playbook_ui 14.10.0.pre.alpha.PBNTR662stickyrightcolumnreact5160 → 14.10.0.pre.alpha.PLAY1750pbcontenttagkitbutton5308

Sign up to get free protection for your applications and to get access to all the features.
Files changed (92) hide show
  1. checksums.yaml +4 -4
  2. data/app/pb_kits/playbook/_playbook.scss +1 -0
  3. data/app/pb_kits/playbook/pb_advanced_table/_advanced_table.scss +11 -16
  4. data/app/pb_kits/playbook/pb_advanced_table/advanced_table.html.erb +1 -1
  5. data/app/pb_kits/playbook/pb_advanced_table/advanced_table.rb +8 -1
  6. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_beta_sort.html.erb +1 -3
  7. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_beta_subrow_headers.html.erb +1 -1
  8. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_beta_subrow_headers.md +1 -1
  9. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_column_headers.html.erb +43 -0
  10. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_column_headers_multiple.html.erb +58 -0
  11. data/app/pb_kits/playbook/pb_advanced_table/docs/example.yml +3 -0
  12. data/app/pb_kits/playbook/pb_advanced_table/index.js +185 -92
  13. data/app/pb_kits/playbook/pb_advanced_table/table_body.html.erb +1 -1
  14. data/app/pb_kits/playbook/pb_advanced_table/table_body.rb +55 -8
  15. data/app/pb_kits/playbook/pb_advanced_table/table_header.html.erb +17 -14
  16. data/app/pb_kits/playbook/pb_advanced_table/table_header.rb +78 -0
  17. data/app/pb_kits/playbook/pb_advanced_table/table_row.html.erb +4 -3
  18. data/app/pb_kits/playbook/pb_advanced_table/table_row.rb +13 -2
  19. data/app/pb_kits/playbook/pb_advanced_table/table_subrow_header.html.erb +2 -6
  20. data/app/pb_kits/playbook/pb_advanced_table/table_subrow_header.rb +6 -4
  21. data/app/pb_kits/playbook/pb_button/button.html.erb +2 -3
  22. data/app/pb_kits/playbook/pb_card/_card.scss +21 -3
  23. data/app/pb_kits/playbook/pb_card/docs/_card_header.html.erb +18 -0
  24. data/app/pb_kits/playbook/pb_card/docs/_card_header.jsx +40 -0
  25. data/app/pb_kits/playbook/pb_checkbox/checkbox.html.erb +1 -6
  26. data/app/pb_kits/playbook/pb_date_picker/date_picker.html.erb +1 -6
  27. data/app/pb_kits/playbook/pb_dropdown/dropdown.html.erb +7 -12
  28. data/app/pb_kits/playbook/pb_dropdown/dropdown_container.html.erb +9 -14
  29. data/app/pb_kits/playbook/pb_dropdown/dropdown_option.html.erb +6 -11
  30. data/app/pb_kits/playbook/pb_dropdown/dropdown_trigger.html.erb +8 -14
  31. data/app/pb_kits/playbook/pb_file_upload/_file_upload.tsx +24 -15
  32. data/app/pb_kits/playbook/pb_file_upload/docs/_file_upload_accept.jsx +3 -1
  33. data/app/pb_kits/playbook/pb_file_upload/docs/_file_upload_custom_description.jsx +4 -1
  34. data/app/pb_kits/playbook/pb_file_upload/docs/_file_upload_max_size.jsx +1 -1
  35. data/app/pb_kits/playbook/pb_icon_circle/_icon_circle.scss +1 -13
  36. data/app/pb_kits/playbook/pb_section_separator/_section_separator.scss +64 -1
  37. data/app/pb_kits/playbook/pb_section_separator/_section_separator.tsx +3 -1
  38. data/app/pb_kits/playbook/pb_section_separator/docs/_section_separator_color.html.erb +10 -0
  39. data/app/pb_kits/playbook/pb_section_separator/docs/_section_separator_color.jsx +42 -0
  40. data/app/pb_kits/playbook/pb_section_separator/docs/_section_separator_color.md +3 -0
  41. data/app/pb_kits/playbook/pb_section_separator/docs/example.yml +2 -0
  42. data/app/pb_kits/playbook/pb_section_separator/docs/index.js +1 -0
  43. data/app/pb_kits/playbook/pb_section_separator/section_separator.rb +4 -1
  44. data/app/pb_kits/playbook/pb_skeleton_loading/_skeleton_loading.scss +2 -2
  45. data/app/pb_kits/playbook/pb_skeleton_loading/docs/_description.md +3 -0
  46. data/app/pb_kits/playbook/pb_skeleton_loading/docs/_skeleton_loading_border_radius.html.erb +9 -0
  47. data/app/pb_kits/playbook/pb_skeleton_loading/docs/_skeleton_loading_border_radius_rails.md +1 -0
  48. data/app/pb_kits/playbook/pb_skeleton_loading/docs/_skeleton_loading_color.html.erb +7 -0
  49. data/app/pb_kits/playbook/pb_skeleton_loading/docs/_skeleton_loading_default.html.erb +1 -1
  50. data/app/pb_kits/playbook/pb_skeleton_loading/docs/_skeleton_loading_filter.html.erb +119 -0
  51. data/app/pb_kits/playbook/pb_skeleton_loading/docs/_skeleton_loading_filter.jsx +10 -2
  52. data/app/pb_kits/playbook/pb_skeleton_loading/docs/_skeleton_loading_height_width.html.erb +15 -0
  53. data/app/pb_kits/playbook/pb_skeleton_loading/docs/_skeleton_loading_height_width.jsx +6 -2
  54. data/app/pb_kits/playbook/pb_skeleton_loading/docs/_skeleton_loading_height_width_rails.md +3 -0
  55. data/app/pb_kits/playbook/pb_skeleton_loading/docs/_skeleton_loading_layout.html.erb +3 -0
  56. data/app/pb_kits/playbook/pb_skeleton_loading/docs/_skeleton_loading_user.html.erb +63 -0
  57. data/app/pb_kits/playbook/pb_skeleton_loading/docs/_skeleton_loading_user.jsx +11 -3
  58. data/app/pb_kits/playbook/pb_skeleton_loading/docs/example.yml +7 -2
  59. data/app/pb_kits/playbook/pb_skeleton_loading/skeleton_loading.html.erb +8 -12
  60. data/app/pb_kits/playbook/pb_skeleton_loading/skeleton_loading.rb +48 -1
  61. data/app/pb_kits/playbook/pb_table/_table.tsx +8 -1
  62. data/app/pb_kits/playbook/pb_table/docs/example.yml +2 -0
  63. data/app/pb_kits/playbook/pb_table/docs/index.js +2 -0
  64. data/app/pb_kits/playbook/pb_table/styles/_scroll.scss +20 -0
  65. data/app/pb_kits/playbook/pb_text_input/_text_input.tsx +8 -1
  66. data/app/pb_kits/playbook/pb_text_input/docs/_text_input_mask.jsx +18 -0
  67. data/app/pb_kits/playbook/pb_text_input/inputMask.ts +45 -1
  68. data/app/pb_kits/playbook/pb_text_input/text_input.test.js +80 -0
  69. data/app/pb_kits/playbook/pb_timeline/_timeline.tsx +5 -5
  70. data/app/pb_kits/playbook/pb_timeline/docs/_timeline_with_gap.html.erb +4 -5
  71. data/app/pb_kits/playbook/pb_timeline/docs/_timeline_with_gap.jsx +4 -4
  72. data/app/pb_kits/playbook/pb_timeline/docs/_timeline_with_gap.md +1 -1
  73. data/app/pb_kits/playbook/pb_timeline/timeline.rb +6 -6
  74. data/app/pb_kits/playbook/utilities/_gap.scss +29 -0
  75. data/app/pb_kits/playbook/utilities/globalPropNames.mjs +1 -0
  76. data/app/pb_kits/playbook/utilities/globalProps.ts +18 -9
  77. data/dist/chunks/_typeahead-C2iCBqxQ.js +36 -0
  78. data/dist/chunks/_weekday_stacked-CWnbnW7m.js +45 -0
  79. data/dist/chunks/vendor.js +1 -1
  80. data/dist/menu.yml +1 -1
  81. data/dist/playbook-doc.js +1 -1
  82. data/dist/playbook-rails-react-bindings.js +1 -1
  83. data/dist/playbook-rails.js +1 -1
  84. data/dist/playbook.css +1 -1
  85. data/lib/playbook/classnames.rb +1 -0
  86. data/lib/playbook/spacing.rb +21 -0
  87. data/lib/playbook/version.rb +1 -1
  88. metadata +21 -6
  89. data/dist/chunks/_typeahead-aym7Ky_O.js +0 -22
  90. data/dist/chunks/_weekday_stacked-BZj1pop-.js +0 -45
  91. /data/app/pb_kits/playbook/pb_skeleton_loading/docs/{_skeleton_loading_border_radius.md → _skeleton_loading_border_radius_react.md} +0 -0
  92. /data/app/pb_kits/playbook/pb_skeleton_loading/docs/{_skeleton_loading_height_width.md → _skeleton_loading_height_width_react.md} +0 -0
@@ -17,19 +17,56 @@ module Playbook
17
17
  prop :collapsible_trail, type: Playbook::Props::Boolean,
18
18
  default: true
19
19
 
20
- def render_row_and_children(row, column_definitions, current_depth, first_parent_child)
20
+ def flatten_columns(columns)
21
+ columns.flat_map do |col|
22
+ if col[:columns]
23
+ flatten_columns(col[:columns])
24
+ elsif col[:accessor].present?
25
+ if has_grouped_headers?
26
+ col.merge(is_last_in_group: last_in_group?(columns, col))
27
+ else
28
+ col
29
+ end
30
+ end
31
+ end.compact
32
+ end
33
+
34
+ def render_row_and_children(row, column_definitions, current_depth, first_parent_child, ancestor_ids = [], top_parent_id = nil, additional_classes: "", table_data_attributes: {})
35
+ top_parent_id ||= row.object_id
36
+ new_ancestor_ids = ancestor_ids + [row.object_id]
37
+ leaf_columns = flatten_columns(column_definitions)
38
+
21
39
  output = ActiveSupport::SafeBuffer.new
22
40
  is_first_child_of_subrow = current_depth.positive? && first_parent_child && subrow_headers[current_depth - 1].present?
23
41
 
24
- output << pb_rails("advanced_table/table_subrow_header", props: { row: row, column_definitions: column_definitions, depth: current_depth, subrow_header: subrow_headers[current_depth - 1], collapsible_trail: collapsible_trail }) if is_first_child_of_subrow && enable_toggle_expansion == "all"
42
+ subrow_ancestor_ids = ancestor_ids + ["#{row.object_id}sr"]
43
+ subrow_data_attributes = {
44
+ advanced_table_content: subrow_ancestor_ids.join("-"),
45
+ row_depth: current_depth,
46
+ row_parent: "#{id}_#{ancestor_ids.last}",
47
+ }
48
+ # Subrow header if applicable
49
+ output << pb_rails("advanced_table/table_subrow_header", props: { row: row, column_definitions: leaf_columns, depth: current_depth, subrow_header: subrow_headers[current_depth - 1], collapsible_trail: collapsible_trail, classname: "toggle-content", subrow_data_attributes: subrow_data_attributes }) if is_first_child_of_subrow && enable_toggle_expansion == "all"
50
+
51
+ current_data_attributes = current_depth.zero? ? { row_depth: 0 } : table_data_attributes
25
52
 
26
- output << pb_rails("advanced_table/table_row", props: { id: id, row: row, column_definitions: column_definitions, depth: current_depth, collapsible_trail: collapsible_trail })
53
+ # Additional class and data attributes needed for toggle logic
54
+ output << pb_rails("advanced_table/table_row", props: { id: id, row: row, column_definitions: leaf_columns, depth: current_depth, collapsible_trail: collapsible_trail, classname: additional_classes, table_data_attributes: current_data_attributes })
27
55
 
28
56
  if row[:children].present?
29
- output << content_tag(:div, class: "toggle-content", data: { advanced_table_content: row.object_id.to_s + id }) do
30
- row[:children].map do |child_row|
31
- render_row_and_children(child_row, column_definitions, current_depth + 1, row.children.first == child_row)
32
- end.join.html_safe
57
+ row[:children].each do |child_row|
58
+ is_first_child = row[:children].first == child_row
59
+ immediate_parent_id = row.object_id
60
+ data_content = new_ancestor_ids.join("-") + "-#{child_row.object_id}"
61
+
62
+ child_data_attributes = {
63
+ top_parent: "#{id}_#{top_parent_id}",
64
+ row_depth: current_depth + 1,
65
+ row_parent: "#{id}_#{immediate_parent_id}",
66
+ advanced_table_content: data_content,
67
+ }
68
+
69
+ output << render_row_and_children(child_row, column_definitions, current_depth + 1, is_first_child, new_ancestor_ids, top_parent_id, additional_classes: "toggle-content", table_data_attributes: child_data_attributes)
33
70
  end
34
71
  end
35
72
 
@@ -37,7 +74,17 @@ module Playbook
37
74
  end
38
75
 
39
76
  def classname
40
- generate_classname("pb_advanced_table_body", "pb_table_tbody", separator: " ")
77
+ generate_classname("pb_advanced_table_body", separator: " ")
78
+ end
79
+
80
+ private
81
+
82
+ def has_grouped_headers?
83
+ column_definitions.any? { |col| col.key?(:columns) }
84
+ end
85
+
86
+ def last_in_group?(columns, current_col)
87
+ columns.last[:accessor] == current_col[:accessor]
41
88
  end
42
89
  end
43
90
  end
@@ -1,18 +1,21 @@
1
- <%= pb_content_tag do %>
2
- <%= pb_rails("table/table_row", props: { tag: "div" }) do %>
3
- <% object.column_definitions.each_with_index do |item, index| %>
4
- <%= pb_rails("table/table_header", props: { tag: "div", id: item[:accessor], classname: object.th_classname, sort_menu: item[:sort_menu] }) do %>
5
- <%= pb_rails("flex", props:{ align: "center", justify: index.zero? ? "start" : "end", text_align: "end" }) do %>
6
- <% if index.zero? && (object.enable_toggle_expansion == "header" || object.enable_toggle_expansion == "all") %>
7
- <button
8
- class="gray-icon toggle-all-icon"
9
- onclick="expandAllRows(this); event.preventDefault();">
10
- <%= pb_rails("icon", props: { icon: "arrows-from-line", cursor: "pointer", fixed_width: true, padding_right: "xs" }) %>
11
- </button>
12
- <% end %>
13
- <%= item[:label] %>
1
+ <%= pb_content_tag(:thead) do %>
2
+ <% object.header_rows.each_with_index do |header_row, row_index| %>
3
+ <%= pb_rails("table/table_row") do %>
4
+ <% header_row.each_with_index do |cell, cell_index| %>
5
+ <% header_id = cell[:accessor].present? ? cell[:accessor] : "header_#{row_index}_#{cell_index}" %>
6
+ <%= pb_rails("table/table_header", props: { id: header_id, colspan: cell[:colspan], classname: [object.th_classname, ('last-header-cell' if cell[:is_last_in_group] && cell_index != 0)].compact.join(' '), sort_menu: cell[:accessor] ? cell[:sort_menu] : nil }) do %>
7
+ <%= pb_rails("flex", props:{ align: "center", justify: cell_index.zero? ? "start" : row_index === header_rows.size - 1 ? "end" : "center", text_align: "end" }) do %>
8
+ <% if cell_index.zero? && (object.enable_toggle_expansion == "header" || object.enable_toggle_expansion == "all") && row_index === header_rows.size - 1 %>
9
+ <button
10
+ class="gray-icon toggle-all-icon"
11
+ onclick="expandAllRows(this); event.preventDefault();">
12
+ <%= pb_rails("icon", props: { icon: "arrows-from-line", cursor: "pointer", fixed_width: true, padding_right: "xs" }) %>
13
+ </button>
14
14
  <% end %>
15
+ <%= cell[:label] %>
15
16
  <% end %>
16
- <% end %>
17
17
  <% end %>
18
+ <% end %>
19
+ <% end %>
20
+ <% end %>
18
21
  <% end %>
@@ -16,6 +16,84 @@ module Playbook
16
16
  def th_classname
17
17
  generate_classname("table-header-cells", separator: " ")
18
18
  end
19
+
20
+ def header_rows
21
+ wrapped_columns = wrap_leaf_columns(column_definitions)
22
+
23
+ rows = []
24
+ max_depth = compute_max_depth(wrapped_columns)
25
+ max_depth.times { rows << [] }
26
+ process_columns(wrapped_columns, rows, 0, max_depth)
27
+ rows
28
+ end
29
+
30
+ private
31
+
32
+ def compute_max_depth(columns)
33
+ columns.map do |col|
34
+ col[:columns] ? 1 + compute_max_depth(col[:columns]) : 1
35
+ end.max || 1
36
+ end
37
+
38
+ def process_columns(columns, rows, current_depth, max_depth)
39
+ total_columns = columns.size
40
+ columns.each_with_index do |col, index|
41
+ is_last = index == total_columns - 1
42
+ if col[:columns]
43
+ colspan = compute_leaf_columns(col[:columns])
44
+ rows[current_depth] << {
45
+ label: col[:label],
46
+ colspan: colspan,
47
+ is_last_in_group: is_last && current_depth.positive?,
48
+ }
49
+
50
+ process_columns(col[:columns], rows, current_depth + 1, max_depth)
51
+ else
52
+ colspan = 1
53
+ rows[current_depth] << {
54
+ label: col[:label],
55
+ colspan: colspan,
56
+ accessor: col[:accessor],
57
+ sort_menu: col[:sort_menu],
58
+ is_last_in_group: is_last && current_depth.positive?,
59
+ }
60
+ end
61
+ end
62
+ end
63
+
64
+ def compute_leaf_columns(columns)
65
+ columns.reduce(0) do |sum, col|
66
+ col[:columns] ? sum + compute_leaf_columns(col[:columns]) : sum + 1
67
+ end
68
+ end
69
+
70
+ def wrap_leaf_columns(column_definitions)
71
+ max_depth = compute_max_depth(column_definitions)
72
+
73
+ column_definitions.map do |col|
74
+ if col.key?(:columns)
75
+ {
76
+ label: col[:label],
77
+ columns: wrap_leaf_columns(col[:columns]),
78
+ }
79
+ else
80
+ # For leaf columns, wrap with empty labels up to max depth to get proper structure
81
+ wrap_leaf_column(col, max_depth)
82
+ end
83
+ end
84
+ end
85
+
86
+ def wrap_leaf_column(col, max_depth)
87
+ wrapped = {
88
+ accessor: col[:accessor],
89
+ label: col[:label] || "",
90
+ sort_menu: col[:sort_menu] || nil,
91
+ }
92
+ (max_depth - 1).times do
93
+ wrapped = { label: "", columns: [wrapped] }
94
+ end
95
+ wrapped
96
+ end
19
97
  end
20
98
  end
21
99
  end
@@ -1,6 +1,7 @@
1
- <%= pb_content_tag do %>
1
+ <%= pb_content_tag(:tr) do %>
2
2
  <% object.column_definitions.each_with_index do |column, index| %>
3
- <%= pb_rails("table/table_cell", props: { tag:"div", classname:object.td_classname}) do %>
3
+ <% next unless column[:accessor].present? %>
4
+ <%= pb_rails("table/table_cell", props: { classname:object.td_classname(column)}) do %>
4
5
  <%= pb_rails("flex", props:{ align: "center", justify: index.zero? ? "start" : "end" }) do %>
5
6
  <% if collapsible_trail && index.zero? %>
6
7
  <% (1..depth).each do |i| %>
@@ -13,7 +14,7 @@
13
14
  <div style="padding-left: <%= depth * 1.25 %>em">
14
15
  <%= pb_rails("flex", props:{align: "center", column_gap: "xs"}) do %>
15
16
  <% if index.zero? && object.row[:children].present? %>
16
- <button id="<%= object.row.object_id.to_s + object.id %>" class="gray-icon expand-toggle-icon" data-advanced-table="true" >
17
+ <button id="<%= "#{object.id}_#{object.row.object_id}" %>" class="gray-icon expand-toggle-icon" data-advanced-table="true" >
17
18
  <%= pb_rails("icon", props: { id: "advanced-table_open_icon", icon: "circle-play", cursor: "pointer" }) %>
18
19
  <%= pb_rails("icon", props: { id: "advanced-table_close_icon", display: "none", icon: "circle-play", cursor: "pointer", rotation: 90 }) %>
19
20
  </button>
@@ -11,13 +11,21 @@ module Playbook
11
11
  prop :depth
12
12
  prop :collapsible_trail, type: Playbook::Props::Boolean,
13
13
  default: true
14
+ prop :table_data_attributes, type: Playbook::Props::HashProp,
15
+ default: {}
16
+
17
+ def data
18
+ Hash(prop(:data)).merge(table_data_attributes)
19
+ end
14
20
 
15
21
  def classname
16
22
  generate_classname("pb_table_tr", "bg-white", subrow_depth_classname, separator: " ")
17
23
  end
18
24
 
19
- def td_classname
20
- generate_classname("id-cell", "chrome-styles", separator: " ")
25
+ def td_classname(column)
26
+ classes = %w[id-cell chrome-styles]
27
+ classes << "last-cell" if column[:is_last_in_group]
28
+ classes.join(" ")
21
29
  end
22
30
 
23
31
  def depth_accessors
@@ -29,6 +37,8 @@ module Playbook
29
37
  private
30
38
 
31
39
  def custom_renderer_value(column, index)
40
+ return nil unless column[:accessor].present?
41
+
32
42
  if index.zero?
33
43
  if depth.zero?
34
44
  row[column[:accessor].to_sym]
@@ -37,6 +47,7 @@ module Playbook
37
47
  key = item.to_sym
38
48
  return row[key] if depth - 1 == accessor_index
39
49
  end
50
+ nil
40
51
  end
41
52
  else
42
53
  row[column[:accessor].to_sym]
@@ -1,10 +1,6 @@
1
- <%= content_tag(:div,
2
- aria: object.aria,
3
- class: object.classname,
4
- data: object.data,
5
- id: object.id) do %>
1
+ <%= pb_content_tag(:tr) do %>
6
2
  <% object.column_definitions.each_with_index do |column, index| %>
7
- <%= pb_rails("table/table_cell", props: { tag: "div", classname: object.td_classname}) do %>
3
+ <%= pb_rails("table/table_cell", props: { classname: "id-cell chrome-styles"}) do %>
8
4
  <%= pb_rails("flex", props:{ align: "center", justify: "start" }) do %>
9
5
  <% if collapsible_trail && index.zero? %>
10
6
  <% (1..depth).each do |i| %>
@@ -14,13 +14,15 @@ module Playbook
14
14
  default: ""
15
15
  prop :collapsible_trail, type: Playbook::Props::Boolean,
16
16
  default: true
17
+ prop :subrow_data_attributes, type: Playbook::Props::HashProp,
18
+ default: {}
17
19
 
18
- def classname
19
- generate_classname("pb_table_tr", "bg-white", subrow_depth_classname, separator: " ")
20
+ def data
21
+ Hash(prop(:data)).merge(subrow_data_attributes)
20
22
  end
21
23
 
22
- def td_classname
23
- generate_classname("id-cell", "chrome-styles", separator: " ")
24
+ def classname
25
+ generate_classname("pb_table_tr", "bg-silver", "pb_subrow_header", subrow_depth_classname, separator: " ")
24
26
  end
25
27
 
26
28
  private
@@ -1,6 +1,5 @@
1
- <%= content_tag(object.tag,
2
- object.tag == "button" ? object.options : object.link_options,
3
- **combined_html_options) do %>
1
+ <%= pb_content_tag(object.tag,
2
+ object.tag == "button" ? object.options : object.link_options) do %>
4
3
  <% if object.variant === "reaction" %>
5
4
  <% if icon && object.valid_emoji(object.icon) %>
6
5
  <%= pb_rails("flex", props:{ align: "center" }) do %>
@@ -21,6 +21,14 @@
21
21
  border-width: 0px;
22
22
  }
23
23
 
24
+ @function ends-with($string, $suffix) {
25
+ $suffix-length: str-length($suffix);
26
+ @if $suffix-length == 0 {
27
+ @return true;
28
+ }
29
+ @return str-slice($string, -$suffix-length) == $suffix;
30
+ }
31
+
24
32
  [class^=pb_card_header_kit] {
25
33
  flex-grow: 0;
26
34
  flex-shrink: 0;
@@ -30,9 +38,19 @@
30
38
  border: 0;
31
39
  border-radius: $pb_card_header_border_radius $pb_card_header_border_radius 0px 0px;
32
40
  @each $color_name, $color_value in $pb_card_header_colors {
33
- &[class*=_#{"" + $color_name}] {
34
- @include pb_card_header_color($color_value);
35
- color: lightenText($color_value);
41
+ @if not ends-with($color_name, '_subtle') {
42
+ &[class*="_#{$color_name}"] {
43
+ @include pb_card_header_color($color_value);
44
+ color: lightenText($color_value);
45
+ }
46
+ }
47
+ }
48
+ @each $color_name, $color_value in $pb_card_header_colors {
49
+ @if ends-with($color_name, '_subtle') {
50
+ &[class*="_#{$color_name}"] {
51
+ @include pb_card_header_color($color_value);
52
+ color: lightenText($color_value);
53
+ }
36
54
  }
37
55
  }
38
56
  @each $color_name, $color_value in $pb_card_header_colors {
@@ -88,3 +88,21 @@
88
88
  Body
89
89
  <% end %>
90
90
  <% end %>
91
+
92
+ <%= pb_rails("card", props: { padding: "none", header: true, margin_bottom: "sm"}) do %>
93
+ <%= pb_rails("card/card_header", props: { padding: "sm", header_color: "success_subtle" }) do %>
94
+ <%= pb_rails("body", props: { text: "Success Subtle" }) %>
95
+ <% end %>
96
+ <%= pb_rails("card/card_body", props: { padding: "md" }) do %>
97
+ Body
98
+ <% end %>
99
+ <% end %>
100
+
101
+ <%= pb_rails("card", props: { padding: "none", header: true, margin_bottom: "sm"}) do %>
102
+ <%= pb_rails("card/card_header", props: { padding: "sm", header_color: "error_subtle" }) do %>
103
+ <%= pb_rails("body", props: { text: "Error Subtle"}) %>
104
+ <% end %>
105
+ <%= pb_rails("card/card_body", props: { padding: "md" }) do %>
106
+ Body
107
+ <% end %>
108
+ <% end %>
@@ -231,6 +231,46 @@ const CardHeader = (props) => {
231
231
  />
232
232
  </Card.Body>
233
233
  </Card>
234
+
235
+ <Card
236
+ {...props}
237
+ marginBottom='sm'
238
+ padding="none"
239
+ >
240
+ <Card.Header
241
+ headerColor="success_subtle"
242
+ >
243
+ <Body
244
+ text="Success Subtle"
245
+ />
246
+ </Card.Header>
247
+ <Card.Body>
248
+ <Body
249
+ {...props}
250
+ text="Body"
251
+ />
252
+ </Card.Body>
253
+ </Card>
254
+
255
+ <Card
256
+ {...props}
257
+ marginBottom='sm'
258
+ padding="none"
259
+ >
260
+ <Card.Header
261
+ headerColor="error_subtle"
262
+ >
263
+ <Body
264
+ text="Error Subtle"
265
+ />
266
+ </Card.Header>
267
+ <Card.Body>
268
+ <Body
269
+ {...props}
270
+ text="Body"
271
+ />
272
+ </Card.Body>
273
+ </Card>
234
274
  </>
235
275
  )
236
276
  }
@@ -1,9 +1,4 @@
1
- <%= content_tag(:label, aria: object.aria,
2
- id: object.id,
3
- data: object.data,
4
- class: object.classname,
5
- **combined_html_options
6
- ) do %>
1
+ <%= pb_content_tag(:label) do %>
7
2
  <%= content.presence || object.input %>
8
3
  <% if object.indeterminate %>
9
4
  <span data-pb-checkbox-icon-span="true" class="pb_checkbox_indeterminate">
@@ -1,9 +1,4 @@
1
- <%= content_tag(:div,
2
- aria: object.aria,
3
- class: object.classname + object.error_class,
4
- data: object.data,
5
- id: object.id,
6
- **combined_html_options) do %>
1
+ <%= pb_content_tag do %>
7
2
  <div class="input_wrapper">
8
3
  <% if content.present? %>
9
4
  <%= content %>
@@ -1,19 +1,14 @@
1
- <%= content_tag(:div,
2
- aria: object.aria,
3
- class: object.classname,
4
- data: object.data,
5
- id: object.id,
6
- **combined_html_options) do %>
1
+ <%= pb_content_tag do %>
7
2
  <% if object.label.present? %>
8
3
  <%= pb_rails("caption", props: {text: object.label, margin_bottom:"xs"}) %>
9
4
  <% end %>
10
5
  <div class="dropdown_wrapper<%= error_class %>" style="position: relative">
11
- <input
12
- data-default-value="<%= input_default_value %>"
13
- id="dropdown-selected-option"
14
- name="<%= object.name %>"
15
- style="display: none"
16
- <%= object.required ? "required" : ""%>
6
+ <input
7
+ data-default-value="<%= input_default_value %>"
8
+ id="dropdown-selected-option"
9
+ name="<%= object.name %>"
10
+ style="display: none"
11
+ <%= object.required ? "required" : ""%>
17
12
  />
18
13
  <% if content.present? %>
19
14
  <%= content.presence %>
@@ -1,20 +1,15 @@
1
- <%= content_tag(:div,
2
- aria: object.aria,
3
- class: object.classname,
4
- data: object.data,
5
- id: object.id,
6
- **combined_html_options) do %>
1
+ <%= pb_content_tag do %>
7
2
  <%= pb_rails("list", props: {ordered: false, borderless: false}) do %>
8
- <% if content.present? %>
3
+ <% if content.present? %>
9
4
  <%= content.presence %>
10
- <% else %>
5
+ <% else %>
11
6
  <%= pb_rails("list/item", props: {
12
- display: "flex",
13
- justify_content: "center",
14
- padding:"xs",
15
- }) do %>
7
+ display: "flex",
8
+ justify_content: "center",
9
+ padding:"xs",
10
+ }) do %>
16
11
  <%= pb_rails("body", props: {text: "No option"}) %>
17
12
  <% end %>
18
13
  <% end %>
19
- <% end %>
20
- <% end %>
14
+ <% end %>
15
+ <% end %>
@@ -1,15 +1,10 @@
1
- <%= content_tag(:div,
2
- aria: object.aria,
3
- class: object.classname,
4
- data: object.data,
5
- id: object.option[:id],
6
- **combined_html_options) do %>
1
+ <%= pb_content_tag do %>
7
2
  <%= pb_rails("list/item", props: {
8
- display: "flex",
9
- justify_content: "center",
10
- padding:"none",
3
+ display: "flex",
4
+ justify_content: "center",
5
+ padding:"none",
11
6
  cursor: "pointer"
12
- }) do %>
7
+ }) do %>
13
8
  <div class="dropdown_option_wrapper">
14
9
  <% if content.present? %>
15
10
  <%= content.presence %>
@@ -18,4 +13,4 @@
18
13
  <% end %>
19
14
  </div>
20
15
  <% end %>
21
- <% end %>
16
+ <% end %>
@@ -1,21 +1,16 @@
1
- <%= content_tag(:div,
2
- aria: object.aria,
3
- class: object.classname,
4
- data: object.data,
5
- id: object.id,
6
- **combined_html_options) do %>
1
+ <%= pb_content_tag do %>
7
2
  <% if content.present? %>
8
3
  <div style="display: inline-block" tabindex="0" data-dropdown-custom-trigger>
9
4
  <%= content.presence %>
10
5
  </div>
11
6
  <% else %>
12
7
  <%= pb_rails("flex", props: {
13
- align: "center",
14
- border_radius:"lg",
15
- classname: object.trigger_wrapper_classes,
16
- cursor: "pointer",
17
- justify: "between",
18
- padding_x:"sm",
8
+ align: "center",
9
+ border_radius:"lg",
10
+ classname: object.trigger_wrapper_classes,
11
+ cursor: "pointer",
12
+ justify: "between",
13
+ padding_x:"sm",
19
14
  padding_y:"xs",
20
15
  html_options: {tabindex:"0"}
21
16
  }) do %>
@@ -23,7 +18,7 @@
23
18
  <%= pb_rails("flex", props: {align: "center"}) do %>
24
19
  <% if object.custom_display.present? %>
25
20
  <%= pb_rails("flex", props: {align: "center"}) do %>
26
- <div id="dropdown_trigger_custom_display" style="display: none;">
21
+ <div id="dropdown_trigger_custom_display" style="display: none;">
27
22
  <%= object.custom_display %>
28
23
  </div>
29
24
  <%= pb_rails("body", props: {text: object.default_display_placeholder, id: "dropdown_trigger_display"}) %>
@@ -40,4 +35,3 @@
40
35
  <% end %>
41
36
  <% end %>
42
37
  <% end %>
43
-