baldur 0.1.4 → 0.1.5
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/README.md +22 -0
- data/app/assets/stylesheets/baldur/application/components/alert.css +1 -1
- data/app/helpers/baldur/optional/auth_page_helper.rb +3 -1
- data/app/views/baldur/optional/_auth_page.html.erb +12 -2
- data/lib/baldur/version.rb +1 -1
- data/lib/generators/baldur/install/templates/ui_helper.rb +1 -0
- data/test/install_generator_test.rb +1 -0
- data/test/tmp/install_generator/app/helpers/ui_helper.rb +1 -0
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 80327b2565d8fdaa5cc943f1bb0579090705b0db74dd6c2a3b25f7d9f6adcdbf
|
|
4
|
+
data.tar.gz: 2b3b1cdb1afe499744a51d1a6730c96960b02ab5a74bdb07c2514ee75e285ec2
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: b6ebcf467140155f886ceaf527e6ab31dfa7355ff354dd915b946ecbf99d5e930cec642fbbae600aaf5b6764d0990a204666324ca629a2b841a55ee054e2751c
|
|
7
|
+
data.tar.gz: d808d8f446683918d816792904a5a25095e83c597536314e2e904ec2b91b5240637d9a70600d55dd83aa415b6cdb2734aa09f761bbfb815e217b0894dfc29ed4
|
data/README.md
CHANGED
|
@@ -43,6 +43,10 @@ bundle exec rails generate baldur:install_panel_secondary
|
|
|
43
43
|
bundle exec rails generate baldur:install_google_auth
|
|
44
44
|
```
|
|
45
45
|
|
|
46
|
+
`baldur:install` now includes `Baldur::Optional::AuthPageHelper` in generated `UiHelper`, so `ui_auth_page` is available by default after base install.
|
|
47
|
+
|
|
48
|
+
The generators above are still optional and only required when using those specific surfaces.
|
|
49
|
+
|
|
46
50
|
Default install behavior keeps Geist loaded through the host `fonts.css` scaffold. If a host app wants a different stack, it should update `fonts.css` and then map the loaded families in `theme.css`.
|
|
47
51
|
|
|
48
52
|
## Security
|
|
@@ -84,6 +88,8 @@ Tailwind provides the utility/base layer. Baldur is the source of truth for shar
|
|
|
84
88
|
|
|
85
89
|
Canonical Ruby internals live under `Baldur::*`, but the default DX is `ui_*` helpers through the generated `UiHelper` include.
|
|
86
90
|
|
|
91
|
+
Not every `ui_*` helper is part of the base install. Some helpers belong to optional surfaces and require the matching generator. `ui_auth_page` is part of the default install; `ui_panel_secondary` and google-auth helpers are optional.
|
|
92
|
+
|
|
87
93
|
Examples:
|
|
88
94
|
|
|
89
95
|
```erb
|
|
@@ -119,6 +125,22 @@ For modals, prefer `ui_modal` directly:
|
|
|
119
125
|
<% end %>
|
|
120
126
|
```
|
|
121
127
|
|
|
128
|
+
For auth layouts, use `ui_auth_page` (available after `baldur:install`):
|
|
129
|
+
|
|
130
|
+
```erb
|
|
131
|
+
<%= ui_auth_page(title: "Sign in", description: nil, brand_path: root_path) do %>
|
|
132
|
+
<%= yield %>
|
|
133
|
+
<% end %>
|
|
134
|
+
```
|
|
135
|
+
|
|
136
|
+
Auth flash messaging can be rendered inside the card by passing `notice:` / `alert:`:
|
|
137
|
+
|
|
138
|
+
```erb
|
|
139
|
+
<%= ui_auth_page(title: "Sign in", description: nil, brand_path: root_path, notice: notice, alert: alert) do %>
|
|
140
|
+
<%= yield %>
|
|
141
|
+
<% end %>
|
|
142
|
+
```
|
|
143
|
+
|
|
122
144
|
If a host app keeps a shared wrapper partial around `ui_modal`, treat `modal_body:` as the wrapper-local input and let the wrapper pass that content into `ui_modal`. Avoid calling a wrapper with `body:` through `render`, since `body` collides with Rails render options.
|
|
123
145
|
|
|
124
146
|
For horizontal primary/secondary CTA groups, prefer `ui_action_row`:
|
|
@@ -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, &block)
|
|
6
|
+
def ui_auth_page(title:, description:, brand_path: nil, shell_class: nil, card_class: nil, notice: nil, alert: nil, &block)
|
|
7
7
|
baldur_render "baldur/optional/auth_page",
|
|
8
8
|
title: title,
|
|
9
9
|
description: description,
|
|
10
10
|
brand_path: brand_path,
|
|
11
11
|
shell_class: shell_class,
|
|
12
12
|
card_class: card_class,
|
|
13
|
+
notice: notice,
|
|
14
|
+
alert: alert,
|
|
13
15
|
body: block_given? ? capture(&block) : nil
|
|
14
16
|
end
|
|
15
17
|
end
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
%>
|
|
6
6
|
|
|
7
7
|
<div class="<%= auth_shell_classes %>">
|
|
8
|
-
<div class="mx-auto max-w-
|
|
8
|
+
<div class="mx-auto max-w-lg">
|
|
9
9
|
<div class="mb-6 flex justify-center">
|
|
10
10
|
<%= link_to resolved_brand_path, class: "inline-flex items-center justify-center no-underline" do %>
|
|
11
11
|
<%= render "shared/brand_lockup",
|
|
@@ -15,7 +15,17 @@
|
|
|
15
15
|
</div>
|
|
16
16
|
|
|
17
17
|
<%= ui_card(title: title, description: description, classes: auth_card_class || "shadow-sm") do %>
|
|
18
|
-
|
|
18
|
+
<div class="space-y-4">
|
|
19
|
+
<%= body %>
|
|
20
|
+
|
|
21
|
+
<% if local_assigns[:notice].present? %>
|
|
22
|
+
<%= ui_alert(body: local_assigns[:notice], variant: :success) %>
|
|
23
|
+
<% end %>
|
|
24
|
+
|
|
25
|
+
<% if local_assigns[:alert].present? %>
|
|
26
|
+
<%= ui_alert(body: local_assigns[:alert], variant: :error) %>
|
|
27
|
+
<% end %>
|
|
28
|
+
</div>
|
|
19
29
|
<% end %>
|
|
20
30
|
</div>
|
|
21
31
|
</div>
|
data/lib/baldur/version.rb
CHANGED
|
@@ -26,6 +26,7 @@ class BaldurInstallGeneratorTest < Rails::Generators::TestCase
|
|
|
26
26
|
assert_operator tailwind_source.index("@import \"../builds/tailwind/baldur.css\";"), :<, tailwind_source.index("@import \"../stylesheets/theme.css\";")
|
|
27
27
|
|
|
28
28
|
assert_file "app/helpers/ui_helper.rb"
|
|
29
|
+
assert_file "app/helpers/ui_helper.rb", /include Baldur::Optional::AuthPageHelper/
|
|
29
30
|
assert_file "config/initializers/baldur.rb"
|
|
30
31
|
assert_file "app/assets/stylesheets/fonts.css"
|
|
31
32
|
assert_file "app/assets/stylesheets/theme.css"
|