Skip to content

Commit 40892ea

Browse files
nouha06boosted-botAhmedAmineZr
authored
chore: password input component update to v13 (#689)(#488)(#753)
* chore: update tokens * chore: update tokens with version 2.4.0 * chore: update tokens with version 2.4.0 * chore: update version components * chore(version): prepare version 2.0.0 (#747) Prepare version v2.0.0 (#747) * feat(password-input): update password input to v1.3 * fix(password-input): Label is truncated when zoom is applied * feat(password-input): update changelog file --------- Co-authored-by: boosted-bot <boosted-bot@users.noreply.github.com> Co-authored-by: Ahmed Amine Zribi <ahmedamine.zribi@sofrecom.com>
1 parent f24b12f commit 40892ea

3 files changed

Lines changed: 74 additions & 88 deletions

File tree

app/CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77
## [Unreleased](https://github.com/Orange-OpenSource/ouds-flutter/compare/1.3.1...develop)
88
### Added
99
### Changed
10+
- [Library] update `Password input` component to v1.3 ([#689](https://github.com/Orange-OpenSource/ouds-flutter/issues/689))
1011
- [Library] `filter chip` and `suggestion chip` component update to v1.4 ([#688](https://github.com/Orange-OpenSource/ouds-flutter/issues/688))
1112
- [DemoApp][Library] update `badge icon` component to 1.3.0 ([#680](https://github.com/Orange-OpenSource/ouds-flutter/issues/680))
1213
- [Library] update library icons to use the one from v1.6 ([#661](https://github.com/Orange-OpenSource/ouds-flutter/issues/661))
@@ -20,6 +21,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
2021
- [DemoApp][Library] update tokens 2.4.0 ([#726](https://github.com/Orange-OpenSource/ouds-flutter/issues/726))
2122

2223
### Fixed
24+
- [Library] `Password input` Label is truncated when zoom is applied ([#600](https://github.com/Orange-OpenSource/ouds-flutter/issues/600))
2325
- [Library] `Filter chip` is not reached by keyboard focus or Switch Access focus ([#474](https://github.com/Orange-OpenSource/ouds-flutter/issues/474))
2426
- [Library] `Phone number input` Add a hint to explain how to interact with fields ([#571](https://github.com/Orange-OpenSource/ouds-flutter/issues/571))
2527
- [Library] `input tag` the whole component should have the role button ([#481](https://github.com/Orange-OpenSource/ouds-flutter/issues/481))

ouds_core/CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77
## [Unreleased](https://github.com/Orange-OpenSource/ouds-flutter/compare/1.3.1...develop)
88
### Added
99
### Changed
10+
- [Library] update `Password input` component to v1.3 ([#689](https://github.com/Orange-OpenSource/ouds-flutter/issues/689))
1011
- [Library] `filter chip` and `suggestion chip` component update to v1.4 ([#688](https://github.com/Orange-OpenSource/ouds-flutter/issues/688))
1112
- [Library] update `badge` icon component to 1.3.0 ([#680](https://github.com/Orange-OpenSource/ouds-flutter/issues/680))
1213
- [Library] update library icons to use the one from v1.6 ([#661](https://github.com/Orange-OpenSource/ouds-flutter/issues/661))
@@ -19,6 +20,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1920
- [Library] update tokens 2.4.0 ([#726](https://github.com/Orange-OpenSource/ouds-flutter/issues/726))
2021

2122
### Fixed
23+
- [Library] `Password input` Label is truncated when zoom is applied ([#600](https://github.com/Orange-OpenSource/ouds-flutter/issues/600))
2224
- [Library] `Filter chip` is not reached by keyboard focus or Switch Access focus ([#474](https://github.com/Orange-OpenSource/ouds-flutter/issues/474))
2325
- [Library] `Phone number input` Add a hint to explain how to interact with fields ([#571](https://github.com/Orange-OpenSource/ouds-flutter/issues/571))
2426
- [Library] `input tag` the whole component should have the role button ([#481](https://github.com/Orange-OpenSource/ouds-flutter/issues/481))

ouds_core/lib/components/form_input/password_input/ouds_password_input.dart

Lines changed: 70 additions & 88 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ import 'package:ouds_core/components/form_input/internal/modifier/ouds_form_inpu
2222
import 'package:ouds_core/components/form_input/internal/ouds_form_input_control_state.dart';
2323
import 'package:ouds_core/components/form_input/password_input/ouds_password_input_decoration.dart';
2424
import 'package:ouds_core/components/utilities/app_assets.dart';
25-
import 'package:ouds_core/components/utilities/input_utils.dart';
2625
import 'package:ouds_core/l10n/gen/ouds_localizations.dart';
2726
import 'package:ouds_theme_contract/ouds_theme.dart';
2827
import 'package:ouds_theme_contract/ouds_theme_contract.dart';
@@ -242,64 +241,51 @@ class _OudsPasswordInputState extends State<OudsPasswordInput> {
242241
mainAxisSize: MainAxisSize.min,
243242
crossAxisAlignment: CrossAxisAlignment.start,
244243
children: [
245-
SizedBox(
246-
height: textInput.sizeMinHeight,
247-
child: DecoratedBox(
248-
decoration: BoxDecoration(
249-
// Background color based on current state and error presence
250-
color: inputTextBackgroundModifier.getBackgroundColor(
251-
state,
252-
isError,
253-
widget.decoration.outlined,
254-
),
255-
256-
/// Bottom border styling; full border if style is not default
257-
border: inputTextBorderModifier.getBorder(
258-
state,
259-
isError,
260-
widget.decoration.outlined,
261-
),
262-
263-
// Border radius if enabled in theme configuration
264-
borderRadius: inputTextBorderModifier.getBorderRadius(context),
244+
DecoratedBox(
245+
decoration: BoxDecoration(
246+
// Background color based on current state and error presence
247+
color: inputTextBackgroundModifier.getBackgroundColor(
248+
state,
249+
isError,
250+
widget.decoration.outlined,
265251
),
266-
child: Padding(
267-
padding: EdgeInsetsGeometry.directional(
268-
start: textInput.spacePaddingInlineDefault,
269-
end: textInput.spacePaddingInlineTrailingAction,
270-
top: textInput.spacePaddingBlockDefault,
271-
bottom: textInput.spacePaddingBlockDefault,
272-
),
273-
child: Row(
274-
crossAxisAlignment: CrossAxisAlignment.center,
275-
children: [
276-
/// Left block: prefix icon container
277-
Container(
278-
alignment: Alignment.center,
279-
child: _buildPrefixIcon(context, state),
280-
),
281252

282-
/// Center block: main text input
283-
Flexible(
284-
fit: FlexFit.loose,
285-
child: Semantics(
286-
hint: helperText,
287-
child:
288-
widget.readOnly == true ||
289-
(widget.decoration.loader == true && _isTyping)
290-
? IgnorePointer(
291-
child: _buildTextField(
292-
inputTextTextModifier,
293-
state,
294-
isError,
295-
effectiveFocusNode,
296-
theme,
297-
context,
298-
textInput,
299-
effectiveIsFocused,
300-
),
301-
)
302-
: _buildTextField(
253+
/// Bottom border styling; full border if style is not default
254+
border: inputTextBorderModifier.getBorder(
255+
state,
256+
isError,
257+
widget.decoration.outlined,
258+
),
259+
260+
// Border radius if enabled in theme configuration
261+
borderRadius: inputTextBorderModifier.getBorderRadius(context),
262+
),
263+
child: Padding(
264+
padding: EdgeInsetsGeometry.directional(
265+
start: textInput.spacePaddingInlineDefault,
266+
end: textInput.spacePaddingInlineTrailingAction,
267+
top: textInput.spacePaddingBlockDefault,
268+
bottom: textInput.spacePaddingBlockDefault,
269+
),
270+
child: Row(
271+
crossAxisAlignment: CrossAxisAlignment.center,
272+
children: [
273+
/// Left block: prefix icon container
274+
Container(
275+
alignment: Alignment.center,
276+
child: _buildPrefixIcon(context, state),
277+
),
278+
279+
/// Center block: main text input
280+
Flexible(
281+
fit: FlexFit.loose,
282+
child: Semantics(
283+
hint: helperText,
284+
child:
285+
widget.readOnly == true ||
286+
(widget.decoration.loader == true && _isTyping)
287+
? IgnorePointer(
288+
child: _buildTextField(
303289
inputTextTextModifier,
304290
state,
305291
isError,
@@ -309,16 +295,26 @@ class _OudsPasswordInputState extends State<OudsPasswordInput> {
309295
textInput,
310296
effectiveIsFocused,
311297
),
312-
),
298+
)
299+
: _buildTextField(
300+
inputTextTextModifier,
301+
state,
302+
isError,
303+
effectiveFocusNode,
304+
theme,
305+
context,
306+
textInput,
307+
effectiveIsFocused,
308+
),
313309
),
310+
),
314311

315-
/// spacing between center container et suffic icon container
316-
SizedBox(width: textInput.spaceColumnGapDefault),
312+
/// spacing between center container et suffic icon container
313+
SizedBox(width: textInput.spaceColumnGapDefault),
317314

318-
/// Right block: suffix icon container
319-
_buildSuffixIcon(context, state),
320-
],
321-
),
315+
/// Right block: suffix icon container
316+
_buildSuffixIcon(context, state),
317+
],
322318
),
323319
),
324320
),
@@ -377,7 +373,7 @@ class _OudsPasswordInputState extends State<OudsPasswordInput> {
377373
controller: widget.controller,
378374
keyboardType: widget.keyboardType,
379375
style: theme.typographyTokens
380-
.typeLabelDefaultLarge(context)
376+
.typeLabelModerateLarge(context)
381377
.copyWith(
382378
color: inputTextTextModifier.getTextLabelColor(state, isError),
383379
),
@@ -412,27 +408,14 @@ class _OudsPasswordInputState extends State<OudsPasswordInput> {
412408

413409
// Label text widget, shown if labelText is provided
414410
label: widget.decoration.labelText != null
415-
? Container(
416-
constraints: BoxConstraints(
417-
maxHeight: textInput.sizeLabelMaxHeight,
418-
),
419-
child: Text(
420-
maxLines: InputUtils.getLabelMaxLines(
421-
hintText: widget.decoration.hintText,
422-
controller: widget.controller,
423-
isFocused: effectiveIsFocused,
424-
),
425-
overflow: TextOverflow.ellipsis,
426-
widget.decoration.labelText ?? "",
427-
style: theme.typographyTokens
428-
.typeLabelDefaultLarge(context)
429-
.copyWith(
430-
color: inputTextTextModifier.getTextColor(
431-
state,
432-
isError,
433-
),
434-
),
435-
),
411+
? Text(
412+
widget.decoration.labelText ?? "",
413+
overflow: TextOverflow.ellipsis,
414+
style: theme.typographyTokens
415+
.typeLabelDefaultLarge(context)
416+
.copyWith(
417+
color: inputTextTextModifier.getTextColor(state, isError),
418+
),
436419
)
437420
: null,
438421

@@ -446,9 +429,8 @@ class _OudsPasswordInputState extends State<OudsPasswordInput> {
446429
// Hint text widget, shown if hintText is provided
447430
hint: widget.decoration.hintText != null
448431
? Text(
449-
maxLines: 1,
450-
overflow: TextOverflow.ellipsis,
451432
widget.decoration.hintText!,
433+
overflow: TextOverflow.ellipsis,
452434
style: theme.typographyTokens
453435
.typeLabelDefaultLarge(context)
454436
.copyWith(

0 commit comments

Comments
 (0)