From 641e49fe00d3e186ccfaa965861953dfac879334 Mon Sep 17 00:00:00 2001 From: nhammami Date: Mon, 30 Mar 2026 15:31:27 +0100 Subject: [PATCH 1/7] fix: address various accessibility and display issues in library components - Correct display issues in `orange compact` components - Update accessible name for show/hide button in `Password Input` - Ensure hidden passwords are read clearly by screen readers - Fix label for `Suggestion Chip` - Add button role to `Filter Chip` - Add role to `Pin Code Input` digit input - Read helper text with group label in `Pin Code Input` --- app/CHANGELOG.md | 8 + ouds_core/CHANGELOG.md | 8 + .../internal/ouds_button_border_modifier.dart | 2 +- .../lib/components/button/ouds_button.dart | 85 +++++++---- .../internal/ouds_chip_border_modifier.dart | 9 +- .../ouds_chip_icon_style_modifier.dart | 14 +- .../ouds_chip_text_style_modifier.dart | 9 +- .../lib/components/chip/ouds_filter_chip.dart | 66 ++++----- .../components/chip/ouds_suggestion_chip.dart | 80 +++++----- .../password_input/ouds_password_input.dart | 12 +- .../digit_input/ouds_digit_input.dart | 138 +++++++++--------- .../pin_code_input/ouds_pin_code_input.dart | 22 ++- .../lib/l10n/gen/ouds_localizations.dart | 38 ++--- .../lib/l10n/gen/ouds_localizations_ar.dart | 20 +-- .../lib/l10n/gen/ouds_localizations_en.dart | 20 +-- ouds_core/lib/l10n/ouds_flutter_ar.arb | 12 +- ouds_core/lib/l10n/ouds_flutter_en.arb | 13 +- 17 files changed, 295 insertions(+), 261 deletions(-) diff --git a/app/CHANGELOG.md b/app/CHANGELOG.md index 662872fb1..8fe9995a0 100644 --- a/app/CHANGELOG.md +++ b/app/CHANGELOG.md @@ -5,10 +5,18 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). ## [Unreleased](https://github.com/Orange-OpenSource/ouds-flutter/compare/1.1.2...develop) ### Added +- [Library] `Filter chip` Apply high contrast theme to filter chip (selected) ([#494](https://github.com/Orange-OpenSource/ouds-flutter/issues/494)) ### Changed ### Fixed +- [Library] `orange compact` some components are not displayed correctly ([#630](https://github.com/Orange-OpenSource/ouds-flutter/issues/630)) +- [Library] `Password Input` Change the accessible name on show/hide button ([#599](https://github.com/Orange-OpenSource/ouds-flutter/issues/599)) +- [Library] `Password input` Hidden password is clearly read by screen readers([#488](https://github.com/Orange-OpenSource/ouds-flutter/issues/488)) +- [Library] `Suggestion Chip` Wrong label([#519](https://github.com/Orange-OpenSource/ouds-flutter/issues/519)) +- [Library] `Filter Chip` No button role on filter chip([#482](https://github.com/Orange-OpenSource/ouds-flutter/issues/482)) +- [Library] `Pin Code Input` Role is missing on digit code input([#486](https://github.com/Orange-OpenSource/ouds-flutter/issues/486)) +- [Library] `Pin Code Input` Read helper text with the group label([#487](https://github.com/Orange-OpenSource/ouds-flutter/issues/487)) ## [1.1.2](https://github.com/Orange-OpenSource/ouds-flutter/compare/1.1.1...1.1.2) - 2026-03-17 ### Fixed diff --git a/ouds_core/CHANGELOG.md b/ouds_core/CHANGELOG.md index d22df03b6..9abcf6b8f 100644 --- a/ouds_core/CHANGELOG.md +++ b/ouds_core/CHANGELOG.md @@ -6,10 +6,18 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased](https://github.com/Orange-OpenSource/ouds-flutter/compare/1.1.2...develop) ### Added +- [Library] `Filter chip` Apply high contrast theme to filter chip (selected) ([#494](https://github.com/Orange-OpenSource/ouds-flutter/issues/494)) ### Changed ### Fixed +- [Library] `orange compact` some components are not displayed correctly ([#630](https://github.com/Orange-OpenSource/ouds-flutter/issues/630)) +- [Library] `Password Input` Change the accessible name on show/hide button ([#599](https://github.com/Orange-OpenSource/ouds-flutter/issues/599)) +- [Library] `Password input` Hidden password is clearly read by screen readers([#488](https://github.com/Orange-OpenSource/ouds-flutter/issues/488)) +- [Library] `Suggestion Chip` Wrong label([#519](https://github.com/Orange-OpenSource/ouds-flutter/issues/519)) +- [Library] `Filter Chip` No button role on filter chip([#482](https://github.com/Orange-OpenSource/ouds-flutter/issues/482)) +- [Library] `Pin Code Input` Role is missing on digit code input([#486](https://github.com/Orange-OpenSource/ouds-flutter/issues/486)) +- [Library] `Pin Code Input` Read helper text with the group label([#487](https://github.com/Orange-OpenSource/ouds-flutter/issues/487)) ## [1.1.2](https://github.com/Orange-OpenSource/ouds-flutter/compare/1.1.1...1.1.2) - 2026-03-17 ### Fixed diff --git a/ouds_core/lib/components/button/internal/ouds_button_border_modifier.dart b/ouds_core/lib/components/button/internal/ouds_button_border_modifier.dart index 30ccbcb79..c5786ec81 100644 --- a/ouds_core/lib/components/button/internal/ouds_button_border_modifier.dart +++ b/ouds_core/lib/components/button/internal/ouds_button_border_modifier.dart @@ -128,7 +128,7 @@ class OudsButtonBorderModifier { final buttonRounded = OudsThemeConfigModel.of(context)?.button?.rounded ?? false; switch (buttonRounded) { case true: - return button.borderRadiusRounded + OudsTheme.of(context).borderTokens.widthFocus; + return button.borderRadiusRounded + (OudsTheme.of(context).borderTokens.widthFocus / 1.2); case false: return button.borderRadiusDefault ; } diff --git a/ouds_core/lib/components/button/ouds_button.dart b/ouds_core/lib/components/button/ouds_button.dart index ce3c788a7..b0a4b2662 100644 --- a/ouds_core/lib/components/button/ouds_button.dart +++ b/ouds_core/lib/components/button/ouds_button.dart @@ -229,38 +229,69 @@ class _OudsButtonState extends State { debugPrint("Warning: ${e.toString()}"); } - return Container( - decoration: BoxDecoration( - border: OudsBorder().borderAll( - color: _isFocused - ? OudsTheme.of(context).colorScheme(context).borderFocus - : Colors.transparent, - width: borderTokens.widthFocus / 2, - ), - borderRadius: BorderRadiusGeometry.circular( - OudsButtonBorderModifier.getDoubleRadiusFocus(context), - ) - ), - child: Container( - decoration: BoxDecoration( - border: OudsBorder().borderAll( - color: _isFocused - ? OudsTheme.of(context).colorScheme(context).borderFocusInset - : Colors.transparent, - width: borderTokens.widthFocusInset, + // 1. Construisez le bouton de base, sans aucune décoration de focus + final buttonWidget = _buildLayout( + context, + buttonState, + ); + + // 2. Si le bouton a le focus, enveloppez-le dans un Stack pour superposer la bordure + if (_isFocused) { + final oudsTheme = OudsTheme.of(context); + final focusBorderWidth = oudsTheme.borderTokens.widthFocus / 2; + final focusColor = oudsTheme.colorScheme(context).borderFocus; + // Get the button's radius so the focus border matches. + final buttonRadius = BorderRadiusGeometry.circular( + OudsButtonBorderModifier.getDoubleRadiusFocus(context), + ); + + return Stack( + clipBehavior: Clip.none, // Allows the border to overflow slightly if necessary. $ + alignment: Alignment.center, + children: [ + // The button itself. It defines the size of the Stack. + buttonWidget, + + // The focus border, drawn on top. + // IgnorePointer prevents this border from intercepting clicks. + Positioned.fill( + //the focus border should be outside + left: - oudsTheme.borderTokens.widthFocus, + right: - oudsTheme.borderTokens.widthFocus, + bottom: - oudsTheme.borderTokens.widthFocus, + top: - oudsTheme.borderTokens.widthFocus, + child: IgnorePointer( + child: Container( + decoration: BoxDecoration( + border: OudsBorder().borderAll( + color: focusColor, + width: focusBorderWidth, + ), + // The border radius should match the button's radius. + borderRadius: buttonRadius, + ), + child: Container( + decoration: BoxDecoration( + border: OudsBorder().borderAll( + color: OudsTheme.of(context).colorScheme(context).borderFocusInset, + width: borderTokens.widthFocusInset, + ), + borderRadius: BorderRadiusGeometry.circular( + OudsButtonBorderModifier.getDoubleRadiusFocus(context), + ) + ), ), - borderRadius: BorderRadiusGeometry.circular( - OudsButtonBorderModifier.getDoubleRadiusFocus(context), - ) - ), - child: _buildLayout( - context, - buttonState, + ), + ) ), - ), + ], ); } + // 3. If the button is not focused, just return it. + return buttonWidget; + } + Widget _buildLayout( BuildContext context, OudsButtonControlState buttonState, diff --git a/ouds_core/lib/components/chip/internal/ouds_chip_border_modifier.dart b/ouds_core/lib/components/chip/internal/ouds_chip_border_modifier.dart index ebb2015a1..ac00e374f 100644 --- a/ouds_core/lib/components/chip/internal/ouds_chip_border_modifier.dart +++ b/ouds_core/lib/components/chip/internal/ouds_chip_border_modifier.dart @@ -25,13 +25,18 @@ class OudsChipControlBorderModifier { OudsChipControlBorderModifier(this.context); /// Gets the borderSide based on the chip state and whether it is selected - Border? getBorder(OudsChipControlState state, [bool isSelected = false]) { + Border? getBorder(OudsChipControlState state, bool isHighContrast, [bool isSelected = false]) { final chipToken = OudsTheme.of(context).componentsTokens(context).chip; + final highContrastColor = OudsTheme.of(context).colorScheme(context).contentDefault; if (isSelected) { switch (state) { case OudsChipControlState.enabled: - return OudsBorder().borderAll(color: chipToken.colorBorderSelectedEnabled, width: chipToken.borderWidthSelected); + // In order to reach the a11y AAA level, the selected chip is black + return OudsBorder().borderAll(color: isHighContrast + ? highContrastColor + : chipToken.colorBorderSelectedEnabled, + width: chipToken.borderWidthSelected); case OudsChipControlState.disabled: return OudsBorder().borderAll(color: chipToken.colorBorderSelectedDisabled, width: chipToken.borderWidthSelected); case OudsChipControlState.hovered: diff --git a/ouds_core/lib/components/chip/internal/ouds_chip_icon_style_modifier.dart b/ouds_core/lib/components/chip/internal/ouds_chip_icon_style_modifier.dart index e4595bd70..4a3a636c2 100644 --- a/ouds_core/lib/components/chip/internal/ouds_chip_icon_style_modifier.dart +++ b/ouds_core/lib/components/chip/internal/ouds_chip_icon_style_modifier.dart @@ -22,13 +22,17 @@ class OudsChipControlIconColorModifier { OudsChipControlIconColorModifier(this.context); /// Returns the icon color based on chip state and selection - Color getIconColor(OudsChipControlState state, [bool isSelected = false]) { + Color getIconColor(OudsChipControlState state, bool isHighContrast,[bool isSelected = false]) { final chipToken = OudsTheme.of(context).componentsTokens(context).chip; + final highContrastColor = OudsTheme.of(context).colorScheme(context).contentDefault; // Assuming selected icon color == tick color switch (state) { case OudsChipControlState.enabled: - return isSelected ? chipToken.colorContentSelectedEnabled : chipToken.colorContentUnselectedEnabled; + // In order to reach the a11y AAA level, the selected icon chip is black + return isSelected ? (isHighContrast + ? highContrastColor + : chipToken.colorContentSelectedEnabled) : chipToken.colorContentUnselectedEnabled; case OudsChipControlState.disabled: return isSelected ? chipToken.colorContentSelectedDisabled : chipToken.colorContentUnselectedDisabled; case OudsChipControlState.hovered: @@ -41,12 +45,14 @@ class OudsChipControlIconColorModifier { } /// Returns the tick color (always used when selected) - Color getTickColor(OudsChipControlState state) { + Color getTickColor(OudsChipControlState state, bool isHighContrast) { final chipToken = OudsTheme.of(context).componentsTokens(context).chip; + final highContrastColor = OudsTheme.of(context).colorScheme(context).contentDefault; switch (state) { case OudsChipControlState.enabled: - return chipToken.colorContentSelectedTickEnabled; + // In order to reach the a11y AAA level, the tick icon chip is black + return isHighContrast ? highContrastColor : chipToken.colorContentSelectedTickEnabled; case OudsChipControlState.disabled: return chipToken.colorContentSelectedDisabled; case OudsChipControlState.hovered: diff --git a/ouds_core/lib/components/chip/internal/ouds_chip_text_style_modifier.dart b/ouds_core/lib/components/chip/internal/ouds_chip_text_style_modifier.dart index 0074cbdfe..5d375278e 100644 --- a/ouds_core/lib/components/chip/internal/ouds_chip_text_style_modifier.dart +++ b/ouds_core/lib/components/chip/internal/ouds_chip_text_style_modifier.dart @@ -22,13 +22,15 @@ class OudsChipControlTextColorModifier { OudsChipControlTextColorModifier(this.context); /// Returns the text color based on chip state and selection - Color? getTextColor(OudsChipControlState state, [bool isSelected = false]) { + Color? getTextColor(OudsChipControlState state, bool isHighContrast, [bool isSelected = false]) { final chipToken = OudsTheme.of(context).componentsTokens(context).chip; + final highContrastColor = OudsTheme.of(context).colorScheme(context).contentDefault; if (isSelected) { switch (state) { case OudsChipControlState.enabled: - return chipToken.colorContentSelectedEnabled; + // In order to reach the a11y AAA level, the text of selected chip is black + return isHighContrast? highContrastColor : chipToken.colorContentSelectedEnabled; case OudsChipControlState.disabled: return chipToken.colorContentSelectedDisabled; case OudsChipControlState.hovered: @@ -41,7 +43,8 @@ class OudsChipControlTextColorModifier { } else { switch (state) { case OudsChipControlState.enabled: - return chipToken.colorContentUnselectedEnabled; + // In order to reach the a11y AAA level, the text of chip is black + return isHighContrast ? highContrastColor : chipToken.colorContentUnselectedEnabled; case OudsChipControlState.disabled: return chipToken.colorContentUnselectedDisabled; case OudsChipControlState.hovered: diff --git a/ouds_core/lib/components/chip/ouds_filter_chip.dart b/ouds_core/lib/components/chip/ouds_filter_chip.dart index 96fb0d789..5689b9172 100644 --- a/ouds_core/lib/components/chip/ouds_filter_chip.dart +++ b/ouds_core/lib/components/chip/ouds_filter_chip.dart @@ -15,6 +15,7 @@ library; import 'package:flutter/material.dart'; import 'package:flutter/scheduler.dart'; import 'package:flutter_svg/svg.dart'; +import 'package:ouds_accessibility_plugin/ouds_accessibility_plugin.dart'; import 'package:ouds_core/components/chip/internal/ouds_chip_background_modifier.dart'; import 'package:ouds_core/components/chip/internal/ouds_chip_border_modifier.dart'; import 'package:ouds_core/components/chip/internal/ouds_chip_control_state.dart'; @@ -88,12 +89,12 @@ class OudsFilterChip extends StatefulWidget { bool selected, ) { final controlIconModifier = OudsChipControlIconColorModifier(context); - + final sizeIcon = OudsTheme.of(context).componentsTokens(context).chip.sizeIcon; return SvgPicture.asset( assetName, fit: BoxFit.contain, - width: OudsTheme.of(context).componentsTokens(context).chip.sizeIcon, - height: OudsTheme.of(context).componentsTokens(context).chip.sizeIcon, + width: sizeIcon, + height: sizeIcon, colorFilter: ColorFilter.mode( controlIconModifier.getIconColor(controlItemState, selected), //selected always true when buildIcon BlendMode.srcIn, @@ -125,6 +126,7 @@ class _OudsFilterChipState extends State { bool _isFocused = false; bool _isPressed = false; bool _isSelected = false; + bool _isHighContrast = false; @override void initState() { @@ -137,6 +139,16 @@ class _OudsFilterChipState extends State { }); } + @override + void didChangeDependencies() { + super.didChangeDependencies(); + OudsAccessibilityPlugin.isHighContrastEnabled(context).then((value) { + setState(() { + _isHighContrast = value; + }); + }); + } + @override void dispose() { _focusNode.dispose(); @@ -174,10 +186,11 @@ class _OudsFilterChipState extends State { final l10n = OudsLocalizations.of(context); final enabled = widget.onSelected != null; String semanticsLabel = '${widget.selected == true ? l10n?.core_filterChip_selected_a11y : l10n?.core_filterChip_unselected_a11y},' - ' ${widget.label ?? ""}, ' + ' ${widget.label ?? ''}, ${widget.layout == OudsChipLayout.iconOnly ? l10n?.core_chip_chip_icon_a11y : ''},' '${enabled && widget.selected == true ? l10n?.core_filterChip_hint_unselected_a11y : enabled && widget.selected == false ? l10n?.core_filterChip_hint_selected_a11y : ''}'; return Semantics( + button: true, enabled: enabled, label: semanticsLabel, child: ExcludeSemantics( @@ -280,7 +293,7 @@ class _OudsFilterChipState extends State { Positioned.fill( child: Container( decoration: BoxDecoration( - border: chipBorderModifier.getBorder(chipState, widget.selected!), + border: chipBorderModifier.getBorder(chipState, _isHighContrast, widget.selected!), borderRadius: BorderRadius.circular( OudsTheme.of(context).componentsTokens(context).chip.borderRadius, ), @@ -318,7 +331,7 @@ class _OudsFilterChipState extends State { width: chipToken.sizeIcon, height: chipToken.sizeIcon, colorFilter: ColorFilter.mode( - chipIconColorModifier.getTickColor(chipState), + chipIconColorModifier.getTickColor(chipState,_isHighContrast), BlendMode.srcIn, ), ), @@ -348,7 +361,7 @@ class _OudsFilterChipState extends State { Positioned.fill( child: Container( decoration: BoxDecoration( - border: chipBorderModifier.getBorder(chipState, widget.selected!), + border: chipBorderModifier.getBorder(chipState, _isHighContrast, widget.selected!), borderRadius: BorderRadius.circular( OudsTheme.of(context).componentsTokens(context).chip.borderRadius, ), @@ -384,7 +397,7 @@ class _OudsFilterChipState extends State { height: chipToken.sizeIcon, fit: BoxFit.contain, colorFilter: ColorFilter.mode( - chipIconColorModifier.getTickColor(chipState), + chipIconColorModifier.getTickColor(chipState,_isHighContrast), BlendMode.srcIn, ), ), @@ -396,9 +409,9 @@ class _OudsFilterChipState extends State { child: Text( widget.label ?? "", textAlign: TextAlign.center, - style: OudsTheme.of(context).typographyTokens.typeLabelStrongMedium(context) + style: OudsTheme.of(context).typographyTokens.typeLabelModerateMedium(context) .copyWith( - color: chipTextColorModifier.getTextColor(chipState, widget.selected!), + color: chipTextColorModifier.getTextColor(chipState,_isHighContrast, widget.selected!), ) ), ), @@ -429,7 +442,7 @@ class _OudsFilterChipState extends State { child: Container( //color: Colors.red, decoration: BoxDecoration( - border: chipBorderModifier.getBorder(chipState, widget.selected!), + border: chipBorderModifier.getBorder(chipState, _isHighContrast, widget.selected!), borderRadius: BorderRadius.circular( OudsTheme.of(context).componentsTokens(context).chip.borderRadius, ), @@ -464,7 +477,7 @@ class _OudsFilterChipState extends State { package: OudsTheme.of(context).packageName, fit: BoxFit.contain, colorFilter: ColorFilter.mode( - chipIconColorModifier.getTickColor(chipState), + chipIconColorModifier.getTickColor(chipState,_isHighContrast), BlendMode.srcIn, ), ), @@ -476,9 +489,9 @@ class _OudsFilterChipState extends State { child: Text( widget.label ?? "", textAlign: TextAlign.center, - style: OudsTheme.of(context).typographyTokens.typeLabelStrongMedium(context) + style: OudsTheme.of(context).typographyTokens.typeLabelModerateMedium(context) .copyWith( - color: chipTextColorModifier.getTextColor(chipState, widget.selected!), + color: chipTextColorModifier.getTextColor(chipState,_isHighContrast, widget.selected!), ) ), ), @@ -493,33 +506,14 @@ class _OudsFilterChipState extends State { Widget _buildLayout(BuildContext context, OudsChipControlBorderModifier chipBorderModifier, OudsChipControlIconColorModifier chipIconColorModifier, OudsChipControlBackgroundColorModifier chipBgColorModifier, OudsChipControlTextColorModifier chipTextColorModifier, OudsChipControlState chipState, bool isDisabled) { - final l10n = OudsLocalizations.of(context); switch (widget.layout) { case OudsChipLayout.iconOnly: - return Semantics( - label: l10n?.core_chip_chip_icon_a11y, - button: true, - selected: widget.selected, - enabled: widget.onSelected != null, - child: _buildIconOnly(context, chipBorderModifier, chipIconColorModifier, chipBgColorModifier, chipState, isDisabled), - ); + return _buildIconOnly(context, chipBorderModifier, chipIconColorModifier, chipBgColorModifier, chipState, isDisabled); case OudsChipLayout.iconAndText: - return Semantics( - label: l10n?.core_chip_chip_label_a11y, - button: true, - selected: widget.selected, - enabled: widget.onSelected != null, - child: _buildIconAndText(context, chipBorderModifier, chipTextColorModifier, chipIconColorModifier, chipBgColorModifier, chipState, isDisabled), - ); + return _buildIconAndText(context, chipBorderModifier, chipTextColorModifier, chipIconColorModifier, chipBgColorModifier, chipState, isDisabled); case OudsChipLayout.textOnly: - return Semantics( - label: l10n?.core_chip_chip_label_a11y, - button: true, - selected: widget.selected, - enabled: widget.onSelected != null, - child: _buildTextOnly(context, chipBorderModifier, chipTextColorModifier, chipBgColorModifier, chipIconColorModifier, chipState, isDisabled), - ); + return _buildTextOnly(context, chipBorderModifier, chipTextColorModifier, chipBgColorModifier, chipIconColorModifier, chipState, isDisabled); } } diff --git a/ouds_core/lib/components/chip/ouds_suggestion_chip.dart b/ouds_core/lib/components/chip/ouds_suggestion_chip.dart index 8a8d9cd6f..7797ea0cd 100644 --- a/ouds_core/lib/components/chip/ouds_suggestion_chip.dart +++ b/ouds_core/lib/components/chip/ouds_suggestion_chip.dart @@ -14,6 +14,7 @@ library; import 'package:flutter/material.dart'; import 'package:flutter_svg/svg.dart'; +import 'package:ouds_accessibility_plugin/ouds_accessibility_plugin.dart'; import 'package:ouds_core/components/chip/internal/ouds_chip_border_modifier.dart'; import 'package:ouds_core/components/chip/internal/ouds_chip_control_state.dart'; import 'package:ouds_core/components/chip/internal/ouds_chip_icon_style_modifier.dart'; @@ -82,25 +83,6 @@ class OudsSuggestionChip extends StatefulWidget { this.onPressed, }); - static Widget buildIcon( - BuildContext context, - String assetName, - OudsChipControlState controlItemState, - ) { - final controlIconModifier = OudsChipControlIconColorModifier(context); - - return SvgPicture.asset( - assetName, - fit: BoxFit.contain, - width: OudsTheme.of(context).componentsTokens(context).chip.sizeIcon, - height: OudsTheme.of(context).componentsTokens(context).chip.sizeIcon, - colorFilter: ColorFilter.mode( - controlIconModifier.getIconColor(controlItemState), - BlendMode.srcIn, - ), - ); - } - @override State createState() => _OudsSuggestionChipState(); @@ -124,6 +106,7 @@ class _OudsSuggestionChipState extends State { bool _isHovered = false; bool _isPressed = false; bool _isFocused = false; + bool _isHighContrast = false; @override void initState() { @@ -136,6 +119,16 @@ class _OudsSuggestionChipState extends State { }); } + @override + void didChangeDependencies() { + super.didChangeDependencies(); + OudsAccessibilityPlugin.isHighContrastEnabled(context).then((value) { + setState(() { + _isHighContrast = true; + }); + }); + } + @override void dispose() { _focusNode.dispose(); @@ -286,7 +279,7 @@ class _OudsSuggestionChipState extends State { Positioned.fill( child: Container( decoration: BoxDecoration( - border: chipBorderModifier.getBorder(chipState), + border: chipBorderModifier.getBorder(chipState,_isHighContrast), borderRadius: BorderRadius.circular( OudsTheme.of(context).componentsTokens(context).chip.borderRadius, ), @@ -311,7 +304,7 @@ class _OudsSuggestionChipState extends State { crossAxisAlignment: CrossAxisAlignment.center, children: [ ExcludeSemantics( - child: OudsSuggestionChip.buildIcon( + child: _buildIcon( context, widget.avatar!, chipState, @@ -329,10 +322,8 @@ class _OudsSuggestionChipState extends State { Widget _buildChipIconAndText(BuildContext context, OudsChipControlBorderModifier chipBorderModifier, OudsChipControlTextColorModifier chipTextColorModifier, OudsChipControlIconColorModifier chipIconColorModifier, OudsChipControlBackgroundColorModifier chipBgColorModifier, OudsChipControlState chipState, bool isDisabled) { final chipToken = OudsTheme.of(context).componentsTokens(context).chip; - final l10n = OudsLocalizations.of(context); return Semantics( - label: l10n?.core_chip_chip_label_a11y, button: true, enabled: widget.onPressed != null, child: Stack( @@ -344,7 +335,7 @@ class _OudsSuggestionChipState extends State { Positioned.fill( child: Container( decoration: BoxDecoration( - border: chipBorderModifier.getBorder(chipState), + border: chipBorderModifier.getBorder(chipState,_isHighContrast), borderRadius: BorderRadius.circular( OudsTheme.of(context).componentsTokens(context).chip.borderRadius, ), @@ -370,19 +361,17 @@ class _OudsSuggestionChipState extends State { crossAxisAlignment: CrossAxisAlignment.center, children: [ ExcludeSemantics( - child: OudsSuggestionChip.buildIcon(context, widget.avatar!, chipState), + child: _buildIcon(context, widget.avatar!, chipState), ), SizedBox(width: chipToken.spaceColumnGapIcon), Flexible( - child: ExcludeSemantics( - child: Text( + child: Text( widget.label ?? "", textAlign: TextAlign.center, - style: OudsTheme.of(context).typographyTokens.typeLabelStrongMedium(context).copyWith( - color: chipTextColorModifier.getTextColor(chipState), + style: OudsTheme.of(context).typographyTokens.typeLabelModerateMedium(context).copyWith( + color: chipTextColorModifier.getTextColor(chipState,_isHighContrast), ), ), - ), ), ], ), @@ -396,10 +385,8 @@ class _OudsSuggestionChipState extends State { Widget _buildChipTextOnly( BuildContext context, OudsChipControlBorderModifier chipBorderModifier, OudsChipControlTextColorModifier chipTextColorModifier, OudsChipControlBackgroundColorModifier chipBgColorModifier, OudsChipControlState chipState, bool isDisabled) { final chipToken = OudsTheme.of(context).componentsTokens(context).chip; - final l10n = OudsLocalizations.of(context); return Semantics( - label: l10n?.core_chip_chip_label_a11y, button: true, enabled: widget.onPressed != null, child: Stack( @@ -411,7 +398,7 @@ class _OudsSuggestionChipState extends State { Positioned.fill( child: Container( decoration: BoxDecoration( - border: chipBorderModifier.getBorder(chipState), + border: chipBorderModifier.getBorder(chipState,_isHighContrast), borderRadius: BorderRadius.circular( OudsTheme.of(context).componentsTokens(context).chip.borderRadius, ), @@ -435,15 +422,13 @@ class _OudsSuggestionChipState extends State { crossAxisAlignment: CrossAxisAlignment.center, children: [ Flexible( - child: ExcludeSemantics( - child: Text( + child: Text( widget.label ?? "", textAlign: TextAlign.center, - style: OudsTheme.of(context).typographyTokens.typeLabelStrongMedium(context).copyWith( - color: chipTextColorModifier.getTextColor(chipState), + style: OudsTheme.of(context).typographyTokens.typeLabelModerateMedium(context).copyWith( + color: chipTextColorModifier.getTextColor(chipState,_isHighContrast), ), ), - ), ), ], ), @@ -453,4 +438,23 @@ class _OudsSuggestionChipState extends State { ), ); } + + Widget _buildIcon( + BuildContext context, + String assetName, + OudsChipControlState controlItemState, + ) { + final controlIconModifier = OudsChipControlIconColorModifier(context); + + return SvgPicture.asset( + assetName, + fit: BoxFit.contain, + width: OudsTheme.of(context).componentsTokens(context).chip.sizeIcon, + height: OudsTheme.of(context).componentsTokens(context).chip.sizeIcon, + colorFilter: ColorFilter.mode( + controlIconModifier.getIconColor(controlItemState, _isHighContrast), + BlendMode.srcIn, + ), + ); + } } diff --git a/ouds_core/lib/components/form_input/password_input/ouds_password_input.dart b/ouds_core/lib/components/form_input/password_input/ouds_password_input.dart index f8fd8ae37..bf178c0cf 100644 --- a/ouds_core/lib/components/form_input/password_input/ouds_password_input.dart +++ b/ouds_core/lib/components/form_input/password_input/ouds_password_input.dart @@ -223,14 +223,17 @@ class _OudsPasswordInputState extends State { final l10n = OudsLocalizations.of(context); - final contentText = widget.controller?.text; - final prefixText = contentText != null && contentText.isNotEmpty ? ", ${widget.decoration.prefix ?? ""}" : ""; + // Conditionally get the content text. + // Only include the password's text if it is NOT hidden. + // Otherwise, use an empty string so it is not read by the screen reader. + final contentText = !_isPasswordHidden ? widget.controller?.text : ""; + final prefixText = widget.controller != null && widget.controller!.text.isNotEmpty ? ", ${widget.decoration.prefix ?? ""}" : ""; final helperText = isError ? widget.decoration.errorText : widget.decoration.helperText ?? ""; return Semantics( label: "${l10n?.core_textInput_trait_a11y}," " ${widget.decoration.labelText ?? ""} " - "$prefixText $contentText, $helperText, " + " $prefixText $contentText, $helperText, " "${widget.enabled == false || widget.readOnly == true ? l10n?.core_common_disabled_a11y : ""}", value: isError ? l10n?.core_common_onError_a11y : null, hint: l10n?.core_common_hint_a11y, @@ -549,8 +552,7 @@ class _OudsPasswordInputState extends State { Semantics( container: true, button: true, - label: _isPasswordHidden ? l10n?.core_password_input_hidden_a11y : l10n?.core_password_input_visible_a11y, - hint: _isPasswordHidden ? l10n?.core_password_input_hint_show_a11y : l10n?.core_password_input_hint_hide_a11y, + label: _isPasswordHidden ? l10n?.core_passwordInput_showPassword_a11y : l10n?.core_passwordInput_hidePassword_a11y, child: ExcludeSemantics( child: OudsButton( appearance: OudsButtonAppearance.minimal, diff --git a/ouds_core/lib/components/pin_code_input/digit_input/ouds_digit_input.dart b/ouds_core/lib/components/pin_code_input/digit_input/ouds_digit_input.dart index f855dc7ad..37dbccff8 100644 --- a/ouds_core/lib/components/pin_code_input/digit_input/ouds_digit_input.dart +++ b/ouds_core/lib/components/pin_code_input/digit_input/ouds_digit_input.dart @@ -152,81 +152,79 @@ class _OudsDigitInputState extends State { isHovered: _isHovered, ).determineControlState(); - return InkWell( - onHover: (hovering) { - if (!mounted) return; - setState(() { - _isHovered = hovering; - }); - }, - child: Container( - constraints: BoxConstraints(minHeight: textInputToken.sizeMinHeight, maxWidth: pinCodeToken.sizeMaxWidth, minWidth: pinCodeToken.sizeMinWidth), + return ExcludeSemantics( + child: InkWell( + onHover: (hovering) { + if (!mounted) return; + setState(() { + _isHovered = hovering; + }); + }, child: Container( - constraints: BoxConstraints(minHeight: textInputToken.sizeMinHeight), - padding: EdgeInsets.only( - top: textInputToken.spacePaddingBlockDefault, - bottom: textInputToken.spacePaddingBlockDefault, - right: widget.length == OudsPinCodeInputLength.eight ? 0 : textInputToken.spacePaddingInlineDefault, - left: widget.length == OudsPinCodeInputLength.eight ? 0 : textInputToken.spacePaddingInlineDefault, - ), - decoration: BoxDecoration( - color: pinCodeInputBackgroundModifier.getPinCodeBackgroundColor(state, widget.isError, widget.digitInputDecoration!.isOutlined), - border: pinCodeInputBorderModifier.getPinCodeBorder(state, widget.isError, widget.digitInputDecoration!.isOutlined), - borderRadius: textInputBorderModifier.getBorderRadius(context), - ), - child: KeyboardListener( - focusNode: _keyboardFocusNode, - onKeyEvent: (KeyEvent event) { - if (event is KeyDownEvent && event.logicalKey == LogicalKeyboardKey.backspace) { - final text = widget.controller?.text ?? ''; - // If the field is empty and the user presses backspace : move to the previous one - if (text.isEmpty) { - final previousIndex = widget.index - 1; - if (previousIndex >= 0) { - widget.controller?.clear(); - FocusScope.of(context).previousFocus(); + height: textInputToken.sizeMinHeight, + constraints: BoxConstraints( + maxWidth: pinCodeToken.sizeMaxWidth, + minWidth: pinCodeToken.sizeMinWidth), + decoration: BoxDecoration( + color: pinCodeInputBackgroundModifier.getPinCodeBackgroundColor(state, widget.isError, widget.digitInputDecoration!.isOutlined), + border: pinCodeInputBorderModifier.getPinCodeBorder(state, widget.isError, widget.digitInputDecoration!.isOutlined), + borderRadius: textInputBorderModifier.getBorderRadius(context), + ), + child: Center( + child: KeyboardListener( + focusNode: _keyboardFocusNode, + onKeyEvent: (KeyEvent event) { + if (event is KeyDownEvent && event.logicalKey == LogicalKeyboardKey.backspace) { + final text = widget.controller?.text ?? ''; + // If the field is empty and the user presses backspace : move to the previous one + if (text.isEmpty) { + final previousIndex = widget.index - 1; + if (previousIndex >= 0) { + widget.controller?.clear(); + FocusScope.of(context).previousFocus(); + } + } } - } - } - }, - child: TextField( - cursorHeight: theme.fontTokens.lineHeightLabelLarge, - obscureText: widget.digitInputDecoration!.hiddenPassword, - obscuringCharacter: "●", - style: theme.typographyTokens.typeLabelDefaultLarge(context).copyWith( - color: theme.colorScheme(context).contentDefault, + }, + child: TextField( + cursorHeight: theme.fontTokens.lineHeightLabelLarge, + obscureText: widget.digitInputDecoration!.hiddenPassword, + obscuringCharacter: "●", + style: theme.typographyTokens.typeLabelDefaultLarge(context).copyWith( + color: theme.colorScheme(context).contentDefault, + ), + cursorColor: pinCodeInputTextModifier.getPinCodeCursorColor(widget.isError), + controller: widget.controller, + focusNode: widget.focusNode, + keyboardType: TextInputType.number, + textAlign: TextAlign.center, + maxLines: 1, + buildCounter: (_, {required currentLength, required isFocused, required maxLength}) => null, // to hide the counter + decoration: InputDecoration( + border: InputBorder.none, + enabledBorder: InputBorder.none, + focusedBorder: InputBorder.none, + contentPadding: EdgeInsets.zero, + counterText: '', + hintText: widget.digitInputDecoration?.hintText, + hintStyle: theme.typographyTokens.typeLabelDefaultLarge(context).copyWith( + color: theme.colorScheme(context).contentMuted, + ), // remove internal padding ), - cursorColor: pinCodeInputTextModifier.getPinCodeCursorColor(widget.isError), - controller: widget.controller, - focusNode: widget.focusNode, - keyboardType: TextInputType.number, - textAlign: TextAlign.center, - maxLines: 1, - buildCounter: (_, {required currentLength, required isFocused, required maxLength}) => null, // to hide the counter - decoration: InputDecoration( - border: InputBorder.none, - enabledBorder: InputBorder.none, - focusedBorder: InputBorder.none, - contentPadding: EdgeInsets.zero, - counterText: '', - hintText: widget.digitInputDecoration?.hintText, - hintStyle: theme.typographyTokens.typeLabelDefaultLarge(context).copyWith( - color: theme.colorScheme(context).contentMuted, - ), // remove internal padding + onChanged: (value) { + widget.onChanged!(value, widget.index); + setState(() {}); + }, + onTap: () { + //cursor should be always at the end of digit input + final text = widget.controller?.text; + widget.controller?.selection = TextSelection.fromPosition( + TextPosition(offset: text!.length), + ); + }, + ), ), - onChanged: (value) { - widget.onChanged!(value, widget.index); - setState(() {}); - }, - onTap: () { - //cursor should be always at the end of digit input - final text = widget.controller?.text; - widget.controller?.selection = TextSelection.fromPosition( - TextPosition(offset: text!.length), - ); - }, ), - ), ), ), ); diff --git a/ouds_core/lib/components/pin_code_input/ouds_pin_code_input.dart b/ouds_core/lib/components/pin_code_input/ouds_pin_code_input.dart index f0d770bf4..a9fc08954 100644 --- a/ouds_core/lib/components/pin_code_input/ouds_pin_code_input.dart +++ b/ouds_core/lib/components/pin_code_input/ouds_pin_code_input.dart @@ -180,6 +180,8 @@ class _OudsPinCodeInputState extends State { final digitsCount = widget.length.digits; final isError = widget.errorText != null || (widget.errorText != null && widget.errorText!.isEmpty); final l10n = OudsLocalizations.of(context); + final hintSemanticText = "${ widget.errorText != null && isError ? widget.errorText! : widget.helperText != null ? widget.helperText! : ''}" + " , ${l10n?.core_common_hint_a11y}"; return Container( constraints: BoxConstraints( @@ -191,7 +193,7 @@ class _OudsPinCodeInputState extends State { mainAxisAlignment: widget.digitInputDecoration.constrainedMaxWidth ? MainAxisAlignment.start : MainAxisAlignment.center, children: [ Semantics( - hint: l10n?.core_common_hint_a11y, + hint: hintSemanticText, label: isError ? l10n?.core_common_onError_a11y : l10n?.core_pinCodeInput_pinCode_label_a11y(digitsCount), child: Row( mainAxisAlignment: widget.digitInputDecoration.constrainedMaxWidth ? MainAxisAlignment.start : MainAxisAlignment.center, @@ -201,7 +203,9 @@ class _OudsPinCodeInputState extends State { fit: FlexFit.loose, child: Semantics( liveRegion: true, - label: l10n?.core_pinCodeInput_digitCode_label_a11y(index + 1), + label: "${l10n?.core_pinCodeInput_digitCode_label_a11y(index + 1)}, " + "${!widget.digitInputDecoration.hiddenPassword && widget.controllers != null? widget.controllers![index].text : ''}, " + "${l10n?.core_pinCodeInput_trait_a11y}", child: OudsDigitInput( index: index, isError: isError, @@ -239,12 +243,14 @@ class _OudsPinCodeInputState extends State { ), child: Align( alignment: AlignmentDirectional.centerStart, - child: Text( - softWrap: true, - widget.errorText != null && isError ? widget.errorText! : widget.helperText!, - style: theme.typographyTokens.typeLabelDefaultMedium(context).copyWith( - color: OudsPinCodeInputTextColorModifier(context).getPinCodeHelperTextColor(isError), - ), + child: ExcludeSemantics( + child: Text( + softWrap: true, + widget.errorText != null && isError ? widget.errorText! : widget.helperText!, + style: theme.typographyTokens.typeLabelDefaultMedium(context).copyWith( + color: OudsPinCodeInputTextColorModifier(context).getPinCodeHelperTextColor(isError), + ), + ), ), ), ), diff --git a/ouds_core/lib/l10n/gen/ouds_localizations.dart b/ouds_core/lib/l10n/gen/ouds_localizations.dart index afdbc4dbd..d077b86cb 100644 --- a/ouds_core/lib/l10n/gen/ouds_localizations.dart +++ b/ouds_core/lib/l10n/gen/ouds_localizations.dart @@ -191,16 +191,10 @@ abstract class OudsLocalizations { /// **'Double-tap to select'** String get core_filterChip_hint_selected_a11y; - /// No description provided for @core_chip_chip_label_a11y. - /// - /// In en, this message translates to: - /// **'Chip label'** - String get core_chip_chip_label_a11y; - /// No description provided for @core_chip_chip_icon_a11y. /// /// In en, this message translates to: - /// **'Chip icon'** + /// **'Icon'** String get core_chip_chip_icon_a11y; /// No description provided for @core_checkbox_trait_a11y. @@ -293,29 +287,17 @@ abstract class OudsLocalizations { /// **'Double tap to select country'** String get core_phoneNumberInput_countrySelector_hint_a11y; - /// No description provided for @core_password_input_hidden_a11y. - /// - /// In en, this message translates to: - /// **'Password hidden'** - String get core_password_input_hidden_a11y; - - /// No description provided for @core_password_input_visible_a11y. + /// No description provided for @core_passwordInput_showPassword_a11y. /// /// In en, this message translates to: - /// **'Password visible'** - String get core_password_input_visible_a11y; + /// **'Show password'** + String get core_passwordInput_showPassword_a11y; - /// No description provided for @core_password_input_hint_show_a11y. + /// No description provided for @core_passwordInput_hidePassword_a11y. /// /// In en, this message translates to: - /// **'Double tap to show password'** - String get core_password_input_hint_show_a11y; - - /// No description provided for @core_password_input_hint_hide_a11y. - /// - /// In en, this message translates to: - /// **'Double tap to hide password'** - String get core_password_input_hint_hide_a11y; + /// **'Hide password'** + String get core_passwordInput_hidePassword_a11y; /// No description provided for @core_pinCodeInput_digitCode_label_a11y. /// @@ -328,6 +310,12 @@ abstract class OudsLocalizations { /// In en, this message translates to: /// **'Enter your {digitsCount}-digit code'** String core_pinCodeInput_pinCode_label_a11y(Object digitsCount); + + /// No description provided for @core_pinCodeInput_trait_a11y. + /// + /// In en, this message translates to: + /// **'EditBox'** + String get core_pinCodeInput_trait_a11y; } class _OudsLocalizationsDelegate diff --git a/ouds_core/lib/l10n/gen/ouds_localizations_ar.dart b/ouds_core/lib/l10n/gen/ouds_localizations_ar.dart index c892ce100..4f85afb3c 100644 --- a/ouds_core/lib/l10n/gen/ouds_localizations_ar.dart +++ b/ouds_core/lib/l10n/gen/ouds_localizations_ar.dart @@ -58,10 +58,7 @@ class OudsLocalizationsAr extends OudsLocalizations { String get core_filterChip_hint_selected_a11y => 'Double-tap to select'; @override - String get core_chip_chip_label_a11y => 'تسمية الشارة'; - - @override - String get core_chip_chip_icon_a11y => 'أيقونة الشارة'; + String get core_chip_chip_icon_a11y => 'أيقونة'; @override String get core_checkbox_trait_a11y => 'خانة الاختيار'; @@ -112,18 +109,10 @@ class OudsLocalizationsAr extends OudsLocalizations { 'اضغط مرتين لتحديد البلد'; @override - String get core_password_input_hidden_a11y => 'كلمة المرور مخفية'; - - @override - String get core_password_input_visible_a11y => 'كلمة المرور ظاهرة'; + String get core_passwordInput_showPassword_a11y => 'عرض كلمة المرور'; @override - String get core_password_input_hint_show_a11y => - 'اضغط مرتين لإظهار كلمة المرور'; - - @override - String get core_password_input_hint_hide_a11y => - 'اضغط مرتين لإخفاء كلمة المرور'; + String get core_passwordInput_hidePassword_a11y => 'إخفاء كلمة المرو'; @override String core_pinCodeInput_digitCode_label_a11y(Object current) { @@ -134,4 +123,7 @@ class OudsLocalizationsAr extends OudsLocalizations { String core_pinCodeInput_pinCode_label_a11y(Object digitsCount) { return 'أدخل رمزك المكوّن من $digitsCount أرقام'; } + + @override + String get core_pinCodeInput_trait_a11y => 'حقل النص'; } diff --git a/ouds_core/lib/l10n/gen/ouds_localizations_en.dart b/ouds_core/lib/l10n/gen/ouds_localizations_en.dart index 30e70157b..6746bf823 100644 --- a/ouds_core/lib/l10n/gen/ouds_localizations_en.dart +++ b/ouds_core/lib/l10n/gen/ouds_localizations_en.dart @@ -58,10 +58,7 @@ class OudsLocalizationsEn extends OudsLocalizations { String get core_filterChip_hint_selected_a11y => 'Double-tap to select'; @override - String get core_chip_chip_label_a11y => 'Chip label'; - - @override - String get core_chip_chip_icon_a11y => 'Chip icon'; + String get core_chip_chip_icon_a11y => 'Icon'; @override String get core_checkbox_trait_a11y => 'Checkbox'; @@ -112,18 +109,10 @@ class OudsLocalizationsEn extends OudsLocalizations { 'Double tap to select country'; @override - String get core_password_input_hidden_a11y => 'Password hidden'; - - @override - String get core_password_input_visible_a11y => 'Password visible'; + String get core_passwordInput_showPassword_a11y => 'Show password'; @override - String get core_password_input_hint_show_a11y => - 'Double tap to show password'; - - @override - String get core_password_input_hint_hide_a11y => - 'Double tap to hide password'; + String get core_passwordInput_hidePassword_a11y => 'Hide password'; @override String core_pinCodeInput_digitCode_label_a11y(Object current) { @@ -134,4 +123,7 @@ class OudsLocalizationsEn extends OudsLocalizations { String core_pinCodeInput_pinCode_label_a11y(Object digitsCount) { return 'Enter your $digitsCount-digit code'; } + + @override + String get core_pinCodeInput_trait_a11y => 'EditBox'; } diff --git a/ouds_core/lib/l10n/ouds_flutter_ar.arb b/ouds_core/lib/l10n/ouds_flutter_ar.arb index a6b8a97a0..b10cb822f 100644 --- a/ouds_core/lib/l10n/ouds_flutter_ar.arb +++ b/ouds_core/lib/l10n/ouds_flutter_ar.arb @@ -21,8 +21,7 @@ "core_chip_unselected_a11y": "غير محدد", "core_chip_unselectAction_a11y": "انقر مرتين لإلغاء التحديد", "core_chip_selectAction_a11y": "انقر مرتين لتحديد", - "core_chip_chip_label_a11y": "تسمية الشارة", - "core_chip_chip_icon_a11y": "أيقونة الشارة", + "core_chip_chip_icon_a11y": "أيقونة", "@_OUDS_Checkbox": {}, "core_checkbox_trait_a11y": "خانة الاختيار", @@ -54,12 +53,11 @@ "core_phoneNumberInput_countrySelector_hint_a11y": "اضغط مرتين لتحديد البلد", "@_OUDS_PASSWORD_INPUT": {}, - "core_password_input_hidden_a11y": "كلمة المرور مخفية", - "core_password_input_visible_a11y": "كلمة المرور ظاهرة", - "core_password_input_hint_show_a11y": "اضغط مرتين لإظهار كلمة المرور", - "core_password_input_hint_hide_a11y": "اضغط مرتين لإخفاء كلمة المرور", + "core_passwordInput_showPassword_a11y": "عرض كلمة المرور", + "core_passwordInput_hidePassword_a11y": "إخفاء كلمة المرو", "@_OUDS_PIN_CODE_INPUT": {}, "core_pinCodeInput_digitCode_label_a11y": "الرقم {current}", - "core_pinCodeInput_pinCode_label_a11y": "أدخل رمزك المكوّن من {digitsCount} أرقام" + "core_pinCodeInput_pinCode_label_a11y": "أدخل رمزك المكوّن من {digitsCount} أرقام", + "core_pinCodeInput_trait_a11y": "حقل النص" } \ No newline at end of file diff --git a/ouds_core/lib/l10n/ouds_flutter_en.arb b/ouds_core/lib/l10n/ouds_flutter_en.arb index f6c024cd2..ff36e6133 100644 --- a/ouds_core/lib/l10n/ouds_flutter_en.arb +++ b/ouds_core/lib/l10n/ouds_flutter_en.arb @@ -21,8 +21,7 @@ "core_filterChip_unselected_a11y": "Unselected", "core_filterChip_hint_unselected_a11y": "Double-tap to unselect", "core_filterChip_hint_selected_a11y": "Double-tap to select", - "core_chip_chip_label_a11y": "Chip label", - "core_chip_chip_icon_a11y": "Chip icon", + "core_chip_chip_icon_a11y": "Icon", "@_OUDS_Checkbox": {}, "core_checkbox_trait_a11y": "Checkbox", @@ -52,12 +51,12 @@ "core_phoneNumberInput_countrySelector_hint_a11y": "Double tap to select country", "@_OUDS_PASSWORD_INPUT": {}, - "core_password_input_hidden_a11y": "Password hidden", - "core_password_input_visible_a11y": "Password visible", - "core_password_input_hint_show_a11y": "Double tap to show password", - "core_password_input_hint_hide_a11y": "Double tap to hide password", + "core_passwordInput_showPassword_a11y": "Show password", + "core_passwordInput_hidePassword_a11y": "Hide password", + "@_OUDS_PIN_CODE_INPUT": {}, "core_pinCodeInput_digitCode_label_a11y": "Digit code {current}", - "core_pinCodeInput_pinCode_label_a11y": "Enter your {digitsCount}-digit code" + "core_pinCodeInput_pinCode_label_a11y": "Enter your {digitsCount}-digit code", + "core_pinCodeInput_trait_a11y": "EditBox" } \ No newline at end of file From d9faf85dd53ce5a29bcb05c6cf961d0ed40740a2 Mon Sep 17 00:00:00 2001 From: nhammami Date: Wed, 1 Apr 2026 17:41:55 +0100 Subject: [PATCH 2/7] review: fix focus and text style --- .../internal/ouds_button_border_modifier.dart | 12 +++--- .../internal/ouds_button_style_modifier.dart | 3 -- .../lib/components/button/ouds_button.dart | 42 +++++++------------ 3 files changed, 22 insertions(+), 35 deletions(-) diff --git a/ouds_core/lib/components/button/internal/ouds_button_border_modifier.dart b/ouds_core/lib/components/button/internal/ouds_button_border_modifier.dart index c5786ec81..d17020c53 100644 --- a/ouds_core/lib/components/button/internal/ouds_button_border_modifier.dart +++ b/ouds_core/lib/components/button/internal/ouds_button_border_modifier.dart @@ -32,13 +32,13 @@ class OudsButtonBorderModifier { if (buttonState == OudsButtonControlState.loading) { return OudsButtonLoadingModifier.getBorderColor(context, appearance); } - if (states.contains(WidgetState.pressed)) { + if (states.contains(WidgetState.pressed) || (buttonState != null && buttonState == OudsButtonControlState.pressed)) { return _getPressedBorderColor(context, appearance); } else if (states.contains(WidgetState.hovered)) { return _getHoverBorderColor(context, appearance); } else if (states.contains(WidgetState.disabled)) { return _getDisabledBorderColor(context, appearance); - } else if (states.contains(WidgetState.focused)) { + } else if (states.contains(WidgetState.focused) || (buttonState != null && buttonState == OudsButtonControlState.focused)) { return _getFocusedBorderColor(context, appearance); } return _getEnabledBorderColor(context, appearance); @@ -123,14 +123,16 @@ class OudsButtonBorderModifier { } } - static double getDoubleRadiusFocus(BuildContext context) { + /// Static method to get the border radius for a button in focus state based on the border parameter. + /// Returns a [BorderRadius] object with the appropriate radius value. + static BorderRadius getBorderRadiusFocus(BuildContext context) { final button = OudsTheme.of(context).componentsTokens(context).button; final buttonRounded = OudsThemeConfigModel.of(context)?.button?.rounded ?? false; switch (buttonRounded) { case true: - return button.borderRadiusRounded + (OudsTheme.of(context).borderTokens.widthFocus / 1.2); + return BorderRadius.circular(button.borderRadiusRounded + (OudsTheme.of(context).borderTokens.widthFocus / 1.2)); case false: - return button.borderRadiusDefault ; + return BorderRadius.circular(button.borderRadiusDefault ) ; } } } diff --git a/ouds_core/lib/components/button/internal/ouds_button_style_modifier.dart b/ouds_core/lib/components/button/internal/ouds_button_style_modifier.dart index 325338901..d5fe9d74c 100644 --- a/ouds_core/lib/components/button/internal/ouds_button_style_modifier.dart +++ b/ouds_core/lib/components/button/internal/ouds_button_style_modifier.dart @@ -34,9 +34,6 @@ class OudsButtonStyleModifier { foregroundColor: OudsButtonForegroundModifier.resolveForegroundColor(context, appearance, buttonState), splashFactory: NoSplash.splashFactory, overlayColor: WidgetStateProperty.all(Colors.transparent), - textStyle: WidgetStateProperty.all( - OudsTheme.of(context).typographyTokens.typeLabelStrongLarge(context), - ), side: OudsButtonBorderModifier.resolveBorderColor(context, appearance, buttonState), shape: WidgetStateProperty.all( RoundedRectangleBorder( diff --git a/ouds_core/lib/components/button/ouds_button.dart b/ouds_core/lib/components/button/ouds_button.dart index b0a4b2662..8316f17d5 100644 --- a/ouds_core/lib/components/button/ouds_button.dart +++ b/ouds_core/lib/components/button/ouds_button.dart @@ -229,28 +229,17 @@ class _OudsButtonState extends State { debugPrint("Warning: ${e.toString()}"); } - // 1. Construisez le bouton de base, sans aucune décoration de focus - final buttonWidget = _buildLayout( - context, - buttonState, - ); - - // 2. Si le bouton a le focus, enveloppez-le dans un Stack pour superposer la bordure - if (_isFocused) { final oudsTheme = OudsTheme.of(context); - final focusBorderWidth = oudsTheme.borderTokens.widthFocus / 2; - final focusColor = oudsTheme.colorScheme(context).borderFocus; // Get the button's radius so the focus border matches. - final buttonRadius = BorderRadiusGeometry.circular( - OudsButtonBorderModifier.getDoubleRadiusFocus(context), - ); + final buttonBorderRadius = OudsButtonBorderModifier.getBorderRadiusFocus(context); - return Stack( - clipBehavior: Clip.none, // Allows the border to overflow slightly if necessary. $ + return _isFocused + ? Stack( + clipBehavior: Clip.none, // Allows the border to overflow slightly if necessary. alignment: Alignment.center, children: [ // The button itself. It defines the size of the Stack. - buttonWidget, + _buildLayout(context, buttonState), // The focus border, drawn on top. // IgnorePointer prevents this border from intercepting clicks. @@ -264,11 +253,11 @@ class _OudsButtonState extends State { child: Container( decoration: BoxDecoration( border: OudsBorder().borderAll( - color: focusColor, - width: focusBorderWidth, + color: oudsTheme.colorScheme(context).borderFocus, + width: oudsTheme.borderTokens.widthFocus / 2, ), // The border radius should match the button's radius. - borderRadius: buttonRadius, + borderRadius: buttonBorderRadius, ), child: Container( decoration: BoxDecoration( @@ -276,20 +265,17 @@ class _OudsButtonState extends State { color: OudsTheme.of(context).colorScheme(context).borderFocusInset, width: borderTokens.widthFocusInset, ), - borderRadius: BorderRadiusGeometry.circular( - OudsButtonBorderModifier.getDoubleRadiusFocus(context), - ) + borderRadius: buttonBorderRadius ), ), ), ) ), ], - ); - } - - // 3. If the button is not focused, just return it. - return buttonWidget; + ) : _buildLayout( + context, + buttonState, + ); } Widget _buildLayout( @@ -383,6 +369,7 @@ class _OudsButtonState extends State { child: Text( widget.label ?? "", textAlign: TextAlign.center, + style: OudsTheme.of(context).typographyTokens.typeLabelStrongLarge(context), ), ), ], @@ -487,6 +474,7 @@ class _OudsButtonState extends State { child: Text( widget.label ?? "", textAlign: TextAlign.center, + style: OudsTheme.of(context).typographyTokens.typeLabelStrongLarge(context), ), ); return _wrapFullWidth(buttonTextOnly); From 47eff652953bfa75142259e4ef373ea124eacdae Mon Sep 17 00:00:00 2001 From: nhammami Date: Thu, 2 Apr 2026 10:48:00 +0100 Subject: [PATCH 3/7] review: add a comment in code --- ouds_core/lib/components/chip/ouds_suggestion_chip.dart | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ouds_core/lib/components/chip/ouds_suggestion_chip.dart b/ouds_core/lib/components/chip/ouds_suggestion_chip.dart index 7797ea0cd..771d7160b 100644 --- a/ouds_core/lib/components/chip/ouds_suggestion_chip.dart +++ b/ouds_core/lib/components/chip/ouds_suggestion_chip.dart @@ -439,6 +439,8 @@ class _OudsSuggestionChipState extends State { ); } + /// Constructs and returns an SVG icon widget, styled according to the current control state and theme, + /// with appropriate size and color filtering. Widget _buildIcon( BuildContext context, String assetName, From 825ccdb19966b98c7c1c29ba9177d1cf0429dd17 Mon Sep 17 00:00:00 2001 From: nhammami Date: Fri, 10 Apr 2026 22:38:15 +0100 Subject: [PATCH 4/7] review: fix bullet in tag --- NOTICE.txt | 4 - ouds_core/lib/components/tag/ouds_tag.dart | 225 +++++++++--------- .../lib/components/utilities/app_assets.dart | 1 - .../assets/ic_bullet_rounded.svg | 3 - .../assets/ic_bullet_rounded.svg | 3 - ouds_theme_sosh/assets/ic_bullet_rounded.svg | 3 - .../assets/ic_bullet_rounded.svg | 3 - 7 files changed, 107 insertions(+), 135 deletions(-) delete mode 100644 ouds_theme_orange/assets/ic_bullet_rounded.svg delete mode 100644 ouds_theme_orange_compact/assets/ic_bullet_rounded.svg delete mode 100644 ouds_theme_sosh/assets/ic_bullet_rounded.svg delete mode 100644 ouds_theme_wireframe/assets/ic_bullet_rounded.svg diff --git a/NOTICE.txt b/NOTICE.txt index 1436dcca0..707702506 100644 --- a/NOTICE.txt +++ b/NOTICE.txt @@ -77,7 +77,6 @@ ouds-flutter/app/assets/sosh/functional/status-and-indicators/info-fill.svg ouds-flutter/app/assets/wireframe/functional/status-and-indicators/info-fill.svg ## OUDS / Themes / Orange -ouds_theme_orange/assets/ic_bullet_rounded.svg ouds_theme_orange/assets/communication/accessibility/accessibility-vision.svg ouds_theme_orange/assets/communication/security-and-safety/lock.svg ouds_theme_orange/assets/component/alert/important-fill.svg @@ -122,7 +121,6 @@ ouds_theme_orange/fonts/SF-Pro-Display-Black-Regular.ttf ouds_theme_orange/fonts/SF-Pro-Display-Black-Thin.ttf ## OUDS / Themes / Orange Compact -ouds_theme_orange_compact/assets/ic_bullet_rounded.svg ouds_theme_orange_compact/assets/communication/accessibility/accessibility-vision.svg ouds_theme_orange_compact/assets/communication/security-and-safety/lock.svg ouds_theme_orange_compact/assets/component/alert/important-fill.svg @@ -166,7 +164,6 @@ ouds_theme_orange_compact/fonts/SF-Pro-Display-Black-Regular.ttf ouds_theme_orange_compact/fonts/SF-Pro-Display-Black-Thin.ttf ## OUDS / Themes / Sosh -ouds_theme_sosh/assets/ic_bullet_rounded.svg ouds_theme_orange/assets/communication/accessibility/accessibility-vision.svg ouds_theme_sosh/assets/communication/security-and-safety/lock.svg ouds_theme_sosh/assets/component/alert/important-fill.svg @@ -204,7 +201,6 @@ ouds_theme_sosh/fonts/Sosh-Regular.ttf ouds_theme_sosh/fonts/Sosh-Thin.ttf ## OUDS / Themes / Wireframe -ouds_theme_wireframe/assets/ic_bullet_rounded.svg ouds_theme_orange/assets/communication/accessibility/accessibility-vision.svg ouds_theme_wireframe/assets/communication/security-and-safety/lock.svg ouds_theme_wireframe/assets/component/alert/important-fill.svg diff --git a/ouds_core/lib/components/tag/ouds_tag.dart b/ouds_core/lib/components/tag/ouds_tag.dart index 71704c866..b0750148e 100644 --- a/ouds_core/lib/components/tag/ouds_tag.dart +++ b/ouds_core/lib/components/tag/ouds_tag.dart @@ -19,7 +19,6 @@ import 'package:ouds_core/components/tag/internal/ouds_tag_border_modifier.dart' import 'package:ouds_core/components/tag/internal/ouds_tag_size_modifier.dart'; import 'package:ouds_core/components/tag/internal/ouds_tag_status_modifier.dart'; import 'package:ouds_core/components/tag/internal/ouds_tag_text_style_modifier.dart'; -import 'package:ouds_core/components/utilities/app_assets.dart'; import 'package:ouds_core/l10n/gen/ouds_localizations.dart'; import 'package:ouds_theme_contract/ouds_theme.dart'; @@ -275,7 +274,7 @@ class OudsTag extends StatefulWidget { OudsTagStatus? state, OudsIconStatus? status, OudsTagAppearance hierarchy, - double width, double height, bool isEnabled) { + bool isEnabled) { final statusModifier = OudsTagStatusModifier(context); //get the asset name from status for neutral and accent status (icon defined by user) @@ -286,8 +285,6 @@ class OudsTag extends StatefulWidget { excludeFromSemantics: true, icon ?? assetName ?? assetIconName ?? "", package: icon != null ? OudsTheme.of(context).packageName : null, - width: width, - height: height, fit: BoxFit.contain, colorFilter: ColorFilter.mode( statusModifier.getStatusIconColor(state,status, hierarchy, isEnabled), @@ -347,48 +344,44 @@ class _OudsTagState extends State { ) { final minWidthAndHeight = tagSizeModifier.getMinWidthAndHeight(widget.size); final widthAndHeightAssetsContainer = tagSizeModifier.getAssetsSize(widget.size); - return Stack( - children: [ - ClipRRect( - borderRadius: OudsTagControlBorderModifier.getBorderRadius(context,widget.roundedCorners), - child: Container( - constraints: BoxConstraints(minHeight: minWidthAndHeight[OudsTagDimensions.height.name]!, minWidth: minWidthAndHeight[OudsTagDimensions.width.name]!), - color: OudsTheme.of(context).colorScheme(context).surfaceSecondary, - padding: tagSizeModifier.getPadding(widget.size, true), - child: Row( - mainAxisSize: MainAxisSize.min, - mainAxisAlignment: MainAxisAlignment.center, - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - SizedBox( - width: widthAndHeightAssetsContainer[OudsTagDimensions.width.name], - height: widthAndHeightAssetsContainer[OudsTagDimensions.height.name], - child: Semantics( - child: CircularProgressIndicator( - padding: tagSizeModifier.getLoadingAssetsPadding(widget.size), - color: OudsTheme.of(context).colorScheme(context).contentDefault, - strokeWidth: OudsTheme.of(context).spaceScheme(context).scaledThreeExtraSmall, - ), - ), - ), - SizedBox(width: tagSizeModifier.getSizeColumnGap(widget.size)), - Flexible( - child: - Text(widget.label, - textAlign: TextAlign.center, - style: tagStyleModifier.buildTagTextStyle( - appearance: widget.appearance, - state: widget._deprecatedStatus, - status: _effectiveStatus, - size: widget.size!, - isLoading: widget.loading, - isEnabled: widget.enabled)), - ), - ], + return Container( + decoration: BoxDecoration( + borderRadius: OudsTagControlBorderModifier.getBorderRadius(context,widget.roundedCorners), + color: OudsTheme.of(context).colorScheme(context).surfaceSecondary, + ), + constraints: BoxConstraints(minHeight: minWidthAndHeight[OudsTagDimensions.height.name]!, minWidth: minWidthAndHeight[OudsTagDimensions.width.name]!), + padding: tagSizeModifier.getPadding(widget.size, true), + child: Row( + mainAxisSize: MainAxisSize.min, + mainAxisAlignment: MainAxisAlignment.center, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + SizedBox( + width: widthAndHeightAssetsContainer[OudsTagDimensions.width.name], + height: widthAndHeightAssetsContainer[OudsTagDimensions.height.name], + child: Semantics( + child: CircularProgressIndicator( + padding: tagSizeModifier.getLoadingAssetsPadding(widget.size), + color: OudsTheme.of(context).colorScheme(context).contentDefault, + strokeWidth: OudsTheme.of(context).spaceScheme(context).scaledThreeExtraSmall, + ), ), ), - ), - ], + SizedBox(width: tagSizeModifier.getSizeColumnGap(widget.size)), + Flexible( + child: + Text(widget.label, + textAlign: TextAlign.center, + style: tagStyleModifier.buildTagTextStyle( + appearance: widget.appearance, + state: widget._deprecatedStatus, + status: _effectiveStatus, + size: widget.size!, + isLoading: widget.loading, + isEnabled: widget.enabled)), + ), + ], + ), ); } @@ -396,43 +389,40 @@ class _OudsTagState extends State { final minWidthAndHeight = tagSizeModifier.getMinWidthAndHeight(widget.size); final widthAndHeightAssetsContainer = tagSizeModifier.getAssetsSize(widget.size); - return Stack( - children: [ - ClipRRect( - borderRadius: OudsTagControlBorderModifier.getBorderRadius(context,widget.roundedCorners), - child: Container( - constraints: BoxConstraints(minHeight: minWidthAndHeight[OudsTagDimensions.height.name]!, minWidth: minWidthAndHeight[OudsTagDimensions.width.name]!), - color: tagStatusModifier.getStatusColor(widget._deprecatedStatus,_effectiveStatus, widget.appearance, widget.enabled), - padding: tagSizeModifier.getPadding(widget.size, true), - child: Row( - mainAxisSize: MainAxisSize.min, - mainAxisAlignment: MainAxisAlignment.center, - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - Container( - padding: tagSizeModifier.getAssetsPadding(widget.size, OudsTagLayout.textAndIcon), - child: OudsTag.buildIcon( - context, widget.icon, widget._deprecatedStatus,_effectiveStatus, - widget.appearance, widthAndHeightAssetsContainer[OudsTagDimensions.width.name]!, - widthAndHeightAssetsContainer[OudsTagDimensions.height.name]!, widget.enabled), - ), - SizedBox( - width: tagSizeModifier.getSizeColumnGap(widget.size), - ), - Flexible( - child: Text( - widget.label, - textAlign: TextAlign.center, - style: tagStyleModifier.buildTagTextStyle( - appearance: widget.appearance, state: widget._deprecatedStatus, - status: _effectiveStatus, size: widget.size!, isEnabled: widget.enabled), - ), - ), - ], + return Container( + decoration: BoxDecoration( + borderRadius: OudsTagControlBorderModifier.getBorderRadius(context,widget.roundedCorners), + color: tagStatusModifier.getStatusColor(widget._deprecatedStatus,_effectiveStatus, widget.appearance, widget.enabled), + ), + constraints: BoxConstraints(minHeight: minWidthAndHeight[OudsTagDimensions.height.name]!, minWidth: minWidthAndHeight[OudsTagDimensions.width.name]!), + padding: tagSizeModifier.getPadding(widget.size, true), + child: Row( + mainAxisSize: MainAxisSize.min, + mainAxisAlignment: MainAxisAlignment.center, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Container( + padding: tagSizeModifier.getAssetsPadding(widget.size, OudsTagLayout.textAndIcon), + width: widthAndHeightAssetsContainer[OudsTagDimensions.width.name], + height: widthAndHeightAssetsContainer[OudsTagDimensions.height.name], + child: OudsTag.buildIcon( + context, widget.icon, widget._deprecatedStatus,_effectiveStatus, + widget.appearance, widget.enabled), + ), + SizedBox( + width: tagSizeModifier.getSizeColumnGap(widget.size), + ), + Flexible( + child: Text( + widget.label, + textAlign: TextAlign.center, + style: tagStyleModifier.buildTagTextStyle( + appearance: widget.appearance, state: widget._deprecatedStatus, + status: _effectiveStatus, size: widget.size!, isEnabled: widget.enabled), ), ), - ), - ], + ], + ), ); } @@ -441,47 +431,46 @@ class _OudsTagState extends State { final minWidthAndHeight = tagSizeModifier.getMinWidthAndHeight(widget.size); final widthAndHeightAssetsContainer = tagSizeModifier.getAssetsSize(widget.size); - return Stack( - children: [ - ClipRRect( - borderRadius: OudsTagControlBorderModifier.getBorderRadius(context,widget.roundedCorners), - child: Container( - constraints: BoxConstraints(minHeight: minWidthAndHeight[OudsTagDimensions.height.name]!, minWidth: minWidthAndHeight[OudsTagDimensions.width.name]!), - color: tagStatusModifier.getStatusColor(widget._deprecatedStatus, _effectiveStatus, widget.appearance, widget.enabled), - padding: tagSizeModifier.getPadding(widget.size, true), - child: Row( - mainAxisSize: MainAxisSize.min, - mainAxisAlignment: MainAxisAlignment.center, - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - SizedBox( - width: widthAndHeightAssetsContainer[OudsTagDimensions.width.name], - height: widthAndHeightAssetsContainer[OudsTagDimensions.height.name], - child: SvgPicture.asset( - AppAssets.icons.roundedBullet, - package: OudsTheme.of(context).packageName, - fit: BoxFit.contain, - colorFilter: ColorFilter.mode(tagStatusModifier.getStatusIconColor( - widget._deprecatedStatus, _effectiveStatus, - widget.appearance, widget.enabled), BlendMode.srcIn), - ), - ), - SizedBox( - width: widget.size == OudsTagSize.small ? tagToken.spaceColumnGapSmall : tagToken.spaceColumnGapDefault, - ), - Flexible( - child: Text( - widget.label, textAlign: TextAlign.center, - style: tagStyleModifier.buildTagTextStyle( - appearance: widget.appearance, state: widget._deprecatedStatus, - status: _effectiveStatus, size: widget.size!, - isEnabled: widget.enabled)), - ), - ], + return Container( + decoration: BoxDecoration( + borderRadius: OudsTagControlBorderModifier.getBorderRadius(context,widget.roundedCorners), + color: tagStatusModifier.getStatusColor(widget._deprecatedStatus, _effectiveStatus, widget.appearance, widget.enabled), + ), + constraints: BoxConstraints(minHeight: minWidthAndHeight[OudsTagDimensions.height.name]!, minWidth: minWidthAndHeight[OudsTagDimensions.width.name]!), + padding: tagSizeModifier.getPadding(widget.size, true), + child: Row( + mainAxisSize: MainAxisSize.min, + mainAxisAlignment: MainAxisAlignment.center, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Container( + padding: tagSizeModifier.getAssetsPadding(widget.size, OudsTagLayout.textAndBullet), + width: widthAndHeightAssetsContainer[OudsTagDimensions.width.name], + height: widthAndHeightAssetsContainer[OudsTagDimensions.height.name], + child: Container( + width: 10, + height: 10, + decoration: BoxDecoration( + color: tagStatusModifier.getStatusIconColor( + widget._deprecatedStatus, _effectiveStatus, + widget.appearance, widget.enabled), + shape: BoxShape.circle, + ), ), ), - ), - ], + SizedBox( + width: widget.size == OudsTagSize.small ? tagToken.spaceColumnGapSmall : tagToken.spaceColumnGapDefault, + ), + Flexible( + child: Text( + widget.label, textAlign: TextAlign.center, + style: tagStyleModifier.buildTagTextStyle( + appearance: widget.appearance, state: widget._deprecatedStatus, + status: _effectiveStatus, size: widget.size!, + isEnabled: widget.enabled)), + ), + ], + ), ); } diff --git a/ouds_core/lib/components/utilities/app_assets.dart b/ouds_core/lib/components/utilities/app_assets.dart index e5aad10be..14def086c 100644 --- a/ouds_core/lib/components/utilities/app_assets.dart +++ b/ouds_core/lib/components/utilities/app_assets.dart @@ -28,7 +28,6 @@ class _Images { class _Icons { _Icons(); - final String roundedBullet = 'assets/ic_bullet_rounded.svg'; final String componentAlertTickConfirmationFill = 'assets/component/alert/tick-confirmation-fill.svg'; final String componentAlertImportantFill = 'assets/component/alert/important-fill.svg'; diff --git a/ouds_theme_orange/assets/ic_bullet_rounded.svg b/ouds_theme_orange/assets/ic_bullet_rounded.svg deleted file mode 100644 index 8671f22a8..000000000 --- a/ouds_theme_orange/assets/ic_bullet_rounded.svg +++ /dev/null @@ -1,3 +0,0 @@ - - - diff --git a/ouds_theme_orange_compact/assets/ic_bullet_rounded.svg b/ouds_theme_orange_compact/assets/ic_bullet_rounded.svg deleted file mode 100644 index 8671f22a8..000000000 --- a/ouds_theme_orange_compact/assets/ic_bullet_rounded.svg +++ /dev/null @@ -1,3 +0,0 @@ - - - diff --git a/ouds_theme_sosh/assets/ic_bullet_rounded.svg b/ouds_theme_sosh/assets/ic_bullet_rounded.svg deleted file mode 100644 index 8671f22a8..000000000 --- a/ouds_theme_sosh/assets/ic_bullet_rounded.svg +++ /dev/null @@ -1,3 +0,0 @@ - - - diff --git a/ouds_theme_wireframe/assets/ic_bullet_rounded.svg b/ouds_theme_wireframe/assets/ic_bullet_rounded.svg deleted file mode 100644 index 8671f22a8..000000000 --- a/ouds_theme_wireframe/assets/ic_bullet_rounded.svg +++ /dev/null @@ -1,3 +0,0 @@ - - - From 325bde27a590af9705200dca9df1975aaacda398 Mon Sep 17 00:00:00 2001 From: nhammami Date: Sun, 12 Apr 2026 18:01:29 +0100 Subject: [PATCH 5/7] merge: update labels from develop --- .../lib/l10n/gen/ouds_localizations_fr.dart | 18 +++++------------- 1 file changed, 5 insertions(+), 13 deletions(-) diff --git a/ouds_core/lib/l10n/gen/ouds_localizations_fr.dart b/ouds_core/lib/l10n/gen/ouds_localizations_fr.dart index 8e288d760..eddc5e758 100644 --- a/ouds_core/lib/l10n/gen/ouds_localizations_fr.dart +++ b/ouds_core/lib/l10n/gen/ouds_localizations_fr.dart @@ -53,9 +53,6 @@ class OudsLocalizationsFr extends OudsLocalizations { String get core_filterChip_hint_selected_a11y => 'Double tap pour sélectionner'; - @override - String get core_chip_chip_label_a11y => 'Chip label'; - @override String get core_chip_chip_icon_a11y => 'Icône'; @@ -108,18 +105,10 @@ class OudsLocalizationsFr extends OudsLocalizations { 'Double tap pour sélectionner un pays'; @override - String get core_password_input_hidden_a11y => 'Password hidden'; - - @override - String get core_password_input_visible_a11y => 'Password visible'; + String get core_passwordInput_showPassword_a11y => 'Afficher le mot de passe'; @override - String get core_password_input_hint_show_a11y => - 'Double tap to show password'; - - @override - String get core_password_input_hint_hide_a11y => - 'Double tap to hide password'; + String get core_passwordInput_hidePassword_a11y => 'Masquer le mot de passe'; @override String core_pinCodeInput_digitCode_label_a11y(Object current) { @@ -130,4 +119,7 @@ class OudsLocalizationsFr extends OudsLocalizations { String core_pinCodeInput_pinCode_label_a11y(Object digitsCount) { return 'Entrez votre code à $digitsCount chiffres'; } + + @override + String get core_pinCodeInput_trait_a11y => 'Champ de saisie'; } From 28a56a2ab43eb7ac1ef091b9d4c7b55df93d3468 Mon Sep 17 00:00:00 2001 From: nhammami Date: Mon, 13 Apr 2026 12:33:16 +0100 Subject: [PATCH 6/7] review: remove not null operator --- .../internal/ouds_tag_text_style_modifier.dart | 2 +- ouds_core/lib/components/tag/ouds_tag.dart | 16 ++++++++-------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/ouds_core/lib/components/tag/internal/ouds_tag_text_style_modifier.dart b/ouds_core/lib/components/tag/internal/ouds_tag_text_style_modifier.dart index f2d2327eb..c779a81a6 100644 --- a/ouds_core/lib/components/tag/internal/ouds_tag_text_style_modifier.dart +++ b/ouds_core/lib/components/tag/internal/ouds_tag_text_style_modifier.dart @@ -31,7 +31,7 @@ class OudsTagStyleModifier { required OudsTagAppearance appearance, OudsTagStatus? state, OudsIconStatus? status, - required OudsTagSize size, + OudsTagSize? size, bool isLoading = false, bool isEnabled = false }) { diff --git a/ouds_core/lib/components/tag/ouds_tag.dart b/ouds_core/lib/components/tag/ouds_tag.dart index b0750148e..792671b97 100644 --- a/ouds_core/lib/components/tag/ouds_tag.dart +++ b/ouds_core/lib/components/tag/ouds_tag.dart @@ -349,7 +349,7 @@ class _OudsTagState extends State { borderRadius: OudsTagControlBorderModifier.getBorderRadius(context,widget.roundedCorners), color: OudsTheme.of(context).colorScheme(context).surfaceSecondary, ), - constraints: BoxConstraints(minHeight: minWidthAndHeight[OudsTagDimensions.height.name]!, minWidth: minWidthAndHeight[OudsTagDimensions.width.name]!), + constraints: BoxConstraints(minHeight: minWidthAndHeight[OudsTagDimensions.height.name] ?? 0.0, minWidth: minWidthAndHeight[OudsTagDimensions.width.name] ?? 0.0), padding: tagSizeModifier.getPadding(widget.size, true), child: Row( mainAxisSize: MainAxisSize.min, @@ -376,7 +376,7 @@ class _OudsTagState extends State { appearance: widget.appearance, state: widget._deprecatedStatus, status: _effectiveStatus, - size: widget.size!, + size: widget.size ?? OudsTagSize.defaultSize, isLoading: widget.loading, isEnabled: widget.enabled)), ), @@ -394,7 +394,7 @@ class _OudsTagState extends State { borderRadius: OudsTagControlBorderModifier.getBorderRadius(context,widget.roundedCorners), color: tagStatusModifier.getStatusColor(widget._deprecatedStatus,_effectiveStatus, widget.appearance, widget.enabled), ), - constraints: BoxConstraints(minHeight: minWidthAndHeight[OudsTagDimensions.height.name]!, minWidth: minWidthAndHeight[OudsTagDimensions.width.name]!), + constraints: BoxConstraints(minHeight: minWidthAndHeight[OudsTagDimensions.height.name] ?? 0.0, minWidth: minWidthAndHeight[OudsTagDimensions.width.name] ?? 0.0), padding: tagSizeModifier.getPadding(widget.size, true), child: Row( mainAxisSize: MainAxisSize.min, @@ -418,7 +418,7 @@ class _OudsTagState extends State { textAlign: TextAlign.center, style: tagStyleModifier.buildTagTextStyle( appearance: widget.appearance, state: widget._deprecatedStatus, - status: _effectiveStatus, size: widget.size!, isEnabled: widget.enabled), + status: _effectiveStatus, size: widget.size, isEnabled: widget.enabled), ), ), ], @@ -436,7 +436,7 @@ class _OudsTagState extends State { borderRadius: OudsTagControlBorderModifier.getBorderRadius(context,widget.roundedCorners), color: tagStatusModifier.getStatusColor(widget._deprecatedStatus, _effectiveStatus, widget.appearance, widget.enabled), ), - constraints: BoxConstraints(minHeight: minWidthAndHeight[OudsTagDimensions.height.name]!, minWidth: minWidthAndHeight[OudsTagDimensions.width.name]!), + constraints: BoxConstraints(minHeight: minWidthAndHeight[OudsTagDimensions.height.name] ?? 0.0, minWidth: minWidthAndHeight[OudsTagDimensions.width.name] ?? 0.0), padding: tagSizeModifier.getPadding(widget.size, true), child: Row( mainAxisSize: MainAxisSize.min, @@ -466,7 +466,7 @@ class _OudsTagState extends State { widget.label, textAlign: TextAlign.center, style: tagStyleModifier.buildTagTextStyle( appearance: widget.appearance, state: widget._deprecatedStatus, - status: _effectiveStatus, size: widget.size!, + status: _effectiveStatus, size: widget.size, isEnabled: widget.enabled)), ), ], @@ -482,7 +482,7 @@ class _OudsTagState extends State { ClipRRect( borderRadius: OudsTagControlBorderModifier.getBorderRadius(context,widget.roundedCorners), child: Container( - constraints: BoxConstraints(minHeight: minWidthAndHeight[OudsTagDimensions.height.name]!, minWidth: minWidthAndHeight[OudsTagDimensions.width.name]!), + constraints: BoxConstraints(minHeight: minWidthAndHeight[OudsTagDimensions.height.name] ?? 0.0, minWidth: minWidthAndHeight[OudsTagDimensions.width.name] ?? 0.0), color: tagStatusModifier.getStatusColor(widget._deprecatedStatus, _effectiveStatus, widget.appearance, widget.enabled), padding: tagSizeModifier.getPadding(widget.size, false), @@ -497,7 +497,7 @@ class _OudsTagState extends State { textAlign: TextAlign.center, style: tagStyleModifier.buildTagTextStyle( appearance: widget.appearance, state: widget._deprecatedStatus, - status: _effectiveStatus, size: widget.size!, isEnabled: widget.enabled), + status: _effectiveStatus, size: widget.size, isEnabled: widget.enabled), ), ), ], From 8695a926a9f8b550601bb75675e326a41b994c9f Mon Sep 17 00:00:00 2001 From: nhammami Date: Mon, 20 Apr 2026 15:32:25 +0100 Subject: [PATCH 7/7] merge: merge from develop --- .../lib/l10n/gen/ouds_localizations.dart | 32 ++++++++++++------- .../lib/l10n/gen/ouds_localizations_ar.dart | 3 ++ .../lib/l10n/gen/ouds_localizations_en.dart | 3 ++ .../lib/l10n/gen/ouds_localizations_fr.dart | 7 ++-- 4 files changed, 31 insertions(+), 14 deletions(-) diff --git a/ouds_core/lib/l10n/gen/ouds_localizations.dart b/ouds_core/lib/l10n/gen/ouds_localizations.dart index 3657e1b7d..23fba9517 100644 --- a/ouds_core/lib/l10n/gen/ouds_localizations.dart +++ b/ouds_core/lib/l10n/gen/ouds_localizations.dart @@ -67,7 +67,7 @@ import 'ouds_localizations_fr.dart'; /// property. abstract class OudsLocalizations { OudsLocalizations(String locale) - : localeName = intl.Intl.canonicalizedLocale(locale.toString()); + : localeName = intl.Intl.canonicalizedLocale(locale.toString()); final String localeName; @@ -90,17 +90,17 @@ abstract class OudsLocalizations { /// of delegates is preferred or required. static const List> localizationsDelegates = >[ - delegate, - GlobalMaterialLocalizations.delegate, - GlobalCupertinoLocalizations.delegate, - GlobalWidgetsLocalizations.delegate, - ]; + delegate, + GlobalMaterialLocalizations.delegate, + GlobalCupertinoLocalizations.delegate, + GlobalWidgetsLocalizations.delegate, + ]; /// A list of this localizations delegate's supported locales. static const List supportedLocales = [ Locale('ar'), Locale('en'), - Locale('fr') + Locale('fr'), ]; /// No description provided for @core_common_error_a11y. @@ -330,6 +330,12 @@ abstract class OudsLocalizations { /// In en, this message translates to: /// **'close'** String get core_topAppBar_closeNavigationIcon_a11y; + + /// No description provided for @core_toolBarTop_backNavigationIcon_a11y. + /// + /// In en, this message translates to: + /// **'Back'** + String get core_toolBarTop_backNavigationIcon_a11y; } class _OudsLocalizationsDelegate @@ -339,7 +345,8 @@ class _OudsLocalizationsDelegate @override Future load(Locale locale) { return SynchronousFuture( - lookupOudsLocalizations(locale)); + lookupOudsLocalizations(locale), + ); } @override @@ -362,8 +369,9 @@ OudsLocalizations lookupOudsLocalizations(Locale locale) { } throw FlutterError( - 'OudsLocalizations.delegate failed to load unsupported locale "$locale". This is likely ' - 'an issue with the localizations generation tool. Please file an issue ' - 'on GitHub with a reproducible sample app and the gen-l10n configuration ' - 'that was used.'); + 'OudsLocalizations.delegate failed to load unsupported locale "$locale". This is likely ' + 'an issue with the localizations generation tool. Please file an issue ' + 'on GitHub with a reproducible sample app and the gen-l10n configuration ' + 'that was used.', + ); } diff --git a/ouds_core/lib/l10n/gen/ouds_localizations_ar.dart b/ouds_core/lib/l10n/gen/ouds_localizations_ar.dart index b73c96189..a7a26c9bc 100644 --- a/ouds_core/lib/l10n/gen/ouds_localizations_ar.dart +++ b/ouds_core/lib/l10n/gen/ouds_localizations_ar.dart @@ -132,4 +132,7 @@ class OudsLocalizationsAr extends OudsLocalizations { @override String get core_topAppBar_closeNavigationIcon_a11y => 'إغلاق'; + + @override + String get core_toolBarTop_backNavigationIcon_a11y => 'رجوع'; } diff --git a/ouds_core/lib/l10n/gen/ouds_localizations_en.dart b/ouds_core/lib/l10n/gen/ouds_localizations_en.dart index a5e025e85..96856fad0 100644 --- a/ouds_core/lib/l10n/gen/ouds_localizations_en.dart +++ b/ouds_core/lib/l10n/gen/ouds_localizations_en.dart @@ -132,4 +132,7 @@ class OudsLocalizationsEn extends OudsLocalizations { @override String get core_topAppBar_closeNavigationIcon_a11y => 'close'; + + @override + String get core_toolBarTop_backNavigationIcon_a11y => 'Back'; } diff --git a/ouds_core/lib/l10n/gen/ouds_localizations_fr.dart b/ouds_core/lib/l10n/gen/ouds_localizations_fr.dart index 8cb8bed93..ca8400341 100644 --- a/ouds_core/lib/l10n/gen/ouds_localizations_fr.dart +++ b/ouds_core/lib/l10n/gen/ouds_localizations_fr.dart @@ -127,11 +127,14 @@ class OudsLocalizationsFr extends OudsLocalizations { String get core_pinCodeInput_error_a11y => 'Error: Invalid code'; @override - String get core_topAppBar_backNavigationIcon_a11y => 'Back'; + String get core_topAppBar_backNavigationIcon_a11y => 'Retour'; @override String get core_topAppBar_menuNavigationIcon_a11y => 'Menu'; @override - String get core_topAppBar_closeNavigationIcon_a11y => 'close'; + String get core_topAppBar_closeNavigationIcon_a11y => 'Fermer'; + + @override + String get core_toolBarTop_backNavigationIcon_a11y => 'Retour'; }