daisyui-view-components 0.0.2 → 0.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/CHANGELOG.md +7 -0
- data/daisyui-view-components/app/components/daisyui_view_components/accordion/component.rb +28 -0
- data/daisyui-view-components/app/components/daisyui_view_components/alert/component.html.erb +34 -0
- data/daisyui-view-components/app/components/daisyui_view_components/alert/component.rb +27 -0
- data/daisyui-view-components/app/components/daisyui_view_components/avatar/component.rb +21 -0
- data/daisyui-view-components/app/components/daisyui_view_components/avatar_group/component.rb +19 -0
- data/daisyui-view-components/app/components/daisyui_view_components/badge/component.rb +41 -0
- data/daisyui-view-components/app/components/daisyui_view_components/base_component.rb +118 -0
- data/daisyui-view-components/app/components/daisyui_view_components/bottom_nav/component.rb +50 -0
- data/daisyui-view-components/app/components/daisyui_view_components/breadcrumbs/component.html.erb +7 -0
- data/daisyui-view-components/app/components/daisyui_view_components/breadcrumbs/component.rb +21 -0
- data/daisyui-view-components/app/components/daisyui_view_components/button/component.rb +68 -0
- data/daisyui-view-components/app/components/daisyui_view_components/card/component.rb +64 -0
- data/daisyui-view-components/app/components/daisyui_view_components/carousel/component.rb +35 -0
- data/daisyui-view-components/app/components/daisyui_view_components/checkbox/component.html.erb +19 -0
- data/daisyui-view-components/app/components/daisyui_view_components/checkbox/component.rb +40 -0
- data/daisyui-view-components/app/components/daisyui_view_components/collapse/component.html.erb +9 -0
- data/daisyui-view-components/app/components/daisyui_view_components/collapse/component.rb +62 -0
- data/daisyui-view-components/app/components/daisyui_view_components/dropdown/component.html.erb +4 -0
- data/daisyui-view-components/app/components/daisyui_view_components/dropdown/component.rb +37 -0
- data/daisyui-view-components/app/components/daisyui_view_components/file_input/component.html.erb +5 -0
- data/daisyui-view-components/app/components/daisyui_view_components/file_input/component.rb +44 -0
- data/daisyui-view-components/app/components/daisyui_view_components/form_control/component.rb +21 -0
- data/daisyui-view-components/app/components/daisyui_view_components/label/component.rb +22 -0
- data/daisyui-view-components/app/components/daisyui_view_components/link/component.rb +34 -0
- data/daisyui-view-components/app/components/daisyui_view_components/menu/component.html.erb +7 -0
- data/daisyui-view-components/app/components/daisyui_view_components/menu/component.rb +28 -0
- data/daisyui-view-components/app/components/daisyui_view_components/modal/action/component.rb +30 -0
- data/daisyui-view-components/app/components/daisyui_view_components/modal/box/component.html.erb +9 -0
- data/daisyui-view-components/app/components/daisyui_view_components/modal/box/component.rb +15 -0
- data/daisyui-view-components/app/components/daisyui_view_components/modal/component.html.erb +8 -0
- data/daisyui-view-components/app/components/daisyui_view_components/modal/component.rb +18 -0
- data/daisyui-view-components/app/components/daisyui_view_components/navbar/component.html.erb +9 -0
- data/daisyui-view-components/app/components/daisyui_view_components/navbar/component.rb +42 -0
- data/daisyui-view-components/app/components/daisyui_view_components/radio/component.html.erb +19 -0
- data/daisyui-view-components/app/components/daisyui_view_components/radio/component.rb +57 -0
- data/daisyui-view-components/app/components/daisyui_view_components/range/component.rb +45 -0
- data/daisyui-view-components/app/components/daisyui_view_components/rating/component.rb +73 -0
- data/daisyui-view-components/app/components/daisyui_view_components/select/component.html.erb +5 -0
- data/daisyui-view-components/app/components/daisyui_view_components/select/component.rb +73 -0
- data/daisyui-view-components/app/components/daisyui_view_components/steps/component.rb +56 -0
- data/daisyui-view-components/app/components/daisyui_view_components/swap/component.rb +49 -0
- data/daisyui-view-components/app/components/daisyui_view_components/table/component.html.erb +5 -0
- data/daisyui-view-components/app/components/daisyui_view_components/table/component.rb +92 -0
- data/daisyui-view-components/app/components/daisyui_view_components/tabs/component.html.erb +5 -0
- data/daisyui-view-components/app/components/daisyui_view_components/tabs/component.rb +50 -0
- data/daisyui-view-components/app/components/daisyui_view_components/text_input/component.html.erb +9 -0
- data/daisyui-view-components/app/components/daisyui_view_components/text_input/component.rb +71 -0
- data/daisyui-view-components/app/components/daisyui_view_components/textarea/component.html.erb +5 -0
- data/daisyui-view-components/app/components/daisyui_view_components/textarea/component.rb +50 -0
- data/daisyui-view-components/app/components/daisyui_view_components/toggle/component.rb +43 -0
- data/daisyui-view-components/lib/daisyui_view_components/cache.rb +50 -0
- data/daisyui-view-components/lib/daisyui_view_components/engine.rb +30 -0
- data/daisyui-view-components/lib/daisyui_view_components/helpers/component.rb +36 -0
- data/daisyui-view-components/lib/daisyui_view_components/tailwind_merger.rb +23 -0
- data/daisyui-view-components/lib/daisyui_view_components/version.rb +7 -0
- data/daisyui-view-components/lib/daisyui_view_components.rb +12 -0
- data/daisyui-view-components/previews/accordion/default.html.erb +29 -0
- data/daisyui-view-components/previews/accordion/preview.rb +14 -0
- data/daisyui-view-components/previews/alert/default.html.erb +4 -0
- data/daisyui-view-components/previews/alert/info_color.html.erb +4 -0
- data/daisyui-view-components/previews/alert/preview.rb +23 -0
- data/daisyui-view-components/previews/alert/with_buttons.html.erb +10 -0
- data/daisyui-view-components/previews/alert/with_icon_title_and_description.html.erb +14 -0
- data/daisyui-view-components/previews/avatar/default.html.erb +5 -0
- data/daisyui-view-components/previews/avatar/preview.rb +19 -0
- data/daisyui-view-components/previews/avatar_group/default.html.erb +17 -0
- data/daisyui-view-components/previews/avatar_group/preview.rb +12 -0
- data/daisyui-view-components/previews/badge/default.html.erb +1 -0
- data/daisyui-view-components/previews/badge/preview.rb +14 -0
- data/daisyui-view-components/previews/bottom_nav/default.html.erb +44 -0
- data/daisyui-view-components/previews/bottom_nav/preview.rb +16 -0
- data/daisyui-view-components/previews/bottom_nav/with_labels.html.erb +47 -0
- data/daisyui-view-components/previews/breadcrumbs/default.html.erb +11 -0
- data/daisyui-view-components/previews/breadcrumbs/preview.rb +16 -0
- data/daisyui-view-components/previews/breadcrumbs/with_icons.html.erb +50 -0
- data/daisyui-view-components/previews/button/default.html.erb +3 -0
- data/daisyui-view-components/previews/button/preview.rb +28 -0
- data/daisyui-view-components/previews/card/default.html.erb +24 -0
- data/daisyui-view-components/previews/card/preview.rb +12 -0
- data/daisyui-view-components/previews/carousel/default.html.erb +37 -0
- data/daisyui-view-components/previews/carousel/preview.rb +19 -0
- data/daisyui-view-components/previews/checkbox/default.html.erb +1 -0
- data/daisyui-view-components/previews/checkbox/preview.rb +34 -0
- data/daisyui-view-components/previews/checkbox/with_form.html.erb +3 -0
- data/daisyui-view-components/previews/collapse/default.html.erb +9 -0
- data/daisyui-view-components/previews/collapse/preview.rb +14 -0
- data/daisyui-view-components/previews/dropdown/default.html.erb +11 -0
- data/daisyui-view-components/previews/dropdown/preview.rb +13 -0
- data/daisyui-view-components/previews/file_input/default.html.erb +1 -0
- data/daisyui-view-components/previews/file_input/preview.rb +26 -0
- data/daisyui-view-components/previews/file_input/with_form.html.erb +13 -0
- data/daisyui-view-components/previews/link/default.html.erb +1 -0
- data/daisyui-view-components/previews/link/preview.rb +17 -0
- data/daisyui-view-components/previews/modal/default.html.erb +14 -0
- data/daisyui-view-components/previews/modal/preview.rb +19 -0
- data/daisyui-view-components/previews/navbar/default.html.erb +75 -0
- data/daisyui-view-components/previews/navbar/preview.rb +12 -0
- data/daisyui-view-components/previews/radio/default.html.erb +1 -0
- data/daisyui-view-components/previews/radio/preview.rb +26 -0
- data/daisyui-view-components/previews/radio/with_form.html.erb +4 -0
- data/daisyui-view-components/previews/range_slider/default.html.erb +1 -0
- data/daisyui-view-components/previews/range_slider/preview.rb +14 -0
- data/daisyui-view-components/previews/rating/default.html.erb +6 -0
- data/daisyui-view-components/previews/rating/preview.rb +14 -0
- data/daisyui-view-components/previews/select/default.html.erb +1 -0
- data/daisyui-view-components/previews/select/preview.rb +26 -0
- data/daisyui-view-components/previews/select/with_form.html.erb +13 -0
- data/daisyui-view-components/previews/steps/default.html.erb +14 -0
- data/daisyui-view-components/previews/steps/preview.rb +13 -0
- data/daisyui-view-components/previews/swap/default.html.erb +9 -0
- data/daisyui-view-components/previews/swap/flip_effect.html.erb +9 -0
- data/daisyui-view-components/previews/swap/hamburger_button.html.erb +26 -0
- data/daisyui-view-components/previews/swap/preview.rb +28 -0
- data/daisyui-view-components/previews/swap/rotate_effect.html.erb +23 -0
- data/daisyui-view-components/previews/swap/volume_icons.html.erb +27 -0
- data/daisyui-view-components/previews/table/default.html.erb +60 -0
- data/daisyui-view-components/previews/table/preview.rb +17 -0
- data/daisyui-view-components/previews/tabs/default.html.erb +11 -0
- data/daisyui-view-components/previews/tabs/preview.rb +21 -0
- data/daisyui-view-components/previews/text_input/default.html.erb +1 -0
- data/daisyui-view-components/previews/text_input/preview.rb +42 -0
- data/daisyui-view-components/previews/text_input/with_form.html.erb +13 -0
- data/daisyui-view-components/previews/text_input/with_icon_inside.html.erb +59 -0
- data/daisyui-view-components/previews/text_input/with_text_label_inside.html.erb +26 -0
- data/daisyui-view-components/previews/textarea/default.html.erb +1 -0
- data/daisyui-view-components/previews/textarea/preview.rb +26 -0
- data/daisyui-view-components/previews/textarea/with_form.html.erb +13 -0
- data/daisyui-view-components/previews/toggle/default.html.erb +1 -0
- data/daisyui-view-components/previews/toggle/preview.rb +26 -0
- data/daisyui-view-components/previews/toggle/with_form.html.erb +3 -0
- metadata +137 -7
@@ -0,0 +1 @@
|
|
1
|
+
<%= component :link, "Link", url: "#", color: color, data: { action: "click" } %>
|
@@ -0,0 +1,17 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Link
|
4
|
+
# @label Link
|
5
|
+
class Preview < ViewComponent::Preview
|
6
|
+
|
7
|
+
# @param color [Symbol] select {{ DaisyUIViewComponents::Link::Component::COLOR_OPTIONS }}
|
8
|
+
# @param url [String]
|
9
|
+
def default(color: DaisyUIViewComponents::Link::Component::DEFAULT_COLOR, url: '#')
|
10
|
+
render_with_template locals: {
|
11
|
+
url: url,
|
12
|
+
color: color
|
13
|
+
}, template: 'link/default'
|
14
|
+
end
|
15
|
+
|
16
|
+
end
|
17
|
+
end
|
@@ -0,0 +1,14 @@
|
|
1
|
+
<%= component :button, 'Open Modal', onclick: 'my_modal_2.showModal()' %>
|
2
|
+
|
3
|
+
<%= component :modal, id: 'my_modal_2', open: open, backdrop: backdrop do |modal| %>
|
4
|
+
<% modal.with_modal_box close_button: close_button do |box| %>
|
5
|
+
<h3 class="text-lg font-bold">Hello 2!</h3>
|
6
|
+
<p class="py-4">2 - Press ESC key or click the button below to close</p>
|
7
|
+
<% box.with_modal_action do |action| %>
|
8
|
+
<%= action.with_close_button class: "btn-sm" %>
|
9
|
+
<%= action.with_button class: "btn-sm" do %>
|
10
|
+
Accept
|
11
|
+
<% end %>
|
12
|
+
<% end %>
|
13
|
+
<% end %>
|
14
|
+
<% end %>
|
@@ -0,0 +1,19 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Modal
|
4
|
+
# @label Modal
|
5
|
+
class Preview < ViewComponent::Preview
|
6
|
+
|
7
|
+
# @param open [Boolean] select [false, true] "Default modal to opened state"
|
8
|
+
# @param backdrop [Boolean] select [true, false] "Whether to allow closing the modal on backdrop clicks"
|
9
|
+
# @param close_button [Boolean] select [true, false] "Whether to show a close button 'x' in the top right corner of the modal"
|
10
|
+
def default(open: false, backdrop: true, close_button: true)
|
11
|
+
render_with_template locals: {
|
12
|
+
open: open,
|
13
|
+
backdrop: backdrop,
|
14
|
+
close_button: close_button
|
15
|
+
}, template: 'modal/default'
|
16
|
+
end
|
17
|
+
|
18
|
+
end
|
19
|
+
end
|
@@ -0,0 +1,75 @@
|
|
1
|
+
<%= component :navbar do |nav| %>
|
2
|
+
<% nav.with_start_element do %>
|
3
|
+
<%= component :dropdown, class: 'lg:hidden' do |dropdown| %>
|
4
|
+
<% dropdown.with_trigger do %>
|
5
|
+
<svg
|
6
|
+
xmlns="http://www.w3.org/2000/svg"
|
7
|
+
class="h-5 w-5"
|
8
|
+
fill="none"
|
9
|
+
viewBox="0 0 24 24"
|
10
|
+
stroke="currentColor">
|
11
|
+
<path
|
12
|
+
stroke-linecap="round"
|
13
|
+
stroke-linejoin="round"
|
14
|
+
stroke-width="2"
|
15
|
+
d="M4 6h16M4 12h8m-8 6h16" />
|
16
|
+
</svg>
|
17
|
+
<% end %>
|
18
|
+
<% dropdown.with_menu do |menu| %>
|
19
|
+
<% menu.with_item do %>
|
20
|
+
<a>Item 1</a>
|
21
|
+
<% end %>
|
22
|
+
<% menu.with_item do %>
|
23
|
+
<a>Item 2</a>
|
24
|
+
<% end %>
|
25
|
+
<% end %>
|
26
|
+
<% end %>
|
27
|
+
<a class="btn btn-ghost text-xl hidden md:block lg:block">daisyUI</a>
|
28
|
+
<% end %>
|
29
|
+
|
30
|
+
<% nav.with_center_element class: 'hidden lg:flex' do %>
|
31
|
+
<div class="form-control">
|
32
|
+
<input type="text" placeholder="Search" class="input input-bordered w-24 md:w-auto" />
|
33
|
+
</div>
|
34
|
+
<% end %>
|
35
|
+
|
36
|
+
<% nav.with_end_element class: 'gap-2' do %>
|
37
|
+
<%= component :menu, class: 'menu-horizontal px-1' do |menu| %>
|
38
|
+
<% menu.with_item do %>
|
39
|
+
<a>Item 1</a>
|
40
|
+
<% end %>
|
41
|
+
<% menu.with_item collapsible: true do %>
|
42
|
+
<summary>Parent</summary>
|
43
|
+
<ul class="p-2 bg-base-200 w-40">
|
44
|
+
<li><a>Submenu 1</a></li>
|
45
|
+
<li><a>Submenu 2</a></li>
|
46
|
+
</ul>
|
47
|
+
<% end %>
|
48
|
+
<% menu.with_item do %>
|
49
|
+
<a>Item 3</a>
|
50
|
+
<% end %>
|
51
|
+
<% end %>
|
52
|
+
<%= component :dropdown, position: :end do |dropdown| %>
|
53
|
+
<% dropdown.with_trigger class: 'btn btn-ghost btn-circle' do %>
|
54
|
+
<%= component :avatar do %>
|
55
|
+
<div class="w-10 rounded-full">
|
56
|
+
<img
|
57
|
+
alt="Tailwind CSS Navbar component"
|
58
|
+
src="https://avatar.iran.liara.run/public/88" />
|
59
|
+
</div>
|
60
|
+
<% end %>
|
61
|
+
<% end %>
|
62
|
+
<% dropdown.with_menu do |menu| %>
|
63
|
+
<% menu.with_item do %>
|
64
|
+
<a>Profile</a>
|
65
|
+
<% end %>
|
66
|
+
<% menu.with_item do %>
|
67
|
+
<a>Settings</a>
|
68
|
+
<% end %>
|
69
|
+
<% menu.with_item do %>
|
70
|
+
<a>Logout</a>
|
71
|
+
<% end %>
|
72
|
+
<% end %>
|
73
|
+
<% end %>
|
74
|
+
<% end %>
|
75
|
+
<% end %>
|
@@ -0,0 +1 @@
|
|
1
|
+
<%= component :radio, size: size, color: color, checked: checked, disabled: disabled, value: "something" %>
|
@@ -0,0 +1,26 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# rubocop:disable Layout/LineLength
|
4
|
+
module Radio
|
5
|
+
# @label Radio
|
6
|
+
class Preview < ViewComponent::Preview
|
7
|
+
|
8
|
+
# @param size [Symbol] select {{ DaisyUIViewComponents::Radio::Component::SIZE_OPTIONS.dup.push('nil') }}
|
9
|
+
# @param color [Symbol] select {{ DaisyUIViewComponents::Radio::Component::COLOR_OPTIONS.dup.push('nil') }}
|
10
|
+
# @param checked [Boolean] select [false, true] "Checked"
|
11
|
+
# @param disabled [Boolean] select [false, true] "Disabled"
|
12
|
+
def default(size: nil, color: nil, disabled: false, checked: false)
|
13
|
+
render_with_template locals: { size: size, color: color, disabled: disabled, checked: checked }, template: 'radio/default'
|
14
|
+
end
|
15
|
+
|
16
|
+
# @param size [Symbol] select {{ DaisyUIViewComponents::Radio::Component::SIZE_OPTIONS.dup.push('nil') }}
|
17
|
+
# @param color [Symbol] select {{ DaisyUIViewComponents::Radio::Component::COLOR_OPTIONS.dup.push('nil') }}
|
18
|
+
# @param checked [Boolean] select [false, true] "Checked"
|
19
|
+
# @param disabled [Boolean] select [false, true] "Disabled"
|
20
|
+
def with_form(size: nil, color: nil, disabled: false, checked: false)
|
21
|
+
render_with_template locals: { size: size, color: color, disabled: disabled, checked: checked }, template: 'radio/with_form'
|
22
|
+
end
|
23
|
+
|
24
|
+
end
|
25
|
+
end
|
26
|
+
# rubocop:enable Layout/LineLength
|
@@ -0,0 +1 @@
|
|
1
|
+
<%= component :range, size: size, color: color, min: min, max: max, value: "10", name: "something" %>
|
@@ -0,0 +1,14 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module RangeSlider
|
4
|
+
# @label Range Slider
|
5
|
+
class Preview < ViewComponent::Preview
|
6
|
+
|
7
|
+
# @param size [Symbol] select {{ DaisyUIViewComponents::Range::Component::SIZE_OPTIONS.dup.push('nil') }}
|
8
|
+
# @param color [Symbol] select {{ DaisyUIViewComponents::Range::Component::COLOR_OPTIONS.dup.push('nil') }}
|
9
|
+
def default(size: nil, color: nil, min: nil, max: nil)
|
10
|
+
render_with_template locals: { size: size, color: color, min: min, max: max }, template: 'range_slider/default'
|
11
|
+
end
|
12
|
+
|
13
|
+
end
|
14
|
+
end
|
@@ -0,0 +1,14 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Rating
|
4
|
+
# @label Rating
|
5
|
+
class Preview < ViewComponent::Preview
|
6
|
+
|
7
|
+
# @param size [Symbol] select {{ DaisyUIViewComponents::Rating::Component::SIZE_OPTIONS.dup.push('nil') }}
|
8
|
+
# @param mask_shape [Symbol] select {{ DaisyUIViewComponents::Rating::Component::Input::MASK_SHAPE_OPTIONS }}
|
9
|
+
def default(size: nil, mask_shape: nil)
|
10
|
+
render_with_template locals: { size: size, mask_shape: mask_shape }, template: 'rating/default'
|
11
|
+
end
|
12
|
+
|
13
|
+
end
|
14
|
+
end
|
@@ -0,0 +1 @@
|
|
1
|
+
<%= component :select, size: size, color: color, ghost: ghost, bordered: bordered, class: "w-full", choices: options_for_select(%w[Ada Ben Caz]), include_blank: "Choose a user…", disable_blank: true %>
|
@@ -0,0 +1,26 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# rubocop:disable Layout/LineLength
|
4
|
+
module Select
|
5
|
+
# @label Select
|
6
|
+
class Preview < ViewComponent::Preview
|
7
|
+
|
8
|
+
# @param size [Symbol] select {{ DaisyUIViewComponents::Select::Component::SIZE_OPTIONS.dup.push('nil') }}
|
9
|
+
# @param color [Symbol] select {{ DaisyUIViewComponents::Select::Component::COLOR_OPTIONS.dup.push('nil') }}
|
10
|
+
# @param ghost [Boolean] select [true, false] "Adds ghost style to select"
|
11
|
+
# @param bordered [Boolean] select [true, false] "Adds border to select"
|
12
|
+
def default(size: nil, color: nil, ghost: false, bordered: false)
|
13
|
+
render_with_template locals: { size: size, color: color, ghost: ghost, bordered: bordered }, template: 'select/default'
|
14
|
+
end
|
15
|
+
|
16
|
+
# @param size [Symbol] select {{ DaisyUIViewComponents::Select::Component::SIZE_OPTIONS.dup.push('nil') }}
|
17
|
+
# @param color [Symbol] select {{ DaisyUIViewComponents::Select::Component::COLOR_OPTIONS.dup.push('nil') }}
|
18
|
+
# @param ghost [Boolean] select [true, false] "Adds ghost style to select"
|
19
|
+
# @param bordered [Boolean] select [true, false] "Adds border to select"
|
20
|
+
def with_form(size: nil, color: nil, ghost: false, bordered: false)
|
21
|
+
render_with_template locals: { size: size, color: color, ghost: ghost, bordered: bordered }, template: 'select/with_form'
|
22
|
+
end
|
23
|
+
|
24
|
+
end
|
25
|
+
end
|
26
|
+
# rubocop:enable Layout/LineLength
|
@@ -0,0 +1,13 @@
|
|
1
|
+
<%= form_with url: "#" do |f| %>
|
2
|
+
<label class="form-control w-full max-w-xs">
|
3
|
+
<div class="label">
|
4
|
+
<span class="label-text">Pick the best fantasy franchise</span>
|
5
|
+
<span class="label-text-alt">Alt label</span>
|
6
|
+
</div>
|
7
|
+
<%= component :select, :film, form: f, size: size, color: color, ghost: ghost, bordered: bordered, class: "w-full", choices: options_for_select(['Star Wars', 'Harry Potter', 'Lord of the Rings', 'Planet of the Apes', 'Star Trek']), include_blank: "Pick one…", disable_blank: true %>
|
8
|
+
<div class="label">
|
9
|
+
<span class="label-text-alt">Alt label</span>
|
10
|
+
<span class="label-text-alt">Alt label</span>
|
11
|
+
</div>
|
12
|
+
</label>
|
13
|
+
<% end %>
|
@@ -0,0 +1,14 @@
|
|
1
|
+
<%= component :steps, direction: direction do |steps| %>
|
2
|
+
<%= steps.with_step color: :primary do %>
|
3
|
+
Register
|
4
|
+
<% end %>
|
5
|
+
<%= steps.with_step color: :primary do %>
|
6
|
+
Choose plan
|
7
|
+
<% end %>
|
8
|
+
<%= steps.with_step do %>
|
9
|
+
Purchase
|
10
|
+
<% end %>
|
11
|
+
<%= steps.with_step do %>
|
12
|
+
Receive Product
|
13
|
+
<% end %>
|
14
|
+
<% end %>
|
@@ -0,0 +1,13 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Steps
|
4
|
+
# @label Steps
|
5
|
+
class Preview < ViewComponent::Preview
|
6
|
+
|
7
|
+
# @param direction [Symbol] select {{ DaisyUIViewComponents::Steps::Component::DIRECTION_OPTIONS }}
|
8
|
+
def default(direction: nil)
|
9
|
+
render_with_template locals: { direction: direction }, template: 'steps/default'
|
10
|
+
end
|
11
|
+
|
12
|
+
end
|
13
|
+
end
|
@@ -0,0 +1,26 @@
|
|
1
|
+
<%= component :swap, class: 'swap-rotate btn btn-circle' do |swap| %>
|
2
|
+
<%= swap.with_input name: 'item_trigger' %>
|
3
|
+
<%= swap.with_swap_off do %>
|
4
|
+
<!-- hamburger icon -->
|
5
|
+
<svg
|
6
|
+
class="fill-current"
|
7
|
+
xmlns="http://www.w3.org/2000/svg"
|
8
|
+
width="32"
|
9
|
+
height="32"
|
10
|
+
viewBox="0 0 512 512">
|
11
|
+
<path d="M64,384H448V341.33H64Zm0-106.67H448V234.67H64ZM64,128v42.67H448V128Z" />
|
12
|
+
</svg>
|
13
|
+
<% end %>
|
14
|
+
<%= swap.with_swap_on do %>
|
15
|
+
<!-- close icon -->
|
16
|
+
<svg
|
17
|
+
class="fill-current"
|
18
|
+
xmlns="http://www.w3.org/2000/svg"
|
19
|
+
width="32"
|
20
|
+
height="32"
|
21
|
+
viewBox="0 0 512 512">
|
22
|
+
<polygon
|
23
|
+
points="400 145.49 366.51 112 256 222.51 145.49 112 112 145.49 222.51 256 112 366.51 145.49 400 256 289.49 366.51 400 400 366.51 289.49 256 400 145.49" />
|
24
|
+
</svg>
|
25
|
+
<% end %>
|
26
|
+
<% end %>
|
@@ -0,0 +1,28 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Swap
|
4
|
+
# @label Swap
|
5
|
+
class Preview < ViewComponent::Preview
|
6
|
+
|
7
|
+
def default
|
8
|
+
render_with_template template: 'swap/default'
|
9
|
+
end
|
10
|
+
|
11
|
+
def volume_icons
|
12
|
+
render_with_template template: 'swap/volume_icons'
|
13
|
+
end
|
14
|
+
|
15
|
+
def rotate_effect
|
16
|
+
render_with_template template: 'swap/rotate_effect'
|
17
|
+
end
|
18
|
+
|
19
|
+
def hamburger_button
|
20
|
+
render_with_template template: 'swap/hamburger_button'
|
21
|
+
end
|
22
|
+
|
23
|
+
def flip_effect
|
24
|
+
render_with_template template: 'swap/flip_effect'
|
25
|
+
end
|
26
|
+
|
27
|
+
end
|
28
|
+
end
|
@@ -0,0 +1,23 @@
|
|
1
|
+
<%= component :swap, class: 'swap-rotate' do |swap| %>
|
2
|
+
<%= swap.with_input name: 'item_trigger' %>
|
3
|
+
<%= swap.with_swap_on class: 'h-10 w-10' do %>
|
4
|
+
<!-- sun icon -->
|
5
|
+
<svg
|
6
|
+
class="fill-current"
|
7
|
+
xmlns="http://www.w3.org/2000/svg"
|
8
|
+
viewBox="0 0 24 24">
|
9
|
+
<path
|
10
|
+
d="M5.64,17l-.71.71a1,1,0,0,0,0,1.41,1,1,0,0,0,1.41,0l.71-.71A1,1,0,0,0,5.64,17ZM5,12a1,1,0,0,0-1-1H3a1,1,0,0,0,0,2H4A1,1,0,0,0,5,12Zm7-7a1,1,0,0,0,1-1V3a1,1,0,0,0-2,0V4A1,1,0,0,0,12,5ZM5.64,7.05a1,1,0,0,0,.7.29,1,1,0,0,0,.71-.29,1,1,0,0,0,0-1.41l-.71-.71A1,1,0,0,0,4.93,6.34Zm12,.29a1,1,0,0,0,.7-.29l.71-.71a1,1,0,1,0-1.41-1.41L17,5.64a1,1,0,0,0,0,1.41A1,1,0,0,0,17.66,7.34ZM21,11H20a1,1,0,0,0,0,2h1a1,1,0,0,0,0-2Zm-9,8a1,1,0,0,0-1,1v1a1,1,0,0,0,2,0V20A1,1,0,0,0,12,19ZM18.36,17A1,1,0,0,0,17,18.36l.71.71a1,1,0,0,0,1.41,0,1,1,0,0,0,0-1.41ZM12,6.5A5.5,5.5,0,1,0,17.5,12,5.51,5.51,0,0,0,12,6.5Zm0,9A3.5,3.5,0,1,1,15.5,12,3.5,3.5,0,0,1,12,15.5Z" />
|
11
|
+
</svg>
|
12
|
+
<% end %>
|
13
|
+
<%= swap.with_swap_off class: 'h-10 w-10' do %>
|
14
|
+
<!-- moon icon -->
|
15
|
+
<svg
|
16
|
+
class="fill-current"
|
17
|
+
xmlns="http://www.w3.org/2000/svg"
|
18
|
+
viewBox="0 0 24 24">
|
19
|
+
<path
|
20
|
+
d="M21.64,13a1,1,0,0,0-1.05-.14,8.05,8.05,0,0,1-3.37.73A8.15,8.15,0,0,1,9.08,5.49a8.59,8.59,0,0,1,.25-2A1,1,0,0,0,8,2.36,10.14,10.14,0,1,0,22,14.05,1,1,0,0,0,21.64,13Zm-9.5,6.69A8.14,8.14,0,0,1,7.08,5.22v.27A10.15,10.15,0,0,0,17.22,15.63a9.79,9.79,0,0,0,2.1-.22A8.11,8.11,0,0,1,12.14,19.73Z" />
|
21
|
+
</svg>
|
22
|
+
<% end %>
|
23
|
+
<% end %>
|
@@ -0,0 +1,27 @@
|
|
1
|
+
<%= component :swap do |swap| %>
|
2
|
+
<%= swap.with_input name: 'item_trigger' %>
|
3
|
+
<%= swap.with_swap_on do %>
|
4
|
+
<!-- volume on icon -->
|
5
|
+
<svg
|
6
|
+
class="fill-current"
|
7
|
+
xmlns="http://www.w3.org/2000/svg"
|
8
|
+
width="48"
|
9
|
+
height="48"
|
10
|
+
viewBox="0 0 24 24">
|
11
|
+
<path
|
12
|
+
d="M14,3.23V5.29C16.89,6.15 19,8.83 19,12C19,15.17 16.89,17.84 14,18.7V20.77C18,19.86 21,16.28 21,12C21,7.72 18,4.14 14,3.23M16.5,12C16.5,10.23 15.5,8.71 14,7.97V16C15.5,15.29 16.5,13.76 16.5,12M3,9V15H7L12,20V4L7,9H3Z" />
|
13
|
+
</svg>
|
14
|
+
<% end %>
|
15
|
+
<%= swap.with_swap_off do %>
|
16
|
+
<!-- volume off icon -->
|
17
|
+
<svg
|
18
|
+
class="fill-current"
|
19
|
+
xmlns="http://www.w3.org/2000/svg"
|
20
|
+
width="48"
|
21
|
+
height="48"
|
22
|
+
viewBox="0 0 24 24">
|
23
|
+
<path
|
24
|
+
d="M3,9H7L12,4V20L7,15H3V9M16.59,12L14,9.41L15.41,8L18,10.59L20.59,8L22,9.41L19.41,12L22,14.59L20.59,16L18,13.41L15.41,16L14,14.59L16.59,12Z" />
|
25
|
+
</svg>
|
26
|
+
<% end %>
|
27
|
+
<% end %>
|
@@ -0,0 +1,60 @@
|
|
1
|
+
<%= component :table, size: size, zebra: zebra do |table| %>
|
2
|
+
<% table.with_head do |head| %>
|
3
|
+
<% head.with_cell %>
|
4
|
+
<% head.with_cell data: { example: "cell" } do %>
|
5
|
+
Name
|
6
|
+
<% end %>
|
7
|
+
<% head.with_cell "Job" %>
|
8
|
+
<% head.with_cell "Favorite color" %>
|
9
|
+
<% end %>
|
10
|
+
<% table.with_body do |body| %>
|
11
|
+
<% body.with_row hover: true do |row| %>
|
12
|
+
<% row.with_cell "1" %>
|
13
|
+
<% row.with_cell do %>
|
14
|
+
Cy Ganderton
|
15
|
+
<% end %>
|
16
|
+
<% row.with_cell do %>
|
17
|
+
Quality Control Specialist
|
18
|
+
<% end %>
|
19
|
+
<% row.with_cell do %>
|
20
|
+
Blue
|
21
|
+
<% end %>
|
22
|
+
<% end %>
|
23
|
+
<% body.with_row do |row| %>
|
24
|
+
<% row.with_cell "2" %>
|
25
|
+
<% row.with_cell do %>
|
26
|
+
Hart Hagerty
|
27
|
+
<% end %>
|
28
|
+
<% row.with_cell do %>
|
29
|
+
Desktop Support Technician
|
30
|
+
<% end %>
|
31
|
+
<% row.with_cell do %>
|
32
|
+
Purple
|
33
|
+
<% end %>
|
34
|
+
<% end %>
|
35
|
+
<% body.with_row do |row| %>
|
36
|
+
<% row.with_cell "3" %>
|
37
|
+
<% row.with_cell do %>
|
38
|
+
Brice Swyre
|
39
|
+
<% end %>
|
40
|
+
<% row.with_cell do %>
|
41
|
+
Tax Accountant
|
42
|
+
<% end %>
|
43
|
+
<% row.with_cell do %>
|
44
|
+
Red
|
45
|
+
<% end %>
|
46
|
+
<% end %>
|
47
|
+
<% body.with_row do |row| %>
|
48
|
+
<% row.with_cell "4" %>
|
49
|
+
<% row.with_cell do %>
|
50
|
+
Yancy Tear
|
51
|
+
<% end %>
|
52
|
+
<% row.with_cell do %>
|
53
|
+
Community Outreach Specialist
|
54
|
+
<% end %>
|
55
|
+
<% row.with_cell do %>
|
56
|
+
Indigo
|
57
|
+
<% end %>
|
58
|
+
<% end %>
|
59
|
+
<% end %>
|
60
|
+
<% end %>
|
@@ -0,0 +1,17 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Table
|
4
|
+
# @label Table
|
5
|
+
class Preview < ViewComponent::Preview
|
6
|
+
|
7
|
+
# @param size [Symbol] select {{ DaisyUIViewComponents::Table::Component::SIZE_OPTIONS }}
|
8
|
+
# @param zebra [Boolean] select [true, false] "Adds a box style to tabs container"
|
9
|
+
def default(size: nil, zebra: nil)
|
10
|
+
render_with_template locals: {
|
11
|
+
size: size,
|
12
|
+
zebra: zebra
|
13
|
+
}, template: 'table/default'
|
14
|
+
end
|
15
|
+
|
16
|
+
end
|
17
|
+
end
|
@@ -0,0 +1,11 @@
|
|
1
|
+
<%= component :tabs, size: size, boxed: boxed, bordered: bordered, lifted: lifted do |tabs| %>
|
2
|
+
<% tabs.with_tab do %>
|
3
|
+
Tab 1
|
4
|
+
<% end %>
|
5
|
+
<% tabs.with_tab active: true do %>
|
6
|
+
Tab 2
|
7
|
+
<% end %>
|
8
|
+
<% tabs.with_tab disabled: false do %>
|
9
|
+
Tab 3
|
10
|
+
<% end %>
|
11
|
+
<% end %>
|
@@ -0,0 +1,21 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Tabs
|
4
|
+
# @label Tabs
|
5
|
+
class Preview < ViewComponent::Preview
|
6
|
+
|
7
|
+
# @param size [Symbol] select {{ DaisyUIViewComponents::Tabs::Component::SIZE_OPTIONS }}
|
8
|
+
# @param boxed [Boolean] select [true, false] "Adds a box style to tabs container"
|
9
|
+
# @param bordered [Boolean] select [true, false] "Adds bottom border to tab item"
|
10
|
+
# @param lifted [Boolean] select [true, false] "Adds lifted style to tab item"
|
11
|
+
def default(size: nil, boxed: false, bordered: false, lifted: false)
|
12
|
+
render_with_template locals: {
|
13
|
+
size: size,
|
14
|
+
boxed: boxed,
|
15
|
+
bordered: bordered,
|
16
|
+
lifted: lifted
|
17
|
+
}, template: 'tabs/default'
|
18
|
+
end
|
19
|
+
|
20
|
+
end
|
21
|
+
end
|
@@ -0,0 +1 @@
|
|
1
|
+
<%= component :text_input, :name, value: "A text field", size: size, color: color, bordered: bordered, ghost: ghost %>
|
@@ -0,0 +1,42 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# rubocop:disable Layout/LineLength
|
4
|
+
module TextInput
|
5
|
+
# @label TextInput
|
6
|
+
class Preview < ViewComponent::Preview
|
7
|
+
|
8
|
+
# @param size [Symbol] select {{ DaisyUIViewComponents::TextInput::Component::SIZE_OPTIONS.dup.push('nil') }}
|
9
|
+
# @param color [Symbol] select {{ DaisyUIViewComponents::TextInput::Component::COLOR_OPTIONS.dup.push('nil') }}
|
10
|
+
# @param bordered [Boolean] select [false, true] "Bordered"
|
11
|
+
# @param ghost [Boolean] select [false, true] "Ghost"
|
12
|
+
def default(size: nil, color: nil, bordered: false, ghost: false)
|
13
|
+
render_with_template locals: { size: size, color: color, bordered: bordered, ghost: ghost }, template: 'text_input/default'
|
14
|
+
end
|
15
|
+
|
16
|
+
# @param size [Symbol] select {{ DaisyUIViewComponents::TextInput::Component::SIZE_OPTIONS.dup.push('nil') }}
|
17
|
+
# @param color [Symbol] select {{ DaisyUIViewComponents::TextInput::Component::COLOR_OPTIONS.dup.push('nil') }}
|
18
|
+
# @param bordered [Boolean] select [false, true] "Bordered"
|
19
|
+
# @param ghost [Boolean] select [false, true] "Ghost"
|
20
|
+
def with_form(size: nil, color: nil, bordered: false, ghost: false)
|
21
|
+
render_with_template locals: { size: size, color: color, bordered: bordered, ghost: ghost }, template: 'text_input/with_form'
|
22
|
+
end
|
23
|
+
|
24
|
+
# @param size [Symbol] select {{ DaisyUIViewComponents::TextInput::Component::SIZE_OPTIONS.dup.push('nil') }}
|
25
|
+
# @param color [Symbol] select {{ DaisyUIViewComponents::TextInput::Component::COLOR_OPTIONS.dup.push('nil') }}
|
26
|
+
# @param bordered [Boolean] select [false, true] "Bordered"
|
27
|
+
# @param ghost [Boolean] select [false, true] "Ghost"
|
28
|
+
def with_icon_inside(size: nil, color: nil, bordered: false, ghost: false)
|
29
|
+
render_with_template locals: { size: size, color: color, bordered: bordered, ghost: ghost }, template: 'text_input/with_icon_inside'
|
30
|
+
end
|
31
|
+
|
32
|
+
# @param size [Symbol] select {{ DaisyUIViewComponents::TextInput::Component::SIZE_OPTIONS.dup.push('nil') }}
|
33
|
+
# @param color [Symbol] select {{ DaisyUIViewComponents::TextInput::Component::COLOR_OPTIONS.dup.push('nil') }}
|
34
|
+
# @param bordered [Boolean] select [false, true] "Bordered"
|
35
|
+
# @param ghost [Boolean] select [false, true] "Ghost"
|
36
|
+
def with_text_label_inside(size: nil, color: nil, bordered: false, ghost: false)
|
37
|
+
render_with_template locals: { size: size, color: color, bordered: bordered, ghost: ghost }, template: 'text_input/with_text_label_inside'
|
38
|
+
end
|
39
|
+
|
40
|
+
end
|
41
|
+
end
|
42
|
+
# rubocop:enable Layout/LineLength
|
@@ -0,0 +1,13 @@
|
|
1
|
+
<%= form_with url: "#" do |f| %>
|
2
|
+
<label class="form-control w-full max-w-xs">
|
3
|
+
<div class="label">
|
4
|
+
<span class="label-text">What is your name?</span>
|
5
|
+
<span class="label-text-alt">Top Right label</span>
|
6
|
+
</div>
|
7
|
+
<%= component :text_input, :name, form: f, placeholder: "Type here", size: size, color: color, bordered: bordered, ghost: ghost %>
|
8
|
+
<div class="label">
|
9
|
+
<span class="label-text-alt">Bottom Left label</span>
|
10
|
+
<span class="label-text-alt">Bottom Right label</span>
|
11
|
+
</div>
|
12
|
+
</label>
|
13
|
+
<% end %>
|