Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
2e93482
chore: update tokens
boosted-bot May 5, 2026
b9f40b9
chore: update tokens with version 2.4.0
AhmedAmineZr May 5, 2026
b7493bd
chore: update tokens with version 2.4.0
AhmedAmineZr May 5, 2026
1a17b38
Merge remote-tracking branch 'origin/tokenator-update-tokens-20260505…
nouha06 May 5, 2026
60038af
Merge branch 'develop' into tokenator-update-tokens-20260505120328
nouha06 May 8, 2026
1aee47c
feat(tag): update tag component to v1.5.0
nouha06 May 8, 2026
a41022c
feat(input-tag): update input tag component to v1.2.0
nouha06 May 8, 2026
1d222ab
Merge branch 'develop' into 694-for-tag-component-update-to-v15
nouha06 May 8, 2026
3a92614
merge: fix conflicts
nouha06 May 8, 2026
53733c5
chore: update version components
AhmedAmineZr May 8, 2026
9f93946
Merge branch 'tokenator-update-tokens-20260505120328' of https://gith…
AhmedAmineZr May 8, 2026
9121be7
Merge branch 'develop' into tokenator-update-tokens-20260505120328
AhmedAmineZr May 8, 2026
0e7bc7c
Merge branch 'develop' into tokenator-update-tokens-20260505120328
AhmedAmineZr May 8, 2026
1657cc3
chore(version): prepare version 2.0.0 (#747)
AhmedAmineZr May 11, 2026
e00a5d5
Merge branch 'develop' into tokenator-update-tokens-20260505120328
nouha06 May 13, 2026
57f6ed4
Merge branch 'refs/heads/tokenator-update-tokens-20260505120328' into…
nouha06 May 14, 2026
d349dbc
fix(input-tag): the whole component should have the role button acces…
nouha06 May 15, 2026
56bcfd0
Merge branch 'prepare-new-version-2.0.0' into 694-for-tag-component-u…
nouha06 May 20, 2026
ba33846
feat(tag): fix the warning icon and color for tag component
nouha06 May 20, 2026
903de3e
Merge branch 'prepare-new-version-2.0.0' into 694-for-tag-component-u…
nouha06 May 20, 2026
ae4acad
Merge branch 'prepare-new-version-2.0.0' into 694-for-tag-component-u…
nouha06 May 21, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions app/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## [Unreleased](https://github.com/Orange-OpenSource/ouds-flutter/compare/1.3.1...develop)
### Added
### Changed
- [Library] update `tag` component to v1.5 ([#694](https://github.com/Orange-OpenSource/ouds-flutter/issues/694))
- [Library] update `input tag` component to v1.2 ([#695](https://github.com/Orange-OpenSource/ouds-flutter/issues/695))
- [DemoApp][Library] update tokens 2.5.0 ([#778](https://github.com/Orange-OpenSource/ouds-flutter/issues/778))
- [DemoApp][Library] update tokens 2.4.0 ([#726](https://github.com/Orange-OpenSource/ouds-flutter/issues/726))

### Fixed
- [Library] `input tag` the whole component should have the role button ([#481](https://github.com/Orange-OpenSource/ouds-flutter/issues/481))

## [1.3.1](https://github.com/Orange-OpenSource/ouds-flutter/compare/1.3.0...1.3.1) - 2026-05-14
### Added
Expand Down
3 changes: 3 additions & 0 deletions ouds_core/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## [Unreleased](https://github.com/Orange-OpenSource/ouds-flutter/compare/1.3.1...develop)
### Added
### Changed
- [Library] update `tag` component to v1.5 ([#694](https://github.com/Orange-OpenSource/ouds-flutter/issues/694))
- [Library] update `input tag` component to v1.2 ([#695](https://github.com/Orange-OpenSource/ouds-flutter/issues/695))
- [Library] update tokens 2.5.0 ([#778](https://github.com/Orange-OpenSource/ouds-flutter/issues/778))
- [Library] update tokens 2.4.0 ([#726](https://github.com/Orange-OpenSource/ouds-flutter/issues/726))

### Fixed
- [Library] `input tag` the whole component should have the role button ([#481](https://github.com/Orange-OpenSource/ouds-flutter/issues/481))

## [1.3.1](https://github.com/Orange-OpenSource/ouds-flutter/compare/1.3.0...1.3.1) - 2026-05-14
### Added
Expand Down
255 changes: 151 additions & 104 deletions ouds_core/lib/components/tag/ouds_input_tag.dart
Original file line number Diff line number Diff line change
Expand Up @@ -58,11 +58,7 @@ class OudsInputTag extends StatefulWidget {
final String label;
final VoidCallback? onPressed;

const OudsInputTag({
super.key,
required this.label,
this.onPressed,
});
const OudsInputTag({super.key, required this.label, this.onPressed});

@override
State<OudsInputTag> createState() => _OudsInputTagState();
Expand Down Expand Up @@ -93,126 +89,173 @@ class _OudsInputTagState extends State<OudsInputTag> {
}

void _handleFocusChange(bool focus) {
if (widget.onPressed == null) _isFocused = false; // Ignore focus changes if disabled
if (widget.onPressed == null)
_isFocused = false; // Ignore focus changes if disabled
setState(() => _isFocused = focus);
}

@override
Widget build(BuildContext context) {
final isDisabled = widget.onPressed == null;
final interactionModelHover = OudsInheritedInteractionModel.of(context, InteractionAspect.hover);
final interactionModelPressed = OudsInheritedInteractionModel.of(context, InteractionAspect.pressed);
final interactionModelHover = OudsInheritedInteractionModel.of(
context,
InteractionAspect.hover,
);
final interactionModelPressed = OudsInheritedInteractionModel.of(
context,
InteractionAspect.pressed,
);
final isHovered = interactionModelHover?.state.isHovered ?? false;
final isPressed = interactionModelPressed?.state.isPressed ?? false;
final tagStateDeterminer = OudsTagControlStateDeterminer(enabled: !isDisabled, isPressed: isPressed || _isPressed, isHovered: isHovered || _isHovered, isFocused: _isFocused);
final tagStateDeterminer = OudsTagControlStateDeterminer(
enabled: !isDisabled,
isPressed: isPressed || _isPressed,
isHovered: isHovered || _isHovered,
isFocused: _isFocused,
);
final tagState = tagStateDeterminer.determineControlState();
final tagBorderModifier = OudsInputTagControlBorderModifier(context);
final tagTextColorModifier = OudsTagStyleModifier(context);
final tagBackgroundColorModifier = OudsInputTagControlBackgroundColorModifier(context);
final tagBackgroundColorModifier =
OudsInputTagControlBackgroundColorModifier(context);

return Visibility(visible: isVisible, child: _buildInputTag(context, tagBorderModifier, tagTextColorModifier, tagBackgroundColorModifier, tagState, isDisabled));
return Visibility(
visible: isVisible,
child: _buildInputTag(
context,
tagBorderModifier,
tagTextColorModifier,
tagBackgroundColorModifier,
tagState,
isDisabled,
),
);
}

Widget _buildInputTag(BuildContext context, OudsInputTagControlBorderModifier tagBorderModifier, OudsTagStyleModifier tagTextColorModifier,
OudsInputTagControlBackgroundColorModifier tagBgColorModifier, OudsTagControlState tagState, bool isDisabled) {
Widget _buildInputTag(
BuildContext context,
OudsInputTagControlBorderModifier tagBorderModifier,
OudsTagStyleModifier tagTextColorModifier,
OudsInputTagControlBackgroundColorModifier tagBgColorModifier,
OudsTagControlState tagState,
bool isDisabled,
) {
final tagToken = OudsTheme.of(context).componentsTokens(context).tag;
final inputTagToken = OudsTheme.of(context).componentsTokens(context).inputTag;
final inputTagToken = OudsTheme.of(
context,
).componentsTokens(context).inputTag;
final borderTokens = OudsTheme.of(context).borderTokens;
final l10n = OudsLocalizations.of(context);

return Semantics(
enabled: !isDisabled,
label: l10n?.core_tag_tag_input_role_a11y,
container: true,
button: true,
child: Material(
color: Colors.transparent,
child: Container(
constraints: BoxConstraints(
minHeight: tagToken.sizeMinHeightInteractiveArea,
),
child: InkWell(
onTap: () {
if (widget.onPressed != null) {
widget.onPressed!.call();
SemanticsService.announce(l10n?.core_tag_tag_input_removed_a11y(widget.label) ?? '', TextDirection.ltr);
}
},
focusNode: _focusNode,
canRequestFocus: !isDisabled,
splashColor: Colors.transparent,
highlightColor: Colors.transparent,
focusColor: Colors.transparent,
hoverColor: Colors.transparent,
onHover: (hovering) {
setState(() {
if (!isDisabled) {
_isHovered = hovering;
}
});
},
onHighlightChanged: (highlighted) {
setState(() {
if (!isDisabled) {
_isPressed = highlighted;
return MergeSemantics(
child: Semantics(
enabled: !isDisabled,
container: true,
button: true,
child: Material(
color: Colors.transparent,
child: Container(
constraints: BoxConstraints(
minHeight: tagToken.sizeMinHeightInteractiveArea,
),
child: InkWell(
onTap: () {
if (widget.onPressed != null) {
widget.onPressed!.call();
SemanticsService.announce(
l10n?.core_tag_tag_input_removed_a11y(widget.label) ?? '',
TextDirection.ltr,
);
}
});
},
child: Stack(
clipBehavior: Clip.none,
alignment: Alignment.center,
children: [
if (_isFocused)
Positioned(
top: borderTokens.widthFocus / 2,
bottom: borderTokens.widthFocus / 2,
left: -borderTokens.widthFocus / 2,
},
focusNode: _focusNode,
canRequestFocus: !isDisabled,
splashColor: Colors.transparent,
highlightColor: Colors.transparent,
focusColor: Colors.transparent,
hoverColor: Colors.transparent,
onHover: (hovering) {
setState(() {
if (!isDisabled) {
_isHovered = hovering;
}
});
},
onHighlightChanged: (highlighted) {
setState(() {
if (!isDisabled) {
_isPressed = highlighted;
}
});
},
child: Stack(
clipBehavior: Clip.none,
alignment: Alignment.center,
children: [
if (_isFocused)
Positioned(
top: borderTokens.widthFocus / 2,
bottom: borderTokens.widthFocus / 2,
left: -borderTokens.widthFocus / 2,

/// to be changed to enhancement the focus.
right: -borderTokens.widthFocus / 2,
/// to be changed to enhancement the focus.
right: -borderTokens.widthFocus / 2,

/// to be changed to enhancement the focus.
child: Container(
decoration: BoxDecoration(
border: OudsBorder().borderAll(
color: OudsTheme.of(context).colorScheme(context).borderFocus,
width: borderTokens.widthFocus,
),
borderRadius: BorderRadius.circular(
tagToken.borderRadius + borderTokens.widthFocus,
/// to be changed to enhancement the focus.
child: Container(
decoration: BoxDecoration(
border: OudsBorder().borderAll(
color: OudsTheme.of(
context,
).colorScheme(context).borderFocus,
width: borderTokens.widthFocus,
),
borderRadius: BorderRadius.circular(
tagToken.borderRadius + borderTokens.widthFocus,
),
),
),
),
),
Container(
decoration: BoxDecoration(
border: OudsBorder().borderAll(
color: _isFocused ? OudsTheme.of(context).colorScheme(context).borderFocusInset : Colors.transparent,
width: inputTagToken.borderWidthDefaultInteraction,
Container(
decoration: BoxDecoration(
border: OudsBorder().borderAll(
color: _isFocused
? OudsTheme.of(
context,
).colorScheme(context).borderFocusInset
: Colors.transparent,
width: inputTagToken.borderWidthDefaultInteraction,
),
borderRadius: BorderRadius.circular(
tagToken.borderRadius,
),
),
borderRadius: BorderRadius.circular(
tagToken.borderRadius,
child: _buildLayout(
context,
tagBorderModifier,
tagTextColorModifier,
tagBgColorModifier,
tagState,
isDisabled,
),
),
child: _buildLayout(
context,
tagBorderModifier,
tagTextColorModifier,
tagBgColorModifier,
tagState,
isDisabled,
),
),
],
],
),
),
),
),
),
);
}

Widget _buildLayout(BuildContext context, OudsInputTagControlBorderModifier tagBorderModifier, OudsTagStyleModifier tagTextColorModifier,
OudsInputTagControlBackgroundColorModifier tagBgColorModifier, OudsTagControlState tagState, bool isDisabled) {
Widget _buildLayout(
BuildContext context,
OudsInputTagControlBorderModifier tagBorderModifier,
OudsTagStyleModifier tagTextColorModifier,
OudsInputTagControlBackgroundColorModifier tagBgColorModifier,
OudsTagControlState tagState,
bool isDisabled,
) {
final tagToken = OudsTheme.of(context).componentsTokens(context).tag;
final typographyTokens = OudsTheme.of(context).typographyTokens;

Expand All @@ -222,18 +265,14 @@ class _OudsInputTagState extends State<OudsInputTag> {
child: Container(
decoration: BoxDecoration(
border: tagBorderModifier.getBorder(tagState),
borderRadius: BorderRadius.circular(
tagToken.borderRadius,
),
borderRadius: BorderRadius.circular(tagToken.borderRadius),
),
),
),

// Content (e.g., Row with icon and label)...
ClipRRect(
borderRadius: BorderRadius.circular(
tagToken.borderRadius,
),
borderRadius: BorderRadius.circular(tagToken.borderRadius),
child: Container(
color: tagBgColorModifier.getBackgroundColor(tagState),
padding: EdgeInsetsDirectional.only(
Expand All @@ -248,16 +287,22 @@ class _OudsInputTagState extends State<OudsInputTag> {
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Flexible(
child: Text(widget.label,
textAlign: TextAlign.center,
style: typographyTokens.typeLabelStrongMedium(context).copyWith(
color: tagTextColorModifier.getTextColor(tagState),
)),
child: Text(
widget.label,
textAlign: TextAlign.center,
style: typographyTokens
.typeLabelModerateMedium(context)
.copyWith(
color: tagTextColorModifier.getTextColor(tagState),
),
),
),
SizedBox(width: tagToken.spaceColumnGapDefault),
Semantics(
container: true,
label: OudsLocalizations.of(context)?.core_inputTag_delete_a11y,
label: OudsLocalizations.of(
context,
)?.core_inputTag_delete_a11y,
button: true,
child: SvgPicture.asset(
excludeFromSemantics: true,
Expand All @@ -267,7 +312,9 @@ class _OudsInputTagState extends State<OudsInputTag> {
package: OudsTheme.of(context).packageName,
fit: BoxFit.contain,
colorFilter: ColorFilter.mode(
OudsInputTagControlIconColorModifier(context).getIconColor(tagState)!,
OudsInputTagControlIconColorModifier(
context,
).getIconColor(tagState)!,
BlendMode.srcIn,
),
),
Expand Down
Loading
Loading