Makes a clean demo of using tailwind for the company 1099 page.
This commit is contained in:
27
src/clj/auto_ap/ssr/components/inputs.clj
Normal file
27
src/clj/auto_ap/ssr/components/inputs.clj
Normal file
@@ -0,0 +1,27 @@
|
||||
(ns auto-ap.ssr.components.inputs)
|
||||
|
||||
(defn select- [params & children]
|
||||
(into
|
||||
[:select {: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"
|
||||
:name (:name params)}
|
||||
(cond->>
|
||||
(map (fn [[k v]]
|
||||
[:option {:value k :selected (= v (:value params))} v])
|
||||
(:options params))
|
||||
(:allow-blank? params) (conj [:option {:value "" :selected (not (:value params))} ""]))]
|
||||
children))
|
||||
|
||||
(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)}])
|
||||
|
||||
(defn field- [params & rest]
|
||||
(into
|
||||
[:div
|
||||
[:label {:class "block mb-2 text-sm font-medium text-gray-900 dark:text-white"} (:label params)]]
|
||||
rest))
|
||||
Reference in New Issue
Block a user