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.
- checksums.yaml +4 -4
- data/app/pb_kits/playbook/pb_advanced_table/Components/CollapsibleTrail.tsx +1 -6
- data/app/pb_kits/playbook/pb_advanced_table/Components/TableHeaderCell.tsx +32 -19
- data/app/pb_kits/playbook/pb_advanced_table/SubKits/TableBody.tsx +3 -1
- data/app/pb_kits/playbook/pb_advanced_table/_advanced_table.scss +48 -3
- data/app/pb_kits/playbook/pb_advanced_table/_advanced_table.tsx +94 -36
- data/app/pb_kits/playbook/pb_advanced_table/advanced_table.test.jsx +2 -2
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_collapsible_trail_rails.html.erb +36 -0
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_collapsible_trail_rails.md +1 -0
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_column_headers.jsx +60 -0
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_column_headers.md +1 -0
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_column_headers_multiple.jsx +74 -0
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_column_headers_multiple.md +1 -0
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_pagination.jsx +50 -0
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_pagination.md +1 -0
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_pagination_with_props.jsx +57 -0
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_pagination_with_props.md +5 -0
- data/app/pb_kits/playbook/pb_advanced_table/docs/advanced_table_pagination_mock_data.json +5600 -0
- data/app/pb_kits/playbook/pb_advanced_table/docs/example.yml +5 -0
- data/app/pb_kits/playbook/pb_advanced_table/docs/index.js +4 -0
- data/app/pb_kits/playbook/pb_advanced_table/table_body.rb +4 -2
- data/app/pb_kits/playbook/pb_advanced_table/table_header.html.erb +5 -3
- data/app/pb_kits/playbook/pb_advanced_table/table_row.html.erb +8 -0
- data/app/pb_kits/playbook/pb_advanced_table/table_row.rb +2 -0
- data/app/pb_kits/playbook/pb_advanced_table/table_subrow_header.html.erb +8 -0
- data/app/pb_kits/playbook/pb_advanced_table/table_subrow_header.rb +2 -0
- data/app/pb_kits/playbook/pb_avatar/_avatar.scss +0 -2
- data/app/pb_kits/playbook/pb_bar_graph/docs/_bar_graph_custom.jsx +53 -49
- data/app/pb_kits/playbook/pb_bar_graph/docs/_bar_graph_custom_rails.html.erb +29 -36
- data/app/pb_kits/playbook/pb_body/_body.scss +14 -13
- data/app/pb_kits/playbook/pb_body/_body_mixins.scss +22 -16
- data/app/pb_kits/playbook/pb_bread_crumbs/docs/_bread_crumbs_default.jsx +6 -0
- data/app/pb_kits/playbook/pb_caption/_caption_mixin.scss +2 -1
- data/app/pb_kits/playbook/pb_card/_card.tsx +7 -7
- data/app/pb_kits/playbook/pb_card/_card_mixin.scss +2 -2
- data/app/pb_kits/playbook/pb_card/docs/_card_header.html.erb +21 -1
- data/app/pb_kits/playbook/pb_card/docs/_card_header.jsx +50 -0
- data/app/pb_kits/playbook/pb_card/docs/_card_header.md +1 -1
- data/app/pb_kits/playbook/pb_circle_icon_button/_circle_icon_button.tsx +3 -0
- data/app/pb_kits/playbook/pb_circle_icon_button/circle_icon_button.html.erb +1 -1
- data/app/pb_kits/playbook/pb_circle_icon_button/circle_icon_button.rb +1 -0
- data/app/pb_kits/playbook/pb_circle_icon_button/docs/_circle_icon_button_link.html.erb +8 -0
- data/app/pb_kits/playbook/pb_circle_icon_button/docs/_circle_icon_button_link.jsx +9 -0
- data/app/pb_kits/playbook/pb_circle_icon_button/docs/_circle_icon_button_link.md +1 -0
- data/app/pb_kits/playbook/pb_collapsible/_collapsible.tsx +9 -4
- data/app/pb_kits/playbook/pb_collapsible/child_kits/CollapsibleContent.tsx +2 -2
- data/app/pb_kits/playbook/pb_collapsible/child_kits/CollapsibleMain.tsx +2 -2
- data/app/pb_kits/playbook/pb_drawer/_drawer.tsx +2 -2
- data/app/pb_kits/playbook/pb_file_upload/_file_upload.scss +5 -0
- data/app/pb_kits/playbook/pb_file_upload/_file_upload.tsx +7 -2
- data/app/pb_kits/playbook/pb_file_upload/file_upload.html.erb +8 -2
- data/app/pb_kits/playbook/pb_form_group/_error_state_mixin.scss +57 -0
- data/app/pb_kits/playbook/pb_form_group/_form_group.scss +11 -2
- data/app/pb_kits/playbook/pb_gauge/_gauge.scss +31 -1
- data/app/pb_kits/playbook/pb_gauge/_gauge.tsx +3 -3
- data/app/pb_kits/playbook/pb_gauge/docs/_gauge_complex.jsx +25 -5
- data/app/pb_kits/playbook/pb_home_address_street/_home_address_street.tsx +17 -1
- data/app/pb_kits/playbook/pb_home_address_street/docs/_home_address_street_emphasis.html.erb +17 -1
- data/app/pb_kits/playbook/pb_home_address_street/docs/_home_address_street_emphasis.jsx +15 -0
- data/app/pb_kits/playbook/pb_home_address_street/docs/_home_address_street_emphasis.md +2 -1
- data/app/pb_kits/playbook/pb_home_address_street/home_address_street.rb +15 -1
- data/app/pb_kits/playbook/pb_home_address_street/none_emphasis.html.erb +32 -0
- data/app/pb_kits/playbook/pb_home_address_street/none_emphasis.rb +29 -0
- data/app/pb_kits/playbook/pb_layout/_layout.tsx +30 -11
- data/app/pb_kits/playbook/pb_link/_link.scss +3 -3
- data/app/pb_kits/playbook/pb_nav/_bold_mixin.scss +11 -1
- data/app/pb_kits/playbook/pb_nav/_collapsible_nav.scss +16 -2
- data/app/pb_kits/playbook/pb_nav/_vertical_nav.scss +1 -1
- data/app/pb_kits/playbook/pb_pagination/_pagination.tsx +2 -2
- data/app/pb_kits/playbook/pb_selectable_card/_selectable_card.scss +4 -4
- data/app/pb_kits/playbook/pb_selectable_card/selectable_card.html.erb +1 -1
- data/app/pb_kits/playbook/pb_skeleton_loading/docs/_skeleton_loading_filter.jsx +166 -0
- data/app/pb_kits/playbook/pb_skeleton_loading/docs/_skeleton_loading_height_width.jsx +2 -0
- data/app/pb_kits/playbook/pb_skeleton_loading/docs/_skeleton_loading_user.jsx +89 -0
- data/app/pb_kits/playbook/pb_skeleton_loading/docs/example.yml +2 -1
- data/app/pb_kits/playbook/pb_skeleton_loading/docs/index.js +2 -0
- data/app/pb_kits/playbook/pb_stat_change/_stat_change.tsx +44 -36
- data/app/pb_kits/playbook/pb_stat_change/stat_change.html.erb +4 -4
- data/app/pb_kits/playbook/pb_table/_table.tsx +73 -24
- data/app/pb_kits/playbook/pb_table/docs/_table_sticky_columns.jsx +88 -0
- data/app/pb_kits/playbook/pb_table/docs/_table_sticky_columns_react.md +3 -0
- data/app/pb_kits/playbook/pb_table/docs/_table_sticky_left_columns.html.erb +77 -0
- data/app/pb_kits/playbook/pb_table/docs/_table_sticky_left_columns.jsx +1 -1
- data/app/pb_kits/playbook/pb_table/docs/_table_sticky_left_columns_rails.md +3 -0
- data/app/pb_kits/playbook/pb_table/docs/_table_sticky_left_columns_react.md +4 -1
- data/app/pb_kits/playbook/pb_table/docs/_table_sticky_right_columns.jsx +87 -0
- data/app/pb_kits/playbook/pb_table/docs/_table_sticky_right_columns_react.md +5 -0
- data/app/pb_kits/playbook/pb_table/docs/_table_with_collapsible.jsx +75 -0
- data/app/pb_kits/playbook/pb_table/docs/_table_with_collapsible.md +1 -0
- data/app/pb_kits/playbook/pb_table/docs/_table_with_collapsible_with_custom_click.jsx +108 -0
- data/app/pb_kits/playbook/pb_table/docs/_table_with_collapsible_with_custom_click.md +2 -0
- data/app/pb_kits/playbook/pb_table/docs/_table_with_collapsible_with_custom_content.jsx +94 -0
- data/app/pb_kits/playbook/pb_table/docs/_table_with_collapsible_with_custom_content.md +0 -0
- data/app/pb_kits/playbook/pb_table/docs/_table_with_collapsible_with_nested_rows.jsx +83 -0
- data/app/pb_kits/playbook/pb_table/docs/_table_with_collapsible_with_nested_rows.md +3 -0
- data/app/pb_kits/playbook/pb_table/docs/_table_with_collapsible_with_nested_table.jsx +120 -0
- data/app/pb_kits/playbook/pb_table/docs/_table_with_collapsible_with_nested_table.md +1 -0
- data/app/pb_kits/playbook/pb_table/docs/example.yml +7 -0
- data/app/pb_kits/playbook/pb_table/docs/index.js +5 -0
- data/app/pb_kits/playbook/pb_table/index.ts +102 -26
- data/app/pb_kits/playbook/pb_table/styles/_all.scss +2 -1
- data/app/pb_kits/playbook/pb_table/styles/_collapsible.scss +35 -0
- data/app/pb_kits/playbook/pb_table/styles/_scroll.scss +44 -3
- data/app/pb_kits/playbook/pb_table/styles/_sticky_columns.scss +17 -4
- data/app/pb_kits/playbook/pb_table/subcomponents/_table_row.tsx +106 -1
- data/app/pb_kits/playbook/pb_table/table.html.erb +8 -2
- data/app/pb_kits/playbook/pb_table/table.rb +21 -2
- data/app/pb_kits/playbook/pb_text_input/_text_input.tsx +35 -3
- data/app/pb_kits/playbook/pb_text_input/docs/_text_input_mask.jsx +88 -0
- data/app/pb_kits/playbook/pb_text_input/docs/example.yml +1 -0
- data/app/pb_kits/playbook/pb_text_input/docs/index.js +1 -0
- data/app/pb_kits/playbook/pb_text_input/inputMask.ts +64 -0
- data/app/pb_kits/playbook/pb_text_input/text_input.test.js +139 -2
- data/app/pb_kits/playbook/pb_title/_title.scss +6 -5
- data/app/pb_kits/playbook/pb_title/_title_mixin.scss +13 -0
- data/app/pb_kits/playbook/pb_typeahead/_typeahead.scss +115 -46
- data/app/pb_kits/playbook/pb_typeahead/docs/_typeahead_with_highlight.jsx +9 -2
- data/app/pb_kits/playbook/pb_typeahead/typeahead.html.erb +3 -2
- data/app/pb_kits/playbook/tokens/_titles.scss +0 -8
- data/app/pb_kits/playbook/utilities/_hover.scss +11 -2
- data/app/pb_kits/playbook/utilities/globalProps.ts +2 -0
- data/app/pb_kits/playbook/utilities/test/globalProps/hover.test.js +15 -0
- data/dist/chunks/_typeahead-aym7Ky_O.js +22 -0
- data/dist/chunks/_weekday_stacked-BZj1pop-.js +45 -0
- data/dist/chunks/lazysizes-B7xYodB-.js +1 -0
- data/dist/chunks/{lib-SyD3buPZ.js → lib-B7sgJtGS.js} +3 -3
- data/dist/chunks/{pb_form_validation-Dt8UJgrJ.js → pb_form_validation-C5Cc0-1v.js} +1 -1
- data/dist/chunks/vendor.js +1 -1
- data/dist/menu.yml +1 -1
- data/dist/playbook-doc.js +1 -1
- data/dist/playbook-rails-react-bindings.js +1 -1
- data/dist/playbook-rails.js +1 -1
- data/dist/playbook.css +1 -1
- data/lib/playbook/hover.rb +7 -1
- data/lib/playbook/version.rb +2 -2
- metadata +46 -10
- data/dist/chunks/_typeahead-B8fkIeXA.js +0 -22
- data/dist/chunks/_weekday_stacked-CVYxBYHe.js +0 -45
- 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
|
8
|
-
|
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? %>
|
@@ -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
|
6
|
-
|
7
|
-
|
8
|
-
}
|
9
|
-
|
10
|
-
|
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
|
-
|
24
|
-
|
25
|
-
style: {
|
26
|
-
color: "red"
|
27
|
-
}
|
26
|
+
yAxis: {
|
27
|
+
tickInterval: 5,
|
28
28
|
},
|
29
29
|
xAxis: {
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
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 = (
|
60
|
+
const BarGraphCustom = () => (
|
53
61
|
<div>
|
54
62
|
<BarGraph
|
55
|
-
axisTitle="Number of Employees"
|
56
63
|
chartData={chartData}
|
57
64
|
customOptions={barGraphOptions}
|
58
|
-
id="
|
59
|
-
|
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
|
-
|
3
|
-
|
2
|
+
name: 'Role',
|
3
|
+
data: [0, 200, 300, 654, 656],
|
4
4
|
}, {
|
5
|
-
|
6
|
-
|
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
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
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
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
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
|
-
|
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,
|
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,
|
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
|
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 $
|
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:
|
7
|
-
light:
|
8
|
-
lighter:
|
9
|
-
link:
|
10
|
-
error:
|
11
|
-
success:
|
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:
|
16
|
-
light:
|
17
|
-
lighter:
|
18
|
-
link:
|
19
|
-
error:
|
20
|
-
success:
|
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:
|
26
|
-
negative:
|
27
|
-
dark_error:
|
28
|
-
positive:
|
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>
|
@@ -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($
|
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 %>
|