playbook_ui_docs 14.17.0.pre.alpha.PLAY2035dialogkitturbocustomprop7297 → 14.17.0.pre.alpha.PLAY2040removeunnecessarystickytableclasses7300

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.
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: playbook_ui_docs
3
3
  version: !ruby/object:Gem::Version
4
- version: 14.17.0.pre.alpha.PLAY2035dialogkitturbocustomprop7297
4
+ version: 14.17.0.pre.alpha.PLAY2040removeunnecessarystickytableclasses7300
5
5
  platform: ruby
6
6
  authors:
7
7
  - Power UX
@@ -708,8 +708,6 @@ files:
708
708
  - app/pb_kits/playbook/pb_dialog/docs/_dialog_status.jsx
709
709
  - app/pb_kits/playbook/pb_dialog/docs/_dialog_status.md
710
710
  - app/pb_kits/playbook/pb_dialog/docs/_dialog_status_swift.md
711
- - app/pb_kits/playbook/pb_dialog/docs/_dialog_turbo_frames.html.erb
712
- - app/pb_kits/playbook/pb_dialog/docs/_dialog_turbo_frames_rails.md
713
711
  - app/pb_kits/playbook/pb_dialog/docs/example.yml
714
712
  - app/pb_kits/playbook/pb_dialog/docs/index.js
715
713
  - app/pb_kits/playbook/pb_distribution_bar/docs/_description.md
@@ -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.