@happychef/reservation-sidebar 1.0.0 → 2.0.1

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/index.js CHANGED
@@ -621,11 +621,11 @@ var require_moment = __commonJS({
621
621
  }
622
622
  }
623
623
  function toInt(argumentForCoercion) {
624
- var coercedNumber = +argumentForCoercion, value = 0;
624
+ var coercedNumber = +argumentForCoercion, value2 = 0;
625
625
  if (coercedNumber !== 0 && isFinite(coercedNumber)) {
626
- value = absFloor(coercedNumber);
626
+ value2 = absFloor(coercedNumber);
627
627
  }
628
- return value;
628
+ return value2;
629
629
  }
630
630
  var tokens = {};
631
631
  function addParseToken(token2, callback) {
@@ -694,9 +694,9 @@ var require_moment = __commonJS({
694
694
  return isLeapYear(this.year());
695
695
  }
696
696
  function makeGetSet(unit, keepTime) {
697
- return function(value) {
698
- if (value != null) {
699
- set$1(this, unit, value);
697
+ return function(value2) {
698
+ if (value2 != null) {
699
+ set$1(this, unit, value2);
700
700
  hooks.updateOffset(this, keepTime);
701
701
  return this;
702
702
  } else {
@@ -730,24 +730,24 @@ var require_moment = __commonJS({
730
730
  return NaN;
731
731
  }
732
732
  }
733
- function set$1(mom, unit, value) {
733
+ function set$1(mom, unit, value2) {
734
734
  var d, isUTC, year, month, date;
735
- if (!mom.isValid() || isNaN(value)) {
735
+ if (!mom.isValid() || isNaN(value2)) {
736
736
  return;
737
737
  }
738
738
  d = mom._d;
739
739
  isUTC = mom._isUTC;
740
740
  switch (unit) {
741
741
  case "Milliseconds":
742
- return void (isUTC ? d.setUTCMilliseconds(value) : d.setMilliseconds(value));
742
+ return void (isUTC ? d.setUTCMilliseconds(value2) : d.setMilliseconds(value2));
743
743
  case "Seconds":
744
- return void (isUTC ? d.setUTCSeconds(value) : d.setSeconds(value));
744
+ return void (isUTC ? d.setUTCSeconds(value2) : d.setSeconds(value2));
745
745
  case "Minutes":
746
- return void (isUTC ? d.setUTCMinutes(value) : d.setMinutes(value));
746
+ return void (isUTC ? d.setUTCMinutes(value2) : d.setMinutes(value2));
747
747
  case "Hours":
748
- return void (isUTC ? d.setUTCHours(value) : d.setHours(value));
748
+ return void (isUTC ? d.setUTCHours(value2) : d.setHours(value2));
749
749
  case "Date":
750
- return void (isUTC ? d.setUTCDate(value) : d.setDate(value));
750
+ return void (isUTC ? d.setUTCDate(value2) : d.setDate(value2));
751
751
  // case 'Day': // Not real
752
752
  // return void (isUTC ? d.setUTCDay(value) : d.setDay(value));
753
753
  // case 'Month': // Not used because we need to pass two variables
@@ -758,7 +758,7 @@ var require_moment = __commonJS({
758
758
  default:
759
759
  return;
760
760
  }
761
- year = value;
761
+ year = value2;
762
762
  month = mom.month();
763
763
  date = mom.date();
764
764
  date = date === 29 && month === 1 && !isLeapYear(year) ? 28 : date;
@@ -771,7 +771,7 @@ var require_moment = __commonJS({
771
771
  }
772
772
  return this;
773
773
  }
774
- function stringSet(units, value) {
774
+ function stringSet(units, value2) {
775
775
  if (typeof units === "object") {
776
776
  units = normalizeObjectUnits(units);
777
777
  var prioritized = getPrioritizedUnits(units), i, prioritizedLen = prioritized.length;
@@ -781,7 +781,7 @@ var require_moment = __commonJS({
781
781
  } else {
782
782
  units = normalizeUnits(units);
783
783
  if (isFunction(this[units])) {
784
- return this[units](value);
784
+ return this[units](value2);
785
785
  }
786
786
  }
787
787
  return this;
@@ -930,28 +930,28 @@ var require_moment = __commonJS({
930
930
  }
931
931
  }
932
932
  }
933
- function setMonth(mom, value) {
933
+ function setMonth(mom, value2) {
934
934
  if (!mom.isValid()) {
935
935
  return mom;
936
936
  }
937
- if (typeof value === "string") {
938
- if (/^\d+$/.test(value)) {
939
- value = toInt(value);
937
+ if (typeof value2 === "string") {
938
+ if (/^\d+$/.test(value2)) {
939
+ value2 = toInt(value2);
940
940
  } else {
941
- value = mom.localeData().monthsParse(value);
942
- if (!isNumber(value)) {
941
+ value2 = mom.localeData().monthsParse(value2);
942
+ if (!isNumber(value2)) {
943
943
  return mom;
944
944
  }
945
945
  }
946
946
  }
947
- var month = value, date = mom.date();
947
+ var month = value2, date = mom.date();
948
948
  date = date < 29 ? date : Math.min(date, daysInMonth(mom.year(), month));
949
949
  void (mom._isUTC ? mom._d.setUTCMonth(month, date) : mom._d.setMonth(month, date));
950
950
  return mom;
951
951
  }
952
- function getSetMonth(value) {
953
- if (value != null) {
954
- setMonth(this, value);
952
+ function getSetMonth(value2) {
953
+ if (value2 != null) {
954
+ setMonth(this, value2);
955
955
  hooks.updateOffset(this, true);
956
956
  return this;
957
957
  } else {
@@ -3728,18 +3728,18 @@ var require_moment = __commonJS({
3728
3728
  data.years = mathAbs(data.years);
3729
3729
  return this;
3730
3730
  }
3731
- function addSubtract$1(duration, input, value, direction) {
3732
- var other = createDuration(input, value);
3731
+ function addSubtract$1(duration, input, value2, direction) {
3732
+ var other = createDuration(input, value2);
3733
3733
  duration._milliseconds += direction * other._milliseconds;
3734
3734
  duration._days += direction * other._days;
3735
3735
  duration._months += direction * other._months;
3736
3736
  return duration._bubble();
3737
3737
  }
3738
- function add$1(input, value) {
3739
- return addSubtract$1(this, input, value, 1);
3738
+ function add$1(input, value2) {
3739
+ return addSubtract$1(this, input, value2, 1);
3740
3740
  }
3741
- function subtract$1(input, value) {
3742
- return addSubtract$1(this, input, value, -1);
3741
+ function subtract$1(input, value2) {
3742
+ return addSubtract$1(this, input, value2, -1);
3743
3743
  }
3744
3744
  function absCeil(number) {
3745
3745
  if (number < 0) {
@@ -4163,7 +4163,7 @@ function styleInject(css, { insertAt } = {}) {
4163
4163
  // src/components/ReservationStepOne/css/reservationMode.css
4164
4164
  styleInject(".new-reservation-page .form-row .field-label {\n display: block;\n margin-bottom: 6px;\n font-weight: 600;\n}\n.new-reservation-page .form-row .reservation-mode-buttons {\n margin-top: 0;\n}\n.new-reservation-page .reservation-mode-buttons {\n display: flex;\n gap: 10px;\n margin-top: 10px;\n}\n.new-reservation-page .reservation-mode-button {\n flex: 1;\n padding: 10px;\n border: 1px solid #ccc;\n border-radius: var(--border-radius);\n background-color: var(--color-white);\n cursor: pointer;\n font-size: 1rem;\n transition: background-color 0.3s ease, color 0.3s ease;\n}\n.new-reservation-page .reservation-mode-button.active,\n.new-reservation-page .reservation-mode-button:hover {\n background-color: var(--color-blue);\n color: var(--color-white);\n}\n.new-reservation-page .reservation-modes-container {\n display: flex;\n flex-wrap: wrap;\n margin: 0 -5px;\n width: 100%;\n}\n.new-reservation-page .reservation-mode-button {\n flex: 0 0 calc(50% - 10px);\n margin: 5px;\n padding: 10px;\n box-sizing: border-box;\n text-align: center;\n border: 1px solid #ccc;\n background: #f7f7f7;\n cursor: pointer;\n}\n.new-reservation-page .reservation-mode-button:nth-child(3) {\n flex: 0 0 100%;\n}\n.new-reservation-page .reservation-modes-container {\n display: flex;\n flex-wrap: wrap;\n margin: 0 -5px;\n width: 100%;\n}\n.new-reservation-page .reservation-mode-button {\n flex: 0 0 calc(50% - 10px);\n margin: 5px;\n padding: 10px;\n box-sizing: border-box;\n text-align: center;\n border: 1px solid #ccc;\n background: #f7f7f7;\n cursor: pointer;\n}\n.new-reservation-page .reservation-mode-button.active,\n.new-reservation-page .reservation-mode-button:hover {\n background-color: var(--color-blue);\n color: var(--color-white);\n}\n.new-reservation-page .unlimited-mode-warning {\n display: flex;\n align-items: flex-start;\n gap: 10px;\n margin: 15px 0;\n padding: 12px 15px;\n background-color: #fff3cd;\n border: 1px solid #ffeaa7;\n border-radius: var(--border-radius, 4px);\n border-left: 4px solid #e67e22;\n font-size: 0.9rem;\n line-height: 1.4;\n}\n.new-reservation-page .unlimited-mode-warning .warning-icon {\n color: #e67e22;\n font-size: 1.1rem;\n margin-top: 2px;\n flex-shrink: 0;\n}\n.new-reservation-page .unlimited-mode-warning .warning-text {\n color: #856404;\n margin: 0;\n}\n@media screen and (max-width: 480px) {\n .new-reservation-page .unlimited-mode-warning {\n margin: 10px 0;\n padding: 10px 12px;\n font-size: 0.85rem;\n }\n .new-reservation-page .unlimited-mode-warning .warning-icon {\n font-size: 1rem;\n }\n}\n.new-reservation-page .reservation-sidebar-component {\n position: fixed;\n top: 0;\n right: -400px;\n width: 400px;\n height: 100%;\n background-color: #fff;\n box-shadow: -2px 0 5px rgba(0, 0, 0, 0.1);\n z-index: var(--z-index-sidebar-reservation);\n display: flex;\n flex-direction: column;\n overflow-y: auto;\n transition: right 0.3s ease-in-out;\n}\n.new-reservation-page .admin-title {\n text-align: center;\n margin-bottom: 30px;\n}\n.new-reservation-page .reservation-sidebar-component.open {\n right: 0;\n}\n.new-reservation-page .reservation-sidebar-content {\n padding: 20px;\n padding-top: 60px;\n}\n.new-reservation-page .close-sidebar-button {\n position: absolute;\n top: 10px;\n left: 10px;\n background-color: transparent;\n border: none;\n cursor: pointer;\n}\n.new-reservation-page .close-sidebar-button svg {\n color: #000;\n}\n.new-reservation-page .sidebar-section-one,\n.new-reservation-page .sidebar-section-two {\n margin-bottom: 20px;\n}\n.new-reservation-page .reservation-footer {\n margin-top: auto;\n}\n.new-reservation-page .store-reservation-button {\n width: 100%;\n padding: 12px;\n background-color: var(--color-blue);\n color: #fff;\n border: none;\n border-radius: 5px;\n cursor: pointer;\n font-size: 1.1rem;\n}\n.new-reservation-page .open-sidebar-button {\n position: fixed;\n bottom: 20px;\n right: 20px;\n background-color: var(--color-blue);\n color: #fff;\n border: none;\n border-radius: 50%;\n width: 50px;\n height: 50px;\n cursor: pointer;\n z-index: var(--z-index-modal) !important;\n transition: all 0.3s ease;\n}\n.new-reservation-page .open-sidebar-button:hover {\n background-color: var(--color-blue-hover-accent) !important;\n}\n.new-reservation-page .open-sidebar-button svg {\n position: relative;\n top: 2px;\n}\n@media screen and (max-width: 480px) {\n .new-reservation-page .reservation-sidebar-component {\n width: 100%;\n }\n}\n.new-reservation-page .sidebar-section-personeel {\n margin-bottom: 10px;\n}\n");
4165
4165
 
4166
- // src/components/ReservationStepOne/ReservationStepOne.tsx
4166
+ // src/components/ReservationStepOne/ReservationStepOne.js
4167
4167
  var ReservationStepOne = ({
4168
4168
  formData,
4169
4169
  errors,
@@ -4209,7 +4209,7 @@ var ReservationStepOne = ({
4209
4209
  };
4210
4210
  var ReservationStepOne_default = ReservationStepOne;
4211
4211
 
4212
- // src/utils/translations.ts
4212
+ // src/utils/translations.js
4213
4213
  var getPreferredLanguage = () => {
4214
4214
  return localStorage.getItem("preferredLanguage") || "nl";
4215
4215
  };
@@ -4256,13 +4256,13 @@ var translations_default = {
4256
4256
  // src/components/FormField/formField.css
4257
4257
  styleInject(".new-reservation-page .form-group .magic-tooltip {\n transition: transform 0.2s ease;\n transform-origin: bottom right;\n}\n.new-reservation-page .form-group .magic-tooltip:hover {\n transform: scale(1.05);\n}\n");
4258
4258
 
4259
- // src/components/FormField/FormField.tsx
4259
+ // src/components/FormField/FormField.js
4260
4260
  var FormField = ({
4261
4261
  label,
4262
4262
  name,
4263
4263
  type = "text",
4264
- icon: Icon,
4265
- value,
4264
+ icon,
4265
+ value: value2,
4266
4266
  onChange,
4267
4267
  onBlur,
4268
4268
  error,
@@ -4270,16 +4270,16 @@ var FormField = ({
4270
4270
  halfWidth,
4271
4271
  options = [],
4272
4272
  selectPlaceholder,
4273
- rightIcon,
4274
- onRightIconClick,
4273
+ rightIcon: rightIcon2,
4274
+ onRightIconClick: onRightIconClick2,
4275
4275
  tooltipContent
4276
4276
  }) => {
4277
4277
  const t = getSection(translations_default, "formField");
4278
4278
  const selectPlaceholderText = selectPlaceholder || t.selectPlaceholder;
4279
4279
  const [showTooltip, setShowTooltip] = React4.useState(false);
4280
- const tooltipRef = React4.useRef(null);
4281
- const timerRef = React4.useRef(null);
4282
- const RightIconComponent = rightIcon;
4280
+ const tooltipRef = React4.useRef < HTMLDivElement > null;
4281
+ const timerRef = React4.useRef < NodeJS.Timeout | null > null;
4282
+ const RightIconComponent = rightIcon2;
4283
4283
  React4.useEffect(() => {
4284
4284
  const handleClickOutside = (e) => {
4285
4285
  if (tooltipRef.current && !tooltipRef.current.contains(e.target)) {
@@ -4292,7 +4292,7 @@ var FormField = ({
4292
4292
  }, [showTooltip]);
4293
4293
  const baseControlProps = {
4294
4294
  name,
4295
- value,
4295
+ value: value2,
4296
4296
  onChange,
4297
4297
  onBlur,
4298
4298
  "aria-label": label,
@@ -4316,7 +4316,7 @@ var FormField = ({
4316
4316
  "div",
4317
4317
  {
4318
4318
  className: "magic-wand-container",
4319
- onClick: onRightIconClick,
4319
+ onClick: onRightIconClick2,
4320
4320
  onMouseEnter: () => {
4321
4321
  if (timerRef.current) clearTimeout(timerRef.current);
4322
4322
  setShowTooltip(true);
@@ -4347,13 +4347,13 @@ var FormField = ({
4347
4347
  style: {
4348
4348
  position: "absolute",
4349
4349
  bottom: "100%",
4350
- right: 0,
4350
+ right,
4351
4351
  backgroundColor: "#fff",
4352
4352
  color: "#333",
4353
4353
  borderRadius: "8px",
4354
4354
  fontSize: "0.9rem",
4355
4355
  boxShadow: "0px 4px 10px rgba(0,0,0,0.15)",
4356
- zIndex: 10,
4356
+ zIndex,
4357
4357
  marginBottom: "8px",
4358
4358
  minWidth: "220px",
4359
4359
  overflow: "hidden"
@@ -4365,13 +4365,13 @@ var FormField = ({
4365
4365
  className: "lottie-container",
4366
4366
  style: {
4367
4367
  position: "absolute",
4368
- top: 0,
4368
+ top,
4369
4369
  right: "1px",
4370
4370
  width: "calc(100% + 30px)",
4371
4371
  height: "100%",
4372
4372
  marginRight: "-100px",
4373
4373
  pointerEvents: "none",
4374
- zIndex: 0
4374
+ zIndex
4375
4375
  }
4376
4376
  },
4377
4377
  /* @__PURE__ */ React4__default.default.createElement(
@@ -4383,7 +4383,7 @@ var FormField = ({
4383
4383
  }
4384
4384
  )
4385
4385
  ),
4386
- /* @__PURE__ */ React4__default.default.createElement("div", { style: { position: "relative", zIndex: 1, padding: "12px 20px" } }, /* @__PURE__ */ React4__default.default.createElement(
4386
+ /* @__PURE__ */ React4__default.default.createElement("div", { style: { position: "relative", zIndex, padding: "12px 20px" } }, /* @__PURE__ */ React4__default.default.createElement(
4387
4387
  "div",
4388
4388
  {
4389
4389
  style: {
@@ -4423,7 +4423,7 @@ var FormField = ({
4423
4423
  };
4424
4424
  var FormField_default = FormField;
4425
4425
 
4426
- // src/components/ReservationStepTwo/ReservationStepTwo.tsx
4426
+ // src/components/ReservationStepTwo/ReservationStepTwo.js
4427
4427
  var import_moment = __toESM(require_moment());
4428
4428
  __toESM(require_nl());
4429
4429
  var useApi = () => {
@@ -4453,7 +4453,7 @@ var useApi = () => {
4453
4453
  const token = getJwtToken();
4454
4454
  return axios__default.default({
4455
4455
  method,
4456
- url: endpoint,
4456
+ url,
4457
4457
  data,
4458
4458
  ...config,
4459
4459
  headers: {
@@ -4608,7 +4608,7 @@ var translations_default2 = {
4608
4608
  // src/components/ReservationStepTwo/reservationStepTwo.css
4609
4609
  styleInject(".new-reservation-page .name-fields {\n display: flex;\n gap: 20px;\n}\n.input-container .form-control {\n display: flex;\n align-items: center;\n justify-content: space-between;\n width: 100%;\n padding: 10px;\n background-color: #fff;\n border: #ccc 1px solid;\n cursor: pointer;\n -webkit-user-select: none;\n user-select: none;\n text-align: left;\n border-radius: 5px;\n font-size: 16px;\n}\n");
4610
4610
 
4611
- // src/components/ReservationStepTwo/ReservationStepTwo.tsx
4611
+ // src/components/ReservationStepTwo/ReservationStepTwo.js
4612
4612
  var ReservationStepTwo = ({
4613
4613
  formData,
4614
4614
  errors,
@@ -4671,26 +4671,14 @@ var ReservationStepTwo = ({
4671
4671
  React4.useEffect(() => {
4672
4672
  tryAutofill();
4673
4673
  }, [formData.email, formData.phone]);
4674
- const applyAutofill = () => {
4675
- if (!pendingAutofill) return;
4676
- setFormData((prev) => ({
4677
- ...prev,
4678
- firstName: pendingAutofill.firstName,
4679
- lastName: pendingAutofill.lastName,
4680
- email: pendingAutofill.email,
4681
- phone: pendingAutofill.phone
4682
- }));
4683
- setHasAutofilled(true);
4684
- setPendingAutofill(null);
4685
- };
4686
4674
  const magicProps = React4.useMemo(() => {
4687
4675
  if (!pendingAutofill)
4688
4676
  return { email: {}, phone: {} };
4689
4677
  const emailActive = pendingAutofill.sources.includes("email") && (formData.email || "").trim().toLowerCase() === pendingAutofill.email.trim().toLowerCase();
4690
4678
  const phoneActive = pendingAutofill.sources.includes("phone") && (formData.phone || "").trim() === pendingAutofill.phone.trim();
4691
4679
  const common = {
4692
- rightIcon: fa.FaMagic,
4693
- onRightIconClick: applyAutofill
4680
+ rightIcon,
4681
+ onRightIconClick
4694
4682
  };
4695
4683
  return {
4696
4684
  email: emailActive ? {
@@ -4907,7 +4895,7 @@ var translations_default3 = {
4907
4895
  // src/components/ReservationSummary/reservationSummary.css
4908
4896
  styleInject(".new-reservation-page .reservation-sidebar-component .reservation-summary .modal-title {\n margin-top: 0;\n margin-bottom: 20px;\n}\n.new-reservation-page .reservation-sidebar-component .reservation-summary .reservation-details {\n list-style-type: none;\n padding: 0;\n margin: 0 0 20px 0;\n width: 100%;\n}\n.new-reservation-page .reservation-sidebar-component .reservation-summary .reservation-details li {\n margin-bottom: 10px;\n font-size: 15px;\n align-items: left;\n text-align: left;\n}\n.new-reservation-page .reservation-sidebar-component .reservation-summary .reservation-details li strong {\n font-weight: bold;\n}\n.new-reservation-page .reservation-sidebar-component .reservation-summary {\n align-items: left;\n}\n");
4909
4897
 
4910
- // src/components/ReservationSummary/ReservationSummary.tsx
4898
+ // src/components/ReservationSummary/ReservationSummary.js
4911
4899
  var ReservationSummary = ({
4912
4900
  formData,
4913
4901
  onNewReservation
@@ -4954,7 +4942,7 @@ var translations_default4 = {
4954
4942
  // src/components/GiftcardSelection/giftcardSelection.css
4955
4943
  styleInject(".new-reservation-page .giftcard-selection {\n margin-bottom: 20px;\n}\n.new-reservation-page .giftcard-options {\n display: flex;\n gap: 20px;\n margin: 10px 0;\n}\n.new-reservation-page .giftcard-option {\n display: flex;\n align-items: center;\n gap: 8px;\n cursor: pointer;\n}\n.new-reservation-page .form-label {\n font-weight: 500;\n margin-bottom: 8px;\n display: block;\n}\n.new-reservation-page .giftcard-option input[type=radio] {\n margin: 0;\n cursor: pointer;\n}\n.new-reservation-page .giftcard-option label {\n cursor: pointer;\n}\n");
4956
4944
 
4957
- // src/components/GiftcardSelection/GiftcardSelection.tsx
4945
+ // src/components/GiftcardSelection/GiftcardSelection.js
4958
4946
  var GiftcardSelection = ({
4959
4947
  restaurantData,
4960
4948
  formData,
@@ -4978,7 +4966,7 @@ var GiftcardSelection = ({
4978
4966
  setAvailableGiftcards([...cards]);
4979
4967
  }, [restaurantData]);
4980
4968
  if (!availableGiftcards.length) return null;
4981
- const options = availableGiftcards.map((card) => ({ value: card, label: card }));
4969
+ const options = availableGiftcards.map((card) => ({ value, label: card }));
4982
4970
  const onChange = (e) => {
4983
4971
  handleChange({ target: { name: "giftcard", value: e.target.value } });
4984
4972
  resetFormDataFields(["date", "time"]);
@@ -5035,7 +5023,7 @@ var translations_default5 = {
5035
5023
  // src/components/ZitplaatsSelection/zitplaatsSelection.css
5036
5024
  styleInject(".new-reservation-page .zitplaats-selection {\n margin-bottom: 15px;\n}\n.new-reservation-page .zitplaats-selection select {\n width: 100%;\n padding: 10px;\n border-radius: 4px;\n border: 1px solid #ccc;\n background-color: white;\n}\n");
5037
5025
 
5038
- // src/components/ZitplaatsSelection/ZitplaatsSelection.tsx
5026
+ // src/components/ZitplaatsSelection/ZitplaatsSelection.js
5039
5027
  var ZitplaatsSelection = ({
5040
5028
  restaurantData,
5041
5029
  formData,
@@ -5053,8 +5041,8 @@ var ZitplaatsSelection = ({
5053
5041
  setAvailableZitplaatsen([...set].sort());
5054
5042
  }, [restaurantData]);
5055
5043
  const handleZitplaatsChange = (e) => {
5056
- const { value } = e.target;
5057
- handleChange({ target: { name: "zitplaats", value } });
5044
+ const { value: value2 } = e.target;
5045
+ handleChange({ target: { name: "zitplaats", value: value2 } });
5058
5046
  resetFormDataFields(["date", "time", "selectedTableNumbers", "selectedTableIds"]);
5059
5047
  };
5060
5048
  const tableSettings = restaurantData?.["table-settings"] || {};
@@ -5106,9 +5094,9 @@ var translationsReservationSidebar_default = {
5106
5094
  };
5107
5095
 
5108
5096
  // src/styles/reservationSidebar.css
5109
- styleInject(".new-reservation-page .reservation-sidebar-component {\n position: fixed;\n top: 0;\n right: -400px;\n width: 400px;\n height: 100%;\n background-color: #fff;\n box-shadow: -2px 0 5px rgba(0, 0, 0, 0.1);\n z-index: var(--z-index-sidebar-reservation);\n display: flex;\n flex-direction: column;\n overflow-y: auto;\n transition: right 0.3s ease-in-out;\n}\n.new-reservation-page .admin-title {\n text-align: center;\n margin-bottom: 30px;\n}\n.new-reservation-page .reservation-sidebar-component.open {\n right: 0;\n}\n.new-reservation-page .reservation-sidebar-content {\n padding: 20px;\n padding-top: 60px;\n}\n.new-reservation-page .close-sidebar-button {\n position: absolute;\n top: 10px;\n left: 10px;\n background-color: transparent;\n border: none;\n cursor: pointer;\n}\n.new-reservation-page .close-sidebar-button svg {\n color: #000;\n}\n.new-reservation-page .sidebar-section-one,\n.new-reservation-page .sidebar-section-two {\n margin-bottom: 20px;\n}\n.new-reservation-page .reservation-footer {\n margin-top: auto;\n}\n.new-reservation-page .store-reservation-button {\n width: 100%;\n padding: 12px;\n background-color: var(--color-blue);\n color: #fff;\n border: none;\n border-radius: 5px;\n cursor: pointer;\n font-size: 1.1rem;\n}\n.new-reservation-page .open-sidebar-button {\n position: fixed;\n bottom: 20px;\n right: 20px;\n background-color: var(--color-blue);\n color: #fff;\n border: none;\n border-radius: 50%;\n width: 50px;\n height: 50px;\n cursor: pointer;\n z-index: var(--z-index-modal) !important;\n transition: all 0.3s ease;\n}\n.new-reservation-page .open-sidebar-button:hover {\n background-color: var(--color-blue-hover-accent) !important;\n}\n.new-reservation-page .open-sidebar-button svg {\n position: relative;\n top: 2px;\n}\n@media screen and (max-width: 480px) {\n .new-reservation-page .reservation-sidebar-component {\n width: 100%;\n }\n}\n.new-reservation-page .sidebar-section-personeel {\n margin-bottom: 10px;\n}\n");
5097
+ styleInject(".reservation-sidebar-component {\n position: fixed;\n top: 0;\n right: -400px;\n width: 400px;\n height: 100%;\n background-color: #fff;\n box-shadow: -2px 0 5px rgba(0, 0, 0, 0.1);\n z-index: var(--z-index-sidebar-reservation);\n display: flex;\n flex-direction: column;\n overflow-y: auto;\n transition: right 0.3s ease-in-out;\n}\n.admin-title {\n text-align: center;\n margin-bottom: 30px;\n}\n.reservation-sidebar-component.open {\n right: 0;\n}\n.reservation-sidebar-content {\n padding: 20px;\n padding-top: 60px;\n}\n.close-sidebar-button {\n position: absolute;\n top: 10px;\n left: 10px;\n background-color: transparent;\n border: none;\n cursor: pointer;\n}\n.close-sidebar-button svg {\n color: #000;\n}\n.sidebar-section-one,\n.sidebar-section-two {\n margin-bottom: 20px;\n}\n.reservation-footer {\n margin-top: auto;\n}\n.store-reservation-button {\n width: 100%;\n padding: 12px;\n background-color: var(--color-blue);\n color: #fff;\n border: none;\n border-radius: 5px;\n cursor: pointer;\n font-size: 1.1rem;\n}\n.open-sidebar-button {\n position: fixed;\n bottom: 20px;\n right: 20px;\n background-color: var(--color-blue);\n color: #fff;\n border: none;\n border-radius: 50%;\n width: 50px;\n height: 50px;\n cursor: pointer;\n z-index: var(--z-index-modal) !important;\n transition: all 0.3s ease;\n}\n.open-sidebar-button:hover {\n background-color: var(--color-blue-hover-accent) !important;\n}\n.open-sidebar-button svg {\n position: relative;\n top: 2px;\n}\n@media screen and (max-width: 480px) {\n .reservation-sidebar-component {\n width: 100%;\n }\n}\n.sidebar-section-personeel {\n margin-bottom: 10px;\n}\n");
5110
5098
 
5111
- // src/ReservationSidebar.tsx
5099
+ // src/ReservationSidebar.js
5112
5100
  var ReservationSidebar = ({
5113
5101
  isOpen,
5114
5102
  onClose,
@@ -5155,7 +5143,7 @@ var ReservationSidebar = ({
5155
5143
  const baseDomain = window.baseDomain || "";
5156
5144
  const [data, personeelData] = await Promise.all([
5157
5145
  api.get(`${baseDomain}api/auth-restaurant/`, {
5158
- noCache: true
5146
+ noCache
5159
5147
  }),
5160
5148
  api.get(`${baseDomain}api/personeel`, { noCache: true })
5161
5149
  ]);
@@ -5182,7 +5170,7 @@ var ReservationSidebar = ({
5182
5170
  }, [isOpen, api]);
5183
5171
  const handleNewReservationClick = React4.useCallback(() => {
5184
5172
  setFormData({
5185
- guests: 1,
5173
+ guests,
5186
5174
  date: "",
5187
5175
  time: "",
5188
5176
  firstName: "",
@@ -5194,8 +5182,8 @@ var ReservationSidebar = ({
5194
5182
  personeel: "",
5195
5183
  giftcard: "",
5196
5184
  zitplaats: "",
5197
- selectedTableNumbers: [],
5198
- selectedTableIds: [],
5185
+ selectedTableNumbers,
5186
+ selectedTableIds,
5199
5187
  reservationMode: "met_limieten"
5200
5188
  });
5201
5189
  onNewReservation();
@@ -5239,7 +5227,7 @@ var ReservationSidebar = ({
5239
5227
  type: "select",
5240
5228
  options: availablePersoneel.map((p) => {
5241
5229
  const full = `${p.voornaam} ${p.achternaam}`;
5242
- return { value: full, label: full };
5230
+ return { value, label: full };
5243
5231
  }),
5244
5232
  value: formData.personeel,
5245
5233
  onChange: handleChange,
@@ -5282,7 +5270,7 @@ var ReservationSidebar = ({
5282
5270
  var ReservationSidebar_default = ReservationSidebar;
5283
5271
 
5284
5272
  // src/styles/newReservationAdmin.css
5285
- styleInject(".new-reservation-page .account-manage-title {\n text-align: center;\n margin-bottom: 30px;\n}\n.new-reservation-page .account-manage-container {\n max-width: 800px;\n margin: 0 auto;\n}\n.new-reservation-page .account-manage-form {\n display: flex;\n flex-direction: column;\n gap: 15px;\n}\n.new-reservation-page .input-container {\n position: relative;\n}\n.new-reservation-page .input-icon {\n position: absolute;\n top: 50%;\n left: 10px;\n transform: translateY(-50%);\n color: #6c757d;\n pointer-events: none;\n}\n.new-reservation-page .input-container input,\n.new-reservation-page .input-container textarea {\n width: 100%;\n padding: 10px 10px 10px 35px;\n border: 1px solid #ccc;\n border-radius: 5px;\n font-size: 1rem;\n transition: border-color 0.3s ease;\n}\n.new-reservation-page .form-error {\n color: #dc3545;\n font-size: 0.9rem;\n margin-top: 5px;\n display: flex;\n align-items: center;\n gap: 5px;\n}\n.new-reservation-page .account-manage__button {\n padding: 12px;\n background-color: var(--color-blue);\n color: #fff;\n border: none;\n border-radius: 5px;\n cursor: pointer;\n font-size: 1.1rem;\n display: flex;\n align-items: center;\n justify-content: center;\n gap: 10px;\n transition: background-color 0.3s ease;\n}\n");
5273
+ styleInject(".account-manage-title {\n text-align: center;\n margin-bottom: 30px;\n}\n.account-manage-container {\n max-width: 800px;\n margin: 0 auto;\n}\n.account-manage-form {\n display: flex;\n flex-direction: column;\n gap: 15px;\n}\n.input-container {\n position: relative;\n}\n.input-icon {\n position: absolute;\n top: 50%;\n left: 10px;\n transform: translateY(-50%);\n color: #6c757d;\n pointer-events: none;\n}\n.input-container input,\n.input-container textarea {\n width: 100%;\n padding: 10px 10px 10px 35px;\n border: 1px solid #ccc;\n border-radius: 5px;\n font-size: 1rem;\n transition: border-color 0.3s ease;\n}\n.form-error {\n color: #dc3545;\n font-size: 0.9rem;\n margin-top: 5px;\n display: flex;\n align-items: center;\n gap: 5px;\n}\n.account-manage__button {\n padding: 12px;\n background-color: var(--color-blue);\n color: #fff;\n border: none;\n border-radius: 5px;\n cursor: pointer;\n font-size: 1.1rem;\n display: flex;\n align-items: center;\n justify-content: center;\n gap: 10px;\n transition: background-color 0.3s ease;\n}\n");
5286
5274
  /*! Bundled license information:
5287
5275
 
5288
5276
  moment/moment.js:
package/dist/index.mjs CHANGED
@@ -1,6 +1,6 @@
1
1
  import React4, { useState, useRef, useEffect, useCallback, useMemo } from 'react';
2
2
  import Lottie from 'lottie-react';
3
- import { FaMagic, FaUser, FaEnvelope, FaPhone, FaInfoCircle, FaTimes } from 'react-icons/fa';
3
+ import { FaUser, FaEnvelope, FaPhone, FaInfoCircle, FaTimes } from 'react-icons/fa';
4
4
  import axios from 'axios';
5
5
  import moment2 from 'moment-timezone';
6
6
 
@@ -612,11 +612,11 @@ var require_moment = __commonJS({
612
612
  }
613
613
  }
614
614
  function toInt(argumentForCoercion) {
615
- var coercedNumber = +argumentForCoercion, value = 0;
615
+ var coercedNumber = +argumentForCoercion, value2 = 0;
616
616
  if (coercedNumber !== 0 && isFinite(coercedNumber)) {
617
- value = absFloor(coercedNumber);
617
+ value2 = absFloor(coercedNumber);
618
618
  }
619
- return value;
619
+ return value2;
620
620
  }
621
621
  var tokens = {};
622
622
  function addParseToken(token2, callback) {
@@ -685,9 +685,9 @@ var require_moment = __commonJS({
685
685
  return isLeapYear(this.year());
686
686
  }
687
687
  function makeGetSet(unit, keepTime) {
688
- return function(value) {
689
- if (value != null) {
690
- set$1(this, unit, value);
688
+ return function(value2) {
689
+ if (value2 != null) {
690
+ set$1(this, unit, value2);
691
691
  hooks.updateOffset(this, keepTime);
692
692
  return this;
693
693
  } else {
@@ -721,24 +721,24 @@ var require_moment = __commonJS({
721
721
  return NaN;
722
722
  }
723
723
  }
724
- function set$1(mom, unit, value) {
724
+ function set$1(mom, unit, value2) {
725
725
  var d, isUTC, year, month, date;
726
- if (!mom.isValid() || isNaN(value)) {
726
+ if (!mom.isValid() || isNaN(value2)) {
727
727
  return;
728
728
  }
729
729
  d = mom._d;
730
730
  isUTC = mom._isUTC;
731
731
  switch (unit) {
732
732
  case "Milliseconds":
733
- return void (isUTC ? d.setUTCMilliseconds(value) : d.setMilliseconds(value));
733
+ return void (isUTC ? d.setUTCMilliseconds(value2) : d.setMilliseconds(value2));
734
734
  case "Seconds":
735
- return void (isUTC ? d.setUTCSeconds(value) : d.setSeconds(value));
735
+ return void (isUTC ? d.setUTCSeconds(value2) : d.setSeconds(value2));
736
736
  case "Minutes":
737
- return void (isUTC ? d.setUTCMinutes(value) : d.setMinutes(value));
737
+ return void (isUTC ? d.setUTCMinutes(value2) : d.setMinutes(value2));
738
738
  case "Hours":
739
- return void (isUTC ? d.setUTCHours(value) : d.setHours(value));
739
+ return void (isUTC ? d.setUTCHours(value2) : d.setHours(value2));
740
740
  case "Date":
741
- return void (isUTC ? d.setUTCDate(value) : d.setDate(value));
741
+ return void (isUTC ? d.setUTCDate(value2) : d.setDate(value2));
742
742
  // case 'Day': // Not real
743
743
  // return void (isUTC ? d.setUTCDay(value) : d.setDay(value));
744
744
  // case 'Month': // Not used because we need to pass two variables
@@ -749,7 +749,7 @@ var require_moment = __commonJS({
749
749
  default:
750
750
  return;
751
751
  }
752
- year = value;
752
+ year = value2;
753
753
  month = mom.month();
754
754
  date = mom.date();
755
755
  date = date === 29 && month === 1 && !isLeapYear(year) ? 28 : date;
@@ -762,7 +762,7 @@ var require_moment = __commonJS({
762
762
  }
763
763
  return this;
764
764
  }
765
- function stringSet(units, value) {
765
+ function stringSet(units, value2) {
766
766
  if (typeof units === "object") {
767
767
  units = normalizeObjectUnits(units);
768
768
  var prioritized = getPrioritizedUnits(units), i, prioritizedLen = prioritized.length;
@@ -772,7 +772,7 @@ var require_moment = __commonJS({
772
772
  } else {
773
773
  units = normalizeUnits(units);
774
774
  if (isFunction(this[units])) {
775
- return this[units](value);
775
+ return this[units](value2);
776
776
  }
777
777
  }
778
778
  return this;
@@ -921,28 +921,28 @@ var require_moment = __commonJS({
921
921
  }
922
922
  }
923
923
  }
924
- function setMonth(mom, value) {
924
+ function setMonth(mom, value2) {
925
925
  if (!mom.isValid()) {
926
926
  return mom;
927
927
  }
928
- if (typeof value === "string") {
929
- if (/^\d+$/.test(value)) {
930
- value = toInt(value);
928
+ if (typeof value2 === "string") {
929
+ if (/^\d+$/.test(value2)) {
930
+ value2 = toInt(value2);
931
931
  } else {
932
- value = mom.localeData().monthsParse(value);
933
- if (!isNumber(value)) {
932
+ value2 = mom.localeData().monthsParse(value2);
933
+ if (!isNumber(value2)) {
934
934
  return mom;
935
935
  }
936
936
  }
937
937
  }
938
- var month = value, date = mom.date();
938
+ var month = value2, date = mom.date();
939
939
  date = date < 29 ? date : Math.min(date, daysInMonth(mom.year(), month));
940
940
  void (mom._isUTC ? mom._d.setUTCMonth(month, date) : mom._d.setMonth(month, date));
941
941
  return mom;
942
942
  }
943
- function getSetMonth(value) {
944
- if (value != null) {
945
- setMonth(this, value);
943
+ function getSetMonth(value2) {
944
+ if (value2 != null) {
945
+ setMonth(this, value2);
946
946
  hooks.updateOffset(this, true);
947
947
  return this;
948
948
  } else {
@@ -3719,18 +3719,18 @@ var require_moment = __commonJS({
3719
3719
  data.years = mathAbs(data.years);
3720
3720
  return this;
3721
3721
  }
3722
- function addSubtract$1(duration, input, value, direction) {
3723
- var other = createDuration(input, value);
3722
+ function addSubtract$1(duration, input, value2, direction) {
3723
+ var other = createDuration(input, value2);
3724
3724
  duration._milliseconds += direction * other._milliseconds;
3725
3725
  duration._days += direction * other._days;
3726
3726
  duration._months += direction * other._months;
3727
3727
  return duration._bubble();
3728
3728
  }
3729
- function add$1(input, value) {
3730
- return addSubtract$1(this, input, value, 1);
3729
+ function add$1(input, value2) {
3730
+ return addSubtract$1(this, input, value2, 1);
3731
3731
  }
3732
- function subtract$1(input, value) {
3733
- return addSubtract$1(this, input, value, -1);
3732
+ function subtract$1(input, value2) {
3733
+ return addSubtract$1(this, input, value2, -1);
3734
3734
  }
3735
3735
  function absCeil(number) {
3736
3736
  if (number < 0) {
@@ -4154,7 +4154,7 @@ function styleInject(css, { insertAt } = {}) {
4154
4154
  // src/components/ReservationStepOne/css/reservationMode.css
4155
4155
  styleInject(".new-reservation-page .form-row .field-label {\n display: block;\n margin-bottom: 6px;\n font-weight: 600;\n}\n.new-reservation-page .form-row .reservation-mode-buttons {\n margin-top: 0;\n}\n.new-reservation-page .reservation-mode-buttons {\n display: flex;\n gap: 10px;\n margin-top: 10px;\n}\n.new-reservation-page .reservation-mode-button {\n flex: 1;\n padding: 10px;\n border: 1px solid #ccc;\n border-radius: var(--border-radius);\n background-color: var(--color-white);\n cursor: pointer;\n font-size: 1rem;\n transition: background-color 0.3s ease, color 0.3s ease;\n}\n.new-reservation-page .reservation-mode-button.active,\n.new-reservation-page .reservation-mode-button:hover {\n background-color: var(--color-blue);\n color: var(--color-white);\n}\n.new-reservation-page .reservation-modes-container {\n display: flex;\n flex-wrap: wrap;\n margin: 0 -5px;\n width: 100%;\n}\n.new-reservation-page .reservation-mode-button {\n flex: 0 0 calc(50% - 10px);\n margin: 5px;\n padding: 10px;\n box-sizing: border-box;\n text-align: center;\n border: 1px solid #ccc;\n background: #f7f7f7;\n cursor: pointer;\n}\n.new-reservation-page .reservation-mode-button:nth-child(3) {\n flex: 0 0 100%;\n}\n.new-reservation-page .reservation-modes-container {\n display: flex;\n flex-wrap: wrap;\n margin: 0 -5px;\n width: 100%;\n}\n.new-reservation-page .reservation-mode-button {\n flex: 0 0 calc(50% - 10px);\n margin: 5px;\n padding: 10px;\n box-sizing: border-box;\n text-align: center;\n border: 1px solid #ccc;\n background: #f7f7f7;\n cursor: pointer;\n}\n.new-reservation-page .reservation-mode-button.active,\n.new-reservation-page .reservation-mode-button:hover {\n background-color: var(--color-blue);\n color: var(--color-white);\n}\n.new-reservation-page .unlimited-mode-warning {\n display: flex;\n align-items: flex-start;\n gap: 10px;\n margin: 15px 0;\n padding: 12px 15px;\n background-color: #fff3cd;\n border: 1px solid #ffeaa7;\n border-radius: var(--border-radius, 4px);\n border-left: 4px solid #e67e22;\n font-size: 0.9rem;\n line-height: 1.4;\n}\n.new-reservation-page .unlimited-mode-warning .warning-icon {\n color: #e67e22;\n font-size: 1.1rem;\n margin-top: 2px;\n flex-shrink: 0;\n}\n.new-reservation-page .unlimited-mode-warning .warning-text {\n color: #856404;\n margin: 0;\n}\n@media screen and (max-width: 480px) {\n .new-reservation-page .unlimited-mode-warning {\n margin: 10px 0;\n padding: 10px 12px;\n font-size: 0.85rem;\n }\n .new-reservation-page .unlimited-mode-warning .warning-icon {\n font-size: 1rem;\n }\n}\n.new-reservation-page .reservation-sidebar-component {\n position: fixed;\n top: 0;\n right: -400px;\n width: 400px;\n height: 100%;\n background-color: #fff;\n box-shadow: -2px 0 5px rgba(0, 0, 0, 0.1);\n z-index: var(--z-index-sidebar-reservation);\n display: flex;\n flex-direction: column;\n overflow-y: auto;\n transition: right 0.3s ease-in-out;\n}\n.new-reservation-page .admin-title {\n text-align: center;\n margin-bottom: 30px;\n}\n.new-reservation-page .reservation-sidebar-component.open {\n right: 0;\n}\n.new-reservation-page .reservation-sidebar-content {\n padding: 20px;\n padding-top: 60px;\n}\n.new-reservation-page .close-sidebar-button {\n position: absolute;\n top: 10px;\n left: 10px;\n background-color: transparent;\n border: none;\n cursor: pointer;\n}\n.new-reservation-page .close-sidebar-button svg {\n color: #000;\n}\n.new-reservation-page .sidebar-section-one,\n.new-reservation-page .sidebar-section-two {\n margin-bottom: 20px;\n}\n.new-reservation-page .reservation-footer {\n margin-top: auto;\n}\n.new-reservation-page .store-reservation-button {\n width: 100%;\n padding: 12px;\n background-color: var(--color-blue);\n color: #fff;\n border: none;\n border-radius: 5px;\n cursor: pointer;\n font-size: 1.1rem;\n}\n.new-reservation-page .open-sidebar-button {\n position: fixed;\n bottom: 20px;\n right: 20px;\n background-color: var(--color-blue);\n color: #fff;\n border: none;\n border-radius: 50%;\n width: 50px;\n height: 50px;\n cursor: pointer;\n z-index: var(--z-index-modal) !important;\n transition: all 0.3s ease;\n}\n.new-reservation-page .open-sidebar-button:hover {\n background-color: var(--color-blue-hover-accent) !important;\n}\n.new-reservation-page .open-sidebar-button svg {\n position: relative;\n top: 2px;\n}\n@media screen and (max-width: 480px) {\n .new-reservation-page .reservation-sidebar-component {\n width: 100%;\n }\n}\n.new-reservation-page .sidebar-section-personeel {\n margin-bottom: 10px;\n}\n");
4156
4156
 
4157
- // src/components/ReservationStepOne/ReservationStepOne.tsx
4157
+ // src/components/ReservationStepOne/ReservationStepOne.js
4158
4158
  var ReservationStepOne = ({
4159
4159
  formData,
4160
4160
  errors,
@@ -4200,7 +4200,7 @@ var ReservationStepOne = ({
4200
4200
  };
4201
4201
  var ReservationStepOne_default = ReservationStepOne;
4202
4202
 
4203
- // src/utils/translations.ts
4203
+ // src/utils/translations.js
4204
4204
  var getPreferredLanguage = () => {
4205
4205
  return localStorage.getItem("preferredLanguage") || "nl";
4206
4206
  };
@@ -4247,13 +4247,13 @@ var translations_default = {
4247
4247
  // src/components/FormField/formField.css
4248
4248
  styleInject(".new-reservation-page .form-group .magic-tooltip {\n transition: transform 0.2s ease;\n transform-origin: bottom right;\n}\n.new-reservation-page .form-group .magic-tooltip:hover {\n transform: scale(1.05);\n}\n");
4249
4249
 
4250
- // src/components/FormField/FormField.tsx
4250
+ // src/components/FormField/FormField.js
4251
4251
  var FormField = ({
4252
4252
  label,
4253
4253
  name,
4254
4254
  type = "text",
4255
- icon: Icon,
4256
- value,
4255
+ icon,
4256
+ value: value2,
4257
4257
  onChange,
4258
4258
  onBlur,
4259
4259
  error,
@@ -4261,16 +4261,16 @@ var FormField = ({
4261
4261
  halfWidth,
4262
4262
  options = [],
4263
4263
  selectPlaceholder,
4264
- rightIcon,
4265
- onRightIconClick,
4264
+ rightIcon: rightIcon2,
4265
+ onRightIconClick: onRightIconClick2,
4266
4266
  tooltipContent
4267
4267
  }) => {
4268
4268
  const t = getSection(translations_default, "formField");
4269
4269
  const selectPlaceholderText = selectPlaceholder || t.selectPlaceholder;
4270
4270
  const [showTooltip, setShowTooltip] = useState(false);
4271
- const tooltipRef = useRef(null);
4272
- const timerRef = useRef(null);
4273
- const RightIconComponent = rightIcon;
4271
+ const tooltipRef = useRef < HTMLDivElement > null;
4272
+ const timerRef = useRef < NodeJS.Timeout | null > null;
4273
+ const RightIconComponent = rightIcon2;
4274
4274
  useEffect(() => {
4275
4275
  const handleClickOutside = (e) => {
4276
4276
  if (tooltipRef.current && !tooltipRef.current.contains(e.target)) {
@@ -4283,7 +4283,7 @@ var FormField = ({
4283
4283
  }, [showTooltip]);
4284
4284
  const baseControlProps = {
4285
4285
  name,
4286
- value,
4286
+ value: value2,
4287
4287
  onChange,
4288
4288
  onBlur,
4289
4289
  "aria-label": label,
@@ -4307,7 +4307,7 @@ var FormField = ({
4307
4307
  "div",
4308
4308
  {
4309
4309
  className: "magic-wand-container",
4310
- onClick: onRightIconClick,
4310
+ onClick: onRightIconClick2,
4311
4311
  onMouseEnter: () => {
4312
4312
  if (timerRef.current) clearTimeout(timerRef.current);
4313
4313
  setShowTooltip(true);
@@ -4338,13 +4338,13 @@ var FormField = ({
4338
4338
  style: {
4339
4339
  position: "absolute",
4340
4340
  bottom: "100%",
4341
- right: 0,
4341
+ right,
4342
4342
  backgroundColor: "#fff",
4343
4343
  color: "#333",
4344
4344
  borderRadius: "8px",
4345
4345
  fontSize: "0.9rem",
4346
4346
  boxShadow: "0px 4px 10px rgba(0,0,0,0.15)",
4347
- zIndex: 10,
4347
+ zIndex,
4348
4348
  marginBottom: "8px",
4349
4349
  minWidth: "220px",
4350
4350
  overflow: "hidden"
@@ -4356,13 +4356,13 @@ var FormField = ({
4356
4356
  className: "lottie-container",
4357
4357
  style: {
4358
4358
  position: "absolute",
4359
- top: 0,
4359
+ top,
4360
4360
  right: "1px",
4361
4361
  width: "calc(100% + 30px)",
4362
4362
  height: "100%",
4363
4363
  marginRight: "-100px",
4364
4364
  pointerEvents: "none",
4365
- zIndex: 0
4365
+ zIndex
4366
4366
  }
4367
4367
  },
4368
4368
  /* @__PURE__ */ React4.createElement(
@@ -4374,7 +4374,7 @@ var FormField = ({
4374
4374
  }
4375
4375
  )
4376
4376
  ),
4377
- /* @__PURE__ */ React4.createElement("div", { style: { position: "relative", zIndex: 1, padding: "12px 20px" } }, /* @__PURE__ */ React4.createElement(
4377
+ /* @__PURE__ */ React4.createElement("div", { style: { position: "relative", zIndex, padding: "12px 20px" } }, /* @__PURE__ */ React4.createElement(
4378
4378
  "div",
4379
4379
  {
4380
4380
  style: {
@@ -4414,7 +4414,7 @@ var FormField = ({
4414
4414
  };
4415
4415
  var FormField_default = FormField;
4416
4416
 
4417
- // src/components/ReservationStepTwo/ReservationStepTwo.tsx
4417
+ // src/components/ReservationStepTwo/ReservationStepTwo.js
4418
4418
  var import_moment = __toESM(require_moment());
4419
4419
  __toESM(require_nl());
4420
4420
  var useApi = () => {
@@ -4444,7 +4444,7 @@ var useApi = () => {
4444
4444
  const token = getJwtToken();
4445
4445
  return axios({
4446
4446
  method,
4447
- url: endpoint,
4447
+ url,
4448
4448
  data,
4449
4449
  ...config,
4450
4450
  headers: {
@@ -4599,7 +4599,7 @@ var translations_default2 = {
4599
4599
  // src/components/ReservationStepTwo/reservationStepTwo.css
4600
4600
  styleInject(".new-reservation-page .name-fields {\n display: flex;\n gap: 20px;\n}\n.input-container .form-control {\n display: flex;\n align-items: center;\n justify-content: space-between;\n width: 100%;\n padding: 10px;\n background-color: #fff;\n border: #ccc 1px solid;\n cursor: pointer;\n -webkit-user-select: none;\n user-select: none;\n text-align: left;\n border-radius: 5px;\n font-size: 16px;\n}\n");
4601
4601
 
4602
- // src/components/ReservationStepTwo/ReservationStepTwo.tsx
4602
+ // src/components/ReservationStepTwo/ReservationStepTwo.js
4603
4603
  var ReservationStepTwo = ({
4604
4604
  formData,
4605
4605
  errors,
@@ -4662,26 +4662,14 @@ var ReservationStepTwo = ({
4662
4662
  useEffect(() => {
4663
4663
  tryAutofill();
4664
4664
  }, [formData.email, formData.phone]);
4665
- const applyAutofill = () => {
4666
- if (!pendingAutofill) return;
4667
- setFormData((prev) => ({
4668
- ...prev,
4669
- firstName: pendingAutofill.firstName,
4670
- lastName: pendingAutofill.lastName,
4671
- email: pendingAutofill.email,
4672
- phone: pendingAutofill.phone
4673
- }));
4674
- setHasAutofilled(true);
4675
- setPendingAutofill(null);
4676
- };
4677
4665
  const magicProps = useMemo(() => {
4678
4666
  if (!pendingAutofill)
4679
4667
  return { email: {}, phone: {} };
4680
4668
  const emailActive = pendingAutofill.sources.includes("email") && (formData.email || "").trim().toLowerCase() === pendingAutofill.email.trim().toLowerCase();
4681
4669
  const phoneActive = pendingAutofill.sources.includes("phone") && (formData.phone || "").trim() === pendingAutofill.phone.trim();
4682
4670
  const common = {
4683
- rightIcon: FaMagic,
4684
- onRightIconClick: applyAutofill
4671
+ rightIcon,
4672
+ onRightIconClick
4685
4673
  };
4686
4674
  return {
4687
4675
  email: emailActive ? {
@@ -4898,7 +4886,7 @@ var translations_default3 = {
4898
4886
  // src/components/ReservationSummary/reservationSummary.css
4899
4887
  styleInject(".new-reservation-page .reservation-sidebar-component .reservation-summary .modal-title {\n margin-top: 0;\n margin-bottom: 20px;\n}\n.new-reservation-page .reservation-sidebar-component .reservation-summary .reservation-details {\n list-style-type: none;\n padding: 0;\n margin: 0 0 20px 0;\n width: 100%;\n}\n.new-reservation-page .reservation-sidebar-component .reservation-summary .reservation-details li {\n margin-bottom: 10px;\n font-size: 15px;\n align-items: left;\n text-align: left;\n}\n.new-reservation-page .reservation-sidebar-component .reservation-summary .reservation-details li strong {\n font-weight: bold;\n}\n.new-reservation-page .reservation-sidebar-component .reservation-summary {\n align-items: left;\n}\n");
4900
4888
 
4901
- // src/components/ReservationSummary/ReservationSummary.tsx
4889
+ // src/components/ReservationSummary/ReservationSummary.js
4902
4890
  var ReservationSummary = ({
4903
4891
  formData,
4904
4892
  onNewReservation
@@ -4945,7 +4933,7 @@ var translations_default4 = {
4945
4933
  // src/components/GiftcardSelection/giftcardSelection.css
4946
4934
  styleInject(".new-reservation-page .giftcard-selection {\n margin-bottom: 20px;\n}\n.new-reservation-page .giftcard-options {\n display: flex;\n gap: 20px;\n margin: 10px 0;\n}\n.new-reservation-page .giftcard-option {\n display: flex;\n align-items: center;\n gap: 8px;\n cursor: pointer;\n}\n.new-reservation-page .form-label {\n font-weight: 500;\n margin-bottom: 8px;\n display: block;\n}\n.new-reservation-page .giftcard-option input[type=radio] {\n margin: 0;\n cursor: pointer;\n}\n.new-reservation-page .giftcard-option label {\n cursor: pointer;\n}\n");
4947
4935
 
4948
- // src/components/GiftcardSelection/GiftcardSelection.tsx
4936
+ // src/components/GiftcardSelection/GiftcardSelection.js
4949
4937
  var GiftcardSelection = ({
4950
4938
  restaurantData,
4951
4939
  formData,
@@ -4969,7 +4957,7 @@ var GiftcardSelection = ({
4969
4957
  setAvailableGiftcards([...cards]);
4970
4958
  }, [restaurantData]);
4971
4959
  if (!availableGiftcards.length) return null;
4972
- const options = availableGiftcards.map((card) => ({ value: card, label: card }));
4960
+ const options = availableGiftcards.map((card) => ({ value, label: card }));
4973
4961
  const onChange = (e) => {
4974
4962
  handleChange({ target: { name: "giftcard", value: e.target.value } });
4975
4963
  resetFormDataFields(["date", "time"]);
@@ -5026,7 +5014,7 @@ var translations_default5 = {
5026
5014
  // src/components/ZitplaatsSelection/zitplaatsSelection.css
5027
5015
  styleInject(".new-reservation-page .zitplaats-selection {\n margin-bottom: 15px;\n}\n.new-reservation-page .zitplaats-selection select {\n width: 100%;\n padding: 10px;\n border-radius: 4px;\n border: 1px solid #ccc;\n background-color: white;\n}\n");
5028
5016
 
5029
- // src/components/ZitplaatsSelection/ZitplaatsSelection.tsx
5017
+ // src/components/ZitplaatsSelection/ZitplaatsSelection.js
5030
5018
  var ZitplaatsSelection = ({
5031
5019
  restaurantData,
5032
5020
  formData,
@@ -5044,8 +5032,8 @@ var ZitplaatsSelection = ({
5044
5032
  setAvailableZitplaatsen([...set].sort());
5045
5033
  }, [restaurantData]);
5046
5034
  const handleZitplaatsChange = (e) => {
5047
- const { value } = e.target;
5048
- handleChange({ target: { name: "zitplaats", value } });
5035
+ const { value: value2 } = e.target;
5036
+ handleChange({ target: { name: "zitplaats", value: value2 } });
5049
5037
  resetFormDataFields(["date", "time", "selectedTableNumbers", "selectedTableIds"]);
5050
5038
  };
5051
5039
  const tableSettings = restaurantData?.["table-settings"] || {};
@@ -5097,9 +5085,9 @@ var translationsReservationSidebar_default = {
5097
5085
  };
5098
5086
 
5099
5087
  // src/styles/reservationSidebar.css
5100
- styleInject(".new-reservation-page .reservation-sidebar-component {\n position: fixed;\n top: 0;\n right: -400px;\n width: 400px;\n height: 100%;\n background-color: #fff;\n box-shadow: -2px 0 5px rgba(0, 0, 0, 0.1);\n z-index: var(--z-index-sidebar-reservation);\n display: flex;\n flex-direction: column;\n overflow-y: auto;\n transition: right 0.3s ease-in-out;\n}\n.new-reservation-page .admin-title {\n text-align: center;\n margin-bottom: 30px;\n}\n.new-reservation-page .reservation-sidebar-component.open {\n right: 0;\n}\n.new-reservation-page .reservation-sidebar-content {\n padding: 20px;\n padding-top: 60px;\n}\n.new-reservation-page .close-sidebar-button {\n position: absolute;\n top: 10px;\n left: 10px;\n background-color: transparent;\n border: none;\n cursor: pointer;\n}\n.new-reservation-page .close-sidebar-button svg {\n color: #000;\n}\n.new-reservation-page .sidebar-section-one,\n.new-reservation-page .sidebar-section-two {\n margin-bottom: 20px;\n}\n.new-reservation-page .reservation-footer {\n margin-top: auto;\n}\n.new-reservation-page .store-reservation-button {\n width: 100%;\n padding: 12px;\n background-color: var(--color-blue);\n color: #fff;\n border: none;\n border-radius: 5px;\n cursor: pointer;\n font-size: 1.1rem;\n}\n.new-reservation-page .open-sidebar-button {\n position: fixed;\n bottom: 20px;\n right: 20px;\n background-color: var(--color-blue);\n color: #fff;\n border: none;\n border-radius: 50%;\n width: 50px;\n height: 50px;\n cursor: pointer;\n z-index: var(--z-index-modal) !important;\n transition: all 0.3s ease;\n}\n.new-reservation-page .open-sidebar-button:hover {\n background-color: var(--color-blue-hover-accent) !important;\n}\n.new-reservation-page .open-sidebar-button svg {\n position: relative;\n top: 2px;\n}\n@media screen and (max-width: 480px) {\n .new-reservation-page .reservation-sidebar-component {\n width: 100%;\n }\n}\n.new-reservation-page .sidebar-section-personeel {\n margin-bottom: 10px;\n}\n");
5088
+ styleInject(".reservation-sidebar-component {\n position: fixed;\n top: 0;\n right: -400px;\n width: 400px;\n height: 100%;\n background-color: #fff;\n box-shadow: -2px 0 5px rgba(0, 0, 0, 0.1);\n z-index: var(--z-index-sidebar-reservation);\n display: flex;\n flex-direction: column;\n overflow-y: auto;\n transition: right 0.3s ease-in-out;\n}\n.admin-title {\n text-align: center;\n margin-bottom: 30px;\n}\n.reservation-sidebar-component.open {\n right: 0;\n}\n.reservation-sidebar-content {\n padding: 20px;\n padding-top: 60px;\n}\n.close-sidebar-button {\n position: absolute;\n top: 10px;\n left: 10px;\n background-color: transparent;\n border: none;\n cursor: pointer;\n}\n.close-sidebar-button svg {\n color: #000;\n}\n.sidebar-section-one,\n.sidebar-section-two {\n margin-bottom: 20px;\n}\n.reservation-footer {\n margin-top: auto;\n}\n.store-reservation-button {\n width: 100%;\n padding: 12px;\n background-color: var(--color-blue);\n color: #fff;\n border: none;\n border-radius: 5px;\n cursor: pointer;\n font-size: 1.1rem;\n}\n.open-sidebar-button {\n position: fixed;\n bottom: 20px;\n right: 20px;\n background-color: var(--color-blue);\n color: #fff;\n border: none;\n border-radius: 50%;\n width: 50px;\n height: 50px;\n cursor: pointer;\n z-index: var(--z-index-modal) !important;\n transition: all 0.3s ease;\n}\n.open-sidebar-button:hover {\n background-color: var(--color-blue-hover-accent) !important;\n}\n.open-sidebar-button svg {\n position: relative;\n top: 2px;\n}\n@media screen and (max-width: 480px) {\n .reservation-sidebar-component {\n width: 100%;\n }\n}\n.sidebar-section-personeel {\n margin-bottom: 10px;\n}\n");
5101
5089
 
5102
- // src/ReservationSidebar.tsx
5090
+ // src/ReservationSidebar.js
5103
5091
  var ReservationSidebar = ({
5104
5092
  isOpen,
5105
5093
  onClose,
@@ -5146,7 +5134,7 @@ var ReservationSidebar = ({
5146
5134
  const baseDomain = window.baseDomain || "";
5147
5135
  const [data, personeelData] = await Promise.all([
5148
5136
  api.get(`${baseDomain}api/auth-restaurant/`, {
5149
- noCache: true
5137
+ noCache
5150
5138
  }),
5151
5139
  api.get(`${baseDomain}api/personeel`, { noCache: true })
5152
5140
  ]);
@@ -5173,7 +5161,7 @@ var ReservationSidebar = ({
5173
5161
  }, [isOpen, api]);
5174
5162
  const handleNewReservationClick = useCallback(() => {
5175
5163
  setFormData({
5176
- guests: 1,
5164
+ guests,
5177
5165
  date: "",
5178
5166
  time: "",
5179
5167
  firstName: "",
@@ -5185,8 +5173,8 @@ var ReservationSidebar = ({
5185
5173
  personeel: "",
5186
5174
  giftcard: "",
5187
5175
  zitplaats: "",
5188
- selectedTableNumbers: [],
5189
- selectedTableIds: [],
5176
+ selectedTableNumbers,
5177
+ selectedTableIds,
5190
5178
  reservationMode: "met_limieten"
5191
5179
  });
5192
5180
  onNewReservation();
@@ -5230,7 +5218,7 @@ var ReservationSidebar = ({
5230
5218
  type: "select",
5231
5219
  options: availablePersoneel.map((p) => {
5232
5220
  const full = `${p.voornaam} ${p.achternaam}`;
5233
- return { value: full, label: full };
5221
+ return { value, label: full };
5234
5222
  }),
5235
5223
  value: formData.personeel,
5236
5224
  onChange: handleChange,
@@ -5273,7 +5261,7 @@ var ReservationSidebar = ({
5273
5261
  var ReservationSidebar_default = ReservationSidebar;
5274
5262
 
5275
5263
  // src/styles/newReservationAdmin.css
5276
- styleInject(".new-reservation-page .account-manage-title {\n text-align: center;\n margin-bottom: 30px;\n}\n.new-reservation-page .account-manage-container {\n max-width: 800px;\n margin: 0 auto;\n}\n.new-reservation-page .account-manage-form {\n display: flex;\n flex-direction: column;\n gap: 15px;\n}\n.new-reservation-page .input-container {\n position: relative;\n}\n.new-reservation-page .input-icon {\n position: absolute;\n top: 50%;\n left: 10px;\n transform: translateY(-50%);\n color: #6c757d;\n pointer-events: none;\n}\n.new-reservation-page .input-container input,\n.new-reservation-page .input-container textarea {\n width: 100%;\n padding: 10px 10px 10px 35px;\n border: 1px solid #ccc;\n border-radius: 5px;\n font-size: 1rem;\n transition: border-color 0.3s ease;\n}\n.new-reservation-page .form-error {\n color: #dc3545;\n font-size: 0.9rem;\n margin-top: 5px;\n display: flex;\n align-items: center;\n gap: 5px;\n}\n.new-reservation-page .account-manage__button {\n padding: 12px;\n background-color: var(--color-blue);\n color: #fff;\n border: none;\n border-radius: 5px;\n cursor: pointer;\n font-size: 1.1rem;\n display: flex;\n align-items: center;\n justify-content: center;\n gap: 10px;\n transition: background-color 0.3s ease;\n}\n");
5264
+ styleInject(".account-manage-title {\n text-align: center;\n margin-bottom: 30px;\n}\n.account-manage-container {\n max-width: 800px;\n margin: 0 auto;\n}\n.account-manage-form {\n display: flex;\n flex-direction: column;\n gap: 15px;\n}\n.input-container {\n position: relative;\n}\n.input-icon {\n position: absolute;\n top: 50%;\n left: 10px;\n transform: translateY(-50%);\n color: #6c757d;\n pointer-events: none;\n}\n.input-container input,\n.input-container textarea {\n width: 100%;\n padding: 10px 10px 10px 35px;\n border: 1px solid #ccc;\n border-radius: 5px;\n font-size: 1rem;\n transition: border-color 0.3s ease;\n}\n.form-error {\n color: #dc3545;\n font-size: 0.9rem;\n margin-top: 5px;\n display: flex;\n align-items: center;\n gap: 5px;\n}\n.account-manage__button {\n padding: 12px;\n background-color: var(--color-blue);\n color: #fff;\n border: none;\n border-radius: 5px;\n cursor: pointer;\n font-size: 1.1rem;\n display: flex;\n align-items: center;\n justify-content: center;\n gap: 10px;\n transition: background-color 0.3s ease;\n}\n");
5277
5265
  /*! Bundled license information:
5278
5266
 
5279
5267
  moment/moment.js:
package/package.json CHANGED
@@ -1,17 +1,16 @@
1
1
  {
2
2
  "name": "@happychef/reservation-sidebar",
3
- "version": "1.0.0",
4
- "description": "A compound component for managing restaurant reservations",
3
+ "version": "2.0.1",
4
+ "description": "A compound component for managing restaurant reservations - JavaScript version with independent styles",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",
7
- "types": "dist/index.d.ts",
8
7
  "files": [
8
+
9
9
  "dist",
10
10
  "README.md"
11
11
  ],
12
12
  "exports": {
13
13
  ".": {
14
- "types": "./dist/index.d.ts",
15
14
  "import": "./dist/index.mjs",
16
15
  "require": "./dist/index.js"
17
16
  }
@@ -19,7 +18,6 @@
19
18
  "scripts": {
20
19
  "build": "tsup",
21
20
  "dev": "tsup --watch",
22
- "type-check": "tsc --noEmit",
23
21
  "prepublishOnly": "npm run build"
24
22
  },
25
23
  "keywords": [
@@ -36,16 +34,13 @@
36
34
  "react-dom": "^16.8.0 || ^17.0.0 || ^18.0.0"
37
35
  },
38
36
  "dependencies": {
37
+ "@happychef/algorithm": "^1.0.1",
39
38
  "axios": "^1.7.9",
40
39
  "lottie-react": "^2.4.1",
41
40
  "moment-timezone": "^0.5.46",
42
41
  "react-icons": "^5.3.0"
43
42
  },
44
43
  "devDependencies": {
45
- "@happychef/algorithm": "^1.0.1",
46
- "@types/node": "^20.11.0",
47
- "@types/react": "^18.2.48",
48
- "@types/react-dom": "^18.2.18",
49
44
  "react": "^18.3.1",
50
45
  "react-dom": "^18.3.1",
51
46
  "tsup": "^8.0.1",
package/dist/index.d.mts DELETED
@@ -1,199 +0,0 @@
1
- import React$1 from 'react';
2
- import { AxiosRequestConfig } from 'axios';
3
-
4
- interface FormData {
5
- guests: number;
6
- date: string;
7
- time: string;
8
- firstName: string;
9
- lastName: string;
10
- email: string;
11
- phone: string;
12
- extraInfo: string;
13
- menu: string;
14
- personeel: string;
15
- giftcard: string;
16
- zitplaats: string;
17
- selectedTableNumbers: number[];
18
- selectedTableIds: string[];
19
- reservationMode: string;
20
- }
21
- interface FormErrors {
22
- guests?: string;
23
- date?: string;
24
- time?: string;
25
- firstName?: string;
26
- lastName?: string;
27
- email?: string;
28
- phone?: string;
29
- menu?: string;
30
- personeel?: string;
31
- [key: string]: string | undefined;
32
- }
33
- interface ReservationSidebarProps {
34
- isOpen: boolean;
35
- onClose: () => void;
36
- formData: FormData;
37
- errors: FormErrors;
38
- handleChange: (e: React.ChangeEvent<HTMLInputElement | HTMLSelectElement | HTMLTextAreaElement>) => void;
39
- handleFinalSubmit: () => void;
40
- setFormData: React.Dispatch<React.SetStateAction<FormData>>;
41
- isSubmitting: boolean;
42
- reservationSubmitted: boolean;
43
- onNewReservation: () => void;
44
- apiBaseDomain?: string;
45
- }
46
- interface Timeblock {
47
- id: string;
48
- startTime: string;
49
- endTime: string;
50
- capacity: number;
51
- [key: string]: any;
52
- }
53
- interface MenuData {
54
- name: string;
55
- startDate: string;
56
- endDate: string;
57
- startHour: string;
58
- endHour: string;
59
- daysOfWeek: string[];
60
- [key: string]: any;
61
- }
62
- interface RestaurantData {
63
- timeblocks?: Timeblock[];
64
- menu?: MenuData[];
65
- 'general-settings'?: {
66
- seatSelectionEnabled?: boolean;
67
- [key: string]: any;
68
- };
69
- 'table-settings'?: {
70
- isInstalled?: boolean;
71
- assignmentMode?: string;
72
- [key: string]: any;
73
- };
74
- floors?: Floor[];
75
- [key: string]: any;
76
- }
77
- interface Floor {
78
- tables: Table[];
79
- [key: string]: any;
80
- }
81
- interface Table {
82
- zitplaats?: string;
83
- number?: number;
84
- id?: string;
85
- [key: string]: any;
86
- }
87
- interface Personeel {
88
- voornaam: string;
89
- achternaam: string;
90
- startDate: string;
91
- endDate: string;
92
- [key: string]: any;
93
- }
94
- interface SelectOption {
95
- value: string;
96
- label: string;
97
- }
98
- interface FormFieldProps {
99
- label: string;
100
- name: string;
101
- type?: 'text' | 'email' | 'tel' | 'textarea' | 'select';
102
- icon?: React.ComponentType<{
103
- className?: string;
104
- }>;
105
- value: string;
106
- onChange: (e: React.ChangeEvent<HTMLInputElement | HTMLSelectElement | HTMLTextAreaElement>) => void;
107
- onBlur?: () => void;
108
- error?: string;
109
- placeholder?: string;
110
- halfWidth?: boolean;
111
- options?: SelectOption[];
112
- selectPlaceholder?: string;
113
- rightIcon?: React.ComponentType<{
114
- className?: string;
115
- style?: React.CSSProperties;
116
- }>;
117
- onRightIconClick?: () => void;
118
- tooltipContent?: React.ReactNode;
119
- }
120
- interface GiftcardSelectionProps {
121
- restaurantData: RestaurantData;
122
- formData: FormData;
123
- handleChange: (e: React.ChangeEvent<HTMLInputElement | HTMLSelectElement | HTMLTextAreaElement>) => void;
124
- resetFormDataFields: (fields: string[]) => void;
125
- }
126
- interface ZitplaatsSelectionProps {
127
- restaurantData: RestaurantData;
128
- formData: FormData;
129
- handleChange: (e: React.ChangeEvent<HTMLInputElement | HTMLSelectElement | HTMLTextAreaElement>) => void;
130
- resetFormDataFields: (fields: string[]) => void;
131
- }
132
- interface ReservationStepOneProps {
133
- formData: FormData;
134
- errors: FormErrors;
135
- handleChange: (e: React.ChangeEvent<HTMLInputElement | HTMLSelectElement | HTMLTextAreaElement>) => void;
136
- setFormData: React.Dispatch<React.SetStateAction<FormData>>;
137
- timeblocks: Timeblock[];
138
- loadingTimeblocks: boolean;
139
- timeblocksError: Error | null;
140
- restaurantData: RestaurantData;
141
- }
142
- interface ReservationStepTwoProps {
143
- formData: FormData;
144
- errors: FormErrors;
145
- handleChange: (e: React.ChangeEvent<HTMLInputElement | HTMLSelectElement | HTMLTextAreaElement>) => void;
146
- setFormData: React.Dispatch<React.SetStateAction<FormData>>;
147
- isSubmitting: boolean;
148
- menuData: MenuData[];
149
- }
150
- interface ReservationSummaryProps {
151
- formData: FormData;
152
- onNewReservation: () => void;
153
- }
154
-
155
- declare const ReservationSidebar: React$1.FC<ReservationSidebarProps>;
156
-
157
- declare const FormField: React$1.FC<FormFieldProps>;
158
-
159
- declare const GiftcardSelection: React$1.FC<GiftcardSelectionProps>;
160
-
161
- declare const ZitplaatsSelection: React$1.FC<ZitplaatsSelectionProps>;
162
-
163
- /**
164
- * Placeholder for ReservationStepOne component
165
- *
166
- * This component has complex dependencies on:
167
- * - @happychef/algorithm package for table availability
168
- * - Multiple sub-components (Calendar, DateSelector, TimeSelector, TableSelector, ValueSelector)
169
- * - Complex reservation logic
170
- *
171
- * To implement this component fully:
172
- * 1. Install @happychef/algorithm package
173
- * 2. Copy the sub-components from StepOne directory
174
- * 3. Implement the full logic from the source repository
175
- *
176
- * For now, this is a placeholder that maintains the interface.
177
- */
178
- declare const ReservationStepOne: React$1.FC<ReservationStepOneProps>;
179
-
180
- declare const ReservationStepTwo: React$1.FC<ReservationStepTwoProps>;
181
-
182
- declare const ReservationSummary: React$1.FC<ReservationSummaryProps>;
183
-
184
- interface ApiConfig extends AxiosRequestConfig {
185
- noCache?: boolean;
186
- }
187
- interface ApiMethods {
188
- get: (endpoint: string, config?: ApiConfig) => Promise<any>;
189
- post: (endpoint: string, data?: any, config?: AxiosRequestConfig) => Promise<any>;
190
- put: (endpoint: string, data?: any, config?: AxiosRequestConfig) => Promise<any>;
191
- patch: (endpoint: string, data?: any, config?: AxiosRequestConfig) => Promise<any>;
192
- delete: (endpoint: string, config?: AxiosRequestConfig) => Promise<any>;
193
- }
194
- declare const useApi: () => ApiMethods;
195
-
196
- declare const getPreferredLanguage: () => string;
197
- declare const getSection: (translationsObj: Record<string, any>, sectionKey: string, fallbackLang?: string) => Record<string, any>;
198
-
199
- export { type Floor, type FormData, type FormErrors, FormField, type FormFieldProps, GiftcardSelection, type GiftcardSelectionProps, type MenuData, type Personeel, ReservationSidebar, type ReservationSidebarProps, ReservationStepOne, type ReservationStepOneProps, ReservationStepTwo, type ReservationStepTwoProps, ReservationSummary, type ReservationSummaryProps, type RestaurantData, type SelectOption, type Table, type Timeblock, ZitplaatsSelection, type ZitplaatsSelectionProps, getPreferredLanguage, getSection, useApi };
package/dist/index.d.ts DELETED
@@ -1,199 +0,0 @@
1
- import React$1 from 'react';
2
- import { AxiosRequestConfig } from 'axios';
3
-
4
- interface FormData {
5
- guests: number;
6
- date: string;
7
- time: string;
8
- firstName: string;
9
- lastName: string;
10
- email: string;
11
- phone: string;
12
- extraInfo: string;
13
- menu: string;
14
- personeel: string;
15
- giftcard: string;
16
- zitplaats: string;
17
- selectedTableNumbers: number[];
18
- selectedTableIds: string[];
19
- reservationMode: string;
20
- }
21
- interface FormErrors {
22
- guests?: string;
23
- date?: string;
24
- time?: string;
25
- firstName?: string;
26
- lastName?: string;
27
- email?: string;
28
- phone?: string;
29
- menu?: string;
30
- personeel?: string;
31
- [key: string]: string | undefined;
32
- }
33
- interface ReservationSidebarProps {
34
- isOpen: boolean;
35
- onClose: () => void;
36
- formData: FormData;
37
- errors: FormErrors;
38
- handleChange: (e: React.ChangeEvent<HTMLInputElement | HTMLSelectElement | HTMLTextAreaElement>) => void;
39
- handleFinalSubmit: () => void;
40
- setFormData: React.Dispatch<React.SetStateAction<FormData>>;
41
- isSubmitting: boolean;
42
- reservationSubmitted: boolean;
43
- onNewReservation: () => void;
44
- apiBaseDomain?: string;
45
- }
46
- interface Timeblock {
47
- id: string;
48
- startTime: string;
49
- endTime: string;
50
- capacity: number;
51
- [key: string]: any;
52
- }
53
- interface MenuData {
54
- name: string;
55
- startDate: string;
56
- endDate: string;
57
- startHour: string;
58
- endHour: string;
59
- daysOfWeek: string[];
60
- [key: string]: any;
61
- }
62
- interface RestaurantData {
63
- timeblocks?: Timeblock[];
64
- menu?: MenuData[];
65
- 'general-settings'?: {
66
- seatSelectionEnabled?: boolean;
67
- [key: string]: any;
68
- };
69
- 'table-settings'?: {
70
- isInstalled?: boolean;
71
- assignmentMode?: string;
72
- [key: string]: any;
73
- };
74
- floors?: Floor[];
75
- [key: string]: any;
76
- }
77
- interface Floor {
78
- tables: Table[];
79
- [key: string]: any;
80
- }
81
- interface Table {
82
- zitplaats?: string;
83
- number?: number;
84
- id?: string;
85
- [key: string]: any;
86
- }
87
- interface Personeel {
88
- voornaam: string;
89
- achternaam: string;
90
- startDate: string;
91
- endDate: string;
92
- [key: string]: any;
93
- }
94
- interface SelectOption {
95
- value: string;
96
- label: string;
97
- }
98
- interface FormFieldProps {
99
- label: string;
100
- name: string;
101
- type?: 'text' | 'email' | 'tel' | 'textarea' | 'select';
102
- icon?: React.ComponentType<{
103
- className?: string;
104
- }>;
105
- value: string;
106
- onChange: (e: React.ChangeEvent<HTMLInputElement | HTMLSelectElement | HTMLTextAreaElement>) => void;
107
- onBlur?: () => void;
108
- error?: string;
109
- placeholder?: string;
110
- halfWidth?: boolean;
111
- options?: SelectOption[];
112
- selectPlaceholder?: string;
113
- rightIcon?: React.ComponentType<{
114
- className?: string;
115
- style?: React.CSSProperties;
116
- }>;
117
- onRightIconClick?: () => void;
118
- tooltipContent?: React.ReactNode;
119
- }
120
- interface GiftcardSelectionProps {
121
- restaurantData: RestaurantData;
122
- formData: FormData;
123
- handleChange: (e: React.ChangeEvent<HTMLInputElement | HTMLSelectElement | HTMLTextAreaElement>) => void;
124
- resetFormDataFields: (fields: string[]) => void;
125
- }
126
- interface ZitplaatsSelectionProps {
127
- restaurantData: RestaurantData;
128
- formData: FormData;
129
- handleChange: (e: React.ChangeEvent<HTMLInputElement | HTMLSelectElement | HTMLTextAreaElement>) => void;
130
- resetFormDataFields: (fields: string[]) => void;
131
- }
132
- interface ReservationStepOneProps {
133
- formData: FormData;
134
- errors: FormErrors;
135
- handleChange: (e: React.ChangeEvent<HTMLInputElement | HTMLSelectElement | HTMLTextAreaElement>) => void;
136
- setFormData: React.Dispatch<React.SetStateAction<FormData>>;
137
- timeblocks: Timeblock[];
138
- loadingTimeblocks: boolean;
139
- timeblocksError: Error | null;
140
- restaurantData: RestaurantData;
141
- }
142
- interface ReservationStepTwoProps {
143
- formData: FormData;
144
- errors: FormErrors;
145
- handleChange: (e: React.ChangeEvent<HTMLInputElement | HTMLSelectElement | HTMLTextAreaElement>) => void;
146
- setFormData: React.Dispatch<React.SetStateAction<FormData>>;
147
- isSubmitting: boolean;
148
- menuData: MenuData[];
149
- }
150
- interface ReservationSummaryProps {
151
- formData: FormData;
152
- onNewReservation: () => void;
153
- }
154
-
155
- declare const ReservationSidebar: React$1.FC<ReservationSidebarProps>;
156
-
157
- declare const FormField: React$1.FC<FormFieldProps>;
158
-
159
- declare const GiftcardSelection: React$1.FC<GiftcardSelectionProps>;
160
-
161
- declare const ZitplaatsSelection: React$1.FC<ZitplaatsSelectionProps>;
162
-
163
- /**
164
- * Placeholder for ReservationStepOne component
165
- *
166
- * This component has complex dependencies on:
167
- * - @happychef/algorithm package for table availability
168
- * - Multiple sub-components (Calendar, DateSelector, TimeSelector, TableSelector, ValueSelector)
169
- * - Complex reservation logic
170
- *
171
- * To implement this component fully:
172
- * 1. Install @happychef/algorithm package
173
- * 2. Copy the sub-components from StepOne directory
174
- * 3. Implement the full logic from the source repository
175
- *
176
- * For now, this is a placeholder that maintains the interface.
177
- */
178
- declare const ReservationStepOne: React$1.FC<ReservationStepOneProps>;
179
-
180
- declare const ReservationStepTwo: React$1.FC<ReservationStepTwoProps>;
181
-
182
- declare const ReservationSummary: React$1.FC<ReservationSummaryProps>;
183
-
184
- interface ApiConfig extends AxiosRequestConfig {
185
- noCache?: boolean;
186
- }
187
- interface ApiMethods {
188
- get: (endpoint: string, config?: ApiConfig) => Promise<any>;
189
- post: (endpoint: string, data?: any, config?: AxiosRequestConfig) => Promise<any>;
190
- put: (endpoint: string, data?: any, config?: AxiosRequestConfig) => Promise<any>;
191
- patch: (endpoint: string, data?: any, config?: AxiosRequestConfig) => Promise<any>;
192
- delete: (endpoint: string, config?: AxiosRequestConfig) => Promise<any>;
193
- }
194
- declare const useApi: () => ApiMethods;
195
-
196
- declare const getPreferredLanguage: () => string;
197
- declare const getSection: (translationsObj: Record<string, any>, sectionKey: string, fallbackLang?: string) => Record<string, any>;
198
-
199
- export { type Floor, type FormData, type FormErrors, FormField, type FormFieldProps, GiftcardSelection, type GiftcardSelectionProps, type MenuData, type Personeel, ReservationSidebar, type ReservationSidebarProps, ReservationStepOne, type ReservationStepOneProps, ReservationStepTwo, type ReservationStepTwoProps, ReservationSummary, type ReservationSummaryProps, type RestaurantData, type SelectOption, type Table, type Timeblock, ZitplaatsSelection, type ZitplaatsSelectionProps, getPreferredLanguage, getSection, useApi };