diff --git a/docs/app/helpers/components_helper.rb b/docs/app/helpers/components_helper.rb index b82cae818c..16aa828b32 100644 --- a/docs/app/helpers/components_helper.rb +++ b/docs/app/helpers/components_helper.rb @@ -567,7 +567,7 @@ def sage_components }, { title: "modal", - description: "Sage modal", + description: "Modals are overlays used to display content on a layer above the page, preventing users from interacting with content behind the modal.", scss: "done", docs: "done", rails: "doing", diff --git a/docs/app/views/examples/components/modal/_preview.html.erb b/docs/app/views/examples/components/modal/_preview.html.erb index 2b1d93ea0e..016791f13d 100644 --- a/docs/app/views/examples/components/modal/_preview.html.erb +++ b/docs/app/views/examples/components/modal/_preview.html.erb @@ -1,380 +1,765 @@ -<% - sample_body_text = "
Add a description of the content you're showing in the modal.
".html_safe +Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse urna leo, condimentum nec pellentesque finibus, ultricies pulvinar ante. Donec eu interdum ligula. Pellentesque aliquam ullamcorper orci, nec tempor libero tristique in. Aliquam vitae felis at leo condimentum placerat eget id libero. In dictum tortor ac accumsan aliquam. Donec sit amet tortor porttitor, tincidunt nisl at, egestas lacus. Integer metus augue, aliquet accumsan vulputate eget, tristique id erat. Donec a venenatis nibh, ac molestie risus. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia curae; Vivamus in orci vitae ex tempor ultrices in a leo. Sed purus magna, vulputate aliquet ligula eget, consectetur sagittis nunc.
".html_safe -%> -<%= sage_component SagePanelBlock, {} do %> - <%= sage_component SageButtonGroup, { wrap: true, gap: :sm, spacer: { bottom: :sm }} do %> - <%= sage_component SageButton, { - style: "primary", - icon: { name: "launch", style: "right" }, - value: "Basic", - attributes: { - "data-js-modaltrigger": "cool-modal", - } - } %> - <%= sage_component SageButton, { - style: "primary", - icon: { name: "launch", style: "right" }, - value: "Scrollable Content", - attributes: { - "data-js-modaltrigger": "cool-modal-scrolling", - } - } %> - <%= sage_component SageButton, { - style: "primary", - icon: { name: "launch", style: "right" }, - value: "Fullscreen", - attributes: { - "data-js-modaltrigger": "cool-modal-fullscreen", - } - } %> - <%= sage_component SageButton, { - style: "primary", - icon: { name: "launch", style: "right" }, - value: "Destructive", - attributes: { - "data-js-modaltrigger": "cool-modal-destructive", - } - } %> +Add a description of the content you're showing in the modal.
+ + <% content_for :sage_footer do %> + <%= sage_component SageButton, { + style: "secondary", + value: "Cancel", + } %> + <%= sage_component SageButton, { + style: "primary", + value: "Confirm", + } %> + <% end %> <% end %> +<% end %> - <%# Standard Modal %> - <%= sage_component SageModal, { id: "cool-modal", size: "lg" } do %> - <%= sage_component SageModalContent, { - title: "Modal header", - subheader: "This is subheader copy for your viewing pleasure", - } do %> - <% content_for :sage_header_aside do %> - <%= sage_component SageButton, { - style: "secondary", - subtle: true, - value: "Close Modal", - icon: { name: "remove", style: "only" }, - attributes: { "data-js-modal": true } - } %> - <% end %> +<%= sage_component SageDivider, {} %> + +Contain a title, a body of content, and a footer with buttons. The call to action button +in the footer contain error styling to indicate that the action is destructive.
+<%= sage_component SageButton, { + style: "primary", + icon: { name: "launch", style: "right" }, + value: "Destructive", + attributes: { + "data-js-modaltrigger": "cool-modal-destructive", + } +} %> + +<%= sage_component SageModal, { id: "cool-modal-destructive" } do %> + <%= sage_component SageModalContent, { + title: "Delete item", + help_content: "Are you sure you want to delete this item? This action cannot be undone.
", + help_link: { + href: "#", + name: "Link" + } + } do %> + <% content_for :sage_header_aside do %> + <%= sage_component SageButton, { + style: "secondary", + subtle: true, + value: "Close Modal", + icon: { name: "remove", style: "only" }, + attributes: { "data-js-modal": true } + } %> + <% end %> - <%= sample_body_text %> +Are you sure you want to delete this item? This action cannot be undone.
+ + <% content_for :sage_footer do %> + <%= sage_component SageButton, { + style: "secondary", + value: "Cancel", + } %> + <%= sage_component SageButton, { + style: "danger", + icon: { name: "trash", style: "left" }, + value: "Delete", + } %> + <% end %> + <% end %> +<% end %> +<%= sage_component SageDivider, {} %> + +Modals can contain an icon in the header.
+<%= sage_component SageButton, { + style: "primary", + icon: { name: "launch", style: "right" }, + value: "Subheader", + attributes: { + "data-js-modaltrigger": "cool-modal-header-icon", + } +} %> + +<%= sage_component SageModal, {id: "cool-modal-header-icon" } do %> + <%= sage_component SageModalContent, { + header_icon: { + name: "check-circle", + color: "sage-400" + }, + title: "Modal header", + subheader: "This is subheader copy for your viewing pleasure", + } do %> + <% content_for :sage_header_aside do %> + <%= sage_component SageButton, { + style: "secondary", + subtle: true, + value: "Close Modal", + icon: { name: "remove", style: "only" }, + attributes: { "data-js-modal": true } + } %> + <% end %> - <% content_for :sage_footer do %> - <% content_for :sage_footer_aside do %> - <%= sage_component SageButton, { - style: "secondary", - subtle: true, - value: "Link", - attributes: { "data-js-modal": true } - } %> - <% end %> - <%= sage_component SageButton, { - style: "secondary", - value: "Cancel", - } %> - <%= sage_component SageButton, { - style: "primary", - value: "Confirm", - } %> - <% end %> +Add a description of the content you're showing in the modal.
+ + <% content_for :sage_footer do %> + <%= sage_component SageButton, { + style: "secondary", + value: "Cancel", + } %> + <%= sage_component SageButton, { + style: "primary", + value: "Confirm", + } %> <% end %> <% end %> +<% end %> - <%# Standard Modal with Scrolling %> - <%= sage_component SageModal, { allow_scroll: true, id: "cool-modal-scrolling" } do %> - <%= sage_component SageModalContent, { - title: "Modal header", - subheader: "This is subheader copy for your viewing pleasure", - } do %> - <% content_for :sage_header_aside do %> - <%= sage_component SageButton, { - style: "secondary", - subtle: true, - value: "Close Modal", - icon: { name: "remove", style: "only" }, - attributes: { "data-js-modal": true } - } %> - <% end %> +<%= sage_component SageDivider, {} %> + +Modals can contain a thumbnail image in the header.
+<%= sage_component SageButton, { + style: "primary", + icon: { name: "launch", style: "right" }, + value: "Subheader", + attributes: { + "data-js-modaltrigger": "cool-modal-header-image", + } +} %> +<%= sage_component SageModal, {id: "cool-modal-header-image" } do %> + <%= sage_component SageModalContent, { + header_image: "avatar/joshua_wilson.png", + title: "Modal header", + subheader: "This is subheader copy for your viewing pleasure", + } do %> + <% content_for :sage_header_aside do %> + <%= sage_component SageButton, { + style: "secondary", + subtle: true, + value: "Close Modal", + icon: { name: "remove", style: "only" }, + attributes: { "data-js-modal": true } + } %> + <% end %> - <%= long_sample_text %> - <%= long_sample_text %> - <%= long_sample_text %> - <%= long_sample_text %> +Add a description of the content you're showing in the modal.
+ + <% content_for :sage_footer do %> + <%= sage_component SageButton, { + style: "secondary", + value: "Cancel", + } %> + <%= sage_component SageButton, { + style: "primary", + value: "Confirm", + } %> + <% end %> + <% end %> +<% end %> - <% content_for :sage_footer do %> - <% content_for :sage_footer_aside do %> - <%= sage_component SageButton, { - style: "secondary", - subtle: true, - value: "Link", - attributes: { "data-js-modal": true } - } %> - <% end %> - <%= sage_component SageButton, { - style: "secondary", - value: "Cancel", - } %> - <%= sage_component SageButton, { - style: "primary", - value: "Confirm", - } %> - <% end %> +<%= sage_component SageDivider, {} %> + +Modals can contain a subheader.
+<%= sage_component SageButton, { + style: "primary", + icon: { name: "launch", style: "right" }, + value: "Subheader", + attributes: { + "data-js-modaltrigger": "cool-modal-subheader", + } +} %> + +<%= sage_component SageModal, { allow_scroll: true, id: "cool-modal-subheader" } do %> + <%= sage_component SageModalContent, { + title: "Modal header", + subheader: "This is subheader copy for your viewing pleasure", + } do %> + <% content_for :sage_header_aside do %> + <%= sage_component SageButton, { + style: "secondary", + subtle: true, + value: "Close Modal", + icon: { name: "remove", style: "only" }, + attributes: { "data-js-modal": true } + } %> + <% end %> + +Add a description of the content you're showing in the modal.
+ + <% content_for :sage_footer do %> + <%= sage_component SageButton, { + style: "secondary", + value: "Cancel", + } %> + <%= sage_component SageButton, { + style: "primary", + value: "Confirm", + } %> <% end %> <% end %> +<% end %> - <%# Fullscreen Modal %> - <%= sage_component SageModal, { - id: "cool-modal-fullscreen", - fullscreen: true +<%= sage_component SageDivider, {} %> + +Modals contain a footer that can contain buttons and links
+<%= sage_component SageButton, { + style: "primary", + icon: { name: "launch", style: "right" }, + value: "Footer", + attributes: { + "data-js-modaltrigger": "cool-modal-footer", + } +} %> + +<%= sage_component SageModal, { id: "cool-modal-footer" } do %> + <%= sage_component SageModalContent, { + title: "Modal Header", + help_content: "Add a description of the content you're showing in the modal.
", + help_link: { + href: "#", + name: "Link" + } } do %> - <%= sage_component SageModalContent, { - title: "Modal header" - } do %> - <% content_for :sage_header_aside do %> + <% content_for :sage_header_aside do %> + <%= sage_component SageButton, { + style: "secondary", + subtle: true, + value: "Close Modal", + icon: { name: "remove", style: "only" }, + attributes: { "data-js-modal": true } + } %> + <% end %> + +Add a description of the content you're showing in the modal.
+ + <% content_for :sage_footer do %> + <% content_for :sage_footer_aside do %> <%= sage_component SageButton, { style: "secondary", subtle: true, - value: "Close Modal", - icon: { name: "remove", style: "only" }, + value: "Link", attributes: { "data-js-modal": true } } %> <% end %> - - <%= sample_body_text %> + <%= sage_component SageButton, { + style: "secondary", + value: "Cancel", + } %> + <%= sage_component SageButton, { + style: "primary", + value: "Confirm", + } %> <% end %> <% end %> +<% end %> - <%# Destructive Modal %> - <%= sage_component SageModal, { id: "cool-modal-destructive" } do %> - <%= sage_component SageModalContent, { - title: "Delete item", - help_content: "Are you sure you want to delete this item? This action cannot be undone.
", - help_link: { - href: "#", - name: "Link" - } - } do %> - <% content_for :sage_header_aside do %> +<%= sage_component SageDivider, {} %> + +The footer aside is a section of the footer that can contain additional buttons or links.
+<%= sage_component SageButton, { + style: "primary", + icon: { name: "launch", style: "right" }, + value: "Footer Aside", + attributes: { + "data-js-modaltrigger": "cool-modal-footer-aside", + } +} %> + +<%= sage_component SageModal, { id: "cool-modal-footer-aside" } do %> + <%= sage_component SageModalContent, { + title: "Modal Header", + help_content: "Add a description of the content you're showing in the modal.
", + help_link: { + href: "#", + name: "Link" + } + } do %> + <% content_for :sage_header_aside do %> + <%= sage_component SageButton, { + style: "secondary", + subtle: true, + value: "Close Modal", + icon: { name: "remove", style: "only" }, + attributes: { "data-js-modal": true } + } %> + <% end %> + +Add a description of the content you're showing in the modal.
+ + <% content_for :sage_footer do %> + <% content_for :sage_footer_aside do %> <%= sage_component SageButton, { style: "secondary", subtle: true, - value: "Close Modal", - icon: { name: "remove", style: "only" }, + value: "Link", attributes: { "data-js-modal": true } } %> <% end %> + <%= sage_component SageButton, { + style: "secondary", + value: "Cancel", + } %> + <%= sage_component SageButton, { + style: "primary", + value: "Confirm", + } %> + <% end %> + <% end %> +<% end %> -Are you sure you want to delete this item? This action cannot be undone.
+<%= sage_component SageDivider, {} %> + +Modals can be configured to allow scrolling of content. This option is useful when the header and footer needs to visible contain actions.
+<%= sage_component SageButton, { + style: "primary", + icon: { name: "launch", style: "right" }, + value: "Scrollable Content", + attributes: { + "data-js-modaltrigger": "cool-modal-scrolling", + } +} %> + +<%= sage_component SageModal, { allow_scroll: true, id: "cool-modal-scrolling" } do %> + <%= sage_component SageModalContent, { + title: "Modal header", + } do %> + <% content_for :sage_header_aside do %> + <%= sage_component SageButton, { + style: "secondary", + subtle: true, + value: "Close Modal", + icon: { name: "remove", style: "only" }, + attributes: { "data-js-modal": true } + } %> + <% end %> - <% content_for :sage_footer do %> - <% content_for :sage_footer_aside do %> - <%= sage_component SageButton, { - style: "secondary", - subtle: true, - value: "Link", - attributes: { "data-js-modal": true } - } %> - <% end %> - <%= sage_component SageButton, { - style: "secondary", - value: "Cancel", - } %> - <%= sage_component SageButton, { - style: "danger", - icon: { name: "trash", style: "left" }, - value: "Delete", - } %> - <% end %> +Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse urna leo, condimentum nec pellentesque finibus, ultricies pulvinar ante. Donec eu interdum ligula. Pellentesque aliquam ullamcorper orci, nec tempor libero tristique in. Aliquam vitae felis at leo condimentum placerat eget id libero. In dictum tortor ac accumsan aliquam. Donec sit amet tortor porttitor, tincidunt nisl at, egestas lacus. Integer metus augue, aliquet accumsan vulputate eget, tristique id erat. Donec a venenatis nibh, ac molestie risus. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia curae; Vivamus in orci vitae ex tempor ultrices in a leo. Sed purus magna, vulputate aliquet ligula eget, consectetur sagittis nunc.
+Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse urna leo, condimentum nec pellentesque finibus, ultricies pulvinar ante. Donec eu interdum ligula. Pellentesque aliquam ullamcorper orci, nec tempor libero tristique in. Aliquam vitae felis at leo condimentum placerat eget id libero. In dictum tortor ac accumsan aliquam. Donec sit amet tortor porttitor, tincidunt nisl at, egestas lacus. Integer metus augue, aliquet accumsan vulputate eget, tristique id erat. Donec a venenatis nibh, ac molestie risus. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia curae; Vivamus in orci vitae ex tempor ultrices in a leo. Sed purus magna, vulputate aliquet ligula eget, consectetur sagittis nunc.
+Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse urna leo, condimentum nec pellentesque finibus, ultricies pulvinar ante. Donec eu interdum ligula. Pellentesque aliquam ullamcorper orci, nec tempor libero tristique in. Aliquam vitae felis at leo condimentum placerat eget id libero. In dictum tortor ac accumsan aliquam. Donec sit amet tortor porttitor, tincidunt nisl at, egestas lacus. Integer metus augue, aliquet accumsan vulputate eget, tristique id erat. Donec a venenatis nibh, ac molestie risus. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia curae; Vivamus in orci vitae ex tempor ultrices in a leo. Sed purus magna, vulputate aliquet ligula eget, consectetur sagittis nunc.
+Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse urna leo, condimentum nec pellentesque finibus, ultricies pulvinar ante. Donec eu interdum ligula. Pellentesque aliquam ullamcorper orci, nec tempor libero tristique in. Aliquam vitae felis at leo condimentum placerat eget id libero. In dictum tortor ac accumsan aliquam. Donec sit amet tortor porttitor, tincidunt nisl at, egestas lacus. Integer metus augue, aliquet accumsan vulputate eget, tristique id erat. Donec a venenatis nibh, ac molestie risus. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia curae; Vivamus in orci vitae ex tempor ultrices in a leo. Sed purus magna, vulputate aliquet ligula eget, consectetur sagittis nunc.
+ + <% content_for :sage_footer do %> + <%= sage_component SageButton, { + style: "secondary", + value: "Cancel", + } %> + <%= sage_component SageButton, { + style: "primary", + value: "Confirm", + } %> <% end %> <% end %> <% end %> -<%= sage_component SagePanelBlock, {} do %> -Modal widths can be configured to be extra small, small, medium, or large.
+<%= sage_component SageButtonGroup, { gap: :sm, spacer: { bottom: :sm }} do %> + <%= sage_component SageButton, { + style: "primary", + icon: { name: "launch", style: "right" }, + value: "Size xs", + attributes: { + "data-js-modaltrigger": "cool-modal-size-xs", + } + } %> + <%= sage_component SageButton, { + style: "primary", + icon: { name: "launch", style: "right" }, + value: "Size sm", + attributes: { + "data-js-modaltrigger": "cool-modal-size-sm", + } + } %> + <%= sage_component SageButton, { + style: "primary", + icon: { name: "launch", style: "right" }, + value: "Size md", + attributes: { + "data-js-modaltrigger": "cool-modal-size-md", + } + } %> + <%= sage_component SageButton, { + style: "primary", + icon: { name: "launch", style: "right" }, + value: "Size lg", + attributes: { + "data-js-modaltrigger": "cool-modal-size-lg", + } + } %> +<% end %> + +<%= sage_component SageModal, { id: "cool-modal-size-xs", size: "xs"} do %> + <%= sage_component SageModalContent, { + title: "Modal title", + } do %> + <% content_for :sage_header_aside do %> + <%= sage_component SageButton, { + style: "secondary", + subtle: true, + value: "Close Modal", + icon: { name: "remove", style: "only" }, + attributes: { "data-js-modal": true } + } %> + <% end %> + +Add a description of the content you're showing in the modal.
+ + <% content_for :sage_footer do %> + <%= sage_component SageButton, { + style: "secondary", + value: "Cancel", + } %> + <%= sage_component SageButton, { + style: "primary", + value: "Confirm", + } %> + <% end %> <% end %> +<% end %> - <%# Animated Modals %> - <%= sage_component SageModal, { id: "cool-modal-animate-default", animate: true, css_classes: "custom-class-name-here" } do %> - <%= sage_component SageModalContent, { title: "Modal header" } do %> - <% content_for :sage_header_aside do %> - <%= sage_component SageButton, { - style: "secondary", - subtle: true, - value: "Close Modal", - icon: { name: "remove", style: "only" }, - attributes: { "data-js-modal": true } - } %> - <% end %> +<%= sage_component SageModal, { id: "cool-modal-size-sm", size: "sm"} do %> + <%= sage_component SageModalContent, { + title: "Modal title", + } do %> + <% content_for :sage_header_aside do %> + <%= sage_component SageButton, { + style: "secondary", + subtle: true, + value: "Close Modal", + icon: { name: "remove", style: "only" }, + attributes: { "data-js-modal": true } + } %> + <% end %> + +Add a description of the content you're showing in the modal.
+ + <% content_for :sage_footer do %> + <%= sage_component SageButton, { + style: "secondary", + value: "Cancel", + } %> + <%= sage_component SageButton, { + style: "primary", + value: "Confirm", + } %> + <% end %> + <% end %> +<% end %> - <%= sample_body_text %> +<%= sage_component SageModal, { id: "cool-modal-size-md", size: "md"} do %> + <%= sage_component SageModalContent, { + title: "Modal title", + } do %> + <% content_for :sage_header_aside do %> + <%= sage_component SageButton, { + style: "secondary", + subtle: true, + value: "Close Modal", + icon: { name: "remove", style: "only" }, + attributes: { "data-js-modal": true } + } %> + <% end %> - <% content_for :sage_footer do %> - <% content_for :sage_footer_aside do %> - <%= sage_component SageButton, { - style: "secondary", - subtle: true, - value: "Close Modal", - attributes: { "data-js-modal": true } - } %> - <% end %> - <%= sage_component SageButton, { - style: "primary", - value: "Confirm", - } %> - <% end %> +Add a description of the content you're showing in the modal.
+ + <% content_for :sage_footer do %> + <%= sage_component SageButton, { + style: "secondary", + value: "Cancel", + } %> + <%= sage_component SageButton, { + style: "primary", + value: "Confirm", + } %> <% end %> <% end %> +<% end %> - <%= sage_component SageModal, { id: "cool-modal-animate-top", animate: { direction: "top" } } do %> - <%= sage_component SageModalContent, { title: "Modal header" } do %> - <% content_for :sage_header_aside do %> - <%= sage_component SageButton, { - style: "secondary", - subtle: true, - value: "Close Modal", - icon: { name: "remove", style: "only" }, - attributes: { "data-js-modal": true } - } %> - <% end %> +<%= sage_component SageModal, { id: "cool-modal-size-lg", size: "lg"} do %> + <%= sage_component SageModalContent, { + title: "Modal title", + } do %> + <% content_for :sage_header_aside do %> + <%= sage_component SageButton, { + style: "secondary", + subtle: true, + value: "Close Modal", + icon: { name: "remove", style: "only" }, + attributes: { "data-js-modal": true } + } %> + <% end %> - <%= sample_body_text %> +Add a description of the content you're showing in the modal.
+ + <% content_for :sage_footer do %> + <%= sage_component SageButton, { + style: "secondary", + value: "Cancel", + } %> + <%= sage_component SageButton, { + style: "primary", + value: "Confirm", + } %> + <% end %> + <% end %> +<% end %> - <% content_for :sage_footer do %> - <% content_for :sage_footer_aside do %> - <%= sage_component SageButton, { - style: "secondary", - subtle: true, - value: "Link", - attributes: { "data-js-modal": true } - } %> - <% end %> - <%= sage_component SageButton, { - style: "primary", - value: "Confirm", - } %> - <% end %> +<%= sage_component SageDivider, {} %> + +Modals can be configured to take up the full screen.
+<%= sage_component SageButton, { + style: "primary", + icon: { name: "launch", style: "right" }, + value: "Fullscreen", + attributes: { + "data-js-modaltrigger": "cool-modal-fullscreen", + } +} %> + +<%= sage_component SageModal, { + id: "cool-modal-fullscreen", + fullscreen: true +} do %> + <%= sage_component SageModalContent, { + title: "Modal header" + } do %> + <% content_for :sage_header_aside do %> + <%= sage_component SageButton, { + style: "secondary", + subtle: true, + value: "Close Modal", + icon: { name: "remove", style: "only" }, + attributes: { "data-js-modal": true } + } %> <% end %> + +Add a description of the content you're showing in the modal.
<% end %> +<% end %> - <%= sage_component SageModal, { id: "cool-modal-animate-left", disable_background_blur: true, animate: { direction: "left" } } do %> - <%= sage_component SageModalContent, { title: "Modal header" } do %> - <% content_for :sage_header_aside do %> +<%= sage_component SageDivider, {} %> + +Modals can be configured to animate in from the top, left, or right.
+<%= sage_component SageButtonGroup, { gap: :sm, spacer: { bottom: :sm }} do %> + <%= sage_component SageButton, { + style: "primary", + icon: { name: "launch", style: "right" }, + value: "Default", + attributes: { + "data-js-modaltrigger": "cool-modal-animate-default", + } + } %> + <%= sage_component SageButton, { + style: "primary", + icon: { name: "launch", style: "right" }, + value: "To top", + attributes: { + "data-js-modaltrigger": "cool-modal-animate-top", + } + } %> + <%= sage_component SageButton, { + style: "primary", + icon: { name: "launch", style: "right" }, + value: "To left (blur off)", + attributes: { + "data-js-modaltrigger": "cool-modal-animate-left", + } + } %> + <%= sage_component SageButton, { + style: "primary", + icon: { name: "launch", style: "right" }, + value: "To right (blur off)", + attributes: { + "data-js-modaltrigger": "cool-modal-animate-right", + } + } %> +<% end %> + +<%# Animated Modals %> +<%= sage_component SageModal, { id: "cool-modal-animate-default", animate: true, css_classes: "custom-class-name-here" } do %> + <%= sage_component SageModalContent, { title: "Modal header" } do %> + <% content_for :sage_header_aside do %> + <%= sage_component SageButton, { + style: "secondary", + subtle: true, + value: "Close Modal", + icon: { name: "remove", style: "only" }, + attributes: { "data-js-modal": true } + } %> + <% end %> + +Add a description of the content you're showing in the modal.
+ + <% content_for :sage_footer do %> + <% content_for :sage_footer_aside do %> <%= sage_component SageButton, { style: "secondary", subtle: true, value: "Close Modal", - icon: { name: "remove", style: "only" }, attributes: { "data-js-modal": true } } %> <% end %> + <%= sage_component SageButton, { + style: "primary", + value: "Confirm", + } %> + <% end %> + <% end %> +<% end %> - <%= sample_body_text %> +<%= sage_component SageModal, { id: "cool-modal-animate-top", animate: { direction: "top" } } do %> + <%= sage_component SageModalContent, { title: "Modal header" } do %> + <% content_for :sage_header_aside do %> + <%= sage_component SageButton, { + style: "secondary", + subtle: true, + value: "Close Modal", + icon: { name: "remove", style: "only" }, + attributes: { "data-js-modal": true } + } %> + <% end %> - <% content_for :sage_footer do %> - <% content_for :sage_footer_aside do %> - <%= sage_component SageButton, { - style: "secondary", - subtle: true, - value: "Link", - attributes: { "data-js-modal": true } - } %> - <% end %> +Add a description of the content you're showing in the modal.
+ + <% content_for :sage_footer do %> + <% content_for :sage_footer_aside do %> <%= sage_component SageButton, { - style: "primary", - value: "Confirm", + style: "secondary", + subtle: true, + value: "Link", + attributes: { "data-js-modal": true } } %> <% end %> + <%= sage_component SageButton, { + style: "primary", + value: "Confirm", + } %> <% end %> <% end %> +<% end %> - <%= sage_component SageModal, { id: "cool-modal-animate-right", disable_background_blur: true, animate: { direction: "right" } } do %> - <%= sage_component SageModalContent, { title: "Modal header" } do %> - <% content_for :sage_header_aside do %> +<%= sage_component SageModal, { id: "cool-modal-animate-left", disable_background_blur: true, animate: { direction: "left" } } do %> + <%= sage_component SageModalContent, { title: "Modal header" } do %> + <% content_for :sage_header_aside do %> + <%= sage_component SageButton, { + style: "secondary", + subtle: true, + value: "Close Modal", + icon: { name: "remove", style: "only" }, + attributes: { "data-js-modal": true } + } %> + <% end %> + +Add a description of the content you're showing in the modal.
+ + <% content_for :sage_footer do %> + <% content_for :sage_footer_aside do %> <%= sage_component SageButton, { style: "secondary", subtle: true, - value: "Close Modal", - icon: { name: "remove", style: "only" }, + value: "Link", attributes: { "data-js-modal": true } } %> <% end %> + <%= sage_component SageButton, { + style: "primary", + value: "Confirm", + } %> + <% end %> + <% end %> +<% end %> - <%= sample_body_text %> +<%= sage_component SageModal, { id: "cool-modal-animate-right", disable_background_blur: true, animate: { direction: "right" } } do %> + <%= sage_component SageModalContent, { title: "Modal header" } do %> + <% content_for :sage_header_aside do %> + <%= sage_component SageButton, { + style: "secondary", + subtle: true, + value: "Close Modal", + icon: { name: "remove", style: "only" }, + attributes: { "data-js-modal": true } + } %> + <% end %> - <% content_for :sage_footer do %> - <% content_for :sage_footer_aside do %> - <%= sage_component SageButton, { - style: "secondary", - subtle: true, - value: "Link", - attributes: { "data-js-modal": true } - } %> - <% end %> +Add a description of the content you're showing in the modal.
+ + <% content_for :sage_footer do %> + <% content_for :sage_footer_aside do %> <%= sage_component SageButton, { - style: "primary", - icon: { name: "check", style: "left" }, - value: "Confirm" + style: "secondary", + subtle: true, + value: "Link", + attributes: { "data-js-modal": true } } %> <% end %> + <%= sage_component SageButton, { + style: "primary", + icon: { name: "check", style: "left" }, + value: "Confirm" + } %> <% end %> <% end %> <% end %> +<%= sage_component SageDivider, {} %> + <%= md(" -remote_url
prop usage on SageModal
data-js-remote-url
key within html_attributes
.
+ The value of the async_path()
equals the all content in this path residing within SageModalContent
Add a description of the content you're showing in the modal.
<% content_for :sage_footer do %> <% content_for :sage_footer_aside do %> @@ -515,7 +900,7 @@ As shown elsewhere on this page default content (such as `SageLoader`) can also } %> <% end %> - <%= sample_body_text %> +Add a description of the content you're showing in the modal.
<% content_for :sage_footer do %> <% content_for :sage_footer_aside do %> @@ -547,7 +932,7 @@ As shown elsewhere on this page default content (such as `SageLoader`) can also } %> <% end %> - <%= sample_body_text %> +Add a description of the content you're showing in the modal.
<% content_for :sage_footer do %> <% content_for :sage_footer_aside do %> @@ -579,7 +964,7 @@ As shown elsewhere on this page default content (such as `SageLoader`) can also } %> <% end %> - <%= sample_body_text %> +Add a description of the content you're showing in the modal.
<% content_for :sage_footer do %> <% content_for :sage_footer_aside do %>