anchor_view_components 0.46.1 → 0.48.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: da98942975137fa343cc58ad7fb08de5d92470a8f6a287924dda11562d7d6ebf
4
+ data.tar.gz: e4d301b64276b42c52732ee10aba4f4c6a54e53495c24920ec8341e73d52b0fc
5
5
  SHA512:
6
- metadata.gz: 64ca63586bec464e0b7ef3058d712246aaf0e2bedf6010436ced79ea68266ca1ad8185167f4ba1e9516657571c5453f2ca85fc8690e50cf37d9b38d942c49dcb
7
- data.tar.gz: 5ca9fc73741adf51b34e3ec0d53ce136f156f2001aeac251ce0b35c0c5c7e615e3f7950aadf3bb21999ac05d1d434d2dddd97ddbb9e2f448d3024ceed470c578
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>
@@ -1,5 +1,6 @@
1
1
  <%= tag.div(**merge_options(wrapper_options, {
2
2
  class: "flex gap-2 p-4 rounded",
3
+ data: { testid: }
3
4
  })) do %>
4
5
  <%= anchor_icon(
5
6
  icon:,
@@ -48,5 +48,9 @@ module Anchor
48
48
  def render?
49
49
  title? || body?
50
50
  end
51
+
52
+ def testid
53
+ "banner-component"
54
+ end
51
55
  end
52
56
  end
@@ -8,7 +8,7 @@
8
8
  "btn-with-ending-icon" => ending_icon?,
9
9
  "btn-full-width" => full_width,
10
10
  ),
11
- data: { testid: test_id },
11
+ data: { testid: },
12
12
  disabled: disabled,
13
13
  href: href,
14
14
  type: type,
@@ -76,14 +76,14 @@ module Anchor
76
76
  element == :a ? nil : @disabled
77
77
  end
78
78
 
79
- def test_id
79
+ def testid
80
80
  wrapper_options.dig(
81
81
  :data,
82
82
  :testid
83
- ) || generated_test_id
83
+ ) || generated_testid
84
84
  end
85
85
 
86
- def generated_test_id
86
+ def generated_testid
87
87
  "#{strip_tags(content).to_s.parameterize}-button"
88
88
  end
89
89
  end
@@ -5,7 +5,7 @@
5
5
  type: :button,
6
6
  **popover.popover_trigger_attributes(
7
7
  popovertarget: popover_id,
8
- data: { testid: test_id(:description) }
8
+ data: { testid: testid(:description) }
9
9
  )
10
10
  ) do %>
11
11
  <span class="font-semibold uppercase mr-2"><%= label %>:</span>
@@ -52,7 +52,7 @@ module Anchor
52
52
  end
53
53
  end
54
54
 
55
- def test_id(action = nil)
55
+ def testid(action = nil)
56
56
  ["filter", action, param_key.to_s.dasherize].compact.join("-")
57
57
  end
58
58
 
@@ -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,5 +1,6 @@
1
1
  <%= tag.div(**merge_options(wrapper_options,
2
2
  class: "border border-subdued",
3
+ data: { testid: }
3
4
  )) do %>
4
5
  <%= header %>
5
6
 
@@ -16,5 +16,9 @@ module Anchor
16
16
  def active?
17
17
  @active == true
18
18
  end
19
+
20
+ def testid
21
+ wrapper_options.dig(:data, :testid) || "panel-component"
22
+ end
19
23
  end
20
24
  end
@@ -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
@@ -4,7 +4,7 @@
4
4
  data: {
5
5
  controller: "toast",
6
6
  toast_assistive_tech_notification_value: assistive_tech_notification,
7
- testid: test_id,
7
+ testid:,
8
8
  },
9
9
  popover: "manual",
10
10
  })
@@ -29,7 +29,7 @@ module Anchor
29
29
  strip_tags(content)
30
30
  end
31
31
 
32
- def test_id
32
+ def testid
33
33
  wrapper_options.dig(:data, :testid) || "toast"
34
34
  end
35
35
  end
@@ -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.48.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.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-01-22 00:00:00.000000000 Z
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
@@ -1,3 +0,0 @@
1
- <%= content_tag(tag, **wrapper_options) do %>
2
- <%= content %>
3
- <% end %>