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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: aca54f0c619c3d812c0002ce48dbeddb027109f8570fed60404b1cf0352277c6
4
- data.tar.gz: 5a87efee5eee3287cbaadaaeeaa6af98ae8ee2f61473937be04ba1e8e90ceb8d
3
+ metadata.gz: 80327b2565d8fdaa5cc943f1bb0579090705b0db74dd6c2a3b25f7d9f6adcdbf
4
+ data.tar.gz: 2b3b1cdb1afe499744a51d1a6730c96960b02ab5a74bdb07c2514ee75e285ec2
5
5
  SHA512:
6
- metadata.gz: 6cedaa833acffe8ad4253311349b82510ec445147001a7bf6a5bc9cd29d2501cdcb59745bae04027d05fc3c87d81d4993e37442a4453ebcaea53f7af7aa897e4
7
- data.tar.gz: 5515d41dfd27c1e64ee038c8546754fa44a3e765e8d2840f3b0b1d692c3ed7522b3c2d339155e8f383cabbe66947f87f86ad763b8616b1460df85ce1a402bf81
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`:
@@ -2,7 +2,7 @@
2
2
  .alert {
3
3
  display: flex;
4
4
  flex-direction: row;
5
- align-items: flex-start;
5
+ align-items: center;
6
6
  gap: var(--space-3);
7
7
  padding: var(--space-3);
8
8
  border-radius: var(--radius-lg);
@@ -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-md">
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
- <%= body %>
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>
@@ -1,3 +1,3 @@
1
1
  module Baldur
2
- VERSION = "0.1.4".freeze
2
+ VERSION = "0.1.5".freeze
3
3
  end
@@ -1,4 +1,5 @@
1
1
  module UiHelper
2
2
  include Baldur::Compatibility::UiAliases
3
3
  include Baldur::MarketingHelper
4
+ include Baldur::Optional::AuthPageHelper
4
5
  end
@@ -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"
@@ -1,4 +1,5 @@
1
1
  module UiHelper
2
2
  include Baldur::Compatibility::UiAliases
3
3
  include Baldur::MarketingHelper
4
+ include Baldur::Optional::AuthPageHelper
4
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: baldur
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.4
4
+ version: 0.1.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Varun Murkar