@sia-ui/react-web 0.1.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/LICENSE +21 -0
- package/README.md +57 -0
- package/dist/index.cjs +5709 -0
- package/dist/index.css +5944 -0
- package/dist/index.d.cts +2053 -0
- package/dist/index.d.ts +2053 -0
- package/dist/index.js +5528 -0
- package/package.json +80 -0
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,2053 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import * as react from 'react';
|
|
3
|
+
import { ReactNode, RefObject, ImgHTMLAttributes, HTMLAttributes, ButtonHTMLAttributes, InputHTMLAttributes, Key, ForwardRefExoticComponent, RefAttributes, ReactElement, TextareaHTMLAttributes, SVGProps, CSSProperties, PropsWithChildren } from 'react';
|
|
4
|
+
import { ComponentTone, ComponentSize } from '@sia-ui/tokens';
|
|
5
|
+
import * as _sia_ui_headless from '@sia-ui/headless';
|
|
6
|
+
import { Placement, TableSort, TableQueryStorage, TableQueryState, TableQuery, SliderValue, FormAdapter, FormValidator, SessionStore, SessionState, PermissionRule, ToastPlacement, ToastId, ToastOptions } from '@sia-ui/headless';
|
|
7
|
+
export { SliderValue, ToastId, ToastOptions, ToastPlacement, ToastTone, toast, toastStore } from '@sia-ui/headless';
|
|
8
|
+
|
|
9
|
+
interface AccordionItem {
|
|
10
|
+
key: string;
|
|
11
|
+
title: ReactNode;
|
|
12
|
+
content: ReactNode;
|
|
13
|
+
/** Une ligne sous le titre, visible même replié. */
|
|
14
|
+
description?: ReactNode;
|
|
15
|
+
icon?: ReactNode;
|
|
16
|
+
/** À droite du titre : un compteur, un badge, un statut. */
|
|
17
|
+
meta?: ReactNode;
|
|
18
|
+
disabled?: boolean;
|
|
19
|
+
}
|
|
20
|
+
interface AccordionProps {
|
|
21
|
+
items: AccordionItem[];
|
|
22
|
+
/** `single` referme la section précédente, `multiple` les cumule. */
|
|
23
|
+
type?: "single" | "multiple";
|
|
24
|
+
value?: string[];
|
|
25
|
+
defaultValue?: string[];
|
|
26
|
+
onValueChange?: (value: string[]) => void;
|
|
27
|
+
/** En `single`, autorise à tout refermer. */
|
|
28
|
+
collapsible?: boolean;
|
|
29
|
+
variant?: "bordered" | "separated" | "plain";
|
|
30
|
+
className?: string;
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Des sections dépliables.
|
|
34
|
+
*
|
|
35
|
+
* La hauteur s'anime sans être mesurée : le panneau est une grille dont la
|
|
36
|
+
* ligne passe de `0fr` à `1fr`. Pas de `scrollHeight`, pas de recalcul au
|
|
37
|
+
* redimensionnement, et un contenu qui change de taille suit tout seul.
|
|
38
|
+
*/
|
|
39
|
+
declare function Accordion({ items, type, value, defaultValue, onValueChange, collapsible, variant, className, }: AccordionProps): react_jsx_runtime.JSX.Element;
|
|
40
|
+
interface CollapseProps {
|
|
41
|
+
title: ReactNode;
|
|
42
|
+
children: ReactNode;
|
|
43
|
+
description?: ReactNode;
|
|
44
|
+
meta?: ReactNode;
|
|
45
|
+
icon?: ReactNode;
|
|
46
|
+
open?: boolean;
|
|
47
|
+
defaultOpen?: boolean;
|
|
48
|
+
onOpenChange?: (open: boolean) => void;
|
|
49
|
+
variant?: AccordionProps["variant"];
|
|
50
|
+
disabled?: boolean;
|
|
51
|
+
className?: string;
|
|
52
|
+
}
|
|
53
|
+
/** Une section seule. Le même rendu, pour le cas le plus courant. */
|
|
54
|
+
declare function Collapse({ title, children, description, meta, icon, open, defaultOpen, onOpenChange, variant, disabled, className, }: CollapseProps): react_jsx_runtime.JSX.Element;
|
|
55
|
+
|
|
56
|
+
interface AlertProps {
|
|
57
|
+
tone?: ComponentTone;
|
|
58
|
+
title?: ReactNode;
|
|
59
|
+
children?: ReactNode;
|
|
60
|
+
action?: ReactNode;
|
|
61
|
+
dismissLabel?: string;
|
|
62
|
+
onDismiss?: () => void;
|
|
63
|
+
className?: string;
|
|
64
|
+
}
|
|
65
|
+
declare function Alert({ tone, title, children, action, dismissLabel: dismissLabelProp, onDismiss, className }: AlertProps): react_jsx_runtime.JSX.Element;
|
|
66
|
+
|
|
67
|
+
interface AmountDisplayProps {
|
|
68
|
+
value: number;
|
|
69
|
+
currency?: string;
|
|
70
|
+
locale?: string;
|
|
71
|
+
label?: ReactNode;
|
|
72
|
+
secondary?: ReactNode;
|
|
73
|
+
sign?: "auto" | "always";
|
|
74
|
+
tone?: ComponentTone;
|
|
75
|
+
className?: string;
|
|
76
|
+
}
|
|
77
|
+
declare function AmountDisplay({ value, currency, locale, label, secondary, sign, tone, className }: AmountDisplayProps): react_jsx_runtime.JSX.Element;
|
|
78
|
+
|
|
79
|
+
interface AppShellProps {
|
|
80
|
+
logo?: ReactNode;
|
|
81
|
+
navigation: ReactNode;
|
|
82
|
+
header?: ReactNode;
|
|
83
|
+
children: ReactNode;
|
|
84
|
+
footer?: ReactNode;
|
|
85
|
+
defaultCollapsed?: boolean;
|
|
86
|
+
className?: string;
|
|
87
|
+
}
|
|
88
|
+
declare function AppShell({ logo, navigation, header, children, footer, defaultCollapsed, className }: AppShellProps): react_jsx_runtime.JSX.Element;
|
|
89
|
+
|
|
90
|
+
interface AspectRatioProps {
|
|
91
|
+
/** Le rapport largeur / hauteur. `16 / 9`, `1`, `4 / 3`. */
|
|
92
|
+
ratio?: number;
|
|
93
|
+
children: ReactNode;
|
|
94
|
+
className?: string;
|
|
95
|
+
}
|
|
96
|
+
/**
|
|
97
|
+
* Une boîte au rapport imposé.
|
|
98
|
+
*
|
|
99
|
+
* Elle existe pour une seule raison : réserver la place avant que l'image ou
|
|
100
|
+
* l'iframe n'arrive. Sans elle, le contenu qui suit saute au chargement — ce
|
|
101
|
+
* que mesure le Cumulative Layout Shift, et ce que les gens ressentent comme
|
|
102
|
+
* une page qui bouge sous le doigt.
|
|
103
|
+
*/
|
|
104
|
+
declare function AspectRatio({ ratio, children, className }: AspectRatioProps): react_jsx_runtime.JSX.Element;
|
|
105
|
+
|
|
106
|
+
interface AsyncStateProps {
|
|
107
|
+
loading?: boolean;
|
|
108
|
+
error?: ReactNode;
|
|
109
|
+
empty?: boolean;
|
|
110
|
+
emptyTitle?: ReactNode;
|
|
111
|
+
emptyDescription?: ReactNode;
|
|
112
|
+
onRetry?: () => void;
|
|
113
|
+
children: ReactNode;
|
|
114
|
+
}
|
|
115
|
+
declare function AsyncState({ loading, error, empty, emptyTitle, emptyDescription, onRetry, children }: AsyncStateProps): react_jsx_runtime.JSX.Element;
|
|
116
|
+
|
|
117
|
+
interface AuditEvent {
|
|
118
|
+
label: ReactNode;
|
|
119
|
+
at: Date | string | number;
|
|
120
|
+
by?: ReactNode;
|
|
121
|
+
detail?: ReactNode;
|
|
122
|
+
}
|
|
123
|
+
interface AuditMetaProps {
|
|
124
|
+
events: AuditEvent[];
|
|
125
|
+
locale?: string;
|
|
126
|
+
title?: ReactNode;
|
|
127
|
+
emptyLabel?: ReactNode;
|
|
128
|
+
className?: string;
|
|
129
|
+
}
|
|
130
|
+
declare function AuditMeta({ events, locale, title, emptyLabel, className }: AuditMetaProps): react_jsx_runtime.JSX.Element;
|
|
131
|
+
|
|
132
|
+
interface AuthLayoutProps {
|
|
133
|
+
title: ReactNode;
|
|
134
|
+
description?: ReactNode;
|
|
135
|
+
logo?: ReactNode;
|
|
136
|
+
aside?: ReactNode;
|
|
137
|
+
children: ReactNode;
|
|
138
|
+
footer?: ReactNode;
|
|
139
|
+
className?: string;
|
|
140
|
+
}
|
|
141
|
+
declare function AuthLayout({ title, description, logo, aside, children, footer, className, }: AuthLayoutProps): react_jsx_runtime.JSX.Element;
|
|
142
|
+
|
|
143
|
+
type OverlayPlacement = "bottom-start" | "bottom-end" | "top-start" | "top-end";
|
|
144
|
+
interface OverlayProps {
|
|
145
|
+
open: boolean;
|
|
146
|
+
anchorRef: RefObject<HTMLElement | null>;
|
|
147
|
+
onOpenChange: (open: boolean) => void;
|
|
148
|
+
children: ReactNode;
|
|
149
|
+
placement?: OverlayPlacement;
|
|
150
|
+
offset?: number;
|
|
151
|
+
matchAnchorWidth?: boolean;
|
|
152
|
+
viewportPadding?: number;
|
|
153
|
+
className?: string;
|
|
154
|
+
id?: string;
|
|
155
|
+
role?: string;
|
|
156
|
+
}
|
|
157
|
+
declare function Overlay({ open, anchorRef, onOpenChange, children, placement, offset, matchAnchorWidth, viewportPadding, className, ...props }: OverlayProps): react.ReactPortal | null;
|
|
158
|
+
|
|
159
|
+
interface SelectOption {
|
|
160
|
+
value: string;
|
|
161
|
+
label: ReactNode;
|
|
162
|
+
description?: ReactNode;
|
|
163
|
+
disabled?: boolean;
|
|
164
|
+
keywords?: string[];
|
|
165
|
+
}
|
|
166
|
+
interface SelectProps {
|
|
167
|
+
id?: string;
|
|
168
|
+
name?: string;
|
|
169
|
+
options?: SelectOption[];
|
|
170
|
+
/** Compatibility path. Prefer the options prop. */
|
|
171
|
+
children?: ReactNode;
|
|
172
|
+
value?: string;
|
|
173
|
+
defaultValue?: string;
|
|
174
|
+
onValueChange?: (value: string, option?: SelectOption) => void;
|
|
175
|
+
placeholder?: string;
|
|
176
|
+
searchable?: boolean;
|
|
177
|
+
searchPlaceholder?: string;
|
|
178
|
+
fetcher?: (query: string, signal?: AbortSignal) => Promise<SelectOption[]>;
|
|
179
|
+
debounce?: number;
|
|
180
|
+
loadingText?: ReactNode;
|
|
181
|
+
emptyText?: ReactNode;
|
|
182
|
+
errorText?: ReactNode;
|
|
183
|
+
clearable?: boolean;
|
|
184
|
+
disabled?: boolean;
|
|
185
|
+
invalid?: boolean;
|
|
186
|
+
required?: boolean;
|
|
187
|
+
placement?: OverlayPlacement;
|
|
188
|
+
className?: string;
|
|
189
|
+
"aria-label"?: string;
|
|
190
|
+
"aria-describedby"?: string;
|
|
191
|
+
"aria-labelledby"?: string;
|
|
192
|
+
"aria-invalid"?: boolean;
|
|
193
|
+
"aria-required"?: boolean;
|
|
194
|
+
}
|
|
195
|
+
declare const Select: react.ForwardRefExoticComponent<SelectProps & react.RefAttributes<HTMLButtonElement>>;
|
|
196
|
+
|
|
197
|
+
interface AutocompleteProps {
|
|
198
|
+
id?: string;
|
|
199
|
+
options: SelectOption[];
|
|
200
|
+
value?: string;
|
|
201
|
+
defaultValue?: string;
|
|
202
|
+
onValueChange?: (value: string, option?: SelectOption) => void;
|
|
203
|
+
placeholder?: string;
|
|
204
|
+
allowCustomValue?: boolean;
|
|
205
|
+
disabled?: boolean;
|
|
206
|
+
className?: string;
|
|
207
|
+
"aria-describedby"?: string;
|
|
208
|
+
"aria-labelledby"?: string;
|
|
209
|
+
"aria-invalid"?: boolean;
|
|
210
|
+
"aria-required"?: boolean;
|
|
211
|
+
}
|
|
212
|
+
declare function Autocomplete({ id, options, value, defaultValue, onValueChange, placeholder: placeholderProp, allowCustomValue, disabled, className, ...ariaProps }: AutocompleteProps): react_jsx_runtime.JSX.Element;
|
|
213
|
+
|
|
214
|
+
interface AvatarProps extends Omit<ImgHTMLAttributes<HTMLImageElement>, "children"> {
|
|
215
|
+
name: string;
|
|
216
|
+
size?: "sm" | "md" | "lg";
|
|
217
|
+
fallback?: string;
|
|
218
|
+
}
|
|
219
|
+
declare function Avatar({ name, size, fallback, className, src, alt, onError, ...props }: AvatarProps): react_jsx_runtime.JSX.Element;
|
|
220
|
+
|
|
221
|
+
interface SpinnerProps extends HTMLAttributes<HTMLSpanElement> {
|
|
222
|
+
label?: string;
|
|
223
|
+
size?: "xs" | "sm" | "md" | "lg" | "xl";
|
|
224
|
+
variant?: "dots" | "ring" | "double-ring";
|
|
225
|
+
tone?: ComponentTone | "current";
|
|
226
|
+
}
|
|
227
|
+
declare function Spinner({ label: labelProp, size: sizeProp, variant: variantProp, tone: toneProp, className, ...props }: SpinnerProps): react_jsx_runtime.JSX.Element;
|
|
228
|
+
|
|
229
|
+
interface BadgeProps extends HTMLAttributes<HTMLSpanElement> {
|
|
230
|
+
tone?: ComponentTone;
|
|
231
|
+
variant?: "soft" | "solid" | "outline";
|
|
232
|
+
left?: ReactNode;
|
|
233
|
+
right?: ReactNode;
|
|
234
|
+
loading?: boolean;
|
|
235
|
+
loadingLabel?: string;
|
|
236
|
+
spinnerProps?: Omit<SpinnerProps, "label">;
|
|
237
|
+
}
|
|
238
|
+
declare function Badge({ tone: toneProp, variant: variantProp, left, right, loading, loadingLabel: loadingLabelProp, spinnerProps, className, children, ...props }: BadgeProps): react_jsx_runtime.JSX.Element;
|
|
239
|
+
|
|
240
|
+
interface BreadcrumbItem {
|
|
241
|
+
key?: string;
|
|
242
|
+
label: ReactNode;
|
|
243
|
+
href?: string;
|
|
244
|
+
icon?: ReactNode;
|
|
245
|
+
onClick?: () => void;
|
|
246
|
+
}
|
|
247
|
+
interface BreadcrumbProps {
|
|
248
|
+
items: BreadcrumbItem[];
|
|
249
|
+
/**
|
|
250
|
+
* Au-delà, les niveaux intermédiaires passent dans un menu. Le premier et
|
|
251
|
+
* les deux derniers restent toujours visibles : ce sont les seuls dont on
|
|
252
|
+
* ait vraiment besoin pour se situer.
|
|
253
|
+
*/
|
|
254
|
+
maxVisible?: number;
|
|
255
|
+
separator?: ReactNode;
|
|
256
|
+
ariaLabel?: string;
|
|
257
|
+
className?: string;
|
|
258
|
+
}
|
|
259
|
+
/**
|
|
260
|
+
* Le chemin parcouru.
|
|
261
|
+
*
|
|
262
|
+
* Le dernier élément n'est jamais un lien : c'est la page courante, et un
|
|
263
|
+
* lien vers l'endroit où l'on se trouve déjà n'existe pas.
|
|
264
|
+
*/
|
|
265
|
+
declare function Breadcrumb({ items, maxVisible, separator, ariaLabel, className, }: BreadcrumbProps): react_jsx_runtime.JSX.Element;
|
|
266
|
+
|
|
267
|
+
type TooltipVariant = "solid" | "outline";
|
|
268
|
+
interface TooltipProps extends Omit<HTMLAttributes<HTMLSpanElement>, "content"> {
|
|
269
|
+
content?: ReactNode;
|
|
270
|
+
children: ReactNode;
|
|
271
|
+
tone?: ComponentTone;
|
|
272
|
+
/** Seules `sm`, `md` et `lg` sont dessinées — voir `styles.css`. */
|
|
273
|
+
size?: ComponentSize;
|
|
274
|
+
placement?: Placement;
|
|
275
|
+
variant?: TooltipVariant;
|
|
276
|
+
/** Délai avant apparition, en millisecondes. */
|
|
277
|
+
delay?: number;
|
|
278
|
+
disabled?: boolean;
|
|
279
|
+
}
|
|
280
|
+
/** Alias historique, conservé pour les composants venus du registre. */
|
|
281
|
+
type ITooltipProps = TooltipProps;
|
|
282
|
+
type ITooltipVariant = TooltipVariant;
|
|
283
|
+
/**
|
|
284
|
+
* Bulle d'aide positionnée hors du flux.
|
|
285
|
+
*
|
|
286
|
+
* Le contenu passe par un portail plutôt que par un `position: absolute` dans
|
|
287
|
+
* le flux : un tooltip posé dans une `Card` ou une cellule de `DataTable` —
|
|
288
|
+
* toutes deux en `overflow: hidden` — serait sinon rogné.
|
|
289
|
+
*/
|
|
290
|
+
declare function Tooltip({ content, children, placement, variant, tone, size, delay, disabled, className, ...props }: TooltipProps): react_jsx_runtime.JSX.Element;
|
|
291
|
+
|
|
292
|
+
interface ButtonProps extends ButtonHTMLAttributes<HTMLButtonElement> {
|
|
293
|
+
variant?: "solid" | "outline" | "ghost";
|
|
294
|
+
/**
|
|
295
|
+
* Le ton sémantique de l'action.
|
|
296
|
+
*
|
|
297
|
+
* `.sia-button--danger` existait dans la feuille de style sans qu'aucune
|
|
298
|
+
* prop ne permette de l'atteindre : une action de suppression ne pouvait pas
|
|
299
|
+
* être rouge sans `className` manuel.
|
|
300
|
+
*/
|
|
301
|
+
tone?: ComponentTone;
|
|
302
|
+
size?: "sm" | "md" | "lg";
|
|
303
|
+
radius?: "default" | "none" | "sm" | "lg" | "full";
|
|
304
|
+
loading?: boolean;
|
|
305
|
+
loadingLabel?: string;
|
|
306
|
+
spinnerProps?: Omit<SpinnerProps, "label">;
|
|
307
|
+
tooltip?: Omit<TooltipProps, "children">;
|
|
308
|
+
leftIcon?: ReactNode;
|
|
309
|
+
rightIcon?: ReactNode;
|
|
310
|
+
}
|
|
311
|
+
declare const Button: react.ForwardRefExoticComponent<ButtonProps & react.RefAttributes<HTMLButtonElement>>;
|
|
312
|
+
|
|
313
|
+
interface CalendarDay {
|
|
314
|
+
date: string;
|
|
315
|
+
day: number;
|
|
316
|
+
inCurrentMonth: boolean;
|
|
317
|
+
isToday: boolean;
|
|
318
|
+
disabled: boolean;
|
|
319
|
+
selected: boolean;
|
|
320
|
+
inRange: boolean;
|
|
321
|
+
rangeEdge?: "start" | "end";
|
|
322
|
+
}
|
|
323
|
+
interface CalendarRangeValue {
|
|
324
|
+
start: string;
|
|
325
|
+
end: string;
|
|
326
|
+
}
|
|
327
|
+
type CalendarMode = "month" | "year";
|
|
328
|
+
interface CalendarProps {
|
|
329
|
+
value?: string;
|
|
330
|
+
defaultValue?: string;
|
|
331
|
+
range?: CalendarRangeValue;
|
|
332
|
+
defaultRange?: CalendarRangeValue;
|
|
333
|
+
selectionMode?: "single" | "range";
|
|
334
|
+
month?: string;
|
|
335
|
+
defaultMonth?: string;
|
|
336
|
+
mode?: CalendarMode;
|
|
337
|
+
defaultMode?: CalendarMode;
|
|
338
|
+
onValueChange?: (value: string) => void;
|
|
339
|
+
onRangeChange?: (value: CalendarRangeValue) => void;
|
|
340
|
+
onSelect?: (value: string, source: "date" | "month" | "year") => void;
|
|
341
|
+
onMonthChange?: (month: string) => void;
|
|
342
|
+
onPanelChange?: (month: string, mode: CalendarMode) => void;
|
|
343
|
+
disabledDate?: (date: string) => boolean;
|
|
344
|
+
validRange?: [string, string];
|
|
345
|
+
renderDay?: (day: CalendarDay) => ReactNode;
|
|
346
|
+
cellRender?: (day: CalendarDay, originNode: ReactNode) => ReactNode;
|
|
347
|
+
headerRender?: (props: {
|
|
348
|
+
month: string;
|
|
349
|
+
mode: CalendarMode;
|
|
350
|
+
onMonthChange: (month: string) => void;
|
|
351
|
+
onModeChange: (mode: CalendarMode) => void;
|
|
352
|
+
}) => ReactNode;
|
|
353
|
+
renderExtraFooter?: () => ReactNode;
|
|
354
|
+
locale?: string;
|
|
355
|
+
firstDayOfWeek?: 0 | 1;
|
|
356
|
+
showWeek?: boolean;
|
|
357
|
+
fullscreen?: boolean;
|
|
358
|
+
tone?: ComponentTone;
|
|
359
|
+
className?: string;
|
|
360
|
+
}
|
|
361
|
+
declare function Calendar({ value, defaultValue, range, defaultRange, selectionMode, month, defaultMonth, mode, defaultMode, onValueChange, onRangeChange, onSelect, onMonthChange, onPanelChange, disabledDate, validRange, renderDay, cellRender, headerRender, renderExtraFooter, locale, firstDayOfWeek, showWeek, fullscreen, tone, className, }: CalendarProps): react_jsx_runtime.JSX.Element;
|
|
362
|
+
|
|
363
|
+
declare function Card({ className, ...props }: HTMLAttributes<HTMLDivElement>): react_jsx_runtime.JSX.Element;
|
|
364
|
+
declare function CardHeader({ className, ...props }: HTMLAttributes<HTMLDivElement>): react_jsx_runtime.JSX.Element;
|
|
365
|
+
declare function CardBody({ className, ...props }: HTMLAttributes<HTMLDivElement>): react_jsx_runtime.JSX.Element;
|
|
366
|
+
declare function CardFooter({ className, ...props }: HTMLAttributes<HTMLDivElement>): react_jsx_runtime.JSX.Element;
|
|
367
|
+
|
|
368
|
+
interface ChartSeries {
|
|
369
|
+
key: string;
|
|
370
|
+
label?: string;
|
|
371
|
+
values: Array<number | null>;
|
|
372
|
+
tone?: ComponentTone;
|
|
373
|
+
/** Couleur explicite. Prioritaire sur `tone`. */
|
|
374
|
+
color?: string;
|
|
375
|
+
}
|
|
376
|
+
interface ChartProps {
|
|
377
|
+
series: ChartSeries[];
|
|
378
|
+
/** Les libellés de l'axe horizontal. Un par point. */
|
|
379
|
+
labels?: string[];
|
|
380
|
+
type?: "line" | "area" | "bar";
|
|
381
|
+
height?: number;
|
|
382
|
+
/** Bornes de l'axe vertical. Par défaut, déduites des données. */
|
|
383
|
+
min?: number;
|
|
384
|
+
max?: number;
|
|
385
|
+
showGrid?: boolean;
|
|
386
|
+
showAxis?: boolean;
|
|
387
|
+
showLegend?: boolean;
|
|
388
|
+
/** Mise en forme des valeurs — montants, pourcentages. */
|
|
389
|
+
format?: (value: number) => string;
|
|
390
|
+
/** Rend le graphique muet : ni survol, ni infobulle. */
|
|
391
|
+
readOnly?: boolean;
|
|
392
|
+
caption?: ReactNode;
|
|
393
|
+
className?: string;
|
|
394
|
+
}
|
|
395
|
+
/**
|
|
396
|
+
* Un graphique sans dépendance.
|
|
397
|
+
*
|
|
398
|
+
* Il couvre les trois formes qui reviennent dans un tableau de bord — courbe,
|
|
399
|
+
* aire, barres — et rien d'autre. `recharts` reste le bon choix dès qu'il
|
|
400
|
+
* faut des axes secondaires, du zoom ou des annotations; il pèse alors 90 ko
|
|
401
|
+
* qu'un projet choisit d'ajouter plutôt que de subir.
|
|
402
|
+
*/
|
|
403
|
+
declare function Chart({ series, labels, type, height, min: minProp, max: maxProp, showGrid, showAxis, showLegend, format, readOnly, caption, className, }: ChartProps): react_jsx_runtime.JSX.Element;
|
|
404
|
+
interface SparklineProps {
|
|
405
|
+
values: Array<number | null>;
|
|
406
|
+
tone?: ComponentTone;
|
|
407
|
+
color?: string;
|
|
408
|
+
width?: number | string;
|
|
409
|
+
height?: number;
|
|
410
|
+
/** Ajoute l'aire sous la courbe. */
|
|
411
|
+
filled?: boolean;
|
|
412
|
+
className?: string;
|
|
413
|
+
}
|
|
414
|
+
/**
|
|
415
|
+
* Une courbe minuscule, sans axes ni survol.
|
|
416
|
+
*
|
|
417
|
+
* Elle tient dans une cellule de tableau ou une carte de statistique, là où
|
|
418
|
+
* un graphique complet ne rentrerait pas.
|
|
419
|
+
*/
|
|
420
|
+
declare function Sparkline({ values, tone, color, width, height, filled, className, }: SparklineProps): react_jsx_runtime.JSX.Element;
|
|
421
|
+
|
|
422
|
+
type CheckboxValue = string | number;
|
|
423
|
+
interface CheckboxGroupProps {
|
|
424
|
+
value?: CheckboxValue[];
|
|
425
|
+
defaultValue?: CheckboxValue[];
|
|
426
|
+
onValueChange?: (value: CheckboxValue[]) => void;
|
|
427
|
+
disabled?: boolean;
|
|
428
|
+
variant?: "default" | "button";
|
|
429
|
+
orientation?: "horizontal" | "vertical";
|
|
430
|
+
size?: "sm" | "md" | "lg";
|
|
431
|
+
tone?: ComponentTone;
|
|
432
|
+
className?: string;
|
|
433
|
+
children: ReactNode;
|
|
434
|
+
}
|
|
435
|
+
declare function CheckboxGroup({ value, defaultValue, onValueChange, disabled, variant, orientation, size, tone, className, children, }: CheckboxGroupProps): react_jsx_runtime.JSX.Element;
|
|
436
|
+
interface CheckboxProps extends Omit<InputHTMLAttributes<HTMLInputElement>, "type" | "value" | "size"> {
|
|
437
|
+
value?: CheckboxValue;
|
|
438
|
+
label?: ReactNode;
|
|
439
|
+
children?: ReactNode;
|
|
440
|
+
description?: ReactNode;
|
|
441
|
+
indeterminate?: boolean;
|
|
442
|
+
onValueChange?: (checked: boolean) => void;
|
|
443
|
+
size?: "sm" | "md" | "lg";
|
|
444
|
+
tone?: ComponentTone;
|
|
445
|
+
}
|
|
446
|
+
declare const Checkbox: react.ForwardRefExoticComponent<CheckboxProps & react.RefAttributes<HTMLInputElement>>;
|
|
447
|
+
|
|
448
|
+
interface ColorPickerProps extends Omit<InputHTMLAttributes<HTMLInputElement>, "type" | "onChange"> {
|
|
449
|
+
onValueChange?: (value: string) => void;
|
|
450
|
+
showValue?: boolean;
|
|
451
|
+
}
|
|
452
|
+
declare const ColorPicker: react.ForwardRefExoticComponent<ColorPickerProps & react.RefAttributes<HTMLInputElement>>;
|
|
453
|
+
|
|
454
|
+
interface CommandItem {
|
|
455
|
+
id: string;
|
|
456
|
+
label: string;
|
|
457
|
+
description?: string;
|
|
458
|
+
keywords?: string[];
|
|
459
|
+
icon?: ReactNode;
|
|
460
|
+
disabled?: boolean;
|
|
461
|
+
onSelect: () => void;
|
|
462
|
+
}
|
|
463
|
+
interface CommandPaletteProps {
|
|
464
|
+
open: boolean;
|
|
465
|
+
onOpenChange: (open: boolean) => void;
|
|
466
|
+
items: CommandItem[];
|
|
467
|
+
placeholder?: string;
|
|
468
|
+
emptyLabel?: string;
|
|
469
|
+
className?: string;
|
|
470
|
+
}
|
|
471
|
+
declare function CommandPalette({ open, onOpenChange, items, placeholder, emptyLabel, className }: CommandPaletteProps): react_jsx_runtime.JSX.Element | null;
|
|
472
|
+
|
|
473
|
+
interface ConfirmDialogProps {
|
|
474
|
+
open: boolean;
|
|
475
|
+
onOpenChange: (open: boolean) => void;
|
|
476
|
+
title: ReactNode;
|
|
477
|
+
description?: ReactNode;
|
|
478
|
+
confirmLabel?: string;
|
|
479
|
+
cancelLabel?: string;
|
|
480
|
+
tone?: Extract<ComponentTone, "primary" | "danger">;
|
|
481
|
+
loading?: boolean;
|
|
482
|
+
onConfirm: () => void | Promise<void>;
|
|
483
|
+
}
|
|
484
|
+
declare function ConfirmDialog({ open, onOpenChange, title, description, confirmLabel: confirmLabelProp, cancelLabel: cancelLabelProp, tone, loading, onConfirm }: ConfirmDialogProps): react_jsx_runtime.JSX.Element;
|
|
485
|
+
|
|
486
|
+
declare function Container({ className, ...props }: HTMLAttributes<HTMLDivElement>): react_jsx_runtime.JSX.Element;
|
|
487
|
+
declare function Stack({ className, ...props }: HTMLAttributes<HTMLDivElement>): react_jsx_runtime.JSX.Element;
|
|
488
|
+
|
|
489
|
+
interface TimerProps {
|
|
490
|
+
duration?: number;
|
|
491
|
+
initialValue?: number;
|
|
492
|
+
direction?: "down" | "up";
|
|
493
|
+
running?: boolean;
|
|
494
|
+
interval?: number;
|
|
495
|
+
onChange?: (milliseconds: number) => void;
|
|
496
|
+
onFinish?: () => void;
|
|
497
|
+
format?: (milliseconds: number) => string;
|
|
498
|
+
className?: string;
|
|
499
|
+
}
|
|
500
|
+
interface TimeParts {
|
|
501
|
+
hours: number;
|
|
502
|
+
minutes: number;
|
|
503
|
+
seconds: number;
|
|
504
|
+
}
|
|
505
|
+
declare function parseTimeValue(value?: string): TimeParts;
|
|
506
|
+
declare function formatTimeValue(parts: TimeParts, showSeconds?: boolean): string;
|
|
507
|
+
declare function formatDuration(milliseconds: number, showMilliseconds?: boolean): string;
|
|
508
|
+
declare function Timer({ duration, initialValue, direction, running, interval, onChange, onFinish, format, className }: TimerProps): react_jsx_runtime.JSX.Element;
|
|
509
|
+
|
|
510
|
+
type CountdownProps = Omit<TimerProps, "direction">;
|
|
511
|
+
declare function Countdown(props: CountdownProps): react_jsx_runtime.JSX.Element;
|
|
512
|
+
|
|
513
|
+
interface CrudPageProps {
|
|
514
|
+
title: ReactNode;
|
|
515
|
+
description?: ReactNode;
|
|
516
|
+
actions?: ReactNode;
|
|
517
|
+
toolbar?: ReactNode;
|
|
518
|
+
children: ReactNode;
|
|
519
|
+
loading?: boolean;
|
|
520
|
+
error?: ReactNode;
|
|
521
|
+
empty?: boolean;
|
|
522
|
+
emptyTitle?: ReactNode;
|
|
523
|
+
page?: number;
|
|
524
|
+
totalPages?: number;
|
|
525
|
+
onPageChange?: (page: number) => void;
|
|
526
|
+
className?: string;
|
|
527
|
+
}
|
|
528
|
+
declare function CrudPage({ title, description, actions, toolbar, children, loading, error, empty, emptyTitle, page, totalPages, onPageChange, className }: CrudPageProps): react_jsx_runtime.JSX.Element;
|
|
529
|
+
|
|
530
|
+
interface CurrencyInputProps extends Omit<InputHTMLAttributes<HTMLInputElement>, "value" | "defaultValue" | "onChange" | "inputMode"> {
|
|
531
|
+
value?: number | null;
|
|
532
|
+
defaultValue?: number | null;
|
|
533
|
+
currency?: string;
|
|
534
|
+
locale?: string;
|
|
535
|
+
onValueChange?: (value: number | null) => void;
|
|
536
|
+
invalid?: boolean;
|
|
537
|
+
}
|
|
538
|
+
declare const CurrencyInput: react.ForwardRefExoticComponent<CurrencyInputProps & react.RefAttributes<HTMLInputElement>>;
|
|
539
|
+
|
|
540
|
+
interface DataTableColumn<T> {
|
|
541
|
+
key: string;
|
|
542
|
+
header: ReactNode;
|
|
543
|
+
cell: (row: T) => ReactNode;
|
|
544
|
+
align?: "left" | "center" | "right";
|
|
545
|
+
width?: string;
|
|
546
|
+
/** Rend l'entête cliquable. Le tri lui-même appartient au serveur. */
|
|
547
|
+
sortable?: boolean;
|
|
548
|
+
/** Le champ envoyé au serveur, si différent de `key`. */
|
|
549
|
+
sortKey?: string;
|
|
550
|
+
}
|
|
551
|
+
interface DataTableProps<T> {
|
|
552
|
+
columns: Array<DataTableColumn<T>>;
|
|
553
|
+
data: T[];
|
|
554
|
+
getRowKey: (row: T) => Key;
|
|
555
|
+
caption?: string;
|
|
556
|
+
empty?: ReactNode;
|
|
557
|
+
loading?: boolean;
|
|
558
|
+
/** Le tri en vigueur — celui de `useTableQuery`, ou le vôtre. */
|
|
559
|
+
sort?: TableSort | null;
|
|
560
|
+
onSortChange?: (field: string) => void;
|
|
561
|
+
/** L'entête reste visible quand le tableau défile. */
|
|
562
|
+
stickyHeader?: boolean;
|
|
563
|
+
onRowClick?: (row: T) => void;
|
|
564
|
+
rowClassName?: (row: T) => string | undefined;
|
|
565
|
+
className?: string;
|
|
566
|
+
}
|
|
567
|
+
/**
|
|
568
|
+
* Un tableau de données.
|
|
569
|
+
*
|
|
570
|
+
* Il n'ordonne ni ne filtre rien lui-même : à partir de quelques centaines de
|
|
571
|
+
* lignes, trier côté client veut dire les avoir toutes téléchargées. Le tri
|
|
572
|
+
* est donc une intention envoyée au serveur — `onSortChange` — et le tableau
|
|
573
|
+
* ne fait qu'afficher ce qu'on lui rend.
|
|
574
|
+
*/
|
|
575
|
+
declare function DataTable<T>({ columns, data, getRowKey, caption, empty: emptyProp, loading, sort, onSortChange, stickyHeader, onRowClick, rowClassName, className, }: DataTableProps<T>): react_jsx_runtime.JSX.Element;
|
|
576
|
+
/**
|
|
577
|
+
* L'état du tableau dans la barre d'adresse.
|
|
578
|
+
*
|
|
579
|
+
* `history.replaceState` plutôt que `pushState` : trier une colonne trois
|
|
580
|
+
* fois de suite ne doit pas demander trois retours en arrière pour revenir
|
|
581
|
+
* d'où l'on vient.
|
|
582
|
+
*/
|
|
583
|
+
declare function createUrlTableStorage(mode?: "replace" | "push"): TableQueryStorage;
|
|
584
|
+
interface UseDataTableQueryOptions {
|
|
585
|
+
defaultState?: Partial<TableQueryState>;
|
|
586
|
+
/** `false` garde l'état en mémoire — utile dans une modale. */
|
|
587
|
+
syncUrl?: boolean;
|
|
588
|
+
/** Empile une entrée d'historique à chaque changement. */
|
|
589
|
+
history?: "replace" | "push";
|
|
590
|
+
/** Préfixe des clés, pour deux tableaux sur la même page. */
|
|
591
|
+
prefix?: string;
|
|
592
|
+
}
|
|
593
|
+
/**
|
|
594
|
+
* Tri, filtres et pagination d'un tableau, synchronisés avec l'URL.
|
|
595
|
+
*
|
|
596
|
+
* Le calcul vit dans `@sia-ui/headless`; il n'y a ici que le branchement sur
|
|
597
|
+
* la barre d'adresse, qui est la seule partie propre au navigateur.
|
|
598
|
+
*/
|
|
599
|
+
declare function useDataTableQuery(options?: UseDataTableQueryOptions): TableQuery;
|
|
600
|
+
|
|
601
|
+
interface DatePickerProps extends Pick<CalendarProps, "locale" | "firstDayOfWeek" | "disabledDate" | "cellRender" | "showWeek"> {
|
|
602
|
+
id?: string;
|
|
603
|
+
name?: string;
|
|
604
|
+
value?: string;
|
|
605
|
+
defaultValue?: string;
|
|
606
|
+
min?: string;
|
|
607
|
+
max?: string;
|
|
608
|
+
onValueChange?: (value: string) => void;
|
|
609
|
+
onOpenChange?: (open: boolean) => void;
|
|
610
|
+
open?: boolean;
|
|
611
|
+
placeholder?: string;
|
|
612
|
+
formatValue?: (value: string, locale: string) => ReactNode;
|
|
613
|
+
allowClear?: boolean;
|
|
614
|
+
showToday?: boolean;
|
|
615
|
+
renderExtraFooter?: () => ReactNode;
|
|
616
|
+
placement?: OverlayPlacement;
|
|
617
|
+
tone?: ComponentTone;
|
|
618
|
+
invalid?: boolean;
|
|
619
|
+
disabled?: boolean;
|
|
620
|
+
required?: boolean;
|
|
621
|
+
className?: string;
|
|
622
|
+
"aria-label"?: string;
|
|
623
|
+
"aria-describedby"?: string;
|
|
624
|
+
"aria-labelledby"?: string;
|
|
625
|
+
"aria-invalid"?: boolean;
|
|
626
|
+
"aria-required"?: boolean;
|
|
627
|
+
}
|
|
628
|
+
declare const DatePicker: react.ForwardRefExoticComponent<DatePickerProps & react.RefAttributes<HTMLButtonElement>>;
|
|
629
|
+
|
|
630
|
+
type DateRangeValue = CalendarRangeValue;
|
|
631
|
+
interface DateRangePickerProps extends Pick<CalendarProps, "locale" | "firstDayOfWeek" | "disabledDate" | "cellRender" | "showWeek"> {
|
|
632
|
+
value?: DateRangeValue;
|
|
633
|
+
defaultValue?: DateRangeValue;
|
|
634
|
+
onValueChange?: (value: DateRangeValue) => void;
|
|
635
|
+
min?: string;
|
|
636
|
+
max?: string;
|
|
637
|
+
startLabel?: string;
|
|
638
|
+
endLabel?: string;
|
|
639
|
+
allowClear?: boolean;
|
|
640
|
+
placement?: OverlayPlacement;
|
|
641
|
+
tone?: ComponentTone;
|
|
642
|
+
invalid?: boolean;
|
|
643
|
+
disabled?: boolean;
|
|
644
|
+
className?: string;
|
|
645
|
+
}
|
|
646
|
+
declare function DateRangePicker({ value, defaultValue, onValueChange, min, max, startLabel, endLabel, allowClear, placement, tone, invalid, disabled, locale, firstDayOfWeek, disabledDate, cellRender, showWeek, className }: DateRangePickerProps): react_jsx_runtime.JSX.Element;
|
|
647
|
+
|
|
648
|
+
interface DateRangePreset {
|
|
649
|
+
label: ReactNode;
|
|
650
|
+
value: DateRangeValue;
|
|
651
|
+
}
|
|
652
|
+
interface DateRangeFilterProps {
|
|
653
|
+
value: DateRangeValue;
|
|
654
|
+
onValueChange: (value: DateRangeValue) => void;
|
|
655
|
+
presets?: DateRangePreset[];
|
|
656
|
+
onClear?: () => void;
|
|
657
|
+
className?: string;
|
|
658
|
+
}
|
|
659
|
+
declare function DateRangeFilter({ value, onValueChange, presets, onClear, className }: DateRangeFilterProps): react_jsx_runtime.JSX.Element;
|
|
660
|
+
|
|
661
|
+
interface TimePickerProps {
|
|
662
|
+
id?: string;
|
|
663
|
+
name?: string;
|
|
664
|
+
value?: string;
|
|
665
|
+
defaultValue?: string;
|
|
666
|
+
min?: string;
|
|
667
|
+
max?: string;
|
|
668
|
+
showSeconds?: boolean;
|
|
669
|
+
minuteStep?: number;
|
|
670
|
+
secondStep?: number;
|
|
671
|
+
hourFormat?: 12 | 24;
|
|
672
|
+
needConfirm?: boolean;
|
|
673
|
+
allowClear?: boolean;
|
|
674
|
+
placeholder?: string;
|
|
675
|
+
disabledTime?: (value: TimeParts) => boolean;
|
|
676
|
+
renderExtraFooter?: () => ReactNode;
|
|
677
|
+
onValueChange?: (value: string) => void;
|
|
678
|
+
onOpenChange?: (open: boolean) => void;
|
|
679
|
+
open?: boolean;
|
|
680
|
+
placement?: OverlayPlacement;
|
|
681
|
+
tone?: ComponentTone;
|
|
682
|
+
invalid?: boolean;
|
|
683
|
+
disabled?: boolean;
|
|
684
|
+
required?: boolean;
|
|
685
|
+
className?: string;
|
|
686
|
+
"aria-label"?: string;
|
|
687
|
+
"aria-describedby"?: string;
|
|
688
|
+
"aria-labelledby"?: string;
|
|
689
|
+
"aria-invalid"?: boolean;
|
|
690
|
+
"aria-required"?: boolean;
|
|
691
|
+
}
|
|
692
|
+
declare const TimePicker: react.ForwardRefExoticComponent<TimePickerProps & react.RefAttributes<HTMLButtonElement>>;
|
|
693
|
+
|
|
694
|
+
interface DateTimeValue {
|
|
695
|
+
date: string;
|
|
696
|
+
time: string;
|
|
697
|
+
}
|
|
698
|
+
interface DateTimePickerProps {
|
|
699
|
+
value?: DateTimeValue;
|
|
700
|
+
defaultValue?: DateTimeValue;
|
|
701
|
+
onValueChange?: (value: DateTimeValue) => void;
|
|
702
|
+
minuteStep?: number;
|
|
703
|
+
secondStep?: number;
|
|
704
|
+
showSeconds?: boolean;
|
|
705
|
+
hourFormat?: 12 | 24;
|
|
706
|
+
needConfirm?: boolean;
|
|
707
|
+
minDate?: string;
|
|
708
|
+
maxDate?: string;
|
|
709
|
+
tone?: ComponentTone;
|
|
710
|
+
invalid?: boolean;
|
|
711
|
+
disabled?: boolean;
|
|
712
|
+
dateProps?: Omit<DatePickerProps, "value" | "defaultValue" | "onValueChange" | "tone" | "invalid" | "disabled">;
|
|
713
|
+
timeProps?: Omit<TimePickerProps, "value" | "defaultValue" | "onValueChange" | "tone" | "invalid" | "disabled">;
|
|
714
|
+
className?: string;
|
|
715
|
+
}
|
|
716
|
+
declare function DateTimePicker({ value, defaultValue, onValueChange, minuteStep, secondStep, showSeconds, hourFormat, needConfirm, minDate, maxDate, tone, invalid, disabled, dateProps, timeProps, className }: DateTimePickerProps): react_jsx_runtime.JSX.Element;
|
|
717
|
+
|
|
718
|
+
interface DescriptionItem {
|
|
719
|
+
key: string;
|
|
720
|
+
label: ReactNode;
|
|
721
|
+
value: ReactNode;
|
|
722
|
+
span?: 1 | 2 | 3;
|
|
723
|
+
}
|
|
724
|
+
interface DescriptionsProps {
|
|
725
|
+
items: DescriptionItem[];
|
|
726
|
+
title?: ReactNode;
|
|
727
|
+
columns?: 1 | 2 | 3;
|
|
728
|
+
bordered?: boolean;
|
|
729
|
+
className?: string;
|
|
730
|
+
}
|
|
731
|
+
declare function Descriptions({ items, title, columns, bordered, className }: DescriptionsProps): react_jsx_runtime.JSX.Element;
|
|
732
|
+
|
|
733
|
+
interface DividerProps extends HTMLAttributes<HTMLDivElement> {
|
|
734
|
+
orientation?: "horizontal" | "vertical";
|
|
735
|
+
decorative?: boolean;
|
|
736
|
+
}
|
|
737
|
+
declare function Divider({ orientation, decorative, className, ...props }: DividerProps): react_jsx_runtime.JSX.Element;
|
|
738
|
+
|
|
739
|
+
/** Ce que la réf impérative expose — ouvrir un tiroir depuis l'extérieur. */
|
|
740
|
+
type DrawerRef = {
|
|
741
|
+
open: () => void;
|
|
742
|
+
close: () => void;
|
|
743
|
+
toggle: () => void;
|
|
744
|
+
isOpen: () => boolean;
|
|
745
|
+
};
|
|
746
|
+
type DrawerPosition = "left" | "right" | "top" | "bottom";
|
|
747
|
+
type DrawerSize = "sm" | "md" | "lg" | "xl";
|
|
748
|
+
interface DrawerProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
749
|
+
open?: boolean;
|
|
750
|
+
defaultOpen?: boolean;
|
|
751
|
+
onOpenChange?: (open: boolean) => void;
|
|
752
|
+
position?: DrawerPosition;
|
|
753
|
+
size?: DrawerSize;
|
|
754
|
+
closeOnOutsideClick?: boolean;
|
|
755
|
+
closeOnEsc?: boolean;
|
|
756
|
+
}
|
|
757
|
+
/** Alias historique, attendu par les composants venus du registre. */
|
|
758
|
+
type IDrawerProps = DrawerProps;
|
|
759
|
+
type DrawerComponent = ForwardRefExoticComponent<IDrawerProps & RefAttributes<DrawerRef>> & {
|
|
760
|
+
Header: typeof DrawerHeader;
|
|
761
|
+
Body: typeof DrawerBody;
|
|
762
|
+
Footer: typeof DrawerFooter;
|
|
763
|
+
Title: typeof DrawerTitle;
|
|
764
|
+
Close: typeof DrawerClose;
|
|
765
|
+
};
|
|
766
|
+
declare const Drawer: DrawerComponent;
|
|
767
|
+
declare function DrawerHeader({ children }: {
|
|
768
|
+
children: React.ReactNode;
|
|
769
|
+
}): react_jsx_runtime.JSX.Element;
|
|
770
|
+
declare function DrawerTitle({ children }: {
|
|
771
|
+
children: React.ReactNode;
|
|
772
|
+
}): react_jsx_runtime.JSX.Element;
|
|
773
|
+
declare function DrawerBody({ children }: {
|
|
774
|
+
children: React.ReactNode;
|
|
775
|
+
}): react_jsx_runtime.JSX.Element;
|
|
776
|
+
declare function DrawerFooter({ children }: {
|
|
777
|
+
children: React.ReactNode;
|
|
778
|
+
}): react_jsx_runtime.JSX.Element;
|
|
779
|
+
declare function DrawerClose(): react_jsx_runtime.JSX.Element | null;
|
|
780
|
+
|
|
781
|
+
interface MenuItem {
|
|
782
|
+
key: string;
|
|
783
|
+
label: ReactNode;
|
|
784
|
+
icon?: ReactNode;
|
|
785
|
+
/** Un raccourci affiché à droite. Purement indicatif : rien n'est écouté. */
|
|
786
|
+
shortcut?: string;
|
|
787
|
+
disabled?: boolean;
|
|
788
|
+
danger?: boolean;
|
|
789
|
+
/** Affiche une coche. `undefined` : l'entrée n'est pas cochable. */
|
|
790
|
+
checked?: boolean;
|
|
791
|
+
description?: ReactNode;
|
|
792
|
+
onSelect?: () => void;
|
|
793
|
+
}
|
|
794
|
+
interface MenuSeparator {
|
|
795
|
+
key: string;
|
|
796
|
+
type: "separator";
|
|
797
|
+
}
|
|
798
|
+
interface MenuLabel {
|
|
799
|
+
key: string;
|
|
800
|
+
type: "label";
|
|
801
|
+
label: ReactNode;
|
|
802
|
+
}
|
|
803
|
+
type MenuEntry = MenuItem | MenuSeparator | MenuLabel;
|
|
804
|
+
interface MenuListProps {
|
|
805
|
+
items: MenuEntry[];
|
|
806
|
+
onSelect: (item: MenuItem) => void;
|
|
807
|
+
onClose: () => void;
|
|
808
|
+
/** Index actif, piloté par le parent pour que le clavier suive. */
|
|
809
|
+
activeIndex: number;
|
|
810
|
+
onActiveIndexChange: (index: number) => void;
|
|
811
|
+
id?: string | undefined;
|
|
812
|
+
className?: string | undefined;
|
|
813
|
+
}
|
|
814
|
+
/**
|
|
815
|
+
* Le panneau seul, sans déclencheur.
|
|
816
|
+
*
|
|
817
|
+
* Extrait parce que `DropdownMenu` et `ContextMenu` n'ont en commun que lui :
|
|
818
|
+
* tout le reste — l'ancrage, le geste d'ouverture — diffère.
|
|
819
|
+
*/
|
|
820
|
+
declare function MenuList({ items, onSelect, onClose, activeIndex, onActiveIndexChange, id, className, }: MenuListProps): react_jsx_runtime.JSX.Element;
|
|
821
|
+
interface DropdownMenuProps {
|
|
822
|
+
items: MenuEntry[];
|
|
823
|
+
children: ReactElement<{
|
|
824
|
+
onClick?: () => void;
|
|
825
|
+
"aria-expanded"?: boolean;
|
|
826
|
+
}>;
|
|
827
|
+
onSelect?: (item: MenuItem) => void;
|
|
828
|
+
open?: boolean;
|
|
829
|
+
defaultOpen?: boolean;
|
|
830
|
+
onOpenChange?: (open: boolean) => void;
|
|
831
|
+
placement?: OverlayPlacement;
|
|
832
|
+
matchTriggerWidth?: boolean;
|
|
833
|
+
className?: string;
|
|
834
|
+
}
|
|
835
|
+
/**
|
|
836
|
+
* Un menu accroché à un bouton.
|
|
837
|
+
*
|
|
838
|
+
* Il repose sur `Overlay` : le repositionnement quand la place manque en bas,
|
|
839
|
+
* la fermeture au clic extérieur et à Échap sont déjà là et ne sont pas
|
|
840
|
+
* réécrites ici.
|
|
841
|
+
*/
|
|
842
|
+
declare function DropdownMenu({ items, children, onSelect, open: openProp, defaultOpen, onOpenChange, placement, matchTriggerWidth, className, }: DropdownMenuProps): react_jsx_runtime.JSX.Element;
|
|
843
|
+
interface ContextMenuProps {
|
|
844
|
+
items: MenuEntry[];
|
|
845
|
+
children: ReactNode;
|
|
846
|
+
onSelect?: (item: MenuItem) => void;
|
|
847
|
+
className?: string;
|
|
848
|
+
}
|
|
849
|
+
/**
|
|
850
|
+
* Le même menu, ouvert au clic droit sur une zone.
|
|
851
|
+
*
|
|
852
|
+
* L'ancre est un point, pas un élément : un repère de taille nulle est posé
|
|
853
|
+
* aux coordonnées du pointeur et confié à `Overlay`, qui ne voit pas la
|
|
854
|
+
* différence. C'est ce qui évite un second moteur de placement.
|
|
855
|
+
*/
|
|
856
|
+
declare function ContextMenu({ items, children, onSelect, className, }: ContextMenuProps): react_jsx_runtime.JSX.Element;
|
|
857
|
+
|
|
858
|
+
interface DurationDisplayProps {
|
|
859
|
+
milliseconds: number;
|
|
860
|
+
locale?: string;
|
|
861
|
+
style?: "short" | "long" | "clock";
|
|
862
|
+
className?: string;
|
|
863
|
+
}
|
|
864
|
+
declare function DurationDisplay({ milliseconds, locale, style, className }: DurationDisplayProps): react_jsx_runtime.JSX.Element;
|
|
865
|
+
|
|
866
|
+
interface EmptyStateProps {
|
|
867
|
+
icon?: ReactNode;
|
|
868
|
+
title: ReactNode;
|
|
869
|
+
description?: ReactNode;
|
|
870
|
+
action?: ReactNode;
|
|
871
|
+
compact?: boolean;
|
|
872
|
+
className?: string;
|
|
873
|
+
}
|
|
874
|
+
declare function EmptyState({ icon, title, description, action, compact, className }: EmptyStateProps): react_jsx_runtime.JSX.Element;
|
|
875
|
+
|
|
876
|
+
interface EntityMetaProps {
|
|
877
|
+
createdAt?: Date | string | number;
|
|
878
|
+
updatedAt?: Date | string | number;
|
|
879
|
+
createdBy?: ReactNode;
|
|
880
|
+
updatedBy?: ReactNode;
|
|
881
|
+
identifier?: string;
|
|
882
|
+
status?: ReactNode;
|
|
883
|
+
locale?: string;
|
|
884
|
+
className?: string;
|
|
885
|
+
}
|
|
886
|
+
declare function EntityMeta({ createdAt, updatedAt, createdBy, updatedBy, identifier, status, locale, className }: EntityMetaProps): react_jsx_runtime.JSX.Element;
|
|
887
|
+
|
|
888
|
+
interface ErrorStateProps {
|
|
889
|
+
title?: ReactNode;
|
|
890
|
+
description?: ReactNode;
|
|
891
|
+
error?: unknown;
|
|
892
|
+
action?: ReactNode;
|
|
893
|
+
onRetry?: () => void;
|
|
894
|
+
retryLabel?: string;
|
|
895
|
+
compact?: boolean;
|
|
896
|
+
className?: string;
|
|
897
|
+
}
|
|
898
|
+
declare function ErrorState({ title: titleProp, description, error, action, onRetry, retryLabel: retryLabelProp, compact, className }: ErrorStateProps): react_jsx_runtime.JSX.Element;
|
|
899
|
+
|
|
900
|
+
interface CalendarEvent {
|
|
901
|
+
id: string;
|
|
902
|
+
date: string;
|
|
903
|
+
title: string;
|
|
904
|
+
tone?: ComponentTone;
|
|
905
|
+
}
|
|
906
|
+
interface EventCalendarProps extends Omit<CalendarProps, "renderDay"> {
|
|
907
|
+
events: CalendarEvent[];
|
|
908
|
+
maxEventsPerDay?: number;
|
|
909
|
+
onEventClick?: (event: CalendarEvent) => void;
|
|
910
|
+
}
|
|
911
|
+
declare function EventCalendar({ events, maxEventsPerDay, onEventClick, ...props }: EventCalendarProps): react_jsx_runtime.JSX.Element;
|
|
912
|
+
|
|
913
|
+
interface InputProps extends InputHTMLAttributes<HTMLInputElement> {
|
|
914
|
+
invalid?: boolean;
|
|
915
|
+
left?: ReactNode;
|
|
916
|
+
right?: ReactNode;
|
|
917
|
+
loading?: boolean;
|
|
918
|
+
loadingLabel?: string;
|
|
919
|
+
spinnerProps?: Omit<SpinnerProps, "label">;
|
|
920
|
+
variant?: "solid" | "outline" | "ghost" | "underline";
|
|
921
|
+
tone?: ComponentTone;
|
|
922
|
+
inputSize?: "sm" | "md" | "lg";
|
|
923
|
+
radius?: "default" | "none" | "sm" | "lg" | "full";
|
|
924
|
+
}
|
|
925
|
+
declare const Input: react.ForwardRefExoticComponent<InputProps & react.RefAttributes<HTMLInputElement>>;
|
|
926
|
+
|
|
927
|
+
interface TextareaProps extends TextareaHTMLAttributes<HTMLTextAreaElement> {
|
|
928
|
+
invalid?: boolean;
|
|
929
|
+
resize?: "none" | "vertical" | "horizontal" | "both";
|
|
930
|
+
}
|
|
931
|
+
declare const Textarea: react.ForwardRefExoticComponent<TextareaProps & react.RefAttributes<HTMLTextAreaElement>>;
|
|
932
|
+
|
|
933
|
+
interface MultiSelectProps {
|
|
934
|
+
id?: string;
|
|
935
|
+
options: SelectOption[];
|
|
936
|
+
value?: string[];
|
|
937
|
+
defaultValue?: string[];
|
|
938
|
+
onValueChange?: (value: string[]) => void;
|
|
939
|
+
placeholder?: string;
|
|
940
|
+
searchable?: boolean;
|
|
941
|
+
disabled?: boolean;
|
|
942
|
+
className?: string;
|
|
943
|
+
"aria-describedby"?: string;
|
|
944
|
+
"aria-labelledby"?: string;
|
|
945
|
+
"aria-invalid"?: boolean;
|
|
946
|
+
"aria-required"?: boolean;
|
|
947
|
+
}
|
|
948
|
+
declare function MultiSelect({ id, options, value, defaultValue, onValueChange, placeholder, searchable, disabled, className, ...ariaProps }: MultiSelectProps): react_jsx_runtime.JSX.Element;
|
|
949
|
+
|
|
950
|
+
type RadioValue = string | number;
|
|
951
|
+
interface RadioGroupProps {
|
|
952
|
+
id?: string;
|
|
953
|
+
name?: string;
|
|
954
|
+
label?: ReactNode;
|
|
955
|
+
value?: RadioValue;
|
|
956
|
+
defaultValue?: RadioValue;
|
|
957
|
+
onValueChange?: (value: RadioValue) => void;
|
|
958
|
+
orientation?: "horizontal" | "vertical";
|
|
959
|
+
disabled?: boolean;
|
|
960
|
+
size?: "sm" | "md" | "lg";
|
|
961
|
+
tone?: ComponentTone;
|
|
962
|
+
className?: string;
|
|
963
|
+
"aria-describedby"?: string;
|
|
964
|
+
"aria-labelledby"?: string;
|
|
965
|
+
"aria-invalid"?: boolean;
|
|
966
|
+
"aria-required"?: boolean;
|
|
967
|
+
children: ReactNode;
|
|
968
|
+
}
|
|
969
|
+
declare function RadioGroup({ id, name, label, value, defaultValue, onValueChange, orientation, disabled, size, tone, className, children, ...ariaProps }: RadioGroupProps): react_jsx_runtime.JSX.Element;
|
|
970
|
+
interface RadioProps extends Omit<InputHTMLAttributes<HTMLInputElement>, "type" | "name" | "value" | "size"> {
|
|
971
|
+
value: RadioValue;
|
|
972
|
+
label?: ReactNode;
|
|
973
|
+
children?: ReactNode;
|
|
974
|
+
}
|
|
975
|
+
declare function Radio({ value, label, children, className, disabled, onChange, ...props }: RadioProps): react_jsx_runtime.JSX.Element;
|
|
976
|
+
interface RadioButtonProps {
|
|
977
|
+
value: RadioValue;
|
|
978
|
+
disabled?: boolean;
|
|
979
|
+
children: ReactNode;
|
|
980
|
+
className?: string;
|
|
981
|
+
}
|
|
982
|
+
declare function RadioButton({ value, disabled, children, className }: RadioButtonProps): react_jsx_runtime.JSX.Element;
|
|
983
|
+
|
|
984
|
+
interface SwitchProps extends Omit<ButtonHTMLAttributes<HTMLButtonElement>, "onChange"> {
|
|
985
|
+
checked?: boolean;
|
|
986
|
+
defaultChecked?: boolean;
|
|
987
|
+
label?: ReactNode;
|
|
988
|
+
onCheckedChange?: (checked: boolean) => void;
|
|
989
|
+
}
|
|
990
|
+
declare const Switch: react.ForwardRefExoticComponent<SwitchProps & react.RefAttributes<HTMLButtonElement>>;
|
|
991
|
+
|
|
992
|
+
interface FileUploadProps extends Omit<InputHTMLAttributes<HTMLInputElement>, "type" | "onChange"> {
|
|
993
|
+
label?: string;
|
|
994
|
+
description?: string;
|
|
995
|
+
onFilesChange?: (files: File[]) => void;
|
|
996
|
+
}
|
|
997
|
+
declare function FileUpload({ label, description, onFilesChange, className, multiple, accept, disabled, ...props }: FileUploadProps): react_jsx_runtime.JSX.Element;
|
|
998
|
+
|
|
999
|
+
interface ImageUploadProps extends Omit<FileUploadProps, "accept" | "onFilesChange"> {
|
|
1000
|
+
accept?: string;
|
|
1001
|
+
value?: string;
|
|
1002
|
+
onValueChange?: (file: File | null, previewUrl?: string) => void;
|
|
1003
|
+
previewAlt?: string;
|
|
1004
|
+
}
|
|
1005
|
+
declare function ImageUpload({ accept, value, onValueChange, previewAlt, className, ...props }: ImageUploadProps): react_jsx_runtime.JSX.Element;
|
|
1006
|
+
|
|
1007
|
+
type SliderRangeValue = [number, number];
|
|
1008
|
+
interface SliderProps {
|
|
1009
|
+
/** Nom du champ, quand le slider est posé dans un formulaire. */
|
|
1010
|
+
name?: string | undefined;
|
|
1011
|
+
/** Mode contrôlé. Laisser vide pour un slider non contrôlé. */
|
|
1012
|
+
value?: SliderValue | undefined;
|
|
1013
|
+
/** Valeur de départ en mode non contrôlé. */
|
|
1014
|
+
defaultValue?: SliderValue | undefined;
|
|
1015
|
+
min?: number | undefined;
|
|
1016
|
+
max?: number | undefined;
|
|
1017
|
+
step?: number | undefined;
|
|
1018
|
+
range?: boolean | undefined;
|
|
1019
|
+
onChange?: ((value: SliderValue) => void) | undefined;
|
|
1020
|
+
/**
|
|
1021
|
+
* Alias de `onChange`, tel que l'attendaient les composants du registre.
|
|
1022
|
+
* Les deux sont appelés.
|
|
1023
|
+
*/
|
|
1024
|
+
onValueChange?: ((value: SliderValue) => void) | undefined;
|
|
1025
|
+
/** Écart minimal entre les deux poignées, en mode plage. */
|
|
1026
|
+
minDistance?: number | undefined;
|
|
1027
|
+
/** Affiche la valeur courante à côté de la piste. */
|
|
1028
|
+
showValue?: boolean | undefined;
|
|
1029
|
+
/** Rendu de la valeur affichée — devise, unité, arrondi. */
|
|
1030
|
+
formatValue?: ((value: number) => string) | undefined;
|
|
1031
|
+
/** Libellé de la poignée basse, annoncé aux lecteurs d'écran. */
|
|
1032
|
+
startLabel?: string | undefined;
|
|
1033
|
+
/** Libellé de la poignée haute, en mode plage. */
|
|
1034
|
+
endLabel?: string | undefined;
|
|
1035
|
+
disabled?: boolean | undefined;
|
|
1036
|
+
className?: string | undefined;
|
|
1037
|
+
}
|
|
1038
|
+
|
|
1039
|
+
/**
|
|
1040
|
+
* Rendu DOM du slider.
|
|
1041
|
+
*
|
|
1042
|
+
* Tout le calcul — pas, bornes, pourcentages, poignée la plus proche,
|
|
1043
|
+
* non-croisement — vit dans `useSliderState`. Ce fichier ne garde que ce qui
|
|
1044
|
+
* est propre au web : la mesure de la piste, les événements souris et le JSX.
|
|
1045
|
+
*/
|
|
1046
|
+
declare function Slider({ name, value, defaultValue, min, max, step, range, minDistance, showValue, formatValue, startLabel, endLabel, onChange, onValueChange, disabled, className, }: SliderProps): react_jsx_runtime.JSX.Element;
|
|
1047
|
+
|
|
1048
|
+
interface RatingProps {
|
|
1049
|
+
id?: string;
|
|
1050
|
+
value?: number;
|
|
1051
|
+
defaultValue?: number;
|
|
1052
|
+
onValueChange?: (value: number) => void;
|
|
1053
|
+
max?: number;
|
|
1054
|
+
/** Autorise les demi-valeurs — 3,5 sur 5. */
|
|
1055
|
+
allowHalf?: boolean;
|
|
1056
|
+
allowClear?: boolean;
|
|
1057
|
+
disabled?: boolean;
|
|
1058
|
+
label?: string;
|
|
1059
|
+
className?: string;
|
|
1060
|
+
"aria-describedby"?: string;
|
|
1061
|
+
"aria-labelledby"?: string;
|
|
1062
|
+
"aria-invalid"?: boolean;
|
|
1063
|
+
"aria-required"?: boolean;
|
|
1064
|
+
}
|
|
1065
|
+
declare function Rating({ id, value, defaultValue, onValueChange, max, allowHalf, allowClear, disabled, label, className, ...ariaProps }: RatingProps): react_jsx_runtime.JSX.Element;
|
|
1066
|
+
|
|
1067
|
+
interface RichTextEditorProps extends Omit<HTMLAttributes<HTMLDivElement>, "onChange" | "defaultValue"> {
|
|
1068
|
+
value?: string;
|
|
1069
|
+
defaultValue?: string;
|
|
1070
|
+
onValueChange?: (html: string) => void;
|
|
1071
|
+
placeholder?: string;
|
|
1072
|
+
disabled?: boolean;
|
|
1073
|
+
}
|
|
1074
|
+
declare function RichTextEditor({ value, defaultValue, onValueChange, placeholder, disabled, className, ...props }: RichTextEditorProps): react_jsx_runtime.JSX.Element;
|
|
1075
|
+
|
|
1076
|
+
interface MarkdownEditorProps extends Omit<TextareaHTMLAttributes<HTMLTextAreaElement>, "value" | "defaultValue" | "onChange"> {
|
|
1077
|
+
value?: string;
|
|
1078
|
+
defaultValue?: string;
|
|
1079
|
+
onValueChange?: (value: string) => void;
|
|
1080
|
+
preview?: (value: string) => ReactNode;
|
|
1081
|
+
}
|
|
1082
|
+
declare function MarkdownEditor({ value, defaultValue, onValueChange, preview, className, ...props }: MarkdownEditorProps): react_jsx_runtime.JSX.Element;
|
|
1083
|
+
|
|
1084
|
+
interface JsonEditorProps extends Omit<TextareaHTMLAttributes<HTMLTextAreaElement>, "value" | "defaultValue" | "onChange"> {
|
|
1085
|
+
value?: string;
|
|
1086
|
+
defaultValue?: string;
|
|
1087
|
+
onValueChange?: (value: string, parsed: unknown | undefined) => void;
|
|
1088
|
+
formatOnBlur?: boolean;
|
|
1089
|
+
}
|
|
1090
|
+
declare function JsonEditor({ value, defaultValue, onValueChange, formatOnBlur, className, ...props }: JsonEditorProps): react_jsx_runtime.JSX.Element;
|
|
1091
|
+
|
|
1092
|
+
interface OtpInputProps {
|
|
1093
|
+
id?: string;
|
|
1094
|
+
value?: string;
|
|
1095
|
+
defaultValue?: string;
|
|
1096
|
+
onValueChange?: (value: string) => void;
|
|
1097
|
+
length?: number;
|
|
1098
|
+
inputMode?: "numeric" | "text";
|
|
1099
|
+
mask?: boolean;
|
|
1100
|
+
disabled?: boolean;
|
|
1101
|
+
className?: string;
|
|
1102
|
+
"aria-describedby"?: string;
|
|
1103
|
+
"aria-labelledby"?: string;
|
|
1104
|
+
"aria-invalid"?: boolean;
|
|
1105
|
+
"aria-required"?: boolean;
|
|
1106
|
+
}
|
|
1107
|
+
declare function OtpInput({ id, value, defaultValue, onValueChange, length, inputMode, mask, disabled, className, ...ariaProps }: OtpInputProps): react_jsx_runtime.JSX.Element;
|
|
1108
|
+
|
|
1109
|
+
interface TagsInputProps {
|
|
1110
|
+
id?: string;
|
|
1111
|
+
value?: string[];
|
|
1112
|
+
defaultValue?: string[];
|
|
1113
|
+
onValueChange?: (value: string[]) => void;
|
|
1114
|
+
placeholder?: string;
|
|
1115
|
+
separators?: string[];
|
|
1116
|
+
maxTags?: number;
|
|
1117
|
+
disabled?: boolean;
|
|
1118
|
+
className?: string;
|
|
1119
|
+
"aria-describedby"?: string;
|
|
1120
|
+
"aria-labelledby"?: string;
|
|
1121
|
+
"aria-invalid"?: boolean;
|
|
1122
|
+
"aria-required"?: boolean;
|
|
1123
|
+
}
|
|
1124
|
+
declare function TagsInput({ id, value, defaultValue, onValueChange, placeholder, separators, maxTags, disabled, className, ...ariaProps }: TagsInputProps): react_jsx_runtime.JSX.Element;
|
|
1125
|
+
|
|
1126
|
+
interface ReferenceOption extends SelectOption {
|
|
1127
|
+
description?: ReactNode;
|
|
1128
|
+
}
|
|
1129
|
+
interface ReferenceSelectProps extends Omit<AutocompleteProps, "options"> {
|
|
1130
|
+
options: ReferenceOption[];
|
|
1131
|
+
}
|
|
1132
|
+
declare function ReferenceSelect({ options, ...props }: ReferenceSelectProps): react_jsx_runtime.JSX.Element;
|
|
1133
|
+
|
|
1134
|
+
type FieldType = "text" | "textarea" | "email" | "password" | "phone" | "number" | "currency" | "date" | "time" | "datetime" | "select" | "multiselect" | "radio" | "checkbox" | "switch" | "file" | "image" | "slider" | "rating" | "color" | "rich-text" | "markdown" | "json" | "otp" | "tags" | "autocomplete" | "reference" | "hidden";
|
|
1135
|
+
type FieldStatus = "default" | "error" | "success" | "warning";
|
|
1136
|
+
type FieldControlProps = {
|
|
1137
|
+
id?: string;
|
|
1138
|
+
"aria-describedby"?: string;
|
|
1139
|
+
"aria-labelledby"?: string;
|
|
1140
|
+
"aria-invalid"?: boolean;
|
|
1141
|
+
"aria-required"?: boolean;
|
|
1142
|
+
};
|
|
1143
|
+
type FieldValue = string | number | SliderRangeValue | boolean | string[] | DateTimeValue | File[] | File | null | undefined;
|
|
1144
|
+
type ControlProps = Partial<InputProps & TextareaProps & CurrencyInputProps & DatePickerProps & TimePickerProps & DateTimePickerProps & SelectProps & MultiSelectProps & RadioGroupProps & CheckboxProps & SwitchProps & FileUploadProps & ImageUploadProps & SliderProps & RatingProps & ColorPickerProps & RichTextEditorProps & MarkdownEditorProps & JsonEditorProps & OtpInputProps & TagsInputProps & AutocompleteProps & ReferenceSelectProps>;
|
|
1145
|
+
/**
|
|
1146
|
+
* Un branchement de formulaire, quel que soit le type exact de sa valeur.
|
|
1147
|
+
*
|
|
1148
|
+
* `onChange` est écrit en syntaxe de méthode, et ce n'est pas un détail :
|
|
1149
|
+
* TypeScript compare alors ses paramètres de façon bivariante. Sans cela, un
|
|
1150
|
+
* `FieldBinding<string>` — ce que rend `form.bind("email")` — serait refusé
|
|
1151
|
+
* ici, puisque le champ manipule une valeur plus large que la chaîne. Il
|
|
1152
|
+
* faudrait un `as` à chaque branchement.
|
|
1153
|
+
*/
|
|
1154
|
+
interface FieldBindingLike {
|
|
1155
|
+
name: string;
|
|
1156
|
+
value: FieldValue;
|
|
1157
|
+
onChange(value: unknown): void;
|
|
1158
|
+
onBlur(): void;
|
|
1159
|
+
error?: string | undefined;
|
|
1160
|
+
disabled?: boolean | undefined;
|
|
1161
|
+
required?: boolean | undefined;
|
|
1162
|
+
}
|
|
1163
|
+
interface FieldProps {
|
|
1164
|
+
/**
|
|
1165
|
+
* Le branchement d'un formulaire, en une prop.
|
|
1166
|
+
*
|
|
1167
|
+
* `<Field label="Courriel" field={form.bind("email")} />` : nom, valeur,
|
|
1168
|
+
* changement, sortie de champ et message d'erreur arrivent ensemble. Le
|
|
1169
|
+
* champ ne sait pas d'où vient l'objet — `useLocalForm`, un adaptateur
|
|
1170
|
+
* react-hook-form, ou trois `useState`. C'est tout l'intérêt du contrat :
|
|
1171
|
+
* aucune bibliothèque de formulaires n'est importée ici.
|
|
1172
|
+
*
|
|
1173
|
+
* Les props écrites explicitement l'emportent, pour corriger un cas isolé
|
|
1174
|
+
* sans démonter le branchement.
|
|
1175
|
+
*/
|
|
1176
|
+
field?: FieldBindingLike | undefined;
|
|
1177
|
+
/** Appelé quand le champ est quitté. Déclenche la validation « au blur ». */
|
|
1178
|
+
onBlur?: (() => void) | undefined;
|
|
1179
|
+
type?: FieldType;
|
|
1180
|
+
label?: ReactNode;
|
|
1181
|
+
helpText?: ReactNode;
|
|
1182
|
+
description?: ReactNode;
|
|
1183
|
+
status?: FieldStatus;
|
|
1184
|
+
message?: ReactNode;
|
|
1185
|
+
error?: ReactNode;
|
|
1186
|
+
warning?: ReactNode;
|
|
1187
|
+
success?: ReactNode;
|
|
1188
|
+
required?: boolean;
|
|
1189
|
+
optional?: boolean;
|
|
1190
|
+
optionalLabel?: ReactNode;
|
|
1191
|
+
htmlFor?: string;
|
|
1192
|
+
orientation?: "vertical" | "horizontal";
|
|
1193
|
+
className?: string;
|
|
1194
|
+
name?: string;
|
|
1195
|
+
value?: FieldValue;
|
|
1196
|
+
defaultValue?: FieldValue;
|
|
1197
|
+
onValueChange?: (value: FieldValue) => void;
|
|
1198
|
+
options?: SelectOption[];
|
|
1199
|
+
referenceOptions?: ReferenceOption[];
|
|
1200
|
+
controlLabel?: ReactNode;
|
|
1201
|
+
placeholder?: string;
|
|
1202
|
+
disabled?: boolean;
|
|
1203
|
+
controlProps?: ControlProps;
|
|
1204
|
+
children?: ReactElement<FieldControlProps>;
|
|
1205
|
+
}
|
|
1206
|
+
declare function Field(rawProps: FieldProps): react_jsx_runtime.JSX.Element;
|
|
1207
|
+
|
|
1208
|
+
interface FiltersBarProps {
|
|
1209
|
+
search?: ReactNode;
|
|
1210
|
+
filters?: ReactNode;
|
|
1211
|
+
actions?: ReactNode;
|
|
1212
|
+
activeCount?: number;
|
|
1213
|
+
onReset?: () => void;
|
|
1214
|
+
resetLabel?: string;
|
|
1215
|
+
className?: string;
|
|
1216
|
+
}
|
|
1217
|
+
declare function FiltersBar({ search, filters, actions, activeCount, onReset, resetLabel: resetLabelProp, className }: FiltersBarProps): react_jsx_runtime.JSX.Element;
|
|
1218
|
+
|
|
1219
|
+
/** Un champ du formulaire : les props de `Field`, plus sa place. */
|
|
1220
|
+
interface FormFieldConfig extends Omit<FieldProps, "field" | "name"> {
|
|
1221
|
+
/** La clé dans les valeurs. C'est elle qui branche le champ. */
|
|
1222
|
+
name: string;
|
|
1223
|
+
/** Nombre de colonnes occupées. Ignoré sur une seule colonne. */
|
|
1224
|
+
colSpan?: number;
|
|
1225
|
+
rowSpan?: number;
|
|
1226
|
+
}
|
|
1227
|
+
/** Un groupe de champs, avec son titre et sa propre grille. */
|
|
1228
|
+
interface FormFieldGroup {
|
|
1229
|
+
group: string;
|
|
1230
|
+
description?: ReactNode;
|
|
1231
|
+
columns?: number;
|
|
1232
|
+
fields: FormFieldConfig[];
|
|
1233
|
+
}
|
|
1234
|
+
type FormEntry = FormFieldConfig | FormFieldGroup;
|
|
1235
|
+
/**
|
|
1236
|
+
* Les valeurs qu'un formulaire déclaratif peut porter.
|
|
1237
|
+
*
|
|
1238
|
+
* Plus étroit que `FormValues` volontairement : ce formulaire rend ses
|
|
1239
|
+
* champs avec `Field`, qui ne sait afficher que ces types-là. Un objet
|
|
1240
|
+
* imbriqué n'aurait pas de contrôle pour le montrer.
|
|
1241
|
+
*/
|
|
1242
|
+
type FormShape = Record<string, FieldValue>;
|
|
1243
|
+
interface FormProps<TValues extends FormShape = FormShape> {
|
|
1244
|
+
fields: FormEntry[];
|
|
1245
|
+
/**
|
|
1246
|
+
* L'adaptateur de formulaire.
|
|
1247
|
+
*
|
|
1248
|
+
* Sans lui, un `useLocalForm` est monté en interne à partir de
|
|
1249
|
+
* `defaultValues`, `validate` et `onSubmit`. Avec lui — react-hook-form,
|
|
1250
|
+
* Formik, votre propre magasin — le formulaire ne fait plus que rendre.
|
|
1251
|
+
*/
|
|
1252
|
+
form?: FormAdapter<TValues>;
|
|
1253
|
+
defaultValues?: TValues;
|
|
1254
|
+
/** La validation. Un schéma Zod s'y branche en cinq lignes. */
|
|
1255
|
+
validate?: FormValidator<TValues>;
|
|
1256
|
+
onSubmit?: (values: TValues) => void | Promise<void>;
|
|
1257
|
+
columns?: number;
|
|
1258
|
+
submitText?: ReactNode;
|
|
1259
|
+
clearText?: ReactNode;
|
|
1260
|
+
showClear?: boolean;
|
|
1261
|
+
submitProps?: ButtonProps;
|
|
1262
|
+
/** Remplace entièrement la barre de boutons. */
|
|
1263
|
+
actions?: ReactNode;
|
|
1264
|
+
loading?: boolean;
|
|
1265
|
+
/** Désactive l'envoi tant que rien n'a changé. */
|
|
1266
|
+
requireDirty?: boolean;
|
|
1267
|
+
/** Désactive l'envoi tant qu'une erreur est en vigueur. */
|
|
1268
|
+
requireValid?: boolean;
|
|
1269
|
+
className?: string;
|
|
1270
|
+
}
|
|
1271
|
+
/**
|
|
1272
|
+
* Un formulaire décrit par ses champs.
|
|
1273
|
+
*
|
|
1274
|
+
* Il ne connaît aucune bibliothèque de formulaires : il reçoit un
|
|
1275
|
+
* `FormAdapter`, ou en monte un lui-même. C'est ce qui lui permet de servir un
|
|
1276
|
+
* projet sous react-hook-form et un projet sans rien, avec le même code.
|
|
1277
|
+
*
|
|
1278
|
+
* ```tsx
|
|
1279
|
+
* <Form
|
|
1280
|
+
* columns={2}
|
|
1281
|
+
* defaultValues={{ nom: "", email: "" }}
|
|
1282
|
+
* validate={createValidator({ nom: [required()], email: [required(), email()] })}
|
|
1283
|
+
* onSubmit={(values) => api.post("/clients", { body: values })}
|
|
1284
|
+
* fields={[
|
|
1285
|
+
* { name: "nom", label: "Nom du client", required: true },
|
|
1286
|
+
* { name: "email", label: "Adresse e-mail", type: "email", required: true },
|
|
1287
|
+
* ]}
|
|
1288
|
+
* />
|
|
1289
|
+
* ```
|
|
1290
|
+
*/
|
|
1291
|
+
declare function Form<TValues extends FormShape = FormShape>({ fields, form: adapter, defaultValues, validate, onSubmit, columns, submitText, clearText, showClear, submitProps, actions, loading, requireDirty, requireValid, className, }: FormProps<TValues>): react_jsx_runtime.JSX.Element;
|
|
1292
|
+
|
|
1293
|
+
interface HoverCardProps {
|
|
1294
|
+
content: ReactNode;
|
|
1295
|
+
children: ReactElement<{
|
|
1296
|
+
onMouseEnter?: () => void;
|
|
1297
|
+
onFocus?: () => void;
|
|
1298
|
+
}>;
|
|
1299
|
+
/**
|
|
1300
|
+
* Délai avant ouverture. Il n'est pas cosmétique : sans lui, traverser la
|
|
1301
|
+
* page avec la souris ouvre et ferme une dizaine de panneaux au passage.
|
|
1302
|
+
*/
|
|
1303
|
+
openDelay?: number;
|
|
1304
|
+
/** Délai avant fermeture, le temps d'atteindre le panneau à la souris. */
|
|
1305
|
+
closeDelay?: number;
|
|
1306
|
+
placement?: OverlayPlacement;
|
|
1307
|
+
open?: boolean;
|
|
1308
|
+
onOpenChange?: (open: boolean) => void;
|
|
1309
|
+
width?: number | string;
|
|
1310
|
+
className?: string;
|
|
1311
|
+
}
|
|
1312
|
+
/**
|
|
1313
|
+
* Un aperçu au survol.
|
|
1314
|
+
*
|
|
1315
|
+
* Ce n'est pas un `Tooltip` : celui-ci porte une phrase et se lit d'un coup
|
|
1316
|
+
* d'œil, celui-là porte du contenu — une fiche, un résumé, une image — que
|
|
1317
|
+
* l'on peut vouloir survoler à son tour, voire sélectionner.
|
|
1318
|
+
*/
|
|
1319
|
+
declare function HoverCard({ content, children, openDelay, closeDelay, placement, open: openProp, onOpenChange, width, className, }: HoverCardProps): react_jsx_runtime.JSX.Element;
|
|
1320
|
+
|
|
1321
|
+
interface IconButtonProps extends ButtonHTMLAttributes<HTMLButtonElement> {
|
|
1322
|
+
label: string;
|
|
1323
|
+
icon: ReactNode;
|
|
1324
|
+
variant?: "solid" | "outline" | "ghost";
|
|
1325
|
+
size?: "sm" | "md" | "lg";
|
|
1326
|
+
radius?: "default" | "none" | "sm" | "lg" | "full";
|
|
1327
|
+
tooltip?: Omit<TooltipProps, "children">;
|
|
1328
|
+
}
|
|
1329
|
+
declare const IconButton: react.ForwardRefExoticComponent<IconButtonProps & react.RefAttributes<HTMLButtonElement>>;
|
|
1330
|
+
|
|
1331
|
+
type IconProps = SVGProps<SVGSVGElement>;
|
|
1332
|
+
declare function CalendarIcon(props: IconProps): react_jsx_runtime.JSX.Element;
|
|
1333
|
+
declare function ClockIcon(props: IconProps): react_jsx_runtime.JSX.Element;
|
|
1334
|
+
declare function ChevronLeftIcon(props: IconProps): react_jsx_runtime.JSX.Element;
|
|
1335
|
+
declare function ChevronRightIcon(props: IconProps): react_jsx_runtime.JSX.Element;
|
|
1336
|
+
declare function ChevronDownIcon(props: IconProps): react_jsx_runtime.JSX.Element;
|
|
1337
|
+
declare function XIcon(props: IconProps): react_jsx_runtime.JSX.Element;
|
|
1338
|
+
declare function ArrowRightIcon(props: IconProps): react_jsx_runtime.JSX.Element;
|
|
1339
|
+
declare function CheckIcon(props: IconProps): react_jsx_runtime.JSX.Element;
|
|
1340
|
+
declare function ChevronUpIcon(props: IconProps): react_jsx_runtime.JSX.Element;
|
|
1341
|
+
declare function SearchIcon(props: IconProps): react_jsx_runtime.JSX.Element;
|
|
1342
|
+
declare function StarIcon({ fill, ...props }: IconProps): react_jsx_runtime.JSX.Element;
|
|
1343
|
+
declare function PlusIcon(props: IconProps): react_jsx_runtime.JSX.Element;
|
|
1344
|
+
declare function MinusIcon(props: IconProps): react_jsx_runtime.JSX.Element;
|
|
1345
|
+
declare function MoreHorizontalIcon(props: IconProps): react_jsx_runtime.JSX.Element;
|
|
1346
|
+
declare function TrashIcon(props: IconProps): react_jsx_runtime.JSX.Element;
|
|
1347
|
+
declare function UploadIcon(props: IconProps): react_jsx_runtime.JSX.Element;
|
|
1348
|
+
declare function AlertCircleIcon(props: IconProps): react_jsx_runtime.JSX.Element;
|
|
1349
|
+
declare function InfoIcon(props: IconProps): react_jsx_runtime.JSX.Element;
|
|
1350
|
+
declare function EyeIcon(props: IconProps): react_jsx_runtime.JSX.Element;
|
|
1351
|
+
declare function EyeOffIcon(props: IconProps): react_jsx_runtime.JSX.Element;
|
|
1352
|
+
|
|
1353
|
+
interface InputNumberProps extends Omit<InputProps, "value" | "defaultValue" | "onChange" | "type" | "right"> {
|
|
1354
|
+
value?: number | null;
|
|
1355
|
+
defaultValue?: number | null;
|
|
1356
|
+
onValueChange?: (value: number | null) => void;
|
|
1357
|
+
min?: number;
|
|
1358
|
+
max?: number;
|
|
1359
|
+
step?: number;
|
|
1360
|
+
/** Nombre de décimales. Omis, la saisie est laissée telle quelle. */
|
|
1361
|
+
precision?: number;
|
|
1362
|
+
/** Cache les boutons et ne garde que les flèches du clavier. */
|
|
1363
|
+
hideControls?: boolean;
|
|
1364
|
+
/** Unité affichée à droite : kg, %, jours. */
|
|
1365
|
+
suffix?: string;
|
|
1366
|
+
}
|
|
1367
|
+
/**
|
|
1368
|
+
* Une saisie numérique avec incrément.
|
|
1369
|
+
*
|
|
1370
|
+
* Le champ reste en `type="text"` avec `inputMode="decimal"` : le `number`
|
|
1371
|
+
* natif refuse `maxLength`, accepte `1e5` et `--`, et perd silencieusement sa
|
|
1372
|
+
* valeur quand elle ne lui plaît pas. On garde le clavier numérique sur
|
|
1373
|
+
* mobile, on renonce au reste.
|
|
1374
|
+
*/
|
|
1375
|
+
declare const InputNumber: react.ForwardRefExoticComponent<InputNumberProps & react.RefAttributes<HTMLInputElement>>;
|
|
1376
|
+
|
|
1377
|
+
interface KpiGridProps extends HTMLAttributes<HTMLDivElement> {
|
|
1378
|
+
columns?: 1 | 2 | 3 | 4;
|
|
1379
|
+
}
|
|
1380
|
+
declare function KpiGrid({ columns, className, ...props }: KpiGridProps): react_jsx_runtime.JSX.Element;
|
|
1381
|
+
|
|
1382
|
+
interface LabelProps extends react.LabelHTMLAttributes<HTMLLabelElement> {
|
|
1383
|
+
/** Le ton du libellé. Par défaut, la couleur du texte courant. */
|
|
1384
|
+
tone?: ComponentTone;
|
|
1385
|
+
/** Marque le champ comme obligatoire d'une astérisque. */
|
|
1386
|
+
required?: boolean;
|
|
1387
|
+
/** Atténue le libellé — une mention secondaire, une unité. */
|
|
1388
|
+
muted?: boolean;
|
|
1389
|
+
}
|
|
1390
|
+
/** Alias historique, attendu par les composants venus du registre. */
|
|
1391
|
+
type ILabelProps = LabelProps;
|
|
1392
|
+
declare const Label: react.ForwardRefExoticComponent<LabelProps & react.RefAttributes<HTMLLabelElement>>;
|
|
1393
|
+
|
|
1394
|
+
declare function MiniCalendar({ className, ...props }: CalendarProps): react_jsx_runtime.JSX.Element;
|
|
1395
|
+
|
|
1396
|
+
interface ModalProps {
|
|
1397
|
+
open: boolean;
|
|
1398
|
+
onOpenChange: (open: boolean) => void;
|
|
1399
|
+
title: ReactNode;
|
|
1400
|
+
description?: ReactNode;
|
|
1401
|
+
children?: ReactNode;
|
|
1402
|
+
footer?: ReactNode;
|
|
1403
|
+
closeOnBackdrop?: boolean;
|
|
1404
|
+
closeLabel?: string;
|
|
1405
|
+
className?: string;
|
|
1406
|
+
}
|
|
1407
|
+
declare function Modal({ open, onOpenChange, title, description, children, footer, closeOnBackdrop, closeLabel: closeLabelProp, className }: ModalProps): react.ReactPortal | null;
|
|
1408
|
+
|
|
1409
|
+
interface MonthPickerProps extends Omit<InputHTMLAttributes<HTMLInputElement>, "type" | "onChange"> {
|
|
1410
|
+
onValueChange?: (value: string) => void;
|
|
1411
|
+
invalid?: boolean;
|
|
1412
|
+
}
|
|
1413
|
+
declare const MonthPicker: react.ForwardRefExoticComponent<MonthPickerProps & react.RefAttributes<HTMLInputElement>>;
|
|
1414
|
+
|
|
1415
|
+
interface PageHeaderProps {
|
|
1416
|
+
title: ReactNode;
|
|
1417
|
+
description?: ReactNode;
|
|
1418
|
+
eyebrow?: ReactNode;
|
|
1419
|
+
actions?: ReactNode;
|
|
1420
|
+
className?: string;
|
|
1421
|
+
}
|
|
1422
|
+
declare function PageHeader({ title, description, eyebrow, actions, className }: PageHeaderProps): react_jsx_runtime.JSX.Element;
|
|
1423
|
+
|
|
1424
|
+
interface PaginationProps {
|
|
1425
|
+
page: number;
|
|
1426
|
+
totalPages: number;
|
|
1427
|
+
onPageChange: (page: number) => void;
|
|
1428
|
+
siblingCount?: number;
|
|
1429
|
+
previousLabel?: string;
|
|
1430
|
+
nextLabel?: string;
|
|
1431
|
+
/**
|
|
1432
|
+
* Ajoute un champ pour sauter directement à une page.
|
|
1433
|
+
*
|
|
1434
|
+
* Sur quarante pages, atteindre la vingt-septième demande sinon de cliquer
|
|
1435
|
+
* dans les ellipses jusqu'à ce qu'elle apparaisse.
|
|
1436
|
+
*/
|
|
1437
|
+
jumpTo?: boolean;
|
|
1438
|
+
/** Affiche « Page 3 sur 40 » à côté des numéros. */
|
|
1439
|
+
showTotal?: boolean;
|
|
1440
|
+
/** Masque les libellés et ne garde que les flèches. */
|
|
1441
|
+
compact?: boolean;
|
|
1442
|
+
ariaLabel?: string;
|
|
1443
|
+
className?: string;
|
|
1444
|
+
}
|
|
1445
|
+
/**
|
|
1446
|
+
* La navigation entre les pages.
|
|
1447
|
+
*
|
|
1448
|
+
* Le calcul des numéros et des ellipses vient de `@sia-ui/headless` :
|
|
1449
|
+
* `usePagination` et ce composant appliquent la même règle, écrite une fois.
|
|
1450
|
+
*/
|
|
1451
|
+
declare function Pagination({ page, totalPages, onPageChange, siblingCount, previousLabel: previousLabelProp, nextLabel: nextLabelProp, jumpTo, showTotal, compact, ariaLabel, className, }: PaginationProps): react_jsx_runtime.JSX.Element | null;
|
|
1452
|
+
|
|
1453
|
+
interface PasswordStrength {
|
|
1454
|
+
/** De 0 à 4. */
|
|
1455
|
+
score: number;
|
|
1456
|
+
label: string;
|
|
1457
|
+
}
|
|
1458
|
+
interface PasswordInputProps extends Omit<InputProps, "type" | "right"> {
|
|
1459
|
+
/** Affiche une jauge sous le champ. */
|
|
1460
|
+
showStrength?: boolean;
|
|
1461
|
+
/** Retire le bouton d'affichage — pour un champ de confirmation. */
|
|
1462
|
+
hideToggle?: boolean;
|
|
1463
|
+
/**
|
|
1464
|
+
* Remplace l'évaluation par défaut. Un projet qui utilise `zxcvbn` branche
|
|
1465
|
+
* son résultat ici; le composant ne dépend de rien.
|
|
1466
|
+
*/
|
|
1467
|
+
evaluate?: (value: string) => PasswordStrength;
|
|
1468
|
+
}
|
|
1469
|
+
/**
|
|
1470
|
+
* Un champ de mot de passe.
|
|
1471
|
+
*
|
|
1472
|
+
* Le bouton d'affichage n'est pas un confort : sur mobile, taper une phrase
|
|
1473
|
+
* de passe à l'aveugle est la première raison pour laquelle les gens en
|
|
1474
|
+
* choisissent une courte.
|
|
1475
|
+
*/
|
|
1476
|
+
declare const PasswordInput: react.ForwardRefExoticComponent<PasswordInputProps & react.RefAttributes<HTMLInputElement>>;
|
|
1477
|
+
|
|
1478
|
+
interface PermissionGateProps {
|
|
1479
|
+
permissions: string[];
|
|
1480
|
+
require: string | string[];
|
|
1481
|
+
mode?: "all" | "any";
|
|
1482
|
+
fallback?: ReactNode;
|
|
1483
|
+
children: ReactNode;
|
|
1484
|
+
}
|
|
1485
|
+
declare function PermissionGate({ permissions, require, mode, fallback, children }: PermissionGateProps): react_jsx_runtime.JSX.Element;
|
|
1486
|
+
|
|
1487
|
+
interface PhoneCountry {
|
|
1488
|
+
/** Code ISO 3166-1 alpha-2. */
|
|
1489
|
+
code: string;
|
|
1490
|
+
/** Indicatif, avec le `+`. */
|
|
1491
|
+
dial: string;
|
|
1492
|
+
label: string;
|
|
1493
|
+
flag: string;
|
|
1494
|
+
/** Nombre de chiffres attendus après l'indicatif. */
|
|
1495
|
+
digits?: number;
|
|
1496
|
+
/** Découpage visuel du numéro national : `[1, 2, 2, 2, 2]` → `6 12 34 56 78`. */
|
|
1497
|
+
groups?: number[];
|
|
1498
|
+
}
|
|
1499
|
+
/**
|
|
1500
|
+
* Les pays servis par défaut.
|
|
1501
|
+
*
|
|
1502
|
+
* Volontairement court et centré sur la zone franc : une liste mondiale pèse
|
|
1503
|
+
* 40 ko pour être fausse six mois plus tard. La prop `countries` la remplace
|
|
1504
|
+
* entièrement quand un projet en a besoin d'une autre.
|
|
1505
|
+
*/
|
|
1506
|
+
declare const DEFAULT_COUNTRIES: PhoneCountry[];
|
|
1507
|
+
interface PhoneInputProps extends Omit<InputProps, "value" | "defaultValue" | "onChange" | "type" | "left"> {
|
|
1508
|
+
/** Le numéro complet, indicatif compris : `+237612345678`. */
|
|
1509
|
+
value?: string;
|
|
1510
|
+
defaultValue?: string;
|
|
1511
|
+
/** Reçoit toujours la forme E.164, sans espaces. */
|
|
1512
|
+
onValueChange?: (value: string) => void;
|
|
1513
|
+
countries?: PhoneCountry[];
|
|
1514
|
+
/** Pays présélectionné, par code ISO. */
|
|
1515
|
+
defaultCountry?: string;
|
|
1516
|
+
/** Verrouille le pays et masque le sélecteur. */
|
|
1517
|
+
lockCountry?: boolean;
|
|
1518
|
+
}
|
|
1519
|
+
/**
|
|
1520
|
+
* Un numéro de téléphone international.
|
|
1521
|
+
*
|
|
1522
|
+
* L'indicatif et le numéro national sont deux champs distincts, parce qu'une
|
|
1523
|
+
* seule zone de saisie oblige à taper le `+237` à chaque fois — ce que
|
|
1524
|
+
* personne ne fait, d'où des numéros enregistrés sans indicatif.
|
|
1525
|
+
*
|
|
1526
|
+
* Aucune validation réelle n'est tentée : `libphonenumber-js` fait cela bien,
|
|
1527
|
+
* pèse 145 ko, et se branche par-dessus si un projet en a besoin. Ici, le
|
|
1528
|
+
* découpage visuel et la forme E.164 en sortie.
|
|
1529
|
+
*/
|
|
1530
|
+
declare const PhoneInput: react.ForwardRefExoticComponent<PhoneInputProps & react.RefAttributes<HTMLInputElement>>;
|
|
1531
|
+
|
|
1532
|
+
interface PopoverProps {
|
|
1533
|
+
content: ReactNode;
|
|
1534
|
+
title?: ReactNode;
|
|
1535
|
+
children: ReactElement<{
|
|
1536
|
+
onClick?: () => void;
|
|
1537
|
+
"aria-expanded"?: boolean;
|
|
1538
|
+
}>;
|
|
1539
|
+
open?: boolean;
|
|
1540
|
+
defaultOpen?: boolean;
|
|
1541
|
+
onOpenChange?: (open: boolean) => void;
|
|
1542
|
+
placement?: OverlayPlacement;
|
|
1543
|
+
trigger?: "click" | "hover";
|
|
1544
|
+
variant?: "solid" | "outline";
|
|
1545
|
+
tone?: ComponentTone;
|
|
1546
|
+
disabled?: boolean;
|
|
1547
|
+
className?: string;
|
|
1548
|
+
}
|
|
1549
|
+
declare function Popover({ content, title, children, open: openProp, defaultOpen, onOpenChange, placement, trigger, variant, tone, disabled, className }: PopoverProps): react_jsx_runtime.JSX.Element;
|
|
1550
|
+
|
|
1551
|
+
interface ProgressProps {
|
|
1552
|
+
/** La valeur courante. Omise, la barre passe en indéterminé. */
|
|
1553
|
+
value?: number | undefined;
|
|
1554
|
+
max?: number;
|
|
1555
|
+
shape?: "bar" | "circle";
|
|
1556
|
+
tone?: ComponentTone;
|
|
1557
|
+
size?: ComponentSize;
|
|
1558
|
+
/** Épaisseur du trait, en pixels. Par défaut selon la taille. */
|
|
1559
|
+
thickness?: number | undefined;
|
|
1560
|
+
/** Affiche le pourcentage — au centre du cercle, en bout de barre. */
|
|
1561
|
+
showValue?: boolean;
|
|
1562
|
+
/** Remplace l'affichage par défaut. */
|
|
1563
|
+
format?: ((percent: number, value: number, max: number) => ReactNode) | undefined;
|
|
1564
|
+
label?: ReactNode;
|
|
1565
|
+
className?: string;
|
|
1566
|
+
}
|
|
1567
|
+
/**
|
|
1568
|
+
* L'avancement d'une tâche.
|
|
1569
|
+
*
|
|
1570
|
+
* Sans `value`, le composant passe en indéterminé plutôt que d'afficher zéro :
|
|
1571
|
+
* « je travaille » et « je n'ai rien fait » ne se ressemblent pas.
|
|
1572
|
+
*/
|
|
1573
|
+
declare function Progress(props: ProgressProps): react_jsx_runtime.JSX.Element;
|
|
1574
|
+
|
|
1575
|
+
interface QRCodeProps {
|
|
1576
|
+
value: string;
|
|
1577
|
+
size?: number;
|
|
1578
|
+
label?: string;
|
|
1579
|
+
render?: (value: string, size: number) => ReactNode;
|
|
1580
|
+
className?: string;
|
|
1581
|
+
}
|
|
1582
|
+
declare function QRCode({ value, size, label, render, className }: QRCodeProps): react_jsx_runtime.JSX.Element;
|
|
1583
|
+
|
|
1584
|
+
interface RelativeTimeProps extends Omit<HTMLAttributes<HTMLTimeElement>, "dateTime"> {
|
|
1585
|
+
value: Date | string | number;
|
|
1586
|
+
locale?: string;
|
|
1587
|
+
prefix?: string;
|
|
1588
|
+
refreshInterval?: number;
|
|
1589
|
+
}
|
|
1590
|
+
declare function RelativeTime({ value, locale, prefix, refreshInterval, className, title, ...props }: RelativeTimeProps): react_jsx_runtime.JSX.Element | null;
|
|
1591
|
+
|
|
1592
|
+
interface RequireSessionProps<TUser, TTenant, TRule> {
|
|
1593
|
+
session: SessionStore<TUser, TTenant, TRule>;
|
|
1594
|
+
children: ReactNode;
|
|
1595
|
+
/** La règle de droits exigée, s'il y en a une. */
|
|
1596
|
+
require?: TRule;
|
|
1597
|
+
/**
|
|
1598
|
+
* Affiché pendant la vérification.
|
|
1599
|
+
*
|
|
1600
|
+
* Ce rendu est ce qui distingue cette garde d'un `if (!user) redirect` :
|
|
1601
|
+
* tant que le serveur n'a pas répondu, on attend. Rediriger pendant la
|
|
1602
|
+
* vérification renvoie à la page de connexion quelqu'un qui est connecté.
|
|
1603
|
+
*/
|
|
1604
|
+
pending?: ReactNode;
|
|
1605
|
+
/** Rendu quand il n'y a pas de session. */
|
|
1606
|
+
fallback?: ReactNode;
|
|
1607
|
+
/** Rendu quand la session existe mais que les droits manquent. */
|
|
1608
|
+
forbidden?: ReactNode;
|
|
1609
|
+
/** Laisse passer une session `incomplete` — profil pas encore rempli. */
|
|
1610
|
+
allowIncomplete?: boolean;
|
|
1611
|
+
/**
|
|
1612
|
+
* Appelé une fois quand la vérification conclut à l'absence de session.
|
|
1613
|
+
*
|
|
1614
|
+
* C'est ici que l'application navigue : `navigate("/login")`,
|
|
1615
|
+
* `router.push(…)`, ou rien du tout si `fallback` suffit. La garde ne
|
|
1616
|
+
* connaît aucun routeur.
|
|
1617
|
+
*/
|
|
1618
|
+
onUnauthenticated?: (state: SessionState<TUser, TTenant>) => void;
|
|
1619
|
+
onForbidden?: (state: SessionState<TUser, TTenant>) => void;
|
|
1620
|
+
onIncomplete?: (state: SessionState<TUser, TTenant>) => void;
|
|
1621
|
+
className?: string;
|
|
1622
|
+
}
|
|
1623
|
+
/**
|
|
1624
|
+
* Ce qui se trouve derrière une session valide.
|
|
1625
|
+
*
|
|
1626
|
+
* Écrite cinq fois dans les projets du disque D, cinq fois de la même façon
|
|
1627
|
+
* à la cible de redirection près. Elle ne dépend d'aucun routeur : elle rend
|
|
1628
|
+
* un état et prévient, l'application décide où aller.
|
|
1629
|
+
*
|
|
1630
|
+
* > Ceci protège l'interface, pas les données. Une route masquée reste une
|
|
1631
|
+
* > route ouverte tant que le serveur ne refuse pas l'appel.
|
|
1632
|
+
*/
|
|
1633
|
+
declare function RequireSession<TUser, TTenant, TRule = PermissionRule>({ session, children, require: rule, pending, fallback, forbidden, allowIncomplete, onUnauthenticated, onForbidden, onIncomplete, className, }: RequireSessionProps<TUser, TTenant, TRule>): react_jsx_runtime.JSX.Element;
|
|
1634
|
+
interface CanProps<TUser, TTenant, TRule> {
|
|
1635
|
+
session: SessionStore<TUser, TTenant, TRule>;
|
|
1636
|
+
require: TRule;
|
|
1637
|
+
children: ReactNode;
|
|
1638
|
+
fallback?: ReactNode;
|
|
1639
|
+
}
|
|
1640
|
+
/**
|
|
1641
|
+
* Un morceau d'interface derrière un droit.
|
|
1642
|
+
*
|
|
1643
|
+
* `PermissionGate` fait la même chose à partir d'un tableau de permissions
|
|
1644
|
+
* passé à la main; celui-ci lit la session et suit son évaluateur — jokers,
|
|
1645
|
+
* expression textuelle ou égalité stricte selon le serveur.
|
|
1646
|
+
*/
|
|
1647
|
+
declare function Can<TUser, TTenant, TRule = PermissionRule>({ session, require: rule, children, fallback, }: CanProps<TUser, TTenant, TRule>): react_jsx_runtime.JSX.Element;
|
|
1648
|
+
|
|
1649
|
+
interface ResizablePanelProps {
|
|
1650
|
+
first: ReactNode;
|
|
1651
|
+
second: ReactNode;
|
|
1652
|
+
defaultSize?: number;
|
|
1653
|
+
minSize?: number;
|
|
1654
|
+
maxSize?: number;
|
|
1655
|
+
direction?: "horizontal" | "vertical";
|
|
1656
|
+
className?: string;
|
|
1657
|
+
}
|
|
1658
|
+
declare function ResizablePanel({ first, second, defaultSize, minSize, maxSize, direction, className }: ResizablePanelProps): react_jsx_runtime.JSX.Element;
|
|
1659
|
+
|
|
1660
|
+
interface ScrollAreaProps {
|
|
1661
|
+
children: ReactNode;
|
|
1662
|
+
/** Hauteur maximale. Au-delà, la zone défile. */
|
|
1663
|
+
maxHeight?: number | string;
|
|
1664
|
+
height?: number | string;
|
|
1665
|
+
orientation?: "vertical" | "horizontal" | "both";
|
|
1666
|
+
/**
|
|
1667
|
+
* Estompe le contenu aux bords tant qu'il reste quelque chose à faire
|
|
1668
|
+
* défiler. C'est le seul indice fiable quand la barre est fine ou masquée.
|
|
1669
|
+
*/
|
|
1670
|
+
fade?: boolean;
|
|
1671
|
+
className?: string;
|
|
1672
|
+
}
|
|
1673
|
+
/**
|
|
1674
|
+
* Une zone défilante sobre.
|
|
1675
|
+
*
|
|
1676
|
+
* La barre reste celle du navigateur, seulement affinée : une barre
|
|
1677
|
+
* réimplémentée en JavaScript coûte un écouteur de défilement, deux mesures
|
|
1678
|
+
* par image et perd le défilement inertiel des pavés tactiles. Le seul ajout
|
|
1679
|
+
* est l'estompe des bords, qui ne demande qu'un booléen par côté.
|
|
1680
|
+
*/
|
|
1681
|
+
declare function ScrollArea({ children, maxHeight, height, orientation, fade, className, }: ScrollAreaProps): react_jsx_runtime.JSX.Element;
|
|
1682
|
+
|
|
1683
|
+
interface SearchInputProps extends Omit<InputHTMLAttributes<HTMLInputElement>, "type" | "onChange"> {
|
|
1684
|
+
value?: string;
|
|
1685
|
+
defaultValue?: string;
|
|
1686
|
+
onValueChange?: (value: string) => void;
|
|
1687
|
+
/** Appelé à la validation, et après le délai si `searchDelay` est posé. */
|
|
1688
|
+
onSearch?: (value: string) => void;
|
|
1689
|
+
/**
|
|
1690
|
+
* Millisecondes d'inactivité avant de déclencher `onSearch`.
|
|
1691
|
+
*
|
|
1692
|
+
* `0` — le défaut — ne déclenche qu'à la validation. Au-delà, la recherche
|
|
1693
|
+
* part quand la frappe s'arrête : c'est ce que chaque projet réécrivait
|
|
1694
|
+
* autour de ce champ.
|
|
1695
|
+
*/
|
|
1696
|
+
searchDelay?: number;
|
|
1697
|
+
clearable?: boolean;
|
|
1698
|
+
searchLabel?: string;
|
|
1699
|
+
clearLabel?: string;
|
|
1700
|
+
}
|
|
1701
|
+
declare const SearchInput: react.ForwardRefExoticComponent<SearchInputProps & react.RefAttributes<HTMLInputElement>>;
|
|
1702
|
+
|
|
1703
|
+
interface SidebarItem {
|
|
1704
|
+
key: string;
|
|
1705
|
+
label: ReactNode;
|
|
1706
|
+
icon?: ReactNode;
|
|
1707
|
+
/** Rend l'entrée comme un lien. Sans lui, c'est un bouton. */
|
|
1708
|
+
href?: string;
|
|
1709
|
+
badge?: ReactNode;
|
|
1710
|
+
disabled?: boolean;
|
|
1711
|
+
/** Sous-entrées. Une seule profondeur : au-delà, c'est un menu, pas une barre. */
|
|
1712
|
+
items?: Array<Omit<SidebarItem, "items">>;
|
|
1713
|
+
onClick?: () => void;
|
|
1714
|
+
}
|
|
1715
|
+
interface SidebarSection {
|
|
1716
|
+
key: string;
|
|
1717
|
+
/** Le titre du groupe. Masqué en mode réduit. */
|
|
1718
|
+
title: ReactNode;
|
|
1719
|
+
items: SidebarItem[];
|
|
1720
|
+
}
|
|
1721
|
+
type SidebarEntry = SidebarItem | SidebarSection;
|
|
1722
|
+
interface SidebarProps {
|
|
1723
|
+
items: SidebarEntry[];
|
|
1724
|
+
/** La clé de l'entrée courante. Un parent s'ouvre si un enfant l'est. */
|
|
1725
|
+
activeKey?: string;
|
|
1726
|
+
collapsed?: boolean;
|
|
1727
|
+
header?: ReactNode;
|
|
1728
|
+
footer?: ReactNode;
|
|
1729
|
+
onNavigate?: (item: SidebarItem) => void;
|
|
1730
|
+
ariaLabel?: string;
|
|
1731
|
+
className?: string;
|
|
1732
|
+
}
|
|
1733
|
+
/**
|
|
1734
|
+
* La navigation principale.
|
|
1735
|
+
*
|
|
1736
|
+
* Elle se pose dans le `navigation` d'`AppShell`, qui gère déjà la largeur et
|
|
1737
|
+
* le repli. Ici, seulement les entrées : ce qui est actif, ce qui est ouvert,
|
|
1738
|
+
* ce qui se replie en icônes.
|
|
1739
|
+
*/
|
|
1740
|
+
declare function Sidebar({ items, activeKey, collapsed, header, footer, onNavigate, ariaLabel, className, }: SidebarProps): react_jsx_runtime.JSX.Element;
|
|
1741
|
+
|
|
1742
|
+
interface SkeletonProps extends HTMLAttributes<HTMLDivElement> {
|
|
1743
|
+
width?: CSSProperties["width"];
|
|
1744
|
+
height?: CSSProperties["height"];
|
|
1745
|
+
radius?: CSSProperties["borderRadius"];
|
|
1746
|
+
circle?: boolean;
|
|
1747
|
+
}
|
|
1748
|
+
declare function Skeleton({ className, width, height, radius, circle, style, ...props }: SkeletonProps): react_jsx_runtime.JSX.Element;
|
|
1749
|
+
|
|
1750
|
+
interface StatisticProps {
|
|
1751
|
+
value: number;
|
|
1752
|
+
label?: ReactNode;
|
|
1753
|
+
format?: "number" | "currency" | "percent";
|
|
1754
|
+
locale?: string;
|
|
1755
|
+
currency?: string;
|
|
1756
|
+
precision?: number;
|
|
1757
|
+
prefix?: ReactNode;
|
|
1758
|
+
suffix?: ReactNode;
|
|
1759
|
+
trend?: number;
|
|
1760
|
+
className?: string;
|
|
1761
|
+
}
|
|
1762
|
+
declare function Statistic({ value, label, format, locale, currency, precision, prefix, suffix, trend, className }: StatisticProps): react_jsx_runtime.JSX.Element;
|
|
1763
|
+
|
|
1764
|
+
interface StatCardProps extends StatisticProps {
|
|
1765
|
+
icon?: ReactNode;
|
|
1766
|
+
description?: ReactNode;
|
|
1767
|
+
action?: ReactNode;
|
|
1768
|
+
}
|
|
1769
|
+
declare function StatCard({ icon, description, action, className, ...statisticProps }: StatCardProps): react_jsx_runtime.JSX.Element;
|
|
1770
|
+
|
|
1771
|
+
type StepStatus = "done" | "current" | "upcoming" | "error";
|
|
1772
|
+
interface StepItem {
|
|
1773
|
+
key: string;
|
|
1774
|
+
title: ReactNode;
|
|
1775
|
+
description?: ReactNode;
|
|
1776
|
+
icon?: ReactNode;
|
|
1777
|
+
/** Forcé au besoin; sinon déduit de `current`. */
|
|
1778
|
+
status?: StepStatus;
|
|
1779
|
+
disabled?: boolean;
|
|
1780
|
+
}
|
|
1781
|
+
interface StepsProps {
|
|
1782
|
+
items: StepItem[];
|
|
1783
|
+
/** Index de l'étape en cours. Ce qui précède est fait, ce qui suit à venir. */
|
|
1784
|
+
current?: number;
|
|
1785
|
+
orientation?: "horizontal" | "vertical";
|
|
1786
|
+
size?: "sm" | "md";
|
|
1787
|
+
/** Rend les étapes cliquables — pour revenir en arrière dans un tunnel. */
|
|
1788
|
+
onStepClick?: (item: StepItem, index: number) => void;
|
|
1789
|
+
className?: string;
|
|
1790
|
+
}
|
|
1791
|
+
/**
|
|
1792
|
+
* Une progression en étapes.
|
|
1793
|
+
*
|
|
1794
|
+
* Le trait entre deux étapes se remplit plutôt que de changer de couleur d'un
|
|
1795
|
+
* coup : c'est ce qui donne le sens de la marche, vers l'avant.
|
|
1796
|
+
*/
|
|
1797
|
+
declare function Steps({ items, current, orientation, size, onStepClick, className, }: StepsProps): react_jsx_runtime.JSX.Element;
|
|
1798
|
+
|
|
1799
|
+
interface TabsProps {
|
|
1800
|
+
value?: string;
|
|
1801
|
+
defaultValue: string;
|
|
1802
|
+
onValueChange?: (value: string) => void;
|
|
1803
|
+
className?: string;
|
|
1804
|
+
children: ReactNode;
|
|
1805
|
+
}
|
|
1806
|
+
declare function Tabs({ value, defaultValue, onValueChange, className, children }: TabsProps): react_jsx_runtime.JSX.Element;
|
|
1807
|
+
declare function TabsList({ className, children }: {
|
|
1808
|
+
className?: string;
|
|
1809
|
+
children: ReactNode;
|
|
1810
|
+
}): react_jsx_runtime.JSX.Element;
|
|
1811
|
+
declare function TabsTrigger({ value, disabled, children }: {
|
|
1812
|
+
value: string;
|
|
1813
|
+
disabled?: boolean;
|
|
1814
|
+
children: ReactNode;
|
|
1815
|
+
}): react_jsx_runtime.JSX.Element;
|
|
1816
|
+
declare function TabsContent({ value, className, children }: {
|
|
1817
|
+
value: string;
|
|
1818
|
+
className?: string;
|
|
1819
|
+
children: ReactNode;
|
|
1820
|
+
}): react_jsx_runtime.JSX.Element | null;
|
|
1821
|
+
|
|
1822
|
+
interface TimeRangeValue {
|
|
1823
|
+
start: string;
|
|
1824
|
+
end: string;
|
|
1825
|
+
}
|
|
1826
|
+
interface TimeRangePickerProps extends Pick<TimePickerProps, "minuteStep" | "secondStep" | "showSeconds" | "hourFormat" | "needConfirm" | "allowClear"> {
|
|
1827
|
+
value?: TimeRangeValue;
|
|
1828
|
+
defaultValue?: TimeRangeValue;
|
|
1829
|
+
onValueChange?: (value: TimeRangeValue) => void;
|
|
1830
|
+
order?: boolean;
|
|
1831
|
+
startLabel?: string;
|
|
1832
|
+
endLabel?: string;
|
|
1833
|
+
tone?: ComponentTone;
|
|
1834
|
+
invalid?: boolean;
|
|
1835
|
+
disabled?: boolean;
|
|
1836
|
+
className?: string;
|
|
1837
|
+
}
|
|
1838
|
+
declare function TimeRangePicker({ value, defaultValue, onValueChange, order, startLabel: startLabelProp, endLabel: endLabelProp, minuteStep, secondStep, showSeconds, hourFormat, needConfirm, allowClear, tone, invalid, disabled, className }: TimeRangePickerProps): react_jsx_runtime.JSX.Element;
|
|
1839
|
+
|
|
1840
|
+
interface TimelineItem {
|
|
1841
|
+
key: string;
|
|
1842
|
+
title: ReactNode;
|
|
1843
|
+
description?: ReactNode;
|
|
1844
|
+
time?: ReactNode;
|
|
1845
|
+
tone?: ComponentTone;
|
|
1846
|
+
}
|
|
1847
|
+
interface TimelineProps {
|
|
1848
|
+
items: TimelineItem[];
|
|
1849
|
+
pending?: ReactNode;
|
|
1850
|
+
className?: string;
|
|
1851
|
+
}
|
|
1852
|
+
declare function Timeline({ items, pending, className }: TimelineProps): react_jsx_runtime.JSX.Element;
|
|
1853
|
+
|
|
1854
|
+
interface ToasterProps {
|
|
1855
|
+
/** Coin par défaut des annonces qui n'en précisent pas. */
|
|
1856
|
+
placement?: ToastPlacement;
|
|
1857
|
+
/** Nombre visible simultanément. Au-delà, la plus ancienne s'efface. */
|
|
1858
|
+
limit?: number;
|
|
1859
|
+
/** Durée par défaut, pour les tons qui n'en imposent pas une. */
|
|
1860
|
+
duration?: number;
|
|
1861
|
+
/** Largeur d'une annonce. */
|
|
1862
|
+
width?: number | string;
|
|
1863
|
+
/** Décalage depuis le bord de l'écran. */
|
|
1864
|
+
offset?: number | string;
|
|
1865
|
+
/**
|
|
1866
|
+
* Où rendre la pile. Par défaut, un nœud créé sous `document.body`.
|
|
1867
|
+
*
|
|
1868
|
+
* À fournir quand le thème est porté par un conteneur plutôt que par la
|
|
1869
|
+
* racine du document : sorties de ce conteneur, les annonces perdraient
|
|
1870
|
+
* ses variables et s'afficheraient dans le thème clair.
|
|
1871
|
+
*/
|
|
1872
|
+
container?: HTMLElement | null | undefined;
|
|
1873
|
+
className?: string;
|
|
1874
|
+
}
|
|
1875
|
+
/**
|
|
1876
|
+
* La pile visible.
|
|
1877
|
+
*
|
|
1878
|
+
* Un seul `<Toaster />` à la racine de l'application. Il rend les six coins :
|
|
1879
|
+
* une annonce peut choisir le sien, ce qui permet à une confirmation
|
|
1880
|
+
* d'apparaître près du geste qui l'a déclenchée et à une panne générale de
|
|
1881
|
+
* s'imposer en haut de l'écran.
|
|
1882
|
+
*/
|
|
1883
|
+
declare function Toaster({ placement, limit, duration, width, offset, container, className, }: ToasterProps): react.ReactPortal | null;
|
|
1884
|
+
interface ToastProviderProps extends PropsWithChildren, ToasterProps {
|
|
1885
|
+
}
|
|
1886
|
+
/**
|
|
1887
|
+
* Enveloppe les enfants et monte le `Toaster`.
|
|
1888
|
+
*
|
|
1889
|
+
* Aucun contexte : le magasin vit hors de React. Ce composant n'existe que
|
|
1890
|
+
* pour monter la pile au bon endroit sans y penser.
|
|
1891
|
+
*/
|
|
1892
|
+
declare function ToastProvider({ children, ...props }: ToastProviderProps): react_jsx_runtime.JSX.Element;
|
|
1893
|
+
/**
|
|
1894
|
+
* L'API des annonces, pour ceux qui préfèrent un hook.
|
|
1895
|
+
*
|
|
1896
|
+
* Elle rend exactement l'objet `toast`, dont l'identité ne change jamais :
|
|
1897
|
+
* l'appeler dans un `useCallback` ou un `useEffect` ne relance rien.
|
|
1898
|
+
*/
|
|
1899
|
+
declare function useToast(): ((input: _sia_ui_headless.ToastInput) => string) & {
|
|
1900
|
+
success: (input: _sia_ui_headless.ToastInput) => string;
|
|
1901
|
+
info: (input: _sia_ui_headless.ToastInput) => string;
|
|
1902
|
+
warning: (input: _sia_ui_headless.ToastInput) => string;
|
|
1903
|
+
error: (input: _sia_ui_headless.ToastInput) => string;
|
|
1904
|
+
loading: (input: _sia_ui_headless.ToastInput) => string;
|
|
1905
|
+
promise<T>(promise: Promise<T>, messages: _sia_ui_headless.PromiseMessages<T>): Promise<T>;
|
|
1906
|
+
update: (id: ToastId, patch: ToastOptions) => void;
|
|
1907
|
+
dismiss: (id?: ToastId) => void;
|
|
1908
|
+
custom: (options: ToastOptions) => string;
|
|
1909
|
+
};
|
|
1910
|
+
|
|
1911
|
+
interface ToggleProps {
|
|
1912
|
+
pressed?: boolean;
|
|
1913
|
+
defaultPressed?: boolean;
|
|
1914
|
+
onPressedChange?: (pressed: boolean) => void;
|
|
1915
|
+
children?: ReactNode;
|
|
1916
|
+
icon?: ReactNode;
|
|
1917
|
+
/** Obligatoire quand le contenu se réduit à une icône. */
|
|
1918
|
+
ariaLabel?: string;
|
|
1919
|
+
size?: ComponentSize;
|
|
1920
|
+
tone?: ComponentTone;
|
|
1921
|
+
variant?: "solid" | "outline" | "ghost";
|
|
1922
|
+
disabled?: boolean;
|
|
1923
|
+
className?: string;
|
|
1924
|
+
}
|
|
1925
|
+
/**
|
|
1926
|
+
* Un bouton à deux états.
|
|
1927
|
+
*
|
|
1928
|
+
* Ce n'est pas un `Switch` : un interrupteur décrit un réglage qui persiste,
|
|
1929
|
+
* une bascule décrit un état de l'interface ici et maintenant — gras, filtre
|
|
1930
|
+
* actif, colonne affichée. `aria-pressed` porte cette différence.
|
|
1931
|
+
*/
|
|
1932
|
+
declare function Toggle({ pressed: pressedProp, defaultPressed, onPressedChange, children, icon, ariaLabel, size, tone, variant, disabled, className, }: ToggleProps): react_jsx_runtime.JSX.Element;
|
|
1933
|
+
interface ToggleGroupOption {
|
|
1934
|
+
value: string;
|
|
1935
|
+
label?: ReactNode;
|
|
1936
|
+
icon?: ReactNode;
|
|
1937
|
+
ariaLabel?: string;
|
|
1938
|
+
disabled?: boolean;
|
|
1939
|
+
}
|
|
1940
|
+
interface ToggleGroupProps {
|
|
1941
|
+
options: ToggleGroupOption[];
|
|
1942
|
+
/** `single` : une valeur ou aucune. `multiple` : un tableau. */
|
|
1943
|
+
type?: "single" | "multiple";
|
|
1944
|
+
value?: string | string[];
|
|
1945
|
+
defaultValue?: string | string[];
|
|
1946
|
+
/** Une chaîne en `single`, un tableau en `multiple` — comme `value`. */
|
|
1947
|
+
onValueChange?: (value: string | string[]) => void;
|
|
1948
|
+
size?: ComponentSize;
|
|
1949
|
+
tone?: ComponentTone;
|
|
1950
|
+
/** Autorise à tout désélectionner en `single`. */
|
|
1951
|
+
deselectable?: boolean;
|
|
1952
|
+
disabled?: boolean;
|
|
1953
|
+
ariaLabel?: string;
|
|
1954
|
+
className?: string;
|
|
1955
|
+
}
|
|
1956
|
+
/**
|
|
1957
|
+
* Plusieurs bascules qui partagent une valeur.
|
|
1958
|
+
*
|
|
1959
|
+
* Le repère glisse d'une option à l'autre au lieu de sauter : c'est la même
|
|
1960
|
+
* idée que les onglets, et c'est ce qui rend le changement lisible.
|
|
1961
|
+
*/
|
|
1962
|
+
declare function ToggleGroup({ options, type, value: valueProp, defaultValue, onValueChange, size, tone, deselectable, disabled, ariaLabel, className, }: ToggleGroupProps): react_jsx_runtime.JSX.Element;
|
|
1963
|
+
|
|
1964
|
+
interface TourStep {
|
|
1965
|
+
target: string;
|
|
1966
|
+
title: ReactNode;
|
|
1967
|
+
description?: ReactNode;
|
|
1968
|
+
}
|
|
1969
|
+
interface TourProps {
|
|
1970
|
+
open: boolean;
|
|
1971
|
+
onOpenChange: (open: boolean) => void;
|
|
1972
|
+
steps: TourStep[];
|
|
1973
|
+
initialStep?: number;
|
|
1974
|
+
onStepChange?: (step: number) => void;
|
|
1975
|
+
className?: string;
|
|
1976
|
+
}
|
|
1977
|
+
declare function Tour({ open, onOpenChange, steps, initialStep, onStepChange, className }: TourProps): react.ReactPortal | null;
|
|
1978
|
+
|
|
1979
|
+
interface TransferItem {
|
|
1980
|
+
key: Key;
|
|
1981
|
+
label: ReactNode;
|
|
1982
|
+
disabled?: boolean;
|
|
1983
|
+
}
|
|
1984
|
+
interface TransferProps {
|
|
1985
|
+
items: TransferItem[];
|
|
1986
|
+
targetKeys: Key[];
|
|
1987
|
+
onChange: (targetKeys: Key[]) => void;
|
|
1988
|
+
sourceTitle?: string;
|
|
1989
|
+
targetTitle?: string;
|
|
1990
|
+
className?: string;
|
|
1991
|
+
}
|
|
1992
|
+
declare function Transfer({ items, targetKeys, onChange, sourceTitle, targetTitle, className }: TransferProps): react_jsx_runtime.JSX.Element;
|
|
1993
|
+
|
|
1994
|
+
interface TreeNode {
|
|
1995
|
+
key: Key;
|
|
1996
|
+
label: ReactNode;
|
|
1997
|
+
children?: TreeNode[];
|
|
1998
|
+
disabled?: boolean;
|
|
1999
|
+
}
|
|
2000
|
+
interface TreeProps {
|
|
2001
|
+
nodes: TreeNode[];
|
|
2002
|
+
defaultExpandedKeys?: Key[];
|
|
2003
|
+
selectedKey?: Key | undefined;
|
|
2004
|
+
onSelect?: ((node: TreeNode) => void) | undefined;
|
|
2005
|
+
className?: string;
|
|
2006
|
+
}
|
|
2007
|
+
declare function Tree({ nodes, defaultExpandedKeys, selectedKey, onSelect, className }: TreeProps): react_jsx_runtime.JSX.Element;
|
|
2008
|
+
|
|
2009
|
+
interface TreeSelectProps {
|
|
2010
|
+
nodes: TreeNode[];
|
|
2011
|
+
value?: Key | undefined;
|
|
2012
|
+
onValueChange?: (value: Key, node: TreeNode) => void;
|
|
2013
|
+
placeholder?: string;
|
|
2014
|
+
className?: string;
|
|
2015
|
+
}
|
|
2016
|
+
declare function TreeSelect({ nodes, value, onValueChange, placeholder: placeholderProp, className }: TreeSelectProps): react_jsx_runtime.JSX.Element;
|
|
2017
|
+
|
|
2018
|
+
interface HeadingProps extends HTMLAttributes<HTMLHeadingElement> {
|
|
2019
|
+
level?: 1 | 2 | 3 | 4 | 5 | 6;
|
|
2020
|
+
size?: "sm" | "md" | "lg" | "xl";
|
|
2021
|
+
}
|
|
2022
|
+
declare function Heading({ level, size, className, ...props }: HeadingProps): react_jsx_runtime.JSX.Element;
|
|
2023
|
+
interface TextProps extends HTMLAttributes<HTMLParagraphElement> {
|
|
2024
|
+
tone?: ComponentTone;
|
|
2025
|
+
size?: "sm" | "md" | "lg";
|
|
2026
|
+
}
|
|
2027
|
+
declare function Text({ tone, size, className, ...props }: TextProps): react_jsx_runtime.JSX.Element;
|
|
2028
|
+
declare function InlineCode({ className, ...props }: HTMLAttributes<HTMLElement>): react_jsx_runtime.JSX.Element;
|
|
2029
|
+
|
|
2030
|
+
interface UnsavedChangesGuardProps {
|
|
2031
|
+
when: boolean;
|
|
2032
|
+
message?: string;
|
|
2033
|
+
}
|
|
2034
|
+
declare function UnsavedChangesGuard({ when, message }: UnsavedChangesGuardProps): null;
|
|
2035
|
+
declare function confirmUnsavedNavigation(when: boolean, message?: string): boolean;
|
|
2036
|
+
|
|
2037
|
+
interface WeekPickerProps extends Omit<InputHTMLAttributes<HTMLInputElement>, "type" | "onChange"> {
|
|
2038
|
+
onValueChange?: (value: string) => void;
|
|
2039
|
+
invalid?: boolean;
|
|
2040
|
+
}
|
|
2041
|
+
declare const WeekPicker: react.ForwardRefExoticComponent<WeekPickerProps & react.RefAttributes<HTMLInputElement>>;
|
|
2042
|
+
|
|
2043
|
+
interface YearPickerProps {
|
|
2044
|
+
value?: number;
|
|
2045
|
+
defaultValue?: number;
|
|
2046
|
+
min?: number;
|
|
2047
|
+
max?: number;
|
|
2048
|
+
onValueChange?: (year: number) => void;
|
|
2049
|
+
className?: string;
|
|
2050
|
+
}
|
|
2051
|
+
declare function YearPicker({ value, defaultValue, min, max, onValueChange, className }: YearPickerProps): react_jsx_runtime.JSX.Element;
|
|
2052
|
+
|
|
2053
|
+
export { Accordion, type AccordionItem, type AccordionProps, Alert, AlertCircleIcon, type AlertProps, AmountDisplay, type AmountDisplayProps, AppShell, type AppShellProps, ArrowRightIcon, AspectRatio, type AspectRatioProps, AsyncState, type AsyncStateProps, type AuditEvent, AuditMeta, type AuditMetaProps, AuthLayout, type AuthLayoutProps, Autocomplete, type AutocompleteProps, Avatar, type AvatarProps, Badge, type BadgeProps, Breadcrumb, type BreadcrumbItem, type BreadcrumbProps, Button, type ButtonProps, Calendar, type CalendarDay, type CalendarEvent, CalendarIcon, type CalendarMode, type CalendarProps, type CalendarRangeValue, Can, type CanProps, Card, CardBody, CardFooter, CardHeader, Chart, type ChartProps, type ChartSeries, CheckIcon, Checkbox, CheckboxGroup, type CheckboxGroupProps, type CheckboxProps, ChevronDownIcon, ChevronLeftIcon, ChevronRightIcon, ChevronUpIcon, ClockIcon, Collapse, type CollapseProps, ColorPicker, type ColorPickerProps, type CommandItem, CommandPalette, type CommandPaletteProps, ConfirmDialog, type ConfirmDialogProps, Container, ContextMenu, type ContextMenuProps, Countdown, type CountdownProps, CrudPage, type CrudPageProps, CurrencyInput, type CurrencyInputProps, DEFAULT_COUNTRIES, DataTable, type DataTableColumn, type DataTableProps, DatePicker, type DatePickerProps, DateRangeFilter, type DateRangeFilterProps, DateRangePicker, type DateRangePickerProps, type DateRangePreset, type DateRangeValue, DateTimePicker, type DateTimePickerProps, type DateTimeValue, type DescriptionItem, Descriptions, type DescriptionsProps, Divider, type DividerProps, Drawer, DrawerBody, DrawerClose, type DrawerComponent, DrawerFooter, DrawerHeader, type DrawerPosition, type DrawerProps, type DrawerRef, type DrawerSize, DrawerTitle, DropdownMenu, type DropdownMenuProps, DurationDisplay, type DurationDisplayProps, EmptyState, type EmptyStateProps, EntityMeta, type EntityMetaProps, ErrorState, type ErrorStateProps, EventCalendar, type EventCalendarProps, EyeIcon, EyeOffIcon, Field, type FieldBindingLike, type FieldProps, type FieldStatus, type FieldType, type FieldValue, FileUpload, type FileUploadProps, FiltersBar, type FiltersBarProps, Form, type FormEntry, Field as FormField, type FormFieldConfig, type FormFieldGroup, type FieldProps as FormFieldProps, type FormProps, type FormShape, Heading, type HeadingProps, HoverCard, type HoverCardProps, type IDrawerProps, type ILabelProps, type ITooltipProps, type ITooltipVariant, IconButton, type IconButtonProps, ImageUpload, type ImageUploadProps, InfoIcon, InlineCode, Input, InputNumber, type InputNumberProps, type InputProps, JsonEditor, type JsonEditorProps, KpiGrid, type KpiGridProps, Label, type LabelProps, MarkdownEditor, type MarkdownEditorProps, type MenuEntry, type MenuItem, type MenuLabel, MenuList, type MenuListProps, type MenuSeparator, MiniCalendar, MinusIcon, Modal, type ModalProps, MonthPicker, type MonthPickerProps, MoreHorizontalIcon, MultiSelect, type MultiSelectProps, OtpInput, type OtpInputProps, Overlay, type OverlayPlacement, type OverlayProps, PageHeader, type PageHeaderProps, Pagination, type PaginationProps, PasswordInput, type PasswordInputProps, type PasswordStrength, PermissionGate, type PermissionGateProps, type PhoneCountry, PhoneInput, type PhoneInputProps, PlusIcon, Popover, type PopoverProps, Progress, type ProgressProps, QRCode, type QRCodeProps, Radio, RadioButton, type RadioButtonProps, RadioGroup, type RadioGroupProps, type RadioProps, Rating, type RatingProps, type ReferenceOption, ReferenceSelect, type ReferenceSelectProps, RelativeTime, type RelativeTimeProps, RequireSession, type RequireSessionProps, ResizablePanel, type ResizablePanelProps, RichTextEditor, type RichTextEditorProps, ScrollArea, type ScrollAreaProps, SearchIcon, SearchInput, type SearchInputProps, Select, type SelectOption, type SelectProps, Sidebar, type SidebarEntry, type SidebarItem, type SidebarProps, type SidebarSection, Skeleton, type SkeletonProps, Slider, type SliderProps, type SliderRangeValue, Sparkline, type SparklineProps, Spinner, type SpinnerProps, Stack, StarIcon, StatCard, type StatCardProps, Statistic, type StatisticProps, type StepItem, type StepStatus, Steps, type StepsProps, Switch, type SwitchProps, Tabs, TabsContent, TabsList, type TabsProps, TabsTrigger, TagsInput, type TagsInputProps, Text, type TextProps, Textarea, type TextareaProps, type TimeParts, TimePicker, type TimePickerProps, TimeRangePicker, type TimeRangePickerProps, type TimeRangeValue, Timeline, type TimelineItem, type TimelineProps, Timer, type TimerProps, ToastProvider, type ToastProviderProps, Toaster, type ToasterProps, Toggle, ToggleGroup, type ToggleGroupOption, type ToggleGroupProps, type ToggleProps, Tooltip, type TooltipProps, type TooltipVariant, Tour, type TourProps, type TourStep, Transfer, type TransferItem, type TransferProps, TrashIcon, Tree, type TreeNode, type TreeProps, TreeSelect, type TreeSelectProps, UnsavedChangesGuard, type UnsavedChangesGuardProps, UploadIcon, type UseDataTableQueryOptions, WeekPicker, type WeekPickerProps, XIcon, YearPicker, type YearPickerProps, confirmUnsavedNavigation, createUrlTableStorage, formatDuration, formatTimeValue, parseTimeValue, useDataTableQuery, useToast };
|