playbook_ui_docs 14.18.0.pre.rc.3 → 14.18.0
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_advanced_table/docs/_advanced_table_expand_by_depth.jsx +66 -0
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_expand_by_depth.md +10 -0
- data/app/pb_kits/playbook/pb_advanced_table/docs/example.yml +1 -0
- data/app/pb_kits/playbook/pb_advanced_table/docs/index.js +2 -1
- data/app/pb_kits/playbook/pb_circle_icon_button/docs/_circle_icon_button_size.html.erb +28 -0
- data/app/pb_kits/playbook/pb_circle_icon_button/docs/_circle_icon_button_size.jsx +42 -0
- data/app/pb_kits/playbook/pb_circle_icon_button/docs/_circle_icon_button_size.md +1 -0
- data/app/pb_kits/playbook/pb_circle_icon_button/docs/example.yml +2 -0
- data/app/pb_kits/playbook/pb_circle_icon_button/docs/index.js +1 -0
- data/app/pb_kits/playbook/pb_copy_button/docs/_copy_button_hook_rails.html.erb +14 -0
- data/app/pb_kits/playbook/pb_copy_button/docs/_copy_button_hook_rails.md +3 -0
- data/app/pb_kits/playbook/pb_copy_button/docs/example.yml +1 -0
- data/app/pb_kits/playbook/pb_dialog/docs/_dialog_turbo_frames.html.erb +117 -0
- data/app/pb_kits/playbook/pb_dialog/docs/_dialog_turbo_frames_rails.md +9 -0
- data/app/pb_kits/playbook/pb_dialog/docs/example.yml +1 -0
- data/app/pb_kits/playbook/pb_draggable/docs/_draggable_event_listeners.html.erb +42 -0
- data/app/pb_kits/playbook/pb_draggable/docs/_draggable_event_listeners.md +1 -0
- data/app/pb_kits/playbook/pb_draggable/docs/example.yml +1 -0
- data/app/pb_kits/playbook/pb_gauge/docs/_gauge_pb_styles.jsx +31 -0
- data/app/pb_kits/playbook/pb_gauge/docs/_gauge_pb_styles.md +1 -0
- data/app/pb_kits/playbook/pb_gauge/docs/example.yml +1 -0
- data/app/pb_kits/playbook/pb_gauge/docs/index.js +1 -0
- data/app/pb_kits/playbook/pb_overlay/docs/_overlay_fullscreen_background.jsx +49 -0
- data/app/pb_kits/playbook/pb_overlay/docs/_overlay_fullscreen_background.md +1 -0
- data/app/pb_kits/playbook/pb_overlay/docs/_overlay_fullscreen_opacity.jsx +81 -0
- data/app/pb_kits/playbook/pb_overlay/docs/_overlay_fullscreen_opacity.md +1 -0
- data/app/pb_kits/playbook/pb_overlay/docs/example.yml +2 -0
- data/app/pb_kits/playbook/pb_overlay/docs/index.js +2 -0
- data/dist/playbook-doc.js +1 -1
- metadata +19 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: af41094e29ed2d3de146bd91de5f6cea739b2d3e072d9afacec4b21c886526d6
|
4
|
+
data.tar.gz: 1f612e7d4be527c0ee0f1513251058d3abb9235f472f9ed6541fb18e45d56f19
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9cb9da613064a0b79590f9c9f316427cd5d7eb9557ded4ed3a7950aa151ae9b651fa2332655d5fec21dea7f4564b67ffc36ce854f144061b9cf333c62d24e4e0
|
7
|
+
data.tar.gz: a1681cb02dd1d7711fef564f0b0530ea1df0189f20a54f31999f868e56f01b1a4950916d304a34e3b162daf52e1a8cd53103ed46994cedf8fa20e7003d7c4bc1
|
@@ -0,0 +1,66 @@
|
|
1
|
+
import React from "react"
|
2
|
+
import AdvancedTable from '../../pb_advanced_table/_advanced_table'
|
3
|
+
import MOCK_DATA from "./advanced_table_mock_data.json"
|
4
|
+
|
5
|
+
const AdvancedTableExpandByDepth = (props) => {
|
6
|
+
const columnDefinitions = [
|
7
|
+
{
|
8
|
+
accessor: "year",
|
9
|
+
label: "Year",
|
10
|
+
cellAccessors: ["quarter", "month", "day"],
|
11
|
+
},
|
12
|
+
{
|
13
|
+
accessor: "newEnrollments",
|
14
|
+
label: "New Enrollments",
|
15
|
+
},
|
16
|
+
{
|
17
|
+
accessor: "scheduledMeetings",
|
18
|
+
label: "Scheduled Meetings",
|
19
|
+
},
|
20
|
+
{
|
21
|
+
accessor: "attendanceRate",
|
22
|
+
label: "Attendance Rate",
|
23
|
+
},
|
24
|
+
{
|
25
|
+
accessor: "completedClasses",
|
26
|
+
label: "Completed Classes",
|
27
|
+
},
|
28
|
+
{
|
29
|
+
accessor: "classCompletionRate",
|
30
|
+
label: "Class Completion Rate",
|
31
|
+
},
|
32
|
+
{
|
33
|
+
accessor: "graduatedStudents",
|
34
|
+
label: "Graduated Students",
|
35
|
+
},
|
36
|
+
]
|
37
|
+
|
38
|
+
const expandByDepth = [
|
39
|
+
{
|
40
|
+
depth: 0,
|
41
|
+
label: "Year",
|
42
|
+
},
|
43
|
+
{
|
44
|
+
depth: 1,
|
45
|
+
label: "Quarter",
|
46
|
+
},
|
47
|
+
{
|
48
|
+
depth: 2,
|
49
|
+
label: "Month",
|
50
|
+
}
|
51
|
+
]
|
52
|
+
|
53
|
+
return (
|
54
|
+
<div>
|
55
|
+
<AdvancedTable
|
56
|
+
columnDefinitions={columnDefinitions}
|
57
|
+
expandByDepth={expandByDepth}
|
58
|
+
onExpandByDepthClick={(depth, rows) => {console.log(depth, rows)}}
|
59
|
+
tableData={MOCK_DATA}
|
60
|
+
{...props}
|
61
|
+
/>
|
62
|
+
</div>
|
63
|
+
)
|
64
|
+
}
|
65
|
+
|
66
|
+
export default AdvancedTableExpandByDepth
|
@@ -0,0 +1,10 @@
|
|
1
|
+
The `expandByDepth` prop enables users to expand or collapse table rows by specific levels of nesting. When provided, it renders a dropdown that appears when the toggle icon in the header is clicked.
|
2
|
+
|
3
|
+
`expandByDepth` accepts an array of objects, where each object defines the depth level to target and the label to display in the dropdown. When a user selects an option:
|
4
|
+
|
5
|
+
**Expanding a depth**: Expands all rows at the selected depth AND all parent levels above it (if parent levels were closed), ensuring nested content is visible.
|
6
|
+
|
7
|
+
**Collapsing a depth**: Only collapses rows at the selected depth, keeping parent rows expanded for context.
|
8
|
+
|
9
|
+
If you want to attach further logic to each option click, the **optional** `onExpandByDepthClick` prop can be used. This click event provides 2 arguments that can be hooked into: the depth level of the clicked item AND all flattened table rows. Any additional functionality provided through this onClick will be applied in addition to the default.
|
10
|
+
|
@@ -22,6 +22,7 @@ examples:
|
|
22
22
|
- advanced_table_sort: Enable Sorting
|
23
23
|
- advanced_table_sort_control: Sort Control
|
24
24
|
- advanced_table_expanded_control: Expanded Control
|
25
|
+
- advanced_table_expand_by_depth: Expand by Depth
|
25
26
|
- advanced_table_subrow_headers: SubRow Headers
|
26
27
|
- advanced_table_collapsible_trail: Collapsible Trail
|
27
28
|
- advanced_table_table_options: Table Options
|
@@ -25,4 +25,5 @@ export { default as AdvancedTableInlineEditing } from './_advanced_table_inline_
|
|
25
25
|
export { default as AdvancedTableFullscreen } from './_advanced_table_fullscreen.jsx'
|
26
26
|
export { default as AdvancedTableStickyColumns } from './_advanced_table_sticky_columns.jsx'
|
27
27
|
export { default as AdvancedTableStickyHeader } from './_advanced_table_sticky_header.jsx'
|
28
|
-
export { default as AdvancedTableStickyColumnsAndHeader } from './_advanced_table_sticky_columns_and_header.jsx'
|
28
|
+
export { default as AdvancedTableStickyColumnsAndHeader } from './_advanced_table_sticky_columns_and_header.jsx'
|
29
|
+
export { default as AdvancedTableExpandByDepth } from './_advanced_table_expand_by_depth.jsx'
|
@@ -0,0 +1,28 @@
|
|
1
|
+
<%= pb_rails("flex", props: { orientation: "column", gap: "sm" }) do %>
|
2
|
+
<%= pb_rails("circle_icon_button", props: {
|
3
|
+
icon: "plus",
|
4
|
+
size: "sm",
|
5
|
+
variant: "primary"
|
6
|
+
}) %>
|
7
|
+
|
8
|
+
<%= pb_rails("circle_icon_button", props: {
|
9
|
+
icon: "pen",
|
10
|
+
loading: true,
|
11
|
+
size: "sm",
|
12
|
+
variant: "secondary"
|
13
|
+
}) %>
|
14
|
+
|
15
|
+
<%= pb_rails("circle_icon_button", props: {
|
16
|
+
disabled: true,
|
17
|
+
icon: "times",
|
18
|
+
size: "sm"
|
19
|
+
}) %>
|
20
|
+
|
21
|
+
<%= pb_rails("circle_icon_button", props: {
|
22
|
+
icon: "info",
|
23
|
+
link: "https://playbook.powerapp.cloud/",
|
24
|
+
size: "sm",
|
25
|
+
target: "child",
|
26
|
+
variant: "link"
|
27
|
+
}) %>
|
28
|
+
<% end %>
|
@@ -0,0 +1,42 @@
|
|
1
|
+
import React from 'react'
|
2
|
+
|
3
|
+
import CircleIconButton from '../_circle_icon_button'
|
4
|
+
import Flex from '../../pb_flex/_flex'
|
5
|
+
|
6
|
+
const CircleIconButtonSize = (props) => (
|
7
|
+
<>
|
8
|
+
<Flex gap="sm"
|
9
|
+
orientation="column"
|
10
|
+
>
|
11
|
+
<CircleIconButton
|
12
|
+
icon="plus"
|
13
|
+
size="sm"
|
14
|
+
variant="primary"
|
15
|
+
{...props}
|
16
|
+
/>
|
17
|
+
<CircleIconButton
|
18
|
+
icon="pen"
|
19
|
+
loading
|
20
|
+
size="sm"
|
21
|
+
variant="secondary"
|
22
|
+
{...props}
|
23
|
+
/>
|
24
|
+
<CircleIconButton
|
25
|
+
disabled
|
26
|
+
icon="times"
|
27
|
+
size="sm"
|
28
|
+
{...props}
|
29
|
+
/>
|
30
|
+
<CircleIconButton
|
31
|
+
icon="info"
|
32
|
+
link="https://playbook.powerapp.cloud/"
|
33
|
+
size="sm"
|
34
|
+
target="child"
|
35
|
+
variant="link"
|
36
|
+
{...props}
|
37
|
+
/>
|
38
|
+
</Flex>
|
39
|
+
</>
|
40
|
+
)
|
41
|
+
|
42
|
+
export default CircleIconButtonSize
|
@@ -0,0 +1 @@
|
|
1
|
+
The `size` prop accepts "sm" as a value to make the Circle Icon Button 20px x 20px instead of the default 40px x 40px size.
|
@@ -4,9 +4,11 @@ examples:
|
|
4
4
|
- circle_icon_button_default: Default
|
5
5
|
- circle_icon_button_link: Link
|
6
6
|
- circle_icon_button_loading: Loading
|
7
|
+
- circle_icon_button_size: Size
|
7
8
|
|
8
9
|
react:
|
9
10
|
- circle_icon_button_default: Default
|
10
11
|
- circle_icon_button_click: Click Handler
|
11
12
|
- circle_icon_button_link: Link
|
12
13
|
- circle_icon_button_loading: Loading
|
14
|
+
- circle_icon_button_size: Size
|
@@ -2,3 +2,4 @@ export { default as CircleIconButtonDefault } from './_circle_icon_button_defaul
|
|
2
2
|
export { default as CircleIconButtonClick } from './_circle_icon_button_click.jsx'
|
3
3
|
export { default as CircleIconButtonLink } from './_circle_icon_button_link.jsx'
|
4
4
|
export { default as CircleIconButtonLoading } from './_circle_icon_button_loading.jsx'
|
5
|
+
export { default as CircleIconButtonSize } from './_circle_icon_button_size.jsx'
|
@@ -0,0 +1,14 @@
|
|
1
|
+
<%= pb_rails("body", props: { cursor: "pointer", data: { "external-copy-from": "hookbody"} }) do %>
|
2
|
+
<span id="hookbody">I'm a custom copy hook! Click this body to copy this text!</span>
|
3
|
+
<% end %>
|
4
|
+
|
5
|
+
<%= pb_rails("tooltip", props: {
|
6
|
+
trigger_element_selector: "#hookbody",
|
7
|
+
tooltip_id: "hookbody_tooltip",
|
8
|
+
position: 'top',
|
9
|
+
trigger_method: "click"
|
10
|
+
}) do %>
|
11
|
+
Copied!
|
12
|
+
<% end %>
|
13
|
+
|
14
|
+
<%= pb_rails("textarea", props: { margin_top: "xs", placeholder: "Paste here" }) %>
|
@@ -0,0 +1,3 @@
|
|
1
|
+
You can use any external control (like the text itself or an icon) to copy. To use this hook, set the `data-external-copy-from` attribute on the external control to the copying ID. This will grab the `innerText` from `your_id` element, or `value` if it is an input element. Alternatively, you can set a `data-external-copy-value` attribute and copy custom text.
|
2
|
+
|
3
|
+
See the code example for details.
|
@@ -0,0 +1,117 @@
|
|
1
|
+
<%= pb_rails("flex", props:{ gap: "xs", wrap:true}) do %>
|
2
|
+
<%= pb_rails("button", props: { id: "button-open-example-turbo-frames", margin_right: "md", text: "Open Dialog via Custom Event" }) %>
|
3
|
+
<%= pb_rails("button", props: { id: "open-dialog-button", data: { open_dialog: "dialog-confirm-turbo-frames" }, margin_right: "md", text: "Custom Event Linked to Confirm Button" }) %>
|
4
|
+
<%= pb_rails("button", props: { id: "button-open-multi-dialog", text: "Mutliple Events Example" }) %>
|
5
|
+
<% end %>
|
6
|
+
|
7
|
+
<!-- Example 1: Basic dialog with custom event opening -->
|
8
|
+
<%= pb_rails("dialog", props: {
|
9
|
+
id: "dialog-open-turbo-frames",
|
10
|
+
title: "Click Event Simulation",
|
11
|
+
text: "Demonstrating Opening the Dialog with a Custom Event.",
|
12
|
+
custom_event_type: "dialogOpen",
|
13
|
+
cancel_button: "Cancel Button",
|
14
|
+
confirm_button: "Okay",
|
15
|
+
confirm_button_id: "confirm-button-turbo-frames"
|
16
|
+
}) %>
|
17
|
+
|
18
|
+
<script>
|
19
|
+
document.getElementById("button-open-example-turbo-frames").addEventListener("click", () => {
|
20
|
+
console.log("📣 Dispatching 'dialogOpen' custom event")
|
21
|
+
|
22
|
+
window.dispatchEvent(new CustomEvent("dialogOpen", {
|
23
|
+
bubbles: true,
|
24
|
+
detail: {
|
25
|
+
dialogId: "dialog-open-turbo-frames",
|
26
|
+
action: "open"
|
27
|
+
}
|
28
|
+
}))
|
29
|
+
|
30
|
+
console.log("✅ Custom event dispatched - dialog should open")
|
31
|
+
})
|
32
|
+
</script>
|
33
|
+
|
34
|
+
<!-- Example 2: Dialog with custom event linking confirm button to closing the dialog-->
|
35
|
+
<%= pb_rails("dialog", props: {
|
36
|
+
id: "dialog-confirm-turbo-frames",
|
37
|
+
title: "Custom Event Button Action",
|
38
|
+
text: "Clicking this dialog's confirm button triggers closing the dialog as well.",
|
39
|
+
custom_event_type: "turboResponse",
|
40
|
+
cancel_button: "Cancel",
|
41
|
+
cancel_button_id: "cancel-button-id-turbo-frames",
|
42
|
+
confirm_button: "Confirm Button",
|
43
|
+
confirm_button_id: "confirm-button-id-turbo-frames"
|
44
|
+
}) %>
|
45
|
+
|
46
|
+
<script>
|
47
|
+
window.addEventListener("turboResponse", (event) => {
|
48
|
+
const { dialogId, action, cancelButtonId } = event.detail || {}
|
49
|
+
console.log("📦 turboResponse event triggered:", { dialogId, action, cancelButtonId })
|
50
|
+
|
51
|
+
if (action === "close" && cancelButtonId) {
|
52
|
+
const dialog = document.getElementById(dialogId)
|
53
|
+
if (dialog?.close) {
|
54
|
+
console.log("🚪 Closing dialog programmatically")
|
55
|
+
dialog.close()
|
56
|
+
}
|
57
|
+
}
|
58
|
+
})
|
59
|
+
|
60
|
+
document.getElementById("confirm-button-id-turbo-frames").addEventListener("click", function () {
|
61
|
+
console.log("✅ Confirm button clicked! Triggering cancel via turboResponse")
|
62
|
+
|
63
|
+
window.dispatchEvent(new CustomEvent("turboResponse", {
|
64
|
+
detail: {
|
65
|
+
dialogId: "dialog-confirm-turbo-frames",
|
66
|
+
action: "close",
|
67
|
+
cancelButtonId: "cancel-button-id-turbo-frames"
|
68
|
+
}
|
69
|
+
}))
|
70
|
+
})
|
71
|
+
</script>
|
72
|
+
|
73
|
+
<!-- Example 3: Dialog with multiple custom event types -->
|
74
|
+
<%= pb_rails("dialog", props: {
|
75
|
+
id: "multi-event-dialog",
|
76
|
+
title: "Multiple Event Types",
|
77
|
+
text: "This dialog responds to multiple custom event types - see console logs.",
|
78
|
+
custom_event_type: "dialogOpenMutli,turboResponseMulti",
|
79
|
+
cancel_button: "Cancel",
|
80
|
+
cancel_button_id: "multi-event-cancel",
|
81
|
+
confirm_button: "Confirm",
|
82
|
+
confirm_button_id: "multi-event-confirm"
|
83
|
+
}) %>
|
84
|
+
|
85
|
+
<script>
|
86
|
+
document.getElementById("button-open-multi-dialog").addEventListener("click", () => {
|
87
|
+
console.log("📣 Dispatching 'dialogOpenMutli' custom event")
|
88
|
+
window.dispatchEvent(new CustomEvent("dialogOpenMutli", {
|
89
|
+
detail: {
|
90
|
+
dialogId: "multi-event-dialog",
|
91
|
+
action: "open"
|
92
|
+
}
|
93
|
+
}))
|
94
|
+
})
|
95
|
+
|
96
|
+
document.getElementById("multi-event-confirm")?.addEventListener("click", function() {
|
97
|
+
console.log("✅ Confirm clicked — dispatching 'turboResponseMulti' to simulate dialog close")
|
98
|
+
|
99
|
+
window.dispatchEvent(new CustomEvent("turboResponseMulti", {
|
100
|
+
detail: {
|
101
|
+
dialogId: "multi-event-dialog",
|
102
|
+
action: "close",
|
103
|
+
cancelButtonId: "multi-event-cancel"
|
104
|
+
}
|
105
|
+
}))
|
106
|
+
})
|
107
|
+
|
108
|
+
window.addEventListener("turboResponseMulti", (event) => {
|
109
|
+
const { dialogId, action, cancelButtonId } = event.detail || {}
|
110
|
+
|
111
|
+
if (action === "close" && dialogId) {
|
112
|
+
const dialog = document.getElementById(dialogId)
|
113
|
+
dialog.close?.()
|
114
|
+
console.log("🚪 Closing dialog programmatically")
|
115
|
+
}
|
116
|
+
})
|
117
|
+
</script>
|
@@ -0,0 +1,9 @@
|
|
1
|
+
The `custom_event_type` prop allows you to specify custom events that will trigger the dialog's initialization or control its behavior. This is especially useful when working with Turbo Frame updates where standard DOM events might not suffice.
|
2
|
+
|
3
|
+
The examples demonstrate two use cases:
|
4
|
+
1) Opening a dialog via custom event dispatch: The first example shows how to configure a dialog to listen for a specific custom event (dialogOpen). When this event is dispatched, the dialog will automatically open, making it easy to trigger the dialog from JavaScript or after Turbo Frame operations.
|
5
|
+
2) Controlling dialog button actions with custom events: The second example demonstrates how to set up a dialog that can have its confirm button triggered through external events (turboResponse). This pattern is useful when you need to programmatically confirm a dialog after some background operation completes.
|
6
|
+
3) Multiple custom events: The third example combines the first two to show how `custom_event_type` prop can support multiple event types separated by a comma.
|
7
|
+
|
8
|
+
For Turbo integration, you can use standard Turbo events like turbo:frame-load or turbo:submit-end as your `custom_event_type` to ensure the dialog responds properly after Turbo navigation or form submissions. The dialog component will listen for these events automatically.
|
9
|
+
The implementation handles various actions including 'open', 'close', 'clickConfirm', and 'clickCancel', making it flexible for different interaction patterns in your Turbo-enhanced application.
|
@@ -0,0 +1,42 @@
|
|
1
|
+
<% initial_items = [
|
2
|
+
{
|
3
|
+
id: "100",
|
4
|
+
url: "https://unsplash.it/500/400/?image=638",
|
5
|
+
},
|
6
|
+
{
|
7
|
+
id: "200",
|
8
|
+
url: "https://unsplash.it/500/400/?image=639",
|
9
|
+
},
|
10
|
+
{
|
11
|
+
id: "300",
|
12
|
+
url: "https://unsplash.it/500/400/?image=640",
|
13
|
+
},
|
14
|
+
] %>
|
15
|
+
|
16
|
+
<%= pb_rails("draggable", props: {initial_items: initial_items}) do %>
|
17
|
+
<%= pb_rails("draggable/draggable_container") do %>
|
18
|
+
<%= pb_rails("flex") do %>
|
19
|
+
<% initial_items.each do |item| %>
|
20
|
+
<%= pb_rails("draggable/draggable_item", props:{drag_id: item[:id]}) do %>
|
21
|
+
<%= pb_rails("image", props: { alt: item[:id], size: "md", url: item[:url], margin: "xs" }) %>
|
22
|
+
<% end %>
|
23
|
+
<% end %>
|
24
|
+
<% end %>
|
25
|
+
<% end %>
|
26
|
+
<% end %>
|
27
|
+
|
28
|
+
<script>
|
29
|
+
const itemIds = ["item_100", "item_200", "item_300"];
|
30
|
+
|
31
|
+
itemIds.forEach((id) => {
|
32
|
+
const element = document.getElementById(id);
|
33
|
+
if (element) {
|
34
|
+
element.addEventListener("dragstart", (event) => {
|
35
|
+
console.log(`${id} drag start!`);
|
36
|
+
});
|
37
|
+
element.addEventListener("dragend", (event) => {
|
38
|
+
console.log(`${id} drag end!`);
|
39
|
+
});
|
40
|
+
}
|
41
|
+
});
|
42
|
+
</script>
|
@@ -0,0 +1 @@
|
|
1
|
+
You can add drag event listeners for `drag`, `dragend`, `dragenter`, `dragleave`, `dragover`, `dragstart`, and `drop`.
|
@@ -0,0 +1,31 @@
|
|
1
|
+
import React from 'react'
|
2
|
+
import gaugeTheme from '../gaugeTheme'
|
3
|
+
import Highcharts from "highcharts"
|
4
|
+
import HighchartsReact from "highcharts-react-official"
|
5
|
+
import HighchartsMore from "highcharts/highcharts-more"
|
6
|
+
import SolidGauge from "highcharts/modules/solid-gauge"
|
7
|
+
|
8
|
+
HighchartsMore(Highcharts);
|
9
|
+
SolidGauge(Highcharts);
|
10
|
+
|
11
|
+
const data = [{ name: "Name", y: 45 }]
|
12
|
+
|
13
|
+
const baseOptions = {
|
14
|
+
title: { text: "" },
|
15
|
+
series: [{ data: data }],
|
16
|
+
};
|
17
|
+
|
18
|
+
const GaugePbStyles = () => {
|
19
|
+
const options = Highcharts.merge({}, gaugeTheme, baseOptions);
|
20
|
+
|
21
|
+
return (
|
22
|
+
<div>
|
23
|
+
<HighchartsReact
|
24
|
+
highcharts={Highcharts}
|
25
|
+
options={options}
|
26
|
+
/>
|
27
|
+
</div>
|
28
|
+
);
|
29
|
+
};
|
30
|
+
|
31
|
+
export default GaugePbStyles;
|
@@ -0,0 +1 @@
|
|
1
|
+
You don't need to use the Gauge Kit to apply Playbook styles to your Highcharts gauge chart. Just import gaugeTheme.ts and merge it with your chart options—Playbook’s styling will apply automatically.
|
@@ -1,4 +1,5 @@
|
|
1
1
|
export { default as GaugeDefault } from './_gauge_default.jsx'
|
2
|
+
export { default as GaugePbStyles } from './_gauge_pb_styles.jsx'
|
2
3
|
export { default as GaugeDisableAnimation } from './_gauge_disable_animation.jsx'
|
3
4
|
export { default as GaugeFullCircle } from './_gauge_full_circle.jsx'
|
4
5
|
export { default as GaugeHeight } from './_gauge_height.jsx'
|
@@ -0,0 +1,49 @@
|
|
1
|
+
import React, { useState } from 'react'
|
2
|
+
import Overlay from '../../pb_overlay/_overlay'
|
3
|
+
import Button from '../../pb_button/_button'
|
4
|
+
import FixedConfirmationToast from '../../pb_fixed_confirmation_toast/_fixed_confirmation_toast'
|
5
|
+
|
6
|
+
const OverlayFullscreenBackground = () => {
|
7
|
+
const [openBackground, setOpenBackground] = useState(false)
|
8
|
+
|
9
|
+
const handleClickBackground = () => {
|
10
|
+
setOpenBackground(true)
|
11
|
+
}
|
12
|
+
|
13
|
+
const handleCloseBackground = () => {
|
14
|
+
setOpenBackground(false)
|
15
|
+
}
|
16
|
+
|
17
|
+
return (
|
18
|
+
<>
|
19
|
+
<div>
|
20
|
+
<Button
|
21
|
+
onClick={handleClickBackground}
|
22
|
+
text="Background Dark"
|
23
|
+
variant="secondary"
|
24
|
+
/>
|
25
|
+
|
26
|
+
{openBackground && (
|
27
|
+
<Overlay
|
28
|
+
color="bg_dark"
|
29
|
+
fullScreen
|
30
|
+
gradient={false}
|
31
|
+
opacity="opacity_4"
|
32
|
+
>
|
33
|
+
<FixedConfirmationToast
|
34
|
+
closeable
|
35
|
+
horizontal='center'
|
36
|
+
onClose={handleCloseBackground}
|
37
|
+
open={openBackground}
|
38
|
+
status="tip"
|
39
|
+
text='Fullscreen Overlay with color set to Background Dark.'
|
40
|
+
vertical='top'
|
41
|
+
/>
|
42
|
+
</Overlay>
|
43
|
+
)}
|
44
|
+
</div>
|
45
|
+
</>
|
46
|
+
)
|
47
|
+
}
|
48
|
+
|
49
|
+
export default OverlayFullscreenBackground
|
@@ -0,0 +1 @@
|
|
1
|
+
The `fullScreen` prop also allows you to use `color` along with it.
|
@@ -0,0 +1,81 @@
|
|
1
|
+
import React, { useState } from 'react'
|
2
|
+
|
3
|
+
import Overlay from '../../pb_overlay/_overlay'
|
4
|
+
import Button from '../../pb_button/_button'
|
5
|
+
import FixedConfirmationToast from '../../pb_fixed_confirmation_toast/_fixed_confirmation_toast'
|
6
|
+
|
7
|
+
const OverlayFullscreenOpacity = () => {
|
8
|
+
const [openOpacity40, setOpenOpacity40] = useState(false)
|
9
|
+
const [openOpacity80, setOpenOpacity80] = useState(false)
|
10
|
+
|
11
|
+
const handleClickOpacity40 = () => {
|
12
|
+
setOpenOpacity40(true)
|
13
|
+
}
|
14
|
+
const handleCloseOpacity40 = () => {
|
15
|
+
setOpenOpacity40(false)
|
16
|
+
}
|
17
|
+
|
18
|
+
const handleClickOpacity80 = () => {
|
19
|
+
setOpenOpacity80(true)
|
20
|
+
}
|
21
|
+
const handleCloseOpacity80 = () => {
|
22
|
+
setOpenOpacity80(false)
|
23
|
+
}
|
24
|
+
|
25
|
+
return (
|
26
|
+
<>
|
27
|
+
<div>
|
28
|
+
<Button
|
29
|
+
onClick={handleClickOpacity40}
|
30
|
+
text="40% Opacity"
|
31
|
+
variant="secondary"
|
32
|
+
/>
|
33
|
+
{' '}
|
34
|
+
<Button
|
35
|
+
onClick={handleClickOpacity80}
|
36
|
+
text="80% Opacity"
|
37
|
+
variant="secondary"
|
38
|
+
/>
|
39
|
+
|
40
|
+
{openOpacity40 && (
|
41
|
+
<Overlay
|
42
|
+
fullScreen
|
43
|
+
gradient={false}
|
44
|
+
opacity="opacity_4"
|
45
|
+
>
|
46
|
+
<FixedConfirmationToast
|
47
|
+
closeable
|
48
|
+
horizontal='center'
|
49
|
+
onClose={handleCloseOpacity40}
|
50
|
+
open={openOpacity40}
|
51
|
+
status="tip"
|
52
|
+
text='Fullscreen Overlay at 40% Opacity.'
|
53
|
+
vertical='top'
|
54
|
+
/>
|
55
|
+
</Overlay>
|
56
|
+
)}
|
57
|
+
|
58
|
+
{openOpacity80 && (
|
59
|
+
<Overlay
|
60
|
+
fullScreen
|
61
|
+
gradient={false}
|
62
|
+
opacity="opacity_8"
|
63
|
+
>
|
64
|
+
<FixedConfirmationToast
|
65
|
+
closeable
|
66
|
+
display="block"
|
67
|
+
horizontal='center'
|
68
|
+
onClose={handleCloseOpacity80}
|
69
|
+
open={openOpacity80}
|
70
|
+
status="tip"
|
71
|
+
text='Fullscreen Overlay at 80% Opacity.'
|
72
|
+
vertical='top'
|
73
|
+
/>
|
74
|
+
</Overlay>
|
75
|
+
)}
|
76
|
+
</div>
|
77
|
+
</>
|
78
|
+
)
|
79
|
+
}
|
80
|
+
|
81
|
+
export default OverlayFullscreenOpacity
|
@@ -0,0 +1 @@
|
|
1
|
+
To enable the overlay to cover the full size of your screen, you can pass the `fullScreen` prop. You can also pass an opacity along with it.
|
@@ -8,6 +8,8 @@ examples:
|
|
8
8
|
- overlay_vertical_dynamic_multi_directional: Vertical Dynamic Multi-directional
|
9
9
|
- overlay_toggle: Toggle
|
10
10
|
- overlay_hide_scroll_bar: Hide Scroll Bar
|
11
|
+
- overlay_fullscreen_opacity: Full Page Opacity
|
12
|
+
- overlay_fullscreen_background: Full Page Using Background Color Tokens
|
11
13
|
|
12
14
|
rails:
|
13
15
|
- overlay_default: Default
|
@@ -6,3 +6,5 @@ export { default as OverlayMultiDirectional } from './_overlay_multi_directional
|
|
6
6
|
export { default as OverlayToggle } from './_overlay_toggle.jsx'
|
7
7
|
export { default as OverlayVerticalDynamicMultiDirectional } from './_overlay_vertical_dynamic_multi_directional.jsx'
|
8
8
|
export { default as OverlayHideScrollBar } from './_overlay_hide_scroll_bar.jsx'
|
9
|
+
export { default as OverlayFullscreenOpacity } from './_overlay_fullscreen_opacity.jsx'
|
10
|
+
export { default as OverlayFullscreenBackground } from './_overlay_fullscreen_background.jsx'
|