playbook_ui 16.0.0.pre.alpha.PLAY267213608 → 16.0.0.pre.alpha.PLAY267213609

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e6176ee8cfd1936b6e7b79e5716d8b099a74331977e5f3fcaba072943590ebd9
4
- data.tar.gz: 7c2e3b2a2d0a7ee10c52de21dd6e66be1997f144dfb97e1cef4f653f6591e3ff
3
+ metadata.gz: eb35019a1dc4a0f44e2ddb2686b53ca34b1af7a59146043718cf92ce68941f30
4
+ data.tar.gz: cff5eb2f7f9ef4613eec3398ba610776159b36324eb1a532ae0a702582aab542
5
5
  SHA512:
6
- metadata.gz: 5a362e44b418ef2a19d8861af43fe7671872d5396faa1cc04ee4b252ef59b29d7c46661175ecaec7a046924b280d4a29c2d1f6bbc605fe6dd026081362d74635
7
- data.tar.gz: 1c8d077d1c087fcde6fb5c3da59580f3e674bdbf0fb26068c8c41be95bb1c8bdb92fb046e956f64ce16fd7c4cb6531ef3af07ade73010ec68ace747935a81b4c
6
+ metadata.gz: c03880f75090837ed00af9495ff4550bdc9a4a18d5faaff5c4623c1e49ae7f57c251e532d06b6b54e88517c7408abef1d3dd923de96cb14a3eb23664acd9b0a7
7
+ data.tar.gz: c0f9684544d8e1d892861cc9135d3bf3e020d46faa9117e938bee503dbe008c847108ef6b6bae0a501f47c1228b4a3451bad309c02fcc55e55202c078b11de27
@@ -23,3 +23,17 @@
23
23
  name: "comment",
24
24
  rows: 4
25
25
  }) %>
26
+
27
+ <br/>
28
+
29
+ <%= pb_rails("textarea", props: {
30
+ label: "Data and ARIA Attributes",
31
+ name: "description",
32
+ rows: 4,
33
+ input_options: {
34
+ 'aria-label': "Enter description",
35
+ 'aria-describedby': "help-text",
36
+ data: { controller: "textarea", action: "focus->handleFocus" },
37
+ id: "description-textarea"
38
+ }
39
+ }) %>
@@ -1 +1,3 @@
1
- Use the `id` prop to set an id on the container wrapper, or use `input_options: { id: ... }` to set an id directly on the textarea element. Both can be used together if needed.
1
+ Use the `input_options` / `inputOptions` prop to pass additional attributes directly to the underlying `<textarea>` element instead of the outer wrapper. This is useful for applying data attributes, custom IDs, ARIA attributes, or other HTML attributes that need to be on the textarea element itself.
2
+
3
+ Additional HTML attributes (e.g. data or ARIA attributes) can also be passed directly to the `<textarea>` via `input_options`.
@@ -11,12 +11,7 @@
11
11
  <%= text_area_tag(
12
12
  object.name,
13
13
  object.value,
14
- :data => object.textarea_options[:data],
15
- :id => object.input_options[:id],
16
- :max_characters => object.max_characters,
17
- :onkeyup => object.onkeyup,
18
- :placeholder => object.placeholder,
19
- :rows => object.rows) %>
14
+ object.all_textarea_attributes) %>
20
15
  <% if object.error %>
21
16
  <% if object.character_count %>
22
17
  <%= pb_rails("flex", props: { spacing: "between", vertical: "center" }) do %>
@@ -38,6 +38,32 @@ module Playbook
38
38
  }
39
39
  end
40
40
 
41
+ def all_textarea_attributes
42
+ # Merge data attributes: emoji_mask data + input_options data
43
+ data_attrs = textarea_options[:data] || {}
44
+ input_data = input_options[:data] || {}
45
+ merged_data = data_attrs.merge(input_data)
46
+
47
+ base_attributes = {
48
+ id: input_options[:id] || "object_method",
49
+ max_characters: max_characters,
50
+ name: name,
51
+ onkeyup: onkeyup,
52
+ placeholder: placeholder,
53
+ rows: rows,
54
+ value: value,
55
+ }
56
+
57
+ # Merge input_options (excluding data to handle separately)
58
+ input_options_without_data = input_options.except(:data)
59
+ result = base_attributes.merge(input_options_without_data)
60
+
61
+ # Add merged data if present (input_options data takes precedence over emoji_mask data)
62
+ result[:data] = merged_data unless merged_data.empty?
63
+
64
+ result
65
+ end
66
+
41
67
  private
42
68
 
43
69
  def error_class
@@ -2,5 +2,5 @@
2
2
 
3
3
  module Playbook
4
4
  PREVIOUS_VERSION = "16.0.0"
5
- VERSION = "16.0.0.pre.alpha.PLAY267213608"
5
+ VERSION = "16.0.0.pre.alpha.PLAY267213609"
6
6
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: playbook_ui
3
3
  version: !ruby/object:Gem::Version
4
- version: 16.0.0.pre.alpha.PLAY267213608
4
+ version: 16.0.0.pre.alpha.PLAY267213609
5
5
  platform: ruby
6
6
  authors:
7
7
  - Power UX