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.
- checksums.yaml +4 -4
- data/Gemfile +1 -1
- data/TODO.md +7 -1
- data/app/assets/stylesheets/baldur/application/components/auth-page.css +7 -0
- data/app/assets/tailwind/baldur/engine.css +2 -2
- data/app/helpers/baldur/marketing_helper.rb +71 -69
- data/app/helpers/baldur/optional/auth_page_helper.rb +4 -2
- data/app/helpers/baldur/optional/google_auth_helper.rb +2 -2
- data/app/helpers/baldur/optional/panel_secondary_helper.rb +3 -2
- data/app/helpers/baldur/ui_helper.rb +151 -138
- data/app/helpers/baldur/ui_helper_feedback.rb +38 -36
- data/app/helpers/baldur/ui_helper_forms.rb +81 -76
- data/app/helpers/baldur/ui_helper_sidebar.rb +6 -5
- data/app/helpers/baldur/ui_helper_unavailable.rb +17 -15
- data/app/views/baldur/components/_theme_toggle.html.erb +23 -0
- data/app/views/baldur/optional/_auth_page.html.erb +6 -0
- data/baldur.gemspec +23 -23
- data/config/importmap.rb +2 -2
- data/lib/baldur/configuration.rb +6 -6
- data/lib/baldur/engine.rb +3 -3
- data/lib/baldur/version.rb +1 -1
- data/lib/baldur.rb +5 -5
- data/lib/generators/baldur/install/install_generator.rb +19 -19
- data/lib/generators/baldur/install/templates/baldur_initializer.rb +7 -7
- data/lib/generators/baldur/install/templates/theme.css +32 -6
- data/lib/generators/baldur/install_google_auth/install_google_auth_generator.rb +2 -2
- data/lib/generators/baldur/install_panel_right/install_panel_right_generator.rb +2 -2
- data/lib/generators/baldur/install_panel_secondary/install_panel_secondary_generator.rb +3 -3
- data/script/verify_host_install +59 -31
- data/test/confirmation_modal_helper_test.rb +34 -34
- data/test/csp_rendering_test.rb +21 -21
- data/test/engine_css_test.rb +36 -0
- data/test/fixtures/shared/_brand_lockup.html.erb +1 -0
- data/test/gemspec_test.rb +7 -5
- data/test/install_generator_test.rb +25 -21
- data/test/install_panel_secondary_generator_test.rb +12 -9
- data/test/marketing_helper_test.rb +7 -7
- data/test/run_all.rb +1 -1
- data/test/sidebar_helper_test.rb +16 -16
- data/test/test_helper.rb +14 -14
- data/test/theme_toggle_helper_test.rb +119 -0
- data/test/tmp/install_generator/app/assets/stylesheets/theme.css +32 -6
- data/test/tmp/install_generator/config/initializers/baldur.rb +7 -7
- metadata +5 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 78855406a91b2417ca33ff60e13c9b7c11f14b8304fd345dda2712498e92ea1f
|
|
4
|
+
data.tar.gz: e4271f4e6e56175c8c537ecbd039f28c86e9b402fe3dfaa48f6b15dcf91e1c48
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 79de8f945a7e8abc81fb08ec45231be9d844c7ba4d6351365db3230e0a71b1e46e4e04b64d9df812d120fcd3a54f25f3db6be642a528eda987b6a90acd59251a
|
|
7
|
+
data.tar.gz: bf09d3939dce71f98dd77f68d3351ff4cf99ebc6daaa17f1dee2ecced26bd5f862cb2744a961af1c5cbc1924025356a9e6f2a51ac2a1fc475161315e1ca180cb
|
data/Gemfile
CHANGED
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
|
-
- [ ]
|
|
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
|
|
@@ -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
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
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:
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
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:
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
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:
|
|
41
|
-
baldur_render
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
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:
|
|
50
|
-
baldur_render
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
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
|
|
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:,
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
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
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
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 ||
|
|
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 ||
|
|
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
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
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
|
-
|
|
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,
|
|
7
|
-
|
|
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:
|
|
7
|
-
baldur_render
|
|
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:
|
|
7
|
-
|
|
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,
|