From ef10967200ca2c305f694e7a1dd73d2c6b78045f Mon Sep 17 00:00:00 2001 From: Ludovic PINEL Date: Fri, 4 Oct 2024 14:02:38 +0200 Subject: [PATCH] Add border on view with opacity --- CHANGELOG.md | 1 + Showcase/Showcase.xcodeproj/project.pbxproj | 6 ++---- .../Showcase/Pages/Tokens/Opacity/OpacityTokenPage.swift | 5 +++++ 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8c4d72bd5..0162afa33 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Added +- [DemoApp] On opacity screen, add a border around the view showing the opacity ([#157](https://github.com/Orange-OpenSource/ouds-ios/issues/157)) - [Library] Add color semantic tokens `colorBackgroundStatusNeutral`, some `OnBackgroundEmphasized`, `colorBackgroundAction`, `colorBackgroundAlways`, `colorContent` variants - [Library] Add typography semantic tokens for font letter spacing - [DemoApp] Create token section (Border, Typography, Elevation, Opacity) ([#120](https://github.com/Orange-OpenSource/ouds-ios/issues/120)) diff --git a/Showcase/Showcase.xcodeproj/project.pbxproj b/Showcase/Showcase.xcodeproj/project.pbxproj index 1a92f7531..4bfaa4e06 100644 --- a/Showcase/Showcase.xcodeproj/project.pbxproj +++ b/Showcase/Showcase.xcodeproj/project.pbxproj @@ -86,7 +86,6 @@ 073543172CA172CA001187EA /* TypographyTokenElement.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TypographyTokenElement.swift; sourceTree = ""; }; 0735431A2CA18C48001187EA /* TypographyTokenPage.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TypographyTokenPage.swift; sourceTree = ""; }; 073543222CA192F9001187EA /* TokenElement.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = TokenElement.swift; sourceTree = ""; }; - 073543232CA192F9001187EA /* ShacaseElementPage.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ShacaseElementPage.swift; sourceTree = ""; }; 074008222C942810006B8729 /* Snapshot.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Snapshot.swift; sourceTree = ""; }; 0740A9872C9833670069D24A /* Appfile */ = {isa = PBXFileReference; lastKnownFileType = text; name = Appfile; path = fastlane/Appfile; sourceTree = ""; }; 0740A9882C9833670069D24A /* Fastfile */ = {isa = PBXFileReference; lastKnownFileType = text; name = Fastfile; path = fastlane/Fastfile; sourceTree = ""; }; @@ -132,7 +131,7 @@ 51BD761C2C466FCF0033365D /* WebView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = WebView.swift; sourceTree = ""; }; 51BD761E2C466FCF0033365D /* Showcase.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Showcase.swift; sourceTree = ""; }; 51BD761F2C466FCF0033365D /* MainView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = MainView.swift; sourceTree = ""; }; - 51E3FF0A2CAFD9AE00F1BC59 /* ShowcaseElementPage.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; name = ShowcaseElementPage.swift; path = Showcase/Pages/Utils/ShowcaseElementPage.swift; sourceTree = ""; }; + 51E3FF0A2CAFD9AE00F1BC59 /* ShowcaseElementPage.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ShowcaseElementPage.swift; sourceTree = ""; }; 974E2EAB64D9123627CD7D29 /* Pods-DemoApp.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-DemoApp.release.xcconfig"; path = "Target Support Files/Pods-DemoApp/Pods-DemoApp.release.xcconfig"; sourceTree = ""; }; BF4130905502F287757622E2 /* Pods-DemoApp.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-DemoApp.debug.xcconfig"; path = "Target Support Files/Pods-DemoApp/Pods-DemoApp.debug.xcconfig"; sourceTree = ""; }; E0D3017314DBC1733F8D0C79 /* Pods_Showcase.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Showcase.framework; sourceTree = BUILT_PRODUCTS_DIR; }; @@ -182,8 +181,8 @@ children = ( 0735430F2CA15440001187EA /* Cards */, 51BD760F2C466FCF0033365D /* ShowcaseElementsPage.swift */, + 51E3FF0A2CAFD9AE00F1BC59 /* ShowcaseElementPage.swift */, 073543152CA17275001187EA /* ShowcaseElement.swift */, - 073543232CA192F9001187EA /* ShacaseElementPage.swift */, ); path = Utils; sourceTree = ""; @@ -262,7 +261,6 @@ 07FDCD882C296A500009AA13 = { isa = PBXGroup; children = ( - 51E3FF0A2CAFD9AE00F1BC59 /* ShowcaseElementPage.swift */, 07FDCDA32C296B170009AA13 /* 🛠 */, 51BD76202C466FCF0033365D /* Showcase */, 0740A9902C9873500069D24A /* ShowcaseTests */, diff --git a/Showcase/Showcase/Pages/Tokens/Opacity/OpacityTokenPage.swift b/Showcase/Showcase/Pages/Tokens/Opacity/OpacityTokenPage.swift index b556e32f5..3bd626491 100644 --- a/Showcase/Showcase/Pages/Tokens/Opacity/OpacityTokenPage.swift +++ b/Showcase/Showcase/Pages/Tokens/Opacity/OpacityTokenPage.swift @@ -12,6 +12,7 @@ // import OUDS +import OUDSComponents // for BorderStyleModifier import OUDSTokensSemantic import SwiftUI @@ -50,6 +51,10 @@ struct OpacityTokenPage: View { Rectangle().fill(colorScheme == .dark ? .white : .black) .opacity(opacityToken) .frame(width: 44, height: 44) + .oudsBorder(style: theme.borderStyleDefault, + width: theme.borderWidthThin, + radius: theme.borderRadiusNone, + color: theme.colorContentDefault!) .transformEffect(CGAffineTransform(translationX: 10, y: 10)) } .frame(width: 54, height: 54, alignment: .leading)