daisyui 1.0.1 → 1.0.3
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 -6
- data/lib/daisy_ui/avatar.rb +0 -6
- data/lib/daisy_ui/avatar_group.rb +2 -6
- data/lib/daisy_ui/badge.rb +0 -2
- data/lib/daisy_ui/base.rb +59 -14
- data/lib/daisy_ui/breadcrumbs.rb +4 -8
- data/lib/daisy_ui/calendar.rb +2 -2
- 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/collapsible_sub_menu.rb +9 -15
- data/lib/daisy_ui/configurable.rb +2 -0
- 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 +14 -6
- data/lib/daisy_ui/dropdown.rb +16 -14
- 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 +2 -2
- data/lib/daisy_ui/list.rb +2 -2
- data/lib/daisy_ui/loading.rb +0 -2
- data/lib/daisy_ui/mask.rb +0 -6
- data/lib/daisy_ui/menu.rb +4 -6
- data/lib/daisy_ui/menu_item.rb +5 -7
- 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 -10
- 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 -6
- 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/sub_menu.rb +7 -7
- data/lib/daisy_ui/swap.rb +6 -6
- data/lib/daisy_ui/tab.rb +6 -6
- data/lib/daisy_ui/tab_with_content.rb +9 -2
- data/lib/daisy_ui/tab_without_content.rb +0 -2
- data/lib/daisy_ui/table.rb +8 -10
- data/lib/daisy_ui/table_row.rb +5 -7
- data/lib/daisy_ui/tabs.rb +8 -3
- data/lib/daisy_ui/theme_controller.rb +2 -2
- 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
- data/lib/daisy_ui.rb +2 -0
- metadata +3 -2
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
|
@@ -54,8 +54,8 @@ module DaisyUI
|
|
|
54
54
|
# label.text("Username")
|
|
55
55
|
# label.text { "Email Address" }
|
|
56
56
|
# label.text("https://", class: "custom-class")
|
|
57
|
-
def text(content = nil, **options
|
|
58
|
-
span(class: component_classes("label", options:
|
|
57
|
+
def text(content = nil, **options)
|
|
58
|
+
span(class: component_classes("label", options:), **options) do
|
|
59
59
|
content || yield
|
|
60
60
|
end
|
|
61
61
|
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/loading.rb
CHANGED
data/lib/daisy_ui/mask.rb
CHANGED
|
@@ -4,16 +4,10 @@ module DaisyUI
|
|
|
4
4
|
class Mask < Base
|
|
5
5
|
self.component_class = :mask
|
|
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, &)
|
|
13
9
|
end
|
|
14
10
|
|
|
15
|
-
private
|
|
16
|
-
|
|
17
11
|
register_modifiers(
|
|
18
12
|
# "sm:mask-squircle"
|
|
19
13
|
# "@sm:mask-squircle"
|
data/lib/daisy_ui/menu.rb
CHANGED
|
@@ -8,12 +8,12 @@ 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
|
-
def item(
|
|
16
|
-
render MenuItem.new(
|
|
15
|
+
def item(...)
|
|
16
|
+
render MenuItem.new(...)
|
|
17
17
|
end
|
|
18
18
|
|
|
19
19
|
def submenu(*modifiers, **, &)
|
|
@@ -28,8 +28,6 @@ module DaisyUI
|
|
|
28
28
|
end
|
|
29
29
|
end
|
|
30
30
|
|
|
31
|
-
private
|
|
32
|
-
|
|
33
31
|
register_modifiers(
|
|
34
32
|
# "sm:menu-xs"
|
|
35
33
|
# "@sm:menu-xs"
|
data/lib/daisy_ui/menu_item.rb
CHANGED
|
@@ -9,20 +9,18 @@ module DaisyUI
|
|
|
9
9
|
li(class: classes, **attributes, &)
|
|
10
10
|
end
|
|
11
11
|
|
|
12
|
-
def title(*, **options, &
|
|
13
|
-
h2(class: component_classes("menu-title", options:
|
|
12
|
+
def title(*, **options, &)
|
|
13
|
+
h2(class: component_classes("menu-title", options:), **options, &)
|
|
14
14
|
end
|
|
15
15
|
|
|
16
|
-
def submenu(*modifiers,
|
|
16
|
+
def submenu(*modifiers, **, &)
|
|
17
17
|
if modifiers.include?(:collapsible)
|
|
18
|
-
render CollapsibleSubMenu.new(*modifiers,
|
|
18
|
+
render CollapsibleSubMenu.new(*modifiers, **, &)
|
|
19
19
|
else
|
|
20
|
-
render SubMenu.new(*modifiers,
|
|
20
|
+
render SubMenu.new(*modifiers, **, &)
|
|
21
21
|
end
|
|
22
22
|
end
|
|
23
23
|
|
|
24
|
-
private
|
|
25
|
-
|
|
26
24
|
register_modifiers(
|
|
27
25
|
# "sm:disabled"
|
|
28
26
|
# "@sm:disabled"
|
|
@@ -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
|
|
@@ -41,8 +41,6 @@ module DaisyUI
|
|
|
41
41
|
end
|
|
42
42
|
end
|
|
43
43
|
|
|
44
|
-
private
|
|
45
|
-
|
|
46
44
|
register_modifiers(
|
|
47
45
|
# "sm:modal-open"
|
|
48
46
|
# "@sm:modal-open"
|
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
|
@@ -4,16 +4,10 @@ module DaisyUI
|
|
|
4
4
|
class Skeleton < Base
|
|
5
5
|
self.component_class = :skeleton
|
|
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, &)
|
|
13
9
|
end
|
|
14
10
|
|
|
15
|
-
private
|
|
16
|
-
|
|
17
11
|
register_modifiers({})
|
|
18
12
|
end
|
|
19
13
|
end
|
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/sub_menu.rb
CHANGED
|
@@ -17,11 +17,11 @@ module DaisyUI
|
|
|
17
17
|
end
|
|
18
18
|
end
|
|
19
19
|
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
20
|
+
return unless @items.any?
|
|
21
|
+
|
|
22
|
+
ul do
|
|
23
|
+
@items.each do |item|
|
|
24
|
+
render item
|
|
25
25
|
end
|
|
26
26
|
end
|
|
27
27
|
end
|
|
@@ -30,8 +30,8 @@ module DaisyUI
|
|
|
30
30
|
@title = block
|
|
31
31
|
end
|
|
32
32
|
|
|
33
|
-
def item(
|
|
34
|
-
@items << MenuItem.new(
|
|
33
|
+
def item(...)
|
|
34
|
+
@items << MenuItem.new(...)
|
|
35
35
|
end
|
|
36
36
|
end
|
|
37
37
|
end
|
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
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
module DaisyUI
|
|
4
4
|
# @private
|
|
5
5
|
class Tab < Base
|
|
6
|
-
def initialize(*modifiers, label: nil, id: nil, **
|
|
7
|
-
super(*modifiers, **
|
|
6
|
+
def initialize(*modifiers, label: nil, id: nil, **)
|
|
7
|
+
super(*modifiers, **)
|
|
8
8
|
@label = label
|
|
9
9
|
@id = id
|
|
10
10
|
end
|
|
@@ -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
|
-
@content =
|
|
35
|
-
content_classes = component_classes("tab-content", options:
|
|
36
|
-
div role: :tabpanel, class: content_classes, **
|
|
34
|
+
@content = lambda do
|
|
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
|
|
@@ -17,9 +17,9 @@ module DaisyUI
|
|
|
17
17
|
tab_attrs = {
|
|
18
18
|
type: :radio,
|
|
19
19
|
name: id,
|
|
20
|
-
class: classes,
|
|
20
|
+
class: classes, # This deletes :class from options
|
|
21
21
|
role: :tab,
|
|
22
|
-
aria: {label: @label}
|
|
22
|
+
aria: { label: @label }
|
|
23
23
|
}
|
|
24
24
|
|
|
25
25
|
# Now get remaining attributes (class has been deleted by classes method)
|
|
@@ -52,6 +52,13 @@ module DaisyUI
|
|
|
52
52
|
|
|
53
53
|
private
|
|
54
54
|
|
|
55
|
+
# Override Base#attributes to exclude :id from the tab input.
|
|
56
|
+
# The TabWithContent component uses :id for the `name` attribute
|
|
57
|
+
# to group radio inputs together - NOT for the id attribute.
|
|
58
|
+
def attributes
|
|
59
|
+
options
|
|
60
|
+
end
|
|
61
|
+
|
|
55
62
|
register_modifiers(
|
|
56
63
|
# "sm:tab-active"
|
|
57
64
|
# "@sm:tab-active"
|
data/lib/daisy_ui/table.rb
CHANGED
|
@@ -8,24 +8,22 @@ module DaisyUI
|
|
|
8
8
|
table(class: classes, **attributes, &)
|
|
9
9
|
end
|
|
10
10
|
|
|
11
|
-
def header(
|
|
12
|
-
thead(
|
|
11
|
+
def header(...)
|
|
12
|
+
thead(...)
|
|
13
13
|
end
|
|
14
14
|
|
|
15
|
-
def row(
|
|
16
|
-
render TableRow.new(
|
|
15
|
+
def row(...)
|
|
16
|
+
render TableRow.new(...)
|
|
17
17
|
end
|
|
18
18
|
|
|
19
|
-
def body(
|
|
20
|
-
tbody(
|
|
19
|
+
def body(...)
|
|
20
|
+
tbody(...)
|
|
21
21
|
end
|
|
22
22
|
|
|
23
|
-
def footer(
|
|
24
|
-
tfoot(
|
|
23
|
+
def footer(...)
|
|
24
|
+
tfoot(...)
|
|
25
25
|
end
|
|
26
26
|
|
|
27
|
-
private
|
|
28
|
-
|
|
29
27
|
register_modifiers(
|
|
30
28
|
# "sm:table-zebra"
|
|
31
29
|
# "@sm:table-zebra"
|
data/lib/daisy_ui/table_row.rb
CHANGED
|
@@ -8,16 +8,14 @@ module DaisyUI
|
|
|
8
8
|
tr(class: classes, **attributes, &)
|
|
9
9
|
end
|
|
10
10
|
|
|
11
|
-
def head(
|
|
12
|
-
th(
|
|
11
|
+
def head(...)
|
|
12
|
+
th(...)
|
|
13
13
|
end
|
|
14
14
|
|
|
15
|
-
def column(
|
|
16
|
-
td(
|
|
15
|
+
def column(...)
|
|
16
|
+
td(...)
|
|
17
17
|
end
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
private
|
|
18
|
+
alias cell column
|
|
21
19
|
|
|
22
20
|
register_modifiers(
|
|
23
21
|
# "sm:table-row-hover"
|
data/lib/daisy_ui/tabs.rb
CHANGED
|
@@ -16,15 +16,20 @@ module DaisyUI
|
|
|
16
16
|
def tab(*args, label: nil, **, &)
|
|
17
17
|
# If first arg is a string, it's the label, rest are modifiers
|
|
18
18
|
# Otherwise all args are modifiers
|
|
19
|
-
if args.first.is_a?(String)
|
|
20
|
-
label = args.shift
|
|
21
|
-
end
|
|
19
|
+
label = args.shift if args.first.is_a?(String)
|
|
22
20
|
|
|
23
21
|
render Tab.new(*args, label:, id:, **, &)
|
|
24
22
|
end
|
|
25
23
|
|
|
26
24
|
private
|
|
27
25
|
|
|
26
|
+
# Override Base#attributes to exclude :id from the main tabs container.
|
|
27
|
+
# The Tabs component uses :id internally to wire up the radio inputs
|
|
28
|
+
# and their associated content panels - NOT for the main container.
|
|
29
|
+
def attributes
|
|
30
|
+
options
|
|
31
|
+
end
|
|
32
|
+
|
|
28
33
|
register_modifiers(
|
|
29
34
|
# "sm:tabs-boxed"
|
|
30
35
|
# "@sm:tabs-boxed"
|
|
@@ -36,7 +36,7 @@ module DaisyUI
|
|
|
36
36
|
# Input always has just the theme-controller class
|
|
37
37
|
input_classes = self.class.component_class.to_s
|
|
38
38
|
|
|
39
|
-
attrs = {type: :checkbox, class: input_classes}
|
|
39
|
+
attrs = { type: :checkbox, class: input_classes }
|
|
40
40
|
attrs[:value] = theme_value if theme_value
|
|
41
41
|
attrs[:checked] = true if checked
|
|
42
42
|
attrs.merge!(options)
|
|
@@ -48,7 +48,7 @@ module DaisyUI
|
|
|
48
48
|
label(class: wrapper_classes) do
|
|
49
49
|
public_send(as, **attrs)
|
|
50
50
|
whitespace
|
|
51
|
-
|
|
51
|
+
yield
|
|
52
52
|
whitespace
|
|
53
53
|
end
|
|
54
54
|
else
|