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

Merged
merged 3 commits into from
May 6, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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/build-example.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ on:
branches: [ main ]

env:
DEVELOPER_DIR: /Applications/Xcode_14.3.app/Contents/Developer
DEVELOPER_DIR: /Applications/Xcode_14.2.app/Contents/Developer
PROJECT_DIR: Example
PROJECT_NAME: Example.xcodeproj
iOSSCHEME: Example (iOS)
Expand Down
2 changes: 1 addition & 1 deletion .swiftformat
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
--swiftversion 5.7
--swiftversion 5.8
--disable preferKeyPath
--ifdef no-indent
2 changes: 1 addition & 1 deletion Package.swift
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// swift-tools-version: 5.8
// swift-tools-version: 5.7
// The swift-tools-version declares the minimum version of Swift required to build this package.
// swiftlint:disable all

Expand Down
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# OversizeUI

[![Build Example](https://github.com/oversizedev/OversizeUI/actions/workflows/build-example.yml/badge.svg)](https://github.com/oversizedev/OversizeUI/actions/workflows/build-example.yml)[![Deploy DocC](https://github.com/oversizedev/OversizeUI/actions/workflows/publish-docc.yml/badge.svg)](https://github.com/oversizedev/OversizeUI/actions/workflows/publish-docc.yml)
[![Build Example](https://github.com/oversizedev/OversizeUI/actions/workflows/build-example.yml/badge.svg)](https://github.com/oversizedev/OversizeUI/actions/workflows/build-example.yml) [![Deploy DocC](https://github.com/oversizedev/OversizeUI/actions/workflows/publish-docc.yml/badge.svg)](https://github.com/oversizedev/OversizeUI/actions/workflows/publish-docc.yml)

Yet another component library on SwiftUI

Expand Down Expand Up @@ -36,13 +36,13 @@ Colors, Typography, Spacing and other styles in [core folder](Sources/OversizeUI

#### Requirements
- iOS 15+ or macOS 12.0+
- Xcode 14.3+
- Swift 5.8+
- Xcode 14.2+
- Swift 5.7+

#### Swift Package Manager
- File > Swift Packages > Add Package Dependency
- Add `https://github.com/oversizedev/OversizeUI.git`
- Select "Up to Next Major" with "3.0.1"
- Select "Up to Next Major" with "3.0.3"

### Import and use OversizeUI
After the framework has been added you can import the module to use it:
Expand Down
6 changes: 3 additions & 3 deletions Sources/OversizeUI/Controls/Checkbox/Checkbox.swift
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ public extension Checkbox where Label == EmptyView {
struct Checkbox_LibraryContent: LibraryContentProvider {
var views: [LibraryItem] {
LibraryItem(
Checkbox(isOn: .constant(false), label: {
Checkbox(isOn: .constant(false), label: {
Text("Text")
}),
title: "Checkbox", category: .control
Expand All @@ -129,15 +129,15 @@ struct Checkbox_LibraryContent: LibraryContentProvider {
struct Checkbox_preview: PreviewProvider {
static var previews: some View {
VStack(spacing: 24) {
Checkbox(isOn: .constant(true), label: {
Checkbox(isOn: .constant(true), label: {
Text("Text")
})

Checkbox(isOn: .constant(false), alignment: .leading, label: {
Text("Text")
})

Checkbox(isOn: .constant(true), alignment: .trailing, label: {
Checkbox(isOn: .constant(true), alignment: .trailing, label: {
Text("Text")
})

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,7 @@ public struct SegmentedPickerSelector<Element: Equatable, Content, Selection>: V
style
.makeBody(
configuration: SegmentedControlConfiguration(
label: SegmentedControlConfiguration.Label(content: getSegmentedControl()
)
label: SegmentedControlConfiguration.Label(content: getSegmentedControl())
)
)
.clipBackground(style.isShowBackground, radius: controlRadius.rawValue)
Expand Down Expand Up @@ -100,7 +99,7 @@ public struct SegmentedPickerSelector<Element: Equatable, Content, Selection>: V
content(data[index],
selectedIndex == index)
.body(.semibold)
.foregroundColor(.onSurfaceHighEmphasis)
.foregroundColor(style.seletionStyle == .accentSurface && selectedIndex == index ? Color.onPrimaryHighEmphasis : Color.onSurfaceHighEmphasis)
.multilineTextAlignment(.center)
Spacer()
}
Expand Down Expand Up @@ -160,7 +159,7 @@ public struct SegmentedPickerSelector<Element: Equatable, Content, Selection>: V
},
label: { content(data[index], selectedIndex == index)
.body(.semibold)
.foregroundColor(.onSurfaceHighEmphasis)
.foregroundColor(style.seletionStyle == .accentSurface && selectedIndex == index ? Color.onPrimaryHighEmphasis : Color.onSurfaceHighEmphasis)
.multilineTextAlignment(.center)
.padding(.leading, controlPadding.leading)
.padding(.trailing, controlPadding.trailing)
Expand Down Expand Up @@ -232,9 +231,11 @@ public struct SegmentedPickerSelector<Element: Equatable, Content, Selection>: V
.strokeBorder(Color.onSurfaceMediumEmphasis, lineWidth: 2)
}
case .accentSurface:
RoundedRectangle(cornerRadius: style.isShowBackground ? controlRadius.rawValue - 4 : controlRadius.rawValue,
style: .continuous)
.strokeBorder(Color.blue, lineWidth: 2)
RoundedRectangle(
cornerRadius: style.isShowBackground ? controlRadius.rawValue - 4 : controlRadius.rawValue,
style: .continuous
)
.fill(Color.accent)
}
}

Expand Down
2 changes: 1 addition & 1 deletion Sources/OversizeUI/Controls/Select/MultiSelect.swift
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ public struct MultiSelect<Element: Equatable, Content, Selection>: View
}
let selectionItems = selectedIndexes.compactMap { data[$0] }
selection = selectionItems
}), label: {
}), label: {
content(data[index], isSelected)
})
}
Expand Down
6 changes: 3 additions & 3 deletions Sources/OversizeUI/Deprecated/Icon.swift
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,8 @@ public struct Icon: View {
}
}

@available(tvOS, unavailable)
struct IconAsset_Previews: PreviewProvider {
@available(tvOS, unavailable)
struct IconAsset_Previews: PreviewProvider {
static var previews: some View {
let grid = [GridItem(),
GridItem(),
Expand All @@ -113,4 +113,4 @@ public struct Icon: View {
.padding()
.previewLayout(.sizeThatFits)
}
}
}
Loading