diff --git a/.github/workflows/build-example.yml b/.github/workflows/build-example.yml index 48cf10c..cc56d35 100644 --- a/.github/workflows/build-example.yml +++ b/.github/workflows/build-example.yml @@ -16,14 +16,6 @@ env: WATCHSCHEME: Example jobs: - - build: - name: Swift Build (SPM) - runs-on: macos-latest - steps: - - uses: actions/checkout@v2 - - name: Build - run: swift build example: name: Run examples diff --git a/.github/workflows/bump.yml b/.github/workflows/bump.yml new file mode 100644 index 0000000..90999e6 --- /dev/null +++ b/.github/workflows/bump.yml @@ -0,0 +1,24 @@ +name: Bump version +on: + pull_request: + types: + - closed + branches: + - main + +jobs: + + tag: + name: Create tag + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + with: + fetch-depth: '0' + + - name: Bump version and push tag + uses: anothrNick/github-tag-action@master + env: + GITHUB_TOKEN: ${{ secrets.ACTIONS_TOKEN }} + WITH_V: false + DEFAULT_BUMP: patch diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..0242e2a --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,16 @@ +name: Release + +on: + push: + tags: + - "*.*.*" + +jobs: + build: + name: Create release + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v3 + - name: Release + uses: softprops/action-gh-release@v1 diff --git a/README.md b/README.md index f192e5e..208c091 100644 --- a/README.md +++ b/README.md @@ -141,6 +141,7 @@ TextField("Text", text: $placeholder)) } ``` +More information on in the [DocC documentation](https://oversizedev.github.io/OversizeUI/documentation/oversizeui/) #### Swift Lint This project uses [SwiftLint](https://github.com/realm/SwiftLint) to automatically lint our Swift code for common errors. Please install it when developing in this repo by following the [SwiftLint Installation Instructions](https://realm.github.io/SwiftLint/). diff --git a/Sources/OversizeUI/Controls/Avatar/AvatarModifiers.swift b/Sources/OversizeUI/Controls/Avatar/AvatarModifiers.swift index ced026d..0e1db62 100644 --- a/Sources/OversizeUI/Controls/Avatar/AvatarModifiers.swift +++ b/Sources/OversizeUI/Controls/Avatar/AvatarModifiers.swift @@ -1,5 +1,4 @@ // -// // Copyright © 2021 Aleksandr Romanov // AvatarModifiers.swift, created on 10.03.2023 // diff --git a/Sources/OversizeUI/Controls/Button/FieldButtonStyle.swift b/Sources/OversizeUI/Controls/Button/FieldButtonStyle.swift index 38be18e..259b72d 100644 --- a/Sources/OversizeUI/Controls/Button/FieldButtonStyle.swift +++ b/Sources/OversizeUI/Controls/Button/FieldButtonStyle.swift @@ -35,6 +35,7 @@ public struct FieldButtonStyle: ButtonStyle { : Color.surfaceSecondary, lineWidth: CGFloat(theme.borderSize)) ) case .top, .bottom, .center: + #if os(iOS) RoundedRectangleCorner(radius: Radius.medium, corners: backgroundShapeCorners) .fill(isPressed ? Color.surfaceTertiary : Color.surfaceSecondary) .overlay( @@ -43,9 +44,21 @@ public struct FieldButtonStyle: ButtonStyle { ? Color.border : Color.surfaceSecondary, lineWidth: CGFloat(theme.borderSize)) ) + #else + RoundedRectangle(cornerRadius: Radius.medium, style: .continuous) + .fill(isPressed ? Color.surfaceTertiary : Color.surfaceSecondary) + .overlay( + RoundedRectangle(cornerRadius: Radius.medium, + style: .continuous) + .stroke(theme.borderTextFields + ? Color.border + : Color.surfaceSecondary, lineWidth: CGFloat(theme.borderSize)) + ) + #endif } } + #if os(iOS) @available(macOS, unavailable) @available(watchOS, unavailable) @available(tvOS, unavailable) @@ -61,6 +74,7 @@ public struct FieldButtonStyle: ButtonStyle { return [] } } + #endif } public extension ButtonStyle where Self == FieldButtonStyle { diff --git a/Sources/OversizeUI/Controls/TextField/LabeledTextFieldStyle.swift b/Sources/OversizeUI/Controls/TextField/LabeledTextFieldStyle.swift index d2563ef..286e963 100644 --- a/Sources/OversizeUI/Controls/TextField/LabeledTextFieldStyle.swift +++ b/Sources/OversizeUI/Controls/TextField/LabeledTextFieldStyle.swift @@ -55,11 +55,14 @@ public struct LabeledTextFieldStyle: TextFieldStyle { ) .fill(isFocused ? Color.surfacePrimary : Color.surfaceSecondary) case .top, .bottom, .center: + #if os(iOS) RoundedRectangleCorner(radius: Radius.medium, corners: backgroundShapeCorners) .fill(isFocused ? Color.surfacePrimary : Color.surfaceSecondary) + #endif } } + #if os(iOS) @available(macOS, unavailable) @available(watchOS, unavailable) @available(tvOS, unavailable) @@ -75,6 +78,7 @@ public struct LabeledTextFieldStyle: TextFieldStyle { return [] } } + #endif private var fieldOffset: CGFloat { switch fieldPlaceholderPosition { @@ -97,8 +101,16 @@ public struct LabeledTextFieldStyle: TextFieldStyle { ) .stroke(overlayBorderColor, lineWidth: isFocused ? 2 : CGFloat(theme.borderSize)) case .top, .bottom, .center: + #if os(iOS) RoundedRectangleCorner(radius: Radius.medium, corners: backgroundShapeCorners) .stroke(overlayBorderColor, lineWidth: isFocused ? 2 : CGFloat(theme.borderSize)) + #else + RoundedRectangle( + cornerRadius: Radius.medium, + style: .continuous + ) + .stroke(overlayBorderColor, lineWidth: isFocused ? 2 : CGFloat(theme.borderSize)) + #endif } }