Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Develop #40

Merged
merged 42 commits into from
May 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
0e67271
Fix CI
aromanov91 Oct 1, 2023
ed10992
Add Page component and other small improvements
aromanov91 Mar 15, 2024
eea3ab4
Fix CI (#38)
aromanov91 Mar 15, 2024
699d219
Update CI
aromanov91 Mar 15, 2024
bf5b0d0
Upd CI
aromanov91 Mar 15, 2024
964cbf5
Upd CI
aromanov91 Mar 15, 2024
9367500
Fig platform supports
aromanov91 Mar 15, 2024
f513062
Upd
aromanov91 Mar 15, 2024
d5d7e72
Update ci-pull-request.yml
aromanov91 Mar 15, 2024
fc08c9f
Update ci-pull-request.yml
aromanov91 Mar 15, 2024
361061f
Update ci-pull-request.yml
aromanov91 Mar 15, 2024
b355f29
Update ci-pull-request.yml
aromanov91 Mar 15, 2024
50d5925
Update ci-pull-request.yml
aromanov91 Mar 15, 2024
ec77257
Update ci-pull-request.yml
aromanov91 Mar 15, 2024
313b3ca
Update ci-pull-request.yml
aromanov91 Mar 15, 2024
d88bc64
Update gitignore
aromanov91 Mar 15, 2024
b5299e8
Fix CI
aromanov91 Mar 15, 2024
28863b3
Fix warnings
aromanov91 Mar 15, 2024
7823f0b
Update CI
aromanov91 Mar 15, 2024
7540522
Fix ci
aromanov91 Mar 15, 2024
6e44448
Delete .swiftpm/xcode directory
aromanov91 Mar 15, 2024
6d17586
Fix macOS and tvOS error, disable SwiftGen and format code
aromanov91 May 18, 2024
365334e
Fix CI
aromanov91 Oct 1, 2023
24f9540
Add Page component and other small improvements
aromanov91 Mar 15, 2024
ae06630
Fix CI (#38)
aromanov91 Mar 15, 2024
136f02d
Update CI
aromanov91 Mar 15, 2024
82ec686
Upd CI
aromanov91 Mar 15, 2024
1e967ce
Upd CI
aromanov91 Mar 15, 2024
9dbb14b
Fig platform supports
aromanov91 Mar 15, 2024
413ea88
Upd
aromanov91 Mar 15, 2024
8a7d4a9
Update ci-pull-request.yml
aromanov91 Mar 15, 2024
64066f6
Update ci-pull-request.yml
aromanov91 Mar 15, 2024
476cd6a
Update ci-pull-request.yml
aromanov91 Mar 15, 2024
2840a1c
Update ci-pull-request.yml
aromanov91 Mar 15, 2024
81312b5
Update ci-pull-request.yml
aromanov91 Mar 15, 2024
d32cffb
Update ci-pull-request.yml
aromanov91 Mar 15, 2024
4b78b58
Update ci-pull-request.yml
aromanov91 Mar 15, 2024
86d0611
Fix CI
aromanov91 Mar 15, 2024
5f6ae1d
Fix warnings
aromanov91 Mar 15, 2024
743badd
Update CI
aromanov91 Mar 15, 2024
ee31c7e
Fix macOS and tvOS error, disable SwiftGen and format code
aromanov91 May 18, 2024
e778048
Merge branch 'develop' of https://github.com/oversizedev/OversizeUI i…
aromanov91 May 18, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading