loco_motion-rails 0.4.0 → 0.5.0
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/README.md +6 -1
- data/app/components/daisy/actions/button_component.html.haml +2 -2
- data/app/components/daisy/actions/button_component.rb +98 -59
- data/app/components/daisy/actions/dropdown_component.html.haml +1 -2
- data/app/components/daisy/actions/dropdown_component.rb +7 -10
- data/app/components/daisy/actions/modal_component.html.haml +10 -8
- data/app/components/daisy/actions/modal_component.rb +6 -6
- data/app/components/daisy/actions/swap_component.rb +13 -9
- data/app/components/daisy/actions/theme_controller.js +113 -0
- data/app/components/daisy/actions/theme_controller_component.rb +58 -17
- data/app/components/daisy/actions/theme_preview_component.html.haml +5 -0
- data/app/components/daisy/actions/theme_preview_component.rb +68 -0
- data/app/components/daisy/data_display/accordion_component.html.haml +0 -1
- data/app/components/daisy/data_display/accordion_component.rb +10 -3
- data/app/components/daisy/data_display/avatar_component.html.haml +1 -1
- data/app/components/daisy/data_display/avatar_component.rb +17 -7
- data/app/components/daisy/data_display/badge_component.rb +122 -4
- data/app/components/daisy/data_display/card_component.html.haml +1 -1
- data/app/components/daisy/data_display/card_component.rb +20 -6
- data/app/components/daisy/data_display/chat_component.rb +2 -2
- data/app/components/daisy/data_display/collapse_component.rb +9 -5
- data/app/components/daisy/data_display/countdown_component.rb +15 -5
- data/app/components/daisy/data_display/figure_component.rb +8 -3
- data/app/components/daisy/data_display/kbd_component.rb +13 -4
- data/app/components/daisy/data_display/list_component.html.haml +5 -0
- data/app/components/daisy/data_display/list_component.rb +82 -0
- data/app/components/daisy/data_display/list_item_component.rb +39 -0
- data/app/components/daisy/data_display/stat_component.html.haml +5 -6
- data/app/components/daisy/data_display/stat_component.rb +21 -8
- data/app/components/daisy/data_display/status_component.rb +47 -0
- data/app/components/daisy/data_display/timeline_component.rb +1 -1
- data/app/components/daisy/data_input/cally_component.html.haml +14 -0
- data/app/components/daisy/data_input/cally_component.rb +182 -0
- data/app/components/daisy/data_input/cally_input_component.html.haml +5 -0
- data/app/components/daisy/data_input/cally_input_component.rb +165 -0
- data/app/components/daisy/data_input/cally_input_controller.js +235 -0
- data/app/components/daisy/data_input/checkbox_component.html.haml +20 -0
- data/app/components/daisy/data_input/checkbox_component.rb +21 -7
- data/app/components/daisy/data_input/fieldset_component.html.haml +8 -0
- data/app/components/daisy/data_input/fieldset_component.rb +57 -0
- data/app/components/daisy/data_input/file_input_component.rb +6 -0
- data/app/components/daisy/data_input/filter_component.html.haml +3 -0
- data/app/components/daisy/data_input/filter_component.rb +221 -0
- data/app/components/daisy/data_input/label_component.rb +2 -2
- data/app/components/daisy/data_input/radio_button_component.rb +1 -1
- data/app/components/daisy/data_input/rating_component.html.haml +0 -2
- data/app/components/daisy/data_input/rating_component.rb +3 -2
- data/app/components/daisy/data_input/select_component.html.haml +27 -15
- data/app/components/daisy/data_input/select_component.rb +152 -10
- data/app/components/daisy/data_input/text_area_component.rb +11 -8
- data/app/components/daisy/data_input/text_input_component.html.haml +25 -4
- data/app/components/daisy/data_input/text_input_component.rb +38 -36
- data/app/components/daisy/data_input/toggle_component.rb +12 -0
- data/app/components/daisy/feedback/alert_component.html.haml +1 -1
- data/app/components/daisy/feedback/alert_component.rb +86 -2
- data/app/components/daisy/feedback/loading_component.rb +10 -3
- data/app/components/daisy/feedback/skeleton_component.rb +1 -1
- data/app/components/daisy/layout/divider_component.rb +4 -2
- data/app/components/daisy/layout/drawer_component.html.haml +0 -1
- data/app/components/daisy/layout/footer_component.rb +6 -6
- data/app/components/daisy/mockup/device_component.rb +15 -18
- data/app/components/daisy/navigation/breadcrumbs_component.html.haml +0 -1
- data/app/components/daisy/navigation/breadcrumbs_component.rb +84 -9
- data/app/components/daisy/navigation/dock_component.rb +146 -0
- data/app/components/daisy/navigation/link_component.rb +18 -9
- data/app/components/daisy/navigation/menu_component.rb +15 -9
- data/app/components/daisy/navigation/navbar_component.html.haml +1 -1
- data/app/components/daisy/navigation/navbar_component.rb +2 -13
- data/app/components/daisy/navigation/steps_component.rb +6 -6
- data/app/components/daisy/navigation/tabs_component.html.haml +0 -1
- data/app/components/daisy/navigation/tabs_component.rb +26 -16
- data/app/components/hero/icon_component.rb +15 -5
- data/app/helpers/daisy/form_builder_helper.rb +30 -3
- data/app/views/examples/daisy/data_input/filters.html.haml +62 -0
- data/lib/hero.rb +1 -1
- data/lib/loco_motion/base_component.rb +44 -1
- data/lib/loco_motion/component_config.rb +1 -0
- data/lib/loco_motion/concerns/iconable_component.rb +134 -0
- data/lib/loco_motion/concerns/labelable_component.rb +142 -0
- data/lib/loco_motion/concerns/linkable_component.rb +40 -0
- data/lib/loco_motion/concerns/tippable_component.rb +25 -10
- data/lib/loco_motion/helpers.rb +27 -18
- data/lib/loco_motion/patches/view_component/slot_loco_parent_patch.rb +37 -0
- data/lib/loco_motion/patches/view_component/slotable_default_patch.rb +21 -0
- data/lib/loco_motion/version.rb +1 -1
- data/lib/loco_motion.rb +12 -2
- metadata +65 -19
- data/app/components/daisy/actions/theme_controller_component.html.haml +0 -5
- data/app/components/daisy/layout/artboard_component.rb +0 -59
- data/app/components/daisy/navigation/bottom_nav_component.rb +0 -138
@@ -1,138 +0,0 @@
|
|
1
|
-
#
|
2
|
-
# Creates a bottom navigation bar, typically used in mobile-friendly applications
|
3
|
-
# to provide quick access to important sections.
|
4
|
-
#
|
5
|
-
# @slot sections+ {Daisy::Navigation::BottomNavSectionComponent} The sections to display in the navigation bar.
|
6
|
-
#
|
7
|
-
# @example Basic bottom nav with icons
|
8
|
-
# = daisy_bottom_nav do |nav|
|
9
|
-
# - nav.with_section(icon: "home", href: "#")
|
10
|
-
# - nav.with_section(icon: "information-circle", href: "#", active: true)
|
11
|
-
# - nav.with_section(icon: "chart-bar", href: "#")
|
12
|
-
#
|
13
|
-
# @example Bottom nav with titles
|
14
|
-
# = daisy_bottom_nav do |nav|
|
15
|
-
# - nav.with_section(icon: "home", href: "#", title: "Home")
|
16
|
-
# - nav.with_section(icon: "information-circle", href: "#", title: "Info")
|
17
|
-
# - nav.with_section(icon: "chart-bar", href: "#", title: "Stats")
|
18
|
-
#
|
19
|
-
# @example Colored bottom nav
|
20
|
-
# = daisy_bottom_nav do |nav|
|
21
|
-
# - nav.with_section(icon: "home", href: "#", css: "text-primary")
|
22
|
-
# - nav.with_section(icon: "information-circle", href: "#", css: "text-secondary")
|
23
|
-
# - nav.with_section(icon: "chart-bar", href: "#", css: "text-accent")
|
24
|
-
#
|
25
|
-
class Daisy::Navigation::BottomNavComponent < LocoMotion::BaseComponent
|
26
|
-
|
27
|
-
#
|
28
|
-
# A section within a Bottom Navigation component.
|
29
|
-
#
|
30
|
-
# @part icon The icon element for the section.
|
31
|
-
# @part title The title element for the section.
|
32
|
-
#
|
33
|
-
# @example Basic section with icon
|
34
|
-
# = daisy_bottom_nav do |nav|
|
35
|
-
# - nav.with_section(icon: "home", href: "#")
|
36
|
-
#
|
37
|
-
# @example Active section with title
|
38
|
-
# = daisy_bottom_nav do |nav|
|
39
|
-
# - nav.with_section(icon: "information-circle", href: "#", active: true, title: "Info")
|
40
|
-
#
|
41
|
-
# @example Custom title content
|
42
|
-
# = daisy_bottom_nav do |nav|
|
43
|
-
# - nav.with_section(icon: "chart-bar", href: "#") do
|
44
|
-
# .font-bold.text-xs
|
45
|
-
# Stats
|
46
|
-
#
|
47
|
-
class Daisy::Navigation::BottomNavSectionComponent < LocoMotion::BaseComponent
|
48
|
-
|
49
|
-
define_parts :icon, :title
|
50
|
-
|
51
|
-
# Creates a new bottom navigation section.
|
52
|
-
#
|
53
|
-
# @param kws [Hash] The keyword arguments for the component.
|
54
|
-
#
|
55
|
-
# @option kws icon [String] The name of the icon to display.
|
56
|
-
#
|
57
|
-
# @option kws icon_variant [Symbol] The variant of the icon to use (default: :outline).
|
58
|
-
#
|
59
|
-
# @option kws icon_css [String] Additional CSS classes for the icon.
|
60
|
-
#
|
61
|
-
# @option kws title [String] Optional text to display below the icon.
|
62
|
-
#
|
63
|
-
# @option kws href [String] Optional URL to make the section a link.
|
64
|
-
#
|
65
|
-
# @option kws active [Boolean] Whether this section is currently active (default: false).
|
66
|
-
#
|
67
|
-
# @option kws css [String] Additional CSS classes for styling. Common
|
68
|
-
# options include:
|
69
|
-
# - Text color: `text-primary`, `text-secondary`, `text-accent`
|
70
|
-
# - Custom colors: `text-[#449944]`
|
71
|
-
#
|
72
|
-
def initialize(**kws)
|
73
|
-
super(**kws)
|
74
|
-
|
75
|
-
@icon = config_option(:icon)
|
76
|
-
@icon_variant = config_option(:icon_variant, :outline)
|
77
|
-
@title = config_option(:title)
|
78
|
-
@href = config_option(:href)
|
79
|
-
@active = config_option(:active, false)
|
80
|
-
end
|
81
|
-
|
82
|
-
def before_render
|
83
|
-
if @href
|
84
|
-
set_tag_name(:component, :a)
|
85
|
-
add_html(:component, href: @href)
|
86
|
-
else
|
87
|
-
set_tag_name(:component, :button)
|
88
|
-
end
|
89
|
-
|
90
|
-
add_css(:component, "active") if @active
|
91
|
-
|
92
|
-
add_css(:icon, "[:where(&)]:size-6")
|
93
|
-
|
94
|
-
set_tag_name(:title, :span)
|
95
|
-
add_css(:title, "btm-nav-label")
|
96
|
-
end
|
97
|
-
|
98
|
-
def call
|
99
|
-
part(:component) do
|
100
|
-
concat(hero_icon(@icon, variant: @icon_variant, html: rendered_html(:icon))) if @icon
|
101
|
-
concat(part(:title) { @title }) if @title
|
102
|
-
concat(content)
|
103
|
-
end
|
104
|
-
end
|
105
|
-
|
106
|
-
end
|
107
|
-
|
108
|
-
renders_many :sections, Daisy::Navigation::BottomNavSectionComponent
|
109
|
-
|
110
|
-
# Creates a new bottom navigation component.
|
111
|
-
#
|
112
|
-
# @param kws [Hash] The keyword arguments for the component.
|
113
|
-
#
|
114
|
-
# @option kws css [String] Additional CSS classes for styling. Common
|
115
|
-
# options include:
|
116
|
-
# - Position: `relative`, `fixed bottom-0`
|
117
|
-
# - Width: `w-full`, `max-w-[400px]`
|
118
|
-
# - Border: `border`, `border-base-200`
|
119
|
-
#
|
120
|
-
def initialize(**kws)
|
121
|
-
super(**kws)
|
122
|
-
end
|
123
|
-
|
124
|
-
def before_render
|
125
|
-
add_css(:component, "btm-nav")
|
126
|
-
end
|
127
|
-
|
128
|
-
def call
|
129
|
-
part(:component) do
|
130
|
-
sections.each do |section|
|
131
|
-
concat(section)
|
132
|
-
end
|
133
|
-
|
134
|
-
concat(content)
|
135
|
-
end
|
136
|
-
end
|
137
|
-
|
138
|
-
end
|