playbook_ui 14.18.0.pre.alpha.revert4567revert4553PLAY2056ATcolbordercolors7469 → 14.18.0.pre.rc.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/Components/RegularTableView.tsx +3 -23
- data/app/pb_kits/playbook/pb_advanced_table/Components/TableHeaderCell.tsx +3 -67
- data/app/pb_kits/playbook/pb_advanced_table/Hooks/useTableActions.ts +2 -1
- data/app/pb_kits/playbook/pb_advanced_table/Utilities/ExpansionControlHelpers.tsx +19 -29
- data/app/pb_kits/playbook/pb_advanced_table/_advanced_table.scss +143 -365
- data/app/pb_kits/playbook/pb_advanced_table/_advanced_table.tsx +1 -14
- data/app/pb_kits/playbook/pb_advanced_table/advanced_table.rb +1 -6
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_table_props.html.erb +1 -1
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_table_props.jsx +2 -1
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_table_props_rails.md +2 -2
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_table_props_react.md +1 -1
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_table_props_sticky_header_rails.md +2 -6
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_table_props_sticky_header_react.md +2 -6
- data/app/pb_kits/playbook/pb_advanced_table/docs/example.yml +3 -10
- data/app/pb_kits/playbook/pb_advanced_table/docs/index.js +1 -6
- data/app/pb_kits/playbook/pb_advanced_table/index.js +0 -7
- data/app/pb_kits/playbook/pb_advanced_table/table_row.html.erb +1 -1
- data/app/pb_kits/playbook/pb_circle_chart/_circle_chart.tsx +1 -1
- data/app/pb_kits/playbook/pb_circle_chart/circleChart.test.js +2 -2
- data/app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_block.html.erb +2 -2
- data/app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_block.jsx +1 -1
- data/app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_colors.html.erb +1 -1
- data/app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_colors.jsx +1 -1
- data/app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_custom_tooltip.html.erb +1 -1
- data/app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_custom_tooltip.jsx +1 -1
- data/app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_default.html.erb +1 -1
- data/app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_default.jsx +1 -1
- data/app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_legend_position.html.erb +1 -1
- data/app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_legend_position.jsx +1 -1
- data/app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_live_data.jsx +2 -2
- data/app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_rounded.html.erb +1 -1
- data/app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_rounded.jsx +1 -1
- data/app/pb_kits/playbook/pb_circle_chart/docs/example.yml +3 -2
- data/app/pb_kits/playbook/pb_circle_chart/docs/index.js +1 -2
- data/app/pb_kits/playbook/pb_circle_icon_button/_circle_icon_button.scss +1 -39
- data/app/pb_kits/playbook/pb_circle_icon_button/_circle_icon_button.tsx +0 -4
- data/app/pb_kits/playbook/pb_circle_icon_button/circle_icon_button.rb +1 -9
- data/app/pb_kits/playbook/pb_circle_icon_button/circle_icon_button.test.js +0 -14
- data/app/pb_kits/playbook/pb_circle_icon_button/docs/example.yml +0 -2
- data/app/pb_kits/playbook/pb_circle_icon_button/docs/index.js +0 -1
- data/app/pb_kits/playbook/pb_copy_button/_copy_button.tsx +45 -19
- data/app/pb_kits/playbook/pb_copy_button/docs/example.yml +0 -2
- data/app/pb_kits/playbook/pb_copy_button/docs/index.js +1 -2
- data/app/pb_kits/playbook/pb_copy_button/index.js +20 -46
- data/app/pb_kits/playbook/pb_date_picker/_date_picker.tsx +0 -12
- data/app/pb_kits/playbook/pb_date_picker/date_picker.rb +0 -12
- data/app/pb_kits/playbook/pb_date_picker/date_picker_helper.ts +1 -50
- data/app/pb_kits/playbook/pb_date_picker/docs/_date_picker_error.jsx +1 -4
- data/app/pb_kits/playbook/pb_date_picker/docs/_date_picker_quick_pick_rails.md +0 -4
- data/app/pb_kits/playbook/pb_date_picker/docs/_date_picker_quick_pick_range_limit.md +1 -1
- data/app/pb_kits/playbook/pb_date_picker/docs/_date_picker_quick_pick_react.md +1 -5
- data/app/pb_kits/playbook/pb_date_picker/docs/example.yml +0 -2
- data/app/pb_kits/playbook/pb_date_picker/docs/index.js +0 -1
- data/app/pb_kits/playbook/pb_date_picker/plugins/quickPick.tsx +0 -10
- data/app/pb_kits/playbook/pb_dialog/dialog.html.erb +1 -10
- data/app/pb_kits/playbook/pb_dialog/dialog.rb +0 -2
- data/app/pb_kits/playbook/pb_dialog/docs/example.yml +0 -1
- data/app/pb_kits/playbook/pb_dialog/index.js +14 -106
- data/app/pb_kits/playbook/pb_draggable/docs/example.yml +1 -3
- data/app/pb_kits/playbook/pb_draggable/draggable.rb +1 -9
- data/app/pb_kits/playbook/pb_draggable/index.js +142 -139
- data/app/pb_kits/playbook/pb_dropdown/_dropdown.tsx +1 -1
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_error.jsx +1 -4
- data/app/pb_kits/playbook/pb_dropdown/subcomponents/DropdownOption.tsx +1 -1
- data/app/pb_kits/playbook/pb_filter/docs/example.yml +0 -1
- data/app/pb_kits/playbook/pb_form_group/_form_group.scss +3 -23
- data/app/pb_kits/playbook/pb_form_group/docs/_form_group_select.html.erb +5 -15
- data/app/pb_kits/playbook/pb_form_group/docs/_form_group_select.jsx +6 -39
- data/app/pb_kits/playbook/pb_gauge/docs/example.yml +0 -1
- data/app/pb_kits/playbook/pb_gauge/docs/index.js +0 -1
- data/app/pb_kits/playbook/pb_layout/_layout.scss +1 -70
- data/app/pb_kits/playbook/pb_layout/_layout.tsx +2 -29
- data/app/pb_kits/playbook/pb_layout/docs/_layout_bracket.jsx +118 -322
- data/app/pb_kits/playbook/pb_layout/docs/_layout_bracket.md +1 -1
- data/app/pb_kits/playbook/pb_layout/subcomponents/_game.tsx +43 -74
- data/app/pb_kits/playbook/pb_layout/subcomponents/_round.tsx +4 -21
- data/app/pb_kits/playbook/pb_line_graph/docs/example.yml +0 -1
- data/app/pb_kits/playbook/pb_line_graph/docs/index.js +0 -1
- data/app/pb_kits/playbook/pb_overlay/_overlay.scss +22 -83
- data/app/pb_kits/playbook/pb_overlay/_overlay.tsx +7 -39
- data/app/pb_kits/playbook/pb_overlay/docs/_overlay_default.md +7 -1
- data/app/pb_kits/playbook/pb_overlay/docs/example.yml +0 -5
- data/app/pb_kits/playbook/pb_overlay/docs/index.js +0 -5
- data/app/pb_kits/playbook/pb_overlay/overlay.test.jsx +1 -39
- data/app/pb_kits/playbook/pb_phone_number_input/_phone_number_input.scss +0 -13
- data/app/pb_kits/playbook/pb_phone_number_input/_phone_number_input.tsx +1 -3
- data/app/pb_kits/playbook/pb_phone_number_input/docs/_phone_number_input_validation.jsx +1 -8
- data/app/pb_kits/playbook/pb_phone_number_input/docs/example.yml +0 -2
- data/app/pb_kits/playbook/pb_phone_number_input/docs/index.js +0 -1
- data/app/pb_kits/playbook/pb_phone_number_input/phone_number_input.rb +0 -3
- data/app/pb_kits/playbook/pb_phone_number_input/phone_number_input.test.js +0 -19
- data/app/pb_kits/playbook/pb_popover/docs/example.yml +0 -1
- data/app/pb_kits/playbook/pb_popover/index.ts +1 -13
- data/app/pb_kits/playbook/pb_popover/popover.rb +0 -2
- data/app/pb_kits/playbook/pb_select/docs/_select_error.jsx +2 -7
- data/app/pb_kits/playbook/pb_table/_table.tsx +2 -2
- data/app/pb_kits/playbook/pb_table/docs/_table_with_collapsible_with_nested_rows.md +1 -3
- data/app/pb_kits/playbook/pb_table/docs/_table_with_collapsible_with_nested_rows_rails.md +1 -3
- data/app/pb_kits/playbook/pb_table/docs/_table_with_collapsible_with_nested_table.md +1 -3
- data/app/pb_kits/playbook/pb_table/docs/_table_with_collapsible_with_nested_table_rails.md +1 -3
- data/app/pb_kits/playbook/pb_table/styles/_collapsible.scss +1 -1
- data/app/pb_kits/playbook/pb_text_input/_text_input.tsx +5 -13
- data/app/pb_kits/playbook/pb_text_input/docs/_text_input_error.jsx +1 -9
- data/app/pb_kits/playbook/pb_text_input/docs/example.yml +0 -2
- data/app/pb_kits/playbook/pb_text_input/docs/index.js +0 -1
- data/app/pb_kits/playbook/pb_text_input/inputMask.ts +1 -8
- data/app/pb_kits/playbook/pb_textarea/docs/_textarea_error.jsx +1 -7
- data/app/pb_kits/playbook/pb_typeahead/docs/_typeahead_error_state.jsx +2 -6
- data/dist/chunks/_typeahead-C2GOKWtm.js +22 -0
- data/dist/chunks/_weekday_stacked-CFGTPT0O.js +45 -0
- data/dist/chunks/lib-BGzBzFZX.js +29 -0
- data/dist/chunks/{pb_form_validation-BWjy4bFn.js → pb_form_validation-BvNy9Bd6.js} +1 -1
- data/dist/chunks/vendor.js +1 -1
- data/dist/menu.yml +2 -2
- data/dist/playbook-doc.js +1 -19
- 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/version.rb +2 -2
- metadata +8 -71
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_column_border_color.jsx +0 -80
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_column_border_color.md +0 -3
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_column_border_color_rails.html.erb +0 -58
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_column_border_color_rails.md +0 -3
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_expand_by_depth.jsx +0 -66
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_expand_by_depth.md +0 -10
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_sticky_columns.jsx +0 -58
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_sticky_columns.md +0 -6
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_sticky_columns_and_header.jsx +0 -64
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_sticky_columns_and_header.md +0 -8
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_sticky_header.jsx +0 -55
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_sticky_header.md +0 -3
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_sticky_header_rails.html.erb +0 -33
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_sticky_header_rails.md +0 -3
- data/app/pb_kits/playbook/pb_advanced_table/scss_partials/advanced_table_sticky_mixin.scss +0 -97
- data/app/pb_kits/playbook/pb_circle_chart/circleChartTheme.ts +0 -53
- 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_circle_icon_button/docs/_circle_icon_button_size.html.erb +0 -28
- data/app/pb_kits/playbook/pb_circle_icon_button/docs/_circle_icon_button_size.jsx +0 -42
- data/app/pb_kits/playbook/pb_circle_icon_button/docs/_circle_icon_button_size.md +0 -1
- data/app/pb_kits/playbook/pb_copy_button/docs/_copy_button_hook.jsx +0 -54
- data/app/pb_kits/playbook/pb_copy_button/docs/_copy_button_hook.md +0 -3
- data/app/pb_kits/playbook/pb_copy_button/docs/_copy_button_hook_rails.html.erb +0 -14
- data/app/pb_kits/playbook/pb_copy_button/docs/_copy_button_hook_rails.md +0 -3
- data/app/pb_kits/playbook/pb_copy_button/usePBCopy.ts +0 -45
- data/app/pb_kits/playbook/pb_date_picker/docs/_date_picker_range_pattern.jsx +0 -34
- data/app/pb_kits/playbook/pb_date_picker/docs/_date_picker_range_pattern.md +0 -14
- data/app/pb_kits/playbook/pb_date_picker/docs/_date_picker_range_pattern_rails.html.erb +0 -20
- data/app/pb_kits/playbook/pb_date_picker/docs/_date_picker_range_pattern_rails.md +0 -14
- data/app/pb_kits/playbook/pb_dialog/docs/_dialog_turbo_frames.html.erb +0 -117
- data/app/pb_kits/playbook/pb_dialog/docs/_dialog_turbo_frames_rails.md +0 -9
- data/app/pb_kits/playbook/pb_draggable/docs/_draggable_drop_zones.html.erb +0 -43
- data/app/pb_kits/playbook/pb_draggable/docs/_draggable_drop_zones_colors.html.erb +0 -55
- data/app/pb_kits/playbook/pb_draggable/docs/_draggable_drop_zones_colors_rails.md +0 -1
- data/app/pb_kits/playbook/pb_draggable/docs/_draggable_event_listeners.html.erb +0 -42
- data/app/pb_kits/playbook/pb_draggable/docs/_draggable_event_listeners.md +0 -1
- data/app/pb_kits/playbook/pb_filter/docs/_filter_within_turbo_frames.html.erb +0 -41
- data/app/pb_kits/playbook/pb_filter/docs/_filter_within_turbo_frames.md +0 -1
- data/app/pb_kits/playbook/pb_gauge/docs/_gauge_pb_styles.jsx +0 -30
- data/app/pb_kits/playbook/pb_gauge/docs/_gauge_pb_styles.md +0 -1
- data/app/pb_kits/playbook/pb_gauge/gaugeTheme.ts +0 -85
- data/app/pb_kits/playbook/pb_layout/subcomponents/_participant.tsx +0 -79
- data/app/pb_kits/playbook/pb_line_graph/docs/_line_graph_pb_styles.jsx +0 -52
- data/app/pb_kits/playbook/pb_line_graph/docs/_line_graph_pb_styles.md +0 -1
- data/app/pb_kits/playbook/pb_line_graph/lineGraphTheme.ts +0 -110
- data/app/pb_kits/playbook/pb_overlay/docs/_overlay_color.jsx +0 -63
- data/app/pb_kits/playbook/pb_overlay/docs/_overlay_color.md +0 -3
- data/app/pb_kits/playbook/pb_overlay/docs/_overlay_fullscreen_background.jsx +0 -49
- data/app/pb_kits/playbook/pb_overlay/docs/_overlay_fullscreen_background.md +0 -1
- data/app/pb_kits/playbook/pb_overlay/docs/_overlay_fullscreen_opacity.jsx +0 -81
- data/app/pb_kits/playbook/pb_overlay/docs/_overlay_fullscreen_opacity.md +0 -1
- data/app/pb_kits/playbook/pb_overlay/docs/_overlay_gradient_opacity.jsx +0 -39
- data/app/pb_kits/playbook/pb_overlay/docs/_overlay_gradient_opacity.md +0 -1
- data/app/pb_kits/playbook/pb_overlay/docs/_overlay_layout.jsx +0 -40
- data/app/pb_kits/playbook/pb_overlay/docs/_overlay_layout.md +0 -5
- data/app/pb_kits/playbook/pb_phone_number_input/docs/_phone_number_input_country_search.html.erb +0 -10
- data/app/pb_kits/playbook/pb_phone_number_input/docs/_phone_number_input_country_search.jsx +0 -20
- data/app/pb_kits/playbook/pb_phone_number_input/docs/_phone_number_input_country_search.md +0 -1
- data/app/pb_kits/playbook/pb_popover/docs/_popover_append_to.html.erb +0 -46
- data/app/pb_kits/playbook/pb_popover/docs/_popover_append_to.md +0 -1
- data/app/pb_kits/playbook/pb_text_input/docs/_text_input_sanitize.jsx +0 -94
- data/app/pb_kits/playbook/pb_text_input/docs/_text_input_sanitize.md +0 -1
- data/dist/chunks/_typeahead-D8CsVBZO.js +0 -22
- data/dist/chunks/_weekday_stacked-D3oLTSkH.js +0 -45
- data/dist/chunks/lib-BmTAc7Nc.js +0 -29
- /data/app/pb_kits/playbook/pb_draggable/docs/{_draggable_drop_zones_react.md → _draggable_drop_zones.md} +0 -0
- /data/app/pb_kits/playbook/pb_draggable/docs/{_draggable_drop_zones_colors_react.md → _draggable_drop_zones_colors.md} +0 -0
@@ -1,117 +0,0 @@
|
|
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>
|
@@ -1,9 +0,0 @@
|
|
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.
|
@@ -1,43 +0,0 @@
|
|
1
|
-
<% data_shadow = [
|
2
|
-
{ id: "51", text: "Task 1" },
|
3
|
-
{ id: "52", text: "Task 2" },
|
4
|
-
{ id: "53", text: "Task 3" }
|
5
|
-
] %>
|
6
|
-
|
7
|
-
<% data_outline = [
|
8
|
-
{ id: "61", text: "Task 1" },
|
9
|
-
{ id: "62", text: "Task 2" },
|
10
|
-
{ id: "63", text: "Task 3" }
|
11
|
-
] %>
|
12
|
-
|
13
|
-
<%= pb_rails("flex", props: { justify: "around" }) do %>
|
14
|
-
<%= pb_rails("flex/flex_item", props: { margin_right: "xl" }) do %>
|
15
|
-
<%= pb_rails("draggable", props: { drop_zone_type: "shadow", initial_items: data_shadow }) do %>
|
16
|
-
<%= pb_rails("caption", props: { margin_bottom: "xs", text: "Shadow", text_align: "center" }) %>
|
17
|
-
<%= pb_rails("draggable/draggable_container", props: { html_options: { style: { width: "200px" } } }) do %>
|
18
|
-
<% data_shadow.each do |item| %>
|
19
|
-
<%= pb_rails("card", props: { drag_id: item[:id], draggable_item: true, margin_bottom: "xs", padding: "xs", padding_right: "xl" }) do %>
|
20
|
-
<%= pb_rails("flex", props: { align_items: "stretch", flex_direction: "column" }) do %>
|
21
|
-
<%= pb_rails("body", props: { text: item[:text] }) %>
|
22
|
-
<% end %>
|
23
|
-
<% end %>
|
24
|
-
<% end %>
|
25
|
-
<% end %>
|
26
|
-
<% end %>
|
27
|
-
<% end %>
|
28
|
-
|
29
|
-
<%= pb_rails("flex/flex_item", props: { margin_right: "xl" }) do %>
|
30
|
-
<%= pb_rails("draggable", props: { drop_zone_type: "outline", initial_items: data_outline }) do %>
|
31
|
-
<%= pb_rails("caption", props: { margin_bottom: "xs", text: "Outline", text_align: "center" }) %>
|
32
|
-
<%= pb_rails("draggable/draggable_container", props: { html_options: { style: { width: "200px" } } }) do %>
|
33
|
-
<% data_outline.each do |item| %>
|
34
|
-
<%= pb_rails("card", props: { drag_id: item[:id], draggable_item: true, margin_bottom: "xs", padding: "xs", padding_right: "xl" }) do %>
|
35
|
-
<%= pb_rails("flex", props: { align_items: "stretch", flex_direction: "column" }) do %>
|
36
|
-
<%= pb_rails("body", props: { text: item[:text] }) %>
|
37
|
-
<% end %>
|
38
|
-
<% end %>
|
39
|
-
<% end %>
|
40
|
-
<% end %>
|
41
|
-
<% end %>
|
42
|
-
<% end %>
|
43
|
-
<% end %>
|
@@ -1,55 +0,0 @@
|
|
1
|
-
<% initial_items = [
|
2
|
-
{
|
3
|
-
id: "141",
|
4
|
-
url: "https://unsplash.it/500/400/?image=633",
|
5
|
-
},
|
6
|
-
{
|
7
|
-
id: "142",
|
8
|
-
url: "https://unsplash.it/500/400/?image=634",
|
9
|
-
},
|
10
|
-
{
|
11
|
-
id: "143",
|
12
|
-
url: "https://unsplash.it/500/400/?image=637",
|
13
|
-
},
|
14
|
-
] %>
|
15
|
-
|
16
|
-
<% next_init_items = [
|
17
|
-
{
|
18
|
-
id: "151",
|
19
|
-
url: "https://unsplash.it/500/400/?image=633",
|
20
|
-
},
|
21
|
-
{
|
22
|
-
id: "152",
|
23
|
-
url: "https://unsplash.it/500/400/?image=634",
|
24
|
-
},
|
25
|
-
{
|
26
|
-
id: "153",
|
27
|
-
url: "https://unsplash.it/500/400/?image=637",
|
28
|
-
},
|
29
|
-
] %>
|
30
|
-
|
31
|
-
<%= pb_rails("draggable", props: {initial_items: initial_items, drop_zone_type: "shadow", drop_zone_color: "primary"}) do %>
|
32
|
-
<%= pb_rails("draggable/draggable_container") do %>
|
33
|
-
<%= pb_rails("flex", props: { gap: "sm" }) do %>
|
34
|
-
<% initial_items.each do |item| %>
|
35
|
-
<%= pb_rails("draggable/draggable_item", props:{drag_id: item[:id]}) do %>
|
36
|
-
<%= pb_rails("image", props: { alt: item[:id], size: "md", url: item[:url] }) %>
|
37
|
-
<% end %>
|
38
|
-
<% end %>
|
39
|
-
<% end %>
|
40
|
-
<% end %>
|
41
|
-
<% end %>
|
42
|
-
|
43
|
-
<br/>
|
44
|
-
|
45
|
-
<%= pb_rails("draggable", props: {initial_items: next_init_items, drop_zone_type: "outline", drop_zone_color: "purple"}) do %>
|
46
|
-
<%= pb_rails("draggable/draggable_container") do %>
|
47
|
-
<%= pb_rails("flex", props: { gap: "sm" }) do %>
|
48
|
-
<% initial_items.each do |item| %>
|
49
|
-
<%= pb_rails("draggable/draggable_item", props:{drag_id: item[:id]}) do %>
|
50
|
-
<%= pb_rails("image", props: { alt: item[:id], size: "md", url: item[:url] }) %>
|
51
|
-
<% end %>
|
52
|
-
<% end %>
|
53
|
-
<% end %>
|
54
|
-
<% end %>
|
55
|
-
<% end %>
|
@@ -1 +0,0 @@
|
|
1
|
-
The default `color` for Draggable kit drop zones is "neutral", with "primary" or "purple" as additional options.
|
@@ -1,42 +0,0 @@
|
|
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>
|
@@ -1 +0,0 @@
|
|
1
|
-
You can add drag event listeners for `drag`, `dragend`, `dragenter`, `dragleave`, `dragover`, `dragstart`, and `drop`.
|
@@ -1,41 +0,0 @@
|
|
1
|
-
<%=
|
2
|
-
pb_rails("filter", props: {
|
3
|
-
id: "filter_within_trubo_frames",
|
4
|
-
position: "top",
|
5
|
-
filters: [
|
6
|
-
{ name: "name", value: "John Wick" },
|
7
|
-
{ name: "city", value: "San Francisco"}
|
8
|
-
],
|
9
|
-
sort_menu: [
|
10
|
-
{ item: "Popularity", link: "?q[sorts]=managers_popularity+asc", active: true, direction: "desc" },
|
11
|
-
{ item: "Mananger's Title", link: "?q[sorts]=managers_title+asc", active: false },
|
12
|
-
{ item: "Manager's Name", link: "?q[sorts]=managers_name+asc", active: false },
|
13
|
-
],
|
14
|
-
template: "default",
|
15
|
-
results: 1,
|
16
|
-
popover_props: { append_to: "parent" },
|
17
|
-
}) do
|
18
|
-
%>
|
19
|
-
<%
|
20
|
-
example_collection = [
|
21
|
-
OpenStruct.new(name: "USA", value: 1),
|
22
|
-
OpenStruct.new(name: "Canada", value: 2),
|
23
|
-
OpenStruct.new(name: "Brazil", value: 3),
|
24
|
-
OpenStruct.new(name: "Philippines", value: 4),
|
25
|
-
OpenStruct.new(name: "A galaxy far far away, like really far far far far far far far far far far far far far far far far far far far far far far far far far far far far far far far far far far far far far far far far far far far far far far far far away...", value: 5)
|
26
|
-
]
|
27
|
-
%>
|
28
|
-
<%= pb_rails("form", props: { form_system_options: { scope: :example, method: :get } }) do |form| %>
|
29
|
-
<%= form.text_field :example_text_field, props: { label: true } %>
|
30
|
-
<%= form.collection_select :example_collection_select, example_collection, :value, :name, props: {max_width: "sm", label: true } %>
|
31
|
-
|
32
|
-
<%= form.actions do |action| %>
|
33
|
-
<%= action.submit props: {
|
34
|
-
text: "Apply",
|
35
|
-
data: {
|
36
|
-
disable_with: "pb_rails('icon', props: { icon: 'spinner', spin: true, fixed_width: true })Searching...".html_safe
|
37
|
-
},}%>
|
38
|
-
<%= action.button props: { type: "reset", text: "Clear", variant: "secondary" } %>
|
39
|
-
<% end %>
|
40
|
-
<% end %>
|
41
|
-
<% end %>
|
@@ -1 +0,0 @@
|
|
1
|
-
By default, the filter popover attaches to the `<body>`. To attach it elsewhere, like inside a Turbo Frame, pass the `append_to` prop through `popover_props`. Set it to `"parent"` to place the tooltip inside its parent element, or pass any CSS selector (`#id` or `.class`) to specify a custom container.
|
@@ -1,30 +0,0 @@
|
|
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
|
-
series: [{ data: data }],
|
15
|
-
};
|
16
|
-
|
17
|
-
const GaugePbStyles = () => {
|
18
|
-
const options = Highcharts.merge({}, gaugeTheme, baseOptions);
|
19
|
-
|
20
|
-
return (
|
21
|
-
<div>
|
22
|
-
<HighchartsReact
|
23
|
-
highcharts={Highcharts}
|
24
|
-
options={options}
|
25
|
-
/>
|
26
|
-
</div>
|
27
|
-
);
|
28
|
-
};
|
29
|
-
|
30
|
-
export default GaugePbStyles;
|
@@ -1 +0,0 @@
|
|
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,85 +0,0 @@
|
|
1
|
-
import colors from '../tokens/exports/_colors.module.scss'
|
2
|
-
import typography from '../tokens/exports/_typography.module.scss'
|
3
|
-
|
4
|
-
const gaugeTheme = {
|
5
|
-
title: { text: "" },
|
6
|
-
chart: {
|
7
|
-
type: "solidgauge",
|
8
|
-
events: {
|
9
|
-
render() {
|
10
|
-
this.container
|
11
|
-
const arc = this.container.querySelector('path.gauge-pane');
|
12
|
-
if (arc) arc.setAttribute('stroke-linejoin', 'round');
|
13
|
-
}
|
14
|
-
}
|
15
|
-
},
|
16
|
-
pane: {
|
17
|
-
size: "90%",
|
18
|
-
startAngle: -100,
|
19
|
-
endAngle: 100,
|
20
|
-
background: [
|
21
|
-
{
|
22
|
-
borderWidth: 20,
|
23
|
-
innerRadius: "90%",
|
24
|
-
outerRadius: "90%",
|
25
|
-
shape: "arc",
|
26
|
-
className: "gauge-pane",
|
27
|
-
borderColor: colors.border_light,
|
28
|
-
borderRadius: '50%',
|
29
|
-
},
|
30
|
-
],
|
31
|
-
},
|
32
|
-
tooltip: {
|
33
|
-
backgroundColor: {
|
34
|
-
linearGradient: { x1: 0, y1: 0, x2: 0, y2: 1 },
|
35
|
-
stops: [
|
36
|
-
[0, colors.bg_dark],
|
37
|
-
[1, colors.bg_dark],
|
38
|
-
],
|
39
|
-
},
|
40
|
-
pointFormat:
|
41
|
-
'<span style="font-weight: bold; color:{point.color};">●</span>{point.name}: ' +
|
42
|
-
"<b>{point.y}</b>",
|
43
|
-
followPointer: true,
|
44
|
-
shadow: false,
|
45
|
-
borderWidth: 0,
|
46
|
-
borderRadius: 10,
|
47
|
-
style: {
|
48
|
-
fontFamily: typography.font_family_base,
|
49
|
-
color: colors.text_dk_default,
|
50
|
-
fontWeight: typography.regular,
|
51
|
-
fontSize: typography.text_smaller,
|
52
|
-
},
|
53
|
-
},
|
54
|
-
yAxis: {
|
55
|
-
min: 0,
|
56
|
-
max: 100,
|
57
|
-
lineWidth: 0,
|
58
|
-
tickPositions: [] as number[],
|
59
|
-
},
|
60
|
-
plotOptions: {
|
61
|
-
solidgauge: {
|
62
|
-
borderColor: colors.data_1,
|
63
|
-
borderWidth: 20,
|
64
|
-
color: colors.data_1,
|
65
|
-
radius: 90,
|
66
|
-
innerRadius: "90%",
|
67
|
-
y: -26,
|
68
|
-
dataLabels: {
|
69
|
-
borderWidth: 0,
|
70
|
-
color: colors.text_lt_default,
|
71
|
-
enabled: true,
|
72
|
-
format: '<span class="fix">{y:,f}</span>',
|
73
|
-
style: {
|
74
|
-
fontFamily: typography.font_family_base,
|
75
|
-
fontWeight: typography.regular,
|
76
|
-
fontSize: typography.heading_2,
|
77
|
-
},
|
78
|
-
y: -26,
|
79
|
-
},
|
80
|
-
},
|
81
|
-
},
|
82
|
-
credits: { enabled: false }
|
83
|
-
}
|
84
|
-
|
85
|
-
export default gaugeTheme;
|
@@ -1,79 +0,0 @@
|
|
1
|
-
import React from 'react'
|
2
|
-
import classnames from 'classnames'
|
3
|
-
|
4
|
-
import { buildCss } from '../../utilities/props'
|
5
|
-
import { GlobalProps, globalProps, globalInlineProps } from '../../utilities/globalProps'
|
6
|
-
|
7
|
-
import Avatar from "../../pb_avatar/_avatar";
|
8
|
-
import Body from "../../pb_body/_body";
|
9
|
-
import Flex from "../../pb_flex/_flex";
|
10
|
-
import Badge from "../../pb_badge/_badge";
|
11
|
-
import Detail from "../../pb_detail/_detail";
|
12
|
-
import Background from "../../pb_background/_background";
|
13
|
-
|
14
|
-
type LayoutParticipantProps = {
|
15
|
-
className?: string,
|
16
|
-
name?: string,
|
17
|
-
territory?: string,
|
18
|
-
points?: string,
|
19
|
-
rank?: string,
|
20
|
-
avatar?: string,
|
21
|
-
winner?: boolean,
|
22
|
-
self?: boolean,
|
23
|
-
} & GlobalProps
|
24
|
-
|
25
|
-
export const Participant = (props: LayoutParticipantProps) => {
|
26
|
-
const { className, name = 'To be determined...', territory = '', points, rank, avatar, winner, self, hasLastWinnerAndSelf } = props
|
27
|
-
const dynamicInlineProps = globalInlineProps(props)
|
28
|
-
const isLastWinnerAndSelf = hasLastWinnerAndSelf && self && winner
|
29
|
-
const classes = classnames(buildCss('layout_participant', winner ? 'winner' : '', self ? 'self' : '', isLastWinnerAndSelf ? 'last' : ''), globalProps(props), className)
|
30
|
-
return (
|
31
|
-
<Background
|
32
|
-
backgroundColor={winner ? "success_subtle" : "white"}
|
33
|
-
className={classes}
|
34
|
-
padding="xs"
|
35
|
-
style={dynamicInlineProps}
|
36
|
-
>
|
37
|
-
<Flex justify="between">
|
38
|
-
<Avatar
|
39
|
-
imageUrl={avatar}
|
40
|
-
marginRight="sm"
|
41
|
-
name={name}
|
42
|
-
size="sm"
|
43
|
-
/>
|
44
|
-
<Body flexGrow={1}>
|
45
|
-
<Flex justify="between">
|
46
|
-
<Body
|
47
|
-
color={winner && !isLastWinnerAndSelf ? "success" : "default"}
|
48
|
-
truncate={1}
|
49
|
-
>
|
50
|
-
{winner ? <strong>{name}{self ? ' (You)' : ''}</strong> : name + (self && !isLastWinnerAndSelf ? ' (You)' : '')}
|
51
|
-
</Body>
|
52
|
-
<Body
|
53
|
-
color={winner && !isLastWinnerAndSelf ? "success" : "light"}
|
54
|
-
display="flex"
|
55
|
-
>
|
56
|
-
{points && (<>
|
57
|
-
<strong>{points}</strong>
|
58
|
-
<Detail
|
59
|
-
color={winner && !isLastWinnerAndSelf ? "success" : "light"}
|
60
|
-
text="pts"
|
61
|
-
/>
|
62
|
-
</>)}
|
63
|
-
</Body>
|
64
|
-
</Flex>
|
65
|
-
<Body color="light">
|
66
|
-
{territory}
|
67
|
-
|
68
|
-
<Badge
|
69
|
-
text={rank}
|
70
|
-
variant={winner && !isLastWinnerAndSelf ? "success" : self ? "notification" : "neutral"}
|
71
|
-
/>
|
72
|
-
</Body>
|
73
|
-
</Body>
|
74
|
-
</Flex>
|
75
|
-
</Background>
|
76
|
-
)
|
77
|
-
}
|
78
|
-
|
79
|
-
export default Participant
|
@@ -1,52 +0,0 @@
|
|
1
|
-
import React from 'react'
|
2
|
-
import lineGraphTheme from '../lineGraphTheme'
|
3
|
-
import Highcharts from "highcharts"
|
4
|
-
import HighchartsReact from "highcharts-react-official"
|
5
|
-
|
6
|
-
const data = [{
|
7
|
-
name: 'Installation',
|
8
|
-
data: [43934, 52503, 57177, 69658, 97031, 119931, 137133, 154175],
|
9
|
-
}, {
|
10
|
-
name: 'Manufacturing',
|
11
|
-
data: [24916, 24064, 29742, 29851, 32490, 30282, 38121, 40434],
|
12
|
-
}, {
|
13
|
-
name: 'Sales & Distribution',
|
14
|
-
data: [11744, 17722, 16005, 19771, 20185, 24377, 32147, 39387],
|
15
|
-
}, {
|
16
|
-
name: 'Project Development',
|
17
|
-
data: [null, null, 7988, 12169, 15112, 22452, 34400, 34227],
|
18
|
-
}, {
|
19
|
-
name: 'Other',
|
20
|
-
data: [12908, 5948, 8105, 11248, 8989, 11816, 18274, 18111],
|
21
|
-
}]
|
22
|
-
|
23
|
-
const categories = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec']
|
24
|
-
|
25
|
-
const baseOptions = {
|
26
|
-
series: data,
|
27
|
-
title: { text: "Solar Employment Growth by Sector, 2010-2016" },
|
28
|
-
subtitle: { text: "Source: thesolarfoundation.com" },
|
29
|
-
xAxis: {
|
30
|
-
categories: categories,
|
31
|
-
},
|
32
|
-
yAxis: {
|
33
|
-
title: {
|
34
|
-
text: "Number of Employees",
|
35
|
-
},
|
36
|
-
},
|
37
|
-
}
|
38
|
-
|
39
|
-
const LineGraphPbStyles = () => {
|
40
|
-
const options = Highcharts.merge({}, lineGraphTheme, baseOptions)
|
41
|
-
|
42
|
-
return(
|
43
|
-
<div>
|
44
|
-
<HighchartsReact
|
45
|
-
highcharts={Highcharts}
|
46
|
-
options={options}
|
47
|
-
/>
|
48
|
-
</div>
|
49
|
-
)
|
50
|
-
}
|
51
|
-
|
52
|
-
export default LineGraphPbStyles
|
@@ -1 +0,0 @@
|
|
1
|
-
You don't need to use the Line Graph Kit to apply Playbook styles to your Highcharts line graph. Just import lineGraphTheme.ts and merge it with your graph options—Playbook’s styling will apply automatically.
|