@sellout/ui 0.0.148 → 0.0.150

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.
@@ -7,6 +7,9 @@ export declare type ProductProps = {
7
7
  subtitle?: string;
8
8
  description?: string;
9
9
  imageUrl?: string;
10
+ eventDays?: string[];
11
+ isMultiDaysEvent?: boolean;
12
+ timeZone?: string;
10
13
  remainingQty?: number;
11
14
  } & CounterProps;
12
- export default function Product({ title, price, subtitle, description, isRSVP, value, minValue, maxValue, onIncrement, onDecrement, remainingQty, }: ProductProps): JSX.Element;
15
+ export default function Product({ title, price, subtitle, description, isRSVP, value, minValue, maxValue, onIncrement, onDecrement, eventDays, isMultiDaysEvent, timeZone, remainingQty }: ProductProps): JSX.Element;
@@ -6,22 +6,24 @@ import { lighten, darken } from 'polished';
6
6
  import Counter from './Counter.js';
7
7
  import AnimateHeight from 'react-animate-height';
8
8
  import { output } from '@sellout/utils/.dist/price';
9
+ import { format } from '@sellout/utils/.dist/time';
9
10
 
10
11
  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
12
  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
13
  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
14
  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
- var Price = styled.div(templateObject_5 || (templateObject_5 = __makeTemplateObject(["\n font-size: 1.6rem;\n font-weight: 500;\n color: ", ";\n margin-bottom:5px;\n"], ["\n font-size: 1.6rem;\n font-weight: 500;\n color: ", ";\n margin-bottom:5px;\n"])), Colors.Grey2);
15
+ var Price = styled.div(templateObject_5 || (templateObject_5 = __makeTemplateObject(["\n font-size: 1.6rem;\n font-weight: 500;\n color: ", ";\n margin:5px 0;\n"], ["\n font-size: 1.6rem;\n font-weight: 500;\n color: ", ";\n margin:5px 0;\n"])), Colors.Grey2);
15
16
  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);
16
- 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);
17
+ 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: 5px;\n"], ["\n font-size: 1.2rem;\n font-weight: 500;\n line-height: 160%;\n color: ", ";\n margin-top: 5px;\n"])), Colors.Grey2);
17
18
  var Tag = styled.div(templateObject_8 || (templateObject_8 = __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.Orange);
18
19
  var Ellipsis = styled.div(templateObject_9 || (templateObject_9 = __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; });
19
20
  var ShowMore = styled.div(templateObject_10 || (templateObject_10 = __makeTemplateObject(["\n font-size: 1.2rem;\n font-weight: 500;\n line-height: 160%;\n color: ", ";\n transition: all 0.2s;\n"], ["\n font-size: 1.2rem;\n font-weight: 500;\n line-height: 160%;\n color: ", ";\n transition: all 0.2s;\n"])), Colors.Orange);
20
21
  var ShowMoreInner = styled.span(templateObject_11 || (templateObject_11 = __makeTemplateObject(["\n &:hover {\n cursor: pointer;\n color: ", ";\n }\n\n &:active {\n color: ", ";\n }\n"], ["\n &:hover {\n cursor: pointer;\n color: ", ";\n }\n\n &:active {\n color: ", ";\n }\n"])), lighten(0.025, Colors.Orange), darken(0.025, Colors.Orange));
22
+ var DateText = styled.span(templateObject_12 || (templateObject_12 = __makeTemplateObject(["\n font-size: 1.2rem;\n font-weight: 500;\n color: ", ";\n margin-bottom: 5px;\n padding-right: 5px;\n"], ["\n font-size: 1.2rem;\n font-weight: 500;\n color: ", ";\n margin-bottom: 5px;\n padding-right: 5px;\n"])), Colors.Grey2);
21
23
  function Product(_a) {
22
24
  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, _f = _a.isRSVP, isRSVP = _f === void 0 ? false : _f,
23
25
  // Counter Props
24
- value = _a.value, minValue = _a.minValue, maxValue = _a.maxValue, onIncrement = _a.onIncrement, onDecrement = _a.onDecrement, _g = _a.remainingQty, remainingQty = _g === void 0 ? 0 : _g;
26
+ value = _a.value, minValue = _a.minValue, maxValue = _a.maxValue, onIncrement = _a.onIncrement, onDecrement = _a.onDecrement, eventDays = _a.eventDays, isMultiDaysEvent = _a.isMultiDaysEvent, timeZone = _a.timeZone, _g = _a.remainingQty, remainingQty = _g === void 0 ? 0 : _g;
25
27
  var _h = useState(false), showMore = _h[0], setShowMore = _h[1];
26
28
  var _j = useState(true), showEllipsis = _j[0], setShowEllipsis = _j[1];
27
29
  var descModified = description;
@@ -36,6 +38,11 @@ function Product(_a) {
36
38
  React.createElement(Row, { justify: "space-between" },
37
39
  React.createElement(Column, null,
38
40
  React.createElement(Title, null, title),
41
+ isMultiDaysEvent && React.createElement("div", null, eventDays && eventDays.length > 0 && (eventDays === null || eventDays === void 0 ? void 0 : eventDays.map(function (day, i) {
42
+ return (React.createElement(DateText, { key: i },
43
+ format(day, "MMM Do", timeZone),
44
+ eventDays.length !== i + 1 && ","));
45
+ }))),
39
46
  isRSVP ? ((output(price, true) === "0.00" || 0) ? React.createElement(Price, null, "RSVP") : React.createElement(Price, null, "$" + output(price, true) + " (Ticket value)")) : React.createElement(Price, null, "$" + output(price, true))),
40
47
  remainingQty > 0 ? React.createElement(Counter, { value: value, minValue: minValue, maxValue: maxValue, onIncrement: onIncrement, onDecrement: onDecrement }) : React.createElement(Tag, null, " Sold out")),
41
48
  React.createElement(Row, null, subtitle && React.createElement(Subtitle, null, subtitle)),
@@ -50,6 +57,6 @@ function Product(_a) {
50
57
  React.createElement(ShowMoreInner, { onClick: function () { return toggle(); } }, showMore ? "Show Less" : "Show More"))));
51
58
  })()));
52
59
  }
53
- var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5, templateObject_6, templateObject_7, templateObject_8, templateObject_9, templateObject_10, templateObject_11;
60
+ var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5, templateObject_6, templateObject_7, templateObject_8, templateObject_9, templateObject_10, templateObject_11, templateObject_12;
54
61
 
55
62
  export default Product;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sellout/ui",
3
- "version": "0.0.148",
3
+ "version": "0.0.150",
4
4
  "main": "build/index.js",
5
5
  "module": "build/index.es.js",
6
6
  "files": [
@@ -70,7 +70,7 @@
70
70
  "shortid": "^2.2.16",
71
71
  "use-places-autocomplete": "^1.9.4"
72
72
  },
73
- "gitHead": "079631858b2c20d6323b6db24ba546e644915a3c",
73
+ "gitHead": "d5a47894cdbf2a11c8a49f5f48c7becc3314bfb4",
74
74
  "peerDependencies": {
75
75
  "react": "^16.13.0",
76
76
  "react-dom": "^16.13.0",