anchor_view_components 0.46.1 → 0.47.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 78a74da25b9b3a47ae6f7aaedc69053b8bc1b538d148c920bb0401a0db50ed4c
4
- data.tar.gz: efd5978b26892fbc6843f627f12c261d3b4be701689255cfefd3162267c15b46
3
+ metadata.gz: f701f39d7fa774ffb3175e88d5d81fa961807f92a37bbc4072fd11a085092f01
4
+ data.tar.gz: 64c92e9bca0bad24e38f276233cde81a53b1343c175c77d76907a905c61d5358
5
5
  SHA512:
6
- metadata.gz: 64ca63586bec464e0b7ef3058d712246aaf0e2bedf6010436ced79ea68266ca1ad8185167f4ba1e9516657571c5453f2ca85fc8690e50cf37d9b38d942c49dcb
7
- data.tar.gz: 5ca9fc73741adf51b34e3ec0d53ce136f156f2001aeac251ce0b35c0c5c7e615e3f7950aadf3bb21999ac05d1d434d2dddd97ddbb9e2f448d3024ceed470c578
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,5 +1,6 @@
1
1
  <%= tag.div(**wrapper_options.except(:class).merge({
2
2
  class: class_names("p-6", wrapper_options[:class]),
3
+ data: { testid: "panel-body" }
3
4
  }),
4
5
  ) do %>
5
6
  <%= content %>
@@ -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>
@@ -2,7 +2,8 @@
2
2
  class: class_names(
3
3
  "border-subdued px-6 py-4",
4
4
  "border-b" => active?
5
- )
5
+ ),
6
+ data: { testid: "panel-header" }
6
7
  )) do %>
7
8
  <%= render Anchor::TextComponent.new(variant: :subheading_xs)
8
9
  .with_content(content) %>
@@ -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: } %>
@@ -36,5 +36,9 @@ module Anchor
36
36
  form_builder:
37
37
  )
38
38
  end
39
+
40
+ def testid
41
+ "radio-field-#{attribute.to_s.parameterize.dasherize}"
42
+ end
39
43
  end
40
44
  end
@@ -23,6 +23,10 @@ module Anchor
23
23
  super(**kwargs)
24
24
  end
25
25
 
26
+ def call
27
+ content_tag(tag, content, **wrapper_options)
28
+ end
29
+
26
30
  private
27
31
 
28
32
  attr_reader :tag
@@ -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|
@@ -1,5 +1,5 @@
1
1
  module Anchor
2
2
  module ViewComponents
3
- VERSION = "0.46.1".freeze
3
+ VERSION = "0.47.0".freeze
4
4
  end
5
5
  end
@@ -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.46.1
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-01-22 00:00:00.000000000 Z
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
@@ -1,3 +0,0 @@
1
- <%= content_tag(tag, **wrapper_options) do %>
2
- <%= content %>
3
- <% end %>