Skip to content

Commit

Permalink
🌲 Update
Browse files Browse the repository at this point in the history
  • Loading branch information
muukii committed Aug 12, 2023
1 parent 7b891d6 commit b417560
Show file tree
Hide file tree
Showing 11 changed files with 54 additions and 227 deletions.
116 changes: 0 additions & 116 deletions Development/Demo/DSLCheck.swift

This file was deleted.

81 changes: 22 additions & 59 deletions Development/MyUIKit/MyBook.swift
Original file line number Diff line number Diff line change
Expand Up @@ -23,56 +23,48 @@
import Foundation

import StorybookKit
import SwiftUISupport

@MainActor
public let myBook = Book(title: "MyUI") {
public let myBook: Book<some View> = Book(title: "MyUI") {

BookParagraph("MyBook")
Text("MyBook")

BookScope {
Group {

let text = "Scope"

return BookGroup {
Group {
BookText(text)
BookText(text)
}
}

BookParagraph("This is BookText")
Text("This is BookText")

BookSection(title: "Features") {

BookNavigationLink(title: "Preview UI") {
BookPage(title: "Typography") {

BookHeading1("""
Text("""
Here is `BookHeadline`, It allows us to describe something big picture.
""")

BookParagraph("""
Text("""
Here is `BookParagpraph`
It allows us to display multiple lines.
Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s,
""")

BookParagraph("""
Text("""
Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s,
""")

BookCallout(text: "Hello! Here is callout!")
BookCallout(symbol: "", text: "Hello! Here is callout!")

BookCallout.info(text: "Info")
BookCallout.warning(text: "Warning")
BookCallout.danger(text: "Danger")
BookCallout.success(text: "Success")


BookSection(title: "Section") {

BookParagraph("""
Text("""
Something description about this section.
""")

Expand Down Expand Up @@ -103,7 +95,7 @@ Something description about this section.

}

BookSection(title: "Section") { () -> BookView in
BookSection(title: "Section") {

BookPreview {
let view = UIView(frame: .init(x: 0, y: 0, width: 80, height: 80))
Expand Down Expand Up @@ -153,35 +145,6 @@ Something description about this section.

}

BookAlphabeticalNavigationLinkSection(title: "Examples") {

BookNavigationLink(title: "MyLabel") {

MyLabel.makeBookView()

BookNavigationLink(title: "Variations") {
BookForEach(data: [
UIColor.systemBlue,
UIColor.systemRed,
UIColor.systemPink
]) { color in
BookPreview {
LightLabel.init(title: "Hello")
}
.backgroundColor(color)
}
}
}

BookNavigationLink(title: "LightLabel") {
BookPreview {
LightLabel.init(title: "Hello")
}
.backgroundColor(.black)
}

}

labelExpandingTestBook()

BookNavigationLink(title: "State") {
Expand All @@ -203,10 +166,11 @@ Something description about this section.

BookNavigationLink(title: "Pattern") {

BookForEach(data: BookPattern.make(
BookPattern.make(
["A", "AAA", "AAAAAA"],
[UIColor.blue, UIColor.red, UIColor.orange]
)) { (args) in
)
.makeBody { args in
BookPreview {
let (text, color) = args
let label = UILabel()
Expand All @@ -220,8 +184,7 @@ Something description about this section.

}

@MainActor
fileprivate func labelExpandingTestBook() -> BookView {
fileprivate func labelExpandingTestBook() -> some View {

BookSection(title: "UILabel updating text") {
BookPreview<UILabel> {
Expand All @@ -244,8 +207,8 @@ fileprivate func labelExpandingTestBook() -> BookView {

extension MyLabel {

fileprivate static func makeBookView() -> BookView {
BookGroup {
fileprivate static func makeBookView() -> some View {
Group {
BookPreview {
self.init(title: "Hello")
}
Expand All @@ -266,14 +229,14 @@ extension MyLabel {
}
}

fileprivate static func makeBookView_1() -> BookView {
fileprivate static func makeBookView_1() -> some View {
BookPreview {
self.init(title: "")
}
}

fileprivate static func makeBookView_2() -> BookView {
BookGroup {
fileprivate static func makeBookView_2() -> some View {
Group {
BookPreview {
self.init(title: "")
}
Expand All @@ -283,8 +246,8 @@ extension MyLabel {
}
}

fileprivate static func makeBookView_3() -> BookView {
BookGroup {
fileprivate static func makeBookView_3() -> some View {
Group {
BookPreview {
self.init(title: "")
}
Expand Down
4 changes: 0 additions & 4 deletions Development/Storybook.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
4B0BDD7F2A87A4C800CF2633 /* StorybookKit in Frameworks */ = {isa = PBXBuildFile; productRef = 4B0BDD7E2A87A4C800CF2633 /* StorybookKit */; };
4B0BDD812A87A4C800CF2633 /* StorybookKitTextureSupport in Frameworks */ = {isa = PBXBuildFile; productRef = 4B0BDD802A87A4C800CF2633 /* StorybookKitTextureSupport */; };
4B0BDD852A87A4DA00CF2633 /* StorybookKit in Frameworks */ = {isa = PBXBuildFile; productRef = 4B0BDD842A87A4DA00CF2633 /* StorybookKit */; };
4B81F791246F34BE009C7602 /* DSLCheck.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4B81F790246F34BE009C7602 /* DSLCheck.swift */; };
4BB03C0922267064006E9E49 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4BB03C0822267064006E9E49 /* AppDelegate.swift */; };
4BB03C1022267065006E9E49 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 4BB03C0F22267065006E9E49 /* Assets.xcassets */; };
4BB03C1322267065006E9E49 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 4BB03C1122267065006E9E49 /* LaunchScreen.storyboard */; };
Expand Down Expand Up @@ -52,7 +51,6 @@

/* Begin PBXFileReference section */
4B0BDD7C2A87A4A200CF2633 /* Storybook-ios */ = {isa = PBXFileReference; lastKnownFileType = wrapper; name = "Storybook-ios"; path = ..; sourceTree = "<group>"; };
4B81F790246F34BE009C7602 /* DSLCheck.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DSLCheck.swift; sourceTree = "<group>"; };
4BB03C0622267064006E9E49 /* Demo.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Demo.app; sourceTree = BUILT_PRODUCTS_DIR; };
4BB03C0822267064006E9E49 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; };
4BB03C0F22267065006E9E49 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
Expand Down Expand Up @@ -106,7 +104,6 @@
4BB03C0F22267065006E9E49 /* Assets.xcassets */,
4BB03C1122267065006E9E49 /* LaunchScreen.storyboard */,
4BB03C1422267065006E9E49 /* Info.plist */,
4B81F790246F34BE009C7602 /* DSLCheck.swift */,
4BB655B62A87B01000F2E2D7 /* RootView.swift */,
);
path = Demo;
Expand Down Expand Up @@ -283,7 +280,6 @@
files = (
4BB655B72A87B01000F2E2D7 /* RootView.swift in Sources */,
4BB03C0922267064006E9E49 /* AppDelegate.swift in Sources */,
4B81F791246F34BE009C7602 /* DSLCheck.swift in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand Down
18 changes: 18 additions & 0 deletions Package.resolved
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,24 @@
"version" : "0.10.0"
}
},
{
"identity" : "swiftui-gesture-velocity",
"kind" : "remoteSourceControl",
"location" : "https://github.com/FluidGroup/swiftui-gesture-velocity",
"state" : {
"revision" : "9c83f8995f9e5efc29db2fca4b9ff058283f1603",
"version" : "1.0.0"
}
},
{
"identity" : "swiftui-support",
"kind" : "remoteSourceControl",
"location" : "https://github.com/FluidGroup/swiftui-support",
"state" : {
"revision" : "8ef53190c33bd345e7a95ef504dafe0f85ad9c4d",
"version" : "0.4.1"
}
},
{
"identity" : "texture",
"kind" : "remoteSourceControl",
Expand Down
4 changes: 3 additions & 1 deletion Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,9 @@ let package = Package(
targets: [
.target(
name: "StorybookKit",
dependencies: []
dependencies: [
.product(name: "SwiftUISupport", package: "swiftui-support")
]
),
.target(
name: "StorybookKitTextureSupport",
Expand Down
Loading

0 comments on commit b417560

Please sign in to comment.