@licklist/design 0.44.485-dev.64 → 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.
Files changed (162) hide show
  1. package/dist/help/popover/HelpPopover.d.ts +4 -2
  2. package/dist/help/popover/HelpPopover.d.ts.map +1 -1
  3. package/dist/help/popover/HelpPopover.js +1 -1
  4. package/dist/iframe/event/event-card/IframeEventCard.d.ts +3 -3
  5. package/dist/iframe/event/event-card/IframeEventCard.d.ts.map +1 -1
  6. package/dist/iframe/event/event-card/IframeEventCard.js +1 -1
  7. package/dist/iframe/event/event-card/IframeEventCardSkeleton.d.ts +3 -3
  8. package/dist/iframe/event/event-card/IframeEventCardSkeleton.d.ts.map +1 -1
  9. package/dist/iframe/event/event-card/IframeEventCardSkeleton.js +1 -1
  10. package/dist/image-radio-input/ImageRadioInput.d.ts +15 -0
  11. package/dist/image-radio-input/ImageRadioInput.d.ts.map +1 -0
  12. package/dist/image-radio-input/ImageRadioInput.js +1 -0
  13. package/dist/image-radio-input/index.d.ts.map +1 -0
  14. package/dist/index.d.ts +3 -0
  15. package/dist/index.d.ts.map +1 -1
  16. package/dist/index.js +1 -1
  17. package/dist/radio-card/RadioCard.d.ts +13 -0
  18. package/dist/radio-card/RadioCard.d.ts.map +1 -0
  19. package/dist/radio-card/RadioCard.js +1 -0
  20. package/dist/radio-card/index.d.ts +2 -0
  21. package/dist/radio-card/index.d.ts.map +1 -0
  22. package/dist/setting/dashboard/index.d.ts +0 -2
  23. package/dist/setting/dashboard/index.d.ts.map +1 -1
  24. package/dist/snippet/snippet-template/preview/Preview.d.ts.map +1 -1
  25. package/dist/snippet/snippet-template/preview/Preview.js +1 -1
  26. package/dist/sorting-select/SortingSelect.d.ts +10 -0
  27. package/dist/sorting-select/SortingSelect.d.ts.map +1 -0
  28. package/dist/sorting-select/SortingSelect.js +1 -0
  29. package/dist/sorting-select/index.d.ts +2 -0
  30. package/dist/sorting-select/index.d.ts.map +1 -0
  31. package/{src/styles/widgets/ImageRadioInput.scss → dist/styles/image-radio-input/_index.scss} +12 -0
  32. package/dist/styles/packages.scss +2 -1
  33. package/{src/styles/widgets/WidgetTypeRadioButton.scss → dist/styles/radio-card/_index.scss} +8 -1
  34. package/package.json +2 -2
  35. package/src/help/popover/HelpPopover.tsx +13 -5
  36. package/src/iframe/event/event-card/IframeEventCard.stories.tsx +6 -14
  37. package/src/iframe/event/event-card/IframeEventCard.tsx +6 -10
  38. package/src/iframe/event/event-card/IframeEventCardSkeleton.tsx +20 -30
  39. package/src/iframe/event/event-card/IframeEventCards.stories.tsx +2 -3
  40. package/src/image-radio-input/ImageRadioInput.stories.tsx +67 -0
  41. package/src/image-radio-input/ImageRadioInput.tsx +53 -0
  42. package/src/index.ts +3 -0
  43. package/src/radio-card/RadioCard.stories.tsx +48 -0
  44. package/src/radio-card/RadioCard.tsx +49 -0
  45. package/src/radio-card/index.ts +1 -0
  46. package/src/setting/dashboard/index.ts +0 -2
  47. package/src/snippet/snippet-template/preview/Preview.tsx +0 -5
  48. package/src/sorting-select/SortingSelect.stories.tsx +15 -0
  49. package/src/sorting-select/SortingSelect.tsx +79 -0
  50. package/src/sorting-select/index.ts +1 -0
  51. package/{dist/styles/widgets/ImageRadioInput.scss → src/styles/image-radio-input/_index.scss} +12 -0
  52. package/src/styles/packages.scss +2 -1
  53. package/{dist/styles/widgets/WidgetTypeRadioButton.scss → src/styles/radio-card/_index.scss} +8 -1
  54. package/dist/assets/widgets/circlePlus.svg +0 -4
  55. package/dist/assets/widgets/inPage.svg +0 -10
  56. package/dist/assets/widgets/overlay.svg +0 -9
  57. package/dist/assets/widgets/sidebar.svg +0 -9
  58. package/dist/setting/dashboard/snippets/control/SnippetControl.d.ts +0 -9
  59. package/dist/setting/dashboard/snippets/control/SnippetControl.d.ts.map +0 -1
  60. package/dist/setting/dashboard/snippets/control/SnippetControl.js +0 -1
  61. package/dist/setting/dashboard/snippets/control/index.d.ts +0 -2
  62. package/dist/setting/dashboard/snippets/control/index.d.ts.map +0 -1
  63. package/dist/setting/dashboard/snippets/form/SnippetForm.d.ts +0 -33
  64. package/dist/setting/dashboard/snippets/form/SnippetForm.d.ts.map +0 -1
  65. package/dist/setting/dashboard/snippets/form/SnippetForm.js +0 -1
  66. package/dist/setting/dashboard/snippets/form/context.d.ts +0 -11
  67. package/dist/setting/dashboard/snippets/form/context.d.ts.map +0 -1
  68. package/dist/setting/dashboard/snippets/form/context.js +0 -1
  69. package/dist/setting/dashboard/snippets/form/index.d.ts +0 -2
  70. package/dist/setting/dashboard/snippets/form/index.d.ts.map +0 -1
  71. package/dist/setting/dashboard/snippets/modal/SnippetViewTypeModal.d.ts +0 -19
  72. package/dist/setting/dashboard/snippets/modal/SnippetViewTypeModal.d.ts.map +0 -1
  73. package/dist/setting/dashboard/snippets/modal/SnippetViewTypeModal.js +0 -1
  74. package/dist/setting/dashboard/snippets/modal/index.d.ts +0 -3
  75. package/dist/setting/dashboard/snippets/modal/index.d.ts.map +0 -1
  76. package/dist/styles/widgets/BookingStyleSelector.scss +0 -14
  77. package/dist/styles/widgets/CalendarStyleSelector.scss +0 -17
  78. package/dist/styles/widgets/CheckboxGroup.scss +0 -15
  79. package/dist/styles/widgets/ProductSetSelector.scss +0 -19
  80. package/dist/styles/widgets/SnippetCode.scss +0 -18
  81. package/dist/styles/widgets/WidgetBuilderForm.scss +0 -51
  82. package/dist/styles/widgets/WidgetTypeSelector.scss +0 -6
  83. package/dist/styles/widgets/_index.scss +0 -9
  84. package/dist/widgets/BookingStyleSelector/BookingStyleSelector.d.ts +0 -3
  85. package/dist/widgets/BookingStyleSelector/BookingStyleSelector.d.ts.map +0 -1
  86. package/dist/widgets/BookingStyleSelector/index.d.ts +0 -2
  87. package/dist/widgets/BookingStyleSelector/index.d.ts.map +0 -1
  88. package/dist/widgets/CalendarStyleSelector/CalendarStyleSelector.d.ts +0 -3
  89. package/dist/widgets/CalendarStyleSelector/CalendarStyleSelector.d.ts.map +0 -1
  90. package/dist/widgets/CalendarStyleSelector/index.d.ts +0 -2
  91. package/dist/widgets/CalendarStyleSelector/index.d.ts.map +0 -1
  92. package/dist/widgets/CheckboxGroup/CheckboxGroup.d.ts +0 -8
  93. package/dist/widgets/CheckboxGroup/CheckboxGroup.d.ts.map +0 -1
  94. package/dist/widgets/CheckboxGroup/index.d.ts +0 -2
  95. package/dist/widgets/CheckboxGroup/index.d.ts.map +0 -1
  96. package/dist/widgets/ImageRadioInput/ImageRadioInput.d.ts +0 -9
  97. package/dist/widgets/ImageRadioInput/ImageRadioInput.d.ts.map +0 -1
  98. package/dist/widgets/ImageRadioInput/index.d.ts.map +0 -1
  99. package/dist/widgets/ProductSetSelector/ProductSetSelector.d.ts +0 -3
  100. package/dist/widgets/ProductSetSelector/ProductSetSelector.d.ts.map +0 -1
  101. package/dist/widgets/ProductSetSelector/index.d.ts +0 -2
  102. package/dist/widgets/ProductSetSelector/index.d.ts.map +0 -1
  103. package/dist/widgets/SnippetCode/SnippetCode.d.ts +0 -6
  104. package/dist/widgets/SnippetCode/SnippetCode.d.ts.map +0 -1
  105. package/dist/widgets/SnippetCode/index.d.ts +0 -2
  106. package/dist/widgets/SnippetCode/index.d.ts.map +0 -1
  107. package/dist/widgets/WidgetBuilderForm/WidgetBuilderForm.d.ts +0 -12
  108. package/dist/widgets/WidgetBuilderForm/WidgetBuilderForm.d.ts.map +0 -1
  109. package/dist/widgets/WidgetTypeRadio/WidgetTypeRadio.d.ts +0 -7
  110. package/dist/widgets/WidgetTypeRadio/WidgetTypeRadio.d.ts.map +0 -1
  111. package/dist/widgets/WidgetTypeRadio/index.d.ts +0 -2
  112. package/dist/widgets/WidgetTypeRadio/index.d.ts.map +0 -1
  113. package/dist/widgets/WidgetTypeSelector/WidgetTypeSelector.d.ts +0 -3
  114. package/dist/widgets/WidgetTypeSelector/WidgetTypeSelector.d.ts.map +0 -1
  115. package/src/assets/widgets/circlePlus.svg +0 -4
  116. package/src/assets/widgets/inPage.svg +0 -10
  117. package/src/assets/widgets/overlay.svg +0 -9
  118. package/src/assets/widgets/sidebar.svg +0 -9
  119. package/src/setting/dashboard/snippets/control/SnippetControl.tsx +0 -235
  120. package/src/setting/dashboard/snippets/control/index.ts +0 -1
  121. package/src/setting/dashboard/snippets/form/SnippetForm.stories.tsx +0 -104
  122. package/src/setting/dashboard/snippets/form/SnippetForm.tsx +0 -94
  123. package/src/setting/dashboard/snippets/form/context.tsx +0 -18
  124. package/src/setting/dashboard/snippets/form/index.ts +0 -1
  125. package/src/setting/dashboard/snippets/modal/SnippetViewTypeModal.stories.tsx +0 -28
  126. package/src/setting/dashboard/snippets/modal/SnippetViewTypeModal.tsx +0 -104
  127. package/src/setting/dashboard/snippets/modal/index.ts +0 -2
  128. package/src/styles/widgets/BookingStyleSelector.scss +0 -14
  129. package/src/styles/widgets/CalendarStyleSelector.scss +0 -17
  130. package/src/styles/widgets/CheckboxGroup.scss +0 -15
  131. package/src/styles/widgets/ProductSetSelector.scss +0 -19
  132. package/src/styles/widgets/SnippetCode.scss +0 -18
  133. package/src/styles/widgets/WidgetBuilderForm.scss +0 -51
  134. package/src/styles/widgets/WidgetTypeSelector.scss +0 -6
  135. package/src/styles/widgets/_index.scss +0 -9
  136. package/src/widgets/BookingStyleSelector/BookingStyleSelector.stories.tsx +0 -12
  137. package/src/widgets/BookingStyleSelector/BookingStyleSelector.tsx +0 -34
  138. package/src/widgets/BookingStyleSelector/index.ts +0 -1
  139. package/src/widgets/CalendarStyleSelector/CalendarStyleSelector.stories.tsx +0 -12
  140. package/src/widgets/CalendarStyleSelector/CalendarStyleSelector.tsx +0 -29
  141. package/src/widgets/CalendarStyleSelector/index.ts +0 -1
  142. package/src/widgets/CheckboxGroup/CheckboxGroup.stories.tsx +0 -16
  143. package/src/widgets/CheckboxGroup/CheckboxGroup.tsx +0 -64
  144. package/src/widgets/CheckboxGroup/index.ts +0 -1
  145. package/src/widgets/ImageRadioInput/ImageRadioInput.stories.tsx +0 -18
  146. package/src/widgets/ImageRadioInput/ImageRadioInput.tsx +0 -29
  147. package/src/widgets/ProductSetSelector/ProductSetSelector.stories.tsx +0 -12
  148. package/src/widgets/ProductSetSelector/ProductSetSelector.tsx +0 -27
  149. package/src/widgets/ProductSetSelector/index.ts +0 -1
  150. package/src/widgets/SnippetCode/SnippetCode.stories.tsx +0 -17
  151. package/src/widgets/SnippetCode/SnippetCode.tsx +0 -27
  152. package/src/widgets/SnippetCode/index.ts +0 -1
  153. package/src/widgets/WidgetBuilderForm/WidgetBuilderForm.stories.tsx +0 -12
  154. package/src/widgets/WidgetBuilderForm/WidgetBuilderForm.tsx +0 -84
  155. package/src/widgets/WidgetTypeRadio/WidgetTypeRadio.stories.tsx +0 -17
  156. package/src/widgets/WidgetTypeRadio/WidgetTypeRadio.tsx +0 -43
  157. package/src/widgets/WidgetTypeRadio/index.ts +0 -1
  158. package/src/widgets/WidgetTypeSelector/WidgetTypeSelector.stories.tsx +0 -12
  159. package/src/widgets/WidgetTypeSelector/WidgetTypeSelector.tsx +0 -32
  160. package/tests/Snippets/Snippets.test.tsx +0 -77
  161. /package/dist/{widgets/ImageRadioInput → image-radio-input}/index.d.ts +0 -0
  162. /package/src/{widgets/ImageRadioInput → image-radio-input}/index.ts +0 -0
@@ -1,51 +0,0 @@
1
- .widget-builder-form {
2
- justify-content: space-between;
3
-
4
- h2 {
5
- font-size: 1.5rem;
6
- }
7
-
8
- h3 {
9
- font-size: 1rem;
10
- font-weight: 600;
11
- }
12
-
13
- h4 {
14
- font-size: 0.875rem;
15
- font-weight: 400;
16
- }
17
-
18
- p {
19
- font-size: 0.8125rem;
20
- }
21
-
22
- input[type="text"],
23
- select {
24
- height: 2.5rem;
25
- border-radius: 0.5rem;
26
- }
27
-
28
- button {
29
- border-radius: 0.75rem;
30
- }
31
-
32
- .form-label {
33
- font-size: 0.875rem;
34
- }
35
-
36
- &-customizations {
37
- margin-bottom: 1rem;
38
- }
39
-
40
- &-right-column {
41
- padding: 0;
42
- }
43
-
44
- &-grey {
45
- height: fit-content;
46
- margin-bottom: 2rem;
47
- padding: 1.5rem;
48
- background-color: #fafafa;
49
- border-radius: 0.75rem;
50
- }
51
- }
@@ -1,6 +0,0 @@
1
- .widget-type-selector {
2
- display: flex;
3
- flex-direction: column;
4
- gap: 0.5rem;
5
- margin-bottom: 2rem;
6
- }
@@ -1,9 +0,0 @@
1
- @import "./WidgetTypeRadioButton";
2
- @import "./CalendarStyleSelector";
3
- @import "./CheckboxGroup";
4
- @import "./ImageRadioInput";
5
- @import "./BookingStyleSelector";
6
- @import "./WidgetTypeSelector";
7
- @import "./WidgetBuilderForm";
8
- @import "./SnippetCode";
9
- @import "./ProductSetSelector";
@@ -1,12 +0,0 @@
1
- import React from "react";
2
- import { Meta, Story } from "@storybook/react";
3
- import { BookingStyleSelector } from "./BookingStyleSelector";
4
-
5
- export default {
6
- title: "Widgets / Booking Style Selector",
7
- component: BookingStyleSelector,
8
- } as Meta;
9
-
10
- export const Default: Story = (args) => {
11
- return <BookingStyleSelector {...args} />;
12
- };
@@ -1,34 +0,0 @@
1
- import React from "react";
2
- import { useTranslation } from "react-i18next";
3
- import { ImageRadioInput } from "../ImageRadioInput";
4
- import { ReactComponent as Overlay } from "../../assets/widgets/overlay.svg";
5
- import { ReactComponent as InPage } from "../../assets/widgets/inPage.svg";
6
- import { ReactComponent as Sidebar } from "../../assets/widgets/sidebar.svg";
7
-
8
- export const BookingStyleSelector = () => {
9
- const { t } = useTranslation("Design");
10
-
11
- return (
12
- <div className="widget-booking-style-selector">
13
- <h4>{t("selectBookingStyle")}</h4>
14
-
15
- <div className="wrapper">
16
- <ImageRadioInput
17
- img={<Overlay />}
18
- label={t("overlay")}
19
- name="bookingWidgetStyle"
20
- />
21
- <ImageRadioInput
22
- img={<InPage />}
23
- label={t("inPage")}
24
- name="bookingWidgetStyle"
25
- />
26
- <ImageRadioInput
27
- img={<Sidebar />}
28
- label={t("sidebar")}
29
- name="bookingWidgetStyle"
30
- />
31
- </div>
32
- </div>
33
- );
34
- };
@@ -1 +0,0 @@
1
- export { BookingStyleSelector } from "./BookingStyleSelector";
@@ -1,12 +0,0 @@
1
- import React from "react";
2
- import { Meta, Story } from "@storybook/react";
3
- import { CalendarStyleSelector } from "./CalendarStyleSelector";
4
-
5
- export default {
6
- title: "Widgets / Calendar Style Selector",
7
- component: CalendarStyleSelector,
8
- } as Meta;
9
-
10
- export const Default: Story = (args) => {
11
- return <CalendarStyleSelector {...args} />;
12
- };
@@ -1,29 +0,0 @@
1
- import React from "react";
2
- import { useTranslation } from "react-i18next";
3
- import { ReactComponent as MonthIcon } from "../../assets/widgets/monthCalendar.svg";
4
- import { ReactComponent as WeekIcon } from "../../assets/widgets/weekCalendar.svg";
5
- import { ImageRadioInput } from "../ImageRadioInput/ImageRadioInput";
6
-
7
- export const CalendarStyleSelector = () => {
8
- const { t } = useTranslation("Design");
9
-
10
- return (
11
- <div className="widget-calendar-style-selector">
12
- <h4>{t("calendarStyle")}</h4>
13
- <p>{t("calendarStyleDescription")}</p>
14
-
15
- <div className="controls">
16
- <ImageRadioInput
17
- label={t("month")}
18
- img={<MonthIcon />}
19
- name="calendarStyle"
20
- />
21
- <ImageRadioInput
22
- label={t("week")}
23
- img={<WeekIcon />}
24
- name="calendarStyle"
25
- />
26
- </div>
27
- </div>
28
- );
29
- };
@@ -1 +0,0 @@
1
- export { CalendarStyleSelector } from "./CalendarStyleSelector";
@@ -1,16 +0,0 @@
1
- import React from "react";
2
- import { Meta, Story } from "@storybook/react";
3
- import { CheckboxGroup, CheckboxGroupProps } from "./CheckboxGroup";
4
-
5
- export default {
6
- title: "Widgets / Checkbox Group",
7
- component: CheckboxGroup,
8
- } as Meta;
9
-
10
- export const Default: Story<CheckboxGroupProps> = (args) => {
11
- return <CheckboxGroup {...args} />;
12
- };
13
-
14
- Default.args = {
15
- heading: "Include from price",
16
- };
@@ -1,64 +0,0 @@
1
- import { useId } from "@react-aria/utils";
2
- import React from "react";
3
- import { Form } from "react-bootstrap";
4
- import { useFormContext } from "react-hook-form";
5
- import { useTranslation } from "react-i18next";
6
- import { WidgetBuilderFormModel } from "../WidgetBuilderForm/WidgetBuilderForm";
7
-
8
- export type CheckboxGroupProps = {
9
- heading: string;
10
- name: keyof Partial<
11
- Pick<WidgetBuilderFormModel, "includeFromPrice" | "includeAvailability">
12
- >;
13
- };
14
-
15
- export const CheckboxGroup = ({ heading, name }: CheckboxGroupProps) => {
16
- const { t } = useTranslation();
17
-
18
- const { register } = useFormContext<WidgetBuilderFormModel>();
19
-
20
- const onTimeSlotsCheckboxIt = useId();
21
- const onCalendarCheckboxId = useId();
22
- const onProductSetsCheckboxId = useId();
23
-
24
- return (
25
- <div className="widgets-checkbox-group">
26
- <h3>{heading}</h3>
27
-
28
- <Form.Group className="custom-checkbox">
29
- <Form.Check custom type="checkbox" id={onTimeSlotsCheckboxIt}>
30
- <Form.Check.Input
31
- type="checkbox"
32
- value="onTimeSlots"
33
- {...register(name)}
34
- />
35
- <Form.Check.Label>{t("onTimeSLots")}</Form.Check.Label>
36
- </Form.Check>
37
- </Form.Group>
38
-
39
- <Form.Group className="custom-checkbox">
40
- <Form.Check custom type="checkbox" id={onCalendarCheckboxId}>
41
- <Form.Check.Input
42
- type="checkbox"
43
- value="onCalendar"
44
- {...register(name)}
45
- />
46
- <Form.Check.Label>{t("onCalendar")}</Form.Check.Label>
47
- </Form.Check>
48
- </Form.Group>
49
-
50
- <Form.Group className="custom-checkbox">
51
- <Form.Check custom type="checkbox" id={onProductSetsCheckboxId}>
52
- <Form.Check.Input
53
- type="checkbox"
54
- value="onProductSets"
55
- {...register(name)}
56
- />
57
- <Form.Check.Label>{t("onProductSets")}</Form.Check.Label>
58
- </Form.Check>
59
- </Form.Group>
60
-
61
- <div className="divider" />
62
- </div>
63
- );
64
- };
@@ -1 +0,0 @@
1
- export { CheckboxGroup } from "./CheckboxGroup";
@@ -1,18 +0,0 @@
1
- import React from "react";
2
- import { Meta, Story } from "@storybook/react";
3
- import { ImageRadioInput, ImageRadioInputProps } from "./ImageRadioInput";
4
- import { ReactComponent as MonthIcon } from "../../assets/widgets/monthCalendar.svg";
5
-
6
- export default {
7
- title: "Widgets / Image Radio Input",
8
- component: ImageRadioInput,
9
- } as Meta;
10
-
11
- export const Default: Story<ImageRadioInputProps> = (args) => {
12
- return <ImageRadioInput {...args} />;
13
- };
14
-
15
- Default.args = {
16
- img: <MonthIcon />,
17
- label: "Month",
18
- };
@@ -1,29 +0,0 @@
1
- import React, { ReactNode } from "react";
2
- import { Form } from "react-bootstrap";
3
- import { useFormContext } from "react-hook-form";
4
- import { WidgetBuilderFormModel } from "../WidgetBuilderForm/WidgetBuilderForm";
5
-
6
- export type ImageRadioInputProps = {
7
- img: ReactNode;
8
- label: string;
9
- name: keyof Partial<
10
- Pick<WidgetBuilderFormModel, "calendarStyle" | "bookingWidgetStyle">
11
- >;
12
- };
13
-
14
- export const ImageRadioInput = ({ img, label, name }: ImageRadioInputProps) => {
15
- const { register } = useFormContext<WidgetBuilderFormModel>();
16
-
17
- return (
18
- <Form.Check className="image-radio-input">
19
- <Form.Check.Label className="image-radio-input-wrapper">
20
- {img}
21
-
22
- <div className="image-radio-input-label">
23
- <Form.Check.Input type="radio" value={label} {...register(name)} />
24
- <span>{label}</span>
25
- </div>
26
- </Form.Check.Label>
27
- </Form.Check>
28
- );
29
- };
@@ -1,12 +0,0 @@
1
- import React from "react";
2
- import { Meta, Story } from "@storybook/react";
3
- import { ProductSetSelector } from "./ProductSetSelector";
4
-
5
- export default {
6
- title: "Widgets / Product Set Selector",
7
- component: ProductSetSelector,
8
- } as Meta;
9
-
10
- export const Default: Story = (args) => {
11
- return <ProductSetSelector {...args} />;
12
- };
@@ -1,27 +0,0 @@
1
- import React from "react";
2
- import { Button, Form } from "react-bootstrap";
3
- import { useTranslation } from "react-i18next";
4
- import { ReactComponent as Icon } from "../../assets/widgets/circlePlus.svg";
5
-
6
- export const ProductSetSelector = () => {
7
- const { t } = useTranslation("Design");
8
-
9
- return (
10
- <div className="widget-builder-product-set-selector">
11
- <h4>{t("productSet")}</h4>
12
- <p>{t("widgetBuilderProductSetDescription")}</p>
13
-
14
- <Form.Group>
15
- <Form.Control as="select">
16
- <option>{1}</option>
17
- <option>{2}</option>
18
- </Form.Control>
19
- </Form.Group>
20
-
21
- <Button className="">
22
- <Icon type="circle-plus" />
23
- {t("addProductSets")}
24
- </Button>
25
- </div>
26
- );
27
- };
@@ -1 +0,0 @@
1
- export { ProductSetSelector } from "./ProductSetSelector";
@@ -1,17 +0,0 @@
1
- /* eslint-disable max-len */
2
- import React from "react";
3
- import { Meta, Story } from "@storybook/react";
4
- import { SnippetCode, SnippetCodeProps } from "./SnippetCode";
5
-
6
- export default {
7
- title: "Widgets / Snippet Code",
8
- component: SnippetCode,
9
- } as Meta;
10
-
11
- export const Default: Story<SnippetCodeProps> = (args) => {
12
- return <SnippetCode {...args} />;
13
- };
14
-
15
- Default.args = {
16
- code: '<iframe width="1238" height="696" src="https://www.youtube.com/embed/Kddw5pV7RZ0" title="Short Booked it software overview." frameBorder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" allowFullScreen />',
17
- };
@@ -1,27 +0,0 @@
1
- import React from "react";
2
- import { Button } from "react-bootstrap";
3
- import { useTranslation } from "react-i18next";
4
- import { ReactComponent as CopyIcon } from "../../assets/widgets/copy.svg";
5
-
6
- export type SnippetCodeProps = {
7
- code: string;
8
- };
9
-
10
- const copyCode = (code: string) => window.navigator.clipboard.writeText(code);
11
-
12
- export const SnippetCode = ({ code }: SnippetCodeProps) => {
13
- const { t } = useTranslation("Design");
14
-
15
- return (
16
- <div className="widget-designer-snippet-code">
17
- <h4>{t("codeSnippet")}</h4>
18
-
19
- <p className="code-container">{code}</p>
20
-
21
- <Button onClick={() => copyCode(code)}>
22
- {t("copyCode")}
23
- <CopyIcon />
24
- </Button>
25
- </div>
26
- );
27
- };
@@ -1 +0,0 @@
1
- export { SnippetCode } from "./SnippetCode";
@@ -1,12 +0,0 @@
1
- import React from "react";
2
- import { Meta, Story } from "@storybook/react";
3
- import { WidgetBuilderForm } from "./WidgetBuilderForm";
4
-
5
- export default {
6
- title: "Widgets / Widget Builder Form",
7
- component: WidgetBuilderForm,
8
- } as Meta;
9
-
10
- export const Default: Story = (args) => {
11
- return <WidgetBuilderForm {...args} />;
12
- };
@@ -1,84 +0,0 @@
1
- import React from "react";
2
- import { Button, Col, Form, Row } from "react-bootstrap";
3
- import { useTranslation } from "react-i18next";
4
- import { useForm, FormProvider } from "react-hook-form";
5
- import { WidgetTypeSelector } from "../WidgetTypeSelector/WidgetTypeSelector";
6
- import { CheckboxGroup } from "../CheckboxGroup";
7
- import { CalendarStyleSelector } from "../CalendarStyleSelector";
8
- import { BookingStyleSelector } from "../BookingStyleSelector";
9
- import { ProductSetSelector } from "../ProductSetSelector";
10
- import { SnippetCode } from "../SnippetCode";
11
-
12
- export type WidgetBuilderFormModel = {
13
- name: string;
14
- widgetType: string;
15
- calendarStyle: string;
16
- includeFromPrice: string[];
17
- includeAvailability: string[];
18
- productSets: string[];
19
- bookingWidgetStyle: string;
20
- };
21
-
22
- export const WidgetBuilderForm = () => {
23
- const { t } = useTranslation("Design");
24
-
25
- const form = useForm<WidgetBuilderFormModel>({ mode: "onChange" });
26
-
27
- const onSubmit = () => null;
28
-
29
- return (
30
- <FormProvider {...form}>
31
- <Row
32
- as="form"
33
- className="widget-builder-form"
34
- onSubmit={form.handleSubmit(onSubmit)}
35
- >
36
- <Col lg={6} md={6}>
37
- <h2>{t("eventPageOverlay")}</h2>
38
-
39
- <Form.Group>
40
- <Form.Label>{t("name")}</Form.Label>
41
- <Form.Control type="text" {...form.register("name")} />
42
- </Form.Group>
43
-
44
- <WidgetTypeSelector />
45
-
46
- <h3 className="widget-builder-form-customizations">
47
- {t("customizations")}
48
- </h3>
49
-
50
- <CalendarStyleSelector />
51
-
52
- <CheckboxGroup
53
- heading={t("includeFromPrice")}
54
- name="includeFromPrice"
55
- />
56
- <CheckboxGroup
57
- heading={t("includeAvailability")}
58
- name="includeAvailability"
59
- />
60
-
61
- <ProductSetSelector />
62
- </Col>
63
-
64
- <Col lg={5} md={5} className="widget-builder-right-column">
65
- <div className="widget-builder-form-grey">
66
- <BookingStyleSelector />
67
-
68
- <div>
69
- <h4>{t("stylingTemplate")}</h4>
70
-
71
- <Form.Group>
72
- <Form.Control as="select" />
73
- </Form.Group>
74
- </div>
75
-
76
- <SnippetCode code="" />
77
- </div>
78
-
79
- <Button type="submit">{t("saveAndClose")}</Button>
80
- </Col>
81
- </Row>
82
- </FormProvider>
83
- );
84
- };
@@ -1,17 +0,0 @@
1
- import React from "react";
2
- import { Meta, Story } from "@storybook/react";
3
- import { WidgetTypeRadio, WidgetTypeRadioProps } from "./WidgetTypeRadio";
4
-
5
- export default {
6
- title: "Widgets / Type Radio Selector",
7
- component: WidgetTypeRadio,
8
- } as Meta;
9
-
10
- export const Default: Story<WidgetTypeRadioProps> = (args) => {
11
- return <WidgetTypeRadio {...args} />;
12
- };
13
-
14
- Default.args = {
15
- label: "Venue Map",
16
- description: ["Date", "Floor", "Table", "Product Sets", "Checkout"],
17
- };
@@ -1,43 +0,0 @@
1
- import React from "react";
2
- import { Form } from "react-bootstrap";
3
- import { useFormContext } from "react-hook-form";
4
- import { WidgetBuilderFormModel } from "../WidgetBuilderForm/WidgetBuilderForm";
5
-
6
- export type WidgetTypeRadioProps = {
7
- label: string;
8
- description: string[];
9
- };
10
-
11
- const prepareDescription = (description: string[]) =>
12
- description.map((item, index) => {
13
- if (index === 0) return item;
14
- return `> ${item}`;
15
- });
16
-
17
- export const WidgetTypeRadio = ({
18
- label,
19
- description,
20
- }: WidgetTypeRadioProps) => {
21
- const { register } = useFormContext<WidgetBuilderFormModel>();
22
-
23
- return (
24
- <Form.Check className="widget-type-radio">
25
- <Form.Check.Label>
26
- <div className="widget-type-radio-controls">
27
- <Form.Check.Input
28
- type="radio"
29
- value={label}
30
- {...register("widgetType")}
31
- />
32
- <span>{label}</span>
33
- </div>
34
-
35
- <p className="widget-type-radio-description">
36
- {prepareDescription(description).map((item) => (
37
- <span key={item}> {item}</span>
38
- ))}
39
- </p>
40
- </Form.Check.Label>
41
- </Form.Check>
42
- );
43
- };
@@ -1 +0,0 @@
1
- export { WidgetTypeRadio } from "./WidgetTypeRadio";
@@ -1,12 +0,0 @@
1
- import React from "react";
2
- import { Meta, Story } from "@storybook/react";
3
- import { WidgetTypeSelector } from "./WidgetTypeSelector";
4
-
5
- export default {
6
- title: "Widgets / Widget Type Selector",
7
- component: WidgetTypeSelector,
8
- } as Meta;
9
-
10
- export const Default: Story = (args) => {
11
- return <WidgetTypeSelector {...args} />;
12
- };
@@ -1,32 +0,0 @@
1
- import React from "react";
2
- import { useTranslation } from "react-i18next";
3
- import { Form } from "react-bootstrap";
4
- import { WidgetTypeRadio } from "../WidgetTypeRadio";
5
-
6
- const venueMapDescription = [
7
- "date",
8
- "floor",
9
- "table",
10
- "productSets",
11
- "checkout",
12
- ];
13
-
14
- export const WidgetTypeSelector = () => {
15
- const { t } = useTranslation("Design");
16
-
17
- return (
18
- <div className="widget-type-selector">
19
- <Form.Label>{t("selectBookingType")}</Form.Label>
20
-
21
- <WidgetTypeRadio
22
- label={t("eventList")}
23
- description={[t("eventListing")]}
24
- />
25
-
26
- <WidgetTypeRadio
27
- label={t("venueMap")}
28
- description={venueMapDescription.map((item) => t(item))}
29
- />
30
- </div>
31
- );
32
- };