@sellout/ui 0.0.1

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.
@@ -0,0 +1,30 @@
1
+ import React from 'react';
2
+ import styled from 'styled-components';
3
+ import { action } from '@storybook/addon-actions';
4
+ import Button from '../components/Button';
5
+
6
+ const Container = styled.div`
7
+ width: 300px;
8
+ padding: 20px;
9
+ `;
10
+
11
+ export default {
12
+ title: 'Button',
13
+ component: Button,
14
+ };
15
+
16
+ export const Text = () => (
17
+ <Container>
18
+ <Button text="Next" onClick={action('clicked')} />
19
+ </Container>
20
+ );
21
+
22
+ export const Loading = () => (
23
+ <Container>
24
+ <Button loading={true} />
25
+ </Container>
26
+ );
27
+
28
+ export const MaxWidth = () => (
29
+ <Button text="Create Event" onClick={action('clicked')} />
30
+ );
@@ -0,0 +1,30 @@
1
+ import React, { useState } from 'react';
2
+ import styled from 'styled-components';
3
+ import { action } from '@storybook/addon-actions';
4
+ import Counter from '../components/Counter';
5
+ import { Icons } from '../components/Icon';
6
+
7
+ const Container = styled.div`
8
+ width: 370px;
9
+ padding: 20px;
10
+ `;
11
+
12
+ export default {
13
+ title: 'Counter',
14
+ component: Counter,
15
+ };
16
+
17
+ export const Default = () => {
18
+ const [value, setValue] = useState(0);
19
+ return (
20
+ <Container>
21
+ <Counter
22
+ value={value}
23
+ minValue={0}
24
+ maxValue={10}
25
+ onIncrement={() => setValue(value + 1)}
26
+ onDecrement={() => setValue(value - 1)}
27
+ />
28
+ </Container>
29
+ );
30
+ };
@@ -0,0 +1,25 @@
1
+ import React from 'react';
2
+ import styled from 'styled-components';
3
+ import { action } from '@storybook/addon-actions';
4
+ import Icon, { Icons } from '../components/Icon';
5
+ import { Colors } from '../Colors';
6
+
7
+ const Container = styled.div`
8
+ width: 300px;
9
+ padding: 20px;
10
+ `;
11
+
12
+ export default {
13
+ title: 'Icon',
14
+ component: Icon,
15
+ };
16
+
17
+ export const Plain = () => (
18
+ <Container>
19
+ <Icon
20
+ icon={Icons.AudienceRegular}
21
+ onClick={action('Clicked')}
22
+ color={Colors.Orange}
23
+ />
24
+ </Container>
25
+ );
@@ -0,0 +1,79 @@
1
+ import React, { useState } from 'react';
2
+ import styled from 'styled-components';
3
+ import { action } from '@storybook/addon-actions';
4
+ import Input from '../components/Input';
5
+ import { Icons } from '../components/Icon';
6
+
7
+ const Container = styled.div`
8
+ width: 370px;
9
+ padding: 20px;
10
+ `;
11
+
12
+ export default {
13
+ title: 'Input',
14
+ component: Input,
15
+ };
16
+
17
+ export const Clear = () => {
18
+ const [value, setValue] = useState('');
19
+ return (
20
+ <Container>
21
+ <Input
22
+ placeholder="Enter your email address"
23
+ value={value}
24
+ icon={Icons.Unlock}
25
+ onChange={e => {
26
+ action('onChange')();
27
+ setValue(e.target.value);
28
+ }}
29
+ onClear={() => {
30
+ action('onClear')();
31
+ setValue('');
32
+ }}
33
+ onBlur={action('onBlur')}
34
+ onFocus={action('onFocus')}
35
+ />
36
+ </Container>
37
+ );
38
+ };
39
+
40
+ export const Submit = () => {
41
+ const [loading, setLoading] = useState(false);
42
+ const [value, setValue] = useState('');
43
+ return (
44
+ <Container>
45
+ <Input
46
+ placeholder="Enter your email address"
47
+ value={value}
48
+ icon={Icons.EnvelopeSolid}
49
+ onChange={e => {
50
+ action('onChange')();
51
+ setValue(e.target.value);
52
+ } }
53
+ onBlur={action('onBlur')}
54
+ onFocus={action('onFocus')}
55
+ canSubmit={value.length > 7}
56
+ onSubmit={() => {
57
+ action('onSubmit')();
58
+ setLoading(true);
59
+ setTimeout(() => setLoading(false), 3000);
60
+ }}
61
+ loading={loading}
62
+ />
63
+ </Container>
64
+ );
65
+ };
66
+
67
+ export const Loading = () => (
68
+ <Container>
69
+ <Input
70
+ placeholder="Enter your email address"
71
+ icon={Icons.EnvelopeSolid}
72
+ onChange={action('onChange')}
73
+ onBlur={action('onBlur')}
74
+ onFocus={action('onFocus')}
75
+ onSubmit={action('onSubmit')}
76
+ loading={true}
77
+ />
78
+ </Container>
79
+ );
@@ -0,0 +1,51 @@
1
+ import React from 'react';
2
+ import styled from 'styled-components';
3
+ import { action } from '@storybook/addon-actions';
4
+ import Loader, { LoaderSizes } from '../components/Loader';
5
+ import { Colors } from "../Colors";
6
+
7
+ const Container = styled.div`
8
+ position: absolute;
9
+ background-color: ${props => props.color || Colors.Orange};
10
+ height: 100%;
11
+ width: 100%;
12
+ display: flex;
13
+ align-items: center;
14
+ justify-content: center;
15
+ `;
16
+
17
+ export default {
18
+ title: 'Loader',
19
+ component: Loader,
20
+ };
21
+
22
+ export const VerySmall = () => (
23
+ <Container>
24
+ <Loader size={LoaderSizes.VerySmall} />
25
+ </Container>
26
+ );
27
+
28
+ export const Small = () => (
29
+ <Container>
30
+ <Loader size={LoaderSizes.Small} />
31
+ </Container>
32
+ );
33
+
34
+ export const Medium = () => (
35
+ <Container>
36
+ <Loader size={LoaderSizes.Medium} />
37
+ </Container>
38
+ );
39
+
40
+ export const Large = () => (
41
+ <Container>
42
+ <Loader size={LoaderSizes.Large} />
43
+ </Container>
44
+ );
45
+
46
+
47
+ export const Colored = () => (
48
+ <Container color={Colors.White}>
49
+ <Loader size={LoaderSizes.Medium} color={Colors.Orange}/>
50
+ </Container>
51
+ );
@@ -0,0 +1,69 @@
1
+ import React, { useState } from 'react';
2
+ import styled from 'styled-components';
3
+ import { action } from '@storybook/addon-actions';
4
+ import Product from '../components/Product';
5
+ import { Icons } from '../components/Icon';
6
+ import { Colors } from '../Colors';
7
+
8
+ const Container = styled.div`
9
+ width: 370px;
10
+ padding: 20px;
11
+ background-color: ${Colors.Grey4};
12
+ `;
13
+
14
+ export default {
15
+ title: 'Product',
16
+ component: Product,
17
+ };
18
+
19
+ export const Default = () => {
20
+ const [value, setValue] = useState(0);
21
+
22
+ const product = {
23
+ title: 'General Admission',
24
+ price: 1000,
25
+ subtitle: 'Comes with a free drink upgrade',
26
+ description: 'Do consequat ut ad enim. Minim commodo in Lorem aliqua aliquip cupidatat voluptate. Fugiat et incididunt enim pariatur eiusmod. Ex id sit nisi mollit laborum id ad. Ut aliquip nulla laboris eu occaecat tempor voluptate Lorem fugiat veniam elit ut eu quis. Aliqua reprehenderit mollit magna et fugiat sit cupidatat aliqua cillum dolore veniam. Sint anim incididunt ea consequat cillum laborum eu. Aute ipsum consequat cupidatat enim dolore amet incididunt occaecat esse consectetur occaecat. Dolor est ad ullamco fugiat occaecat anim minim aliqua Lorem. Ad culpa ipsum in labore minim sunt laboris nulla laboris.'
27
+ };
28
+
29
+ return (
30
+ <Container>
31
+ <Product
32
+ title={product.title}
33
+ price={product.price}
34
+ subtitle={product.subtitle}
35
+ description={product.description}
36
+ value={value}
37
+ minValue={0}
38
+ maxValue={10}
39
+ onIncrement={() => setValue(value + 1)}
40
+ onDecrement={() => setValue(value - 1)}
41
+ />
42
+ </Container>
43
+ );
44
+ };
45
+
46
+ export const Simple = () => {
47
+ const [value, setValue] = useState(0);
48
+
49
+ const product = {
50
+ title: 'General Admission',
51
+ price: 1000,
52
+ };
53
+
54
+ return (
55
+ <Container>
56
+ <Product
57
+ title={product.title}
58
+ price={product.price}
59
+ subtitle={product.subtitle}
60
+ description={product.description}
61
+ value={value}
62
+ minValue={0}
63
+ maxValue={10}
64
+ onIncrement={() => setValue(value + 1)}
65
+ onDecrement={() => setValue(value - 1)}
66
+ />
67
+ </Container>
68
+ );
69
+ };
package/tsconfig.json ADDED
@@ -0,0 +1,25 @@
1
+ {
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,
15
+ "module": "esnext",
16
+ "moduleResolution": "node",
17
+ "resolveJsonModule": true,
18
+ "isolatedModules": true,
19
+ "noEmit": true,
20
+ "jsx": "react"
21
+ },
22
+ "include": [
23
+ "src"
24
+ ]
25
+ }
@@ -0,0 +1,37 @@
1
+ const csvFilePath = './icon-library.csv';
2
+ const csv = require('csvtojson');
3
+
4
+ csv()
5
+ .fromFile(csvFilePath)
6
+ .then((jsonObj) => {
7
+ const icons = jsonObj.reduce((cur, icon) => {
8
+ let key = `${icon.Library}-${icon.Weight}`.toLowerCase();
9
+ if(key.charAt(key.length - 1) === '-') return cur;
10
+ key = `@fortawesome/${key}-svg-icons`;
11
+
12
+ icon = {
13
+ import: `import { ${icon['FA Name']} as ${icon.Name}} from '${key}'`,
14
+ export: `${icon.Name}`,
15
+ };
16
+
17
+ if(cur[key]) {
18
+ cur[key].push(icon);
19
+ } else {
20
+ cur[key] = [icon];
21
+ }
22
+ return cur;
23
+ }, {});
24
+
25
+ let importText = '';
26
+ let exportText = 'export enum Icons {\n';
27
+
28
+ Object.values(icons).flat().forEach((icon) => {
29
+ importText += icon.import + '\n';
30
+ exportText += icon.export + ',\n\t';
31
+ })
32
+ exportText += '}'
33
+
34
+ console.log(second);
35
+ })
36
+ .catch(e => console.error(e));
37
+
@@ -0,0 +1,98 @@
1
+ Name,Icon,Library,Weight,FA Name
2
+ ,,,,
3
+ AudienceRegular,FontAwesome%20Library/user-friends-regular.svg,Pro,Regular,faUserFriends
4
+ Amex,FontAwesome%20Library/cc-amex-brands.svg,Brands,,faCcAmex
5
+ AudienceSolid,FontAwesome%20Library/user-friends-solid.svg,Free,Solid,faUserFriends
6
+ BackArrow,FontAwesome%20Library/arrow-left-solid.svg,Free,Solid,faArrowLeft
7
+ Bold,FontAwesome%20Library/bold-solid.svg,Free,Solid,faBold
8
+ BoxOfficeRegular,FontAwesome%20Library/cash-register-regular.svg,Pro,Regular,faCashRegister
9
+ BoxOfficeSolid,FontAwesome%20Library/cash-register-solid.svg,Free,Solid,faCashRegister
10
+ Bullhorn,FontAwesome%20Library/bullhorn-solid.svg,Free,Solid,faBullhorn
11
+ CalculatorRegular,FontAwesome%20Library/calculator-regular.svg,Pro,Regular,faCalculator
12
+ CalculatorSolid,FontAwesome%20Library/calculator-solid.svg,Free,Solid,faCalculator
13
+ Calendar,FontAwesome%20Library/calendar-alt-regular.svg,Free,Regular,faCalendarAlt
14
+ CalendarDayLight,FontAwesome%20Library/calendar-day-light.svg,Pro,Light,faCalendarDay
15
+ CalendarDaySolid,FontAwesome%20Library/calendar-day-solid.svg,Free,Solid,faCalendarDay
16
+ CalendarStarRegular,FontAwesome%20Library/calendar-star-regular.svg,Pro,Regular,faCalendarStar
17
+ CalendarStarSolid,FontAwesome%20Library/calendar-star-solid.svg,Pro,Solid,faCalendarStar
18
+ Cancel,FontAwesome%20Library/times-solid.svg,Free,Solid,faTimes
19
+ CancelCircle,FontAwesome%20Library/times-circle-solid.svg,Free,Solid,faTimesCircle
20
+ CaretDown,FontAwesome%20Library/caret-down-solid.svg,Free,Solid,faCaretDown
21
+ Cash,FontAwesome%20Library/money-bill-solid.svg,Free,Solid,faMoneyBill
22
+ Check,FontAwesome%20Library/check-regular.svg,Pro,Regular,faCheck
23
+ CheckCircle,FontAwesome%20Library/check-circle-solid.svg,Free,Solid,faCheckCircle
24
+ Cheers,FontAwesome%20Library/glass-cheers-regular.svg,Pro,Regular,faGlassCheers
25
+ Clipboard,FontAwesome%20Library/clipboard-list-regular.svg,Pro,Regular,faClipboardList
26
+ Clock,FontAwesome%20Library/clock-regular.svg,Free,Regular,faClock
27
+ CopyRegular,FontAwesome%20Library/copy-regular_(1).svg,Free,Regular,faCopy
28
+ CopySolid,FontAwesome%20Library/copy-solid.svg,Free,Solid,faCopy
29
+ CreditCardBack,FontAwesome%20Library/credit-card-solid.svg,Free,Solid,faCreditCard
30
+ CreditCardFront,FontAwesome%20Library/credit-card-front-solid.svg,Pro,Solid,faCreditCardFront
31
+ CrownRegular,FontAwesome%20Library/crown-regular.svg,Pro,Regular,faCrown
32
+ CrownSolid,FontAwesome%20Library/crown-solid.svg,Free,Solid,faCrown
33
+ Cursor,FontAwesome%20Library/i-cursor-solid.svg,Free,Solid,faICursor
34
+ DashboardRegular,FontAwesome%20Library/tachometer-regular.svg,Pro,Regular,faTachometer
35
+ DashboardSolid,FontAwesome%20Library/tachometer-solid.svg,Pro,Solid,faTachometer
36
+ DeleteRegular,FontAwesome%20Library/trash-regular.svg,Pro,Regular,faTrash
37
+ DeleteSolid,FontAwesome%20Library/trash-solid.svg,Free,Solid,faTrash
38
+ Discover,FontAwesome%20Library/cc-discover-brands.svg,Brands,,faCcDiscover
39
+ Dollar,FontAwesome%20Library/dollar-sign-regular.svg,Pro,Regular,faDollarSign
40
+ DownArrow,FontAwesome%20Library/arrow-alt-down-regular.svg,Pro,Regular,faArrowAltDown
41
+ DownloadReport,FontAwesome%20Library/file-download-regular.svg,Pro,Regular,faFileDownload
42
+ Edit,FontAwesome%20Library/edit-regular.svg,Free,Regular,faEdit
43
+ Embed,FontAwesome%20Library/code-regular_(1).svg,Pro,Regular,faCode
44
+ EnvelopeSolid,FontAwesome%20Library/envelope-solid.svg,Free,Solid,faEnvelope
45
+ Export,FontAwesome%20Library/file-export-regular.svg,Pro,Regular,faFileExport
46
+ EyeRegular,FontAwesome%20Library/eye-regular.svg,Free,Regular,faEye
47
+ EyeSlashRegular,FontAwesome%20Library/eye-slash-regular_(1).svg,Free,Regular,faEyeSlash
48
+ EyeSolid,FontAwesome%20Library/eye-solid.svg,Free,Solid,faEye
49
+ FeeRegular,FontAwesome%20Library/usd-square-regular.svg,Pro,Regular,faUsdSquare
50
+ FeeSolid,FontAwesome%20Library/usd-square-solid.svg,Pro,Solid,faUsdSquare
51
+ FilterRegular,FontAwesome%20Library/filter-regular.svg,Pro,Regular,faFilter
52
+ GlobeRegular,FontAwesome%20Library/globe-americas-regular.svg,Pro,Regular,faGlobeAmericas
53
+ GraphGrowth,FontAwesome%20Library/chart-line-regular.svg,Pro,Regular,faChartLine
54
+ HelpRegular,FontAwesome%20Library/question-circle-regular.svg,Free,Regular,faQuestionCircle
55
+ HelpSolid,FontAwesome%20Library/question-circle-solid.svg,Free,Solid,faQuestionCircle
56
+ Italic,FontAwesome%20Library/italic-solid.svg,Free,Solid,faItalic
57
+ KeyRegular,FontAwesome%20Library/key-skeleton-regular.svg,Pro,Regular,faKeySkeleton
58
+ KeySolid,FontAwesome%20Library/key-skeleton-solid.svg,Pro,Solid,faKeySkeleton
59
+ LeftChevron,FontAwesome%20Library/chevron-left-regular.svg,Pro,Regular,faChevronLeft
60
+ Link,FontAwesome%20Library/link-regular.svg,Pro,Regular,faLink
61
+ LongRightArrow,FontAwesome%20Library/long-arrow-right-solid.svg,Pro,Solid,faLongArrowRight
62
+ mapPinLight,FontAwesome%20Library/map-marker-alt-light.svg,Pro,Light,faMapMarkerAlt
63
+ Mastercard,FontAwesome%20Library/cc-mastercard-brands.svg,Brands,,faCcMastercard
64
+ MicrophoneRegular,FontAwesome%20Library/microphone-alt-regular.svg,Pro,Regular,faMicrophoneAlt
65
+ MicrophoneSolid,FontAwesome%20Library/microphone-alt-solid.svg,Free,Solid,faMicrophoneAlt
66
+ MinusCircleLight,FontAwesome%20Library/minus-circle-light.svg,Pro,Light,faMinusCircle
67
+ Mobile,FontAwesome%20Library/mobile-alt-solid.svg,Free,Solid,faMobileAlt
68
+ PlusCircle,FontAwesome%20Library/plus-circle-solid.svg,Free,Solid,faPlusCircle
69
+ PlusCircleLight,FontAwesome%20Library/plus-circle-light.svg,Pro,Light,faPlusCircle
70
+ PrintRegular,FontAwesome%20Library/print-regular.svg,Pro,Regular,faPrint
71
+ PrintSolid,FontAwesome%20Library/print-solid.svg,Free,Solid,faPrint
72
+ ReceiptRegular,FontAwesome%20Library/receipt-regular.svg,Pro,Regular,faReceipt
73
+ ReceiptSolid,FontAwesome%20Library/receipt-solid.svg,Free,Solid,faReceipt
74
+ ReportRegular,FontAwesome%20Library/file-chart-line-regular.svg,Pro,Regular,faFileChartLine
75
+ ReportSolid,FontAwesome%20Library/file-chart-line-solid.svg,Pro,Solid,faFileChartLine
76
+ RightChevronCircle,FontAwesome%20Library/chevron-circle-right-solid.svg,Free,Solid,faChevronCircleRight
77
+ SadTear,FontAwesome%20Library/sad-tear-regular.svg,Free,Regular,faSadTear
78
+ SearchRegular,FontAwesome%20Library/search-regular.svg,Pro,Regular,faSearch
79
+ SearchSolid,FontAwesome%20Library/search-solid.svg,Free,Solid,faSearch
80
+ Sort,FontAwesome%20Library/sort-solid.svg,Free,Solid,faSort
81
+ SortBy,FontAwesome%20Library/sort-alt-solid.svg,Pro,Solid,faSortAlt
82
+ TicketRegular,FontAwesome%20Library/ticket-alt-regular.svg,Pro,Regular,faTicketAlt
83
+ TicketSolid,FontAwesome%20Library/ticket-alt-solid.svg,Free,Solid,faTicketAlt
84
+ Underline,FontAwesome%20Library/underline-solid.svg,Free,Solid,faUnderline
85
+ Unlock,FontAwesome%20Library/unlock-regular.svg,Pro,Regular,faUnlock
86
+ UpArrow,FontAwesome%20Library/arrow-alt-up-regular.svg,Pro,Regular,faArrowAltUp
87
+ UpgradeRegular,FontAwesome%20Library/arrow-alt-square-up-regular.svg,Pro,Regular,faArrowAltSquareUp
88
+ UpgradeSolid,FontAwesome%20Library/arrow-alt-square-up-solid.svg,Pro,Solid,faArrowAltSquareUp
89
+ Upload,FontAwesome%20Library/upload-regular.svg,Pro,Regular,faUpload
90
+ UserCircle,FontAwesome%20Library/user-circle-solid.svg,Free,Solid,faUserCircle
91
+ UserRegular,FontAwesome%20Library/user-regular.svg,Free,Regular,faUser
92
+ UserSolid,FontAwesome%20Library/user-solid.svg,Free,Solid,faUser
93
+ UsersRegular,FontAwesome%20Library/users-regular.svg,Pro,Regular,faUsers
94
+ UsersSolid,FontAwesome%20Library/users-solid.svg,Free,Solid,faUsers
95
+ VenueRegular,FontAwesome%20Library/landmark-regular.svg,Pro,Regular,faLandmark
96
+ VenueSolid,FontAwesome%20Library/landmark-solid.svg,Free,Solid,faLandmark
97
+ Visa,FontAwesome%20Library/cc-visa-brands.svg,Brands,,faCcVisa
98
+ Warning,FontAwesome%20Library/exclamation-triangle-solid.svg,Free,Solid,faExclamationTriangle