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.
- checksums.yaml +4 -4
- data/Rakefile +1 -1
- data/app/assets/stylesheets/aeros/application.css +1 -15
- data/app/assets/stylesheets/aeros/base.css +43 -0
- data/app/assets/stylesheets/aeros/reset.css +397 -0
- data/app/assets/stylesheets/aeros/source.css +15 -0
- data/app/assets/stylesheets/aeros/theme.css +6 -0
- data/app/assets/stylesheets/aeros/themes/slate.css +163 -0
- data/app/assets/stylesheets/aeros/themes/zinc.css +163 -0
- data/app/assets/stylesheets/aeros/utilities.css +23 -0
- data/app/components/aeros/application_view_component.rb +149 -5
- data/app/components/aeros/blocks/component_preview/component.html.erb +7 -0
- data/app/components/aeros/blocks/component_preview/component.rb +10 -0
- data/app/components/aeros/blocks/component_preview/styles.css +10 -0
- data/app/components/aeros/form_builder.rb +24 -8
- data/app/components/aeros/pages/showcase/index/component.html.erb +53 -0
- data/app/components/aeros/pages/showcase/index/component.rb +7 -0
- data/app/components/aeros/pages/showcase/index/styles.css +27 -0
- data/app/components/aeros/pages/showcase/placeholder/component.html.erb +7 -0
- data/app/components/aeros/pages/showcase/placeholder/component.rb +10 -0
- data/app/components/aeros/pages/showcase/show/component.html.erb +38 -0
- data/app/components/aeros/pages/showcase/show/component.rb +48 -0
- data/app/components/aeros/primitives/button/component.rb +66 -0
- data/app/components/aeros/primitives/button/styles.css +153 -0
- data/app/components/aeros/primitives/card/component.html.erb +3 -0
- data/app/components/aeros/primitives/card/component.rb +42 -0
- data/app/components/aeros/primitives/card/styles.css +28 -0
- data/app/components/aeros/primitives/conversation/component.html.erb +28 -0
- data/app/components/aeros/primitives/conversation/component.rb +15 -0
- data/app/components/aeros/primitives/conversation/controller.js +18 -0
- data/app/components/aeros/primitives/conversation/message/component.html.erb +24 -0
- data/app/components/aeros/primitives/conversation/message/component.rb +35 -0
- data/app/components/aeros/primitives/conversation/streaming_indicator/component.html.erb +21 -0
- data/app/components/aeros/primitives/conversation/streaming_indicator/component.rb +18 -0
- data/app/components/aeros/primitives/conversation/styles.css +221 -0
- data/app/components/aeros/primitives/conversation/user_message_box/component.html.erb +1 -0
- data/app/components/aeros/{empty → primitives/conversation/user_message_box}/component.rb +1 -2
- data/app/components/aeros/primitives/drawer/component.html.erb +43 -0
- data/app/components/aeros/primitives/drawer/component.rb +33 -0
- data/app/components/aeros/primitives/drawer/controller.js +104 -0
- data/app/components/aeros/primitives/drawer/styles.css +90 -0
- data/app/components/aeros/primitives/dropdown/checkbox.rb +22 -0
- data/app/components/aeros/primitives/dropdown/component.html.erb +38 -0
- data/app/components/aeros/primitives/dropdown/component.rb +53 -0
- data/app/components/aeros/primitives/dropdown/controller.js +153 -0
- data/app/components/aeros/primitives/dropdown/item.rb +29 -0
- data/app/components/aeros/primitives/dropdown/label.rb +7 -0
- data/app/components/aeros/primitives/dropdown/radio_group.rb +16 -0
- data/app/components/aeros/primitives/dropdown/radio_item.rb +24 -0
- data/app/components/aeros/primitives/dropdown/separator.rb +7 -0
- data/app/components/aeros/primitives/dropdown/styles.css +155 -0
- data/app/components/aeros/primitives/empty/component.html.erb +15 -0
- data/app/components/aeros/primitives/empty/component.rb +18 -0
- data/app/components/aeros/primitives/empty/styles.css +40 -0
- data/app/components/aeros/primitives/input_attachments/component.html.erb +60 -0
- data/app/components/aeros/primitives/input_attachments/component.rb +52 -0
- data/app/components/aeros/primitives/input_attachments/controller.js +357 -0
- data/app/components/aeros/primitives/input_attachments/styles.css +102 -0
- data/app/components/aeros/primitives/input_color/component.html.erb +24 -0
- data/app/components/aeros/primitives/input_color/component.rb +42 -0
- data/app/components/aeros/primitives/input_color/styles.css +64 -0
- data/app/components/aeros/primitives/input_password/component.html.erb +43 -0
- data/app/components/aeros/primitives/input_password/component.rb +20 -0
- data/app/components/aeros/primitives/input_password/styles.css +61 -0
- data/app/components/aeros/{input_select → primitives/input_select}/component.html.erb +19 -19
- data/app/components/aeros/primitives/input_select/component.rb +21 -0
- data/app/components/aeros/primitives/input_select/option.rb +14 -0
- data/app/components/aeros/primitives/input_select/styles.css +30 -0
- data/app/components/aeros/primitives/input_slider/component.html.erb +33 -0
- data/app/components/aeros/primitives/input_slider/component.rb +35 -0
- data/app/components/aeros/primitives/input_slider/styles.css +74 -0
- data/app/components/aeros/primitives/input_tagging/component.html.erb +73 -0
- data/app/components/aeros/primitives/input_tagging/component.rb +40 -0
- data/app/components/aeros/primitives/input_tagging/controller.js +326 -0
- data/app/components/aeros/primitives/input_tagging/styles.css +148 -0
- data/app/components/aeros/primitives/input_text/component.html.erb +25 -0
- data/app/components/aeros/primitives/input_text/component.rb +20 -0
- data/app/components/aeros/primitives/input_text/styles.css +38 -0
- data/app/components/aeros/primitives/input_text_area/component.html.erb +23 -0
- data/app/components/aeros/primitives/input_text_area/component.rb +19 -0
- data/app/components/aeros/primitives/input_text_area/styles.css +30 -0
- data/app/components/aeros/primitives/input_text_area_ai/component.html.erb +51 -0
- data/app/components/aeros/primitives/input_text_area_ai/component.rb +47 -0
- data/app/components/aeros/primitives/input_text_area_ai/controller.js +198 -0
- data/app/components/aeros/primitives/input_text_area_ai/styles.css +91 -0
- data/app/components/aeros/primitives/input_wrapper/component.html.erb +20 -0
- data/app/components/aeros/primitives/input_wrapper/component.rb +31 -0
- data/app/components/aeros/primitives/input_wrapper/styles.css +72 -0
- data/app/components/aeros/primitives/layouts/agentic/component.html.erb +4 -0
- data/app/components/aeros/primitives/layouts/agentic/component.rb +23 -0
- data/app/components/aeros/primitives/layouts/app/aside.rb +9 -0
- data/app/components/aeros/primitives/layouts/app/component.html.erb +14 -0
- data/app/components/aeros/primitives/layouts/app/component.rb +11 -0
- data/app/components/aeros/primitives/layouts/app/sidebar.rb +9 -0
- data/app/components/aeros/primitives/layouts/app/styles.css +46 -0
- data/app/components/aeros/primitives/page/component.html.erb +24 -0
- data/app/components/aeros/primitives/page/component.rb +23 -0
- data/app/components/aeros/primitives/page/styles.css +55 -0
- data/app/components/aeros/primitives/sidebar/component.html.erb +25 -0
- data/app/components/aeros/primitives/sidebar/component.rb +14 -0
- data/app/components/aeros/primitives/sidebar/footer.rb +7 -0
- data/app/components/aeros/primitives/sidebar/group.rb +18 -0
- data/app/components/aeros/primitives/sidebar/header.rb +7 -0
- data/app/components/aeros/primitives/sidebar/item.rb +19 -0
- data/app/components/aeros/primitives/sidebar/styles.css +95 -0
- data/app/components/aeros/primitives/spinner/component.rb +36 -0
- data/app/components/aeros/primitives/spinner/styles.css +81 -0
- data/app/components/aeros/primitives/table/cell.rb +7 -0
- data/app/components/aeros/primitives/table/column.rb +7 -0
- data/app/components/aeros/primitives/table/component.html.erb +8 -0
- data/app/components/aeros/primitives/table/component.rb +14 -0
- data/app/components/aeros/primitives/table/header.rb +13 -0
- data/app/components/aeros/primitives/table/row.rb +11 -0
- data/app/components/aeros/primitives/table/styles.css +39 -0
- data/app/controllers/aeros/application_controller.rb +11 -0
- data/app/controllers/aeros/showcase_controller.rb +37 -1
- data/app/controllers/aeros/theme_controller.rb +10 -0
- data/app/helpers/aeros/application_helper.rb +19 -7
- data/app/views/layouts/aeros/application.html.erb +49 -14
- data/config/importmap.rb +6 -1
- data/config/routes.rb +2 -0
- data/lib/aeros/configuration.rb +56 -0
- data/lib/aeros/engine.rb +7 -1
- data/lib/aeros/theme.rb +326 -0
- data/lib/aeros/version.rb +1 -1
- data/lib/aeros.rb +2 -0
- data/lib/tasks/aeros_tasks.rake +25 -7
- metadata +127 -38
- data/app/assets/stylesheets/aeros/application.tailwind.css +0 -7
- data/app/assets/stylesheets/aeros/tailwind.css +0 -1100
- data/app/components/aeros/button/component.rb +0 -128
- data/app/components/aeros/card/component.html.erb +0 -3
- data/app/components/aeros/card/component.rb +0 -7
- data/app/components/aeros/dropdown/component.html.erb +0 -26
- data/app/components/aeros/dropdown/component.rb +0 -66
- data/app/components/aeros/empty/component.html.erb +0 -12
- data/app/components/aeros/input_password/component.html.erb +0 -43
- data/app/components/aeros/input_password/component.rb +0 -6
- data/app/components/aeros/input_select/component.rb +0 -24
- data/app/components/aeros/input_text/component.html.erb +0 -25
- data/app/components/aeros/input_text/component.rb +0 -5
- data/app/components/aeros/input_wrapper/component.html.erb +0 -20
- data/app/components/aeros/input_wrapper/component.rb +0 -12
- data/app/components/aeros/page/component.html.erb +0 -24
- data/app/components/aeros/page/component.rb +0 -9
- data/app/components/aeros/spinner/component.rb +0 -55
- data/app/components/aeros/table/component.html.erb +0 -10
- data/app/components/aeros/table/component.rb +0 -64
- data/app/views/aeros/showcase/index.html.erb +0 -1
- /data/app/components/aeros/{button → primitives/button}/controller.js +0 -0
- /data/app/components/aeros/{input_password → primitives/input_password}/controller.js +0 -0
|
@@ -0,0 +1,163 @@
|
|
|
1
|
+
/* =============================================================================
|
|
2
|
+
Theme: Slate
|
|
3
|
+
============================================================================= */
|
|
4
|
+
|
|
5
|
+
[data-theme="slate"] {
|
|
6
|
+
/* Background & Foreground */
|
|
7
|
+
--ui-background: #ffffff;
|
|
8
|
+
--ui-foreground: #0f172a;
|
|
9
|
+
|
|
10
|
+
/* Generic */
|
|
11
|
+
--ui-border: #e2e8f0;
|
|
12
|
+
--ui-destructive: #dc2626;
|
|
13
|
+
--ui-primary: #0f172a;
|
|
14
|
+
--ui-accent: #f1f5f9;
|
|
15
|
+
--ui-accent-foreground: #0f172a;
|
|
16
|
+
--ui-popover: #ffffff;
|
|
17
|
+
--ui-shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1);
|
|
18
|
+
--ui-shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1);
|
|
19
|
+
|
|
20
|
+
/* Muted */
|
|
21
|
+
--ui-muted: #f1f5f9;
|
|
22
|
+
--ui-muted-foreground: #64748b;
|
|
23
|
+
|
|
24
|
+
/* Card */
|
|
25
|
+
--ui-card-bg: #ffffff;
|
|
26
|
+
--ui-card-fg: #0f172a;
|
|
27
|
+
--ui-card-border: #e2e8f0;
|
|
28
|
+
--ui-card-radius: 0.75rem;
|
|
29
|
+
--ui-card-shadow: 0 1px 2px 0 rgb(0 0 0 / 0.05);
|
|
30
|
+
|
|
31
|
+
/* Area */
|
|
32
|
+
--ui-area-bg: #f8fafc;
|
|
33
|
+
--ui-area-fg: #0f172a;
|
|
34
|
+
--ui-area-border: #e2e8f0;
|
|
35
|
+
|
|
36
|
+
/* Sidebar */
|
|
37
|
+
--ui-sidebar-bg: #f8fafc;
|
|
38
|
+
--ui-sidebar-fg: #0f172a;
|
|
39
|
+
--ui-sidebar-border: #e2e8f0;
|
|
40
|
+
--ui-sidebar-hover: #f1f5f9;
|
|
41
|
+
--ui-sidebar-active: #e2e8f0;
|
|
42
|
+
|
|
43
|
+
/* Button */
|
|
44
|
+
--ui-button-bg: #0f172a;
|
|
45
|
+
--ui-button-bg-hover: #1e293b;
|
|
46
|
+
--ui-button-fg: #ffffff;
|
|
47
|
+
--ui-button-border: #0f172a;
|
|
48
|
+
--ui-button-secondary-bg: #f1f5f9;
|
|
49
|
+
--ui-button-secondary-bg-hover: #e2e8f0;
|
|
50
|
+
--ui-button-secondary-fg: #0f172a;
|
|
51
|
+
--ui-button-destructive-bg: #dc2626;
|
|
52
|
+
--ui-button-destructive-bg-hover: #b91c1c;
|
|
53
|
+
--ui-button-destructive-fg: #ffffff;
|
|
54
|
+
--ui-button-ghost-bg-hover: #f1f5f9;
|
|
55
|
+
--ui-button-ghost-fg: #0f172a;
|
|
56
|
+
--ui-button-outline-bg-hover: #f1f5f9;
|
|
57
|
+
--ui-button-outline-fg: #0f172a;
|
|
58
|
+
|
|
59
|
+
/* Input */
|
|
60
|
+
--ui-input-bg: #ffffff;
|
|
61
|
+
--ui-input-fg: #0f172a;
|
|
62
|
+
--ui-input-border: #e2e8f0;
|
|
63
|
+
--ui-input-border-focus: #94a3b8;
|
|
64
|
+
--ui-input-ring: #3b82f6;
|
|
65
|
+
--ui-input-placeholder: #94a3b8;
|
|
66
|
+
|
|
67
|
+
/* Typography */
|
|
68
|
+
--ui-heading-color: #0f172a;
|
|
69
|
+
--ui-body-color: #334155;
|
|
70
|
+
--ui-muted-color: #64748b;
|
|
71
|
+
--ui-link-color: #2563eb;
|
|
72
|
+
--ui-link-hover: #1d4ed8;
|
|
73
|
+
--ui-ring: #3b82f6;
|
|
74
|
+
|
|
75
|
+
/* Menu */
|
|
76
|
+
--ui-menu-bg: #ffffff;
|
|
77
|
+
--ui-menu-fg: #0f172a;
|
|
78
|
+
--ui-menu-border: #e2e8f0;
|
|
79
|
+
--ui-menu-radius: 0.375rem;
|
|
80
|
+
--ui-menu-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.1);
|
|
81
|
+
--ui-menu-padding: 0.25rem;
|
|
82
|
+
--ui-menu-item-radius: 0.25rem;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
/* Dark mode */
|
|
86
|
+
[data-theme="slate"][data-mode="dark"] {
|
|
87
|
+
/* Background & Foreground */
|
|
88
|
+
--ui-background: #0f172a;
|
|
89
|
+
--ui-foreground: #f8fafc;
|
|
90
|
+
|
|
91
|
+
/* Generic */
|
|
92
|
+
--ui-border: #334155;
|
|
93
|
+
--ui-destructive: #dc2626;
|
|
94
|
+
--ui-primary: #f8fafc;
|
|
95
|
+
--ui-accent: #1e293b;
|
|
96
|
+
--ui-accent-foreground: #f8fafc;
|
|
97
|
+
--ui-popover: #1e293b;
|
|
98
|
+
--ui-shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.3);
|
|
99
|
+
--ui-shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.3);
|
|
100
|
+
|
|
101
|
+
/* Muted */
|
|
102
|
+
--ui-muted: #1e293b;
|
|
103
|
+
--ui-muted-foreground: #94a3b8;
|
|
104
|
+
|
|
105
|
+
/* Card */
|
|
106
|
+
--ui-card-bg: #1e293b;
|
|
107
|
+
--ui-card-fg: #f8fafc;
|
|
108
|
+
--ui-card-border: #334155;
|
|
109
|
+
--ui-card-shadow: 0 1px 2px 0 rgb(0 0 0 / 0.3);
|
|
110
|
+
|
|
111
|
+
/* Area */
|
|
112
|
+
--ui-area-bg: #1e293b;
|
|
113
|
+
--ui-area-fg: #f8fafc;
|
|
114
|
+
--ui-area-border: #334155;
|
|
115
|
+
|
|
116
|
+
/* Sidebar */
|
|
117
|
+
--ui-sidebar-bg: #1e293b;
|
|
118
|
+
--ui-sidebar-fg: #f8fafc;
|
|
119
|
+
--ui-sidebar-border: #334155;
|
|
120
|
+
--ui-sidebar-hover: #334155;
|
|
121
|
+
--ui-sidebar-active: #475569;
|
|
122
|
+
|
|
123
|
+
/* Button */
|
|
124
|
+
--ui-button-bg: #f8fafc;
|
|
125
|
+
--ui-button-bg-hover: #e2e8f0;
|
|
126
|
+
--ui-button-fg: #0f172a;
|
|
127
|
+
--ui-button-border: #f8fafc;
|
|
128
|
+
--ui-button-secondary-bg: #334155;
|
|
129
|
+
--ui-button-secondary-bg-hover: #475569;
|
|
130
|
+
--ui-button-secondary-fg: #f8fafc;
|
|
131
|
+
--ui-button-destructive-bg: #dc2626;
|
|
132
|
+
--ui-button-destructive-bg-hover: #ef4444;
|
|
133
|
+
--ui-button-destructive-fg: #ffffff;
|
|
134
|
+
--ui-button-ghost-bg-hover: #334155;
|
|
135
|
+
--ui-button-ghost-fg: #f8fafc;
|
|
136
|
+
--ui-button-outline-bg-hover: #334155;
|
|
137
|
+
--ui-button-outline-fg: #f8fafc;
|
|
138
|
+
|
|
139
|
+
/* Input */
|
|
140
|
+
--ui-input-bg: #1e293b;
|
|
141
|
+
--ui-input-fg: #f8fafc;
|
|
142
|
+
--ui-input-border: #334155;
|
|
143
|
+
--ui-input-border-focus: #64748b;
|
|
144
|
+
--ui-input-ring: #3b82f6;
|
|
145
|
+
--ui-input-placeholder: #64748b;
|
|
146
|
+
|
|
147
|
+
/* Typography */
|
|
148
|
+
--ui-heading-color: #f8fafc;
|
|
149
|
+
--ui-body-color: #cbd5e1;
|
|
150
|
+
--ui-muted-color: #94a3b8;
|
|
151
|
+
--ui-link-color: #60a5fa;
|
|
152
|
+
--ui-link-hover: #93c5fd;
|
|
153
|
+
--ui-ring: #3b82f6;
|
|
154
|
+
|
|
155
|
+
/* Menu */
|
|
156
|
+
--ui-menu-bg: #1e293b;
|
|
157
|
+
--ui-menu-fg: #f8fafc;
|
|
158
|
+
--ui-menu-border: #334155;
|
|
159
|
+
--ui-menu-radius: 0.375rem;
|
|
160
|
+
--ui-menu-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.3);
|
|
161
|
+
--ui-menu-padding: 0.25rem;
|
|
162
|
+
--ui-menu-item-radius: 0.25rem;
|
|
163
|
+
}
|
|
@@ -0,0 +1,163 @@
|
|
|
1
|
+
/* =============================================================================
|
|
2
|
+
Theme: Zinc
|
|
3
|
+
============================================================================= */
|
|
4
|
+
|
|
5
|
+
[data-theme="zinc"] {
|
|
6
|
+
/* Background & Foreground */
|
|
7
|
+
--ui-background: #ffffff;
|
|
8
|
+
--ui-foreground: #18181b;
|
|
9
|
+
|
|
10
|
+
/* Generic */
|
|
11
|
+
--ui-border: #e4e4e7;
|
|
12
|
+
--ui-destructive: #dc2626;
|
|
13
|
+
--ui-primary: #18181b;
|
|
14
|
+
--ui-accent: #f4f4f5;
|
|
15
|
+
--ui-accent-foreground: #18181b;
|
|
16
|
+
--ui-popover: #ffffff;
|
|
17
|
+
--ui-shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1);
|
|
18
|
+
--ui-shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1);
|
|
19
|
+
|
|
20
|
+
/* Muted */
|
|
21
|
+
--ui-muted: #f4f4f5;
|
|
22
|
+
--ui-muted-foreground: #71717a;
|
|
23
|
+
|
|
24
|
+
/* Card */
|
|
25
|
+
--ui-card-bg: #ffffff;
|
|
26
|
+
--ui-card-fg: #18181b;
|
|
27
|
+
--ui-card-border: #e4e4e7;
|
|
28
|
+
--ui-card-radius: 0.75rem;
|
|
29
|
+
--ui-card-shadow: 0 1px 2px 0 rgb(0 0 0 / 0.05);
|
|
30
|
+
|
|
31
|
+
/* Area */
|
|
32
|
+
--ui-area-bg: #fafafa;
|
|
33
|
+
--ui-area-fg: #18181b;
|
|
34
|
+
--ui-area-border: #e4e4e7;
|
|
35
|
+
|
|
36
|
+
/* Sidebar */
|
|
37
|
+
--ui-sidebar-bg: #fafafa;
|
|
38
|
+
--ui-sidebar-fg: #18181b;
|
|
39
|
+
--ui-sidebar-border: #e4e4e7;
|
|
40
|
+
--ui-sidebar-hover: #f4f4f5;
|
|
41
|
+
--ui-sidebar-active: #e4e4e7;
|
|
42
|
+
|
|
43
|
+
/* Button */
|
|
44
|
+
--ui-button-bg: #18181b;
|
|
45
|
+
--ui-button-bg-hover: #27272a;
|
|
46
|
+
--ui-button-fg: #ffffff;
|
|
47
|
+
--ui-button-border: #18181b;
|
|
48
|
+
--ui-button-secondary-bg: #f4f4f5;
|
|
49
|
+
--ui-button-secondary-bg-hover: #e4e4e7;
|
|
50
|
+
--ui-button-secondary-fg: #18181b;
|
|
51
|
+
--ui-button-destructive-bg: #dc2626;
|
|
52
|
+
--ui-button-destructive-bg-hover: #b91c1c;
|
|
53
|
+
--ui-button-destructive-fg: #ffffff;
|
|
54
|
+
--ui-button-ghost-bg-hover: #f4f4f5;
|
|
55
|
+
--ui-button-ghost-fg: #18181b;
|
|
56
|
+
--ui-button-outline-bg-hover: #f4f4f5;
|
|
57
|
+
--ui-button-outline-fg: #18181b;
|
|
58
|
+
|
|
59
|
+
/* Input */
|
|
60
|
+
--ui-input-bg: #ffffff;
|
|
61
|
+
--ui-input-fg: #18181b;
|
|
62
|
+
--ui-input-border: #e4e4e7;
|
|
63
|
+
--ui-input-border-focus: #a1a1aa;
|
|
64
|
+
--ui-input-ring: #3b82f6;
|
|
65
|
+
--ui-input-placeholder: #a1a1aa;
|
|
66
|
+
|
|
67
|
+
/* Typography */
|
|
68
|
+
--ui-heading-color: #18181b;
|
|
69
|
+
--ui-body-color: #3f3f46;
|
|
70
|
+
--ui-muted-color: #71717a;
|
|
71
|
+
--ui-link-color: #2563eb;
|
|
72
|
+
--ui-link-hover: #1d4ed8;
|
|
73
|
+
--ui-ring: #3b82f6;
|
|
74
|
+
|
|
75
|
+
/* Menu */
|
|
76
|
+
--ui-menu-bg: #ffffff;
|
|
77
|
+
--ui-menu-fg: #18181b;
|
|
78
|
+
--ui-menu-border: #e4e4e7;
|
|
79
|
+
--ui-menu-radius: 0.375rem;
|
|
80
|
+
--ui-menu-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.1);
|
|
81
|
+
--ui-menu-padding: 0.25rem;
|
|
82
|
+
--ui-menu-item-radius: 0.25rem;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
/* Dark mode */
|
|
86
|
+
[data-theme="zinc"][data-mode="dark"] {
|
|
87
|
+
/* Background & Foreground */
|
|
88
|
+
--ui-background: #09090b;
|
|
89
|
+
--ui-foreground: #fafafa;
|
|
90
|
+
|
|
91
|
+
/* Generic */
|
|
92
|
+
--ui-border: #27272a;
|
|
93
|
+
--ui-destructive: #dc2626;
|
|
94
|
+
--ui-primary: #fafafa;
|
|
95
|
+
--ui-accent: #27272a;
|
|
96
|
+
--ui-accent-foreground: #fafafa;
|
|
97
|
+
--ui-popover: #18181b;
|
|
98
|
+
--ui-shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.3);
|
|
99
|
+
--ui-shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.3);
|
|
100
|
+
|
|
101
|
+
/* Muted */
|
|
102
|
+
--ui-muted: #27272a;
|
|
103
|
+
--ui-muted-foreground: #a1a1aa;
|
|
104
|
+
|
|
105
|
+
/* Card */
|
|
106
|
+
--ui-card-bg: #18181b;
|
|
107
|
+
--ui-card-fg: #fafafa;
|
|
108
|
+
--ui-card-border: #27272a;
|
|
109
|
+
--ui-card-shadow: 0 1px 2px 0 rgb(0 0 0 / 0.3);
|
|
110
|
+
|
|
111
|
+
/* Area */
|
|
112
|
+
--ui-area-bg: #18181b;
|
|
113
|
+
--ui-area-fg: #fafafa;
|
|
114
|
+
--ui-area-border: #27272a;
|
|
115
|
+
|
|
116
|
+
/* Sidebar */
|
|
117
|
+
--ui-sidebar-bg: #18181b;
|
|
118
|
+
--ui-sidebar-fg: #fafafa;
|
|
119
|
+
--ui-sidebar-border: #27272a;
|
|
120
|
+
--ui-sidebar-hover: #27272a;
|
|
121
|
+
--ui-sidebar-active: #3f3f46;
|
|
122
|
+
|
|
123
|
+
/* Button */
|
|
124
|
+
--ui-button-bg: #fafafa;
|
|
125
|
+
--ui-button-bg-hover: #e4e4e7;
|
|
126
|
+
--ui-button-fg: #18181b;
|
|
127
|
+
--ui-button-border: #fafafa;
|
|
128
|
+
--ui-button-secondary-bg: #27272a;
|
|
129
|
+
--ui-button-secondary-bg-hover: #3f3f46;
|
|
130
|
+
--ui-button-secondary-fg: #fafafa;
|
|
131
|
+
--ui-button-destructive-bg: #dc2626;
|
|
132
|
+
--ui-button-destructive-bg-hover: #ef4444;
|
|
133
|
+
--ui-button-destructive-fg: #ffffff;
|
|
134
|
+
--ui-button-ghost-bg-hover: #27272a;
|
|
135
|
+
--ui-button-ghost-fg: #fafafa;
|
|
136
|
+
--ui-button-outline-bg-hover: #27272a;
|
|
137
|
+
--ui-button-outline-fg: #fafafa;
|
|
138
|
+
|
|
139
|
+
/* Input */
|
|
140
|
+
--ui-input-bg: #18181b;
|
|
141
|
+
--ui-input-fg: #fafafa;
|
|
142
|
+
--ui-input-border: #27272a;
|
|
143
|
+
--ui-input-border-focus: #52525b;
|
|
144
|
+
--ui-input-ring: #3b82f6;
|
|
145
|
+
--ui-input-placeholder: #52525b;
|
|
146
|
+
|
|
147
|
+
/* Typography */
|
|
148
|
+
--ui-heading-color: #fafafa;
|
|
149
|
+
--ui-body-color: #d4d4d8;
|
|
150
|
+
--ui-muted-color: #a1a1aa;
|
|
151
|
+
--ui-link-color: #60a5fa;
|
|
152
|
+
--ui-link-hover: #93c5fd;
|
|
153
|
+
--ui-ring: #3b82f6;
|
|
154
|
+
|
|
155
|
+
/* Menu */
|
|
156
|
+
--ui-menu-bg: #18181b;
|
|
157
|
+
--ui-menu-fg: #fafafa;
|
|
158
|
+
--ui-menu-border: #27272a;
|
|
159
|
+
--ui-menu-radius: 0.375rem;
|
|
160
|
+
--ui-menu-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.3);
|
|
161
|
+
--ui-menu-padding: 0.25rem;
|
|
162
|
+
--ui-menu-item-radius: 0.25rem;
|
|
163
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/* Padding */
|
|
2
|
+
.pad-1 { padding: var(--ui-spacing); }
|
|
3
|
+
.pad-2 { padding: calc(var(--ui-spacing) * 2); }
|
|
4
|
+
.pad-3 { padding: calc(var(--ui-spacing) * 3); }
|
|
5
|
+
.pad-4 { padding: calc(var(--ui-spacing) * 4); }
|
|
6
|
+
|
|
7
|
+
/* Text size */
|
|
8
|
+
.text-xs { font-size: 0.75rem; }
|
|
9
|
+
.text-sm { font-size: 0.875rem; }
|
|
10
|
+
.text-base { font-size: 1rem; }
|
|
11
|
+
.text-lg { font-size: 1.125rem; }
|
|
12
|
+
.text-xl { font-size: 1.25rem; }
|
|
13
|
+
|
|
14
|
+
/* Text color */
|
|
15
|
+
.text-muted { color: var(--ui-muted-color); }
|
|
16
|
+
|
|
17
|
+
/* Fixed positioning */
|
|
18
|
+
.cg-theme-toggle {
|
|
19
|
+
position: fixed;
|
|
20
|
+
bottom: 1.5rem;
|
|
21
|
+
right: 1.5rem;
|
|
22
|
+
z-index: 50;
|
|
23
|
+
}
|
|
@@ -1,22 +1,152 @@
|
|
|
1
1
|
module Aeros
|
|
2
2
|
class ApplicationViewComponent < ViewComponentContrib::Base
|
|
3
3
|
extend(Dry::Initializer)
|
|
4
|
+
include(Turbo::StreamsHelper)
|
|
5
|
+
include(Turbo::FramesHelper)
|
|
4
6
|
include(Aeros::ApplicationHelper)
|
|
5
|
-
include(
|
|
7
|
+
include(LucideRails::RailsHelper)
|
|
6
8
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
+
# ═══════════════════════════════════════════════════════════════════════════
|
|
10
|
+
# PROPS DSL
|
|
11
|
+
# ═══════════════════════════════════════════════════════════════════════════
|
|
12
|
+
|
|
13
|
+
def self.prop_definitions
|
|
14
|
+
@prop_definitions ||= {}
|
|
15
|
+
end
|
|
16
|
+
|
|
17
|
+
def self.prop(name, description:, values: nil, **opts)
|
|
18
|
+
prop_definitions[name] = { description:, values: }.compact
|
|
19
|
+
option(name, **opts)
|
|
20
|
+
end
|
|
21
|
+
|
|
22
|
+
def self.props
|
|
23
|
+
ancestors
|
|
24
|
+
.select { |a| a.respond_to?(:prop_definitions) }
|
|
25
|
+
.reverse
|
|
26
|
+
.reduce({}) { |h, a| h.merge(a.prop_definitions) }
|
|
27
|
+
end
|
|
28
|
+
|
|
29
|
+
# ═══════════════════════════════════════════════════════════════════════════
|
|
30
|
+
# EXAMPLES DSL
|
|
31
|
+
# ═══════════════════════════════════════════════════════════════════════════
|
|
32
|
+
|
|
33
|
+
class ExamplePreview
|
|
34
|
+
attr_reader :props
|
|
35
|
+
|
|
36
|
+
def initialize(props)
|
|
37
|
+
@props = props
|
|
38
|
+
end
|
|
39
|
+
end
|
|
40
|
+
|
|
41
|
+
class Example
|
|
42
|
+
attr_reader :key, :title, :description, :previews
|
|
43
|
+
|
|
44
|
+
def initialize(key, title:, description: nil)
|
|
45
|
+
@key = key
|
|
46
|
+
@title = title
|
|
47
|
+
@description = description
|
|
48
|
+
@previews = []
|
|
49
|
+
end
|
|
50
|
+
|
|
51
|
+
def preview(**props)
|
|
52
|
+
@previews << ExamplePreview.new(props)
|
|
53
|
+
end
|
|
54
|
+
end
|
|
55
|
+
|
|
56
|
+
class ExamplesBuilder
|
|
57
|
+
attr_reader :examples
|
|
58
|
+
|
|
59
|
+
def initialize
|
|
60
|
+
@examples = []
|
|
61
|
+
end
|
|
62
|
+
|
|
63
|
+
def example(key, title:, description: nil, &block)
|
|
64
|
+
ex = Example.new(key, title: title, description: description)
|
|
65
|
+
block.call(ex) if block
|
|
66
|
+
@examples << ex
|
|
67
|
+
end
|
|
68
|
+
end
|
|
69
|
+
|
|
70
|
+
def self.examples_config
|
|
71
|
+
@examples_config ||= { title: nil, description: nil, examples: [] }
|
|
72
|
+
end
|
|
73
|
+
|
|
74
|
+
def self.examples(title, description: nil, &block)
|
|
75
|
+
@examples_config = { title: title, description: description, examples: [] }
|
|
76
|
+
builder = ExamplesBuilder.new
|
|
77
|
+
block.call(builder) if block
|
|
78
|
+
@examples_config[:examples] = builder.examples
|
|
79
|
+
end
|
|
80
|
+
|
|
81
|
+
def self.examples_title
|
|
82
|
+
examples_config[:title]
|
|
83
|
+
end
|
|
84
|
+
|
|
85
|
+
def self.examples_description
|
|
86
|
+
examples_config[:description]
|
|
87
|
+
end
|
|
88
|
+
|
|
89
|
+
def self.examples_list
|
|
90
|
+
examples_config[:examples]
|
|
9
91
|
end
|
|
10
92
|
|
|
11
93
|
option(:css, optional: true)
|
|
12
|
-
|
|
13
|
-
|
|
94
|
+
option(:style, optional: true)
|
|
95
|
+
|
|
96
|
+
# Override in components: def default_style = { height: "300px" }
|
|
97
|
+
def default_style = {}
|
|
98
|
+
|
|
99
|
+
# Hash - for passing to child components
|
|
100
|
+
def style_hash
|
|
101
|
+
@style_hash ||= default_style.merge(style || {}).compact
|
|
102
|
+
end
|
|
103
|
+
|
|
104
|
+
# String - for HTML style attribute
|
|
105
|
+
def merged_style
|
|
106
|
+
@merged_style ||= style_hash
|
|
107
|
+
.map { |k, v| "#{k.to_s.dasherize}: #{v}" }
|
|
108
|
+
.join("; ")
|
|
109
|
+
.presence
|
|
14
110
|
end
|
|
15
111
|
|
|
16
112
|
class << self
|
|
17
113
|
def named
|
|
18
114
|
@named ||= self.name.sub(/::Component$/, "").underscore.split("/").join("--").gsub("_", "-")
|
|
19
115
|
end
|
|
116
|
+
|
|
117
|
+
PREFIXES = {
|
|
118
|
+
"Primitives" => "cp",
|
|
119
|
+
"Blocks" => "cb",
|
|
120
|
+
"Pages" => "cg"
|
|
121
|
+
}.freeze
|
|
122
|
+
|
|
123
|
+
# Component identifier for CSS scoping (e.g., "cp-card", "cb-sidebar")
|
|
124
|
+
# Note: Can't use @identifier - ViewComponent uses it for file paths
|
|
125
|
+
def css_identifier
|
|
126
|
+
parts = self.name.to_s.sub(/::Component$/, "").split("::")
|
|
127
|
+
prefix = PREFIXES[parts[-2]] || "c"
|
|
128
|
+
component = parts.last.underscore.gsub("_", "-")
|
|
129
|
+
"#{prefix}-#{component}"
|
|
130
|
+
end
|
|
131
|
+
end
|
|
132
|
+
|
|
133
|
+
# Generate scoped CSS class name (e.g., "cp-card", "cp-card--centered")
|
|
134
|
+
def class_for(name = nil)
|
|
135
|
+
return self.class.css_identifier if name.nil? || name == "base"
|
|
136
|
+
"#{self.class.css_identifier}--#{name}"
|
|
137
|
+
end
|
|
138
|
+
|
|
139
|
+
# Build classes from modifiers
|
|
140
|
+
# Usage: classes(variant:, size:, disabled:, full:)
|
|
141
|
+
# - symbol values: class_for(value) e.g. variant: :default → cp-button--default
|
|
142
|
+
# - true: class_for(key) e.g. disabled: true → cp-button--disabled
|
|
143
|
+
# - false/nil: skipped
|
|
144
|
+
def classes(**mods)
|
|
145
|
+
[
|
|
146
|
+
class_for,
|
|
147
|
+
*mods.filter_map { |k, v| v && class_for(v == true ? k.to_s : v.to_s) },
|
|
148
|
+
css
|
|
149
|
+
].join(" ")
|
|
20
150
|
end
|
|
21
151
|
|
|
22
152
|
def controller_name
|
|
@@ -71,5 +201,19 @@ module Aeros
|
|
|
71
201
|
def default_data
|
|
72
202
|
{ controller: controller_name }
|
|
73
203
|
end
|
|
204
|
+
|
|
205
|
+
# Shared helper for rendering clickable elements
|
|
206
|
+
# - button_to for non-GET methods (creates form)
|
|
207
|
+
# - link_to for GET links
|
|
208
|
+
# - button_tag for action buttons
|
|
209
|
+
def action_tag(href: nil, method: nil, data: {}, form_data: {}, **opts, &block)
|
|
210
|
+
if method && href
|
|
211
|
+
helpers.button_to(href, method: method, data: data, form: { data: form_data }, **opts, &block)
|
|
212
|
+
elsif href
|
|
213
|
+
helpers.link_to(href, data: data, **opts, &block)
|
|
214
|
+
else
|
|
215
|
+
helpers.button_tag(type: "button", data: data, **opts, &block)
|
|
216
|
+
end
|
|
217
|
+
end
|
|
74
218
|
end
|
|
75
219
|
end
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
<div class="cb-component-preview">
|
|
2
|
+
<% if title %><h2 class="cb-component-preview__title"><%= title %></h2><% end %>
|
|
3
|
+
<% if description %><p class="cb-component-preview__description text-muted"><%= description %></p><% end %>
|
|
4
|
+
<%= ui("card", style: style_hash, centered: true) do %>
|
|
5
|
+
<%= content %>
|
|
6
|
+
<% end %>
|
|
7
|
+
</div>
|
|
@@ -5,19 +5,19 @@ class Aeros::FormBuilder < ActionView::Helpers::FormBuilder
|
|
|
5
5
|
INPUT_BASE_CLASSES = %w[
|
|
6
6
|
block
|
|
7
7
|
w-full
|
|
8
|
-
rounded-
|
|
9
|
-
bg-
|
|
8
|
+
rounded-input
|
|
9
|
+
bg-input-bg
|
|
10
10
|
px-3
|
|
11
11
|
py-2
|
|
12
12
|
text-sm
|
|
13
|
-
text-
|
|
14
|
-
placeholder:text-
|
|
13
|
+
text-input-text
|
|
14
|
+
placeholder:text-input-placeholder
|
|
15
15
|
outline-none
|
|
16
16
|
border
|
|
17
|
-
border-
|
|
18
|
-
focus:border-
|
|
17
|
+
border-input-border
|
|
18
|
+
focus:border-input-border-focus
|
|
19
19
|
focus:ring-1
|
|
20
|
-
focus:ring-
|
|
20
|
+
focus:ring-input-ring
|
|
21
21
|
shadow-sm
|
|
22
22
|
].freeze
|
|
23
23
|
|
|
@@ -35,7 +35,7 @@ class Aeros::FormBuilder < ActionView::Helpers::FormBuilder
|
|
|
35
35
|
end
|
|
36
36
|
|
|
37
37
|
def field(field_type, name, options = {}, &block)
|
|
38
|
-
klass = "Aeros::Input#{field_type.to_s.
|
|
38
|
+
klass = "::Aeros::Primitives::Input#{field_type.to_s.camelize}::Component".constantize
|
|
39
39
|
resolved_name = resolve_name(name)
|
|
40
40
|
error_text = @object&.errors&.[](name)&.first
|
|
41
41
|
|
|
@@ -63,6 +63,22 @@ class Aeros::FormBuilder < ActionView::Helpers::FormBuilder
|
|
|
63
63
|
field(:select, name, options, &block)
|
|
64
64
|
end
|
|
65
65
|
|
|
66
|
+
def text_area_field(name, options = {})
|
|
67
|
+
field(:text_area, name, options)
|
|
68
|
+
end
|
|
69
|
+
|
|
70
|
+
def tagging_field(name, options = {})
|
|
71
|
+
field(:tagging, name, options)
|
|
72
|
+
end
|
|
73
|
+
|
|
74
|
+
def attachments_field(name, options = {})
|
|
75
|
+
field(:attachments, name, options)
|
|
76
|
+
end
|
|
77
|
+
|
|
78
|
+
def text_area_ai_field(name, options = {})
|
|
79
|
+
field(:text_area_ai, name, options)
|
|
80
|
+
end
|
|
81
|
+
|
|
66
82
|
private
|
|
67
83
|
|
|
68
84
|
def resolve_name(name)
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
<div class="cg-showcase">
|
|
2
|
+
<h1>Button</h1>
|
|
3
|
+
|
|
4
|
+
<%= block("component_preview", title: "Preview") do %>
|
|
5
|
+
<%= ui("button", label: "Click me", variant: :default) %>
|
|
6
|
+
<% end %>
|
|
7
|
+
|
|
8
|
+
<%= block("component_preview", title: "Variants") do %>
|
|
9
|
+
<%= ui("button", label: "Default", variant: :default) %>
|
|
10
|
+
<%= ui("button", label: "Secondary", variant: :secondary) %>
|
|
11
|
+
<%= ui("button", label: "Destructive", variant: :destructive) %>
|
|
12
|
+
<%= ui("button", label: "Outline", variant: :outline) %>
|
|
13
|
+
<%= ui("button", label: "Ghost", variant: :ghost) %>
|
|
14
|
+
<%= ui("button", label: "Link", variant: :link) %>
|
|
15
|
+
<% end %>
|
|
16
|
+
|
|
17
|
+
<%= block("component_preview", title: "Sizes") do %>
|
|
18
|
+
<%= ui("button", label: "XSmall", size: :xsmall) %>
|
|
19
|
+
<%= ui("button", label: "Small", size: :small) %>
|
|
20
|
+
<%= ui("button", label: "Default") %>
|
|
21
|
+
<%= ui("button", label: "Large", size: :large) %>
|
|
22
|
+
<% end %>
|
|
23
|
+
|
|
24
|
+
<%= block("component_preview", title: "With Icons") do %>
|
|
25
|
+
<%= ui("button", label: "Settings", icon: "settings") %>
|
|
26
|
+
<%= ui("button", label: "Download", icon: "download", variant: :secondary) %>
|
|
27
|
+
<%= ui("button", label: "Delete", icon: "trash-2", variant: :destructive) %>
|
|
28
|
+
<% end %>
|
|
29
|
+
|
|
30
|
+
<%= ui("card") do %>
|
|
31
|
+
<h2>Props</h2>
|
|
32
|
+
<%= ui("card") do %>
|
|
33
|
+
<%= ui("table") do |t| %>
|
|
34
|
+
<% t.with_header do |h| %>
|
|
35
|
+
<% h.with_column do %>Name<% end %>
|
|
36
|
+
<% h.with_column do %>Description<% end %>
|
|
37
|
+
<% h.with_column do %>Values<% end %>
|
|
38
|
+
<% end %>
|
|
39
|
+
<% component_class(:button).props.each do |name, meta| %>
|
|
40
|
+
<% t.with_row do |r| %>
|
|
41
|
+
<% r.with_cell do %><code><%= name %></code><% end %>
|
|
42
|
+
<% r.with_cell do %><%= meta[:description] %><% end %>
|
|
43
|
+
<% r.with_cell do %>
|
|
44
|
+
<% if meta[:values] %>
|
|
45
|
+
<% meta[:values].each do |v| %><code><%= v %></code> <% end %>
|
|
46
|
+
<% end %>
|
|
47
|
+
<% end %>
|
|
48
|
+
<% end %>
|
|
49
|
+
<% end %>
|
|
50
|
+
<% end %>
|
|
51
|
+
<% end %>
|
|
52
|
+
<% end %>
|
|
53
|
+
</div>
|