-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
update "yarn build" improve build generation Update Loader component update Loader Test snapshots add layout component (css part) optimize Layout component update icon size update tests Add storybook build/deploy Add Button component with theme management Make SideBar themable and remove semantic ui dependencies Add themable Dropdown component Add Themable Layout Component Add fontawesome icons Add title to navbar Add MergeTheme management upfate fontawesome version Fix SVG Icons import problem when integrating with Apps upgrade fontawesome fix fontawesome import update fontawesome package export Button component add dropdown auto positioning management add @babel/plugin-proposal-class-properties Add button loading state Add Plop to generate component template files gitignore logs Add caret to the dropdown Add checkbox component Add Toggle Component Add Color story
- Loading branch information
Showing
65 changed files
with
10,317 additions
and
12,221 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
{ | ||
"presets": [ | ||
"@babel/preset-env", | ||
"@babel/preset-react" | ||
], | ||
"plugins": [ | ||
"@babel/plugin-proposal-class-properties", | ||
] | ||
} |
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 |
---|---|---|
@@ -1,2 +1,10 @@ | ||
node_modules/ | ||
dist/ | ||
.build-storybook | ||
|
||
# Logs | ||
logs | ||
*.log | ||
npm-debug.log* | ||
yarn-debug.log* | ||
yarn-error.log* |
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 |
---|---|---|
@@ -1 +1,36 @@ | ||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/semantic-ui@2.4.2/dist/semantic.min.css"> | ||
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.7.2/css/all.css" integrity="sha384-fnmOCqbTlWIlj8LyTjo7mOUStjsKC4pOpQbqyi7RrhN7udi9RwhKkMHpvLbHG9Sr" crossorigin="anonymous"> | ||
<style> | ||
html, body { | ||
font-family: "Font Awesome 5 Free"; | ||
} | ||
.main { | ||
display: flex; | ||
justify-content: center; | ||
align-items: center; | ||
} | ||
|
||
.storybook-button .sc-button{ | ||
margin: 10px; | ||
} | ||
|
||
.storybook-dropdown .sc-dropdown{ | ||
margin: 10px; | ||
} | ||
|
||
.card { | ||
margin: 15px; | ||
height: 150px; | ||
width: 100px; | ||
display: flex; | ||
flex-direction: column; | ||
} | ||
|
||
.card .color { | ||
height: 120px; | ||
width: 100px; | ||
} | ||
|
||
.card .text { | ||
font-weight: bold; | ||
} | ||
</style> |
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 @@ | ||
Licensed under the Scality RING license. |
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 |
---|---|---|
@@ -1,45 +1,64 @@ | ||
{ | ||
"name": "scality-ui", | ||
"version": "0.1.0", | ||
"description": "Scality commun React component library", | ||
"repository": { | ||
"type": "git", | ||
"url": "git://bitbucket.org/scality/scality-ui.git" | ||
}, | ||
"author": "Scality Engineering", | ||
"license": "SEE LICENSE IN LICENSE", | ||
"main": "dist/index.js", | ||
"module": "dist/index.js", | ||
"files": ["dist"], | ||
"mainSrc": "src/lib/index.js", | ||
"resolutions": { | ||
"babel-core": "7.0.0-bridge.0" | ||
}, | ||
"devDependencies": { | ||
"@babel/core": "^7.2.2", | ||
"@babel/polyfill": "^7.0.0", | ||
"@babel/cli": "^7.0.0", | ||
"@babel/core": "7.2.2", | ||
"@babel/plugin-proposal-class-properties": "^7.0.0", | ||
"@babel/polyfill": "7.2.5", | ||
"@babel/preset-env": "7.2.3", | ||
"@babel/preset-react": "7.0.0", | ||
"@babel/register": "7.0.0", | ||
"@babel/runtime": "7.2.0", | ||
"@fortawesome/fontawesome-free": "5.7.2", | ||
"@storybook/addon-actions": "^4.0.12", | ||
"@storybook/addon-info": "^4.0.12", | ||
"@storybook/addon-links": "^4.0.12", | ||
"@storybook/addon-knobs": "^4.0.12", | ||
"@storybook/addon-storyshots": "^4.0.12", | ||
"@storybook/react": "^4.0.12", | ||
"babel-cli": "^6.26.0", | ||
"babel-core": "7.0.0-beta.3", | ||
"babel-loader": "8.0.4", | ||
"babel-jest": "23.6.0", | ||
"babel-plugin-lodash": "3.3.4", | ||
"color": "3.1.0", | ||
"enzyme": "^3.8.0", | ||
"enzyme-adapter-react-15": "^1.2.0", | ||
"enzyme-adapter-react-16": "^1.7.0", | ||
"plop": "^2.2.1", | ||
"react": "^16.7.0", | ||
"react-dom": "^16.7.0", | ||
"react-scripts": "2.1.3", | ||
"react-storybook-addon-props-combinations": "^1.1.0", | ||
"react-test-renderer": "^16.7.0", | ||
"semantic-ui-css": "^2.4.1", | ||
"semantic-ui-react": "^0.85.0", | ||
"rimraf": "^2.6.1", | ||
"styled-components": "^4.1.2" | ||
}, | ||
"peerDependencies": { | ||
"@fortawesome/fontawesome-free": "5.7.2", | ||
"react": "^16.7.0", | ||
"react-dom": "^16.7.0" | ||
}, | ||
"scripts": { | ||
"test": "react-scripts test --env=jsdom", | ||
"storybook": "start-storybook -p 6006", | ||
"build": | ||
"rm -rf dist && NODE_ENV=production babel src/lib --out-dir dist --copy-files --ignore __tests__,spec.js,test.js,__snapshots__" | ||
"start": "start-storybook -p 3000", | ||
"build": "rimraf dist && NODE_ENV=production babel src/lib --out-dir dist --copy-files && rimraf dist/**/*.test.js && rimraf dist/**/__snapshots__", | ||
"storybook:build": "build-storybook -c .storybook -o .build-storybook", | ||
"plop": "plop" | ||
}, | ||
"eslintConfig": { | ||
"extends": "react-app" | ||
}, | ||
"browserslist": [ | ||
">0.2%", | ||
"not dead", | ||
"not ie <= 11", | ||
"not op_mini all" | ||
] | ||
} | ||
} | ||
} |
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,7 @@ | ||
import { configure } from "@storybook/react"; | ||
|
||
function loadStories() { | ||
require("../../../../../stories/{{lowerCase name}}"); | ||
} | ||
|
||
configure(loadStories, module); |
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,14 @@ | ||
import React from "react"; | ||
import styled from "styled-components"; | ||
|
||
const {{properCase name}}Container = styled.div``; | ||
|
||
function {{properCase name}}(props) { | ||
return ( | ||
<{{properCase name}}Container className="sc-{{lowerCase name}}"> | ||
|
||
</{{properCase name}}Container> | ||
); | ||
} | ||
|
||
export default {{properCase name}}; |
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,5 @@ | ||
import initStoryshots from "@storybook/addon-storyshots"; | ||
|
||
initStoryshots({ | ||
configPath: "src/lib/components/{{lowerCase name}}/__snapshots__" | ||
}); |
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,30 @@ | ||
import React from "react"; | ||
import { storiesOf } from "@storybook/react"; | ||
import { ThemeProvider } from "styled-components"; | ||
import {{properCase name}} from "../src/lib/components/{{lowerCase name}}/{{properCase name}}.component"; | ||
import { jade } from "../src/lib/style/theme"; | ||
|
||
storiesOf("{{properCase name}}", module) | ||
.add("Default", () => { | ||
return ( | ||
<div> | ||
<{{properCase name}} /> | ||
</div> | ||
); | ||
}) | ||
.add("ThemeProvider", () => { | ||
const theme = { | ||
brand: { | ||
primary: jade | ||
} | ||
}; | ||
return ( | ||
<div> | ||
<ThemeProvider theme={theme}> | ||
<div> | ||
<{{properCase name}} /> | ||
</div> | ||
</ThemeProvider> | ||
</div> | ||
); | ||
}); |
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,43 @@ | ||
module.exports = function(plop) { | ||
plop.addHelper("lowerCase", text => text.toLowerCase()); | ||
plop.addHelper("properCase", text => | ||
text.replace(/\w\S*/g, function(txt) { | ||
return txt.charAt(0).toUpperCase() + txt.substr(1); | ||
}) | ||
); | ||
|
||
plop.setGenerator("component", { | ||
description: "Add a react component", | ||
prompts: [ | ||
{ | ||
type: "input", | ||
name: "name", | ||
message: "Component name please (ex: layout, breadcrumbs, menuItem)!" | ||
} | ||
], | ||
actions: [ | ||
{ | ||
type: "add", | ||
path: | ||
"src/lib/components/{{lowerCase name}}/{{properCase name}}.component.js", | ||
templateFile: "plop-templates/component.hbs" | ||
}, | ||
{ | ||
type: "add", | ||
path: | ||
"src/lib/components/{{lowerCase name}}/{{properCase name}}.component.test.js", | ||
templateFile: "plop-templates/component.test.hbs" | ||
}, | ||
{ | ||
type: "add", | ||
path: "src/lib/components/{{lowerCase name}}/__snapshots__/config.js", | ||
templateFile: "plop-templates/component.config.hbs" | ||
}, | ||
{ | ||
type: "add", | ||
path: "stories/{{lowerCase name}}.js", | ||
templateFile: "plop-templates/stories.hbs" | ||
} | ||
] | ||
}); | ||
}; |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.