anchor_view_components 0.46.1 → 0.47.0
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 +13 -0
- data/README.md +9 -0
- data/app/components/anchor/input_component.rb +5 -1
- data/app/components/anchor/panel/body_component.html.erb +1 -0
- data/app/components/anchor/panel/footer_component.html.erb +2 -2
- data/app/components/anchor/panel/header_component.html.erb +2 -1
- data/app/components/anchor/radio_button_collection_component.html.erb +1 -1
- data/app/components/anchor/radio_button_collection_component.rb +4 -0
- data/app/components/anchor/text_component.rb +4 -0
- data/app/helpers/anchor/form_builder.rb +14 -0
- data/lib/anchor/view_components/version.rb +1 -1
- data/previews/forms/default.html.erb +12 -0
- metadata +2 -3
- data/app/components/anchor/text_component.html.erb +0 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f701f39d7fa774ffb3175e88d5d81fa961807f92a37bbc4072fd11a085092f01
|
4
|
+
data.tar.gz: 64c92e9bca0bad24e38f276233cde81a53b1343c175c77d76907a905c61d5358
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1344766f080f5c8f1fab3c923ee39ba89b5f397aa8dcf62214014a780523976c23d5383f7f77f649e5dac45748024aad8d5ae664b16e05ecea24c414d2d9edfa
|
7
|
+
data.tar.gz: 85f9f0d2a6f0114be1955f88a37d41be771baf35b870f6c44e3381e267e4f1104a2fc9256e9b69f864a492a285ece4a58a475ee5b647398df25aa61e7b08e10d
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,18 @@
|
|
1
1
|
# Changelog
|
2
2
|
|
3
|
+
## 0.47.0
|
4
|
+
|
5
|
+
### Minor Changes
|
6
|
+
|
7
|
+
- 6446e5c: Adding time only input
|
8
|
+
- 3c41909: Adding test ids to panel component
|
9
|
+
- 802aab6: Adding background color for disabled input fields
|
10
|
+
- b37a471: Auto generate testid for the radio button collection component
|
11
|
+
|
12
|
+
### Patch Changes
|
13
|
+
|
14
|
+
- 7672ffd: remove whitespace from anchor_text
|
15
|
+
|
3
16
|
## 0.46.1
|
4
17
|
|
5
18
|
### Patch Changes
|
data/README.md
CHANGED
@@ -64,6 +64,15 @@ To see component previews:
|
|
64
64
|
- Go to the `demo/` directory, install dependencies, and run `bin/dev`
|
65
65
|
- See the components at http://localhost:3000
|
66
66
|
|
67
|
+
### Using local changes in another application (i.e. BuoyRails)
|
68
|
+
- Run `yarn build:css --watch`
|
69
|
+
- In target app, update the Gemfile to point to the this checked out directory
|
70
|
+
- `gem "anchor_view_components", path: "../anchor_view_components"`
|
71
|
+
- In target app, update the Package.json to point to the this checked out directory
|
72
|
+
- `"@buoysoftware/anchor-view-components": "file:../anchor_view_components"`
|
73
|
+
- Run `bundle install && yarn install`
|
74
|
+
- Start or restart App and now all changes should reflect immediately
|
75
|
+
|
67
76
|
## Releasing
|
68
77
|
|
69
78
|
See [RELEASING.md](RELEASING.md)
|
@@ -23,6 +23,7 @@ module Anchor
|
|
23
23
|
form_builder:,
|
24
24
|
attribute:,
|
25
25
|
type:,
|
26
|
+
disabled: false,
|
26
27
|
starting_icon: nil,
|
27
28
|
ending_icon: nil,
|
28
29
|
**kwargs
|
@@ -30,22 +31,25 @@ module Anchor
|
|
30
31
|
@form_builder = form_builder
|
31
32
|
@attribute = attribute
|
32
33
|
@type = type
|
34
|
+
@disabled = disabled
|
33
35
|
@starting_icon = starting_icon
|
34
36
|
@ending_icon = ending_icon
|
35
37
|
|
36
38
|
super(**kwargs)
|
37
39
|
end
|
38
40
|
|
39
|
-
attr_reader :attribute, :type, :starting_icon, :ending_icon
|
41
|
+
attr_reader :attribute, :type, :disabled, :starting_icon, :ending_icon
|
40
42
|
|
41
43
|
def options
|
42
44
|
{
|
43
45
|
class: class_names(
|
44
46
|
INPUT_CLASSES,
|
47
|
+
"bg-neutral" => disabled,
|
45
48
|
"pl-11" => starting_icon?,
|
46
49
|
"pr-11" => ending_icon?
|
47
50
|
),
|
48
51
|
data: { testid: },
|
52
|
+
disabled:,
|
49
53
|
}
|
50
54
|
end
|
51
55
|
|
@@ -1,9 +1,9 @@
|
|
1
|
-
<div class="border-t border-subdued flex p-6 items-center">
|
1
|
+
<div class="border-t border-subdued flex p-6 items-center" data-testid="panel-footer">
|
2
2
|
<% if supporting_text? %>
|
3
3
|
<span class="text-base text-primary font-semibold"><%= supporting_text %></span>
|
4
4
|
<% end %>
|
5
5
|
|
6
|
-
<div class="ml-auto">
|
6
|
+
<div class="ml-auto" data-testid="panel-actions">
|
7
7
|
<%= primary_action %>
|
8
8
|
</div>
|
9
9
|
</div>
|
@@ -1 +1 @@
|
|
1
|
-
<%= tag.div content, class: "flex flex-col space-y-2 text-base" %>
|
1
|
+
<%= tag.div content, class: "flex flex-col space-y-2 text-base", data: { testid: } %>
|
@@ -171,6 +171,20 @@ module Anchor
|
|
171
171
|
form_builder: self,
|
172
172
|
attribute:,
|
173
173
|
type: :text,
|
174
|
+
disabled: options.delete(:disabled),
|
175
|
+
starting_icon: options.delete(:starting_icon),
|
176
|
+
ending_icon: options.delete(:ending_icon)
|
177
|
+
) do |component|
|
178
|
+
super(attribute, component.options.merge(options))
|
179
|
+
end
|
180
|
+
end
|
181
|
+
|
182
|
+
def time_field(attribute, options = {})
|
183
|
+
render InputComponent.new(
|
184
|
+
form_builder: self,
|
185
|
+
attribute:,
|
186
|
+
type: :time,
|
187
|
+
disabled: options.delete(:disabled),
|
174
188
|
starting_icon: options.delete(:starting_icon),
|
175
189
|
ending_icon: options.delete(:ending_icon)
|
176
190
|
) do |component|
|
@@ -12,6 +12,12 @@
|
|
12
12
|
<%= form.error_message_for :email %>
|
13
13
|
<% end %>
|
14
14
|
|
15
|
+
<%= tag.div do %>
|
16
|
+
<%= form.label :name %>
|
17
|
+
<%= form.text_field :name, disabled: true %>
|
18
|
+
<%= form.error_message_for :name %>
|
19
|
+
<% end %>
|
20
|
+
|
15
21
|
<%= tag.div do %>
|
16
22
|
<%= form.label :number_stepper %>
|
17
23
|
<%= form.number_field :number_stepper %>
|
@@ -47,6 +53,12 @@
|
|
47
53
|
<%= form.error_message_for :last_login_at %>
|
48
54
|
<% end %>
|
49
55
|
|
56
|
+
<%= tag.div do %>
|
57
|
+
<%= form.label :sunrise_at %>
|
58
|
+
<%= form.time_field :sunrise_at %>
|
59
|
+
<%= form.error_message_for :sunrise_at %>
|
60
|
+
<% end %>
|
61
|
+
|
50
62
|
<%= tag.div do %>
|
51
63
|
<%= form.check_box :allows_email_marketing %>
|
52
64
|
<%= form.label :allows_email_marketing %>
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: anchor_view_components
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.47.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Buoy Software
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-
|
11
|
+
date: 2024-02-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -179,7 +179,6 @@ files:
|
|
179
179
|
- app/components/anchor/table_component.en.yml
|
180
180
|
- app/components/anchor/table_component.html.erb
|
181
181
|
- app/components/anchor/table_component.rb
|
182
|
-
- app/components/anchor/text_component.html.erb
|
183
182
|
- app/components/anchor/text_component.rb
|
184
183
|
- app/components/anchor/toast_component.html.erb
|
185
184
|
- app/components/anchor/toast_component.rb
|