forked from ccdcoe/Providentia
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* fix search and modal components
- Loading branch information
Showing
8 changed files
with
59 additions
and
67 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,28 @@ | ||
.contents{data: {controller: 'modal'}} | ||
.contents{data: {controller: 'modal', action: 'keydown.esc->modal#close'}} | ||
= content | ||
|
||
.font-raleway.hidden.animated.fadeIn.fixed.inset-0.overflow-y-auto.flex.items-center.justify-center.z-50{data: {action: 'click->modal#closeBackground keyup@window->modal#closeWithKeyboard', "modal-target" => 'container'}} | ||
.relative{class: size_classes} | ||
- if @only_body | ||
= body | ||
- else | ||
/ Modal content | ||
.relative.bg-white.rounded-lg.shadow.dark:bg-gray-700.flex.flex-col{class: content_classes} | ||
/ Modal header | ||
.flex.justify-between.items-start.p-4.rounded-t.border-b.dark:border-gray-600 | ||
- if @header | ||
%h3.text-xl.font-semibold.text-gray-900.dark:text-white= @header | ||
%button.text-gray-400.bg-transparent.hover:bg-gray-200.hover:text-gray-900.rounded-lg.text-sm.ml-auto.inline-flex.items-center.dark:hover:bg-gray-600.dark:hover:text-white{:class => "p-1.5", "data-action" => "click->modal#close", :type => "button"} | ||
%svg.w-5.h-5{:fill => "currentColor", :viewbox => "0 0 20 20", :xmlns => "http://www.w3.org/2000/svg"} | ||
%path{"clip-rule" => "evenodd", :d => "M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z", "fill-rule" => "evenodd"} | ||
/ Modal body | ||
.p-6.space-y-6{class: content_classes}= body | ||
.hidden.fixed.inset-0.z-40.overflow-y-auto.flex.items-center.justify-center{"class" => "bg-gray-900/50 dark:bg-gray-900/80","data-action" => "click->modal#closeBackground", "data-modal-target" => "background", "data-transition-enter" => "transition-all ease-in-out duration-300", "data-transition-enter-from" => "bg-opacity-0", "data-transition-enter-to" => "bg-opacity-80", "data-transition-leave" => "transition-all ease-in-out duration-300", "data-transition-leave-from" => "bg-opacity-80", "data-transition-leave-to" => "bg-opacity-0"} | ||
|
||
-# / Modal footer | ||
-# .flex.items-center.p-6.space-x-2.rounded-b.border-t.border-gray-200.dark:border-gray-600 | ||
-# %button.text-white.bg-blue-700.hover:bg-blue-800.focus:ring-4.focus:outline-none.focus:ring-blue-300.rounded-lg.text-sm.px-5.text-center.dark:bg-blue-600.dark:hover:bg-blue-700.dark:focus:ring-blue-800{:class => "py-2.5", "data-modal-target" => "trigger", :type => "button"} | ||
-# I accept | ||
-# %button.text-gray-500.bg-white.hover:bg-gray-100.focus:ring-4.focus:outline-none.focus:ring-blue-300.rounded-lg.border.border-gray-200.text-sm.px-5.hover:text-gray-900.focus:z-10.dark:bg-gray-700.dark:text-gray-300.dark:border-gray-500.dark:hover:text-white.dark:hover:bg-gray-600.dark:focus:ring-gray-600{:class => "py-2.5", "data-modal-target" => "trigger", :type => "button"} | ||
-# Decline | ||
.max-h-screen.w-full.max-w-5xl.relative{data: {"modal-target" => 'container'}} | ||
.font-raleway.relative{class: size_classes} | ||
- if @only_body | ||
= body | ||
- else | ||
/ Modal content | ||
.relative.bg-white.rounded-lg.shadow.dark:bg-gray-700.flex.flex-col{class: content_classes} | ||
/ Modal header | ||
.flex.justify-between.items-start.p-4.rounded-t.border-b.dark:border-gray-600 | ||
- if @header | ||
%h3.text-xl.font-semibold.text-gray-900.dark:text-white= @header | ||
%button.text-gray-400.bg-transparent.hover:bg-gray-200.hover:text-gray-900.rounded-lg.text-sm.ml-auto.inline-flex.items-center.dark:hover:bg-gray-600.dark:hover:text-white{:class => "p-1.5", "data-action" => "click->modal#close", :type => "button"} | ||
%svg.w-5.h-5{:fill => "currentColor", :viewbox => "0 0 20 20", :xmlns => "http://www.w3.org/2000/svg"} | ||
%path{"clip-rule" => "evenodd", :d => "M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z", "fill-rule" => "evenodd"} | ||
/ Modal body | ||
.p-6.space-y-6{class: content_classes}= body | ||
-# / Modal footer | ||
-# .flex.items-center.p-6.space-x-2.rounded-b.border-t.border-gray-200.dark:border-gray-600 | ||
-# %button.text-white.bg-blue-700.hover:bg-blue-800.focus:ring-4.focus:outline-none.focus:ring-blue-300.rounded-lg.text-sm.px-5.text-center.dark:bg-blue-600.dark:hover:bg-blue-700.dark:focus:ring-blue-800{:class => "py-2.5", "data-modal-target" => "trigger", :type => "button"} | ||
-# I accept | ||
-# %button.text-gray-500.bg-white.hover:bg-gray-100.focus:ring-4.focus:outline-none.focus:ring-blue-300.rounded-lg.border.border-gray-200.text-sm.px-5.hover:text-gray-900.focus:z-10.dark:bg-gray-700.dark:text-gray-300.dark:border-gray-500.dark:hover:text-white.dark:hover:bg-gray-600.dark:focus:ring-gray-600{:class => "py-2.5", "data-modal-target" => "trigger", :type => "button"} | ||
-# Decline |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
21 changes: 11 additions & 10 deletions
21
app/components/search_component/search_component.html.haml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,12 @@ | ||
.font-raleway.hidden.animated.fadeIn.fixed.inset-0.overflow-y-auto.flex.items-center.justify-center.z-50{data_tags} | ||
.bg-white.overflow-auto.max-w-2xl.w-full.max-h-full.rounded.shadow-lg | ||
= form_with(url: search_path, class: 'border-b border-gray-200', data: {search_target: 'form'}) do |f| | ||
.relative | ||
= f.text_field :query, class: query_classes, data: query_data, type: 'search' | ||
%button.absolute.inset-0.right-auto.group{"aria-label" => "Search", :type => "submit"} | ||
%svg.w-4.h-4.flex-shrink-0.fill-current.text-gray-400.group-hover:text-gray-500.ml-4.mr-2{:viewbox => "0 0 16 16", :xmlns => "http://www.w3.org/2000/svg"} | ||
%path{:d => "M7 14c-3.86 0-7-3.14-7-7s3.14-7 7-7 7 3.14 7 7-3.14 7-7 7zM7 2C4.243 2 2 4.243 2 7s2.243 5 5 5 5-2.243 5-5-2.243-5-5-5z"} | ||
%path{:d => "M15.707 14.293L13.314 11.9a8.019 8.019 0 01-1.414 1.414l2.393 2.393a.997.997 0 001.414 0 .999.999 0 000-1.414z"} | ||
.relative.z-10{data: {action: 'keydown.esc@window->search#close'}, tabindex: "-1"} | ||
.hidden.fixed.inset-0.z-40.overflow-y-auto.flex.items-center.justify-center{"class" => "bg-gray-900/50 dark:bg-gray-900/80","data-action" => "click->search#closeBackground", "data-search-target" => "background", "data-transition-enter" => "transition-all ease-in-out duration-300", "data-transition-enter-from" => "bg-opacity-0", "data-transition-enter-to" => "bg-opacity-80", "data-transition-leave" => "transition-all ease-in-out duration-300", "data-transition-leave-from" => "bg-opacity-80", "data-transition-leave-to" => "bg-opacity-0"} | ||
.bg-white.rounded.shadow-lg.max-h-screen.w-full.max-w-5xl.relative{data: {"search-target" => 'container'}} | ||
= form_with(url: search_path, class: 'border-b border-gray-200', data: {search_target: 'form'}) do |f| | ||
.relative | ||
= f.text_field :query, class: query_classes, data: query_data, type: 'search' | ||
%button.absolute.inset-0.right-auto.group{"aria-label" => "Search", :type => "submit"} | ||
%svg.w-4.h-4.flex-shrink-0.fill-current.text-gray-400.group-hover:text-gray-500.ml-4.mr-2{:viewbox => "0 0 16 16", :xmlns => "http://www.w3.org/2000/svg"} | ||
%path{:d => "M7 14c-3.86 0-7-3.14-7-7s3.14-7 7-7 7 3.14 7 7-3.14 7-7 7zM7 2C4.243 2 2 4.243 2 7s2.243 5 5 5 5-2.243 5-5-2.243-5-5-5z"} | ||
%path{:d => "M15.707 14.293L13.314 11.9a8.019 8.019 0 01-1.414 1.414l2.393 2.393a.997.997 0 001.414 0 .999.999 0 000-1.414z"} | ||
|
||
#search_results | ||
#search_results |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters