@@ -19,19 +19,6 @@ def default
1919 end
2020 end
2121
22- # @label With confirmation check box
23- # @snapshot interactive
24- def with_confirmation_check_box
25- render ( Primer ::OpenProject ::DangerDialog . new ( title : "Delete dialog" ) ) do |dialog |
26- dialog . with_show_button { "Click me" }
27- dialog . with_confirmation_message do |message |
28- message . with_heading ( tag : :h2 ) { "Permanently delete this item?" }
29- message . with_description_content ( "This action is not reversible. Please proceed with caution." )
30- end
31- dialog . with_confirmation_check_box_content ( "I understand that this deletion cannot be reversed" )
32- end
33- end
34-
3522 # @label Playground
3623 # @param icon [Symbol] octicon
3724 # @param icon_color [Symbol] select [default, muted, subtle, accent, success, attention, severe, danger, open, closed, done, sponsors, on_emphasis, inherit]
@@ -68,6 +55,19 @@ def playground(
6855 )
6956 end
7057
58+ # @label With confirmation check box
59+ # @snapshot interactive
60+ def with_confirmation_check_box
61+ render ( Primer ::OpenProject ::DangerDialog . new ( title : "Delete dialog" ) ) do |dialog |
62+ dialog . with_show_button { "Click me" }
63+ dialog . with_confirmation_message do |message |
64+ message . with_heading ( tag : :h2 ) { "Permanently delete this item?" }
65+ message . with_description_content ( "This action is not reversible. Please proceed with caution." )
66+ end
67+ dialog . with_confirmation_check_box_content ( "I understand that this deletion cannot be reversed" )
68+ end
69+ end
70+
7171 # @label With form using FormBuilder
7272 def with_form_builder_form ( route_format : :html )
7373 render_with_template ( locals : { route_format : route_format } )
@@ -106,23 +106,6 @@ def with_form_builder_form_test(route_format: :html)
106106 def with_form_test ( route_format : :html )
107107 render_with_template ( locals : { route_format : route_format } )
108108 end
109-
110- # @label With confirmation checkbox and custom live messages
111- # @snapshot interactive
112- def with_confirmation_check_box_and_live_messages
113- render ( Primer ::OpenProject ::DangerDialog . new (
114- title : "Delete dialog" ,
115- confirmation_live_message_checked : "You checked the box — deletion is now possible." ,
116- confirmation_live_message_unchecked : "You must check the box to enable deletion."
117- ) ) do |dialog |
118- dialog . with_show_button { "Click me" }
119- dialog . with_confirmation_message do |message |
120- message . with_heading ( tag : :h2 ) { "Permanently delete this item?" }
121- message . with_description_content ( "This action is irreversible. Proceed with caution." )
122- end
123- dialog . with_confirmation_check_box_content ( "I understand that this deletion cannot be reversed" )
124- end
125- end
126109 end
127110 end
128111end
0 commit comments