@licklist/design 0.44.485-dev.63 → 0.44.485-dev.65
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/dist/events/event-venue-map/components/MapPoint/MapPoint.js +1 -1
- package/dist/help/popover/HelpPopover.d.ts +4 -2
- package/dist/help/popover/HelpPopover.d.ts.map +1 -1
- package/dist/help/popover/HelpPopover.js +1 -1
- package/dist/iframe/event/event-card/IframeEventCard.d.ts +3 -3
- package/dist/iframe/event/event-card/IframeEventCard.d.ts.map +1 -1
- package/dist/iframe/event/event-card/IframeEventCard.js +1 -1
- package/dist/iframe/event/event-card/IframeEventCardSkeleton.d.ts +3 -3
- package/dist/iframe/event/event-card/IframeEventCardSkeleton.d.ts.map +1 -1
- package/dist/iframe/event/event-card/IframeEventCardSkeleton.js +1 -1
- package/dist/image-radio-input/ImageRadioInput.d.ts +15 -0
- package/dist/image-radio-input/ImageRadioInput.d.ts.map +1 -0
- package/dist/image-radio-input/ImageRadioInput.js +1 -0
- package/dist/image-radio-input/index.d.ts.map +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/product-set/product/quantity/ProductQuantityRechargingControl.d.ts.map +1 -1
- package/dist/product-set/product/quantity/ProductQuantityRechargingControl.js +1 -1
- package/dist/provider/constants.d.ts +1 -1
- package/dist/provider/constants.js +1 -1
- package/dist/provider/provider-details-input/ProviderDetailsInput.js +1 -1
- package/dist/radio-card/RadioCard.d.ts +13 -0
- package/dist/radio-card/RadioCard.d.ts.map +1 -0
- package/dist/radio-card/RadioCard.js +1 -0
- package/dist/radio-card/index.d.ts +2 -0
- package/dist/radio-card/index.d.ts.map +1 -0
- package/dist/setting/dashboard/index.d.ts +0 -2
- package/dist/setting/dashboard/index.d.ts.map +1 -1
- package/dist/snippet/snippet-template/preview/Preview.d.ts.map +1 -1
- package/dist/snippet/snippet-template/preview/Preview.js +1 -1
- package/dist/sorting-select/SortingSelect.d.ts +10 -0
- package/dist/sorting-select/SortingSelect.d.ts.map +1 -0
- package/dist/sorting-select/SortingSelect.js +1 -0
- package/dist/sorting-select/index.d.ts +2 -0
- package/dist/sorting-select/index.d.ts.map +1 -0
- package/{src/styles/widgets/ImageRadioInput.scss → dist/styles/image-radio-input/_index.scss} +12 -0
- package/dist/styles/packages.scss +2 -1
- package/{src/styles/widgets/WidgetTypeRadioButton.scss → dist/styles/radio-card/_index.scss} +8 -1
- package/package.json +2 -2
- package/src/events/event-venue-map/components/MapPoint/MapPoint.tsx +1 -1
- package/src/help/popover/HelpPopover.tsx +13 -5
- package/src/iframe/event/event-card/IframeEventCard.stories.tsx +6 -14
- package/src/iframe/event/event-card/IframeEventCard.tsx +6 -10
- package/src/iframe/event/event-card/IframeEventCardSkeleton.tsx +20 -30
- package/src/iframe/event/event-card/IframeEventCards.stories.tsx +2 -3
- package/src/image-radio-input/ImageRadioInput.stories.tsx +67 -0
- package/src/image-radio-input/ImageRadioInput.tsx +53 -0
- package/src/index.ts +3 -0
- package/src/product-set/product/quantity/ProductQuantityRechargingControl.tsx +0 -5
- package/src/provider/constants.ts +1 -1
- package/src/provider/provider-details-input/ProviderDetailsInput.tsx +1 -1
- package/src/radio-card/RadioCard.stories.tsx +48 -0
- package/src/radio-card/RadioCard.tsx +49 -0
- package/src/radio-card/index.ts +1 -0
- package/src/setting/dashboard/index.ts +0 -2
- package/src/snippet/snippet-template/preview/Preview.tsx +0 -5
- package/src/sorting-select/SortingSelect.stories.tsx +15 -0
- package/src/sorting-select/SortingSelect.tsx +79 -0
- package/src/sorting-select/index.ts +1 -0
- package/{dist/styles/widgets/ImageRadioInput.scss → src/styles/image-radio-input/_index.scss} +12 -0
- package/src/styles/packages.scss +2 -1
- package/{dist/styles/widgets/WidgetTypeRadioButton.scss → src/styles/radio-card/_index.scss} +8 -1
- package/dist/assets/widgets/circlePlus.svg +0 -4
- package/dist/assets/widgets/inPage.svg +0 -10
- package/dist/assets/widgets/overlay.svg +0 -9
- package/dist/assets/widgets/sidebar.svg +0 -9
- package/dist/setting/dashboard/snippets/control/SnippetControl.d.ts +0 -9
- package/dist/setting/dashboard/snippets/control/SnippetControl.d.ts.map +0 -1
- package/dist/setting/dashboard/snippets/control/SnippetControl.js +0 -1
- package/dist/setting/dashboard/snippets/control/index.d.ts +0 -2
- package/dist/setting/dashboard/snippets/control/index.d.ts.map +0 -1
- package/dist/setting/dashboard/snippets/form/SnippetForm.d.ts +0 -33
- package/dist/setting/dashboard/snippets/form/SnippetForm.d.ts.map +0 -1
- package/dist/setting/dashboard/snippets/form/SnippetForm.js +0 -1
- package/dist/setting/dashboard/snippets/form/context.d.ts +0 -11
- package/dist/setting/dashboard/snippets/form/context.d.ts.map +0 -1
- package/dist/setting/dashboard/snippets/form/context.js +0 -1
- package/dist/setting/dashboard/snippets/form/index.d.ts +0 -2
- package/dist/setting/dashboard/snippets/form/index.d.ts.map +0 -1
- package/dist/setting/dashboard/snippets/modal/SnippetViewTypeModal.d.ts +0 -19
- package/dist/setting/dashboard/snippets/modal/SnippetViewTypeModal.d.ts.map +0 -1
- package/dist/setting/dashboard/snippets/modal/SnippetViewTypeModal.js +0 -1
- package/dist/setting/dashboard/snippets/modal/index.d.ts +0 -3
- package/dist/setting/dashboard/snippets/modal/index.d.ts.map +0 -1
- package/dist/styles/widgets/BookingStyleSelector.scss +0 -14
- package/dist/styles/widgets/CalendarStyleSelector.scss +0 -17
- package/dist/styles/widgets/CheckboxGroup.scss +0 -15
- package/dist/styles/widgets/ProductSetSelector.scss +0 -19
- package/dist/styles/widgets/SnippetCode.scss +0 -18
- package/dist/styles/widgets/WidgetBuilderForm.scss +0 -51
- package/dist/styles/widgets/WidgetTypeSelector.scss +0 -6
- package/dist/styles/widgets/_index.scss +0 -9
- package/dist/widgets/BookingStyleSelector/BookingStyleSelector.d.ts +0 -3
- package/dist/widgets/BookingStyleSelector/BookingStyleSelector.d.ts.map +0 -1
- package/dist/widgets/BookingStyleSelector/index.d.ts +0 -2
- package/dist/widgets/BookingStyleSelector/index.d.ts.map +0 -1
- package/dist/widgets/CalendarStyleSelector/CalendarStyleSelector.d.ts +0 -3
- package/dist/widgets/CalendarStyleSelector/CalendarStyleSelector.d.ts.map +0 -1
- package/dist/widgets/CalendarStyleSelector/index.d.ts +0 -2
- package/dist/widgets/CalendarStyleSelector/index.d.ts.map +0 -1
- package/dist/widgets/CheckboxGroup/CheckboxGroup.d.ts +0 -8
- package/dist/widgets/CheckboxGroup/CheckboxGroup.d.ts.map +0 -1
- package/dist/widgets/CheckboxGroup/index.d.ts +0 -2
- package/dist/widgets/CheckboxGroup/index.d.ts.map +0 -1
- package/dist/widgets/ImageRadioInput/ImageRadioInput.d.ts +0 -9
- package/dist/widgets/ImageRadioInput/ImageRadioInput.d.ts.map +0 -1
- package/dist/widgets/ImageRadioInput/index.d.ts.map +0 -1
- package/dist/widgets/ProductSetSelector/ProductSetSelector.d.ts +0 -3
- package/dist/widgets/ProductSetSelector/ProductSetSelector.d.ts.map +0 -1
- package/dist/widgets/ProductSetSelector/index.d.ts +0 -2
- package/dist/widgets/ProductSetSelector/index.d.ts.map +0 -1
- package/dist/widgets/SnippetCode/SnippetCode.d.ts +0 -6
- package/dist/widgets/SnippetCode/SnippetCode.d.ts.map +0 -1
- package/dist/widgets/SnippetCode/index.d.ts +0 -2
- package/dist/widgets/SnippetCode/index.d.ts.map +0 -1
- package/dist/widgets/WidgetBuilderForm/WidgetBuilderForm.d.ts +0 -12
- package/dist/widgets/WidgetBuilderForm/WidgetBuilderForm.d.ts.map +0 -1
- package/dist/widgets/WidgetTypeRadio/WidgetTypeRadio.d.ts +0 -7
- package/dist/widgets/WidgetTypeRadio/WidgetTypeRadio.d.ts.map +0 -1
- package/dist/widgets/WidgetTypeRadio/index.d.ts +0 -2
- package/dist/widgets/WidgetTypeRadio/index.d.ts.map +0 -1
- package/dist/widgets/WidgetTypeSelector/WidgetTypeSelector.d.ts +0 -3
- package/dist/widgets/WidgetTypeSelector/WidgetTypeSelector.d.ts.map +0 -1
- package/src/assets/widgets/circlePlus.svg +0 -4
- package/src/assets/widgets/inPage.svg +0 -10
- package/src/assets/widgets/overlay.svg +0 -9
- package/src/assets/widgets/sidebar.svg +0 -9
- package/src/setting/dashboard/snippets/control/SnippetControl.tsx +0 -235
- package/src/setting/dashboard/snippets/control/index.ts +0 -1
- package/src/setting/dashboard/snippets/form/SnippetForm.stories.tsx +0 -104
- package/src/setting/dashboard/snippets/form/SnippetForm.tsx +0 -94
- package/src/setting/dashboard/snippets/form/context.tsx +0 -18
- package/src/setting/dashboard/snippets/form/index.ts +0 -1
- package/src/setting/dashboard/snippets/modal/SnippetViewTypeModal.stories.tsx +0 -28
- package/src/setting/dashboard/snippets/modal/SnippetViewTypeModal.tsx +0 -104
- package/src/setting/dashboard/snippets/modal/index.ts +0 -2
- package/src/styles/widgets/BookingStyleSelector.scss +0 -14
- package/src/styles/widgets/CalendarStyleSelector.scss +0 -17
- package/src/styles/widgets/CheckboxGroup.scss +0 -15
- package/src/styles/widgets/ProductSetSelector.scss +0 -19
- package/src/styles/widgets/SnippetCode.scss +0 -18
- package/src/styles/widgets/WidgetBuilderForm.scss +0 -51
- package/src/styles/widgets/WidgetTypeSelector.scss +0 -6
- package/src/styles/widgets/_index.scss +0 -9
- package/src/widgets/BookingStyleSelector/BookingStyleSelector.stories.tsx +0 -12
- package/src/widgets/BookingStyleSelector/BookingStyleSelector.tsx +0 -34
- package/src/widgets/BookingStyleSelector/index.ts +0 -1
- package/src/widgets/CalendarStyleSelector/CalendarStyleSelector.stories.tsx +0 -12
- package/src/widgets/CalendarStyleSelector/CalendarStyleSelector.tsx +0 -29
- package/src/widgets/CalendarStyleSelector/index.ts +0 -1
- package/src/widgets/CheckboxGroup/CheckboxGroup.stories.tsx +0 -16
- package/src/widgets/CheckboxGroup/CheckboxGroup.tsx +0 -64
- package/src/widgets/CheckboxGroup/index.ts +0 -1
- package/src/widgets/ImageRadioInput/ImageRadioInput.stories.tsx +0 -18
- package/src/widgets/ImageRadioInput/ImageRadioInput.tsx +0 -29
- package/src/widgets/ProductSetSelector/ProductSetSelector.stories.tsx +0 -12
- package/src/widgets/ProductSetSelector/ProductSetSelector.tsx +0 -27
- package/src/widgets/ProductSetSelector/index.ts +0 -1
- package/src/widgets/SnippetCode/SnippetCode.stories.tsx +0 -17
- package/src/widgets/SnippetCode/SnippetCode.tsx +0 -27
- package/src/widgets/SnippetCode/index.ts +0 -1
- package/src/widgets/WidgetBuilderForm/WidgetBuilderForm.stories.tsx +0 -12
- package/src/widgets/WidgetBuilderForm/WidgetBuilderForm.tsx +0 -84
- package/src/widgets/WidgetTypeRadio/WidgetTypeRadio.stories.tsx +0 -17
- package/src/widgets/WidgetTypeRadio/WidgetTypeRadio.tsx +0 -43
- package/src/widgets/WidgetTypeRadio/index.ts +0 -1
- package/src/widgets/WidgetTypeSelector/WidgetTypeSelector.stories.tsx +0 -12
- package/src/widgets/WidgetTypeSelector/WidgetTypeSelector.tsx +0 -32
- package/tests/Snippets/Snippets.test.tsx +0 -77
- /package/dist/{widgets/ImageRadioInput → image-radio-input}/index.d.ts +0 -0
- /package/src/{widgets/ImageRadioInput → image-radio-input}/index.ts +0 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@licklist/design",
|
|
3
|
-
"version": "0.44.485-dev.
|
|
3
|
+
"version": "0.44.485-dev.65",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "git+ssh://git@bitbucket.org/artelogicsoft/licklist_design.git"
|
|
@@ -53,7 +53,7 @@
|
|
|
53
53
|
"@fortawesome/free-brands-svg-icons": "5.15.2",
|
|
54
54
|
"@fortawesome/free-solid-svg-icons": "5.15.2",
|
|
55
55
|
"@fortawesome/react-fontawesome": "0.1.9",
|
|
56
|
-
"@licklist/core": ">=0.15.
|
|
56
|
+
"@licklist/core": ">=0.15.28-dev.0 < 0.15.28",
|
|
57
57
|
"@licklist/eslint-config": "0.3.4",
|
|
58
58
|
"@licklist/plugins": ">=0.20.133-dev.5 < 0.20.133",
|
|
59
59
|
"@mdx-js/react": "1.6.22",
|
|
@@ -1,23 +1,31 @@
|
|
|
1
1
|
import { useId } from "@react-aria/utils";
|
|
2
|
-
import React from "react";
|
|
2
|
+
import React, { ReactNode } from "react";
|
|
3
3
|
import Button from "react-bootstrap/Button";
|
|
4
4
|
import OverlayTrigger from "react-bootstrap/OverlayTrigger";
|
|
5
5
|
import Popover from "react-bootstrap/Popover";
|
|
6
6
|
import { ButtonVariant } from "react-bootstrap/types";
|
|
7
|
+
import clsx from "clsx";
|
|
7
8
|
import Icon from "../../static/Icon";
|
|
8
9
|
|
|
9
10
|
export type HelpPopoverProps = {
|
|
10
11
|
children?: React.ReactElement | React.ReactElement[];
|
|
11
12
|
title?: string;
|
|
12
13
|
variant?: ButtonVariant;
|
|
14
|
+
icon?: ReactNode;
|
|
15
|
+
bordered?: boolean;
|
|
13
16
|
};
|
|
14
17
|
|
|
15
|
-
export function HelpPopover(
|
|
16
|
-
|
|
18
|
+
export function HelpPopover({
|
|
19
|
+
children,
|
|
20
|
+
title,
|
|
21
|
+
variant = "light",
|
|
22
|
+
icon,
|
|
23
|
+
bordered = false,
|
|
24
|
+
}: HelpPopoverProps) {
|
|
17
25
|
const popoverId = useId();
|
|
18
26
|
|
|
19
27
|
const popover = (
|
|
20
|
-
<Popover id={popoverId}>
|
|
28
|
+
<Popover id={popoverId} className={clsx(bordered && "border")}>
|
|
21
29
|
<Popover.Title as="h3">{title}</Popover.Title>
|
|
22
30
|
<Popover.Content>{children}</Popover.Content>
|
|
23
31
|
</Popover>
|
|
@@ -39,7 +47,7 @@ export function HelpPopover(props: HelpPopoverProps) {
|
|
|
39
47
|
{...triggerHandler}
|
|
40
48
|
className="btn-icon-popover rounded-circle px-2 py-1 d-inline-flex align-items-center"
|
|
41
49
|
>
|
|
42
|
-
<Icon type="question" style={{ width: "10px" }} />
|
|
50
|
+
{icon ?? <Icon type="question" style={{ width: "10px" }} />}
|
|
43
51
|
</Button>
|
|
44
52
|
)}
|
|
45
53
|
</OverlayTrigger>
|
|
@@ -11,18 +11,15 @@ export default {
|
|
|
11
11
|
|
|
12
12
|
export function Default() {
|
|
13
13
|
const showImage = boolean("showImage", true);
|
|
14
|
-
const displayCost = boolean("displayCost", false);
|
|
15
|
-
const displayType = boolean("displayType", true);
|
|
16
|
-
const displayDescription = boolean("displayDescription", false);
|
|
17
14
|
const isListView = boolean("isListView", false);
|
|
18
15
|
|
|
19
16
|
return (
|
|
20
17
|
<div>
|
|
21
18
|
<IframeEventCard
|
|
22
19
|
imageSrc={
|
|
23
|
-
// eslint-disable-next-line max-len
|
|
24
20
|
showImage
|
|
25
|
-
?
|
|
21
|
+
? // eslint-disable-next-line max-len
|
|
22
|
+
"https://images.unsplash.com/photo-1638988319382-90e61be77c59?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=687&q=80"
|
|
26
23
|
: undefined
|
|
27
24
|
}
|
|
28
25
|
title="Glitterbomb Bucks / Baga Chipz"
|
|
@@ -43,9 +40,8 @@ export function Default() {
|
|
|
43
40
|
RuPaul's Drag Race UK to VINYL Cambridge! So get excited because
|
|
44
41
|
the...`}
|
|
45
42
|
snippetSetting={{
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
displayDescription,
|
|
43
|
+
includeAvailability: ["calendar", "product_sets", "time_slots"],
|
|
44
|
+
includeFromPrice: ["calendar", "product_sets", "time_slots"],
|
|
49
45
|
}}
|
|
50
46
|
goToDetails={() => null}
|
|
51
47
|
isListView={isListView}
|
|
@@ -59,9 +55,6 @@ export function Default() {
|
|
|
59
55
|
|
|
60
56
|
export function EventCardSkeleton() {
|
|
61
57
|
const showImage = boolean("showImage", true);
|
|
62
|
-
const displayCost = boolean("displayCost", false);
|
|
63
|
-
const displayType = boolean("displayType", true);
|
|
64
|
-
const displayDescription = boolean("displayDescription", false);
|
|
65
58
|
const isListView = boolean("isListView", false);
|
|
66
59
|
|
|
67
60
|
return (
|
|
@@ -69,9 +62,8 @@ export function EventCardSkeleton() {
|
|
|
69
62
|
<IframeEventCardSkeleton
|
|
70
63
|
showImage={showImage}
|
|
71
64
|
snippetSetting={{
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
displayDescription,
|
|
65
|
+
includeAvailability: ["calendar", "product_sets", "time_slots"],
|
|
66
|
+
includeFromPrice: ["calendar", "product_sets", "time_slots"],
|
|
75
67
|
}}
|
|
76
68
|
isListView={isListView}
|
|
77
69
|
/>
|
|
@@ -3,7 +3,7 @@ import { Card } from "react-bootstrap";
|
|
|
3
3
|
import { useTranslation } from "react-i18next";
|
|
4
4
|
import { useIntl } from "react-intl";
|
|
5
5
|
import clsx from "clsx";
|
|
6
|
-
import {
|
|
6
|
+
import { Snippet } from "@licklist/core/dist/DataMapper/Provider/SnippetDataMapper";
|
|
7
7
|
import { TipTapEditor } from "../../../tiptap-editor/TipTapEditor";
|
|
8
8
|
import { formatContent } from "../../../events/event-card/utils";
|
|
9
9
|
import { ReactComponent as ClockSvg } from "../../../assets/iframe/clock.svg";
|
|
@@ -18,7 +18,8 @@ interface IframeEventCardProps {
|
|
|
18
18
|
cost?: number;
|
|
19
19
|
date: string;
|
|
20
20
|
imageSrc?: string;
|
|
21
|
-
|
|
21
|
+
// eslint-disable-next-line react/no-unused-prop-types
|
|
22
|
+
snippetSetting?: Snippet["widgetSetting"];
|
|
22
23
|
colour?: string;
|
|
23
24
|
goToDetails?: () => void;
|
|
24
25
|
description?: string | null;
|
|
@@ -35,11 +36,6 @@ export function IframeEventCard({
|
|
|
35
36
|
cost,
|
|
36
37
|
date,
|
|
37
38
|
imageSrc,
|
|
38
|
-
snippetSetting = {
|
|
39
|
-
displayType: true,
|
|
40
|
-
displayCost: true,
|
|
41
|
-
displayDescription: true,
|
|
42
|
-
},
|
|
43
39
|
colour,
|
|
44
40
|
goToDetails,
|
|
45
41
|
description,
|
|
@@ -102,7 +98,7 @@ export function IframeEventCard({
|
|
|
102
98
|
</div>
|
|
103
99
|
</Card.Text>
|
|
104
100
|
|
|
105
|
-
{type &&
|
|
101
|
+
{type && (
|
|
106
102
|
<Card.Text as="div" className="list-view-hided">
|
|
107
103
|
<div className="d-flex align-items-center mb-3">
|
|
108
104
|
<div className="icon-wrapper">
|
|
@@ -113,7 +109,7 @@ export function IframeEventCard({
|
|
|
113
109
|
</Card.Text>
|
|
114
110
|
)}
|
|
115
111
|
|
|
116
|
-
{typeof cost === "number" &&
|
|
112
|
+
{typeof cost === "number" && (
|
|
117
113
|
<Card.Text as="div">
|
|
118
114
|
<div className="d-flex align-items-center mb-3">
|
|
119
115
|
<div className="icon-wrapper">
|
|
@@ -127,7 +123,7 @@ export function IframeEventCard({
|
|
|
127
123
|
</Card.Text>
|
|
128
124
|
)}
|
|
129
125
|
|
|
130
|
-
{description &&
|
|
126
|
+
{description && (
|
|
131
127
|
<Card.Text as="div" className="list-view-hided">
|
|
132
128
|
<TipTapEditor
|
|
133
129
|
viewMode
|
|
@@ -2,11 +2,12 @@ import React, { memo } from "react";
|
|
|
2
2
|
import { Card } from "react-bootstrap";
|
|
3
3
|
import clsx from "clsx";
|
|
4
4
|
import Skeleton from "react-loading-skeleton";
|
|
5
|
-
import {
|
|
5
|
+
import { Snippet } from "@licklist/core/dist/DataMapper/Provider/SnippetDataMapper";
|
|
6
6
|
|
|
7
7
|
interface IframeEventCardSkeletonProps {
|
|
8
8
|
showImage?: boolean;
|
|
9
|
-
|
|
9
|
+
// eslint-disable-next-line react/no-unused-prop-types
|
|
10
|
+
snippetSetting?: Snippet["widgetSetting"];
|
|
10
11
|
colour?: string;
|
|
11
12
|
isListView?: boolean;
|
|
12
13
|
className?: string;
|
|
@@ -15,11 +16,6 @@ interface IframeEventCardSkeletonProps {
|
|
|
15
16
|
export const IframeEventCardSkeleton = memo(
|
|
16
17
|
({
|
|
17
18
|
showImage,
|
|
18
|
-
snippetSetting = {
|
|
19
|
-
displayType: true,
|
|
20
|
-
displayCost: true,
|
|
21
|
-
displayDescription: true,
|
|
22
|
-
},
|
|
23
19
|
colour,
|
|
24
20
|
isListView = false,
|
|
25
21
|
className,
|
|
@@ -61,31 +57,25 @@ export const IframeEventCardSkeleton = memo(
|
|
|
61
57
|
</div>
|
|
62
58
|
</Card.Text>
|
|
63
59
|
|
|
64
|
-
|
|
65
|
-
<
|
|
66
|
-
<
|
|
67
|
-
<
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
</Card.Text>
|
|
72
|
-
)}
|
|
60
|
+
<Card.Text as="div" className="list-view-hided">
|
|
61
|
+
<div className="d-flex align-items-center mb-3">
|
|
62
|
+
<p className="iframe-event-card__bold m-0">
|
|
63
|
+
<Skeleton className="skeleton-w6" />
|
|
64
|
+
</p>
|
|
65
|
+
</div>
|
|
66
|
+
</Card.Text>
|
|
73
67
|
|
|
74
|
-
|
|
75
|
-
<
|
|
76
|
-
<
|
|
77
|
-
<
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
</Card.Text>
|
|
82
|
-
)}
|
|
68
|
+
<Card.Text as="div">
|
|
69
|
+
<div className="d-flex align-items-center mb-3">
|
|
70
|
+
<p className="iframe-event-card__bold m-0">
|
|
71
|
+
<Skeleton className="skeleton-w6" />
|
|
72
|
+
</p>
|
|
73
|
+
</div>
|
|
74
|
+
</Card.Text>
|
|
83
75
|
|
|
84
|
-
|
|
85
|
-
<
|
|
86
|
-
|
|
87
|
-
</Card.Text>
|
|
88
|
-
)}
|
|
76
|
+
<Card.Text as="div" className="list-view-hided">
|
|
77
|
+
<Skeleton className="w-100 h-100" />
|
|
78
|
+
</Card.Text>
|
|
89
79
|
</div>
|
|
90
80
|
</Card.Body>
|
|
91
81
|
</Card>
|
|
@@ -581,9 +581,8 @@ export function Default() {
|
|
|
581
581
|
date={String(event.startAt)}
|
|
582
582
|
colour={event.colour}
|
|
583
583
|
snippetSetting={{
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
displayDescription,
|
|
584
|
+
includeAvailability: [],
|
|
585
|
+
includeFromPrice: [],
|
|
587
586
|
}}
|
|
588
587
|
imageSrc={event.imgSrc}
|
|
589
588
|
goToDetails={() => {}}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { Meta, Story } from "@storybook/react";
|
|
3
|
+
import { FormProvider, useForm } from "react-hook-form";
|
|
4
|
+
import { ImageRadioInput, ImageRadioInputProps } from "./ImageRadioInput";
|
|
5
|
+
import { ReactComponent as MonthIcon } from "../assets/widgets/monthCalendar.svg";
|
|
6
|
+
import Icon from "../static/Icon";
|
|
7
|
+
|
|
8
|
+
export default {
|
|
9
|
+
title: "ImageRadioInput",
|
|
10
|
+
component: ImageRadioInput,
|
|
11
|
+
} as Meta;
|
|
12
|
+
|
|
13
|
+
type FormModel = {
|
|
14
|
+
test: string;
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
export const Default: Story<ImageRadioInputProps<FormModel>> = (args) => {
|
|
18
|
+
const form = useForm();
|
|
19
|
+
|
|
20
|
+
return (
|
|
21
|
+
<FormProvider {...form}>
|
|
22
|
+
<ImageRadioInput {...args} />
|
|
23
|
+
</FormProvider>
|
|
24
|
+
);
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
Default.args = {
|
|
28
|
+
img: <MonthIcon />,
|
|
29
|
+
label: "Month",
|
|
30
|
+
name: "test",
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
export const WithFontAwesomeIcon: Story<ImageRadioInputProps<FormModel>> = (
|
|
34
|
+
args
|
|
35
|
+
) => {
|
|
36
|
+
const form = useForm();
|
|
37
|
+
|
|
38
|
+
return (
|
|
39
|
+
<FormProvider {...form}>
|
|
40
|
+
<ImageRadioInput {...args} />
|
|
41
|
+
</FormProvider>
|
|
42
|
+
);
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
WithFontAwesomeIcon.args = {
|
|
46
|
+
img: <Icon type="bars" />,
|
|
47
|
+
label: "List",
|
|
48
|
+
name: "test",
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
export const Disabled: Story<ImageRadioInputProps<FormModel>> = (args) => {
|
|
52
|
+
const form = useForm();
|
|
53
|
+
|
|
54
|
+
return (
|
|
55
|
+
<FormProvider {...form}>
|
|
56
|
+
<ImageRadioInput {...args} />
|
|
57
|
+
</FormProvider>
|
|
58
|
+
);
|
|
59
|
+
};
|
|
60
|
+
|
|
61
|
+
Disabled.args = {
|
|
62
|
+
img: <MonthIcon />,
|
|
63
|
+
label: "Month",
|
|
64
|
+
name: "test",
|
|
65
|
+
disabled: true,
|
|
66
|
+
disabledMessage: "Coming soon",
|
|
67
|
+
};
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import clsx from "clsx";
|
|
2
|
+
import React, { ReactNode } from "react";
|
|
3
|
+
import { Form } from "react-bootstrap";
|
|
4
|
+
import { FormCheckInputProps } from "react-bootstrap/esm/FormCheckInput";
|
|
5
|
+
import { Path, RegisterOptions, useFormContext } from "react-hook-form";
|
|
6
|
+
|
|
7
|
+
export type ImageRadioInputProps<FormModel> = {
|
|
8
|
+
img: ReactNode;
|
|
9
|
+
label: string;
|
|
10
|
+
value: string | number;
|
|
11
|
+
name: Path<FormModel>;
|
|
12
|
+
disabled?: boolean;
|
|
13
|
+
disabledMessage?: string;
|
|
14
|
+
rules?: RegisterOptions<FormModel>;
|
|
15
|
+
inputProps?: FormCheckInputProps;
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
export const ImageRadioInput = <FormModel,>({
|
|
19
|
+
img,
|
|
20
|
+
label,
|
|
21
|
+
value,
|
|
22
|
+
name,
|
|
23
|
+
disabled,
|
|
24
|
+
disabledMessage,
|
|
25
|
+
rules,
|
|
26
|
+
inputProps,
|
|
27
|
+
}: ImageRadioInputProps<FormModel>) => {
|
|
28
|
+
const { register } = useFormContext<FormModel>();
|
|
29
|
+
|
|
30
|
+
return (
|
|
31
|
+
<Form.Check className="image-radio-input">
|
|
32
|
+
<Form.Check.Label
|
|
33
|
+
className={clsx("image-radio-input-wrapper", disabled && "disabled")}
|
|
34
|
+
>
|
|
35
|
+
<div className="image-radio-input-image-wrapper">{img}</div>
|
|
36
|
+
|
|
37
|
+
<div className="image-radio-input-label">
|
|
38
|
+
<Form.Check.Input
|
|
39
|
+
type="radio"
|
|
40
|
+
value={value}
|
|
41
|
+
disabled={disabled}
|
|
42
|
+
{...register(name, rules)}
|
|
43
|
+
{...inputProps}
|
|
44
|
+
/>
|
|
45
|
+
<span>{label}</span>
|
|
46
|
+
</div>
|
|
47
|
+
</Form.Check.Label>
|
|
48
|
+
<Form.Control.Feedback type="valid" className="d-block text-center">
|
|
49
|
+
{disabledMessage}
|
|
50
|
+
</Form.Control.Feedback>
|
|
51
|
+
</Form.Check>
|
|
52
|
+
);
|
|
53
|
+
};
|
package/src/index.ts
CHANGED
|
@@ -37,7 +37,6 @@ export function ProductQuantityRechargingControl<T extends FormValues>(
|
|
|
37
37
|
clearErrors,
|
|
38
38
|
setError,
|
|
39
39
|
watch,
|
|
40
|
-
trigger,
|
|
41
40
|
formState: { errors },
|
|
42
41
|
} = useFormContext<T>();
|
|
43
42
|
const { t } = useTranslation("Design");
|
|
@@ -48,10 +47,6 @@ export function ProductQuantityRechargingControl<T extends FormValues>(
|
|
|
48
47
|
`${fieldNamePrefix}.totalQuantity` as Path<T>
|
|
49
48
|
);
|
|
50
49
|
|
|
51
|
-
// trigger total quantity field's validation if disabled state was changed
|
|
52
|
-
useEffect(() => {
|
|
53
|
-
trigger(`${fieldNamePrefix}.totalQuantity` as Path<T>);
|
|
54
|
-
}, [disabled, fieldNamePrefix, trigger]);
|
|
55
50
|
|
|
56
51
|
useEffect(() => {
|
|
57
52
|
if (Number(totalQuantityValue) === 0) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export const MAX_DESCRIPTION_CHARACTERS_LENGTH =
|
|
1
|
+
export const MAX_DESCRIPTION_CHARACTERS_LENGTH = 25500;
|
|
@@ -52,7 +52,7 @@ export function ProviderDetailsInput({
|
|
|
52
52
|
|
|
53
53
|
useEffect(() => {
|
|
54
54
|
if (MAX_DESCRIPTION_CHARACTERS_LENGTH > description.length) return;
|
|
55
|
-
notification.
|
|
55
|
+
notification.danger({
|
|
56
56
|
title: t("App:warning"),
|
|
57
57
|
message: t("Validation:descriptionTooManyCharactersMessage", {
|
|
58
58
|
max: MAX_DESCRIPTION_CHARACTERS_LENGTH,
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import React, { useEffect } from "react";
|
|
2
|
+
import { Meta, Story } from "@storybook/react";
|
|
3
|
+
import { FormProvider, useForm } from "react-hook-form";
|
|
4
|
+
import { RadioCard, RadioCardProps } from "./RadioCard";
|
|
5
|
+
|
|
6
|
+
export default {
|
|
7
|
+
title: "Widgets / Widget Type Radio Card",
|
|
8
|
+
component: RadioCard,
|
|
9
|
+
} as Meta;
|
|
10
|
+
|
|
11
|
+
type FormModel = {
|
|
12
|
+
name: string;
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
export const Default: Story<RadioCardProps<FormModel>> = (args) => {
|
|
16
|
+
const form = useForm<FormModel>();
|
|
17
|
+
|
|
18
|
+
return (
|
|
19
|
+
<FormProvider {...form}>
|
|
20
|
+
<RadioCard {...args} />
|
|
21
|
+
</FormProvider>
|
|
22
|
+
);
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
Default.args = {
|
|
26
|
+
label: "Venue Map",
|
|
27
|
+
description: "Date > Floor",
|
|
28
|
+
name: "name",
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
export const Invalid: Story<RadioCardProps<FormModel>> = (args) => {
|
|
32
|
+
const form = useForm<FormModel>();
|
|
33
|
+
|
|
34
|
+
return (
|
|
35
|
+
<FormProvider {...form}>
|
|
36
|
+
<RadioCard {...args} />
|
|
37
|
+
</FormProvider>
|
|
38
|
+
);
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
Invalid.args = {
|
|
42
|
+
label: "Venue Map",
|
|
43
|
+
description: "Date > Floor",
|
|
44
|
+
name: "name",
|
|
45
|
+
inputProps: {
|
|
46
|
+
isInvalid: true,
|
|
47
|
+
},
|
|
48
|
+
};
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import clsx from "clsx";
|
|
2
|
+
import React, { ReactNode } from "react";
|
|
3
|
+
import { Form } from "react-bootstrap";
|
|
4
|
+
import { FormCheckInputProps } from "react-bootstrap/esm/FormCheckInput";
|
|
5
|
+
import { Path, RegisterOptions, useFormContext } from "react-hook-form";
|
|
6
|
+
|
|
7
|
+
export type RadioCardProps<FormModel> = {
|
|
8
|
+
label: string;
|
|
9
|
+
description: ReactNode;
|
|
10
|
+
name: Path<FormModel>;
|
|
11
|
+
value: string;
|
|
12
|
+
rules: RegisterOptions<FormModel>;
|
|
13
|
+
inputProps?: FormCheckInputProps;
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
export const RadioCard = <FormModel,>({
|
|
17
|
+
label,
|
|
18
|
+
description,
|
|
19
|
+
name,
|
|
20
|
+
value,
|
|
21
|
+
rules,
|
|
22
|
+
inputProps,
|
|
23
|
+
}: RadioCardProps<FormModel>) => {
|
|
24
|
+
const {
|
|
25
|
+
register,
|
|
26
|
+
formState: { errors },
|
|
27
|
+
} = useFormContext<FormModel>();
|
|
28
|
+
|
|
29
|
+
const isInvalid = !!errors[name as string] || inputProps?.isInvalid;
|
|
30
|
+
|
|
31
|
+
return (
|
|
32
|
+
<Form.Check className={clsx("radio-card", isInvalid && "invalid")}>
|
|
33
|
+
<Form.Check.Label>
|
|
34
|
+
<div className="radio-card-controls">
|
|
35
|
+
<Form.Check.Input
|
|
36
|
+
type="radio"
|
|
37
|
+
isInvalid={isInvalid}
|
|
38
|
+
value={value}
|
|
39
|
+
{...register(name, rules)}
|
|
40
|
+
{...inputProps}
|
|
41
|
+
/>
|
|
42
|
+
<span>{label}</span>
|
|
43
|
+
</div>
|
|
44
|
+
|
|
45
|
+
<p className="radio-card-description">{description}</p>
|
|
46
|
+
</Form.Check.Label>
|
|
47
|
+
</Form.Check>
|
|
48
|
+
);
|
|
49
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { RadioCard } from "./RadioCard";
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
export * from "./DashboardSettingForm";
|
|
2
|
-
export * from "./snippets/form";
|
|
3
2
|
export * from "./snippets/card";
|
|
4
3
|
export * from "./snippet-templates/card";
|
|
5
4
|
export * from "./payments/payments-form/PaymentsForm";
|
|
6
5
|
export * from "./payments/payments-modal/PaymentsModal";
|
|
7
|
-
export * from "./snippets/modal";
|
|
@@ -368,11 +368,6 @@ export function Preview({
|
|
|
368
368
|
type="Party Doors 22:00 - 03:00"
|
|
369
369
|
cost={6}
|
|
370
370
|
date="Sat 2nd May"
|
|
371
|
-
snippetSetting={{
|
|
372
|
-
displayCost: true,
|
|
373
|
-
displayType: true,
|
|
374
|
-
displayDescription: true,
|
|
375
|
-
}}
|
|
376
371
|
goToDetails={() => null}
|
|
377
372
|
shortDate="07/03/2023"
|
|
378
373
|
/>
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { Meta, Story } from "@storybook/react";
|
|
3
|
+
import { SortingSelect, SortingSelectProps } from "./SortingSelect";
|
|
4
|
+
|
|
5
|
+
export default {
|
|
6
|
+
title: "SortingSelect",
|
|
7
|
+
} as Meta;
|
|
8
|
+
|
|
9
|
+
export const Default: Story<SortingSelectProps> = (props) => {
|
|
10
|
+
return <SortingSelect {...props} />;
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
Default.args = {
|
|
14
|
+
onSortingChange: () => null,
|
|
15
|
+
};
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import React, { useEffect, useState } from "react";
|
|
2
|
+
import useQuery from "@licklist/plugins/dist/hooks/Query/useQuery";
|
|
3
|
+
import { Form, FormGroupProps } from "react-bootstrap";
|
|
4
|
+
import { useTranslation } from "react-i18next";
|
|
5
|
+
import {
|
|
6
|
+
SORT_DIRECTION_ASC,
|
|
7
|
+
SORT_DIRECTION_NEWEST,
|
|
8
|
+
SORT_DIRECTION_DESC,
|
|
9
|
+
SORT_KEY_NAME,
|
|
10
|
+
SORT_KEY_CREATED_AT,
|
|
11
|
+
} from "@licklist/core/dist/Config";
|
|
12
|
+
|
|
13
|
+
export type SortingSelectProps = {
|
|
14
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
15
|
+
formGroupProps?: FormGroupProps & Record<string, any>;
|
|
16
|
+
defaultSortKey?: string;
|
|
17
|
+
defaultSortDirection?: string;
|
|
18
|
+
onSortingChange?: (url: URLSearchParams) => void;
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
export const SortingSelect = ({
|
|
22
|
+
formGroupProps,
|
|
23
|
+
defaultSortKey = SORT_KEY_NAME,
|
|
24
|
+
defaultSortDirection = SORT_DIRECTION_ASC,
|
|
25
|
+
onSortingChange,
|
|
26
|
+
}: SortingSelectProps) => {
|
|
27
|
+
const { t } = useTranslation("Design");
|
|
28
|
+
const [controlValue, setControlValue] = useState(SORT_DIRECTION_ASC);
|
|
29
|
+
const searchParams = useQuery();
|
|
30
|
+
|
|
31
|
+
const { sortKey = defaultSortKey, sortDirection = defaultSortDirection } =
|
|
32
|
+
Object.fromEntries(searchParams);
|
|
33
|
+
|
|
34
|
+
const onSortingValueChange = ({ target: { value } }) => {
|
|
35
|
+
setControlValue(value);
|
|
36
|
+
|
|
37
|
+
const nextSortDirection =
|
|
38
|
+
value === SORT_DIRECTION_NEWEST ? SORT_DIRECTION_DESC : value;
|
|
39
|
+
|
|
40
|
+
const nextSortKey =
|
|
41
|
+
value === SORT_DIRECTION_NEWEST ? SORT_KEY_CREATED_AT : sortKey;
|
|
42
|
+
|
|
43
|
+
const nextSearchParams = new URLSearchParams(searchParams);
|
|
44
|
+
|
|
45
|
+
nextSearchParams.set("sortDirection", nextSortDirection);
|
|
46
|
+
nextSearchParams.set("sortKey", nextSortKey);
|
|
47
|
+
|
|
48
|
+
onSortingChange(nextSearchParams);
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
useEffect(() => {
|
|
52
|
+
if (sortKey === SORT_KEY_CREATED_AT) {
|
|
53
|
+
setControlValue(SORT_DIRECTION_NEWEST);
|
|
54
|
+
return;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
setControlValue(sortDirection);
|
|
58
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
59
|
+
}, [sortKey, sortDirection]);
|
|
60
|
+
|
|
61
|
+
return (
|
|
62
|
+
<Form.Group className="d-flex align-items-center p-0" {...formGroupProps}>
|
|
63
|
+
<Form.Label className="text-nowrap mr-4 mb-0">
|
|
64
|
+
{t("App:sortBy")}:
|
|
65
|
+
</Form.Label>
|
|
66
|
+
<Form.Control
|
|
67
|
+
as="select"
|
|
68
|
+
data-testid="sorting-select"
|
|
69
|
+
onChange={onSortingValueChange}
|
|
70
|
+
custom
|
|
71
|
+
value={controlValue}
|
|
72
|
+
>
|
|
73
|
+
<option value={SORT_DIRECTION_ASC}>A-Z</option>
|
|
74
|
+
<option value={SORT_DIRECTION_DESC}>Z-A</option>
|
|
75
|
+
<option value={SORT_DIRECTION_NEWEST}>{t("newestOnTop")}</option>
|
|
76
|
+
</Form.Control>
|
|
77
|
+
</Form.Group>
|
|
78
|
+
);
|
|
79
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./SortingSelect";
|