playbook_ui 14.9.0 → 14.10.0.pre.alpha.PBNTR662stickyrightcolumnreact5160

Sign up to get free protection for your applications and to get access to all the features.
Files changed (139) hide show
  1. checksums.yaml +4 -4
  2. data/app/pb_kits/playbook/pb_advanced_table/Components/CollapsibleTrail.tsx +1 -6
  3. data/app/pb_kits/playbook/pb_advanced_table/Components/TableHeaderCell.tsx +32 -19
  4. data/app/pb_kits/playbook/pb_advanced_table/SubKits/TableBody.tsx +3 -1
  5. data/app/pb_kits/playbook/pb_advanced_table/_advanced_table.scss +48 -3
  6. data/app/pb_kits/playbook/pb_advanced_table/_advanced_table.tsx +94 -36
  7. data/app/pb_kits/playbook/pb_advanced_table/advanced_table.test.jsx +2 -2
  8. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_collapsible_trail_rails.html.erb +36 -0
  9. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_collapsible_trail_rails.md +1 -0
  10. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_column_headers.jsx +60 -0
  11. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_column_headers.md +1 -0
  12. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_column_headers_multiple.jsx +74 -0
  13. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_column_headers_multiple.md +1 -0
  14. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_pagination.jsx +50 -0
  15. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_pagination.md +1 -0
  16. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_pagination_with_props.jsx +57 -0
  17. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_pagination_with_props.md +5 -0
  18. data/app/pb_kits/playbook/pb_advanced_table/docs/advanced_table_pagination_mock_data.json +5600 -0
  19. data/app/pb_kits/playbook/pb_advanced_table/docs/example.yml +5 -0
  20. data/app/pb_kits/playbook/pb_advanced_table/docs/index.js +4 -0
  21. data/app/pb_kits/playbook/pb_advanced_table/table_body.rb +4 -2
  22. data/app/pb_kits/playbook/pb_advanced_table/table_header.html.erb +5 -3
  23. data/app/pb_kits/playbook/pb_advanced_table/table_row.html.erb +8 -0
  24. data/app/pb_kits/playbook/pb_advanced_table/table_row.rb +2 -0
  25. data/app/pb_kits/playbook/pb_advanced_table/table_subrow_header.html.erb +8 -0
  26. data/app/pb_kits/playbook/pb_advanced_table/table_subrow_header.rb +2 -0
  27. data/app/pb_kits/playbook/pb_avatar/_avatar.scss +0 -2
  28. data/app/pb_kits/playbook/pb_bar_graph/docs/_bar_graph_custom.jsx +53 -49
  29. data/app/pb_kits/playbook/pb_bar_graph/docs/_bar_graph_custom_rails.html.erb +29 -36
  30. data/app/pb_kits/playbook/pb_body/_body.scss +14 -13
  31. data/app/pb_kits/playbook/pb_body/_body_mixins.scss +22 -16
  32. data/app/pb_kits/playbook/pb_bread_crumbs/docs/_bread_crumbs_default.jsx +6 -0
  33. data/app/pb_kits/playbook/pb_caption/_caption_mixin.scss +2 -1
  34. data/app/pb_kits/playbook/pb_card/_card.tsx +7 -7
  35. data/app/pb_kits/playbook/pb_card/_card_mixin.scss +2 -2
  36. data/app/pb_kits/playbook/pb_card/docs/_card_header.html.erb +21 -1
  37. data/app/pb_kits/playbook/pb_card/docs/_card_header.jsx +50 -0
  38. data/app/pb_kits/playbook/pb_card/docs/_card_header.md +1 -1
  39. data/app/pb_kits/playbook/pb_circle_icon_button/_circle_icon_button.tsx +3 -0
  40. data/app/pb_kits/playbook/pb_circle_icon_button/circle_icon_button.html.erb +1 -1
  41. data/app/pb_kits/playbook/pb_circle_icon_button/circle_icon_button.rb +1 -0
  42. data/app/pb_kits/playbook/pb_circle_icon_button/docs/_circle_icon_button_link.html.erb +8 -0
  43. data/app/pb_kits/playbook/pb_circle_icon_button/docs/_circle_icon_button_link.jsx +9 -0
  44. data/app/pb_kits/playbook/pb_circle_icon_button/docs/_circle_icon_button_link.md +1 -0
  45. data/app/pb_kits/playbook/pb_collapsible/_collapsible.tsx +9 -4
  46. data/app/pb_kits/playbook/pb_collapsible/child_kits/CollapsibleContent.tsx +2 -2
  47. data/app/pb_kits/playbook/pb_collapsible/child_kits/CollapsibleMain.tsx +2 -2
  48. data/app/pb_kits/playbook/pb_drawer/_drawer.tsx +2 -2
  49. data/app/pb_kits/playbook/pb_file_upload/_file_upload.scss +5 -0
  50. data/app/pb_kits/playbook/pb_file_upload/_file_upload.tsx +7 -2
  51. data/app/pb_kits/playbook/pb_file_upload/file_upload.html.erb +8 -2
  52. data/app/pb_kits/playbook/pb_form_group/_error_state_mixin.scss +57 -0
  53. data/app/pb_kits/playbook/pb_form_group/_form_group.scss +11 -2
  54. data/app/pb_kits/playbook/pb_gauge/_gauge.scss +31 -1
  55. data/app/pb_kits/playbook/pb_gauge/_gauge.tsx +3 -3
  56. data/app/pb_kits/playbook/pb_gauge/docs/_gauge_complex.jsx +25 -5
  57. data/app/pb_kits/playbook/pb_home_address_street/_home_address_street.tsx +17 -1
  58. data/app/pb_kits/playbook/pb_home_address_street/docs/_home_address_street_emphasis.html.erb +17 -1
  59. data/app/pb_kits/playbook/pb_home_address_street/docs/_home_address_street_emphasis.jsx +15 -0
  60. data/app/pb_kits/playbook/pb_home_address_street/docs/_home_address_street_emphasis.md +2 -1
  61. data/app/pb_kits/playbook/pb_home_address_street/home_address_street.rb +15 -1
  62. data/app/pb_kits/playbook/pb_home_address_street/none_emphasis.html.erb +32 -0
  63. data/app/pb_kits/playbook/pb_home_address_street/none_emphasis.rb +29 -0
  64. data/app/pb_kits/playbook/pb_layout/_layout.tsx +30 -11
  65. data/app/pb_kits/playbook/pb_link/_link.scss +3 -3
  66. data/app/pb_kits/playbook/pb_nav/_bold_mixin.scss +11 -1
  67. data/app/pb_kits/playbook/pb_nav/_collapsible_nav.scss +16 -2
  68. data/app/pb_kits/playbook/pb_nav/_vertical_nav.scss +1 -1
  69. data/app/pb_kits/playbook/pb_pagination/_pagination.tsx +2 -2
  70. data/app/pb_kits/playbook/pb_selectable_card/_selectable_card.scss +4 -4
  71. data/app/pb_kits/playbook/pb_selectable_card/selectable_card.html.erb +1 -1
  72. data/app/pb_kits/playbook/pb_skeleton_loading/docs/_skeleton_loading_filter.jsx +166 -0
  73. data/app/pb_kits/playbook/pb_skeleton_loading/docs/_skeleton_loading_height_width.jsx +2 -0
  74. data/app/pb_kits/playbook/pb_skeleton_loading/docs/_skeleton_loading_user.jsx +89 -0
  75. data/app/pb_kits/playbook/pb_skeleton_loading/docs/example.yml +2 -1
  76. data/app/pb_kits/playbook/pb_skeleton_loading/docs/index.js +2 -0
  77. data/app/pb_kits/playbook/pb_stat_change/_stat_change.tsx +44 -36
  78. data/app/pb_kits/playbook/pb_stat_change/stat_change.html.erb +4 -4
  79. data/app/pb_kits/playbook/pb_table/_table.tsx +73 -24
  80. data/app/pb_kits/playbook/pb_table/docs/_table_sticky_columns.jsx +88 -0
  81. data/app/pb_kits/playbook/pb_table/docs/_table_sticky_columns_react.md +3 -0
  82. data/app/pb_kits/playbook/pb_table/docs/_table_sticky_left_columns.html.erb +77 -0
  83. data/app/pb_kits/playbook/pb_table/docs/_table_sticky_left_columns.jsx +1 -1
  84. data/app/pb_kits/playbook/pb_table/docs/_table_sticky_left_columns_rails.md +3 -0
  85. data/app/pb_kits/playbook/pb_table/docs/_table_sticky_left_columns_react.md +4 -1
  86. data/app/pb_kits/playbook/pb_table/docs/_table_sticky_right_columns.jsx +87 -0
  87. data/app/pb_kits/playbook/pb_table/docs/_table_sticky_right_columns_react.md +5 -0
  88. data/app/pb_kits/playbook/pb_table/docs/_table_with_collapsible.jsx +75 -0
  89. data/app/pb_kits/playbook/pb_table/docs/_table_with_collapsible.md +1 -0
  90. data/app/pb_kits/playbook/pb_table/docs/_table_with_collapsible_with_custom_click.jsx +108 -0
  91. data/app/pb_kits/playbook/pb_table/docs/_table_with_collapsible_with_custom_click.md +2 -0
  92. data/app/pb_kits/playbook/pb_table/docs/_table_with_collapsible_with_custom_content.jsx +94 -0
  93. data/app/pb_kits/playbook/pb_table/docs/_table_with_collapsible_with_custom_content.md +0 -0
  94. data/app/pb_kits/playbook/pb_table/docs/_table_with_collapsible_with_nested_rows.jsx +83 -0
  95. data/app/pb_kits/playbook/pb_table/docs/_table_with_collapsible_with_nested_rows.md +3 -0
  96. data/app/pb_kits/playbook/pb_table/docs/_table_with_collapsible_with_nested_table.jsx +120 -0
  97. data/app/pb_kits/playbook/pb_table/docs/_table_with_collapsible_with_nested_table.md +1 -0
  98. data/app/pb_kits/playbook/pb_table/docs/example.yml +7 -0
  99. data/app/pb_kits/playbook/pb_table/docs/index.js +5 -0
  100. data/app/pb_kits/playbook/pb_table/index.ts +102 -26
  101. data/app/pb_kits/playbook/pb_table/styles/_all.scss +2 -1
  102. data/app/pb_kits/playbook/pb_table/styles/_collapsible.scss +35 -0
  103. data/app/pb_kits/playbook/pb_table/styles/_scroll.scss +44 -3
  104. data/app/pb_kits/playbook/pb_table/styles/_sticky_columns.scss +17 -4
  105. data/app/pb_kits/playbook/pb_table/subcomponents/_table_row.tsx +106 -1
  106. data/app/pb_kits/playbook/pb_table/table.html.erb +8 -2
  107. data/app/pb_kits/playbook/pb_table/table.rb +21 -2
  108. data/app/pb_kits/playbook/pb_text_input/_text_input.tsx +35 -3
  109. data/app/pb_kits/playbook/pb_text_input/docs/_text_input_mask.jsx +88 -0
  110. data/app/pb_kits/playbook/pb_text_input/docs/example.yml +1 -0
  111. data/app/pb_kits/playbook/pb_text_input/docs/index.js +1 -0
  112. data/app/pb_kits/playbook/pb_text_input/inputMask.ts +64 -0
  113. data/app/pb_kits/playbook/pb_text_input/text_input.test.js +139 -2
  114. data/app/pb_kits/playbook/pb_title/_title.scss +6 -5
  115. data/app/pb_kits/playbook/pb_title/_title_mixin.scss +13 -0
  116. data/app/pb_kits/playbook/pb_typeahead/_typeahead.scss +115 -46
  117. data/app/pb_kits/playbook/pb_typeahead/docs/_typeahead_with_highlight.jsx +9 -2
  118. data/app/pb_kits/playbook/pb_typeahead/typeahead.html.erb +3 -2
  119. data/app/pb_kits/playbook/tokens/_titles.scss +0 -8
  120. data/app/pb_kits/playbook/utilities/_hover.scss +11 -2
  121. data/app/pb_kits/playbook/utilities/globalProps.ts +2 -0
  122. data/app/pb_kits/playbook/utilities/test/globalProps/hover.test.js +15 -0
  123. data/dist/chunks/_typeahead-aym7Ky_O.js +22 -0
  124. data/dist/chunks/_weekday_stacked-BZj1pop-.js +45 -0
  125. data/dist/chunks/lazysizes-B7xYodB-.js +1 -0
  126. data/dist/chunks/{lib-SyD3buPZ.js → lib-B7sgJtGS.js} +3 -3
  127. data/dist/chunks/{pb_form_validation-Dt8UJgrJ.js → pb_form_validation-C5Cc0-1v.js} +1 -1
  128. data/dist/chunks/vendor.js +1 -1
  129. data/dist/menu.yml +1 -1
  130. data/dist/playbook-doc.js +1 -1
  131. data/dist/playbook-rails-react-bindings.js +1 -1
  132. data/dist/playbook-rails.js +1 -1
  133. data/dist/playbook.css +1 -1
  134. data/lib/playbook/hover.rb +7 -1
  135. data/lib/playbook/version.rb +2 -2
  136. metadata +46 -10
  137. data/dist/chunks/_typeahead-B8fkIeXA.js +0 -22
  138. data/dist/chunks/_weekday_stacked-CVYxBYHe.js +0 -45
  139. data/dist/chunks/lazysizes-DHz07jlL.js +0 -1
@@ -2,6 +2,7 @@ examples:
2
2
  rails:
3
3
  - advanced_table_beta: Default (Required Props)
4
4
  - advanced_table_beta_subrow_headers: SubRow Headers
5
+ - advanced_table_collapsible_trail_rails: Collapsible Trail
5
6
  - advanced_table_beta_sort: Enable Sorting
6
7
  - advanced_table_custom_cell_rails: Custom Components for Cells
7
8
 
@@ -18,3 +19,7 @@ examples:
18
19
  - advanced_table_inline_row_loading: Inline Row Loading
19
20
  - advanced_table_responsive: Responsive Tables
20
21
  - advanced_table_custom_cell: Custom Components for Cells
22
+ - advanced_table_pagination: Pagination
23
+ - advanced_table_pagination_with_props: Pagination Props
24
+ - advanced_table_column_headers: Multi-Header Columns
25
+ - advanced_table_column_headers_multiple: Multi-Header Columns (Multiple Levels)
@@ -10,3 +10,7 @@ export { default as AdvancedTableTableProps } from './_advanced_table_table_prop
10
10
  export { default as AdvancedTableInlineRowLoading } from './_advanced_table_inline_row_loading.jsx'
11
11
  export { default as AdvancedTableResponsive } from './_advanced_table_responsive.jsx'
12
12
  export { default as AdvancedTableCustomCell } from './_advanced_table_custom_cell.jsx'
13
+ export { default as AdvancedTablePagination } from './_advanced_table_pagination.jsx'
14
+ export { default as AdvancedTablePaginationWithProps } from './_advanced_table_pagination_with_props.jsx'
15
+ export { default as AdvancedTableColumnHeaders } from './_advanced_table_column_headers.jsx'
16
+ export { default as AdvancedTableColumnHeadersMultiple } from './_advanced_table_column_headers_multiple.jsx'
@@ -14,14 +14,16 @@ module Playbook
14
14
  default: "header"
15
15
  prop :subrow_headers, type: Playbook::Props::Array,
16
16
  default: []
17
+ prop :collapsible_trail, type: Playbook::Props::Boolean,
18
+ default: true
17
19
 
18
20
  def render_row_and_children(row, column_definitions, current_depth, first_parent_child)
19
21
  output = ActiveSupport::SafeBuffer.new
20
22
  is_first_child_of_subrow = current_depth.positive? && first_parent_child && subrow_headers[current_depth - 1].present?
21
23
 
22
- 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] }) if is_first_child_of_subrow && enable_toggle_expansion == "all"
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"
23
25
 
24
- output << pb_rails("advanced_table/table_row", props: { id: id, row: row, column_definitions: column_definitions, depth: current_depth })
26
+ output << pb_rails("advanced_table/table_row", props: { id: id, row: row, column_definitions: column_definitions, depth: current_depth, collapsible_trail: collapsible_trail })
25
27
 
26
28
  if row[:children].present?
27
29
  output << content_tag(:div, class: "toggle-content", data: { advanced_table_content: row.object_id.to_s + id }) do
@@ -4,8 +4,10 @@
4
4
  <%= pb_rails("table/table_header", props: { tag: "div", id: item[:accessor], classname: object.th_classname, sort_menu: item[:sort_menu] }) do %>
5
5
  <%= pb_rails("flex", props:{ align: "center", justify: index.zero? ? "start" : "end", text_align: "end" }) do %>
6
6
  <% if index.zero? && (object.enable_toggle_expansion == "header" || object.enable_toggle_expansion == "all") %>
7
- <button class="gray-icon toggle-all-icon" onclick="expandAllRows(this)">
8
- <%= pb_rails("icon", props: { icon: "arrows-from-line", cursor: "pointer", fixed_width: true, padding_right: "xs" }) %>
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" }) %>
9
11
  </button>
10
12
  <% end %>
11
13
  <%= item[:label] %>
@@ -13,4 +15,4 @@
13
15
  <% end %>
14
16
  <% end %>
15
17
  <% end %>
16
- <% end %>
18
+ <% end %>
@@ -2,6 +2,14 @@
2
2
  <% object.column_definitions.each_with_index do |column, index| %>
3
3
  <%= pb_rails("table/table_cell", props: { tag:"div", classname:object.td_classname}) do %>
4
4
  <%= pb_rails("flex", props:{ align: "center", justify: index.zero? ? "start" : "end" }) do %>
5
+ <% if collapsible_trail && index.zero? %>
6
+ <% (1..depth).each do |i| %>
7
+ <% additional_offset = i > 1 ? (i - 1) * 0.25 : 0 %>
8
+ <% left_offset = i * 1.0 + additional_offset %>
9
+ <div class="collapsible-trail" style="left: <%= left_offset %>em"></div>
10
+ <% end %>
11
+ <% end %>
12
+
5
13
  <div style="padding-left: <%= depth * 1.25 %>em">
6
14
  <%= pb_rails("flex", props:{align: "center", column_gap: "xs"}) do %>
7
15
  <% if index.zero? && object.row[:children].present? %>
@@ -9,6 +9,8 @@ module Playbook
9
9
  default: []
10
10
  prop :row
11
11
  prop :depth
12
+ prop :collapsible_trail, type: Playbook::Props::Boolean,
13
+ default: true
12
14
 
13
15
  def classname
14
16
  generate_classname("pb_table_tr", "bg-white", subrow_depth_classname, separator: " ")
@@ -6,6 +6,14 @@
6
6
  <% object.column_definitions.each_with_index do |column, index| %>
7
7
  <%= pb_rails("table/table_cell", props: { tag: "div", classname: object.td_classname}) do %>
8
8
  <%= pb_rails("flex", props:{ align: "center", justify: "start" }) do %>
9
+ <% if collapsible_trail && index.zero? %>
10
+ <% (1..depth).each do |i| %>
11
+ <% additional_offset = i > 1 ? (i - 1) * 0.25 : 0 %>
12
+ <% left_offset = i * 1.0 + additional_offset %>
13
+ <div class="collapsible-trail" style="left: <%= left_offset %>em"></div>
14
+ <% end %>
15
+ <% end %>
16
+
9
17
  <div style="padding-left: <%= depth * 1.25 %>em">
10
18
  <%= pb_rails("flex", props:{align: "center", column_gap: "xs"}) do %>
11
19
  <% if index.zero? && object.row[:children].present? %>
@@ -12,6 +12,8 @@ module Playbook
12
12
  default: "header"
13
13
  prop :subrow_header, type: Playbook::Props::String,
14
14
  default: ""
15
+ prop :collapsible_trail, type: Playbook::Props::Boolean,
16
+ default: true
15
17
 
16
18
  def classname
17
19
  generate_classname("pb_table_tr", "bg-white", subrow_depth_classname, separator: " ")
@@ -31,14 +31,12 @@ $avatar-sizes: (
31
31
  [class^=pb_card_kit].overlay_top_center {
32
32
  left: 50%;
33
33
  transform: translateX(-50%);
34
- padding: 2px !important;
35
34
  }
36
35
 
37
36
  [class^=pb_card_kit].overlay_left_center,
38
37
  [class^=pb_card_kit].overlay_right_center {
39
38
  top: 50%;
40
39
  transform: translateY(-50%);
41
- padding: 2px !important;
42
40
  }
43
41
  }
44
42
 
@@ -1,66 +1,70 @@
1
1
  import React from 'react'
2
-
2
+ import ReactDOMServer from 'react-dom/server'
3
3
  import BarGraph from '../_bar_graph'
4
+ import Icon from '../../pb_icon/_icon'
5
+
6
+ const chartData = [
7
+ {
8
+ name: 'Role',
9
+ data: [0, 200, 300, 654, 656],
10
+ },
11
+ {
12
+ name: 'Company',
13
+ data: [150, 524, 320, 440, 500],
14
+ },
15
+ ]
4
16
 
5
- const chartData = [{
6
- name: 'Installation',
7
- data: [1475, 200, 3000, 654, 656],
8
- }, {
9
- name: 'Manufacturing',
10
- data: [4434, 524, 2320, 440, 500],
11
- }, {
12
- name: 'Sales & Distribution',
13
- data: [3387, 743, 1344, 434, 440],
14
- }, {
15
- name: 'Project Development',
16
- data: [3227, 878, 999, 780, 1000],
17
- }, {
18
- name: 'Other',
19
- data: [1111, 677, 3245, 500, 200],
20
- }]
17
+ const renderIcon = (iconName, color) => {
18
+ return ReactDOMServer.renderToStaticMarkup(
19
+ <Icon
20
+ color={color}
21
+ icon={iconName}
22
+ />)
23
+ };
21
24
 
22
25
  const barGraphOptions = {
23
- subtitle: {
24
- text: "Overwritten subtitle",
25
- style: {
26
- color: "red"
27
- }
26
+ yAxis: {
27
+ tickInterval: 5,
28
28
  },
29
29
  xAxis: {
30
- labels: {
31
- useHTML: true,
32
- formatter: function() {
33
- switch (this.value) {
34
- case 'Jan':
35
- return `<i class="far fa-apple-whole"></i> ${this.value}`
36
- case 'Feb':
37
- return `<i class="far fa-strawberry"></i> ${this.value}`
38
- case 'Mar':
39
- return `<i class="far fa-lemon"></i> ${this.value}`
40
- case 'Apr':
41
- return `<i class="far fa-pear"></i> ${this.value}`
42
- case 'May':
43
- return `<i class="far fa-peach"></i> ${this.value}`
44
- default:
45
- return ''
46
- }
47
- }
48
- }
49
- }
30
+ categories: ['1', '2', '3', '4', '5'],
31
+ labels: {
32
+ useHTML: true,
33
+ formatter: function () {
34
+ switch (this.value) {
35
+ case '1':
36
+ return `${renderIcon('frown', 'error')}`;
37
+ case '2':
38
+ return `${renderIcon('frown', 'warning')}`;
39
+ case '3':
40
+ return `${renderIcon('frown-open', 'neutral')}`;
41
+ case '4':
42
+ return `${renderIcon('smile', 'category_7')}`;
43
+ case '5':
44
+ return `${renderIcon('smile-beam', 'success')}`;
45
+ default:
46
+ return ''
47
+ }
48
+ },
49
+ style: {
50
+ fontSize: '1.4em',
51
+ },
52
+ y: 42,
53
+ },
54
+ },
55
+ legend: {
56
+ itemMarginTop: 62,
57
+ },
50
58
  }
51
59
 
52
- const BarGraphCustom = (props) => (
60
+ const BarGraphCustom = () => (
53
61
  <div>
54
62
  <BarGraph
55
- axisTitle="Number of Employees"
56
63
  chartData={chartData}
57
64
  customOptions={barGraphOptions}
58
- id="bar-custom"
59
- subTitle="Subtitle to replace"
65
+ id="happiness-dashboard"
66
+ legend
60
67
  title="Bar Graph with Custom Overrides"
61
- xAxisCategories={['Jan', 'Feb', 'Mar', 'Apr', 'May']}
62
- yAxisMin={0}
63
- {...props}
64
68
  />
65
69
  </div>
66
70
  )
@@ -1,49 +1,42 @@
1
1
  <% data = [{
2
- name: 'Installation',
3
- data: [1475,200,3000,654,656]
2
+ name: 'Role',
3
+ data: [0, 200, 300, 654, 656],
4
4
  }, {
5
- name: 'Manufacturing',
6
- data: [4434,524,2320,440,500]
7
- }, {
8
- name: 'Sales & Distribution',
9
- data: [3387,743,1344,434,440,]
10
- }, {
11
- name: 'Project Development',
12
- data: [3227,878,999,780,1000]
13
- }, {
14
- name: 'Other',
15
- data: [1111,677,3245,500,200]
5
+ name: 'Company',
6
+ data: [150, 524, 320, 440, 500],
16
7
  }] %>
17
8
 
18
9
  <% bar_graph_options = {
19
- customOptions: {
20
- subtitle: {
21
- text: "Overwritten subtitle",
22
- style: {
23
- color: "red"
24
- }
10
+ customOptions: {
11
+ yAxis: {
12
+ tickInterval: 5,
13
+ },
14
+ xAxis: {
15
+ categories: [
16
+ raw(pb_rails("icon", props: { icon: "frown", color: "error", size: "2x" })),
17
+ raw(pb_rails("icon", props: { icon: "frown", color: "warning", size: "2x" })),
18
+ raw(pb_rails("icon", props: { icon: "frown-open", color: "neutral", size: "2x" })),
19
+ raw(pb_rails("icon", props: { icon: "smile", color: "category_7", size: "2x" })),
20
+ raw(pb_rails("icon", props: { icon: "smile-beam", color: "success", size: "2x" }))
21
+ ],
22
+ labels: {
23
+ useHTML: true,
24
+ sytle: {
25
+ fontSize: '1.4em',
25
26
  },
26
- xAxis: {
27
- categories: [
28
- '<i class="far fa-apple-whole"></i> Jan',
29
- '<i class="far fa-strawberry"></i> Feb',
30
- '<i class="far fa-lemon"></i> Mar',
31
- '<i class="far fa-pear"></i> Apr',
32
- '<i class="far fa-peach"></i> May'
33
- ],
34
- labels: {
35
- useHTML: true,
36
- }
37
- }
38
- }
27
+ y: 42,
28
+ },
29
+ },
30
+ legend: {
31
+ itemMarginTop: 62,
32
+ },
33
+ }
39
34
  } %>
40
35
 
41
36
  <%= pb_rails("bar_graph", props: {
42
- axis_title: 'Number of Employees',
43
37
  chart_data: data,
44
38
  id: "bar-default",
45
- y_axis_min: 0,
46
- subtitle: 'Subtitle to replace',
39
+ legend: true,
47
40
  title: 'Bar Graph with Custom Overrides',
48
41
  custom_options: bar_graph_options
49
- }) %>
42
+ }) %>
@@ -1,24 +1,25 @@
1
1
  @import "./body_mixins";
2
2
  @import "../tokens/titles";
3
3
 
4
- [class^=pb_body_kit]{
4
+ [class^="pb_body_kit"] {
5
5
  @include pb_body($text_lt_default);
6
6
  @each $color_name, $color_value in $pb_body_colors {
7
7
  &[class*=_#{"" + $color_name}] {
8
8
  @include pb_body($color_value);
9
9
  }
10
10
  @each $status_name, $status_value in $pb_body_status {
11
- &[class*=_default_#{$status_name}] {
11
+ &[class*="_default_#{$status_name}"] {
12
12
  @include pb_body($status_value);
13
13
  }
14
14
  }
15
15
  }
16
- @each $dark_color_name, $dark_color_value in $pb_dark_body_colors{
17
- &[class*=_#{$dark_color_name}][class*=dark]{
16
+ @each $dark_color_name, $dark_color_value in $pb_dark_body_colors {
17
+ &[class*="_#{$dark_color_name}"][class*="dark"] {
18
18
  @include pb_body($dark_color_value);
19
19
  }
20
20
  }
21
- b, strong {
21
+ b,
22
+ strong {
22
23
  font-weight: $bold;
23
24
  }
24
25
 
@@ -29,7 +30,8 @@
29
30
  }
30
31
  }
31
32
 
32
- em, i {
33
+ em,
34
+ i {
33
35
  font-style: italic;
34
36
  }
35
37
 
@@ -39,26 +41,25 @@
39
41
  }
40
42
 
41
43
  @each $status_name, $status_value in $pb_body_status {
42
- &[class*=#{$status_name}] {
44
+ &[class*="#{$status_name}"] {
43
45
  @include pb_body($status_value);
44
46
  }
45
47
  }
46
48
 
47
- &[class*=dark] {
49
+ &[class*="dark"] {
48
50
  a {
49
51
  color: $active_dark;
50
52
  }
51
53
  @include pb_body_dark();
52
- @each $dark_color_name, $dark_color_value in $pb_dark_body_colors{
53
- &[class*=_#{$dark_color_name}][class*=dark]{
54
+ @each $dark_color_name, $dark_color_value in $pb_dark_body_colors {
55
+ &[class*="_#{$dark_color_name}"][class*="dark"] {
54
56
  @include pb_body($dark_color_value);
55
57
  }
56
58
  }
57
- @each $status_name, $status_value in $pb_body_status {
58
- &[class*=_#{$status_name}] {
59
+ @each $status_name, $status_value in $pb_dark_body_status {
60
+ &[class*="_#{$status_name}"] {
59
61
  @include pb_body($status_value);
60
62
  }
61
63
  }
62
64
  }
63
-
64
65
  }
@@ -3,29 +3,35 @@
3
3
  @import "../tokens/typography";
4
4
 
5
5
  $pb_body_colors: (
6
- default: $text_lt_default,
7
- light: $text_lt_light,
8
- lighter: $text_lt_lighter,
9
- link: $primary,
10
- error: $error,
11
- success: $text_lt_success_sm,
6
+ default: $text_lt_default,
7
+ light: $text_lt_light,
8
+ lighter: $text_lt_lighter,
9
+ link: $primary,
10
+ error: $error,
11
+ success: $text_lt_success_sm,
12
12
  );
13
13
 
14
14
  $pb_dark_body_colors: (
15
- default: $text_dk_default,
16
- light: $text_dk_light,
17
- lighter: $text_dk_lighter,
18
- link: $active_dark,
19
- error: $error,
20
- success: $text_dk_success_sm,
15
+ default: $text_dk_default,
16
+ light: $text_dk_light,
17
+ lighter: $text_dk_lighter,
18
+ link: $active_dark,
19
+ error: $error,
20
+ success: $text_dk_success_sm,
21
21
  );
22
22
 
23
23
  // Order is important here!
24
24
  $pb_body_status: (
25
- default: $text_lt_default,
26
- negative: $error,
27
- dark_error: $error_dark_body,
28
- positive: $text_lt_success_sm,
25
+ default: $text_lt_default,
26
+ negative: $error,
27
+ dark_error: $error_dark_body,
28
+ positive: $text_lt_success_sm,
29
+ );
30
+
31
+ $pb_dark_body_status: (
32
+ default: $text_dk_default,
33
+ negative: $error_dark,
34
+ positive: $text_dk_success_sm,
29
35
  );
30
36
 
31
37
  @mixin pb_body($color: $text_lt_default) {
@@ -13,6 +13,7 @@ const BreadCrumbsDefault = (props) => {
13
13
  <Icon
14
14
  icon="home"
15
15
  size="1x"
16
+ {...props}
16
17
  />
17
18
  <BreadCrumbItem
18
19
  {...props}
@@ -22,11 +23,13 @@ const BreadCrumbsDefault = (props) => {
22
23
  size="4"
23
24
  tag="span"
24
25
  text="Home"
26
+ {...props}
25
27
  />
26
28
  </BreadCrumbItem>
27
29
  <Icon
28
30
  icon="users"
29
31
  size="1x"
32
+ {...props}
30
33
  />
31
34
  <Link
32
35
  {...props}
@@ -36,17 +39,20 @@ const BreadCrumbsDefault = (props) => {
36
39
  size="4"
37
40
  tag="span"
38
41
  text="Users"
42
+ {...props}
39
43
  />
40
44
  </Link>
41
45
  <Icon
42
46
  icon="user"
43
47
  size="1x"
48
+ {...props}
44
49
  />
45
50
  <Link {...props}>
46
51
  <Title
47
52
  size="4"
48
53
  tag="span"
49
54
  text="User"
55
+ {...props}
50
56
  />
51
57
  </Link>
52
58
  </BreadCrumbs>
@@ -13,9 +13,10 @@ $pb_caption_colors: (
13
13
  $pb_dark_caption_colors: (
14
14
  default: $text_dk_default,
15
15
  light: $text_dk_light,
16
+ lighter: $text_dk_lighter,
16
17
  link: $active_dark,
17
18
  success: $text_dk_success_sm,
18
- error: $error,
19
+ error: $error_dark,
19
20
  );
20
21
 
21
22
 
@@ -6,7 +6,7 @@ import classnames from 'classnames'
6
6
 
7
7
  import { buildAriaProps, buildCss, buildDataProps, buildHtmlProps } from '../utilities/props'
8
8
  import { GlobalProps, globalProps, globalInlineProps } from '../utilities/globalProps'
9
- import type { ProductColors, CategoryColors, BackgroundColors } from '../types/colors'
9
+ import type { ProductColors, CategoryColors, BackgroundColors, StatusColors } from '../types/colors'
10
10
 
11
11
  import Icon from '../pb_icon/_icon'
12
12
  import Flex from '../pb_flex/_flex'
@@ -36,7 +36,7 @@ type CardPropTypes = {
36
36
  } & GlobalProps
37
37
 
38
38
  type CardHeaderProps = {
39
- headerColor?: BackgroundColors | ProductColors | CategoryColors | "none",
39
+ headerColor?: BackgroundColors | ProductColors | CategoryColors | StatusColors | "none",
40
40
  headerColorStriped?: boolean,
41
41
  children: React.ReactChild[] | React.ReactChild,
42
42
  className?: string,
@@ -127,12 +127,12 @@ const Card = (props: CardPropTypes): React.ReactElement => {
127
127
 
128
128
  const tagOptions = ['div', 'section', 'footer', 'header', 'article', 'aside', 'main', 'nav']
129
129
  const Tag = tagOptions.includes(tag) ? tag : 'div'
130
-
130
+
131
131
  return (
132
132
  <>
133
133
  {
134
134
  draggableItem ? (
135
- <Draggable.Item dragId={dragId}
135
+ <Draggable.Item dragId={dragId}
136
136
  key={dragId}
137
137
  >
138
138
  <Tag
@@ -140,14 +140,14 @@ const Card = (props: CardPropTypes): React.ReactElement => {
140
140
  {...dataProps}
141
141
  className={classnames(cardCss, globalProps(props), className)}
142
142
  {...restHtmlProps}
143
- style={mergedStyles}
143
+ style={mergedStyles}
144
144
  >
145
145
  {subComponentTags('Header')}
146
146
  {
147
147
  dragHandle ? (
148
148
  <Flex>
149
149
  <span className="card_draggable_handle">
150
- <Icon
150
+ <Icon
151
151
  icon="grip-dots-vertical"
152
152
  paddingRight="xs"
153
153
  verticalAlign="middle"
@@ -169,7 +169,7 @@ const Card = (props: CardPropTypes): React.ReactElement => {
169
169
  {...dataProps}
170
170
  className={classnames(cardCss, globalProps(props), className)}
171
171
  {...restHtmlProps}
172
- style={mergedStyles}
172
+ style={mergedStyles}
173
173
  >
174
174
  {subComponentTags('Header')}
175
175
  {nonHeaderChildren}
@@ -24,7 +24,7 @@ $additional_colors: (
24
24
  "neutral_subtle": $neutral_subtle,
25
25
  );
26
26
  $background_colors: map-merge($product_colors, $additional_colors);
27
- $pb_card_header_colors: map-merge(map-merge($product_colors, $additional_colors), $category_colors);
27
+ $pb_card_header_colors: map-merge(map-merge(map-merge($product_colors, $additional_colors), $category_colors), $status_colors);
28
28
 
29
29
  @mixin pb_card_selected($border_color: $primary) {
30
30
  border-color: $border_color;
@@ -32,7 +32,7 @@ $pb_card_header_colors: map-merge(map-merge($product_colors, $additional_colors)
32
32
  }
33
33
 
34
34
  @mixin pb_card_selected_dark {
35
- @include pb_card_selected($primary_action);
35
+ @include pb_card_selected($primary_action_dark);
36
36
  }
37
37
 
38
38
  @mixin pb_card($background: $card_light, $border_color: $border_light) {
@@ -67,4 +67,24 @@
67
67
  <%= pb_rails("card/card_body", props: { padding: "md", }) do %>
68
68
  Body
69
69
  <% end %>
70
- <% end %>
70
+ <% end %>
71
+
72
+ <%= pb_rails("title", props: { text: "Status Colors", tag: "h4", size: 4, margin_bottom: "sm" }) %>
73
+
74
+ <%= pb_rails("card", props: { padding: "none", header: true, margin_bottom: "sm"}) do %>
75
+ <%= pb_rails("card/card_header", props: { padding: "sm", header_color: "success" }) do %>
76
+ <%= pb_rails("body", props: { text: "Success", dark: true }) %>
77
+ <% end %>
78
+ <%= pb_rails("card/card_body", props: { padding: "md" }) do %>
79
+ Body
80
+ <% end %>
81
+ <% end %>
82
+
83
+ <%= pb_rails("card", props: { padding: "none", header: true, margin_bottom: "sm"}) do %>
84
+ <%= pb_rails("card/card_header", props: { padding: "sm", header_color: "error" }) do %>
85
+ <%= pb_rails("body", props: { text: "Error", dark: true }) %>
86
+ <% end %>
87
+ <%= pb_rails("card/card_body", props: { padding: "md" }) do %>
88
+ Body
89
+ <% end %>
90
+ <% end %>