-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Make the storage manager public To make the environment for htmlkit work, the manager needs to be cached in the application storage. * Add the press modifier to the text component * Add the environment value to the content rendering In a specific case the environment value didn't get caught by the renderer. * Fix the styling of the divider component * Add a dropdown component * Revise the card component * Remove the css from the grid item The grid should only be for alignment. * Add a scrollview component * Add a carousel component * Extend the carousel component * Add more component tests * Fix test failing * Add motion to the carousel by adding javascript * Add autoplay to the carousel * Fix tests * Add a test for the symbol component * Add the possibility to disable views * Fix the css classes for the position index * Add a few new symbols * Add more symbols * Add the possibility to hide views * Revise the input fields to accept a placeholder value * Add the submit event to the form component * Add comments * Refactor code and rearrange files * Add form validation * Fix some sort of things * Change the js initialization for the carousel component * Add a textpad component
- Loading branch information
1 parent
4041787
commit c811b23
Showing
83 changed files
with
1,522 additions
and
253 deletions.
There are no files selected for viewing
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
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,10 @@ | ||
# Abstraction | ||
|
||
This directory contains the HTML abstraction. | ||
|
||
### Attributes | ||
|
||
### Elements | ||
|
||
### Tokens | ||
|
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
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
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
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,17 @@ | ||
# Framework | ||
|
||
This directory contains sources for | ||
|
||
### Builders | ||
|
||
### Environment | ||
|
||
### Extensions | ||
|
||
### Helpers | ||
|
||
### Localization | ||
|
||
### Primitives | ||
|
||
### Rendering |
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
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
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
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 |
---|---|---|
@@ -1,21 +1,57 @@ | ||
/* | ||
Abstract: | ||
The file contains a card component. | ||
*/ | ||
|
||
import HTMLKit | ||
|
||
public struct Card: View, Modifiable { | ||
/// A component that distinguish content. | ||
public class Card: View { | ||
|
||
/// The header of the card. | ||
public var header: [Content]? | ||
|
||
internal var content: [Content] | ||
/// The content of the card. | ||
public var content: [Content] | ||
|
||
/// The classes of the content. | ||
internal var classes: [String] | ||
|
||
/// Creates a card. | ||
public init(@ContentBuilder<Content> content: () -> [Content]) { | ||
|
||
self.content = content() | ||
self.classes = ["card"] | ||
} | ||
|
||
/// Creates a card. | ||
public init(@ContentBuilder<Content> content: () -> [Content], | ||
@ContentBuilder<Content> header: () -> [Content]) { | ||
|
||
self.content = content() | ||
self.header = header() | ||
self.classes = ["card"] | ||
} | ||
|
||
/// Creates a card. | ||
internal init(header: [Content]?, content: [Content], classes: [String]) { | ||
|
||
self.header = header | ||
self.content = content | ||
self.classes = classes | ||
} | ||
|
||
public var body: Content { | ||
Division { | ||
content | ||
Division { | ||
header | ||
} | ||
.class("card-header") | ||
Division { | ||
content | ||
} | ||
.class("card-body") | ||
} | ||
.class(self.classes.joined(separator: " ")) | ||
.class(classes.joined(separator: " ")) | ||
} | ||
} |
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,114 @@ | ||
/* | ||
Abstract: | ||
The file contains a carousel component. | ||
*/ | ||
|
||
import HTMLKit | ||
|
||
/// A compnonent that cycles through an amount of views. | ||
public struct Carousel: View { | ||
|
||
/// The indication for the carousel. | ||
internal var indication: [Content] | ||
|
||
/// The content of the carousel. | ||
internal var content: [Content] | ||
|
||
/// The classes of the carousel. | ||
internal var classes: [String] | ||
|
||
/// Creates a carousel. | ||
public init(@ContentBuilder<Content> content: () -> [Content], | ||
@ContentBuilder<Content> indication: () -> [Content]) { | ||
|
||
self.content = content() | ||
self.indication = indication() | ||
self.classes = ["carousel"] | ||
} | ||
|
||
/// Creates a carousel. | ||
internal init(indication: [Content], content: [Content], classes: [String]) { | ||
|
||
self.indication = indication | ||
self.content = content | ||
self.classes = classes | ||
} | ||
|
||
public var body: Content { | ||
Division { | ||
Division { | ||
content | ||
} | ||
.class("carousel-content") | ||
Division { | ||
indication | ||
} | ||
.class("carousel-indication") | ||
} | ||
.class(classes.joined(separator: " ")) | ||
} | ||
} | ||
|
||
public struct Slide: View, Identifiable, Modifiable { | ||
|
||
internal var id: String? | ||
|
||
internal var source: String | ||
|
||
internal var classes: [String] | ||
|
||
internal var caption: [Content] | ||
|
||
public init(source: String, @ContentBuilder<Content> caption: () -> [Content]) { | ||
|
||
self.source = source | ||
self.caption = caption() | ||
self.classes = ["slide"] | ||
} | ||
|
||
internal init(id: String?, source: String, caption: [Content], classes: [String]) { | ||
|
||
self.id = id | ||
self.source = source | ||
self.caption = caption | ||
self.classes = classes | ||
} | ||
|
||
public var body: Content { | ||
Division { | ||
Division { | ||
HTMLKit.Image() | ||
.source(source) | ||
} | ||
.class("slide-thumbnail") | ||
Division { | ||
caption | ||
} | ||
.class("slide-caption") | ||
} | ||
.class(classes.joined(separator: " ")) | ||
.modify(unwrap: id) { | ||
$0.id($1) | ||
} | ||
} | ||
|
||
public func tag(_ value: String) -> Slide { | ||
return self.mutate(id: value) | ||
} | ||
} | ||
|
||
public struct Indicator: View { | ||
|
||
internal var tag: String | ||
|
||
public init(for tag: String) { | ||
self.tag = "#" + tag | ||
} | ||
|
||
public var body: Content { | ||
Anchor { | ||
} | ||
.class("indicator") | ||
.reference(tag) | ||
} | ||
} |
Oops, something went wrong.