@etic-insa/ui 0.5.0 → 0.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +323 -62
- package/dist/charts/index.d.ts +1 -0
- package/dist/charts/index.js +1 -0
- package/dist/components/etic/app-shell.d.ts +10 -0
- package/dist/components/etic/app-shell.js +144 -117
- package/dist/components/etic/app-shell.js.map +1 -1
- package/dist/components/etic/code-block.d.ts +15 -0
- package/dist/components/etic/code-block.js +21 -0
- package/dist/components/etic/code-block.js.map +1 -0
- package/dist/components/etic/data-table-toolbar.d.ts +12 -1
- package/dist/components/etic/data-table-toolbar.js +50 -39
- package/dist/components/etic/data-table-toolbar.js.map +1 -1
- package/dist/components/etic/data-table-view-options.d.ts +2 -1
- package/dist/components/etic/data-table-view-options.js +1 -1
- package/dist/components/etic/data-table-view-options.js.map +1 -1
- package/dist/components/etic/detail-meta.d.ts +28 -0
- package/dist/components/etic/detail-meta.js +51 -0
- package/dist/components/etic/detail-meta.js.map +1 -0
- package/dist/components/etic/detail-sheet.d.ts +36 -0
- package/dist/components/etic/detail-sheet.js +37 -0
- package/dist/components/etic/detail-sheet.js.map +1 -0
- package/dist/components/etic/empty-state.d.ts +15 -0
- package/dist/components/etic/empty-state.js +24 -12
- package/dist/components/etic/empty-state.js.map +1 -1
- package/dist/components/etic/error-banner.js +8 -5
- package/dist/components/etic/error-banner.js.map +1 -1
- package/dist/components/etic/external-link.d.ts +40 -0
- package/dist/components/etic/external-link.js +47 -0
- package/dist/components/etic/external-link.js.map +1 -0
- package/dist/components/etic/file-upload.d.ts +19 -0
- package/dist/components/etic/file-upload.js +24 -1
- package/dist/components/etic/file-upload.js.map +1 -1
- package/dist/components/etic/form-field.d.ts +10 -1
- package/dist/components/etic/form-field.js +32 -28
- package/dist/components/etic/form-field.js.map +1 -1
- package/dist/components/etic/nav-tabs.d.ts +27 -0
- package/dist/components/etic/nav-tabs.js +22 -0
- package/dist/components/etic/nav-tabs.js.map +1 -0
- package/dist/components/etic/phone-input.d.ts +4 -3
- package/dist/components/etic/phone-input.js +51 -37
- package/dist/components/etic/phone-input.js.map +1 -1
- package/dist/components/etic/progress-ring.d.ts +23 -0
- package/dist/components/etic/progress-ring.js +46 -0
- package/dist/components/etic/progress-ring.js.map +1 -0
- package/dist/components/etic/reset-button.d.ts +37 -0
- package/dist/components/etic/reset-button.js +41 -0
- package/dist/components/etic/reset-button.js.map +1 -0
- package/dist/components/etic/save-bar.d.ts +20 -4
- package/dist/components/etic/save-bar.js +39 -24
- package/dist/components/etic/save-bar.js.map +1 -1
- package/dist/components/etic/select-field.d.ts +38 -0
- package/dist/components/etic/select-field.js +42 -0
- package/dist/components/etic/select-field.js.map +1 -0
- package/dist/components/etic/sub-section.d.ts +15 -0
- package/dist/components/etic/sub-section.js +23 -0
- package/dist/components/etic/sub-section.js.map +1 -0
- package/dist/components/etic/use-detail-sheet.d.ts +58 -0
- package/dist/components/etic/use-detail-sheet.js +35 -0
- package/dist/components/etic/use-detail-sheet.js.map +1 -0
- package/dist/components/etic/use-server-pagination.d.ts +55 -0
- package/dist/components/etic/use-server-pagination.js +31 -0
- package/dist/components/etic/use-server-pagination.js.map +1 -0
- package/dist/components/etic/use-server-sorting.d.ts +29 -0
- package/dist/components/etic/use-server-sorting.js +19 -0
- package/dist/components/etic/use-server-sorting.js.map +1 -0
- package/dist/components/etic/verdict-panel.d.ts +25 -0
- package/dist/components/etic/verdict-panel.js +42 -0
- package/dist/components/etic/verdict-panel.js.map +1 -0
- package/dist/components/ui/chart.d.ts +44 -0
- package/dist/components/ui/chart.js +131 -0
- package/dist/components/ui/chart.js.map +1 -0
- package/dist/components/ui/sheet.d.ts +20 -2
- package/dist/components/ui/sheet.js +21 -8
- package/dist/components/ui/sheet.js.map +1 -1
- package/dist/hooks/use-column-prefs.d.ts +25 -7
- package/dist/hooks/use-column-prefs.js +44 -35
- package/dist/hooks/use-column-prefs.js.map +1 -1
- package/dist/hooks/use-debounced-search.d.ts +29 -0
- package/dist/hooks/use-debounced-search.js +29 -0
- package/dist/hooks/use-debounced-search.js.map +1 -0
- package/dist/hooks/use-fresh-dialog.d.ts +33 -0
- package/dist/hooks/use-fresh-dialog.js +17 -0
- package/dist/hooks/use-fresh-dialog.js.map +1 -0
- package/dist/hooks/use-load-on-open.d.ts +23 -0
- package/dist/hooks/use-load-on-open.js +21 -0
- package/dist/hooks/use-load-on-open.js.map +1 -0
- package/dist/hooks/use-save-by-key.d.ts +45 -0
- package/dist/hooks/use-save-by-key.js +49 -0
- package/dist/hooks/use-save-by-key.js.map +1 -0
- package/dist/index.d.ts +21 -4
- package/dist/index.js +117 -100
- package/dist/lib/format.d.ts +31 -0
- package/dist/lib/format.js +53 -18
- package/dist/lib/format.js.map +1 -1
- package/dist/lib/ton.d.ts +7 -0
- package/dist/lib/ton.js +15 -0
- package/dist/lib/ton.js.map +1 -1
- package/package.json +10 -1
- package/vite-plugin.d.ts +3 -3
- package/vite-plugin.js +8 -2
package/dist/index.js
CHANGED
|
@@ -1,102 +1,119 @@
|
|
|
1
1
|
import { cn as e } from "./lib/utils.js";
|
|
2
2
|
import { MOBILE_MEDIA_QUERY as t, useIsMobile as n } from "./hooks/use-mobile.js";
|
|
3
|
-
import { accorde as r,
|
|
4
|
-
import { ecrireDateIso as
|
|
5
|
-
import { comparerFr as
|
|
6
|
-
import { NO_AUTOFILL as
|
|
7
|
-
import { useDebouncedValue as
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
20
|
-
import {
|
|
21
|
-
import {
|
|
22
|
-
import {
|
|
23
|
-
import {
|
|
24
|
-
import {
|
|
25
|
-
import {
|
|
26
|
-
import {
|
|
27
|
-
import {
|
|
28
|
-
import {
|
|
29
|
-
import {
|
|
30
|
-
import {
|
|
31
|
-
import {
|
|
32
|
-
import {
|
|
33
|
-
import {
|
|
34
|
-
import {
|
|
35
|
-
import {
|
|
36
|
-
import {
|
|
37
|
-
import {
|
|
38
|
-
import {
|
|
39
|
-
import {
|
|
40
|
-
import {
|
|
41
|
-
import {
|
|
42
|
-
import {
|
|
43
|
-
import {
|
|
44
|
-
import {
|
|
45
|
-
import {
|
|
46
|
-
import {
|
|
47
|
-
import {
|
|
48
|
-
import {
|
|
49
|
-
import {
|
|
50
|
-
import {
|
|
51
|
-
import {
|
|
52
|
-
import {
|
|
53
|
-
import {
|
|
54
|
-
import {
|
|
55
|
-
import {
|
|
56
|
-
import {
|
|
57
|
-
import {
|
|
58
|
-
import {
|
|
59
|
-
import {
|
|
60
|
-
import {
|
|
61
|
-
import {
|
|
62
|
-
import {
|
|
63
|
-
import {
|
|
64
|
-
import {
|
|
65
|
-
import {
|
|
66
|
-
import {
|
|
67
|
-
import {
|
|
68
|
-
import {
|
|
69
|
-
import {
|
|
70
|
-
import {
|
|
71
|
-
import {
|
|
72
|
-
import {
|
|
73
|
-
import {
|
|
74
|
-
import {
|
|
75
|
-
import {
|
|
76
|
-
import {
|
|
77
|
-
import {
|
|
78
|
-
import {
|
|
79
|
-
import {
|
|
80
|
-
import {
|
|
81
|
-
import {
|
|
82
|
-
import {
|
|
83
|
-
import {
|
|
84
|
-
import {
|
|
85
|
-
import {
|
|
86
|
-
import {
|
|
87
|
-
import {
|
|
88
|
-
import {
|
|
89
|
-
import {
|
|
90
|
-
import {
|
|
91
|
-
import {
|
|
92
|
-
import {
|
|
93
|
-
import {
|
|
94
|
-
import {
|
|
95
|
-
import {
|
|
96
|
-
import {
|
|
97
|
-
import {
|
|
98
|
-
import {
|
|
99
|
-
import {
|
|
100
|
-
import {
|
|
101
|
-
import {
|
|
102
|
-
|
|
3
|
+
import { accorde as r, capitaliser as i, compte as a, formaterAnciennete as o, formaterDate as s, formaterDateHeure as c, formaterDateHeureLongue as l, formaterDuree as u, formaterDureeArrondie as d, formaterDureePrecise as f, formaterHeure as p, formaterHorodatage as m, formaterMontant as h, formaterNombre as g, formaterOctets as _, formaterPourcentage as v, initiales as y, nombreFr as b, participe as x, uniteAccordee as S } from "./lib/format.js";
|
|
4
|
+
import { ecrireDateIso as C, lireDateIso as w } from "./lib/dates.js";
|
|
5
|
+
import { comparerFr as T, correspondance as E, normaliser as D, normaliserRecherche as O } from "./lib/normalize.js";
|
|
6
|
+
import { NO_AUTOFILL as k } from "./lib/autofill.js";
|
|
7
|
+
import { useDebouncedValue as A } from "./hooks/use-debounced-value.js";
|
|
8
|
+
import { useDebouncedSearch as j } from "./hooks/use-debounced-search.js";
|
|
9
|
+
import { useFreshDialog as M } from "./hooks/use-fresh-dialog.js";
|
|
10
|
+
import { useLoadOnOpen as N } from "./hooks/use-load-on-open.js";
|
|
11
|
+
import { useSaveByKey as P } from "./hooks/use-save-by-key.js";
|
|
12
|
+
import { useDocumentTitle as F } from "./hooks/use-document-title.js";
|
|
13
|
+
import { Alert as I, AlertAction as L, AlertDescription as R, AlertTitle as z } from "./components/ui/alert.js";
|
|
14
|
+
import { AlertDialog as B, AlertDialogAction as V, AlertDialogCancel as H, AlertDialogContent as U, AlertDialogDescription as W, AlertDialogFooter as G, AlertDialogHeader as K, AlertDialogMedia as q, AlertDialogOverlay as J, AlertDialogPortal as Y, AlertDialogTitle as X, AlertDialogTrigger as Z } from "./components/ui/alert-dialog.js";
|
|
15
|
+
import { Avatar as Q, AvatarBadge as $, AvatarFallback as ee, AvatarGroup as te, AvatarGroupCount as ne, AvatarImage as re } from "./components/ui/avatar.js";
|
|
16
|
+
import { Badge as ie, badgeVariants as ae } from "./components/ui/badge.js";
|
|
17
|
+
import { Breadcrumb as oe, BreadcrumbEllipsis as se, BreadcrumbItem as ce, BreadcrumbLink as le, BreadcrumbList as ue, BreadcrumbPage as de, BreadcrumbSeparator as fe } from "./components/ui/breadcrumb.js";
|
|
18
|
+
import { Button as pe, buttonVariants as me } from "./components/ui/button.js";
|
|
19
|
+
import { ButtonGroup as he, ButtonGroupSeparator as ge, ButtonGroupText as _e, buttonGroupVariants as ve } from "./components/ui/button-group.js";
|
|
20
|
+
import { Calendar as ye, CalendarDayButton as be } from "./components/ui/calendar.js";
|
|
21
|
+
import { Card as xe, CardAction as Se, CardContent as Ce, CardDescription as we, CardFooter as Te, CardHeader as Ee, CardTitle as De } from "./components/ui/card.js";
|
|
22
|
+
import { Checkbox as Oe } from "./components/ui/checkbox.js";
|
|
23
|
+
import { Collapsible as ke, CollapsibleContent as Ae, CollapsibleTrigger as je } from "./components/ui/collapsible.js";
|
|
24
|
+
import { Combobox as Me, ComboboxChip as Ne, ComboboxChips as Pe, ComboboxChipsInput as Fe, ComboboxCollection as Ie, ComboboxContent as Le, ComboboxEmpty as Re, ComboboxGroup as ze, ComboboxInput as Be, ComboboxItem as Ve, ComboboxLabel as He, ComboboxList as Ue, ComboboxSeparator as We, ComboboxTrigger as Ge, ComboboxValue as Ke, useComboboxAnchor as qe } from "./components/ui/combobox.js";
|
|
25
|
+
import { Dialog as Je, DialogBody as Ye, DialogClose as Xe, DialogContent as Ze, DialogDescription as Qe, DialogFooter as $e, DialogHeader as et, DialogOverlay as tt, DialogPortal as nt, DialogTitle as rt, DialogTrigger as it } from "./components/ui/dialog.js";
|
|
26
|
+
import { DropdownMenu as at, DropdownMenuCheckboxItem as ot, DropdownMenuContent as st, DropdownMenuGroup as ct, DropdownMenuItem as lt, DropdownMenuLabel as ut, DropdownMenuPortal as dt, DropdownMenuRadioGroup as ft, DropdownMenuRadioItem as pt, DropdownMenuSeparator as mt, DropdownMenuShortcut as ht, DropdownMenuSub as gt, DropdownMenuSubContent as _t, DropdownMenuSubTrigger as vt, DropdownMenuTrigger as yt } from "./components/ui/dropdown-menu.js";
|
|
27
|
+
import { Empty as bt, EmptyContent as xt, EmptyDescription as St, EmptyHeader as Ct, EmptyMedia as wt, EmptyTitle as Tt } from "./components/ui/empty.js";
|
|
28
|
+
import { Field as Et, FieldContent as Dt, FieldDescription as Ot, FieldError as kt, FieldGroup as At, FieldLabel as jt, FieldLegend as Mt, FieldSeparator as Nt, FieldSet as Pt, FieldTitle as Ft } from "./components/ui/field.js";
|
|
29
|
+
import { Input as It } from "./components/ui/input.js";
|
|
30
|
+
import { InputGroup as Lt, InputGroupAddon as Rt, InputGroupButton as zt, InputGroupInput as Bt, InputGroupText as Vt, InputGroupTextarea as Ht } from "./components/ui/input-group.js";
|
|
31
|
+
import { Item as Ut, ItemActions as Wt, ItemContent as Gt, ItemDescription as Kt, ItemFooter as qt, ItemGroup as Jt, ItemHeader as Yt, ItemMedia as Xt, ItemSeparator as Zt, ItemTitle as Qt } from "./components/ui/item.js";
|
|
32
|
+
import { Kbd as $t, KbdGroup as en } from "./components/ui/kbd.js";
|
|
33
|
+
import { Label as tn } from "./components/ui/label.js";
|
|
34
|
+
import { NativeSelect as nn, NativeSelectOptGroup as rn, NativeSelectOption as an } from "./components/ui/native-select.js";
|
|
35
|
+
import { Pagination as on, PaginationContent as sn, PaginationEllipsis as cn, PaginationItem as ln, PaginationLink as un, PaginationNext as dn, PaginationPrevious as fn } from "./components/ui/pagination.js";
|
|
36
|
+
import { Popover as pn, PopoverContent as mn, PopoverDescription as hn, PopoverHeader as gn, PopoverTitle as _n, PopoverTrigger as vn } from "./components/ui/popover.js";
|
|
37
|
+
import { Progress as yn, ProgressIndicator as bn, ProgressLabel as xn, ProgressTrack as Sn, ProgressValue as Cn } from "./components/ui/progress.js";
|
|
38
|
+
import { RadioGroup as wn, RadioGroupItem as Tn } from "./components/ui/radio-group.js";
|
|
39
|
+
import { ScrollArea as En, ScrollBar as Dn } from "./components/ui/scroll-area.js";
|
|
40
|
+
import { Select as On, SelectContent as kn, SelectGroup as An, SelectItem as jn, SelectLabel as Mn, SelectScrollDownButton as Nn, SelectScrollUpButton as Pn, SelectSeparator as Fn, SelectTrigger as In, SelectValue as Ln } from "./components/ui/select.js";
|
|
41
|
+
import { Separator as Rn } from "./components/ui/separator.js";
|
|
42
|
+
import { Sheet as zn, SheetBody as Bn, SheetClose as Vn, SheetContent as Hn, SheetDescription as Un, SheetFooter as Wn, SheetHeader as Gn, SheetTitle as Kn, SheetTrigger as qn } from "./components/ui/sheet.js";
|
|
43
|
+
import { Sidebar as Jn, SidebarContent as Yn, SidebarFooter as Xn, SidebarGroup as Zn, SidebarGroupAction as Qn, SidebarGroupContent as $n, SidebarGroupLabel as er, SidebarHeader as tr, SidebarInput as nr, SidebarInset as rr, SidebarMenu as ir, SidebarMenuAction as ar, SidebarMenuBadge as or, SidebarMenuButton as sr, SidebarMenuItem as cr, SidebarMenuSkeleton as lr, SidebarMenuSub as ur, SidebarMenuSubButton as dr, SidebarMenuSubItem as fr, SidebarProvider as pr, SidebarRail as mr, SidebarSeparator as hr, SidebarTrigger as gr, useSidebar as _r } from "./components/ui/sidebar.js";
|
|
44
|
+
import { Skeleton as vr } from "./components/ui/skeleton.js";
|
|
45
|
+
import { Slider as yr } from "./components/ui/slider.js";
|
|
46
|
+
import { Spinner as br, SpinnerDecoratif as xr } from "./components/ui/spinner.js";
|
|
47
|
+
import { Switch as Sr } from "./components/ui/switch.js";
|
|
48
|
+
import { Table as Cr, TableBody as wr, TableCaption as Tr, TableCell as Er, TableFooter as Dr, TableHead as Or, TableHeader as kr, TableRow as Ar } from "./components/ui/table.js";
|
|
49
|
+
import { Tabs as jr, TabsContent as Mr, TabsList as Nr, TabsTrigger as Pr, tabsListVariants as Fr } from "./components/ui/tabs.js";
|
|
50
|
+
import { Textarea as Ir } from "./components/ui/textarea.js";
|
|
51
|
+
import { Toggle as Lr, toggleVariants as Rr } from "./components/ui/toggle.js";
|
|
52
|
+
import { ToggleGroup as zr, ToggleGroupItem as Br } from "./components/ui/toggle-group.js";
|
|
53
|
+
import { Tooltip as Vr, TooltipContent as Hr, TooltipProvider as Ur, TooltipTrigger as Wr } from "./components/ui/tooltip.js";
|
|
54
|
+
import { AppShell as Gr } from "./components/etic/app-shell.js";
|
|
55
|
+
import { NavTabs as Kr } from "./components/etic/nav-tabs.js";
|
|
56
|
+
import { LienProvider as qr, useLien as Jr } from "./components/etic/lien.js";
|
|
57
|
+
import { ThemeMenu as Yr } from "./components/etic/theme-menu.js";
|
|
58
|
+
import { appliquerTheme as Xr, useThemeApplique as Zr } from "./theme.js";
|
|
59
|
+
import { fermerSaufEnCours as Qr } from "./components/etic/action.js";
|
|
60
|
+
import { AuthAvatar as $r, AuthImage as ei, useAuthObjectUrl as ti, useAuthObjectUrlEtat as ni } from "./components/etic/auth-image.js";
|
|
61
|
+
import { ButtonLink as ri } from "./components/etic/button-link.js";
|
|
62
|
+
import { DropdownMenuExternalLink as ii, ExternalLink as ai } from "./components/etic/external-link.js";
|
|
63
|
+
import { CenteredScreen as oi, MessageScreen as si } from "./components/etic/centered-screen.js";
|
|
64
|
+
import { ConfirmDialog as ci } from "./components/etic/confirm-dialog.js";
|
|
65
|
+
import { CopyButton as li } from "./components/etic/copy-button.js";
|
|
66
|
+
import { DeleteButton as ui } from "./components/etic/delete-button.js";
|
|
67
|
+
import { DetailItem as di, DetailList as fi } from "./components/etic/detail-list.js";
|
|
68
|
+
import { DetailSheet as pi } from "./components/etic/detail-sheet.js";
|
|
69
|
+
import { useDetailSheet as mi } from "./components/etic/use-detail-sheet.js";
|
|
70
|
+
import { Disclosure as hi, DisclosureTrigger as gi } from "./components/etic/disclosure.js";
|
|
71
|
+
import { DropdownMenuAction as _i } from "./components/etic/dropdown-menu-action.js";
|
|
72
|
+
import { DraftResumeDialog as vi } from "./components/etic/draft-resume-dialog.js";
|
|
73
|
+
import { EmptyState as yi, FilteredEmptyState as bi } from "./components/etic/empty-state.js";
|
|
74
|
+
import { BoutonReessayer as xi, DetailTechnique as Si, ErrorBanner as Ci, ErrorBannerProvider as wi, decrireErreur as Ti } from "./components/etic/error-banner.js";
|
|
75
|
+
import { ErrorBoundary as Ei } from "./components/etic/error-boundary.js";
|
|
76
|
+
import { FormDialog as Di } from "./components/etic/form-dialog.js";
|
|
77
|
+
import { IconToggle as Oi } from "./components/etic/icon-toggle.js";
|
|
78
|
+
import { Loading as ki, SkeletonCard as Ai, SkeletonPage as ji, SkeletonTable as Mi } from "./components/etic/loading.js";
|
|
79
|
+
import { DetailHeader as Ni, PageHeader as Pi } from "./components/etic/page-header.js";
|
|
80
|
+
import { DetailMeta as Fi, DetailMetaLink as Ii } from "./components/etic/detail-meta.js";
|
|
81
|
+
import { PageContainer as Li } from "./components/etic/page-container.js";
|
|
82
|
+
import { QueryBoundary as Ri, QueryErrorBanner as zi } from "./components/etic/query-boundary.js";
|
|
83
|
+
import { SectionCard as Bi } from "./components/etic/section-card.js";
|
|
84
|
+
import { SubSection as Vi } from "./components/etic/sub-section.js";
|
|
85
|
+
import { CodeBlock as Hi } from "./components/etic/code-block.js";
|
|
86
|
+
import { StatTile as Ui } from "./components/etic/stat-tile.js";
|
|
87
|
+
import { ProgressRing as Wi } from "./components/etic/progress-ring.js";
|
|
88
|
+
import { VerdictPanel as Gi } from "./components/etic/verdict-panel.js";
|
|
89
|
+
import { StatGrid as Ki } from "./components/etic/stat-grid.js";
|
|
90
|
+
import { StatusBadge as qi } from "./components/etic/status-badge.js";
|
|
91
|
+
import { RemovableBadge as Ji } from "./components/etic/removable-badge.js";
|
|
92
|
+
import { ExplainedBadge as Yi } from "./components/etic/explained-badge.js";
|
|
93
|
+
import { Toggletip as Xi } from "./components/etic/toggletip.js";
|
|
94
|
+
import { SaveBar as Zi } from "./components/etic/save-bar.js";
|
|
95
|
+
import { ResetButton as Qi } from "./components/etic/reset-button.js";
|
|
96
|
+
import { TooltipButton as $i } from "./components/etic/tooltip-button.js";
|
|
97
|
+
import { UnsavedChangesDialog as ea } from "./components/etic/unsaved-changes.js";
|
|
98
|
+
import { useUnsavedChangesWarning as ta } from "./components/etic/use-unsaved-changes-warning.js";
|
|
99
|
+
import { FormField as na, FormSection as ra, RequiredMark as ia } from "./components/etic/form-field.js";
|
|
100
|
+
import { useFormField as aa } from "./components/etic/form-field-context.js";
|
|
101
|
+
import { DatePicker as oa } from "./components/etic/date-picker.js";
|
|
102
|
+
import { PhoneInput as sa, formaterTelephone as ca } from "./components/etic/phone-input.js";
|
|
103
|
+
import { FileDropZone as la, FileUploadButton as ua, SelectedFile as da } from "./components/etic/file-upload.js";
|
|
104
|
+
import { SelectField as fa } from "./components/etic/select-field.js";
|
|
105
|
+
import { SegmentedControl as pa } from "./components/etic/segmented-control.js";
|
|
106
|
+
import { CheckboxList as ma } from "./components/etic/checkbox-list.js";
|
|
107
|
+
import { useDraftAutosave as ha } from "./components/etic/use-draft-autosave.js";
|
|
108
|
+
import { SearchSelect as ga } from "./components/etic/search-select.js";
|
|
109
|
+
import { DataTable as _a, DataTableCellLink as va, DataTableColumnHeader as ya, DataTableRowActions as ba, createDataTableColumnHelper as xa, dataTableActionsColumn as Sa, dataTableExpandColumn as Ca, dataTableFeatures as wa, dataTableSelectionColumn as Ta, useDataTable as Ea } from "./components/etic/data-table.js";
|
|
110
|
+
import { focaliserTableau as Da } from "./components/etic/data-table-focus.js";
|
|
111
|
+
import { DataTableBulkActions as Oa } from "./components/etic/data-table-bulk-actions.js";
|
|
112
|
+
import { DataTablePagination as ka } from "./components/etic/data-table-pagination.js";
|
|
113
|
+
import { DataTableCount as Aa, DataTableSelectFilter as ja, DataTableToolbar as Ma } from "./components/etic/data-table-toolbar.js";
|
|
114
|
+
import { DataTableViewOptions as Na } from "./components/etic/data-table-view-options.js";
|
|
115
|
+
import { PorteeStockageLocal as Pa, usePersistedState as Fa } from "./hooks/use-persisted-state.js";
|
|
116
|
+
import { useColumnPrefs as Ia } from "./hooks/use-column-prefs.js";
|
|
117
|
+
import { useServerPagination as La } from "./components/etic/use-server-pagination.js";
|
|
118
|
+
import { useServerSorting as Ra } from "./components/etic/use-server-sorting.js";
|
|
119
|
+
export { I as Alert, L as AlertAction, R as AlertDescription, B as AlertDialog, V as AlertDialogAction, H as AlertDialogCancel, U as AlertDialogContent, W as AlertDialogDescription, G as AlertDialogFooter, K as AlertDialogHeader, q as AlertDialogMedia, J as AlertDialogOverlay, Y as AlertDialogPortal, X as AlertDialogTitle, Z as AlertDialogTrigger, z as AlertTitle, Gr as AppShell, $r as AuthAvatar, ei as AuthImage, Q as Avatar, $ as AvatarBadge, ee as AvatarFallback, te as AvatarGroup, ne as AvatarGroupCount, re as AvatarImage, ie as Badge, xi as BoutonReessayer, oe as Breadcrumb, se as BreadcrumbEllipsis, ce as BreadcrumbItem, le as BreadcrumbLink, ue as BreadcrumbList, de as BreadcrumbPage, fe as BreadcrumbSeparator, pe as Button, he as ButtonGroup, ge as ButtonGroupSeparator, _e as ButtonGroupText, ri as ButtonLink, ye as Calendar, be as CalendarDayButton, xe as Card, Se as CardAction, Ce as CardContent, we as CardDescription, Te as CardFooter, Ee as CardHeader, De as CardTitle, oi as CenteredScreen, Oe as Checkbox, ma as CheckboxList, Hi as CodeBlock, ke as Collapsible, Ae as CollapsibleContent, je as CollapsibleTrigger, Me as Combobox, Ne as ComboboxChip, Pe as ComboboxChips, Fe as ComboboxChipsInput, Ie as ComboboxCollection, Le as ComboboxContent, Re as ComboboxEmpty, ze as ComboboxGroup, Be as ComboboxInput, Ve as ComboboxItem, He as ComboboxLabel, Ue as ComboboxList, We as ComboboxSeparator, Ge as ComboboxTrigger, Ke as ComboboxValue, ci as ConfirmDialog, li as CopyButton, _a as DataTable, Oa as DataTableBulkActions, va as DataTableCellLink, ya as DataTableColumnHeader, Aa as DataTableCount, ka as DataTablePagination, ba as DataTableRowActions, ja as DataTableSelectFilter, Ma as DataTableToolbar, Na as DataTableViewOptions, oa as DatePicker, ui as DeleteButton, Ni as DetailHeader, di as DetailItem, fi as DetailList, Fi as DetailMeta, Ii as DetailMetaLink, pi as DetailSheet, Si as DetailTechnique, Je as Dialog, Ye as DialogBody, Xe as DialogClose, Ze as DialogContent, Qe as DialogDescription, $e as DialogFooter, et as DialogHeader, tt as DialogOverlay, nt as DialogPortal, rt as DialogTitle, it as DialogTrigger, hi as Disclosure, gi as DisclosureTrigger, vi as DraftResumeDialog, at as DropdownMenu, _i as DropdownMenuAction, ot as DropdownMenuCheckboxItem, st as DropdownMenuContent, ii as DropdownMenuExternalLink, ct as DropdownMenuGroup, lt as DropdownMenuItem, ut as DropdownMenuLabel, dt as DropdownMenuPortal, ft as DropdownMenuRadioGroup, pt as DropdownMenuRadioItem, mt as DropdownMenuSeparator, ht as DropdownMenuShortcut, gt as DropdownMenuSub, _t as DropdownMenuSubContent, vt as DropdownMenuSubTrigger, yt as DropdownMenuTrigger, bt as Empty, xt as EmptyContent, St as EmptyDescription, Ct as EmptyHeader, wt as EmptyMedia, yi as EmptyState, Tt as EmptyTitle, Ci as ErrorBanner, wi as ErrorBannerProvider, Ei as ErrorBoundary, Yi as ExplainedBadge, ai as ExternalLink, Et as Field, Dt as FieldContent, Ot as FieldDescription, kt as FieldError, At as FieldGroup, jt as FieldLabel, Mt as FieldLegend, Nt as FieldSeparator, Pt as FieldSet, Ft as FieldTitle, la as FileDropZone, ua as FileUploadButton, bi as FilteredEmptyState, Di as FormDialog, na as FormField, ra as FormSection, Oi as IconToggle, It as Input, Lt as InputGroup, Rt as InputGroupAddon, zt as InputGroupButton, Bt as InputGroupInput, Vt as InputGroupText, Ht as InputGroupTextarea, Ut as Item, Wt as ItemActions, Gt as ItemContent, Kt as ItemDescription, qt as ItemFooter, Jt as ItemGroup, Yt as ItemHeader, Xt as ItemMedia, Zt as ItemSeparator, Qt as ItemTitle, $t as Kbd, en as KbdGroup, tn as Label, qr as LienProvider, ki as Loading, t as MOBILE_MEDIA_QUERY, si as MessageScreen, k as NO_AUTOFILL, nn as NativeSelect, rn as NativeSelectOptGroup, an as NativeSelectOption, Kr as NavTabs, Li as PageContainer, Pi as PageHeader, on as Pagination, sn as PaginationContent, cn as PaginationEllipsis, ln as PaginationItem, un as PaginationLink, dn as PaginationNext, fn as PaginationPrevious, sa as PhoneInput, pn as Popover, mn as PopoverContent, hn as PopoverDescription, gn as PopoverHeader, _n as PopoverTitle, vn as PopoverTrigger, Pa as PorteeStockageLocal, yn as Progress, bn as ProgressIndicator, xn as ProgressLabel, Wi as ProgressRing, Sn as ProgressTrack, Cn as ProgressValue, Ri as QueryBoundary, zi as QueryErrorBanner, wn as RadioGroup, Tn as RadioGroupItem, Ji as RemovableBadge, ia as RequiredMark, Qi as ResetButton, Zi as SaveBar, En as ScrollArea, Dn as ScrollBar, ga as SearchSelect, Bi as SectionCard, pa as SegmentedControl, On as Select, kn as SelectContent, fa as SelectField, An as SelectGroup, jn as SelectItem, Mn as SelectLabel, Nn as SelectScrollDownButton, Pn as SelectScrollUpButton, Fn as SelectSeparator, In as SelectTrigger, Ln as SelectValue, da as SelectedFile, Rn as Separator, zn as Sheet, Bn as SheetBody, Vn as SheetClose, Hn as SheetContent, Un as SheetDescription, Wn as SheetFooter, Gn as SheetHeader, Kn as SheetTitle, qn as SheetTrigger, Jn as Sidebar, Yn as SidebarContent, Xn as SidebarFooter, Zn as SidebarGroup, Qn as SidebarGroupAction, $n as SidebarGroupContent, er as SidebarGroupLabel, tr as SidebarHeader, nr as SidebarInput, rr as SidebarInset, ir as SidebarMenu, ar as SidebarMenuAction, or as SidebarMenuBadge, sr as SidebarMenuButton, cr as SidebarMenuItem, lr as SidebarMenuSkeleton, ur as SidebarMenuSub, dr as SidebarMenuSubButton, fr as SidebarMenuSubItem, pr as SidebarProvider, mr as SidebarRail, hr as SidebarSeparator, gr as SidebarTrigger, vr as Skeleton, Ai as SkeletonCard, ji as SkeletonPage, Mi as SkeletonTable, yr as Slider, br as Spinner, xr as SpinnerDecoratif, Ki as StatGrid, Ui as StatTile, qi as StatusBadge, Vi as SubSection, Sr as Switch, Cr as Table, wr as TableBody, Tr as TableCaption, Er as TableCell, Dr as TableFooter, Or as TableHead, kr as TableHeader, Ar as TableRow, jr as Tabs, Mr as TabsContent, Nr as TabsList, Pr as TabsTrigger, Ir as Textarea, Yr as ThemeMenu, Lr as Toggle, zr as ToggleGroup, Br as ToggleGroupItem, Xi as Toggletip, Vr as Tooltip, $i as TooltipButton, Hr as TooltipContent, Ur as TooltipProvider, Wr as TooltipTrigger, ea as UnsavedChangesDialog, Gi as VerdictPanel, r as accorde, Xr as appliquerTheme, ae as badgeVariants, ve as buttonGroupVariants, me as buttonVariants, i as capitaliser, e as cn, T as comparerFr, a as compte, E as correspondance, xa as createDataTableColumnHelper, Sa as dataTableActionsColumn, Ca as dataTableExpandColumn, wa as dataTableFeatures, Ta as dataTableSelectionColumn, Ti as decrireErreur, C as ecrireDateIso, Qr as fermerSaufEnCours, Da as focaliserTableau, o as formaterAnciennete, s as formaterDate, c as formaterDateHeure, l as formaterDateHeureLongue, u as formaterDuree, d as formaterDureeArrondie, f as formaterDureePrecise, p as formaterHeure, m as formaterHorodatage, h as formaterMontant, g as formaterNombre, _ as formaterOctets, v as formaterPourcentage, ca as formaterTelephone, y as initiales, w as lireDateIso, b as nombreFr, D as normaliser, O as normaliserRecherche, x as participe, Fr as tabsListVariants, Rr as toggleVariants, S as uniteAccordee, ti as useAuthObjectUrl, ni as useAuthObjectUrlEtat, Ia as useColumnPrefs, qe as useComboboxAnchor, Ea as useDataTable, j as useDebouncedSearch, A as useDebouncedValue, mi as useDetailSheet, F as useDocumentTitle, ha as useDraftAutosave, aa as useFormField, M as useFreshDialog, n as useIsMobile, Jr as useLien, N as useLoadOnOpen, Fa as usePersistedState, P as useSaveByKey, La as useServerPagination, Ra as useServerSorting, _r as useSidebar, Zr as useThemeApplique, ta as useUnsavedChangesWarning };
|
package/dist/lib/format.d.ts
CHANGED
|
@@ -21,12 +21,38 @@ export declare const accorde: (n: number, singulier: string, pluriel?: string) =
|
|
|
21
21
|
/** Nombre et nom accordé : `compte(1234, "ligne")` → « 1 234 lignes »,
|
|
22
22
|
* `compte(0, "doublon")` → « 0 doublon ». */
|
|
23
23
|
export declare const compte: (n: number, singulier: string, pluriel?: string) => string;
|
|
24
|
+
/** Nombre à la française (« 2,5 », « 1 234 ») ; le repli sans valeur. */
|
|
25
|
+
export declare function formaterNombre(valeur: number | null | undefined, repli?: string): string;
|
|
26
|
+
/** Montant : « 1 234,50 € » (euros par défaut, `devise` ISO 4217 sinon). */
|
|
27
|
+
export declare function formaterMontant(valeur: number | null | undefined, { devise, repli }?: {
|
|
28
|
+
devise?: string;
|
|
29
|
+
repli?: string;
|
|
30
|
+
}): string;
|
|
31
|
+
/** Une fraction en pourcentage : 0,55 → « 55 % » ; `decimales` au plus
|
|
32
|
+
* (0 par défaut : arrondi à l'unité). */
|
|
33
|
+
export declare function formaterPourcentage(fraction: number | null | undefined, { decimales, repli }?: {
|
|
34
|
+
decimales?: number;
|
|
35
|
+
repli?: string;
|
|
36
|
+
}): string;
|
|
37
|
+
/** Première lettre en capitale : un libellé servi en minuscules qui ouvre
|
|
38
|
+
* une ligne (« en attente » → « En attente »). */
|
|
39
|
+
export declare function capitaliser(texte: string): string;
|
|
40
|
+
/**
|
|
41
|
+
* Initiales d'un nom affiché, pour un avatar : les deux premiers mots
|
|
42
|
+
* (« Camille Martin » → « CM »), sinon la première lettre du `secours`
|
|
43
|
+
* (l'adresse e-mail), sinon « ? ».
|
|
44
|
+
*/
|
|
45
|
+
export declare function initiales(nom: string | null | undefined, secours?: string | null): string;
|
|
24
46
|
/** Taille en octets, en base 1024 : « 0 o », « 512 o », « 1,5 Ko »,
|
|
25
47
|
* « 120 Mo » (une décimale sous 100). */
|
|
26
48
|
export declare function formaterOctets(octets: number | null | undefined, repli?: string): string;
|
|
27
49
|
/** Durée en secondes, ses deux plus grandes unités : « 3 j 4 h »,
|
|
28
50
|
* « 2 h 15 min », « 15 min », « 42 s ». */
|
|
29
51
|
export declare function formaterDuree(secondes: number | null | undefined, repli?: string): string;
|
|
52
|
+
/** Durée à la seconde, pour une opération qui se compte en secondes ou en
|
|
53
|
+
* minutes (un traitement, un envoi) : « moins d'une seconde », « 23 s »,
|
|
54
|
+
* « 1 min 05 s », « 1 h 02 min 05 s ». */
|
|
55
|
+
export declare function formaterDureePrecise(secondes: number | null | undefined, repli?: string): string;
|
|
30
56
|
/** L'ordre de grandeur d'une durée, sa plus grande unité seulement : « 3 j »,
|
|
31
57
|
* « 18 h », « 15 min » (jamais en secondes : « 0 min » sous la minute). */
|
|
32
58
|
export declare function formaterDureeArrondie(secondes: number): string;
|
|
@@ -50,5 +76,10 @@ export declare function formaterDateHeure(valeur: string | null | undefined, rep
|
|
|
50
76
|
/** Date et heure à la seconde : « 05/07/2026 14:30:12 », là où l'instant
|
|
51
77
|
* exact compte (journal, événements). */
|
|
52
78
|
export declare function formaterHorodatage(valeur: string | null | undefined, repli?: string): string;
|
|
79
|
+
/** Heure seule, à la seconde : « 14:30:12 ». Accepte un instant en
|
|
80
|
+
* millisecondes (`Date.now()`, `dataUpdatedAt` de TanStack Query) comme
|
|
81
|
+
* une date ISO. Le repli pour `0` (`dataUpdatedAt` avant la première
|
|
82
|
+
* réponse) et pour un nombre non fini. */
|
|
83
|
+
export declare function formaterHeure(valeur: number | string | null | undefined, repli?: string): string;
|
|
53
84
|
/** Date et heure, mois en lettres, pour une fiche : « 05 juillet 2026 à 14:30 ». */
|
|
54
85
|
export declare function formaterDateHeureLongue(valeur: string | null | undefined, repli?: string): string;
|
package/dist/lib/format.js
CHANGED
|
@@ -3,70 +3,105 @@ import { lireDateIso as e } from "./dates.js";
|
|
|
3
3
|
var t = (e) => e.toLocaleString("fr-FR"), n = (e, t) => e > 1 ? t.pluriel : t.singulier, r = (e, t, n) => `${e}${n ? "e" : ""}${t > 1 ? "s" : ""}`, i = (e, t, r) => n(e, {
|
|
4
4
|
singulier: t,
|
|
5
5
|
pluriel: r ?? `${t}s`
|
|
6
|
-
}), a = (e, n, r) => `${t(e)} ${i(e, n, r)}`, o =
|
|
6
|
+
}), a = (e, n, r) => `${t(e)} ${i(e, n, r)}`, o = (e) => typeof e == "number" && Number.isFinite(e);
|
|
7
|
+
function s(e, n = "—") {
|
|
8
|
+
return o(e) ? t(e) : n;
|
|
9
|
+
}
|
|
10
|
+
function c(e, { devise: t = "EUR", repli: n = "—" } = {}) {
|
|
11
|
+
return o(e) ? e.toLocaleString("fr-FR", {
|
|
12
|
+
style: "currency",
|
|
13
|
+
currency: t
|
|
14
|
+
}) : n;
|
|
15
|
+
}
|
|
16
|
+
function l(e, { decimales: t = 0, repli: n = "—" } = {}) {
|
|
17
|
+
return o(e) ? e.toLocaleString("fr-FR", {
|
|
18
|
+
style: "percent",
|
|
19
|
+
maximumFractionDigits: t
|
|
20
|
+
}) : n;
|
|
21
|
+
}
|
|
22
|
+
function u(e) {
|
|
23
|
+
return e.charAt(0).toLocaleUpperCase("fr-FR") + e.slice(1);
|
|
24
|
+
}
|
|
25
|
+
function d(e, t) {
|
|
26
|
+
return ((e?.trim().split(/\s+/).filter(Boolean) ?? []).slice(0, 2).map((e) => e[0]).join("") || t?.trim()[0] || "?").toLocaleUpperCase("fr-FR");
|
|
27
|
+
}
|
|
28
|
+
var f = [
|
|
7
29
|
"o",
|
|
8
30
|
"Ko",
|
|
9
31
|
"Mo",
|
|
10
32
|
"Go",
|
|
11
33
|
"To"
|
|
12
34
|
];
|
|
13
|
-
function
|
|
35
|
+
function p(e, t = "—") {
|
|
14
36
|
if (e == null) return t;
|
|
15
37
|
if (e === 0) return "0 o";
|
|
16
38
|
let n = e, r = 0;
|
|
17
|
-
for (; n >= 1024 && r <
|
|
39
|
+
for (; n >= 1024 && r < f.length - 1;) n /= 1024, r += 1;
|
|
18
40
|
let i = n >= 100 || r === 0 ? 0 : 1;
|
|
19
|
-
return `${n.toLocaleString("fr-FR", { maximumFractionDigits: i })} ${
|
|
41
|
+
return `${n.toLocaleString("fr-FR", { maximumFractionDigits: i })} ${f[r]}`;
|
|
20
42
|
}
|
|
21
|
-
function
|
|
43
|
+
function m(e, t = "—") {
|
|
22
44
|
if (e == null) return t;
|
|
23
45
|
let n = Math.floor(e / 86400), r = Math.floor(e % 86400 / 3600), i = Math.floor(e % 3600 / 60);
|
|
24
46
|
return n > 0 ? `${n} j ${r} h` : r > 0 ? `${r} h ${i} min` : i > 0 ? `${i} min` : `${Math.floor(e)} s`;
|
|
25
47
|
}
|
|
26
|
-
function
|
|
48
|
+
function h(e, t = "—") {
|
|
49
|
+
if (!o(e)) return t;
|
|
50
|
+
let n = Math.round(e);
|
|
51
|
+
if (n < 1) return "moins d'une seconde";
|
|
52
|
+
if (n < 60) return `${n} s`;
|
|
53
|
+
let r = Math.floor(n / 3600), i = Math.floor(n % 3600 / 60), a = String(n % 60).padStart(2, "0");
|
|
54
|
+
return r === 0 ? `${i} min ${a} s` : `${r} h ${String(i).padStart(2, "0")} min ${a} s`;
|
|
55
|
+
}
|
|
56
|
+
function g(e) {
|
|
27
57
|
let t = Math.floor(e / 86400);
|
|
28
58
|
if (t > 0) return `${t} j`;
|
|
29
59
|
let n = Math.floor(e / 3600);
|
|
30
60
|
return n > 0 ? `${n} h` : `${Math.floor(e / 60)} min`;
|
|
31
61
|
}
|
|
32
|
-
function
|
|
62
|
+
function _(e, { arrondie: t = !1, ilYA: n = !0, repli: r = "—" } = {}) {
|
|
33
63
|
if (!e) return r;
|
|
34
64
|
let i = new Date(e).getTime();
|
|
35
65
|
if (Number.isNaN(i)) return e;
|
|
36
66
|
let a = (Date.now() - i) / 1e3;
|
|
37
67
|
if (a < 60) return "à l'instant";
|
|
38
|
-
let o = t ?
|
|
68
|
+
let o = t ? g(a) : m(a);
|
|
39
69
|
return n ? `il y a ${o}` : o;
|
|
40
70
|
}
|
|
41
|
-
function
|
|
71
|
+
function v(e) {
|
|
42
72
|
let t = new Date(e);
|
|
43
73
|
return Number.isNaN(t.getTime()) ? null : t;
|
|
44
74
|
}
|
|
45
|
-
function
|
|
75
|
+
function y(t, n = "—") {
|
|
46
76
|
if (!t) return n;
|
|
47
|
-
let r = e(t) ??
|
|
77
|
+
let r = e(t) ?? v(t);
|
|
48
78
|
return r ? r.toLocaleDateString("fr-FR", {
|
|
49
79
|
day: "2-digit",
|
|
50
80
|
month: "long",
|
|
51
81
|
year: "numeric"
|
|
52
82
|
}) : t;
|
|
53
83
|
}
|
|
54
|
-
function
|
|
84
|
+
function b(e, t = "—") {
|
|
55
85
|
if (!e) return t;
|
|
56
|
-
let n =
|
|
86
|
+
let n = v(e);
|
|
57
87
|
return n ? n.toLocaleString("fr-FR", {
|
|
58
88
|
dateStyle: "short",
|
|
59
89
|
timeStyle: "short"
|
|
60
90
|
}) : e;
|
|
61
91
|
}
|
|
62
|
-
function
|
|
92
|
+
function x(e, t = "—") {
|
|
63
93
|
if (!e) return t;
|
|
64
|
-
let n =
|
|
94
|
+
let n = v(e);
|
|
65
95
|
return n ? n.toLocaleString("fr-FR") : e;
|
|
66
96
|
}
|
|
67
|
-
function
|
|
97
|
+
function S(e, t = "—") {
|
|
98
|
+
if (e == null || e === "" || typeof e == "number" && (!o(e) || e === 0)) return t;
|
|
99
|
+
let n = new Date(e);
|
|
100
|
+
return Number.isNaN(n.getTime()) ? String(e) : n.toLocaleTimeString("fr-FR", { timeStyle: "medium" });
|
|
101
|
+
}
|
|
102
|
+
function C(e, t = "—") {
|
|
68
103
|
if (!e) return t;
|
|
69
|
-
let n =
|
|
104
|
+
let n = v(e);
|
|
70
105
|
return n ? n.toLocaleString("fr-FR", {
|
|
71
106
|
day: "2-digit",
|
|
72
107
|
month: "long",
|
|
@@ -75,6 +110,6 @@ function h(e, t = "—") {
|
|
|
75
110
|
minute: "2-digit"
|
|
76
111
|
}) : e;
|
|
77
112
|
}
|
|
78
|
-
export { i as accorde, a as compte,
|
|
113
|
+
export { i as accorde, u as capitaliser, a as compte, _ as formaterAnciennete, y as formaterDate, b as formaterDateHeure, C as formaterDateHeureLongue, m as formaterDuree, g as formaterDureeArrondie, h as formaterDureePrecise, S as formaterHeure, x as formaterHorodatage, c as formaterMontant, s as formaterNombre, p as formaterOctets, l as formaterPourcentage, d as initiales, t as nombreFr, r as participe, n as uniteAccordee };
|
|
79
114
|
|
|
80
115
|
//# sourceMappingURL=format.js.map
|
package/dist/lib/format.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"format.js","names":["nombreFr","n","uniteAccordee","unite","participe","base","feminin","accorde","pluriel","singulier","compte","UNITES_OCTETS","formaterOctets","octets","repli","valeur","decimales","formaterDuree","secondes","j","h","min","formaterDureeArrondie","formaterAnciennete","instant","duree","arrondie","ilYA","lireInstant","date","formaterDate","lireDateIso","formaterDateHeure","formaterHorodatage","formaterDateHeureLongue"],"sources":["../../src/lib/format.ts"],"sourcesContent":["/**\n * Textes chiffrés en français, communs à la suite : accords, nombres, octets,\n * durées et dates. Chaque formateur rend un repli (« — » par défaut) pour une\n * valeur absente, et rend telle quelle une date illisible (une valeur\n * inattendue de l'API reste visible au lieu de « Invalid Date »).\n */\n\nimport { lireDateIso } from \"@etic-ui/lib/dates\"\n\n// Accords et nombres\n\n/** Nom d'un élément, au singulier et au pluriel. */\nexport interface Unite {\n singulier: string\n pluriel: string\n}\n\n/** 1234 → « 1 234 » (espace fine insécable, comme `Intl`). */\nexport const nombreFr = (n: number) => n.toLocaleString(\"fr-FR\")\n\n/** Nom accordé au nombre : 0 et 1 au singulier, comme en français. */\nexport const uniteAccordee = (n: number, unite: Unite) =>\n n > 1 ? unite.pluriel : unite.singulier\n\n/** Participe accordé : `participe(\"sélectionné\", 3, true)` → « sélectionnées ». */\nexport const participe = (base: string, n: number, feminin: boolean) =>\n `${base}${feminin ? \"e\" : \"\"}${n > 1 ? \"s\" : \"\"}`\n\n/** Mot accordé au nombre : `accorde(3, \"ligne\")` → « lignes » ; pluriel\n * irrégulier en troisième argument (`accorde(2, \"journal\", \"journaux\")`). */\nexport const accorde = (n: number, singulier: string, pluriel?: string) =>\n uniteAccordee(n, { singulier, pluriel: pluriel ?? `${singulier}s` })\n\n/** Nombre et nom accordé : `compte(1234, \"ligne\")` → « 1 234 lignes »,\n * `compte(0, \"doublon\")` → « 0 doublon ». */\nexport const compte = (n: number, singulier: string, pluriel?: string) =>\n `${nombreFr(n)} ${accorde(n, singulier, pluriel)}`\n\n// Octets\n\nconst UNITES_OCTETS = [\"o\", \"Ko\", \"Mo\", \"Go\", \"To\"]\n\n/** Taille en octets, en base 1024 : « 0 o », « 512 o », « 1,5 Ko »,\n * « 120 Mo » (une décimale sous 100). */\nexport function formaterOctets(\n octets: number | null | undefined,\n repli = \"—\"\n): string {\n if (octets === null || octets === undefined) return repli\n if (octets === 0) return \"0 o\"\n let valeur = octets\n let unite = 0\n while (valeur >= 1024 && unite < UNITES_OCTETS.length - 1) {\n valeur /= 1024\n unite += 1\n }\n const decimales = valeur >= 100 || unite === 0 ? 0 : 1\n return `${valeur.toLocaleString(\"fr-FR\", { maximumFractionDigits: decimales })} ${UNITES_OCTETS[unite]}`\n}\n\n// Durées\n\n/** Durée en secondes, ses deux plus grandes unités : « 3 j 4 h »,\n * « 2 h 15 min », « 15 min », « 42 s ». */\nexport function formaterDuree(\n secondes: number | null | undefined,\n repli = \"—\"\n): string {\n if (secondes === null || secondes === undefined) return repli\n const j = Math.floor(secondes / 86400)\n const h = Math.floor((secondes % 86400) / 3600)\n const min = Math.floor((secondes % 3600) / 60)\n if (j > 0) return `${j} j ${h} h`\n if (h > 0) return `${h} h ${min} min`\n if (min > 0) return `${min} min`\n return `${Math.floor(secondes)} s`\n}\n\n/** L'ordre de grandeur d'une durée, sa plus grande unité seulement : « 3 j »,\n * « 18 h », « 15 min » (jamais en secondes : « 0 min » sous la minute). */\nexport function formaterDureeArrondie(secondes: number): string {\n const j = Math.floor(secondes / 86400)\n if (j > 0) return `${j} j`\n const h = Math.floor(secondes / 3600)\n if (h > 0) return `${h} h`\n return `${Math.floor(secondes / 60)} min`\n}\n\nexport interface AncienneteOptions {\n /** Plus grande unité seulement (« 3 j ») au lieu des deux (« 3 j 4 h »). */\n arrondie?: boolean\n /** Précédée de « il y a » (par défaut) ; `false` pour « 3 j » seul. */\n ilYA?: boolean\n /** Texte d'une valeur absente. */\n repli?: string\n}\n\n/** Ancienneté d'un instant ISO : « il y a 3 j 4 h », ou « à l'instant » sous\n * la minute (instant à venir compris). */\nexport function formaterAnciennete(\n valeur: string | null | undefined,\n { arrondie = false, ilYA = true, repli = \"—\" }: AncienneteOptions = {}\n): string {\n if (!valeur) return repli\n const instant = new Date(valeur).getTime()\n if (Number.isNaN(instant)) return valeur\n const secondes = (Date.now() - instant) / 1000\n if (secondes < 60) return \"à l'instant\"\n const duree = arrondie\n ? formaterDureeArrondie(secondes)\n : formaterDuree(secondes)\n return ilYA ? `il y a ${duree}` : duree\n}\n\n// Dates\n\nfunction lireInstant(valeur: string): Date | null {\n const date = new Date(valeur)\n return Number.isNaN(date.getTime()) ? null : date\n}\n\n/** Date seule, mois en lettres : « 05 juillet 2026 ». Une date sans heure\n * (`2026-07-05`, une date de naissance) est lue en heure locale : lue comme\n * minuit UTC, ce serait la veille à l'ouest de Greenwich. */\nexport function formaterDate(\n valeur: string | null | undefined,\n repli = \"—\"\n): string {\n if (!valeur) return repli\n const date = lireDateIso(valeur) ?? lireInstant(valeur)\n if (!date) return valeur\n return date.toLocaleDateString(\"fr-FR\", {\n day: \"2-digit\",\n month: \"long\",\n year: \"numeric\",\n })\n}\n\n/** Date et heure compactes, en chiffres : « 05/07/2026 14:30 ». */\nexport function formaterDateHeure(\n valeur: string | null | undefined,\n repli = \"—\"\n): string {\n if (!valeur) return repli\n const date = lireInstant(valeur)\n if (!date) return valeur\n return date.toLocaleString(\"fr-FR\", {\n dateStyle: \"short\",\n timeStyle: \"short\",\n })\n}\n\n/** Date et heure à la seconde : « 05/07/2026 14:30:12 », là où l'instant\n * exact compte (journal, événements). */\nexport function formaterHorodatage(\n valeur: string | null | undefined,\n repli = \"—\"\n): string {\n if (!valeur) return repli\n const date = lireInstant(valeur)\n if (!date) return valeur\n return date.toLocaleString(\"fr-FR\")\n}\n\n/** Date et heure, mois en lettres, pour une fiche : « 05 juillet 2026 à 14:30 ». */\nexport function formaterDateHeureLongue(\n valeur: string | null | undefined,\n repli = \"—\"\n): string {\n if (!valeur) return repli\n const date = lireInstant(valeur)\n if (!date)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ACb,CAAC,IAJiBd;AAKpB;AAIA,SAAgBkB,EACd,GACA,IAAQ,KACA;CACR,IAAI,CAAClB,GAAQ,OAAOD;CACpB,IAAMe,IAAOD,EAAYb,CAAM;CAE/B,OADKc,IACEA,EAAK,eAAe,OAAO,IADhBd;AAEpB;AAGA,SAAgBmB,EACd,GACA,IAAQ,KACA;CACR,IAAI,CAACnB,GAAQ,OAAOD;CACpB,IAAMe,IAAOD,EAAYb,CAAM;CAE/B,OADKc,IACEA,EAAK,eAAe,SAAS;EAClC,KAAK;EACL,OAAO;EACP,MAAM;EACN,MAAM;EACN,QAAQ;CACV,CAAC,IAPiBd;AAQpB"}
|
|
1
|
+
{"version":3,"file":"format.js","names":["nombreFr","n","uniteAccordee","unite","participe","base","feminin","accorde","pluriel","singulier","compte","fini","valeur","formaterNombre","repli","formaterMontant","devise","formaterPourcentage","fraction","decimales","capitaliser","texte","initiales","nom","mot","secours","UNITES_OCTETS","formaterOctets","octets","formaterDuree","secondes","j","h","min","formaterDureePrecise","total","s","formaterDureeArrondie","formaterAnciennete","instant","duree","arrondie","ilYA","lireInstant","date","formaterDate","lireDateIso","formaterDateHeure","formaterHorodatage","formaterHeure","formaterDateHeureLongue"],"sources":["../../src/lib/format.ts"],"sourcesContent":["/**\n * Textes chiffrés en français, communs à la suite : accords, nombres, octets,\n * durées et dates. Chaque formateur rend un repli (« — » par défaut) pour une\n * valeur absente, et rend telle quelle une date illisible (une valeur\n * inattendue de l'API reste visible au lieu de « Invalid Date »).\n */\n\nimport { lireDateIso } from \"@etic-ui/lib/dates\"\n\n// Accords et nombres\n\n/** Nom d'un élément, au singulier et au pluriel. */\nexport interface Unite {\n singulier: string\n pluriel: string\n}\n\n/** 1234 → « 1 234 » (espace fine insécable, comme `Intl`). */\nexport const nombreFr = (n: number) => n.toLocaleString(\"fr-FR\")\n\n/** Nom accordé au nombre : 0 et 1 au singulier, comme en français. */\nexport const uniteAccordee = (n: number, unite: Unite) =>\n n > 1 ? unite.pluriel : unite.singulier\n\n/** Participe accordé : `participe(\"sélectionné\", 3, true)` → « sélectionnées ». */\nexport const participe = (base: string, n: number, feminin: boolean) =>\n `${base}${feminin ? \"e\" : \"\"}${n > 1 ? \"s\" : \"\"}`\n\n/** Mot accordé au nombre : `accorde(3, \"ligne\")` → « lignes » ; pluriel\n * irrégulier en troisième argument (`accorde(2, \"journal\", \"journaux\")`). */\nexport const accorde = (n: number, singulier: string, pluriel?: string) =>\n uniteAccordee(n, { singulier, pluriel: pluriel ?? `${singulier}s` })\n\n/** Nombre et nom accordé : `compte(1234, \"ligne\")` → « 1 234 lignes »,\n * `compte(0, \"doublon\")` → « 0 doublon ». */\nexport const compte = (n: number, singulier: string, pluriel?: string) =>\n `${nombreFr(n)} ${accorde(n, singulier, pluriel)}`\n\n/** Un nombre fini, ou rien (absent, `NaN`, infini). */\nconst fini = (valeur: number | null | undefined): valeur is number =>\n typeof valeur === \"number\" && Number.isFinite(valeur)\n\n/** Nombre à la française (« 2,5 », « 1 234 ») ; le repli sans valeur. */\nexport function formaterNombre(\n valeur: number | null | undefined,\n repli = \"—\"\n): string {\n return fini(valeur) ? nombreFr(valeur) : repli\n}\n\n/** Montant : « 1 234,50 € » (euros par défaut, `devise` ISO 4217 sinon). */\nexport function formaterMontant(\n valeur: number | null | undefined,\n { devise = \"EUR\", repli = \"—\" }: { devise?: string; repli?: string } = {}\n): string {\n if (!fini(valeur)) return repli\n return valeur.toLocaleString(\"fr-FR\", { style: \"currency\", currency: devise })\n}\n\n/** Une fraction en pourcentage : 0,55 → « 55 % » ; `decimales` au plus\n * (0 par défaut : arrondi à l'unité). */\nexport function formaterPourcentage(\n fraction: number | null | undefined,\n { decimales = 0, repli = \"—\" }: { decimales?: number; repli?: string } = {}\n): string {\n if (!fini(fraction)) return repli\n return fraction.toLocaleString(\"fr-FR\", {\n style: \"percent\",\n maximumFractionDigits: decimales,\n })\n}\n\n/** Première lettre en capitale : un libellé servi en minuscules qui ouvre\n * une ligne (« en attente » → « En attente »). */\nexport function capitaliser(texte: string): string {\n return texte.charAt(0).toLocaleUpperCase(\"fr-FR\") + texte.slice(1)\n}\n\n/**\n * Initiales d'un nom affiché, pour un avatar : les deux premiers mots\n * (« Camille Martin » → « CM »), sinon la première lettre du `secours`\n * (l'adresse e-mail), sinon « ? ».\n */\nexport function initiales(\n nom: string | null | undefined,\n secours?: string | null\n): string {\n const mots = nom?.trim().split(/\\s+/).filter(Boolean) ?? []\n const lettres = mots\n .slice(0, 2)\n .map((mot) => mot[0])\n .join(\"\")\n return (lettres || secours?.trim()[0] || \"?\").toLocaleUpperCase(\"fr-FR\")\n}\n\n// Octets\n\nconst UNITES_OCTETS = [\"o\", \"Ko\", \"Mo\", \"Go\", \"To\"]\n\n/** Taille en octets, en base 1024 : « 0 o », « 512 o », « 1,5 Ko »,\n * « 120 Mo » (une décimale sous 100). */\nexport function formaterOctets(\n octets: number | null | undefined,\n repli = \"—\"\n): string {\n if (octets === null || octets === undefined) return repli\n if (octets === 0) return \"0 o\"\n let valeur = octets\n let unite = 0\n while (valeur >= 1024 && unite < UNITES_OCTETS.length - 1) {\n valeur /= 1024\n unite += 1\n }\n const decimales = valeur >= 100 || unite === 0 ? 0 : 1\n return `${valeur.toLocaleString(\"fr-FR\", { maximumFractionDigits: decimales })} ${UNITES_OCTETS[unite]}`\n}\n\n// Durées\n\n/** Durée en secondes, ses deux plus grandes unités : « 3 j 4 h »,\n * « 2 h 15 min », « 15 min », « 42 s ». */\nexport function formaterDuree(\n secondes: number | null | undefined,\n repli = \"—\"\n): string {\n if (secondes === null || secondes === undefined) return repli\n const j = Math.floor(secondes / 86400)\n const h = Math.floor((secondes % 86400) / 3600)\n const min = Math.floor((secondes % 3600) / 60)\n if (j > 0) return `${j} j ${h} h`\n if (h > 0) return `${h} h ${min} min`\n if (min > 0) return `${min} min`\n return `${Math.floor(secondes)} s`\n}\n\n/** Durée à la seconde, pour une opération qui se compte en secondes ou en\n * minutes (un traitement, un envoi) : « moins d'une seconde », « 23 s »,\n * « 1 min 05 s », « 1 h 02 min 05 s ». */\nexport function formaterDureePrecise(\n secondes: number | null | undefined,\n repli = \"—\"\n): string {\n if (!fini(secondes)) return repli\n const total = Math.round(secondes)\n if (total < 1) return \"moins d'une seconde\"\n if (total < 60) return `${total} s`\n const h = Math.floor(total / 3600)\n const min = Math.floor((total % 3600) / 60)\n const s = String(total % 60).padStart(2, \"0\")\n if (h === 0) return `${min} min ${s} s`\n return `${h} h ${String(min).padStart(2, \"0\")} min ${s} s`\n}\n\n/** L'ordre de grandeur d'une durée, sa plus grande unité seulement : « 3 j »,\n * « 18 h », « 15 min » (jamais en secondes : « 0 min » sous la minute). */\nexport function formaterDureeArrondie(secondes: number): string {\n const j = Math.floor(secondes / 86400)\n if (j > 0) return `${j} j`\n const h = Math.floor(secondes / 3600)\n if (h > 0) return `${h} h`\n return `${Math.floor(secondes / 60)} min`\n}\n\nexport interface AncienneteOptions {\n /** Plus grande unité seulement (« 3 j ») au lieu des deux (« 3 j 4 h »). */\n arrondie?: boolean\n /** Précédée de « il y a » (par défaut) ; `false` pour « 3 j » seul. */\n ilYA?: boolean\n /** Texte d'une valeur absente. */\n repli?: string\n}\n\n/** Ancienneté d'un instant ISO : « il y a 3 j 4 h », ou « à l'instant » sous\n * la minute (instant à venir compris). */\nexport function formaterAnciennete(\n valeur: string | null | undefined,\n { arrondie = false, ilYA = true, repli = \"—\" }: AncienneteOptions = {}\n): string {\n if (!valeur) return repli\n const instant = new Date(valeur).getTime()\n if (Number.isNaN(instant)) return valeur\n const secondes = (Date.now() - instant) / 1000\n if (secondes < 60) return \"à l'instant\"\n const duree = arrondie\n ? formaterDureeArrondie(secondes)\n : formaterDuree(secondes)\n return ilYA ? `il y a ${duree}` : duree\n}\n\n// Dates\n\nfunction lireInstant(valeur: string): Date | null {\n const date = new Date(valeur)\n return Number.isNaN(date.getTime()) ? null : date\n}\n\n/** Date seule, mois en lettres : « 05 juillet 2026 ». Une date sans heure\n * (`2026-07-05`, une date de naissance) est lue en heure locale : lue comme\n * minuit UTC, ce serait la veille à l'ouest de Greenwich. */\nexport function formaterDate(\n valeur: string | null | undefined,\n repli = \"—\"\n): string {\n if (!valeur) return repli\n const date = lireDateIso(valeur) ?? lireInstant(valeur)\n if (!date) return valeur\n return date.toLocaleDateString(\"fr-FR\", {\n day: \"2-digit\",\n month: \"long\",\n year: \"numeric\",\n })\n}\n\n/** Date et heure compactes, en chiffres : « 05/07/2026 14:30 ». */\nexport function formaterDateHeure(\n valeur: string | null | undefined,\n repli = \"—\"\n): string {\n if (!valeur) return repli\n const date = lireInstant(valeur)\n if (!date) return valeur\n return date.toLocaleString(\"fr-FR\", {\n dateStyle: \"short\",\n timeStyle: \"short\",\n })\n}\n\n/** Date et heure à la seconde : « 05/07/2026 14:30:12 », là où l'instant\n * exact compte (journal, événements). */\nexport function formaterHorodatage(\n valeur: string | null | undefined,\n repli = \"—\"\n): string {\n if (!valeur) return repli\n const date = lireInstant(valeur)\n if (!date) return valeur\n return date.toLocaleString(\"fr-FR\")\n}\n\n/** Heure seule, à la seconde : « 14:30:12 ». Accepte un instant en\n * millisecondes (`Date.now()`, `dataUpdatedAt` de TanStack Query) comme\n * une date ISO. Le repli pour `0` (`dataUpdatedAt` avant la première\n * réponse) et pour un nombre non fini. */\nexport function formaterHeure(\n valeur: number | string | null | undefined,\n repli = \"—\"\n): string {\n if (valeur === null || valeur === undefined || valeur === \"\") return repli\n if (typeof valeur === \"number\" && (!fini(valeur) || valeur === 0))\n return repli\n const date = new Date(valeur)\n if (Number.isNaN(date.getTime())) return String(valeur)\n return date.toLocaleTimeString(\"fr-FR\", { timeStyle: \"medium\" })\n}\n\n/** Date et heure, mois en lettres, pour une fiche : « 05 juillet 2026 à 14:30 ». */\nexport function formaterDateHeureLongue(\n valeur: string | null | undefined,\n repli = \"—\"\n): string {\n if (!valeur) return repli\n const date = lireInstant(valeur)\n if (!date) return valeur\n return date.toLocaleString(\"fr-FR\", {\n day: \"2-digit\",\n month: \"long\",\n year: \"num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KACA;CACR,IAAI,CAACnC,GAAQ,OAAOE;CACpB,IAAM8B,IAAOD,EAAY/B,CAAM;CAE/B,OADKgC,IACEA,EAAK,eAAe,SAAS;EAClC,WAAW;EACX,WAAW;CACb,CAAC,IAJiBhC;AAKpB;AAIA,SAAgBoC,EACd,GACA,IAAQ,KACA;CACR,IAAI,CAACpC,GAAQ,OAAOE;CACpB,IAAM8B,IAAOD,EAAY/B,CAAM;CAE/B,OADKgC,IACEA,EAAK,eAAe,OAAO,IADhBhC;AAEpB;AAMA,SAAgBqC,EACd,GACA,IAAQ,KACA;CAER,IADIrC,KAAW,QAAgCA,MAAW,MACtD,OAAOA,KAAW,aAAa,CAACD,EAAKC,CAAM,KAAKA,MAAW,IAC7D,OAAOE;CACT,IAAM8B,IAAO,IAAI,KAAKhC,CAAM;CAE5B,OADI,OAAO,MAAMgC,EAAK,QAAQ,CAAC,IAAU,OAAOhC,CAAM,IAC/CgC,EAAK,mBAAmB,SAAS,EAAE,WAAW,SAAS,CAAC;AACjE;AAGA,SAAgBM,EACd,GACA,IAAQ,KACA;CACR,IAAI,CAACtC,GAAQ,OAAOE;CACpB,IAAM8B,IAAOD,EAAY/B,CAAM;CAE/B,OADKgC,IACEA,EAAK,eAAe,SAAS;EAClC,KAAK;EACL,OAAO;EACP,MAAM;EACN,MAAM;EACN,QAAQ;CACV,CAAC,IAPiBhC;AAQpB"}
|
package/dist/lib/ton.d.ts
CHANGED
|
@@ -14,6 +14,13 @@ export interface ClassesTon {
|
|
|
14
14
|
piste: string;
|
|
15
15
|
/** Remplissage d'une jauge `Progress`. */
|
|
16
16
|
remplissage: string;
|
|
17
|
+
/** Arc d'une jauge circulaire `ProgressRing` (trait SVG). */
|
|
18
|
+
trait: string;
|
|
19
|
+
/** Liseré d'un `VerdictPanel` : l'anneau de la carte, teinté. */
|
|
20
|
+
cadre: string;
|
|
21
|
+
/** Pastille du signe d'un `VerdictPanel` : fond à 10 %, signe en
|
|
22
|
+
* couleur. */
|
|
23
|
+
medaillon: string;
|
|
17
24
|
/** `IconToggle` actif, survol et thème sombre compris. */
|
|
18
25
|
basculeActive: string;
|
|
19
26
|
/** Segment choisi d'un `SegmentedControl` : fond, texte et liseré ; fond
|
package/dist/lib/ton.js
CHANGED
|
@@ -6,6 +6,9 @@ var e = {
|
|
|
6
6
|
pastille: "bg-muted-foreground",
|
|
7
7
|
piste: "",
|
|
8
8
|
remplissage: "",
|
|
9
|
+
trait: "stroke-primary",
|
|
10
|
+
cadre: "",
|
|
11
|
+
medaillon: "bg-muted text-muted-foreground",
|
|
9
12
|
basculeActive: "aria-pressed:text-foreground",
|
|
10
13
|
segmentChoisi: ""
|
|
11
14
|
},
|
|
@@ -15,6 +18,9 @@ var e = {
|
|
|
15
18
|
pastille: "bg-info",
|
|
16
19
|
piste: "bg-info/15",
|
|
17
20
|
remplissage: "bg-info",
|
|
21
|
+
trait: "stroke-info",
|
|
22
|
+
cadre: "ring-info/40",
|
|
23
|
+
medaillon: "bg-info/10 text-info",
|
|
18
24
|
basculeActive: "aria-pressed:bg-info/10 aria-pressed:text-info aria-pressed:hover:bg-info/15 aria-pressed:hover:text-info dark:aria-pressed:bg-info/20 dark:aria-pressed:hover:bg-info/25",
|
|
19
25
|
segmentChoisi: "aria-pressed:bg-info/15 aria-pressed:text-info aria-pressed:inset-ring-info/60 dark:aria-pressed:bg-info/25"
|
|
20
26
|
},
|
|
@@ -24,6 +30,9 @@ var e = {
|
|
|
24
30
|
pastille: "bg-success",
|
|
25
31
|
piste: "bg-success/15",
|
|
26
32
|
remplissage: "bg-success",
|
|
33
|
+
trait: "stroke-success",
|
|
34
|
+
cadre: "ring-success/35",
|
|
35
|
+
medaillon: "bg-success/10 text-success",
|
|
27
36
|
basculeActive: "aria-pressed:bg-success/10 aria-pressed:text-success aria-pressed:hover:bg-success/15 aria-pressed:hover:text-success dark:aria-pressed:bg-success/20 dark:aria-pressed:hover:bg-success/25",
|
|
28
37
|
segmentChoisi: "aria-pressed:bg-success/15 aria-pressed:text-success aria-pressed:inset-ring-success/60 dark:aria-pressed:bg-success/25"
|
|
29
38
|
},
|
|
@@ -33,6 +42,9 @@ var e = {
|
|
|
33
42
|
pastille: "bg-warning",
|
|
34
43
|
piste: "bg-warning/15",
|
|
35
44
|
remplissage: "bg-warning",
|
|
45
|
+
trait: "stroke-warning",
|
|
46
|
+
cadre: "ring-warning/40",
|
|
47
|
+
medaillon: "bg-warning/10 text-warning",
|
|
36
48
|
basculeActive: "aria-pressed:bg-warning/10 aria-pressed:text-warning aria-pressed:hover:bg-warning/15 aria-pressed:hover:text-warning dark:aria-pressed:bg-warning/20 dark:aria-pressed:hover:bg-warning/25",
|
|
37
49
|
segmentChoisi: "aria-pressed:bg-warning/15 aria-pressed:text-warning aria-pressed:inset-ring-warning/60 dark:aria-pressed:bg-warning/25"
|
|
38
50
|
},
|
|
@@ -42,6 +54,9 @@ var e = {
|
|
|
42
54
|
pastille: "bg-destructive",
|
|
43
55
|
piste: "bg-destructive/15",
|
|
44
56
|
remplissage: "bg-destructive",
|
|
57
|
+
trait: "stroke-destructive",
|
|
58
|
+
cadre: "ring-destructive/40",
|
|
59
|
+
medaillon: "bg-destructive/10 text-destructive",
|
|
45
60
|
basculeActive: "aria-pressed:bg-destructive/10 aria-pressed:text-destructive aria-pressed:hover:bg-destructive/15 aria-pressed:hover:text-destructive dark:aria-pressed:bg-destructive/20 dark:aria-pressed:hover:bg-destructive/25",
|
|
46
61
|
segmentChoisi: "aria-pressed:bg-destructive/15 aria-pressed:text-destructive aria-pressed:inset-ring-destructive/60 dark:aria-pressed:bg-destructive/25"
|
|
47
62
|
}
|