Skip to content

Commit

Permalink
migrate to semantic-ui-react;
Browse files Browse the repository at this point in the history
- abandoning previous implementation of soda-ash that wrapped
  semantic-ui in favor of
  semantic-ui-react;
  • Loading branch information
gadfly361 committed Feb 12, 2017
1 parent b9584a3 commit b750904
Show file tree
Hide file tree
Showing 86 changed files with 235 additions and 9,784 deletions.
5 changes: 0 additions & 5 deletions .travis.yml

This file was deleted.

41 changes: 5 additions & 36 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,40 +1,9 @@
## 0.1.0-beta
## 0.2.0-SNAPSHOT

* adds the following elements
* list
* rail
* step
* remove :group? and replace with plural version of the element.<sup>1</sup> In other words, adds the following:
* buttons
* icons
* images
* labels
* segments
* targets semantic-ui-react version "0.64.0-0"

<sup>1</sup> Breaking change. Example for how to update affected elements:
---

```
;; 0.1.0-alpha2
[s/button {:soda {:tag :div
:group? true
:color :red}}
... ]
*DONT USE ANYTHING BEFORE VERSION 0.2.0.*

;; 0.1.0-beta
[s/buttons {:soda {:color :red}} ;; <-- note the extra "s"
... ]
```


## 0.1.0-alpha2 [source](https://github.com/gadfly361/soda-ash/tree/4f266c3d3a9dbca240238a3c6f3d2f62cf80586a)

* initial release
* targets Semantic UI version 2.1.8 and Reagent 0.5.1

## 0.1.0-alpha1

* broken release (forgot to set :source-paths)

## 0.1.0-alpha

* broken release (forgot to set :source-paths)
The previous versions were incomplete and wrapped semantic-ui instead of semantic-ui-react.
116 changes: 53 additions & 63 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,87 +1,77 @@
# soda-ash

[![Build Status](https://travis-ci.org/gadfly361/soda-ash.svg?branch=master)](https://travis-ci.org/gadfly361/soda-ash)

**WARNING** I am currently working on a complete re-write of soda-ash. I strongly urge you to *not* depend on this library yet. Also, the current release only covers Semantic UI's Elements.

Soda-ash is an interface between clojurescript's [reagent](https://github.com/reagent-project/reagent) and [Semantic UI](http://semantic-ui.com/).

Semantic UI is awesome ... however, at its core, you are concatenating
ordered classes into a string. Soda-ash bubbles Semantic UI's classes
out of this regex-hell and softens them into clojurescript's familiar,
powerful, and unordered hash-map. Furthermore, soda-ash allows you to
place this hash-map inside a reagent atom at your desired path. This
means you can swap! Semantic UI classes and have your component
reactively update.

## Docs

The
**[documentation](http://soda-ash.s3-website-us-east-1.amazonaws.com/#!/soda_ash.an_overview_card)**
has *lots* of devcard examples.

If you have questions, I can usually be found hanging out in the
[clojurians](http://clojurians.net/) #reagent slack channel (my handle
is [@gadfly361](https://twitter.com/gadfly361)).
Soda-ash is an interface between
clojurescript's [reagent](https://github.com/reagent-project/reagent)
and [semantic-ui-react](http://react.semantic-ui.com/introduction).

## Usage

Put the following in the `:dependencies` vector of your *project.clj*

```
[soda-ash "0.1.0-beta"
:exclusions [cljsjs/react-with-addons]]
```clojure
[soda-ash "0.2.0-SNAPSHOT"]
```

Then require soda-ash in your namespace.

```
```clojure
(ns foo.bar
(:require [soda-ash.element :as s]))
(:require [soda-ash.core :as sa]))
```

Finally, add Semantic UI to your index.html file:

### Example

Let's take a look at a modal. In javascript, you'd write something like this:

```jsx
import React from 'react'
import { Button, Header, Image, Modal } from 'semantic-ui-react'

const ModalModalExample = () => (
<Modal trigger={<Button>Show Modal</Button>}>
<Modal.Header>Select a Photo</Modal.Header>
<Modal.Content image>
<Image wrapped size='medium' src='http://semantic-ui.com/images/avatar2/large/rachel.png' />
<Modal.Description>
<Header>Default Profile Image</Header>
<p>We've found the following gravatar image associated with your e-mail address.</p>
<p>Is it okay to use this photo?</p>
</Modal.Description>
</Modal.Content>
</Modal>
)
export default ModalModalExample
```
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/semantic-ui/2.1.8/semantic.min.css">
```

## Roadmap

Next up, Collections.

## Development
### Devcards
However, in clojurescript with soda-ash, you'd write something like this:

```clojure
(ns foo.bar
(:require
[reagent.core :as reagent]
[soda-ash.core :as sa]))
(defn modal-example []
[sa/Modal {:trigger (reagent/as-element [sa/Button "Show Modal"])}
[sa/ModalHeader "Select a Photo"]
[sa/ModalContent {:image true}
[sa/Image {:wrapped true
:size "medium"
:src "http://semantic-ui.com/images/avatar2/large/rachel.png"}]
[sa/ModalDescription
[sa/Header "Default Profile Image"]
[:p "We've found the following gravatar image associated with your e-mail address."]
[:p "Is it okay to use this photo?"]
]]]))
```
lein clean
lein figwheel devcards
```

Figwheel will automatically push cljs changes to the browser.

Wait a bit, then browse to [http://localhost:3449](http://localhost:3449).

---

To build a minified version:

```
lein clean
lein cljsbuild once hostedcards
```

Then open *resources/public/index.html*

### Tests

```
lein clean
lein with-profile test doo phantom unit once
```
## Questions

The above command assumes that you have [phantomjs](https://www.npmjs.com/package/phantomjs) installed.
If you have questions, I can usually be found hanging out in the
[clojurians](http://clojurians.net/) #reagent slack channel (my handle
is [@gadfly361](https://twitter.com/gadfly361)).

# License

Expand Down
66 changes: 7 additions & 59 deletions project.clj
Original file line number Diff line number Diff line change
@@ -1,67 +1,15 @@
(defproject soda-ash "0.1.0-beta"
(defproject soda-ash "0.2.0-SNAPSHOT"
:description "Soda-ash is an interface between clojurescript's reagent
and Semantic UI"
and Semantic UI React"
:url "https://github.com/gadfly361/soda-ash"
:license {:name "MIT"}
:scm {:name "git"
:url "https://github.com/gadfly361/soda-ash"}
:url "https://github.com/gadfly361/soda-ash"}

:min-lein-version "2.5.3"

:source-paths ["src/main/cljs"] ;; needed for clojars

:dependencies
[[org.clojure/clojure "1.7.0"]
[org.clojure/clojurescript "1.7.170"]
[reagent "0.5.1" :exclusions [cljsjs/react]]
[cljsjs/react-with-addons "0.13.3-0"]]

:plugins
[[lein-cljsbuild "1.1.1"]]

:clean-targets ^{:protect false}
["resources/public/js/compiled" "target"]


:profiles
{:dev
{:dependencies
[[devcards "0.2.0-8" :exclusions [cljsjs/react]]]

:plugins
[[lein-figwheel "0.5.0-2"]]

:cljsbuild
{:builds
[{:id "devcards"
:source-paths ["src/devcards" "src/main/cljs"]
:figwheel {:devcards true }
:compiler {:main "soda-ash.core-card"
:asset-path "js/compiled/devcards_out"
:output-to "resources/public/js/compiled/devcards.js"
:output-dir "resources/public/js/compiled/devcards_out"
:source-map-timestamp true }}

{:id "hostedcards"
:source-paths ["src/devcards" "src/main/cljs"]
:compiler {:main "soda-ash.core-card"
:devcards true
:asset-path "js/compiled/devcards_out"
:output-to "resources/public/js/compiled/devcards.js"
:optimizations :advanced}}]}}

:test
{:dependencies
[[cljs-react-test "0.1.3-SNAPSHOT"]
[prismatic/dommy "1.1.0"]]

:plugins
[[lein-doo "0.1.6"]]

:cljsbuild
{:builds
[{:id "unit"
:source-paths ["src/main/cljs" "src/test/cljs"]
:compiler {:output-to "resources/public/js/compiled/test.js"
:main soda-ash.runner
:optimizations :none}}]}}})
[[org.clojure/clojure "1.8.0"]
[org.clojure/clojurescript "1.9.229"]
[reagent "0.6.0"]
[cljsjs/semantic-ui-react "0.64.0-0"]])
Binary file removed resources/public/images/avatar/large/ade.jpg
Binary file not shown.
Binary file removed resources/public/images/avatar/large/nan.jpg
Binary file not shown.
Binary file removed resources/public/images/avatar/small/christian.jpg
Binary file not shown.
Binary file removed resources/public/images/avatar/small/elliot.jpg
Binary file not shown.
Binary file removed resources/public/images/avatar/small/joe.jpg
Binary file not shown.
Binary file removed resources/public/images/avatar/small/matt.jpg
Binary file not shown.
Binary file removed resources/public/images/avatar/small/stevie.jpg
Binary file not shown.
Binary file removed resources/public/images/avatar/small/tom.jpg
Binary file not shown.
Binary file removed resources/public/images/avatar2/small/elyse.png
Binary file not shown.
Binary file removed resources/public/images/avatar2/small/eve.png
Binary file not shown.
Binary file removed resources/public/images/avatar2/small/lindsay.png
Binary file not shown.
Binary file removed resources/public/images/avatar2/small/molly.png
Binary file not shown.
Binary file removed resources/public/images/avatar2/small/rachel.png
Binary file not shown.
Binary file removed resources/public/images/icons/school.png
Binary file not shown.
Binary file removed resources/public/images/wireframe/image.png
Binary file not shown.
Binary file removed resources/public/images/wireframe/square-image.png
Binary file not shown.
Binary file removed resources/public/images/wireframe/white-image.png
Binary file not shown.
15 changes: 0 additions & 15 deletions resources/public/index.html

This file was deleted.

Loading

0 comments on commit b750904

Please sign in to comment.