Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor(project): stardust => semantic-ui-react #608

Merged
merged 18 commits into from
Oct 3, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 1 addition & 1 deletion .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,7 @@ A [`ui header`][5] accepts a size class. The `ui modal` has a *component part*

#### React Components & Sub Components

Top level Stardust components correspond to SUI *components*. Stardust sub components correspond to SUI *component parts*.
Top level Semantic-UI-React components correspond to SUI *components*. Stardust sub components correspond to SUI *component parts*.

This allows us to provide accurate `propTypes` validation. It also separates concerns, isolating features and tests.

Expand Down
29 changes: 6 additions & 23 deletions .github/ISSUE_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -1,27 +1,10 @@
<!---------------------- BUG ----------------------->
### Steps to Reproduce
### Steps
1. Do something
2. Do something else.

### Expected Behavior
### Expected

### Actual Behavior

### Version

Stardust: `x.y.z`
Browser:
OS:

### Test Case

Fork: http://codepen.io/levithomason/pen/ZpBaJX

<!-------------------- FEATURE --------------------->
### Description

### Example Code

### Example Result

### Prototype (optional)
### Result

### Testcase
Fork: http://codepen.io/levithomason/pen/ZpBaJX
28 changes: 13 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
</p>
</p>

# [Stardust][2]
# [Semantic-UI-React (Stardust)][2]
[![Gitter](https://img.shields.io/badge/gitter-join_chat-1dce73.svg?logo=data%3Aimage%2Fsvg%2Bxml%3Bbase64%2CPD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4NCjxzdmcgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cmVjdCB4PSIwIiB5PSI1IiBmaWxsPSIjZmZmIiB3aWR0aD0iMSIgaGVpZ2h0PSI1Ii8%2BPHJlY3QgeD0iMiIgeT0iNiIgZmlsbD0iI2ZmZiIgd2lkdGg9IjEiIGhlaWdodD0iNyIvPjxyZWN0IHg9IjQiIHk9IjYiIGZpbGw9IiNmZmYiIHdpZHRoPSIxIiBoZWlnaHQ9IjciLz48cmVjdCB4PSI2IiB5PSI2IiBmaWxsPSIjZmZmIiB3aWR0aD0iMSIgaGVpZ2h0PSI0Ii8%2BPC9zdmc%2B&logoWidth=8&style=flat-square&maxAge=2592000)](https://gitter.im/TechnologyAdvice/stardust)
[![Circle CI](https://img.shields.io/circleci/project/TechnologyAdvice/stardust/master.svg?style=flat-square)](https://circleci.com/gh/TechnologyAdvice/stardust/tree/master)
[![Codecov](https://img.shields.io/codecov/c/github/TechnologyAdvice/stardust/master.svg?style=flat-square)](https://codecov.io/gh/TechnologyAdvice/stardust)
Expand Down Expand Up @@ -55,22 +55,20 @@ Help shape this library by weighing in on our [RFC (request for comments)][19] i
## Install

```sh
npm i stardust -S
npm i semantic-ui-react -S
```

## Usage

**App.js**

```js
import React, { Component } from 'react'
import { Button } from 'stardust'

export default class TryStardust extends Component {
render() {
return <Button>Hello</Button>
}
}
import React from 'react'
import { Button } from 'semantic-ui-react'

export default () => (
<Button>Hello</Button>
)
```

**index.html**
Expand All @@ -80,7 +78,7 @@ export default class TryStardust extends Component {
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Try Stardust</title>
<title>Semantic-UI-React</title>

<!-- SUI CSS -->
<link href="//cdnjs.cloudflare.com/ajax/libs/semantic-ui/2.1.8/semantic.css" rel="stylesheet">
Expand All @@ -100,9 +98,9 @@ For more complete examples, check out the [Doc Site][2].
We use the [debug](https://www.npmjs.com/package/debug) module for debugging. You can turn debugging on and off via the `localStorage.debug` flag from the browser console. See the [debug docs](https://www.npmjs.com/package/debug) for more.

```js
localStorage.debug = 'stardust:*' // default, debug all components
localStorage.debug = 'stardust:dropdown' // debug only the dropdown
localStorage.debug = null // turn debug off
localStorage.debug = 'semanticUIReact:*' // default, debug all components
localStorage.debug = 'semanticUIReact:dropdown' // debug only the dropdown
localStorage.debug = null // turn debug off
```

Once you change the flag, you need to refresh your browser to see the changes in debug output.
Expand All @@ -125,7 +123,7 @@ Any other issue labeled [`help wanted`][4] is ready for a PR.

## Our Principles

[TechnologyAdvice][9] has been [dogfooding][10] Stardust in production since fall of 2015. This living list is updated as we iterate. We'll lock it in as our v1.0 constitution soon.
[TechnologyAdvice][9] has been [dogfooding][10] Semantic-UI-React in production since fall of 2015. These are the guiding principles that have developed as a result:

- No jQuery dependency
- No animation dependencies
Expand Down
4 changes: 2 additions & 2 deletions browser/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,15 @@
></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/react/15.3.2/react.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/react/15.3.2/react-dom.js"></script>
<script src="../dist/umd/stardust.min.js"></script>
<script src="../dist/umd/semantic-ui-react.min.js"></script>
<link
rel="stylesheet"
href="https://cdnjs.cloudflare.com/ajax/libs/semantic-ui/2.2.2/semantic.min.css"
>
</head>
<body>
<script type="text/babel">
const { Container, Divider, Dropdown, Header, Message } = stardust
const { Container, Divider, Dropdown, Header, Message } = semanticUIReact

const options = [
{ value: 'all', text: 'All' },
Expand Down
6 changes: 3 additions & 3 deletions docs/app/Components/ComponentDoc/ComponentDoc.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import ComponentProps from './ComponentProps'
import docgenInfo from '../../docgenInfo.json'

import { META } from 'src/lib'
import * as stardust from 'src'
import * as semanticUIReact from 'src'
import { Divider, Grid, Header, Icon, List } from 'src'

const docgenPaths = _.keys(docgenInfo)
Expand Down Expand Up @@ -87,7 +87,7 @@ export default class ComponentDoc extends Component {
const seeTags = _.filter(docgen.docBlock.tags, ['title', 'see'])

const seeLinks = _.map(seeTags, ({ description }) => {
const seeMeta = _.get(stardust[description], '_meta')
const seeMeta = _.get(semanticUIReact[description], '_meta')
if (!seeMeta) return

const { type, name } = seeMeta
Expand Down Expand Up @@ -154,7 +154,7 @@ export default class ComponentDoc extends Component {
const selectedDocgen = docgenInfo[getDocgenPath(showPropsFor)]
const toggleIcon = `toggle ${showPropsFor ? 'on' : 'off'}`

const subComponents = _.flatMap(stardust, SDComponent => _.filter(SDComponent, staticValue => (
const subComponents = _.flatMap(semanticUIReact, SDComponent => _.filter(SDComponent, staticValue => (
_.get(staticValue, '_meta.parent') === _meta.name
)))

Expand Down
14 changes: 7 additions & 7 deletions docs/app/Components/ComponentDoc/ComponentExample.js
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ export default class ComponentExample extends Component {
const FAKER = require('faker')
const LODASH = require('lodash')
const REACT = require('react')
const STARDUST = require('stardust')
const SEMANTIC_UI_REACT = require('semantic-ui-react')
/* eslint-enable no-unused-vars */

// Should use an AST transform here... oh well :/
Expand All @@ -137,14 +137,14 @@ export default class ComponentExample extends Component {

// rewrite imports to const statements against the UPPERCASE module names
const imports = _.get(/(import[\s\S]*from[\s\S]*['"]\n)/.exec(sourceCode), '[1]', '')
.replace(/[\s\n]+/g, ' ') // normalize spaces and make one line
.replace(/'\s+/g, "'\n") // one import per line
.replace(/, }/g, ' }') // remove trailing destructured commas
.split('\n')
.replace(/[\s\n]+/g, ' ') // normalize spaces and make one line
.replace(/ import/g, '\nimport') // one import per line
.split('\n') // split lines
.filter(l => l.trim() !== '') // remove empty lines
.map(l => {
const defaultImport = _.get(/import\s+(\w+)/.exec(l), '[1]')
const destructuredImports = _.get(/import.*({[\s\w,}]+)\s+from/.exec(l), '[1]')
const module = _.get(/import.*from.*'(.*)'/.exec(l), '[1]', '').toUpperCase()
const module = _.snakeCase(_.get(/import.*from.*'(.*)'/.exec(l), '[1]', '')).toUpperCase()

return _.compact([
defaultImport && `const ${defaultImport} = ${module}`,
Expand All @@ -158,7 +158,7 @@ export default class ComponentExample extends Component {

// consider everything after the imports to be the body
// remove `export` statements except `export default class|function`
const body = _.get(/import[\s\S]*from '\w+'([\s\S]*)/.exec(sourceCode), '[1]', '')
const body = _.get(/import[\s\S]*from.*\n([\s\S]*)/.exec(sourceCode), '[1]', '')
.replace(/export\s+default\s+(?!class|function)\w+([\s\n]+)?/, '') // remove `export default Foo` statements
.replace(/export\s+default\s+/, '') // remove `export default ...`

Expand Down
2 changes: 1 addition & 1 deletion docs/app/Components/ComponentDoc/ComponentExamples.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React, { Component, createElement, PropTypes } from 'react'

import { exampleContext } from 'docs/app/utils'
import { Grid, Icon, Message } from 'stardust'
import { Grid, Icon, Message } from 'src'

export default class ComponentExamples extends Component {
static propTypes = {
Expand Down
2 changes: 1 addition & 1 deletion docs/app/Components/ComponentDoc/ComponentProps.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import _ from 'lodash'
import React, { Component, PropTypes } from 'react'

import { Label, Table } from 'stardust'
import { Label, Table } from 'src'

/**
* Displays a table of a Component's PropTypes.
Expand Down
8 changes: 4 additions & 4 deletions docs/app/Components/Editor/Editor.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,28 +13,28 @@ import { parentComponents } from 'docs/app/utils'
// https://github.com/thlorenz/brace/issues/19
const languageTools = ace.acequire('ace/ext/language_tools')

const stardustCompleter = {
const semanticUIReactCompleter = {
getCompletions(editor, session, pos, prefix, callback) {
const completions = []

_.each(parentComponents, (component) => {
const { name } = component._meta
// Component
completions.push({ caption: name, value: name, meta: 'Stardust Component' })
completions.push({ caption: name, value: name, meta: 'Component' })

// Its props
_.each(component.propTypes, (val, propName) => {
// don't add duplicate prop completions
if (_.find(completions, { value: propName })) return

completions.push({ caption: propName, value: propName, meta: 'Stardust Prop' })
completions.push({ caption: propName, value: propName, meta: 'Component Prop' })
})
})
callback(null, completions)
},
}

languageTools.addCompleter(stardustCompleter)
languageTools.addCompleter(semanticUIReactCompleter)

function Editor(props) {
const { id, mode, value, ...rest } = props
Expand Down
4 changes: 2 additions & 2 deletions docs/app/Components/Root.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import React, { Component, PropTypes } from 'react'
import ComponentDoc from '../Components/ComponentDoc/ComponentDoc'
import PageNotFound from '../Views/PageNotFound'
import { META } from 'src/lib'
import * as stardust from 'stardust'
import * as semanticUIReact from 'src'

export default class Root extends Component {
static propTypes = {
Expand All @@ -19,7 +19,7 @@ export default class Root extends Component {
render() {
const { name } = this.props.params
const componentName = _.startCase(name).replace(/ /g, '')
const component = stardust[componentName]
const component = semanticUIReact[componentName]
if (!component || !component._meta || !META.isParent(component)) {
return <PageNotFound />
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React, { Component } from 'react'
import { Button, Confirm } from 'stardust'
import { Button, Confirm } from 'semantic-ui-react'

class ConfirmCallbacksExample extends Component {
state = { active: false, result: 'show the modal to capture a result' }
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React, { Component } from 'react'
import { Button, Confirm } from 'stardust'
import { Button, Confirm } from 'semantic-ui-react'

class ConfirmConfirmExample extends Component {
state = { active: false }
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React, { Component } from 'react'
import { Button, Confirm } from 'stardust'
import { Button, Confirm } from 'semantic-ui-react'

class ConfirmButtonsExample extends Component {
state = { active: false }
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React, { Component } from 'react'
import { Button, Confirm } from 'stardust'
import { Button, Confirm } from 'semantic-ui-react'

class ConfirmButtonsExample extends Component {
state = { active: false }
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React, { Component } from 'react'
import { Button, Confirm } from 'stardust'
import { Button, Confirm } from 'semantic-ui-react'

class ConfirmHeaderExample extends Component {
state = { active: false }
Expand Down
2 changes: 1 addition & 1 deletion docs/app/Examples/addons/Radio/States/Checked.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from 'react'
import { Radio } from 'stardust'
import { Radio } from 'semantic-ui-react'

const RadioCheckedExample = () => (
<Radio label='This radio comes prechecked' defaultChecked />
Expand Down
2 changes: 1 addition & 1 deletion docs/app/Examples/addons/Radio/States/Disabled.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from 'react'
import { Form, Radio } from 'stardust'
import { Form, Radio } from 'semantic-ui-react'

const RadioDisabledExample = () => (
<Form>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React, { Component } from 'react'
import { Button, Radio } from 'stardust'
import { Button, Radio } from 'semantic-ui-react'

export default class RadioRemoteControlExample extends Component {
state = { checked: false }
Expand Down
2 changes: 1 addition & 1 deletion docs/app/Examples/addons/Radio/States/ReadOnly.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from 'react'
import { Radio } from 'stardust'
import { Radio } from 'semantic-ui-react'

const RadioReadOnlyExample = () => (
<Radio label='This radio is read-only' readOnly />
Expand Down
2 changes: 1 addition & 1 deletion docs/app/Examples/addons/Radio/States/index.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React, { Component } from 'react'
import ComponentExample from 'docs/app/Components/ComponentDoc/ComponentExample'
import ExampleSection from 'docs/app/Components/ComponentDoc/ExampleSection'
import { Message } from 'stardust'
import { Message } from 'semantic-ui-react'

export default class RadioStatesExamples extends Component {
render() {
Expand Down
2 changes: 1 addition & 1 deletion docs/app/Examples/addons/Radio/Types/Radio.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from 'react'
import { Radio } from 'stardust'
import { Radio } from 'semantic-ui-react'

const RadioRadioExample = () => (
<Radio label='Make my profile visible' />
Expand Down
2 changes: 1 addition & 1 deletion docs/app/Examples/addons/Radio/Types/RadioGroup.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React, { Component } from 'react'
import { Form, Radio } from 'stardust'
import { Form, Radio } from 'semantic-ui-react'

export default class RadioGroupExample extends Component {
state = {}
Expand Down
2 changes: 1 addition & 1 deletion docs/app/Examples/addons/Radio/Types/Slider.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from 'react'
import { Radio } from 'stardust'
import { Radio } from 'semantic-ui-react'

const RadioSliderExample = () => (
<Radio slider />
Expand Down
2 changes: 1 addition & 1 deletion docs/app/Examples/addons/Radio/Types/Toggle.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from 'react'
import { Radio } from 'stardust'
import { Radio } from 'semantic-ui-react'

const RadioToggleExample = () => (
<Radio toggle />
Expand Down
2 changes: 1 addition & 1 deletion docs/app/Examples/addons/Radio/Variations/Fitted.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from 'react'
import { Radio, Segment } from 'stardust'
import { Radio, Segment } from 'semantic-ui-react'

const RadioFittedExample = () => (
<div>
Expand Down
2 changes: 1 addition & 1 deletion docs/app/Examples/addons/Radio/Variations/index.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React from 'react'
import ComponentExample from 'docs/app/Components/ComponentDoc/ComponentExample'
import ExampleSection from 'docs/app/Components/ComponentDoc/ExampleSection'
import { Message } from 'stardust'
import { Message } from 'semantic-ui-react'

const RadioVariationsExamples = () => (
<ExampleSection title='Variations'>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from 'react'
import { Breadcrumb } from 'stardust'
import { Breadcrumb } from 'semantic-ui-react'

const BreadcrumbDividerExample = () => (
<Breadcrumb>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from 'react'
import { Breadcrumb } from 'stardust'
import { Breadcrumb } from 'semantic-ui-react'

const sections = [
{ text: 'Home', link: true },
Expand Down
Loading