@happychef/reservation-sidebar 2.5.4 → 2.5.6

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 (4) hide show
  1. package/dist/index.js +21 -12204
  2. package/dist/index.mjs +21 -12187
  3. package/package.json +10 -11
  4. package/dist/index.css +0 -676
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@happychef/reservation-sidebar",
3
- "version": "2.5.4",
3
+ "version": "2.5.6",
4
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",
@@ -12,11 +12,10 @@
12
12
  ".": {
13
13
  "import": "./dist/index.mjs",
14
14
  "require": "./dist/index.js"
15
- },
16
- "./dist/index.css": "./dist/index.css"
15
+ }
17
16
  },
18
17
  "scripts": {
19
- "build": "tsup && node add-use-client.js && node extract-css.js",
18
+ "build": "tsup",
20
19
  "dev": "tsup --watch",
21
20
  "prepublishOnly": "npm run build"
22
21
  },
@@ -30,27 +29,27 @@
30
29
  "author": "HappyChef",
31
30
  "license": "MIT",
32
31
  "peerDependencies": {
32
+ "react": "^16.8.0 || ^17.0.0 || ^18.0.0",
33
+ "react-dom": "^16.8.0 || ^17.0.0 || ^18.0.0",
33
34
  "axios": "^1.0.0",
34
35
  "framer-motion": "^10.0.0 || ^11.0.0 || ^12.0.0",
35
36
  "lottie-react": "^2.0.0",
36
- "react": "^16.8.0 || ^17.0.0 || ^18.0.0",
37
- "react-dom": "^16.8.0 || ^17.0.0 || ^18.0.0",
38
37
  "react-icons": "^4.0.0 || ^5.0.0"
39
38
  },
40
39
  "dependencies": {
40
+ "@happychef/algorithm": "^1.0.1",
41
41
  "moment-timezone": "^0.5.48"
42
42
  },
43
43
  "devDependencies": {
44
- "@happychef/algorithm": "^1.0.4",
44
+ "react": "^18.3.1",
45
+ "react-dom": "^18.3.1",
45
46
  "axios": "^1.7.9",
46
47
  "framer-motion": "^12.23.24",
47
48
  "lottie-react": "^2.4.1",
48
49
  "moment-timezone": "^0.5.48",
49
- "react": "^18.3.1",
50
- "react-dom": "^18.3.1",
51
50
  "react-icons": "^5.3.0",
52
- "tsup": "^8.5.1",
53
- "typescript": "^5.9.3"
51
+ "tsup": "^8.0.1",
52
+ "typescript": "^5.3.3"
54
53
  },
55
54
  "repository": {
56
55
  "type": "git",
package/dist/index.css DELETED
@@ -1,676 +0,0 @@
1
- /* src/styles/reservationSidebar.css */
2
-
3
- /* reservationSidebar.js */
4
-
5
- .reservation-sidebar-component {
6
- position: fixed;
7
- top: 0;
8
- right: -400px; /* Start off-screen */
9
- width: 400px;
10
- height: 100%;
11
- background-color: #fff;
12
- box-shadow: -2px 0 5px rgba(0,0,0,0.1);
13
- z-index: var(--z-index-sidebar-reservation); /* Updated z-index */
14
- display: flex;
15
- flex-direction: column;
16
- overflow-y: auto;
17
- transition: right 0.3s ease-in-out;
18
- }
19
-
20
- .admin-title {
21
- text-align: center;
22
- margin-bottom: 30px;
23
- }
24
-
25
- .reservation-sidebar-component.open {
26
- right: 0;
27
- }
28
-
29
- .reservation-sidebar-content {
30
- padding: 20px;
31
- padding-top: 60px; /* To make room for the close button */
32
- }
33
-
34
- .close-sidebar-button {
35
- position: absolute;
36
- top: 10px;
37
- left: 10px;
38
- background-color: transparent;
39
- border: none;
40
- cursor: pointer;
41
- }
42
-
43
- .close-sidebar-button svg {
44
- color: #000;
45
- }
46
-
47
- .sidebar-section-one,
48
- .sidebar-section-two {
49
- margin-bottom: 20px;
50
- }
51
-
52
- .reservation-footer {
53
- margin-top: auto;
54
- }
55
-
56
- .store-reservation-button {
57
- width: 100%;
58
- padding: 12px;
59
- background-color: var(--color-blue);
60
- color: #fff;
61
- border: none;
62
- border-radius: 5px;
63
- cursor: pointer;
64
- font-size: 1.1rem;
65
- }
66
-
67
- .open-sidebar-button {
68
- position: fixed;
69
- bottom: 20px;
70
- right: 20px;
71
- background-color: var(--color-blue);
72
- color: #fff;
73
- border: none;
74
- border-radius: 50%;
75
- width: 50px;
76
- height: 50px;
77
- cursor: pointer;
78
- z-index: var(--z-index-modal) !important;
79
- transition: all 0.3s ease;
80
- }
81
-
82
- .open-sidebar-button:hover {
83
- background-color: var(--color-blue-hover-accent) !important;
84
- }
85
-
86
- .open-sidebar-button svg {
87
- position: relative;
88
- top: 2px;
89
- }
90
-
91
- @media screen and (max-width: 480px) {
92
- .reservation-sidebar-component {
93
- width: 100%;
94
- }
95
- }
96
-
97
-
98
- .sidebar-section-personeel {
99
- margin-bottom: 10px;
100
- }
101
-
102
- /* src/styles/newReservationAdmin.css */
103
- /* newReservationAdmin.css */
104
-
105
-
106
- .account-manage-title {
107
- text-align: center;
108
- margin-bottom: 30px;
109
- }
110
-
111
- .account-manage-container {
112
- max-width: 800px;
113
- margin: 0 auto;
114
- }
115
-
116
- .account-manage-form {
117
- display: flex;
118
- flex-direction: column;
119
- gap: 15px;
120
- }
121
-
122
- .input-container {
123
- position: relative;
124
- }
125
-
126
- .input-icon {
127
- position: absolute;
128
- top: 50%;
129
- left: 10px;
130
- transform: translateY(-50%);
131
- color: #6c757d;
132
- pointer-events: none;
133
- }
134
-
135
- .input-container input,
136
- .input-container textarea {
137
- width: 100%;
138
- padding: 10px 10px 10px 35px;
139
- border: 1px solid #ccc;
140
- border-radius: 5px;
141
- font-size: 1rem;
142
- transition: border-color 0.3s ease;
143
- }
144
-
145
-
146
- .form-error {
147
- color: #dc3545;
148
- font-size: 0.9rem;
149
- margin-top: 5px;
150
- display: flex;
151
- align-items: center;
152
- gap: 5px;
153
- }
154
-
155
- .account-manage__button {
156
- padding: 12px;
157
- background-color: var(--color-blue);
158
- color: #fff;
159
- border: none;
160
- border-radius: 5px;
161
- cursor: pointer;
162
- font-size: 1.1rem;
163
- display: flex;
164
- align-items: center;
165
- justify-content: center;
166
- gap: 10px;
167
- transition: background-color 0.3s ease;
168
- }
169
-
170
-
171
- /* src/components/FormField/formField.css */
172
- /* src/components/FormField.css */
173
- .new-reservation-page .form-group .magic-tooltip {
174
- transition: transform 0.2s ease;
175
- transform-origin: bottom right;
176
- }
177
-
178
- .new-reservation-page .form-group .magic-tooltip:hover {
179
- transform: scale(1.05);
180
- }
181
-
182
-
183
- /* src/components/GiftcardSelection/giftcardSelection.css */
184
- /* src/Pages/NewReservation/css/giftcardSelection.css */
185
-
186
- .new-reservation-page .giftcard-selection {
187
- margin-bottom: 20px;
188
- }
189
-
190
- .new-reservation-page .giftcard-options {
191
- display: flex;
192
- gap: 20px;
193
- margin: 10px 0;
194
- }
195
-
196
- .new-reservation-page .giftcard-option {
197
- display: flex;
198
- align-items: center;
199
- gap: 8px;
200
- cursor: pointer;
201
- }
202
-
203
- .new-reservation-page .form-label {
204
- font-weight: 500;
205
- margin-bottom: 8px;
206
- display: block;
207
- }
208
-
209
- .new-reservation-page .giftcard-option input[type="radio"] {
210
- margin: 0;
211
- cursor: pointer;
212
- }
213
-
214
- .new-reservation-page .giftcard-option label {
215
- cursor: pointer;
216
- }
217
-
218
- /* src/components/ZitplaatsSelection/zitplaatsSelection.css */
219
- /* src/Pages/NewReservation/css/zitplaatsSelection.css */
220
-
221
- .new-reservation-page .zitplaats-selection {
222
- margin-bottom: 15px;
223
- }
224
-
225
- .new-reservation-page .zitplaats-selection select {
226
- width: 100%;
227
- padding: 10px;
228
- border-radius: 4px;
229
- border: 1px solid #ccc;
230
- background-color: white;
231
- }
232
-
233
- /* src/components/ReservationStepTwo/reservationStepTwo.css */
234
- /* Name Fields Container */
235
- .new-reservation-page .name-fields {
236
- display: flex;
237
- gap: 20px;
238
- }
239
-
240
- .input-container .form-control { /* New reservation prefix can't be added here*/
241
- display: flex;
242
- align-items: center;
243
- justify-content: space-between;
244
- width: 100%;
245
- padding: 10px;
246
- background-color: #fff;
247
- border: #ccc 1px solid;
248
- cursor: pointer;
249
- -webkit-user-select: none;
250
- user-select: none;
251
- text-align: left;
252
- border-radius: 5px;
253
- font-size: 16px;
254
- }
255
-
256
- /* src/components/ReservationSummary/reservationSummary.css */
257
- /* src/components/ReservationForm/css/reservationSummary.css */
258
-
259
- .new-reservation-page .reservation-sidebar-component .reservation-summary .modal-title {
260
- margin-top: 0;
261
- margin-bottom: 20px;
262
- }
263
-
264
- .new-reservation-page .reservation-sidebar-component .reservation-summary .reservation-details {
265
- list-style-type: none;
266
- padding: 0;
267
- margin: 0 0 20px 0;
268
- width: 100%;
269
- }
270
-
271
- .new-reservation-page .reservation-sidebar-component .reservation-summary .reservation-details li {
272
- margin-bottom: 10px;
273
- font-size: 15px;
274
- align-items: left;
275
- text-align: left;
276
- }
277
-
278
- .new-reservation-page .reservation-sidebar-component .reservation-summary .reservation-details li strong {
279
- font-weight: bold;
280
- }
281
-
282
- .new-reservation-page .reservation-sidebar-component .reservation-summary {
283
- align-items: left;
284
- }
285
-
286
-
287
- /* src/components/ReservationStepOne/css/timeSelector.css */
288
- /* src/components/NewReservation/css/timeSelector.css */
289
-
290
- .new-reservation-page .time-selector-container {
291
- position: relative;
292
- }
293
-
294
- .new-reservation-page .time-display {
295
- display: flex;
296
- align-items: center;
297
- justify-content: space-between;
298
- width: 100%;
299
- padding: 10px;
300
- background-color: #fff;
301
- border: #ccc 1px solid;
302
- cursor: pointer;
303
- user-select: none;
304
- text-align: left;
305
- border-radius: 5px;
306
- }
307
-
308
- .new-reservation-page .time-display span:first-child {
309
- flex-grow: 1;
310
- }
311
-
312
- .new-reservation-page .time-selector {
313
- position: absolute;
314
- z-index: 1000;
315
- width: 100%;
316
- max-height: 300px;
317
- overflow-y: auto;
318
- background-color: rgba(255, 255, 255, 1);
319
- border: 1px solid #ccc;
320
- margin-top: 5px;
321
- padding: 10px;
322
- border-radius: 10px;
323
- animation: fadeInTimeSelector 0.3s ease-in-out;
324
- top: 75px;
325
- }
326
-
327
- @keyframes fadeInTimeSelector {
328
- from {
329
- opacity: 0;
330
- }
331
- to {
332
- opacity: 1;
333
- }
334
- }
335
-
336
- .new-reservation-page .time-period {
337
- margin-bottom: 15px;
338
- }
339
-
340
- .new-reservation-page .time-period-label {
341
- font-weight: bold;
342
- margin-bottom: 5px;
343
- }
344
-
345
- .new-reservation-page .time-options {
346
- display: flex;
347
- flex-wrap: wrap;
348
- gap: 5px;
349
- }
350
-
351
- .new-reservation-page .time-option {
352
- padding: 8px 12px;
353
- background-color: #ccffcc; /* Green background for available times */
354
- color: #006600;
355
- border-radius: 5px;
356
- cursor: pointer;
357
- transition: background-color 0.2s ease;
358
- }
359
-
360
- .new-reservation-page .time-option:hover {
361
- background-color: #b3ffb3;
362
- }
363
-
364
- .new-reservation-page .time-option.selected {
365
- background-color: #006600;
366
- color: #ccffcc;
367
- }
368
-
369
- .new-reservation-page .info-text {
370
- color: #666;
371
- font-style: italic;
372
- }
373
-
374
- .new-reservation-page .arrow {
375
- margin-left: auto;
376
- color: gray;
377
- display: flex;
378
- align-items: center;
379
- }
380
-
381
- @media screen and (max-width: 480px) {
382
- .new-reservation-page .time-option {
383
- padding: 6px 10px;
384
- font-size: 14px;
385
- }
386
- }
387
-
388
-
389
- /* src/components/ReservationStepOne/css/calendar.css */
390
- /* calendar.css */
391
- .new-reservation-page .calendar-container {
392
- position: relative;
393
- width: 100%;
394
- }
395
-
396
- .new-reservation-page .calendar-container .calendar-display {
397
- display: flex;
398
- align-items: center;
399
- justify-content: space-between;
400
- width: 100%;
401
- padding: 10px;
402
- background-color: #fff;
403
- border: #ccc 1px solid;
404
- cursor: pointer;
405
- user-select: none;
406
- text-align: left;
407
- border-radius: 5px;
408
- }
409
-
410
- .new-reservation-page .calendar-container .calendar-display span:first-child {
411
- flex-grow: 1;
412
- }
413
-
414
- .new-reservation-page .calendar-container .calendar {
415
- position: absolute;
416
- z-index: 1000;
417
- width: 100%;
418
- background-color: rgba(255, 255, 255, 1);
419
- border: 1px solid #ccc;
420
- margin-top: 5px;
421
- padding: 10px;
422
- border-radius: 10px;
423
- animation: fadeInCalendar 0.3s ease-in-out;
424
- box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
425
- }
426
-
427
- @keyframes fadeInCalendar {
428
- from {
429
- opacity: 0;
430
- }
431
- to {
432
- opacity: 1;
433
- }
434
- }
435
-
436
- /* NEW: Beschikbaarheden press-and-hold button */
437
- .new-reservation-page .calendar-container .availability-hold-btn {
438
- font-size: 10px;
439
- }
440
-
441
-
442
- .new-reservation-page .calendar-container .calendar-header {
443
- display: flex;
444
- justify-content: space-between;
445
- align-items: center;
446
- margin-bottom: 10px;
447
- gap: 8px;
448
- flex-wrap: wrap;
449
- }
450
-
451
- .new-reservation-page .calendar-container .calendar-header button {
452
- background-color: transparent;
453
- border: none;
454
- cursor: pointer;
455
- font-size: 18px;
456
- }
457
-
458
- .new-reservation-page .calendar-container .calendar-header span {
459
- font-size: 15px;
460
- color: gray;
461
- font-weight: 500;
462
- }
463
-
464
- .new-reservation-page .calendar-container .calendar-weeks-wrapper {
465
- overflow: hidden;
466
- position: relative;
467
- width: 100%;
468
- }
469
-
470
- .new-reservation-page .calendar-container .calendar-table {
471
- width: 100%;
472
- border-collapse: collapse;
473
- }
474
-
475
- .new-reservation-page .calendar-container .calendar-table th,
476
- .new-reservation-page .calendar-container .calendar-table td {
477
- width: 14.28%;
478
- text-align: center;
479
- padding: 5px;
480
- }
481
-
482
- .calendar-container .calendar-table th {
483
- color: #666;
484
- font-weight: normal;
485
- padding-bottom: 10px;
486
- }
487
-
488
- .new-reservation-page .calendar-container .calendar-table td {
489
- vertical-align: middle;
490
- cursor: pointer;
491
- border: none;
492
- opacity: 1;
493
- position: relative; /* For badge positioning */
494
- }
495
-
496
- .new-reservation-page .calendar-container .calendar-table td.empty-day {
497
- cursor: default;
498
- }
499
-
500
- .new-reservation-page .calendar-container .calendar-table td:hover .day-square.available {
501
- transform: scale(1.05);
502
- }
503
-
504
- /* MINIMAL: Day square with clean layout */
505
- .new-reservation-page .calendar-container .day-square {
506
- position: relative;
507
- width: 38px;
508
- height: 38px;
509
- border-radius: 4px;
510
- display: inline-flex;
511
- align-items: center;
512
- justify-content: center;
513
- flex-direction: column;
514
- transition: all 0.2s ease;
515
- font-size: 16px;
516
- margin: 0 auto;
517
- }
518
-
519
- .new-reservation-page .calendar-container .day-number {
520
- line-height: 1;
521
- z-index: 2; /* Ensure number stays above background */
522
- }
523
-
524
- .new-reservation-page .calendar-container .available .day-square {
525
- background-color: #ccffcc;
526
- color: #006600;
527
- }
528
-
529
- .new-reservation-page .calendar-container .available:hover .day-square {
530
- background-color: #b3ffb3;
531
- }
532
-
533
- .new-reservation-page .calendar-container .available:active .day-square {
534
- background-color: #99ff99;
535
- }
536
-
537
- .new-reservation-page .calendar-container .unavailable .day-square {
538
- background-color: rgba(139, 0, 0, 0.13);
539
- color: darkred;
540
- }
541
-
542
- .new-reservation-page .calendar-container .gray-out .day-square {
543
- background-color: #e0e0e0;
544
- color: #999;
545
- cursor: not-allowed;
546
- }
547
-
548
- .new-reservation-page .calendar-container .selected .day-square {
549
- background-color: #006600;
550
- color: #ccffcc;
551
- }
552
-
553
- .new-reservation-page .calendar-container .calendar-table td.unavailable,
554
- .new-reservation-page .calendar-container .calendar-table td.gray-out {
555
- cursor: not-allowed;
556
- }
557
-
558
- .new-reservation-page .calendar-container .calendar-table td.unavailable:hover .day-square,
559
- .new-reservation-page .calendar-container .calendar-table td.gray-out:hover .day-square {
560
- transform: none;
561
- }
562
-
563
- .new-reservation-page .calendar-container .calendar-table td {
564
- border: none;
565
- }
566
-
567
- .new-reservation-page .calendar-container .arrow {
568
- margin-left: auto;
569
- color: gray;
570
- display: flex;
571
- align-items: center;
572
- }
573
-
574
- /* Only show badge for available dates with actual capacity */
575
- .new-reservation-page .calendar-container .available .availability-badge {
576
- background: #38a169;
577
- }
578
-
579
- .new-reservation-page .calendar-container .selected .availability-badge {
580
- background: #2d3748;
581
- }
582
-
583
- @media screen and (max-width: 900px) {
584
- .calendar-container .day-square {
585
- width: 35px !important;
586
- height: 35px !important;
587
- font-size: 15px !important;
588
- }
589
-
590
- .calendar-container .calendar-header span {
591
- font-size: 12px;
592
- }
593
-
594
- /* Make availability button more compact on mobile */
595
- .new-reservation-page .calendar-container .availability-toggle-btn {
596
- padding: 5px 8px;
597
- font-size: 11px;
598
- }
599
- }
600
-
601
- /* src/components/ReservationStepOne/css/valueSelector.css */
602
- /* Use the same CSS provided, adjusted for the value selector */
603
-
604
- .new-reservation-page .value-selector {
605
- display: flex;
606
- flex-direction: column;
607
- gap: 15px;
608
- margin-bottom: 20px;
609
- }
610
-
611
- .new-reservation-page .non-absolute {
612
- position: relative !important;
613
- }
614
-
615
- .new-reservation-page .non-absolute::before {
616
- background: none;
617
- }
618
-
619
- .new-reservation-page .predefined-values {
620
- display: flex;
621
- gap: 10px;
622
- }
623
-
624
- .new-reservation-page .predefined-value-button {
625
- flex: 1;
626
- padding: 10px;
627
- border: 1px solid #ccc;
628
- border-radius: var(--border-radius);
629
- background-color: var(--color-white);
630
- cursor: pointer;
631
- font-size: 1rem;
632
- transition: background-color 0.3s ease;
633
- }
634
-
635
- .new-reservation-page .predefined-value-button.active,
636
- .new-reservation-page .predefined-value-button:hover {
637
- background-color: var(--color-blue);
638
- color: var(--color-white);
639
- }
640
-
641
- .new-reservation-page .slider-container {
642
- display: flex;
643
- align-items: center;
644
- gap: 15px;
645
- }
646
-
647
- .new-reservation-page .slider {
648
- flex: 1;
649
- appearance: none;
650
- -webkit-appearance: none;
651
- height: 5px;
652
- background: #ddd;
653
- border-radius: 5px;
654
- outline: none;
655
- }
656
-
657
- .new-reservation-page .slider::-webkit-slider-thumb {
658
- -webkit-appearance: none;
659
- appearance: none;
660
- width: 20px;
661
- height: 20px;
662
- background: var(--color-blue);
663
- cursor: pointer;
664
- border-radius: 50%;
665
- }
666
-
667
- .new-reservation-page .value-input {
668
- width: 80px;
669
- padding: 10px;
670
- border: 1px solid #ccc;
671
- border-radius: var(--border-radius);
672
- font-size: 1rem;
673
- }
674
-
675
-
676
-