@contractspec/lib.ui-kit-web 3.7.1 → 3.7.3

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.
@@ -5,1259 +5,6 @@ var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require
5
5
  return require.apply(this, arguments);
6
6
  throw Error('Dynamic require of "' + x + '" is not supported');
7
7
  });
8
-
9
- // ui/button.tsx
10
- import { Slot } from "@radix-ui/react-slot";
11
- import { cva } from "class-variance-authority";
12
- import { cn } from "@contractspec/lib.ui-kit-core/utils";
13
- import { jsxDEV } from "react/jsx-dev-runtime";
14
- var buttonVariants = cva("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-hidden focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive", {
15
- variants: {
16
- variant: {
17
- default: "bg-primary text-primary-foreground hover:bg-primary/90",
18
- destructive: "bg-destructive text-white hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",
19
- outline: "border bg-background shadow-2xs hover:bg-accent hover:text-accent-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50",
20
- secondary: "bg-secondary text-secondary-foreground hover:bg-secondary/80",
21
- ghost: "hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50",
22
- link: "text-primary underline-offset-4 hover:underline"
23
- },
24
- size: {
25
- default: "h-9 px-4 py-2 has-[>svg]:px-3",
26
- sm: "h-8 rounded-md gap-1.5 px-3 has-[>svg]:px-2.5",
27
- lg: "h-10 rounded-md px-6 has-[>svg]:px-4",
28
- icon: "size-9"
29
- }
30
- },
31
- defaultVariants: {
32
- variant: "default",
33
- size: "default"
34
- }
35
- });
36
- function Button({
37
- className,
38
- variant,
39
- size,
40
- asChild = false,
41
- ref,
42
- ...props
43
- }) {
44
- if (asChild) {
45
- return /* @__PURE__ */ jsxDEV(Slot, {
46
- "data-slot": "button",
47
- className: cn(buttonVariants({ variant, size, className })),
48
- ...props
49
- }, undefined, false, undefined, this);
50
- }
51
- return /* @__PURE__ */ jsxDEV("button", {
52
- ref,
53
- "data-slot": "button",
54
- className: cn(buttonVariants({ variant, size, className })),
55
- ...props
56
- }, undefined, false, undefined, this);
57
- }
58
- // ui/select.tsx
59
- import * as SelectPrimitive from "@radix-ui/react-select";
60
- import { CheckIcon, ChevronDownIcon, ChevronUpIcon } from "lucide-react";
61
- import { cn as cn2 } from "@contractspec/lib.ui-kit-core/utils";
62
- import { jsxDEV as jsxDEV2 } from "react/jsx-dev-runtime";
63
- "use client";
64
- function Select({
65
- ...props
66
- }) {
67
- return /* @__PURE__ */ jsxDEV2(SelectPrimitive.Root, {
68
- "data-slot": "select",
69
- ...props
70
- }, undefined, false, undefined, this);
71
- }
72
- function SelectGroup({
73
- ...props
74
- }) {
75
- return /* @__PURE__ */ jsxDEV2(SelectPrimitive.Group, {
76
- "data-slot": "select-group",
77
- ...props
78
- }, undefined, false, undefined, this);
79
- }
80
- function SelectValue({
81
- ...props
82
- }) {
83
- return /* @__PURE__ */ jsxDEV2(SelectPrimitive.Value, {
84
- "data-slot": "select-value",
85
- ...props
86
- }, undefined, false, undefined, this);
87
- }
88
- function SelectTrigger({
89
- className,
90
- size = "default",
91
- children,
92
- ...props
93
- }) {
94
- return /* @__PURE__ */ jsxDEV2(SelectPrimitive.Trigger, {
95
- "data-slot": "select-trigger",
96
- "data-size": size,
97
- className: cn2("aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive border-input focus-visible:border-ring focus-visible:ring-ring/50 data-placeholder:text-muted-foreground dark:bg-input/30 dark:hover:bg-input/50 [&_svg:not([class*='text-'])]:text-muted-foreground flex w-fit items-center justify-between gap-2 rounded-md border bg-transparent px-3 py-2 text-sm whitespace-nowrap shadow-2xs outline-hidden transition-[color,box-shadow] focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 data-[size=default]:h-9 data-[size=sm]:h-8 *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-2 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4", className),
98
- ...props,
99
- children: [
100
- children,
101
- /* @__PURE__ */ jsxDEV2(SelectPrimitive.Icon, {
102
- asChild: true,
103
- children: /* @__PURE__ */ jsxDEV2(ChevronDownIcon, {
104
- className: "size-4 opacity-50"
105
- }, undefined, false, undefined, this)
106
- }, undefined, false, undefined, this)
107
- ]
108
- }, undefined, true, undefined, this);
109
- }
110
- function SelectContent({
111
- className,
112
- children,
113
- position = "popper",
114
- ...props
115
- }) {
116
- return /* @__PURE__ */ jsxDEV2(SelectPrimitive.Portal, {
117
- children: /* @__PURE__ */ jsxDEV2(SelectPrimitive.Content, {
118
- "data-slot": "select-content",
119
- className: cn2("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 relative z-50 max-h-(--radix-select-content-available-height) min-w-32 origin-(--radix-select-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border shadow-md", position === "popper" && "data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1", className),
120
- position,
121
- ...props,
122
- children: [
123
- /* @__PURE__ */ jsxDEV2(SelectScrollUpButton, {}, undefined, false, undefined, this),
124
- /* @__PURE__ */ jsxDEV2(SelectPrimitive.Viewport, {
125
- className: cn2("p-1", position === "popper" && "h-(--radix-select-trigger-height) w-full min-w-(--radix-select-trigger-width) scroll-my-1"),
126
- children
127
- }, undefined, false, undefined, this),
128
- /* @__PURE__ */ jsxDEV2(SelectScrollDownButton, {}, undefined, false, undefined, this)
129
- ]
130
- }, undefined, true, undefined, this)
131
- }, undefined, false, undefined, this);
132
- }
133
- function SelectLabel({
134
- className,
135
- ...props
136
- }) {
137
- return /* @__PURE__ */ jsxDEV2(SelectPrimitive.Label, {
138
- "data-slot": "select-label",
139
- className: cn2("text-muted-foreground px-2 py-1.5 text-xs", className),
140
- ...props
141
- }, undefined, false, undefined, this);
142
- }
143
- function SelectItem({
144
- className,
145
- children,
146
- ...props
147
- }) {
148
- return /* @__PURE__ */ jsxDEV2(SelectPrimitive.Item, {
149
- "data-slot": "select-item",
150
- className: cn2("focus:bg-accent focus:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground relative flex w-full cursor-default items-center gap-2 rounded-xs py-1.5 pr-8 pl-2 text-sm outline-hidden select-none data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2", className),
151
- ...props,
152
- children: [
153
- /* @__PURE__ */ jsxDEV2("span", {
154
- className: "absolute right-2 flex size-3.5 items-center justify-center",
155
- children: /* @__PURE__ */ jsxDEV2(SelectPrimitive.ItemIndicator, {
156
- children: /* @__PURE__ */ jsxDEV2(CheckIcon, {
157
- className: "size-4"
158
- }, undefined, false, undefined, this)
159
- }, undefined, false, undefined, this)
160
- }, undefined, false, undefined, this),
161
- /* @__PURE__ */ jsxDEV2(SelectPrimitive.ItemText, {
162
- children
163
- }, undefined, false, undefined, this)
164
- ]
165
- }, undefined, true, undefined, this);
166
- }
167
- function SelectSeparator({
168
- className,
169
- ...props
170
- }) {
171
- return /* @__PURE__ */ jsxDEV2(SelectPrimitive.Separator, {
172
- "data-slot": "select-separator",
173
- className: cn2("bg-border pointer-events-none -mx-1 my-1 h-px", className),
174
- ...props
175
- }, undefined, false, undefined, this);
176
- }
177
- function SelectScrollUpButton({
178
- className,
179
- ...props
180
- }) {
181
- return /* @__PURE__ */ jsxDEV2(SelectPrimitive.ScrollUpButton, {
182
- "data-slot": "select-scroll-up-button",
183
- className: cn2("flex cursor-default items-center justify-center py-1", className),
184
- ...props,
185
- children: /* @__PURE__ */ jsxDEV2(ChevronUpIcon, {
186
- className: "size-4"
187
- }, undefined, false, undefined, this)
188
- }, undefined, false, undefined, this);
189
- }
190
- function SelectScrollDownButton({
191
- className,
192
- ...props
193
- }) {
194
- return /* @__PURE__ */ jsxDEV2(SelectPrimitive.ScrollDownButton, {
195
- "data-slot": "select-scroll-down-button",
196
- className: cn2("flex cursor-default items-center justify-center py-1", className),
197
- ...props,
198
- children: /* @__PURE__ */ jsxDEV2(ChevronDownIcon, {
199
- className: "size-4"
200
- }, undefined, false, undefined, this)
201
- }, undefined, false, undefined, this);
202
- }
203
- // ui/label.tsx
204
- import * as LabelPrimitive from "@radix-ui/react-label";
205
- import { cn as cn3 } from "@contractspec/lib.ui-kit-core/utils";
206
- import { jsxDEV as jsxDEV3 } from "react/jsx-dev-runtime";
207
- "use client";
208
- function Label2({
209
- className,
210
- ...props
211
- }) {
212
- return /* @__PURE__ */ jsxDEV3(LabelPrimitive.Root, {
213
- "data-slot": "label",
214
- className: cn3("flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50", className),
215
- ...props
216
- }, undefined, false, undefined, this);
217
- }
218
- // ui/atoms/FilterSelect/FilterSelect.tsx
219
- import { jsxDEV as jsxDEV4 } from "react/jsx-dev-runtime";
220
- var FilterSelect = ({
221
- value,
222
- options,
223
- onChange,
224
- placeholder = "Sélectionner...",
225
- label,
226
- disabled = false,
227
- className = "",
228
- showCounts = false
229
- }) => {
230
- return /* @__PURE__ */ jsxDEV4("div", {
231
- className: `space-y-2 ${className}`,
232
- children: [
233
- label && /* @__PURE__ */ jsxDEV4(Label2, {
234
- className: "text-foreground text-base font-medium",
235
- children: label
236
- }, undefined, false, undefined, this),
237
- /* @__PURE__ */ jsxDEV4(Select, {
238
- value,
239
- onValueChange: onChange,
240
- disabled,
241
- children: [
242
- /* @__PURE__ */ jsxDEV4(SelectTrigger, {
243
- className: "w-full",
244
- children: /* @__PURE__ */ jsxDEV4(SelectValue, {
245
- placeholder
246
- }, undefined, false, undefined, this)
247
- }, undefined, false, undefined, this),
248
- /* @__PURE__ */ jsxDEV4(SelectContent, {
249
- className: "bg-background",
250
- children: [
251
- /* @__PURE__ */ jsxDEV4(SelectItem, {
252
- value: "all",
253
- children: [
254
- "Tous",
255
- showCounts && /* @__PURE__ */ jsxDEV4("span", {
256
- className: "text-muted-foreground ml-2 text-sm",
257
- children: [
258
- "(",
259
- options.reduce((sum, option) => sum + (option.count || 0), 0),
260
- ")"
261
- ]
262
- }, undefined, true, undefined, this)
263
- ]
264
- }, undefined, true, undefined, this),
265
- options.map((option) => /* @__PURE__ */ jsxDEV4(SelectItem, {
266
- value: option.value,
267
- children: /* @__PURE__ */ jsxDEV4("div", {
268
- className: "flex w-full items-center justify-between",
269
- children: [
270
- /* @__PURE__ */ jsxDEV4("span", {
271
- children: option.label
272
- }, undefined, false, undefined, this),
273
- showCounts && option.count !== undefined && /* @__PURE__ */ jsxDEV4("span", {
274
- className: "text-muted-foreground ml-2 text-sm",
275
- children: [
276
- "(",
277
- option.count,
278
- ")"
279
- ]
280
- }, undefined, true, undefined, this)
281
- ]
282
- }, undefined, true, undefined, this)
283
- }, option.value, false, undefined, this))
284
- ]
285
- }, undefined, true, undefined, this)
286
- ]
287
- }, undefined, true, undefined, this)
288
- ]
289
- }, undefined, true, undefined, this);
290
- };
291
- // ui/atoms/Pagination/Pagination.tsx
292
- import {
293
- ChevronLeft,
294
- ChevronRight,
295
- ChevronsLeft,
296
- ChevronsRight
297
- } from "lucide-react";
298
- import { jsxDEV as jsxDEV5 } from "react/jsx-dev-runtime";
299
- var Pagination = ({
300
- currentPage,
301
- totalPages,
302
- totalItems,
303
- itemsPerPage,
304
- onPageChange,
305
- onItemsPerPageChange,
306
- disabled = false,
307
- className = "",
308
- showItemsPerPage = true,
309
- itemsPerPageOptions = [10, 25, 50, 100]
310
- }) => {
311
- const startItem = (currentPage - 1) * itemsPerPage + 1;
312
- const endItem = Math.min(currentPage * itemsPerPage, totalItems);
313
- const canGoPrevious = currentPage > 1 && !disabled;
314
- const canGoNext = currentPage < totalPages && !disabled;
315
- const getVisiblePageNumbers = () => {
316
- if (totalPages <= 7) {
317
- return Array.from({ length: totalPages }, (_, i) => i + 1);
318
- }
319
- if (currentPage <= 3) {
320
- return [1, 2, 3, 4, 5, -1, totalPages];
321
- }
322
- if (currentPage >= totalPages - 2) {
323
- return [
324
- 1,
325
- -1,
326
- totalPages - 4,
327
- totalPages - 3,
328
- totalPages - 2,
329
- totalPages - 1,
330
- totalPages
331
- ];
332
- }
333
- return [
334
- 1,
335
- -1,
336
- currentPage - 1,
337
- currentPage,
338
- currentPage + 1,
339
- -1,
340
- totalPages
341
- ];
342
- };
343
- if (totalPages === 0)
344
- return null;
345
- return /* @__PURE__ */ jsxDEV5("div", {
346
- className: `flex flex-col items-center justify-between gap-4 sm:flex-row ${className}`,
347
- children: [
348
- /* @__PURE__ */ jsxDEV5("div", {
349
- className: "text-muted-foreground order-2 text-base sm:order-1",
350
- children: [
351
- "Affichage de ",
352
- startItem,
353
- " à ",
354
- endItem,
355
- " sur ",
356
- totalItems,
357
- " résultats"
358
- ]
359
- }, undefined, true, undefined, this),
360
- /* @__PURE__ */ jsxDEV5("div", {
361
- className: "order-1 flex items-center gap-2 sm:order-2",
362
- children: [
363
- /* @__PURE__ */ jsxDEV5(Button, {
364
- variant: "outline",
365
- size: "sm",
366
- onClick: () => onPageChange(1),
367
- disabled: !canGoPrevious,
368
- className: "hidden h-8 w-8 p-0 sm:flex",
369
- children: [
370
- /* @__PURE__ */ jsxDEV5(ChevronsLeft, {
371
- className: "h-4 w-4"
372
- }, undefined, false, undefined, this),
373
- /* @__PURE__ */ jsxDEV5("span", {
374
- className: "sr-only",
375
- children: "Première page"
376
- }, undefined, false, undefined, this)
377
- ]
378
- }, undefined, true, undefined, this),
379
- /* @__PURE__ */ jsxDEV5(Button, {
380
- variant: "outline",
381
- size: "sm",
382
- onClick: () => onPageChange(currentPage - 1),
383
- disabled: !canGoPrevious,
384
- className: "h-8 w-8 p-0",
385
- children: [
386
- /* @__PURE__ */ jsxDEV5(ChevronLeft, {
387
- className: "h-4 w-4"
388
- }, undefined, false, undefined, this),
389
- /* @__PURE__ */ jsxDEV5("span", {
390
- className: "sr-only",
391
- children: "Page précédente"
392
- }, undefined, false, undefined, this)
393
- ]
394
- }, undefined, true, undefined, this),
395
- /* @__PURE__ */ jsxDEV5("div", {
396
- className: "flex items-center gap-1",
397
- children: getVisiblePageNumbers().map((page, index) => {
398
- if (page === -1) {
399
- return /* @__PURE__ */ jsxDEV5("span", {
400
- className: "text-muted-foreground px-2 py-1",
401
- children: "..."
402
- }, `ellipsis-${index}`, false, undefined, this);
403
- }
404
- return /* @__PURE__ */ jsxDEV5(Button, {
405
- variant: page === currentPage ? "default" : "outline",
406
- size: "sm",
407
- onClick: () => onPageChange(page),
408
- disabled,
409
- className: "h-8 min-w-8 px-2",
410
- children: page
411
- }, page, false, undefined, this);
412
- })
413
- }, undefined, false, undefined, this),
414
- /* @__PURE__ */ jsxDEV5(Button, {
415
- variant: "outline",
416
- size: "sm",
417
- onClick: () => onPageChange(currentPage + 1),
418
- disabled: !canGoNext,
419
- className: "h-8 w-8 p-0",
420
- children: [
421
- /* @__PURE__ */ jsxDEV5(ChevronRight, {
422
- className: "h-4 w-4"
423
- }, undefined, false, undefined, this),
424
- /* @__PURE__ */ jsxDEV5("span", {
425
- className: "sr-only",
426
- children: "Page suivante"
427
- }, undefined, false, undefined, this)
428
- ]
429
- }, undefined, true, undefined, this),
430
- /* @__PURE__ */ jsxDEV5(Button, {
431
- variant: "outline",
432
- size: "sm",
433
- onClick: () => onPageChange(totalPages),
434
- disabled: !canGoNext,
435
- className: "hidden h-8 w-8 p-0 sm:flex",
436
- children: [
437
- /* @__PURE__ */ jsxDEV5(ChevronsRight, {
438
- className: "h-4 w-4"
439
- }, undefined, false, undefined, this),
440
- /* @__PURE__ */ jsxDEV5("span", {
441
- className: "sr-only",
442
- children: "Dernière page"
443
- }, undefined, false, undefined, this)
444
- ]
445
- }, undefined, true, undefined, this)
446
- ]
447
- }, undefined, true, undefined, this),
448
- showItemsPerPage && onItemsPerPageChange && /* @__PURE__ */ jsxDEV5("div", {
449
- className: "order-3 flex items-center gap-2 text-base",
450
- children: [
451
- /* @__PURE__ */ jsxDEV5("span", {
452
- className: "text-muted-foreground",
453
- children: "Afficher:"
454
- }, undefined, false, undefined, this),
455
- /* @__PURE__ */ jsxDEV5(Select, {
456
- value: itemsPerPage.toString(),
457
- onValueChange: (value) => onItemsPerPageChange(parseInt(value)),
458
- disabled,
459
- children: [
460
- /* @__PURE__ */ jsxDEV5(SelectTrigger, {
461
- className: "h-8 w-16",
462
- children: /* @__PURE__ */ jsxDEV5(SelectValue, {}, undefined, false, undefined, this)
463
- }, undefined, false, undefined, this),
464
- /* @__PURE__ */ jsxDEV5(SelectContent, {
465
- className: "bg-background",
466
- children: itemsPerPageOptions.map((option) => /* @__PURE__ */ jsxDEV5(SelectItem, {
467
- value: option.toString(),
468
- children: option
469
- }, option, false, undefined, this))
470
- }, undefined, false, undefined, this)
471
- ]
472
- }, undefined, true, undefined, this)
473
- ]
474
- }, undefined, true, undefined, this)
475
- ]
476
- }, undefined, true, undefined, this);
477
- };
478
- // ui/input.tsx
479
- import { cn as cn4 } from "@contractspec/lib.ui-kit-core/utils";
480
- import { jsxDEV as jsxDEV6 } from "react/jsx-dev-runtime";
481
- function Input({ className, type, ...props }) {
482
- return /* @__PURE__ */ jsxDEV6("input", {
483
- type,
484
- "data-slot": "input",
485
- className: cn4("file:text-foreground placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground dark:bg-input/30 border-input h-9 w-full min-w-0 rounded-md border bg-transparent px-3 py-1 text-base shadow-xs transition-[color,box-shadow] outline-none file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm", "focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]", "aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive", className),
486
- ...props
487
- }, undefined, false, undefined, this);
488
- }
489
- // ui/atoms/SearchInput/SearchInput.tsx
490
- import { Search, X } from "lucide-react";
491
- import { jsxDEV as jsxDEV7 } from "react/jsx-dev-runtime";
492
- var SearchInput = ({
493
- value,
494
- onChange,
495
- placeholder = "Rechercher...",
496
- onClear,
497
- disabled = false,
498
- className = "",
499
- autoFocus = false
500
- }) => {
501
- const handleClear = () => {
502
- onChange("");
503
- onClear?.();
504
- };
505
- return /* @__PURE__ */ jsxDEV7("div", {
506
- className: `relative w-full ${className}`,
507
- children: [
508
- /* @__PURE__ */ jsxDEV7("div", {
509
- className: "pointer-events-none absolute inset-y-0 left-0 flex items-center pl-3",
510
- children: /* @__PURE__ */ jsxDEV7(Search, {
511
- className: "text-muted-foreground h-4 w-4"
512
- }, undefined, false, undefined, this)
513
- }, undefined, false, undefined, this),
514
- /* @__PURE__ */ jsxDEV7(Input, {
515
- type: "text",
516
- value,
517
- onChange: (e) => onChange(e.target.value),
518
- placeholder,
519
- disabled,
520
- autoFocus,
521
- className: "pr-10 pl-10"
522
- }, undefined, false, undefined, this),
523
- value && /* @__PURE__ */ jsxDEV7("div", {
524
- className: "absolute inset-y-0 right-0 flex items-center pr-3",
525
- children: /* @__PURE__ */ jsxDEV7(Button, {
526
- type: "button",
527
- variant: "ghost",
528
- size: "sm",
529
- onClick: handleClear,
530
- disabled,
531
- className: "h-6 w-6 p-0 hover:bg-transparent",
532
- children: [
533
- /* @__PURE__ */ jsxDEV7(X, {
534
- className: "text-muted-foreground hover:text-foreground h-4 w-4"
535
- }, undefined, false, undefined, this),
536
- /* @__PURE__ */ jsxDEV7("span", {
537
- className: "sr-only",
538
- children: "Effacer la recherche"
539
- }, undefined, false, undefined, this)
540
- ]
541
- }, undefined, true, undefined, this)
542
- }, undefined, false, undefined, this)
543
- ]
544
- }, undefined, true, undefined, this);
545
- };
546
- // ui/card.tsx
547
- import { cn as cn5 } from "@contractspec/lib.ui-kit-core/utils";
548
- import { jsxDEV as jsxDEV8 } from "react/jsx-dev-runtime";
549
- function Card({ className, ...props }) {
550
- return /* @__PURE__ */ jsxDEV8("div", {
551
- "data-slot": "card",
552
- className: cn5("bg-card text-card-foreground flex flex-col gap-6 rounded-xl border py-6 shadow-2xs", className),
553
- ...props
554
- }, undefined, false, undefined, this);
555
- }
556
- function CardHeader({
557
- className,
558
- ...props
559
- }) {
560
- return /* @__PURE__ */ jsxDEV8("div", {
561
- "data-slot": "card-header",
562
- className: cn5("@container/card-header grid auto-rows-min grid-rows-[auto_auto] items-start gap-1.5 px-6 has-data-[slot=card-action]:grid-cols-[1fr_auto] [.border-b]:pb-6", className),
563
- ...props
564
- }, undefined, false, undefined, this);
565
- }
566
- function CardTitle({
567
- className,
568
- ...props
569
- }) {
570
- return /* @__PURE__ */ jsxDEV8("div", {
571
- "data-slot": "card-title",
572
- className: cn5("leading-none font-semibold", className),
573
- ...props
574
- }, undefined, false, undefined, this);
575
- }
576
- function CardDescription({
577
- className,
578
- ...props
579
- }) {
580
- return /* @__PURE__ */ jsxDEV8("div", {
581
- "data-slot": "card-description",
582
- className: cn5("text-muted-foreground text-sm", className),
583
- ...props
584
- }, undefined, false, undefined, this);
585
- }
586
- function CardAction({
587
- className,
588
- ...props
589
- }) {
590
- return /* @__PURE__ */ jsxDEV8("div", {
591
- "data-slot": "card-action",
592
- className: cn5("col-start-2 row-span-2 row-start-1 self-start justify-self-end", className),
593
- ...props
594
- }, undefined, false, undefined, this);
595
- }
596
- function CardContent({
597
- className,
598
- ...props
599
- }) {
600
- return /* @__PURE__ */ jsxDEV8("div", {
601
- "data-slot": "card-content",
602
- className: cn5("px-6", className),
603
- ...props
604
- }, undefined, false, undefined, this);
605
- }
606
- function CardFooter({
607
- className,
608
- ...props
609
- }) {
610
- return /* @__PURE__ */ jsxDEV8("div", {
611
- "data-slot": "card-footer",
612
- className: cn5("flex items-center px-6 [.border-t]:pt-6", className),
613
- ...props
614
- }, undefined, false, undefined, this);
615
- }
616
- // ui/collapsible.tsx
617
- import * as CollapsiblePrimitive from "@radix-ui/react-collapsible";
618
- import { jsxDEV as jsxDEV9 } from "react/jsx-dev-runtime";
619
- "use client";
620
- function Collapsible({
621
- ...props
622
- }) {
623
- return /* @__PURE__ */ jsxDEV9(CollapsiblePrimitive.Root, {
624
- "data-slot": "collapsible",
625
- ...props
626
- }, undefined, false, undefined, this);
627
- }
628
- function CollapsibleTrigger2({
629
- ...props
630
- }) {
631
- return /* @__PURE__ */ jsxDEV9(CollapsiblePrimitive.CollapsibleTrigger, {
632
- "data-slot": "collapsible-trigger",
633
- ...props
634
- }, undefined, false, undefined, this);
635
- }
636
- function CollapsibleContent2({
637
- ...props
638
- }) {
639
- return /* @__PURE__ */ jsxDEV9(CollapsiblePrimitive.CollapsibleContent, {
640
- "data-slot": "collapsible-content",
641
- ...props
642
- }, undefined, false, undefined, this);
643
- }
644
- // ui/stack.tsx
645
- import { cva as cva2 } from "class-variance-authority";
646
- import { cn as cn6 } from "@contractspec/lib.ui-kit-core/utils";
647
- import { jsxDEV as jsxDEV10 } from "react/jsx-dev-runtime";
648
- var vStackVariants = cva2("flex flex-col", {
649
- variants: {
650
- gap: {
651
- none: "gap-0",
652
- xs: "gap-1",
653
- sm: "gap-2",
654
- md: "gap-3",
655
- lg: "gap-4",
656
- xl: "gap-6",
657
- "2xl": "gap-8"
658
- },
659
- align: {
660
- start: "items-start",
661
- center: "items-center",
662
- end: "items-end",
663
- stretch: "items-stretch"
664
- },
665
- justify: {
666
- start: "justify-start",
667
- center: "justify-center",
668
- end: "justify-end",
669
- between: "justify-between",
670
- around: "justify-around",
671
- evenly: "justify-evenly"
672
- }
673
- },
674
- defaultVariants: {
675
- gap: "md",
676
- align: "stretch",
677
- justify: "start"
678
- }
679
- });
680
- function VStack({
681
- className,
682
- gap,
683
- align,
684
- justify,
685
- as = "div",
686
- ref,
687
- ...props
688
- }) {
689
- const Comp = as;
690
- return /* @__PURE__ */ jsxDEV10(Comp, {
691
- ref,
692
- className: cn6(vStackVariants({ gap, align, justify }), className),
693
- ...props
694
- }, undefined, false, undefined, this);
695
- }
696
- var hStackVariants = cva2("flex flex-row", {
697
- variants: {
698
- gap: {
699
- none: "gap-0",
700
- xs: "gap-1",
701
- sm: "gap-2",
702
- md: "gap-3",
703
- lg: "gap-4",
704
- xl: "gap-6",
705
- "2xl": "gap-8"
706
- },
707
- align: {
708
- start: "items-start",
709
- center: "items-center",
710
- end: "items-end",
711
- stretch: "items-stretch",
712
- baseline: "items-baseline"
713
- },
714
- justify: {
715
- start: "justify-start",
716
- center: "justify-center",
717
- end: "justify-end",
718
- between: "justify-between",
719
- around: "justify-around",
720
- evenly: "justify-evenly"
721
- },
722
- wrap: {
723
- nowrap: "flex-nowrap",
724
- wrap: "flex-wrap",
725
- wrapReverse: "flex-wrap-reverse"
726
- }
727
- },
728
- defaultVariants: {
729
- gap: "md",
730
- align: "center",
731
- justify: "start",
732
- wrap: "wrap"
733
- }
734
- });
735
- function HStack({
736
- className,
737
- gap,
738
- align,
739
- justify,
740
- wrap,
741
- as = "div",
742
- ref,
743
- ...props
744
- }) {
745
- const Comp = as;
746
- return /* @__PURE__ */ jsxDEV10(Comp, {
747
- ref,
748
- className: cn6(hStackVariants({ gap, align, justify, wrap }), className),
749
- ...props
750
- }, undefined, false, undefined, this);
751
- }
752
- var boxVariants = cva2("flex flex-row", {
753
- variants: {
754
- gap: {
755
- none: "gap-0",
756
- xs: "gap-1",
757
- sm: "gap-2",
758
- md: "gap-3",
759
- lg: "gap-4",
760
- xl: "gap-6",
761
- "2xl": "gap-8"
762
- },
763
- align: {
764
- start: "items-start",
765
- center: "items-center",
766
- end: "items-end",
767
- stretch: "items-stretch",
768
- baseline: "items-baseline"
769
- },
770
- justify: {
771
- start: "justify-start",
772
- center: "justify-center",
773
- end: "justify-end",
774
- between: "justify-between",
775
- around: "justify-around",
776
- evenly: "justify-evenly"
777
- },
778
- wrap: {
779
- nowrap: "flex-nowrap",
780
- wrap: "flex-wrap",
781
- wrapReverse: "flex-wrap-reverse"
782
- }
783
- },
784
- defaultVariants: {
785
- gap: "md",
786
- align: "center",
787
- justify: "center",
788
- wrap: "nowrap"
789
- }
790
- });
791
- function Box({
792
- className,
793
- gap,
794
- align,
795
- justify,
796
- wrap,
797
- as = "div",
798
- ref,
799
- ...props
800
- }) {
801
- const Comp = as;
802
- return /* @__PURE__ */ jsxDEV10(Comp, {
803
- ref,
804
- className: cn6(boxVariants({ gap, align, justify, wrap }), className),
805
- ...props
806
- }, undefined, false, undefined, this);
807
- }
808
- // ui/separator.tsx
809
- import * as SeparatorPrimitive from "@radix-ui/react-separator";
810
- import { cn as cn7 } from "@contractspec/lib.ui-kit-core/utils";
811
- import { jsxDEV as jsxDEV11 } from "react/jsx-dev-runtime";
812
- "use client";
813
- function Separator2({
814
- className,
815
- orientation = "horizontal",
816
- decorative = true,
817
- ...props
818
- }) {
819
- return /* @__PURE__ */ jsxDEV11(SeparatorPrimitive.Root, {
820
- "data-slot": "separator",
821
- decorative,
822
- orientation,
823
- className: cn7("bg-border shrink-0 data-[orientation=horizontal]:h-px data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-px", className),
824
- ...props
825
- }, undefined, false, undefined, this);
826
- }
827
- // ui/molecules/SearchAndFilter/SearchAndFilter.tsx
828
- import { useState } from "react";
829
- import { ChevronDown, ChevronUp, Filter } from "lucide-react";
830
- import { jsxDEV as jsxDEV12 } from "react/jsx-dev-runtime";
831
- var SearchAndFilter = ({
832
- searchValue,
833
- onSearchChange,
834
- searchPlaceholder,
835
- filters = [],
836
- isLoading = false,
837
- disabled = false,
838
- className = "",
839
- collapsible = true,
840
- defaultCollapsed = false
841
- }) => {
842
- const [isCollapsed, setIsCollapsed] = useState(defaultCollapsed);
843
- const hasFilters = filters.length > 0;
844
- const activeFiltersCount = filters.filter((f) => f.value).length;
845
- const shouldUseCollapsible = collapsible && hasFilters;
846
- console.log("SearchAndFilter", { filters });
847
- const FilterComponents = () => /* @__PURE__ */ jsxDEV12("div", {
848
- className: "grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4",
849
- children: filters.map((filter) => /* @__PURE__ */ jsxDEV12(FilterSelect, {
850
- value: filter.value,
851
- options: filter.options,
852
- onChange: filter.onChange,
853
- label: filter.label,
854
- disabled: disabled || isLoading,
855
- showCounts: filter.showCounts,
856
- className: "min-w-0"
857
- }, filter.key, false, undefined, this))
858
- }, undefined, false, undefined, this);
859
- return /* @__PURE__ */ jsxDEV12("div", {
860
- className: `space-y-4 ${className}`,
861
- children: [
862
- /* @__PURE__ */ jsxDEV12("div", {
863
- className: "flex flex-col gap-4 sm:flex-row",
864
- children: [
865
- /* @__PURE__ */ jsxDEV12("div", {
866
- className: "flex-1",
867
- children: /* @__PURE__ */ jsxDEV12(SearchInput, {
868
- value: searchValue,
869
- onChange: onSearchChange,
870
- placeholder: searchPlaceholder,
871
- disabled: disabled || isLoading,
872
- className: "w-full"
873
- }, undefined, false, undefined, this)
874
- }, undefined, false, undefined, this),
875
- shouldUseCollapsible && /* @__PURE__ */ jsxDEV12(Collapsible, {
876
- open: !isCollapsed,
877
- onOpenChange: setIsCollapsed,
878
- className: "sm:hidden",
879
- children: [
880
- /* @__PURE__ */ jsxDEV12(CollapsibleTrigger2, {
881
- asChild: true,
882
- children: /* @__PURE__ */ jsxDEV12(Button, {
883
- variant: "outline",
884
- className: "sm:hidden",
885
- disabled: disabled || isLoading,
886
- children: [
887
- /* @__PURE__ */ jsxDEV12(Filter, {
888
- className: "mr-2 h-4 w-4"
889
- }, undefined, false, undefined, this),
890
- "Filtres",
891
- activeFiltersCount > 0 && /* @__PURE__ */ jsxDEV12("span", {
892
- className: "bg-primary text-primary-foreground ml-2 flex h-5 w-5 items-center justify-center rounded-full text-sm",
893
- children: activeFiltersCount
894
- }, undefined, false, undefined, this),
895
- isCollapsed ? /* @__PURE__ */ jsxDEV12(ChevronDown, {
896
- className: "ml-2 h-4 w-4"
897
- }, undefined, false, undefined, this) : /* @__PURE__ */ jsxDEV12(ChevronUp, {
898
- className: "ml-2 h-4 w-4"
899
- }, undefined, false, undefined, this)
900
- ]
901
- }, undefined, true, undefined, this)
902
- }, undefined, false, undefined, this),
903
- /* @__PURE__ */ jsxDEV12(CollapsibleContent2, {
904
- className: "mt-4 space-y-4",
905
- children: /* @__PURE__ */ jsxDEV12(FilterComponents, {}, undefined, false, undefined, this)
906
- }, undefined, false, undefined, this)
907
- ]
908
- }, undefined, true, undefined, this)
909
- ]
910
- }, undefined, true, undefined, this),
911
- hasFilters && /* @__PURE__ */ jsxDEV12("div", {
912
- className: "hidden sm:block",
913
- children: /* @__PURE__ */ jsxDEV12(FilterComponents, {}, undefined, false, undefined, this)
914
- }, undefined, false, undefined, this),
915
- activeFiltersCount > 0 && /* @__PURE__ */ jsxDEV12("div", {
916
- className: "flex flex-wrap items-center gap-2",
917
- children: [
918
- /* @__PURE__ */ jsxDEV12("span", {
919
- className: "text-muted-foreground text-base",
920
- children: "Filtres actifs:"
921
- }, undefined, false, undefined, this),
922
- filters.filter((f) => f.value).map((filter) => {
923
- const selectedOption = filter.options.find((opt) => opt.value === filter.value);
924
- return /* @__PURE__ */ jsxDEV12(Button, {
925
- variant: "secondary",
926
- size: "sm",
927
- onClick: () => filter.onChange(""),
928
- disabled: disabled || isLoading,
929
- className: "h-7 px-2 text-sm",
930
- children: [
931
- filter.label,
932
- ": ",
933
- selectedOption?.label,
934
- /* @__PURE__ */ jsxDEV12("span", {
935
- className: "ml-1",
936
- children: "×"
937
- }, undefined, false, undefined, this)
938
- ]
939
- }, filter.key, true, undefined, this);
940
- })
941
- ]
942
- }, undefined, true, undefined, this)
943
- ]
944
- }, undefined, true, undefined, this);
945
- };
946
- // ui/organisms/ListPage/ListPage.tsx
947
- import Link from "next/link";
948
- import { AlertTriangle, Loader2, Plus, RefreshCcw } from "lucide-react";
949
- import { jsxDEV as jsxDEV13, Fragment } from "react/jsx-dev-runtime";
950
- function ListPage({
951
- title,
952
- description,
953
- header,
954
- items,
955
- totalItems,
956
- totalPages,
957
- isLoading,
958
- isFetching,
959
- error,
960
- listState,
961
- searchPlaceholder,
962
- filters = [],
963
- onRefresh,
964
- primaryAction,
965
- toolbar,
966
- renderItem,
967
- renderEmpty,
968
- renderStats,
969
- className = "",
970
- itemClassName = ""
971
- }) {
972
- const {
973
- searchQuery,
974
- setSearchQuery,
975
- filters: filterValues,
976
- setFilter,
977
- currentPage,
978
- itemsPerPage,
979
- setCurrentPage,
980
- setItemsPerPage
981
- } = listState;
982
- if (isLoading && !items.length) {
983
- return /* @__PURE__ */ jsxDEV13(VStack, {
984
- className: `space-y-4 md:space-y-6 ${className}`,
985
- children: [
986
- header ? header : /* @__PURE__ */ jsxDEV13(VStack, {
987
- className: "gap-1",
988
- children: [
989
- /* @__PURE__ */ jsxDEV13("h1", {
990
- className: "text-2xl font-bold md:text-3xl",
991
- children: title
992
- }, undefined, false, undefined, this),
993
- description && /* @__PURE__ */ jsxDEV13("p", {
994
- className: "text-muted-foreground text-base",
995
- children: description
996
- }, undefined, false, undefined, this)
997
- ]
998
- }, undefined, true, undefined, this),
999
- /* @__PURE__ */ jsxDEV13("div", {
1000
- className: "flex min-h-[400px] items-center justify-center",
1001
- children: /* @__PURE__ */ jsxDEV13(Card, {
1002
- children: /* @__PURE__ */ jsxDEV13(CardContent, {
1003
- className: "flex items-center gap-4 p-6",
1004
- children: [
1005
- /* @__PURE__ */ jsxDEV13(Loader2, {
1006
- className: "text-primary h-8 w-8 animate-spin"
1007
- }, undefined, false, undefined, this),
1008
- /* @__PURE__ */ jsxDEV13("div", {
1009
- children: [
1010
- /* @__PURE__ */ jsxDEV13("h3", {
1011
- className: "font-medium",
1012
- children: "Chargement..."
1013
- }, undefined, false, undefined, this),
1014
- /* @__PURE__ */ jsxDEV13("p", {
1015
- className: "text-muted-foreground text-base",
1016
- children: "Récupération des données en cours"
1017
- }, undefined, false, undefined, this)
1018
- ]
1019
- }, undefined, true, undefined, this)
1020
- ]
1021
- }, undefined, true, undefined, this)
1022
- }, undefined, false, undefined, this)
1023
- }, undefined, false, undefined, this)
1024
- ]
1025
- }, undefined, true, undefined, this);
1026
- }
1027
- if (error && !items.length) {
1028
- return /* @__PURE__ */ jsxDEV13(VStack, {
1029
- className: `space-y-4 md:space-y-6 ${className}`,
1030
- children: [
1031
- header ? header : /* @__PURE__ */ jsxDEV13(VStack, {
1032
- className: "gap-1",
1033
- children: [
1034
- /* @__PURE__ */ jsxDEV13("h1", {
1035
- className: "text-2xl font-bold md:text-3xl",
1036
- children: title
1037
- }, undefined, false, undefined, this),
1038
- description && /* @__PURE__ */ jsxDEV13("p", {
1039
- className: "text-muted-foreground text-base",
1040
- children: description
1041
- }, undefined, false, undefined, this)
1042
- ]
1043
- }, undefined, true, undefined, this),
1044
- /* @__PURE__ */ jsxDEV13("div", {
1045
- className: "flex min-h-[400px] items-center justify-center",
1046
- children: /* @__PURE__ */ jsxDEV13(Card, {
1047
- children: /* @__PURE__ */ jsxDEV13(CardContent, {
1048
- className: "flex flex-col items-center gap-4 p-6 text-center",
1049
- children: [
1050
- /* @__PURE__ */ jsxDEV13(AlertTriangle, {
1051
- className: "text-destructive h-12 w-12"
1052
- }, undefined, false, undefined, this),
1053
- /* @__PURE__ */ jsxDEV13("div", {
1054
- children: [
1055
- /* @__PURE__ */ jsxDEV13("h3", {
1056
- className: "font-medium",
1057
- children: "Erreur de chargement"
1058
- }, undefined, false, undefined, this),
1059
- /* @__PURE__ */ jsxDEV13("p", {
1060
- className: "text-muted-foreground text-base",
1061
- children: error.message || "Une erreur est survenue"
1062
- }, undefined, false, undefined, this)
1063
- ]
1064
- }, undefined, true, undefined, this),
1065
- onRefresh && /* @__PURE__ */ jsxDEV13(Button, {
1066
- onClick: onRefresh,
1067
- variant: "outline",
1068
- size: "sm",
1069
- children: [
1070
- /* @__PURE__ */ jsxDEV13(RefreshCcw, {
1071
- className: "mr-2 h-4 w-4"
1072
- }, undefined, false, undefined, this),
1073
- "Réessayer"
1074
- ]
1075
- }, undefined, true, undefined, this)
1076
- ]
1077
- }, undefined, true, undefined, this)
1078
- }, undefined, false, undefined, this)
1079
- }, undefined, false, undefined, this)
1080
- ]
1081
- }, undefined, true, undefined, this);
1082
- }
1083
- const filterConfigs = filters.map((filter) => ({
1084
- key: filter.key,
1085
- label: filter.label,
1086
- value: filterValues[filter.key] || "",
1087
- options: filter.options,
1088
- onChange: (value) => {
1089
- setFilter(filter.key, value === "all" ? "" : value);
1090
- },
1091
- showCounts: filter.showCounts
1092
- }));
1093
- return /* @__PURE__ */ jsxDEV13(VStack, {
1094
- className: `space-y-4 md:space-y-6 ${className}`,
1095
- children: [
1096
- header ? header : /* @__PURE__ */ jsxDEV13(HStack, {
1097
- className: "items-center justify-between",
1098
- children: [
1099
- /* @__PURE__ */ jsxDEV13(VStack, {
1100
- className: "gap-1",
1101
- children: [
1102
- /* @__PURE__ */ jsxDEV13("h1", {
1103
- className: "text-2xl font-bold md:text-3xl",
1104
- children: title
1105
- }, undefined, false, undefined, this),
1106
- description && /* @__PURE__ */ jsxDEV13("p", {
1107
- className: "text-muted-foreground text-base",
1108
- children: description
1109
- }, undefined, false, undefined, this)
1110
- ]
1111
- }, undefined, true, undefined, this),
1112
- /* @__PURE__ */ jsxDEV13(HStack, {
1113
- className: "items-center gap-4",
1114
- children: [
1115
- toolbar,
1116
- (isLoading || isFetching) && /* @__PURE__ */ jsxDEV13("div", {
1117
- className: "text-muted-foreground flex items-center gap-2 text-base",
1118
- children: [
1119
- /* @__PURE__ */ jsxDEV13(Loader2, {
1120
- className: "h-4 w-4 animate-spin"
1121
- }, undefined, false, undefined, this),
1122
- /* @__PURE__ */ jsxDEV13("span", {
1123
- className: "hidden sm:inline",
1124
- children: "Mise à jour..."
1125
- }, undefined, false, undefined, this)
1126
- ]
1127
- }, undefined, true, undefined, this),
1128
- onRefresh && /* @__PURE__ */ jsxDEV13(Button, {
1129
- variant: "outline",
1130
- size: "sm",
1131
- onClick: onRefresh,
1132
- disabled: Boolean(isLoading),
1133
- "aria-label": "Rafraîchir",
1134
- children: [
1135
- /* @__PURE__ */ jsxDEV13(RefreshCcw, {
1136
- className: `mr-2 h-4 w-4 ${isLoading || isFetching ? "animate-spin" : ""}`
1137
- }, undefined, false, undefined, this),
1138
- /* @__PURE__ */ jsxDEV13("span", {
1139
- className: "hidden sm:inline",
1140
- children: "Rafraîchir"
1141
- }, undefined, false, undefined, this)
1142
- ]
1143
- }, undefined, true, undefined, this),
1144
- primaryAction && /* @__PURE__ */ jsxDEV13(Fragment, {
1145
- children: primaryAction.href ? /* @__PURE__ */ jsxDEV13(Link, {
1146
- href: primaryAction.href,
1147
- children: /* @__PURE__ */ jsxDEV13(Button, {
1148
- children: [
1149
- primaryAction.icon || /* @__PURE__ */ jsxDEV13(Plus, {
1150
- className: "mr-2 h-4 w-4"
1151
- }, undefined, false, undefined, this),
1152
- /* @__PURE__ */ jsxDEV13("span", {
1153
- className: "hidden sm:inline",
1154
- children: primaryAction.label
1155
- }, undefined, false, undefined, this),
1156
- /* @__PURE__ */ jsxDEV13("span", {
1157
- className: "sm:hidden",
1158
- children: "Nouveau"
1159
- }, undefined, false, undefined, this)
1160
- ]
1161
- }, undefined, true, undefined, this)
1162
- }, undefined, false, undefined, this) : /* @__PURE__ */ jsxDEV13(Button, {
1163
- onClick: primaryAction.onClick,
1164
- children: [
1165
- primaryAction.icon || /* @__PURE__ */ jsxDEV13(Plus, {
1166
- className: "mr-2 h-4 w-4"
1167
- }, undefined, false, undefined, this),
1168
- /* @__PURE__ */ jsxDEV13("span", {
1169
- className: "hidden sm:inline",
1170
- children: primaryAction.label
1171
- }, undefined, false, undefined, this),
1172
- /* @__PURE__ */ jsxDEV13("span", {
1173
- className: "sm:hidden",
1174
- children: "Nouveau"
1175
- }, undefined, false, undefined, this)
1176
- ]
1177
- }, undefined, true, undefined, this)
1178
- }, undefined, false, undefined, this)
1179
- ]
1180
- }, undefined, true, undefined, this)
1181
- ]
1182
- }, undefined, true, undefined, this),
1183
- renderStats && /* @__PURE__ */ jsxDEV13(Fragment, {
1184
- children: [
1185
- renderStats(items),
1186
- /* @__PURE__ */ jsxDEV13(Separator2, {}, undefined, false, undefined, this)
1187
- ]
1188
- }, undefined, true, undefined, this),
1189
- /* @__PURE__ */ jsxDEV13(SearchAndFilter, {
1190
- searchValue: searchQuery,
1191
- onSearchChange: setSearchQuery,
1192
- searchPlaceholder,
1193
- filters: filterConfigs,
1194
- isLoading
1195
- }, undefined, false, undefined, this),
1196
- items.length === 0 && !isLoading ? renderEmpty ? renderEmpty() : /* @__PURE__ */ jsxDEV13(Card, {
1197
- children: /* @__PURE__ */ jsxDEV13(CardContent, {
1198
- className: "flex flex-col items-center gap-4 p-8 text-center",
1199
- children: [
1200
- /* @__PURE__ */ jsxDEV13("div", {
1201
- className: "bg-muted flex h-12 w-12 items-center justify-center rounded-full",
1202
- children: /* @__PURE__ */ jsxDEV13("div", {
1203
- className: "bg-muted-foreground/20 h-6 w-6 rounded-full"
1204
- }, undefined, false, undefined, this)
1205
- }, undefined, false, undefined, this),
1206
- /* @__PURE__ */ jsxDEV13("div", {
1207
- children: [
1208
- /* @__PURE__ */ jsxDEV13("h3", {
1209
- className: "font-medium",
1210
- children: "Aucun élément trouvé"
1211
- }, undefined, false, undefined, this),
1212
- /* @__PURE__ */ jsxDEV13("p", {
1213
- className: "text-muted-foreground text-base",
1214
- children: searchQuery || Object.values(filterValues).some((v) => v) ? "Essayez de modifier vos critères de recherche" : "Commencez par créer votre premier élément"
1215
- }, undefined, false, undefined, this)
1216
- ]
1217
- }, undefined, true, undefined, this),
1218
- primaryAction && !searchQuery && !Object.values(filterValues).some((v) => v) && /* @__PURE__ */ jsxDEV13(Fragment, {
1219
- children: primaryAction.href ? /* @__PURE__ */ jsxDEV13(Link, {
1220
- href: primaryAction.href,
1221
- children: /* @__PURE__ */ jsxDEV13(Button, {
1222
- children: [
1223
- primaryAction.icon || /* @__PURE__ */ jsxDEV13(Plus, {
1224
- className: "mr-2 h-4 w-4"
1225
- }, undefined, false, undefined, this),
1226
- primaryAction.label
1227
- ]
1228
- }, undefined, true, undefined, this)
1229
- }, undefined, false, undefined, this) : /* @__PURE__ */ jsxDEV13(Button, {
1230
- onClick: primaryAction.onClick,
1231
- children: [
1232
- primaryAction.icon || /* @__PURE__ */ jsxDEV13(Plus, {
1233
- className: "mr-2 h-4 w-4"
1234
- }, undefined, false, undefined, this),
1235
- primaryAction.label
1236
- ]
1237
- }, undefined, true, undefined, this)
1238
- }, undefined, false, undefined, this)
1239
- ]
1240
- }, undefined, true, undefined, this)
1241
- }, undefined, false, undefined, this) : /* @__PURE__ */ jsxDEV13(Fragment, {
1242
- children: [
1243
- /* @__PURE__ */ jsxDEV13("div", {
1244
- className: `space-y-4 ${itemClassName}`,
1245
- children: items.map((item, index) => renderItem(item, index))
1246
- }, undefined, false, undefined, this),
1247
- totalPages > 1 && /* @__PURE__ */ jsxDEV13(Pagination, {
1248
- currentPage,
1249
- totalPages,
1250
- totalItems,
1251
- itemsPerPage,
1252
- onPageChange: setCurrentPage,
1253
- onItemsPerPageChange: setItemsPerPage,
1254
- disabled: isLoading
1255
- }, undefined, false, undefined, this)
1256
- ]
1257
- }, undefined, true, undefined, this)
1258
- ]
1259
- }, undefined, true, undefined, this);
1260
- }
1261
8
  export {
1262
9
  ListPage
1263
10
  };