Skip to content

Commit

Permalink
Develop (#40)
Browse files Browse the repository at this point in the history
* Fix CI

* Add Page component and other small improvements

* Fix CI (#38)

* Fix CI

* Update release.yml
# Conflicts:
#	.github/workflows/release.yml

* Update CI

* Upd CI

* Upd CI

* Fig platform supports

* Upd

* Update ci-pull-request.yml

* Update ci-pull-request.yml

* Update ci-pull-request.yml

* Update ci-pull-request.yml

* Update ci-pull-request.yml

* Update ci-pull-request.yml

* Update ci-pull-request.yml

* Update gitignore

* Fix CI

* Fix warnings

* Update CI

* Fix ci

* Delete .swiftpm/xcode directory

* Fix macOS and tvOS error, disable SwiftGen and format code

* Fix CI

* Add Page component and other small improvements

* Fix CI (#38)

* Fix CI

* Update release.yml
# Conflicts:
#	.github/workflows/release.yml

* Update CI

* Upd CI

* Upd CI

* Fig platform supports

* Upd

* Update ci-pull-request.yml

* Update ci-pull-request.yml

* Update ci-pull-request.yml

* Update ci-pull-request.yml

* Update ci-pull-request.yml

* Update ci-pull-request.yml

* Update ci-pull-request.yml

* Fix CI

* Fix warnings

* Update CI

* Fix macOS and tvOS error, disable SwiftGen and format code
  • Loading branch information
aromanov91 authored May 18, 2024
1 parent 6285add commit 93cea1f
Show file tree
Hide file tree
Showing 50 changed files with 1,416 additions and 400 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/publish-docc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: macos-12
runs-on: macos-14
steps:
- name: Checkout 🛎️
uses: actions/checkout@v3
Expand Down
8 changes: 1 addition & 7 deletions Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -19,17 +19,11 @@ let package = Package(
targets: ["OversizeUI"]
),
],
dependencies: [
.package(url: "https://github.com/SwiftGen/SwiftGenPlugin", .upToNextMajor(from: "6.6.2")),
],
targets: [
.target(
name: "OversizeUI",
dependencies: [],
resources: [.process("Resources")],
plugins: [
.plugin(name: "SwiftGenPlugin", package: "SwiftGenPlugin"),
]
resources: [.process("Resources")]
),
.testTarget(name: "OversizeUITests", dependencies: ["OversizeUI"]),
]
Expand Down
1 change: 0 additions & 1 deletion Sources/OversizeUI/Controls/Avatar/Avatar.swift
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ public enum AvatarBackgroundType {
/// ```
///
public struct Avatar: View {

#if !os(tvOS)
@Environment(\.controlSize) var controlSize: ControlSize
#endif
Expand Down
10 changes: 5 additions & 5 deletions Sources/OversizeUI/Controls/Background/Background.swift
Original file line number Diff line number Diff line change
Expand Up @@ -53,20 +53,20 @@ public struct Background<Content: View>: View {
private var paddingSize: CGFloat {
switch padding {
case .medium:
return Constants.paddingMedium
Constants.paddingMedium
case .small:
return Constants.paddingSmall
Constants.paddingSmall
}
}

private var backgroundColor: Color {
switch background {
case .primary:
return Constants.colorPrimary
Constants.colorPrimary
case .secondary:
return Constants.colorSecondary
Constants.colorSecondary
case .tertiary:
return Constants.colorTertiary
Constants.colorTertiary
}
}
}
36 changes: 18 additions & 18 deletions Sources/OversizeUI/Controls/Button/BarButton.swift
Original file line number Diff line number Diff line change
Expand Up @@ -61,61 +61,61 @@ public struct BarButton: View {
private var controlSize: ControlSize {
switch type {
case .close, .closeAction, .back, .backAction, .image, .icon:
return .mini
.mini
default:
return .small
.small
}
}

private var isAccent: Bool {
switch type {
case .accent:
return true
true
default:
return false
false
}
}

private var isDisabled: Bool {
switch type {
case .disabled:
return true
true
default:
return false
false
}
}

private var buttonStyle: OversizeButtonStyle {
switch type {
case .close, .closeAction, .back, .backAction, .image, .icon, .secondary:
return .secondary
.secondary
case .accent, .primary:
return .primary
.primary
case .disabled:
return .tertiary
.tertiary
}
}

private var buttonAction: () -> Void {
switch type {
case .back, .close:
return { dismiss() }
{ dismiss() }
case let .closeAction(action: action):
return action
action
case let .backAction(action: action):
return action
action
case let .accent(_, action: action):
return action
action
case let .primary(_, action: action):
return action
action
case let .secondary(_, action: action):
return action
action
case .disabled:
return {}
{}
case let .image(_, action: action):
return action
action
case let .icon(_, action: action):
return action
action
}
}

Expand Down
36 changes: 18 additions & 18 deletions Sources/OversizeUI/Controls/Button/Button.swift
Original file line number Diff line number Diff line change
Expand Up @@ -78,56 +78,56 @@ public struct OversizeButtonStyle: ButtonStyle {
switch type {
case .primary:
switch role {
case .some(.destructive): return Color.error
case .some(.cancel): return Color.accent
case .some(.destructive): Color.error
case .some(.cancel): Color.accent
default:
if isAccent {
return Color.accent
Color.accent
} else {
return Color.primary
Color.primary
}
}
case .secondary:
return Color.surfacePrimary
Color.surfacePrimary
case .tertiary:
return Color.surfaceSecondary
Color.surfaceSecondary
case .quaternary:
return Color.clear
Color.clear
}
}

private func foregroundColor(for role: ButtonRole?) -> Color {
switch type {
case .primary:
switch role {
case .some(.destructive), .some(.cancel): return Color.onPrimaryHighEmphasis
case .some(.destructive), .some(.cancel): Color.onPrimaryHighEmphasis
default:
if isAccent {
return Color.onPrimaryHighEmphasis
Color.onPrimaryHighEmphasis
} else {
return Color.backgroundPrimary
Color.backgroundPrimary
}
}
case .secondary, .quaternary:
switch role {
case .some(.destructive): return Color.error
case .some(.cancel): return Color.accent
case .some(.destructive): Color.error
case .some(.cancel): Color.accent
default:
if isAccent {
return Color.accent
Color.accent
} else {
return Color.onSurfaceHighEmphasis
Color.onSurfaceHighEmphasis
}
}
case .tertiary:
switch role {
case .some(.destructive): return Color.error
case .some(.cancel): return Color.onSurfaceHighEmphasis
case .some(.destructive): Color.error
case .some(.cancel): Color.onSurfaceHighEmphasis
default:
if isAccent {
return Color.accent
Color.accent
} else {
return Color.onSurfaceHighEmphasis
Color.onSurfaceHighEmphasis
}
}
}
Expand Down
8 changes: 4 additions & 4 deletions Sources/OversizeUI/Controls/Button/FieldButtonStyle.swift
Original file line number Diff line number Diff line change
Expand Up @@ -65,13 +65,13 @@ public struct FieldButtonStyle: ButtonStyle {
private var backgroundShapeCorners: UIRectCorner {
switch fieldPosition {
case .default:
return [.allCorners]
[.allCorners]
case .top:
return [.topLeft, .topRight]
[.topLeft, .topRight]
case .bottom:
return [.bottomLeft, .bottomRight]
[.bottomLeft, .bottomRight]
case .center:
return []
[]
}
}
#endif
Expand Down
4 changes: 2 additions & 2 deletions Sources/OversizeUI/Controls/Checkbox/Checkbox.swift
Original file line number Diff line number Diff line change
Expand Up @@ -94,9 +94,9 @@ public struct Checkbox<Label: View>: View {

private var foregroundColor: Color {
if isEnabled {
return Color.onSurfaceHighEmphasis
Color.onSurfaceHighEmphasis
} else {
return Color.onSurfaceDisabled
Color.onSurfaceDisabled
}
}
}
Expand Down
Loading

0 comments on commit 93cea1f

Please sign in to comment.