@licklist/design 0.44.486-dev.19 → 0.44.486-dev.2

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 (165) hide show
  1. package/dist/collapsible-input-group/CollapsibleInputGroup.js +1 -1
  2. package/dist/date-time-button/DateTimeButton.js +1 -1
  3. package/dist/events/edit-event-modal/IntervalInput.d.ts.map +1 -1
  4. package/dist/events/edit-event-modal/IntervalInput.js +1 -1
  5. package/dist/events/event-venue-map/hooks/useImage.d.ts.map +1 -1
  6. package/dist/events/event-venue-map/hooks/useImage.js +1 -1
  7. package/dist/iframe/activity-cards/activity-card/ActivityCard.d.ts +12 -0
  8. package/dist/iframe/activity-cards/activity-card/ActivityCard.d.ts.map +1 -0
  9. package/dist/iframe/activity-cards/activity-card/ActivityCard.js +1 -0
  10. package/dist/iframe/activity-cards/index.d.ts +3 -0
  11. package/dist/iframe/activity-cards/index.d.ts.map +1 -0
  12. package/dist/iframe/activity-cards/list-activity-card/ListActivityCard.d.ts +12 -0
  13. package/dist/iframe/activity-cards/list-activity-card/ListActivityCard.d.ts.map +1 -0
  14. package/dist/iframe/activity-cards/list-activity-card/ListActivityCard.js +1 -0
  15. package/dist/iframe/event/event-calendar/EventCalendar.d.ts +3 -5
  16. package/dist/iframe/event/event-calendar/EventCalendar.d.ts.map +1 -1
  17. package/dist/iframe/event/event-calendar/EventCalendar.js +1 -1
  18. package/dist/iframe/event/event-calendar/components/CalendarDate/CalendarDate.d.ts +2 -3
  19. package/dist/iframe/event/event-calendar/components/CalendarDate/CalendarDate.d.ts.map +1 -1
  20. package/dist/iframe/event/event-calendar/components/CalendarDate/CalendarDate.js +1 -1
  21. package/dist/iframe/event/event-calendar/components/CalendarDates/CalendarDates.d.ts +3 -5
  22. package/dist/iframe/event/event-calendar/components/CalendarDates/CalendarDates.d.ts.map +1 -1
  23. package/dist/iframe/event/event-calendar/components/CalendarDates/CalendarDates.js +1 -1
  24. package/dist/iframe/index.d.ts +1 -1
  25. package/dist/iframe/index.d.ts.map +1 -1
  26. package/dist/iframe/order-process/components/BookingSummary/BookingSummary.d.ts +1 -1
  27. package/dist/iframe/order-process/components/BookingSummary/BookingSummary.d.ts.map +1 -1
  28. package/dist/iframe/order-process/components/BookingSummary/BookingSummary.js +1 -1
  29. package/dist/iframe/order-process/components/BookingSummary/types/index.d.ts +0 -1
  30. package/dist/iframe/order-process/components/BookingSummary/types/index.d.ts.map +1 -1
  31. package/dist/iframe/order-process/components/BookingSummary/utils/index.d.ts.map +1 -1
  32. package/dist/iframe/order-process/components/BookingSummary/utils/index.js +1 -1
  33. package/dist/iframe/order-process/components/CalendarStepsForm/CalendarStepsForm.d.ts +1 -1
  34. package/dist/iframe/order-process/components/CalendarStepsForm/CalendarStepsForm.d.ts.map +1 -1
  35. package/dist/iframe/order-process/components/CalendarStepsForm/CalendarStepsForm.js +1 -1
  36. package/dist/iframe/order-process/components/utils/useCategoryVerification.d.ts +2 -3
  37. package/dist/iframe/order-process/components/utils/useCategoryVerification.d.ts.map +1 -1
  38. package/dist/iframe/order-process/components/utils/useCategoryVerification.js +1 -1
  39. package/dist/iframe/page/components/PageBody/components/LeftBlock/LeftBlock.d.ts.map +1 -1
  40. package/dist/iframe/page/components/PageBody/components/LeftBlock/LeftBlock.js +1 -1
  41. package/dist/iframe/payment/order-items-table/hooks/useTableData.d.ts.map +1 -1
  42. package/dist/iframe/payment/order-items-table/hooks/useTableData.js +1 -1
  43. package/dist/iframe/payment/order-items-table/types/index.d.ts +1 -7
  44. package/dist/iframe/payment/order-items-table/types/index.d.ts.map +1 -1
  45. package/dist/index.js +1 -1
  46. package/dist/notification/email-template/control/EmailTemplateControl.d.ts.map +1 -1
  47. package/dist/notification/email-template/control/EmailTemplateControl.js +1 -1
  48. package/dist/product-set/form/ProductCategoriesControl.d.ts.map +1 -1
  49. package/dist/product-set/form/ProductCategoriesControl.js +1 -1
  50. package/dist/product-set/form/ProductsControl.d.ts +1 -3
  51. package/dist/product-set/form/ProductsControl.d.ts.map +1 -1
  52. package/dist/product-set/form/ProductsControl.js +1 -1
  53. package/dist/product-set/product/ProductControl.d.ts +1 -2
  54. package/dist/product-set/product/ProductControl.d.ts.map +1 -1
  55. package/dist/product-set/product/ProductControl.js +1 -1
  56. package/dist/product-set/product/duration/ProductDurationControl.js +1 -1
  57. package/dist/product-set/product-category/ProductCategoryControl.d.ts.map +1 -1
  58. package/dist/product-set/product-category/ProductCategoryControl.js +1 -1
  59. package/dist/provider/working-hours-input/WorkingHoursInputDescription.d.ts.map +1 -1
  60. package/dist/provider/working-hours-input/WorkingHoursInputDescription.js +1 -1
  61. package/dist/recurrence-input/RecurrenceEndInput.d.ts +1 -2
  62. package/dist/recurrence-input/RecurrenceEndInput.d.ts.map +1 -1
  63. package/dist/recurrence-input/RecurrenceEndInput.js +1 -1
  64. package/dist/recurrence-input/RecurrenceInput.d.ts +1 -2
  65. package/dist/recurrence-input/RecurrenceInput.d.ts.map +1 -1
  66. package/dist/recurrence-input/RecurrenceInput.js +1 -1
  67. package/dist/recurring-date-picker-input/RecurrenceIntervalAndFrequencyInput.d.ts +1 -4
  68. package/dist/recurring-date-picker-input/RecurrenceIntervalAndFrequencyInput.d.ts.map +1 -1
  69. package/dist/recurring-date-picker-input/RecurrenceIntervalAndFrequencyInput.js +1 -1
  70. package/dist/snippet/snippet-template/preview/Preview.js +1 -1
  71. package/dist/static/CountryCodeSelect.d.ts.map +1 -1
  72. package/dist/static/CountryCodeSelect.js +1 -1
  73. package/dist/static/form-number-input/FormNumberInput.d.ts +1 -2
  74. package/dist/static/form-number-input/FormNumberInput.d.ts.map +1 -1
  75. package/dist/static/form-number-input/FormNumberInput.js +1 -1
  76. package/dist/styles/{activity-card/GridActivitiesCard.scss → iframe-customers-journey/ActivitiesCard.scss} +1 -1
  77. package/dist/styles/{activity-card/ListActivitiesCard.scss → iframe-customers-journey/ActivitiesSelectedCard.scss} +1 -2
  78. package/dist/styles/iframe-customers-journey/_index.scss +3 -0
  79. package/dist/styles/iframe-events/Calendar.scss +14 -14
  80. package/dist/styles/iframe-page/PageBody.scss +2 -3
  81. package/dist/styles/notification/Notification.scss +0 -4
  82. package/dist/styles/packages.scss +1 -2
  83. package/dist/styles/resources-blocking/_index.scss +0 -5
  84. package/dist/styles/themes/bookedit/_index.scss +0 -1
  85. package/dist/zone/form/components/AvailableTimesControl.d.ts.map +1 -1
  86. package/dist/zone/form/components/AvailableTimesControl.js +1 -1
  87. package/dist/zone/form/components/ZoneControl.d.ts.map +1 -1
  88. package/dist/zone/form/components/ZoneControl.js +1 -1
  89. package/dist/zone/form/components/ZoneRecurrencesControl.d.ts.map +1 -1
  90. package/dist/zone/form/components/ZoneRecurrencesControl.js +1 -1
  91. package/dist/zone/form/utils/dates.d.ts.map +1 -1
  92. package/dist/zone/form/utils/dates.js +1 -1
  93. package/package.json +1 -1
  94. package/src/collapsible-input-group/CollapsibleInputGroup.tsx +1 -1
  95. package/src/date-time-button/DateTimeButton.tsx +1 -1
  96. package/src/events/edit-event-modal/IntervalInput.tsx +0 -3
  97. package/src/events/event-venue-map/hooks/useImage.tsx +8 -17
  98. package/src/iframe/{activity-card → activity-cards/activity-card}/ActivityCard.stories.tsx +1 -24
  99. package/src/iframe/activity-cards/activity-card/ActivityCard.tsx +38 -0
  100. package/src/iframe/activity-cards/index.ts +2 -0
  101. package/src/iframe/activity-cards/list-activity-card/ListActivityCard.stories.tsx +52 -0
  102. package/src/iframe/activity-cards/list-activity-card/ListActivityCard.tsx +49 -0
  103. package/src/iframe/event/event-calendar/EventCalendar.stories.tsx +21 -20
  104. package/src/iframe/event/event-calendar/EventCalendar.tsx +3 -10
  105. package/src/iframe/event/event-calendar/components/CalendarDate/CalendarDate.tsx +2 -10
  106. package/src/iframe/event/event-calendar/components/CalendarDates/CalendarDates.tsx +2 -6
  107. package/src/iframe/index.ts +1 -1
  108. package/src/iframe/order-process/components/BookingSummary/BookingSummary.tsx +0 -2
  109. package/src/iframe/order-process/components/BookingSummary/types/index.ts +0 -1
  110. package/src/iframe/order-process/components/BookingSummary/utils/index.ts +0 -2
  111. package/src/iframe/order-process/components/CalendarStepsForm/CalendarStepsForm.tsx +2 -2
  112. package/src/iframe/order-process/components/utils/useCategoryVerification.ts +29 -28
  113. package/src/iframe/page/components/PageBody/components/LeftBlock/LeftBlock.tsx +1 -6
  114. package/src/iframe/payment/order-items-table/hooks/useTableData.tsx +99 -11
  115. package/src/iframe/payment/order-items-table/types/index.ts +1 -18
  116. package/src/iframe/payment/payment-page/PaymentPage.tsx +4 -4
  117. package/src/notification/email-template/control/EmailTemplateControl.tsx +1 -26
  118. package/src/product-set/form/ProductCategoriesControl.tsx +0 -2
  119. package/src/product-set/form/ProductSetForm.stories.tsx +0 -1
  120. package/src/product-set/form/ProductsControl.tsx +0 -10
  121. package/src/product-set/product/ProductControl.tsx +8 -31
  122. package/src/product-set/product/duration/ProductDurationControl.tsx +1 -1
  123. package/src/product-set/product-category/ProductCategoryControl.tsx +5 -15
  124. package/src/provider/working-hours-input/WorkingHoursInputDescription.tsx +8 -10
  125. package/src/recurrence-input/RecurrenceEndInput.tsx +9 -27
  126. package/src/recurrence-input/RecurrenceInput.tsx +0 -3
  127. package/src/recurring-date-picker-input/RecurrenceIntervalAndFrequencyInput.tsx +13 -23
  128. package/src/static/CountryCodeSelect.tsx +5 -3
  129. package/src/static/form-number-input/FormNumberInput.tsx +1 -8
  130. package/src/styles/{activity-card/GridActivitiesCard.scss → iframe-customers-journey/ActivitiesCard.scss} +1 -1
  131. package/src/styles/{activity-card/ListActivitiesCard.scss → iframe-customers-journey/ActivitiesSelectedCard.scss} +1 -2
  132. package/src/styles/iframe-customers-journey/_index.scss +3 -0
  133. package/src/styles/iframe-events/Calendar.scss +14 -14
  134. package/src/styles/iframe-page/PageBody.scss +2 -3
  135. package/src/styles/notification/Notification.scss +0 -4
  136. package/src/styles/packages.scss +1 -2
  137. package/src/styles/resources-blocking/_index.scss +0 -5
  138. package/src/styles/themes/bookedit/_index.scss +0 -1
  139. package/src/typings.d.ts +0 -11
  140. package/src/zone/form/components/AvailableTimesControl.tsx +9 -4
  141. package/src/zone/form/components/ZoneControl.tsx +0 -2
  142. package/src/zone/form/components/ZoneRecurrencesControl.tsx +35 -27
  143. package/src/zone/form/utils/dates.ts +36 -29
  144. package/dist/iframe/activity-card/ActivityCard.d.ts +0 -17
  145. package/dist/iframe/activity-card/ActivityCard.d.ts.map +0 -1
  146. package/dist/iframe/activity-card/ActivityCard.js +0 -1
  147. package/dist/iframe/activity-card/index.d.ts +0 -2
  148. package/dist/iframe/activity-card/index.d.ts.map +0 -1
  149. package/dist/iframe/payment/order-items-table/types/index.js +0 -1
  150. package/dist/iframe/payment/order-items-table/utils/paymentSummary.d.ts +0 -3
  151. package/dist/iframe/payment/order-items-table/utils/paymentSummary.d.ts.map +0 -1
  152. package/dist/iframe/payment/order-items-table/utils/paymentSummary.js +0 -1
  153. package/dist/styles/activity-card/_index.scss +0 -2
  154. package/dist/styles/date-time-button/_index.scss +0 -1
  155. package/dist/zone/form/components/GameDurationControl.d.ts +0 -7
  156. package/dist/zone/form/components/GameDurationControl.d.ts.map +0 -1
  157. package/dist/zone/form/components/GameDurationControl.js +0 -1
  158. package/src/iframe/activity-card/ActivityCard.tsx +0 -77
  159. package/src/iframe/activity-card/index.ts +0 -1
  160. package/src/iframe/payment/order-items-table/utils/paymentSummary.tsx +0 -118
  161. package/src/styles/activity-card/_index.scss +0 -2
  162. package/src/styles/date-time-button/_index.scss +0 -1
  163. package/src/zone/form/components/GameDurationControl.tsx +0 -46
  164. /package/dist/styles/{date-time-button → iframe-customers-journey}/DateTimeButton.scss +0 -0
  165. /package/src/styles/{date-time-button → iframe-customers-journey}/DateTimeButton.scss +0 -0
@@ -3,7 +3,7 @@ import React from "react";
3
3
  import { Col, Row } from "react-bootstrap";
4
4
  import { useFormContext } from "react-hook-form";
5
5
  import { useTranslation } from "react-i18next";
6
- import { TIME_FORMAT } from "@licklist/core/dist/Config";
6
+ import { useIntl } from "react-intl";
7
7
  import { WorkingHoursInputValues } from ".";
8
8
  import { useWeekdays } from "./utils";
9
9
 
@@ -12,9 +12,7 @@ export function WorkingHoursInputDescription() {
12
12
  const values = watch("workingHours");
13
13
  const weekdays = useWeekdays("short");
14
14
  const { t } = useTranslation("Design");
15
-
16
- if (!values) return null;
17
-
15
+ const { formatTime } = useIntl();
18
16
  return (
19
17
  <>
20
18
  {Array.from({ length: weekdays.length }, (_, i) => i)
@@ -28,16 +26,16 @@ export function WorkingHoursInputDescription() {
28
26
  {weekday?.end
29
27
  ? weekday.start
30
28
  ? t("timeInterval", {
31
- start: DateTime.fromISO(weekday.start).toFormat(
32
- TIME_FORMAT
29
+ start: formatTime(
30
+ DateTime.fromISO(weekday.start).toJSDate()
33
31
  ),
34
- end: DateTime.fromISO(weekday.start).toFormat(
35
- TIME_FORMAT
32
+ end: formatTime(
33
+ DateTime.fromISO(weekday.end).toJSDate()
36
34
  ),
37
35
  })
38
36
  : t("timeFrom", {
39
- start: DateTime.fromISO(weekday.start).toFormat(
40
- TIME_FORMAT
37
+ start: formatTime(
38
+ DateTime.fromISO(weekday.start).toJSDate()
41
39
  ),
42
40
  })
43
41
  : null}
@@ -1,19 +1,17 @@
1
- import React, { useEffect, useRef } from "react";
1
+ import React, { useRef } from "react";
2
2
  import { useId } from "@react-aria/utils";
3
3
  import { DateTime, DurationUnit } from "luxon";
4
4
  import { Col, Form, InputGroup, Row } from "react-bootstrap";
5
5
  import RRule from "rrule";
6
- import { DATE_FORMAT } from "@licklist/core/dist/Config";
7
- import { useTranslation } from "react-i18next";
6
+
8
7
  import { SupportedFrequency } from "./utils";
9
8
  import HTMLInputDateElement from "../types/static/HTMLInputDateElement";
10
9
 
11
10
  interface Props {
12
11
  disabled?: boolean;
13
- date: string; // yyyy-mm-ddThh:mm
14
- minDate?: string; // should be in yyyy-mm-dd format
12
+ date: string;
15
13
  frequency: SupportedFrequency;
16
- until?: string; // yyyy-mm-dd
14
+ until?: string;
17
15
  count?: number;
18
16
  onChange: (values: { until?: string; count?: number }) => void;
19
17
  }
@@ -25,31 +23,16 @@ function RecurrenceEndInput({
25
23
  until,
26
24
  count,
27
25
  onChange,
28
- minDate,
29
26
  }: Props) {
30
- const { t } = useTranslation("Design");
31
27
  // unique ids for radios
32
28
  const neverId = useId();
33
29
  const onId = useId();
34
30
  const afterId = useId();
35
31
  const dateInput = useRef<HTMLInputDateElement | null>(null);
36
32
 
37
- useEffect(() => {
38
- const untilDatetime = DateTime.fromFormat(
39
- until ?? getUntil({ date, frequency }),
40
- DATE_FORMAT
41
- );
42
-
43
- const minDatetime = DateTime.fromFormat(minDate, DATE_FORMAT);
44
-
45
- if (minDatetime > untilDatetime) {
46
- onChange({ until: minDate });
47
- }
48
- }, [minDate, onChange, until, date, frequency]);
49
-
50
33
  return (
51
34
  <Form.Group>
52
- <Form.Label>{t("ends")}</Form.Label>
35
+ <Form.Label>Ends</Form.Label>
53
36
 
54
37
  <Form.Check type="radio" id={neverId} custom className="mt-3">
55
38
  <Form.Check.Input
@@ -58,7 +41,7 @@ function RecurrenceEndInput({
58
41
  onChange={() => onChange({ count: 500 })}
59
42
  disabled={disabled}
60
43
  />
61
- <Form.Check.Label>{t("never")}</Form.Check.Label>
44
+ <Form.Check.Label>Never</Form.Check.Label>
62
45
  </Form.Check>
63
46
 
64
47
  <Form.Check type="radio" id={onId} custom className="mt-3">
@@ -72,12 +55,11 @@ function RecurrenceEndInput({
72
55
  }
73
56
  disabled={disabled}
74
57
  />
75
- <Form.Check.Label>{t("on")}</Form.Check.Label>
58
+ <Form.Check.Label>On</Form.Check.Label>
76
59
  </Col>
77
60
  <Col>
78
61
  <Form.Control
79
62
  type="date"
80
- min={minDate}
81
63
  disabled={disabled || !until}
82
64
  aria-label="Date on which the recurrence ends"
83
65
  value={until ?? getUntil({ date, frequency })}
@@ -101,7 +83,7 @@ function RecurrenceEndInput({
101
83
  }
102
84
  disabled={disabled}
103
85
  />
104
- <Form.Check.Label>{t("after")}</Form.Check.Label>
86
+ <Form.Check.Label>After</Form.Check.Label>
105
87
  </Col>
106
88
  <Col>
107
89
  <InputGroup>
@@ -117,7 +99,7 @@ function RecurrenceEndInput({
117
99
  }
118
100
  />
119
101
  <InputGroup.Append>
120
- <InputGroup.Text>{t("occurences")}</InputGroup.Text>
102
+ <InputGroup.Text>occurrences</InputGroup.Text>
121
103
  </InputGroup.Append>
122
104
  </InputGroup>
123
105
  </Col>
@@ -16,7 +16,6 @@ import {
16
16
  export interface RecurrenceInputProps {
17
17
  disabled?: boolean;
18
18
  date: string;
19
- minDate?: string;
20
19
  value?: string;
21
20
  onChange: (value: string) => void;
22
21
  initialFrequency?: Frequency;
@@ -25,7 +24,6 @@ export interface RecurrenceInputProps {
25
24
  export function RecurrenceInput({
26
25
  disabled = false,
27
26
  date,
28
- minDate,
29
27
  value,
30
28
  onChange,
31
29
  initialFrequency = Frequency.WEEKLY,
@@ -84,7 +82,6 @@ export function RecurrenceInput({
84
82
  )}
85
83
  <RecurrenceEndInput
86
84
  date={date}
87
- minDate={minDate}
88
85
  frequency={state.freq}
89
86
  until={state.until && DateTime.fromJSDate(state.until).toISODate()}
90
87
  count={state.count}
@@ -2,8 +2,8 @@ import React, { useEffect } from "react";
2
2
  import { DateTime } from "luxon";
3
3
  import { Col, Form, Row } from "react-bootstrap";
4
4
  import { useTranslation } from "react-i18next";
5
- import { RegisterOptions, useFormContext } from "react-hook-form";
6
- import { DATE_FORMAT } from "@licklist/core/dist/Config";
5
+ import { useFormContext } from "react-hook-form";
6
+ import { DATE_FORMAT, TIME_FULL_FORMAT } from "@licklist/core/dist/Config";
7
7
  import { RecurringDatePickerInputValues } from "./RecurringDatePickerInput";
8
8
 
9
9
  interface RecurrenceIntervalAndFrequencyInputProps {
@@ -13,14 +13,6 @@ interface RecurrenceIntervalAndFrequencyInputProps {
13
13
  startTimeLabel?: string;
14
14
  endDateLabel?: string;
15
15
  endTimeLabel?: string;
16
- startTimeRules?: Pick<
17
- RegisterOptions,
18
- "max" | "min" | "validate" | "required" | "pattern"
19
- >;
20
- endTimeRules?: Pick<
21
- RegisterOptions,
22
- "max" | "min" | "validate" | "required" | "pattern"
23
- >;
24
16
  }
25
17
 
26
18
  function RecurrenceIntervalAndFrequencyInput({
@@ -30,8 +22,6 @@ function RecurrenceIntervalAndFrequencyInput({
30
22
  startTimeLabel,
31
23
  endDateLabel,
32
24
  endTimeLabel,
33
- startTimeRules,
34
- endTimeRules,
35
25
  }: RecurrenceIntervalAndFrequencyInputProps) {
36
26
  const { t } = useTranslation(["Design", "Notification", "App"]);
37
27
 
@@ -57,9 +47,6 @@ function RecurrenceIntervalAndFrequencyInput({
57
47
  }, [startDate]);
58
48
 
59
49
  useEffect(() => {
60
- if (!startTime || !endTime) {
61
- return;
62
- }
63
50
  trigger("endTime");
64
51
  // eslint-disable-next-line react-hooks/exhaustive-deps
65
52
  }, [startTime]);
@@ -131,18 +118,15 @@ function RecurrenceIntervalAndFrequencyInput({
131
118
  </Form.Label>
132
119
  <Form.Control
133
120
  type="time"
134
- {...register("startTime", { required: false, ...startTimeRules })}
121
+ {...register("startTime", { required: false })}
135
122
  onChange={({ target: { value } }) => {
136
- setValue("startTime", `${value}:00`, { shouldValidate: true });
123
+ setValue("startTime", `${value}:00`);
137
124
  }}
138
125
  placeholder="hh:mm"
139
126
  defaultValue={startTime}
140
127
  disabled={disabled}
141
128
  isInvalid={Boolean(errors.startTime)}
142
129
  />
143
- <Form.Control.Feedback type="invalid">
144
- {errors.startTime?.message}
145
- </Form.Control.Feedback>
146
130
  </Form.Group>
147
131
  </Col>
148
132
 
@@ -157,8 +141,15 @@ function RecurrenceIntervalAndFrequencyInput({
157
141
  if (!startTime || !time) {
158
142
  return true;
159
143
  }
160
- const currentStartTime = DateTime.fromISO(startTime);
161
- const currentEndTime = DateTime.fromISO(time);
144
+ const currentStartTime = DateTime.fromFormat(
145
+ startTime,
146
+ TIME_FULL_FORMAT
147
+ );
148
+
149
+ const currentEndTime = DateTime.fromFormat(
150
+ time,
151
+ TIME_FULL_FORMAT
152
+ );
162
153
 
163
154
  return currentEndTime?.diff(currentStartTime, ["seconds"])
164
155
  ?.seconds > 0
@@ -168,7 +159,6 @@ function RecurrenceIntervalAndFrequencyInput({
168
159
  min: t("Design:startTimeSmall"),
169
160
  })}`;
170
161
  },
171
- ...endTimeRules,
172
162
  })}
173
163
  onChange={({ target: { value } }) => {
174
164
  setValue("endTime", `${value}:59`, { shouldValidate: true });
@@ -52,9 +52,11 @@ function CountryCodeSelect({
52
52
  {t("chooseCountry")}
53
53
  </option>
54
54
  {sortedCountries.map((key: keyof typeof en) => (
55
- <option key={key as string} value={key as string}>
56
- {en[key]}
57
- </option>
55
+ <>
56
+ <option key={key as string} value={key as string}>
57
+ {en[key]}
58
+ </option>
59
+ </>
58
60
  ))}
59
61
  </Form.Control>
60
62
  <Form.Control.Feedback type="invalid">{error}</Form.Control.Feedback>
@@ -15,7 +15,6 @@ interface FormNumberInputProps {
15
15
  label: string;
16
16
  fieldName: string;
17
17
  step?: number;
18
- onChange?: (value: number) => void;
19
18
  disabled?: boolean;
20
19
  rules?: Pick<
21
20
  RegisterOptions,
@@ -29,7 +28,6 @@ export const FormNumberInput = ({
29
28
  step = 1,
30
29
  rules,
31
30
  disabled,
32
- onChange,
33
31
  }: FormNumberInputProps) => {
34
32
  const controlId = useId();
35
33
  const { t } = useTranslation("Validation");
@@ -78,12 +76,7 @@ export const FormNumberInput = ({
78
76
  disabled={disabled}
79
77
  isInvalid={HookFormService.isInvalid(fieldName, errors)}
80
78
  {...field}
81
- onChange={(event) => {
82
- if (onChange) {
83
- onChange(Number(event.target.value));
84
- }
85
- field.onChange(Number(event.target.value));
86
- }}
79
+ onChange={(event) => field.onChange(Number(event.target.value))}
87
80
  onFocus={onFocus}
88
81
  />
89
82
  )}
@@ -11,7 +11,7 @@
11
11
  word-wrap: break-word;
12
12
  background-color: #fff;
13
13
  font-size: 0.8rem;
14
- background-color: $snippet-product-set-background-color;
14
+ color: $snippet-elements-body-color;
15
15
 
16
16
  div {
17
17
  text-align: left;
@@ -6,9 +6,8 @@
6
6
  align-items: center;
7
7
  cursor: pointer;
8
8
  height: 5rem;
9
- padding: 0.375rem;
10
9
  border: 2px solid transparent;
11
- border-radius: 0.5rem;
10
+ border: 2px solid transparent;
12
11
  background-color: $snippet-product-set-background-color;
13
12
  color: $snippet-product-set-font-color;
14
13
  transition: $color-transition;
@@ -0,0 +1,3 @@
1
+ @import "./ActivitiesSelectedCard.scss";
2
+ @import "./ActivitiesCard.scss";
3
+ @import "./DateTimeButton.scss";
@@ -1,3 +1,4 @@
1
+
1
2
  .calendar-wrapper {
2
3
  display: flex;
3
4
 
@@ -20,7 +21,7 @@
20
21
  background-color: transparent;
21
22
  }
22
23
 
23
- &:focus {
24
+ &:focus{
24
25
  box-shadow: none;
25
26
  }
26
27
  }
@@ -72,9 +73,10 @@
72
73
  }
73
74
  }
74
75
 
76
+
77
+
75
78
  .calendar-dates-wrapper {
76
- .calendar-weekdays,
77
- .calendar-dates {
79
+ .calendar-weekdays, .calendar-dates {
78
80
  display: grid;
79
81
  grid-template-columns: repeat(7, auto);
80
82
  grid-gap: 0.5rem 1rem;
@@ -96,17 +98,17 @@
96
98
  margin-top: 0.75rem;
97
99
 
98
100
  .calendar-date {
101
+ height: 2rem;
99
102
  display: flex;
100
- flex-direction: column;
101
103
  align-items: center;
102
104
  justify-content: center;
103
- padding: 0.25rem;
105
+ padding: 0;
104
106
  border-radius: 0.25rem;
105
107
  background-color: $snippet-calendar-button-background-color;
106
108
  color: $snippet-calendar-button-font-color;
107
109
  font-size: 0.875rem;
108
110
  line-height: 1.3125rem;
109
- border: 1px solid $snippet-calendar-button-border-color;
111
+ border: 1px solid $snippet-calendar-button-border-color;;
110
112
 
111
113
  &.selected-date {
112
114
  background-color: $snippet-calendar-active-button-background-color;
@@ -136,7 +138,7 @@
136
138
  &:hover {
137
139
  border-color: $snippet-calendar-active-button-border-color;
138
140
  }
139
-
141
+
140
142
  &:focus {
141
143
  box-shadow: none;
142
144
  }
@@ -165,11 +167,11 @@
165
167
  justify-content: center;
166
168
  width: 3.75rem;
167
169
  height: 2.5rem;
168
- background-color: #f2f2f2;
170
+ background-color: #F2F2F2;
169
171
  color: $black;
170
172
  font-size: 0.75rem;
171
173
  border-radius: 0.25rem;
172
-
174
+
173
175
  &.selected-time {
174
176
  background-color: $blue;
175
177
  color: $white;
@@ -187,16 +189,14 @@
187
189
  flex-direction: column;
188
190
  align-items: center;
189
191
 
190
- .calendar,
191
- .start-time-wrapper {
192
+ .calendar, .start-time-wrapper {
192
193
  min-width: 20.75rem;
193
194
 
194
195
  .calendar-dates-wrapper {
195
- .calendar-weekdays,
196
- .calendar-dates {
196
+ .calendar-weekdays, .calendar-dates {
197
197
  grid-gap: 0.5rem;
198
198
  }
199
-
199
+
200
200
  .calendar-dates {
201
201
  .calendar-date {
202
202
  width: 2.5rem;
@@ -199,8 +199,7 @@
199
199
  color: $snippet-elements-button-color;
200
200
  border: none;
201
201
  background-color: $snippet-elements-button-background-color;
202
- box-shadow: 0 0 0 $input-btn-focus-width
203
- $snippet-elements-button-background-color;
202
+ box-shadow: 0 0 0 $input-btn-focus-width $snippet-elements-button-background-color;
204
203
  }
205
204
 
206
205
  &:disabled {
@@ -235,7 +234,7 @@
235
234
  font-weight: 500;
236
235
  border-radius: 0.25rem;
237
236
  font-size: 0.875rem;
238
- min-height: 2.25rem;
237
+ height: 2.25rem;
239
238
 
240
239
  &:focus {
241
240
  box-shadow: unset;
@@ -15,10 +15,6 @@
15
15
  display: none !important;
16
16
  }
17
17
  }
18
-
19
- &.is-invalid {
20
- border-color: theme-color("danger");
21
- }
22
18
  }
23
19
 
24
20
  .placeholder-row {
@@ -13,6 +13,7 @@
13
13
  @import "./static";
14
14
  @import "./table";
15
15
  @import "./back-button";
16
+ @import "./iframe-customers-journey";
16
17
  @import "./custom-fields";
17
18
  @import "./file-upload";
18
19
  @import "./iframe-events";
@@ -40,5 +41,3 @@
40
41
  @import "./striped-static-table/";
41
42
  @import "./image-radio-input/";
42
43
  @import "./radio-card/";
43
- @import "./activity-card/";
44
- @import "./date-time-button/";
@@ -7,11 +7,6 @@
7
7
  overflow: auto;
8
8
  }
9
9
 
10
- .modal-form-content {
11
- max-height: 21rem;
12
- overflow-x: auto;
13
- }
14
-
15
10
  .reccurrence-interval-container {
16
11
  .form-group {
17
12
  margin-bottom: 0.5rem;
@@ -46,7 +46,6 @@
46
46
  .header {
47
47
  background-color: color("white");
48
48
  padding: 0 2.5rem;
49
- z-index: 2;
50
49
  min-height: 4rem;
51
50
  border-bottom: 1px solid #f0f0f0;
52
51
  }
package/src/typings.d.ts CHANGED
@@ -28,14 +28,3 @@ declare module "*.json" {
28
28
 
29
29
  declare module "react-phone-number-input/input";
30
30
  declare module "react-phone-number-input/commonjs/Flag";
31
-
32
- // @TODO: this is a hofix for the following issue:
33
- // licklist_workspace_frontend/packages/design/src/product-set/hooks/useSortableTreeFunctions.ts(17,34):
34
- // semantic error TS2304: Cannot find name 'structuredClone'.
35
- interface WindowOrWorkerGlobalScope {
36
- structuredClone(value: any, options?: StructuredSerializeOptions): any;
37
- }
38
- declare function structuredClone(
39
- value: any,
40
- options?: StructuredSerializeOptions
41
- ): any;
@@ -9,6 +9,7 @@ import { Form } from "react-bootstrap";
9
9
  import { UseFormSetError, useForm } from "react-hook-form";
10
10
  import { useId } from "@react-aria/utils";
11
11
  import { WorkHour } from "@licklist/core/dist/DataMapper/Provider/WorkHourDataMapper";
12
+ import { calculateTimeWithOffset } from "@licklist/plugins/dist/utils/time";
12
13
  import { getCheckboxesByWorkHours } from "../utils/dates";
13
14
 
14
15
  export type AvailableTimesControlRef = {
@@ -61,18 +62,20 @@ export const AvailableTimesControl = forwardRef<
61
62
  });
62
63
 
63
64
  const onChange = (option: string) => {
64
- const isAlreadyChecked = availableTimes.includes(option);
65
+ const timeWithOffset = calculateTimeWithOffset(option);
66
+
67
+ const isAlreadyChecked = availableTimes.includes(timeWithOffset);
65
68
 
66
69
  if (isAlreadyChecked) {
67
70
  setValue(
68
71
  "availableTimes",
69
- availableTimes.filter((value) => value !== option)
72
+ availableTimes.filter((value) => value !== timeWithOffset)
70
73
  );
71
74
 
72
75
  return;
73
76
  }
74
77
 
75
- setValue("availableTimes", [...availableTimes, option]);
78
+ setValue("availableTimes", [...availableTimes, timeWithOffset]);
76
79
  };
77
80
 
78
81
  useEffect(() => {
@@ -92,7 +95,9 @@ export const AvailableTimesControl = forwardRef<
92
95
  <Form.Check.Input
93
96
  type="checkbox"
94
97
  value={option}
95
- checked={availableTimes.includes(option)}
98
+ checked={availableTimes.includes(
99
+ calculateTimeWithOffset(option)
100
+ )}
96
101
  onChange={() => onChange(option)}
97
102
  disabled={isLoading}
98
103
  />
@@ -7,7 +7,6 @@ import { SortControl } from "./SortControl";
7
7
  import { ZoneRecurrencesControl } from "./ZoneRecurrencesControl";
8
8
  import { DescriptionControl } from "./DescriptionControl";
9
9
  import { ZoneImageControl } from "./ZoneImageControl";
10
- import { GameDurationControl } from "./GameDurationControl";
11
10
 
12
11
  export type ZoneControlProps = {
13
12
  isLoading: boolean;
@@ -28,7 +27,6 @@ export const ZoneControl = ({
28
27
  <Col md={6} sm={6}>
29
28
  <ZoneTypeControl isLoading={isLoading} />
30
29
  <SortControl isLoading={isLoading} />
31
- <GameDurationControl isLoading={isLoading} />
32
30
  </Col>
33
31
  <Col md={6} sm={6}>
34
32
  <ZoneImageControl isLoading={isLoading} />
@@ -12,8 +12,11 @@ import {
12
12
  import { DndContext } from "@dnd-kit/core";
13
13
  import { WorkHour } from "@licklist/core/dist/DataMapper/Provider/WorkHourDataMapper";
14
14
  import { DateTime } from "luxon";
15
- import { TIME_FORMAT } from "@licklist/core/dist/Config";
16
-
15
+ import { TIME_FORMAT, TIME_FULL_FORMAT } from "@licklist/core/dist/Config";
16
+ import {
17
+ calculateTimeWithOffset,
18
+ DIRECTION_TO_LOCAL,
19
+ } from "@licklist/plugins/dist/utils/time";
17
20
  import { CONFIRM_MODAL_ACTIONS } from "../../../modals/confirmation/ConfirmModal";
18
21
  import { Icon } from "../../../static";
19
22
  import {
@@ -64,6 +67,7 @@ export const ZoneRecurrencesControl = ({
64
67
  });
65
68
  const clearEditState = () => setEditState({ index: null, values: null });
66
69
  const [availableTimes, setAvailableTimes] = useState<string[]>([]);
70
+
67
71
  const popoverRef = useRef<HTMLDivElement>();
68
72
  const availableTimesFormRef = useRef<AvailableTimesControlRef>();
69
73
 
@@ -93,29 +97,30 @@ export const ZoneRecurrencesControl = ({
93
97
  if (!isAvailableTimesFormValid) {
94
98
  return;
95
99
  }
96
- if (next?.startTime && next?.endTime) {
97
- const startTime = DateTime.fromISO(next.startTime);
98
- const endTime = DateTime.fromISO(next.endTime);
99
- const { availableTimes } = availableTimesFormRef.current.getValues();
100
- const validAvalilableTimes = availableTimes.every((time) => {
101
- const currentAvailableTime = DateTime.fromFormat(time, TIME_FORMAT);
102
-
103
- return (
104
- currentAvailableTime.diff(startTime, "minutes").minutes >= 0 &&
105
- currentAvailableTime.diff(endTime, "minutes").minutes <= 0
106
- );
100
+ const startTime = DateTime.fromFormat(next.startTime, TIME_FULL_FORMAT);
101
+ const endTime = DateTime.fromFormat(next.endTime, TIME_FULL_FORMAT);
102
+ const { availableTimes } = availableTimesFormRef.current.getValues();
103
+ const validAvalilableTimes = availableTimes.every((time) => {
104
+ const currentAvailableTime = DateTime.fromFormat(
105
+ calculateTimeWithOffset(time, DIRECTION_TO_LOCAL),
106
+ TIME_FORMAT
107
+ );
108
+
109
+ return (
110
+ currentAvailableTime.diff(startTime, "minutes").minutes >= 0 &&
111
+ currentAvailableTime.diff(endTime, "minutes").minutes <= 0
112
+ );
113
+ });
114
+ if (!validAvalilableTimes) {
115
+ availableTimesFormRef.current.setError("availableTimes", {
116
+ message: t("Validation:fieldTimeBetween", {
117
+ attribute: t("Design:startTimesSmall"),
118
+ min: startTime.toFormat(TIME_FORMAT),
119
+ max: endTime.toFormat(TIME_FORMAT),
120
+ }),
107
121
  });
108
- if (!validAvalilableTimes) {
109
- availableTimesFormRef.current.setError("availableTimes", {
110
- message: t("Validation:fieldTimeBetween", {
111
- attribute: t("Design:startTimesSmall"),
112
- min: startTime.toFormat(TIME_FORMAT),
113
- max: endTime.toFormat(TIME_FORMAT),
114
- }),
115
- });
116
-
117
- return;
118
- }
122
+
123
+ return;
119
124
  }
120
125
  const values = {
121
126
  rrule: next.rrule,
@@ -143,9 +148,12 @@ export const ZoneRecurrencesControl = ({
143
148
  const handleOnEdit = (next: Partial<ZoneRecurrence>, index) => {
144
149
  clearEditState();
145
150
 
146
- setEditState({ index, values: next });
147
- setAvailableTimes(next.availableTimes || []);
148
- setIsDatePopoverVisible(() => true);
151
+ // Hotfix for an issue with Popover close & open actions
152
+ setTimeout(() => {
153
+ setEditState({ index, values: next });
154
+ setAvailableTimes(next.availableTimes || []);
155
+ setIsDatePopoverVisible(() => true);
156
+ }, 100);
149
157
  };
150
158
 
151
159
  const handleOnAdd = () => {