anchor_view_components 0.46.1 → 0.48.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 +21 -0
- data/README.md +9 -0
- data/app/assets/images/icons/open-new-window.svg +5 -0
- data/app/components/anchor/banner_component.html.erb +1 -0
- data/app/components/anchor/banner_component.rb +4 -0
- data/app/components/anchor/button_component.html.erb +1 -1
- data/app/components/anchor/button_component.rb +3 -3
- data/app/components/anchor/filter_component.html.erb +1 -1
- data/app/components/anchor/filter_component.rb +1 -1
- 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/panel_component.html.erb +1 -0
- data/app/components/anchor/panel_component.rb +4 -0
- 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/components/anchor/toast_component.html.erb +1 -1
- data/app/components/anchor/toast_component.rb +1 -1
- 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 +3 -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: da98942975137fa343cc58ad7fb08de5d92470a8f6a287924dda11562d7d6ebf
|
4
|
+
data.tar.gz: e4d301b64276b42c52732ee10aba4f4c6a54e53495c24920ec8341e73d52b0fc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1614e7d9ee23d0c32a56d7fa3c2e4d396045de15e4cedc8f2ea19f23b70877d9009a59c8709e1471220b35c11101816d86d2f7e851160c713e74c1aae5fb9e66
|
7
|
+
data.tar.gz: 1bebc7268fde9116e11a2684ea58b0cda6d9d6a44de32ca9b51e7284eb816584cb064eff682e0b299321c808624e6135b661dc8cc26cd4864e0c0ae2caa12835
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,26 @@
|
|
1
1
|
# Changelog
|
2
2
|
|
3
|
+
## 0.48.0
|
4
|
+
|
5
|
+
### Minor Changes
|
6
|
+
|
7
|
+
- 49a05e0: added data testids to banner component
|
8
|
+
- d9925cb: Added a test ID to the panel component (`panel-component`) with the option to pass in a custom ID.
|
9
|
+
- f55a733: Add open-new-window icon
|
10
|
+
|
11
|
+
## 0.47.0
|
12
|
+
|
13
|
+
### Minor Changes
|
14
|
+
|
15
|
+
- 6446e5c: Adding time only input
|
16
|
+
- 3c41909: Adding test ids to panel component
|
17
|
+
- 802aab6: Adding background color for disabled input fields
|
18
|
+
- b37a471: Auto generate testid for the radio button collection component
|
19
|
+
|
20
|
+
### Patch Changes
|
21
|
+
|
22
|
+
- 7672ffd: remove whitespace from anchor_text
|
23
|
+
|
3
24
|
## 0.46.1
|
4
25
|
|
5
26
|
### 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)
|
@@ -0,0 +1,5 @@
|
|
1
|
+
<!-- Source: Iconoir, added via `bin/add_icon` -->
|
2
|
+
<svg width="24" height="24" viewBox="0 0 24 24" stroke-width="1.5" fill="none" xmlns="http://www.w3.org/2000/svg">
|
3
|
+
<path d="M21 3L15 3M21 3L12 12M21 3V9" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round"/>
|
4
|
+
<path d="M21 13V19C21 20.1046 20.1046 21 19 21H5C3.89543 21 3 20.1046 3 19V5C3 3.89543 3.89543 3 5 3H11" stroke="currentColor" stroke-linecap="round"/>
|
5
|
+
</svg>
|
@@ -76,14 +76,14 @@ module Anchor
|
|
76
76
|
element == :a ? nil : @disabled
|
77
77
|
end
|
78
78
|
|
79
|
-
def
|
79
|
+
def testid
|
80
80
|
wrapper_options.dig(
|
81
81
|
:data,
|
82
82
|
:testid
|
83
|
-
) ||
|
83
|
+
) || generated_testid
|
84
84
|
end
|
85
85
|
|
86
|
-
def
|
86
|
+
def generated_testid
|
87
87
|
"#{strip_tags(content).to_s.parameterize}-button"
|
88
88
|
end
|
89
89
|
end
|
@@ -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.48.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-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -67,6 +67,7 @@ files:
|
|
67
67
|
- app/assets/images/icons/nav-arrow-down.svg
|
68
68
|
- app/assets/images/icons/nav-arrow-left.svg
|
69
69
|
- app/assets/images/icons/nav-arrow-right.svg
|
70
|
+
- app/assets/images/icons/open-new-window.svg
|
70
71
|
- app/assets/images/icons/paste-clipboard.svg
|
71
72
|
- app/assets/images/icons/percentage.svg
|
72
73
|
- app/assets/images/icons/plus.svg
|
@@ -179,7 +180,6 @@ files:
|
|
179
180
|
- app/components/anchor/table_component.en.yml
|
180
181
|
- app/components/anchor/table_component.html.erb
|
181
182
|
- app/components/anchor/table_component.rb
|
182
|
-
- app/components/anchor/text_component.html.erb
|
183
183
|
- app/components/anchor/text_component.rb
|
184
184
|
- app/components/anchor/toast_component.html.erb
|
185
185
|
- app/components/anchor/toast_component.rb
|