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