Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Swift package `SwiftLintPlugins` from v0.60.0 to v0.60.1
- Update various GitHub Actions workflows dependencies
- Tuning of themes (like rounded corners) (Orange-OpenSource/ouds-ios#951)

### Fixed

- Filter chip component should not have a button trait (Orange-OpenSource#956)
- Badge component does not have bigger sizes if text sizes is increased (Orange-OpenSource#844)

## [0.18.0](https://github.com/Orange-OpenSource/ouds-ios/compare/0.17.0...0.18.0) - 2025-09-05
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -124,13 +124,20 @@ public struct OUDSFilterChip: View { // TODO: #407 - Add documentation hyperlink
Chip(layout: layout, selected: selected, interactionState: ChipInteractionState(with: $0))
}
.accessibilityAddTraits(selected ? [.isSelected] : [])
.accessibilityAddTraits(.isButton)
.accessibilityRemoveTraits([.isButton])
.accessibilityHint(accessibilityHint)
.accessibilityLabel(accessibilityLabel)
.modifier(IsToggleModifier())
}

/// If the device OS is > iOS 17, the toggle trait is added thanks to `IsToggleModifier`.
/// Thus an hint is automatically added and a custom hint is not needed anymore/
private var accessibilityHint: String {
(selected ? "core_filterchip_hint_selected_a11y" : "core_filterchip_hint_unselected_a11y").localized()
if #available(iOS 17.0, *) {
Copy link
Member

Choose a reason for hiding this comment

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

Est-ce que l'on ne pouvais pas faire ceci dans le modifier ?
et avec le clef de wording core_common_selected_a11y ?
Et utiliser pour le radio et peut -êttre le picker ?

""
} else {
(selected ? "core_filterchip_hint_selected_a11y" : "core_filterchip_hint_unselected_a11y").localized()
}
}

private var accessibilityLabel: String {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
//
// Software Name: OUDS iOS
// SPDX-FileCopyrightText: Copyright (c) Orange SA
// SPDX-License-Identifier: MIT
//
// This software is distributed under the MIT license,
// the text of which is available at https://opensource.org/license/MIT/
// or see the "LICENSE" file for more details.
//
// Authors: See CONTRIBUTORS.txt
// Software description: A SwiftUI components library with code examples for Orange Unified Design System
//

import SwiftUI

/// A `ViewModifier` adding the `isToggle` trait to the target view
/// if and only if the operating system is at least**iOS 17.0**.
struct IsToggleModifier: ViewModifier {

func body(content: Content) -> some View {
#if canImport(UIKit) // Remember: doc is generated with non-iOS aware tool...
if #available(iOS 17.0, *) {
content.accessibilityAddTraits(.isToggle)
} else {
content
}
#else
content
#endif
}
}