loco_motion-rails 0.0.6 → 0.0.8
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 +139 -67
- data/app/components/daisy/actions/button_component.rb +112 -8
- data/app/components/daisy/actions/dropdown_component.html.haml +5 -5
- data/app/components/daisy/actions/dropdown_component.rb +95 -26
- data/app/components/daisy/actions/modal_component.html.haml +3 -2
- data/app/components/daisy/actions/modal_component.rb +111 -20
- data/app/components/daisy/actions/swap_component.rb +117 -6
- data/app/components/daisy/actions/theme_controller_component.html.haml +1 -1
- data/app/components/daisy/actions/theme_controller_component.rb +37 -2
- data/app/components/daisy/data_display/accordion_component.rb +81 -4
- data/app/components/daisy/data_display/avatar_component.rb +39 -17
- data/app/components/daisy/data_display/badge_component.rb +49 -5
- data/app/components/daisy/data_display/card_component.html.haml +5 -13
- data/app/components/daisy/data_display/card_component.rb +76 -40
- data/app/components/daisy/data_display/carousel_component.rb +39 -1
- data/app/components/daisy/data_display/chat_component.rb +42 -15
- data/app/components/daisy/data_display/collapse_component.rb +61 -2
- data/app/components/daisy/data_display/countdown_component.rb +51 -1
- data/app/components/daisy/data_display/diff_component.rb +38 -1
- data/app/components/daisy/data_display/figure_component.rb +49 -0
- data/app/components/daisy/data_display/kbd_component.rb +64 -3
- data/app/components/daisy/data_display/stat_component.rb +67 -7
- data/app/components/daisy/data_display/table_component.rb +100 -35
- data/app/components/daisy/data_display/timeline_component.rb +46 -1
- data/app/components/daisy/data_display/timeline_event_component.rb +40 -2
- data/app/components/daisy/feedback/alert_component.rb +47 -2
- data/app/components/daisy/feedback/loading_component.rb +50 -0
- data/app/components/daisy/feedback/progress_component.rb +58 -0
- data/app/components/daisy/feedback/radial_progress_component.rb +72 -0
- data/app/components/daisy/feedback/skeleton_component.rb +53 -0
- data/app/components/daisy/feedback/toast_component.rb +45 -0
- data/app/components/daisy/feedback/tooltip_component.rb +77 -0
- data/app/components/daisy/layout/artboard_component.rb +59 -0
- data/app/components/daisy/layout/divider_component.rb +72 -0
- data/app/components/daisy/layout/drawer_component.html.haml +9 -0
- data/app/components/daisy/layout/drawer_component.rb +155 -0
- data/app/components/daisy/layout/footer_component.rb +69 -0
- data/app/components/daisy/layout/hero_component.html.haml +5 -0
- data/app/components/daisy/layout/hero_component.rb +83 -0
- data/app/components/daisy/layout/indicator_component.rb +83 -0
- data/app/components/daisy/layout/join_component.rb +72 -1
- data/app/components/daisy/layout/stack_component.rb +68 -0
- data/app/components/daisy/mockup/browser_component.rb +78 -0
- data/app/components/daisy/mockup/code_component.rb +144 -0
- data/app/components/daisy/mockup/device_component.rb +81 -0
- data/app/components/daisy/mockup/frame_component.rb +62 -0
- data/app/components/daisy/navigation/bottom_nav_component.rb +83 -4
- data/app/components/daisy/navigation/breadcrumbs_component.rb +41 -4
- data/app/components/daisy/navigation/link_component.rb +66 -13
- data/app/components/daisy/navigation/menu_component.rb +83 -11
- data/app/components/daisy/navigation/navbar_component.html.haml +1 -1
- data/app/components/daisy/navigation/navbar_component.rb +64 -3
- data/app/components/daisy/navigation/steps_component.rb +78 -2
- data/app/components/daisy/navigation/tabs_component.rb +112 -9
- data/app/components/hero/icon_component.rb +50 -1
- data/lib/daisy.rb +18 -3
- data/lib/hero.rb +7 -0
- data/lib/loco_motion/basic_component.rb +1 -1
- data/lib/loco_motion/concerns/tippable_component.rb +26 -0
- data/lib/loco_motion/configuration.rb +35 -0
- data/lib/loco_motion/helpers.rb +96 -0
- data/lib/loco_motion/version.rb +5 -0
- data/lib/loco_motion.rb +6 -36
- metadata +58 -9
- data/app/components/daisy/data_display/badge_component.html.haml +0 -2
- data/app/components/daisy/data_display/kbd_component.html.haml +0 -2
- data/app/components/daisy/navigation/link_component.html.haml +0 -4
- data/lib/daisy/helpers.rb +0 -61
@@ -0,0 +1,96 @@
|
|
1
|
+
module LocoMotion
|
2
|
+
COMPONENTS = {
|
3
|
+
### Hero Components
|
4
|
+
|
5
|
+
"Hero::IconComponent" => { names: "icon", group: "Hero", title: "Icons", example: "icons" },
|
6
|
+
|
7
|
+
### Daisy Components
|
8
|
+
|
9
|
+
# Actions
|
10
|
+
"Daisy::Actions::ButtonComponent" => { names: "button", group: "Actions", title: "Buttons", example: "buttons" },
|
11
|
+
"Daisy::Actions::DropdownComponent" => { names: "dropdown", group: "Actions", title: "Dropdowns", example: "dropdowns" },
|
12
|
+
"Daisy::Actions::ModalComponent" => { names: "modal", group: "Actions", title: "Modals", example: "modals" },
|
13
|
+
"Daisy::Actions::SwapComponent" => { names: "swap", group: "Actions", title: "Swaps", example: "swaps" },
|
14
|
+
"Daisy::Actions::ThemeControllerComponent" => { names: "theme_controller", group: "Actions", title: "Theme Controllers", example: "theme_controllers" },
|
15
|
+
|
16
|
+
# Data
|
17
|
+
"Daisy::DataDisplay::AccordionComponent" => { names: "accordion", group: "Data", title: "Accordions", example: "accordions" },
|
18
|
+
"Daisy::DataDisplay::AvatarComponent" => { names: "avatar", group: "Data", title: "Avatars", example: "avatars" },
|
19
|
+
"Daisy::DataDisplay::BadgeComponent" => { names: "badge", group: "Data", title: "Badges", example: "badges" },
|
20
|
+
"Daisy::DataDisplay::CardComponent" => { names: "card", group: "Data", title: "Cards", example: "cards" },
|
21
|
+
"Daisy::DataDisplay::CarouselComponent" => { names: "carousel", group: "Data", title: "Carousels", example: "carousels" },
|
22
|
+
"Daisy::DataDisplay::ChatComponent" => { names: "chat", group: "Data", title: "Chat Bubbles", example: "chat_bubbles" },
|
23
|
+
"Daisy::DataDisplay::CollapseComponent" => { names: "collapse", group: "Data", title: "Collapses", example: "collapses" },
|
24
|
+
"Daisy::DataDisplay::CountdownComponent" => { names: "countdown", group: "Data", title: "Countdowns", example: "countdowns" },
|
25
|
+
"Daisy::DataDisplay::DiffComponent" => { names: "diff", group: "Data", title: "Diffs", example: "diffs" },
|
26
|
+
"Daisy::DataDisplay::FigureComponent" => { names: "figure", group: "Data", title: "Figures", example: "figures" },
|
27
|
+
"Daisy::DataDisplay::KbdComponent" => { names: "kbd", group: "Data", title: "Keyboard (KBD)", example: "kbds" },
|
28
|
+
"Daisy::DataDisplay::StatComponent" => { names: "stat", group: "Data", title: "Stats", example: "stats" },
|
29
|
+
"Daisy::DataDisplay::TableComponent" => { names: "table", group: "Data", title: "Tables", example: "tables" },
|
30
|
+
"Daisy::DataDisplay::TimelineComponent" => { names: "timeline", group: "Data", title: "Timelines", example: "timelines" },
|
31
|
+
|
32
|
+
# Navigation
|
33
|
+
"Daisy::Navigation::BreadcrumbsComponent" => { names: "breadcrumbs", group: "Navigation", title: "Breadcrumbs", example: "breadcrumbs" },
|
34
|
+
"Daisy::Navigation::BottomNavComponent" => { names: "bottom_nav", group: "Navigation", title: "Bottom Navs", example: "bottom_navs" },
|
35
|
+
"Daisy::Navigation::LinkComponent" => { names: "link", group: "Navigation", title: "Links", example: "links" },
|
36
|
+
"Daisy::Navigation::MenuComponent" => { names: "menu", group: "Navigation", title: "Menus", example: "menus" },
|
37
|
+
"Daisy::Navigation::NavbarComponent" => { names: "navbar", group: "Navigation", title: "Navbars", example: "navbars" },
|
38
|
+
"Daisy::Navigation::PaginationComponent" => { names: nil, group: "Navigation", title: "Pagination", example: "pagination" },
|
39
|
+
"Daisy::Navigation::StepsComponent" => { names: "steps", group: "Navigation", title: "Steps", example: "steps" },
|
40
|
+
"Daisy::Navigation::TabsComponent" => { names: "tabs", group: "Navigation", title: "Tabs", example: "tabs" },
|
41
|
+
|
42
|
+
# Feedback
|
43
|
+
"Daisy::Feedback::AlertComponent" => { names: "alert", group: "Feedback", title: "Alerts", example: "alerts" },
|
44
|
+
"Daisy::Feedback::LoadingComponent" => { names: ["loading", "loader"], group: "Feedback", title: "Loaders", example: "loaders" },
|
45
|
+
"Daisy::Feedback::ProgressComponent" => { names: ["progress"], group: "Feedback", title: "Progress Bars", example: "progress_bars" },
|
46
|
+
"Daisy::Feedback::RadialProgressComponent" => { names: "radial", group: "Feedback", title: "Radial Progress", example: "radials" },
|
47
|
+
"Daisy::Feedback::SkeletonComponent" => { names: "skeleton", group: "Feedback", title: "Skeletons", example: "skeletons" },
|
48
|
+
"Daisy::Feedback::ToastComponent" => { names: "toast", group: "Feedback", title: "Toasts", example: "toasts" },
|
49
|
+
"Daisy::Feedback::TooltipComponent" => { names: ["tooltip", "tip"], group: "Feedback", title: "Tooltips", example: "tooltips" },
|
50
|
+
|
51
|
+
# Layout
|
52
|
+
"Daisy::Layout::ArtboardComponent" => { names: "artboard", group: "Layout", title: "Artboards", example: "artboards" },
|
53
|
+
"Daisy::Layout::DividerComponent" => { names: "divider", group: "Layout", title: "Dividers", example: "dividers" },
|
54
|
+
"Daisy::Layout::DrawerComponent" => { names: "drawer", group: "Layout", title: "Drawers", example: "drawers" },
|
55
|
+
"Daisy::Layout::FooterComponent" => { names: "footer", group: "Layout", title: "Footers", example: "footers" },
|
56
|
+
"Daisy::Layout::HeroComponent" => { names: "hero", group: "Layout", title: "Heroes", example: "heroes" },
|
57
|
+
"Daisy::Layout::IndicatorComponent" => { names: "indicator", group: "Layout", title: "Indicators", example: "indicators" },
|
58
|
+
"Daisy::Layout::JoinComponent" => { names: "join", group: "Layout", title: "Joins", example: "joins" },
|
59
|
+
"Daisy::Layout::MaskComponent" => { names: nil, group: "Layout", title: "Masks", example: "masks" },
|
60
|
+
"Daisy::Layout::StackComponent" => { names: "stack", group: "Layout", title: "Stacks", example: "stacks" },
|
61
|
+
|
62
|
+
# Mockup
|
63
|
+
"Daisy::Mockup::BrowserComponent" => { names: "browser", group: "Mockup", title: "Browsers", example: "browsers" },
|
64
|
+
"Daisy::Mockup::CodeComponent" => { names: "code", group: "Mockup", title: "Code Blocks", example: "code_blocks" },
|
65
|
+
"Daisy::Mockup::DeviceComponent" => { names: "device", group: "Mockup", title: "Devices", example: "devices" },
|
66
|
+
"Daisy::Mockup::FrameComponent" => { names: "frame", group: "Mockup", title: "Frames", example: "frames" },
|
67
|
+
}
|
68
|
+
|
69
|
+
module Helpers
|
70
|
+
COMPONENTS.each do |component, helper|
|
71
|
+
framework = component.split("::").first.underscore
|
72
|
+
|
73
|
+
method_names = [helper[:names]].flatten
|
74
|
+
|
75
|
+
method_names.each do |method_name|
|
76
|
+
ActionView::Helpers.define_method("#{framework}_#{method_name}") do |*args, **kws, &block|
|
77
|
+
render(component.constantize.new(*args, **kws), &block)
|
78
|
+
end
|
79
|
+
end
|
80
|
+
end
|
81
|
+
|
82
|
+
def component_example_path(component_name)
|
83
|
+
comp = COMPONENTS[component_name]
|
84
|
+
|
85
|
+
comp_split = component_name.split("::")
|
86
|
+
framework = comp_split.first.underscore
|
87
|
+
section = comp_split.length == 3 ? comp_split[1] : nil
|
88
|
+
example = comp[:example]
|
89
|
+
section_path = section ? "#{section.underscore}/" : ""
|
90
|
+
|
91
|
+
"/examples/#{framework}/#{section_path}#{example}"
|
92
|
+
end
|
93
|
+
|
94
|
+
module_function :component_example_path
|
95
|
+
end
|
96
|
+
end
|
data/lib/loco_motion.rb
CHANGED
@@ -5,44 +5,14 @@ require "heroicons-rails"
|
|
5
5
|
require Gem::Specification.find_by_name("heroicons-rails").gem_dir + "/app/helpers/heroicons/icons_helper.rb"
|
6
6
|
|
7
7
|
require "view_component"
|
8
|
-
|
8
|
+
|
9
9
|
require "loco_motion/errors"
|
10
|
+
require "loco_motion/configuration"
|
10
11
|
require "loco_motion/component_config"
|
11
12
|
require "loco_motion/base_component"
|
13
|
+
require "loco_motion/basic_component"
|
14
|
+
require "loco_motion/engine"
|
15
|
+
require "loco_motion/helpers"
|
12
16
|
|
17
|
+
require "hero"
|
13
18
|
require "daisy"
|
14
|
-
|
15
|
-
#
|
16
|
-
# Module containing all features related to the LocoMotion gem.
|
17
|
-
#
|
18
|
-
module LocoMotion
|
19
|
-
|
20
|
-
class << self
|
21
|
-
def configure
|
22
|
-
yield(configuration)
|
23
|
-
end
|
24
|
-
|
25
|
-
def configuration
|
26
|
-
@configuration ||= Configuration.new
|
27
|
-
end
|
28
|
-
|
29
|
-
# Mostly used for internal testing; not needed in Rails
|
30
|
-
def require_components
|
31
|
-
Dir.glob(File.dirname(__FILE__) + '/../app/components/**/*.rb').each do |file|
|
32
|
-
require file
|
33
|
-
end
|
34
|
-
end
|
35
|
-
|
36
|
-
def define_render_helper(name, component)
|
37
|
-
end
|
38
|
-
end
|
39
|
-
|
40
|
-
class Configuration
|
41
|
-
attr_accessor :base_component_class
|
42
|
-
|
43
|
-
def initialize
|
44
|
-
@base_component_class = LocoMotion::BaseComponent
|
45
|
-
end
|
46
|
-
end
|
47
|
-
|
48
|
-
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: loco_motion-rails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.8
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Topher Fangio
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2025-03-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: haml-rails
|
@@ -42,14 +42,14 @@ dependencies:
|
|
42
42
|
name: rails
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
|
-
- - "
|
45
|
+
- - "~>"
|
46
46
|
- !ruby/object:Gem::Version
|
47
47
|
version: '6.1'
|
48
48
|
type: :runtime
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
|
-
- - "
|
52
|
+
- - "~>"
|
53
53
|
- !ruby/object:Gem::Version
|
54
54
|
version: '6.1'
|
55
55
|
- !ruby/object:Gem::Dependency
|
@@ -94,6 +94,20 @@ dependencies:
|
|
94
94
|
- - "~>"
|
95
95
|
- !ruby/object:Gem::Version
|
96
96
|
version: 3.1.8
|
97
|
+
- !ruby/object:Gem::Dependency
|
98
|
+
name: drb
|
99
|
+
requirement: !ruby/object:Gem::Requirement
|
100
|
+
requirements:
|
101
|
+
- - "~>"
|
102
|
+
- !ruby/object:Gem::Version
|
103
|
+
version: 2.2.1
|
104
|
+
type: :runtime
|
105
|
+
prerelease: false
|
106
|
+
version_requirements: !ruby/object:Gem::Requirement
|
107
|
+
requirements:
|
108
|
+
- - "~>"
|
109
|
+
- !ruby/object:Gem::Version
|
110
|
+
version: 2.2.1
|
97
111
|
- !ruby/object:Gem::Dependency
|
98
112
|
name: fiddle
|
99
113
|
requirement: !ruby/object:Gem::Requirement
|
@@ -206,6 +220,20 @@ dependencies:
|
|
206
220
|
- - "~>"
|
207
221
|
- !ruby/object:Gem::Version
|
208
222
|
version: '1.2'
|
223
|
+
- !ruby/object:Gem::Dependency
|
224
|
+
name: pry
|
225
|
+
requirement: !ruby/object:Gem::Requirement
|
226
|
+
requirements:
|
227
|
+
- - "~>"
|
228
|
+
- !ruby/object:Gem::Version
|
229
|
+
version: 0.15.0
|
230
|
+
type: :development
|
231
|
+
prerelease: false
|
232
|
+
version_requirements: !ruby/object:Gem::Requirement
|
233
|
+
requirements:
|
234
|
+
- - "~>"
|
235
|
+
- !ruby/object:Gem::Version
|
236
|
+
version: 0.15.0
|
209
237
|
- !ruby/object:Gem::Dependency
|
210
238
|
name: rails
|
211
239
|
requirement: !ruby/object:Gem::Requirement
|
@@ -332,7 +360,6 @@ files:
|
|
332
360
|
- app/components/daisy/data_display/accordion_component.rb
|
333
361
|
- app/components/daisy/data_display/avatar_component.html.haml
|
334
362
|
- app/components/daisy/data_display/avatar_component.rb
|
335
|
-
- app/components/daisy/data_display/badge_component.html.haml
|
336
363
|
- app/components/daisy/data_display/badge_component.rb
|
337
364
|
- app/components/daisy/data_display/card_component.html.haml
|
338
365
|
- app/components/daisy/data_display/card_component.rb
|
@@ -347,7 +374,7 @@ files:
|
|
347
374
|
- app/components/daisy/data_display/countdown_controller.js
|
348
375
|
- app/components/daisy/data_display/diff_component.html.haml
|
349
376
|
- app/components/daisy/data_display/diff_component.rb
|
350
|
-
- app/components/daisy/data_display/
|
377
|
+
- app/components/daisy/data_display/figure_component.rb
|
351
378
|
- app/components/daisy/data_display/kbd_component.rb
|
352
379
|
- app/components/daisy/data_display/stat_component.html.haml
|
353
380
|
- app/components/daisy/data_display/stat_component.rb
|
@@ -359,11 +386,29 @@ files:
|
|
359
386
|
- app/components/daisy/data_display/timeline_event_component.rb
|
360
387
|
- app/components/daisy/feedback/alert_component.html.haml
|
361
388
|
- app/components/daisy/feedback/alert_component.rb
|
389
|
+
- app/components/daisy/feedback/loading_component.rb
|
390
|
+
- app/components/daisy/feedback/progress_component.rb
|
391
|
+
- app/components/daisy/feedback/radial_progress_component.rb
|
392
|
+
- app/components/daisy/feedback/skeleton_component.rb
|
393
|
+
- app/components/daisy/feedback/toast_component.rb
|
394
|
+
- app/components/daisy/feedback/tooltip_component.rb
|
395
|
+
- app/components/daisy/layout/artboard_component.rb
|
396
|
+
- app/components/daisy/layout/divider_component.rb
|
397
|
+
- app/components/daisy/layout/drawer_component.html.haml
|
398
|
+
- app/components/daisy/layout/drawer_component.rb
|
399
|
+
- app/components/daisy/layout/footer_component.rb
|
400
|
+
- app/components/daisy/layout/hero_component.html.haml
|
401
|
+
- app/components/daisy/layout/hero_component.rb
|
402
|
+
- app/components/daisy/layout/indicator_component.rb
|
362
403
|
- app/components/daisy/layout/join_component.rb
|
404
|
+
- app/components/daisy/layout/stack_component.rb
|
405
|
+
- app/components/daisy/mockup/browser_component.rb
|
406
|
+
- app/components/daisy/mockup/code_component.rb
|
407
|
+
- app/components/daisy/mockup/device_component.rb
|
408
|
+
- app/components/daisy/mockup/frame_component.rb
|
363
409
|
- app/components/daisy/navigation/bottom_nav_component.rb
|
364
410
|
- app/components/daisy/navigation/breadcrumbs_component.html.haml
|
365
411
|
- app/components/daisy/navigation/breadcrumbs_component.rb
|
366
|
-
- app/components/daisy/navigation/link_component.html.haml
|
367
412
|
- app/components/daisy/navigation/link_component.rb
|
368
413
|
- app/components/daisy/navigation/menu_component.html.haml
|
369
414
|
- app/components/daisy/navigation/menu_component.rb
|
@@ -374,13 +419,17 @@ files:
|
|
374
419
|
- app/components/daisy/navigation/tabs_component.rb
|
375
420
|
- app/components/hero/icon_component.rb
|
376
421
|
- lib/daisy.rb
|
377
|
-
- lib/
|
422
|
+
- lib/hero.rb
|
378
423
|
- lib/loco_motion.rb
|
379
424
|
- lib/loco_motion/base_component.rb
|
380
425
|
- lib/loco_motion/basic_component.rb
|
381
426
|
- lib/loco_motion/component_config.rb
|
427
|
+
- lib/loco_motion/concerns/tippable_component.rb
|
428
|
+
- lib/loco_motion/configuration.rb
|
382
429
|
- lib/loco_motion/engine.rb
|
383
430
|
- lib/loco_motion/errors.rb
|
431
|
+
- lib/loco_motion/helpers.rb
|
432
|
+
- lib/loco_motion/version.rb
|
384
433
|
homepage: https://rubygems.org/gems/loco_motion-rails
|
385
434
|
licenses:
|
386
435
|
- MIT
|
@@ -394,7 +443,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
394
443
|
requirements:
|
395
444
|
- - ">="
|
396
445
|
- !ruby/object:Gem::Version
|
397
|
-
version: '0'
|
446
|
+
version: '3.0'
|
398
447
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
399
448
|
requirements:
|
400
449
|
- - ">="
|
data/lib/daisy/helpers.rb
DELETED
@@ -1,61 +0,0 @@
|
|
1
|
-
module Daisy
|
2
|
-
COMPONENT_HELPERS = {
|
3
|
-
# TODO: The hero icons should be in a different helper? Or maybe this whole
|
4
|
-
# thing should be in a Loco module instead of Daisy?
|
5
|
-
|
6
|
-
### Hero Icons
|
7
|
-
icon: "Hero::IconComponent",
|
8
|
-
|
9
|
-
### Daisy Components
|
10
|
-
|
11
|
-
# Actions
|
12
|
-
button: "Daisy::Actions::ButtonComponent",
|
13
|
-
dropdown: "Daisy::Actions::DropdownComponent",
|
14
|
-
modal: "Daisy::Actions::ModalComponent",
|
15
|
-
swap: "Daisy::Actions::SwapComponent",
|
16
|
-
theme_controller: "Daisy::Actions::ThemeControllerComponent",
|
17
|
-
|
18
|
-
# Data
|
19
|
-
accordion: "Daisy::DataDisplay::AccordionComponent",
|
20
|
-
avatar: "Daisy::DataDisplay::AvatarComponent",
|
21
|
-
badge: "Daisy::DataDisplay::BadgeComponent",
|
22
|
-
card: "Daisy::DataDisplay::CardComponent",
|
23
|
-
carousel: "Daisy::DataDisplay::CarouselComponent",
|
24
|
-
chat: "Daisy::DataDisplay::ChatComponent",
|
25
|
-
collapse: "Daisy::DataDisplay::CollapseComponent",
|
26
|
-
countdown: "Daisy::DataDisplay::CountdownComponent",
|
27
|
-
diff: "Daisy::DataDisplay::DiffComponent",
|
28
|
-
kbd: "Daisy::DataDisplay::KbdComponent",
|
29
|
-
stat: "Daisy::DataDisplay::StatComponent",
|
30
|
-
table: "Daisy::DataDisplay::TableComponent",
|
31
|
-
timeline: "Daisy::DataDisplay::TimelineComponent",
|
32
|
-
|
33
|
-
# Navigation
|
34
|
-
breadcrumbs: "Daisy::Navigation::BreadcrumbsComponent",
|
35
|
-
bottom_nav: "Daisy::Navigation::BottomNavComponent",
|
36
|
-
link: "Daisy::Navigation::LinkComponent",
|
37
|
-
menu: "Daisy::Navigation::MenuComponent",
|
38
|
-
navbar: "Daisy::Navigation::NavbarComponent",
|
39
|
-
# TODO: This doesn't exist as a component, so it feels weird to have it
|
40
|
-
# here; but it makes the navigation work properly.
|
41
|
-
pagination: "Daisy::Navigation::PaginationComponent",
|
42
|
-
steps: "Daisy::Navigation::StepsComponent",
|
43
|
-
tabs: "Daisy::Navigation::TabsComponent",
|
44
|
-
|
45
|
-
# Feedback
|
46
|
-
alert: "Daisy::Feedback::AlertComponent",
|
47
|
-
|
48
|
-
# Layout
|
49
|
-
join: "Daisy::Layout::JoinComponent",
|
50
|
-
}
|
51
|
-
|
52
|
-
module Helpers
|
53
|
-
COMPONENT_HELPERS.each do |method_name, component_klass|
|
54
|
-
framework = component_klass.split("::").first.downcase
|
55
|
-
|
56
|
-
ActionView::Helpers.define_method("#{framework}_#{method_name}") do |*args, **kws, &block|
|
57
|
-
render(component_klass.constantize.new(*args, **kws), &block)
|
58
|
-
end
|
59
|
-
end
|
60
|
-
end
|
61
|
-
end
|