-
-
Notifications
You must be signed in to change notification settings - Fork 7
/
input.gleam
42 lines (31 loc) · 1.01 KB
/
input.gleam
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
// IMPORTS ---------------------------------------------------------------------
import lustre/attribute.{type Attribute, attribute}
import lustre/element.{type Element}
import lustre/element/html
// ELEMENTS --------------------------------------------------------------------
///
pub fn input(attributes: List(Attribute(msg))) -> Element(msg) {
html.input([attribute.class("lustre-ui-input"), ..attributes])
}
// ATTRIBUTES ------------------------------------------------------------------
pub fn clear() -> Attribute(msg) {
attribute.class("clear")
}
pub fn primary() -> Attribute(msg) {
attribute("data-variant", "primary")
}
pub fn greyscale() -> Attribute(msg) {
attribute("data-variant", "greyscale")
}
pub fn error() -> Attribute(msg) {
attribute("data-variant", "error")
}
pub fn warning() -> Attribute(msg) {
attribute("data-variant", "warning")
}
pub fn success() -> Attribute(msg) {
attribute("data-variant", "success")
}
pub fn info() -> Attribute(msg) {
attribute("data-variant", "info")
}