File tree Expand file tree Collapse file tree 12 files changed +546
-17
lines changed
Expand file tree Collapse file tree 12 files changed +546
-17
lines changed Original file line number Diff line number Diff line change @@ -13,13 +13,18 @@ Read stylesheets: [style.cljs](https://github.com/Respo/respo-ui/blob/master/src
1313[ ![ Clojars Project] ( https://img.shields.io/clojars/v/respo/ui.svg )] ( https://clojars.org/respo/ui )
1414
1515``` clojure
16- [respo/ui " 0.3.1 " ]
16+ [respo/ui " 0.3.2 " ]
1717```
1818
1919``` clojure
2020[respo-ui.core :as ui]
2121[respo-ui.colors :as colors]
22- [respo-ui.comp.switchy :refer [comp-switch]] ; `switch` is a reserved word
22+ ```
23+
24+ ``` clojure
25+ (respo-ui.comp.icon/comp-icon :flash )
26+ (respo-ui.comp.icon/comp-ios-icon :bell )
27+ (respo-ui.comp.icon/comp-android-icon :cart )
2328```
2429
2530Use ` ui/button ` as ` :style ` attributes for buttons.
Original file line number Diff line number Diff line change 99 :username " jiyinyiyong"
1010 :password (read-password " Clojars password: " )}]))
1111
12- (def +version+ " 0.3.1 " )
12+ (def +version+ " 0.3.2 " )
1313
1414(deftask deploy []
1515 (comp
Original file line number Diff line number Diff line change 2525 "license" : " MIT" ,
2626 "devDependencies" : {
2727 "http-server" : " ^0.11.1" ,
28- "shadow-cljs" : " 2.0.134 "
28+ "shadow-cljs" : " 2.0.142 "
2929 },
3030 "dependencies" : {}
3131}
Original file line number Diff line number Diff line change 11
22{:source-paths [" src" ]
33 :dependencies [[mvc-works/hsl " 0.1.2" ]
4- [mvc-works/shell-page " 0.1.6" ]
5- [mvc-works/verbosely " 0.1.2" ]
6- [respo/reel " 0.2.3" ]
74 [mvc-works/keycode " 0.1.3" ]
8- [respo/value " 0.2.3" ]
5+ [mvc-works/verbosely " 0.1.2" ]
6+ [mvc-works/shell-page " 0.1.6" ]
7+ [respo " 0.8.13" ]
8+ [respo/value " 0.2.4" ]
99 [respo/router " 0.4.0" ]
10- [respo " 0.8.12 " ]]
10+ [respo/reel " 0.2.4 " ]]
1111 :open-file-command [" subl" [" %s:%s:%s" :file :line :column ]]
1212 :builds {:browser {:target :browser
1313 :output-dir " target/browser"
1919 :devtools {:after-load respo-ui.main/reload!
2020 :preloads [shadow.cljs.devtools.client.hud]
2121 :http-root " target"
22- :http-port 8080 }
22+ :http-port 7000 }
2323 :release {:output-dir " dist/"
2424 :module-hash-names 8
2525 :build-options {:manifest-name " assets.edn" }}}
Original file line number Diff line number Diff line change 1212 [respo-ui.comp.layouts-page :refer [comp-layouts-page]]
1313 [respo-ui.comp.fonts-page :refer [comp-fonts-page]]
1414 [respo-ui.comp.components :refer [comp-components-page]]
15- [respo-ui.comp.navbar :refer [comp-navbar]]))
15+ [respo-ui.comp.navbar :refer [comp-navbar]]
16+ [respo-ui.comp.icons-page :refer [comp-icons-page]]))
1617
1718(def style-content {:padding 8 })
1819
4041 " layouts.html" (comp-layouts-page )
4142 " fonts.html" (comp-fonts-page )
4243 " components.html" (cursor-> :components comp-components-page states)
44+ " icons.html" (comp-icons-page )
4345 (<> (pr-str router))))))))
Original file line number Diff line number Diff line change 1+
2+ (ns respo-ui.comp.icon
3+ (:require [respo.macros :refer [defcomp div input textarea button span select option a <>]]
4+ [respo.core :refer [create-element]]))
5+
6+ (defn get-string [icon-name]
7+ (cond
8+ (keyword? icon-name) (name icon-name)
9+ (string? icon-name) icon-name
10+ :else (throw (js/Error. (str " Unknown icon: " (pr-str icon-name))))))
11+
12+ (defcomp
13+ comp-android-icon
14+ (icon-name )
15+ (create-element :i {:class-name (str " ion-android-" (get-string icon-name))}))
16+
17+ (defn comp-icon [icon-name]
18+ (create-element :i {:class-name (str " ion-" (get-string icon-name))}))
19+
20+ (defcomp
21+ comp-ios-icon
22+ (icon-name )
23+ (create-element :i {:class-name (str " ion-ios-" (get-string icon-name))}))
Original file line number Diff line number Diff line change 1+
2+ (ns respo-ui.comp.icons-page
3+ (:require [respo.macros :refer [defcomp div <>]]
4+ [respo-ui.core :as ui]
5+ [respo-ui.comp.icon :refer [comp-icon comp-android-icon comp-ios-icon]]))
6+
7+ (defcomp
8+ comp-icons-page
9+ ()
10+ (div
11+ {}
12+ (<> " icon pages" )
13+ (div {} (comp-icon :flash ))
14+ (div {} (comp-ios-icon :bell ))
15+ (div {} (comp-android-icon :cart ))))
Original file line number Diff line number Diff line change 2828 (render-entry " fonts.html" " Fonts" mobile?)
2929 (render-entry " widgets.html" " Widgets" mobile?)
3030 (render-entry " layouts.html" " Layouts" mobile?)
31- (render-entry " components.html" " Components" mobile?)))
31+ (render-entry " components.html" " Components" mobile?)
32+ (render-entry " icons.html" " Icons" mobile?)))
Original file line number Diff line number Diff line change 2424 " /colors.html"
2525 " /layouts.html"
2626 " /fonts.html"
27- " /components.html" ])
27+ " /components.html"
28+ " /icons.html" ])
2829
2930(def preview? (= " preview" js/process.env.prod))
3031
You can’t perform that action at this time.
0 commit comments