plutonium 0.45.3 → 0.46.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 (49) hide show
  1. checksums.yaml +4 -4
  2. data/.claude/skills/plutonium/SKILL.md +146 -0
  3. data/.claude/skills/plutonium-assets/SKILL.md +248 -157
  4. data/.claude/skills/{plutonium-rodauth → plutonium-auth}/SKILL.md +195 -229
  5. data/.claude/skills/plutonium-controller/SKILL.md +9 -2
  6. data/.claude/skills/plutonium-create-resource/SKILL.md +22 -1
  7. data/.claude/skills/plutonium-definition/SKILL.md +521 -7
  8. data/.claude/skills/plutonium-entity-scoping/SKILL.md +317 -0
  9. data/.claude/skills/plutonium-forms/SKILL.md +8 -1
  10. data/.claude/skills/plutonium-installation/SKILL.md +25 -2
  11. data/.claude/skills/plutonium-interaction/SKILL.md +9 -2
  12. data/.claude/skills/plutonium-invites/SKILL.md +11 -7
  13. data/.claude/skills/plutonium-model/SKILL.md +50 -50
  14. data/.claude/skills/plutonium-nested-resources/SKILL.md +8 -1
  15. data/.claude/skills/plutonium-package/SKILL.md +8 -1
  16. data/.claude/skills/plutonium-policy/SKILL.md +69 -78
  17. data/.claude/skills/plutonium-portal/SKILL.md +26 -70
  18. data/.claude/skills/plutonium-views/SKILL.md +9 -2
  19. data/CHANGELOG.md +28 -0
  20. data/app/assets/plutonium.css +1 -1
  21. data/app/views/rodauth/_login_form.html.erb +0 -3
  22. data/app/views/rodauth/confirm_password.html.erb +0 -4
  23. data/app/views/rodauth/create_account.html.erb +0 -3
  24. data/app/views/rodauth/logout.html.erb +0 -3
  25. data/docs/superpowers/plans/2026-04-08-plutonium-skills-overhaul.md +481 -0
  26. data/docs/superpowers/specs/2026-04-08-plutonium-skills-overhaul-design.md +236 -0
  27. data/gemfiles/rails_7.gemfile.lock +1 -1
  28. data/gemfiles/rails_8.0.gemfile.lock +1 -1
  29. data/gemfiles/rails_8.1.gemfile.lock +1 -1
  30. data/lib/generators/pu/core/update/update_generator.rb +8 -0
  31. data/lib/generators/pu/gem/active_shrine/active_shrine_generator.rb +56 -0
  32. data/lib/generators/pu/invites/install_generator.rb +8 -1
  33. data/lib/generators/pu/lib/plutonium_generators/concerns/actions.rb +43 -0
  34. data/lib/generators/pu/profile/concerns/profile_arguments.rb +10 -4
  35. data/lib/generators/pu/profile/conn_generator.rb +9 -12
  36. data/lib/generators/pu/profile/install_generator.rb +5 -2
  37. data/lib/generators/pu/rodauth/templates/app/rodauth/account_rodauth_plugin.rb.tt +3 -0
  38. data/lib/generators/pu/saas/portal_generator.rb +4 -9
  39. data/lib/generators/pu/saas/welcome/templates/app/views/welcome/onboarding.html.erb.tt +2 -2
  40. data/lib/plutonium/engine.rb +18 -5
  41. data/lib/plutonium/ui/layout/rodauth_layout.rb +6 -1
  42. data/lib/plutonium/version.rb +1 -1
  43. data/package.json +1 -1
  44. metadata +7 -8
  45. data/.claude/skills/plutonium/skill.md +0 -130
  46. data/.claude/skills/plutonium-definition-actions/SKILL.md +0 -424
  47. data/.claude/skills/plutonium-definition-query/SKILL.md +0 -364
  48. data/.claude/skills/plutonium-profile/SKILL.md +0 -276
  49. data/.claude/skills/plutonium-theming/SKILL.md +0 -424
@@ -1,424 +0,0 @@
1
- ---
2
- name: plutonium-theming
3
- description: Use when customizing colors, typography, spacing, or component appearance via Plutonium design tokens
4
- ---
5
-
6
- # Plutonium Design Token System
7
-
8
- Plutonium uses a comprehensive CSS design token system for consistent, themeable UI components. This system provides CSS custom properties and reusable component classes that automatically support light and dark modes.
9
-
10
- ## CSS Design Tokens
11
-
12
- Design tokens are defined in `src/css/tokens.css` and provide the foundation for all UI styling.
13
-
14
- ### Surface & Background Colors
15
-
16
- ```css
17
- /* Light mode */
18
- --pu-body: #f8fafc; /* Page background */
19
- --pu-surface: #ffffff; /* Main surface (cards, panels) */
20
- --pu-surface-alt: #f1f5f9; /* Alternate surface (headers) */
21
- --pu-surface-raised: #ffffff; /* Elevated elements */
22
- --pu-surface-overlay: rgba(255, 255, 255, 0.95);
23
-
24
- /* Dark mode (.dark class) */
25
- --pu-body: #0f172a;
26
- --pu-surface: #1e293b;
27
- --pu-surface-alt: #0f172a;
28
- --pu-surface-raised: #334155;
29
- --pu-surface-overlay: rgba(30, 41, 59, 0.95);
30
- ```
31
-
32
- ### Text Colors
33
-
34
- ```css
35
- /* Light mode */
36
- --pu-text: #0f172a; /* Primary text */
37
- --pu-text-muted: #64748b; /* Secondary text */
38
- --pu-text-subtle: #94a3b8; /* Tertiary/disabled text */
39
-
40
- /* Dark mode */
41
- --pu-text: #f8fafc;
42
- --pu-text-muted: #94a3b8;
43
- --pu-text-subtle: #64748b;
44
- ```
45
-
46
- ### Border Colors
47
-
48
- ```css
49
- /* Light mode */
50
- --pu-border: #e2e8f0; /* Standard borders */
51
- --pu-border-muted: #f1f5f9; /* Subtle borders */
52
- --pu-border-strong: #cbd5e1; /* Emphasized borders */
53
-
54
- /* Dark mode */
55
- --pu-border: #334155;
56
- --pu-border-muted: #1e293b;
57
- --pu-border-strong: #475569;
58
- ```
59
-
60
- ### Form Tokens
61
-
62
- ```css
63
- --pu-input-bg: #ffffff; /* Input background */
64
- --pu-input-border: #e2e8f0; /* Input border */
65
- --pu-input-focus-ring: theme(colors.primary.500);
66
- --pu-input-placeholder: #94a3b8; /* Placeholder text */
67
- ```
68
-
69
- ### Card Tokens
70
-
71
- ```css
72
- --pu-card-bg: #ffffff;
73
- --pu-card-border: #e2e8f0;
74
- ```
75
-
76
- ### Shadow System
77
-
78
- ```css
79
- --pu-shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.03), 0 1px 3px 0 rgb(0 0 0 / 0.05);
80
- --pu-shadow-md: 0 2px 4px -1px rgb(0 0 0 / 0.04), 0 4px 6px -1px rgb(0 0 0 / 0.06);
81
- --pu-shadow-lg: 0 4px 6px -2px rgb(0 0 0 / 0.03), 0 10px 15px -3px rgb(0 0 0 / 0.08);
82
- ```
83
-
84
- ### Border Radius
85
-
86
- ```css
87
- --pu-radius-sm: 0.375rem; /* 6px */
88
- --pu-radius-md: 0.5rem; /* 8px */
89
- --pu-radius-lg: 0.75rem; /* 12px */
90
- --pu-radius-xl: 1rem; /* 16px */
91
- --pu-radius-full: 9999px; /* Fully rounded */
92
- ```
93
-
94
- ### Spacing
95
-
96
- ```css
97
- --pu-space-xs: 0.25rem; /* 4px */
98
- --pu-space-sm: 0.5rem; /* 8px */
99
- --pu-space-md: 1rem; /* 16px */
100
- --pu-space-lg: 1.5rem; /* 24px */
101
- --pu-space-xl: 2rem; /* 32px */
102
- ```
103
-
104
- ### Transitions
105
-
106
- ```css
107
- --pu-transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
108
- --pu-transition-normal: 200ms cubic-bezier(0.4, 0, 0.2, 1);
109
- --pu-transition-slow: 300ms cubic-bezier(0.4, 0, 0.2, 1);
110
- ```
111
-
112
- ## Component Classes
113
-
114
- Component classes are defined in `src/css/components.css` and provide ready-to-use styled components.
115
-
116
- ### Buttons
117
-
118
- Base class with size variants:
119
-
120
- ```css
121
- .pu-btn /* Base button styles */
122
- .pu-btn-md /* Medium size (default) */
123
- .pu-btn-sm /* Small size */
124
- .pu-btn-xs /* Extra small size */
125
- ```
126
-
127
- Solid variants (with hover lift animation):
128
-
129
- ```css
130
- .pu-btn-primary /* Primary action */
131
- .pu-btn-secondary /* Secondary action */
132
- .pu-btn-danger /* Destructive action */
133
- .pu-btn-success /* Success action */
134
- .pu-btn-warning /* Warning action */
135
- .pu-btn-info /* Informational action */
136
- .pu-btn-accent /* Accent action */
137
- ```
138
-
139
- Other variants:
140
-
141
- ```css
142
- .pu-btn-ghost /* Minimal, text-like */
143
- .pu-btn-outline /* Bordered, transparent background */
144
- ```
145
-
146
- Soft variants (tinted backgrounds for secondary contexts):
147
-
148
- ```css
149
- .pu-btn-soft-primary
150
- .pu-btn-soft-danger
151
- .pu-btn-soft-success
152
- .pu-btn-soft-warning
153
- .pu-btn-soft-info
154
- .pu-btn-soft-secondary
155
- .pu-btn-soft-accent
156
- ```
157
-
158
- Usage:
159
-
160
- ```erb
161
- <%= form.submit "Save", class: "pu-btn pu-btn-md pu-btn-primary" %>
162
- <%= form.submit "Delete", class: "pu-btn pu-btn-md pu-btn-danger" %>
163
- <%= form.submit "Disable", class: "pu-btn pu-btn-md pu-btn-warning" %>
164
- ```
165
-
166
- ### Form Inputs
167
-
168
- ```css
169
- .pu-input /* Base input styles */
170
- .pu-input-invalid /* Error state */
171
- .pu-input-valid /* Valid state */
172
- ```
173
-
174
- Usage:
175
-
176
- ```erb
177
- <%= form.text_field :name, class: "pu-input #{errors? ? 'pu-input-invalid' : ''}" %>
178
- ```
179
-
180
- ### Labels & Text
181
-
182
- ```css
183
- .pu-label /* Form labels */
184
- .pu-label-required /* Adds red asterisk after label */
185
- .pu-hint /* Helper text below inputs */
186
- .pu-error /* Error messages */
187
- ```
188
-
189
- Usage:
190
-
191
- ```erb
192
- <%= form.label :email, class: "pu-label" %>
193
- <span class="pu-error">Email is required</span>
194
- ```
195
-
196
- ### Checkboxes
197
-
198
- ```css
199
- .pu-checkbox /* Styled checkbox/radio */
200
- ```
201
-
202
- Usage:
203
-
204
- ```erb
205
- <%= form.check_box :remember_me, class: "pu-checkbox" %>
206
- ```
207
-
208
- ### Cards
209
-
210
- ```css
211
- .pu-card /* Card container with border, shadow, radius */
212
- .pu-card-body /* Card content padding */
213
- ```
214
-
215
- ### Panels
216
-
217
- ```css
218
- .pu-panel-header /* Panel header with background */
219
- .pu-panel-title /* Panel title text */
220
- .pu-panel-description /* Panel description text */
221
- ```
222
-
223
- ### Tables
224
-
225
- ```css
226
- .pu-table-wrapper /* Scrollable container with card styling */
227
- .pu-table /* Base table styles */
228
- .pu-table-header /* Header row */
229
- .pu-table-header-cell /* Header cell */
230
- .pu-table-body-row /* Body row with hover */
231
- .pu-table-body-row-selected /* Selected row */
232
- .pu-table-body-cell /* Body cell */
233
- .pu-selection-cell /* Checkbox column */
234
- ```
235
-
236
- ### Toolbar
237
-
238
- ```css
239
- .pu-toolbar /* Toolbar container with gradient */
240
- .pu-toolbar-text /* Toolbar text */
241
- .pu-toolbar-actions /* Toolbar action buttons */
242
- ```
243
-
244
- ### Empty State
245
-
246
- ```css
247
- .pu-empty-state /* Centered container */
248
- .pu-empty-state-icon /* Icon styling */
249
- .pu-empty-state-title /* Title text */
250
- .pu-empty-state-description /* Description text */
251
- ```
252
-
253
- ## Ruby Component Classes
254
-
255
- The `Plutonium::UI::ComponentClasses` module provides Ruby constants for consistent class usage.
256
-
257
- Location: `lib/plutonium/ui/component_classes.rb`
258
-
259
- ### Button Classes
260
-
261
- ```ruby
262
- ComponentClasses::Button::BASE # "pu-btn"
263
- ComponentClasses::Button::SIZE_DEFAULT # "pu-btn-md"
264
- ComponentClasses::Button::SIZE_SM # "pu-btn-sm"
265
- ComponentClasses::Button::SIZE_XS # "pu-btn-xs"
266
-
267
- ComponentClasses::Button::VARIANTS[:primary] # "pu-btn-primary"
268
- ComponentClasses::Button::VARIANTS[:danger] # "pu-btn-danger"
269
- ComponentClasses::Button::SOFT_VARIANTS[:primary] # "pu-btn-soft-primary"
270
-
271
- # Helper method
272
- ComponentClasses::Button.classes(variant: :primary, size: :default, soft: false)
273
- # => "pu-btn pu-btn-md pu-btn-primary"
274
- ```
275
-
276
- ### Form Classes
277
-
278
- ```ruby
279
- ComponentClasses::Form::INPUT # "pu-input"
280
- ComponentClasses::Form::INPUT_INVALID # "pu-input pu-input-invalid"
281
- ComponentClasses::Form::INPUT_VALID # "pu-input pu-input-valid"
282
- ComponentClasses::Form::LABEL # "pu-label"
283
- ComponentClasses::Form::HINT # "pu-hint"
284
- ComponentClasses::Form::ERROR # "pu-error"
285
- ComponentClasses::Form::BUTTON # "pu-btn pu-btn-md pu-btn-primary"
286
- ```
287
-
288
- ### Table Classes
289
-
290
- ```ruby
291
- ComponentClasses::Table::WRAPPER # "pu-table-wrapper"
292
- ComponentClasses::Table::BASE # "pu-table"
293
- ComponentClasses::Table::HEADER # "pu-table-header"
294
- ComponentClasses::Table::HEADER_CELL # "pu-table-header-cell"
295
- ComponentClasses::Table::BODY_ROW # "pu-table-body-row"
296
- ComponentClasses::Table::BODY_ROW_SELECTED # "pu-table-body-row-selected"
297
- ComponentClasses::Table::BODY_CELL # "pu-table-body-cell"
298
- ComponentClasses::Table::CHECKBOX # "pu-checkbox"
299
- ```
300
-
301
- ### Card Classes
302
-
303
- ```ruby
304
- ComponentClasses::Card::BASE # "pu-card"
305
- ComponentClasses::Card::BODY # "pu-card-body"
306
- ComponentClasses::Card::HEADER # "pu-panel-header"
307
- ComponentClasses::Card::TITLE # "pu-panel-title"
308
- ComponentClasses::Card::DESCRIPTION # "pu-panel-description"
309
- ```
310
-
311
- ## Using Tokens in Templates
312
-
313
- ### ERB Templates
314
-
315
- ```erb
316
- <%# Text colors %>
317
- <h1 class="text-[var(--pu-text)]">Title</h1>
318
- <p class="text-[var(--pu-text-muted)]">Description</p>
319
-
320
- <%# Surfaces %>
321
- <div class="bg-[var(--pu-surface)] border border-[var(--pu-border)] rounded-[var(--pu-radius-lg)]">
322
- Content
323
- </div>
324
-
325
- <%# With shadows %>
326
- <div class="bg-[var(--pu-card-bg)]" style="box-shadow: var(--pu-shadow-md)">
327
- Card content
328
- </div>
329
-
330
- <%# Form fields %>
331
- <%= form.label :name, class: "pu-label" %>
332
- <%= form.text_field :name, class: "pu-input" %>
333
- <span class="pu-error">Error message</span>
334
-
335
- <%# Buttons %>
336
- <%= form.submit "Save", class: "w-full pu-btn pu-btn-md pu-btn-primary" %>
337
- ```
338
-
339
- ### Phlex Components
340
-
341
- ```ruby
342
- class MyComponent < Plutonium::UI::Component::Base
343
- def view_template
344
- div(class: "bg-[var(--pu-surface)] border border-[var(--pu-border)] rounded-[var(--pu-radius-lg)]",
345
- style: "box-shadow: var(--pu-shadow-md)") {
346
- h2(class: "text-lg font-semibold text-[var(--pu-text)]") { "Title" }
347
- p(class: "text-[var(--pu-text-muted)]") { "Description" }
348
- }
349
- end
350
- end
351
- ```
352
-
353
- ## Link Styling Patterns
354
-
355
- Plutonium uses consistent link styling patterns:
356
-
357
- ```erb
358
- <%# Primary links %>
359
- <%= link_to "Link", path, class: "font-medium text-secondary-600 dark:text-secondary-400 hover:underline transition-colors" %>
360
-
361
- <%# Muted links %>
362
- <%= link_to "Link", path, class: "text-[var(--pu-text-muted)] hover:text-primary-600 transition-colors" %>
363
- ```
364
-
365
- ## Dark Mode
366
-
367
- All tokens automatically switch values when the `.dark` class is present on `<html>`:
368
-
369
- ```html
370
- <!-- Light mode -->
371
- <html>
372
- <body class="bg-[var(--pu-body)]">...</body>
373
- </html>
374
-
375
- <!-- Dark mode -->
376
- <html class="dark">
377
- <body class="bg-[var(--pu-body)]">...</body>
378
- </html>
379
- ```
380
-
381
- No additional classes needed - tokens handle the switch automatically.
382
-
383
- ## Customizing Tokens
384
-
385
- Override tokens in your application CSS:
386
-
387
- ```css
388
- /* app/assets/stylesheets/application.tailwind.css */
389
- @import "gem:plutonium/src/css/plutonium.css";
390
- @import "tailwindcss";
391
-
392
- :root {
393
- /* Override light mode tokens */
394
- --pu-surface: #fafafa;
395
- --pu-border: #d1d5db;
396
- }
397
-
398
- .dark {
399
- /* Override dark mode tokens */
400
- --pu-surface: #111827;
401
- --pu-border: #374151;
402
- }
403
- ```
404
-
405
- ## Migration from Hardcoded Classes
406
-
407
- When updating views to use the design token system:
408
-
409
- | Old Pattern | New Pattern |
410
- |-------------|-------------|
411
- | `text-gray-900 dark:text-white` | `text-[var(--pu-text)]` |
412
- | `text-gray-500 dark:text-gray-400` | `text-[var(--pu-text-muted)]` |
413
- | `bg-gray-50 dark:bg-gray-700` | `bg-[var(--pu-surface)]` |
414
- | `border-gray-300 dark:border-gray-600` | `border-[var(--pu-border)]` |
415
- | `bg-gray-50 border ... (long input class)` | `pu-input` |
416
- | `block mb-2 text-sm font-semibold ...` | `pu-label` |
417
- | `text-red-600 dark:text-red-400` | `pu-error` |
418
- | `(long button class)` | `pu-btn pu-btn-md pu-btn-primary` |
419
-
420
- ## Related Skills
421
-
422
- - `plutonium-assets` - TailwindCSS configuration and asset setup
423
- - `plutonium-forms` - Form component customization
424
- - `plutonium-views` - View and layout customization