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
data/lib/aeros/engine.rb CHANGED
@@ -1,7 +1,7 @@
1
1
  require "importmap-rails"
2
2
  require "view_component-contrib"
3
3
  require "dry-effects"
4
- require "tailwind_merge"
4
+ require "lucide-rails"
5
5
 
6
6
  module Aeros
7
7
  class << self
@@ -19,6 +19,12 @@ module Aeros
19
19
  end
20
20
  end
21
21
 
22
+ initializer "aeros.helpers" do
23
+ ActiveSupport.on_load(:action_controller) do
24
+ helper Aeros::ApplicationHelper
25
+ end
26
+ end
27
+
22
28
  initializer "aeros.importmap", before: "importmap" do |app|
23
29
  Aeros.importmap = Importmap::Map.new
24
30
  Aeros.importmap.draw(app.root.join("config/importmap.rb"))
@@ -0,0 +1,326 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Aeros
4
+ class Theme
5
+ # ═══════════════════════════════════════════════════════════════════════════
6
+ # PROPERTY TYPES
7
+ # Define how each type is rendered in the configurator
8
+ # ═══════════════════════════════════════════════════════════════════════════
9
+ PROPERTY_TYPES = {
10
+ color: {
11
+ widget: :color_picker,
12
+ },
13
+ length: {
14
+ widget: :slider,
15
+ unit: "rem",
16
+ min: 0,
17
+ max: 2,
18
+ step: 0.0625,
19
+ },
20
+ multiplier: {
21
+ widget: :slider,
22
+ prefix: "×",
23
+ min: 0,
24
+ max: 3,
25
+ step: 0.1,
26
+ },
27
+ shadow: {
28
+ widget: :button_group,
29
+ options: {
30
+ none: "none",
31
+ sm: "0 1px 2px 0 rgb(0 0 0 / 0.05)",
32
+ md: "0 4px 6px -1px rgb(0 0 0 / 0.1)",
33
+ lg: "0 10px 15px -3px rgb(0 0 0 / 0.1)",
34
+ xl: "0 20px 25px -5px rgb(0 0 0 / 0.1)"
35
+ }
36
+ },
37
+ font_family: {
38
+ widget: :select,
39
+ options: {
40
+ sans: "ui-sans-serif, system-ui, sans-serif",
41
+ serif: "ui-serif, Georgia, serif",
42
+ mono: "ui-monospace, monospace"
43
+ }
44
+ },
45
+ font_weight: {
46
+ widget: :button_group,
47
+ options: {
48
+ normal: "400",
49
+ medium: "500",
50
+ semibold: "600",
51
+ bold: "700"
52
+ }
53
+ },
54
+ }.freeze
55
+
56
+ # ═══════════════════════════════════════════════════════════════════════════
57
+ # PRIMITIVES
58
+ # The foundational values. Change these → everything derives.
59
+ # ═══════════════════════════════════════════════════════════════════════════
60
+ PRIMITIVES = {
61
+ # Colors
62
+ primary: "#475569",
63
+ primary_hover: "#334155",
64
+ primary_fg: "#ffffff",
65
+
66
+ secondary: "#f5f5f5",
67
+ secondary_hover: "#e5e5e5",
68
+ secondary_fg: "#1a1a1a",
69
+
70
+ destructive: "#dc2626",
71
+ destructive_hover: "#b91c1c",
72
+ destructive_fg: "#ffffff",
73
+
74
+ background: "#ffffff",
75
+ foreground: "#1a1a1a",
76
+
77
+ muted: "#f5f5f5",
78
+ muted_fg: "#737373",
79
+
80
+ border: "#e5e5e5",
81
+ ring: "#475569",
82
+
83
+ overlay: "#00000080",
84
+
85
+ # Lengths
86
+ radius_sm: "0.25rem",
87
+ radius_md: "0.375rem",
88
+ radius_lg: "0.5rem",
89
+ radius_xl: "0.75rem",
90
+
91
+ spacing_xs: "0.25rem",
92
+ spacing_sm: "0.5rem",
93
+ spacing_md: "0.75rem",
94
+ spacing_lg: "1rem",
95
+ spacing_xl: "1.5rem",
96
+ spacing_2xl: "2rem",
97
+
98
+ # Shadows
99
+ shadow_none: "none",
100
+ shadow_sm: "0 1px 2px 0 rgb(0 0 0 / 0.05)",
101
+ shadow_md: "0 4px 6px -1px rgb(0 0 0 / 0.1)",
102
+ shadow_lg: "0 10px 15px -3px rgb(0 0 0 / 0.1)",
103
+ shadow_xl: "0 20px 25px -5px rgb(0 0 0 / 0.1)",
104
+
105
+ # Fonts
106
+ font_sans: "ui-sans-serif, system-ui, sans-serif",
107
+ font_mono: "ui-monospace, monospace",
108
+
109
+ weight_normal: "400",
110
+ weight_medium: "500",
111
+ weight_semibold: "600",
112
+ weight_bold: "700",
113
+ }.freeze
114
+
115
+ # ═══════════════════════════════════════════════════════════════════════════
116
+ # CORNERSTONES
117
+ # Component-level tokens, defaults reference primitives
118
+ # ═══════════════════════════════════════════════════════════════════════════
119
+ CORNERSTONES = {
120
+ button: {
121
+ label: "Button",
122
+ properties: {
123
+ bg: { var: "--ui-button-bg", type: :color, default: :primary },
124
+ bg_hover: { var: "--ui-button-bg-hover", type: :color, default: :primary_hover },
125
+ fg: { var: "--ui-button-fg", type: :color, default: :primary_fg },
126
+ border: { var: "--ui-button-border", type: :color, default: :primary },
127
+ radius: { var: "--ui-button-radius", type: :length, default: :radius_md, max: 1 },
128
+ padding_x: { var: "--ui-button-px", type: :length, default: :spacing_md, max: 2 },
129
+ padding_y: { var: "--ui-button-py", type: :length, default: :spacing_sm, max: 1.5 },
130
+ font_weight: { var: "--ui-button-weight", type: :font_weight, default: :weight_semibold },
131
+ }
132
+ },
133
+
134
+ input: {
135
+ label: "Input",
136
+ properties: {
137
+ bg: { var: "--ui-input-bg", type: :color, default: :background },
138
+ fg: { var: "--ui-input-fg", type: :color, default: :foreground },
139
+ border: { var: "--ui-input-border", type: :color, default: :border },
140
+ border_focus: { var: "--ui-input-border-focus", type: :color, default: :primary },
141
+ ring: { var: "--ui-input-ring", type: :color, default: :ring },
142
+ placeholder: { var: "--ui-input-placeholder", type: :color, default: :muted_fg },
143
+ radius: { var: "--ui-input-radius", type: :length, default: :radius_md, max: 1 },
144
+ padding_x: { var: "--ui-input-px", type: :length, default: :spacing_md, max: 1.5 },
145
+ padding_y: { var: "--ui-input-py", type: :length, default: :spacing_sm, max: 1 },
146
+ }
147
+ },
148
+
149
+ card: {
150
+ label: "Card",
151
+ properties: {
152
+ bg: { var: "--ui-card-bg", type: :color, default: :background },
153
+ fg: { var: "--ui-card-fg", type: :color, default: :foreground },
154
+ border: { var: "--ui-card-border", type: :color, default: :border },
155
+ radius: { var: "--ui-card-radius", type: :length, default: :radius_lg, max: 1.5 },
156
+ padding: { var: "--ui-card-padding", type: :length, default: :spacing_xl, max: 3 },
157
+ shadow: { var: "--ui-card-shadow", type: :shadow, default: :shadow_sm },
158
+ }
159
+ },
160
+
161
+ sheet: {
162
+ label: "Sheet",
163
+ properties: {
164
+ bg: { var: "--ui-sheet-bg", type: :color, default: :background },
165
+ fg: { var: "--ui-sheet-fg", type: :color, default: :foreground },
166
+ border: { var: "--ui-sheet-border", type: :color, default: :border },
167
+ overlay: { var: "--ui-sheet-overlay", type: :color, default: :overlay },
168
+ radius: { var: "--ui-sheet-radius", type: :length, default: :radius_xl, max: 2 },
169
+ padding: { var: "--ui-sheet-padding", type: :length, default: :spacing_xl, max: 3 },
170
+ shadow: { var: "--ui-sheet-shadow", type: :shadow, default: :shadow_xl },
171
+ }
172
+ },
173
+
174
+ area: {
175
+ label: "Area",
176
+ properties: {
177
+ bg: { var: "--ui-area-bg", type: :color, default: :muted },
178
+ fg: { var: "--ui-area-fg", type: :color, default: :foreground },
179
+ border: { var: "--ui-area-border", type: :color, default: :border },
180
+ radius: { var: "--ui-area-radius", type: :length, default: :radius_xl, max: 2 },
181
+ padding: { var: "--ui-area-padding", type: :length, default: :spacing_2xl, max: 4 },
182
+ }
183
+ },
184
+
185
+ table: {
186
+ label: "Table",
187
+ properties: {
188
+ bg: { var: "--ui-table-bg", type: :color, default: :background },
189
+ fg: { var: "--ui-table-fg", type: :color, default: :foreground },
190
+ border: { var: "--ui-table-border", type: :color, default: :border },
191
+ header_bg: { var: "--ui-table-header-bg", type: :color, default: :muted },
192
+ header_fg: { var: "--ui-table-header-fg", type: :color, default: :muted_fg },
193
+ row_hover: { var: "--ui-table-row-hover", type: :color, default: :muted },
194
+ row_stripe: { var: "--ui-table-row-stripe", type: :color, default: :muted },
195
+ radius: { var: "--ui-table-radius", type: :length, default: :radius_lg, max: 1 },
196
+ cell_padding: { var: "--ui-table-cell-padding", type: :length, default: :spacing_md, max: 1.5 },
197
+ }
198
+ },
199
+
200
+ typography: {
201
+ label: "Typography",
202
+ properties: {
203
+ heading: { var: "--ui-heading-color", type: :color, default: :foreground },
204
+ body: { var: "--ui-body-color", type: :color, default: :foreground },
205
+ muted: { var: "--ui-muted-color", type: :color, default: :muted_fg },
206
+ link: { var: "--ui-link-color", type: :color, default: :primary },
207
+ link_hover: { var: "--ui-link-hover", type: :color, default: :primary_hover },
208
+ code_bg: { var: "--ui-code-bg", type: :color, default: :muted },
209
+ code_fg: { var: "--ui-code-fg", type: :color, default: :foreground },
210
+ font_sans: { var: "--ui-font-sans", type: :font_family, default: :font_sans },
211
+ font_mono: { var: "--ui-font-mono", type: :font_family, default: :font_mono },
212
+ heading_weight: { var: "--ui-heading-weight", type: :font_weight, default: :weight_semibold },
213
+ }
214
+ },
215
+
216
+ menu: {
217
+ label: "Menu",
218
+ properties: {
219
+ bg: { var: "--ui-menu-bg", type: :color, default: :background },
220
+ fg: { var: "--ui-menu-fg", type: :color, default: :foreground },
221
+ border: { var: "--ui-menu-border", type: :color, default: :border },
222
+ radius: { var: "--ui-menu-radius", type: :length, default: :radius_md },
223
+ shadow: { var: "--ui-menu-shadow", type: :shadow, default: :shadow_lg },
224
+ padding: { var: "--ui-menu-padding", type: :length, default: :spacing_xs },
225
+ item_radius: { var: "--ui-menu-item-radius", type: :length, default: :radius_sm },
226
+ }
227
+ },
228
+ }.freeze
229
+
230
+ # ═══════════════════════════════════════════════════════════════════════════
231
+ # API METHODS
232
+ # ═══════════════════════════════════════════════════════════════════════════
233
+
234
+ class << self
235
+ # All CSS variable names (for JS)
236
+ def css_variables
237
+ vars = []
238
+ CORNERSTONES.each_value do |cornerstone|
239
+ cornerstone[:properties].each_value do |prop|
240
+ vars << prop[:var]
241
+ end
242
+ end
243
+ vars
244
+ end
245
+
246
+ # For JS: array of var names
247
+ def to_js_array
248
+ css_variables.map { |v| %("#{v}") }.join(", ")
249
+ end
250
+
251
+ # Resolve a default value (symbol → primitive value)
252
+ def resolve_default(default_key)
253
+ return default_key unless default_key.is_a?(Symbol)
254
+ PRIMITIVES[default_key] || default_key.to_s
255
+ end
256
+
257
+ # Get property config with resolved default
258
+ def property_config(cornerstone, property)
259
+ prop = CORNERSTONES.dig(cornerstone, :properties, property)
260
+ return nil unless prop
261
+
262
+ type_config = PROPERTY_TYPES[prop[:type]] || {}
263
+ resolved = type_config.merge(prop)
264
+ resolved[:resolved_default] = resolve_default(prop[:default])
265
+ resolved
266
+ end
267
+
268
+ # Full config for JS configurator
269
+ def to_js_config
270
+ config = {}
271
+ CORNERSTONES.each do |key, cornerstone|
272
+ config[key] = {
273
+ label: cornerstone[:label],
274
+ properties: {}
275
+ }
276
+ cornerstone[:properties].each do |prop_key, prop|
277
+ type_config = PROPERTY_TYPES[prop[:type]] || {}
278
+ config[key][:properties][prop_key] = type_config
279
+ .merge(prop)
280
+ .merge(resolved_default: resolve_default(prop[:default]))
281
+ end
282
+ end
283
+ config.to_json
284
+ end
285
+
286
+ # Generate CSS with defaults
287
+ def to_default_css
288
+ lines = [":root {"]
289
+ CORNERSTONES.each_value do |cornerstone|
290
+ cornerstone[:properties].each_value do |prop|
291
+ value = resolve_default(prop[:default])
292
+ lines << " #{prop[:var]}: #{value};"
293
+ end
294
+ end
295
+ lines << "}"
296
+ lines.join("\n")
297
+ end
298
+ end
299
+
300
+ # ═══════════════════════════════════════════════════════════════════════════
301
+ # INSTANCE METHODS (for runtime theming)
302
+ # ═══════════════════════════════════════════════════════════════════════════
303
+
304
+ def initialize
305
+ @values = {}
306
+ end
307
+
308
+ def set(var_name, value)
309
+ @values[var_name] = value
310
+ end
311
+
312
+ def to_css
313
+ return "" if @values.empty?
314
+
315
+ vars = @values.map { |k, v| " #{k}: #{v};" }.join("\n")
316
+ ":root {\n#{vars}\n}"
317
+ end
318
+
319
+ def to_style_tag
320
+ css = to_css
321
+ return "" if css.empty?
322
+
323
+ "<style>#{css}</style>".html_safe
324
+ end
325
+ end
326
+ end
data/lib/aeros/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Aeros
2
- VERSION = "0.0.1"
2
+ VERSION = "0.0.2"
3
3
  end
data/lib/aeros.rb CHANGED
@@ -1,6 +1,8 @@
1
1
  require "aeros/version"
2
2
  require "aeros/engine"
3
3
  require "aeros/engine_helpers"
4
+ require "aeros/theme"
5
+ require "aeros/configuration"
4
6
 
5
7
  module Aeros
6
8
  class << self
@@ -1,18 +1,36 @@
1
1
  # desc "Explaining what the task does"
2
2
  namespace :aeros do
3
- desc "run tailwind"
4
- task :tailwind_engine_watch do
3
+ desc "build tailwind css once"
4
+ task tailwind_build: :environment do
5
+ require "tailwindcss-rails"
6
+
7
+ command = [
8
+ Tailwindcss::Commands.compile_command.first,
9
+ "-i", Aeros::Engine.root.join("app/assets/stylesheets/aeros/application.tailwind.css").to_s,
10
+ "-o", Aeros::Engine.root.join("app/assets/stylesheets/aeros/tailwind.css").to_s
11
+ ]
12
+
13
+ puts "Building Tailwind CSS..."
14
+ puts "Input: #{Aeros::Engine.root.join("app/assets/stylesheets/aeros/application.tailwind.css")}"
15
+ puts "Output: #{Aeros::Engine.root.join("app/assets/stylesheets/aeros/tailwind.css")}"
16
+ puts "Command: #{command.join(' ')}"
17
+ puts ""
18
+
19
+ system(*command)
20
+
21
+ puts ""
22
+ puts "Build complete!"
23
+ end
24
+
25
+ desc "run tailwind in watch mode"
26
+ task tailwind_engine_watch: :environment do
5
27
  require "tailwindcss-rails"
6
28
 
7
29
  command = [
8
30
  Tailwindcss::Commands.compile_command.first,
9
31
  "-i", Aeros::Engine.root.join("app/assets/stylesheets/aeros/application.tailwind.css").to_s,
10
32
  "-o", Aeros::Engine.root.join("app/assets/stylesheets/aeros/tailwind.css").to_s,
11
- "-w",
12
- "--content", [
13
- Aeros::Engine.root.join("app/components/**/*.rb").to_s,
14
- Aeros::Engine.root.join("app/components/**/*.erb").to_s
15
- ].join(",")
33
+ "-w"
16
34
  ]
17
35
 
18
36
  p command
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: aeros
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ben
@@ -66,61 +66,61 @@ dependencies:
66
66
  - !ruby/object:Gem::Version
67
67
  version: '1.3'
68
68
  - !ruby/object:Gem::Dependency
69
- name: tailwindcss-rails
69
+ name: view_component
70
70
  requirement: !ruby/object:Gem::Requirement
71
71
  requirements:
72
72
  - - "~>"
73
73
  - !ruby/object:Gem::Version
74
- version: 4.3.0
74
+ version: '4.0'
75
75
  type: :runtime
76
76
  prerelease: false
77
77
  version_requirements: !ruby/object:Gem::Requirement
78
78
  requirements:
79
79
  - - "~>"
80
80
  - !ruby/object:Gem::Version
81
- version: 4.3.0
81
+ version: '4.0'
82
82
  - !ruby/object:Gem::Dependency
83
- name: view_component
83
+ name: view_component-contrib
84
84
  requirement: !ruby/object:Gem::Requirement
85
85
  requirements:
86
86
  - - "~>"
87
87
  - !ruby/object:Gem::Version
88
- version: '4.0'
88
+ version: 0.2.5
89
89
  type: :runtime
90
90
  prerelease: false
91
91
  version_requirements: !ruby/object:Gem::Requirement
92
92
  requirements:
93
93
  - - "~>"
94
94
  - !ruby/object:Gem::Version
95
- version: '4.0'
95
+ version: 0.2.5
96
96
  - !ruby/object:Gem::Dependency
97
- name: view_component-contrib
97
+ name: dry-effects
98
98
  requirement: !ruby/object:Gem::Requirement
99
99
  requirements:
100
100
  - - "~>"
101
101
  - !ruby/object:Gem::Version
102
- version: 0.2.5
102
+ version: 0.5.0
103
103
  type: :runtime
104
104
  prerelease: false
105
105
  version_requirements: !ruby/object:Gem::Requirement
106
106
  requirements:
107
107
  - - "~>"
108
108
  - !ruby/object:Gem::Version
109
- version: 0.2.5
109
+ version: 0.5.0
110
110
  - !ruby/object:Gem::Dependency
111
- name: dry-effects
111
+ name: lucide-rails
112
112
  requirement: !ruby/object:Gem::Requirement
113
113
  requirements:
114
114
  - - "~>"
115
115
  - !ruby/object:Gem::Version
116
- version: 0.5.0
116
+ version: '0.3'
117
117
  type: :runtime
118
118
  prerelease: false
119
119
  version_requirements: !ruby/object:Gem::Requirement
120
120
  requirements:
121
121
  - - "~>"
122
122
  - !ruby/object:Gem::Version
123
- version: 0.5.0
123
+ version: '0.3'
124
124
  - !ruby/object:Gem::Dependency
125
125
  name: tailwind_merge
126
126
  requirement: !ruby/object:Gem::Requirement
@@ -148,34 +148,122 @@ files:
148
148
  - README.md
149
149
  - Rakefile
150
150
  - app/assets/stylesheets/aeros/application.css
151
- - app/assets/stylesheets/aeros/application.tailwind.css
152
- - app/assets/stylesheets/aeros/tailwind.css
151
+ - app/assets/stylesheets/aeros/base.css
152
+ - app/assets/stylesheets/aeros/reset.css
153
+ - app/assets/stylesheets/aeros/source.css
154
+ - app/assets/stylesheets/aeros/theme.css
155
+ - app/assets/stylesheets/aeros/themes/slate.css
156
+ - app/assets/stylesheets/aeros/themes/zinc.css
157
+ - app/assets/stylesheets/aeros/utilities.css
153
158
  - app/components/aeros/application_view_component.rb
154
- - app/components/aeros/button/component.rb
155
- - app/components/aeros/button/controller.js
156
- - app/components/aeros/card/component.html.erb
157
- - app/components/aeros/card/component.rb
158
- - app/components/aeros/dropdown/component.html.erb
159
- - app/components/aeros/dropdown/component.rb
160
- - app/components/aeros/empty/component.html.erb
161
- - app/components/aeros/empty/component.rb
159
+ - app/components/aeros/blocks/component_preview/component.html.erb
160
+ - app/components/aeros/blocks/component_preview/component.rb
161
+ - app/components/aeros/blocks/component_preview/styles.css
162
162
  - app/components/aeros/form_builder.rb
163
- - app/components/aeros/input_password/component.html.erb
164
- - app/components/aeros/input_password/component.rb
165
- - app/components/aeros/input_password/controller.js
166
- - app/components/aeros/input_select/component.html.erb
167
- - app/components/aeros/input_select/component.rb
168
- - app/components/aeros/input_text/component.html.erb
169
- - app/components/aeros/input_text/component.rb
170
- - app/components/aeros/input_wrapper/component.html.erb
171
- - app/components/aeros/input_wrapper/component.rb
172
- - app/components/aeros/page/component.html.erb
173
- - app/components/aeros/page/component.rb
174
- - app/components/aeros/spinner/component.rb
175
- - app/components/aeros/table/component.html.erb
176
- - app/components/aeros/table/component.rb
163
+ - app/components/aeros/pages/showcase/index/component.html.erb
164
+ - app/components/aeros/pages/showcase/index/component.rb
165
+ - app/components/aeros/pages/showcase/index/styles.css
166
+ - app/components/aeros/pages/showcase/placeholder/component.html.erb
167
+ - app/components/aeros/pages/showcase/placeholder/component.rb
168
+ - app/components/aeros/pages/showcase/show/component.html.erb
169
+ - app/components/aeros/pages/showcase/show/component.rb
170
+ - app/components/aeros/primitives/button/component.rb
171
+ - app/components/aeros/primitives/button/controller.js
172
+ - app/components/aeros/primitives/button/styles.css
173
+ - app/components/aeros/primitives/card/component.html.erb
174
+ - app/components/aeros/primitives/card/component.rb
175
+ - app/components/aeros/primitives/card/styles.css
176
+ - app/components/aeros/primitives/conversation/component.html.erb
177
+ - app/components/aeros/primitives/conversation/component.rb
178
+ - app/components/aeros/primitives/conversation/controller.js
179
+ - app/components/aeros/primitives/conversation/message/component.html.erb
180
+ - app/components/aeros/primitives/conversation/message/component.rb
181
+ - app/components/aeros/primitives/conversation/streaming_indicator/component.html.erb
182
+ - app/components/aeros/primitives/conversation/streaming_indicator/component.rb
183
+ - app/components/aeros/primitives/conversation/styles.css
184
+ - app/components/aeros/primitives/conversation/user_message_box/component.html.erb
185
+ - app/components/aeros/primitives/conversation/user_message_box/component.rb
186
+ - app/components/aeros/primitives/drawer/component.html.erb
187
+ - app/components/aeros/primitives/drawer/component.rb
188
+ - app/components/aeros/primitives/drawer/controller.js
189
+ - app/components/aeros/primitives/drawer/styles.css
190
+ - app/components/aeros/primitives/dropdown/checkbox.rb
191
+ - app/components/aeros/primitives/dropdown/component.html.erb
192
+ - app/components/aeros/primitives/dropdown/component.rb
193
+ - app/components/aeros/primitives/dropdown/controller.js
194
+ - app/components/aeros/primitives/dropdown/item.rb
195
+ - app/components/aeros/primitives/dropdown/label.rb
196
+ - app/components/aeros/primitives/dropdown/radio_group.rb
197
+ - app/components/aeros/primitives/dropdown/radio_item.rb
198
+ - app/components/aeros/primitives/dropdown/separator.rb
199
+ - app/components/aeros/primitives/dropdown/styles.css
200
+ - app/components/aeros/primitives/empty/component.html.erb
201
+ - app/components/aeros/primitives/empty/component.rb
202
+ - app/components/aeros/primitives/empty/styles.css
203
+ - app/components/aeros/primitives/input_attachments/component.html.erb
204
+ - app/components/aeros/primitives/input_attachments/component.rb
205
+ - app/components/aeros/primitives/input_attachments/controller.js
206
+ - app/components/aeros/primitives/input_attachments/styles.css
207
+ - app/components/aeros/primitives/input_color/component.html.erb
208
+ - app/components/aeros/primitives/input_color/component.rb
209
+ - app/components/aeros/primitives/input_color/styles.css
210
+ - app/components/aeros/primitives/input_password/component.html.erb
211
+ - app/components/aeros/primitives/input_password/component.rb
212
+ - app/components/aeros/primitives/input_password/controller.js
213
+ - app/components/aeros/primitives/input_password/styles.css
214
+ - app/components/aeros/primitives/input_select/component.html.erb
215
+ - app/components/aeros/primitives/input_select/component.rb
216
+ - app/components/aeros/primitives/input_select/option.rb
217
+ - app/components/aeros/primitives/input_select/styles.css
218
+ - app/components/aeros/primitives/input_slider/component.html.erb
219
+ - app/components/aeros/primitives/input_slider/component.rb
220
+ - app/components/aeros/primitives/input_slider/styles.css
221
+ - app/components/aeros/primitives/input_tagging/component.html.erb
222
+ - app/components/aeros/primitives/input_tagging/component.rb
223
+ - app/components/aeros/primitives/input_tagging/controller.js
224
+ - app/components/aeros/primitives/input_tagging/styles.css
225
+ - app/components/aeros/primitives/input_text/component.html.erb
226
+ - app/components/aeros/primitives/input_text/component.rb
227
+ - app/components/aeros/primitives/input_text/styles.css
228
+ - app/components/aeros/primitives/input_text_area/component.html.erb
229
+ - app/components/aeros/primitives/input_text_area/component.rb
230
+ - app/components/aeros/primitives/input_text_area/styles.css
231
+ - app/components/aeros/primitives/input_text_area_ai/component.html.erb
232
+ - app/components/aeros/primitives/input_text_area_ai/component.rb
233
+ - app/components/aeros/primitives/input_text_area_ai/controller.js
234
+ - app/components/aeros/primitives/input_text_area_ai/styles.css
235
+ - app/components/aeros/primitives/input_wrapper/component.html.erb
236
+ - app/components/aeros/primitives/input_wrapper/component.rb
237
+ - app/components/aeros/primitives/input_wrapper/styles.css
238
+ - app/components/aeros/primitives/layouts/agentic/component.html.erb
239
+ - app/components/aeros/primitives/layouts/agentic/component.rb
240
+ - app/components/aeros/primitives/layouts/app/aside.rb
241
+ - app/components/aeros/primitives/layouts/app/component.html.erb
242
+ - app/components/aeros/primitives/layouts/app/component.rb
243
+ - app/components/aeros/primitives/layouts/app/sidebar.rb
244
+ - app/components/aeros/primitives/layouts/app/styles.css
245
+ - app/components/aeros/primitives/page/component.html.erb
246
+ - app/components/aeros/primitives/page/component.rb
247
+ - app/components/aeros/primitives/page/styles.css
248
+ - app/components/aeros/primitives/sidebar/component.html.erb
249
+ - app/components/aeros/primitives/sidebar/component.rb
250
+ - app/components/aeros/primitives/sidebar/footer.rb
251
+ - app/components/aeros/primitives/sidebar/group.rb
252
+ - app/components/aeros/primitives/sidebar/header.rb
253
+ - app/components/aeros/primitives/sidebar/item.rb
254
+ - app/components/aeros/primitives/sidebar/styles.css
255
+ - app/components/aeros/primitives/spinner/component.rb
256
+ - app/components/aeros/primitives/spinner/styles.css
257
+ - app/components/aeros/primitives/table/cell.rb
258
+ - app/components/aeros/primitives/table/column.rb
259
+ - app/components/aeros/primitives/table/component.html.erb
260
+ - app/components/aeros/primitives/table/component.rb
261
+ - app/components/aeros/primitives/table/header.rb
262
+ - app/components/aeros/primitives/table/row.rb
263
+ - app/components/aeros/primitives/table/styles.css
177
264
  - app/controllers/aeros/application_controller.rb
178
265
  - app/controllers/aeros/showcase_controller.rb
266
+ - app/controllers/aeros/theme_controller.rb
179
267
  - app/helpers/aeros/application_helper.rb
180
268
  - app/javascript/aeros/application.js
181
269
  - app/javascript/aeros/controllers/application.js
@@ -183,13 +271,14 @@ files:
183
271
  - app/javascript/aeros/controllers/loader.js
184
272
  - app/jobs/aeros/application_job.rb
185
273
  - app/models/aeros/application_record.rb
186
- - app/views/aeros/showcase/index.html.erb
187
274
  - app/views/layouts/aeros/application.html.erb
188
275
  - config/importmap.rb
189
276
  - config/routes.rb
190
277
  - lib/aeros.rb
278
+ - lib/aeros/configuration.rb
191
279
  - lib/aeros/engine.rb
192
280
  - lib/aeros/engine_helpers.rb
281
+ - lib/aeros/theme.rb
193
282
  - lib/aeros/version.rb
194
283
  - lib/tasks/aeros_tasks.rake
195
284
  homepage: https://github.com/getnvoi/ui
@@ -1,7 +0,0 @@
1
- @import "tailwindcss";
2
-
3
- @layer base {
4
- html {
5
- @apply text-stone-700;
6
- }
7
- }