Skip to content

Commit

Permalink
Merge pull request #27 from oversizedev/develop
Browse files Browse the repository at this point in the history
  • Loading branch information
aromanov91 authored May 6, 2023
2 parents 24f00f0 + 6f8da01 commit 05bb860
Show file tree
Hide file tree
Showing 7 changed files with 67 additions and 9 deletions.
8 changes: 0 additions & 8 deletions .github/workflows/build-example.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
24 changes: 24 additions & 0 deletions .github/workflows/bump.yml
Original file line number Diff line number Diff line change
@@ -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
16 changes: 16 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -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
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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/).
Expand Down
1 change: 0 additions & 1 deletion Sources/OversizeUI/Controls/Avatar/AvatarModifiers.swift
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
//
//
// Copyright © 2021 Aleksandr Romanov
// AvatarModifiers.swift, created on 10.03.2023
//
Expand Down
14 changes: 14 additions & 0 deletions Sources/OversizeUI/Controls/Button/FieldButtonStyle.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand All @@ -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)
Expand All @@ -61,6 +74,7 @@ public struct FieldButtonStyle: ButtonStyle {
return []
}
}
#endif
}

public extension ButtonStyle where Self == FieldButtonStyle {
Expand Down
12 changes: 12 additions & 0 deletions Sources/OversizeUI/Controls/TextField/LabeledTextFieldStyle.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -75,6 +78,7 @@ public struct LabeledTextFieldStyle: TextFieldStyle {
return []
}
}
#endif

private var fieldOffset: CGFloat {
switch fieldPlaceholderPosition {
Expand All @@ -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
}
}

Expand Down

0 comments on commit 05bb860

Please sign in to comment.