playbook_ui 13.20.0 → 13.21.0.pre.alpha.PBNTR224letuserresetrowexpansion2466

Sign up to get free protection for your applications and to get access to all the features.
Files changed (221) hide show
  1. checksums.yaml +4 -4
  2. data/app/pb_kits/playbook/index.js +1 -1
  3. data/app/pb_kits/playbook/pb_advanced_table/Components/CollapsibleTrail.tsx +6 -1
  4. data/app/pb_kits/playbook/pb_advanced_table/Components/CustomCell.tsx +23 -17
  5. data/app/pb_kits/playbook/pb_advanced_table/Components/SortIconButton.tsx +6 -3
  6. data/app/pb_kits/playbook/pb_advanced_table/Components/SubRowHeaderRow.tsx +12 -8
  7. data/app/pb_kits/playbook/pb_advanced_table/Components/TableHeaderCell.tsx +14 -9
  8. data/app/pb_kits/playbook/pb_advanced_table/Components/ToggleIconButton.tsx +9 -5
  9. data/app/pb_kits/playbook/pb_advanced_table/README.md +2 -2
  10. data/app/pb_kits/playbook/pb_advanced_table/SubKits/TableBody.tsx +16 -10
  11. data/app/pb_kits/playbook/pb_advanced_table/SubKits/TableHeader.tsx +14 -8
  12. data/app/pb_kits/playbook/pb_advanced_table/Utilities/ExpansionControlHelpers.tsx +3 -2
  13. data/app/pb_kits/playbook/pb_advanced_table/Utilities/types.ts +0 -2
  14. data/app/pb_kits/playbook/pb_advanced_table/_advanced_table.scss +50 -7
  15. data/app/pb_kits/playbook/pb_advanced_table/_advanced_table.tsx +86 -78
  16. data/app/pb_kits/playbook/pb_advanced_table/advanced_table.html.erb +14 -0
  17. data/app/pb_kits/playbook/pb_advanced_table/advanced_table.rb +19 -0
  18. data/app/pb_kits/playbook/pb_advanced_table/advanced_table.test.jsx +54 -54
  19. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_collapsible_trail.jsx +7 -7
  20. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_default.jsx +7 -7
  21. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_expanded_control.jsx +12 -7
  22. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_inline_row_loading.jsx +7 -7
  23. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_inline_row_loading.md +1 -1
  24. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_loading.jsx +7 -7
  25. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_sort.jsx +7 -7
  26. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_sort_control.jsx +7 -7
  27. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_subrow_headers.jsx +7 -7
  28. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_table_options.jsx +7 -7
  29. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_table_props.jsx +7 -7
  30. data/app/pb_kits/playbook/pb_advanced_table/docs/_mock_data.js +1 -1
  31. data/app/pb_kits/playbook/pb_advanced_table/docs/_mock_data_inline_loading.js +1 -1
  32. data/app/pb_kits/playbook/pb_advanced_table/docs/example.yml +2 -0
  33. data/app/pb_kits/playbook/pb_advanced_table/scss_partials/_chrome_styles.scss +13 -0
  34. data/app/pb_kits/playbook/pb_advanced_table/table_body.html.erb +9 -0
  35. data/app/pb_kits/playbook/pb_advanced_table/table_body.rb +30 -0
  36. data/app/pb_kits/playbook/pb_advanced_table/table_header.html.erb +20 -0
  37. data/app/pb_kits/playbook/pb_advanced_table/table_header.rb +21 -0
  38. data/app/pb_kits/playbook/pb_advanced_table/table_row.html.erb +37 -0
  39. data/app/pb_kits/playbook/pb_advanced_table/table_row.rb +32 -0
  40. data/app/pb_kits/playbook/pb_avatar/avatar.html.erb +2 -1
  41. data/app/pb_kits/playbook/pb_avatar_action_button/avatar_action_button.html.erb +2 -1
  42. data/app/pb_kits/playbook/pb_background/background.html.erb +2 -1
  43. data/app/pb_kits/playbook/pb_badge/badge.html.erb +2 -1
  44. data/app/pb_kits/playbook/pb_body/body.html.erb +2 -1
  45. data/app/pb_kits/playbook/pb_bread_crumbs/_bread_crumbs.scss +0 -7
  46. data/app/pb_kits/playbook/pb_bread_crumbs/bread_crumb_item.html.erb +2 -1
  47. data/app/pb_kits/playbook/pb_bread_crumbs/bread_crumbs.html.erb +2 -1
  48. data/app/pb_kits/playbook/pb_button/button.html.erb +2 -1
  49. data/app/pb_kits/playbook/pb_button/button.rb +2 -3
  50. data/app/pb_kits/playbook/pb_button_toolbar/button_toolbar.html.erb +2 -1
  51. data/app/pb_kits/playbook/pb_caption/caption.html.erb +2 -1
  52. data/app/pb_kits/playbook/pb_card/card.html.erb +2 -1
  53. data/app/pb_kits/playbook/pb_card/card_body.html.erb +2 -1
  54. data/app/pb_kits/playbook/pb_card/card_header.html.erb +2 -1
  55. data/app/pb_kits/playbook/pb_checkbox/checkbox.html.erb +3 -1
  56. data/app/pb_kits/playbook/pb_circle_icon_button/circle_icon_button.html.erb +2 -1
  57. data/app/pb_kits/playbook/pb_collapsible/collapsible.html.erb +2 -1
  58. data/app/pb_kits/playbook/pb_collapsible/collapsible_content.html.erb +2 -1
  59. data/app/pb_kits/playbook/pb_collapsible/collapsible_main.html.erb +2 -1
  60. data/app/pb_kits/playbook/pb_contact/contact.html.erb +2 -1
  61. data/app/pb_kits/playbook/pb_currency/currency.html.erb +2 -1
  62. data/app/pb_kits/playbook/pb_dashboard_value/dashboard_value.html.erb +2 -1
  63. data/app/pb_kits/playbook/pb_date/date.html.erb +2 -1
  64. data/app/pb_kits/playbook/pb_date/docs/_date_alignment_swift.md +26 -6
  65. data/app/pb_kits/playbook/pb_date/docs/_date_default_swift.md +27 -8
  66. data/app/pb_kits/playbook/pb_date_picker/_date_picker.scss +1 -2
  67. data/app/pb_kits/playbook/pb_date_picker/_date_picker.tsx +3 -0
  68. data/app/pb_kits/playbook/pb_date_picker/date_picker.html.erb +4 -2
  69. data/app/pb_kits/playbook/pb_date_picker/date_picker.rb +2 -1
  70. data/app/pb_kits/playbook/pb_date_picker/date_picker.test.js +1 -1
  71. data/app/pb_kits/playbook/pb_date_picker/date_picker_helper.ts +9 -7
  72. data/app/pb_kits/playbook/pb_date_picker/docs/_date_picker_margin_bottom.html.erb +7 -0
  73. data/app/pb_kits/playbook/pb_date_picker/docs/_date_picker_margin_bottom.jsx +41 -0
  74. data/app/pb_kits/playbook/pb_date_picker/docs/example.yml +2 -0
  75. data/app/pb_kits/playbook/pb_date_picker/docs/index.js +1 -0
  76. data/app/pb_kits/playbook/pb_date_picker/sass_partials/_input_styles.scss +1 -2
  77. data/app/pb_kits/playbook/pb_date_range_inline/date_range_inline.html.erb +2 -1
  78. data/app/pb_kits/playbook/pb_date_range_stacked/date_range_stacked.html.erb +2 -1
  79. data/app/pb_kits/playbook/pb_date_stacked/date_stacked.html.erb +2 -1
  80. data/app/pb_kits/playbook/pb_date_time/date_time.html.erb +2 -1
  81. data/app/pb_kits/playbook/pb_date_time_stacked/date_time_stacked.html.erb +3 -2
  82. data/app/pb_kits/playbook/pb_date_year_stacked/date_year_stacked.html.erb +2 -1
  83. data/app/pb_kits/playbook/pb_detail/detail.html.erb +2 -1
  84. data/app/pb_kits/playbook/pb_dialog/dialog.html.erb +2 -1
  85. data/app/pb_kits/playbook/pb_dialog/dialog_body.html.erb +3 -2
  86. data/app/pb_kits/playbook/pb_dialog/dialog_footer.html.erb +2 -1
  87. data/app/pb_kits/playbook/pb_dialog/dialog_header.html.erb +3 -2
  88. data/app/pb_kits/playbook/pb_file_upload/file_upload.html.erb +2 -1
  89. data/app/pb_kits/playbook/pb_filter/filter.html.erb +2 -1
  90. data/app/pb_kits/playbook/pb_fixed_confirmation_toast/_fixed_confirmation_toast.scss +8 -3
  91. data/app/pb_kits/playbook/pb_fixed_confirmation_toast/_fixed_confirmation_toast.tsx +1 -0
  92. data/app/pb_kits/playbook/pb_fixed_confirmation_toast/docs/_fixed_confirmation_toast_multi_line.html.erb +51 -1
  93. data/app/pb_kits/playbook/pb_fixed_confirmation_toast/docs/_fixed_confirmation_toast_multi_line.jsx +62 -11
  94. data/app/pb_kits/playbook/pb_fixed_confirmation_toast/docs/_fixed_confirmation_toast_positions.html.erb +7 -2
  95. data/app/pb_kits/playbook/pb_fixed_confirmation_toast/fixed_confirmation_toast.html.erb +4 -3
  96. data/app/pb_kits/playbook/pb_flex/docs/_flex_spacing.html.erb +0 -4
  97. data/app/pb_kits/playbook/pb_flex/flex.html.erb +2 -1
  98. data/app/pb_kits/playbook/pb_flex/flex_item.html.erb +2 -1
  99. data/app/pb_kits/playbook/pb_form_group/form_group.html.erb +2 -1
  100. data/app/pb_kits/playbook/pb_form_pill/form_pill.html.erb +2 -2
  101. data/app/pb_kits/playbook/pb_hashtag/hashtag.html.erb +2 -1
  102. data/app/pb_kits/playbook/pb_highlight/highlight.html.erb +2 -1
  103. data/app/pb_kits/playbook/pb_home_address_street/home_address_street.html.erb +2 -1
  104. data/app/pb_kits/playbook/pb_icon/_icon.tsx +1 -0
  105. data/app/pb_kits/playbook/pb_icon/icon.html.erb +2 -1
  106. data/app/pb_kits/playbook/pb_icon/icon.rb +3 -3
  107. data/app/pb_kits/playbook/pb_icon_circle/icon_circle.html.erb +2 -1
  108. data/app/pb_kits/playbook/pb_icon_stat_value/icon_stat_value.html.erb +2 -1
  109. data/app/pb_kits/playbook/pb_icon_value/icon_value.html.erb +2 -1
  110. data/app/pb_kits/playbook/pb_image/image.html.erb +2 -1
  111. data/app/pb_kits/playbook/pb_label_pill/label_pill.html.erb +2 -1
  112. data/app/pb_kits/playbook/pb_label_value/label_value.html.erb +3 -2
  113. data/app/pb_kits/playbook/pb_layout/body.html.erb +2 -1
  114. data/app/pb_kits/playbook/pb_layout/footer.html.erb +2 -1
  115. data/app/pb_kits/playbook/pb_layout/header.html.erb +2 -1
  116. data/app/pb_kits/playbook/pb_layout/item.html.erb +2 -1
  117. data/app/pb_kits/playbook/pb_layout/layout.html.erb +2 -1
  118. data/app/pb_kits/playbook/pb_layout/sidebar.html.erb +2 -1
  119. data/app/pb_kits/playbook/pb_legend/legend.html.erb +2 -1
  120. data/app/pb_kits/playbook/pb_list/item.html.erb +2 -1
  121. data/app/pb_kits/playbook/pb_list/list.html.erb +2 -1
  122. data/app/pb_kits/playbook/pb_loading_inline/loading_inline.html.erb +2 -1
  123. data/app/pb_kits/playbook/pb_message/docs/_description.md +1 -1
  124. data/app/pb_kits/playbook/pb_message/message.html.erb +2 -1
  125. data/app/pb_kits/playbook/pb_message/message_mention.html.erb +3 -2
  126. data/app/pb_kits/playbook/pb_multi_level_select/multi_level_select.html.erb +2 -1
  127. data/app/pb_kits/playbook/pb_multiple_users/multiple_users.html.erb +2 -1
  128. data/app/pb_kits/playbook/pb_multiple_users_stacked/multiple_users_stacked.html.erb +2 -1
  129. data/app/pb_kits/playbook/pb_nav/_subtle_mixin.scss +4 -0
  130. data/app/pb_kits/playbook/pb_nav/item.html.erb +4 -2
  131. data/app/pb_kits/playbook/pb_nav/nav.html.erb +2 -1
  132. data/app/pb_kits/playbook/pb_online_status/online_status.html.erb +2 -1
  133. data/app/pb_kits/playbook/pb_pagination/pagination.html.erb +2 -1
  134. data/app/pb_kits/playbook/pb_passphrase/passphrase.html.erb +1 -1
  135. data/app/pb_kits/playbook/pb_person/person.html.erb +2 -1
  136. data/app/pb_kits/playbook/pb_person_contact/person_contact.html.erb +2 -1
  137. data/app/pb_kits/playbook/pb_pill/pill.html.erb +2 -1
  138. data/app/pb_kits/playbook/pb_popover/popover.html.erb +2 -1
  139. data/app/pb_kits/playbook/pb_progress_pills/progress_pills.html.erb +2 -1
  140. data/app/pb_kits/playbook/pb_progress_simple/progress_simple.html.erb +2 -1
  141. data/app/pb_kits/playbook/pb_progress_step/progress_step.html.erb +2 -1
  142. data/app/pb_kits/playbook/pb_progress_step/progress_step_item.html.erb +2 -1
  143. data/app/pb_kits/playbook/pb_radio/radio.html.erb +2 -1
  144. data/app/pb_kits/playbook/pb_section_separator/section_separator.html.erb +2 -1
  145. data/app/pb_kits/playbook/pb_select/select.html.erb +2 -1
  146. data/app/pb_kits/playbook/pb_selectable_card/selectable_card.html.erb +2 -1
  147. data/app/pb_kits/playbook/pb_selectable_card_icon/selectable_card_icon.html.erb +2 -1
  148. data/app/pb_kits/playbook/pb_selectable_icon/selectable_icon.html.erb +2 -1
  149. data/app/pb_kits/playbook/pb_selectable_list/selectable_list.html.erb +2 -1
  150. data/app/pb_kits/playbook/pb_selectable_list/selectable_list_item.html.erb +2 -1
  151. data/app/pb_kits/playbook/pb_source/source.html.erb +2 -1
  152. data/app/pb_kits/playbook/pb_star_rating/star_rating.html.erb +2 -1
  153. data/app/pb_kits/playbook/pb_stat_change/stat_change.html.erb +2 -1
  154. data/app/pb_kits/playbook/pb_stat_value/stat_value.html.erb +2 -1
  155. data/app/pb_kits/playbook/pb_table/_table.tsx +13 -0
  156. data/app/pb_kits/playbook/pb_table/docs/_table_side_highlight.jsx +24 -25
  157. data/app/pb_kits/playbook/pb_table/docs/_table_with_subcomponents.jsx +47 -0
  158. data/app/pb_kits/playbook/pb_table/docs/_table_with_subcomponents.md +7 -0
  159. data/app/pb_kits/playbook/pb_table/docs/_table_with_subcomponents_as_divs.html.erb +34 -0
  160. data/app/pb_kits/playbook/pb_table/docs/_table_with_subcomponents_as_divs.jsx +48 -0
  161. data/app/pb_kits/playbook/pb_table/docs/_table_with_subcomponents_as_divs.md +3 -0
  162. data/app/pb_kits/playbook/pb_table/docs/_table_with_subcomponents_rails.html.erb +34 -0
  163. data/app/pb_kits/playbook/pb_table/docs/_table_with_subcomponents_rails.md +7 -0
  164. data/app/pb_kits/playbook/pb_table/docs/example.yml +6 -2
  165. data/app/pb_kits/playbook/pb_table/docs/index.js +2 -0
  166. data/app/pb_kits/playbook/pb_table/styles/_striped.scss +2 -2
  167. data/app/pb_kits/playbook/pb_table/styles/_structure.scss +4 -2
  168. data/app/pb_kits/playbook/pb_table/subcomponents/_table_body.tsx +64 -0
  169. data/app/pb_kits/playbook/pb_table/subcomponents/_table_cell.tsx +66 -0
  170. data/app/pb_kits/playbook/pb_table/subcomponents/_table_head.tsx +64 -0
  171. data/app/pb_kits/playbook/pb_table/subcomponents/_table_header.tsx +66 -0
  172. data/app/pb_kits/playbook/pb_table/subcomponents/_table_row.tsx +74 -0
  173. data/app/pb_kits/playbook/pb_table/subcomponents/index.tsx +5 -0
  174. data/app/pb_kits/playbook/pb_table/table.html.erb +4 -2
  175. data/app/pb_kits/playbook/pb_table/table.test.js +142 -1
  176. data/app/pb_kits/playbook/pb_table/table_body.html.erb +19 -0
  177. data/app/pb_kits/playbook/pb_table/table_body.rb +15 -0
  178. data/app/pb_kits/playbook/pb_table/table_cell.html.erb +19 -0
  179. data/app/pb_kits/playbook/pb_table/table_cell.rb +17 -0
  180. data/app/pb_kits/playbook/pb_table/table_head.html.erb +19 -0
  181. data/app/pb_kits/playbook/pb_table/table_head.rb +15 -0
  182. data/app/pb_kits/playbook/pb_table/table_header.html.erb +50 -38
  183. data/app/pb_kits/playbook/pb_table/table_header.rb +8 -1
  184. data/app/pb_kits/playbook/pb_table/table_row.html.erb +18 -6
  185. data/app/pb_kits/playbook/pb_table/table_row.rb +8 -1
  186. data/app/pb_kits/playbook/pb_text_input/_text_input.scss +0 -1
  187. data/app/pb_kits/playbook/pb_text_input/_text_input.tsx +9 -5
  188. data/app/pb_kits/playbook/pb_text_input/docs/_text_input_add_on.jsx +20 -0
  189. data/app/pb_kits/playbook/pb_text_input/text_input.html.erb +2 -1
  190. data/app/pb_kits/playbook/pb_text_input/text_input.rb +2 -1
  191. data/app/pb_kits/playbook/pb_textarea/textarea.html.erb +2 -1
  192. data/app/pb_kits/playbook/pb_time/time.html.erb +2 -1
  193. data/app/pb_kits/playbook/pb_time_range_inline/time_range_inline.html.erb +3 -2
  194. data/app/pb_kits/playbook/pb_time_stacked/time_stacked.html.erb +2 -1
  195. data/app/pb_kits/playbook/pb_timeline/item.html.erb +2 -1
  196. data/app/pb_kits/playbook/pb_timeline/timeline.html.erb +2 -1
  197. data/app/pb_kits/playbook/pb_timestamp/timestamp.html.erb +2 -1
  198. data/app/pb_kits/playbook/pb_title/title.html.erb +3 -2
  199. data/app/pb_kits/playbook/pb_title_count/title_count.html.erb +2 -1
  200. data/app/pb_kits/playbook/pb_title_detail/title_detail.html.erb +2 -1
  201. data/app/pb_kits/playbook/pb_toggle/toggle.html.erb +2 -1
  202. data/app/pb_kits/playbook/pb_tooltip/tooltip.html.erb +2 -1
  203. data/app/pb_kits/playbook/pb_typeahead/typeahead.html.erb +2 -1
  204. data/app/pb_kits/playbook/pb_user/docs/_user_presence_indicator_swift.md +30 -0
  205. data/app/pb_kits/playbook/pb_user/docs/_user_props_table.md +2 -1
  206. data/app/pb_kits/playbook/pb_user/docs/example.yml +1 -0
  207. data/app/pb_kits/playbook/pb_user/user.html.erb +2 -1
  208. data/app/pb_kits/playbook/pb_user_badge/user_badge.html.erb +2 -1
  209. data/app/pb_kits/playbook/pb_weekday_stacked/weekday_stacked.html.erb +2 -1
  210. data/app/pb_kits/playbook/utilities/_positioning.scss +48 -7
  211. data/app/pb_kits/playbook/utilities/globalProps.ts +23 -1
  212. data/dist/playbook-rails.js +6 -6
  213. data/lib/playbook/bottom.rb +33 -0
  214. data/lib/playbook/classnames.rb +4 -0
  215. data/lib/playbook/kit_base.rb +26 -0
  216. data/lib/playbook/left.rb +33 -0
  217. data/lib/playbook/right.rb +33 -0
  218. data/lib/playbook/top.rb +33 -0
  219. data/lib/playbook/version.rb +2 -2
  220. metadata +41 -7
  221. data/app/pb_kits/playbook/pb_table/_table_row.tsx +0 -47
@@ -4,7 +4,8 @@
4
4
  class: object.classname,
5
5
  data: object.data,
6
6
  id: object.id,
7
- value: object.value) do %>
7
+ value: object.value,
8
+ **combined_html_options) do %>
8
9
 
9
10
  <% if content.present? %>
10
11
  <%= content %>
@@ -2,7 +2,8 @@
2
2
  aria: object.aria,
3
3
  id: object.id,
4
4
  data: object.data,
5
- class: object.classname) do %>
5
+ class: object.classname,
6
+ **combined_html_options) do %>
6
7
  <% if object.orientation === 'horizontal' %>
7
8
  <% if content %>
8
9
  <%= content %>
@@ -1,7 +1,8 @@
1
1
  <%= content_tag(:div,
2
2
  aria: object.aria,
3
3
  data: object.data,
4
- class: object.classnames) do %>
4
+ class: object.classnames,
5
+ **combined_html_options) do %>
5
6
  <% if object.label %>
6
7
  <label class="pb_select_kit_label" for="<%= object.name %>">
7
8
  <%= pb_rails("caption", props: { text: object.label }) %>
@@ -1,7 +1,8 @@
1
1
  <%= content_tag(:div,
2
2
  id: object.id,
3
3
  data: object.data,
4
- class: object.classname) do %>
4
+ class: object.classname,
5
+ **combined_html_options) do %>
5
6
 
6
7
  <% if object.multi %>
7
8
  <%= check_box_tag(object.name, object.value, object.checked, object.additional_input_options) %>
@@ -1,6 +1,7 @@
1
1
  <%= content_tag(:div,
2
2
  data: object.data,
3
- class: object.classname) do %>
3
+ class: object.classname,
4
+ **combined_html_options) do %>
4
5
 
5
6
  <%= pb_rails("selectable_card", props: {
6
7
  input_id: object.input_id,
@@ -1,7 +1,8 @@
1
1
  <%= content_tag(:div,
2
2
  id: object.id,
3
3
  data: object.data,
4
- class: object.classname) do %>
4
+ class: object.classname,
5
+ **combined_html_options) do %>
5
6
 
6
7
  <% if object.inputs == "disabled" %>
7
8
 
@@ -2,7 +2,8 @@
2
2
  aria: object.aria,
3
3
  class: object.classname,
4
4
  data: object.data,
5
- id: object.id) do %>
5
+ id: object.id,
6
+ **combined_html_options) do %>
6
7
  <%= pb_rails("list") do %>
7
8
  <% object.items.each do |item| %>
8
9
  <%= pb_rails("selectable_list/selectable_list_item", props: item.merge(variant: object.variant, id: object.get_id(item)) )%>
@@ -2,7 +2,8 @@
2
2
  aria: object.aria,
3
3
  class: object.classname,
4
4
  data: object.data,
5
- id: object.id) do %>
5
+ id: object.id,
6
+ **combined_html_options) do %>
6
7
  <% if object.variant == "radio"%>
7
8
  <%= pb_rails("radio", props: { text: object.text, checked: object.checked, input_options: object.input_options } ) %>
8
9
  <% if content.present? %>
@@ -1,7 +1,8 @@
1
1
  <%= content_tag(:div,
2
2
  id: object.id,
3
3
  data: object.data,
4
- class: object.classname) do %>
4
+ class: object.classname,
5
+ **combined_html_options) do %>
5
6
  <div class="pb__source_layout">
6
7
  <% if !object.hide_icon %>
7
8
  <% if object.show_icon? %>
@@ -1,7 +1,8 @@
1
1
  <%= content_tag(:div,
2
2
  id: object.id,
3
3
  data: object.data,
4
- class: object.classname) do %>
4
+ class: object.classname,
5
+ **combined_html_options) do %>
5
6
  <% if layout_option == "number" %>
6
7
  <% case object.size %>
7
8
  <% when "xs", "sm" %>
@@ -1,7 +1,8 @@
1
1
  <%= content_tag(:div,
2
2
  id: object.id,
3
3
  data: object.data,
4
- class: object.classname) do %>
4
+ class: object.classname,
5
+ **combined_html_options) do %>
5
6
  <%= pb_rails("body", props: { status: object.status }) do %>
6
7
  <%= pb_rails("icon", props: { fixed_width: true, icon: object.returned_icon }) if object.returned_icon %>
7
8
  <%= "#{object.value}%" if object.value %>
@@ -1,7 +1,8 @@
1
1
  <%= content_tag(:div,
2
2
  id: object.id,
3
3
  data: object.data,
4
- class: object.classname) do %>
4
+ class: object.classname,
5
+ **combined_html_options) do %>
5
6
  <div class="pb_stat_value_wrapper">
6
7
  <%= pb_rails "title", props: {
7
8
  classname: "pb_stat_value_kit",
@@ -3,6 +3,13 @@ import classnames from 'classnames'
3
3
  import { buildAriaProps, buildDataProps, buildHtmlProps } from '../utilities/props'
4
4
  import { globalProps, GlobalProps } from '../utilities/globalProps'
5
5
  import PbTable from '.'
6
+ import {
7
+ TableHead,
8
+ TableHeader,
9
+ TableBody,
10
+ TableRow,
11
+ TableCell,
12
+ } from "./subcomponents";
6
13
 
7
14
  type TableProps = {
8
15
  aria?: { [key: string]: string },
@@ -105,4 +112,10 @@ const Table = (props: TableProps) => {
105
112
  )
106
113
  }
107
114
 
115
+ Table.Head = TableHead
116
+ Table.Header = TableHeader
117
+ Table.Body = TableBody
118
+ Table.Row = TableRow
119
+ Table.Cell = TableCell
120
+
108
121
  export default Table
@@ -1,7 +1,6 @@
1
1
  import React from 'react'
2
2
 
3
3
  import Table from '../_table'
4
- import TableRow from '../_table_row'
5
4
 
6
5
  const TableSideHighlight = (props) => {
7
6
  return (
@@ -20,7 +19,7 @@ const TableSideHighlight = (props) => {
20
19
  </tr>
21
20
  </thead>
22
21
  <tbody>
23
- <TableRow
22
+ <Table.Row
24
23
  sideHighlightColor="product_1_highlight"
25
24
  {...props}
26
25
  >
@@ -29,8 +28,8 @@ const TableSideHighlight = (props) => {
29
28
  <td>{'Value 3'}</td>
30
29
  <td>{'Value 4'}</td>
31
30
  <td>{'Value 5'}</td>
32
- </TableRow>
33
- <TableRow
31
+ </Table.Row>
32
+ <Table.Row
34
33
  sideHighlightColor="product_2_highlight"
35
34
  {...props}
36
35
  >
@@ -39,8 +38,8 @@ const TableSideHighlight = (props) => {
39
38
  <td>{'Value 3'}</td>
40
39
  <td>{'Value 4'}</td>
41
40
  <td>{'Value 5'}</td>
42
- </TableRow>
43
- <TableRow
41
+ </Table.Row>
42
+ <Table.Row
44
43
  sideHighlightColor="product_3_highlight"
45
44
  {...props}
46
45
  >
@@ -49,8 +48,8 @@ const TableSideHighlight = (props) => {
49
48
  <td>{'Value 3'}</td>
50
49
  <td>{'Value 4'}</td>
51
50
  <td>{'Value 5'}</td>
52
- </TableRow>
53
- <TableRow
51
+ </Table.Row>
52
+ <Table.Row
54
53
  sideHighlightColor="none"
55
54
  {...props}
56
55
  >
@@ -59,7 +58,7 @@ const TableSideHighlight = (props) => {
59
58
  <td>{'Value 3'}</td>
60
59
  <td>{'Value 4'}</td>
61
60
  <td>{'Value 5'}</td>
62
- </TableRow>
61
+ </Table.Row>
63
62
  </tbody>
64
63
  </Table>
65
64
 
@@ -79,7 +78,7 @@ const TableSideHighlight = (props) => {
79
78
  </tr>
80
79
  </thead>
81
80
  <tbody>
82
- <TableRow
81
+ <Table.Row
83
82
  sideHighlightColor="success"
84
83
  {...props}
85
84
  >
@@ -88,8 +87,8 @@ const TableSideHighlight = (props) => {
88
87
  <td>{'Value 3'}</td>
89
88
  <td>{'Value 4'}</td>
90
89
  <td>{'Value 5'}</td>
91
- </TableRow>
92
- <TableRow
90
+ </Table.Row>
91
+ <Table.Row
93
92
  sideHighlightColor="warning"
94
93
  {...props}
95
94
  >
@@ -98,8 +97,8 @@ const TableSideHighlight = (props) => {
98
97
  <td>{'Value 3'}</td>
99
98
  <td>{'Value 4'}</td>
100
99
  <td>{'Value 5'}</td>
101
- </TableRow>
102
- <TableRow
100
+ </Table.Row>
101
+ <Table.Row
103
102
  sideHighlightColor="error"
104
103
  {...props}
105
104
  >
@@ -108,8 +107,8 @@ const TableSideHighlight = (props) => {
108
107
  <td>{'Value 3'}</td>
109
108
  <td>{'Value 4'}</td>
110
109
  <td>{'Value 5'}</td>
111
- </TableRow>
112
- <TableRow
110
+ </Table.Row>
111
+ <Table.Row
113
112
  sideHighlightColor="none"
114
113
  {...props}
115
114
  >
@@ -118,7 +117,7 @@ const TableSideHighlight = (props) => {
118
117
  <td>{'Value 3'}</td>
119
118
  <td>{'Value 4'}</td>
120
119
  <td>{'Value 5'}</td>
121
- </TableRow>
120
+ </Table.Row>
122
121
  </tbody>
123
122
  </Table>
124
123
 
@@ -138,7 +137,7 @@ const TableSideHighlight = (props) => {
138
137
  </tr>
139
138
  </thead>
140
139
  <tbody>
141
- <TableRow
140
+ <Table.Row
142
141
  sideHighlightColor="category_1"
143
142
  {...props}
144
143
  >
@@ -147,8 +146,8 @@ const TableSideHighlight = (props) => {
147
146
  <td>{'Value 3'}</td>
148
147
  <td>{'Value 4'}</td>
149
148
  <td>{'Value 5'}</td>
150
- </TableRow>
151
- <TableRow
149
+ </Table.Row>
150
+ <Table.Row
152
151
  sideHighlightColor="category_2"
153
152
  {...props}
154
153
  >
@@ -157,8 +156,8 @@ const TableSideHighlight = (props) => {
157
156
  <td>{'Value 3'}</td>
158
157
  <td>{'Value 4'}</td>
159
158
  <td>{'Value 5'}</td>
160
- </TableRow>
161
- <TableRow
159
+ </Table.Row>
160
+ <Table.Row
162
161
  sideHighlightColor="category_3"
163
162
  {...props}
164
163
  >
@@ -167,8 +166,8 @@ const TableSideHighlight = (props) => {
167
166
  <td>{'Value 3'}</td>
168
167
  <td>{'Value 4'}</td>
169
168
  <td>{'Value 5'}</td>
170
- </TableRow>
171
- <TableRow
169
+ </Table.Row>
170
+ <Table.Row
172
171
  sideHighlightColor="none"
173
172
  {...props}
174
173
  >
@@ -177,7 +176,7 @@ const TableSideHighlight = (props) => {
177
176
  <td>{'Value 3'}</td>
178
177
  <td>{'Value 4'}</td>
179
178
  <td>{'Value 5'}</td>
180
- </TableRow>
179
+ </Table.Row>
181
180
  </tbody>
182
181
  </Table>
183
182
  </div>
@@ -0,0 +1,47 @@
1
+ import React from 'react'
2
+
3
+ import Table from '../_table'
4
+
5
+ const TableWithSubcomponents = (props) => {
6
+ return (
7
+ <Table
8
+ size="sm"
9
+ {...props}
10
+ >
11
+ <Table.Head>
12
+ <Table.Row>
13
+ <Table.Header>{'Column 1'}</Table.Header>
14
+ <Table.Header>{'Column 2'}</Table.Header>
15
+ <Table.Header>{'Column 3'}</Table.Header>
16
+ <Table.Header>{'Column 4'}</Table.Header>
17
+ <Table.Header>{'Column 5'}</Table.Header>
18
+ </Table.Row>
19
+ </Table.Head>
20
+ <Table.Body>
21
+ <Table.Row>
22
+ <Table.Cell>{'Value 1'}</Table.Cell>
23
+ <Table.Cell>{'Value 2'}</Table.Cell>
24
+ <Table.Cell>{'Value 3'}</Table.Cell>
25
+ <Table.Cell>{'Value 4'}</Table.Cell>
26
+ <Table.Cell>{'Value 5'}</Table.Cell>
27
+ </Table.Row>
28
+ <Table.Row>
29
+ <Table.Cell>{'Value 1'}</Table.Cell>
30
+ <Table.Cell>{'Value 2'}</Table.Cell>
31
+ <Table.Cell>{'Value 3'}</Table.Cell>
32
+ <Table.Cell>{'Value 4'}</Table.Cell>
33
+ <Table.Cell>{'Value 5'}</Table.Cell>
34
+ </Table.Row>
35
+ <Table.Row>
36
+ <Table.Cell>{'Value 1'}</Table.Cell>
37
+ <Table.Cell>{'Value 2'}</Table.Cell>
38
+ <Table.Cell>{'Value 3'}</Table.Cell>
39
+ <Table.Cell>{'Value 4'}</Table.Cell>
40
+ <Table.Cell>{'Value 5'}</Table.Cell>
41
+ </Table.Row>
42
+ </Table.Body>
43
+ </Table>
44
+ )
45
+ }
46
+
47
+ export default TableWithSubcomponents
@@ -0,0 +1,7 @@
1
+ You can optionally build your table using our sub-components, which map to their respective html table elements:
2
+
3
+ `Table.Head` = `thead`
4
+ `Table.Body` = `tbody`
5
+ `Table.Row` = `tr`
6
+ `Table.Header` = `th`
7
+ `Table.Cell` = `td`
@@ -0,0 +1,34 @@
1
+ <%= pb_rails("table", props: { size: "sm", tag:"div" }) do %>
2
+ <%= pb_rails("table/table_head", props: {tag:"div"}) do %>
3
+ <%= pb_rails("table/table_row", props: {tag:"div"}) do %>
4
+ <%= pb_rails("table/table_header", props: { text: "Column 1", tag:"div"}) %>
5
+ <%= pb_rails("table/table_header", props: { text: "Column 2", tag:"div"}) %>
6
+ <%= pb_rails("table/table_header", props: { text: "Column 3", tag:"div"}) %>
7
+ <%= pb_rails("table/table_header", props: { text: "Column 4", tag:"div"}) %>
8
+ <%= pb_rails("table/table_header", props: { text: "Column 5", tag:"div"}) %>
9
+ <% end %>
10
+ <% end %>
11
+ <%= pb_rails("table/table_body", props: {tag:"div"}) do %>
12
+ <%= pb_rails("table/table_row", props: {tag:"div"}) do %>
13
+ <%= pb_rails("table/table_cell", props: { text: "Value 1", tag:"div"}) %>
14
+ <%= pb_rails("table/table_cell", props: { text: "Value 2", tag:"div"}) %>
15
+ <%= pb_rails("table/table_cell", props: { text: "Value 3", tag:"div"}) %>
16
+ <%= pb_rails("table/table_cell", props: { text: "Value 4", tag:"div"}) %>
17
+ <%= pb_rails("table/table_cell", props: { text: "Value 5", tag:"div"}) %>
18
+ <% end %>
19
+ <%= pb_rails("table/table_row", props: {tag:"div"}) do %>
20
+ <%= pb_rails("table/table_cell", props: { text: "Value 1", tag:"div"}) %>
21
+ <%= pb_rails("table/table_cell", props: { text: "Value 2", tag:"div"}) %>
22
+ <%= pb_rails("table/table_cell", props: { text: "Value 3", tag:"div"}) %>
23
+ <%= pb_rails("table/table_cell", props: { text: "Value 4", tag:"div"}) %>
24
+ <%= pb_rails("table/table_cell", props: { text: "Value 5", tag:"div"}) %>
25
+ <% end %>
26
+ <%= pb_rails("table/table_row", props: {tag:"div"}) do %>
27
+ <%= pb_rails("table/table_cell", props: { text: "Value 1", tag:"div"}) %>
28
+ <%= pb_rails("table/table_cell", props: { text: "Value 2", tag:"div"}) %>
29
+ <%= pb_rails("table/table_cell", props: { text: "Value 3", tag:"div"}) %>
30
+ <%= pb_rails("table/table_cell", props: { text: "Value 4", tag:"div"}) %>
31
+ <%= pb_rails("table/table_cell", props: { text: "Value 5", tag:"div"}) %>
32
+ <% end %>
33
+ <% end %>
34
+ <% end %>
@@ -0,0 +1,48 @@
1
+ import React from 'react'
2
+
3
+ import Table from '../_table'
4
+
5
+ const TableWithSubcomponentsAsDivs = (props) => {
6
+ return (
7
+ <Table
8
+ size="sm"
9
+ tag="div"
10
+ {...props}
11
+ >
12
+ <Table.Head tag="div">
13
+ <Table.Row tag="div">
14
+ <Table.Header tag="div">{'Column 1'}</Table.Header>
15
+ <Table.Header tag="div">{'Column 2'}</Table.Header>
16
+ <Table.Header tag="div">{'Column 3'}</Table.Header>
17
+ <Table.Header tag="div">{'Column 4'}</Table.Header>
18
+ <Table.Header tag="div">{'Column 5'}</Table.Header>
19
+ </Table.Row>
20
+ </Table.Head>
21
+ <Table.Body tag="div">
22
+ <Table.Row tag="div">
23
+ <Table.Cell tag="div">{'Value 1'}</Table.Cell>
24
+ <Table.Cell tag="div">{'Value 2'}</Table.Cell>
25
+ <Table.Cell tag="div">{'Value 3'}</Table.Cell>
26
+ <Table.Cell tag="div">{'Value 4'}</Table.Cell>
27
+ <Table.Cell tag="div">{'Value 5'}</Table.Cell>
28
+ </Table.Row>
29
+ <Table.Row tag="div">
30
+ <Table.Cell tag="div">{'Value 1'}</Table.Cell>
31
+ <Table.Cell tag="div">{'Value 2'}</Table.Cell>
32
+ <Table.Cell tag="div">{'Value 3'}</Table.Cell>
33
+ <Table.Cell tag="div">{'Value 4'}</Table.Cell>
34
+ <Table.Cell tag="div">{'Value 5'}</Table.Cell>
35
+ </Table.Row>
36
+ <Table.Row>
37
+ <Table.Cell tag="div">{'Value 1'}</Table.Cell>
38
+ <Table.Cell tag="div">{'Value 2'}</Table.Cell>
39
+ <Table.Cell tag="div">{'Value 3'}</Table.Cell>
40
+ <Table.Cell tag="div">{'Value 4'}</Table.Cell>
41
+ <Table.Cell tag="div">{'Value 5'}</Table.Cell>
42
+ </Table.Row>
43
+ </Table.Body>
44
+ </Table>
45
+ )
46
+ }
47
+
48
+ export default TableWithSubcomponentsAsDivs
@@ -0,0 +1,3 @@
1
+ Optionally build your table with divs by passing `div` to the `tag` prop of all* your sub-components.
2
+
3
+ *NOTE: The `tag` prop defaults to `table`, which returns html elements. If divs are desired, sub-components must be used and all table elements, including the initial kit call, must use `div` as their `tag` in order for the table to render properly.
@@ -0,0 +1,34 @@
1
+ <%= pb_rails("table", props: { size: "sm" }) do %>
2
+ <%= pb_rails("table/table_head") do %>
3
+ <%= pb_rails("table/table_row") do %>
4
+ <%= pb_rails("table/table_header", props: { text: "Column 1"}) %>
5
+ <%= pb_rails("table/table_header", props: { text: "Column 2"}) %>
6
+ <%= pb_rails("table/table_header", props: { text: "Column 3"}) %>
7
+ <%= pb_rails("table/table_header", props: { text: "Column 4"}) %>
8
+ <%= pb_rails("table/table_header", props: { text: "Column 5"}) %>
9
+ <% end %>
10
+ <% end %>
11
+ <%= pb_rails("table/table_body") do %>
12
+ <%= pb_rails("table/table_row") do %>
13
+ <%= pb_rails("table/table_cell", props: { text: "Value 1"}) %>
14
+ <%= pb_rails("table/table_cell", props: { text: "Value 2"}) %>
15
+ <%= pb_rails("table/table_cell", props: { text: "Value 3"}) %>
16
+ <%= pb_rails("table/table_cell", props: { text: "Value 4"}) %>
17
+ <%= pb_rails("table/table_cell", props: { text: "Value 5"}) %>
18
+ <% end %>
19
+ <%= pb_rails("table/table_row") do %>
20
+ <%= pb_rails("table/table_cell", props: { text: "Value 1"}) %>
21
+ <%= pb_rails("table/table_cell", props: { text: "Value 2"}) %>
22
+ <%= pb_rails("table/table_cell", props: { text: "Value 3"}) %>
23
+ <%= pb_rails("table/table_cell", props: { text: "Value 4"}) %>
24
+ <%= pb_rails("table/table_cell", props: { text: "Value 5"}) %>
25
+ <% end %>
26
+ <%= pb_rails("table/table_row") do %>
27
+ <%= pb_rails("table/table_cell", props: { text: "Value 1"}) %>
28
+ <%= pb_rails("table/table_cell", props: { text: "Value 2"}) %>
29
+ <%= pb_rails("table/table_cell", props: { text: "Value 3"}) %>
30
+ <%= pb_rails("table/table_cell", props: { text: "Value 4"}) %>
31
+ <%= pb_rails("table/table_cell", props: { text: "Value 5"}) %>
32
+ <% end %>
33
+ <% end %>
34
+ <% end %>
@@ -0,0 +1,7 @@
1
+ You can optionally build your table using our sub-components, which map to their respective html table elements:
2
+
3
+ `table_head` = `thead`
4
+ `table_body` = `tbody`
5
+ `table_row` = `tr`
6
+ `table_header` = `th`
7
+ `table_cell` = `td`
@@ -1,6 +1,5 @@
1
1
  examples:
2
2
  rails:
3
- # - table_div: Div
4
3
  - table_sm: Small
5
4
  - table_md: Medium
6
5
  - table_lg: Large
@@ -25,9 +24,11 @@ examples:
25
24
  - table_with_background_kit: Table With Background Kit
26
25
  - table_vertical_border: Vertical Borders
27
26
  - table_striped: Striped Table
27
+ - table_with_subcomponents_rails: Table with Sub Components (Table Elements)
28
+ - table_with_subcomponents_as_divs: Table with Sub Components (Divs)
29
+
28
30
 
29
31
  react:
30
- # - table_div: Div
31
32
  - table_sm: Small
32
33
  - table_md: Medium
33
34
  - table_lg: Large
@@ -51,3 +52,6 @@ examples:
51
52
  - table_with_background_kit: Table With Background Kit
52
53
  - table_vertical_border: Vertical Borders
53
54
  - table_striped: Striped Table
55
+ - table_with_subcomponents: Table with Sub Components (Table Elements)
56
+ - table_with_subcomponents_as_divs: Table with Sub Components (Divs)
57
+
@@ -22,3 +22,5 @@ export { default as TableWithBackgroundKit } from './_table_with_background_kit.
22
22
  export { default as TableVerticalBorder } from './_table_vertical_border.jsx'
23
23
  export { default as TableStriped } from './_table_striped.jsx'
24
24
  export { default as TableDiv } from './_table_div.jsx'
25
+ export { default as TableWithSubcomponents } from './_table_with_subcomponents.jsx'
26
+ export { default as TableWithSubcomponentsAsDivs } from './_table_with_subcomponents_as_divs.jsx'
@@ -1,7 +1,7 @@
1
1
  [class^=pb_table] {
2
2
  &.striped {
3
3
  tbody, .pb_table_tbody {
4
- tr:nth-child(odd), .tr:nth-child(odd) {
4
+ tr:nth-child(odd), .pb_table_tr:nth-child(odd) {
5
5
  background-color: $bg_light;
6
6
  }
7
7
  }
@@ -10,7 +10,7 @@
10
10
  &.dark {
11
11
  &.striped {
12
12
  tbody, .pb_table_tbody {
13
- tr:nth-child(odd), .tr:nth-child(odd) {
13
+ tr:nth-child(odd), .pb_table_tr:nth-child(odd) {
14
14
  background-color: $bg_dark;
15
15
  }
16
16
  }
@@ -48,7 +48,8 @@
48
48
  }
49
49
  }
50
50
  &.data_table {
51
- thead tr th {
51
+ thead tr th,
52
+ .pb_table_thead .pb_table_tr .pb_table_th {
52
53
  padding-top: $cell-pad-sm;
53
54
  padding-bottom: $cell-pad-sm;
54
55
  &:first-child {
@@ -58,7 +59,8 @@
58
59
  padding-right: $cell-pad-sm;
59
60
  }
60
61
  }
61
- tbody tr td {
62
+ tbody tr td,
63
+ .pb_table_tbody .pb_table_tr .pb_table_td {
62
64
  padding-top: $cell-pad-sm;
63
65
  padding-bottom: $cell-pad-sm;
64
66
  &:first-child {
@@ -0,0 +1,64 @@
1
+ import React from "react";
2
+ import classnames from "classnames";
3
+ import {
4
+ buildAriaProps,
5
+ buildDataProps,
6
+ buildHtmlProps,
7
+ } from "../../utilities/props";
8
+ import { globalProps } from "../../utilities/globalProps";
9
+
10
+ type TableBodyPropTypes = {
11
+ aria?: { [key: string]: string };
12
+ children: React.ReactNode[] | React.ReactNode;
13
+ className: string;
14
+ data?: { [key: string]: string };
15
+ htmlOptions?: { [key: string]: string | number | boolean | (() => void) };
16
+ id?: string;
17
+ tag?: "table" | "div";
18
+ };
19
+
20
+ const TableBody = (props: TableBodyPropTypes) => {
21
+ const {
22
+ aria = {},
23
+ children,
24
+ className,
25
+ data = {},
26
+ htmlOptions = {},
27
+ id,
28
+ tag = "table",
29
+ } = props;
30
+
31
+ const ariaProps = buildAriaProps(aria);
32
+ const dataProps = buildDataProps(data);
33
+ const htmlProps = buildHtmlProps(htmlOptions);
34
+ const classes = classnames("pb_table_tbody", globalProps(props), className);
35
+ const isTableTag = tag === "table";
36
+
37
+ return (
38
+ <>
39
+ {isTableTag ? (
40
+ <tbody
41
+ {...ariaProps}
42
+ {...dataProps}
43
+ {...htmlProps}
44
+ className={classes}
45
+ id={id}
46
+ >
47
+ {children}
48
+ </tbody>
49
+ ) : (
50
+ <div
51
+ {...ariaProps}
52
+ {...dataProps}
53
+ {...htmlProps}
54
+ className={classes}
55
+ id={id}
56
+ >
57
+ {children}
58
+ </div>
59
+ )}
60
+ </>
61
+ );
62
+ };
63
+
64
+ export default TableBody;