baldur 0.2.0 → 0.2.3

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 (44) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile +1 -1
  3. data/TODO.md +7 -1
  4. data/app/assets/stylesheets/baldur/application/components/auth-page.css +7 -0
  5. data/app/assets/tailwind/baldur/engine.css +2 -2
  6. data/app/helpers/baldur/marketing_helper.rb +71 -69
  7. data/app/helpers/baldur/optional/auth_page_helper.rb +4 -2
  8. data/app/helpers/baldur/optional/google_auth_helper.rb +2 -2
  9. data/app/helpers/baldur/optional/panel_secondary_helper.rb +3 -2
  10. data/app/helpers/baldur/ui_helper.rb +151 -138
  11. data/app/helpers/baldur/ui_helper_feedback.rb +38 -36
  12. data/app/helpers/baldur/ui_helper_forms.rb +81 -76
  13. data/app/helpers/baldur/ui_helper_sidebar.rb +6 -5
  14. data/app/helpers/baldur/ui_helper_unavailable.rb +17 -15
  15. data/app/views/baldur/components/_theme_toggle.html.erb +23 -0
  16. data/app/views/baldur/optional/_auth_page.html.erb +6 -0
  17. data/baldur.gemspec +23 -23
  18. data/config/importmap.rb +2 -2
  19. data/lib/baldur/configuration.rb +6 -6
  20. data/lib/baldur/engine.rb +3 -3
  21. data/lib/baldur/version.rb +1 -1
  22. data/lib/baldur.rb +5 -5
  23. data/lib/generators/baldur/install/install_generator.rb +19 -19
  24. data/lib/generators/baldur/install/templates/baldur_initializer.rb +7 -7
  25. data/lib/generators/baldur/install/templates/theme.css +32 -6
  26. data/lib/generators/baldur/install_google_auth/install_google_auth_generator.rb +2 -2
  27. data/lib/generators/baldur/install_panel_right/install_panel_right_generator.rb +2 -2
  28. data/lib/generators/baldur/install_panel_secondary/install_panel_secondary_generator.rb +3 -3
  29. data/script/verify_host_install +59 -31
  30. data/test/confirmation_modal_helper_test.rb +34 -34
  31. data/test/csp_rendering_test.rb +21 -21
  32. data/test/engine_css_test.rb +36 -0
  33. data/test/fixtures/shared/_brand_lockup.html.erb +1 -0
  34. data/test/gemspec_test.rb +7 -5
  35. data/test/install_generator_test.rb +25 -21
  36. data/test/install_panel_secondary_generator_test.rb +12 -9
  37. data/test/marketing_helper_test.rb +7 -7
  38. data/test/run_all.rb +1 -1
  39. data/test/sidebar_helper_test.rb +16 -16
  40. data/test/test_helper.rb +14 -14
  41. data/test/theme_toggle_helper_test.rb +119 -0
  42. data/test/tmp/install_generator/app/assets/stylesheets/theme.css +32 -6
  43. data/test/tmp/install_generator/config/initializers/baldur.rb +7 -7
  44. metadata +5 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 633d727781f1701dcac870818b72d1c8df5ea9392cee702502ce5bd45aa1ef8a
4
- data.tar.gz: aa155789ea73b321dff4cb7d795e5291c7613cbcff8b24142558c8b9cd0e3700
3
+ metadata.gz: 78855406a91b2417ca33ff60e13c9b7c11f14b8304fd345dda2712498e92ea1f
4
+ data.tar.gz: e4271f4e6e56175c8c537ecbd039f28c86e9b402fe3dfaa48f6b15dcf91e1c48
5
5
  SHA512:
6
- metadata.gz: 00f499098c0a6cd6bd35aa0819e9978e63648f23d3c7e1b1e57f90c3b6775338beb54fbf956e3e1185666b89362e523e39fadb9403c7722b1d97c4353530a568
7
- data.tar.gz: e45efa594d08c3271fa53a2b56319d92e97e270c2610595c5ff01ce16b9a8d3e7a6b4ece4da564d82ccb8b5e42f80c0160611dc2ae92a51c7e855be9c94a4113
6
+ metadata.gz: 79de8f945a7e8abc81fb08ec45231be9d844c7ba4d6351365db3230e0a71b1e46e4e04b64d9df812d120fcd3a54f25f3db6be642a528eda987b6a90acd59251a
7
+ data.tar.gz: bf09d3939dce71f98dd77f68d3351ff4cf99ebc6daaa17f1dee2ecced26bd5f862cb2744a961af1c5cbc1924025356a9e6f2a51ac2a1fc475161315e1ca180cb
data/Gemfile CHANGED
@@ -1,3 +1,3 @@
1
- source "https://rubygems.org"
1
+ source 'https://rubygems.org'
2
2
 
3
3
  gemspec
data/TODO.md CHANGED
@@ -1,5 +1,7 @@
1
1
  # Baldur TODO
2
2
 
3
+ - [ ] Consider `pagy` gem for tables component
4
+
3
5
  ## Install and Verification
4
6
  - [ ] Harden `baldur:install` so host assumptions are reduced
5
7
  - [ ] Audit generated controller shims against all shipped components
@@ -19,6 +21,7 @@
19
21
  - [ ] Add starter settings page layout
20
22
  - [ ] Add starter CRUD index/show/form templates
21
23
  - [ ] Add starter dashboard shell/page templates
24
+ - [ ] Add boilerplate page template with page title component
22
25
 
23
26
  ## Forms
24
27
  - [ ] Add Rails form-builder integration for Baldur fields
@@ -29,11 +32,14 @@
29
32
  - [ ] Add a higher-level resource index pattern on top of existing table primitives
30
33
  - [ ] Support search, filters, row actions, bulk select, and empty states
31
34
  - [ ] Document recommended resource index composition
35
+ - [ ] Table accessibility: add <caption> or aria-label to admin tables
32
36
 
33
37
  ## Theming
34
38
  - [ ] Add a small set of starter theme presets
39
+ - [ ] Add first-class `ui_theme_toggle` helper/component so hosts do not need to copy Mimir toggle partial
35
40
  - [ ] Improve dark-mode/theme controller documentation
36
- - [ ] Document brand-token customization more clearly
41
+ - [ ] Theme toggle on auth page templates need top rail
42
+ - [ ] Document brand-token customization more clearly
37
43
 
38
44
  ## Accessibility
39
45
  - [ ] Audit keyboard and focus behavior across interactive components
@@ -14,6 +14,13 @@
14
14
  margin-inline: auto;
15
15
  }
16
16
 
17
+ .auth-page__top-rail {
18
+ display: flex;
19
+ align-items: center;
20
+ justify-content: flex-end;
21
+ margin-bottom: var(--space-4);
22
+ }
23
+
17
24
  .auth-page__brand {
18
25
  display: flex;
19
26
  justify-content: center;
@@ -1,5 +1,5 @@
1
- @source "../../helpers";
2
- @source "../../views";
1
+ @source "../../../helpers";
2
+ @source "../../../views";
3
3
 
4
4
  @import "../../stylesheets/baldur.css";
5
5
  @import "../../stylesheets/baldur_panel_secondary.css";
@@ -3,82 +3,85 @@ module Baldur
3
3
  include Baldur::RenderHelper
4
4
 
5
5
  def ui_marketing_top_nav(links:, primary_action:, theme_toggle: nil, classes: nil, brand: {})
6
- baldur_render "baldur/marketing/top_nav",
7
- links: Array(links),
8
- primary_action: primary_action,
9
- theme_toggle: theme_toggle,
10
- classes: classes,
11
- brand: ui_marketing_resolve_brand(brand)
6
+ baldur_render 'baldur/marketing/top_nav',
7
+ links: Array(links),
8
+ primary_action: primary_action,
9
+ theme_toggle: theme_toggle,
10
+ classes: classes,
11
+ brand: ui_marketing_resolve_brand(brand)
12
12
  end
13
13
 
14
- def ui_marketing_hero_section(variant:, headline:, body:, primary_action:, centerpiece_image:, id: "hero", secondary_action: nil, supporting_action: nil, callouts: [], orbit_sources: [], classes: nil)
15
- baldur_render "baldur/marketing/hero_section",
16
- variant: variant,
17
- headline: headline,
18
- body: body,
19
- primary_action: primary_action,
20
- secondary_action: secondary_action,
21
- supporting_action: supporting_action,
22
- callouts: Array(callouts),
23
- orbit_sources: Array(orbit_sources),
24
- centerpiece_image: centerpiece_image,
25
- id: id,
26
- classes: classes
14
+ def ui_marketing_hero_section(variant:, headline:, body:, primary_action:, centerpiece_image:, id: 'hero',
15
+ secondary_action: nil, supporting_action: nil, callouts: [], orbit_sources: [], classes: nil)
16
+ baldur_render 'baldur/marketing/hero_section',
17
+ variant: variant,
18
+ headline: headline,
19
+ body: body,
20
+ primary_action: primary_action,
21
+ secondary_action: secondary_action,
22
+ supporting_action: supporting_action,
23
+ callouts: Array(callouts),
24
+ orbit_sources: Array(orbit_sources),
25
+ centerpiece_image: centerpiece_image,
26
+ id: id,
27
+ classes: classes
27
28
  end
28
29
 
29
- def ui_marketing_features_section(title:, tabs:, id: "use-cases", description: nil, cta: nil, question_label: "Answers to questions like:", classes: nil)
30
- baldur_render "baldur/marketing/features_section",
31
- title: title,
32
- description: description,
33
- tabs: Array(tabs),
34
- cta: cta,
35
- question_label: question_label,
36
- id: id,
37
- classes: classes
30
+ def ui_marketing_features_section(title:, tabs:, id: 'use-cases', description: nil, cta: nil,
31
+ question_label: 'Answers to questions like:', classes: nil)
32
+ baldur_render 'baldur/marketing/features_section',
33
+ title: title,
34
+ description: description,
35
+ tabs: Array(tabs),
36
+ cta: cta,
37
+ question_label: question_label,
38
+ id: id,
39
+ classes: classes
38
40
  end
39
41
 
40
- def ui_marketing_testimonials_section(variant:, title:, items:, id: "proof", classes: nil)
41
- baldur_render "baldur/marketing/testimonials_section",
42
- variant: variant,
43
- title: title,
44
- items: Array(items),
45
- id: id,
46
- classes: classes
42
+ def ui_marketing_testimonials_section(variant:, title:, items:, id: 'proof', classes: nil)
43
+ baldur_render 'baldur/marketing/testimonials_section',
44
+ variant: variant,
45
+ title: title,
46
+ items: Array(items),
47
+ id: id,
48
+ classes: classes
47
49
  end
48
50
 
49
- def ui_marketing_faq_section(title:, items:, id: "faq", description: nil, classes: nil, container_class: nil)
50
- baldur_render "baldur/marketing/faq_section",
51
- title: title,
52
- description: description,
53
- items: Array(items),
54
- id: id,
55
- classes: classes,
56
- container_class: container_class
51
+ def ui_marketing_faq_section(title:, items:, id: 'faq', description: nil, classes: nil, container_class: nil)
52
+ baldur_render 'baldur/marketing/faq_section',
53
+ title: title,
54
+ description: description,
55
+ items: Array(items),
56
+ id: id,
57
+ classes: classes,
58
+ container_class: container_class
57
59
  end
58
60
 
59
61
  def ui_marketing_cta_banner(banner:, classes: nil)
60
- baldur_render "baldur/marketing/cta_banner", banner: banner, classes: classes
62
+ baldur_render 'baldur/marketing/cta_banner', banner: banner, classes: classes
61
63
  end
62
64
 
63
- def ui_marketing_pricing_tables(headline:, subheadline:, billing_options:, plans:, shared_capabilities:, eyebrow: "Pricing", fair_use_link: nil, classes: nil)
64
- baldur_render "baldur/marketing/pricing_tables",
65
- headline: headline,
66
- subheadline: subheadline,
67
- billing_options: Array(billing_options),
68
- plans: Array(plans),
69
- shared_capabilities: shared_capabilities,
70
- eyebrow: eyebrow,
71
- fair_use_link: fair_use_link,
72
- classes: classes
65
+ def ui_marketing_pricing_tables(headline:, subheadline:, billing_options:, plans:, shared_capabilities:,
66
+ eyebrow: 'Pricing', fair_use_link: nil, classes: nil)
67
+ baldur_render 'baldur/marketing/pricing_tables',
68
+ headline: headline,
69
+ subheadline: subheadline,
70
+ billing_options: Array(billing_options),
71
+ plans: Array(plans),
72
+ shared_capabilities: shared_capabilities,
73
+ eyebrow: eyebrow,
74
+ fair_use_link: fair_use_link,
75
+ classes: classes
73
76
  end
74
77
 
75
78
  def ui_marketing_footer(columns:, description:, copyright: nil, classes: nil, brand: {})
76
- baldur_render "baldur/marketing/footer",
77
- columns: Array(columns),
78
- description: description,
79
- copyright: copyright,
80
- classes: classes,
81
- brand: ui_marketing_resolve_brand(brand)
79
+ baldur_render 'baldur/marketing/footer',
80
+ columns: Array(columns),
81
+ description: description,
82
+ copyright: copyright,
83
+ classes: classes,
84
+ brand: ui_marketing_resolve_brand(brand)
82
85
  end
83
86
 
84
87
  def ui_marketing_render_content(content)
@@ -90,18 +93,18 @@ module Baldur
90
93
  end
91
94
 
92
95
  def ui_marketing_action_string(*actions)
93
- actions.flatten.compact.map(&:to_s).map(&:strip).reject(&:blank?).uniq.join(" ")
96
+ actions.flatten.compact.map(&:to_s).map(&:strip).reject(&:blank?).uniq.join(' ')
94
97
  end
95
98
 
96
99
  def ui_marketing_resolve_brand(overrides = {})
97
100
  configured_brand = ui_marketing_configured_brand
98
101
  override_brand = overrides.to_h.symbolize_keys
99
102
  resolved_brand = configured_brand.merge(override_brand)
100
- resolved_name = resolved_brand[:name].presence || "Brand"
103
+ resolved_name = resolved_brand[:name].presence || 'Brand'
101
104
 
102
105
  resolved_brand[:name] = resolved_name
103
106
  resolved_brand[:wordmark] = resolved_brand[:wordmark].presence || resolved_name
104
- resolved_brand[:logo_src] = resolved_brand[:logo_src].presence || "/icon.png"
107
+ resolved_brand[:logo_src] = resolved_brand[:logo_src].presence || '/icon.png'
105
108
  resolved_brand[:logo_alt] = resolved_brand[:logo_alt].presence || "#{resolved_name} logo"
106
109
  resolved_brand
107
110
  end
@@ -109,13 +112,12 @@ module Baldur
109
112
  def ui_marketing_configured_brand
110
113
  config = Baldur.config
111
114
  brand = if config.respond_to?(:marketing_brand)
112
- config.public_send(:marketing_brand)
113
- elsif config.instance_variable_defined?(:@marketing_brand)
114
- config.instance_variable_get(:@marketing_brand)
115
- end
115
+ config.public_send(:marketing_brand)
116
+ elsif config.instance_variable_defined?(:@marketing_brand)
117
+ config.instance_variable_get(:@marketing_brand)
118
+ end
116
119
 
117
- resolved_brand = brand.respond_to?(:to_h) ? brand.to_h.symbolize_keys : {}
118
- resolved_brand
120
+ brand.respond_to?(:to_h) ? brand.to_h.symbolize_keys : {}
119
121
  end
120
122
  end
121
123
  end
@@ -3,13 +3,15 @@ module Baldur
3
3
  module AuthPageHelper
4
4
  include Baldur::RenderHelper
5
5
 
6
- def ui_auth_page(title:, description:, brand_path: nil, shell_class: nil, card_class: nil, notice: nil, alert: nil, &block)
7
- baldur_render "baldur/optional/auth_page",
6
+ def ui_auth_page(title:, description:, brand_path: nil, shell_class: nil, card_class: nil,
7
+ top_rail: nil, notice: nil, alert: nil, &block)
8
+ baldur_render 'baldur/optional/auth_page',
8
9
  title: title,
9
10
  description: description,
10
11
  brand_path: brand_path,
11
12
  shell_class: shell_class,
12
13
  card_class: card_class,
14
+ top_rail: top_rail,
13
15
  notice: notice,
14
16
  alert: alert,
15
17
  body: block_given? ? capture(&block) : nil
@@ -3,8 +3,8 @@ module Baldur
3
3
  module GoogleAuthHelper
4
4
  include Baldur::RenderHelper
5
5
 
6
- def google_sign_in_button(label: "Sign in with Google", href: nil, block: false, **options)
7
- baldur_render "baldur/optional/google_sign_in_button",
6
+ def google_sign_in_button(label: 'Sign in with Google', href: nil, block: false, **options)
7
+ baldur_render 'baldur/optional/google_sign_in_button',
8
8
  **{
9
9
  label: label,
10
10
  href: href || Baldur.config.default_google_sign_in_path,
@@ -3,8 +3,9 @@ module Baldur
3
3
  module PanelSecondaryHelper
4
4
  include Baldur::RenderHelper
5
5
 
6
- def ui_panel_secondary(id:, title:, trigger_label:, trigger_icon: "message-square", panel_class: nil, trigger_class: nil, shell_class: nil, shell_data: nil, panel_data: nil, trigger_data: nil, &block)
7
- baldur_render "baldur/optional/panel_secondary",
6
+ def ui_panel_secondary(id:, title:, trigger_label:, trigger_icon: 'message-square', panel_class: nil,
7
+ trigger_class: nil, shell_class: nil, shell_data: nil, panel_data: nil, trigger_data: nil, &block)
8
+ baldur_render 'baldur/optional/panel_secondary',
8
9
  id: id,
9
10
  title: title,
10
11
  trigger_label: trigger_label,