diff --git a/CHANGELOG.md b/CHANGELOG.md index 99155d67fb..3d91f14649 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased](https://github.com/Orange-OpenSource/ouds-ios/compare/0.8.0...develop) +### Changed + +- [DemoApp] Update show code text ([#361](https://github.com/Orange-OpenSource/ouds-ios/issues/361)) + ## [0.8.0](https://github.com/Orange-OpenSource/ouds-ios/compare/0.7.0...0.8.0) - 2024-12-18 ### Added diff --git a/Showcase/Podfile.lock b/Showcase/Podfile.lock index be0f1c0c46..d2954713dc 100644 --- a/Showcase/Podfile.lock +++ b/Showcase/Podfile.lock @@ -1,10 +1,10 @@ PODS: - SwiftFormat/CLI (0.55.3) - - SwiftLint (0.57.0) + - SwiftLint (0.57.1) DEPENDENCIES: - SwiftFormat/CLI (= 0.55.3) - - SwiftLint (= 0.57.0) + - SwiftLint (= 0.57.1) SPEC REPOS: trunk: @@ -13,8 +13,8 @@ SPEC REPOS: SPEC CHECKSUMS: SwiftFormat: 2f3558ca02842dcd3fd970360d2d4054bd21624a - SwiftLint: eb47480d47c982481592c195c221d11013a679cc + SwiftLint: 92196976e597b9afec5dbe374810103e6c1d9d7c -PODFILE CHECKSUM: 48af44a98a1ebfa588f530c218eac9369a4515bf +PODFILE CHECKSUM: c4ad93a479bf732e918b4e92f458ff72333a85fc COCOAPODS: 1.16.2 diff --git a/Showcase/Showcase/Pages/Components/Utils/ComponentPage.swift b/Showcase/Showcase/Pages/Components/Utils/ComponentPage.swift index 4cfbc7df80..620996e479 100644 --- a/Showcase/Showcase/Pages/Components/Utils/ComponentPage.swift +++ b/Showcase/Showcase/Pages/Components/Utils/ComponentPage.swift @@ -52,7 +52,7 @@ struct ComponentConfigurationView: View where Componen } .padding(.horizontal, theme.spaces.spaceFixedMedium) - ShowcaseCode(code: configuration.code) + ShowcaseCode(code: configuration.code, titleText: "app_components_common_viewCodeExample_label") .padding(.horizontal, theme.spaces.spaceFixedMedium) } .padding(.bottom, theme.spaces.spaceFixedMedium) diff --git a/Showcase/Showcase/Pages/Tokens/Border/BorderTokenPage.swift b/Showcase/Showcase/Pages/Tokens/Border/BorderTokenPage.swift index 7b9c4d882a..3d29c124ca 100644 --- a/Showcase/Showcase/Pages/Tokens/Border/BorderTokenPage.swift +++ b/Showcase/Showcase/Pages/Tokens/Border/BorderTokenPage.swift @@ -24,7 +24,7 @@ struct BorderTokenPage: View { VStack(alignment: .leading, spacing: theme.spaces.spaceFixedMedium) { Section { VStack(alignment: .leading, spacing: theme.spaces.spaceFixedNone) { - ShowcaseCode(code: "theme.borders.borderWidthDefault") + ShowcaseCode(code: "theme.borders.borderWidthDefault", titleText: "app_tokens_common_viewCodeExample_label") } } Section { diff --git a/Showcase/Showcase/Pages/Tokens/Color/ColorTokenPage.swift b/Showcase/Showcase/Pages/Tokens/Color/ColorTokenPage.swift index d00f9fec67..b42feeddb4 100644 --- a/Showcase/Showcase/Pages/Tokens/Color/ColorTokenPage.swift +++ b/Showcase/Showcase/Pages/Tokens/Color/ColorTokenPage.swift @@ -26,7 +26,7 @@ struct ColorTokenPage: View { var body: some View { Group { Section { - ShowcaseCode(code: "theme.colors.colorBgPrimary.color(for: colorScheme)") + ShowcaseCode(code: "theme.colors.colorBgPrimary.color(for: colorScheme)", titleText: "app_tokens_common_viewCodeExample_label") } Section { illustrationForAction() } header: { header("Action") } Section { illustrationForAlways() } header: { header("Always") } diff --git a/Showcase/Showcase/Pages/Tokens/Dimension/Size/SizeTokenPage.swift b/Showcase/Showcase/Pages/Tokens/Dimension/Size/SizeTokenPage.swift index 4bb5370073..c77b781d78 100644 --- a/Showcase/Showcase/Pages/Tokens/Dimension/Size/SizeTokenPage.swift +++ b/Showcase/Showcase/Pages/Tokens/Dimension/Size/SizeTokenPage.swift @@ -22,7 +22,7 @@ struct SizeTokenPage: View { var body: some View { Group { Section { - ShowcaseCode(code: "theme.sizeIconWithHeadingXLargeShort.dimension(for: horizontalSizeClass ?? .regular)") + ShowcaseCode(code: "theme.sizeIconWithHeadingXLargeShort.dimension(for: horizontalSizeClass ?? .regular)", titleText: "app_tokens_common_viewCodeExample_label") } Section { ForEach(NamedSize.IconDecorative.allCases, id: \.rawValue) { namedSize in diff --git a/Showcase/Showcase/Pages/Tokens/Dimension/Space/SpaceTokenPage.swift b/Showcase/Showcase/Pages/Tokens/Dimension/Space/SpaceTokenPage.swift index cbb282bdfb..3d413d8cd8 100644 --- a/Showcase/Showcase/Pages/Tokens/Dimension/Space/SpaceTokenPage.swift +++ b/Showcase/Showcase/Pages/Tokens/Dimension/Space/SpaceTokenPage.swift @@ -28,7 +28,7 @@ struct SpaceTokenPage: View { var body: some View { Group { Section { - ShowcaseCode(code: "theme.spaceScaledMedium.dimension(for: horizontalSizeClass ?? .regular)") + ShowcaseCode(code: "theme.spaceScaledMedium.dimension(for: horizontalSizeClass ?? .regular)", titleText: "app_tokens_common_viewCodeExample_label") } // Basic Space Tokens Section { ScaledSpaceProperty() } header: { diff --git a/Showcase/Showcase/Pages/Tokens/Elevation/ElevationTokenPage.swift b/Showcase/Showcase/Pages/Tokens/Elevation/ElevationTokenPage.swift index 0b031a2a22..dee52531fd 100644 --- a/Showcase/Showcase/Pages/Tokens/Elevation/ElevationTokenPage.swift +++ b/Showcase/Showcase/Pages/Tokens/Elevation/ElevationTokenPage.swift @@ -26,7 +26,7 @@ struct ElevationTokenPage: View { var body: some View { VStack(alignment: .leading, spacing: theme.spaces.spaceFixedNone) { Section { - ShowcaseCode(code: "theme.elevations.elevationNone.elevation(for: colorScheme)") + ShowcaseCode(code: "theme.elevations.elevationNone.elevation(for: colorScheme)", titleText: "app_tokens_common_viewCodeExample_label") } Spacer().frame(height: theme.spaces.spaceFixedMedium) diff --git a/Showcase/Showcase/Pages/Tokens/Font/FontTokenPage.swift b/Showcase/Showcase/Pages/Tokens/Font/FontTokenPage.swift index 0b7f75a8e8..29138d677c 100644 --- a/Showcase/Showcase/Pages/Tokens/Font/FontTokenPage.swift +++ b/Showcase/Showcase/Pages/Tokens/Font/FontTokenPage.swift @@ -26,7 +26,7 @@ struct FontTokenPage: View { var body: some View { VStack(alignment: .leading, spacing: theme.spaces.spaceFixedNone) { Section { - ShowcaseCode(code: "theme.typeBodyStrongLarge(theme)") + ShowcaseCode(code: "theme.typeBodyStrongLarge(theme)", titleText: "app_tokens_common_viewCodeExample_label") } Spacer() diff --git a/Showcase/Showcase/Pages/Tokens/Grid/GrisTokenPage.swift b/Showcase/Showcase/Pages/Tokens/Grid/GrisTokenPage.swift index 420830fa5a..9544449fba 100644 --- a/Showcase/Showcase/Pages/Tokens/Grid/GrisTokenPage.swift +++ b/Showcase/Showcase/Pages/Tokens/Grid/GrisTokenPage.swift @@ -42,7 +42,7 @@ struct GridTokenPage: View { } Section { - ShowcaseCode(code: "theme.gridColumnCount(for: horizontalSizeClass)") + ShowcaseCode(code: "theme.gridColumnCount(for: horizontalSizeClass)", titleText: "app_tokens_common_viewCodeExample_label") } Section { illustrationForGridTokens() } header: { diff --git a/Showcase/Showcase/Pages/Tokens/Opacity/OpacityTokenPage.swift b/Showcase/Showcase/Pages/Tokens/Opacity/OpacityTokenPage.swift index 7391b82a13..dad26731f0 100644 --- a/Showcase/Showcase/Pages/Tokens/Opacity/OpacityTokenPage.swift +++ b/Showcase/Showcase/Pages/Tokens/Opacity/OpacityTokenPage.swift @@ -25,7 +25,7 @@ struct OpacityTokenPage: View { var body: some View { VStack(alignment: .leading, spacing: theme.spaces.spaceFixedNone) { Section { - ShowcaseCode(code: "theme.opacities.opacityInvisible") + ShowcaseCode(code: "theme.opacities.opacityInvisible", titleText: "app_tokens_common_viewCodeExample_label") } Spacer() .frame(height: theme.spaces.spaceFixedMedium) diff --git a/Showcase/Showcase/Pages/Utils/ShowcaseCode.swift b/Showcase/Showcase/Pages/Utils/ShowcaseCode.swift index 1ee08a917a..aeb17befd6 100644 --- a/Showcase/Showcase/Pages/Utils/ShowcaseCode.swift +++ b/Showcase/Showcase/Pages/Utils/ShowcaseCode.swift @@ -26,6 +26,7 @@ struct ShowcaseCode: View { @State private var isCodeVisible = false let code: String + let titleText: LocalizedStringKey // MARK: Body @@ -44,7 +45,7 @@ struct ShowcaseCode: View { VStack(alignment: .leading, spacing: theme.spaces.spaceFixedNone) { Button(action: toggle) { HStack { - Text("app_tokens_code_title_label") + Text(titleText) .typeBodyStrongLarge(theme) .foregroundStyle(theme.colors.colorContentDefault.color(for: colorScheme)) .padding(.vertical, theme.spaces.spacePaddingInlineShort) @@ -55,7 +56,7 @@ struct ShowcaseCode: View { .foregroundColor(theme.colors.colorSurfaceBrandPrimary.color(for: colorScheme)) .frame(width: 20, height: 20) .padding(.trailing, theme.spaces.spacePaddingInlineMedium) - .accessibilityLabel("app_tokens_code_visibility_button_a11y") + .accessibilityLabel("app_common_viewCodeExample_label_a11y") } } .buttonStyle(PlainButtonStyle()) @@ -85,7 +86,7 @@ struct ShowcaseCode: View { .frame(width: 24, height: 24) .padding(.trailing, theme.spaces.spacePaddingInlineMedium) .alignmentGuide(.firstTextBaseline) { $0[.bottom] * 0.7 } - .accessibilityLabel("app_tokens_code_copy_button_a11y") + .accessibilityLabel("app_common_copyCode_a11y") } }) } @@ -94,7 +95,7 @@ struct ShowcaseCode: View { .padding(.leading, theme.spaces.spacePaddingInlineMedium) .background(theme.colors.colorBgSecondary.color(for: colorScheme)) .accessibilityElement(children: .combine) - .accessibilityHint("app_tokens_code_copy_button_a11y") + .accessibilityHint("app_common_copyCode_a11y") .overlay( Rectangle() .opacity(theme.opacities.opacityInvisible) diff --git a/Showcase/Showcase/Resources/en.lproj/Localizable.strings b/Showcase/Showcase/Resources/en.lproj/Localizable.strings index 364ef1e5b5..0bfbb6299b 100644 --- a/Showcase/Showcase/Resources/en.lproj/Localizable.strings +++ b/Showcase/Showcase/Resources/en.lproj/Localizable.strings @@ -11,6 +11,10 @@ // Software description: A SwiftUI components library with code examples for Orange Unified Design System // +// MARK: - Common +"app_common_viewCodeExample_label_a11y" = "Toggle code visibility"; +"app_common_copyCode_a11y" = "Copy code"; + // MARK: - bottomBar "app_bottomBar_components_label" = "Components"; @@ -27,6 +31,8 @@ // MARK: - Tokens Screen +"app_tokens_common_viewCodeExample_label" = "View token code example"; + "app_tokens_border_label" = "Border"; "app_tokens_border_width_label" = "Width"; "app_tokens_border_radius_label" = "Radius"; @@ -70,11 +76,9 @@ "app_tokens_typography_label" = "Font"; "app_tokens_typography_description_text" = "Font is our system of fonts and text styles. They enhance communication and reinforce the brand style."; -"app_tokens_code_title_label" = "View token code example"; -"app_tokens_code_visibility_button_a11y" = "Toggle code visibility"; -"app_tokens_code_copy_button_a11y" = "Copy code to clipboard"; - // MARK: - Component Screen +"app_components_common_viewCodeExample_label" = "View component code example"; + "app_component_emptyContent_text" = "No content"; "app_component_emptyContent_description_text" = "This content is under construction and will be available very soon";