@dododog/ui 0.14.1 → 0.15.0
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/chunk-5KOWMIWK.mjs +110 -0
- package/dist/{chunk-MCF3EQTV.js → chunk-73BHQJW6.js} +13 -1
- package/dist/{chunk-U3XWNFHH.js → chunk-A3M3XQ35.js} +96 -29
- package/dist/chunk-BKM5VCUS.mjs +569 -0
- package/dist/{chunk-333YD5QI.mjs → chunk-EAATIFYL.mjs} +40 -6
- package/dist/chunk-FLKEMER2.js +592 -0
- package/dist/{chunk-I4S3R6C6.js → chunk-JUB3NGJR.js} +51 -6
- package/dist/chunk-JWQ2OUEG.js +132 -0
- package/dist/{chunk-3R7PT3JG.js → chunk-LJSMPON7.js} +40 -6
- package/dist/{chunk-DMCMWOBJ.mjs → chunk-PBXH4I5N.mjs} +51 -6
- package/dist/{chunk-ERL3WXNY.mjs → chunk-PZZWQ6IG.mjs} +5 -5
- package/dist/{chunk-GBWVIY3C.mjs → chunk-UJEIFKSK.mjs} +96 -29
- package/dist/chunk-WY24TZ4R.mjs +94 -0
- package/dist/chunk-XBNIHUSG.js +116 -0
- package/dist/{chunk-TDGU5Y2P.js → chunk-XOFTU3T7.js} +5 -5
- package/dist/{chunk-NZ7GF6RF.mjs → chunk-YOMOULLR.mjs} +13 -1
- package/dist/components/Accordion/index.js +2 -2
- package/dist/components/Accordion/index.mjs +1 -1
- package/dist/components/Counter/index.d.mts +12 -0
- package/dist/components/Counter/index.d.ts +12 -0
- package/dist/components/Counter/index.js +2 -2
- package/dist/components/Counter/index.mjs +1 -1
- package/dist/components/DateRangePicker/index.d.mts +7 -1
- package/dist/components/DateRangePicker/index.d.ts +7 -1
- package/dist/components/DateRangePicker/index.js +3 -3
- package/dist/components/DateRangePicker/index.mjs +1 -1
- package/dist/components/Drawer/index.d.mts +21 -1
- package/dist/components/Drawer/index.d.ts +21 -1
- package/dist/components/Drawer/index.js +2 -2
- package/dist/components/Drawer/index.mjs +1 -1
- package/dist/components/DualRangeSlider/index.js +2 -2
- package/dist/components/DualRangeSlider/index.mjs +1 -1
- package/dist/components/Lightbox/index.d.mts +2 -0
- package/dist/components/Lightbox/index.d.ts +2 -0
- package/dist/components/Lightbox/index.js +2 -2
- package/dist/components/Lightbox/index.mjs +1 -1
- package/dist/components/Select/index.d.mts +8 -0
- package/dist/components/Select/index.d.ts +8 -0
- package/dist/components/Select/index.js +3 -3
- package/dist/components/Select/index.mjs +1 -1
- package/dist/components/Switch/index.d.mts +41 -1
- package/dist/components/Switch/index.d.ts +41 -1
- package/dist/components/Switch/index.js +4 -4
- package/dist/components/Switch/index.mjs +1 -1
- package/dist/index.js +47 -47
- package/dist/index.mjs +15 -15
- package/package.json +1 -1
- package/dist/chunk-AIA3NHCK.js +0 -373
- package/dist/chunk-FL3GD5FJ.mjs +0 -350
- package/dist/chunk-LRNSVRUN.mjs +0 -55
- package/dist/chunk-T4AT3YCT.js +0 -77
- package/dist/chunk-VWFY24XF.js +0 -89
- package/dist/chunk-ZLF7IL3Y.mjs +0 -67
package/dist/chunk-AIA3NHCK.js
DELETED
|
@@ -1,373 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
var chunkADIDI7AJ_js = require('./chunk-ADIDI7AJ.js');
|
|
4
|
-
var React = require('react');
|
|
5
|
-
var jsxRuntime = require('react/jsx-runtime');
|
|
6
|
-
|
|
7
|
-
function _interopNamespace(e) {
|
|
8
|
-
if (e && e.__esModule) return e;
|
|
9
|
-
var n = Object.create(null);
|
|
10
|
-
if (e) {
|
|
11
|
-
Object.keys(e).forEach(function (k) {
|
|
12
|
-
if (k !== 'default') {
|
|
13
|
-
var d = Object.getOwnPropertyDescriptor(e, k);
|
|
14
|
-
Object.defineProperty(n, k, d.get ? d : {
|
|
15
|
-
enumerable: true,
|
|
16
|
-
get: function () { return e[k]; }
|
|
17
|
-
});
|
|
18
|
-
}
|
|
19
|
-
});
|
|
20
|
-
}
|
|
21
|
-
n.default = e;
|
|
22
|
-
return Object.freeze(n);
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
var React__namespace = /*#__PURE__*/_interopNamespace(React);
|
|
26
|
-
|
|
27
|
-
function startOfDay(d) {
|
|
28
|
-
const r = new Date(d);
|
|
29
|
-
r.setHours(0, 0, 0, 0);
|
|
30
|
-
return r;
|
|
31
|
-
}
|
|
32
|
-
function addMonths(d, n) {
|
|
33
|
-
const r = new Date(d);
|
|
34
|
-
r.setMonth(r.getMonth() + n);
|
|
35
|
-
return r;
|
|
36
|
-
}
|
|
37
|
-
function isSameDay(a, b) {
|
|
38
|
-
return a.getFullYear() === b.getFullYear() && a.getMonth() === b.getMonth() && a.getDate() === b.getDate();
|
|
39
|
-
}
|
|
40
|
-
function isBefore(a, b) {
|
|
41
|
-
return startOfDay(a).getTime() < startOfDay(b).getTime();
|
|
42
|
-
}
|
|
43
|
-
function isAfter(a, b) {
|
|
44
|
-
return startOfDay(a).getTime() > startOfDay(b).getTime();
|
|
45
|
-
}
|
|
46
|
-
function isSameMonth(a, b) {
|
|
47
|
-
return a.getFullYear() === b.getFullYear() && a.getMonth() === b.getMonth();
|
|
48
|
-
}
|
|
49
|
-
var MONTH_NAMES = [
|
|
50
|
-
"janvier",
|
|
51
|
-
"f\xE9vrier",
|
|
52
|
-
"mars",
|
|
53
|
-
"avril",
|
|
54
|
-
"mai",
|
|
55
|
-
"juin",
|
|
56
|
-
"juillet",
|
|
57
|
-
"ao\xFBt",
|
|
58
|
-
"septembre",
|
|
59
|
-
"octobre",
|
|
60
|
-
"novembre",
|
|
61
|
-
"d\xE9cembre"
|
|
62
|
-
];
|
|
63
|
-
var SHORT_MONTHS = [
|
|
64
|
-
"janv.",
|
|
65
|
-
"f\xE9vr.",
|
|
66
|
-
"mars",
|
|
67
|
-
"avr.",
|
|
68
|
-
"mai",
|
|
69
|
-
"juin",
|
|
70
|
-
"juil.",
|
|
71
|
-
"ao\xFBt",
|
|
72
|
-
"sept.",
|
|
73
|
-
"oct.",
|
|
74
|
-
"nov.",
|
|
75
|
-
"d\xE9c."
|
|
76
|
-
];
|
|
77
|
-
var WEEK_DAYS = ["lu", "ma", "me", "je", "ve", "sa", "di"];
|
|
78
|
-
function formatMonthYear(d) {
|
|
79
|
-
return `${MONTH_NAMES[d.getMonth()]} ${d.getFullYear()}`;
|
|
80
|
-
}
|
|
81
|
-
function formatShortDate(d) {
|
|
82
|
-
return `${d.getDate()} ${SHORT_MONTHS[d.getMonth()]}`;
|
|
83
|
-
}
|
|
84
|
-
function getCalendarDays(month) {
|
|
85
|
-
const first = new Date(month.getFullYear(), month.getMonth(), 1);
|
|
86
|
-
const dayOfWeek = (first.getDay() + 6) % 7;
|
|
87
|
-
const start = new Date(first);
|
|
88
|
-
start.setDate(start.getDate() - dayOfWeek);
|
|
89
|
-
const last = new Date(month.getFullYear(), month.getMonth() + 1, 0);
|
|
90
|
-
const dayOfWeekEnd = (last.getDay() + 6) % 7;
|
|
91
|
-
const end = new Date(last);
|
|
92
|
-
end.setDate(end.getDate() + (6 - dayOfWeekEnd));
|
|
93
|
-
const days = [];
|
|
94
|
-
const cursor = new Date(start);
|
|
95
|
-
while (cursor <= end) {
|
|
96
|
-
days.push(new Date(cursor));
|
|
97
|
-
cursor.setDate(cursor.getDate() + 1);
|
|
98
|
-
}
|
|
99
|
-
return days;
|
|
100
|
-
}
|
|
101
|
-
function DatePickerInput({
|
|
102
|
-
label,
|
|
103
|
-
value,
|
|
104
|
-
placeholder = "Quand ?",
|
|
105
|
-
isActive,
|
|
106
|
-
onClick,
|
|
107
|
-
onClear,
|
|
108
|
-
showClear = false
|
|
109
|
-
}) {
|
|
110
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
111
|
-
"div",
|
|
112
|
-
{
|
|
113
|
-
className: "relative flex-1 px-4 py-2 border-b md:border-b-0 md:border-r border-gray-200 transition-all text-left cursor-pointer",
|
|
114
|
-
onClick,
|
|
115
|
-
children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center justify-between", children: [
|
|
116
|
-
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex-1", children: [
|
|
117
|
-
/* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-xs font-medium text-gray-500 mb-0.5", children: label }),
|
|
118
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
119
|
-
"p",
|
|
120
|
-
{
|
|
121
|
-
className: chunkADIDI7AJ_js.cn(
|
|
122
|
-
"text-base font-medium text-primary whitespace-nowrap",
|
|
123
|
-
isActive && value && "underline decoration-secondary decoration-2 underline-offset-4"
|
|
124
|
-
),
|
|
125
|
-
children: value ? formatShortDate(value) : /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-gray-400", children: placeholder })
|
|
126
|
-
}
|
|
127
|
-
)
|
|
128
|
-
] }),
|
|
129
|
-
showClear && value && isActive && onClear && /* @__PURE__ */ jsxRuntime.jsx(
|
|
130
|
-
"button",
|
|
131
|
-
{
|
|
132
|
-
onClick: (e) => {
|
|
133
|
-
e.stopPropagation();
|
|
134
|
-
onClear();
|
|
135
|
-
},
|
|
136
|
-
className: "p-1 hover:bg-gray-100 rounded-full transition-colors",
|
|
137
|
-
children: /* @__PURE__ */ jsxRuntime.jsxs("svg", { xmlns: "http://www.w3.org/2000/svg", width: "20", height: "20", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", className: "text-gray-400", children: [
|
|
138
|
-
/* @__PURE__ */ jsxRuntime.jsx("path", { d: "M18 6 6 18" }),
|
|
139
|
-
/* @__PURE__ */ jsxRuntime.jsx("path", { d: "m6 6 12 12" })
|
|
140
|
-
] })
|
|
141
|
-
}
|
|
142
|
-
)
|
|
143
|
-
] })
|
|
144
|
-
}
|
|
145
|
-
);
|
|
146
|
-
}
|
|
147
|
-
var DateRangePicker = React__namespace.forwardRef(
|
|
148
|
-
({
|
|
149
|
-
checkIn,
|
|
150
|
-
checkOut,
|
|
151
|
-
onCheckInChange,
|
|
152
|
-
onCheckOutChange,
|
|
153
|
-
isOpen,
|
|
154
|
-
onClose,
|
|
155
|
-
position = "center",
|
|
156
|
-
minWidth = 800
|
|
157
|
-
}, forwardedRef) => {
|
|
158
|
-
const [calendarMonth, setCalendarMonth] = React__namespace.useState(() => checkIn || /* @__PURE__ */ new Date());
|
|
159
|
-
const [activeDateField, setActiveDateField] = React__namespace.useState("arrival");
|
|
160
|
-
const [isMobile, setIsMobile] = React__namespace.useState(false);
|
|
161
|
-
const [isNarrow, setIsNarrow] = React__namespace.useState(false);
|
|
162
|
-
const internalRef = React__namespace.useRef(null);
|
|
163
|
-
const setRefs = React__namespace.useCallback(
|
|
164
|
-
(node) => {
|
|
165
|
-
internalRef.current = node;
|
|
166
|
-
if (typeof forwardedRef === "function") forwardedRef(node);
|
|
167
|
-
else if (forwardedRef) forwardedRef.current = node;
|
|
168
|
-
},
|
|
169
|
-
[forwardedRef]
|
|
170
|
-
);
|
|
171
|
-
React__namespace.useEffect(() => {
|
|
172
|
-
const mq = window.matchMedia("(max-width: 767px)");
|
|
173
|
-
setIsMobile(mq.matches);
|
|
174
|
-
const handler = (e) => setIsMobile(e.matches);
|
|
175
|
-
mq.addEventListener("change", handler);
|
|
176
|
-
return () => mq.removeEventListener("change", handler);
|
|
177
|
-
}, []);
|
|
178
|
-
React__namespace.useEffect(() => {
|
|
179
|
-
const checkNarrow = () => setIsNarrow(window.innerWidth < minWidth + 64);
|
|
180
|
-
checkNarrow();
|
|
181
|
-
window.addEventListener("resize", checkNarrow);
|
|
182
|
-
return () => window.removeEventListener("resize", checkNarrow);
|
|
183
|
-
}, [minWidth]);
|
|
184
|
-
React__namespace.useEffect(() => {
|
|
185
|
-
if (isOpen) {
|
|
186
|
-
setActiveDateField("arrival");
|
|
187
|
-
if (checkIn) setCalendarMonth(checkIn);
|
|
188
|
-
}
|
|
189
|
-
}, [isOpen]);
|
|
190
|
-
React__namespace.useEffect(() => {
|
|
191
|
-
if (isOpen && isMobile) {
|
|
192
|
-
document.body.style.overflow = "hidden";
|
|
193
|
-
return () => {
|
|
194
|
-
document.body.style.overflow = "";
|
|
195
|
-
};
|
|
196
|
-
}
|
|
197
|
-
}, [isOpen, isMobile]);
|
|
198
|
-
React__namespace.useEffect(() => {
|
|
199
|
-
if (isMobile || !isOpen) return;
|
|
200
|
-
const handleClickOutside = (event) => {
|
|
201
|
-
if (internalRef.current && !internalRef.current.contains(event.target)) {
|
|
202
|
-
onClose();
|
|
203
|
-
}
|
|
204
|
-
};
|
|
205
|
-
document.addEventListener("mousedown", handleClickOutside);
|
|
206
|
-
return () => document.removeEventListener("mousedown", handleClickOutside);
|
|
207
|
-
}, [isOpen, onClose, isMobile]);
|
|
208
|
-
const handleDateClick = (date) => {
|
|
209
|
-
if (activeDateField === "arrival") {
|
|
210
|
-
onCheckInChange(date);
|
|
211
|
-
if (checkOut && isBefore(checkOut, date)) onCheckOutChange(null);
|
|
212
|
-
setActiveDateField("departure");
|
|
213
|
-
} else {
|
|
214
|
-
if (checkIn && isBefore(date, checkIn)) {
|
|
215
|
-
onCheckInChange(date);
|
|
216
|
-
onCheckOutChange(null);
|
|
217
|
-
setActiveDateField("departure");
|
|
218
|
-
} else {
|
|
219
|
-
onCheckOutChange(date);
|
|
220
|
-
if (isMobile) onClose();
|
|
221
|
-
}
|
|
222
|
-
}
|
|
223
|
-
};
|
|
224
|
-
const clearDates = () => {
|
|
225
|
-
onCheckInChange(null);
|
|
226
|
-
onCheckOutChange(null);
|
|
227
|
-
setActiveDateField("arrival");
|
|
228
|
-
};
|
|
229
|
-
const isDateInRange = (date) => {
|
|
230
|
-
if (!checkIn || !checkOut) return false;
|
|
231
|
-
return isAfter(date, checkIn) && isBefore(date, checkOut);
|
|
232
|
-
};
|
|
233
|
-
const isDateDisabled = (date) => {
|
|
234
|
-
const today = startOfDay(/* @__PURE__ */ new Date());
|
|
235
|
-
return isBefore(date, today);
|
|
236
|
-
};
|
|
237
|
-
const renderMonth = (monthDate, compact = false) => {
|
|
238
|
-
const days = getCalendarDays(monthDate);
|
|
239
|
-
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex-1", children: [
|
|
240
|
-
!compact && /* @__PURE__ */ jsxRuntime.jsx("h3", { className: "text-center font-semibold text-2xl text-primary mb-6 capitalize", children: formatMonthYear(monthDate) }),
|
|
241
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { className: chunkADIDI7AJ_js.cn("grid grid-cols-7", compact ? "mb-2" : "mb-3"), children: WEEK_DAYS.map((day) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
242
|
-
"div",
|
|
243
|
-
{
|
|
244
|
-
className: chunkADIDI7AJ_js.cn(
|
|
245
|
-
"text-center font-medium text-gray-500 py-2",
|
|
246
|
-
compact ? "text-xs" : "text-base"
|
|
247
|
-
),
|
|
248
|
-
children: day
|
|
249
|
-
},
|
|
250
|
-
day
|
|
251
|
-
)) }),
|
|
252
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "grid grid-cols-7", children: days.map((day, index) => {
|
|
253
|
-
const isCurrentMonth = isSameMonth(day, monthDate);
|
|
254
|
-
const isSelected = checkIn && isSameDay(day, checkIn) || checkOut && isSameDay(day, checkOut);
|
|
255
|
-
const isStart = checkIn && isSameDay(day, checkIn);
|
|
256
|
-
const isEnd = checkOut && isSameDay(day, checkOut);
|
|
257
|
-
const inRange = isDateInRange(day) && isCurrentMonth;
|
|
258
|
-
const disabled = isDateDisabled(day) || !isCurrentMonth;
|
|
259
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
260
|
-
"button",
|
|
261
|
-
{
|
|
262
|
-
type: "button",
|
|
263
|
-
onClick: () => !disabled && handleDateClick(day),
|
|
264
|
-
disabled,
|
|
265
|
-
className: chunkADIDI7AJ_js.cn(
|
|
266
|
-
"relative font-medium transition-all",
|
|
267
|
-
compact ? "h-10 text-sm" : "h-12 text-base",
|
|
268
|
-
!isCurrentMonth && "text-gray-300",
|
|
269
|
-
disabled && isCurrentMonth && "text-gray-300 cursor-not-allowed",
|
|
270
|
-
inRange && "bg-orange-100",
|
|
271
|
-
isSelected && "bg-secondary text-white z-10",
|
|
272
|
-
isStart && checkOut && "rounded-l-lg",
|
|
273
|
-
isEnd && checkIn && "rounded-r-lg",
|
|
274
|
-
isSelected && (!checkOut || !checkIn) && "rounded-lg",
|
|
275
|
-
isSelected && checkIn && checkOut && isSameDay(checkIn, checkOut) && "rounded-lg",
|
|
276
|
-
!disabled && !isSelected && !inRange && isCurrentMonth && "text-primary hover:bg-gray-100 hover:rounded-lg"
|
|
277
|
-
),
|
|
278
|
-
children: isCurrentMonth && day.getDate()
|
|
279
|
-
},
|
|
280
|
-
index
|
|
281
|
-
);
|
|
282
|
-
}) })
|
|
283
|
-
] });
|
|
284
|
-
};
|
|
285
|
-
if (!isOpen) return null;
|
|
286
|
-
if (isMobile) {
|
|
287
|
-
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "fixed inset-0 z-[60] bg-white flex flex-col", children: [
|
|
288
|
-
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center justify-between px-4 py-3 border-b border-gray-100", children: [
|
|
289
|
-
/* @__PURE__ */ jsxRuntime.jsx("h2", { className: "font-heading font-bold text-lg text-primary", children: "S\xE9lectionnez vos dates" }),
|
|
290
|
-
/* @__PURE__ */ jsxRuntime.jsx("button", { onClick: onClose, className: "p-2 hover:bg-gray-100 rounded-full transition-colors", children: /* @__PURE__ */ jsxRuntime.jsxs("svg", { xmlns: "http://www.w3.org/2000/svg", width: "20", height: "20", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", className: "text-gray-600", children: [
|
|
291
|
-
/* @__PURE__ */ jsxRuntime.jsx("path", { d: "M18 6 6 18" }),
|
|
292
|
-
/* @__PURE__ */ jsxRuntime.jsx("path", { d: "m6 6 12 12" })
|
|
293
|
-
] }) })
|
|
294
|
-
] }),
|
|
295
|
-
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex gap-3 px-4 py-3 border-b border-gray-100", children: [
|
|
296
|
-
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
297
|
-
"button",
|
|
298
|
-
{
|
|
299
|
-
onClick: () => setActiveDateField("arrival"),
|
|
300
|
-
className: chunkADIDI7AJ_js.cn(
|
|
301
|
-
"flex-1 px-3 py-2 rounded-xl text-left transition-all",
|
|
302
|
-
activeDateField === "arrival" ? "ring-2 ring-secondary bg-secondary/5" : "bg-gray-100"
|
|
303
|
-
),
|
|
304
|
-
children: [
|
|
305
|
-
/* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-xs font-medium text-gray-500", children: "Arriv\xE9e" }),
|
|
306
|
-
/* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm font-semibold text-primary", children: checkIn ? `${checkIn.getDate()} ${SHORT_MONTHS[checkIn.getMonth()]} ${checkIn.getFullYear()}` : "S\xE9lectionner" })
|
|
307
|
-
]
|
|
308
|
-
}
|
|
309
|
-
),
|
|
310
|
-
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
311
|
-
"button",
|
|
312
|
-
{
|
|
313
|
-
onClick: () => setActiveDateField("departure"),
|
|
314
|
-
className: chunkADIDI7AJ_js.cn(
|
|
315
|
-
"flex-1 px-3 py-2 rounded-xl text-left transition-all",
|
|
316
|
-
activeDateField === "departure" ? "ring-2 ring-secondary bg-secondary/5" : "bg-gray-100"
|
|
317
|
-
),
|
|
318
|
-
children: [
|
|
319
|
-
/* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-xs font-medium text-gray-500", children: "D\xE9part" }),
|
|
320
|
-
/* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm font-semibold text-primary", children: checkOut ? `${checkOut.getDate()} ${SHORT_MONTHS[checkOut.getMonth()]} ${checkOut.getFullYear()}` : "S\xE9lectionner" })
|
|
321
|
-
]
|
|
322
|
-
}
|
|
323
|
-
)
|
|
324
|
-
] }),
|
|
325
|
-
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex-1 overflow-y-auto px-4 py-4", children: [
|
|
326
|
-
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center justify-between mb-4", children: [
|
|
327
|
-
/* @__PURE__ */ jsxRuntime.jsx("button", { onClick: () => setCalendarMonth(addMonths(calendarMonth, -1)), className: "p-2 hover:bg-gray-100 rounded-full transition-colors", children: /* @__PURE__ */ jsxRuntime.jsx("svg", { xmlns: "http://www.w3.org/2000/svg", width: "20", height: "20", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", className: "text-gray-600", children: /* @__PURE__ */ jsxRuntime.jsx("path", { d: "m15 18-6-6 6-6" }) }) }),
|
|
328
|
-
/* @__PURE__ */ jsxRuntime.jsx("h3", { className: "font-semibold text-lg text-primary capitalize", children: formatMonthYear(calendarMonth) }),
|
|
329
|
-
/* @__PURE__ */ jsxRuntime.jsx("button", { onClick: () => setCalendarMonth(addMonths(calendarMonth, 1)), className: "p-2 hover:bg-gray-100 rounded-full transition-colors", children: /* @__PURE__ */ jsxRuntime.jsx("svg", { xmlns: "http://www.w3.org/2000/svg", width: "20", height: "20", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", className: "text-gray-600", children: /* @__PURE__ */ jsxRuntime.jsx("path", { d: "m9 18 6-6-6-6" }) }) })
|
|
330
|
-
] }),
|
|
331
|
-
renderMonth(calendarMonth, true)
|
|
332
|
-
] }),
|
|
333
|
-
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "border-t border-gray-100 px-4 py-3 flex items-center justify-between bg-white", children: [
|
|
334
|
-
checkIn || checkOut ? /* @__PURE__ */ jsxRuntime.jsx("button", { onClick: clearDates, className: "text-sm text-primary underline hover:text-secondary transition-colors", children: "Effacer" }) : /* @__PURE__ */ jsxRuntime.jsx("div", {}),
|
|
335
|
-
/* @__PURE__ */ jsxRuntime.jsx("button", { onClick: onClose, className: "px-6 py-2.5 bg-secondary text-white rounded-xl font-semibold text-sm hover:bg-secondary-dark transition-colors", children: "Valider" })
|
|
336
|
-
] })
|
|
337
|
-
] });
|
|
338
|
-
}
|
|
339
|
-
const positionClasses = {
|
|
340
|
-
left: "left-0",
|
|
341
|
-
center: "left-1/2 -translate-x-1/2",
|
|
342
|
-
right: "right-0"
|
|
343
|
-
};
|
|
344
|
-
const singleMonth = isNarrow;
|
|
345
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
346
|
-
"div",
|
|
347
|
-
{
|
|
348
|
-
ref: setRefs,
|
|
349
|
-
className: chunkADIDI7AJ_js.cn(
|
|
350
|
-
"absolute top-full mt-2 bg-white rounded-3xl shadow-2xl border z-[60] p-8 pb-10",
|
|
351
|
-
positionClasses[position]
|
|
352
|
-
),
|
|
353
|
-
style: singleMonth ? { width: "100%", maxWidth: "400px" } : { minWidth: `${minWidth}px` },
|
|
354
|
-
children: [
|
|
355
|
-
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center justify-between mb-4", children: [
|
|
356
|
-
/* @__PURE__ */ jsxRuntime.jsx("button", { onClick: () => setCalendarMonth(addMonths(calendarMonth, -1)), className: "p-2 hover:bg-gray-100 rounded-full transition-colors", children: /* @__PURE__ */ jsxRuntime.jsx("svg", { xmlns: "http://www.w3.org/2000/svg", width: "20", height: "20", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", className: "text-gray-600", children: /* @__PURE__ */ jsxRuntime.jsx("path", { d: "m15 18-6-6 6-6" }) }) }),
|
|
357
|
-
singleMonth && /* @__PURE__ */ jsxRuntime.jsx("h3", { className: "font-semibold text-lg text-primary capitalize", children: formatMonthYear(calendarMonth) }),
|
|
358
|
-
/* @__PURE__ */ jsxRuntime.jsx("button", { onClick: () => setCalendarMonth(addMonths(calendarMonth, 1)), className: "p-2 hover:bg-gray-100 rounded-full transition-colors", children: /* @__PURE__ */ jsxRuntime.jsx("svg", { xmlns: "http://www.w3.org/2000/svg", width: "20", height: "20", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", className: "text-gray-600", children: /* @__PURE__ */ jsxRuntime.jsx("path", { d: "m9 18 6-6-6-6" }) }) })
|
|
359
|
-
] }),
|
|
360
|
-
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: singleMonth ? "" : "flex gap-12", children: [
|
|
361
|
-
renderMonth(calendarMonth, singleMonth),
|
|
362
|
-
!singleMonth && renderMonth(addMonths(calendarMonth, 1))
|
|
363
|
-
] }),
|
|
364
|
-
(checkIn || checkOut) && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-right mt-4 pt-4 border-t border-gray-100", children: /* @__PURE__ */ jsxRuntime.jsx("button", { onClick: clearDates, className: "text-sm text-primary underline hover:text-secondary transition-colors", children: "Effacer les dates" }) })
|
|
365
|
-
]
|
|
366
|
-
}
|
|
367
|
-
);
|
|
368
|
-
}
|
|
369
|
-
);
|
|
370
|
-
DateRangePicker.displayName = "DateRangePicker";
|
|
371
|
-
|
|
372
|
-
exports.DatePickerInput = DatePickerInput;
|
|
373
|
-
exports.DateRangePicker = DateRangePicker;
|