@sellout/ui 0.0.5 → 0.0.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,7 +1,22 @@
1
1
  {
2
2
  "name": "@sellout/ui",
3
- "version": "0.0.5",
4
- "dependencies": {
3
+ "version": "0.0.6",
4
+ "main": "build/index.js",
5
+ "module": "build/index.es.js",
6
+ "jsnext:main": "build/index.es.js",
7
+ "scripts": {
8
+ "prepare": "npm run build",
9
+ "build": "rollup -c",
10
+ "start": "rollup -c -w",
11
+ "test": "jest --coverage",
12
+ "storybook": "start-storybook -p 9009 -s public",
13
+ "build-storybook": "build-storybook -s public"
14
+ },
15
+ "keywords": [],
16
+ "author": "",
17
+ "license": "ISC",
18
+ "devDependencies": {
19
+ "@babel/core": "^7.7.7",
5
20
  "@fortawesome/fontawesome-svg-core": "^1.2.27",
6
21
  "@fortawesome/free-regular-svg-icons": "^5.12.1",
7
22
  "@fortawesome/free-solid-svg-icons": "^5.12.1",
@@ -9,55 +24,58 @@
9
24
  "@fortawesome/pro-regular-svg-icons": "^5.12.1",
10
25
  "@fortawesome/pro-solid-svg-icons": "^5.12.1",
11
26
  "@fortawesome/react-fontawesome": "^0.1.9",
12
- "@rehooks/component-size": "^1.0.3",
13
- "@sellout/utils": "^0.0.5",
27
+ "@sellout/utils": "^0.0.6",
28
+ "@storybook/addon-actions": "^5.3.17",
29
+ "@storybook/addon-links": "^5.3.17",
30
+ "@storybook/react": "^5.2.8",
14
31
  "@testing-library/jest-dom": "^4.2.4",
15
- "@testing-library/react": "^9.5.0",
32
+ "@testing-library/react": "^9.4.0",
16
33
  "@testing-library/user-event": "^7.2.1",
17
- "@types/jest": "^24.9.1",
18
- "@types/node": "^12.12.30",
19
- "@types/react": "^16.9.23",
20
- "@types/react-dom": "^16.9.5",
34
+ "@types/jest": "^24.0.24",
35
+ "@types/react": "^16.9.17",
36
+ "@types/react-dom": "^16.9.4",
37
+ "@types/styled-components": "^5.0.1",
38
+ "awesome-typescript-loader": "^5.2.1",
39
+ "babel-loader": "^8.0.6",
40
+ "jest": "^24.9.0",
21
41
  "polished": "^3.4.4",
22
42
  "react": "^16.13.0",
23
43
  "react-animate-height": "^2.0.20",
24
44
  "react-dom": "^16.13.0",
25
- "react-scripts": "3.4.0",
45
+ "rollup": "^1.27.13",
46
+ "rollup-plugin-commonjs": "^10.1.0",
47
+ "rollup-plugin-node-resolve": "^5.2.0",
48
+ "rollup-plugin-peer-deps-external": "^2.2.0",
49
+ "rollup-plugin-typescript2": "^0.25.3",
50
+ "standard": "^14.3.1",
26
51
  "styled-components": "^5.0.1",
52
+ "ts-jest": "^24.2.0",
27
53
  "typescript": "^3.7.5"
28
54
  },
29
- "scripts": {
30
- "prepare": "npm run build",
31
- "start": "react-scripts start",
32
- "build": "react-scripts build",
33
- "test": "react-scripts test",
34
- "eject": "react-scripts eject",
35
- "storybook": "start-storybook -p 9009 -s public",
36
- "build-storybook": "build-storybook -s public"
55
+ "gitHead": "293473fa4ad310e0ce454b24ba2670109bac0b4c",
56
+ "peerDependencies": {
57
+ "react": "^16",
58
+ "react-dom": "^16"
37
59
  },
38
- "eslintConfig": {
39
- "extends": "react-app"
60
+ "jest": {
61
+ "preset": "ts-jest",
62
+ "testEnvironment": "jsdom",
63
+ "testPathIgnorePatterns": [
64
+ "build/"
65
+ ]
40
66
  },
41
- "browserslist": {
42
- "production": [
43
- ">0.2%",
44
- "not dead",
45
- "not op_mini all"
67
+ "standard": {
68
+ "ignore": [
69
+ "node_modules/",
70
+ "build/"
46
71
  ],
47
- "development": [
48
- "last 1 chrome version",
49
- "last 1 firefox version",
50
- "last 1 safari version"
72
+ "globals": [
73
+ "describe",
74
+ "it",
75
+ "test",
76
+ "expect",
77
+ "afterAll",
78
+ "jest"
51
79
  ]
52
- },
53
- "devDependencies": {
54
- "@storybook/addon-actions": "^5.3.17",
55
- "@storybook/addon-links": "^5.3.17",
56
- "@storybook/addons": "^5.3.17",
57
- "@storybook/preset-create-react-app": "^2.0.0",
58
- "@storybook/react": "^5.3.17",
59
- "@types/styled-components": "^5.0.1",
60
- "csvtojson": "^2.0.10"
61
- },
62
- "gitHead": "5af90cec2aeb461ce24ab03508bd8cb705de8ae3"
80
+ }
63
81
  }
@@ -0,0 +1,55 @@
1
+ import typescript from 'rollup-plugin-typescript2'
2
+ import commonjs from 'rollup-plugin-commonjs'
3
+ import external from 'rollup-plugin-peer-deps-external'
4
+ import resolve from 'rollup-plugin-node-resolve'
5
+
6
+ import pkg from './package.json'
7
+
8
+ export default {
9
+ input: 'src/index.ts',
10
+ output: [
11
+ {
12
+ file: pkg.main,
13
+ format: 'cjs',
14
+ exports: 'named',
15
+ sourcemap: true
16
+ },
17
+ {
18
+ file: pkg.module,
19
+ format: 'es',
20
+ exports: 'named',
21
+ sourcemap: true
22
+ }
23
+ ],
24
+ plugins: [
25
+ external(),
26
+ resolve(),
27
+ typescript({
28
+ rollupCommonJSResolveHack: true,
29
+ exclude: [
30
+ '**/*.stories.js'
31
+ ],
32
+ clean: true
33
+ }),
34
+ commonjs({
35
+ include: 'node_modules/**',
36
+ // left-hand side can be an absolute path, a path
37
+ // relative to the current directory, or the name
38
+ // of a module in node_modules
39
+ namedExports: {
40
+ 'node_modules/react/index.js': [
41
+ 'cloneElement',
42
+ 'createContext',
43
+ 'Component',
44
+ 'createElement'
45
+ ],
46
+ 'node_modules/react-dom/index.js': ['render', 'hydrate'],
47
+ 'node_modules/react-is/index.js': [
48
+ 'isElement',
49
+ 'isValidElementType',
50
+ 'ForwardRef'
51
+ ]
52
+ }
53
+ }),
54
+ ]
55
+ }
package/src/Colors.ts CHANGED
@@ -1,5 +1,7 @@
1
1
  export enum Colors {
2
2
  White = "#FFFFFF",
3
+ OffWhite = '#FCFCFC',
4
+ Blue = '#020151',
3
5
  Red = "#E63946",
4
6
  Orange = "#FF700F",
5
7
  DarkOrange = "#D65600",
@@ -38,6 +38,7 @@ const StyledButton = styled.div<StyledButtonProps>`
38
38
  if (props.type === ButtonTypes.Submit) {
39
39
  return Colors.Orange;
40
40
  }
41
+ return null;
41
42
  }};
42
43
 
43
44
  &:hover {
@@ -46,6 +47,7 @@ const StyledButton = styled.div<StyledButtonProps>`
46
47
  if (props.onClick && props.type === ButtonTypes.Submit) {
47
48
  return Polished.lighten(0.025, Colors.Orange);
48
49
  }
50
+ return null;
49
51
  }};
50
52
  }
51
53
 
@@ -55,6 +57,7 @@ const StyledButton = styled.div<StyledButtonProps>`
55
57
  if (props.onClick && props.type === ButtonTypes.Submit) {
56
58
  return Polished.darken(0.025, Colors.Orange);
57
59
  }
60
+ return null;
58
61
  }};
59
62
  }
60
63
  `;
@@ -73,6 +76,7 @@ const Text = styled.span<TextProps>`
73
76
  if (props.type === ButtonTypes.Submit) {
74
77
  return Colors.White;
75
78
  }
79
+ return null;
76
80
  }};
77
81
  `;
78
82
 
@@ -1,5 +1,5 @@
1
1
  import React, { Fragment, useState } from "react";
2
- import styled from 'styled-components';
2
+ import styled from "styled-components";
3
3
  import * as Polished from 'polished';
4
4
  import { Colors } from "../Colors";
5
5
  import Icon, { Icons } from './Icon'
@@ -4,7 +4,7 @@ import * as Polished from "polished";
4
4
  import AnimateHeight from "react-animate-height";
5
5
  import { Colors } from "../Colors";
6
6
  import Counter, { CounterProps } from './Counter';
7
- import * as PriceUtil from '@sellout/utils/.dist/price';
7
+ // import * as PriceUtil from '@sellout/utils/.dist/price';
8
8
  // import Icon from "./Icon";
9
9
 
10
10
  type RowProps = {
@@ -124,7 +124,7 @@ export default function Product({
124
124
  <Row justify="space-between">
125
125
  <Column>
126
126
  <Title>{title}</Title>
127
- <Price>{PriceUtil.output(price)}</Price>
127
+ <Price>${price}</Price>
128
128
  </Column>
129
129
  <Counter
130
130
  value={value}
@@ -136,23 +136,23 @@ export default function Product({
136
136
  </Row>
137
137
  <Row>
138
138
  {subtitle && <Subtitle>{subtitle}</Subtitle>}
139
- {(() => {
140
- if (!description) return;
141
-
142
- return (
143
- <Fragment>
144
- <AnimateHeight height={showMore ? "auto" : 67}>
145
- <Ellipsis active={showEllipsis}>
146
- <Description>{description}</Description>
147
- </Ellipsis>
148
- </AnimateHeight>
149
- <ShowMore onClick={() => toggle()}>
150
- {showMore ? "Show Less" : "Show More"}
151
- </ShowMore>
152
- </Fragment>
153
- );
154
- })()}
155
139
  </Row>
140
+ {(() => {
141
+ if (!description) return;
142
+
143
+ return (
144
+ <Fragment>
145
+ <AnimateHeight height={showMore ? "auto" : 67}>
146
+ <Ellipsis active={showEllipsis}>
147
+ <Description>{description}</Description>
148
+ </Ellipsis>
149
+ </AnimateHeight>
150
+ <ShowMore onClick={() => toggle()}>
151
+ {showMore ? "Show Less" : "Show More"}
152
+ </ShowMore>
153
+ </Fragment>
154
+ );
155
+ })()}
156
156
  </Container>
157
157
  );
158
158
  }
package/src/index.ts ADDED
@@ -0,0 +1,21 @@
1
+ import { Colors } from "./Colors";
2
+ import Button from './components/Button';
3
+ import Counter from "./components/Counter";
4
+ import Icon from "./components/Icon";
5
+ import { IconEnum } from "./components/Icons";
6
+ import Input from "./components/Input";
7
+ import Loader from "./components/Loader";
8
+ import Product from "./components/Product";
9
+
10
+ const Icons = IconEnum;
11
+
12
+ export {
13
+ Colors,
14
+ Button,
15
+ Counter,
16
+ Icon,
17
+ Icons,
18
+ Input,
19
+ Loader,
20
+ Product,
21
+ };
package/tsconfig.json CHANGED
@@ -1,25 +1,24 @@
1
1
  {
2
2
  "compilerOptions": {
3
- "target": "es5",
4
- "lib": [
5
- "dom",
6
- "dom.iterable",
7
- "esnext"
8
- ],
9
- "allowJs": true,
10
- "skipLibCheck": true,
11
- "esModuleInterop": true,
12
- "allowSyntheticDefaultImports": true,
13
- "strict": true,
14
- "forceConsistentCasingInFileNames": true,
3
+ "outDir": "build",
15
4
  "module": "esnext",
5
+ "target": "es5",
6
+ "lib": ["es6", "dom", "es2016", "es2017"],
7
+ "sourceMap": true,
8
+ "allowJs": false,
9
+ "jsx": "react",
10
+ "declaration": true,
16
11
  "moduleResolution": "node",
17
- "resolveJsonModule": true,
18
- "isolatedModules": true,
19
- "noEmit": true,
20
- "jsx": "react"
12
+ "forceConsistentCasingInFileNames": true,
13
+ "noImplicitReturns": true,
14
+ "noImplicitThis": true,
15
+ "noImplicitAny": true,
16
+ "strictNullChecks": true,
17
+ "suppressImplicitAnyIndexErrors": true,
18
+ "noUnusedLocals": true,
19
+ "noUnusedParameters": true,
20
+ "esModuleInterop": true
21
21
  },
22
- "include": [
23
- "src"
24
- ]
25
- }
22
+ "include": ["src"],
23
+ "exclude": ["node_modules", "build"]
24
+ }
@@ -1,8 +0,0 @@
1
- module.exports = {
2
- stories: ['../src/**/*.stories.js'],
3
- addons: [
4
- '@storybook/preset-create-react-app',
5
- '@storybook/addon-actions',
6
- '@storybook/addon-links',
7
- ],
8
- };
package/README.md DELETED
@@ -1,44 +0,0 @@
1
- This project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app).
2
-
3
- ## Available Scripts
4
-
5
- In the project directory, you can run:
6
-
7
- ### `npm start`
8
-
9
- Runs the app in the development mode.<br />
10
- Open [http://localhost:3000](http://localhost:3000) to view it in the browser.
11
-
12
- The page will reload if you make edits.<br />
13
- You will also see any lint errors in the console.
14
-
15
- ### `npm test`
16
-
17
- Launches the test runner in the interactive watch mode.<br />
18
- See the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information.
19
-
20
- ### `npm run build`
21
-
22
- Builds the app for production to the `build` folder.<br />
23
- It correctly bundles React in production mode and optimizes the build for the best performance.
24
-
25
- The build is minified and the filenames include the hashes.<br />
26
- Your app is ready to be deployed!
27
-
28
- See the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information.
29
-
30
- ### `npm run eject`
31
-
32
- **Note: this is a one-way operation. Once you `eject`, you can’t go back!**
33
-
34
- If you aren’t satisfied with the build tool and configuration choices, you can `eject` at any time. This command will remove the single build dependency from your project.
35
-
36
- Instead, it will copy all the configuration files and the transitive dependencies (webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except `eject` will still work, but they will point to the copied scripts so you can tweak them. At this point you’re on your own.
37
-
38
- You don’t have to ever use `eject`. The curated feature set is suitable for small and middle deployments, and you shouldn’t feel obligated to use this feature. However we understand that this tool wouldn’t be useful if you couldn’t customize it when you are ready for it.
39
-
40
- ## Learn More
41
-
42
- You can learn more in the [Create React App documentation](https://facebook.github.io/create-react-app/docs/getting-started).
43
-
44
- To learn React, check out the [React documentation](https://reactjs.org/).
Binary file
package/public/index.html DELETED
@@ -1,43 +0,0 @@
1
- <!DOCTYPE html>
2
- <html lang="en">
3
- <head>
4
- <meta charset="utf-8" />
5
- <link rel="icon" href="%PUBLIC_URL%/favicon.ico" />
6
- <meta name="viewport" content="width=device-width, initial-scale=1" />
7
- <meta name="theme-color" content="#000000" />
8
- <meta
9
- name="description"
10
- content="Web site created using create-react-app"
11
- />
12
- <link rel="apple-touch-icon" href="%PUBLIC_URL%/logo192.png" />
13
- <!--
14
- manifest.json provides metadata used when your web app is installed on a
15
- user's mobile device or desktop. See https://developers.google.com/web/fundamentals/web-app-manifest/
16
- -->
17
- <link rel="manifest" href="%PUBLIC_URL%/manifest.json" />
18
- <!--
19
- Notice the use of %PUBLIC_URL% in the tags above.
20
- It will be replaced with the URL of the `public` folder during the build.
21
- Only files inside the `public` folder can be referenced from the HTML.
22
-
23
- Unlike "/favicon.ico" or "favicon.ico", "%PUBLIC_URL%/favicon.ico" will
24
- work correctly both with client-side routing and a non-root public URL.
25
- Learn how to configure a non-root public URL by running `npm run build`.
26
- -->
27
- <title>React App</title>
28
- </head>
29
- <body>
30
- <noscript>You need to enable JavaScript to run this app.</noscript>
31
- <div id="root"></div>
32
- <!--
33
- This HTML file is a template.
34
- If you open it directly in the browser, you will see an empty page.
35
-
36
- You can add webfonts, meta tags, or analytics to this file.
37
- The build step will place the bundled scripts into the <body> tag.
38
-
39
- To begin the development, run `npm start` or `yarn start`.
40
- To create a production bundle, use `npm run build` or `yarn build`.
41
- -->
42
- </body>
43
- </html>
Binary file
Binary file
@@ -1,25 +0,0 @@
1
- {
2
- "short_name": "React App",
3
- "name": "Create React App Sample",
4
- "icons": [
5
- {
6
- "src": "favicon.ico",
7
- "sizes": "64x64 32x32 24x24 16x16",
8
- "type": "image/x-icon"
9
- },
10
- {
11
- "src": "logo192.png",
12
- "type": "image/png",
13
- "sizes": "192x192"
14
- },
15
- {
16
- "src": "logo512.png",
17
- "type": "image/png",
18
- "sizes": "512x512"
19
- }
20
- ],
21
- "start_url": ".",
22
- "display": "standalone",
23
- "theme_color": "#000000",
24
- "background_color": "#ffffff"
25
- }
package/public/robots.txt DELETED
@@ -1,3 +0,0 @@
1
- # https://www.robotstxt.org/robotstxt.html
2
- User-agent: *
3
- Disallow:
package/src/index.tsx DELETED
@@ -1,8 +0,0 @@
1
- import React from 'react';
2
- import ReactDOM from 'react-dom';
3
-
4
- ReactDOM.render(<div />, document.getElementById('root'));
5
-
6
- // If you want your app to work offline and load faster, you can change
7
- // unregister() to register() below. Note this comes with some pitfalls.
8
- // Learn more about service workers: https://bit.ly/CRA-PWA
@@ -1 +0,0 @@
1
- /// <reference types="react-scripts" />
package/src/setupTests.ts DELETED
@@ -1,5 +0,0 @@
1
- // jest-dom adds custom jest matchers for asserting on DOM nodes.
2
- // allows you to do things like:
3
- // expect(element).toHaveTextContent(/react/i)
4
- // learn more: https://github.com/testing-library/jest-dom
5
- import '@testing-library/jest-dom/extend-expect';