@sellout/ui 0.0.57 → 0.0.60
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/build/Colors.js +26 -0
- package/build/_virtual/_tslib.js +51 -0
- package/build/components/Button.d.ts +20 -6
- package/build/components/Button.js +210 -0
- package/build/components/CodeInput.d.ts +8 -0
- package/build/components/CodeInput.js +78 -0
- package/build/components/Counter.js +28 -0
- package/build/components/Dropdown.d.ts +24 -0
- package/build/components/Dropdown.js +49 -0
- package/build/components/Flex.d.ts +12 -0
- package/build/components/Flex.js +12 -0
- package/build/components/Icon.d.ts +49 -3
- package/build/components/Icon.js +39 -0
- package/build/components/Icons.d.ts +49 -3
- package/build/components/Icons.js +181 -0
- package/build/components/Input.d.ts +16 -1
- package/build/components/Input.js +177 -0
- package/build/components/InputOld.d.ts +23 -0
- package/build/components/InputOld.js +83 -0
- package/build/components/Label.d.ts +9 -0
- package/build/components/Label.js +22 -0
- package/build/components/Loader.js +37 -0
- package/build/components/MaxLength.d.ts +7 -0
- package/build/components/MaxLength.js +16 -0
- package/build/components/Motion.d.ts +30 -0
- package/build/components/Motion.js +39 -0
- package/build/components/PhoneNumberInput.d.ts +19 -0
- package/build/components/PhoneNumberInput.js +39 -0
- package/build/components/Product.js +54 -0
- package/build/components/TextButton.d.ts +15 -0
- package/build/components/TextButton.js +39 -0
- package/build/components/Tip.d.ts +7 -0
- package/build/components/Tip.js +18 -0
- package/build/components/UserImage.d.ts +13 -0
- package/build/components/UserImage.js +20 -0
- package/build/components/UserInfo.d.ts +12 -0
- package/build/components/UserInfo.js +38 -0
- package/build/components/ValidationError.d.ts +6 -0
- package/build/components/ValidationError.js +23 -0
- package/build/components/VerticalUserInfo.d.ts +12 -0
- package/build/index.d.ts +18 -126
- package/build/index.js +27 -453
- package/build/utils/ErrorUtil.d.ts +1 -0
- package/build/utils/ErrorUtil.js +18 -0
- package/build/utils/MediaQuery.d.ts +17 -0
- package/build/utils/MediaQuery.js +64 -0
- package/build/utils/Validation.d.ts +6 -0
- package/build/utils/Validation.js +53 -0
- package/build/utils/makeEventHandler.js +11 -0
- package/package.json +13 -5
- package/.storybook/config.js +0 -3
- package/.storybook/preview-head.html +0 -21
- package/.storybook/webpack.config.js +0 -19
- package/build/index.es.js +0 -443
- package/rollup.config.js +0 -20
- package/src/Colors.ts +0 -23
- package/src/assets/images/sellout-logo-long.svg +0 -11
- package/src/assets/images/sellout-logo-mono-white.svg +0 -4
- package/src/components/Button.tsx +0 -141
- package/src/components/Counter.tsx +0 -91
- package/src/components/Icon.tsx +0 -78
- package/src/components/Icons.ts +0 -251
- package/src/components/Input.tsx +0 -258
- package/src/components/Loader.tsx +0 -88
- package/src/components/Product.tsx +0 -156
- package/src/index.ts +0 -28
- package/src/stories/Button.stories.js +0 -30
- package/src/stories/Counter.stories.js +0 -28
- package/src/stories/Icon.stories.js +0 -25
- package/src/stories/Input.stories.js +0 -79
- package/src/stories/Loader.stories.js +0 -50
- package/src/stories/Product.stories.js +0 -67
- package/src/utils/makeEventHandler.ts +0 -8
- package/tsconfig.json +0 -24
- package/utils/generateIconLibrary.js +0 -49
- package/utils/icon-library.csv +0 -129
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import Joi from '@hapi/joi';
|
|
2
|
+
|
|
3
|
+
// Email Validation
|
|
4
|
+
var email = Joi
|
|
5
|
+
.string()
|
|
6
|
+
.required()
|
|
7
|
+
.email({ tlds: { allow: false } })
|
|
8
|
+
.error(function () {
|
|
9
|
+
return new Error('Please enter a valid email.');
|
|
10
|
+
});
|
|
11
|
+
// Password Validation
|
|
12
|
+
// could force users to be more secure ->
|
|
13
|
+
// https://stackoverflow.com/questions/19605150/regex-for-password-must-contain-at-least-eight-characters-at-least-one-number-a
|
|
14
|
+
var password = Joi
|
|
15
|
+
.string()
|
|
16
|
+
.required()
|
|
17
|
+
.min(8)
|
|
18
|
+
.max(30)
|
|
19
|
+
.error(function (errors) {
|
|
20
|
+
return errors.map(function (error) {
|
|
21
|
+
console.log(error);
|
|
22
|
+
switch (error.code) {
|
|
23
|
+
case "string.min":
|
|
24
|
+
return new Error('Password must be greater than 8 Characters.');
|
|
25
|
+
case "string.max":
|
|
26
|
+
return new Error('Password must be fewer than 30 characters.');
|
|
27
|
+
case "string.empty":
|
|
28
|
+
return new Error('Please enter a password.');
|
|
29
|
+
default:
|
|
30
|
+
return new Error('Password validation error.');
|
|
31
|
+
}
|
|
32
|
+
});
|
|
33
|
+
});
|
|
34
|
+
// full name validation - only checks for first and last name via single space character
|
|
35
|
+
// all characters are valid, gotta support X Æ A-12 now
|
|
36
|
+
// should maybe fix, idk, it accepts stuff like Mike\tPollard
|
|
37
|
+
var fullName = Joi
|
|
38
|
+
.string()
|
|
39
|
+
.required()
|
|
40
|
+
.pattern(new RegExp("^[^\\s]+(\\s[^\\s]+)+$"))
|
|
41
|
+
.error(function () {
|
|
42
|
+
return new Error('Please enter your first and last name');
|
|
43
|
+
});
|
|
44
|
+
// Phone number validation, need to test internationally
|
|
45
|
+
var phoneNumber = Joi
|
|
46
|
+
.string()
|
|
47
|
+
.required()
|
|
48
|
+
.pattern(new RegExp("^(\\+\\d{1,2}\\s?)?1?\\-?\\.?\\s?\\(?\\d{3}\\)?[\\s.-]?\\d{3}[\\s.-]?\\d{4}$"))
|
|
49
|
+
.error(function () {
|
|
50
|
+
return new Error('Please enter a valid phone number.');
|
|
51
|
+
});
|
|
52
|
+
|
|
53
|
+
export { email, fullName, password, phoneNumber };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
function makeEventHandler(executeOnEvent) {
|
|
2
|
+
if (executeOnEvent === void 0) { executeOnEvent = function () { }; }
|
|
3
|
+
return function (eventHandler) {
|
|
4
|
+
return function (event) {
|
|
5
|
+
executeOnEvent();
|
|
6
|
+
eventHandler(event.currentTarget.value);
|
|
7
|
+
};
|
|
8
|
+
};
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export default makeEventHandler;
|
package/package.json
CHANGED
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sellout/ui",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.60",
|
|
4
4
|
"main": "build/index.js",
|
|
5
5
|
"module": "build/index.es.js",
|
|
6
|
-
"
|
|
6
|
+
"files": [
|
|
7
|
+
"build"
|
|
8
|
+
],
|
|
7
9
|
"scripts": {
|
|
8
10
|
"prepare": "npm run build",
|
|
9
11
|
"build": "rollup -c",
|
|
@@ -31,6 +33,7 @@
|
|
|
31
33
|
"jest": "^24.9.0",
|
|
32
34
|
"rollup": "^1.27.13",
|
|
33
35
|
"rollup-plugin-commonjs": "^10.1.0",
|
|
36
|
+
"rollup-plugin-multi-input": "^1.1.1",
|
|
34
37
|
"rollup-plugin-node-resolve": "^5.2.0",
|
|
35
38
|
"rollup-plugin-peer-deps-external": "^2.2.0",
|
|
36
39
|
"rollup-plugin-typescript2": "^0.25.3",
|
|
@@ -40,19 +43,24 @@
|
|
|
40
43
|
},
|
|
41
44
|
"dependencies": {
|
|
42
45
|
"@fortawesome/fontawesome-svg-core": "^1.2.27",
|
|
46
|
+
"@fortawesome/free-brands-svg-icons": "^5.14.0",
|
|
43
47
|
"@fortawesome/free-regular-svg-icons": "^5.12.1",
|
|
44
48
|
"@fortawesome/free-solid-svg-icons": "^5.12.1",
|
|
45
49
|
"@fortawesome/pro-light-svg-icons": "^5.12.1",
|
|
46
50
|
"@fortawesome/pro-regular-svg-icons": "^5.12.1",
|
|
47
51
|
"@fortawesome/pro-solid-svg-icons": "^5.12.1",
|
|
48
52
|
"@fortawesome/react-fontawesome": "^0.1.9",
|
|
49
|
-
"@
|
|
53
|
+
"@hapi/joi": "^17.1.1",
|
|
54
|
+
"@sellout/utils": "^0.0.60",
|
|
50
55
|
"@types/escape-html": "^1.0.0",
|
|
56
|
+
"@types/hapi__joi": "^16.0.12",
|
|
51
57
|
"csvtojson": "^2.0.10",
|
|
58
|
+
"framer-motion": "^2.3.0",
|
|
52
59
|
"polished": "^3.4.4",
|
|
53
|
-
"react-animate-height": "^2.0.20"
|
|
60
|
+
"react-animate-height": "^2.0.20",
|
|
61
|
+
"react-phone-input-2": "^2.13.7"
|
|
54
62
|
},
|
|
55
|
-
"gitHead": "
|
|
63
|
+
"gitHead": "551f1a01e488368e342661719a0946ad0071197b",
|
|
56
64
|
"peerDependencies": {
|
|
57
65
|
"react": "^16.13.0",
|
|
58
66
|
"react-dom": "^16.13.0",
|
package/.storybook/config.js
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
<link href="https://fonts.googleapis.com/css?family=Work+Sans:300,400,500,600,700" rel="stylesheet" />
|
|
2
|
-
<link href="https://use.typekit.net/suf4knx.css" rel="stylesheet" />
|
|
3
|
-
|
|
4
|
-
<style>
|
|
5
|
-
html {
|
|
6
|
-
font-size: 62.5%;
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
body {
|
|
10
|
-
margin: 0;
|
|
11
|
-
font-family: 'neue-haas-grotesk-display', sans-serif;
|
|
12
|
-
-webkit-font-smoothing: antialiased;
|
|
13
|
-
-moz-osx-font-smoothing: grayscale;
|
|
14
|
-
font-size: 1.4rem;
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
code {
|
|
18
|
-
font-family: source-code-pro, Menlo, Monaco, Consolas, 'Courier New',
|
|
19
|
-
monospace;
|
|
20
|
-
}
|
|
21
|
-
</style>
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
const path = require('path')
|
|
2
|
-
const SRC_PATH = path.join(__dirname, '../src')
|
|
3
|
-
|
|
4
|
-
module.exports = ({ config }) => {
|
|
5
|
-
config.module.rules.push({
|
|
6
|
-
test: /\.(ts|tsx)$/,
|
|
7
|
-
include: [SRC_PATH],
|
|
8
|
-
use: [
|
|
9
|
-
{
|
|
10
|
-
loader: require.resolve('awesome-typescript-loader'),
|
|
11
|
-
options: {
|
|
12
|
-
configFileName: './tsconfig.json'
|
|
13
|
-
}
|
|
14
|
-
}
|
|
15
|
-
]
|
|
16
|
-
})
|
|
17
|
-
config.resolve.extensions.push('.ts', '.tsx')
|
|
18
|
-
return config
|
|
19
|
-
}
|
package/build/index.es.js
DELETED
|
@@ -1,443 +0,0 @@
|
|
|
1
|
-
import React, { Fragment, useState } from 'react';
|
|
2
|
-
import styled from 'styled-components';
|
|
3
|
-
import { lighten, darken } from 'polished';
|
|
4
|
-
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
|
|
5
|
-
import { faAnalytics, faBell, faCashRegister, faBullhorn, faCalendarDay, faCalendarAlt, faCalendarStar, faCheck, faEnvelope, faEnvelopeOpenText, faFileExport, faFilter, faQuestionCircle, faHome, faLock, faMapMarkerAlt, faMicrophoneAlt, faMinusCircle, faMobileAlt, faPlusCircle, faReceipt, faSearch, faSortAlt, faUnlock, faUpload, faUser, faUsers, faLandmark } from '@fortawesome/pro-light-svg-icons';
|
|
6
|
-
import { faAnalytics as faAnalytics$1, faCalendarStar as faCalendarStar$1, faCreditCardFront, faUsdSquare, faKey, faLongArrowRight, faFileChartLine, faSortAlt as faSortAlt$1, faArrowAltSquareUp } from '@fortawesome/pro-solid-svg-icons';
|
|
7
|
-
import { faUserFriends, faBold, faCalculator, faCheck as faCheck$1, faGlassCheers, faClipboardList, faCrown, faTrash, faDollarSign, faArrowAltDown, faFileDownload, faCode, faUsdSquare as faUsdSquare$1, faFilter as faFilter$1, faGlobeAmericas, faChartLine, faItalic, faKey as faKey$1, faChevronLeft, faLink, faListOl, faPrint, faFileChartLine as faFileChartLine$1, faSearch as faSearch$1, faCog, faSignOut, faSync, faTicketAlt, faListUl, faUnderline, faUnlock as faUnlock$1, faArrowAltUp, faMegaphone, faArrowAltSquareUp as faArrowAltSquareUp$1, faUsers as faUsers$1, faGift } from '@fortawesome/pro-regular-svg-icons';
|
|
8
|
-
import { faUserFriends as faUserFriends$1, faArrowLeft, faCashRegister as faCashRegister$1, faBullhorn as faBullhorn$1, faCalculator as faCalculator$1, faCalendarDay as faCalendarDay$1, faTimes, faTimesCircle, faCaretDown, faMoneyBill, faCheckCircle, faCopy, faCreditCard, faCrown as faCrown$1, faICursor, faTrash as faTrash$1, faEnvelope as faEnvelope$1, faEye, faQuestionCircle as faQuestionCircle$1, faHome as faHome$1, faInfoCircle, faChevronLeft as faChevronLeft$1, faBars, faMicrophoneAlt as faMicrophoneAlt$1, faMobileAlt as faMobileAlt$1, faPlus, faPlusCircle as faPlusCircle$1, faPrint as faPrint$1, faReceipt as faReceipt$1, faChevronCircleRight, faChevronRight, faSearch as faSearch$2, faSort, faThumbsDown, faThumbsUp, faTicketAlt as faTicketAlt$1, faUserCircle, faUser as faUser$1, faUsers as faUsers$2, faLandmark as faLandmark$1, faExclamationTriangle } from '@fortawesome/free-solid-svg-icons';
|
|
9
|
-
import { faCalendarAlt as faCalendarAlt$1, faClock, faCopy as faCopy$1, faEdit, faEye as faEye$1, faEyeSlash, faLifeRing, faSadTear, faUser as faUser$2 } from '@fortawesome/free-regular-svg-icons';
|
|
10
|
-
import AnimateHeight from 'react-animate-height';
|
|
11
|
-
import { output } from '@sellout/utils/.dist/price';
|
|
12
|
-
|
|
13
|
-
var Colors;
|
|
14
|
-
(function (Colors) {
|
|
15
|
-
Colors["White"] = "#FFFFFF";
|
|
16
|
-
Colors["Black"] = "#000000";
|
|
17
|
-
Colors["Yellow"] = "#FFBA49";
|
|
18
|
-
// Green = "#419D78",
|
|
19
|
-
Colors["Green"] = "#42BB83";
|
|
20
|
-
Colors["OffWhite"] = "#FCFCFC";
|
|
21
|
-
Colors["LightBlue"] = "#39159C";
|
|
22
|
-
Colors["Blue"] = "#2D0E84";
|
|
23
|
-
Colors["DarkBlue"] = "#1D0858";
|
|
24
|
-
Colors["Red"] = "#E63946";
|
|
25
|
-
Colors["Orange"] = "#FF700F";
|
|
26
|
-
Colors["FadedOrange"] = "#FFF1E7";
|
|
27
|
-
Colors["LightOrange"] = "#FFBE93";
|
|
28
|
-
Colors["DarkOrange"] = "#D65600";
|
|
29
|
-
Colors["Grey1"] = "#333333";
|
|
30
|
-
Colors["Grey2"] = "#4F4F4F";
|
|
31
|
-
Colors["Grey3"] = "#828282";
|
|
32
|
-
Colors["Grey4"] = "#BDBDBD";
|
|
33
|
-
Colors["Grey5"] = "#E0E0E0";
|
|
34
|
-
Colors["Grey6"] = "#F2F2F2";
|
|
35
|
-
Colors["Grey7"] = "#F8F8F8";
|
|
36
|
-
})(Colors || (Colors = {}));
|
|
37
|
-
|
|
38
|
-
/*! *****************************************************************************
|
|
39
|
-
Copyright (c) Microsoft Corporation. All rights reserved.
|
|
40
|
-
Licensed under the Apache License, Version 2.0 (the "License"); you may not use
|
|
41
|
-
this file except in compliance with the License. You may obtain a copy of the
|
|
42
|
-
License at http://www.apache.org/licenses/LICENSE-2.0
|
|
43
|
-
|
|
44
|
-
THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
|
45
|
-
KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
|
|
46
|
-
WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
|
|
47
|
-
MERCHANTABLITY OR NON-INFRINGEMENT.
|
|
48
|
-
|
|
49
|
-
See the Apache Version 2.0 License for specific language governing permissions
|
|
50
|
-
and limitations under the License.
|
|
51
|
-
***************************************************************************** */
|
|
52
|
-
|
|
53
|
-
function __makeTemplateObject(cooked, raw) {
|
|
54
|
-
if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
|
|
55
|
-
return cooked;
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
var _a;
|
|
59
|
-
var LoaderSizes;
|
|
60
|
-
(function (LoaderSizes) {
|
|
61
|
-
LoaderSizes["FuckingTiny"] = "FuckingTiny";
|
|
62
|
-
LoaderSizes["SuperSmall"] = "SuperSmall";
|
|
63
|
-
LoaderSizes["VerySmall"] = "VerySmall";
|
|
64
|
-
LoaderSizes["Small"] = "Small";
|
|
65
|
-
LoaderSizes["Medium"] = "Medium";
|
|
66
|
-
LoaderSizes["Large"] = "Large";
|
|
67
|
-
})(LoaderSizes || (LoaderSizes = {}));
|
|
68
|
-
var LoaderSizesMap = (_a = {},
|
|
69
|
-
_a[LoaderSizes.FuckingTiny] = 14,
|
|
70
|
-
_a[LoaderSizes.SuperSmall] = 20,
|
|
71
|
-
_a[LoaderSizes.VerySmall] = 24,
|
|
72
|
-
_a[LoaderSizes.Small] = 30,
|
|
73
|
-
_a[LoaderSizes.Medium] = 40,
|
|
74
|
-
_a[LoaderSizes.Large] = 60,
|
|
75
|
-
_a);
|
|
76
|
-
var scale = function (size, scale) { return size * scale + "px"; };
|
|
77
|
-
var StyledLoader = styled.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n position: relative;\n top: 1.5px;\n\n .lds-ring {\n display: inline-block;\n position: relative;\n width: ", ";\n height: ", ";\n }\n .lds-ring div {\n box-sizing: border-box;\n display: block;\n position: absolute;\n width: ", ";\n height: ", ";\n margin: ", ";\n border: ", " solid ", ";\n border-radius: 50%;\n animation: lds-ring 0.8s cubic-bezier(0.5, 0, 0.5, 1) infinite;\n border-color: ", " transparent transparent transparent;\n }\n .lds-ring div:nth-child(1) {\n animation-delay: -0.3s;\n }\n .lds-ring div:nth-child(2) {\n animation-delay: -0.2s;\n }\n .lds-ring div:nth-child(3) {\n animation-delay: -0.1s;\n }\n @keyframes lds-ring {\n 0% {\n transform: rotate(0deg);\n }\n 100% {\n transform: rotate(360deg);\n }\n }\n"], ["\n position: relative;\n top: 1.5px;\n\n .lds-ring {\n display: inline-block;\n position: relative;\n width: ", ";\n height: ", ";\n }\n .lds-ring div {\n box-sizing: border-box;\n display: block;\n position: absolute;\n width: ", ";\n height: ", ";\n margin: ", ";\n border: ", " solid ", ";\n border-radius: 50%;\n animation: lds-ring 0.8s cubic-bezier(0.5, 0, 0.5, 1) infinite;\n border-color: ", " transparent transparent transparent;\n }\n .lds-ring div:nth-child(1) {\n animation-delay: -0.3s;\n }\n .lds-ring div:nth-child(2) {\n animation-delay: -0.2s;\n }\n .lds-ring div:nth-child(3) {\n animation-delay: -0.1s;\n }\n @keyframes lds-ring {\n 0% {\n transform: rotate(0deg);\n }\n 100% {\n transform: rotate(360deg);\n }\n }\n"])), function (props) { return scale(props.size, 1); }, function (props) { return scale(props.size, 1); }, function (props) { return scale(props.size, .8); }, function (props) { return scale(props.size, .8); }, function (props) { return scale(props.size, .1); }, function (props) { return scale(props.size, 0.066); }, function (props) { return props.color; }, function (props) { return props.color; });
|
|
78
|
-
function Loader(_a) {
|
|
79
|
-
var _b = _a.size, size = _b === void 0 ? LoaderSizes.Medium : _b, _c = _a.color, color = _c === void 0 ? Colors.White : _c;
|
|
80
|
-
return (React.createElement(StyledLoader, { size: LoaderSizesMap[size], color: color },
|
|
81
|
-
React.createElement("div", { className: "lds-ring" },
|
|
82
|
-
React.createElement("div", null),
|
|
83
|
-
React.createElement("div", null),
|
|
84
|
-
React.createElement("div", null))));
|
|
85
|
-
}
|
|
86
|
-
var templateObject_1;
|
|
87
|
-
|
|
88
|
-
var IconEnum = {
|
|
89
|
-
AnalyticsLight: faAnalytics,
|
|
90
|
-
BellLight: faBell,
|
|
91
|
-
BoxOfficeLight: faCashRegister,
|
|
92
|
-
BullHornLight: faBullhorn,
|
|
93
|
-
CalendarDayLight: faCalendarDay,
|
|
94
|
-
CalendarLight: faCalendarAlt,
|
|
95
|
-
CalendarStarLight: faCalendarStar,
|
|
96
|
-
CheckLight: faCheck,
|
|
97
|
-
EnvelopeLight: faEnvelope,
|
|
98
|
-
EnvelopeOpenRegular: faEnvelopeOpenText,
|
|
99
|
-
ExportLight: faFileExport,
|
|
100
|
-
FilterLight: faFilter,
|
|
101
|
-
HelpLight: faQuestionCircle,
|
|
102
|
-
HomeLight: faHome,
|
|
103
|
-
Lock: faLock,
|
|
104
|
-
mapPinLight: faMapMarkerAlt,
|
|
105
|
-
MicrophoneLight: faMicrophoneAlt,
|
|
106
|
-
MinusCircleLight: faMinusCircle,
|
|
107
|
-
MobileLight: faMobileAlt,
|
|
108
|
-
PlusCircleLight: faPlusCircle,
|
|
109
|
-
ReceiptLight: faReceipt,
|
|
110
|
-
SearchLight: faSearch,
|
|
111
|
-
SortByLight: faSortAlt,
|
|
112
|
-
UnlockLight: faUnlock,
|
|
113
|
-
UploadLight: faUpload,
|
|
114
|
-
UserLight: faUser,
|
|
115
|
-
UsersLight: faUsers,
|
|
116
|
-
VenueLight: faLandmark,
|
|
117
|
-
AnalyticsSolid: faAnalytics$1,
|
|
118
|
-
CalendarStarSolid: faCalendarStar$1,
|
|
119
|
-
CreditCardFront: faCreditCardFront,
|
|
120
|
-
FeeSolid: faUsdSquare,
|
|
121
|
-
KeySolid: faKey,
|
|
122
|
-
LongRightArrow: faLongArrowRight,
|
|
123
|
-
ReportSolid: faFileChartLine,
|
|
124
|
-
SortBy: faSortAlt$1,
|
|
125
|
-
UpgradeSolid: faArrowAltSquareUp,
|
|
126
|
-
AudienceRegular: faUserFriends,
|
|
127
|
-
BoldRegular: faBold,
|
|
128
|
-
CalculatorRegular: faCalculator,
|
|
129
|
-
CheckRegular: faCheck$1,
|
|
130
|
-
Cheers: faGlassCheers,
|
|
131
|
-
Clipboard: faClipboardList,
|
|
132
|
-
CrownRegular: faCrown,
|
|
133
|
-
DeleteRegular: faTrash,
|
|
134
|
-
Dollar: faDollarSign,
|
|
135
|
-
DownArrow: faArrowAltDown,
|
|
136
|
-
DownloadReport: faFileDownload,
|
|
137
|
-
Embed: faCode,
|
|
138
|
-
FeeRegular: faUsdSquare$1,
|
|
139
|
-
FilterRegular: faFilter$1,
|
|
140
|
-
GlobeRegular: faGlobeAmericas,
|
|
141
|
-
GraphGrowth: faChartLine,
|
|
142
|
-
ItalicRegular: faItalic,
|
|
143
|
-
KeyRegular: faKey$1,
|
|
144
|
-
LeftChevronRegular: faChevronLeft,
|
|
145
|
-
LinkRegular: faLink,
|
|
146
|
-
OListRegular: faListOl,
|
|
147
|
-
PrintRegular: faPrint,
|
|
148
|
-
ReportRegular: faFileChartLine$1,
|
|
149
|
-
SearchRegular: faSearch$1,
|
|
150
|
-
Settings: faCog,
|
|
151
|
-
SignOut: faSignOut,
|
|
152
|
-
SyncRegular: faSync,
|
|
153
|
-
TicketRegular: faTicketAlt,
|
|
154
|
-
UListRegular: faListUl,
|
|
155
|
-
UnderlineRegular: faUnderline,
|
|
156
|
-
UnlockRegular: faUnlock$1,
|
|
157
|
-
UpArrow: faArrowAltUp,
|
|
158
|
-
Update: faMegaphone,
|
|
159
|
-
UpgradeRegular: faArrowAltSquareUp$1,
|
|
160
|
-
UsersRegular: faUsers$1,
|
|
161
|
-
GiftRegular: faGift,
|
|
162
|
-
AudienceSolid: faUserFriends$1,
|
|
163
|
-
BackArrow: faArrowLeft,
|
|
164
|
-
BoxOfficeSolid: faCashRegister$1,
|
|
165
|
-
BullhornSolid: faBullhorn$1,
|
|
166
|
-
CalculatorSolid: faCalculator$1,
|
|
167
|
-
CalendarDaySolid: faCalendarDay$1,
|
|
168
|
-
Cancel: faTimes,
|
|
169
|
-
CancelCircle: faTimesCircle,
|
|
170
|
-
CaretDown: faCaretDown,
|
|
171
|
-
Cash: faMoneyBill,
|
|
172
|
-
CheckCircle: faCheckCircle,
|
|
173
|
-
CopySolid: faCopy,
|
|
174
|
-
CreditCardBack: faCreditCard,
|
|
175
|
-
CrownSolid: faCrown$1,
|
|
176
|
-
Cursor: faICursor,
|
|
177
|
-
DeleteSolid: faTrash$1,
|
|
178
|
-
EnvelopeSolid: faEnvelope$1,
|
|
179
|
-
EyeSolid: faEye,
|
|
180
|
-
HelpSolid: faQuestionCircle$1,
|
|
181
|
-
HomeSolid: faHome$1,
|
|
182
|
-
InfotipSolid: faInfoCircle,
|
|
183
|
-
LeftArrowSolid: faArrowLeft,
|
|
184
|
-
LeftChevronSolid: faChevronLeft$1,
|
|
185
|
-
Menu: faBars,
|
|
186
|
-
MicrophoneSolid: faMicrophoneAlt$1,
|
|
187
|
-
MobileSolid: faMobileAlt$1,
|
|
188
|
-
Plus: faPlus,
|
|
189
|
-
PlusCircle: faPlusCircle$1,
|
|
190
|
-
PrintSolid: faPrint$1,
|
|
191
|
-
ReceiptSolid: faReceipt$1,
|
|
192
|
-
RightChevronCircle: faChevronCircleRight,
|
|
193
|
-
RightChevronSolid: faChevronRight,
|
|
194
|
-
SearchSolid: faSearch$2,
|
|
195
|
-
Sort: faSort,
|
|
196
|
-
ThumbsDownSolid: faThumbsDown,
|
|
197
|
-
ThumbsUpSolid: faThumbsUp,
|
|
198
|
-
TicketSolid: faTicketAlt$1,
|
|
199
|
-
UserCircle: faUserCircle,
|
|
200
|
-
UserSolid: faUser$1,
|
|
201
|
-
UsersSolid: faUsers$2,
|
|
202
|
-
VenueSolid: faLandmark$1,
|
|
203
|
-
Warning: faExclamationTriangle,
|
|
204
|
-
CalendarRegular: faCalendarAlt$1,
|
|
205
|
-
Clock: faClock,
|
|
206
|
-
CopyRegular: faCopy$1,
|
|
207
|
-
Edit: faEdit,
|
|
208
|
-
EyeRegular: faEye$1,
|
|
209
|
-
EyeSlashRegular: faEyeSlash,
|
|
210
|
-
Help: faLifeRing,
|
|
211
|
-
SadTear: faSadTear,
|
|
212
|
-
UserRegular: faUser$2,
|
|
213
|
-
};
|
|
214
|
-
|
|
215
|
-
var Container = styled.div(templateObject_1$1 || (templateObject_1$1 = __makeTemplateObject(["\n color: ", ";\n\n &:hover {\n color: ", ";\n }\n"], ["\n color: ", ";\n\n &:hover {\n color: ",
|
|
216
|
-
";\n }\n"])), function (props) { return props.color; }, function (props) {
|
|
217
|
-
if (props.color === "inherit")
|
|
218
|
-
return null;
|
|
219
|
-
return props.hoverColor;
|
|
220
|
-
});
|
|
221
|
-
var Icons = IconEnum;
|
|
222
|
-
function Icon(_a) {
|
|
223
|
-
var _b = _a.icon, icon = _b === void 0 ? Icons.AudienceRegular : _b, _c = _a.color, color = _c === void 0 ? Colors.Orange : _c, _d = _a.hoverColor, hoverColor = _d === void 0 ? null : _d, onClick = _a.onClick, _e = _a.size, size = _e === void 0 ? 20 : _e, top = _a.top, left = _a.left, right = _a.right, _f = _a.position, position = _f === void 0 ? "relative" : _f, zIndex = _a.zIndex, margin = _a.margin, tip = _a.tip, transitionDuration = _a.transitionDuration, rotation = _a.rotation;
|
|
224
|
-
var cursor = onClick ? "pointer" : "";
|
|
225
|
-
if (icon === Icons.TicketRegular)
|
|
226
|
-
rotation = 90;
|
|
227
|
-
if (icon === Icons.TicketSolid)
|
|
228
|
-
rotation = 90;
|
|
229
|
-
return (React.createElement(Container, { color: color, hoverColor: hoverColor, "data-tip": tip },
|
|
230
|
-
React.createElement(FontAwesomeIcon, { icon: icon, onClick: onClick, style: {
|
|
231
|
-
top: top,
|
|
232
|
-
left: left,
|
|
233
|
-
right: right,
|
|
234
|
-
position: position,
|
|
235
|
-
zIndex: zIndex,
|
|
236
|
-
fontSize: size,
|
|
237
|
-
transition: "all " + (transitionDuration || "0.2s"),
|
|
238
|
-
transform: rotation ? "rotate(" + rotation + "deg)" : undefined,
|
|
239
|
-
margin: margin,
|
|
240
|
-
cursor: cursor,
|
|
241
|
-
} })));
|
|
242
|
-
}
|
|
243
|
-
var templateObject_1$1;
|
|
244
|
-
|
|
245
|
-
var ButtonTypes;
|
|
246
|
-
(function (ButtonTypes) {
|
|
247
|
-
ButtonTypes["Submit"] = "Submit";
|
|
248
|
-
})(ButtonTypes || (ButtonTypes = {}));
|
|
249
|
-
var ButtonStates;
|
|
250
|
-
(function (ButtonStates) {
|
|
251
|
-
ButtonStates["Active"] = "Active";
|
|
252
|
-
})(ButtonStates || (ButtonStates = {}));
|
|
253
|
-
var StyledButton = styled.div(templateObject_1$2 || (templateObject_1$2 = __makeTemplateObject(["\n position: relative;\n height: 40px;\n width: 100%;\n display: flex;\n flex-direction: row;\n align-items: center;\n overflow: hidden;\n justify-content: center;\n white-space: nowrap;\n text-align: center;\n border-radius: 10px;\n transition: all 0.2s;\n margin: ", ";\n padding: ", ";\n background-color: ", ";\n\n &:hover {\n cursor: ", ";\n background-color: ", ";\n }\n\n &:active {\n cursor: ", ";\n background-color: ", ";\n }\n"], ["\n position: relative;\n height: 40px;\n width: 100%;\n display: flex;\n flex-direction: row;\n align-items: center;\n overflow: hidden;\n justify-content: center;\n white-space: nowrap;\n text-align: center;\n border-radius: 10px;\n transition: all 0.2s;\n margin: ", ";\n padding: ", ";\n background-color: ",
|
|
254
|
-
";\n\n &:hover {\n cursor: ", ";\n background-color: ",
|
|
255
|
-
";\n }\n\n &:active {\n cursor: ", ";\n background-color: ",
|
|
256
|
-
";\n }\n"])), function (props) { return (Boolean(props.margin) ? props.margin : "0px"); }, function (props) { return (Boolean(props.padding) ? props.padding : "0px"); }, function (props) {
|
|
257
|
-
if (props.type === ButtonTypes.Submit) {
|
|
258
|
-
return Colors.Orange;
|
|
259
|
-
}
|
|
260
|
-
return null;
|
|
261
|
-
}, function (props) { return (props.onClick ? "pointer" : null); }, function (props) {
|
|
262
|
-
if (props.onClick && props.type === ButtonTypes.Submit) {
|
|
263
|
-
return lighten(0.025, Colors.Orange);
|
|
264
|
-
}
|
|
265
|
-
return null;
|
|
266
|
-
}, function (props) { return (props.onClick ? "pointer" : null); }, function (props) {
|
|
267
|
-
if (props.onClick && props.type === ButtonTypes.Submit) {
|
|
268
|
-
return darken(0.025, Colors.Orange);
|
|
269
|
-
}
|
|
270
|
-
return null;
|
|
271
|
-
});
|
|
272
|
-
var Text = styled.span(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n font-size: 1.4rem;\n font-weight: 600;\n text-transform: uppercase;\n margin-left: ", ";\n color: ", ";\n"], ["\n font-size: 1.4rem;\n font-weight: 600;\n text-transform: uppercase;\n margin-left: ", ";\n color: ",
|
|
273
|
-
";\n"])), function (props) { return (props.icon ? "10px" : 0); }, function (props) {
|
|
274
|
-
if (props.type === ButtonTypes.Submit) {
|
|
275
|
-
return Colors.White;
|
|
276
|
-
}
|
|
277
|
-
return null;
|
|
278
|
-
});
|
|
279
|
-
function Button(_a) {
|
|
280
|
-
var _b = _a.type, type = _b === void 0 ? ButtonTypes.Submit : _b, _c = _a.state, state = _c === void 0 ? ButtonStates.Active : _c, text = _a.text, _d = _a.onClick, onClick = _d === void 0 ? function () { } : _d, icon = _a.icon, margin = _a.margin, padding = _a.padding, _e = _a.loading, loading = _e === void 0 ? false : _e;
|
|
281
|
-
return (React.createElement(StyledButton, { type: type, onClick: loading ? null : function () { return onClick(); }, margin: margin, padding: padding, state: state }, (function () {
|
|
282
|
-
return (React.createElement(Fragment, null,
|
|
283
|
-
icon && (React.createElement(Icon, { icon: icon, color: Colors.White })),
|
|
284
|
-
(function () {
|
|
285
|
-
if (loading) {
|
|
286
|
-
return React.createElement(Loader, { size: LoaderSizes.VerySmall });
|
|
287
|
-
}
|
|
288
|
-
return (text && (React.createElement(Text, { type: type, icon: Boolean(icon) }, text)));
|
|
289
|
-
})()));
|
|
290
|
-
})()));
|
|
291
|
-
}
|
|
292
|
-
var templateObject_1$2, templateObject_2;
|
|
293
|
-
|
|
294
|
-
var Container$1 = styled.div(templateObject_1$3 || (templateObject_1$3 = __makeTemplateObject(["\n position: relative;\n display: flex;\n align-items: center;\n justify-content: space-between;\n width: 85px;\n min-height: 42px;\n /* background-color: red; */\n"], ["\n position: relative;\n display: flex;\n align-items: center;\n justify-content: space-between;\n width: 85px;\n min-height: 42px;\n /* background-color: red; */\n"])));
|
|
295
|
-
var IconContainer = styled.div(templateObject_2$1 || (templateObject_2$1 = __makeTemplateObject(["\n display: flex;\n align-items: center;\n justify-content: ", ";\n flex: 1;\n /* background-color: blue; */\n height: 100%;\n\n &:hover {\n cursor: ", ";\n }\n\n .svg-inline--fa {\n color: ", " !important;\n }\n"], ["\n display: flex;\n align-items: center;\n justify-content: ", ";\n flex: 1;\n /* background-color: blue; */\n height: 100%;\n\n &:hover {\n cursor: ", ";\n }\n\n .svg-inline--fa {\n color: ",
|
|
296
|
-
" !important;\n }\n"])), function (props) { return props.justify; }, function (props) { return (props.active ? "pointer" : null); }, function (props) {
|
|
297
|
-
return props.active ? lighten(0.025, Colors.Orange) : null;
|
|
298
|
-
});
|
|
299
|
-
var Value = styled.div(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n font-size: 2.4rem;\n color: ", ";\n min-width: 20px;\n text-align: center;\n"], ["\n font-size: 2.4rem;\n color: ", ";\n min-width: 20px;\n text-align: center;\n"])), Colors.Grey1);
|
|
300
|
-
function Counter(_a) {
|
|
301
|
-
var value = _a.value, maxValue = _a.maxValue, _b = _a.minValue, minValue = _b === void 0 ? 0 : _b, onIncrement = _a.onIncrement, onDecrement = _a.onDecrement;
|
|
302
|
-
var canDecrement = value > minValue;
|
|
303
|
-
var canIncrement = Boolean(!Boolean(maxValue) || (maxValue && value < maxValue));
|
|
304
|
-
return (React.createElement(Container$1, null,
|
|
305
|
-
React.createElement(IconContainer, { active: canDecrement, onClick: function () { return (canDecrement ? onDecrement() : null); }, justify: "flex-start" },
|
|
306
|
-
React.createElement(Icon, { icon: Icons.MinusCircleLight, color: canDecrement ? Colors.Orange : Colors.Grey5 })),
|
|
307
|
-
React.createElement(Value, null, value),
|
|
308
|
-
React.createElement(IconContainer, { active: canIncrement, onClick: function () { return (canIncrement ? onIncrement() : null); }, justify: "flex-end" },
|
|
309
|
-
React.createElement(Icon, { icon: Icons.PlusCircleLight, color: canIncrement ? Colors.Orange : Colors.Grey5 }))));
|
|
310
|
-
}
|
|
311
|
-
var templateObject_1$3, templateObject_2$1, templateObject_3;
|
|
312
|
-
|
|
313
|
-
var Form = styled.form(templateObject_1$4 || (templateObject_1$4 = __makeTemplateObject(["\n width: ", ";\n display: flex;\n flex-direction: row;\n position: relative;\n border-radius: 10px;\n transition: all 0.2s;\n border: 1px solid\n ", ";\n"], ["\n width: ", ";\n display: flex;\n flex-direction: row;\n position: relative;\n border-radius: 10px;\n transition: all 0.2s;\n border: 1px solid\n ",
|
|
314
|
-
";\n"])), function (props) { return props.width; }, function (props) {
|
|
315
|
-
if (props.focused)
|
|
316
|
-
return Colors.Grey3;
|
|
317
|
-
if (props.hovered)
|
|
318
|
-
return Colors.Grey4;
|
|
319
|
-
return Colors.Grey5;
|
|
320
|
-
});
|
|
321
|
-
var Button$1 = styled.div(templateObject_2$2 || (templateObject_2$2 = __makeTemplateObject(["\n position: absolute;\n display: flex;\n align-items: center;\n justify-content: center;\n color: ", ";\n height: 50px;\n width: 50px;\n border-radius: 0 10px 10px 0;\n top: -1px;\n right: -1px;\n transition: all 0.2s;\n background-color: ", ";\n\n &:hover {\n cursor: ", ";\n background-color: ", ";\n }\n\n &:active {\n cursor: ", ";\n background-color: ", ";\n }\n"], ["\n position: absolute;\n display: flex;\n align-items: center;\n justify-content: center;\n color: ", ";\n height: 50px;\n width: 50px;\n border-radius: 0 10px 10px 0;\n top: -1px;\n right: -1px;\n transition: all 0.2s;\n background-color: ",
|
|
322
|
-
";\n\n &:hover {\n cursor: ", ";\n background-color: ",
|
|
323
|
-
";\n }\n\n &:active {\n cursor: ", ";\n background-color: ",
|
|
324
|
-
";\n }\n"])), Colors.White, function (props) {
|
|
325
|
-
return props.canSubmit ? Colors.Orange : Colors.Grey6;
|
|
326
|
-
}, function (props) { return (props.onClick ? "pointer" : null); }, function (props) {
|
|
327
|
-
return props.canSubmit ? lighten(0.025, Colors.Orange) : null;
|
|
328
|
-
}, function (props) { return (props.onClick ? "pointer" : null); }, function (props) {
|
|
329
|
-
return props.canSubmit ? darken(0.025, Colors.Orange) : null;
|
|
330
|
-
});
|
|
331
|
-
var LeftContainer = styled.div(templateObject_3$1 || (templateObject_3$1 = __makeTemplateObject(["\n position: relative;\n display: flex;\n align-items: center;\n justify-content: center;\n margin-left: 15px;\n top: 0px;\n left: 0px;\n"], ["\n position: relative;\n display: flex;\n align-items: center;\n justify-content: center;\n margin-left: 15px;\n top: 0px;\n left: 0px;\n"])));
|
|
332
|
-
var RightContainer = styled.div(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n position: absolute;\n display: flex;\n align-items: center;\n justify-content: center;\n height: 50px;\n width: 50px;\n top: -1px;\n right: -1px;\n\n &:hover {\n cursor: ", ";\n }\n"], ["\n position: absolute;\n display: flex;\n align-items: center;\n justify-content: center;\n height: 50px;\n width: 50px;\n top: -1px;\n right: -1px;\n\n &:hover {\n cursor: ", ";\n }\n"])), function (props) { return (props.onClick ? "pointer" : null); });
|
|
333
|
-
var Spacer = styled.div(templateObject_5 || (templateObject_5 = __makeTemplateObject(["\n width: 50px;\n"], ["\n width: 50px;\n"])));
|
|
334
|
-
var InputStyled = styled.input(templateObject_6 || (templateObject_6 = __makeTemplateObject(["\n background-color: ", ";\n color: ", ";\n outline: none;\n border: 0px;\n border-radius: 10px;\n height: 48px;\n width: fill-available;\n font-size: 1.4rem;\n font-weight: 500;\n padding: 0 0 0 10px;\n transition: all 0.2s;\n margin: ", ";\n padding: ", ";\n \n ::placeholder {\n color: ", ";\n }\n"], ["\n background-color: ", ";\n color: ", ";\n outline: none;\n border: 0px;\n border-radius: 10px;\n height: 48px;\n width: fill-available;\n font-size: 1.4rem;\n font-weight: 500;\n padding: 0 0 0 10px;\n transition: all 0.2s;\n margin: ", ";\n padding: ", ";\n \n ::placeholder {\n color: ", ";\n }\n"])), Colors.White, Colors.Grey1, function (props) { return props.margin; }, function (props) { return props.padding; }, Colors.Grey4);
|
|
335
|
-
function Input(_a) {
|
|
336
|
-
var inputRef = _a.inputRef, autoFocus = _a.autoFocus, placeholder = _a.placeholder, value = _a.value, defaultValue = _a.defaultValue, icon = _a.icon, _b = _a.type, type = _b === void 0 ? 'text' : _b, onMouseEnter = _a.onMouseEnter, onMouseLeave = _a.onMouseLeave, onChange = _a.onChange, onFocus = _a.onFocus, onBlur = _a.onBlur, onSubmit = _a.onSubmit, onClear = _a.onClear, _c = _a.canSubmit, canSubmit = _c === void 0 ? true : _c, loading = _a.loading, margin = _a.margin, padding = _a.padding, width = _a.width;
|
|
337
|
-
var _d = useState(false), hovered = _d[0], setHovered = _d[1];
|
|
338
|
-
var _e = useState(false), focused = _e[0], setFocused = _e[1];
|
|
339
|
-
var submit = function (event) {
|
|
340
|
-
event.preventDefault();
|
|
341
|
-
if (onSubmit && canSubmit && !loading) {
|
|
342
|
-
onSubmit();
|
|
343
|
-
}
|
|
344
|
-
};
|
|
345
|
-
return (React.createElement(Form, { hovered: hovered, focused: focused, onSubmit: function (event) { return submit(event); }, width: width },
|
|
346
|
-
icon && (React.createElement(LeftContainer, null,
|
|
347
|
-
React.createElement(Icon, { icon: icon, size: 16, color: focused ? Colors.Grey1 : Colors.Grey4 }))),
|
|
348
|
-
React.createElement(InputStyled, { ref: inputRef, autoFocus: autoFocus, placeholder: placeholder, value: value, defaultValue: defaultValue, type: type, onChange: onChange, onFocus: function (event) {
|
|
349
|
-
setFocused(true);
|
|
350
|
-
if (onFocus)
|
|
351
|
-
onFocus(event);
|
|
352
|
-
}, onBlur: function (event) {
|
|
353
|
-
setFocused(false);
|
|
354
|
-
if (onFocus)
|
|
355
|
-
onBlur(event);
|
|
356
|
-
}, onMouseEnter: function (event) {
|
|
357
|
-
setHovered(true);
|
|
358
|
-
if (onMouseEnter)
|
|
359
|
-
onMouseEnter(event);
|
|
360
|
-
}, onMouseLeave: function (event) {
|
|
361
|
-
setHovered(false);
|
|
362
|
-
if (onMouseLeave)
|
|
363
|
-
onMouseLeave(event);
|
|
364
|
-
}, margin: margin, padding: padding }),
|
|
365
|
-
(function () {
|
|
366
|
-
if (onSubmit) {
|
|
367
|
-
return (React.createElement(Fragment, null,
|
|
368
|
-
React.createElement(Spacer, null),
|
|
369
|
-
React.createElement(Button$1, { canSubmit: canSubmit, onClick: function (event) { return submit(event); } }, (function () {
|
|
370
|
-
if (loading) {
|
|
371
|
-
return React.createElement(Loader, { size: LoaderSizes.VerySmall });
|
|
372
|
-
}
|
|
373
|
-
return (React.createElement(Icon, { icon: Icons.RightChevronCircle, color: canSubmit ? Colors.White : Colors.Grey4, size: 16 }));
|
|
374
|
-
})())));
|
|
375
|
-
}
|
|
376
|
-
if (Boolean(value) && onClear) {
|
|
377
|
-
return (React.createElement(Fragment, null,
|
|
378
|
-
React.createElement(Spacer, null),
|
|
379
|
-
React.createElement(RightContainer, { onClick: function () { return onClear(); } },
|
|
380
|
-
React.createElement(Icon, { icon: Icons.CancelCircle, color: Colors.Grey3, size: 16 }))));
|
|
381
|
-
}
|
|
382
|
-
return React.createElement(Spacer, null);
|
|
383
|
-
})()));
|
|
384
|
-
}
|
|
385
|
-
var templateObject_1$4, templateObject_2$2, templateObject_3$1, templateObject_4, templateObject_5, templateObject_6;
|
|
386
|
-
|
|
387
|
-
var Row = styled.div(templateObject_1$5 || (templateObject_1$5 = __makeTemplateObject(["\n display: flex;\n flex-direction: row;\n justify-content: ", ";\n"], ["\n display: flex;\n flex-direction: row;\n justify-content: ", ";\n"])), function (props) { return props.justify; });
|
|
388
|
-
var Column = styled.div(templateObject_2$3 || (templateObject_2$3 = __makeTemplateObject(["\n display: flex;\n flex-direction: column;\n"], ["\n display: flex;\n flex-direction: column;\n"])));
|
|
389
|
-
var Container$2 = styled.div(templateObject_3$2 || (templateObject_3$2 = __makeTemplateObject(["\n background-color: ", ";\n padding: 15px;\n border-bottom: 1px solid ", ";\n"], ["\n background-color: ", ";\n padding: 15px;\n border-bottom: 1px solid ", ";\n"])), Colors.White, Colors.Grey6);
|
|
390
|
-
var Title = styled.div(templateObject_4$1 || (templateObject_4$1 = __makeTemplateObject(["\n font-size: 1.8rem;\n color: ", ";\n font-weight: 600;\n margin-bottom: 5px;\n"], ["\n font-size: 1.8rem;\n color: ", ";\n font-weight: 600;\n margin-bottom: 5px;\n"])), Colors.Grey1);
|
|
391
|
-
var Price = styled.div(templateObject_5$1 || (templateObject_5$1 = __makeTemplateObject(["\n font-size: 1.4rem;\n font-weight: 500;\n color: ", ";\n margin-bottom: 5px;\n"], ["\n font-size: 1.4rem;\n font-weight: 500;\n color: ", ";\n margin-bottom: 5px;\n"])), Colors.Grey2);
|
|
392
|
-
var Subtitle = styled.div(templateObject_6$1 || (templateObject_6$1 = __makeTemplateObject(["\n font-size: 1.2rem;\n font-weight: 500;\n line-height: 160%;\n color: ", ";\n"], ["\n font-size: 1.2rem;\n font-weight: 500;\n line-height: 160%;\n color: ", ";\n"])), Colors.Grey3);
|
|
393
|
-
var Description = styled.div(templateObject_7 || (templateObject_7 = __makeTemplateObject(["\n font-size: 1.2rem;\n font-weight: 500;\n line-height: 160%;\n color: ", ";\n margin-top: 10px;\n"], ["\n font-size: 1.2rem;\n font-weight: 500;\n line-height: 160%;\n color: ", ";\n margin-top: 10px;\n"])), Colors.Grey2);
|
|
394
|
-
var Ellipsis = styled.div(templateObject_8 || (templateObject_8 = __makeTemplateObject(["\n display: -webkit-box;\n -webkit-line-clamp: ", ";\n -webkit-box-orient: ", ";\n overflow: hidden;\n text-overflow: ellipsis;\n"], ["\n display: -webkit-box;\n -webkit-line-clamp: ", ";\n -webkit-box-orient: ", ";\n overflow: hidden;\n text-overflow: ellipsis;\n"])), function (props) { return props.active ? 3 : null; }, function (props) { return props.active ? 'vertical' : null; });
|
|
395
|
-
var ShowMore = styled.div(templateObject_9 || (templateObject_9 = __makeTemplateObject(["\n font-size: 1.2rem;\n font-weight: 500;\n line-height: 160%;\n color: ", ";\n transition: all 0.2s;\n\n &:hover {\n cursor: pointer;\n color: ", ";\n }\n\n &:active {\n color: ", ";\n }\n"], ["\n font-size: 1.2rem;\n font-weight: 500;\n line-height: 160%;\n color: ", ";\n transition: all 0.2s;\n\n &:hover {\n cursor: pointer;\n color: ", ";\n }\n\n &:active {\n color: ", ";\n }\n"])), Colors.Orange, lighten(0.025, Colors.Orange), darken(0.025, Colors.Orange));
|
|
396
|
-
function Product(_a) {
|
|
397
|
-
var _b = _a.title, title = _b === void 0 ? '' : _b, _c = _a.price, price = _c === void 0 ? 0 : _c, _d = _a.subtitle, subtitle = _d === void 0 ? '' : _d, _e = _a.description, description = _e === void 0 ? '' : _e,
|
|
398
|
-
// Counter Props
|
|
399
|
-
value = _a.value, minValue = _a.minValue, maxValue = _a.maxValue, onIncrement = _a.onIncrement, onDecrement = _a.onDecrement;
|
|
400
|
-
var _f = useState(false), showMore = _f[0], setShowMore = _f[1];
|
|
401
|
-
var _g = useState(true), showEllipsis = _g[0], setShowEllipsis = _g[1];
|
|
402
|
-
var descModified = description;
|
|
403
|
-
if (descModified.length > 210 && !showMore) {
|
|
404
|
-
descModified = descModified.substring(0, 210) + '...';
|
|
405
|
-
}
|
|
406
|
-
var toggle = function () {
|
|
407
|
-
setShowEllipsis(!showEllipsis);
|
|
408
|
-
setShowMore(!showMore);
|
|
409
|
-
};
|
|
410
|
-
return (React.createElement(Container$2, null,
|
|
411
|
-
React.createElement(Row, { justify: "space-between" },
|
|
412
|
-
React.createElement(Column, null,
|
|
413
|
-
React.createElement(Title, null, title),
|
|
414
|
-
React.createElement(Price, null,
|
|
415
|
-
"$",
|
|
416
|
-
output(price))),
|
|
417
|
-
React.createElement(Counter, { value: value, minValue: minValue, maxValue: maxValue, onIncrement: onIncrement, onDecrement: onDecrement })),
|
|
418
|
-
React.createElement(Row, null, subtitle && React.createElement(Subtitle, null, subtitle)),
|
|
419
|
-
(function () {
|
|
420
|
-
if (!description)
|
|
421
|
-
return;
|
|
422
|
-
return (React.createElement(Fragment, null,
|
|
423
|
-
React.createElement(AnimateHeight, { height: showMore ? "auto" : 67 },
|
|
424
|
-
React.createElement(Ellipsis, { active: showEllipsis },
|
|
425
|
-
React.createElement(Description, null, description))),
|
|
426
|
-
React.createElement(ShowMore, { onClick: function () { return toggle(); } }, showMore ? "Show Less" : "Show More")));
|
|
427
|
-
})()));
|
|
428
|
-
}
|
|
429
|
-
var templateObject_1$5, templateObject_2$3, templateObject_3$2, templateObject_4$1, templateObject_5$1, templateObject_6$1, templateObject_7, templateObject_8, templateObject_9;
|
|
430
|
-
|
|
431
|
-
function makeEventHandler(executeOnEvent) {
|
|
432
|
-
if (executeOnEvent === void 0) { executeOnEvent = function () { }; }
|
|
433
|
-
return function (eventHandler) {
|
|
434
|
-
return function (event) {
|
|
435
|
-
executeOnEvent();
|
|
436
|
-
eventHandler(event.currentTarget.value);
|
|
437
|
-
};
|
|
438
|
-
};
|
|
439
|
-
}
|
|
440
|
-
|
|
441
|
-
var Icons$1 = IconEnum;
|
|
442
|
-
|
|
443
|
-
export { Button, ButtonStates, ButtonTypes, Colors, Counter, Icon, Icons$1 as Icons, Input, Loader, LoaderSizes, Product, makeEventHandler };
|
package/rollup.config.js
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import typescript from "rollup-plugin-typescript2";
|
|
2
|
-
import pkg from "./package.json";
|
|
3
|
-
|
|
4
|
-
console.log(Object.keys(pkg.peerDependencies || {}));
|
|
5
|
-
|
|
6
|
-
export default [
|
|
7
|
-
{
|
|
8
|
-
input: "src/index.ts",
|
|
9
|
-
external: Object.keys(pkg.peerDependencies || {}),
|
|
10
|
-
plugins: [
|
|
11
|
-
typescript({
|
|
12
|
-
typescript: require("typescript")
|
|
13
|
-
})
|
|
14
|
-
],
|
|
15
|
-
output: [
|
|
16
|
-
{ file: pkg.main, format: "cjs" },
|
|
17
|
-
{ file: pkg.module, format: "esm" },
|
|
18
|
-
]
|
|
19
|
-
}
|
|
20
|
-
];
|