@licklist/design 0.58.4-dev.1 → 0.58.4

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 (135) hide show
  1. package/dist/iframe/event/event-card/IframeEventCard.d.ts +1 -2
  2. package/dist/iframe/event/event-card/IframeEventCard.d.ts.map +1 -1
  3. package/dist/iframe/event/event-card/IframeEventCard.js +1 -1
  4. package/dist/iframe/order-process/components/CategoryProduct/components/NumberInput/NumberInput.d.ts.map +1 -1
  5. package/dist/iframe/order-process/components/CategoryProduct/components/NumberInput/NumberInput.js +1 -1
  6. package/dist/iframe/order-process/components/CategoryProduct/components/ProductQuantityInput/ProductQuantityInput.d.ts.map +1 -1
  7. package/dist/iframe/order-process/components/CategoryProduct/components/ProductQuantityInput/ProductQuantityInput.js +1 -1
  8. package/dist/iframe/page/components/PageBody/components/LeftBlock/LeftBlock.d.ts.map +1 -1
  9. package/dist/iframe/page/components/PageBody/components/LeftBlock/LeftBlock.js +1 -1
  10. package/dist/iframe/payment/order-items-table/utils/paymentSummary.d.ts.map +1 -1
  11. package/dist/iframe/payment/order-items-table/utils/paymentSummary.js +1 -1
  12. package/dist/index.js +1 -1
  13. package/dist/product-set/card/ProductSetCard.d.ts +1 -2
  14. package/dist/product-set/card/ProductSetCard.d.ts.map +1 -1
  15. package/dist/product-set/card/ProductSetCard.js +1 -1
  16. package/dist/product-set/control/ProductSetControl.d.ts +1 -2
  17. package/dist/product-set/control/ProductSetControl.d.ts.map +1 -1
  18. package/dist/product-set/control/ProductSetControl.js +1 -1
  19. package/dist/product-set/control/TutorialGifCard.d.ts +1 -2
  20. package/dist/product-set/control/TutorialGifCard.d.ts.map +1 -1
  21. package/dist/product-set/control/TutorialGifCard.js +1 -1
  22. package/dist/product-set/form/ProductCategoriesControl.d.ts +1 -2
  23. package/dist/product-set/form/ProductCategoriesControl.d.ts.map +1 -1
  24. package/dist/product-set/form/ProductCategoriesControl.js +1 -1
  25. package/dist/product-set/form/ProductSetForm.d.ts +2 -7
  26. package/dist/product-set/form/ProductSetForm.d.ts.map +1 -1
  27. package/dist/product-set/form/ProductSetForm.js +1 -1
  28. package/dist/product-set/form/ProductsControl.d.ts +1 -2
  29. package/dist/product-set/form/ProductsControl.d.ts.map +1 -1
  30. package/dist/product-set/form/ProductsControl.js +1 -1
  31. package/dist/product-set/form/StepsControl.d.ts +1 -2
  32. package/dist/product-set/form/StepsControl.d.ts.map +1 -1
  33. package/dist/product-set/form/StepsControl.js +1 -1
  34. package/dist/product-set/form/SubProductsControl.d.ts +1 -2
  35. package/dist/product-set/form/SubProductsControl.d.ts.map +1 -1
  36. package/dist/product-set/form/SubProductsControl.js +1 -1
  37. package/dist/product-set/hooks/useSortableTreeFunctions.d.ts +1 -2
  38. package/dist/product-set/hooks/useSortableTreeFunctions.d.ts.map +1 -1
  39. package/dist/product-set/hooks/useSortableTreeFunctions.js +1 -1
  40. package/dist/product-set/item/CreateProductSetItem.d.ts +1 -2
  41. package/dist/product-set/item/CreateProductSetItem.d.ts.map +1 -1
  42. package/dist/product-set/item/CreateProductSetItem.js +1 -1
  43. package/dist/product-set/product/ProductControl.d.ts +1 -2
  44. package/dist/product-set/product/ProductControl.d.ts.map +1 -1
  45. package/dist/product-set/product/ProductControl.js +1 -1
  46. package/dist/product-set/product/fixed-duration-fields/FixedDurationOptions.d.ts +2 -4
  47. package/dist/product-set/product/fixed-duration-fields/FixedDurationOptions.d.ts.map +1 -1
  48. package/dist/product-set/product/fixed-duration-fields/FixedDurationOptions.js +1 -1
  49. package/dist/product-set/product/quantity/ProductQuantityControl.d.ts +0 -1
  50. package/dist/product-set/product/quantity/ProductQuantityControl.d.ts.map +1 -1
  51. package/dist/product-set/product/quantity/ProductQuantityControl.js +1 -1
  52. package/dist/product-set/product-category/ProductCategoryControl.d.ts +1 -2
  53. package/dist/product-set/product-category/ProductCategoryControl.d.ts.map +1 -1
  54. package/dist/product-set/product-category/ProductCategoryControl.js +1 -1
  55. package/dist/recurring-date-picker-input/RecurringDatePickerInput.d.ts +0 -2
  56. package/dist/recurring-date-picker-input/RecurringDatePickerInput.d.ts.map +1 -1
  57. package/dist/recurring-date-picker-input/RecurringDatePickerInput.js +1 -1
  58. package/dist/sales/booking/results/components/ResultCard.d.ts.map +1 -1
  59. package/dist/sortable-list/SortableList.d.ts +1 -2
  60. package/dist/sortable-list/SortableList.d.ts.map +1 -1
  61. package/dist/sortable-list/SortableList.js +1 -1
  62. package/dist/sortable-tree/SortableTreeItem.d.ts +1 -3
  63. package/dist/sortable-tree/SortableTreeItem.d.ts.map +1 -1
  64. package/dist/sortable-tree/SortableTreeItem.js +1 -1
  65. package/dist/static/manual-date-picker/ManualDatePicker.js +1 -1
  66. package/dist/static/manual-date-picker/constants/index.d.ts +1 -4
  67. package/dist/static/manual-date-picker/constants/index.d.ts.map +1 -1
  68. package/dist/static/manual-date-picker/constants/index.js +1 -1
  69. package/dist/static/manual-date-picker/utils/index.d.ts +0 -4
  70. package/dist/static/manual-date-picker/utils/index.d.ts.map +1 -1
  71. package/dist/static/manual-date-picker/utils/index.js +1 -1
  72. package/dist/styles/availability-indicator/AvailabilityIndicator.scss +0 -10
  73. package/dist/styles/iframe-events/Card.scss +8 -24
  74. package/dist/styles/iframe-events/PoweredBy.scss +2 -2
  75. package/dist/styles/iframe-order-process/IframeOrderProcess.scss +2 -0
  76. package/dist/styles/iframe-page/Page.scss +0 -1
  77. package/dist/styles/iframe-page/PageBody.scss +11 -32
  78. package/dist/styles/iframe-page/PageHeader.scss +39 -41
  79. package/dist/styles/product-set/EditVenueMapSetModal.scss +1 -1
  80. package/dist/styles/sales/BookingResults.scss +1 -1
  81. package/package.json +3 -3
  82. package/src/calendar/Calendar.stories.tsx +2 -9
  83. package/src/iframe/event/event-card/IframeEventCard.stories.tsx +0 -1
  84. package/src/iframe/event/event-card/IframeEventCard.tsx +8 -7
  85. package/src/iframe/order-process/components/CategoryProduct/components/NumberInput/NumberInput.tsx +10 -30
  86. package/src/iframe/order-process/components/CategoryProduct/components/ProductQuantityInput/ProductQuantityInput.tsx +12 -8
  87. package/src/iframe/page/components/PageBody/components/LeftBlock/LeftBlock.tsx +1 -3
  88. package/src/iframe/payment/order-items-table/utils/paymentSummary.tsx +1 -6
  89. package/src/product-set/card/ProductSetCard.tsx +1 -10
  90. package/src/product-set/control/ProductSetControl.tsx +24 -46
  91. package/src/product-set/control/TutorialGifCard.tsx +3 -11
  92. package/src/product-set/form/ProductCategoriesControl.tsx +1 -12
  93. package/src/product-set/form/ProductSetForm.tsx +1 -10
  94. package/src/product-set/form/ProductsControl.tsx +0 -10
  95. package/src/product-set/form/StepsControl.tsx +2 -8
  96. package/src/product-set/form/SubProductsControl.tsx +0 -3
  97. package/src/product-set/hooks/useSortableTreeFunctions.ts +0 -4
  98. package/src/product-set/item/CreateProductSetItem.tsx +0 -3
  99. package/src/product-set/product/ProductControl.tsx +12 -23
  100. package/src/product-set/product/fixed-duration-fields/FixedDurationOptions.tsx +2 -10
  101. package/src/product-set/product/quantity/ProductQuantityControl.tsx +3 -4
  102. package/src/product-set/product-category/ProductCategoryControl.tsx +8 -12
  103. package/src/recurring-date-picker-input/RecurringDatePickerInput.tsx +1 -4
  104. package/src/sales/booking/results/components/ResultCard.tsx +3 -0
  105. package/src/sortable-list/SortableList.tsx +0 -3
  106. package/src/sortable-tree/SortableTreeItem.tsx +1 -7
  107. package/src/static/manual-date-picker/ManualDatePicker.tsx +3 -3
  108. package/src/static/manual-date-picker/constants/index.ts +2 -6
  109. package/src/static/manual-date-picker/utils/index.ts +0 -11
  110. package/src/static/switch/BooleanSwitch.tsx +1 -1
  111. package/src/styles/availability-indicator/AvailabilityIndicator.scss +0 -10
  112. package/src/styles/iframe-events/Card.scss +8 -24
  113. package/src/styles/iframe-events/PoweredBy.scss +2 -2
  114. package/src/styles/iframe-order-process/IframeOrderProcess.scss +2 -0
  115. package/src/styles/iframe-page/Page.scss +0 -1
  116. package/src/styles/iframe-page/PageBody.scss +11 -32
  117. package/src/styles/iframe-page/PageHeader.scss +39 -41
  118. package/src/styles/product-set/EditVenueMapSetModal.scss +1 -1
  119. package/src/styles/sales/BookingResults.scss +1 -1
  120. package/dist/product-set/control/DateInput.d.ts +0 -17
  121. package/dist/product-set/control/DateInput.d.ts.map +0 -1
  122. package/dist/product-set/control/DateInput.js +0 -1
  123. package/dist/product-set/control/ProductSetRecurrenceOverridesControl.d.ts +0 -11
  124. package/dist/product-set/control/ProductSetRecurrenceOverridesControl.d.ts.map +0 -1
  125. package/dist/product-set/control/ProductSetRecurrenceOverridesControl.js +0 -1
  126. package/dist/recurring-date-picker-input/DatePickerInput.d.ts +0 -19
  127. package/dist/recurring-date-picker-input/DatePickerInput.d.ts.map +0 -1
  128. package/dist/recurring-date-picker-input/DatePickerInput.js +0 -1
  129. package/dist/recurring-date-picker-input/RecurrenceAndFrequencyInput.d.ts +0 -15
  130. package/dist/recurring-date-picker-input/RecurrenceAndFrequencyInput.d.ts.map +0 -1
  131. package/dist/recurring-date-picker-input/RecurrenceAndFrequencyInput.js +0 -1
  132. package/src/product-set/control/DateInput.tsx +0 -311
  133. package/src/product-set/control/ProductSetRecurrenceOverridesControl.tsx +0 -63
  134. package/src/recurring-date-picker-input/DatePickerInput.tsx +0 -93
  135. package/src/recurring-date-picker-input/RecurrenceAndFrequencyInput.tsx +0 -137
@@ -1,137 +0,0 @@
1
- import React, { useEffect } from "react";
2
- import { DateTime } from "luxon";
3
- import { Col, Form, Row } from "react-bootstrap";
4
- import { useTranslation } from "react-i18next";
5
- import { RegisterOptions, useFormContext } from "react-hook-form";
6
- import { RecurringDatePickerInputValues } from "./RecurringDatePickerInput";
7
-
8
- interface RecurrenceIntervalAndFrequencyInputProps {
9
- disabled?: boolean;
10
- minDate?: string;
11
- startDateLabel?: string;
12
- startTimeLabel?: string;
13
- endDateLabel?: string;
14
- endTimeLabel?: string;
15
- startTimeRules?: Pick<
16
- RegisterOptions,
17
- "max" | "min" | "validate" | "required" | "pattern"
18
- >;
19
- endTimeRules?: Pick<
20
- RegisterOptions,
21
- "max" | "min" | "validate" | "required" | "pattern"
22
- >;
23
- }
24
-
25
- function RecurrenceAndFrequencyInput({
26
- disabled = false,
27
- minDate,
28
- startDateLabel,
29
- startTimeLabel,
30
- endTimeLabel,
31
- startTimeRules,
32
- endTimeRules,
33
- }: RecurrenceIntervalAndFrequencyInputProps) {
34
- const { t } = useTranslation(["Design", "Notification", "App"]);
35
-
36
- const {
37
- getValues,
38
- formState: { errors },
39
- register,
40
- trigger,
41
- } = useFormContext<RecurringDatePickerInputValues>();
42
-
43
- const startDate = getValues("startDate");
44
- const startTime = getValues("startTime");
45
- const endTime = getValues("endTime");
46
-
47
- useEffect(() => {
48
- if (!startTime || !endTime) {
49
- return;
50
- }
51
- trigger("endTime");
52
- // eslint-disable-next-line react-hooks/exhaustive-deps
53
- }, [startTime]);
54
-
55
- return (
56
- <>
57
- <Row>
58
- <Col xs={12} sm={6}>
59
- <Form.Group>
60
- <Form.Label>{startDateLabel ?? t("Design:fromDate")}</Form.Label>
61
- <Form.Control
62
- type="date"
63
- {...register("startDate", { required: true })}
64
- defaultValue={startDate}
65
- className={startDate && "date-input-with-value"}
66
- disabled={disabled}
67
- min={minDate}
68
- isInvalid={Boolean(errors.startDate)}
69
- />
70
- <Form.Control.Feedback type="invalid">
71
- {errors.startDate?.message}
72
- </Form.Control.Feedback>
73
- </Form.Group>
74
- </Col>
75
-
76
- </Row>
77
-
78
- <Row>
79
- <Col xs={12} sm={6}>
80
- <Form.Group>
81
- <Form.Label>
82
- {startTimeLabel ?? t("Design:availableFrom")}
83
- </Form.Label>
84
- <Form.Control
85
- type="time"
86
- {...register("startTime", { required: false, ...startTimeRules })}
87
- placeholder="hh:mm"
88
- defaultValue={startTime}
89
- disabled={disabled}
90
- isInvalid={Boolean(errors.startTime)}
91
- />
92
- <Form.Control.Feedback type="invalid">
93
- {errors.startTime?.message}
94
- </Form.Control.Feedback>
95
- </Form.Group>
96
- </Col>
97
-
98
- <Col xs={12} sm={6}>
99
- <Form.Group>
100
- <Form.Label>{endTimeLabel ?? t("Design:availableTo")}</Form.Label>
101
- <Form.Control
102
- type="time"
103
- {...register("endTime", {
104
- required: false,
105
- validate: (time) => {
106
- if (!startTime || !time) {
107
- return true;
108
- }
109
- const currentStartTime = DateTime.fromISO(startTime);
110
- const currentEndTime = DateTime.fromISO(time);
111
-
112
- return currentEndTime?.diff(currentStartTime, ["minutes"])
113
- ?.minutes >= 0
114
- ? true
115
- : `${t(`Validation:fieldLaterDate`, {
116
- attribute: t("Design:endTimeSmall"),
117
- min: t("Design:startTimeSmall"),
118
- })}`;
119
- },
120
- ...endTimeRules,
121
- })}
122
- placeholder="hh:mm"
123
- defaultValue={endTime}
124
- disabled={disabled}
125
- isInvalid={Boolean(errors.endTime)}
126
- />
127
- <Form.Control.Feedback type="invalid">
128
- {errors.endTime?.message}
129
- </Form.Control.Feedback>
130
- </Form.Group>
131
- </Col>
132
- </Row>
133
- </>
134
- );
135
- }
136
-
137
- export default RecurrenceAndFrequencyInput;