makes stuff work
This commit is contained in:
@@ -1,5 +1,9 @@
|
||||
(ns auto-ap.ssr.components.card)
|
||||
|
||||
(defn card- [params & children]
|
||||
(into [:div {:class "shadow-md dark:bg-gray-800 sm:rounded-lg border-2 border-gray-200 dark:border-gray-900 bg-white overflow-hidden"}]
|
||||
children))
|
||||
|
||||
(defn content-card- [params & children]
|
||||
[:section {:class " py-3 sm:py-5"}
|
||||
[:div {:class "max-w-screen-2xl"}
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
(ns auto-ap.ssr.components.dialog)
|
||||
|
||||
(defn dialog- [header content footer]
|
||||
[:div {:class "relative bg-white rounded-lg shadow dark:bg-gray-700 dark:text-white fade-in slide-up duration-300 transition-all modal-content"}
|
||||
[:div {:class "flex items-start justify-between p-4 border-b rounded-t dark:border-gray-600"} header]
|
||||
[:div {:class "p-6 space-y-6"}
|
||||
content]
|
||||
[:div footer]])
|
||||
[:div#modal-content
|
||||
[:div {:class "relative bg-white rounded-lg shadow dark:bg-gray-700 dark:text-white fade-in slide-up duration-300 transition-all modal-content"}
|
||||
[:div {:class "flex items-start justify-between p-4 border-b rounded-t dark:border-gray-600"} header]
|
||||
[:div {:class "p-6 space-y-6"}
|
||||
content]
|
||||
[:div footer]]])
|
||||
|
||||
@@ -13,12 +13,9 @@
|
||||
|
||||
(defn text-input- [params]
|
||||
[:input
|
||||
{:type "text"
|
||||
:class "bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500"
|
||||
:autofocus (:autofocus params)
|
||||
:name (:name params)
|
||||
:placeholder (:placeholder params)
|
||||
:value (:value params)}])
|
||||
(update params
|
||||
:class str " bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500")
|
||||
])
|
||||
|
||||
(defn field- [params & rest]
|
||||
(into
|
||||
|
||||
@@ -1,7 +1,9 @@
|
||||
(ns auto-ap.ssr.components.navbar
|
||||
(:require [auto-ap.ssr.components.buttons :refer [icon-button-]]
|
||||
[auto-ap.ssr.svg :as svg]
|
||||
[hiccup2.core :as hiccup]))
|
||||
[hiccup2.core :as hiccup]
|
||||
[bidi.bidi :as bidi]
|
||||
[auto-ap.ssr-routes :as ssr-routes]))
|
||||
|
||||
(defn navbar- []
|
||||
[:nav {:class "fixed z-30 w-full bg-white border-b border-gray-200 dark:bg-gray-800 dark:border-gray-700"}
|
||||
@@ -15,24 +17,30 @@
|
||||
[:a {:href "https://flowbite-admin-dashboard.vercel.app/", :class "flex ml-2 md:mr-24"}
|
||||
[:img {:src "/img/logo-big2.png", :class "h-10 mr-16", :alt "Integreat logo"}]
|
||||
]
|
||||
[:form {:action "#", :method "GET", :class "hidden lg:block lg:pl-3.5"}
|
||||
[:label {:for "topbar-search", :class "sr-only"} "Search"]
|
||||
[:div {:class "relative mt-1 lg:w-96"}
|
||||
[:div {:class "absolute inset-y-0 left-0 flex items-center pl-3 pointer-events-none"}
|
||||
[:svg {:class "w-5 h-5 text-gray-500 dark:text-gray-400", :fill "currentColor", :viewbox "0 0 20 20", :xmlns "http://www.w3.org/2000/svg"}
|
||||
[:path {:fill-rule "evenodd", :d "M8 4a4 4 0 100 8 4 4 0 000-8zM2 8a6 6 0 1110.89 3.476l4.817 4.817a1 1 0 01-1.414 1.414l-4.816-4.816A6 6 0 012 8z", :clip-rule "evenodd"}]]]
|
||||
[:input {:type "text", :name "email", :id "topbar-search", :class "bg-gray-50 border border-gray-300 text-gray-900 sm:text-sm rounded-lg focus:ring-primary-500 focus:border-primary-500 block w-full pl-10 p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-primary-500 dark:focus:border-primary-500", :placeholder "Search"}]]]]
|
||||
[:button.mt-1.lg:w-96.relative.hidden.lg:block {:class "bg-gray-50 hover:bg-gray-200 dark:hover:bg-gray-700 border border-gray-300 text-gray-900 sm:text-sm rounded-lg focus:ring-primary-500 focus:border-primary-500 w-full pl-10 py-4 pr-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-primary-500 dark:focus:border-primary-500 gap-4 "
|
||||
:hx-get (bidi/path-for ssr-routes/only-routes
|
||||
:search)
|
||||
:hx-target "#modal-content"
|
||||
:hx-swap "innerHTML"}
|
||||
[:div {:class "absolute inset-y-0 left-0 flex items-center pl-3 pointer-events-none text-gray-500"}
|
||||
[:div.w-4.h-4 svg/search]
|
||||
[:span.ml-2 "Search"]]]]
|
||||
|
||||
[:div {:class "flex items-center gap-4"}
|
||||
[:div {:class "hidden mr-3 -mb-1 sm:block"}
|
||||
[:span]]
|
||||
[:button {:id "toggleSidebarMobileSearch", :type "button", :class "p-2 text-gray-500 rounded-lg lg:hidden hover:text-gray-900 hover:bg-gray-100 dark:text-gray-400 dark:hover:bg-gray-700 dark:hover:text-white"}
|
||||
[:span {:class "sr-only"} "Search"]
|
||||
[:svg {:class "w-6 h-6", :fill "currentColor", :viewbox "0 0 20 20", :xmlns "http://www.w3.org/2000/svg"}
|
||||
[:path {:fill-rule "evenodd", :d "M8 4a4 4 0 100 8 4 4 0 000-8zM2 8a6 6 0 1110.89 3.476l4.817 4.817a1 1 0 01-1.414 1.414l-4.816-4.816A6 6 0 012 8z", :clip-rule "evenodd"}]]]
|
||||
(icon-button-
|
||||
{:id "toggleSidebarMobileSearch", :type "button", :class "p-2 text-gray-500 rounded-lg lg:hidden hover:text-gray-900 hover:bg-gray-100 dark:text-gray-400 dark:hover:bg-gray-700 dark:hover:text-white"
|
||||
:hx-get (bidi/path-for ssr-routes/only-routes
|
||||
:search)
|
||||
:hx-target "#modal-content"
|
||||
:hx-swap "innerHTML"}
|
||||
svg/search)
|
||||
#_[:button
|
||||
[:div.w-4.h-4 svg/search]]
|
||||
|
||||
|
||||
|
||||
(icon-button- {} [:div.w-4.h-4 svg/search])
|
||||
#_[:button {:type "button", :data-dropdown-toggle "apps-dropdown", :class "hidden p-2 text-gray-500 rounded-lg sm:flex hover:text-gray-900 hover:bg-gray-100 dark:text-gray-400 dark:hover:text-white dark:hover:bg-gray-700"}
|
||||
[:span {:class "sr-only"} "View notifications"]
|
||||
[:svg {:class "w-6 h-6", :fill "currentColor", :viewbox "0 0 20 20", :xmlns "http://www.w3.org/2000/svg"}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
(ns auto-ap.ssr.components.page
|
||||
(:require [auto-ap.ssr.components.navbar :refer [navbar-]]
|
||||
[auto-ap.ssr.components.aside :refer [left-aside-]]))
|
||||
[auto-ap.ssr.components.aside :refer [left-aside-]]
|
||||
[hiccup2.core :as hiccup]))
|
||||
|
||||
(defn page- [{:keys [nav page-specific]} & children]
|
||||
[:div#app
|
||||
@@ -14,7 +15,10 @@
|
||||
[:div.p-4]
|
||||
children)]]
|
||||
[:div#modal-holder.hidden
|
||||
{"_" (hiccup/raw "on click trigger closeDialog")}
|
||||
[:div { :tabindex "-1", :class "fixed top-0 left-0 right-0 z-50 w-full p-4 overflow-x-hidden overflow-y-auto md:inset-0 h-[calc(100%-1rem)] max-h-full flex justify-center "}
|
||||
[:div {:class "relative w-full max-w-2xl max-h-full"}
|
||||
[:div {:class "relative w-full max-w-2xl max-h-full"
|
||||
"_" (hiccup/raw "on click halt the event")}
|
||||
[:div#modal-content ]]]
|
||||
[:div {:class "bg-gray-900 bg-opacity-50 dark:bg-opacity-80 fixed inset-0 z-40"}]]])
|
||||
[:div {:class "bg-gray-900 bg-opacity-50 dark:bg-opacity-80 fixed inset-0 z-40"
|
||||
}]]])
|
||||
|
||||
18
src/clj/auto_ap/ssr/components/tags.clj
Normal file
18
src/clj/auto_ap/ssr/components/tags.clj
Normal file
@@ -0,0 +1,18 @@
|
||||
(ns auto-ap.ssr.components.tags)
|
||||
|
||||
|
||||
(defn pill- [params & children]
|
||||
(into
|
||||
[:span (cond-> params
|
||||
true (update :class str " text-xs font-medium px-2 py-0.5 rounded whitespace-nowrap")
|
||||
|
||||
(= :primary (:color params))
|
||||
(update :class str " bg-green-100 text-green-800 dark:bg-green-900 dark:text-green-300 ")
|
||||
|
||||
(= :secondary (:color params))
|
||||
(update :class str " bg-blue-100 text-blue-800 dark:bg-blue-900 dark:text-blue-300 ")
|
||||
|
||||
(= :yellow (:color params))
|
||||
(update :class str " bg-yellow-100 text-yellow-800 dark:bg-yellow-900 dark:text-yellow-300")
|
||||
)]
|
||||
children))
|
||||
Reference in New Issue
Block a user