@etic-insa/ui 0.4.2 → 0.6.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 +182 -51
- package/dist/charts/index.d.ts +1 -0
- package/dist/charts/index.js +1 -0
- package/dist/components/etic/centered-screen.d.ts +19 -1
- package/dist/components/etic/centered-screen.js +35 -3
- package/dist/components/etic/centered-screen.js.map +1 -1
- package/dist/components/etic/data-table-toolbar.d.ts +6 -4
- package/dist/components/etic/data-table-toolbar.js +2 -2
- package/dist/components/etic/data-table-toolbar.js.map +1 -1
- package/dist/components/etic/data-table.d.ts +3 -1
- package/dist/components/etic/data-table.js.map +1 -1
- package/dist/components/etic/dropdown-menu-action.d.ts +30 -0
- package/dist/components/etic/dropdown-menu-action.js +30 -0
- package/dist/components/etic/dropdown-menu-action.js.map +1 -0
- package/dist/components/etic/error-banner.d.ts +44 -10
- package/dist/components/etic/error-banner.js +47 -28
- package/dist/components/etic/error-banner.js.map +1 -1
- package/dist/components/etic/form-dialog.d.ts +8 -1
- package/dist/components/etic/form-dialog.js +92 -60
- package/dist/components/etic/form-dialog.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/page-header.d.ts +2 -1
- package/dist/components/etic/page-header.js +40 -52
- package/dist/components/etic/page-header.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 +29 -8
- package/dist/components/etic/save-bar.js +40 -25
- package/dist/components/etic/save-bar.js.map +1 -1
- 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.js +41 -36
- package/dist/components/ui/sheet.js.map +1 -1
- package/dist/index.d.ts +6 -2
- package/dist/index.js +49 -45
- package/dist/lib/ton.d.ts +7 -0
- package/dist/lib/ton.js +15 -0
- package/dist/lib/ton.js.map +1 -1
- package/dist/testing/index.d.ts +19 -0
- package/dist/testing/index.js +40 -0
- package/dist/testing/index.js.map +1 -0
- package/package.json +28 -3
- package/vite-plugin.d.ts +31 -0
- package/vite-plugin.js +162 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sheet.js","names":["SheetPrimitive","Sheet","props","Dialog","SheetTrigger","SheetClose","SheetPortal","SheetOverlay","cn","className","SheetContent","side","
|
|
1
|
+
{"version":3,"file":"sheet.js","names":["SheetPrimitive","React","Sheet","props","Dialog","SheetTrigger","SheetClose","ContexteCroixSheet","SheetPortal","SheetOverlay","cn","className","SheetContent","side","showCloseButton","Button","XIcon","SheetHeader","croix","SheetFooter","SheetTitle","SheetDescription"],"sources":["../../../src/components/ui/sheet.tsx"],"sourcesContent":["\"use client\"\n\nimport * as React from \"react\"\nimport { Dialog as SheetPrimitive } from \"@base-ui/react/dialog\"\nimport { cn } from \"cn\"\n\nimport { Button } from \"@etic-ui/components/ui/button\"\nimport { XIcon } from \"lucide-react\"\n\nfunction Sheet({ ...props }: SheetPrimitive.Root.Props) {\n return <SheetPrimitive.Root data-slot=\"sheet\" {...props} />\n}\n\nfunction SheetTrigger({ ...props }: SheetPrimitive.Trigger.Props) {\n return <SheetPrimitive.Trigger data-slot=\"sheet-trigger\" {...props} />\n}\n\nfunction SheetClose({ ...props }: SheetPrimitive.Close.Props) {\n return <SheetPrimitive.Close data-slot=\"sheet-close\" {...props} />\n}\n\n// ETIC : le tiroir dit à son en-tête s'il porte la croix, pour que le titre\n// ne passe pas dessous (voir le README, écarts).\nconst ContexteCroixSheet = React.createContext(false)\n\nfunction SheetPortal({ ...props }: SheetPrimitive.Portal.Props) {\n return <SheetPrimitive.Portal data-slot=\"sheet-portal\" {...props} />\n}\n\nfunction SheetOverlay({ className, ...props }: SheetPrimitive.Backdrop.Props) {\n return (\n <SheetPrimitive.Backdrop\n data-slot=\"sheet-overlay\"\n className={cn(\n \"fixed inset-0 z-50 bg-black/10 transition-opacity duration-150 data-ending-style:opacity-0 data-starting-style:opacity-0 supports-backdrop-filter:backdrop-blur-xs\",\n className\n )}\n {...props}\n />\n )\n}\n\nfunction SheetContent({\n className,\n children,\n side = \"right\",\n showCloseButton = true,\n ...props\n}: SheetPrimitive.Popup.Props & {\n side?: \"top\" | \"right\" | \"bottom\" | \"left\"\n showCloseButton?: boolean\n}) {\n return (\n <SheetPortal>\n <SheetOverlay />\n <SheetPrimitive.Popup\n data-slot=\"sheet-content\"\n data-side={side}\n className={cn(\n \"fixed z-50 flex flex-col gap-4 bg-popover bg-clip-padding text-sm text-popover-foreground shadow-lg transition duration-200 ease-in-out data-ending-style:opacity-0 data-starting-style:opacity-0 data-[side=bottom]:inset-x-0 data-[side=bottom]:bottom-0 data-[side=bottom]:h-auto data-[side=bottom]:border-t data-[side=bottom]:data-ending-style:translate-y-[2.5rem] data-[side=bottom]:data-starting-style:translate-y-[2.5rem] data-[side=left]:inset-y-0 data-[side=left]:left-0 data-[side=left]:h-full data-[side=left]:w-3/4 data-[side=left]:border-r data-[side=left]:data-ending-style:translate-x-[-2.5rem] data-[side=left]:data-starting-style:translate-x-[-2.5rem] data-[side=right]:inset-y-0 data-[side=right]:right-0 data-[side=right]:h-full data-[side=right]:w-3/4 data-[side=right]:border-l data-[side=right]:data-ending-style:translate-x-[2.5rem] data-[side=right]:data-starting-style:translate-x-[2.5rem] data-[side=top]:inset-x-0 data-[side=top]:top-0 data-[side=top]:h-auto data-[side=top]:border-b data-[side=top]:data-ending-style:translate-y-[-2.5rem] data-[side=top]:data-starting-style:translate-y-[-2.5rem] data-[side=left]:sm:max-w-sm data-[side=right]:sm:max-w-sm\",\n className\n )}\n {...props}\n >\n <ContexteCroixSheet.Provider value={showCloseButton}>\n {children}\n </ContexteCroixSheet.Provider>\n {showCloseButton && (\n <SheetPrimitive.Close\n data-slot=\"sheet-close\"\n render={\n <Button\n variant=\"ghost\"\n className=\"absolute top-3 right-3\"\n size=\"icon-sm\"\n />\n }\n >\n <XIcon />\n <span className=\"sr-only\">Fermer</span>\n </SheetPrimitive.Close>\n )}\n </SheetPrimitive.Popup>\n </SheetPortal>\n )\n}\n\nfunction SheetHeader({ className, ...props }: React.ComponentProps<\"div\">) {\n const croix = React.useContext(ContexteCroixSheet)\n return (\n <div\n data-slot=\"sheet-header\"\n // ETIC : place de la croix réservée (28 px à 12 px du bord).\n className={cn(\"flex flex-col gap-0.5 p-4\", croix && \"pr-12\", className)}\n {...props}\n />\n )\n}\n\nfunction SheetFooter({ className, ...props }: React.ComponentProps<\"div\">) {\n return (\n <div\n data-slot=\"sheet-footer\"\n className={cn(\"mt-auto flex flex-col gap-2 p-4\", className)}\n {...props}\n />\n )\n}\n\nfunction SheetTitle({ className, ...props }: SheetPrimitive.Title.Props) {\n return (\n <SheetPrimitive.Title\n data-slot=\"sheet-title\"\n className={cn(\n \"font-heading text-base font-medium text-foreground\",\n className\n )}\n {...props}\n />\n )\n}\n\nfunction SheetDescription({\n className,\n ...props\n}: SheetPrimitive.Description.Props) {\n return (\n <SheetPrimitive.Description\n data-slot=\"sheet-description\"\n className={cn(\"text-sm text-muted-foreground\", className)}\n {...props}\n />\n )\n}\n\nexport {\n Sheet,\n SheetTrigger,\n SheetClose,\n SheetContent,\n SheetHeader,\n SheetFooter,\n SheetTitle,\n SheetDescription,\n}\n"],"mappings":";;;;;;;;AASA,SAASE,EAAM,EAAE,GAAGC,KAAoC;CACtD,OAAO,kBAACH,EAAe,MAAhB;EAAqB,aAAU;EAAQ,GAAIG;CAAQ,CAAA;AAC5D;AAEA,SAASE,EAAa,EAAE,GAAGF,KAAuC;CAChE,OAAO,kBAACH,EAAe,SAAhB;EAAwB,aAAU;EAAgB,GAAIG;CAAQ,CAAA;AACvE;AAEA,SAASG,EAAW,EAAE,GAAGH,KAAqC;CAC5D,OAAO,kBAACH,EAAe,OAAhB;EAAsB,aAAU;EAAc,GAAIG;CAAQ,CAAA;AACnE;AAIA,IAAMI,IAAqBN,EAAM,cAAc,EAAK;AAEpD,SAASO,EAAY,EAAE,GAAGL,KAAsC;CAC9D,OAAO,kBAACH,EAAe,QAAhB;EAAuB,aAAU;EAAe,GAAIG;CAAQ,CAAA;AACrE;AAEA,SAASM,EAAa,EAAE,cAAW,GAAGN,KAAwC;CAC5E,OACE,kBAACH,EAAe,UAAhB;EACE,aAAU;EACV,WAAWU,EACT,sKACAC,CACF;EACA,GAAIR;CACL,CAAA;AAEL;AAEA,SAASS,EAAa,EACpB,cACA,aACA,UAAO,SACP,qBAAkB,IAClB,GAAGT,KAIF;CACD,OACE,kBAACK,GAAD,EAAA,UAAA,CACE,kBAACC,GAAD,CAAe,CAAA,GACf,kBAACT,EAAe,OAAhB;EACE,aAAU;EACV,aAAWa;EACX,WAAWH,EACT,6pCACAC,CACF;EACA,GAAIR;EAPN,UAAA,CASE,kBAACI,EAAmB,UAApB;GAA6B,OAAOO;GACjC;EAC0B,CAAA,GAC5BA,KACC,kBAACd,EAAe,OAAhB;GACE,aAAU;GACV,QACE,kBAACe,GAAD;IACE,SAAQ;IACR,WAAU;IACV,MAAK;GACN,CAAA;GAPL,UAAA,CAUE,kBAACC,GAAD,CAAQ,CAAA,GACR,kBAAC,QAAD;IAAM,WAAU;IAAU,UAAA;GAAY,CAAA,CAClB;EAEJ,CAAA,CAAA;CACX,CAAA,CAAA,EAAA,CAAA;AAEjB;AAEA,SAASC,EAAY,EAAE,cAAW,GAAGd,KAAsC;CACzE,IAAMe,IAAQjB,EAAM,WAAWM,CAAkB;CACjD,OACE,kBAAC,OAAD;EACE,aAAU;EAEV,WAAWG,EAAG,6BAA6BQ,KAAS,SAASP,CAAS;EACtE,GAAIR;CACL,CAAA;AAEL;AAEA,SAASgB,EAAY,EAAE,cAAW,GAAGhB,KAAsC;CACzE,OACE,kBAAC,OAAD;EACE,aAAU;EACV,WAAWO,EAAG,mCAAmCC,CAAS;EAC1D,GAAIR;CACL,CAAA;AAEL;AAEA,SAASiB,EAAW,EAAE,cAAW,GAAGjB,KAAqC;CACvE,OACE,kBAACH,EAAe,OAAhB;EACE,aAAU;EACV,WAAWU,EACT,sDACAC,CACF;EACA,GAAIR;CACL,CAAA;AAEL;AAEA,SAASkB,EAAiB,EACxB,cACA,GAAGlB,KACgC;CACnC,OACE,kBAACH,EAAe,aAAhB;EACE,aAAU;EACV,WAAWU,EAAG,iCAAiCC,CAAS;EACxD,GAAIR;CACL,CAAA;AAEL"}
|
package/dist/index.d.ts
CHANGED
|
@@ -56,15 +56,16 @@ export type { ActionDialogue } from './components/etic/action';
|
|
|
56
56
|
export { fermerSaufEnCours } from './components/etic/action';
|
|
57
57
|
export { AuthAvatar, type AuthAvatarProps, AuthImage, type AuthImageCharger, type AuthImageProps, type AuthObjectUrlEtat, useAuthObjectUrl, useAuthObjectUrlEtat, } from './components/etic/auth-image';
|
|
58
58
|
export { ButtonLink, type ButtonLinkProps } from './components/etic/button-link';
|
|
59
|
-
export { CenteredScreen, type CenteredScreenProps, } from './components/etic/centered-screen';
|
|
59
|
+
export { CenteredScreen, type CenteredScreenProps, MessageScreen, type MessageScreenProps, } from './components/etic/centered-screen';
|
|
60
60
|
export { ConfirmDialog, type ConfirmDialogProps, type ConfirmDialogSaisie, type ConfirmDialogTaille, type DialogFinalFocus, } from './components/etic/confirm-dialog';
|
|
61
61
|
export { CopyButton, type CopyButtonProps } from './components/etic/copy-button';
|
|
62
62
|
export { DeleteButton, type DeleteButtonProps, } from './components/etic/delete-button';
|
|
63
63
|
export { DetailItem, type DetailItemProps, DetailList, type DetailListProps, type DetailListDisposition, } from './components/etic/detail-list';
|
|
64
64
|
export { Disclosure, type DisclosureProps, type DisclosureTaille, DisclosureTrigger, type DisclosureTriggerProps, type DisclosureVariante, } from './components/etic/disclosure';
|
|
65
|
+
export { DropdownMenuAction, type DropdownMenuActionProps, } from './components/etic/dropdown-menu-action';
|
|
65
66
|
export { DraftResumeDialog, type DraftResumeDialogProps, } from './components/etic/draft-resume-dialog';
|
|
66
67
|
export { EmptyState, type EmptyStateProps } from './components/etic/empty-state';
|
|
67
|
-
export { ErrorBanner, type ErrorBannerProps, } from './components/etic/error-banner';
|
|
68
|
+
export { BoutonReessayer, type BoutonReessayerProps, decrireErreur, DetailTechnique, type ErreurDecrite, ErrorBanner, type ErrorBannerProps, ErrorBannerProvider, type ErrorBannerProviderProps, } from './components/etic/error-banner';
|
|
68
69
|
export { ErrorBoundary, type ErrorBoundaryProps, } from './components/etic/error-boundary';
|
|
69
70
|
export { FormDialog, type FormDialogActionSecondaire, type FormDialogProps, type FormDialogTaille, } from './components/etic/form-dialog';
|
|
70
71
|
export { IconToggle, type IconToggleProps } from './components/etic/icon-toggle';
|
|
@@ -74,12 +75,15 @@ export { PageContainer, type PageContainerLargeur, type PageContainerProps, } fr
|
|
|
74
75
|
export { QueryBoundary, type QueryBoundaryProps, type QueryBoundaryRequete, QueryErrorBanner, type QueryErrorBannerProps, } from './components/etic/query-boundary';
|
|
75
76
|
export { SectionCard, type SectionCardProps, } from './components/etic/section-card';
|
|
76
77
|
export { StatTile, type StatTileProps } from './components/etic/stat-tile';
|
|
78
|
+
export { ProgressRing, type ProgressRingProps, } from './components/etic/progress-ring';
|
|
79
|
+
export { VerdictPanel, type VerdictPanelProps, } from './components/etic/verdict-panel';
|
|
77
80
|
export { type LongueurCss, StatGrid, type StatGridProps, } from './components/etic/stat-grid';
|
|
78
81
|
export { StatusBadge, type StatusBadgeProps, type StatusTon, } from './components/etic/status-badge';
|
|
79
82
|
export { RemovableBadge, type RemovableBadgeProps, } from './components/etic/removable-badge';
|
|
80
83
|
export { ExplainedBadge, type ExplainedBadgeProps, } from './components/etic/explained-badge';
|
|
81
84
|
export { Toggletip, type ToggletipProps } from './components/etic/toggletip';
|
|
82
85
|
export { SaveBar, type SaveBarProps } from './components/etic/save-bar';
|
|
86
|
+
export { ResetButton, type ResetButtonProps, } from './components/etic/reset-button';
|
|
83
87
|
export { TooltipButton, type TooltipButtonProps, } from './components/etic/tooltip-button';
|
|
84
88
|
export { type UnsavedChangesBlocage, UnsavedChangesDialog, type UnsavedChangesDialogProps, } from './components/etic/unsaved-changes';
|
|
85
89
|
export { useUnsavedChangesWarning } from './components/etic/use-unsaved-changes-warning';
|
package/dist/index.js
CHANGED
|
@@ -54,48 +54,52 @@ import { appliquerTheme as Lr, useThemeApplique as Rr } from "./theme.js";
|
|
|
54
54
|
import { fermerSaufEnCours as zr } from "./components/etic/action.js";
|
|
55
55
|
import { AuthAvatar as Br, AuthImage as Vr, useAuthObjectUrl as Hr, useAuthObjectUrlEtat as Ur } from "./components/etic/auth-image.js";
|
|
56
56
|
import { ButtonLink as Wr } from "./components/etic/button-link.js";
|
|
57
|
-
import { CenteredScreen as Gr } from "./components/etic/centered-screen.js";
|
|
58
|
-
import { ConfirmDialog as
|
|
59
|
-
import { CopyButton as
|
|
60
|
-
import { DeleteButton as
|
|
61
|
-
import { DetailItem as
|
|
62
|
-
import { Disclosure as
|
|
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
|
-
|
|
57
|
+
import { CenteredScreen as Gr, MessageScreen as Kr } from "./components/etic/centered-screen.js";
|
|
58
|
+
import { ConfirmDialog as qr } from "./components/etic/confirm-dialog.js";
|
|
59
|
+
import { CopyButton as Jr } from "./components/etic/copy-button.js";
|
|
60
|
+
import { DeleteButton as Yr } from "./components/etic/delete-button.js";
|
|
61
|
+
import { DetailItem as Xr, DetailList as Zr } from "./components/etic/detail-list.js";
|
|
62
|
+
import { Disclosure as Qr, DisclosureTrigger as $r } from "./components/etic/disclosure.js";
|
|
63
|
+
import { DropdownMenuAction as ei } from "./components/etic/dropdown-menu-action.js";
|
|
64
|
+
import { DraftResumeDialog as ti } from "./components/etic/draft-resume-dialog.js";
|
|
65
|
+
import { EmptyState as ni } from "./components/etic/empty-state.js";
|
|
66
|
+
import { BoutonReessayer as ri, DetailTechnique as ii, ErrorBanner as ai, ErrorBannerProvider as oi, decrireErreur as si } from "./components/etic/error-banner.js";
|
|
67
|
+
import { ErrorBoundary as ci } from "./components/etic/error-boundary.js";
|
|
68
|
+
import { FormDialog as li } from "./components/etic/form-dialog.js";
|
|
69
|
+
import { IconToggle as ui } from "./components/etic/icon-toggle.js";
|
|
70
|
+
import { Loading as di, SkeletonCard as fi, SkeletonPage as pi, SkeletonTable as mi } from "./components/etic/loading.js";
|
|
71
|
+
import { DetailHeader as hi, PageHeader as gi } from "./components/etic/page-header.js";
|
|
72
|
+
import { PageContainer as _i } from "./components/etic/page-container.js";
|
|
73
|
+
import { QueryBoundary as vi, QueryErrorBanner as yi } from "./components/etic/query-boundary.js";
|
|
74
|
+
import { SectionCard as bi } from "./components/etic/section-card.js";
|
|
75
|
+
import { StatTile as xi } from "./components/etic/stat-tile.js";
|
|
76
|
+
import { ProgressRing as Si } from "./components/etic/progress-ring.js";
|
|
77
|
+
import { VerdictPanel as Ci } from "./components/etic/verdict-panel.js";
|
|
78
|
+
import { StatGrid as wi } from "./components/etic/stat-grid.js";
|
|
79
|
+
import { StatusBadge as Ti } from "./components/etic/status-badge.js";
|
|
80
|
+
import { RemovableBadge as Ei } from "./components/etic/removable-badge.js";
|
|
81
|
+
import { ExplainedBadge as Di } from "./components/etic/explained-badge.js";
|
|
82
|
+
import { Toggletip as Oi } from "./components/etic/toggletip.js";
|
|
83
|
+
import { SaveBar as ki } from "./components/etic/save-bar.js";
|
|
84
|
+
import { ResetButton as Ai } from "./components/etic/reset-button.js";
|
|
85
|
+
import { TooltipButton as ji } from "./components/etic/tooltip-button.js";
|
|
86
|
+
import { UnsavedChangesDialog as Mi } from "./components/etic/unsaved-changes.js";
|
|
87
|
+
import { useUnsavedChangesWarning as Ni } from "./components/etic/use-unsaved-changes-warning.js";
|
|
88
|
+
import { FormField as Pi, FormSection as Fi, RequiredMark as Ii } from "./components/etic/form-field.js";
|
|
89
|
+
import { useFormField as Li } from "./components/etic/form-field-context.js";
|
|
90
|
+
import { DatePicker as Ri } from "./components/etic/date-picker.js";
|
|
91
|
+
import { PhoneInput as zi, formaterTelephone as Bi } from "./components/etic/phone-input.js";
|
|
92
|
+
import { FileDropZone as Vi, FileUploadButton as Hi } from "./components/etic/file-upload.js";
|
|
93
|
+
import { SegmentedControl as Ui } from "./components/etic/segmented-control.js";
|
|
94
|
+
import { CheckboxList as Wi } from "./components/etic/checkbox-list.js";
|
|
95
|
+
import { useDraftAutosave as Gi } from "./components/etic/use-draft-autosave.js";
|
|
96
|
+
import { SearchSelect as Ki } from "./components/etic/search-select.js";
|
|
97
|
+
import { DataTable as qi, DataTableCellLink as Ji, DataTableColumnHeader as Yi, DataTableRowActions as Xi, createDataTableColumnHelper as Zi, dataTableActionsColumn as Qi, dataTableExpandColumn as $i, dataTableFeatures as ea, dataTableSelectionColumn as ta, useDataTable as na } from "./components/etic/data-table.js";
|
|
98
|
+
import { focaliserTableau as ra } from "./components/etic/data-table-focus.js";
|
|
99
|
+
import { DataTableBulkActions as ia } from "./components/etic/data-table-bulk-actions.js";
|
|
100
|
+
import { DataTablePagination as aa } from "./components/etic/data-table-pagination.js";
|
|
101
|
+
import { DataTableCount as oa, DataTableSelectFilter as sa, DataTableToolbar as ca } from "./components/etic/data-table-toolbar.js";
|
|
102
|
+
import { DataTableViewOptions as la } from "./components/etic/data-table-view-options.js";
|
|
103
|
+
import { PorteeStockageLocal as ua, usePersistedState as da } from "./hooks/use-persisted-state.js";
|
|
104
|
+
import { useColumnPrefs as fa } from "./hooks/use-column-prefs.js";
|
|
105
|
+
export { T as Alert, E as AlertAction, D as AlertDescription, k as AlertDialog, A as AlertDialogAction, j as AlertDialogCancel, M as AlertDialogContent, N as AlertDialogDescription, P as AlertDialogFooter, F as AlertDialogHeader, I as AlertDialogMedia, L as AlertDialogOverlay, R as AlertDialogPortal, z as AlertDialogTitle, B as AlertDialogTrigger, O as AlertTitle, Nr as AppShell, Br as AuthAvatar, Vr as AuthImage, V as Avatar, H as AvatarBadge, U as AvatarFallback, W as AvatarGroup, G as AvatarGroupCount, K as AvatarImage, q as Badge, ri as BoutonReessayer, Y as Breadcrumb, X as BreadcrumbEllipsis, Z as BreadcrumbItem, Q as BreadcrumbLink, $ as BreadcrumbList, ee as BreadcrumbPage, te as BreadcrumbSeparator, ne as Button, ie as ButtonGroup, ae as ButtonGroupSeparator, oe as ButtonGroupText, Wr as ButtonLink, ce as Calendar, le as CalendarDayButton, ue as Card, de as CardAction, fe as CardContent, pe as CardDescription, me as CardFooter, he as CardHeader, ge as CardTitle, Gr as CenteredScreen, _e as Checkbox, Wi as CheckboxList, ve as Collapsible, ye as CollapsibleContent, be as CollapsibleTrigger, xe as Combobox, Se as ComboboxChip, Ce as ComboboxChips, we as ComboboxChipsInput, Te as ComboboxCollection, Ee as ComboboxContent, De as ComboboxEmpty, Oe as ComboboxGroup, ke as ComboboxInput, Ae as ComboboxItem, je as ComboboxLabel, Me as ComboboxList, Ne as ComboboxSeparator, Pe as ComboboxTrigger, Fe as ComboboxValue, qr as ConfirmDialog, Jr as CopyButton, qi as DataTable, ia as DataTableBulkActions, Ji as DataTableCellLink, Yi as DataTableColumnHeader, oa as DataTableCount, aa as DataTablePagination, Xi as DataTableRowActions, sa as DataTableSelectFilter, ca as DataTableToolbar, la as DataTableViewOptions, Ri as DatePicker, Yr as DeleteButton, hi as DetailHeader, Xr as DetailItem, Zr as DetailList, ii as DetailTechnique, Le as Dialog, Re as DialogBody, ze as DialogClose, Be as DialogContent, Ve as DialogDescription, He as DialogFooter, Ue as DialogHeader, We as DialogOverlay, Ge as DialogPortal, Ke as DialogTitle, qe as DialogTrigger, Qr as Disclosure, $r as DisclosureTrigger, ti as DraftResumeDialog, Je as DropdownMenu, ei as DropdownMenuAction, Ye as DropdownMenuCheckboxItem, Xe as DropdownMenuContent, Ze as DropdownMenuGroup, Qe as DropdownMenuItem, $e as DropdownMenuLabel, et as DropdownMenuPortal, tt as DropdownMenuRadioGroup, nt as DropdownMenuRadioItem, rt as DropdownMenuSeparator, it as DropdownMenuShortcut, at as DropdownMenuSub, ot as DropdownMenuSubContent, st as DropdownMenuSubTrigger, ct as DropdownMenuTrigger, lt as Empty, ut as EmptyContent, dt as EmptyDescription, ft as EmptyHeader, pt as EmptyMedia, ni as EmptyState, mt as EmptyTitle, ai as ErrorBanner, oi as ErrorBannerProvider, ci as ErrorBoundary, Di as ExplainedBadge, ht as Field, gt as FieldContent, _t as FieldDescription, vt as FieldError, yt as FieldGroup, bt as FieldLabel, xt as FieldLegend, St as FieldSeparator, Ct as FieldSet, wt as FieldTitle, Vi as FileDropZone, Hi as FileUploadButton, li as FormDialog, Pi as FormField, Fi as FormSection, ui as IconToggle, Tt as Input, Et as InputGroup, Dt as InputGroupAddon, Ot as InputGroupButton, kt as InputGroupInput, At as InputGroupText, jt as InputGroupTextarea, Mt as Item, Nt as ItemActions, Pt as ItemContent, Ft as ItemDescription, It as ItemFooter, Lt as ItemGroup, Rt as ItemHeader, zt as ItemMedia, Bt as ItemSeparator, Vt as ItemTitle, Ht as Kbd, Ut as KbdGroup, Wt as Label, Pr as LienProvider, di as Loading, t as MOBILE_MEDIA_QUERY, Kr as MessageScreen, S as NO_AUTOFILL, Gt as NativeSelect, Kt as NativeSelectOptGroup, qt as NativeSelectOption, _i as PageContainer, gi as PageHeader, Jt as Pagination, Yt as PaginationContent, Xt as PaginationEllipsis, Zt as PaginationItem, Qt as PaginationLink, $t as PaginationNext, en as PaginationPrevious, zi as PhoneInput, tn as Popover, nn as PopoverContent, rn as PopoverDescription, an as PopoverHeader, on as PopoverTitle, sn as PopoverTrigger, ua as PorteeStockageLocal, cn as Progress, ln as ProgressIndicator, un as ProgressLabel, Si as ProgressRing, dn as ProgressTrack, fn as ProgressValue, vi as QueryBoundary, yi as QueryErrorBanner, pn as RadioGroup, mn as RadioGroupItem, Ei as RemovableBadge, Ii as RequiredMark, Ai as ResetButton, ki as SaveBar, hn as ScrollArea, gn as ScrollBar, Ki as SearchSelect, bi as SectionCard, Ui as SegmentedControl, _n as Select, vn as SelectContent, yn as SelectGroup, bn as SelectItem, xn as SelectLabel, Sn as SelectScrollDownButton, Cn as SelectScrollUpButton, wn as SelectSeparator, Tn as SelectTrigger, En as SelectValue, Dn as Separator, On as Sheet, kn as SheetClose, An as SheetContent, jn as SheetDescription, Mn as SheetFooter, Nn as SheetHeader, Pn as SheetTitle, Fn as SheetTrigger, In as Sidebar, Ln as SidebarContent, Rn as SidebarFooter, zn as SidebarGroup, Bn as SidebarGroupAction, Vn as SidebarGroupContent, Hn as SidebarGroupLabel, Un as SidebarHeader, Wn as SidebarInput, Gn as SidebarInset, Kn as SidebarMenu, qn as SidebarMenuAction, Jn as SidebarMenuBadge, Yn as SidebarMenuButton, Xn as SidebarMenuItem, Zn as SidebarMenuSkeleton, Qn as SidebarMenuSub, $n as SidebarMenuSubButton, er as SidebarMenuSubItem, tr as SidebarProvider, nr as SidebarRail, rr as SidebarSeparator, ir as SidebarTrigger, or as Skeleton, fi as SkeletonCard, pi as SkeletonPage, mi as SkeletonTable, sr as Slider, cr as Spinner, lr as SpinnerDecoratif, wi as StatGrid, xi as StatTile, Ti as StatusBadge, ur as Switch, dr as Table, fr as TableBody, pr as TableCaption, mr as TableCell, hr as TableFooter, gr as TableHead, _r as TableHeader, vr as TableRow, yr as Tabs, br as TabsContent, xr as TabsList, Sr as TabsTrigger, wr as Textarea, Ir as ThemeMenu, Tr as Toggle, Dr as ToggleGroup, Or as ToggleGroupItem, Oi as Toggletip, kr as Tooltip, ji as TooltipButton, Ar as TooltipContent, jr as TooltipProvider, Mr as TooltipTrigger, Mi as UnsavedChangesDialog, Ci as VerdictPanel, r as accorde, Lr as appliquerTheme, J as badgeVariants, se as buttonGroupVariants, re as buttonVariants, e as cn, v as comparerFr, i as compte, y as correspondance, Zi as createDataTableColumnHelper, Qi as dataTableActionsColumn, $i as dataTableExpandColumn, ea as dataTableFeatures, ta as dataTableSelectionColumn, si as decrireErreur, g as ecrireDateIso, zr as fermerSaufEnCours, ra as focaliserTableau, a as formaterAnciennete, o as formaterDate, s as formaterDateHeure, c as formaterDateHeureLongue, l as formaterDuree, u as formaterDureeArrondie, d as formaterHorodatage, f as formaterOctets, Bi as formaterTelephone, _ as lireDateIso, p as nombreFr, b as normaliser, x as normaliserRecherche, m as participe, Cr as tabsListVariants, Er as toggleVariants, h as uniteAccordee, Hr as useAuthObjectUrl, Ur as useAuthObjectUrlEtat, fa as useColumnPrefs, Ie as useComboboxAnchor, na as useDataTable, C as useDebouncedValue, w as useDocumentTitle, Gi as useDraftAutosave, Li as useFormField, n as useIsMobile, Fr as useLien, da as usePersistedState, ar as useSidebar, Rr as useThemeApplique, Ni as useUnsavedChangesWarning };
|
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
|
}
|
package/dist/lib/ton.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ton.js","names":["TONS"],"sources":["../../src/lib/ton.ts"],"sourcesContent":["/**\n * Les tons d'état de la suite et leurs classes, à un seul endroit : un ton\n * s'ajoute ici, et tous les composants qui en ont un (`StatusBadge`,\n * `StatTile`, `Progress`, `
|
|
1
|
+
{"version":3,"file":"ton.js","names":["TONS"],"sources":["../../src/lib/ton.ts"],"sourcesContent":["/**\n * Les tons d'état de la suite et leurs classes, à un seul endroit : un ton\n * s'ajoute ici, et tous les composants qui en ont un (`StatusBadge`,\n * `StatTile`, `Progress`, `ProgressRing`, `VerdictPanel`, `IconToggle`,\n * `SegmentedControl`) le reçoivent.\n *\n * Les classes sont écrites en entier (pas de `bg-${ton}`) : Tailwind ne\n * détecte que les classes littérales.\n */\n\nimport type { VariantProps } from \"class-variance-authority\"\n\nimport type { badgeVariants } from \"@etic-ui/components/ui/badge\"\n\n/** Ce que dit un état : bon, à surveiller, en échec, une information (un\n * changement sans gravité), ou rien de particulier. */\nexport type StatusTon =\n \"neutral\" | \"info\" | \"success\" | \"warning\" | \"destructive\"\n\nexport interface ClassesTon {\n /** Variante du `Badge` (`StatusBadge`). */\n badge: NonNullable<VariantProps<typeof badgeVariants>[\"variant\"]>\n /** Texte de la couleur du ton (valeur d'une `StatTile`). */\n texte: string\n /** Pastille pleine, qui double la couleur du texte. */\n pastille: string\n /** Piste d'une jauge `Progress` (teinte à 15 %). */\n piste: string\n /** Remplissage d'une jauge `Progress`. */\n remplissage: string\n /** Arc d'une jauge circulaire `ProgressRing` (trait SVG). */\n trait: string\n /** Liseré d'un `VerdictPanel` : l'anneau de la carte, teinté. */\n cadre: string\n /** Pastille du signe d'un `VerdictPanel` : fond à 10 %, signe en\n * couleur. */\n medaillon: string\n /** `IconToggle` actif, survol et thème sombre compris. */\n basculeActive: string\n /** Segment choisi d'un `SegmentedControl` : fond, texte et liseré ; fond\n * plus soutenu en sombre (+10 %, comme `basculeActive` et `Badge`). */\n segmentChoisi: string\n}\n\nexport const TONS: Record<StatusTon, ClassesTon> = {\n // « neutral » garde l'apparence par défaut de chaque composant.\n neutral: {\n badge: \"secondary\",\n texte: \"\",\n pastille: \"bg-muted-foreground\",\n piste: \"\",\n remplissage: \"\",\n trait: \"stroke-primary\",\n cadre: \"\",\n medaillon: \"bg-muted text-muted-foreground\",\n basculeActive: \"aria-pressed:text-foreground\",\n segmentChoisi: \"\",\n },\n info: {\n badge: \"info\",\n texte: \"text-info\",\n pastille: \"bg-info\",\n piste: \"bg-info/15\",\n remplissage: \"bg-info\",\n trait: \"stroke-info\",\n cadre: \"ring-info/40\",\n medaillon: \"bg-info/10 text-info\",\n basculeActive:\n \"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\",\n segmentChoisi:\n \"aria-pressed:bg-info/15 aria-pressed:text-info aria-pressed:inset-ring-info/60 dark:aria-pressed:bg-info/25\",\n },\n success: {\n badge: \"success\",\n texte: \"text-success\",\n pastille: \"bg-success\",\n piste: \"bg-success/15\",\n remplissage: \"bg-success\",\n trait: \"stroke-success\",\n cadre: \"ring-success/35\",\n medaillon: \"bg-success/10 text-success\",\n basculeActive:\n \"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\",\n segmentChoisi:\n \"aria-pressed:bg-success/15 aria-pressed:text-success aria-pressed:inset-ring-success/60 dark:aria-pressed:bg-success/25\",\n },\n warning: {\n badge: \"warning\",\n texte: \"text-warning\",\n pastille: \"bg-warning\",\n piste: \"bg-warning/15\",\n remplissage: \"bg-warning\",\n trait: \"stroke-warning\",\n cadre: \"ring-warning/40\",\n medaillon: \"bg-warning/10 text-warning\",\n basculeActive:\n \"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\",\n segmentChoisi:\n \"aria-pressed:bg-warning/15 aria-pressed:text-warning aria-pressed:inset-ring-warning/60 dark:aria-pressed:bg-warning/25\",\n },\n destructive: {\n badge: \"destructive\",\n texte: \"text-destructive\",\n pastille: \"bg-destructive\",\n piste: \"bg-destructive/15\",\n remplissage: \"bg-destructive\",\n trait: \"stroke-destructive\",\n cadre: \"ring-destructive/40\",\n medaillon: \"bg-destructive/10 text-destructive\",\n basculeActive:\n \"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\",\n segmentChoisi:\n \"aria-pressed:bg-destructive/15 aria-pressed:text-destructive aria-pressed:inset-ring-destructive/60 dark:aria-pressed:bg-destructive/25\",\n },\n}\n"],"mappings":";AA4CA,IAAaA,IAAsC;CAEjD,SAAS;EACP,OAAO;EACP,OAAO;EACP,UAAU;EACV,OAAO;EACP,aAAa;EACb,OAAO;EACP,OAAO;EACP,WAAW;EACX,eAAe;EACf,eAAe;CACjB;CACA,MAAM;EACJ,OAAO;EACP,OAAO;EACP,UAAU;EACV,OAAO;EACP,aAAa;EACb,OAAO;EACP,OAAO;EACP,WAAW;EACX,eACE;EACF,eACE;CACJ;CACA,SAAS;EACP,OAAO;EACP,OAAO;EACP,UAAU;EACV,OAAO;EACP,aAAa;EACb,OAAO;EACP,OAAO;EACP,WAAW;EACX,eACE;EACF,eACE;CACJ;CACA,SAAS;EACP,OAAO;EACP,OAAO;EACP,UAAU;EACV,OAAO;EACP,aAAa;EACb,OAAO;EACP,OAAO;EACP,WAAW;EACX,eACE;EACF,eACE;CACJ;CACA,aAAa;EACX,OAAO;EACP,OAAO;EACP,UAAU;EACV,OAAO;EACP,aAAa;EACb,OAAO;EACP,OAAO;EACP,WAAW;EACX,eACE;EACF,eACE;CACJ;AACF"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Passe l'affichage en mobile (`true`) ou en bureau (`false`) pour la
|
|
3
|
+
* doublure posée par {@link installMatchMedia}. Les composants abonnés
|
|
4
|
+
* (`useIsMobile`, `AppShell`…) se redessinent aussitôt : sur un composant
|
|
5
|
+
* déjà monté, l'appeler dans un `act()`.
|
|
6
|
+
*/
|
|
7
|
+
export declare function setMobileViewport(valeur: boolean): void;
|
|
8
|
+
/**
|
|
9
|
+
* Remplace `window.matchMedia` par une doublure pilotable : le `matchMedia`
|
|
10
|
+
* de jsdom n'existe pas, celui de happy-dom suit une fenêtre fixe de
|
|
11
|
+
* 1 024 px, donc mobile pour la bibliothèque. Seule la requête de
|
|
12
|
+
* `useIsMobile` (`MOBILE_MEDIA_QUERY`) est connue ; toute autre est réputée
|
|
13
|
+
* ne pas correspondre. Affichage de bureau au départ.
|
|
14
|
+
*
|
|
15
|
+
* À appeler une fois dans le fichier de mise en place des tests, avec
|
|
16
|
+
* `beforeEach(() => setMobileViewport(false))` pour que chaque test parte du
|
|
17
|
+
* bureau.
|
|
18
|
+
*/
|
|
19
|
+
export declare function installMatchMedia(): void;
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { MOBILE_MEDIA_QUERY as e } from "../hooks/use-mobile.js";
|
|
2
|
+
// src/testing/index.ts
|
|
3
|
+
var t = /* @__PURE__ */ new Set(), n = !1;
|
|
4
|
+
function r(r) {
|
|
5
|
+
if (n === r) return;
|
|
6
|
+
n = r;
|
|
7
|
+
let i = {
|
|
8
|
+
matches: r,
|
|
9
|
+
media: e
|
|
10
|
+
};
|
|
11
|
+
for (let e of t) e(i);
|
|
12
|
+
}
|
|
13
|
+
function i() {
|
|
14
|
+
Object.defineProperty(window, "matchMedia", {
|
|
15
|
+
configurable: !0,
|
|
16
|
+
writable: !0,
|
|
17
|
+
value: (r) => {
|
|
18
|
+
let i = r === e;
|
|
19
|
+
return {
|
|
20
|
+
media: r,
|
|
21
|
+
get matches() {
|
|
22
|
+
return i && n;
|
|
23
|
+
},
|
|
24
|
+
onchange: null,
|
|
25
|
+
addEventListener: (e, n) => {
|
|
26
|
+
i && typeof n == "function" && t.add(n);
|
|
27
|
+
},
|
|
28
|
+
removeEventListener: (e, n) => {
|
|
29
|
+
typeof n == "function" && t.delete(n);
|
|
30
|
+
},
|
|
31
|
+
addListener: () => {},
|
|
32
|
+
removeListener: () => {},
|
|
33
|
+
dispatchEvent: () => !1
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
export { i as installMatchMedia, r as setMobileViewport };
|
|
39
|
+
|
|
40
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","names":["ecouteurs","mobile","setMobileViewport","valeur","evenement","MOBILE_MEDIA_QUERY","ecouteur","installMatchMedia","estMobile","media"],"sources":["../../src/testing/index.ts"],"sourcesContent":["// Outils de test des applications : `@etic-insa/ui/test`. Hors de l'index\n// principal, ils n'entrent jamais dans le bundle d'une application.\nimport { MOBILE_MEDIA_QUERY } from \"@etic-ui/hooks/use-mobile\"\n\ntype Ecouteur = (evenement: MediaQueryListEvent) => void\n\nconst ecouteurs = new Set<Ecouteur>()\nlet mobile = false\n\n/**\n * Passe l'affichage en mobile (`true`) ou en bureau (`false`) pour la\n * doublure posée par {@link installMatchMedia}. Les composants abonnés\n * (`useIsMobile`, `AppShell`…) se redessinent aussitôt : sur un composant\n * déjà monté, l'appeler dans un `act()`.\n */\nexport function setMobileViewport(valeur: boolean): void {\n if (mobile === valeur) return\n mobile = valeur\n const evenement = {\n matches: valeur,\n media: MOBILE_MEDIA_QUERY,\n } as MediaQueryListEvent\n for (const ecouteur of ecouteurs) ecouteur(evenement)\n}\n\n/**\n * Remplace `window.matchMedia` par une doublure pilotable : le `matchMedia`\n * de jsdom n'existe pas, celui de happy-dom suit une fenêtre fixe de\n * 1 024 px, donc mobile pour la bibliothèque. Seule la requête de\n * `useIsMobile` (`MOBILE_MEDIA_QUERY`) est connue ; toute autre est réputée\n * ne pas correspondre. Affichage de bureau au départ.\n *\n * À appeler une fois dans le fichier de mise en place des tests, avec\n * `beforeEach(() => setMobileViewport(false))` pour que chaque test parte du\n * bureau.\n */\nexport function installMatchMedia(): void {\n const matchMedia = (media: string): MediaQueryList => {\n const estMobile = media === MOBILE_MEDIA_QUERY\n return {\n media,\n // Un accesseur, pas une valeur : une liste gardée reflète l'état\n // courant à chaque lecture.\n get matches() {\n return estMobile && mobile\n },\n onchange: null,\n addEventListener: (\n _type: string,\n ecouteur: EventListenerOrEventListenerObject\n ) => {\n if (estMobile && typeof ecouteur === \"function\")\n ecouteurs.add(ecouteur as Ecouteur)\n },\n removeEventListener: (\n _type: string,\n ecouteur: EventListenerOrEventListenerObject\n ) => {\n if (typeof ecouteur === \"function\")\n ecouteurs.delete(ecouteur as Ecouteur)\n },\n // API historique, exigée par le type.\n addListener: () => {},\n removeListener: () => {},\n dispatchEvent: () => false,\n } as MediaQueryList\n }\n Object.defineProperty(window, \"matchMedia\", {\n configurable: true,\n writable: true,\n value: matchMedia,\n })\n}\n"],"mappings":";;AAMA,IAAMA,oBAAY,IAAI,IAAc,GAChCC,IAAS;AAQb,SAAgBC,EAAkB,GAAuB;CACvD,IAAID,MAAWE,GAAQ;CACvB,IAASA;CACT,IAAMC,IAAY;EAChB,SAASD;EACT,OAAOE;CACT;CACA,KAAK,IAAMC,KAAYN,GAAW,EAASI,CAAS;AACtD;AAaA,SAAgBG,IAA0B;CA+BxC,OAAO,eAAe,QAAQ,cAAc;EAC1C,cAAc;EACd,UAAU;EACV,QAjCkB,MAAkC;GACpD,IAAMC,IAAYC,MAAUJ;GAC5B,OAAO;IACL;IAGA,IAAI,UAAU;KACZ,OAAOG,KAAaP;IACtB;IACA,UAAU;IACV,mBACE,GACA,MACG;KACH,AAAIO,KAAa,OAAOF,KAAa,cACnCN,EAAU,IAAIM,CAAoB;IACtC;IACA,sBACE,GACA,MACG;KACH,AAAI,OAAOA,KAAa,cACtBN,EAAU,OAAOM,CAAoB;IACzC;IAEA,mBAAmB,CAAC;IACpB,sBAAsB,CAAC;IACvB,qBAAqB;GACvB;EACF;CAKA,CAAC;AACH"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@etic-insa/ui",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.6.0",
|
|
4
4
|
"description": "Bibliothèque de composants React des applications ETIC, construite sur shadcn et Base UI.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -17,13 +17,27 @@
|
|
|
17
17
|
"types": "./dist/index.d.ts",
|
|
18
18
|
"default": "./dist/index.js"
|
|
19
19
|
},
|
|
20
|
+
"./test": {
|
|
21
|
+
"types": "./dist/testing/index.d.ts",
|
|
22
|
+
"default": "./dist/testing/index.js"
|
|
23
|
+
},
|
|
24
|
+
"./charts": {
|
|
25
|
+
"types": "./dist/charts/index.d.ts",
|
|
26
|
+
"default": "./dist/charts/index.js"
|
|
27
|
+
},
|
|
28
|
+
"./vite": {
|
|
29
|
+
"types": "./vite-plugin.d.ts",
|
|
30
|
+
"default": "./vite-plugin.js"
|
|
31
|
+
},
|
|
20
32
|
"./styles.css": "./dist/styles.css",
|
|
21
33
|
"./theme-boot.js": "./src/theme-boot.js",
|
|
22
34
|
"./package.json": "./package.json"
|
|
23
35
|
},
|
|
24
36
|
"files": [
|
|
25
37
|
"dist",
|
|
26
|
-
"src/theme-boot.js"
|
|
38
|
+
"src/theme-boot.js",
|
|
39
|
+
"vite-plugin.js",
|
|
40
|
+
"vite-plugin.d.ts"
|
|
27
41
|
],
|
|
28
42
|
"publishConfig": {
|
|
29
43
|
"access": "public",
|
|
@@ -40,7 +54,17 @@
|
|
|
40
54
|
"lucide-react": "^1.64.0",
|
|
41
55
|
"react": "^19.2.0",
|
|
42
56
|
"react-dom": "^19.2.0",
|
|
43
|
-
"
|
|
57
|
+
"recharts": "^3.8.0",
|
|
58
|
+
"tailwindcss": "^4",
|
|
59
|
+
"vite": ">=7"
|
|
60
|
+
},
|
|
61
|
+
"peerDependenciesMeta": {
|
|
62
|
+
"recharts": {
|
|
63
|
+
"optional": true
|
|
64
|
+
},
|
|
65
|
+
"vite": {
|
|
66
|
+
"optional": true
|
|
67
|
+
}
|
|
44
68
|
},
|
|
45
69
|
"dependencies": {
|
|
46
70
|
"@base-ui/react": "^1.9.0",
|
|
@@ -77,6 +101,7 @@
|
|
|
77
101
|
"lucide-react": "^1.64.0",
|
|
78
102
|
"react": "^19.3.1",
|
|
79
103
|
"react-dom": "^19.3.1",
|
|
104
|
+
"recharts": "^3.8.0",
|
|
80
105
|
"shadcn": "^4.23.0",
|
|
81
106
|
"tailwindcss": "^4",
|
|
82
107
|
"typescript": "~6.0.2",
|
package/vite-plugin.d.ts
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import type { Plugin } from "vite"
|
|
2
|
+
|
|
3
|
+
export interface EticPackagesSourcesOptions {
|
|
4
|
+
/** Sert aussi les sources de `@etic-insa/auth`. Faux par défaut. */
|
|
5
|
+
auth?: boolean
|
|
6
|
+
/**
|
|
7
|
+
* Paquets à n'avoir qu'en un exemplaire, en plus de `react`, `react-dom`
|
|
8
|
+
* et `recharts` : `@tanstack/react-query` quand l'`AuthProvider` des
|
|
9
|
+
* sources doit voir le `QueryClient` de l'application.
|
|
10
|
+
*/
|
|
11
|
+
dedupe?: string[]
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* En développement (`vite`, hors vitest), sert les sources locales
|
|
16
|
+
* d'etic-packages à la place des paquets installés : une modification de la
|
|
17
|
+
* bibliothèque se voit aussitôt, sans build ni publication. Les sources
|
|
18
|
+
* sont `ETIC_UI_SOURCES` (chemin de `packages/ui/src`), sinon
|
|
19
|
+
* `etic-packages` à côté du dépôt de l'application (depuis un worktree
|
|
20
|
+
* aussi), et seulement si ce checkout a ses `node_modules`.
|
|
21
|
+
* `ETIC_UI_SOURCES=npm` force les paquets installés. Build et tests
|
|
22
|
+
* gardent toujours les paquets installés.
|
|
23
|
+
*
|
|
24
|
+
* Alias de `@etic-insa/ui` (et de `/styles.css`, `/test`, `/charts`), `@etic-ui`,
|
|
25
|
+
* `@etic-insa/auth` avec `auth` ; `dedupe` ; accès du serveur au checkout ;
|
|
26
|
+
* `@source` des sources ajouté à la feuille CSS qui importe
|
|
27
|
+
* `@etic-insa/ui/styles.css`. Annonce au démarrage ce qui est servi.
|
|
28
|
+
*/
|
|
29
|
+
export function eticPackagesSources(
|
|
30
|
+
options?: EticPackagesSourcesOptions
|
|
31
|
+
): Plugin
|