@krosoft/react 0.0.292 → 0.0.294

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 (29) hide show
  1. package/dist/{GenericForm-BdKwapAz.js → GenericForm-D7ni-5-4.js} +1 -1
  2. package/dist/MultiSelect-CZ4hye2w.js +147 -0
  3. package/dist/SearchInput-nr0CrMLK.js +316 -0
  4. package/dist/components/core/dialogs/index.js +1 -1
  5. package/dist/components/core/filters/FilterField.d.ts.map +1 -1
  6. package/dist/components/core/filters/FilterPills.d.ts +1 -1
  7. package/dist/components/core/filters/TableFilter.d.ts.map +1 -1
  8. package/dist/components/core/filters/index.d.ts +0 -1
  9. package/dist/components/core/filters/index.d.ts.map +1 -1
  10. package/dist/components/core/filters/index.js +138 -253
  11. package/dist/components/core/forms/index.js +1 -1
  12. package/dist/components/core/index.js +15 -15
  13. package/dist/components/core/inputs/MultiSelect.d.ts +15 -7
  14. package/dist/components/core/inputs/MultiSelect.d.ts.map +1 -1
  15. package/dist/components/core/inputs/SingleSelect.d.ts +30 -0
  16. package/dist/components/core/inputs/SingleSelect.d.ts.map +1 -0
  17. package/dist/components/core/inputs/index.d.ts +2 -2
  18. package/dist/components/core/inputs/index.d.ts.map +1 -1
  19. package/dist/components/core/inputs/index.js +4 -4
  20. package/dist/components/index.js +15 -15
  21. package/dist/{dialogs-BxyPBIc6.js → dialogs-BjqvZvax.js} +1 -1
  22. package/dist/{inputs-CUNf48Vk.js → inputs-BMCt-VqZ.js} +2 -2
  23. package/package.json +1 -1
  24. package/dist/MultiSelect-O4JP5fRO.js +0 -129
  25. package/dist/SearchInput-BSIjKB_9.js +0 -259
  26. package/dist/components/core/filters/SearchableFilterPill.d.ts +0 -16
  27. package/dist/components/core/filters/SearchableFilterPill.d.ts.map +0 -1
  28. package/dist/components/core/inputs/SearchableSelect.d.ts +0 -28
  29. package/dist/components/core/inputs/SearchableSelect.d.ts.map +0 -1
@@ -1,18 +1,26 @@
1
1
  import React from "react";
2
2
  import type { SelectOption } from "@krosoft/core/types";
3
- interface MultiSelectProps {
3
+ interface MultiSelectProps<T extends string = string> {
4
4
  options: SelectOption[];
5
- selected: string[];
6
- onToggle: (val: string) => void;
7
- onClear: () => void;
8
- onSelectAll?: (values: string[]) => void;
5
+ selected: T[];
6
+ onToggle: (val: T) => void;
7
+ onClear?: () => void;
8
+ onSelectAll?: (values: T[]) => void;
9
+ /**
10
+ * `"input"` : contrôle de formulaire pleine largeur (libellés sélectionnés + compteur `+N`).
11
+ * `"pill"` : pastille de filtre compacte (libellé i18n fixe + badge du nombre de sélections).
12
+ */
13
+ variant?: "input" | "pill";
9
14
  placeholder?: string;
15
+ /** Libellé i18n fixe de la pastille (variant `"pill"`). */
16
+ labelKey?: string;
10
17
  searchable?: boolean;
11
18
  searchPlaceholder?: string;
12
19
  disabled?: boolean;
13
- /** Nombre de libellés affichés dans le trigger, le reste est résumé par un compteur `+N`. */
20
+ /** Nombre de libellés affichés dans le trigger (variant `"input"`), le reste est résumé par un compteur `+N`. */
14
21
  maxCount?: number;
22
+ className?: string;
15
23
  }
16
- export declare const MultiSelect: ({ options, selected, onToggle, onClear, onSelectAll, placeholder, searchable, searchPlaceholder, disabled, maxCount, }: MultiSelectProps) => React.ReactElement;
24
+ export declare const MultiSelect: <T extends string = string>({ options, selected, onToggle, onClear, onSelectAll, variant, placeholder, labelKey, searchable, searchPlaceholder, disabled, maxCount, className, }: MultiSelectProps<T>) => React.ReactElement;
17
25
  export {};
18
26
  //# sourceMappingURL=MultiSelect.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"MultiSelect.d.ts","sourceRoot":"","sources":["../../../../src/components/core/inputs/MultiSelect.tsx"],"names":[],"mappings":"AACA,OAAO,KAA+C,MAAM,OAAO,CAAC;AAIpE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAExD,UAAU,gBAAgB;IACxB,OAAO,EAAE,YAAY,EAAE,CAAC;IACxB,QAAQ,EAAE,MAAM,EAAE,CAAC;IACnB,QAAQ,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,CAAC;IAChC,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,WAAW,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,IAAI,CAAC;IACzC,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,6FAA6F;IAC7F,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,eAAO,MAAM,WAAW,GAAI,wHAWzB,gBAAgB,KAAG,KAAK,CAAC,YA8K3B,CAAC"}
1
+ {"version":3,"file":"MultiSelect.d.ts","sourceRoot":"","sources":["../../../../src/components/core/inputs/MultiSelect.tsx"],"names":[],"mappings":"AACA,OAAO,KAA4B,MAAM,OAAO,CAAC;AAKjD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAExD,UAAU,gBAAgB,CAAC,CAAC,SAAS,MAAM,GAAG,MAAM;IAClD,OAAO,EAAE,YAAY,EAAE,CAAC;IACxB,QAAQ,EAAE,CAAC,EAAE,CAAC;IACd,QAAQ,EAAE,CAAC,GAAG,EAAE,CAAC,KAAK,IAAI,CAAC;IAC3B,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,WAAW,CAAC,EAAE,CAAC,MAAM,EAAE,CAAC,EAAE,KAAK,IAAI,CAAC;IACpC;;;OAGG;IACH,OAAO,CAAC,EAAE,OAAO,GAAG,MAAM,CAAC;IAC3B,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,2DAA2D;IAC3D,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,iHAAiH;IACjH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,eAAO,MAAM,WAAW,GAAI,CAAC,SAAS,MAAM,GAAG,MAAM,EAAE,sJAcpD,gBAAgB,CAAC,CAAC,CAAC,KAAG,KAAK,CAAC,YAkM9B,CAAC"}
@@ -0,0 +1,30 @@
1
+ import React from "react";
2
+ import type { SelectOption } from "@krosoft/core/types";
3
+ export interface SingleSelectOption extends SelectOption {
4
+ /** Texte secondaire affiché en gris à côté du libellé (ex. le groupe d'un tenant). Inclus dans la recherche (mode `searchable`). */
5
+ description?: string;
6
+ }
7
+ interface SingleSelectProps {
8
+ options?: SingleSelectOption[];
9
+ value: string | undefined;
10
+ onChange: (value: string) => void;
11
+ onClear?: () => void;
12
+ /** Active la recherche : rend un panneau filtrable (aligné visuellement sur `MultiSelect`) au lieu du select simple (Radix). */
13
+ searchable?: boolean;
14
+ /** Mode `searchable` : propose de créer une option quand la saisie ne correspond à aucun libellé existant. */
15
+ onCreate?: (label: string) => void;
16
+ placeholder?: string;
17
+ searchPlaceholder?: string;
18
+ emptyLabel?: string;
19
+ createLabel?: (search: string) => string;
20
+ disabled?: boolean;
21
+ /**
22
+ * Mode `searchable` : panneau rendu en modal (défaut, comme le `Select`). À laisser tel quel dans une boîte de
23
+ * dialogue : sans ça, le `Dialog` neutralise les clics sur le panneau porté dans le portail.
24
+ */
25
+ modal?: boolean;
26
+ className?: string;
27
+ }
28
+ export declare const SingleSelect: ({ options, value, onChange, onClear, searchable, onCreate, placeholder, searchPlaceholder, emptyLabel, createLabel, disabled, modal, className, }: SingleSelectProps) => React.ReactElement;
29
+ export {};
30
+ //# sourceMappingURL=SingleSelect.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SingleSelect.d.ts","sourceRoot":"","sources":["../../../../src/components/core/inputs/SingleSelect.tsx"],"names":[],"mappings":"AACA,OAAO,KAA4B,MAAM,OAAO,CAAC;AAKjD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAExD,MAAM,WAAW,kBAAmB,SAAQ,YAAY;IACtD,oIAAoI;IACpI,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,UAAU,iBAAiB;IACzB,OAAO,CAAC,EAAE,kBAAkB,EAAE,CAAC;IAC/B,KAAK,EAAE,MAAM,GAAG,SAAS,CAAC;IAC1B,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAClC,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,gIAAgI;IAChI,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,8GAA8G;IAC9G,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACnC,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,WAAW,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,MAAM,CAAC;IACzC,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;;OAGG;IACH,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,eAAO,MAAM,YAAY,GAAI,mJAc1B,iBAAiB,KAAG,KAAK,CAAC,YAwK5B,CAAC"}
@@ -2,8 +2,8 @@ export { ImageInput } from "./ImageInput";
2
2
  export { SearchInput } from "./SearchInput";
3
3
  export { DatePicker } from "./DatePicker";
4
4
  export { DateRangePicker } from "./DateRangePicker";
5
+ export { SingleSelect } from "./SingleSelect";
6
+ export type { SingleSelectOption } from "./SingleSelect";
5
7
  export { MultiSelect } from "./MultiSelect";
6
8
  export { RatingInput } from "./RatingInput";
7
- export { SearchableSelect } from "./SearchableSelect";
8
- export type { SearchableSelectOption } from "./SearchableSelect";
9
9
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/core/inputs/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,YAAY,EAAE,sBAAsB,EAAE,MAAM,oBAAoB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/core/inputs/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,YAAY,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AACzD,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC"}
@@ -1,5 +1,5 @@
1
1
  import { t as e } from "../../../ImageInput-BPNEywyf.js";
2
- import { t } from "../../../MultiSelect-O4JP5fRO.js";
3
- import { i as n, n as r, r as i, t as a } from "../../../SearchInput-BSIjKB_9.js";
4
- import { t as o } from "../../../inputs-CUNf48Vk.js";
5
- export { n as DatePicker, i as DateRangePicker, e as ImageInput, t as MultiSelect, o as RatingInput, a as SearchInput, r as SearchableSelect };
2
+ import { t } from "../../../MultiSelect-CZ4hye2w.js";
3
+ import { i as n, n as r, r as i, t as a } from "../../../SearchInput-nr0CrMLK.js";
4
+ import { t as o } from "../../../inputs-BMCt-VqZ.js";
5
+ export { n as DatePicker, i as DateRangePicker, e as ImageInput, t as MultiSelect, o as RatingInput, a as SearchInput, r as SingleSelect };
@@ -7,23 +7,23 @@ import { A as On, C as kn, D as An, E as jn, F as Mn, M as Nn, N as Pn, O as Fn,
7
7
  import { a as lr, c as ur, i as dr, l as fr, n as pr, o as mr, r as hr, s as gr, t as _r, u as vr } from "../select-DmLScQKX.js";
8
8
  import { t as yr } from "../skeleton-D6Ga4BLw.js";
9
9
  import { a as br, c as xr, i as Sr, n as Cr, o as wr, r as Tr, s as Er, t as Dr } from "../charts-C7MWuqi9.js";
10
- import { n as Or, r as kr, t as Ar } from "../dialogs-BxyPBIc6.js";
10
+ import { n as Or, r as kr, t as Ar } from "../dialogs-BjqvZvax.js";
11
11
  import { t as jr } from "../ImageInput-BPNEywyf.js";
12
12
  import { t as Mr } from "../AppActions-CpbkO_3O.js";
13
13
  import { t as Nr } from "../AppSubTitle-BOVTZlUB.js";
14
- import { t as Pr } from "../MultiSelect-O4JP5fRO.js";
15
- import { t as Fr } from "../GenericForm-BdKwapAz.js";
14
+ import { t as Pr } from "../MultiSelect-CZ4hye2w.js";
15
+ import { t as Fr } from "../GenericForm-D7ni-5-4.js";
16
16
  import { t as Ir } from "../ErrorAlert-L2s8Dd1_.js";
17
- import { i as Lr, n as Rr, r as zr, t as Br } from "../SearchInput-BSIjKB_9.js";
18
- import { ActiveFilters as Vr, AdvancedFilters as Hr, FilterField as Ur, FilterPills as Wr, FilterPillsGroup as Gr, SearchableFilterPill as Kr, TableFilter as qr } from "./core/filters/index.js";
19
- import { t as Jr } from "../inputs-CUNf48Vk.js";
20
- import { t as Yr } from "../language-DOGOdjzx.js";
21
- import { t as Xr } from "../AppTitle-BZ5jQWbs.js";
22
- import { n as Zr, t as Qr } from "../states-BQK9jqS4.js";
23
- import { AppPageHeader as $r, KpiCardsLayout as ei } from "./core/layouts/index.js";
24
- import { a as ti, i as ni, n as ri, o as ii, r as ai, t as oi } from "../navbar-CCHGdEzE.js";
25
- import { DataTable as si, JsonTableOutput as ci, TableActions as li, TableBody as ui, TableBulkActions as di, TableHeader as fi, TablePagination as pi, TableSettings as mi } from "./core/table/index.js";
26
- import { AppTabContainer as hi, AppTabHeader as gi, AppTabs as _i, AppVerticalTabs as vi } from "./core/tabs/index.js";
27
- import { t as yi } from "../theme-q2uzluEd.js";
17
+ import { i as Lr, n as Rr, r as zr, t as Br } from "../SearchInput-nr0CrMLK.js";
18
+ import { ActiveFilters as Vr, AdvancedFilters as Hr, FilterField as Ur, FilterPills as Wr, FilterPillsGroup as Gr, TableFilter as Kr } from "./core/filters/index.js";
19
+ import { t as qr } from "../inputs-BMCt-VqZ.js";
20
+ import { t as Jr } from "../language-DOGOdjzx.js";
21
+ import { t as Yr } from "../AppTitle-BZ5jQWbs.js";
22
+ import { n as Xr, t as Zr } from "../states-BQK9jqS4.js";
23
+ import { AppPageHeader as Qr, KpiCardsLayout as $r } from "./core/layouts/index.js";
24
+ import { a as ei, i as ti, n as ni, o as ri, r as ii, t as ai } from "../navbar-CCHGdEzE.js";
25
+ import { DataTable as oi, JsonTableOutput as si, TableActions as ci, TableBody as li, TableBulkActions as ui, TableHeader as di, TablePagination as fi, TableSettings as pi } from "./core/table/index.js";
26
+ import { AppTabContainer as mi, AppTabHeader as hi, AppTabs as gi, AppVerticalTabs as _i } from "./core/tabs/index.js";
27
+ import { t as vi } from "../theme-q2uzluEd.js";
28
28
  import "./core/index.js";
29
- export { ze as Accordion, Ie as AccordionContent, He as AccordionItem, he as AccordionTrigger, Vr as ActiveFilters, Hr as AdvancedFilters, yn as Alert, _n as AlertDescription, w as AlertDialog, Ae as AlertDialogAction, H as AlertDialogCancel, De as AlertDialogContent, Ne as AlertDialogDescription, z as AlertDialogFooter, Z as AlertDialogHeader, Vt as AlertDialogTitle, J as AlertDialogTrigger, vn as AlertTitle, Mr as AppActions, kr as AppDialog, $r as AppPageHeader, Nr as AppSubTitle, hi as AppTabContainer, gi as AppTabHeader, _i as AppTabs, Xr as AppTitle, vi as AppVerticalTabs, hn as AspectRatio, G as Avatar, ee as AvatarFallback, ve as AvatarImage, fe as Badge, xr as BarChartHorizontal, Er as BarChartVertical, A as Breadcrumb, le as BreadcrumbEllipsis, Ct as BreadcrumbItem, x as BreadcrumbLink, bt as BreadcrumbList, re as BreadcrumbPage, oe as BreadcrumbSeparator, En as Button, br as CHART_COLORS, N as Calendar, l as Card, t as CardContent, a as CardDescription, d as CardFooter, n as CardHeader, r as CardTitle, ln as Carousel, xe as CarouselContent, D as CarouselItem, on as CarouselNext, we as CarouselPrevious, Sr as ChartCard, u as ChartContainer, o as ChartLegend, c as ChartLegendContent, i as ChartStyle, e as ChartTooltip, s as ChartTooltipContent, Ze as Checkbox, Tr as CircularGauge, Ge as Collapsible, nn as CollapsibleContent, fn as CollapsibleTrigger, zn as Command, ar as CommandDialog, cr as CommandEmpty, Vn as CommandGroup, sr as CommandInput, Ln as CommandItem, kn as CommandList, or as CommandSeparator, Rn as CommandShortcut, Ar as ConfirmationDialog, Mt as ContextMenu, Wt as ContextMenuCheckboxItem, _t as ContextMenuContent, Je as ContextMenuGroup, Ft as ContextMenuItem, qt as ContextMenuLabel, et as ContextMenuPortal, Et as ContextMenuRadioGroup, $t as ContextMenuRadioItem, rt as ContextMenuSeparator, ct as ContextMenuShortcut, Rt as ContextMenuSub, kt as ContextMenuSubContent, mt as ContextMenuSubTrigger, dt as ContextMenuTrigger, h as DashboardCard, si as DataTable, Lr as DatePicker, zr as DateRangePicker, jn as Dialog, An as DialogClose, Fn as DialogContent, Yn as DialogDescription, On as DialogFooter, Jn as DialogHeader, Nn as DialogOverlay, Pn as DialogPortal, In as DialogTitle, Mn as DialogTrigger, Q as Drawer, Ht as DrawerClose, Y as DrawerContent, Be as DrawerDescription, Le as DrawerFooter, Ue as DrawerHeader, ge as DrawerOverlay, y as DrawerPortal, at as DrawerTitle, Xt as DrawerTrigger, xt as DropdownMenu, ie as DropdownMenuCheckboxItem, se as DropdownMenuContent, pe as DropdownMenuGroup, L as DropdownMenuItem, K as DropdownMenuLabel, te as DropdownMenuPortal, ye as DropdownMenuRadioGroup, gn as DropdownMenuRadioItem, T as DropdownMenuSeparator, je as DropdownMenuShortcut, U as DropdownMenuSub, Oe as DropdownMenuSubContent, Pe as DropdownMenuSubTrigger, B as DropdownMenuTrigger, Ir as ErrorAlert, Zr as ErrorState, Ur as FilterField, Wr as FilterPills, Gr as FilterPillsGroup, Se as Form, O as FormControl, sn as FormDescription, Or as FormDialog, Te as FormField, P as FormItem, j as FormLabel, ue as FormMessage, Fr as GenericForm, ii as GlobalSearch, pn as HoverCard, Qe as HoverCardContent, un as HoverCardTrigger, jr as ImageInput, Gn as Input, ht as InputOTP, ft as InputOTPGroup, Ke as InputOTPSeparator, rn as InputOTPSlot, ci as JsonTableOutput, f as KpiCard, p as KpiCards, ei as KpiCardsLayout, S as Label, Yr as LanguageSelector, Cr as LineChart, Qr as LoadingState, v as Menubar, ot as MenubarCheckboxItem, Zt as MenubarContent, Nt as MenubarGroup, Gt as MenubarItem, vt as MenubarLabel, Ye as MenubarMenu, It as MenubarPortal, Jt as MenubarRadioGroup, tt as MenubarRadioItem, Dt as MenubarSeparator, en as MenubarShortcut, it as MenubarSub, lt as MenubarSubContent, zt as MenubarSubTrigger, At as MenubarTrigger, g as MetricCard, Pr as MultiSelect, Me as NavigationMenu, R as NavigationMenuContent, X as NavigationMenuIndicator, Bt as NavigationMenuItem, q as NavigationMenuLink, Re as NavigationMenuList, Fe as NavigationMenuTrigger, Ve as NavigationMenuViewport, ti as NotificationsBell, $ as Pagination, _e as PaginationContent, mn as PaginationEllipsis, C as PaginationItem, ke as PaginationLink, V as PaginationNext, Ee as PaginationPrevious, Dr as PieChart, er as Popover, Zn as PopoverContent, Kn as PopoverTrigger, W as Progress, de as RadioGroup, F as RadioGroupItem, Jr as RatingInput, yt as ResizableHandle, ne as ResizablePanel, ae as ResizablePanelGroup, Un as ScrollArea, Wn as ScrollBar, Br as SearchInput, Kr as SearchableFilterPill, Rr as SearchableSelect, _r as Select, pr as SelectContent, hr as SelectGroup, dr as SelectItem, lr as SelectLabel, mr as SelectScrollDownButton, gr as SelectScrollUpButton, ur as SelectSeparator, fr as SelectTrigger, vr as SelectValue, b as Separator, rr as Sheet, Qn as SheetClose, tr as SheetContent, qn as SheetDescription, Bn as SheetFooter, $n as SheetHeader, nr as SheetOverlay, Hn as SheetPortal, Xn as SheetTitle, ir as SheetTrigger, ai as Sidebar, ri as SidebarHeader, ni as SidebarNavItem, be as SimpleTable, E as SimpleTableBody, an as SimpleTableCaption, Ce as SimpleTableCell, M as SimpleTableFooter, k as SimpleTableHead, ce as SimpleTableHeader, St as SimpleTableRow, yr as Skeleton, m as SkeletonCard, _ as SkeletonCards, cn as Slider, dn as Sonner, tn as Switch, li as TableActions, ui as TableBody, di as TableBulkActions, qr as TableFilter, fi as TableHeader, pi as TablePagination, mi as TableSettings, Ot as Tabs, pt as TabsContent, ut as TabsList, We as TabsTrigger, Lt as Textarea, yi as ThemeSelector, Pt as Toast, Kt as ToastAction, $e as ToastClose, Tt as ToastDescription, Qt as ToastProvider, nt as ToastTitle, st as ToastViewport, qe as Toaster, Ut as Toggle, Yt as ToggleGroup, jt as ToggleGroupItem, Dn as Tooltip, Cn as TooltipContent, Tn as TooltipProvider, Sn as TooltipTrigger, oi as Topbar, I as badgeVariants, xn as buttonVariants, bn as controlBaseClass, wn as controlTriggerClass, wr as getChartColor, me as navigationMenuTriggerStyle, Xe as toast, gt as toggleVariants, wt as useFormField };
29
+ export { ze as Accordion, Ie as AccordionContent, He as AccordionItem, he as AccordionTrigger, Vr as ActiveFilters, Hr as AdvancedFilters, yn as Alert, _n as AlertDescription, w as AlertDialog, Ae as AlertDialogAction, H as AlertDialogCancel, De as AlertDialogContent, Ne as AlertDialogDescription, z as AlertDialogFooter, Z as AlertDialogHeader, Vt as AlertDialogTitle, J as AlertDialogTrigger, vn as AlertTitle, Mr as AppActions, kr as AppDialog, Qr as AppPageHeader, Nr as AppSubTitle, mi as AppTabContainer, hi as AppTabHeader, gi as AppTabs, Yr as AppTitle, _i as AppVerticalTabs, hn as AspectRatio, G as Avatar, ee as AvatarFallback, ve as AvatarImage, fe as Badge, xr as BarChartHorizontal, Er as BarChartVertical, A as Breadcrumb, le as BreadcrumbEllipsis, Ct as BreadcrumbItem, x as BreadcrumbLink, bt as BreadcrumbList, re as BreadcrumbPage, oe as BreadcrumbSeparator, En as Button, br as CHART_COLORS, N as Calendar, l as Card, t as CardContent, a as CardDescription, d as CardFooter, n as CardHeader, r as CardTitle, ln as Carousel, xe as CarouselContent, D as CarouselItem, on as CarouselNext, we as CarouselPrevious, Sr as ChartCard, u as ChartContainer, o as ChartLegend, c as ChartLegendContent, i as ChartStyle, e as ChartTooltip, s as ChartTooltipContent, Ze as Checkbox, Tr as CircularGauge, Ge as Collapsible, nn as CollapsibleContent, fn as CollapsibleTrigger, zn as Command, ar as CommandDialog, cr as CommandEmpty, Vn as CommandGroup, sr as CommandInput, Ln as CommandItem, kn as CommandList, or as CommandSeparator, Rn as CommandShortcut, Ar as ConfirmationDialog, Mt as ContextMenu, Wt as ContextMenuCheckboxItem, _t as ContextMenuContent, Je as ContextMenuGroup, Ft as ContextMenuItem, qt as ContextMenuLabel, et as ContextMenuPortal, Et as ContextMenuRadioGroup, $t as ContextMenuRadioItem, rt as ContextMenuSeparator, ct as ContextMenuShortcut, Rt as ContextMenuSub, kt as ContextMenuSubContent, mt as ContextMenuSubTrigger, dt as ContextMenuTrigger, h as DashboardCard, oi as DataTable, Lr as DatePicker, zr as DateRangePicker, jn as Dialog, An as DialogClose, Fn as DialogContent, Yn as DialogDescription, On as DialogFooter, Jn as DialogHeader, Nn as DialogOverlay, Pn as DialogPortal, In as DialogTitle, Mn as DialogTrigger, Q as Drawer, Ht as DrawerClose, Y as DrawerContent, Be as DrawerDescription, Le as DrawerFooter, Ue as DrawerHeader, ge as DrawerOverlay, y as DrawerPortal, at as DrawerTitle, Xt as DrawerTrigger, xt as DropdownMenu, ie as DropdownMenuCheckboxItem, se as DropdownMenuContent, pe as DropdownMenuGroup, L as DropdownMenuItem, K as DropdownMenuLabel, te as DropdownMenuPortal, ye as DropdownMenuRadioGroup, gn as DropdownMenuRadioItem, T as DropdownMenuSeparator, je as DropdownMenuShortcut, U as DropdownMenuSub, Oe as DropdownMenuSubContent, Pe as DropdownMenuSubTrigger, B as DropdownMenuTrigger, Ir as ErrorAlert, Xr as ErrorState, Ur as FilterField, Wr as FilterPills, Gr as FilterPillsGroup, Se as Form, O as FormControl, sn as FormDescription, Or as FormDialog, Te as FormField, P as FormItem, j as FormLabel, ue as FormMessage, Fr as GenericForm, ri as GlobalSearch, pn as HoverCard, Qe as HoverCardContent, un as HoverCardTrigger, jr as ImageInput, Gn as Input, ht as InputOTP, ft as InputOTPGroup, Ke as InputOTPSeparator, rn as InputOTPSlot, si as JsonTableOutput, f as KpiCard, p as KpiCards, $r as KpiCardsLayout, S as Label, Jr as LanguageSelector, Cr as LineChart, Zr as LoadingState, v as Menubar, ot as MenubarCheckboxItem, Zt as MenubarContent, Nt as MenubarGroup, Gt as MenubarItem, vt as MenubarLabel, Ye as MenubarMenu, It as MenubarPortal, Jt as MenubarRadioGroup, tt as MenubarRadioItem, Dt as MenubarSeparator, en as MenubarShortcut, it as MenubarSub, lt as MenubarSubContent, zt as MenubarSubTrigger, At as MenubarTrigger, g as MetricCard, Pr as MultiSelect, Me as NavigationMenu, R as NavigationMenuContent, X as NavigationMenuIndicator, Bt as NavigationMenuItem, q as NavigationMenuLink, Re as NavigationMenuList, Fe as NavigationMenuTrigger, Ve as NavigationMenuViewport, ei as NotificationsBell, $ as Pagination, _e as PaginationContent, mn as PaginationEllipsis, C as PaginationItem, ke as PaginationLink, V as PaginationNext, Ee as PaginationPrevious, Dr as PieChart, er as Popover, Zn as PopoverContent, Kn as PopoverTrigger, W as Progress, de as RadioGroup, F as RadioGroupItem, qr as RatingInput, yt as ResizableHandle, ne as ResizablePanel, ae as ResizablePanelGroup, Un as ScrollArea, Wn as ScrollBar, Br as SearchInput, _r as Select, pr as SelectContent, hr as SelectGroup, dr as SelectItem, lr as SelectLabel, mr as SelectScrollDownButton, gr as SelectScrollUpButton, ur as SelectSeparator, fr as SelectTrigger, vr as SelectValue, b as Separator, rr as Sheet, Qn as SheetClose, tr as SheetContent, qn as SheetDescription, Bn as SheetFooter, $n as SheetHeader, nr as SheetOverlay, Hn as SheetPortal, Xn as SheetTitle, ir as SheetTrigger, ii as Sidebar, ni as SidebarHeader, ti as SidebarNavItem, be as SimpleTable, E as SimpleTableBody, an as SimpleTableCaption, Ce as SimpleTableCell, M as SimpleTableFooter, k as SimpleTableHead, ce as SimpleTableHeader, St as SimpleTableRow, Rr as SingleSelect, yr as Skeleton, m as SkeletonCard, _ as SkeletonCards, cn as Slider, dn as Sonner, tn as Switch, ci as TableActions, li as TableBody, ui as TableBulkActions, Kr as TableFilter, di as TableHeader, fi as TablePagination, pi as TableSettings, Ot as Tabs, pt as TabsContent, ut as TabsList, We as TabsTrigger, Lt as Textarea, vi as ThemeSelector, Pt as Toast, Kt as ToastAction, $e as ToastClose, Tt as ToastDescription, Qt as ToastProvider, nt as ToastTitle, st as ToastViewport, qe as Toaster, Ut as Toggle, Yt as ToggleGroup, jt as ToggleGroupItem, Dn as Tooltip, Cn as TooltipContent, Tn as TooltipProvider, Sn as TooltipTrigger, ai as Topbar, I as badgeVariants, xn as buttonVariants, bn as controlBaseClass, wn as controlTriggerClass, wr as getChartColor, me as navigationMenuTriggerStyle, Xe as toast, gt as toggleVariants, wt as useFormField };
@@ -3,7 +3,7 @@ import { Bn as t, Gn as n, Hn as r, I as i, Kn as a, Un as o, Wn as s, qn as c }
3
3
  import { n as l, t as u } from "./alert-REQGK9bR.js";
4
4
  import { s as d } from "./tooltip-BmZ9Bfou.js";
5
5
  import { E as f, O as p, P as m, j as h, k as g } from "./sheet-DQTOen4V.js";
6
- import { t as _ } from "./GenericForm-BdKwapAz.js";
6
+ import { t as _ } from "./GenericForm-D7ni-5-4.js";
7
7
  import { t as v } from "./ErrorAlert-L2s8Dd1_.js";
8
8
  import { useEffect as y, useState as b } from "react";
9
9
  import { Fragment as x, jsx as S, jsxs as C } from "react/jsx-runtime";
@@ -1,7 +1,7 @@
1
1
  import { t as e } from "./tailwind.helper-CJaRYBmL.js";
2
2
  import "./ImageInput-BPNEywyf.js";
3
- import "./MultiSelect-O4JP5fRO.js";
4
- import "./SearchInput-BSIjKB_9.js";
3
+ import "./MultiSelect-CZ4hye2w.js";
4
+ import "./SearchInput-nr0CrMLK.js";
5
5
  import { jsx as t } from "react/jsx-runtime";
6
6
  import { Heart as n, Star as r } from "lucide-react";
7
7
  //#region src/components/core/inputs/RatingInput.tsx
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@krosoft/react",
3
- "version": "0.0.292",
3
+ "version": "0.0.294",
4
4
  "description": "Krosoft shared React package",
5
5
  "type": "module",
6
6
  "scripts": {
@@ -1,129 +0,0 @@
1
- import { t as e } from "./tailwind.helper-CJaRYBmL.js";
2
- import { t } from "./i18n-d2p0RJo9.js";
3
- import { bn as n } from "./ui-D8Pg34YW.js";
4
- import { o as r } from "./tooltip-BmZ9Bfou.js";
5
- import { useEffect as i, useMemo as a, useRef as o, useState as s } from "react";
6
- import { jsx as c, jsxs as l } from "react/jsx-runtime";
7
- import { ChevronDownIcon as u, SearchIcon as d, XIcon as f } from "lucide-react";
8
- //#region src/components/core/inputs/MultiSelect.tsx
9
- var p = ({ options: p, selected: m, onToggle: h, onClear: g, onSelectAll: _, placeholder: v, searchable: y = !1, searchPlaceholder: b, disabled: x = !1, maxCount: S }) => {
10
- let { t: C } = t(), [w, T] = s(""), [E, D] = s(!1), O = o(null), k = o(null), A = a(() => w === "" ? p : p.filter((e) => e.label.toLowerCase().includes(w.toLowerCase())), [p, w]), j = a(() => A.length !== 0 && A.every((e) => m.includes(e.value)), [A, m]), M = a(() => m.map((e) => p.find((t) => t.value === e)?.label ?? e), [p, m]), N = S !== void 0 && S > 0 ? M.slice(0, S) : M, P = M.length - N.length;
11
- return i(() => {
12
- E && y && requestAnimationFrame(() => {
13
- k.current?.focus();
14
- });
15
- }, [E, y]), i(() => {
16
- if (!E) return;
17
- let e = (e) => {
18
- O.current !== null && !O.current.contains(e.target) && (D(!1), T(""));
19
- };
20
- return document.addEventListener("mousedown", e), () => {
21
- document.removeEventListener("mousedown", e);
22
- };
23
- }, [E]), /* @__PURE__ */ l("div", {
24
- ref: O,
25
- className: "relative w-full",
26
- children: [/* @__PURE__ */ l("button", {
27
- type: "button",
28
- disabled: x,
29
- onClick: () => {
30
- x || D((e) => (e && T(""), !e));
31
- },
32
- className: e(r, "w-full", E && "ring-2 ring-ring ring-offset-2", m.length === 0 && "text-muted-foreground"),
33
- children: [/* @__PURE__ */ c("span", {
34
- className: "truncate",
35
- children: m.length === 0 ? v ?? C("select.placeholder") : N.join(", ")
36
- }), /* @__PURE__ */ l("div", {
37
- className: "flex shrink-0 items-center gap-1",
38
- children: [
39
- P > 0 && /* @__PURE__ */ l("span", {
40
- className: "rounded-control bg-muted px-1.5 py-0.5 text-xs font-medium text-foreground",
41
- children: ["+", P]
42
- }),
43
- m.length > 0 && !x && /* @__PURE__ */ c("span", {
44
- role: "button",
45
- tabIndex: -1,
46
- onClick: (e) => {
47
- e.stopPropagation();
48
- },
49
- onPointerDown: (e) => {
50
- e.preventDefault(), e.stopPropagation(), g();
51
- },
52
- className: "text-muted-foreground hover:text-foreground",
53
- children: /* @__PURE__ */ c(f, { className: "size-4" })
54
- }),
55
- /* @__PURE__ */ c(u, { className: e("size-4 opacity-50 shrink-0 transition-transform", E && "rotate-180") })
56
- ]
57
- })]
58
- }), E ? /* @__PURE__ */ l("div", {
59
- className: "absolute left-0 right-0 top-[calc(100%+4px)] z-[100] rounded-surface border bg-popover text-popover-foreground shadow-md animate-in fade-in-0 zoom-in-95 slide-in-from-top-2",
60
- children: [
61
- y ? /* @__PURE__ */ c("div", {
62
- className: "border-b border-border p-2",
63
- children: /* @__PURE__ */ l("div", {
64
- className: "relative",
65
- children: [/* @__PURE__ */ c(d, { className: "absolute left-2 top-1/2 h-3.5 w-3.5 -translate-y-1/2 text-muted-foreground" }), /* @__PURE__ */ c("input", {
66
- ref: k,
67
- className: "w-full rounded-control 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",
68
- placeholder: b ?? C("search.placeholder"),
69
- value: w,
70
- onChange: (e) => {
71
- T(e.target.value);
72
- }
73
- })]
74
- })
75
- }) : null,
76
- /* @__PURE__ */ l("div", {
77
- 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",
78
- children: [A.length === 0 && /* @__PURE__ */ c("p", {
79
- className: "px-2 py-3 text-center text-xs text-muted-foreground",
80
- children: C("states.noResult")
81
- }), A.map((e) => /* @__PURE__ */ l("label", {
82
- className: "flex items-center gap-2.5 rounded-md px-2 py-2 text-sm hover:bg-muted cursor-pointer transition-colors",
83
- children: [
84
- /* @__PURE__ */ c(n, {
85
- checked: m.includes(e.value),
86
- onCheckedChange: () => {
87
- h(e.value);
88
- }
89
- }),
90
- e.color && /* @__PURE__ */ c("span", {
91
- className: "size-2.5 shrink-0 rounded-full",
92
- style: { backgroundColor: e.color }
93
- }),
94
- e.label
95
- ]
96
- }, e.value))]
97
- }),
98
- A.length > 0 && /* @__PURE__ */ c("div", {
99
- className: "border-t border-border p-1.5",
100
- children: j ? /* @__PURE__ */ c("button", {
101
- type: "button",
102
- onClick: g,
103
- className: "w-full rounded-md px-2 py-1.5 text-xs text-muted-foreground hover:text-foreground hover:bg-muted transition-colors text-center",
104
- children: C("filters.deselectAll")
105
- }) : /* @__PURE__ */ c("button", {
106
- type: "button",
107
- onClick: () => {
108
- if (j) {
109
- let e = A.map((e) => e.value), t = m.filter((t) => !e.includes(t));
110
- _ === void 0 ? g() : _(t);
111
- } else {
112
- let e = [...m];
113
- A.forEach((t) => {
114
- e.includes(t.value) || e.push(t.value);
115
- }), _ === void 0 ? A.forEach((e) => {
116
- m.includes(e.value) || h(e.value);
117
- }) : _(e);
118
- }
119
- },
120
- className: "w-full rounded-md px-2 py-1.5 text-xs text-muted-foreground hover:text-foreground hover:bg-muted transition-colors text-center",
121
- children: C("filters.selectAll")
122
- })
123
- })
124
- ]
125
- }) : null]
126
- });
127
- };
128
- //#endregion
129
- export { p as t };
@@ -1,259 +0,0 @@
1
- import { t as e } from "./tailwind.helper-CJaRYBmL.js";
2
- import { r as t, t as n } from "./i18n-d2p0RJo9.js";
3
- import { En as r } from "./ui-D8Pg34YW.js";
4
- import { o as i, s as a } from "./tooltip-BmZ9Bfou.js";
5
- import { C as o, S as s, _ as c, b as l, g as u, h as d, m as f, p, x as m, y as h } from "./sheet-DQTOen4V.js";
6
- import * as g from "react";
7
- import { useEffect as _, useMemo as v, useRef as y, useState as b } from "react";
8
- import { jsx as x, jsxs as S } from "react/jsx-runtime";
9
- import { CalendarIcon as C, CheckIcon as w, ChevronDownIcon as T, PlusIcon as E, SearchIcon as D, XIcon as O } from "lucide-react";
10
- import { format as k } from "date-fns";
11
- //#region src/components/core/inputs/DatePicker.tsx
12
- var A = ({ date: n, onDateChange: i, placeholder: o }) => {
13
- let s = t(), [c, l] = b(!1), u = y(null);
14
- return _(() => {
15
- if (!c) return;
16
- let e = (e) => {
17
- u.current !== null && !u.current.contains(e.target) && l(!1);
18
- };
19
- return document.addEventListener("mousedown", e), () => {
20
- document.removeEventListener("mousedown", e);
21
- };
22
- }, [c]), /* @__PURE__ */ S("div", {
23
- ref: u,
24
- className: "relative w-full",
25
- children: [/* @__PURE__ */ S(a, {
26
- variant: "outline",
27
- type: "button",
28
- onClick: () => {
29
- l((e) => !e);
30
- },
31
- className: e("w-full justify-start text-left font-normal focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2", c && "ring-2 ring-ring ring-offset-2", n === void 0 && "text-muted-foreground"),
32
- children: [/* @__PURE__ */ x(C, { className: "mr-2 size-4 shrink-0" }), n === void 0 ? /* @__PURE__ */ x("span", { children: o }) : k(n, "dd/MM/yyyy", { locale: s })]
33
- }), c ? /* @__PURE__ */ x("div", {
34
- className: "absolute left-0 top-[calc(100%+4px)] z-[100] rounded-surface border bg-popover text-popover-foreground shadow-md animate-in fade-in-0 zoom-in-95 slide-in-from-top-2",
35
- children: /* @__PURE__ */ x(r, {
36
- mode: "single",
37
- locale: s,
38
- defaultMonth: n,
39
- selected: n,
40
- onSelect: (e) => {
41
- i(e), l(!1);
42
- }
43
- })
44
- }) : null]
45
- });
46
- }, j = (e) => e ? {
47
- from: e.from,
48
- to: e.to
49
- } : void 0, M = ({ value: i, onChange: o, placeholder: s, className: c }) => {
50
- let { t: l } = n(), u = t(), [m, h] = g.useState(!1), [_, v] = g.useState(j(i));
51
- return g.useEffect(() => {
52
- m && v(j(i));
53
- }, [m, i]), /* @__PURE__ */ x("div", {
54
- className: e("grid gap-2", c),
55
- children: /* @__PURE__ */ S(p, {
56
- open: m,
57
- onOpenChange: h,
58
- children: [/* @__PURE__ */ x(d, {
59
- asChild: !0,
60
- children: /* @__PURE__ */ S(a, {
61
- id: "date",
62
- variant: "outline",
63
- className: e("w-[300px] justify-start text-left font-normal", !i?.from && "text-muted-foreground"),
64
- children: [
65
- /* @__PURE__ */ x(C, { className: "mr-2 size-4" }),
66
- ((e) => e?.from ? !e.to || e.from.getTime() === e.to.getTime() ? k(e.from, "dd MMM yyyy", { locale: u }) : `${k(e.from, "dd MMM yyyy", { locale: u })} - ${k(e.to, "dd MMM yyyy", { locale: u })}` : s ?? l("date.pickPeriod"))(i),
67
- i?.from && /* @__PURE__ */ x(a, {
68
- type: "button",
69
- variant: "ghost",
70
- size: "icon",
71
- "aria-label": l("date.clearPeriod"),
72
- className: "ml-auto h-5 w-5 opacity-50 hover:opacity-100",
73
- onClick: (e) => {
74
- e.stopPropagation(), o(void 0), h(!1);
75
- },
76
- children: /* @__PURE__ */ x(O, { className: "size-4" })
77
- })
78
- ]
79
- })
80
- }), /* @__PURE__ */ S(f, {
81
- className: "w-auto p-0",
82
- align: "start",
83
- side: "bottom",
84
- sideOffset: 4,
85
- children: [/* @__PURE__ */ x(r, {
86
- mode: "range",
87
- resetOnSelect: !0,
88
- defaultMonth: _?.from,
89
- selected: _,
90
- onSelect: v,
91
- numberOfMonths: 2,
92
- locale: u,
93
- className: "pointer-events-auto p-3"
94
- }), /* @__PURE__ */ S("div", {
95
- className: "flex items-center justify-between border-t border-border px-3 py-2",
96
- children: [/* @__PURE__ */ x(a, {
97
- variant: "ghost",
98
- size: "sm",
99
- onClick: () => {
100
- v(void 0);
101
- },
102
- children: l("actions.clear")
103
- }), /* @__PURE__ */ S("div", {
104
- className: "flex gap-2",
105
- children: [/* @__PURE__ */ x(a, {
106
- variant: "ghost",
107
- size: "sm",
108
- onClick: () => {
109
- v(j(i)), h(!1);
110
- },
111
- children: l("actions.cancel")
112
- }), /* @__PURE__ */ x(a, {
113
- size: "sm",
114
- onClick: () => {
115
- o(_), h(!1);
116
- },
117
- children: l("actions.apply")
118
- })]
119
- })]
120
- })]
121
- })]
122
- })
123
- });
124
- }, N = ({ options: t = [], value: r, onChange: a, onClear: u, onCreate: g, placeholder: _, searchPlaceholder: y, emptyLabel: C, createLabel: D, disabled: k = !1, modal: A = !0, className: j }) => {
125
- let { t: M } = n(), [N, P] = b(!1), [F, I] = b(""), L = r !== void 0 && r !== "", R = v(() => L ? t.find((e) => e.value === r) : void 0, [
126
- L,
127
- t,
128
- r
129
- ]), z = L ? R?.label ?? r : void 0, B = F.trim(), V = g !== void 0 && B !== "" && !t.some((e) => e.label.toLowerCase() === B.toLowerCase()), H = (e) => {
130
- P(e), e || I("");
131
- }, U = (e) => {
132
- a(e), H(!1);
133
- };
134
- return /* @__PURE__ */ S(p, {
135
- open: N,
136
- onOpenChange: H,
137
- modal: A,
138
- children: [/* @__PURE__ */ x(d, {
139
- asChild: !0,
140
- children: /* @__PURE__ */ S("button", {
141
- type: "button",
142
- role: "combobox",
143
- "aria-expanded": N,
144
- disabled: k,
145
- className: e(i, "w-full", "data-[state=open]:ring-2 data-[state=open]:ring-ring data-[state=open]:ring-offset-2", !L && "text-muted-foreground", j),
146
- children: [/* @__PURE__ */ S("span", {
147
- className: "flex items-center truncate",
148
- children: [
149
- R?.color && /* @__PURE__ */ x("span", {
150
- className: "mr-2 size-2.5 shrink-0 rounded-full",
151
- style: { backgroundColor: R.color }
152
- }),
153
- /* @__PURE__ */ x("span", {
154
- className: "truncate",
155
- children: z ?? _ ?? M("select.placeholder")
156
- }),
157
- R?.description !== void 0 && /* @__PURE__ */ S("span", {
158
- className: "ml-1 truncate text-muted-foreground",
159
- children: [
160
- "(",
161
- R.description,
162
- ")"
163
- ]
164
- })
165
- ]
166
- }), /* @__PURE__ */ S("div", {
167
- className: "flex items-center gap-1",
168
- children: [u && L && !k && /* @__PURE__ */ x("span", {
169
- role: "button",
170
- tabIndex: -1,
171
- onClick: (e) => {
172
- e.stopPropagation();
173
- },
174
- onPointerDown: (e) => {
175
- e.preventDefault(), e.stopPropagation(), u();
176
- },
177
- className: "text-muted-foreground hover:text-foreground",
178
- children: /* @__PURE__ */ x(O, { className: "size-4" })
179
- }), /* @__PURE__ */ x(T, { className: e("size-4 shrink-0 opacity-50 transition-transform", N && "rotate-180") })]
180
- })]
181
- })
182
- }), /* @__PURE__ */ x(f, {
183
- className: "w-[var(--radix-popover-trigger-width)] p-0",
184
- align: "start",
185
- children: /* @__PURE__ */ S(c, {
186
- filter: (e, t, n) => +!!(n ?? []).join(" ").toLowerCase().includes(t.trim().toLowerCase()),
187
- children: [/* @__PURE__ */ x(m, {
188
- placeholder: y ?? M("search.placeholder"),
189
- value: F,
190
- onValueChange: I
191
- }), /* @__PURE__ */ S(o, { children: [!V && /* @__PURE__ */ x(h, { children: C ?? M("states.noResult") }), /* @__PURE__ */ S(l, { children: [t.map((t) => /* @__PURE__ */ S(s, {
192
- value: t.value,
193
- keywords: [t.label, t.description ?? ""],
194
- onSelect: () => {
195
- U(t.value);
196
- },
197
- children: [
198
- /* @__PURE__ */ x(w, { className: e("mr-2 size-4 shrink-0", r === t.value ? "opacity-100" : "opacity-0") }),
199
- t.color !== void 0 && /* @__PURE__ */ x("span", {
200
- className: "mr-2 size-2.5 shrink-0 rounded-full",
201
- style: { backgroundColor: t.color }
202
- }),
203
- /* @__PURE__ */ x("span", {
204
- className: "truncate",
205
- children: t.label
206
- }),
207
- t.description !== void 0 && /* @__PURE__ */ S("span", {
208
- className: "ml-1 truncate text-muted-foreground",
209
- children: [
210
- "(",
211
- t.description,
212
- ")"
213
- ]
214
- })
215
- ]
216
- }, t.value)), V && /* @__PURE__ */ S(s, {
217
- forceMount: !0,
218
- value: "__create__",
219
- onSelect: () => {
220
- g?.(B), H(!1);
221
- },
222
- children: [/* @__PURE__ */ x(E, { className: "mr-2 size-4 shrink-0" }), /* @__PURE__ */ x("span", {
223
- className: "truncate",
224
- children: D ? D(B) : M("select.create", { search: B })
225
- })]
226
- })] })] })]
227
- })
228
- })]
229
- });
230
- }, P = ({ searchQuery: t, search: r, placeholder: i, onSearch: a, onSubmit: o, onClear: s, className: c }) => {
231
- let { t: l } = n(), d = t ?? r ?? "";
232
- return /* @__PURE__ */ S("div", {
233
- className: e("relative h-fit w-full md:w-64", c),
234
- children: [
235
- /* @__PURE__ */ x(D, { className: "absolute left-3 top-1/2 transform -translate-y-1/2 text-muted-foreground w-4 h-4" }),
236
- /* @__PURE__ */ x(u, {
237
- placeholder: i ?? l("search.placeholder"),
238
- value: d,
239
- onChange: (e) => {
240
- a(e.target.value);
241
- },
242
- className: "pl-8",
243
- onKeyDown: (e) => {
244
- e.key === "Enter" && o !== void 0 && (e.preventDefault(), o());
245
- }
246
- }),
247
- d === "" ? null : /* @__PURE__ */ x("button", {
248
- onClick: () => {
249
- a(""), s !== void 0 && s();
250
- },
251
- className: "absolute right-3 top-1/2 -translate-y-1/2 text-gray-500 hover:text-gray-700",
252
- type: "button",
253
- children: /* @__PURE__ */ x(O, { className: "size-4" })
254
- })
255
- ]
256
- });
257
- };
258
- //#endregion
259
- export { A as i, N as n, M as r, P as t };
@@ -1,16 +0,0 @@
1
- export interface FilterOption {
2
- value: string;
3
- label: string;
4
- color?: string;
5
- }
6
- export declare function SearchableFilterPill<T extends string>({ labelKey, options, selected, onToggle, onClear, onSelectAll, searchable, searchPlaceholder, }: {
7
- labelKey: string;
8
- options: FilterOption[];
9
- selected: T[];
10
- onToggle: (value: T) => void;
11
- onClear?: () => void;
12
- onSelectAll?: (values: T[]) => void;
13
- searchable?: boolean;
14
- searchPlaceholder?: string;
15
- }): React.ReactElement;
16
- //# sourceMappingURL=SearchableFilterPill.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"SearchableFilterPill.d.ts","sourceRoot":"","sources":["../../../../src/components/core/filters/SearchableFilterPill.tsx"],"names":[],"mappings":"AAMA,MAAM,WAAW,YAAY;IAC3B,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,wBAAgB,oBAAoB,CAAC,CAAC,SAAS,MAAM,EAAE,EACrD,QAAQ,EACR,OAAO,EACP,QAAQ,EACR,QAAQ,EACR,OAAO,EACP,WAAW,EACX,UAAkB,EAClB,iBAAiB,GAClB,EAAE;IACD,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,YAAY,EAAE,CAAC;IACxB,QAAQ,EAAE,CAAC,EAAE,CAAC;IACd,QAAQ,EAAE,CAAC,KAAK,EAAE,CAAC,KAAK,IAAI,CAAC;IAC7B,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,WAAW,CAAC,EAAE,CAAC,MAAM,EAAE,CAAC,EAAE,KAAK,IAAI,CAAC;IACpC,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,iBAAiB,CAAC,EAAE,MAAM,CAAC;CAC5B,GAAG,KAAK,CAAC,YAAY,CAyIrB"}
@@ -1,28 +0,0 @@
1
- import React from "react";
2
- import type { SelectOption } from "@krosoft/core/types";
3
- export interface SearchableSelectOption extends SelectOption {
4
- /** Texte secondaire affiché en gris à côté du libellé (ex. le groupe d'un tenant). Inclus dans la recherche. */
5
- description?: string;
6
- }
7
- interface SearchableSelectProps {
8
- options?: SearchableSelectOption[];
9
- value: string | undefined;
10
- onChange: (value: string) => void;
11
- onClear?: () => void;
12
- /** Fourni : propose de créer une option quand la saisie ne correspond à aucun libellé existant. */
13
- onCreate?: (label: string) => void;
14
- placeholder?: string;
15
- searchPlaceholder?: string;
16
- emptyLabel?: string;
17
- createLabel?: (search: string) => string;
18
- disabled?: boolean;
19
- /**
20
- * Panneau rendu en modal (défaut, comme le `Select`). À laisser tel quel dans une boîte de
21
- * dialogue : sans ça, le `Dialog` neutralise les clics sur le panneau porté dans le portail.
22
- */
23
- modal?: boolean;
24
- className?: string;
25
- }
26
- export declare const SearchableSelect: ({ options, value, onChange, onClear, onCreate, placeholder, searchPlaceholder, emptyLabel, createLabel, disabled, modal, className, }: SearchableSelectProps) => React.ReactElement;
27
- export {};
28
- //# sourceMappingURL=SearchableSelect.d.ts.map