playbook_ui 10.26.0.pre.alpha1 → 10.26.0.pre.alpha3
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/data/menu.yml +0 -1
- data/app/pb_kits/playbook/index.js +1 -2
- data/app/pb_kits/playbook/pb_avatar/_avatar.tsx +3 -3
- data/app/pb_kits/playbook/pb_body/_body.tsx +8 -8
- data/app/pb_kits/playbook/pb_button/docs/_button_default.html.erb +0 -1
- data/app/pb_kits/playbook/pb_caption/{_caption.tsx → _caption.jsx} +8 -7
- data/app/pb_kits/playbook/pb_card/_card.jsx +3 -1
- data/app/pb_kits/playbook/pb_card/_card_mixin.scss +1 -0
- data/app/pb_kits/playbook/pb_dashboard/pbChartsDarkTheme.js +0 -37
- data/app/pb_kits/playbook/pb_dashboard/pbChartsLightTheme.js +0 -37
- data/app/pb_kits/playbook/pb_form_pill/_form_pill.jsx +1 -1
- data/app/pb_kits/playbook/pb_image/_image.tsx +1 -1
- data/app/pb_kits/playbook/pb_kit/dateTime.js +2 -1
- data/app/pb_kits/playbook/pb_pill/_pill.jsx +1 -1
- data/app/pb_kits/playbook/pb_table/_table.jsx +3 -0
- data/app/pb_kits/playbook/pb_table/docs/_table_sticky.html.erb +83 -0
- data/app/pb_kits/playbook/pb_table/docs/_table_sticky.jsx +94 -0
- data/app/pb_kits/playbook/pb_table/docs/_table_sticky.md +3 -0
- data/app/pb_kits/playbook/pb_table/docs/example.yml +2 -0
- data/app/pb_kits/playbook/pb_table/docs/index.js +1 -0
- data/app/pb_kits/playbook/pb_table/styles/_all.scss +1 -0
- data/app/pb_kits/playbook/pb_table/styles/_sticky_header.scss +21 -0
- data/app/pb_kits/playbook/pb_table/table.rb +7 -1
- data/app/pb_kits/playbook/pb_table/table.test.js +17 -0
- data/app/pb_kits/playbook/pb_title/{_title.tsx → _title.jsx} +12 -10
- data/app/pb_kits/playbook/pb_title/title.test.js +2 -2
- data/app/pb_kits/playbook/playbook-doc.js +0 -2
- data/app/pb_kits/playbook/playbook-rails-react-bindings.js +0 -2
- data/app/pb_kits/playbook/plugins/pb_chart.js +0 -34
- data/app/pb_kits/playbook/tokens/_display.scss +13 -0
- data/app/pb_kits/playbook/tokens/_screen_sizes.scss +21 -5
- data/app/pb_kits/playbook/utilities/_display.scss +58 -1
- data/app/pb_kits/playbook/utilities/_flex_direction.scss +15 -28
- data/app/pb_kits/playbook/utilities/globalProps.ts +134 -103
- data/app/pb_kits/playbook/utilities/text.js +15 -0
- data/dist/reset.css +1 -60
- data/lib/playbook/display.rb +20 -6
- data/lib/playbook/flex_direction.rb +1 -7
- data/lib/playbook/version.rb +1 -1
- metadata +12 -27
- data/app/pb_kits/playbook/pb_treemap_chart/_treemap_chart.jsx +0 -79
- data/app/pb_kits/playbook/pb_treemap_chart/docs/_description.md +0 -5
- data/app/pb_kits/playbook/pb_treemap_chart/docs/_treemap_chart_colors.html.erb +0 -37
- data/app/pb_kits/playbook/pb_treemap_chart/docs/_treemap_chart_colors.jsx +0 -48
- data/app/pb_kits/playbook/pb_treemap_chart/docs/_treemap_chart_colors.md +0 -2
- data/app/pb_kits/playbook/pb_treemap_chart/docs/_treemap_chart_default.html.erb +0 -37
- data/app/pb_kits/playbook/pb_treemap_chart/docs/_treemap_chart_default.jsx +0 -47
- data/app/pb_kits/playbook/pb_treemap_chart/docs/_treemap_chart_default.md +0 -3
- data/app/pb_kits/playbook/pb_treemap_chart/docs/_treemap_chart_drillable.html.erb +0 -79
- data/app/pb_kits/playbook/pb_treemap_chart/docs/_treemap_chart_drillable.jsx +0 -90
- data/app/pb_kits/playbook/pb_treemap_chart/docs/_treemap_chart_drillable.md +0 -1
- data/app/pb_kits/playbook/pb_treemap_chart/docs/_treemap_chart_grouped_data.html.erb +0 -54
- data/app/pb_kits/playbook/pb_treemap_chart/docs/_treemap_chart_grouped_data.jsx +0 -65
- data/app/pb_kits/playbook/pb_treemap_chart/docs/_treemap_chart_grouped_data.md +0 -3
- data/app/pb_kits/playbook/pb_treemap_chart/docs/_treemap_chart_tooltip.html.erb +0 -37
- data/app/pb_kits/playbook/pb_treemap_chart/docs/_treemap_chart_tooltip.jsx +0 -48
- data/app/pb_kits/playbook/pb_treemap_chart/docs/_treemap_chart_tooltip.md +0 -3
- data/app/pb_kits/playbook/pb_treemap_chart/docs/example.yml +0 -15
- data/app/pb_kits/playbook/pb_treemap_chart/docs/index.js +0 -5
- data/app/pb_kits/playbook/pb_treemap_chart/treemap_chart.html.erb +0 -1
- data/app/pb_kits/playbook/pb_treemap_chart/treemap_chart.rb +0 -43
- data/app/pb_kits/playbook/utilities/text.ts +0 -22
@@ -1,65 +0,0 @@
|
|
1
|
-
import React from 'react'
|
2
|
-
|
3
|
-
import TreemapChart from '../_treemap_chart'
|
4
|
-
|
5
|
-
const chartData = [
|
6
|
-
{
|
7
|
-
name: 'Meat',
|
8
|
-
id: 'Meat',
|
9
|
-
color: "#0056CF",
|
10
|
-
}, {
|
11
|
-
name: 'Pepperoni',
|
12
|
-
parent: 'Meat',
|
13
|
-
value: 250,
|
14
|
-
}, {
|
15
|
-
name: 'Meatball',
|
16
|
-
parent: 'Meat',
|
17
|
-
value: 400,
|
18
|
-
}, {
|
19
|
-
name: "Anchovy",
|
20
|
-
parent: 'Meat',
|
21
|
-
value: 40,
|
22
|
-
}, {
|
23
|
-
name: 'Vegetarian',
|
24
|
-
id: 'Vegetarian',
|
25
|
-
color: "#F9BB00",
|
26
|
-
}, {
|
27
|
-
name: 'Onions',
|
28
|
-
parent: 'Vegetarian',
|
29
|
-
value: 300,
|
30
|
-
}, {
|
31
|
-
name: 'Pineapple',
|
32
|
-
parent: 'Vegetarian',
|
33
|
-
value: 90,
|
34
|
-
}, {
|
35
|
-
name: "Peppers",
|
36
|
-
parent: 'Vegetarian',
|
37
|
-
value: 80,
|
38
|
-
}, {
|
39
|
-
name: "Specialty",
|
40
|
-
id: "Specialty",
|
41
|
-
color: "#9E64E9",
|
42
|
-
},{
|
43
|
-
name: "Buffalo Chicken",
|
44
|
-
parent: "Specialty",
|
45
|
-
value: 400,
|
46
|
-
}, {
|
47
|
-
name: "Supreme",
|
48
|
-
parent: "Specialty",
|
49
|
-
value: 150,
|
50
|
-
}
|
51
|
-
]
|
52
|
-
|
53
|
-
const TreemapChartGroupedData = (props) => (
|
54
|
-
<div>
|
55
|
-
<TreemapChart
|
56
|
-
chartData={chartData}
|
57
|
-
grouped
|
58
|
-
id="treemap-grouped-data"
|
59
|
-
title="Grouped Toppings"
|
60
|
-
{...props}
|
61
|
-
/>
|
62
|
-
</div>
|
63
|
-
)
|
64
|
-
|
65
|
-
export default TreemapChartGroupedData
|
@@ -1,3 +0,0 @@
|
|
1
|
-
Data can be grouped into distinct segments by specifying the relationship in the `chartData`. For a point to be a parent, it needs an `id` of type `string` included in its object. Any other data points may then reference that `id` as their `parent` value to establish the tree structure.
|
2
|
-
|
3
|
-
Parents can also be passed a custom color to be applied to all of its child points.
|
@@ -1,37 +0,0 @@
|
|
1
|
-
<% data = [
|
2
|
-
{
|
3
|
-
name: "Pepperoni",
|
4
|
-
parent: "Toppings",
|
5
|
-
value: 600,
|
6
|
-
}, {
|
7
|
-
name: "Cheese",
|
8
|
-
parent: "Toppings",
|
9
|
-
value: 510,
|
10
|
-
}, {
|
11
|
-
name: "Mushroom",
|
12
|
-
parent: "Toppings",
|
13
|
-
value: 330,
|
14
|
-
},{
|
15
|
-
name: "Onions",
|
16
|
-
parent: "Toppings",
|
17
|
-
value: 250,
|
18
|
-
}, {
|
19
|
-
name: "Olives",
|
20
|
-
parent: "Toppings",
|
21
|
-
value: 204,
|
22
|
-
}, {
|
23
|
-
name: "Pineapple",
|
24
|
-
parent: "Toppings",
|
25
|
-
value: 90,
|
26
|
-
}, {
|
27
|
-
name: "Pizza Toppings",
|
28
|
-
id: "Toppings",
|
29
|
-
},
|
30
|
-
] %>
|
31
|
-
|
32
|
-
<%= pb_rails("treemap_chart", props: {
|
33
|
-
chart_data: data,
|
34
|
-
id: "treemap-tooltip",
|
35
|
-
title: "Favored Pizza Toppings",
|
36
|
-
tooltip_html: "<p>Custom tooltip for {point.name} <br/>with value: {point.value}</p>",
|
37
|
-
}) %>
|
@@ -1,48 +0,0 @@
|
|
1
|
-
import React from 'react'
|
2
|
-
|
3
|
-
import TreemapChart from '../_treemap_chart'
|
4
|
-
|
5
|
-
const chartData = [
|
6
|
-
{
|
7
|
-
name: "Pepperoni",
|
8
|
-
parent: "Toppings",
|
9
|
-
value: 600,
|
10
|
-
}, {
|
11
|
-
name: "Cheese",
|
12
|
-
parent: "Toppings",
|
13
|
-
value: 510,
|
14
|
-
}, {
|
15
|
-
name: "Mushroom",
|
16
|
-
parent: "Toppings",
|
17
|
-
value: 330,
|
18
|
-
},{
|
19
|
-
name: "Onions",
|
20
|
-
parent: "Toppings",
|
21
|
-
value: 250,
|
22
|
-
}, {
|
23
|
-
name: "Olives",
|
24
|
-
parent: "Toppings",
|
25
|
-
value: 204,
|
26
|
-
}, {
|
27
|
-
name: "Pineapple",
|
28
|
-
parent: "Toppings",
|
29
|
-
value: 90,
|
30
|
-
}, {
|
31
|
-
name: "Pizza Toppings",
|
32
|
-
id: "Toppings",
|
33
|
-
},
|
34
|
-
]
|
35
|
-
|
36
|
-
const TreemapChartTooltip = (props) => (
|
37
|
-
<div>
|
38
|
-
<TreemapChart
|
39
|
-
chartData={chartData}
|
40
|
-
id="treemap-tooltip"
|
41
|
-
title="Favored Pizza Toppings"
|
42
|
-
tooltipHtml={"<p>Custom tooltip for {point.name} <br/>with value: {point.value}</p>"}
|
43
|
-
{...props}
|
44
|
-
/>
|
45
|
-
</div>
|
46
|
-
)
|
47
|
-
|
48
|
-
export default TreemapChartTooltip
|
@@ -1,15 +0,0 @@
|
|
1
|
-
examples:
|
2
|
-
|
3
|
-
rails:
|
4
|
-
- treemap_chart_default: Default
|
5
|
-
- treemap_chart_grouped_data: Grouped Data
|
6
|
-
- treemap_chart_drillable: Drillable
|
7
|
-
- treemap_chart_colors: Color Overrides
|
8
|
-
- treemap_chart_tooltip: Tooltip Customization
|
9
|
-
|
10
|
-
react:
|
11
|
-
- treemap_chart_default: Default
|
12
|
-
- treemap_chart_grouped_data: Grouped Data
|
13
|
-
- treemap_chart_drillable: Drillable
|
14
|
-
- treemap_chart_colors: Color Overrides
|
15
|
-
- treemap_chart_tooltip: Tooltip Customization
|
@@ -1,5 +0,0 @@
|
|
1
|
-
export { default as TreemapChartDefault } from './_treemap_chart_default.jsx'
|
2
|
-
export { default as TreemapChartGroupedData } from './_treemap_chart_grouped_data.jsx'
|
3
|
-
export { default as TreemapChartDrillable } from './_treemap_chart_drillable.jsx'
|
4
|
-
export { default as TreemapChartColors } from './_treemap_chart_colors.jsx'
|
5
|
-
export { default as TreemapChartTooltip } from './_treemap_chart_tooltip.jsx'
|
@@ -1 +0,0 @@
|
|
1
|
-
<%= react_component('TreemapChart', object.chart_options) %>
|
@@ -1,43 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
module Playbook
|
4
|
-
module PbTreemapChart
|
5
|
-
class TreemapChart < Playbook::KitBase
|
6
|
-
prop :chart_data, type: Playbook::Props::Array,
|
7
|
-
default: []
|
8
|
-
prop :colors, type: Playbook::Props::Array,
|
9
|
-
default: []
|
10
|
-
prop :drillable, type: Playbook::Props::Boolean, default: false
|
11
|
-
prop :grouped, type: Playbook::Props::Boolean, default: false
|
12
|
-
prop :height
|
13
|
-
prop :title, default: ""
|
14
|
-
prop :tooltip_html, default: '<span style="font-weight: bold; color:{point.color};">● </span>
|
15
|
-
{point.name}: ' + '<b>{point.value}
|
16
|
-
</b>'
|
17
|
-
|
18
|
-
def chart_type
|
19
|
-
"treemap"
|
20
|
-
end
|
21
|
-
|
22
|
-
def chart_options
|
23
|
-
{
|
24
|
-
chartData: chart_data,
|
25
|
-
className: classname,
|
26
|
-
colors: colors,
|
27
|
-
dark: dark ? "dark" : "",
|
28
|
-
drillable: drillable,
|
29
|
-
grouped: grouped,
|
30
|
-
height: height,
|
31
|
-
id: id,
|
32
|
-
title: title,
|
33
|
-
tooltipHtml: tooltip_html,
|
34
|
-
type: chart_type,
|
35
|
-
}
|
36
|
-
end
|
37
|
-
|
38
|
-
def classname
|
39
|
-
generate_classname("pb_treemap_chart")
|
40
|
-
end
|
41
|
-
end
|
42
|
-
end
|
43
|
-
end
|
@@ -1,22 +0,0 @@
|
|
1
|
-
import { filter, isEmpty } from 'lodash'
|
2
|
-
|
3
|
-
const titleizedWord = (word: string): string => (
|
4
|
-
word.charAt(0).toUpperCase() + word.slice(1).toLowerCase()
|
5
|
-
)
|
6
|
-
|
7
|
-
export const titleize = (sentence: string): string => (
|
8
|
-
isEmpty(sentence) ? sentence : sentence.split(' ').map(titleizedWord).join(' ')
|
9
|
-
)
|
10
|
-
|
11
|
-
const notEmpty = (value: string | Record<string, unknown>): boolean => !isEmpty(value)
|
12
|
-
|
13
|
-
export const joinPresent = (array: [], separator: string): string => (
|
14
|
-
filter(array, notEmpty).join(separator)
|
15
|
-
)
|
16
|
-
|
17
|
-
export const camelToSnakeCase = (word: string): string => {
|
18
|
-
return word.split(/([A-Z])/g).map((w, i) => {
|
19
|
-
const prefix = i > 0 ? '_' : ''
|
20
|
-
return w === w.toLowerCase() ? w : prefix + w.toLowerCase()
|
21
|
-
}).join("")
|
22
|
-
}
|