daisyui 1.0.0 → 1.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/daisy_ui/alert.rb +0 -4
- data/lib/daisy_ui/avatar.rb +0 -4
- data/lib/daisy_ui/avatar_group.rb +0 -4
- data/lib/daisy_ui/breadcrumbs.rb +2 -6
- data/lib/daisy_ui/card.rb +6 -6
- data/lib/daisy_ui/carousel.rb +2 -6
- data/lib/daisy_ui/chat.rb +8 -12
- data/lib/daisy_ui/collapse.rb +5 -7
- data/lib/daisy_ui/diff.rb +6 -6
- data/lib/daisy_ui/divider.rb +0 -4
- data/lib/daisy_ui/dock.rb +2 -6
- data/lib/daisy_ui/drawer.rb +6 -6
- data/lib/daisy_ui/dropdown.rb +8 -12
- data/lib/daisy_ui/fab.rb +4 -8
- data/lib/daisy_ui/fieldset.rb +2 -2
- data/lib/daisy_ui/filter.rb +3 -7
- data/lib/daisy_ui/footer.rb +2 -2
- data/lib/daisy_ui/form_control.rb +0 -4
- data/lib/daisy_ui/hero.rb +4 -8
- data/lib/daisy_ui/indicator.rb +2 -6
- data/lib/daisy_ui/join.rb +3 -5
- data/lib/daisy_ui/label.rb +51 -3
- data/lib/daisy_ui/list.rb +2 -2
- data/lib/daisy_ui/mask.rb +0 -4
- data/lib/daisy_ui/menu.rb +2 -2
- data/lib/daisy_ui/menu_item.rb +4 -4
- data/lib/daisy_ui/mockup_browser.rb +2 -6
- data/lib/daisy_ui/mockup_code.rb +0 -4
- data/lib/daisy_ui/mockup_phone.rb +4 -8
- data/lib/daisy_ui/mockup_window.rb +0 -4
- data/lib/daisy_ui/modal.rb +8 -8
- data/lib/daisy_ui/navbar.rb +6 -6
- data/lib/daisy_ui/pagination.rb +2 -6
- data/lib/daisy_ui/rating.rb +0 -4
- data/lib/daisy_ui/skeleton.rb +0 -4
- data/lib/daisy_ui/stack.rb +0 -4
- data/lib/daisy_ui/stat.rb +12 -16
- data/lib/daisy_ui/steps.rb +4 -4
- data/lib/daisy_ui/swap.rb +6 -6
- data/lib/daisy_ui/tab.rb +3 -3
- data/lib/daisy_ui/timeline.rb +6 -6
- data/lib/daisy_ui/toast.rb +0 -4
- data/lib/daisy_ui/validator.rb +1 -1
- data/lib/daisy_ui/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 75db7da2ecbc50158da82bbf662b754ed98691102f006f24298f2d754f33e27b
|
|
4
|
+
data.tar.gz: 036e8f6362a4fedf58a2d924ea40ab5720006224e2bc71f3c9b8aef42bd9b1e3
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 708df86e95e6c50e3a2270d299a0b13147ae78d56b660b7fa6ea0867258ed964006aa23c104123d9ba4db5dfab1c42b49735190e3937892be792d37fc3ba0aae
|
|
7
|
+
data.tar.gz: 8009d960b83e5bd5033469a10d59bb1d1d254d4e244356250df01ccf0ef6f35f34dec000a398c4733c6d8bf8e78cefbe26a76c9b845289923aea6e383ba91898
|
data/lib/daisy_ui/alert.rb
CHANGED
data/lib/daisy_ui/avatar.rb
CHANGED
data/lib/daisy_ui/breadcrumbs.rb
CHANGED
|
@@ -4,18 +4,14 @@ module DaisyUI
|
|
|
4
4
|
class Breadcrumbs < Base
|
|
5
5
|
self.component_class = :breadcrumbs
|
|
6
6
|
|
|
7
|
-
def initialize(*, as: :div, **)
|
|
8
|
-
super
|
|
9
|
-
end
|
|
10
|
-
|
|
11
7
|
def view_template(&)
|
|
12
8
|
public_send(as, class: classes, **attributes) do
|
|
13
9
|
ul(&)
|
|
14
10
|
end
|
|
15
11
|
end
|
|
16
12
|
|
|
17
|
-
def crumb(**
|
|
18
|
-
li(class: component_classes(options:
|
|
13
|
+
def crumb(**options, &)
|
|
14
|
+
li(class: component_classes(options: options), **options, &)
|
|
19
15
|
end
|
|
20
16
|
alias_method :breadcrumb, :crumb
|
|
21
17
|
alias_method :item, :crumb
|
data/lib/daisy_ui/card.rb
CHANGED
|
@@ -12,16 +12,16 @@ module DaisyUI
|
|
|
12
12
|
public_send(as, class: classes, **attributes, &)
|
|
13
13
|
end
|
|
14
14
|
|
|
15
|
-
def body(**
|
|
16
|
-
div(class: component_classes("card-body", options:
|
|
15
|
+
def body(**options, &)
|
|
16
|
+
div(class: component_classes("card-body", options:), **options, &)
|
|
17
17
|
end
|
|
18
18
|
|
|
19
|
-
def title(**
|
|
20
|
-
header(class: component_classes("card-title", options:
|
|
19
|
+
def title(**options, &)
|
|
20
|
+
header(class: component_classes("card-title", options:), **options, &)
|
|
21
21
|
end
|
|
22
22
|
|
|
23
|
-
def actions(**
|
|
24
|
-
footer(class: component_classes("card-actions", options:
|
|
23
|
+
def actions(**options, &)
|
|
24
|
+
footer(class: component_classes("card-actions", options:), **options, &)
|
|
25
25
|
end
|
|
26
26
|
|
|
27
27
|
register_modifiers(
|
data/lib/daisy_ui/carousel.rb
CHANGED
|
@@ -5,16 +5,12 @@ module DaisyUI
|
|
|
5
5
|
class Carousel < Base
|
|
6
6
|
self.component_class = :carousel
|
|
7
7
|
|
|
8
|
-
def initialize(*, as: :div, **)
|
|
9
|
-
super
|
|
10
|
-
end
|
|
11
|
-
|
|
12
8
|
def view_template(&)
|
|
13
9
|
public_send(as, class: classes, **attributes, &)
|
|
14
10
|
end
|
|
15
11
|
|
|
16
|
-
def item(**
|
|
17
|
-
div(class: component_classes("carousel-item", options:
|
|
12
|
+
def item(**options, &)
|
|
13
|
+
div(class: component_classes("carousel-item", options:), **options, &)
|
|
18
14
|
end
|
|
19
15
|
|
|
20
16
|
register_modifiers(
|
data/lib/daisy_ui/chat.rb
CHANGED
|
@@ -5,28 +5,24 @@ module DaisyUI
|
|
|
5
5
|
class Chat < Base
|
|
6
6
|
self.component_class = :chat
|
|
7
7
|
|
|
8
|
-
def initialize(*, as: :div, **)
|
|
9
|
-
super
|
|
10
|
-
end
|
|
11
|
-
|
|
12
8
|
def view_template(&)
|
|
13
9
|
public_send(as, class: classes, **attributes, &)
|
|
14
10
|
end
|
|
15
11
|
|
|
16
|
-
def image(**
|
|
17
|
-
div(class: component_classes("chat-image", options:
|
|
12
|
+
def image(**options, &)
|
|
13
|
+
div(class: component_classes("chat-image", options:), **options, &)
|
|
18
14
|
end
|
|
19
15
|
|
|
20
|
-
def header(**
|
|
21
|
-
div(class: component_classes("chat-header", options:
|
|
16
|
+
def header(**options, &)
|
|
17
|
+
div(class: component_classes("chat-header", options:), **options, &)
|
|
22
18
|
end
|
|
23
19
|
|
|
24
|
-
def bubble(**
|
|
25
|
-
div(class: component_classes("chat-bubble", options:
|
|
20
|
+
def bubble(**options, &)
|
|
21
|
+
div(class: component_classes("chat-bubble", options:), **options, &)
|
|
26
22
|
end
|
|
27
23
|
|
|
28
|
-
def footer(**
|
|
29
|
-
div(class: component_classes("chat-footer", options:
|
|
24
|
+
def footer(**options, &)
|
|
25
|
+
div(class: component_classes("chat-footer", options:), **options, &)
|
|
30
26
|
end
|
|
31
27
|
|
|
32
28
|
register_modifiers(
|
data/lib/daisy_ui/collapse.rb
CHANGED
|
@@ -3,20 +3,18 @@
|
|
|
3
3
|
module DaisyUI
|
|
4
4
|
# @component html class="collapse"
|
|
5
5
|
class Collapse < Base
|
|
6
|
-
|
|
7
|
-
super
|
|
8
|
-
end
|
|
6
|
+
self.component_class = :collapse
|
|
9
7
|
|
|
10
8
|
def view_template(&)
|
|
11
9
|
public_send(as, class: classes, **attributes, &)
|
|
12
10
|
end
|
|
13
11
|
|
|
14
|
-
def title(**
|
|
15
|
-
div(class: component_classes("collapse-title", options:
|
|
12
|
+
def title(**options, &)
|
|
13
|
+
div(class: component_classes("collapse-title", options:), **options, &)
|
|
16
14
|
end
|
|
17
15
|
|
|
18
|
-
def content(**
|
|
19
|
-
div(class: component_classes("collapse-content", options:
|
|
16
|
+
def content(**options, &)
|
|
17
|
+
div(class: component_classes("collapse-content", options:), **options, &)
|
|
20
18
|
end
|
|
21
19
|
|
|
22
20
|
register_modifiers(
|
data/lib/daisy_ui/diff.rb
CHANGED
|
@@ -13,16 +13,16 @@ module DaisyUI
|
|
|
13
13
|
public_send(as, class: classes, **attributes, &)
|
|
14
14
|
end
|
|
15
15
|
|
|
16
|
-
def item_1(**
|
|
17
|
-
div(class: component_classes("diff-item-1", options:
|
|
16
|
+
def item_1(**options, &)
|
|
17
|
+
div(class: component_classes("diff-item-1", options:), **options, &)
|
|
18
18
|
end
|
|
19
19
|
|
|
20
|
-
def item_2(**
|
|
21
|
-
div(class: component_classes("diff-item-2", options:
|
|
20
|
+
def item_2(**options, &)
|
|
21
|
+
div(class: component_classes("diff-item-2", options:), **options, &)
|
|
22
22
|
end
|
|
23
23
|
|
|
24
|
-
def resizer(**
|
|
25
|
-
div(class: component_classes("diff-resizer", options:
|
|
24
|
+
def resizer(**options, &)
|
|
25
|
+
div(class: component_classes("diff-resizer", options:), **options, &)
|
|
26
26
|
end
|
|
27
27
|
end
|
|
28
28
|
end
|
data/lib/daisy_ui/divider.rb
CHANGED
data/lib/daisy_ui/dock.rb
CHANGED
|
@@ -5,16 +5,12 @@ module DaisyUI
|
|
|
5
5
|
class Dock < Base
|
|
6
6
|
self.component_class = :dock
|
|
7
7
|
|
|
8
|
-
def initialize(*, as: :div, **)
|
|
9
|
-
super
|
|
10
|
-
end
|
|
11
|
-
|
|
12
8
|
def view_template(&)
|
|
13
9
|
public_send(as, class: classes, **attributes, &)
|
|
14
10
|
end
|
|
15
11
|
|
|
16
|
-
def label(**
|
|
17
|
-
span(class: component_classes("dock-label", options:
|
|
12
|
+
def label(**options, &)
|
|
13
|
+
span(class: component_classes("dock-label", options:), **options, &)
|
|
18
14
|
end
|
|
19
15
|
|
|
20
16
|
register_modifiers(
|
data/lib/daisy_ui/drawer.rb
CHANGED
|
@@ -13,21 +13,21 @@ module DaisyUI
|
|
|
13
13
|
public_send(as, class: classes, **attributes, &)
|
|
14
14
|
end
|
|
15
15
|
|
|
16
|
-
def toggle(**
|
|
17
|
-
toggle_classes = component_classes("drawer-toggle", options:
|
|
18
|
-
input(id:, type: :checkbox, class: toggle_classes, **
|
|
16
|
+
def toggle(**options, &)
|
|
17
|
+
toggle_classes = component_classes("drawer-toggle", options:)
|
|
18
|
+
input(id:, type: :checkbox, class: toggle_classes, **options, &)
|
|
19
19
|
end
|
|
20
20
|
|
|
21
21
|
def content(as: :div, **options, &)
|
|
22
|
-
public_send(as, class: component_classes("drawer-content", options:
|
|
22
|
+
public_send(as, class: component_classes("drawer-content", options:), **options, &)
|
|
23
23
|
end
|
|
24
24
|
|
|
25
25
|
def side(as: :div, **options, &)
|
|
26
|
-
public_send(as, class: component_classes("drawer-side", options:
|
|
26
|
+
public_send(as, class: component_classes("drawer-side", options:), **options, &)
|
|
27
27
|
end
|
|
28
28
|
|
|
29
29
|
def overlay(**options, &)
|
|
30
|
-
overlay_classes = component_classes("drawer-overlay", options:
|
|
30
|
+
overlay_classes = component_classes("drawer-overlay", options:)
|
|
31
31
|
label(for: id, class: overlay_classes, **options, &)
|
|
32
32
|
end
|
|
33
33
|
|
data/lib/daisy_ui/dropdown.rb
CHANGED
|
@@ -4,10 +4,6 @@ module DaisyUI
|
|
|
4
4
|
class Dropdown < Base
|
|
5
5
|
self.component_class = :dropdown
|
|
6
6
|
|
|
7
|
-
def initialize(*, as: :div, **)
|
|
8
|
-
super
|
|
9
|
-
end
|
|
10
|
-
|
|
11
7
|
def view_template(&)
|
|
12
8
|
if modifiers.include?(:tap_to_close)
|
|
13
9
|
details(class: classes, **attributes, &)
|
|
@@ -24,23 +20,23 @@ module DaisyUI
|
|
|
24
20
|
end
|
|
25
21
|
end
|
|
26
22
|
|
|
27
|
-
def content(*, as: :div, **
|
|
28
|
-
content_classes = component_classes("dropdown-content", options:
|
|
23
|
+
def content(*, as: :div, **options, &)
|
|
24
|
+
content_classes = component_classes("dropdown-content", options:)
|
|
29
25
|
|
|
30
26
|
if modifiers.include?(:tap_to_close)
|
|
31
|
-
render_as(*, as:, class: content_classes, **
|
|
27
|
+
render_as(*, as:, class: content_classes, **options, &)
|
|
32
28
|
else
|
|
33
|
-
render_as(*, as:, tabindex: 0, class: content_classes, **
|
|
29
|
+
render_as(*, as:, tabindex: 0, class: content_classes, **options, &)
|
|
34
30
|
end
|
|
35
31
|
end
|
|
36
32
|
|
|
37
|
-
def menu(*, **
|
|
38
|
-
menu_classes = component_classes("dropdown-content", options:
|
|
33
|
+
def menu(*, **options, &)
|
|
34
|
+
menu_classes = component_classes("dropdown-content", options:)
|
|
39
35
|
|
|
40
36
|
if modifiers.include?(:tap_to_close)
|
|
41
|
-
render Menu.new(*, class: menu_classes, **
|
|
37
|
+
render Menu.new(*, class: menu_classes, **options, &)
|
|
42
38
|
else
|
|
43
|
-
render Menu.new(*, tabindex: 0, class: menu_classes, **
|
|
39
|
+
render Menu.new(*, tabindex: 0, class: menu_classes, **options, &)
|
|
44
40
|
end
|
|
45
41
|
end
|
|
46
42
|
|
data/lib/daisy_ui/fab.rb
CHANGED
|
@@ -5,20 +5,16 @@ module DaisyUI
|
|
|
5
5
|
class Fab < Base
|
|
6
6
|
self.component_class = :fab
|
|
7
7
|
|
|
8
|
-
def initialize(*, as: :div, **)
|
|
9
|
-
super
|
|
10
|
-
end
|
|
11
|
-
|
|
12
8
|
def view_template(&)
|
|
13
9
|
public_send(as, class: classes, **attributes, &)
|
|
14
10
|
end
|
|
15
11
|
|
|
16
|
-
def close(**
|
|
17
|
-
div(class: component_classes("fab-close", options:
|
|
12
|
+
def close(**options, &)
|
|
13
|
+
div(class: component_classes("fab-close", options:), **options, &)
|
|
18
14
|
end
|
|
19
15
|
|
|
20
|
-
def main_action(**
|
|
21
|
-
div(class: component_classes("fab-main-action", options:
|
|
16
|
+
def main_action(**options, &)
|
|
17
|
+
div(class: component_classes("fab-main-action", options:), **options, &)
|
|
22
18
|
end
|
|
23
19
|
|
|
24
20
|
register_modifiers(
|
data/lib/daisy_ui/fieldset.rb
CHANGED
|
@@ -13,8 +13,8 @@ module DaisyUI
|
|
|
13
13
|
public_send(as, class: classes, **attributes, &)
|
|
14
14
|
end
|
|
15
15
|
|
|
16
|
-
def legend(**
|
|
17
|
-
super(class: component_classes("fieldset-legend", options:
|
|
16
|
+
def legend(**options, &)
|
|
17
|
+
super(class: component_classes("fieldset-legend", options:), **options, &)
|
|
18
18
|
end
|
|
19
19
|
end
|
|
20
20
|
end
|
data/lib/daisy_ui/filter.rb
CHANGED
|
@@ -5,17 +5,13 @@ module DaisyUI
|
|
|
5
5
|
class Filter < Base
|
|
6
6
|
self.component_class = :filter
|
|
7
7
|
|
|
8
|
-
def initialize(*, as: :div, **)
|
|
9
|
-
super
|
|
10
|
-
end
|
|
11
|
-
|
|
12
8
|
def view_template(&)
|
|
13
9
|
public_send(as, class: classes, **attributes, &)
|
|
14
10
|
end
|
|
15
11
|
|
|
16
|
-
def reset(**
|
|
17
|
-
reset_classes = component_classes("filter-reset", options:
|
|
18
|
-
input(type: :radio, class: reset_classes, **
|
|
12
|
+
def reset(**options, &)
|
|
13
|
+
reset_classes = component_classes("filter-reset", options:)
|
|
14
|
+
input(type: :radio, class: reset_classes, **options, &)
|
|
19
15
|
end
|
|
20
16
|
end
|
|
21
17
|
end
|
data/lib/daisy_ui/footer.rb
CHANGED
|
@@ -13,8 +13,8 @@ module DaisyUI
|
|
|
13
13
|
public_send(as, class: classes, **attributes, &)
|
|
14
14
|
end
|
|
15
15
|
|
|
16
|
-
def title(**
|
|
17
|
-
div(class: component_classes("footer-title", options:
|
|
16
|
+
def title(**options, &)
|
|
17
|
+
div(class: component_classes("footer-title", options:), **options, &)
|
|
18
18
|
end
|
|
19
19
|
|
|
20
20
|
register_modifiers(
|
data/lib/daisy_ui/hero.rb
CHANGED
|
@@ -5,20 +5,16 @@ module DaisyUI
|
|
|
5
5
|
class Hero < Base
|
|
6
6
|
self.component_class = :hero
|
|
7
7
|
|
|
8
|
-
def initialize(*, as: :div, **)
|
|
9
|
-
super
|
|
10
|
-
end
|
|
11
|
-
|
|
12
8
|
def view_template(&)
|
|
13
9
|
public_send(as, class: classes, **attributes, &)
|
|
14
10
|
end
|
|
15
11
|
|
|
16
|
-
def content(**
|
|
17
|
-
div(class: component_classes("hero-content", options:
|
|
12
|
+
def content(**options, &)
|
|
13
|
+
div(class: component_classes("hero-content", options:), **options, &)
|
|
18
14
|
end
|
|
19
15
|
|
|
20
|
-
def overlay(**
|
|
21
|
-
div(class: component_classes("hero-overlay", options:
|
|
16
|
+
def overlay(**options, &)
|
|
17
|
+
div(class: component_classes("hero-overlay", options:), **options, &)
|
|
22
18
|
end
|
|
23
19
|
end
|
|
24
20
|
end
|
data/lib/daisy_ui/indicator.rb
CHANGED
|
@@ -5,16 +5,12 @@ module DaisyUI
|
|
|
5
5
|
class Indicator < Base
|
|
6
6
|
self.component_class = :indicator
|
|
7
7
|
|
|
8
|
-
def initialize(*, as: :div, **)
|
|
9
|
-
super
|
|
10
|
-
end
|
|
11
|
-
|
|
12
8
|
def view_template(&)
|
|
13
9
|
public_send(as, class: classes, **attributes, &)
|
|
14
10
|
end
|
|
15
11
|
|
|
16
|
-
def item(**
|
|
17
|
-
span(class: component_classes("indicator-item", options:
|
|
12
|
+
def item(**options, &)
|
|
13
|
+
span(class: component_classes("indicator-item", options:), **options, &)
|
|
18
14
|
end
|
|
19
15
|
|
|
20
16
|
register_modifiers(
|
data/lib/daisy_ui/join.rb
CHANGED
|
@@ -3,16 +3,14 @@
|
|
|
3
3
|
module DaisyUI
|
|
4
4
|
# @component html class="join"
|
|
5
5
|
class Join < Base
|
|
6
|
-
|
|
7
|
-
super
|
|
8
|
-
end
|
|
6
|
+
self.component_class = :join
|
|
9
7
|
|
|
10
8
|
def view_template(&)
|
|
11
9
|
public_send(as, class: classes, **attributes, &)
|
|
12
10
|
end
|
|
13
11
|
|
|
14
|
-
def item(**
|
|
15
|
-
div(class: component_classes("join-item", options:
|
|
12
|
+
def item(**options, &)
|
|
13
|
+
div(class: component_classes("join-item", options:), **options, &)
|
|
16
14
|
end
|
|
17
15
|
|
|
18
16
|
register_modifiers(
|
data/lib/daisy_ui/label.rb
CHANGED
|
@@ -1,15 +1,63 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
3
|
module DaisyUI
|
|
4
|
+
# Label component for wrapping inputs, selects, or creating floating labels
|
|
5
|
+
#
|
|
6
|
+
# @example Floating label
|
|
7
|
+
# DaisyUI::Label.new(:floating) do
|
|
8
|
+
# input(type: "text", placeholder: "Email", class: "input input-md")
|
|
9
|
+
# span { "Your Email" }
|
|
10
|
+
# end
|
|
11
|
+
#
|
|
12
|
+
# @example Input wrapper with label
|
|
13
|
+
# DaisyUI::Label.new(:input) do |label|
|
|
14
|
+
# label.text("https://")
|
|
15
|
+
# input(type: "text", placeholder: "URL")
|
|
16
|
+
# end
|
|
17
|
+
#
|
|
18
|
+
# @example Select wrapper with label
|
|
19
|
+
# DaisyUI::Label.new(:select) do |label|
|
|
20
|
+
# label.text("Type")
|
|
21
|
+
# select do
|
|
22
|
+
# option { "Personal" }
|
|
23
|
+
# option { "Business" }
|
|
24
|
+
# end
|
|
25
|
+
# end
|
|
4
26
|
class Label < Base
|
|
5
|
-
|
|
27
|
+
# No default component_class - it varies based on usage
|
|
28
|
+
# (floating-label, input, or select)
|
|
29
|
+
self.component_class = nil
|
|
30
|
+
|
|
31
|
+
register_modifiers(
|
|
32
|
+
# "sm:floating-label"
|
|
33
|
+
# "md:floating-label"
|
|
34
|
+
# "lg:floating-label"
|
|
35
|
+
floating: "floating-label",
|
|
36
|
+
# "sm:input"
|
|
37
|
+
# "md:input"
|
|
38
|
+
# "lg:input"
|
|
39
|
+
input: "input",
|
|
40
|
+
# "sm:select"
|
|
41
|
+
# "md:select"
|
|
42
|
+
# "lg:select"
|
|
43
|
+
select: "select"
|
|
44
|
+
)
|
|
6
45
|
|
|
7
46
|
def view_template(&)
|
|
8
47
|
label(class: classes, **attributes, &)
|
|
9
48
|
end
|
|
10
49
|
|
|
11
|
-
|
|
12
|
-
|
|
50
|
+
# Renders label text for input/select wrappers
|
|
51
|
+
# For floating labels, use a plain span instead
|
|
52
|
+
#
|
|
53
|
+
# @example
|
|
54
|
+
# label.text("Username")
|
|
55
|
+
# label.text { "Email Address" }
|
|
56
|
+
# label.text("https://", class: "custom-class")
|
|
57
|
+
def text(content = nil, **options, &block)
|
|
58
|
+
span(class: component_classes("label", options:), **options) do
|
|
59
|
+
content || yield
|
|
60
|
+
end
|
|
13
61
|
end
|
|
14
62
|
end
|
|
15
63
|
end
|
data/lib/daisy_ui/list.rb
CHANGED
|
@@ -13,8 +13,8 @@ module DaisyUI
|
|
|
13
13
|
public_send(as, class: classes, **attributes, &)
|
|
14
14
|
end
|
|
15
15
|
|
|
16
|
-
def row(**
|
|
17
|
-
li(class: component_classes("list-row", options:
|
|
16
|
+
def row(**options, &)
|
|
17
|
+
li(class: component_classes("list-row", options:), **options, &)
|
|
18
18
|
end
|
|
19
19
|
|
|
20
20
|
register_modifiers(
|
data/lib/daisy_ui/mask.rb
CHANGED
data/lib/daisy_ui/menu.rb
CHANGED
|
@@ -8,8 +8,8 @@ module DaisyUI
|
|
|
8
8
|
ul(class: classes, **attributes, &)
|
|
9
9
|
end
|
|
10
10
|
|
|
11
|
-
def title(*, as: :li, **
|
|
12
|
-
public_send(as, class: component_classes("menu-title", options:
|
|
11
|
+
def title(*, as: :li, **options, &)
|
|
12
|
+
public_send(as, class: component_classes("menu-title", options:), **options, &)
|
|
13
13
|
end
|
|
14
14
|
|
|
15
15
|
def item(*, **, &)
|
data/lib/daisy_ui/menu_item.rb
CHANGED
|
@@ -10,14 +10,14 @@ module DaisyUI
|
|
|
10
10
|
end
|
|
11
11
|
|
|
12
12
|
def title(*, **options, &block)
|
|
13
|
-
h2(class: component_classes("menu-title", options:
|
|
13
|
+
h2(class: component_classes("menu-title", options:), **options, &block)
|
|
14
14
|
end
|
|
15
15
|
|
|
16
|
-
def submenu(*modifiers, **
|
|
16
|
+
def submenu(*modifiers, **options, &)
|
|
17
17
|
if modifiers.include?(:collapsible)
|
|
18
|
-
render CollapsibleSubMenu.new(*modifiers, **
|
|
18
|
+
render CollapsibleSubMenu.new(*modifiers, **options, &)
|
|
19
19
|
else
|
|
20
|
-
render SubMenu.new(*modifiers, **
|
|
20
|
+
render SubMenu.new(*modifiers, **options, &)
|
|
21
21
|
end
|
|
22
22
|
end
|
|
23
23
|
|
|
@@ -5,16 +5,12 @@ module DaisyUI
|
|
|
5
5
|
class MockupBrowser < Base
|
|
6
6
|
self.component_class = "mockup-browser"
|
|
7
7
|
|
|
8
|
-
def initialize(*, as: :div, **)
|
|
9
|
-
super
|
|
10
|
-
end
|
|
11
|
-
|
|
12
8
|
def view_template(&)
|
|
13
9
|
public_send(as, class: classes, **attributes, &)
|
|
14
10
|
end
|
|
15
11
|
|
|
16
|
-
def toolbar(**
|
|
17
|
-
div(class: component_classes("mockup-browser-toolbar", options:
|
|
12
|
+
def toolbar(**options, &)
|
|
13
|
+
div(class: component_classes("mockup-browser-toolbar", options:), **options, &)
|
|
18
14
|
end
|
|
19
15
|
end
|
|
20
16
|
end
|
data/lib/daisy_ui/mockup_code.rb
CHANGED
|
@@ -5,20 +5,16 @@ module DaisyUI
|
|
|
5
5
|
class MockupPhone < Base
|
|
6
6
|
self.component_class = "mockup-phone"
|
|
7
7
|
|
|
8
|
-
def initialize(*, as: :div, **)
|
|
9
|
-
super
|
|
10
|
-
end
|
|
11
|
-
|
|
12
8
|
def view_template(&)
|
|
13
9
|
public_send(as, class: classes, **attributes, &)
|
|
14
10
|
end
|
|
15
11
|
|
|
16
|
-
def camera(**
|
|
17
|
-
div(class: component_classes("mockup-phone-camera", options:
|
|
12
|
+
def camera(**options, &)
|
|
13
|
+
div(class: component_classes("mockup-phone-camera", options:), **options, &)
|
|
18
14
|
end
|
|
19
15
|
|
|
20
|
-
def display(**
|
|
21
|
-
div(class: component_classes("mockup-phone-display", options:
|
|
16
|
+
def display(**options, &)
|
|
17
|
+
div(class: component_classes("mockup-phone-display", options:), **options, &)
|
|
22
18
|
end
|
|
23
19
|
end
|
|
24
20
|
end
|
data/lib/daisy_ui/modal.rb
CHANGED
|
@@ -17,20 +17,20 @@ module DaisyUI
|
|
|
17
17
|
end
|
|
18
18
|
end
|
|
19
19
|
|
|
20
|
-
def body(*, as: :div, **
|
|
21
|
-
public_send(as, class: component_classes("modal-box", options:
|
|
20
|
+
def body(*, as: :div, **options, &)
|
|
21
|
+
public_send(as, class: component_classes("modal-box", options:), **options, &)
|
|
22
22
|
end
|
|
23
23
|
|
|
24
|
-
def action(*, as: :div, **
|
|
25
|
-
action_classes = component_classes("modal-action", options:
|
|
26
|
-
public_send(as, class: action_classes, **
|
|
24
|
+
def action(*, as: :div, **options, &block)
|
|
25
|
+
action_classes = component_classes("modal-action", options:)
|
|
26
|
+
public_send(as, class: action_classes, **options) do
|
|
27
27
|
block&.call(self)
|
|
28
28
|
end
|
|
29
29
|
end
|
|
30
30
|
|
|
31
|
-
def backdrop(*, **
|
|
32
|
-
backdrop_classes = component_classes("modal-backdrop", options:
|
|
33
|
-
form method: :dialog, class: backdrop_classes, **
|
|
31
|
+
def backdrop(*, **options, &)
|
|
32
|
+
backdrop_classes = component_classes("modal-backdrop", options:)
|
|
33
|
+
form method: :dialog, class: backdrop_classes, **options do
|
|
34
34
|
button
|
|
35
35
|
end
|
|
36
36
|
end
|
data/lib/daisy_ui/navbar.rb
CHANGED
|
@@ -12,16 +12,16 @@ module DaisyUI
|
|
|
12
12
|
public_send(as, class: classes, **attributes, &)
|
|
13
13
|
end
|
|
14
14
|
|
|
15
|
-
def start(*, as: :div, **
|
|
16
|
-
public_send(as, class: component_classes("navbar-start", options:
|
|
15
|
+
def start(*, as: :div, **options, &)
|
|
16
|
+
public_send(as, class: component_classes("navbar-start", options:), **options, &)
|
|
17
17
|
end
|
|
18
18
|
|
|
19
|
-
def center(*, as: :div, **
|
|
20
|
-
public_send(as, class: component_classes("navbar-center", options:
|
|
19
|
+
def center(*, as: :div, **options, &)
|
|
20
|
+
public_send(as, class: component_classes("navbar-center", options:), **options, &)
|
|
21
21
|
end
|
|
22
22
|
|
|
23
|
-
def end(*, as: :div, **
|
|
24
|
-
public_send(as, class: component_classes("navbar-end", options:
|
|
23
|
+
def end(*, as: :div, **options, &)
|
|
24
|
+
public_send(as, class: component_classes("navbar-end", options:), **options, &)
|
|
25
25
|
end
|
|
26
26
|
|
|
27
27
|
register_modifiers(
|
data/lib/daisy_ui/pagination.rb
CHANGED
|
@@ -5,16 +5,12 @@ module DaisyUI
|
|
|
5
5
|
class Pagination < Base
|
|
6
6
|
self.component_class = "join"
|
|
7
7
|
|
|
8
|
-
def initialize(*, as: :div, **)
|
|
9
|
-
super
|
|
10
|
-
end
|
|
11
|
-
|
|
12
8
|
def view_template(&)
|
|
13
9
|
public_send(as, class: classes, **attributes, &)
|
|
14
10
|
end
|
|
15
11
|
|
|
16
|
-
def item(**
|
|
17
|
-
div(class: component_classes("join-item", options:
|
|
12
|
+
def item(**options, &)
|
|
13
|
+
div(class: component_classes("join-item", options:), **options, &)
|
|
18
14
|
end
|
|
19
15
|
|
|
20
16
|
register_modifiers(
|
data/lib/daisy_ui/rating.rb
CHANGED
data/lib/daisy_ui/skeleton.rb
CHANGED
data/lib/daisy_ui/stack.rb
CHANGED
data/lib/daisy_ui/stat.rb
CHANGED
|
@@ -5,36 +5,32 @@ module DaisyUI
|
|
|
5
5
|
class Stat < Base
|
|
6
6
|
self.component_class = "stats"
|
|
7
7
|
|
|
8
|
-
def initialize(*, as: :div, **)
|
|
9
|
-
super
|
|
10
|
-
end
|
|
11
|
-
|
|
12
8
|
def view_template(&)
|
|
13
9
|
public_send(as, class: classes, **attributes, &)
|
|
14
10
|
end
|
|
15
11
|
|
|
16
|
-
def item(**
|
|
17
|
-
div(class: component_classes("stat", options:
|
|
12
|
+
def item(**options, &)
|
|
13
|
+
div(class: component_classes("stat", options:), **options, &)
|
|
18
14
|
end
|
|
19
15
|
|
|
20
|
-
def title(**
|
|
21
|
-
div(class: component_classes("stat-title", options:
|
|
16
|
+
def title(**options, &)
|
|
17
|
+
div(class: component_classes("stat-title", options:), **options, &)
|
|
22
18
|
end
|
|
23
19
|
|
|
24
|
-
def value(**
|
|
25
|
-
div(class: component_classes("stat-value", options:
|
|
20
|
+
def value(**options, &)
|
|
21
|
+
div(class: component_classes("stat-value", options:), **options, &)
|
|
26
22
|
end
|
|
27
23
|
|
|
28
|
-
def desc(**
|
|
29
|
-
div(class: component_classes("stat-desc", options:
|
|
24
|
+
def desc(**options, &)
|
|
25
|
+
div(class: component_classes("stat-desc", options:), **options, &)
|
|
30
26
|
end
|
|
31
27
|
|
|
32
|
-
def figure(**
|
|
33
|
-
div(class: component_classes("stat-figure", options:
|
|
28
|
+
def figure(**options, &)
|
|
29
|
+
div(class: component_classes("stat-figure", options:), **options, &)
|
|
34
30
|
end
|
|
35
31
|
|
|
36
|
-
def actions(**
|
|
37
|
-
div(class: component_classes("stat-actions", options:
|
|
32
|
+
def actions(**options, &)
|
|
33
|
+
div(class: component_classes("stat-actions", options:), **options, &)
|
|
38
34
|
end
|
|
39
35
|
|
|
40
36
|
register_modifiers(
|
data/lib/daisy_ui/steps.rb
CHANGED
|
@@ -13,12 +13,12 @@ module DaisyUI
|
|
|
13
13
|
public_send(as, class: classes, **attributes, &)
|
|
14
14
|
end
|
|
15
15
|
|
|
16
|
-
def step(**
|
|
17
|
-
li(class: component_classes("step", options:
|
|
16
|
+
def step(**options, &)
|
|
17
|
+
li(class: component_classes("step", options:), **options, &)
|
|
18
18
|
end
|
|
19
19
|
|
|
20
|
-
def icon(**
|
|
21
|
-
div(class: component_classes("step-icon", options:
|
|
20
|
+
def icon(**options, &)
|
|
21
|
+
div(class: component_classes("step-icon", options:), **options, &)
|
|
22
22
|
end
|
|
23
23
|
|
|
24
24
|
register_modifiers(
|
data/lib/daisy_ui/swap.rb
CHANGED
|
@@ -13,16 +13,16 @@ module DaisyUI
|
|
|
13
13
|
public_send(as, class: classes, **attributes, &)
|
|
14
14
|
end
|
|
15
15
|
|
|
16
|
-
def on(**
|
|
17
|
-
div(class: component_classes("swap-on", options:
|
|
16
|
+
def on(**options, &)
|
|
17
|
+
div(class: component_classes("swap-on", options:), **options, &)
|
|
18
18
|
end
|
|
19
19
|
|
|
20
|
-
def off(**
|
|
21
|
-
div(class: component_classes("swap-off", options:
|
|
20
|
+
def off(**options, &)
|
|
21
|
+
div(class: component_classes("swap-off", options:), **options, &)
|
|
22
22
|
end
|
|
23
23
|
|
|
24
|
-
def indeterminate(**
|
|
25
|
-
div(class: component_classes("swap-indeterminate", options:
|
|
24
|
+
def indeterminate(**options, &)
|
|
25
|
+
div(class: component_classes("swap-indeterminate", options:), **options, &)
|
|
26
26
|
end
|
|
27
27
|
|
|
28
28
|
register_modifiers(
|
data/lib/daisy_ui/tab.rb
CHANGED
|
@@ -25,15 +25,15 @@ module DaisyUI
|
|
|
25
25
|
end
|
|
26
26
|
end
|
|
27
27
|
|
|
28
|
-
def content(*, **
|
|
28
|
+
def content(*, **options, &block)
|
|
29
29
|
unless id
|
|
30
30
|
raise ArgumentError,
|
|
31
31
|
"You must pass an id to Tabs#new if you want to add content"
|
|
32
32
|
end
|
|
33
33
|
|
|
34
34
|
@content = -> do
|
|
35
|
-
content_classes = component_classes("tab-content", options:
|
|
36
|
-
div role: :tabpanel, class: content_classes, **
|
|
35
|
+
content_classes = component_classes("tab-content", options:)
|
|
36
|
+
div role: :tabpanel, class: content_classes, **options, &block
|
|
37
37
|
end
|
|
38
38
|
end
|
|
39
39
|
end
|
data/lib/daisy_ui/timeline.rb
CHANGED
|
@@ -13,16 +13,16 @@ module DaisyUI
|
|
|
13
13
|
public_send(as, class: classes, **attributes, &)
|
|
14
14
|
end
|
|
15
15
|
|
|
16
|
-
def start(**
|
|
17
|
-
div(class: component_classes("timeline-start", options:
|
|
16
|
+
def start(**options, &)
|
|
17
|
+
div(class: component_classes("timeline-start", options:), **options, &)
|
|
18
18
|
end
|
|
19
19
|
|
|
20
|
-
def middle(**
|
|
21
|
-
div(class: component_classes("timeline-middle", options:
|
|
20
|
+
def middle(**options, &)
|
|
21
|
+
div(class: component_classes("timeline-middle", options:), **options, &)
|
|
22
22
|
end
|
|
23
23
|
|
|
24
|
-
def end(**
|
|
25
|
-
div(class: component_classes("timeline-end", options:
|
|
24
|
+
def end(**options, &)
|
|
25
|
+
div(class: component_classes("timeline-end", options:), **options, &)
|
|
26
26
|
end
|
|
27
27
|
|
|
28
28
|
register_modifiers(
|
data/lib/daisy_ui/toast.rb
CHANGED
data/lib/daisy_ui/validator.rb
CHANGED
|
@@ -19,7 +19,7 @@ module DaisyUI
|
|
|
19
19
|
end
|
|
20
20
|
|
|
21
21
|
def hint(**options, &block)
|
|
22
|
-
@hint = -> { p(class: component_classes("validator-hint", options:
|
|
22
|
+
@hint = -> { p(class: component_classes("validator-hint", options:), **options, &block) }
|
|
23
23
|
end
|
|
24
24
|
end
|
|
25
25
|
end
|
data/lib/daisy_ui/version.rb
CHANGED