playbook_ui 14.22.0.pre.alpha.popoverkittransitionpoppertofloatingui8736 → 14.22.0.pre.alpha.popoverkittransitionpoppertofloatingui8856
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/app/pb_kits/playbook/pb_bar_graph/barGraphTheme.ts +106 -0
- data/app/pb_kits/playbook/pb_bar_graph/docs/_bar_graph_colors.jsx +33 -15
- data/app/pb_kits/playbook/pb_bar_graph/docs/_bar_graph_default.jsx +33 -15
- data/app/pb_kits/playbook/pb_bar_graph/docs/_bar_graph_height.jsx +52 -22
- data/app/pb_kits/playbook/pb_bar_graph/docs/_bar_graph_height.md +3 -0
- data/app/pb_kits/playbook/pb_bar_graph/docs/_bar_graph_horizontal.jsx +12 -16
- data/app/pb_kits/playbook/pb_bar_graph/docs/_bar_graph_legend.jsx +31 -15
- data/app/pb_kits/playbook/pb_bar_graph/docs/_bar_graph_legend_non_clickable.jsx +39 -16
- data/app/pb_kits/playbook/pb_bar_graph/docs/_bar_graph_legend_position.jsx +86 -38
- data/app/pb_kits/playbook/pb_bar_graph/docs/_bar_graph_negative_numbers.jsx +32 -15
- data/app/pb_kits/playbook/pb_bar_graph/docs/_bar_graph_secondary_y_axis.jsx +72 -22
- data/app/pb_kits/playbook/pb_bar_graph/docs/_bar_graph_secondary_y_axis.md +1 -1
- data/app/pb_kits/playbook/pb_bar_graph/docs/_bar_graph_spline.jsx +31 -15
- data/app/pb_kits/playbook/pb_bar_graph/docs/_bar_graph_stacked.jsx +37 -16
- data/app/pb_kits/playbook/pb_bar_graph/docs/_description.md +1 -3
- data/app/pb_kits/playbook/pb_bar_graph/docs/example.yml +1 -3
- data/app/pb_kits/playbook/pb_bar_graph/docs/index.js +0 -2
- data/app/pb_kits/playbook/pb_circle_chart/circleChartTheme.ts +36 -1
- data/app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_block.jsx +71 -26
- data/app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_colors.jsx +29 -16
- data/app/pb_kits/playbook/pb_circle_chart/docs/{_circle_chart_colors.md → _circle_chart_colors_rails.md} +1 -1
- data/app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_colors_react.md +2 -0
- data/app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_custom_tooltip.jsx +28 -16
- data/app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_custom_tooltip.md +4 -2
- data/app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_default.jsx +23 -15
- data/app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_inner_sizes.jsx +81 -51
- data/app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_legend_position.jsx +103 -75
- data/app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_legend_position.md +3 -6
- data/app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_live_data.jsx +19 -13
- data/app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_rounded.jsx +30 -17
- data/app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_with_labels.jsx +34 -20
- data/app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_with_legend_kit.jsx +29 -20
- data/app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_with_title.jsx +28 -20
- data/app/pb_kits/playbook/pb_circle_chart/docs/_description.md +1 -0
- data/app/pb_kits/playbook/pb_circle_chart/docs/example.yml +0 -1
- data/app/pb_kits/playbook/pb_circle_chart/docs/index.js +0 -1
- data/app/pb_kits/playbook/pb_filter/filter.test.js +1 -1
- data/app/pb_kits/playbook/pb_popover/_popover.tsx +16 -20
- data/app/pb_kits/playbook/pb_tooltip/docs/_tooltip_click_open.html.erb +14 -0
- data/app/pb_kits/playbook/pb_tooltip/docs/_tooltip_click_open_rails.md +1 -0
- data/app/pb_kits/playbook/pb_tooltip/docs/example.yml +1 -0
- data/app/pb_kits/playbook/pb_tooltip/index.js +59 -36
- data/app/pb_kits/playbook/pb_tooltip/tooltip.rb +9 -2
- data/app/pb_kits/playbook/pb_walkthrough/_walkthrough.tsx +3 -3
- data/dist/chunks/_circle_chart-DVSbcau1.js +1 -0
- data/dist/chunks/_typeahead-Dw_aUsLL.js +22 -0
- data/dist/chunks/_weekday_stacked-BNHzzslr.js +21 -0
- data/dist/chunks/{lib-MbZXVX7s.js → lib-Ca_BDmX1.js} +1 -1
- data/dist/chunks/{pb_form_validation-ClEueixE.js → pb_form_validation-DczEjrcc.js} +1 -1
- data/dist/chunks/vendor.js +1 -1
- data/dist/playbook-doc.js +1 -19
- data/dist/playbook-rails-react-bindings.js +1 -1
- data/dist/playbook-rails.js +1 -1
- data/lib/playbook/version.rb +1 -1
- metadata +15 -16
- data/app/pb_kits/playbook/pb_bar_graph/docs/_bar_graph_custom.jsx +0 -72
- data/app/pb_kits/playbook/pb_bar_graph/docs/_bar_graph_custom.md +0 -6
- data/app/pb_kits/playbook/pb_bar_graph/docs/_bar_graph_pb_styles.jsx +0 -64
- data/app/pb_kits/playbook/pb_bar_graph/docs/_bar_graph_pb_styles.md +0 -1
- data/app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_pb_styles.jsx +0 -38
- data/app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_pb_styles.md +0 -1
- data/app/pb_kits/playbook/pb_popover/popover.test.js +0 -220
- data/app/pb_kits/playbook/pb_rich_text_editor/rich_text_editor_advanced.test.js +0 -47
- data/dist/chunks/_typeahead-L71EUpvT.js +0 -22
- data/dist/chunks/_weekday_stacked-BEQ6MH1X.js +0 -45
- /data/app/pb_kits/playbook/pb_tooltip/docs/{_tooltip_click_open.md → _tooltip_click_open_react.md} +0 -0
@@ -1,64 +0,0 @@
|
|
1
|
-
import React from 'react'
|
2
|
-
import Highcharts from "highcharts";
|
3
|
-
import HighchartsReact from "highcharts-react-official";
|
4
|
-
|
5
|
-
import "../BarGraphStyles.scss";
|
6
|
-
// Your path might look more like this
|
7
|
-
//import "playbook-ui/dist/pb_bar_graph/BarGraphStyles.scss";
|
8
|
-
|
9
|
-
const columnChartData = [
|
10
|
-
{
|
11
|
-
name: "Installation",
|
12
|
-
data: [1475, 200, 3000, 654, 656],
|
13
|
-
},
|
14
|
-
{
|
15
|
-
name: "Manufacturing",
|
16
|
-
data: [4434, 524, 2320, 440, 500],
|
17
|
-
},
|
18
|
-
{
|
19
|
-
name: "Sales & Distribution",
|
20
|
-
data: [3387, 743, 1344, 434, 440],
|
21
|
-
},
|
22
|
-
{
|
23
|
-
name: "Project Development",
|
24
|
-
data: [3227, 878, 999, 780, 1000],
|
25
|
-
},
|
26
|
-
{
|
27
|
-
name: "Other",
|
28
|
-
data: [1111, 677, 3245, 500, 200],
|
29
|
-
},
|
30
|
-
];
|
31
|
-
|
32
|
-
const columnOptions = {
|
33
|
-
chart: {
|
34
|
-
type: "column",
|
35
|
-
},
|
36
|
-
series: columnChartData,
|
37
|
-
title: {
|
38
|
-
text: "Solar Employment Growth by Sector, 2010-2016",
|
39
|
-
},
|
40
|
-
subtitle: {
|
41
|
-
text: "Source: thesolarfoundation.com",
|
42
|
-
},
|
43
|
-
xAxis: {
|
44
|
-
categories: ["Jan", "Feb", "Mar", "Apr", "May"],
|
45
|
-
},
|
46
|
-
yAxis: {
|
47
|
-
min: 0,
|
48
|
-
title: {
|
49
|
-
text: "Number of Employees",
|
50
|
-
},
|
51
|
-
},
|
52
|
-
legend: { enabled: false },
|
53
|
-
credits: { enabled: false },
|
54
|
-
};
|
55
|
-
|
56
|
-
const BarGraphPbStyles = () => (
|
57
|
-
<div>
|
58
|
-
<HighchartsReact highcharts={Highcharts}
|
59
|
-
options={columnOptions}
|
60
|
-
/>
|
61
|
-
</div>
|
62
|
-
)
|
63
|
-
|
64
|
-
export default BarGraphPbStyles
|
@@ -1 +0,0 @@
|
|
1
|
-
You don't need to use the bar graph kit to apply the styles to your Highcharts bar graph. Just import the BarGraphStyles.scss to your component and the styles will apply automatically.
|
@@ -1,38 +0,0 @@
|
|
1
|
-
import React from 'react'
|
2
|
-
import circleChartTheme from '../circleChartTheme'
|
3
|
-
import Highcharts from "highcharts"
|
4
|
-
import HighchartsReact from "highcharts-react-official"
|
5
|
-
|
6
|
-
const data = [
|
7
|
-
{
|
8
|
-
name: 'Waiting for Calls',
|
9
|
-
y: 41,
|
10
|
-
},
|
11
|
-
{
|
12
|
-
name: 'On Call',
|
13
|
-
y: 49,
|
14
|
-
},
|
15
|
-
{
|
16
|
-
name: 'After Call',
|
17
|
-
y: 10,
|
18
|
-
},
|
19
|
-
]
|
20
|
-
|
21
|
-
const baseOptions = {
|
22
|
-
series: [{ data: data }],
|
23
|
-
}
|
24
|
-
|
25
|
-
const CircleChartPbStyles = () => {
|
26
|
-
const options = Highcharts.merge({}, circleChartTheme, baseOptions )
|
27
|
-
|
28
|
-
return (
|
29
|
-
<div>
|
30
|
-
<HighchartsReact
|
31
|
-
highcharts={Highcharts}
|
32
|
-
options={options}
|
33
|
-
/>
|
34
|
-
</div>
|
35
|
-
);
|
36
|
-
};
|
37
|
-
|
38
|
-
export default CircleChartPbStyles;
|
@@ -1 +0,0 @@
|
|
1
|
-
You don't need to use the Circle Chart Kit to apply Playbook styles to your Highcharts circle chart. Just import circleChartTheme.ts and merge it with your chart options—Playbook’s styling will apply automatically.
|
@@ -1,220 +0,0 @@
|
|
1
|
-
import React from "react";
|
2
|
-
import { render, screen, fireEvent } from "../utilities/test-utils";
|
3
|
-
import { Button, PbReactPopover } from "playbook-ui";
|
4
|
-
|
5
|
-
const testId = "popover-kit";
|
6
|
-
|
7
|
-
//Test default popover
|
8
|
-
const PopoverTest = () => {
|
9
|
-
const [mockState, setMockState] = React.useState(false)
|
10
|
-
const togglePopover = () => {
|
11
|
-
setMockState(!mockState)
|
12
|
-
}
|
13
|
-
|
14
|
-
const popoverReference = (
|
15
|
-
<Button onClick={togglePopover}
|
16
|
-
text="Click Me"
|
17
|
-
/>
|
18
|
-
);
|
19
|
-
return (
|
20
|
-
<PbReactPopover
|
21
|
-
offset
|
22
|
-
reference={popoverReference}
|
23
|
-
show={mockState}
|
24
|
-
>
|
25
|
-
{"Click Anywhere"}
|
26
|
-
</PbReactPopover>
|
27
|
-
)
|
28
|
-
};
|
29
|
-
//Test popover with z-index
|
30
|
-
const PopoverTestZIndex = () => {
|
31
|
-
const [mockState, setMockState] = React.useState(false)
|
32
|
-
const togglePopover = () => {
|
33
|
-
setMockState(!mockState)
|
34
|
-
}
|
35
|
-
|
36
|
-
const popoverReference = (
|
37
|
-
<Button onClick={togglePopover}
|
38
|
-
text="Click Me"
|
39
|
-
/>
|
40
|
-
);
|
41
|
-
return (
|
42
|
-
<PbReactPopover
|
43
|
-
offset
|
44
|
-
reference={popoverReference}
|
45
|
-
show={mockState}
|
46
|
-
zIndex={3}
|
47
|
-
>
|
48
|
-
{"Click Anywhere"}
|
49
|
-
</PbReactPopover>
|
50
|
-
)
|
51
|
-
};
|
52
|
-
|
53
|
-
//Test popover with max-height and max-width
|
54
|
-
const PopoverTestHeight = () => {
|
55
|
-
const [mockState, setMockState] = React.useState(false)
|
56
|
-
const togglePopover = () => {
|
57
|
-
setMockState(!mockState)
|
58
|
-
}
|
59
|
-
|
60
|
-
const popoverReference = (
|
61
|
-
<Button onClick={togglePopover}
|
62
|
-
text="Click Me"
|
63
|
-
/>
|
64
|
-
);
|
65
|
-
return (
|
66
|
-
<PbReactPopover
|
67
|
-
maxHeight="150px"
|
68
|
-
maxWidth="240px"
|
69
|
-
offset
|
70
|
-
reference={popoverReference}
|
71
|
-
show={mockState}
|
72
|
-
>
|
73
|
-
{"Click Anywhere"}
|
74
|
-
</PbReactPopover>
|
75
|
-
)
|
76
|
-
};
|
77
|
-
|
78
|
-
//Test Popover with click to close 'anywhere'
|
79
|
-
const PopoverTestClicktoClose = () => {
|
80
|
-
const [mockState, setMockState] = React.useState(false)
|
81
|
-
const togglePopover = () => {
|
82
|
-
setMockState(!mockState)
|
83
|
-
}
|
84
|
-
const handleShouldClosePopover = (shouldClosePopover) => {
|
85
|
-
setMockState(!shouldClosePopover)
|
86
|
-
}
|
87
|
-
|
88
|
-
const popoverReference = (
|
89
|
-
<Button onClick={togglePopover}
|
90
|
-
text="Click Me"
|
91
|
-
/>
|
92
|
-
);
|
93
|
-
return (
|
94
|
-
<PbReactPopover
|
95
|
-
closeOnClick="any"
|
96
|
-
offset
|
97
|
-
reference={popoverReference}
|
98
|
-
shouldClosePopover={handleShouldClosePopover}
|
99
|
-
show={mockState}
|
100
|
-
>
|
101
|
-
{"Click Anywhere"}
|
102
|
-
</PbReactPopover>
|
103
|
-
)
|
104
|
-
};
|
105
|
-
|
106
|
-
//Test Popover with click to close 'inside'
|
107
|
-
const PopoverTestClicktoClose2 = () => {
|
108
|
-
const [mockState, setMockState] = React.useState(false)
|
109
|
-
const togglePopover = () => {
|
110
|
-
setMockState(!mockState)
|
111
|
-
}
|
112
|
-
const handleShouldClosePopover = (shouldClosePopover) => {
|
113
|
-
setMockState(!shouldClosePopover)
|
114
|
-
}
|
115
|
-
|
116
|
-
const popoverReference = (
|
117
|
-
<Button onClick={togglePopover}
|
118
|
-
text="Click Me"
|
119
|
-
/>
|
120
|
-
);
|
121
|
-
return (
|
122
|
-
<PbReactPopover
|
123
|
-
closeOnClick="inside"
|
124
|
-
offset
|
125
|
-
reference={popoverReference}
|
126
|
-
shouldClosePopover={handleShouldClosePopover}
|
127
|
-
show={mockState}
|
128
|
-
>
|
129
|
-
{"Click Inside"}
|
130
|
-
</PbReactPopover>
|
131
|
-
)
|
132
|
-
};
|
133
|
-
|
134
|
-
//Test Popover with click to close 'outside'
|
135
|
-
const PopoverTestClicktoClose3 = () => {
|
136
|
-
const [mockState, setMockState] = React.useState(false)
|
137
|
-
const togglePopover = () => {
|
138
|
-
setMockState(!mockState)
|
139
|
-
}
|
140
|
-
const handleShouldClosePopover = (shouldClosePopover) => {
|
141
|
-
setMockState(!shouldClosePopover)
|
142
|
-
}
|
143
|
-
|
144
|
-
const popoverReference = (
|
145
|
-
<Button onClick={togglePopover}
|
146
|
-
text="Click Me"
|
147
|
-
/>
|
148
|
-
);
|
149
|
-
return (
|
150
|
-
<PbReactPopover
|
151
|
-
closeOnClick="outside"
|
152
|
-
offset
|
153
|
-
reference={popoverReference}
|
154
|
-
shouldClosePopover={handleShouldClosePopover}
|
155
|
-
show={mockState}
|
156
|
-
>
|
157
|
-
{"Click Outside"}
|
158
|
-
</PbReactPopover>
|
159
|
-
)
|
160
|
-
};
|
161
|
-
|
162
|
-
|
163
|
-
test("renders Popover", () => {
|
164
|
-
render(<PopoverTest data={{ testid: testId}}/>)
|
165
|
-
const btn = screen.getByText(/click me/i)
|
166
|
-
fireEvent.click(btn);
|
167
|
-
const kit = screen.getByText("Click Anywhere");
|
168
|
-
expect(kit).toBeInTheDocument();
|
169
|
-
});
|
170
|
-
|
171
|
-
test("renders Popover with z index", () => {
|
172
|
-
render(<PopoverTestZIndex data={{ testid: testId}}/>)
|
173
|
-
const btn = screen.getByText(/click me/i)
|
174
|
-
fireEvent.click(btn);
|
175
|
-
const kit = screen.getByText("Click Anywhere");
|
176
|
-
expect(kit).toHaveClass("pb_popover_body z_index_3");
|
177
|
-
});
|
178
|
-
|
179
|
-
test("renders Popover with max height and max width", () => {
|
180
|
-
render(<PopoverTestHeight data={{ testid: testId}}/>)
|
181
|
-
const btn = screen.getByText(/click me/i)
|
182
|
-
fireEvent.click(btn);
|
183
|
-
const kit = screen.getByText("Click Anywhere");
|
184
|
-
expect(kit).toHaveClass("pb_popover_body p_sm overflow_handling");
|
185
|
-
});
|
186
|
-
|
187
|
-
test("closes Popover on click anywhere", async () => {
|
188
|
-
render(<PopoverTestClicktoClose data={{ testid: testId}}/>)
|
189
|
-
const btn = screen.getByText(/click me/i)
|
190
|
-
fireEvent.click(btn);
|
191
|
-
const kit = screen.getByText("Click Anywhere");
|
192
|
-
expect(kit).toBeInTheDocument();
|
193
|
-
fireEvent.click(document.body);
|
194
|
-
|
195
|
-
expect(kit).not.toBeInTheDocument;
|
196
|
-
});
|
197
|
-
|
198
|
-
test("closes Popover on click inside", async () => {
|
199
|
-
render(<PopoverTestClicktoClose2 data={{ testid: testId}}/>)
|
200
|
-
const btn = screen.getByText(/click me/i)
|
201
|
-
fireEvent.click(btn);
|
202
|
-
const kit = screen.getByText("Click Inside");
|
203
|
-
expect(kit).toBeInTheDocument();
|
204
|
-
fireEvent.click(kit);
|
205
|
-
|
206
|
-
expect(kit).not.toBeInTheDocument;
|
207
|
-
});
|
208
|
-
|
209
|
-
test("closes Popover on click outside", async () => {
|
210
|
-
render(<PopoverTestClicktoClose3 data={{ testid: testId}}/>)
|
211
|
-
const btn = screen.getByText(/click me/i)
|
212
|
-
fireEvent.click(btn);
|
213
|
-
const kit = screen.getByText("Click Outside");
|
214
|
-
expect(kit).toBeInTheDocument();
|
215
|
-
fireEvent.click(kit);
|
216
|
-
expect(kit).toBeInTheDocument();
|
217
|
-
fireEvent.click(btn);
|
218
|
-
|
219
|
-
expect(kit).not.toBeInTheDocument;
|
220
|
-
});
|
@@ -1,47 +0,0 @@
|
|
1
|
-
import React from "react";
|
2
|
-
import { render } from "../utilities/test-utils";
|
3
|
-
import { useEditor, EditorContent } from "@tiptap/react";
|
4
|
-
import StarterKit from "@tiptap/starter-kit";
|
5
|
-
import Link from "@tiptap/extension-link";
|
6
|
-
|
7
|
-
import RichTextEditor from "./_rich_text_editor";
|
8
|
-
|
9
|
-
const kitClass = "pb_rich_text_editor_advanced_container";
|
10
|
-
|
11
|
-
const EditorTest = (props) => {
|
12
|
-
const editor = useEditor({
|
13
|
-
extensions: [StarterKit, Link],
|
14
|
-
content: "",
|
15
|
-
});
|
16
|
-
|
17
|
-
return (
|
18
|
-
<RichTextEditor
|
19
|
-
advancedEditor={editor}
|
20
|
-
{...props}
|
21
|
-
>
|
22
|
-
<EditorContent editor={editor} />
|
23
|
-
</RichTextEditor>
|
24
|
-
);
|
25
|
-
};
|
26
|
-
|
27
|
-
test("returns namespaced class name", () => {
|
28
|
-
const { container } = render(<EditorTest />);
|
29
|
-
|
30
|
-
expect(container.getElementsByClassName(kitClass).length).toBeGreaterThan(0);
|
31
|
-
});
|
32
|
-
|
33
|
-
test("returns toolbar class name", () => {
|
34
|
-
const { container } = render(<EditorTest />);
|
35
|
-
|
36
|
-
expect(
|
37
|
-
container.getElementsByClassName(`${kitClass} toolbar-active`).length
|
38
|
-
).toBeGreaterThan(0);
|
39
|
-
});
|
40
|
-
|
41
|
-
test("doesn't returns toolbar class name", () => {
|
42
|
-
const { container } = render(<EditorTest advancedEditorToolbar={false} />);
|
43
|
-
|
44
|
-
expect(
|
45
|
-
container.getElementsByClassName(`${kitClass} toolbar-active`).length
|
46
|
-
).toBe(0);
|
47
|
-
});
|