view_primitives 0.1.2 → 0.1.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/CHANGELOG.md +6 -0
- data/lib/generators/view_primitives/add/templates/form_field/form_field_component.rb.tt +3 -3
- data/lib/generators/view_primitives/add/templates/input_otp/input_otp_component.rb.tt +1 -1
- data/lib/generators/view_primitives/add/templates/qr_code/qr_code_component.rb.tt +3 -3
- data/lib/view_primitives/version.rb +1 -1
- 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: c95b5b096babd8416b53c83c883124d89f992814d19ef7d262c731abc9ac5ffa
|
|
4
|
+
data.tar.gz: 16744aa30b37e6bad9995dc8e792b5fdbe28300555577aab8361db78f4cc4e6f
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 5b588f79626af5d772a3616518198def45d7e918ff703fb937ce32ff17cc78edc135452b22243c2b14e878f6076149ea647cb93f65113deb88ca70dc96e99417
|
|
7
|
+
data.tar.gz: 18f9fca991217855a0c169ca9b8d8c44cbca7f31e5e642f851b366e71b43ddc5960afcc4145e197dd1e50e7885001dc351cfe4cc96134a08c22fcde6f8e5df8c
|
data/CHANGELOG.md
CHANGED
|
@@ -7,6 +7,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
7
7
|
|
|
8
8
|
## [Unreleased]
|
|
9
9
|
|
|
10
|
+
## [0.1.3] - 2026-06-04
|
|
11
|
+
|
|
12
|
+
### Fixed
|
|
13
|
+
|
|
14
|
+
- `AddGenerator` template files for `form_field`, `input_otp`, and `qr_code` contained unescaped ERB tags (`<%= %>` / `<% %>`) inside Ruby comments; the stricter ERB parser in Ruby 4.0 raised `SyntaxError` when processing these `.tt` files, making those three components impossible to generate; fixed by escaping the comment-only tags as `<%%=` / `<%%`
|
|
15
|
+
|
|
10
16
|
## [0.1.2] - 2026-06-04
|
|
11
17
|
|
|
12
18
|
### Fixed
|
|
@@ -4,9 +4,9 @@ module UI
|
|
|
4
4
|
# Wraps a label + input + optional hint and error message into a consistent field layout.
|
|
5
5
|
#
|
|
6
6
|
# Usage:
|
|
7
|
-
#
|
|
8
|
-
#
|
|
9
|
-
#
|
|
7
|
+
# <%%= ui :form_field, label: "Email", error: @user.errors[:email].first do %>
|
|
8
|
+
# <%%= ui :input, type: "email", name: "user[email]", id: "user_email" %>
|
|
9
|
+
# <%% end %>
|
|
10
10
|
class FormFieldComponent < ApplicationComponent
|
|
11
11
|
def initialize(label: nil, hint: nil, error: nil, required: false, **html_attrs)
|
|
12
12
|
@label = label
|
|
@@ -6,7 +6,7 @@ module UI
|
|
|
6
6
|
# Renders N individual single-character inputs that auto-advance on entry.
|
|
7
7
|
#
|
|
8
8
|
# Usage:
|
|
9
|
-
#
|
|
9
|
+
# <%%= ui :input_otp, length: 6, name: "otp" %>
|
|
10
10
|
|
|
11
11
|
CELL_CLS = "h-12 w-10 rounded-md border border-input bg-transparent text-center text-lg font-medium " \
|
|
12
12
|
"shadow-xs transition-[color,box-shadow] outline-none " \
|
|
@@ -8,9 +8,9 @@ module UI
|
|
|
8
8
|
# 1. src: — pass a pre-rendered image URL (e.g. from an API or Rails asset)
|
|
9
9
|
# 2. Block — pass raw SVG or HTML generated by a gem such as rqrcode:
|
|
10
10
|
#
|
|
11
|
-
#
|
|
12
|
-
#
|
|
13
|
-
#
|
|
11
|
+
# <%%= ui :qr_code, size: 200 do %>
|
|
12
|
+
# <%%= RQRCode::QRCode.new("https://example.com").as_svg(viewbox: true).html_safe %>
|
|
13
|
+
# <%% end %>
|
|
14
14
|
|
|
15
15
|
WRAPPER_CLS = "inline-flex items-center justify-center overflow-hidden rounded-lg bg-white p-3"
|
|
16
16
|
|