admin_suite 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (128) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +10 -0
  3. data/Gemfile +13 -0
  4. data/LICENSE.txt +22 -0
  5. data/README.md +7 -0
  6. data/Rakefile +11 -0
  7. data/app/assets/admin_suite.css +444 -0
  8. data/app/assets/admin_suite_tailwind.css +8 -0
  9. data/app/assets/builds/admin_suite_tailwind.css +8 -0
  10. data/app/assets/rouge.css +218 -0
  11. data/app/assets/tailwind/admin_suite.css +22 -0
  12. data/app/controllers/admin_suite/application_controller.rb +118 -0
  13. data/app/controllers/admin_suite/dashboard_controller.rb +258 -0
  14. data/app/controllers/admin_suite/docs_controller.rb +155 -0
  15. data/app/controllers/admin_suite/portals_controller.rb +22 -0
  16. data/app/controllers/admin_suite/resources_controller.rb +238 -0
  17. data/app/helpers/admin_suite/base_helper.rb +1199 -0
  18. data/app/helpers/admin_suite/icon_helper.rb +61 -0
  19. data/app/helpers/admin_suite/panels_helper.rb +52 -0
  20. data/app/helpers/admin_suite/resources_helper.rb +15 -0
  21. data/app/helpers/admin_suite/theme_helper.rb +99 -0
  22. data/app/javascript/controllers/admin_suite/click_actions_controller.js +73 -0
  23. data/app/javascript/controllers/admin_suite/clipboard_controller.js +57 -0
  24. data/app/javascript/controllers/admin_suite/code_editor_controller.js +45 -0
  25. data/app/javascript/controllers/admin_suite/file_upload_controller.js +238 -0
  26. data/app/javascript/controllers/admin_suite/json_editor_controller.js +62 -0
  27. data/app/javascript/controllers/admin_suite/live_filter_controller.js +71 -0
  28. data/app/javascript/controllers/admin_suite/markdown_editor_controller.js +67 -0
  29. data/app/javascript/controllers/admin_suite/searchable_select_controller.js +171 -0
  30. data/app/javascript/controllers/admin_suite/sidebar_controller.js +33 -0
  31. data/app/javascript/controllers/admin_suite/tag_select_controller.js +193 -0
  32. data/app/javascript/controllers/admin_suite/toggle_switch_controller.js +66 -0
  33. data/app/views/admin_suite/dashboard/index.html.erb +21 -0
  34. data/app/views/admin_suite/docs/index.html.erb +86 -0
  35. data/app/views/admin_suite/panels/_cards.html.erb +107 -0
  36. data/app/views/admin_suite/panels/_chart.html.erb +47 -0
  37. data/app/views/admin_suite/panels/_health.html.erb +44 -0
  38. data/app/views/admin_suite/panels/_recent.html.erb +56 -0
  39. data/app/views/admin_suite/panels/_stat.html.erb +64 -0
  40. data/app/views/admin_suite/panels/_table.html.erb +36 -0
  41. data/app/views/admin_suite/portals/show.html.erb +75 -0
  42. data/app/views/admin_suite/resources/_form.html.erb +32 -0
  43. data/app/views/admin_suite/resources/edit.html.erb +24 -0
  44. data/app/views/admin_suite/resources/index.html.erb +315 -0
  45. data/app/views/admin_suite/resources/new.html.erb +22 -0
  46. data/app/views/admin_suite/resources/show.html.erb +184 -0
  47. data/app/views/admin_suite/shared/_flash.html.erb +30 -0
  48. data/app/views/admin_suite/shared/_form.html.erb +60 -0
  49. data/app/views/admin_suite/shared/_json_editor_field.html.erb +52 -0
  50. data/app/views/admin_suite/shared/_sidebar.html.erb +94 -0
  51. data/app/views/admin_suite/shared/_toggle_cell.html.erb +34 -0
  52. data/app/views/admin_suite/shared/_topbar.html.erb +47 -0
  53. data/app/views/layouts/admin_suite/application.html.erb +79 -0
  54. data/lib/admin/base/action_executor.rb +155 -0
  55. data/lib/admin/base/action_handler.rb +31 -0
  56. data/lib/admin/base/filter_builder.rb +121 -0
  57. data/lib/admin/base/resource.rb +541 -0
  58. data/lib/admin_suite/configuration.rb +42 -0
  59. data/lib/admin_suite/engine.rb +101 -0
  60. data/lib/admin_suite/markdown_renderer.rb +115 -0
  61. data/lib/admin_suite/portal_definition.rb +64 -0
  62. data/lib/admin_suite/portal_registry.rb +32 -0
  63. data/lib/admin_suite/theme_palette.rb +36 -0
  64. data/lib/admin_suite/ui/dashboard_definition.rb +69 -0
  65. data/lib/admin_suite/ui/field_renderer_registry.rb +119 -0
  66. data/lib/admin_suite/ui/form_field_renderer.rb +48 -0
  67. data/lib/admin_suite/ui/show_formatter_registry.rb +120 -0
  68. data/lib/admin_suite/ui/show_value_formatter.rb +70 -0
  69. data/lib/admin_suite/version.rb +10 -0
  70. data/lib/admin_suite.rb +54 -0
  71. data/lib/generators/admin_suite/install/install_generator.rb +23 -0
  72. data/lib/generators/admin_suite/install/templates/admin_suite.rb +60 -0
  73. data/lib/generators/admin_suite/resource/resource_generator.rb +83 -0
  74. data/lib/generators/admin_suite/resource/templates/resource.rb.tt +47 -0
  75. data/lib/generators/admin_suite/scaffold/scaffold_generator.rb +28 -0
  76. data/lib/tasks/admin_suite_tailwind.rake +28 -0
  77. data/lib/tasks/admin_suite_test.rake +11 -0
  78. data/test/dummy/Gemfile +21 -0
  79. data/test/dummy/README.md +24 -0
  80. data/test/dummy/Rakefile +6 -0
  81. data/test/dummy/app/assets/stylesheets/application.css +10 -0
  82. data/test/dummy/app/controllers/application_controller.rb +4 -0
  83. data/test/dummy/app/helpers/application_helper.rb +2 -0
  84. data/test/dummy/app/models/application_record.rb +2 -0
  85. data/test/dummy/app/views/layouts/application.html.erb +28 -0
  86. data/test/dummy/app/views/pwa/manifest.json.erb +22 -0
  87. data/test/dummy/app/views/pwa/service-worker.js +26 -0
  88. data/test/dummy/bin/ci +6 -0
  89. data/test/dummy/bin/dev +2 -0
  90. data/test/dummy/bin/rails +4 -0
  91. data/test/dummy/bin/rake +4 -0
  92. data/test/dummy/bin/setup +35 -0
  93. data/test/dummy/config/application.rb +43 -0
  94. data/test/dummy/config/boot.rb +3 -0
  95. data/test/dummy/config/ci.rb +19 -0
  96. data/test/dummy/config/database.yml +31 -0
  97. data/test/dummy/config/environment.rb +5 -0
  98. data/test/dummy/config/environments/development.rb +57 -0
  99. data/test/dummy/config/environments/production.rb +67 -0
  100. data/test/dummy/config/environments/test.rb +42 -0
  101. data/test/dummy/config/initializers/assets.rb +7 -0
  102. data/test/dummy/config/initializers/content_security_policy.rb +29 -0
  103. data/test/dummy/config/initializers/filter_parameter_logging.rb +8 -0
  104. data/test/dummy/config/initializers/inflections.rb +16 -0
  105. data/test/dummy/config/locales/en.yml +31 -0
  106. data/test/dummy/config/puma.rb +39 -0
  107. data/test/dummy/config/routes.rb +16 -0
  108. data/test/dummy/config.ru +6 -0
  109. data/test/dummy/db/seeds.rb +9 -0
  110. data/test/dummy/log/test.log +441 -0
  111. data/test/dummy/public/400.html +135 -0
  112. data/test/dummy/public/404.html +135 -0
  113. data/test/dummy/public/406-unsupported-browser.html +135 -0
  114. data/test/dummy/public/422.html +135 -0
  115. data/test/dummy/public/500.html +135 -0
  116. data/test/dummy/public/icon.png +0 -0
  117. data/test/dummy/public/icon.svg +3 -0
  118. data/test/dummy/public/robots.txt +1 -0
  119. data/test/dummy/test/test_helper.rb +15 -0
  120. data/test/dummy/tmp/local_secret.txt +1 -0
  121. data/test/fixtures/docs/progress/PROGRESS_REPORT.md +6 -0
  122. data/test/integration/dashboard_test.rb +13 -0
  123. data/test/integration/docs_test.rb +46 -0
  124. data/test/integration/theme_test.rb +27 -0
  125. data/test/lib/markdown_renderer_test.rb +20 -0
  126. data/test/lib/theme_palette_test.rb +24 -0
  127. data/test/test_helper.rb +11 -0
  128. metadata +264 -0
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: 0f7c1be0b2abc25afb2d0e162c35694d27c03acb1c0db9aa5f7c75fdf9f5a0de
4
+ data.tar.gz: 5f969a9e650ccc2e135334658c00bda4fe59918d8b4f8402a43c7207ffd5b0cb
5
+ SHA512:
6
+ metadata.gz: afadac82d6a9e20a8b6416c1299e3cba56fc4f0cab22ca33987498c7809e44167743636dc991acf08d2d6d142b5eac4132a8f8fafb3f79cd7c1dd697b12ba861
7
+ data.tar.gz: d2dac896f3b213c9058ec702a9673201d4561a793105c2f552afa6a79c7d4896b716372737a08db4eb0c5230b5a7a1d719f9d98f20c994143f9393c8b52005dc
data/.gitignore ADDED
@@ -0,0 +1,10 @@
1
+ /pkg/
2
+ /vendor/bundle/
3
+ /coverage/
4
+ /test/dummy/db/*.sqlite3*
5
+ /test/dummy/config/master.key
6
+ /test/dummy/config/credentials.yml.enc
7
+ /test/dummy/log/*
8
+ !/test/dummy/log/.keep
9
+ /test/dummy/tmp/
10
+ /test/dummy/storage/
data/Gemfile ADDED
@@ -0,0 +1,13 @@
1
+ source "https://rubygems.org"
2
+
3
+ # Declare runtime dependencies in the gemspec.
4
+ gemspec
5
+
6
+ group :development, :test do
7
+ # Provides the asset pipeline used by the engine/dummy app.
8
+ gem "propshaft"
9
+ end
10
+
11
+ group :test do
12
+ gem "simplecov", require: false
13
+ end
data/LICENSE.txt ADDED
@@ -0,0 +1,22 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Gleania
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
22
+
data/README.md ADDED
@@ -0,0 +1,7 @@
1
+ # AdminSuite
2
+
3
+ A mountable Rails engine that provides a resource-based admin UI and generators.
4
+
5
+ This engine is currently extracted from the Gleania app and is intended to be reused
6
+ across other products.
7
+
data/Rakefile ADDED
@@ -0,0 +1,11 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "bundler/gem_tasks"
4
+ require "rake/testtask"
5
+
6
+ Rake::TestTask.new(:test) do |t|
7
+ t.libs << "test"
8
+ t.pattern = "test/**/*_test.rb"
9
+ end
10
+
11
+ task default: :test
@@ -0,0 +1,444 @@
1
+ /*
2
+ * AdminSuite baseline styles.
3
+ *
4
+ * This is intentionally small: it provides usable defaults for core UI elements
5
+ * even when the host app does not ship Tailwind.
6
+ *
7
+ * Host apps can still include their own stylesheet (e.g. Tailwind) via
8
+ * `AdminSuite.config.host_stylesheet`.
9
+ */
10
+
11
+ body.admin-suite {
12
+ --admin-suite-bg: #f8fafc; /* slate-50 */
13
+ --admin-suite-fg: #0f172a; /* slate-900 */
14
+ --admin-suite-muted: #475569; /* slate-600 */
15
+ --admin-suite-border: #e2e8f0; /* slate-200 */
16
+ --admin-suite-card: #ffffff;
17
+ --admin-suite-primary: #4f46e5; /* indigo-600 */
18
+ --admin-suite-primary-hover: #4338ca; /* indigo-700 */
19
+ --admin-suite-danger: #ef4444; /* red-500 */
20
+
21
+ /* Sidebar gradient (dark) */
22
+ --admin-suite-sidebar-from: #312e81;
23
+ --admin-suite-sidebar-via: #3730a3;
24
+ --admin-suite-sidebar-to: #581c87;
25
+
26
+ /* Common portal accent colors (fixed palette) */
27
+ --admin-suite-color-amber: #f59e0b;
28
+ --admin-suite-color-emerald: #10b981;
29
+ --admin-suite-color-cyan: #06b6d4;
30
+ --admin-suite-color-violet: #8b5cf6;
31
+ --admin-suite-color-slate: #64748b;
32
+ }
33
+
34
+ /* Light-mode only for now.
35
+ The host app can implement dark mode later via Tailwind and explicit `.dark` toggling. */
36
+
37
+ html, body {
38
+ height: 100%;
39
+ }
40
+
41
+ body.admin-suite {
42
+ background: var(--admin-suite-bg);
43
+ color: var(--admin-suite-fg);
44
+ font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji", "Segoe UI Emoji";
45
+ line-height: 1.5;
46
+ }
47
+
48
+ body.admin-suite a {
49
+ color: var(--admin-suite-primary);
50
+ text-decoration: none;
51
+ }
52
+ /* Avoid global underline-on-hover: the engine uses Tailwind utilities for hover
53
+ states (nav items, button-like links). Prose/markdown renderers should opt-in
54
+ to underlines explicitly. */
55
+ body.admin-suite a:hover { text-decoration: none; }
56
+
57
+ /* Docs viewer (engine-owned, no Tailwind typography plugin required) */
58
+ .admin-suite-doc-content {
59
+ color: var(--admin-suite-fg);
60
+ font-size: 0.95rem;
61
+ line-height: 1.75;
62
+ }
63
+
64
+ .admin-suite-doc-content h1,
65
+ .admin-suite-doc-content h2,
66
+ .admin-suite-doc-content h3,
67
+ .admin-suite-doc-content h4 {
68
+ color: var(--admin-suite-fg);
69
+ font-weight: 700;
70
+ line-height: 1.25;
71
+ margin: 1.5rem 0 0.75rem;
72
+ }
73
+
74
+ .admin-suite-doc-content h2 {
75
+ font-size: 1.25rem;
76
+ padding-bottom: 0.5rem;
77
+ border-bottom: 1px solid var(--admin-suite-border);
78
+ }
79
+
80
+ .admin-suite-doc-content h3 { font-size: 1.05rem; }
81
+ .admin-suite-doc-content h4 { font-size: 1rem; }
82
+
83
+ .admin-suite-doc-content p { margin: 0.75rem 0; color: color-mix(in srgb, var(--admin-suite-fg) 80%, #0000); }
84
+
85
+ .admin-suite-doc-content a {
86
+ color: var(--admin-suite-primary);
87
+ text-decoration: none;
88
+ font-weight: 600;
89
+ }
90
+ .admin-suite-doc-content a:hover { text-decoration: underline; }
91
+
92
+ .admin-suite-doc-content ul,
93
+ .admin-suite-doc-content ol { margin: 0.75rem 0 0.75rem 1.25rem; }
94
+ .admin-suite-doc-content li { margin: 0.25rem 0; }
95
+
96
+ .admin-suite-doc-content code {
97
+ font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
98
+ font-size: 0.9em;
99
+ padding: 0.1rem 0.35rem;
100
+ border-radius: 0.35rem;
101
+ background: #f1f5f9; /* slate-100 */
102
+ }
103
+
104
+ .admin-suite-doc-content pre {
105
+ margin: 1rem 0;
106
+ border-radius: 0.75rem;
107
+ overflow-x: auto;
108
+ }
109
+
110
+ .admin-suite-doc-content pre.highlight {
111
+ background: #1e293b; /* slate-800 */
112
+ padding: 1rem;
113
+ }
114
+
115
+ .admin-suite-doc-content pre code {
116
+ background: transparent;
117
+ padding: 0;
118
+ color: #e2e8f0; /* slate-200 */
119
+ }
120
+
121
+ .admin-suite-doc-content .code-block {
122
+ position: relative;
123
+ }
124
+
125
+ .admin-suite-doc-content .code-lang {
126
+ position: absolute;
127
+ top: 0.5rem;
128
+ right: 0.75rem;
129
+ font-size: 0.65rem;
130
+ font-weight: 700;
131
+ text-transform: uppercase;
132
+ letter-spacing: 0.06em;
133
+ color: rgba(226, 232, 240, 0.8);
134
+ background: rgba(0, 0, 0, 0.25);
135
+ padding: 0.125rem 0.5rem;
136
+ border-radius: 0.35rem;
137
+ }
138
+
139
+ .admin-suite-doc-table {
140
+ width: 100%;
141
+ border-collapse: collapse;
142
+ margin: 1rem 0;
143
+ font-size: 0.95rem;
144
+ }
145
+
146
+ .admin-suite-doc-table th,
147
+ .admin-suite-doc-table td {
148
+ border: 1px solid var(--admin-suite-border);
149
+ padding: 0.6rem 0.75rem;
150
+ text-align: left;
151
+ vertical-align: top;
152
+ }
153
+
154
+ .admin-suite-doc-table th {
155
+ background: #f8fafc; /* slate-50 */
156
+ font-weight: 700;
157
+ }
158
+
159
+ .admin-suite-doc-content blockquote {
160
+ margin: 1rem 0;
161
+ padding: 0.75rem 1rem;
162
+ border-left: 4px solid var(--admin-suite-primary);
163
+ background: color-mix(in srgb, var(--admin-suite-primary) 8%, #fff);
164
+ border-radius: 0 0.75rem 0.75rem 0;
165
+ }
166
+
167
+ /* Semantic theme classes (used throughout engine views) */
168
+ .admin-suite-link {
169
+ color: var(--admin-suite-primary);
170
+ text-decoration: none;
171
+ }
172
+
173
+ .admin-suite-link-hover:hover {
174
+ color: var(--admin-suite-primary-hover);
175
+ }
176
+
177
+ .admin-suite-badge-primary {
178
+ background: color-mix(in srgb, var(--admin-suite-primary) 14%, #ffffff);
179
+ color: color-mix(in srgb, var(--admin-suite-primary) 80%, #000000);
180
+ }
181
+
182
+ .admin-suite-focus-ring:focus-visible {
183
+ outline: none;
184
+ box-shadow: 0 0 0 3px color-mix(in srgb, var(--admin-suite-primary) 30%, transparent);
185
+ }
186
+
187
+ /* Portal / accent color helpers (semantic; no Tailwind palette dependency) */
188
+ .admin-suite-portal-accent {
189
+ --portal-color: var(--admin-suite-color-slate);
190
+ }
191
+ .admin-suite-portal-accent--amber { --portal-color: var(--admin-suite-color-amber); }
192
+ .admin-suite-portal-accent--emerald { --portal-color: var(--admin-suite-color-emerald); }
193
+ .admin-suite-portal-accent--cyan { --portal-color: var(--admin-suite-color-cyan); }
194
+ .admin-suite-portal-accent--violet { --portal-color: var(--admin-suite-color-violet); }
195
+ .admin-suite-portal-accent--slate { --portal-color: var(--admin-suite-color-slate); }
196
+
197
+ .admin-suite-portal-chip {
198
+ background: color-mix(in srgb, var(--portal-color) 22%, transparent);
199
+ }
200
+
201
+ .admin-suite-portal-icon {
202
+ color: color-mix(in srgb, var(--portal-color) 45%, white);
203
+ }
204
+
205
+ .admin-suite-portal-card {
206
+ background: color-mix(in srgb, var(--portal-color) 10%, white);
207
+ border: 1px solid var(--admin-suite-border);
208
+ }
209
+
210
+ .admin-suite-portal-card:hover {
211
+ box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08);
212
+ }
213
+
214
+ .admin-suite-portal-link {
215
+ color: color-mix(in srgb, var(--portal-color) 75%, #000);
216
+ }
217
+
218
+ .admin-suite-portal-link:hover {
219
+ color: color-mix(in srgb, var(--portal-color) 90%, #000);
220
+ }
221
+
222
+ /* Generic themed card hover accents */
223
+ .admin-suite-theme-border-hover:hover {
224
+ border-color: color-mix(in srgb, var(--admin-suite-primary) 35%, var(--admin-suite-border));
225
+ }
226
+
227
+ .admin-suite-theme-text-hover:hover {
228
+ color: var(--admin-suite-primary);
229
+ }
230
+
231
+ .admin-suite-env-dot {
232
+ background: var(--admin-suite-primary);
233
+ }
234
+
235
+ .admin-suite-avatar {
236
+ background: color-mix(in srgb, var(--admin-suite-primary) 18%, #fff);
237
+ color: color-mix(in srgb, var(--admin-suite-primary) 80%, #000);
238
+ }
239
+
240
+ .admin-suite-flash--info {
241
+ background: color-mix(in srgb, var(--admin-suite-primary) 10%, #fff);
242
+ border-color: color-mix(in srgb, var(--admin-suite-primary) 30%, var(--admin-suite-border));
243
+ color: color-mix(in srgb, var(--admin-suite-primary) 70%, #000);
244
+ }
245
+
246
+ /* Sidebar readability (engine-owned, light-mode only)
247
+ Ensures nav text is readable even without Tailwind utilities.
248
+ Note: `body.admin-suite a { color: var(--admin-suite-primary) }` is more specific
249
+ than `.admin-suite-sidebar a`, so we scope these rules under `body.admin-suite`
250
+ to guarantee the sidebar stays readable. */
251
+ .admin-suite-sidebar {
252
+ background: linear-gradient(to bottom, var(--admin-suite-sidebar-from), var(--admin-suite-sidebar-via), var(--admin-suite-sidebar-to));
253
+ }
254
+
255
+ body.admin-suite .admin-suite-sidebar,
256
+ body.admin-suite .admin-suite-sidebar a {
257
+ color: rgba(255, 255, 255, 0.95);
258
+ }
259
+
260
+ body.admin-suite .admin-suite-sidebar a:hover {
261
+ color: #ffffff;
262
+ }
263
+
264
+ body.admin-suite .admin-suite-sidebar .admin-suite-sidebar-muted {
265
+ color: rgba(255, 255, 255, 0.75);
266
+ }
267
+
268
+ .form-group { margin-bottom: 1rem; }
269
+ .form-label {
270
+ display: block;
271
+ font-size: 0.875rem;
272
+ font-weight: 600;
273
+ color: var(--admin-suite-muted);
274
+ margin-bottom: 0.25rem;
275
+ }
276
+
277
+ .form-input,
278
+ .form-input-file,
279
+ select.form-input,
280
+ textarea.form-input {
281
+ display: block;
282
+ width: 100%;
283
+ padding: 0.55rem 0.75rem;
284
+ border: 1px solid var(--admin-suite-border);
285
+ border-radius: 0.5rem;
286
+ background: var(--admin-suite-card);
287
+ color: var(--admin-suite-fg);
288
+ font-size: 0.875rem;
289
+ box-sizing: border-box;
290
+ }
291
+
292
+ .form-input:focus,
293
+ .form-input-file:focus {
294
+ outline: none;
295
+ border-color: var(--admin-suite-primary);
296
+ box-shadow: 0 0 0 3px color-mix(in srgb, var(--admin-suite-primary) 25%, transparent);
297
+ }
298
+
299
+ .form-checkbox {
300
+ width: 1rem;
301
+ height: 1rem;
302
+ }
303
+
304
+ table {
305
+ border-collapse: collapse;
306
+ }
307
+
308
+ th, td {
309
+ border-bottom: 1px solid var(--admin-suite-border);
310
+ padding: 0.6rem 0.75rem;
311
+ vertical-align: top;
312
+ }
313
+
314
+ th {
315
+ text-transform: uppercase;
316
+ letter-spacing: 0.05em;
317
+ font-size: 0.75rem;
318
+ color: var(--admin-suite-muted);
319
+ text-align: left;
320
+ }
321
+
322
+ button {
323
+ font-family: inherit;
324
+ }
325
+
326
+ button[type="submit"],
327
+ .btn-primary {
328
+ background: var(--admin-suite-primary);
329
+ color: white;
330
+ border: 0;
331
+ border-radius: 0.5rem;
332
+ padding: 0.55rem 0.9rem;
333
+ font-weight: 600;
334
+ cursor: pointer;
335
+ }
336
+
337
+ button[type="submit"]:hover,
338
+ .btn-primary:hover {
339
+ filter: brightness(0.95);
340
+ }
341
+
342
+ /* Primary buttons rendered as links (e.g. "New ...") */
343
+ .admin-suite-btn-primary {
344
+ display: inline-flex;
345
+ align-items: center;
346
+ justify-content: center;
347
+ gap: 0.5rem;
348
+ padding: 0.55rem 0.9rem;
349
+ background: var(--admin-suite-primary);
350
+ color: #fff !important;
351
+ text-decoration: none !important;
352
+ border-radius: 0.5rem;
353
+ border: 0;
354
+ font-weight: 600;
355
+ cursor: pointer;
356
+ }
357
+
358
+ .admin-suite-btn-primary:hover {
359
+ background: var(--admin-suite-primary-hover);
360
+ }
361
+
362
+ .admin-suite-btn-primary--sm {
363
+ padding: 0.5rem 0.75rem;
364
+ }
365
+
366
+ /* Toggle switch fallback (engine-owned)
367
+ -----------------------------------
368
+ Some host builds (or Tailwind v4 scanning) may not emit translate utilities.
369
+ Provide minimal styles so index-page toggles render correctly regardless.
370
+ */
371
+ .admin-suite-toggle-track {
372
+ position: relative;
373
+ display: inline-flex;
374
+ height: 1.5rem; /* h-6 */
375
+ width: 2.75rem; /* w-11 */
376
+ flex-shrink: 0;
377
+ cursor: pointer;
378
+ border-radius: 9999px;
379
+ border: 2px solid transparent;
380
+ transition: background-color 0.2s ease-in-out;
381
+ background: #e2e8f0; /* slate-200 (off) */
382
+ vertical-align: middle;
383
+ }
384
+
385
+ .admin-suite-toggle-wrap {
386
+ vertical-align: middle;
387
+ }
388
+
389
+ .admin-suite-toggle-wrap form.button_to {
390
+ margin: 0;
391
+ display: inline-flex;
392
+ align-items: center;
393
+ }
394
+
395
+ /* Rails `button_to` uses a submit button; our baseline styles all submit buttons.
396
+ Override those defaults for toggle switches so off/on colors can differ. */
397
+ button.admin-suite-toggle-track {
398
+ padding: 0;
399
+ line-height: 1;
400
+ font-weight: 400;
401
+ background: #e2e8f0; /* slate-200 (off) */
402
+ color: inherit;
403
+ border-radius: 9999px;
404
+ vertical-align: middle;
405
+ }
406
+
407
+ .admin-suite-toggle-track:hover {
408
+ filter: none;
409
+ }
410
+
411
+ .admin-suite-toggle-thumb {
412
+ pointer-events: none;
413
+ display: inline-block;
414
+ height: 1.25rem; /* h-5 */
415
+ width: 1.25rem; /* w-5 */
416
+ border-radius: 9999px;
417
+ background: #fff;
418
+ box-shadow: 0 1px 2px rgba(0,0,0,0.15);
419
+ transition: transform 0.2s ease-in-out;
420
+ transform: translateX(0);
421
+ }
422
+
423
+ .admin-suite-toggle-track.is-on .admin-suite-toggle-thumb {
424
+ transform: translateX(1.25rem); /* translate-x-5 */
425
+ }
426
+
427
+ .admin-suite-toggle-track.is-on {
428
+ background: var(--admin-suite-primary);
429
+ }
430
+
431
+ button.admin-suite-toggle-track.is-on {
432
+ background: var(--admin-suite-primary);
433
+ }
434
+
435
+ .admin-suite-toggle-track:focus-visible {
436
+ outline: none;
437
+ box-shadow: 0 0 0 3px color-mix(in srgb, var(--admin-suite-primary) 30%, transparent);
438
+ }
439
+
440
+ .btn-danger {
441
+ background: var(--admin-suite-danger);
442
+ color: white;
443
+ }
444
+
@@ -0,0 +1,8 @@
1
+ /*
2
+ * Placeholder compiled Tailwind output for AdminSuite.
3
+ *
4
+ * Host apps should generate a real build during asset precompile or via a
5
+ * `tailwindcss` build step. This file exists so the engine can boot (and its
6
+ * test dummy app can render) even when a compiled build is not present.
7
+ */
8
+
@@ -0,0 +1,8 @@
1
+ /*
2
+ * Placeholder compiled Tailwind output for AdminSuite.
3
+ *
4
+ * Host apps should generate a real build during asset precompile or via the
5
+ * `tailwindcss` build step. This file exists so the engine can boot (and its
6
+ * test dummy app can render) even when a compiled build is not present.
7
+ */
8
+