-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
eaa3adb
commit 246d8be
Showing
1 changed file
with
95 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,95 @@ | ||
package dividers | ||
|
||
import htmx "github.com/zeiss/fiber-htmx" | ||
|
||
// DividerProps is a struct that contains the props of a divider. | ||
type DividerProps struct { | ||
ClassNames htmx.ClassNames | ||
} | ||
|
||
// Divider is a struct that contains the props of a divider. | ||
func Divider(p DividerProps, children ...htmx.Node) htmx.Node { | ||
return htmx.Div( | ||
htmx.ClassNames{ | ||
"divider": true, | ||
}.Merge(p.ClassNames), | ||
htmx.Group(children...), | ||
) | ||
} | ||
|
||
// DividerNeutral is a struct that contains the props of a neutral divider. | ||
func DividerNeutral(p DividerProps, children ...htmx.Node) htmx.Node { | ||
return htmx.Div( | ||
htmx.ClassNames{ | ||
"divider": true, | ||
"divider-neutral": true, | ||
}.Merge(p.ClassNames), | ||
htmx.Group(children...), | ||
) | ||
} | ||
|
||
// DividerPrimary is a struct that contains the props of a primary divider. | ||
func DividerPrimary(p DividerProps, children ...htmx.Node) htmx.Node { | ||
return htmx.Div( | ||
htmx.ClassNames{ | ||
"divider": true, | ||
"divider-primary": true, | ||
}.Merge(p.ClassNames), | ||
htmx.Group(children...), | ||
) | ||
} | ||
|
||
// DividerSecondary is a struct that contains the props of a secondary divider. | ||
func DividerSecondary(p DividerProps, children ...htmx.Node) htmx.Node { | ||
return htmx.Div( | ||
htmx.ClassNames{ | ||
"divider": true, | ||
"divider-secondary": true, | ||
}.Merge(p.ClassNames), | ||
htmx.Group(children...), | ||
) | ||
} | ||
|
||
// DividerSuccess is a struct that contains the props of a success divider. | ||
func DividerSuccess(p DividerProps, children ...htmx.Node) htmx.Node { | ||
return htmx.Div( | ||
htmx.ClassNames{ | ||
"divider": true, | ||
"divider-success": true, | ||
}.Merge(p.ClassNames), | ||
htmx.Group(children...), | ||
) | ||
} | ||
|
||
// DividerWarning is a struct that contains the props of a warning divider. | ||
func DividerWarning(p DividerProps, children ...htmx.Node) htmx.Node { | ||
return htmx.Div( | ||
htmx.ClassNames{ | ||
"divider": true, | ||
"divider-warning": true, | ||
}.Merge(p.ClassNames), | ||
htmx.Group(children...), | ||
) | ||
} | ||
|
||
// DividerInfo is a struct that contains the props of an info divider. | ||
func DividerInfo(p DividerProps, children ...htmx.Node) htmx.Node { | ||
return htmx.Div( | ||
htmx.ClassNames{ | ||
"divider": true, | ||
"divider-info": true, | ||
}.Merge(p.ClassNames), | ||
htmx.Group(children...), | ||
) | ||
} | ||
|
||
// DividerError is a struct that contains the props of an error divider. | ||
func DividerError(p DividerProps, children ...htmx.Node) htmx.Node { | ||
return htmx.Div( | ||
htmx.ClassNames{ | ||
"divider": true, | ||
"divider-error": true, | ||
}.Merge(p.ClassNames), | ||
htmx.Group(children...), | ||
) | ||
} |