-
Notifications
You must be signed in to change notification settings - Fork 40
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Support deprecated modifiers (for backwards compatibility), and add new TabViewStyles * Fix macOS build * Exclude menuButtonStyle modifier * Attempt to fix watchOS build
- Loading branch information
1 parent
2b54243
commit 394167c
Showing
9 changed files
with
2,263 additions
and
772 deletions.
There are no files selected for viewing
35 changes: 35 additions & 0 deletions
35
...ve/Stylesheets/ParseableTypes/Styles/AnyDisclosureGroupStyle+ParseableModifierValue.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
// | ||
// AnyDisclosureGroupStyle+ParseableModifierValue.swift | ||
// | ||
// | ||
// Created by Carson Katri on 6/20/24. | ||
// | ||
|
||
#if os(iOS) || os(macOS) || os(visionOS) | ||
import SwiftUI | ||
import LiveViewNativeStylesheet | ||
|
||
/// See [`SwiftUI.DisclosureGroupStyle`](https://developer.apple.com/documentation/swiftui/DisclosureGroupStyle) for more details. | ||
/// | ||
/// Possible values: | ||
/// - `.automatic` | ||
@_documentation(visibility: public) | ||
enum AnyDisclosureGroupStyle: String, CaseIterable, ParseableModifierValue, DisclosureGroupStyle { | ||
typealias _ParserType = ImplicitStaticMember<Self, EnumParser<Self>> | ||
|
||
case automatic | ||
|
||
func makeBody(configuration: Configuration) -> some View { | ||
let disclosureGroup = SwiftUI.DisclosureGroup.init(isExpanded: configuration.$isExpanded) { | ||
configuration.content | ||
} label: { | ||
configuration.label | ||
} | ||
|
||
switch self { | ||
case .automatic: | ||
disclosureGroup.disclosureGroupStyle(.automatic) | ||
} | ||
} | ||
} | ||
#endif |
24 changes: 24 additions & 0 deletions
24
...ive/Stylesheets/ParseableTypes/Styles/AnyNavigationViewStyle+ParseableModifierValue.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
// | ||
// AnyNavigationViewStyle+ParseableModifierValue.swift | ||
// | ||
// | ||
// Created by Carson Katri on 6/20/24. | ||
// | ||
|
||
import SwiftUI | ||
import LiveViewNativeStylesheet | ||
|
||
/// See [`SwiftUI.NavigationViewStyle`](https://developer.apple.com/documentation/swiftui/NavigationViewStyle) for more details. | ||
/// | ||
/// - Note: This type is deprecated and should no longer be used. | ||
@_documentation(visibility: public) | ||
enum AnyNavigationViewStyle: String, CaseIterable, ParseableModifierValue, NavigationViewStyle { | ||
typealias _ParserType = ImplicitStaticMember<Self, EnumParser<Self>> | ||
|
||
case __never | ||
|
||
@ViewBuilder | ||
func _body(configuration: _NavigationViewStyleConfiguration) -> some View { | ||
fatalError("This type is deprecated and should no longer be used.") | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
22 changes: 22 additions & 0 deletions
22
...tive/Stylesheets/ParseableTypes/UITextAutocapitalizationType+ParseableModifierValue.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
// | ||
// UITextAutocapitalizationType+ParseableModifierValue.swift | ||
// | ||
// | ||
// Created by Carson Katri on 6/20/24. | ||
// | ||
|
||
#if os(iOS) || os(tvOS) || os(visionOS) | ||
import SwiftUI | ||
import LiveViewNativeStylesheet | ||
|
||
extension UITextAutocapitalizationType: ParseableModifierValue { | ||
public static func parser(in context: ParseableModifierContext) -> some Parser<Substring.UTF8View, Self> { | ||
ImplicitStaticMember([ | ||
"none": Self.none, | ||
"sentences": Self.sentences, | ||
"words": Self.words, | ||
"allCharacters": Self.allCharacters, | ||
]) | ||
} | ||
} | ||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.