@sellout/ui 0.0.68 → 0.0.70
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/components/Button.d.ts +0 -1
- package/build/components/Button.js +1 -1
- package/build/components/Counter.d.ts +0 -1
- package/build/components/Counter.js +2 -2
- package/build/components/Dropdown.js +2 -2
- package/build/components/PhoneNumberInput.d.ts +1 -0
- package/build/components/PhoneNumberInput.js +4 -2
- package/build/components/Product.d.ts +2 -2
- package/build/components/Product.js +5 -7
- package/build/components/UserImage.js +3 -2
- package/build/components/UserInfo.js +3 -3
- package/build/utils/MediaQuery.d.ts +1 -0
- package/build/utils/MediaQuery.js +2 -1
- package/package.json +4 -4
|
@@ -34,7 +34,7 @@ var StyledButton = styled.div(templateObject_1 || (templateObject_1 = __makeTemp
|
|
|
34
34
|
";\n background-color: ",
|
|
35
35
|
";\n }\n"])), function (props) {
|
|
36
36
|
if (props.type === ButtonTypes.Next) {
|
|
37
|
-
return "
|
|
37
|
+
return "48px";
|
|
38
38
|
}
|
|
39
39
|
if (props.type === ButtonTypes.Regular) {
|
|
40
40
|
return "40px";
|
|
@@ -18,10 +18,10 @@ function Counter(_a) {
|
|
|
18
18
|
return (React.createElement(Container, null,
|
|
19
19
|
value > 0 && (React.createElement(Fragment, null,
|
|
20
20
|
React.createElement(IconContainer, { active: canDecrement, onClick: function () { return (canDecrement ? onDecrement() : null); }, justify: "flex-start" },
|
|
21
|
-
React.createElement(Icon, { icon: Icons.MinusCircleLight, color: canDecrement ? Colors.Orange : Colors.Grey5 })),
|
|
21
|
+
React.createElement(Icon, { icon: Icons.MinusCircleLight, color: canDecrement ? Colors.Orange : Colors.Grey5, size: 24 })),
|
|
22
22
|
React.createElement(Value, null, value))),
|
|
23
23
|
React.createElement(IconContainer, { active: canIncrement, onClick: function () { return (canIncrement ? onIncrement() : null); }, justify: "flex-end" },
|
|
24
|
-
React.createElement(Icon, { icon: Icons.PlusCircleLight, color: canIncrement ? Colors.Orange : Colors.Grey5 }))));
|
|
24
|
+
React.createElement(Icon, { icon: Icons.PlusCircleLight, color: canIncrement ? Colors.Orange : Colors.Grey5, size: 24 }))));
|
|
25
25
|
}
|
|
26
26
|
var templateObject_1, templateObject_2, templateObject_3;
|
|
27
27
|
|
|
@@ -8,8 +8,8 @@ import Label from './Label.js';
|
|
|
8
8
|
import Flex from './Flex.js';
|
|
9
9
|
|
|
10
10
|
var Container = styled.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n position: relative;\n height: 65px;\n width: ", ";\n"], ["\n position: relative;\n height: 65px;\n width: ", ";\n"])), function (props) { return props.width; });
|
|
11
|
-
var FieldContainer = styled.div(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n position: absolute;\n height: ", ";\n width: ", ";\n background-color: ", ";\n border: 1px solid ", ";\n border-radius: 10px;\n transition: all 0.2s;\n z-index: ", ";\n box-shadow: ", ";\n overflow: hidden;\n outline: none;\n\n &:hover {\n cursor: pointer
|
|
12
|
-
";\n overflow: hidden;\n outline: none;\n\n &:hover {\n cursor: pointer
|
|
11
|
+
var FieldContainer = styled.div(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n position: absolute;\n height: ", ";\n width: ", ";\n background-color: ", ";\n border: 1px solid ", ";\n border-radius: 10px;\n transition: all 0.2s;\n z-index: ", ";\n box-shadow: ", ";\n overflow: hidden;\n outline: none;\n\n &:hover {\n cursor: pointer;\n border: 1px solid ", ";\n }\n\n &:focus {\n border: 1px solid ", ";\n }\n"], ["\n position: absolute;\n height: ", ";\n width: ", ";\n background-color: ", ";\n border: 1px solid ", ";\n border-radius: 10px;\n transition: all 0.2s;\n z-index: ", ";\n box-shadow: ",
|
|
12
|
+
";\n overflow: hidden;\n outline: none;\n\n &:hover {\n cursor: pointer;\n border: 1px solid ", ";\n }\n\n &:focus {\n border: 1px solid ", ";\n }\n"])), function (props) { return (props.open ? props.height : "38px"); }, function (props) { return props.width; }, Colors.White, Colors.Grey5, function (props) { return (props.open ? 100 : 0); }, function (props) {
|
|
13
13
|
return props.open ? "0px 4px 16px rgba(0, 0, 0, 0.05)" : "";
|
|
14
14
|
}, darken(0.05, Colors.Grey5), Colors.Grey4);
|
|
15
15
|
var TopRow = styled.div(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n display: flex;\n flex-direction: row;\n align-items: center;\n justify-content: space-between;\n height: 38px;\n padding: 0 15px;\n"], ["\n display: flex;\n flex-direction: row;\n align-items: center;\n justify-content: space-between;\n height: 38px;\n padding: 0 15px;\n"])));
|
|
@@ -17,7 +17,7 @@ var Container = styled.div(templateObject_1 || (templateObject_1 = __makeTemplat
|
|
|
17
17
|
// overwrite the preset style imports
|
|
18
18
|
var InnerContainer = styled.div(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n .react-tel-input {\n font-family: \"neue-haas-grotesk-display\", sans-serif;\n font-size: ", ";\n position: relative;\n width: 100%;\n :disabled {\n cursor: not-allowed;\n }\n\n .form-control {\n font-family: \"neue-haas-grotesk-display\", sans-serif;\n text-indent: 15px;\n transition: all 0.2s;\n color: ", ";\n font-weight: 500;\n position: relative;\n font-size: ", ";\n margin-top: 0 !important;\n margin-bottom: 0 !important;\n margin-left: 50px;\n padding-left: 0;\n background: ", ";\n border: 1px solid ", ";\n border-radius: 0px 10px 10px 0px;\n height: ", ";\n width: calc(100% - 50px);\n z-index: 1;\n outline: none;\n &:hover {\n border: 1px solid ", ";\n }\n &.invalid-number {\n border: 1px solid ", ";\n background-color: ", ";\n border-left-color: ", ";\n &:focus {\n border: 1px solid ", ";\n border-left-color: ", ";\n background-color: ", ";\n }\n }\n &.open {\n border-color: ", ";\n border-radius: 0px 10px 0 0;\n /* border-bottom: none; */\n box-shadow: none;\n }\n ::placeholder {\n color: ", ";\n }\n &:focus {\n border: 1px solid ", ";\n }\n }\n\n .flag-dropdown {\n outline: none;\n position: absolute;\n width: 100%;\n top: 0;\n bottom: 0;\n padding: 0;\n background-color: ", ";\n border: 1px solid ", ";\n border-radius: 10px;\n &.open {\n background: ", ";\n border-radius: 10px 10px 0 0;\n .selected-flag {\n background: ", ";\n border-radius: 10px 0 0 0;\n }\n }\n &:hover, &:focus {\n cursor: pointer;\n .selected-flag {\n background-color: ", ";\n }\n }\n }\n\n input[disabled] {\n &+.flag-dropdown {\n &:hover {\n cursor: default;\n .selected-flag {\n background-color: transparent;\n }\n }\n }\n }\n\n .selected-flag {\n transition: all 0.2s;\n background: ", ";\n position: relative;\n width: 50px;\n height: 100%;\n padding: 0 0 0 10px;\n border-radius: 10px 0 0 10px;\n .flag {\n position: absolute;\n top: 50%;\n margin-top: -5px;\n }\n .arrow {\n position: relative;\n top: 50%;\n margin-top: -2px;\n left: 25px;\n width: 0;\n height: 0;\n border-left: 3px solid transparent;\n border-right: 3px solid transparent;\n border-top: 4px solid #555;\n &.up {\n border-top: none;\n border-bottom: 4px solid #555;\n }\n }\n &.open {\n z-index: 2;\n }\n }\n\n .country-list {\n z-index: 2;\n border-radius: 0 0 10px 10px;\n border: 1px solid ", ";\n border-top: none;\n list-style: none;\n position: absolute;\n padding: 0;\n margin: 0px 0 10px -1px;\n box-shadow: unset;\n background-color: ", ";\n width: calc(100% + 2px);\n max-height: ", ";\n overflow-y: scroll;\n .flag {\n display: inline-block;\n }\n .divider {\n padding-bottom: 5px;\n margin-bottom: 5px;\n border-bottom: 1px solid #ccc;\n }\n .country {\n padding: 7px 9px;\n .dial-code {\n color: #6b6b6b;\n }\n &:hover {\n background-color: #f1f1f1;\n }\n &.highlight {\n background-color: #f1f1f1;\n }\n }\n .flag {\n margin-right: 7px;\n margin-top: 2px;\n }\n .country-name {\n margin-right: 6px;\n }\n .search {\n position: sticky;\n top: 0;\n background-color: #fff;\n padding: 5px 0 6px 10px;\n }\n .search-emoji {\n display: none;\n font-size: ", ";\n }\n .search-box {\n border: 1px solid #cacaca;\n border-radius: 3px;\n font-size: ", ";\n line-height: 15px;\n padding: 3px 8px 5px;\n outline: none;\n }\n .no-entries-message {\n padding: 7px 10px 11px;\n opacity: .7;\n }\n &::-webkit-scrollbar { width: 12px; }\n &::-webkit-scrollbar-track { background-color: #e6e6e6; }\n &::-webkit-scrollbar-thumb { background-color: #c5c5c4; border-radius: 5px; }\n }\n\n .invalid-number-message {\n position: absolute;\n z-index: 1;\n font-size: ", ";\n left: 46px;\n top: -8px;\n background: #fff;\n padding: 0 2px;\n color: #de0000;\n }\n }\n"], ["\n .react-tel-input {\n font-family: \"neue-haas-grotesk-display\", sans-serif;\n font-size: ", ";\n position: relative;\n width: 100%;\n :disabled {\n cursor: not-allowed;\n }\n\n .form-control {\n font-family: \"neue-haas-grotesk-display\", sans-serif;\n text-indent: 15px;\n transition: all 0.2s;\n color: ", ";\n font-weight: 500;\n position: relative;\n font-size: ", ";\n margin-top: 0 !important;\n margin-bottom: 0 !important;\n margin-left: 50px;\n padding-left: 0;\n background: ", ";\n border: 1px solid ", ";\n border-radius: 0px 10px 10px 0px;\n height: ", ";\n width: calc(100% - 50px);\n z-index: 1;\n outline: none;\n &:hover {\n border: 1px solid ", ";\n }\n &.invalid-number {\n border: 1px solid ", ";\n background-color: ", ";\n border-left-color: ", ";\n &:focus {\n border: 1px solid ", ";\n border-left-color: ", ";\n background-color: ", ";\n }\n }\n &.open {\n border-color: ", ";\n border-radius: 0px 10px 0 0;\n /* border-bottom: none; */\n box-shadow: none;\n }\n ::placeholder {\n color: ", ";\n }\n &:focus {\n border: 1px solid ", ";\n }\n }\n\n .flag-dropdown {\n outline: none;\n position: absolute;\n width: 100%;\n top: 0;\n bottom: 0;\n padding: 0;\n background-color: ", ";\n border: 1px solid ", ";\n border-radius: 10px;\n &.open {\n background: ", ";\n border-radius: 10px 10px 0 0;\n .selected-flag {\n background: ", ";\n border-radius: 10px 0 0 0;\n }\n }\n &:hover, &:focus {\n cursor: pointer;\n .selected-flag {\n background-color: ", ";\n }\n }\n }\n\n input[disabled] {\n &+.flag-dropdown {\n &:hover {\n cursor: default;\n .selected-flag {\n background-color: transparent;\n }\n }\n }\n }\n\n .selected-flag {\n transition: all 0.2s;\n background: ", ";\n position: relative;\n width: 50px;\n height: 100%;\n padding: 0 0 0 10px;\n border-radius: 10px 0 0 10px;\n .flag {\n position: absolute;\n top: 50%;\n margin-top: -5px;\n }\n .arrow {\n position: relative;\n top: 50%;\n margin-top: -2px;\n left: 25px;\n width: 0;\n height: 0;\n border-left: 3px solid transparent;\n border-right: 3px solid transparent;\n border-top: 4px solid #555;\n &.up {\n border-top: none;\n border-bottom: 4px solid #555;\n }\n }\n &.open {\n z-index: 2;\n }\n }\n\n .country-list {\n z-index: 2;\n border-radius: 0 0 10px 10px;\n border: 1px solid ", ";\n border-top: none;\n list-style: none;\n position: absolute;\n padding: 0;\n margin: 0px 0 10px -1px;\n box-shadow: unset;\n background-color: ", ";\n width: calc(100% + 2px);\n max-height: ", ";\n overflow-y: scroll;\n .flag {\n display: inline-block;\n }\n .divider {\n padding-bottom: 5px;\n margin-bottom: 5px;\n border-bottom: 1px solid #ccc;\n }\n .country {\n padding: 7px 9px;\n .dial-code {\n color: #6b6b6b;\n }\n &:hover {\n background-color: #f1f1f1;\n }\n &.highlight {\n background-color: #f1f1f1;\n }\n }\n .flag {\n margin-right: 7px;\n margin-top: 2px;\n }\n .country-name {\n margin-right: 6px;\n }\n .search {\n position: sticky;\n top: 0;\n background-color: #fff;\n padding: 5px 0 6px 10px;\n }\n .search-emoji {\n display: none;\n font-size: ", ";\n }\n .search-box {\n border: 1px solid #cacaca;\n border-radius: 3px;\n font-size: ", ";\n line-height: 15px;\n padding: 3px 8px 5px;\n outline: none;\n }\n .no-entries-message {\n padding: 7px 10px 11px;\n opacity: .7;\n }\n &::-webkit-scrollbar { width: 12px; }\n &::-webkit-scrollbar-track { background-color: #e6e6e6; }\n &::-webkit-scrollbar-thumb { background-color: #c5c5c4; border-radius: 5px; }\n }\n\n .invalid-number-message {\n position: absolute;\n z-index: 1;\n font-size: ", ";\n left: 46px;\n top: -8px;\n background: #fff;\n padding: 0 2px;\n color: #de0000;\n }\n }\n"])), function (props) { return props.isMobile ? '1.6rem' : '1.4rem'; }, Colors.Grey1, function (props) { return props.isMobile ? '1.6rem' : '1.4rem'; }, Colors.White, Colors.Grey5, function (props) { return props.phoneNumberInputSize === PhoneNumberInputSizes.Regular ? '38px' : '48px'; }, Colors.Grey5, Colors.Grey5, Colors.White, Colors.Grey5, Colors.Grey4, Colors.Grey5, Colors.White, Colors.Grey5, Colors.Grey4, Colors.Grey4, Colors.Grey6, Colors.Grey5, Colors.Grey6, Colors.Grey6, Colors.Grey5, Colors.Grey6, Colors.Grey5, Colors.White, function (props) { return props.isMobile ? '180px' : '200px'; }, function (props) { return props.isMobile ? '1.6rem' : '1.4rem'; }, function (props) { return props.isMobile ? '1.6rem' : '1.4rem'; }, function (props) { return props.isMobile ? '1.6rem' : '1.4rem'; });
|
|
19
19
|
var PhoneNumberInput = function (_a) {
|
|
20
|
-
var value = _a.value, onChange = _a.onChange, onEnter = _a.onEnter, validationError = _a.validationError, phoneNumberInputSize = _a.phoneNumberInputSize, subLabel = _a.subLabel, tip = _a.tip, label = _a.label, margin = _a.margin;
|
|
20
|
+
var value = _a.value, onChange = _a.onChange, onEnter = _a.onEnter, validationError = _a.validationError, phoneNumberInputSize = _a.phoneNumberInputSize, subLabel = _a.subLabel, tip = _a.tip, label = _a.label, margin = _a.margin, autoFocus = _a.autoFocus;
|
|
21
21
|
return (React.createElement(Container, { margin: margin },
|
|
22
22
|
label && React.createElement(Label, { text: label, subText: subLabel, tip: tip }),
|
|
23
23
|
React.createElement(InnerContainer, { isMobile: useMobileMedia(), phoneNumberInputSize: phoneNumberInputSize },
|
|
@@ -31,7 +31,9 @@ var PhoneNumberInput = function (_a) {
|
|
|
31
31
|
}
|
|
32
32
|
}, onChange: function (value) {
|
|
33
33
|
onChange(value);
|
|
34
|
-
}, countryCodeEditable: false
|
|
34
|
+
}, countryCodeEditable: false, inputProps: {
|
|
35
|
+
autoFocus: autoFocus,
|
|
36
|
+
} }),
|
|
35
37
|
validationError && (React.createElement(ValidationError, { validationError: validationError })))));
|
|
36
38
|
};
|
|
37
39
|
var templateObject_1, templateObject_2;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
1
|
import { CounterProps } from './Counter';
|
|
3
2
|
export declare type ProductProps = {
|
|
4
3
|
title: string;
|
|
5
4
|
price: number;
|
|
5
|
+
isRSVP?: boolean;
|
|
6
6
|
subtitle?: string;
|
|
7
7
|
description?: string;
|
|
8
8
|
imageUrl?: string;
|
|
9
9
|
} & CounterProps;
|
|
10
|
-
export default function Product({ title, price, subtitle, description, value, minValue, maxValue, onIncrement, onDecrement, }: ProductProps): JSX.Element;
|
|
10
|
+
export default function Product({ title, price, isRSVP, subtitle, description, value, minValue, maxValue, onIncrement, onDecrement, }: ProductProps): JSX.Element;
|
|
@@ -9,7 +9,7 @@ import { output } from '@sellout/utils/.dist/price';
|
|
|
9
9
|
|
|
10
10
|
var Row = styled.div(templateObject_1 || (templateObject_1 = __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; });
|
|
11
11
|
var Column = styled.div(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n display: flex;\n flex-direction: column;\n"], ["\n display: flex;\n flex-direction: column;\n"])));
|
|
12
|
-
var Container = styled.div(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n background-color: ", ";\n margin: 0
|
|
12
|
+
var Container = styled.div(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n background-color: ", ";\n margin: 0 24px;\n padding: 24px 0;\n border-bottom: 1px solid ", ";\n"], ["\n background-color: ", ";\n margin: 0 24px;\n padding: 24px 0;\n border-bottom: 1px solid ", ";\n"])), Colors.White, Colors.Grey6);
|
|
13
13
|
var Title = styled.div(templateObject_4 || (templateObject_4 = __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);
|
|
14
14
|
var Price = styled.div(templateObject_5 || (templateObject_5 = __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);
|
|
15
15
|
var Subtitle = styled.div(templateObject_6 || (templateObject_6 = __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);
|
|
@@ -17,11 +17,11 @@ var Description = styled.div(templateObject_7 || (templateObject_7 = __makeTempl
|
|
|
17
17
|
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; });
|
|
18
18
|
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));
|
|
19
19
|
function Product(_a) {
|
|
20
|
-
var _b = _a.title, title = _b === void 0 ? '' : _b, _c = _a.price, price = _c === void 0 ? 0 : _c, _d = _a.subtitle, subtitle =
|
|
20
|
+
var _b = _a.title, title = _b === void 0 ? '' : _b, _c = _a.price, price = _c === void 0 ? 0 : _c, _d = _a.isRSVP, isRSVP = _d === void 0 ? false : _d, _e = _a.subtitle, subtitle = _e === void 0 ? '' : _e, _f = _a.description, description = _f === void 0 ? '' : _f,
|
|
21
21
|
// Counter Props
|
|
22
22
|
value = _a.value, minValue = _a.minValue, maxValue = _a.maxValue, onIncrement = _a.onIncrement, onDecrement = _a.onDecrement;
|
|
23
|
-
var
|
|
24
|
-
var
|
|
23
|
+
var _g = useState(false), showMore = _g[0], setShowMore = _g[1];
|
|
24
|
+
var _h = useState(true), showEllipsis = _h[0], setShowEllipsis = _h[1];
|
|
25
25
|
var descModified = description;
|
|
26
26
|
if (descModified.length > 210 && !showMore) {
|
|
27
27
|
descModified = descModified.substring(0, 210) + '...';
|
|
@@ -34,9 +34,7 @@ function Product(_a) {
|
|
|
34
34
|
React.createElement(Row, { justify: "space-between" },
|
|
35
35
|
React.createElement(Column, null,
|
|
36
36
|
React.createElement(Title, null, title),
|
|
37
|
-
React.createElement(Price, null,
|
|
38
|
-
"$",
|
|
39
|
-
output(price))),
|
|
37
|
+
React.createElement(Price, null, isRSVP ? 'RSVP' : "$" + output(price))),
|
|
40
38
|
React.createElement(Counter, { value: value, minValue: minValue, maxValue: maxValue, onIncrement: onIncrement, onDecrement: onDecrement })),
|
|
41
39
|
React.createElement(Row, null, subtitle && React.createElement(Subtitle, null, subtitle)),
|
|
42
40
|
(function () {
|
|
@@ -2,16 +2,17 @@ import { Colors } from '../Colors.js';
|
|
|
2
2
|
import { __makeTemplateObject } from '../_virtual/_tslib.js';
|
|
3
3
|
import React from 'react';
|
|
4
4
|
import styled from 'styled-components';
|
|
5
|
+
import Icon, { Icons } from './Icon.js';
|
|
5
6
|
|
|
6
7
|
var UserImageDiv = styled.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n background-color: ", ";\n height: ", ";\n width: ", ";\n min-height: ", ";\n min-width: ", ";\n border-radius: ", ";\n color: ", ";\n font-size: ", ";\n font-weight: 600;\n display: flex;\n justify-content: center;\n align-items: center;\n margin: ", ";\n background-image: ", ";\n background-position: center;\n background-size: cover;\n"], ["\n background-color: ", ";\n height: ", ";\n width: ", ";\n min-height: ", ";\n min-width: ", ";\n border-radius: ", ";\n color: ", ";\n font-size: ", ";\n font-weight: 600;\n display: flex;\n justify-content: center;\n align-items: center;\n margin: ", ";\n background-image: ", ";\n background-position: center;\n background-size: cover;\n"])), function (props) { return (props.invert ? Colors.White : Colors.Grey1); }, function (props) { return props.height; }, function (props) { return props.height; }, function (props) { return props.height; }, function (props) { return props.height; }, function (props) { return (props.circle ? '50%' : '0'); }, function (props) { return (props.invert ? Colors.Grey1 : Colors.White); }, function (props) { return props.size; }, function (props) { return props.margin || '0px 10px 0px 0px'; }, function (props) { return "url(" + props.src + ")"; });
|
|
7
8
|
var UserImage = function (_a) {
|
|
8
9
|
var imageUrl = _a.imageUrl, _b = _a.height, height = _b === void 0 ? '45px' : _b, _c = _a.size, size = _c === void 0 ? '1.8rem' : _c, firstName = _a.firstName, lastName = _a.lastName, margin = _a.margin, invert = _a.invert, _d = _a.circle, circle = _d === void 0 ? true : _d;
|
|
9
10
|
if (!imageUrl) {
|
|
10
|
-
var userInitials = '
|
|
11
|
+
var userInitials = '';
|
|
11
12
|
if (firstName && lastName) {
|
|
12
13
|
userInitials = "" + firstName.split('')[0] + lastName.split('')[0];
|
|
13
14
|
}
|
|
14
|
-
return (React.createElement(UserImageDiv, { height: height, margin: margin, invert: invert, size: size, circle: circle }, userInitials));
|
|
15
|
+
return (React.createElement(UserImageDiv, { height: height, margin: margin, invert: invert, size: size, circle: circle }, userInitials ? userInitials : (React.createElement(Icon, { icon: Icons.UserSolid, color: invert ? Colors.Grey1 : Colors.White, size: 16 }))));
|
|
15
16
|
}
|
|
16
17
|
return (React.createElement(UserImageDiv, { src: imageUrl, height: height, margin: margin, circle: circle }));
|
|
17
18
|
};
|
|
@@ -28,9 +28,9 @@ var UserInfo = function (_a) {
|
|
|
28
28
|
return (React.createElement(Container, null,
|
|
29
29
|
React.createElement(UserImage, { imageUrl: imageUrl, height: height, size: isLarge ? "1.8rem" : "1.4rem", firstName: firstName, lastName: lastName, invert: invert }),
|
|
30
30
|
React.createElement(Details, null,
|
|
31
|
-
React.createElement(UserName, null),
|
|
32
|
-
React.createElement(UserEmail, null),
|
|
33
|
-
isLarge && React.createElement(UserPhoneNumber, null))));
|
|
31
|
+
firstName && lastName && React.createElement(UserName, null),
|
|
32
|
+
email && React.createElement(UserEmail, null),
|
|
33
|
+
isLarge && phoneNumber && React.createElement(UserPhoneNumber, null))));
|
|
34
34
|
};
|
|
35
35
|
var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5;
|
|
36
36
|
|
|
@@ -12,6 +12,7 @@ export declare const media: {
|
|
|
12
12
|
};
|
|
13
13
|
export declare const useMedia: (query: any) => boolean;
|
|
14
14
|
export declare const useMobileMedia: () => boolean;
|
|
15
|
+
export declare const useTabletMedia: () => boolean;
|
|
15
16
|
export declare const useDesktopMedia: () => boolean;
|
|
16
17
|
export declare const useLargeDesktopMedia: () => boolean;
|
|
17
18
|
export declare const useGiantMedia: () => boolean;
|
|
@@ -56,9 +56,10 @@ var useMedia = function (query) {
|
|
|
56
56
|
return isMatch;
|
|
57
57
|
};
|
|
58
58
|
var useMobileMedia = function () { return useMedia("" + queryStrings.mobile); };
|
|
59
|
+
var useTabletMedia = function () { return useMedia("" + queryStrings.tablet); };
|
|
59
60
|
var useDesktopMedia = function () { return useMedia("" + queryStrings.desktop); };
|
|
60
61
|
var useLargeDesktopMedia = function () { return useMedia("" + queryStrings.largeDesktop); };
|
|
61
62
|
var useGiantMedia = function () { return useMedia("" + queryStrings.giant); };
|
|
62
63
|
var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5, templateObject_6, templateObject_7, templateObject_8, templateObject_9, templateObject_10, templateObject_11;
|
|
63
64
|
|
|
64
|
-
export { media, useDesktopMedia, useGiantMedia, useLargeDesktopMedia, useMedia, useMobileMedia };
|
|
65
|
+
export { media, useDesktopMedia, useGiantMedia, useLargeDesktopMedia, useMedia, useMobileMedia, useTabletMedia };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sellout/ui",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.70",
|
|
4
4
|
"main": "build/index.js",
|
|
5
5
|
"module": "build/index.es.js",
|
|
6
6
|
"files": [
|
|
@@ -56,8 +56,8 @@
|
|
|
56
56
|
"@hapi/joi": "^17.1.1",
|
|
57
57
|
"@react-pdf/primitives": "^2.0.0-beta.11",
|
|
58
58
|
"@react-pdf/renderer": "^2.0.0-beta.14",
|
|
59
|
-
"@sellout/models": "^0.0.
|
|
60
|
-
"@sellout/utils": "^0.0.
|
|
59
|
+
"@sellout/models": "^0.0.70",
|
|
60
|
+
"@sellout/utils": "^0.0.70",
|
|
61
61
|
"@types/escape-html": "^1.0.0",
|
|
62
62
|
"@types/hapi__joi": "^16.0.12",
|
|
63
63
|
"@types/react-pdf": "^4.0.6",
|
|
@@ -70,7 +70,7 @@
|
|
|
70
70
|
"rollup-plugin-url": "^3.0.1",
|
|
71
71
|
"shortid": "^2.2.15"
|
|
72
72
|
},
|
|
73
|
-
"gitHead": "
|
|
73
|
+
"gitHead": "d92f4201d8d3d210acac2de571282768c95e8303",
|
|
74
74
|
"peerDependencies": {
|
|
75
75
|
"react": "^16.13.0",
|
|
76
76
|
"react-dom": "^16.13.0",
|