aeros 0.0.1 → 0.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.
Files changed (151) hide show
  1. checksums.yaml +4 -4
  2. data/Rakefile +1 -1
  3. data/app/assets/stylesheets/aeros/application.css +1 -15
  4. data/app/assets/stylesheets/aeros/base.css +43 -0
  5. data/app/assets/stylesheets/aeros/reset.css +397 -0
  6. data/app/assets/stylesheets/aeros/source.css +15 -0
  7. data/app/assets/stylesheets/aeros/theme.css +6 -0
  8. data/app/assets/stylesheets/aeros/themes/slate.css +163 -0
  9. data/app/assets/stylesheets/aeros/themes/zinc.css +163 -0
  10. data/app/assets/stylesheets/aeros/utilities.css +23 -0
  11. data/app/components/aeros/application_view_component.rb +149 -5
  12. data/app/components/aeros/blocks/component_preview/component.html.erb +7 -0
  13. data/app/components/aeros/blocks/component_preview/component.rb +10 -0
  14. data/app/components/aeros/blocks/component_preview/styles.css +10 -0
  15. data/app/components/aeros/form_builder.rb +24 -8
  16. data/app/components/aeros/pages/showcase/index/component.html.erb +53 -0
  17. data/app/components/aeros/pages/showcase/index/component.rb +7 -0
  18. data/app/components/aeros/pages/showcase/index/styles.css +27 -0
  19. data/app/components/aeros/pages/showcase/placeholder/component.html.erb +7 -0
  20. data/app/components/aeros/pages/showcase/placeholder/component.rb +10 -0
  21. data/app/components/aeros/pages/showcase/show/component.html.erb +38 -0
  22. data/app/components/aeros/pages/showcase/show/component.rb +48 -0
  23. data/app/components/aeros/primitives/button/component.rb +66 -0
  24. data/app/components/aeros/primitives/button/styles.css +153 -0
  25. data/app/components/aeros/primitives/card/component.html.erb +3 -0
  26. data/app/components/aeros/primitives/card/component.rb +42 -0
  27. data/app/components/aeros/primitives/card/styles.css +28 -0
  28. data/app/components/aeros/primitives/conversation/component.html.erb +28 -0
  29. data/app/components/aeros/primitives/conversation/component.rb +15 -0
  30. data/app/components/aeros/primitives/conversation/controller.js +18 -0
  31. data/app/components/aeros/primitives/conversation/message/component.html.erb +24 -0
  32. data/app/components/aeros/primitives/conversation/message/component.rb +35 -0
  33. data/app/components/aeros/primitives/conversation/streaming_indicator/component.html.erb +21 -0
  34. data/app/components/aeros/primitives/conversation/streaming_indicator/component.rb +18 -0
  35. data/app/components/aeros/primitives/conversation/styles.css +221 -0
  36. data/app/components/aeros/primitives/conversation/user_message_box/component.html.erb +1 -0
  37. data/app/components/aeros/{empty → primitives/conversation/user_message_box}/component.rb +1 -2
  38. data/app/components/aeros/primitives/drawer/component.html.erb +43 -0
  39. data/app/components/aeros/primitives/drawer/component.rb +33 -0
  40. data/app/components/aeros/primitives/drawer/controller.js +104 -0
  41. data/app/components/aeros/primitives/drawer/styles.css +90 -0
  42. data/app/components/aeros/primitives/dropdown/checkbox.rb +22 -0
  43. data/app/components/aeros/primitives/dropdown/component.html.erb +38 -0
  44. data/app/components/aeros/primitives/dropdown/component.rb +53 -0
  45. data/app/components/aeros/primitives/dropdown/controller.js +153 -0
  46. data/app/components/aeros/primitives/dropdown/item.rb +29 -0
  47. data/app/components/aeros/primitives/dropdown/label.rb +7 -0
  48. data/app/components/aeros/primitives/dropdown/radio_group.rb +16 -0
  49. data/app/components/aeros/primitives/dropdown/radio_item.rb +24 -0
  50. data/app/components/aeros/primitives/dropdown/separator.rb +7 -0
  51. data/app/components/aeros/primitives/dropdown/styles.css +155 -0
  52. data/app/components/aeros/primitives/empty/component.html.erb +15 -0
  53. data/app/components/aeros/primitives/empty/component.rb +18 -0
  54. data/app/components/aeros/primitives/empty/styles.css +40 -0
  55. data/app/components/aeros/primitives/input_attachments/component.html.erb +60 -0
  56. data/app/components/aeros/primitives/input_attachments/component.rb +52 -0
  57. data/app/components/aeros/primitives/input_attachments/controller.js +357 -0
  58. data/app/components/aeros/primitives/input_attachments/styles.css +102 -0
  59. data/app/components/aeros/primitives/input_color/component.html.erb +24 -0
  60. data/app/components/aeros/primitives/input_color/component.rb +42 -0
  61. data/app/components/aeros/primitives/input_color/styles.css +64 -0
  62. data/app/components/aeros/primitives/input_password/component.html.erb +43 -0
  63. data/app/components/aeros/primitives/input_password/component.rb +20 -0
  64. data/app/components/aeros/primitives/input_password/styles.css +61 -0
  65. data/app/components/aeros/{input_select → primitives/input_select}/component.html.erb +19 -19
  66. data/app/components/aeros/primitives/input_select/component.rb +21 -0
  67. data/app/components/aeros/primitives/input_select/option.rb +14 -0
  68. data/app/components/aeros/primitives/input_select/styles.css +30 -0
  69. data/app/components/aeros/primitives/input_slider/component.html.erb +33 -0
  70. data/app/components/aeros/primitives/input_slider/component.rb +35 -0
  71. data/app/components/aeros/primitives/input_slider/styles.css +74 -0
  72. data/app/components/aeros/primitives/input_tagging/component.html.erb +73 -0
  73. data/app/components/aeros/primitives/input_tagging/component.rb +40 -0
  74. data/app/components/aeros/primitives/input_tagging/controller.js +326 -0
  75. data/app/components/aeros/primitives/input_tagging/styles.css +148 -0
  76. data/app/components/aeros/primitives/input_text/component.html.erb +25 -0
  77. data/app/components/aeros/primitives/input_text/component.rb +20 -0
  78. data/app/components/aeros/primitives/input_text/styles.css +38 -0
  79. data/app/components/aeros/primitives/input_text_area/component.html.erb +23 -0
  80. data/app/components/aeros/primitives/input_text_area/component.rb +19 -0
  81. data/app/components/aeros/primitives/input_text_area/styles.css +30 -0
  82. data/app/components/aeros/primitives/input_text_area_ai/component.html.erb +51 -0
  83. data/app/components/aeros/primitives/input_text_area_ai/component.rb +47 -0
  84. data/app/components/aeros/primitives/input_text_area_ai/controller.js +198 -0
  85. data/app/components/aeros/primitives/input_text_area_ai/styles.css +91 -0
  86. data/app/components/aeros/primitives/input_wrapper/component.html.erb +20 -0
  87. data/app/components/aeros/primitives/input_wrapper/component.rb +31 -0
  88. data/app/components/aeros/primitives/input_wrapper/styles.css +72 -0
  89. data/app/components/aeros/primitives/layouts/agentic/component.html.erb +4 -0
  90. data/app/components/aeros/primitives/layouts/agentic/component.rb +23 -0
  91. data/app/components/aeros/primitives/layouts/app/aside.rb +9 -0
  92. data/app/components/aeros/primitives/layouts/app/component.html.erb +14 -0
  93. data/app/components/aeros/primitives/layouts/app/component.rb +11 -0
  94. data/app/components/aeros/primitives/layouts/app/sidebar.rb +9 -0
  95. data/app/components/aeros/primitives/layouts/app/styles.css +46 -0
  96. data/app/components/aeros/primitives/page/component.html.erb +24 -0
  97. data/app/components/aeros/primitives/page/component.rb +23 -0
  98. data/app/components/aeros/primitives/page/styles.css +55 -0
  99. data/app/components/aeros/primitives/sidebar/component.html.erb +25 -0
  100. data/app/components/aeros/primitives/sidebar/component.rb +14 -0
  101. data/app/components/aeros/primitives/sidebar/footer.rb +7 -0
  102. data/app/components/aeros/primitives/sidebar/group.rb +18 -0
  103. data/app/components/aeros/primitives/sidebar/header.rb +7 -0
  104. data/app/components/aeros/primitives/sidebar/item.rb +19 -0
  105. data/app/components/aeros/primitives/sidebar/styles.css +95 -0
  106. data/app/components/aeros/primitives/spinner/component.rb +36 -0
  107. data/app/components/aeros/primitives/spinner/styles.css +81 -0
  108. data/app/components/aeros/primitives/table/cell.rb +7 -0
  109. data/app/components/aeros/primitives/table/column.rb +7 -0
  110. data/app/components/aeros/primitives/table/component.html.erb +8 -0
  111. data/app/components/aeros/primitives/table/component.rb +14 -0
  112. data/app/components/aeros/primitives/table/header.rb +13 -0
  113. data/app/components/aeros/primitives/table/row.rb +11 -0
  114. data/app/components/aeros/primitives/table/styles.css +39 -0
  115. data/app/controllers/aeros/application_controller.rb +11 -0
  116. data/app/controllers/aeros/showcase_controller.rb +37 -1
  117. data/app/controllers/aeros/theme_controller.rb +10 -0
  118. data/app/helpers/aeros/application_helper.rb +19 -7
  119. data/app/views/layouts/aeros/application.html.erb +49 -14
  120. data/config/importmap.rb +6 -1
  121. data/config/routes.rb +2 -0
  122. data/lib/aeros/configuration.rb +56 -0
  123. data/lib/aeros/engine.rb +7 -1
  124. data/lib/aeros/theme.rb +326 -0
  125. data/lib/aeros/version.rb +1 -1
  126. data/lib/aeros.rb +2 -0
  127. data/lib/tasks/aeros_tasks.rake +25 -7
  128. metadata +127 -38
  129. data/app/assets/stylesheets/aeros/application.tailwind.css +0 -7
  130. data/app/assets/stylesheets/aeros/tailwind.css +0 -1100
  131. data/app/components/aeros/button/component.rb +0 -128
  132. data/app/components/aeros/card/component.html.erb +0 -3
  133. data/app/components/aeros/card/component.rb +0 -7
  134. data/app/components/aeros/dropdown/component.html.erb +0 -26
  135. data/app/components/aeros/dropdown/component.rb +0 -66
  136. data/app/components/aeros/empty/component.html.erb +0 -12
  137. data/app/components/aeros/input_password/component.html.erb +0 -43
  138. data/app/components/aeros/input_password/component.rb +0 -6
  139. data/app/components/aeros/input_select/component.rb +0 -24
  140. data/app/components/aeros/input_text/component.html.erb +0 -25
  141. data/app/components/aeros/input_text/component.rb +0 -5
  142. data/app/components/aeros/input_wrapper/component.html.erb +0 -20
  143. data/app/components/aeros/input_wrapper/component.rb +0 -12
  144. data/app/components/aeros/page/component.html.erb +0 -24
  145. data/app/components/aeros/page/component.rb +0 -9
  146. data/app/components/aeros/spinner/component.rb +0 -55
  147. data/app/components/aeros/table/component.html.erb +0 -10
  148. data/app/components/aeros/table/component.rb +0 -64
  149. data/app/views/aeros/showcase/index.html.erb +0 -1
  150. /data/app/components/aeros/{button → primitives/button}/controller.js +0 -0
  151. /data/app/components/aeros/{input_password → primitives/input_password}/controller.js +0 -0
@@ -1,128 +0,0 @@
1
- module Aeros::Button
2
- class Component < ::Aeros::ApplicationViewComponent
3
- option(:css, optional: true)
4
- option(:type, optional: true)
5
- option(:label, optional: true)
6
- option(:method, optional: true)
7
- option(:href, optional: true)
8
- option(:data, default: proc { {} })
9
- option(:icon, optional: true)
10
- option(:variant, default: proc { :default })
11
- option(:disabled, default: proc { false })
12
- option(:full, default: proc { false })
13
- option(:size, default: proc { nil })
14
- option(:as, default: proc { :button })
15
- option(:target, optional: true)
16
-
17
- style do
18
- base do
19
- %w[
20
- rounded-md
21
- px-3.5
22
- py-2.5
23
- font-semibold
24
- inline-flex
25
- items-center
26
- space-x-1
27
- hover:bg-stone-500
28
- focus-visible:outline
29
- focus-visible:outline-2
30
- focus-visible:outline-offset-2
31
- focus-visible:outline-stone-600
32
- cursor-pointer
33
- [&>span]:truncate
34
- [&>span]:flex-shrink
35
- [&>svg]:flex-shrink-0
36
- [&>svg]:w-4
37
- [&>svg]:h-4
38
- [&.loading]:opacity-50
39
- [&.loading]:pointer-events-none
40
- [&.loading_.icon]:hidden
41
- [&.loading_.spinner]:flex
42
- ]
43
- end
44
-
45
- variants do
46
- variant do
47
- white { "text-stone-600 bg-white hover:bg-stone-50 text-stone-800 border border-gray-200 shadow-sm !text-gray-500" }
48
- default { "bg-slate-600 text-white" }
49
- light { "bg-stone-50 text-stone-600 hover:bg-stone-100" }
50
- outline { "bg-stone-50 text-stone-600 ring ring-1 ring-stone-400 rounded-full px-6 hover:bg-stone-100" }
51
- end
52
-
53
- disabled do
54
- yes { "pointer-events-none opacity-50" }
55
- end
56
-
57
- full do
58
- yes { "w-full justify-center" }
59
- end
60
-
61
- size do
62
- xsmall do
63
- %w[
64
- px-2.5
65
- py-1
66
- [&>span]:text-xs
67
- [&>svg]:pl-[-10px]
68
- [&>svg]:flex-shrink-0
69
- [&>svg]:w-3
70
- [&>svg]:h-3
71
- space-x-1
72
- ]
73
- end
74
-
75
- small do
76
- %w[
77
- text-lg
78
- px-2.5
79
- py-1.5
80
- space-x-1
81
- text-sm
82
- [&>svg]:pl-[-10px]
83
- [&>svg]:flex-shrink-0
84
- [&>svg]:w-4
85
- [&>svg]:h-4
86
- ]
87
- end
88
-
89
- large do
90
- %w[
91
- text-lg
92
- px-4
93
- py-3
94
- space-x-2
95
- [&>svg]:pl-[-10px]
96
- [&>svg]:flex-shrink-0
97
- [&>svg]:w-6
98
- [&>svg]:h-6
99
- ]
100
- end
101
- end
102
- end
103
- end
104
-
105
- def classes
106
- [
107
- css,
108
- style(variant:, disabled:, full:, size:)
109
- ].join(" ")
110
- end
111
-
112
- erb_template <<~ERB
113
- <% if href %>
114
- <%= link_to(href, method:, data: merged_data, class: classes, target:) do %>
115
- <%= lucide_icon(icon, class: "flex-shrink-0 icon") if icon %>
116
- <%= ui("spinner", size: :sm, variant: :white, css: "spinner hidden") %>
117
- <% if label %><span class="truncate flex-shrink"><%= label %></span><% end %>
118
- <% end %>
119
- <% else %>
120
- <%= content_tag(as, data: merged_data, type: type || "button", class: classes) do %>
121
- <%= lucide_icon(icon, class: "flex-shrink-0 icon") if icon %>
122
- <%= ui("spinner", size: :sm, variant: :white, css: "spinner hidden") %>
123
- <% if label %><span class="truncate flex-shrink"><%= label %></span><% end %>
124
- <% end %>
125
- <% end %>
126
- ERB
127
- end
128
- end
@@ -1,3 +0,0 @@
1
- <div class="<%= default_styles %>">
2
- <%= content %>
3
- </div>
@@ -1,7 +0,0 @@
1
- module Aeros::Card
2
- class Component < ::Aeros::ApplicationViewComponent
3
- style do
4
- base { "shadow-lg ring ring-stone-400/20 rounded-lg" }
5
- end
6
- end
7
- end
@@ -1,26 +0,0 @@
1
- <div class="<%= classes %>">
2
- <div>
3
- <%= ui("button",
4
- label: label,
5
- icon: "chevron-down",
6
- variant: button_variant,
7
- size: button_size,
8
- data: { "dropdown-menu-toggle": "" }) %>
9
- </div>
10
-
11
- <div class="hidden origin-top-right absolute right-0 mt-2 w-56 rounded-md shadow-lg bg-white ring-1 ring-black ring-opacity-5 focus:outline-none z-10"
12
- role="menu"
13
- aria-orientation="vertical">
14
- <div class="py-1">
15
- <% if groups.any? %>
16
- <% groups.each do |group| %>
17
- <%= group %>
18
- <% end %>
19
- <% else %>
20
- <% options.each do |option| %>
21
- <%= option %>
22
- <% end %>
23
- <% end %>
24
- </div>
25
- </div>
26
- </div>
@@ -1,66 +0,0 @@
1
- module Aeros::Dropdown
2
- class Component < ::Aeros::ApplicationViewComponent
3
- option(:css, optional: true)
4
- option(:label, optional: true)
5
- option(:button_variant, default: proc { :white })
6
- option(:button_size, default: proc { :small })
7
-
8
- renders_many :options, "OptionComponent"
9
- renders_many :groups, "GroupComponent"
10
-
11
- class OptionComponent < ApplicationViewComponent
12
- option(:value)
13
- option(:label)
14
- option(:href, optional: true)
15
- option(:selected, default: proc { false })
16
- option(:icon, optional: true)
17
-
18
- erb_template <<~ERB
19
- <% if href %>
20
- <a href="<%= href %>"
21
- class="block px-4 py-2 text-sm text-gray-700 hover:bg-gray-100 hover:text-gray-900 <%= 'bg-gray-50' if selected %>"
22
- role="menuitem">
23
- <div class="flex items-center space-x-2">
24
- <%= lucide_icon(icon, class: "w-4 h-4") if icon %>
25
- <span><%= label %></span>
26
- </div>
27
- </a>
28
- <% else %>
29
- <button type="button"
30
- data-value="<%= value %>"
31
- class="block w-full text-left px-4 py-2 text-sm text-gray-700 hover:bg-gray-100 hover:text-gray-900 <%= 'bg-gray-50' if selected %>"
32
- role="menuitem">
33
- <div class="flex items-center space-x-2">
34
- <%= lucide_icon(icon, class: "w-4 h-4") if icon %>
35
- <span><%= label %></span>
36
- </div>
37
- </button>
38
- <% end %>
39
- ERB
40
- end
41
-
42
- class GroupComponent < ApplicationViewComponent
43
- option(:label)
44
-
45
- renders_many :items, "Aeros::Dropdown::Component::OptionComponent"
46
-
47
- erb_template <<~ERB
48
- <div class="py-1">
49
- <div class="px-4 py-2 text-xs font-semibold text-gray-500 uppercase tracking-wider">
50
- <%= label %>
51
- </div>
52
- <% items.each do |item| %>
53
- <%= item %>
54
- <% end %>
55
- </div>
56
- ERB
57
- end
58
-
59
- def classes
60
- [
61
- "relative inline-block text-left",
62
- css
63
- ].join(" ")
64
- end
65
- end
66
- end
@@ -1,12 +0,0 @@
1
- <div class="p-6">
2
- <div class="flex items-center justify-center flex-col border border-dashed border-stone-300 rounded-lg p-6 min-h-[300px]">
3
- <div class="flex items-center justify-center flex-col space-y-4">
4
- <% if title %>
5
- <div class="font-bold text-xl"><%= title %></div>
6
- <% end %>
7
- <div>
8
- <%= content %>
9
- </div>
10
- </div>
11
- </div>
12
- </div>
@@ -1,43 +0,0 @@
1
- <%= ui("input_wrapper",
2
- label: label,
3
- helper_text: helper_text,
4
- error_text: error_text,
5
- name: name,
6
- id: id,
7
- disabled: disabled,
8
- required: required) do %>
9
- <div class="relative" data-controller="<%= controller_name %>">
10
- <input
11
- type="password"
12
- id="<%= id %>"
13
- name="<%= name %>"
14
- value="<%= value %>"
15
- placeholder="<%= placeholder %>"
16
- autocomplete="<%= autocomplete %>"
17
- class="<%= Ui::FormBuilder::BaseComponent::INPUT_BASE_CLASSES.join(' ') %> <%= show_toggle ? 'pr-10' : '' %>"
18
- data-<%= controller_name %>-target="input"
19
- <%= 'disabled' if disabled %>
20
- <%= 'required' if required %>
21
- <% if data.any? %>
22
- <% data.each do |key, val| %>
23
- data-<%= key.to_s.dasherize %>="<%= val %>"
24
- <% end %>
25
- <% end %>
26
- />
27
- <% if show_toggle %>
28
- <button
29
- type="button"
30
- class="absolute inset-y-0 right-0 pr-3 flex items-center"
31
- data-action="click-><%= controller_name %>#toggle"
32
- tabindex="-1"
33
- >
34
- <span data-<%= controller_name %>-target="showIcon">
35
- <%= lucide_icon("eye", class: "h-4 w-4 text-gray-400 hover:text-gray-600") %>
36
- </span>
37
- <span data-<%= controller_name %>-target="hideIcon" class="hidden">
38
- <%= lucide_icon("eye-off", class: "h-4 w-4 text-gray-400 hover:text-gray-600") %>
39
- </span>
40
- </button>
41
- <% end %>
42
- </div>
43
- <% end %>
@@ -1,6 +0,0 @@
1
- module Aeros::InputPassword
2
- class Component < ::Aeros::FormBuilder::BaseComponent
3
- option(:autocomplete, default: proc { "current-password" })
4
- option(:show_toggle, default: proc { true })
5
- end
6
- end
@@ -1,24 +0,0 @@
1
- module Aeros::InputSelect
2
- class Component < ::Aeros::FormBuilder::BaseComponent
3
- option(:prompt, optional: true)
4
- option(:options, default: proc { [] })
5
- option(:collection, optional: true)
6
- option(:value_method, optional: true)
7
- option(:label_method, optional: true)
8
-
9
- renders_many :select_options, "OptionComponent"
10
-
11
- class OptionComponent < ApplicationViewComponent
12
- option(:value)
13
- option(:label)
14
- option(:selected, default: proc { false })
15
- option(:disabled, default: proc { false })
16
-
17
- erb_template <<~ERB
18
- <option value="<%= value %>" <%= 'selected' if selected %> <%= 'disabled' if disabled %>>
19
- <%= label %>
20
- </option>
21
- ERB
22
- end
23
- end
24
- end
@@ -1,25 +0,0 @@
1
- <%= ui("input_wrapper",
2
- label: label,
3
- helper_text: helper_text,
4
- error_text: error_text,
5
- name: name,
6
- id: id,
7
- disabled: disabled,
8
- required: required) do %>
9
- <input
10
- type="<%= type || 'text' %>"
11
- id="<%= id %>"
12
- name="<%= name %>"
13
- value="<%= value %>"
14
- placeholder="<%= placeholder %>"
15
- autocomplete="<%= autocomplete %>"
16
- class="<%= Ui::FormBuilder::BaseComponent::INPUT_BASE_CLASSES.join(' ') %>"
17
- <%= 'disabled' if disabled %>
18
- <%= 'required' if required %>
19
- <% if data.any? %>
20
- <% data.each do |key, val| %>
21
- data-<%= key.to_s.dasherize %>="<%= val %>"
22
- <% end %>
23
- <% end %>
24
- />
25
- <% end %>
@@ -1,5 +0,0 @@
1
- module Aeros::InputText
2
- class Component < ::Aeros::FormBuilder::BaseComponent
3
- option(:autocomplete, optional: true)
4
- end
5
- end
@@ -1,20 +0,0 @@
1
- <div class="<%= 'opacity-50 pointer-events-none' if disabled %>" data-<%= data.to_json if data.any? %>>
2
- <% if label %>
3
- <label for="<%= id || name %>" class="block text-sm font-medium text-gray-700 mb-1">
4
- <%= label %>
5
- <% if required %>
6
- <span class="text-red-500">*</span>
7
- <% end %>
8
- </label>
9
- <% end %>
10
-
11
- <div class="relative">
12
- <%= content %>
13
- </div>
14
-
15
- <% if error_text %>
16
- <p class="mt-1 text-sm text-red-600"><%= error_text %></p>
17
- <% elsif helper_text %>
18
- <p class="mt-1 text-sm text-gray-500"><%= helper_text %></p>
19
- <% end %>
20
- </div>
@@ -1,12 +0,0 @@
1
- module Aeros::InputWrapper
2
- class Component < ::Aeros::ApplicationViewComponent
3
- option(:label, optional: true)
4
- option(:name)
5
- option(:id, optional: true)
6
- option(:helper_text, optional: true)
7
- option(:error_text, optional: true)
8
- option(:disabled, default: proc { false })
9
- option(:required, default: proc { false })
10
- option(:data, default: proc { {} })
11
- end
12
- end
@@ -1,24 +0,0 @@
1
- <div class="flex flex-col w-full">
2
- <div class="flex items-center justify-between py-6 space-x-6">
3
- <div class="w-full min-w-0 truncate">
4
- <h1 class="flex items-center space-x-2 font-semibold text-3xl tracking-tight">
5
- <span class="flex-shrink truncate min-w-0 max-w-2/3"><%= title %></span>
6
- <% if subtitle %>
7
- <span class="text-gray-500/70 flex-shrink-0"><%= subtitle %></span>
8
- <% end %>
9
- </h1>
10
- <% if description %>
11
- <p class="mt-2 text-gray-600"><%= description %></p>
12
- <% end %>
13
- </div>
14
- <% if actions_area %>
15
- <div class="flex-shrink-0">
16
- <%= actions_area %>
17
- </div>
18
- <% end %>
19
- </div>
20
-
21
- <div class="pb-6 w-full">
22
- <%= content %>
23
- </div>
24
- </div>
@@ -1,9 +0,0 @@
1
- module Aeros::Page
2
- class Component < Aeros::ApplicationViewComponent
3
- option(:title)
4
- option(:subtitle, optional: true)
5
- option(:description, optional: true)
6
-
7
- renders_one(:actions_area)
8
- end
9
- end
@@ -1,55 +0,0 @@
1
- module Aeros::Spinner
2
- class Component < ::Aeros::ApplicationViewComponent
3
- option(:size, default: proc { :default })
4
- option(:variant, default: proc { :default })
5
- option(:css, optional: true)
6
-
7
- style do
8
- base do
9
- %w[
10
- relative
11
- inset-0
12
- pl-2
13
- mr-0
14
- w-5
15
- h-5
16
- before:content-['']
17
- before:box-border
18
- before:absolute
19
- before:top-1/2
20
- before:left-1/2
21
- before:w-5
22
- before:h-5
23
- before:-mt-2
24
- before:-ml-2
25
- before:rounded-full
26
- before:border-2
27
- before:animate-spin
28
- ]
29
- end
30
-
31
- variants do
32
- size do
33
- xs { "before:w-3 before:h-3 before:-mt-1.5 before:-ml-1.5" }
34
- sm { "before:w-4 before:h-4 before:-mt-2 before:-ml-2" }
35
- default { "before:w-5 before:h-5 before:-mt-2.5 before:-ml-2.5" }
36
- lg { "before:w-6 before:h-6 before:-mt-3 before:-ml-3" }
37
- xl { "before:w-8 before:h-8 before:-mt-4 before:-ml-4" }
38
- end
39
-
40
- variant do
41
- white { "before:border-white/50 before:border-t-white" }
42
- default { "before:border-gray-500/50 before:border-t-gray-500" }
43
- primary { "before:border-default-500/50 before:border-t-default-500" }
44
- secondary { "before:border-secondary/50 before:border-t-secondary" }
45
- destructive { "before:border-destructive/50 before:border-t-destructive" }
46
- black { "before:border-black/50 before:border-t-black" }
47
- end
48
- end
49
- end
50
-
51
- erb_template <<~ERB
52
- <span class="<%= style(size:, variant:) %> <%= css %>"></span>
53
- ERB
54
- end
55
- end
@@ -1,10 +0,0 @@
1
- <div class="overflow-x-auto">
2
- <table class="<%= table_classes %>" <%= "id=\"#{id}\"" if id %>>
3
- <%= header if header? %>
4
- <tbody class="bg-white divide-y divide-gray-200">
5
- <% rows.each do |row| %>
6
- <%= row %>
7
- <% end %>
8
- </tbody>
9
- </table>
10
- </div>
@@ -1,64 +0,0 @@
1
- module Aeros::Table
2
- class Component < ::Aeros::ApplicationViewComponent
3
- option(:css, optional: true)
4
- option(:id, optional: true)
5
-
6
- renders_one :header, "HeaderComponent"
7
- renders_many :rows, "RowComponent"
8
-
9
- class HeaderComponent < Aeros::ApplicationViewComponent
10
- renders_many :columns, "ColumnComponent"
11
-
12
- class ColumnComponent < Aeros::ApplicationViewComponent
13
- option(:css, optional: true)
14
-
15
- erb_template <<~ERB
16
- <th scope="col" class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider <%= css %>">
17
- <%= content %>
18
- </th>
19
- ERB
20
- end
21
-
22
- erb_template <<~ERB
23
- <thead class="bg-gray-50">
24
- <tr>
25
- <% columns.each do |column| %>
26
- <%= column %>
27
- <% end %>
28
- </tr>
29
- </thead>
30
- ERB
31
- end
32
-
33
- class RowComponent < Aeros::ApplicationViewComponent
34
- option(:css, optional: true)
35
-
36
- renders_many :cells, "CellComponent"
37
-
38
- class CellComponent < Aeros::ApplicationViewComponent
39
- option(:css, optional: true)
40
-
41
- erb_template <<~ERB
42
- <td class="px-6 py-4 text-sm text-gray-900 <%= css %>">
43
- <%= content %>
44
- </td>
45
- ERB
46
- end
47
-
48
- erb_template <<~ERB
49
- <tr class="<%= css %>">
50
- <% cells.each do |cell| %>
51
- <%= cell %>
52
- <% end %>
53
- </tr>
54
- ERB
55
- end
56
-
57
- def table_classes
58
- [
59
- "min-w-full divide-y divide-gray-200",
60
- css
61
- ].compact.join(" ")
62
- end
63
- end
64
- end
@@ -1 +0,0 @@
1
- <%= ui("button", label: "ok") %>