@krosoft/react 0.0.102 → 0.0.103

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 (52) hide show
  1. package/dist/{AppSubTitle-DBxJVB46.js → AppSubTitle-Cr3zbmee.js} +1 -1
  2. package/dist/{AppTitle-DDQoaHBb.js → AppTitle-eazxzYGa.js} +1 -1
  3. package/dist/{AppVerticalTabs-CYx0jMXp.js → AppVerticalTabs-ujb4jtNi.js} +2 -2
  4. package/dist/ConfirmationDialog-B41OAAmc.js +257 -0
  5. package/dist/{DataTable-CtzBzpP-.js → DataTable-jrFyuw67.js} +1 -1
  6. package/dist/GenericForm-D3Gxh9kf.js +11365 -0
  7. package/dist/{ImageInput-DVMsk_kn.js → ImageInput-BcGHoduc.js} +1 -1
  8. package/dist/{MetricCard-CFwSSiQY.js → MetricCard-CXDB0msa.js} +1 -1
  9. package/dist/MultiSelect-Bc0Re1XN.js +137 -0
  10. package/dist/SearchInput-DFrIqONH.js +586 -0
  11. package/dist/{TableFilter-DGFQNbZ_.js → TableFilter-CK8NyawM.js} +27 -26
  12. package/dist/components/core/cards/index.js +1 -1
  13. package/dist/components/core/dialogs/FormDialog.d.ts +6 -18
  14. package/dist/components/core/dialogs/FormDialog.d.ts.map +1 -1
  15. package/dist/components/core/dialogs/index.d.ts +1 -1
  16. package/dist/components/core/dialogs/index.d.ts.map +1 -1
  17. package/dist/components/core/dialogs/index.js +2 -2
  18. package/dist/components/core/filters/index.js +1 -1
  19. package/dist/components/core/forms/GenericForm.d.ts +57 -0
  20. package/dist/components/core/forms/GenericForm.d.ts.map +1 -0
  21. package/dist/components/core/forms/index.d.ts +2 -0
  22. package/dist/components/core/forms/index.d.ts.map +1 -0
  23. package/dist/components/core/forms/index.js +4 -0
  24. package/dist/components/core/index.d.ts +1 -0
  25. package/dist/components/core/index.d.ts.map +1 -1
  26. package/dist/components/core/index.js +48 -45
  27. package/dist/components/core/inputs/MultiSelect.d.ts +2 -1
  28. package/dist/components/core/inputs/MultiSelect.d.ts.map +1 -1
  29. package/dist/components/core/inputs/index.js +8 -7
  30. package/dist/components/core/layouts/index.js +2 -2
  31. package/dist/components/core/table/index.js +1 -1
  32. package/dist/components/core/tabs/index.js +1 -1
  33. package/dist/components/index.js +100 -97
  34. package/dist/components/ui/index.js +2 -2
  35. package/dist/{toaster-BTQcWjuV.js → toaster-CtADevTu.js} +1 -1
  36. package/dist/{toggle-group-6CH5BRLO.js → toggle-group-Cnfwf4uy.js} +8376 -7317
  37. package/dist/types/forms/FieldType.d.ts +2 -0
  38. package/dist/types/forms/FieldType.d.ts.map +1 -0
  39. package/dist/types/forms/FormField.d.ts +40 -0
  40. package/dist/types/forms/FormField.d.ts.map +1 -0
  41. package/dist/types/forms/FormSchema.d.ts +6 -0
  42. package/dist/types/forms/FormSchema.d.ts.map +1 -0
  43. package/dist/types/forms/FormSection.d.ts +12 -0
  44. package/dist/types/forms/FormSection.d.ts.map +1 -0
  45. package/dist/types/forms/index.d.ts +5 -0
  46. package/dist/types/forms/index.d.ts.map +1 -0
  47. package/dist/types/forms/index.js +1 -0
  48. package/dist/types/index.d.ts +1 -0
  49. package/dist/types/index.d.ts.map +1 -1
  50. package/package.json +7 -5
  51. package/dist/ConfirmationDialog-bBFPpP2z.js +0 -322
  52. package/dist/SearchInput-CsZcpaxL.js +0 -710
@@ -0,0 +1,586 @@
1
+ import { jsxs as m, jsx as a } from "react/jsx-runtime";
2
+ import * as k from "react";
3
+ import { useState as N, useRef as j, useEffect as W, useMemo as T } from "react";
4
+ import { cm as C, cn as g, co as y, cp as E, cq as M, H as D, bv as H, bx as R, bw as A, ce as S, aW as F } from "./toggle-group-Cnfwf4uy.js";
5
+ import "./alert-srKINZRG.js";
6
+ import { c as h } from "./tailwind.helper-gWiv5-6R.js";
7
+ import { B as p, C as q } from "./tooltip-mWS3Mix6.js";
8
+ import { X as z, C as X } from "./select-CDIMkakd.js";
9
+ import "next-themes";
10
+ import { c as V } from "./index-BSI9LuBZ.js";
11
+ /**
12
+ * @license lucide-react v1.16.0 - ISC
13
+ *
14
+ * This source code is licensed under the ISC license.
15
+ * See the LICENSE file in the root directory of this source tree.
16
+ */
17
+ const _ = [
18
+ ["path", { d: "M8 2v4", key: "1cmpym" }],
19
+ ["path", { d: "M16 2v4", key: "4m81vk" }],
20
+ ["rect", { width: "18", height: "18", x: "3", y: "4", rx: "2", key: "1hopcy" }],
21
+ ["path", { d: "M3 10h18", key: "8toen8" }]
22
+ ], J = V("calendar", _), I = {
23
+ lessThanXSeconds: {
24
+ one: "moins d’une seconde",
25
+ other: "moins de {{count}} secondes"
26
+ },
27
+ xSeconds: {
28
+ one: "1 seconde",
29
+ other: "{{count}} secondes"
30
+ },
31
+ halfAMinute: "30 secondes",
32
+ lessThanXMinutes: {
33
+ one: "moins d’une minute",
34
+ other: "moins de {{count}} minutes"
35
+ },
36
+ xMinutes: {
37
+ one: "1 minute",
38
+ other: "{{count}} minutes"
39
+ },
40
+ aboutXHours: {
41
+ one: "environ 1 heure",
42
+ other: "environ {{count}} heures"
43
+ },
44
+ xHours: {
45
+ one: "1 heure",
46
+ other: "{{count}} heures"
47
+ },
48
+ xDays: {
49
+ one: "1 jour",
50
+ other: "{{count}} jours"
51
+ },
52
+ aboutXWeeks: {
53
+ one: "environ 1 semaine",
54
+ other: "environ {{count}} semaines"
55
+ },
56
+ xWeeks: {
57
+ one: "1 semaine",
58
+ other: "{{count}} semaines"
59
+ },
60
+ aboutXMonths: {
61
+ one: "environ 1 mois",
62
+ other: "environ {{count}} mois"
63
+ },
64
+ xMonths: {
65
+ one: "1 mois",
66
+ other: "{{count}} mois"
67
+ },
68
+ aboutXYears: {
69
+ one: "environ 1 an",
70
+ other: "environ {{count}} ans"
71
+ },
72
+ xYears: {
73
+ one: "1 an",
74
+ other: "{{count}} ans"
75
+ },
76
+ overXYears: {
77
+ one: "plus d’un an",
78
+ other: "plus de {{count}} ans"
79
+ },
80
+ almostXYears: {
81
+ one: "presqu’un an",
82
+ other: "presque {{count}} ans"
83
+ }
84
+ }, Y = (e, t, i) => {
85
+ let n;
86
+ const o = I[e];
87
+ return typeof o == "string" ? n = o : t === 1 ? n = o.one : n = o.other.replace("{{count}}", String(t)), i != null && i.addSuffix ? i.comparison && i.comparison > 0 ? "dans " + n : "il y a " + n : n;
88
+ }, Q = {
89
+ full: "EEEE d MMMM y",
90
+ long: "d MMMM y",
91
+ medium: "d MMM y",
92
+ short: "dd/MM/y"
93
+ }, $ = {
94
+ full: "HH:mm:ss zzzz",
95
+ long: "HH:mm:ss z",
96
+ medium: "HH:mm:ss",
97
+ short: "HH:mm"
98
+ }, B = {
99
+ full: "{{date}} 'à' {{time}}",
100
+ long: "{{date}} 'à' {{time}}",
101
+ medium: "{{date}}, {{time}}",
102
+ short: "{{date}}, {{time}}"
103
+ }, K = {
104
+ date: C({
105
+ formats: Q,
106
+ defaultWidth: "full"
107
+ }),
108
+ time: C({
109
+ formats: $,
110
+ defaultWidth: "full"
111
+ }),
112
+ dateTime: C({
113
+ formats: B,
114
+ defaultWidth: "full"
115
+ })
116
+ }, G = {
117
+ lastWeek: "eeee 'dernier à' p",
118
+ yesterday: "'hier à' p",
119
+ today: "'aujourd’hui à' p",
120
+ tomorrow: "'demain à' p'",
121
+ nextWeek: "eeee 'prochain à' p",
122
+ other: "P"
123
+ }, U = (e, t, i, n) => G[e], Z = {
124
+ narrow: ["av. J.-C", "ap. J.-C"],
125
+ abbreviated: ["av. J.-C", "ap. J.-C"],
126
+ wide: ["avant Jésus-Christ", "après Jésus-Christ"]
127
+ }, ee = {
128
+ narrow: ["T1", "T2", "T3", "T4"],
129
+ abbreviated: ["1er trim.", "2ème trim.", "3ème trim.", "4ème trim."],
130
+ wide: ["1er trimestre", "2ème trimestre", "3ème trimestre", "4ème trimestre"]
131
+ }, te = {
132
+ narrow: ["J", "F", "M", "A", "M", "J", "J", "A", "S", "O", "N", "D"],
133
+ abbreviated: [
134
+ "janv.",
135
+ "févr.",
136
+ "mars",
137
+ "avr.",
138
+ "mai",
139
+ "juin",
140
+ "juil.",
141
+ "août",
142
+ "sept.",
143
+ "oct.",
144
+ "nov.",
145
+ "déc."
146
+ ],
147
+ wide: [
148
+ "janvier",
149
+ "février",
150
+ "mars",
151
+ "avril",
152
+ "mai",
153
+ "juin",
154
+ "juillet",
155
+ "août",
156
+ "septembre",
157
+ "octobre",
158
+ "novembre",
159
+ "décembre"
160
+ ]
161
+ }, ne = {
162
+ narrow: ["D", "L", "M", "M", "J", "V", "S"],
163
+ short: ["di", "lu", "ma", "me", "je", "ve", "sa"],
164
+ abbreviated: ["dim.", "lun.", "mar.", "mer.", "jeu.", "ven.", "sam."],
165
+ wide: [
166
+ "dimanche",
167
+ "lundi",
168
+ "mardi",
169
+ "mercredi",
170
+ "jeudi",
171
+ "vendredi",
172
+ "samedi"
173
+ ]
174
+ }, re = {
175
+ narrow: {
176
+ am: "AM",
177
+ pm: "PM",
178
+ midnight: "minuit",
179
+ noon: "midi",
180
+ morning: "mat.",
181
+ afternoon: "ap.m.",
182
+ evening: "soir",
183
+ night: "mat."
184
+ },
185
+ abbreviated: {
186
+ am: "AM",
187
+ pm: "PM",
188
+ midnight: "minuit",
189
+ noon: "midi",
190
+ morning: "matin",
191
+ afternoon: "après-midi",
192
+ evening: "soir",
193
+ night: "matin"
194
+ },
195
+ wide: {
196
+ am: "AM",
197
+ pm: "PM",
198
+ midnight: "minuit",
199
+ noon: "midi",
200
+ morning: "du matin",
201
+ afternoon: "de l’après-midi",
202
+ evening: "du soir",
203
+ night: "du matin"
204
+ }
205
+ }, ae = (e, t) => {
206
+ const i = Number(e), n = t == null ? void 0 : t.unit;
207
+ if (i === 0) return "0";
208
+ const o = ["year", "week", "hour", "minute", "second"];
209
+ let s;
210
+ return i === 1 ? s = n && o.includes(n) ? "ère" : "er" : s = "ème", i + s;
211
+ }, ie = ["MMM", "MMMM"], oe = {
212
+ preprocessor: (e, t) => e.getDate() === 1 || !t.some(
213
+ (n) => n.isToken && ie.includes(n.value)
214
+ ) ? t : t.map(
215
+ (n) => n.isToken && n.value === "do" ? { isToken: !0, value: "d" } : n
216
+ ),
217
+ ordinalNumber: ae,
218
+ era: g({
219
+ values: Z,
220
+ defaultWidth: "wide"
221
+ }),
222
+ quarter: g({
223
+ values: ee,
224
+ defaultWidth: "wide",
225
+ argumentCallback: (e) => e - 1
226
+ }),
227
+ month: g({
228
+ values: te,
229
+ defaultWidth: "wide"
230
+ }),
231
+ day: g({
232
+ values: ne,
233
+ defaultWidth: "wide"
234
+ }),
235
+ dayPeriod: g({
236
+ values: re,
237
+ defaultWidth: "wide"
238
+ })
239
+ }, se = /^(\d+)(ième|ère|ème|er|e)?/i, de = /\d+/i, le = {
240
+ narrow: /^(av\.J\.C|ap\.J\.C|ap\.J\.-C)/i,
241
+ abbreviated: /^(av\.J\.-C|av\.J-C|apr\.J\.-C|apr\.J-C|ap\.J-C)/i,
242
+ wide: /^(avant Jésus-Christ|après Jésus-Christ)/i
243
+ }, me = {
244
+ any: [/^av/i, /^ap/i]
245
+ }, ce = {
246
+ narrow: /^T?[1234]/i,
247
+ abbreviated: /^[1234](er|ème|e)? trim\.?/i,
248
+ wide: /^[1234](er|ème|e)? trimestre/i
249
+ }, ue = {
250
+ any: [/1/i, /2/i, /3/i, /4/i]
251
+ }, fe = {
252
+ narrow: /^[jfmasond]/i,
253
+ abbreviated: /^(janv|févr|mars|avr|mai|juin|juill|juil|août|sept|oct|nov|déc)\.?/i,
254
+ wide: /^(janvier|février|mars|avril|mai|juin|juillet|août|septembre|octobre|novembre|décembre)/i
255
+ }, he = {
256
+ narrow: [
257
+ /^j/i,
258
+ /^f/i,
259
+ /^m/i,
260
+ /^a/i,
261
+ /^m/i,
262
+ /^j/i,
263
+ /^j/i,
264
+ /^a/i,
265
+ /^s/i,
266
+ /^o/i,
267
+ /^n/i,
268
+ /^d/i
269
+ ],
270
+ any: [
271
+ /^ja/i,
272
+ /^f/i,
273
+ /^mar/i,
274
+ /^av/i,
275
+ /^ma/i,
276
+ /^juin/i,
277
+ /^juil/i,
278
+ /^ao/i,
279
+ /^s/i,
280
+ /^o/i,
281
+ /^n/i,
282
+ /^d/i
283
+ ]
284
+ }, pe = {
285
+ narrow: /^[lmjvsd]/i,
286
+ short: /^(di|lu|ma|me|je|ve|sa)/i,
287
+ abbreviated: /^(dim|lun|mar|mer|jeu|ven|sam)\.?/i,
288
+ wide: /^(dimanche|lundi|mardi|mercredi|jeudi|vendredi|samedi)/i
289
+ }, ve = {
290
+ narrow: [/^d/i, /^l/i, /^m/i, /^m/i, /^j/i, /^v/i, /^s/i],
291
+ any: [/^di/i, /^lu/i, /^ma/i, /^me/i, /^je/i, /^ve/i, /^sa/i]
292
+ }, be = {
293
+ narrow: /^(a|p|minuit|midi|mat\.?|ap\.?m\.?|soir|nuit)/i,
294
+ any: /^([ap]\.?\s?m\.?|du matin|de l'après[-\s]midi|du soir|de la nuit)/i
295
+ }, ge = {
296
+ any: {
297
+ am: /^a/i,
298
+ pm: /^p/i,
299
+ midnight: /^min/i,
300
+ noon: /^mid/i,
301
+ morning: /mat/i,
302
+ afternoon: /ap/i,
303
+ evening: /soir/i,
304
+ night: /nuit/i
305
+ }
306
+ }, ye = {
307
+ ordinalNumber: E({
308
+ matchPattern: se,
309
+ parsePattern: de,
310
+ valueCallback: (e) => parseInt(e)
311
+ }),
312
+ era: y({
313
+ matchPatterns: le,
314
+ defaultMatchWidth: "wide",
315
+ parsePatterns: me,
316
+ defaultParseWidth: "any"
317
+ }),
318
+ quarter: y({
319
+ matchPatterns: ce,
320
+ defaultMatchWidth: "wide",
321
+ parsePatterns: ue,
322
+ defaultParseWidth: "any",
323
+ valueCallback: (e) => e + 1
324
+ }),
325
+ month: y({
326
+ matchPatterns: fe,
327
+ defaultMatchWidth: "wide",
328
+ parsePatterns: he,
329
+ defaultParseWidth: "any"
330
+ }),
331
+ day: y({
332
+ matchPatterns: pe,
333
+ defaultMatchWidth: "wide",
334
+ parsePatterns: ve,
335
+ defaultParseWidth: "any"
336
+ }),
337
+ dayPeriod: y({
338
+ matchPatterns: be,
339
+ defaultMatchWidth: "any",
340
+ parsePatterns: ge,
341
+ defaultParseWidth: "any"
342
+ })
343
+ }, x = {
344
+ code: "fr",
345
+ formatDistance: Y,
346
+ formatLong: K,
347
+ formatRelative: U,
348
+ localize: oe,
349
+ match: ye,
350
+ options: {
351
+ weekStartsOn: 1,
352
+ firstWeekContainsDate: 4
353
+ }
354
+ }, Te = ({ date: e, onDateChange: t, placeholder: i }) => {
355
+ const [n, o] = N(!1), s = j(null);
356
+ W(() => {
357
+ if (!n) return;
358
+ const l = (d) => {
359
+ s.current !== null && !s.current.contains(d.target) && o(!1);
360
+ };
361
+ return document.addEventListener("mousedown", l), () => {
362
+ document.removeEventListener("mousedown", l);
363
+ };
364
+ }, [n]);
365
+ const f = () => {
366
+ o((l) => !l);
367
+ }, c = (l) => {
368
+ t(l), o(!1);
369
+ };
370
+ return /* @__PURE__ */ m("div", { ref: s, className: "relative w-full", children: [
371
+ /* @__PURE__ */ m(
372
+ p,
373
+ {
374
+ variant: "outline",
375
+ type: "button",
376
+ onClick: f,
377
+ className: h(
378
+ "w-full justify-start text-left font-normal focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",
379
+ n && "ring-2 ring-ring ring-offset-2",
380
+ e === void 0 && "text-muted-foreground"
381
+ ),
382
+ children: [
383
+ /* @__PURE__ */ a(J, { className: "mr-2 size-4 shrink-0" }),
384
+ e !== void 0 ? M(e, "dd/MM/yyyy", { locale: x }) : /* @__PURE__ */ a("span", { children: i })
385
+ ]
386
+ }
387
+ ),
388
+ n ? /* @__PURE__ */ a("div", { className: "absolute left-0 top-[calc(100%+4px)] z-[100] rounded-md border bg-popover text-popover-foreground shadow-md animate-in fade-in-0 zoom-in-95 slide-in-from-top-2", children: /* @__PURE__ */ a(D, { mode: "single", selected: e, onSelect: c }) }) : null
389
+ ] });
390
+ }, De = ({ value: e, onChange: t, placeholder: i = "Selectionner une periode", className: n }) => {
391
+ const [o, s] = k.useState(!1), [f, c] = k.useState(e);
392
+ k.useEffect(() => {
393
+ o && c(e);
394
+ }, [o, e]);
395
+ const l = (u) => {
396
+ u.stopPropagation(), t(void 0), s(!1);
397
+ }, d = () => {
398
+ t(f), s(!1);
399
+ }, v = () => {
400
+ c(e), s(!1);
401
+ }, b = () => {
402
+ c(void 0);
403
+ }, w = (u) => u != null && u.from ? !u.to || u.from.getTime() === u.to.getTime() ? M(u.from, "dd MMM yyyy", { locale: x }) : `${M(u.from, "dd MMM yyyy", { locale: x })} - ${M(u.to, "dd MMM yyyy", { locale: x })}` : i;
404
+ return /* @__PURE__ */ a("div", { className: h("grid gap-2", n), children: /* @__PURE__ */ m(H, { open: o, onOpenChange: s, children: [
405
+ /* @__PURE__ */ a(R, { asChild: !0, children: /* @__PURE__ */ m(p, { id: "date", variant: "outline", className: h("w-[300px] justify-start text-left font-normal", !(e != null && e.from) && "text-muted-foreground"), children: [
406
+ /* @__PURE__ */ a(J, { className: "mr-2 size-4" }),
407
+ w(e),
408
+ (e == null ? void 0 : e.from) && /* @__PURE__ */ a(
409
+ p,
410
+ {
411
+ type: "button",
412
+ variant: "ghost",
413
+ size: "icon",
414
+ "aria-label": "Effacer la periode selectionnee",
415
+ className: "ml-auto h-5 w-5 opacity-50 hover:opacity-100",
416
+ onClick: l,
417
+ children: /* @__PURE__ */ a(z, { className: "size-4" })
418
+ }
419
+ )
420
+ ] }) }),
421
+ /* @__PURE__ */ m(A, { className: "w-auto p-0", align: "start", side: "bottom", sideOffset: 4, children: [
422
+ /* @__PURE__ */ a(
423
+ D,
424
+ {
425
+ mode: "range",
426
+ defaultMonth: f == null ? void 0 : f.from,
427
+ selected: f,
428
+ onSelect: c,
429
+ numberOfMonths: 2,
430
+ weekStartsOn: 1,
431
+ className: "pointer-events-auto p-3"
432
+ }
433
+ ),
434
+ /* @__PURE__ */ m("div", { className: "flex items-center justify-between border-t border-border px-3 py-2", children: [
435
+ /* @__PURE__ */ a(p, { variant: "ghost", size: "sm", onClick: b, children: "Effacer" }),
436
+ /* @__PURE__ */ m("div", { className: "flex gap-2", children: [
437
+ /* @__PURE__ */ a(p, { variant: "ghost", size: "sm", onClick: v, children: "Annuler" }),
438
+ /* @__PURE__ */ a(p, { size: "sm", onClick: d, children: "Appliquer" })
439
+ ] })
440
+ ] })
441
+ ] })
442
+ ] }) });
443
+ }, Se = ({
444
+ options: e = [],
445
+ value: t,
446
+ onChange: i,
447
+ onClear: n,
448
+ placeholder: o = "Sélectionner...",
449
+ searchPlaceholder: s = "Rechercher...",
450
+ disabled: f = !1
451
+ }) => {
452
+ const [c, l] = N(""), [d, v] = N(!1), b = j(null), w = j(null), u = T(() => c === "" ? e : e.filter((r) => r.label.toLowerCase().includes(c.toLowerCase())), [e, c]), L = T(() => {
453
+ var r;
454
+ if (!(t === void 0 || t === ""))
455
+ return ((r = e.find((P) => P.value === t)) == null ? void 0 : r.label) ?? t;
456
+ }, [e, t]);
457
+ W(() => {
458
+ d && requestAnimationFrame(() => {
459
+ var r;
460
+ (r = w.current) == null || r.focus();
461
+ });
462
+ }, [d]), W(() => {
463
+ if (!d) return;
464
+ const r = (P) => {
465
+ b.current !== null && !b.current.contains(P.target) && (v(!1), l(""));
466
+ };
467
+ return document.addEventListener("mousedown", r), () => {
468
+ document.removeEventListener("mousedown", r);
469
+ };
470
+ }, [d]);
471
+ const O = (r) => {
472
+ i(r), v(!1), l("");
473
+ };
474
+ return /* @__PURE__ */ m("div", { ref: b, className: "relative w-full", children: [
475
+ /* @__PURE__ */ m(
476
+ "button",
477
+ {
478
+ type: "button",
479
+ onClick: () => {
480
+ f || v((r) => (r && l(""), !r));
481
+ },
482
+ disabled: f,
483
+ className: h(
484
+ "flex h-10 w-full items-center justify-between rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",
485
+ d && "ring-2 ring-ring ring-offset-2",
486
+ (t === void 0 || t === "") && "text-muted-foreground"
487
+ ),
488
+ children: [
489
+ /* @__PURE__ */ a("span", { className: "truncate", children: L ?? o }),
490
+ /* @__PURE__ */ m("div", { className: "flex items-center gap-1", children: [
491
+ n && t !== void 0 && t !== "" && !f && /* @__PURE__ */ a(
492
+ "span",
493
+ {
494
+ role: "button",
495
+ tabIndex: -1,
496
+ onClick: (r) => {
497
+ r.stopPropagation();
498
+ },
499
+ onPointerDown: (r) => {
500
+ r.preventDefault(), r.stopPropagation(), n();
501
+ },
502
+ className: "text-muted-foreground hover:text-foreground",
503
+ children: /* @__PURE__ */ a(z, { className: "size-4" })
504
+ }
505
+ ),
506
+ /* @__PURE__ */ a(q, { className: h("size-4 opacity-50 shrink-0 transition-transform", d && "rotate-180") })
507
+ ] })
508
+ ]
509
+ }
510
+ ),
511
+ d ? /* @__PURE__ */ m("div", { className: "absolute left-0 right-0 top-[calc(100%+4px)] z-[100] rounded-md border bg-popover text-popover-foreground shadow-md animate-in fade-in-0 zoom-in-95 slide-in-from-top-2", children: [
512
+ /* @__PURE__ */ a("div", { className: "border-b border-border p-2", children: /* @__PURE__ */ m("div", { className: "relative", children: [
513
+ /* @__PURE__ */ a(S, { className: "absolute left-2 top-1/2 h-3.5 w-3.5 -translate-y-1/2 text-muted-foreground" }),
514
+ /* @__PURE__ */ a(
515
+ "input",
516
+ {
517
+ ref: w,
518
+ className: "w-full rounded-md bg-muted/50 py-1.5 pl-7 pr-2 text-sm text-foreground placeholder:text-muted-foreground outline-none focus:ring-1 focus:ring-ring",
519
+ placeholder: s,
520
+ value: c,
521
+ onChange: (r) => {
522
+ l(r.target.value);
523
+ }
524
+ }
525
+ )
526
+ ] }) }),
527
+ /* @__PURE__ */ m("div", { className: "flex flex-col gap-0.5 max-h-56 overflow-y-auto p-1.5 scrollbar-thin scrollbar-thumb-rounded scrollbar-thumb-muted-foreground/20 scrollbar-track-transparent [&::-webkit-scrollbar]:w-1.5 [&::-webkit-scrollbar-thumb]:rounded-full [&::-webkit-scrollbar-thumb]:bg-muted-foreground/20 [&::-webkit-scrollbar-track]:bg-transparent", children: [
528
+ u.length === 0 && /* @__PURE__ */ a("p", { className: "px-2 py-3 text-center text-xs text-muted-foreground", children: "Aucun résultat" }),
529
+ u.map((r) => /* @__PURE__ */ m(
530
+ "button",
531
+ {
532
+ type: "button",
533
+ onClick: () => {
534
+ O(r.value);
535
+ },
536
+ className: h(
537
+ "flex items-center gap-2.5 rounded-md px-2 py-2 text-sm hover:bg-muted cursor-pointer transition-colors text-left w-full",
538
+ t === r.value && "bg-muted font-medium"
539
+ ),
540
+ children: [
541
+ /* @__PURE__ */ a(X, { className: h("size-3.5 shrink-0", t === r.value ? "opacity-100" : "opacity-0") }),
542
+ r.label
543
+ ]
544
+ },
545
+ r.value
546
+ ))
547
+ ] })
548
+ ] }) : null
549
+ ] });
550
+ }, Je = ({
551
+ searchQuery: e,
552
+ search: t,
553
+ placeholder: i = "Rechercher...",
554
+ onSearch: n,
555
+ onSubmit: o,
556
+ onClear: s,
557
+ className: f
558
+ }) => {
559
+ const c = e ?? t ?? "", l = () => {
560
+ n(""), s !== void 0 && s();
561
+ };
562
+ return /* @__PURE__ */ m("div", { className: h("relative h-fit w-full md:w-64", f), children: [
563
+ /* @__PURE__ */ a(S, { className: "absolute left-3 top-1/2 transform -translate-y-1/2 text-muted-foreground w-4 h-4" }),
564
+ /* @__PURE__ */ a(
565
+ F,
566
+ {
567
+ placeholder: i,
568
+ value: c,
569
+ onChange: (d) => {
570
+ n(d.target.value);
571
+ },
572
+ className: "pl-8",
573
+ onKeyDown: (d) => {
574
+ d.key === "Enter" && o !== void 0 && (d.preventDefault(), o());
575
+ }
576
+ }
577
+ ),
578
+ c !== "" ? /* @__PURE__ */ a("button", { onClick: l, className: "absolute right-3 top-1/2 -translate-y-1/2 text-gray-500 hover:text-gray-700", type: "button", children: /* @__PURE__ */ a(z, { className: "size-4" }) }) : null
579
+ ] });
580
+ };
581
+ export {
582
+ Te as D,
583
+ Je as S,
584
+ De as a,
585
+ Se as b
586
+ };