-
-
Notifications
You must be signed in to change notification settings - Fork 142
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- BREAKING CHANGE: Updated version to 2.0.1 - BREAKING CHANGE: Renamed re-com.core to re-com.misc and updated all components. - BREAKING CHANGE: Moved label and title to re-com.text.cljs and updated many components. - POTENTIAL BREAKING CHANGE: Modified the label component to be an inline element (like a [:span]) rather than a block level element (like a [:div]). Main implication is that it plays well within other [labels] and [:span]s. - Upgraded ClojureScript to 0.0-3058. - Made sure all demo tabs have a "Notes" section. - Added "Status: Beta" to all component demo pages. - Major re-org of tabs demo to be more consistent with the others. - Brought tour demo up to scratch with the other ones. - Copied index_dev.html visual changes to index_prod.html. - Update GitHub hyperlinks to point to master branch for prod version and develop branch for dev version. - [STILL IN PROGRESS] Now supports Secretary routes and goog history functionality. - Added lein-s3-static-deploy to allow syncing prod version of demo with an AWS bucket.
- Loading branch information
Showing
43 changed files
with
688 additions
and
579 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
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 |
---|---|---|
|
@@ -20,9 +20,6 @@ | |
font-size: 13px; | ||
font-weight: 400; | ||
} | ||
|
||
</style> | ||
<style> | ||
.semibold { | ||
font-weight: 500; | ||
} | ||
|
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
(ns re-com.text | ||
(:require-macros [re-com.core :refer [handler-fn]]) | ||
(:require [re-com.box :refer [v-box box line]] | ||
[re-com.validate :refer [extract-arg-data validate-args css-style? html-attr?]])) | ||
|
||
|
||
;; ------------------------------------------------------------------------------------ | ||
;; Component: label | ||
;; ------------------------------------------------------------------------------------ | ||
|
||
(def label-args-desc | ||
[{:name :label :required true :type "anything" :description "text to display. Can be anything as it will be converted to a string"} | ||
{:name :on-click :required false :type "() -> nil" :validate-fn fn? :description "function to call when label is clicked"} | ||
{:name :width :required false :type "string" :validate-fn string? :description "a CSS width"} | ||
{:name :class :required false :type "string" :validate-fn string? :description "CSS class names, space separated"} | ||
{:name :style :required false :type "css style map" :validate-fn css-style? :description "additional CSS styles"} | ||
{:name :attr :required false :type "html attr map" :validate-fn html-attr? :description [:span "HTML attributes, like " [:code ":on-mouse-move"] [:br] "No " [:code ":class"] " or " [:code ":style"] "allowed"]}]) | ||
|
||
(def label-args (extract-arg-data label-args-desc)) | ||
|
||
(defn label | ||
"Returns markup for a basic label" | ||
[& {:keys [label on-click width class style attr] | ||
:as args}] | ||
{:pre [(validate-args label-args args "label")]} | ||
[box | ||
:width width | ||
:align :start | ||
:style {:display "inline-flex"} | ||
:child [:span | ||
(merge | ||
{:class (str "rc-label " class) | ||
:style (merge {:flex "none"} style)} | ||
(when on-click | ||
{:on-click (handler-fn (on-click))}) | ||
attr) | ||
(str label)]]) | ||
|
||
|
||
;; ------------------------------------------------------------------------------------ | ||
;; Component: title | ||
;; ------------------------------------------------------------------------------------ | ||
|
||
;; TODO: Could add proper :h validation | ||
|
||
(def title-args-desc | ||
[{:name :label :required true :type "anything" :description "text to display. Can be anything as it will be converted to a string"} | ||
{:name :h :required false :default :h3 :type "keyword" :validate-fn keyword? :description "something like :h3 or :h4"} | ||
{:name :underline? :required false :default true :type "boolean" :description "determines whether an underline is placed under the title"} | ||
{:name :class :required false :type "string" :validate-fn string? :description "CSS class names, space separated"} | ||
{:name :style :required false :type "css style map" :validate-fn css-style? :description "CSS styles to add or override"} | ||
{:name :attr :required false :type "html attr map" :validate-fn html-attr? :description [:span "HTML attributes, like " [:code ":on-mouse-move"] [:br] "No " [:code ":class"] " or " [:code ":style"] "allowed"]}]) | ||
|
||
(def title-args (extract-arg-data title-args-desc)) | ||
|
||
(defn title | ||
"An underlined, left justified, Title. By default :h3" | ||
[& {:keys [label h underline? class style attr] | ||
:or {underline? true h :h3} | ||
:as args}] | ||
{:pre [(validate-args title-args args "title")]} | ||
[v-box | ||
:children [[h (merge {:class (str "rc-title " class) | ||
:style (merge {:display "flex" :flex "none"} | ||
style)} | ||
attr) | ||
label] | ||
(when underline? [line :size "1px"])]]) |
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
Oops, something went wrong.