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 #44

Merged
merged 33 commits into from
Dec 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
0e2a4ac
Add Platform and minor bug fixes
aromanov91 Sep 26, 2024
94505bc
Up CI devices
aromanov91 Sep 26, 2024
b8cf6bc
Fix platform
aromanov91 Sep 26, 2024
b0aa8aa
Fix ci
aromanov91 Sep 26, 2024
676d05b
Update ci-pull-request.yml
aromanov91 Sep 26, 2024
852d398
Update ci-pull-request.yml
aromanov91 Sep 26, 2024
718b80a
Update ci-pull-request.yml
aromanov91 Sep 26, 2024
fcb58f6
Update CI
aromanov91 Sep 26, 2024
718d93b
Update ci-pull-request.yml
aromanov91 Sep 26, 2024
fb8c56c
Update steps
aromanov91 Sep 26, 2024
51a6825
Update ci.yml
aromanov91 Sep 26, 2024
d0c8354
Revert changes
aromanov91 Sep 26, 2024
65f14ed
Add RoundedRectangleCorner for macOS, update filed position and etc
aromanov91 Oct 6, 2024
13962f0
Add Platform and minor bug fixes
aromanov91 Sep 26, 2024
09bb010
Fix platform
aromanov91 Sep 26, 2024
68cf2b8
Update ci.yml
aromanov91 Sep 26, 2024
bf97a4c
Revert changes
aromanov91 Sep 26, 2024
48fd61f
Add RoundedRectangleCorner for macOS, update filed position and etc
aromanov91 Oct 6, 2024
35fd367
Merge branch 'develop' of https://github.com/oversizedev/OversizeUI i…
aromanov91 Oct 6, 2024
cb90839
Fix watchOS field
aromanov91 Oct 6, 2024
5109927
Fix iOS build
aromanov91 Oct 6, 2024
246ff31
Fix example
aromanov91 Oct 6, 2024
8af2ddb
Adopt Swift 6
aromanov91 Oct 15, 2024
97220d1
Update MacOS styles
aromanov91 Nov 3, 2024
c364a56
Fix tvOS build
aromanov91 Nov 3, 2024
a6028de
Up CI versions
aromanov91 Nov 3, 2024
924c5fb
Fix fontStyle
aromanov91 Nov 3, 2024
4e825fa
Add HUD autoHide and format
aromanov91 Nov 9, 2024
a334c18
Renamed colors
aromanov91 Nov 9, 2024
d14b9e9
Delete deprecated HUD and Row
aromanov91 Nov 9, 2024
703fff7
Fix examples #major
aromanov91 Nov 9, 2024
8ea7bb8
Update images
aromanov91 Dec 13, 2024
b2a9f9d
Merge branch 'main' into develop
aromanov91 Dec 13, 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 .swiftformat
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
--swiftversion 5.9
--swiftversion 6.0
--disable preferKeyPath
--ifdef no-indent
1 change: 1 addition & 0 deletions Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ let package = Package(
.macOS(.v13),
.tvOS(.v15),
.watchOS(.v9),
.visionOS(.v2),
],
products: [
.library(
Expand Down
5 changes: 2 additions & 3 deletions Sources/OversizeUI/Controls/PageView/Page.swift
Original file line number Diff line number Diff line change
Expand Up @@ -96,9 +96,8 @@ public struct Page<Content, Header, LeadingBar, TrailingBar, TopToolbar, TitleLa
.toolbarBackground(.hidden)
.toolbar(isFocusSearchBar ? .hidden : .automatic, for: .navigationBar)
.navigationBarTitleDisplayMode(.inline)
#endif
#if os(macOS)
.navigationTitle(title ?? "")
#elseif os(macOS)
.navigationTitle(title ?? "")
#endif
}

Expand Down
31 changes: 20 additions & 11 deletions Sources/OversizeUI/Controls/SegmentedControl/SegmentedControl.swift
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ public struct SegmentedPickerSelector<Element: Equatable, Content, Selection>: V
@Environment(\.segmentedControlStyle) private var style
@Environment(\.controlRadius) var controlRadius: Radius
@Environment(\.segmentedPickerMargins) var controlPadding: EdgeSpaceInsets
@Environment(\.platform) var platform: Platform

public typealias Data = [Element]

Expand Down Expand Up @@ -224,7 +225,8 @@ public struct SegmentedPickerSelector<Element: Equatable, Content, Selection>: V
? Color.border
: Color.surfaceSecondary, lineWidth: CGFloat(theme.borderSize))
)
.shadowElevaton(.z2)
.shadowElevaton(platform == .macOS ? .z0 : .z2)

case .graySurface:

if style.unseletionStyle == .clean {
Expand All @@ -246,6 +248,7 @@ public struct SegmentedPickerSelector<Element: Equatable, Content, Selection>: V
style: .continuous)
.strokeBorder(Color.onSurfaceSecondary, lineWidth: 2)
}

case .accentSurface:
RoundedRectangle(
cornerRadius: style.isShowBackground ? controlRadius.rawValue - 4 : controlRadius.rawValue,
Expand All @@ -261,17 +264,23 @@ public struct SegmentedPickerSelector<Element: Equatable, Content, Selection>: V
case .clean:
EmptyView()
case .surface:

RoundedRectangle(cornerRadius: controlRadius,
style: .continuous)
.fill(Color.surfaceSecondary)
.overlay(
RoundedRectangle(cornerRadius: controlRadius,
style: .continuous)
.stroke(theme.borderControls
? Color.border
: Color.surfaceSecondary, lineWidth: CGFloat(theme.borderSize))
RoundedRectangle(
cornerRadius: controlRadius,
style: .continuous
)
.fill(Color.surfaceSecondary)
.overlay(
RoundedRectangle(
cornerRadius: controlRadius,
style: .continuous
)
.stroke(
theme.borderControls
? Color.border
: Color.surfaceSecondary,
lineWidth: CGFloat(theme.borderSize)
)
)
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ public struct LabeledTextFieldStyle: TextFieldStyle {

private var fieldRadius: Radius {
#if os(macOS)
return .xSmall
return .small
#else
return .medium
#endif
Expand Down
4 changes: 2 additions & 2 deletions Sources/OversizeUI/Core/Appearance/ThemeSettings.swift
Original file line number Diff line number Diff line change
Expand Up @@ -43,14 +43,14 @@ public class ThemeSettings: ObservableObject, @unchecked Sendable {
@AppStorage(ThemeSettingsNames.borderTextFields) public var borderTextFields: Bool = true
@AppStorage(ThemeSettingsNames.borderSurface) public var borderSurface: Bool = true
@AppStorage(ThemeSettingsNames.radius) public var radius: Double = 4
@AppStorage(ThemeSettingsNames.borderControls) public var borderControls: Bool = true
#else
@AppStorage(ThemeSettingsNames.borderSurface) public var borderSurface: Bool = false
@AppStorage(ThemeSettingsNames.borderTextFields) public var borderTextFields: Bool = false
@AppStorage(ThemeSettingsNames.borderSize) public var borderSize: Double = 0.5
@AppStorage(ThemeSettingsNames.radius) public var radius: Double = 8
#endif

@AppStorage(ThemeSettingsNames.borderControls) public var borderControls: Bool = false
#endif

@AppStorage(ThemeSettingsNames.theme) public var theme: Int = 0

Expand Down
19 changes: 19 additions & 0 deletions Sources/OversizeUI/Core/Illustrations.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
//
// Copyright © 2024 Alexander Romanov
// Illustration.swift, created on 16.11.2024
//

import SwiftUI

public extension SwiftUI.Image {
enum Illustration {
public enum Status {
public static let success = Image("Status/Success", bundle: .module)
public static let error = Image("Status/Error", bundle: .module)
public static let warning = Image("Status/Warning", bundle: .module)
public enum Warning {
public static let fill = Image("Status/Warning/Triangle", bundle: .module)
}
}
}
}
32 changes: 32 additions & 0 deletions Sources/OversizeUI/Core/ViewModifier/DelayTask/DelayTask.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
//
// Copyright © 2024 Alexander Romanov
// DelayTaskViewModifier.swift, created on 13.11.2024
//

import SwiftUI

@available(iOS 16.0, tvOS 16.0, watchOS 9.0, macOS 13.0, *)
struct DelayTaskViewModifier: ViewModifier {
let delay: ContinuousClock.Instant.Duration
let action: @Sendable () async -> Void

func body(content: Content) -> some View {
content
.task {
do {
try await Task.sleep(for: delay)
await action()
} catch {}
}
}
}

@available(iOS 16.0, tvOS 16.0, watchOS 9.0, macOS 13.0, *)
public extension View {
func task(
delay: ContinuousClock.Duration,
action: @Sendable @escaping () async -> Void
) -> some View {
modifier(DelayTaskViewModifier(delay: delay, action: action))
}
}
24 changes: 16 additions & 8 deletions Sources/OversizeUI/Deprecated/Icon.swift
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,16 @@
import SwiftUI

public enum IconSizes: CaseIterable {
case xSmall
case small
case medium
case large
case xLarge

public var rawValue: CGFloat {
switch self {
case .xSmall:
Space.xSmall.rawValue
case .small:
Space.small.rawValue
case .medium:
Expand All @@ -32,6 +35,7 @@ public enum IconSizes: CaseIterable {
public struct IconDeprecated: View {
private enum Constants: Sendable {
/// Size
static let xSmall: CGFloat = Space.xSmall.rawValue
static let small: CGFloat = Space.small.rawValue
static let medium: CGFloat = Space.medium.rawValue
static let large: CGFloat = Space.large.rawValue
Expand Down Expand Up @@ -74,10 +78,12 @@ public struct IconDeprecated: View {

private var iconSize: CGFloat {
switch size {
case .medium:
Constants.medium
case .xSmall:
Constants.xSmall
case .small:
Constants.small
case .medium:
Constants.medium
case .large:
Constants.large
case .xLarge:
Expand All @@ -95,12 +101,14 @@ public struct IconDeprecated: View {
@available(tvOS, unavailable)
struct IconAsset_Previews: PreviewProvider {
static var previews: some View {
let grid = [GridItem(),
GridItem(),
GridItem(),
GridItem(),
GridItem(),
GridItem()]
let grid = [
GridItem(),
GridItem(),
GridItem(),
GridItem(),
GridItem(),
GridItem(),
]

Button(role: .cancel, action: {}, label: {
Text("Text")
Expand Down
2 changes: 1 addition & 1 deletion Sources/OversizeUI/Extensions/View/View+SizeReader.swift
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import SwiftUI

public extension View {
func readSize(onChange: @escaping (CGSize) -> Void) -> some View {
func readSize(onChange: @Sendable @escaping (CGSize) -> Void) -> some View {
background(
GeometryReader { geometryProxy in
Color.clear
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
"color-space" : "srgb",
"components" : {
"alpha" : "1.000",
"blue" : "0.404",
"green" : "0.831",
"red" : "0.333"
"blue" : "0x5E",
"green" : "0xB3",
"red" : "0x5C"
}
},
"idiom" : "universal"
Expand All @@ -23,9 +23,9 @@
"color-space" : "srgb",
"components" : {
"alpha" : "1.000",
"blue" : "0.294",
"green" : "0.745",
"red" : "0.220"
"blue" : "0x4B",
"green" : "0x99",
"red" : "0x4B"
}
},
"idiom" : "universal"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,8 @@
"info" : {
"author" : "xcode",
"version" : 1
},
"properties" : {
"provides-namespace" : true
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Loading