@licklist/design 0.44.485-dev.25 → 0.44.485-dev.27

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.
@@ -1 +1 @@
1
- {"version":3,"file":"ProductIcon.d.ts","sourceRoot":"","sources":["../../../../../../src/events/event-venue-map/components/MapPoint/components/ProductIcon/ProductIcon.tsx"],"names":[],"mappings":";AACA,OAAO,EAAQ,eAAe,EAAiB,MAAM,aAAa,CAAC;AACnE,OAAO,KAAK,MAAM,OAAO,CAAC;AAyB1B,MAAM,MAAM,gBAAgB,GAAG,eAAe,GAC5C,KAAK,CAAC,WAAW,GAAG;IAClB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,uBAAuB,EAAE,OAAO,CAAC;IACjC,gBAAgB,EAAE,OAAO,CAAC;CAC3B,CAAC;AAkBJ,eAAO,MAAM,WAAW,8EAOrB,gBAAgB,gBA8FlB,CAAC"}
1
+ {"version":3,"file":"ProductIcon.d.ts","sourceRoot":"","sources":["../../../../../../src/events/event-venue-map/components/MapPoint/components/ProductIcon/ProductIcon.tsx"],"names":[],"mappings":";AACA,OAAO,EAAQ,eAAe,EAAiB,MAAM,aAAa,CAAC;AACnE,OAAO,KAAK,MAAM,OAAO,CAAC;AA0B1B,MAAM,MAAM,gBAAgB,GAAG,eAAe,GAC5C,KAAK,CAAC,WAAW,GAAG;IAClB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,uBAAuB,EAAE,OAAO,CAAC;IACjC,gBAAgB,EAAE,OAAO,CAAC;CAC3B,CAAC;AAkBJ,eAAO,MAAM,WAAW,8EAOrB,gBAAgB,gBAwGlB,CAAC"}
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var o,t=require("tslib"),e=require("react"),r=(o=e)&&"object"==typeof o&&"default"in o?o.default:o,n=require("react-konva"),i="#FFFFFF",a="#FFFFFF80",c="#0E8CE2",l="#878787",d=function(o,t){void 0===t&&(t=!1);var e=document.getElementById("snippet-template-context");if(e){var r=getComputedStyle(e).getPropertyValue(o);return!r||r&&!t?r:"".concat(r,"80")}};exports.ProductIcon=function(o){var p,s,u=o.x,v=o.y,C=o.isActive,F=o.isSoldOut,f=o.isErrorOnChoosedProduct,k=o.isProductChoosed,P=e.useMemo((function(){return{pointBackgroundColor:d("--snippet-canvas-point-background-color")||i,pointBorderColor:d("--snippet-canvas-point-border-color",!0)||a,pointFontColor:d("--snippet-canvas-point-font-color")||c,activePointBackgroundColor:d("--snippet-canvas-active-point-background-color")||c,activePointBorderColor:d("--snippet-canvas-active-point-border-color",!0)||a,activePointFontColor:d("--snippet-canvas-active-point-font-color")||i}}),[C,f,k]);return r.createElement(n.Group,{x:u,y:v},r.createElement(n.Circle,t.__assign({radius:14,strokeWidth:2,x:0,y:-21},(p=P.pointBackgroundColor,s=P.pointBorderColor,C&&(s=P.activePointBorderColor),k&&(p=P.activePointBackgroundColor),f&&(s="#ff000080"),F&&(s=l,p=l),{fill:p,stroke:s}))),k?r.createElement(n.Path,{x:-7,y:-28,data:"M1.5 6L5.5 10L13.5 2",width:28,height:28,fill:P.activePointBackgroundColor,stroke:P.activePointFontColor,strokeWidth:3}):r.createElement(n.Path,{x:-7,y:-28,data:"M14 0C9.3569 0.6633 4.6431 0.6633 0 0L6 7V13H3V14H11V13H8V7L14 0Z",width:28,height:28,strokeWidth:1,fill:P.pointFontColor,stroke:P.pointFontColor}))};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var o,t=require("tslib"),e=require("react"),r=(o=e)&&"object"==typeof o&&"default"in o?o.default:o,n=require("react-konva"),i=require("../ProductTooltip/ProductTooltip.js"),a="#FFFFFF",c="#FFFFFF80",l="#0E8CE2",u="#878787",d=function(o,t){void 0===t&&(t=!1);var e=document.getElementById("snippet-template-context");if(e){var r=getComputedStyle(e).getPropertyValue(o);return!r||r&&!t?r:"".concat(r,"80")}};exports.ProductIcon=function(o){var s,p,v=o.x,C=o.y,f=o.isActive,F=o.isSoldOut,P=o.isErrorOnChoosedProduct,k=o.isProductChoosed,g=-28,h=t.__read(e.useState(!1),2),y=h[0],m=h[1],x=e.useMemo((function(){return{pointBackgroundColor:d("--snippet-canvas-point-background-color")||a,pointBorderColor:d("--snippet-canvas-point-border-color",!0)||c,pointFontColor:d("--snippet-canvas-point-font-color")||l,activePointBackgroundColor:d("--snippet-canvas-active-point-background-color")||l,activePointBorderColor:d("--snippet-canvas-active-point-border-color",!0)||c,activePointFontColor:d("--snippet-canvas-active-point-font-color")||a}}),[f,P,k]);return r.createElement(n.Group,{x:v,y:C,onMouseEnter:function(){return m(!0)},onMouseLeave:function(){return m(!1)}},r.createElement(n.Circle,t.__assign({radius:14,strokeWidth:2,x:0,y:-21},(s=x.pointBackgroundColor,p=x.pointBorderColor,f&&(p=x.activePointBorderColor),k&&(s=x.activePointBackgroundColor),P&&(p="#ff000080"),F&&(p=u,s=u),{fill:s,stroke:p}))),y&&F&&r.createElement(i.ProductTooltip,{x:-7,y:g,text:"Sold out"}),k?r.createElement(n.Path,{x:-7,y:g,data:"M1.5 6L5.5 10L13.5 2",width:28,height:28,fill:x.activePointBackgroundColor,stroke:x.activePointFontColor,strokeWidth:3}):r.createElement(n.Path,{x:-7,y:g,data:"M14 0C9.3569 0.6633 4.6431 0.6633 0 0L6 7V13H3V14H11V13H8V7L14 0Z",width:28,height:28,strokeWidth:1,fill:x.pointFontColor,stroke:x.pointFontColor}))};
@@ -0,0 +1,9 @@
1
+ /// <reference types="react" />
2
+ type ProductTooltipProps = {
3
+ x: number;
4
+ y: number;
5
+ text: string;
6
+ };
7
+ export declare const ProductTooltip: ({ x, y, text }: ProductTooltipProps) => JSX.Element;
8
+ export {};
9
+ //# sourceMappingURL=ProductTooltip.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ProductTooltip.d.ts","sourceRoot":"","sources":["../../../../../../src/events/event-venue-map/components/MapPoint/components/ProductTooltip/ProductTooltip.tsx"],"names":[],"mappings":";AAkBA,KAAK,mBAAmB,GAAG;IACzB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,IAAI,EAAE,MAAM,CAAC;CACd,CAAC;AAEF,eAAO,MAAM,cAAc,mBAAoB,mBAAmB,gBA2CjE,CAAC"}
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e,t=require("react"),r=(e=t)&&"object"==typeof e&&"default"in e?e.default:e,i=require("react-konva"),l="#000";exports.ProductTooltip=function(e){var t=e.x,o=e.y,c=e.text;return r.createElement(i.Group,{width:60,height:20,x:t+30,y:o-1},r.createElement(i.Rect,{x:-5,y:5,sceneFunc:function(e){e.beginPath(),e.moveTo(0,5),e.lineTo(5,0),e.lineTo(5,10),e.closePath(),e.fill()},fill:l,borderColor:l,opacity:.8}),r.createElement(i.Rect,{x:0,y:0,width:60,height:20,fill:l,cornerRadius:5,opacity:.8}),r.createElement(i.Text,{y:4,text:c,strokeWidth:5,width:60,align:"center",verticalAlign:"middle",fill:"#FFF"}))};
@@ -0,0 +1,2 @@
1
+ export { ProductTooltip } from "./ProductTooltip";
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/events/event-venue-map/components/MapPoint/components/ProductTooltip/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC"}
@@ -1,5 +1,5 @@
1
1
  /// <reference types="react" />
2
- interface Filters {
2
+ export interface Filters {
3
3
  id: string;
4
4
  name: string;
5
5
  email: string;
@@ -14,5 +14,4 @@ export interface SaleFiltersProps {
14
14
  onChange: (values: Filters) => void;
15
15
  }
16
16
  export declare function SaleFilters({ values, onChange }: SaleFiltersProps): JSX.Element;
17
- export {};
18
17
  //# sourceMappingURL=SaleFilters.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"SaleFilters.d.ts","sourceRoot":"","sources":["../../../src/sales/filters/SaleFilters.tsx"],"names":[],"mappings":";AAMA,UAAU,OAAO;IACf,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,eAAe,EAAE,MAAM,CAAC;IACxB,aAAa,EAAE,MAAM,CAAC;IACtB,mBAAmB,EAAE,MAAM,CAAC;IAC5B,iBAAiB,EAAE,MAAM,CAAC;IAC1B,UAAU,EAAE,OAAO,CAAC;CACrB;AAED,MAAM,WAAW,gBAAgB;IAC/B,MAAM,EAAE,OAAO,CAAC;IAChB,QAAQ,EAAE,CAAC,MAAM,EAAE,OAAO,KAAK,IAAI,CAAC;CACrC;AAUD,wBAAgB,WAAW,CAAC,EAAE,MAAM,EAAE,QAAQ,EAAE,EAAE,gBAAgB,eAsDjE"}
1
+ {"version":3,"file":"SaleFilters.d.ts","sourceRoot":"","sources":["../../../src/sales/filters/SaleFilters.tsx"],"names":[],"mappings":";AAMA,MAAM,WAAW,OAAO;IACtB,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,eAAe,EAAE,MAAM,CAAC;IACxB,aAAa,EAAE,MAAM,CAAC;IACtB,mBAAmB,EAAE,MAAM,CAAC;IAC5B,iBAAiB,EAAE,MAAM,CAAC;IAC1B,UAAU,EAAE,OAAO,CAAC;CACrB;AAED,MAAM,WAAW,gBAAgB;IAC/B,MAAM,EAAE,OAAO,CAAC;IAChB,QAAQ,EAAE,CAAC,MAAM,EAAE,OAAO,KAAK,IAAI,CAAC;CACrC;AAUD,wBAAgB,WAAW,CAAC,EAAE,MAAM,EAAE,QAAQ,EAAE,EAAE,gBAAgB,eAsDjE"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@licklist/design",
3
- "version": "0.44.485-dev.25",
3
+ "version": "0.44.485-dev.27",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+ssh://git@bitbucket.org/artelogicsoft/licklist_design.git"
@@ -1,6 +1,7 @@
1
- import React, { useMemo } from "react";
1
+ import React, { useMemo, useState } from "react";
2
2
  import { Path, KonvaNodeEvents, Group, Circle } from "react-konva";
3
3
  import Konva from "konva";
4
+ import { ProductTooltip } from "../ProductTooltip";
4
5
 
5
6
  const ICON_DATA =
6
7
  "M14 0C9.3569 0.6633 4.6431 0.6633 0 0L6 7V13H3V14H11V13H8V7L14 0Z";
@@ -62,6 +63,8 @@ export const ProductIcon = ({
62
63
  const defaultX = -X_OFFSET;
63
64
  const defaultY = -Y_OFFSET;
64
65
 
66
+ const [hovered, setHovered] = useState<boolean>(false);
67
+
65
68
  const cssVariableValues = useMemo(() => {
66
69
  return {
67
70
  pointBackgroundColor:
@@ -119,7 +122,12 @@ export const ProductIcon = ({
119
122
  };
120
123
 
121
124
  return (
122
- <Group x={x} y={y}>
125
+ <Group
126
+ x={x}
127
+ y={y}
128
+ onMouseEnter={() => setHovered(true)}
129
+ onMouseLeave={() => setHovered(false)}
130
+ >
123
131
  <Circle
124
132
  radius={CIRCLE_RADIUS}
125
133
  strokeWidth={POINT_STROKE_WIDTH}
@@ -127,6 +135,9 @@ export const ProductIcon = ({
127
135
  y={defaultY * 0.75}
128
136
  {...circleColors()}
129
137
  />
138
+ {hovered && isSoldOut && (
139
+ <ProductTooltip x={defaultX} y={defaultY} text="Sold out" />
140
+ )}
130
141
  {isProductChoosed ? (
131
142
  <Path
132
143
  x={defaultX}
@@ -0,0 +1,68 @@
1
+ import React from "react";
2
+ import { Group, Rect, Text } from "react-konva";
3
+
4
+ const TOOLTIP_WIDTH = 60;
5
+ const TOOLTIP_HEIGHT = 20;
6
+
7
+ const BACKGROUND_COLOR = "#000";
8
+ const BACKGROUND_Y_OFFSET = 1;
9
+ const BACKGROUND_X_OFFSET = 30;
10
+ const BACKGROUND_RADIUS = 5;
11
+ const BACKGROUND_OPACITY = 0.8;
12
+
13
+ const TEXT_Y_OFFSET = 4;
14
+ const TEXT_STROKE_WIDTH = 5;
15
+ const TEXT_COLOR = "#FFF";
16
+ const TEXT_ALIGN = "center";
17
+ const TEXT_VERTICAL_ALIGN = "middle";
18
+
19
+ type ProductTooltipProps = {
20
+ x: number;
21
+ y: number;
22
+ text: string;
23
+ };
24
+
25
+ export const ProductTooltip = ({ x, y, text }: ProductTooltipProps) => {
26
+ return (
27
+ <Group
28
+ width={TOOLTIP_WIDTH}
29
+ height={TOOLTIP_HEIGHT}
30
+ x={x + BACKGROUND_X_OFFSET}
31
+ y={y - BACKGROUND_Y_OFFSET}
32
+ >
33
+ <Rect
34
+ x={-5}
35
+ y={5}
36
+ sceneFunc={(context) => {
37
+ context.beginPath();
38
+ context.moveTo(0, 5);
39
+ context.lineTo(5, 0);
40
+ context.lineTo(5, 10);
41
+ context.closePath();
42
+ context.fill();
43
+ }}
44
+ fill={BACKGROUND_COLOR}
45
+ borderColor={BACKGROUND_COLOR}
46
+ opacity={BACKGROUND_OPACITY}
47
+ />
48
+ <Rect
49
+ x={0}
50
+ y={0}
51
+ width={TOOLTIP_WIDTH}
52
+ height={TOOLTIP_HEIGHT}
53
+ fill={BACKGROUND_COLOR}
54
+ cornerRadius={BACKGROUND_RADIUS}
55
+ opacity={BACKGROUND_OPACITY}
56
+ />
57
+ <Text
58
+ y={TEXT_Y_OFFSET}
59
+ text={text}
60
+ strokeWidth={TEXT_STROKE_WIDTH}
61
+ width={TOOLTIP_WIDTH}
62
+ align={TEXT_ALIGN}
63
+ verticalAlign={TEXT_VERTICAL_ALIGN}
64
+ fill={TEXT_COLOR}
65
+ />
66
+ </Group>
67
+ );
68
+ };
@@ -0,0 +1 @@
1
+ export { ProductTooltip } from "./ProductTooltip";
@@ -6,6 +6,7 @@ import { Page, PageBody, PageHeader } from "../../page";
6
6
  import { BookingSummaryFooter } from "../../order-process/components/BookingSummaryFooter";
7
7
  import { BookingSummary } from "../../order-process/components/BookingSummary";
8
8
  import { CalendarSelect } from "../event-calendar/components/CalendarSelect";
9
+ import { Product } from "../../../types";
9
10
 
10
11
  export default {
11
12
  title: "Iframe/Event/IframeEventVenueMap",
@@ -268,6 +269,10 @@ export function Default() {
268
269
  pointProducts={MENU_STEPS[0].pointProducts}
269
270
  usedInIframe={usedInIframe}
270
271
  onPointClick={(pointId) => console.log({ pointId })}
272
+ products={
273
+ MENU_STEPS[0].productCategories[0]
274
+ .products as Partial<Product>[]
275
+ }
271
276
  choosedProductUuids={[
272
277
  "beb6393c-2fdd-40f7-bb92-8800685b203f",
273
278
  "beb6393c-2fdd-40f7-bb92-8800685b203a",
@@ -4,7 +4,7 @@ import clsx from "clsx";
4
4
  import { TextField } from "../../static/TextField";
5
5
  import { DateRangeInput } from "../../static/date-range-input";
6
6
 
7
- interface Filters {
7
+ export interface Filters {
8
8
  id: string;
9
9
  name: string;
10
10
  email: string;