design-zystem 1.0.310 → 1.0.311
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/dist/index.css +2 -1
- package/dist/index.d.mts +55 -56
- package/dist/index.d.ts +55 -56
- package/dist/index.js +93 -85
- package/dist/index.mjs +93 -85
- package/dist/ui/index.d.mts +1177 -0
- package/dist/ui/index.d.ts +1177 -0
- package/dist/ui/index.js +5734 -0
- package/dist/ui/index.mjs +5597 -0
- package/dist/ui/style.css +1 -0
- package/package.json +57 -3
|
@@ -0,0 +1,1177 @@
|
|
|
1
|
+
import * as react from 'react';
|
|
2
|
+
import { HTMLAttributes, AnchorHTMLAttributes, ElementType, ImgHTMLAttributes, ButtonHTMLAttributes, ReactNode, InputHTMLAttributes, TextareaHTMLAttributes, MouseEvent, ComponentPropsWithoutRef } from 'react';
|
|
3
|
+
import * as class_variance_authority_types from 'class-variance-authority/types';
|
|
4
|
+
import { VariantProps } from 'class-variance-authority';
|
|
5
|
+
import * as RadixLabel from '@radix-ui/react-label';
|
|
6
|
+
import * as RadixCheckbox from '@radix-ui/react-checkbox';
|
|
7
|
+
import * as RadixSwitch from '@radix-ui/react-switch';
|
|
8
|
+
import * as RadixDialog from '@radix-ui/react-dialog';
|
|
9
|
+
import * as RadixAvatar from '@radix-ui/react-avatar';
|
|
10
|
+
import * as RadixCollapsible from '@radix-ui/react-collapsible';
|
|
11
|
+
import { Drawer as Drawer$1 } from 'vaul';
|
|
12
|
+
import { DocumentProps } from 'react-pdf';
|
|
13
|
+
import * as RadixScrollArea from '@radix-ui/react-scroll-area';
|
|
14
|
+
|
|
15
|
+
declare const layoutVariants: (props?: ({
|
|
16
|
+
direction?: "row" | "column" | null | undefined;
|
|
17
|
+
gap?: 0 | 0.5 | 1 | 1.5 | 2 | 3 | 4 | 5 | 6 | 8 | 10 | 12 | 16 | null | undefined;
|
|
18
|
+
align?: "start" | "center" | "end" | "stretch" | "baseline" | null | undefined;
|
|
19
|
+
justify?: "start" | "center" | "end" | "between" | "around" | "evenly" | null | undefined;
|
|
20
|
+
wrap?: boolean | null | undefined;
|
|
21
|
+
fullWidth?: boolean | null | undefined;
|
|
22
|
+
fullHeight?: boolean | null | undefined;
|
|
23
|
+
padding?: 0 | 0.5 | 1 | 1.5 | 2 | 3 | 4 | 5 | 6 | 8 | 10 | 12 | 16 | null | undefined;
|
|
24
|
+
paddingX?: 0 | 0.5 | 1 | 1.5 | 2 | 3 | 4 | 5 | 6 | 8 | 10 | 12 | 16 | null | undefined;
|
|
25
|
+
paddingY?: 0 | 0.5 | 1 | 1.5 | 2 | 3 | 4 | 5 | 6 | 8 | 10 | 12 | 16 | null | undefined;
|
|
26
|
+
paddingTop?: 0 | 0.5 | 1 | 1.5 | 2 | 3 | 4 | 5 | 6 | 8 | 10 | 12 | 16 | null | undefined;
|
|
27
|
+
paddingRight?: 0 | 0.5 | 1 | 1.5 | 2 | 3 | 4 | 5 | 6 | 8 | 10 | 12 | 16 | null | undefined;
|
|
28
|
+
paddingBottom?: 0 | 0.5 | 1 | 1.5 | 2 | 3 | 4 | 5 | 6 | 8 | 10 | 12 | 16 | null | undefined;
|
|
29
|
+
paddingLeft?: 0 | 0.5 | 1 | 1.5 | 2 | 3 | 4 | 5 | 6 | 8 | 10 | 12 | 16 | null | undefined;
|
|
30
|
+
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
31
|
+
interface LayoutProps extends HTMLAttributes<HTMLDivElement>, Omit<VariantProps<typeof layoutVariants>, 'direction'> {
|
|
32
|
+
row?: boolean;
|
|
33
|
+
column?: boolean;
|
|
34
|
+
/** Largeur explicite (`"300px"`, `"50%"`) — désactive le `fullWidth` par défaut. */
|
|
35
|
+
width?: string;
|
|
36
|
+
/** Raccourci CSS `flex` (ex. `1`, `2`, `"1 1 0%"`) — pour répartir l'espace entre plusieurs `Layout` côte à côte dans un `Layout row` parent. */
|
|
37
|
+
flex?: number | string;
|
|
38
|
+
}
|
|
39
|
+
/** Remplace Row + Col du DZ — `row` (défaut) ou `column` choisit le sens. Pour une grille, écrire `grid grid-cols-*` en `className` directement, pas de composant Grid. */
|
|
40
|
+
declare const Layout: react.ForwardRefExoticComponent<LayoutProps & react.RefAttributes<HTMLDivElement>>;
|
|
41
|
+
|
|
42
|
+
/**
|
|
43
|
+
* Jeu fermé de couleurs brutes exposé aux composants (Button, Checkbox,
|
|
44
|
+
* Switch, Card, Badge...). Toujours un nom de token de la palette
|
|
45
|
+
* (DeliverySystem/tailwind.config.ts), jamais un alias sémantique
|
|
46
|
+
* (primary/secondary/destructive) — cf. CLAUDE.local.md.
|
|
47
|
+
*/
|
|
48
|
+
declare const COLOR_TOKENS: readonly ["blue-700", "blue-900", "blue-950", "red-900", "green-700", "grey-600"];
|
|
49
|
+
type ColorToken = (typeof COLOR_TOKENS)[number];
|
|
50
|
+
|
|
51
|
+
declare const boxVariants: (props?: ({
|
|
52
|
+
padding?: "none" | "sm" | "md" | "lg" | null | undefined;
|
|
53
|
+
radius?: "none" | "sm" | "md" | null | undefined;
|
|
54
|
+
hasShadow?: boolean | null | undefined;
|
|
55
|
+
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
56
|
+
interface BoxProps extends HTMLAttributes<HTMLDivElement>, VariantProps<typeof boxVariants> {
|
|
57
|
+
/** Left accent bar — status/score encoding. */
|
|
58
|
+
accent?: ColorToken | 'none';
|
|
59
|
+
width?: string;
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* Surface bordée/ombrée. Ne gère pas le flex — composer avec `Layout` pour
|
|
63
|
+
* disposer les enfants (`<Box><Layout row>...</Layout></Box>`).
|
|
64
|
+
*/
|
|
65
|
+
declare const Box: react.ForwardRefExoticComponent<BoxProps & react.RefAttributes<HTMLDivElement>>;
|
|
66
|
+
|
|
67
|
+
declare const dividerVariants: (props?: ({
|
|
68
|
+
orientation?: "horizontal" | "vertical" | null | undefined;
|
|
69
|
+
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
70
|
+
interface DividerProps extends VariantProps<typeof dividerVariants> {
|
|
71
|
+
className?: string;
|
|
72
|
+
}
|
|
73
|
+
declare const Divider: ({ orientation, className, }: DividerProps) => react.JSX.Element;
|
|
74
|
+
|
|
75
|
+
declare const linkVariants: (props?: ({
|
|
76
|
+
color?: "blue-700" | "blue-900" | "blue-950" | "red-900" | "green-700" | "grey-600" | null | undefined;
|
|
77
|
+
size?: "s" | "xs" | "m" | "l" | null | undefined;
|
|
78
|
+
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
79
|
+
interface LinkProps extends Omit<AnchorHTMLAttributes<HTMLAnchorElement>, 'color'>, VariantProps<typeof linkVariants> {
|
|
80
|
+
newTab?: boolean;
|
|
81
|
+
}
|
|
82
|
+
declare const Link: react.ForwardRefExoticComponent<LinkProps & react.RefAttributes<HTMLAnchorElement>>;
|
|
83
|
+
|
|
84
|
+
declare const textVariants: (props?: ({
|
|
85
|
+
size?: "s" | "xs" | "m" | "l" | "xxs" | "xl" | "xxl" | null | undefined;
|
|
86
|
+
weight?: "bold" | "normal" | "medium" | "semibold" | null | undefined;
|
|
87
|
+
color?: "white" | "blue-700" | "blue-900" | "blue-950" | "red-900" | "green-700" | "grey-600" | "neutral-800" | "grey-500" | null | undefined;
|
|
88
|
+
align?: "center" | "left" | "right" | null | undefined;
|
|
89
|
+
lineClamp?: 1 | 2 | 3 | "none" | null | undefined;
|
|
90
|
+
italic?: boolean | null | undefined;
|
|
91
|
+
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
92
|
+
interface TextProps extends Omit<HTMLAttributes<HTMLElement>, 'color'>, VariantProps<typeof textVariants> {
|
|
93
|
+
as?: ElementType;
|
|
94
|
+
/** Pour `as="label"`. */
|
|
95
|
+
htmlFor?: string;
|
|
96
|
+
}
|
|
97
|
+
declare const Text: react.ForwardRefExoticComponent<TextProps & react.RefAttributes<HTMLElement>>;
|
|
98
|
+
|
|
99
|
+
declare const imageVariants: (props?: ({
|
|
100
|
+
fit?: "contain" | "cover" | "fill" | null | undefined;
|
|
101
|
+
radius?: "none" | "sm" | "md" | "full" | null | undefined;
|
|
102
|
+
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
103
|
+
interface ImageProps extends ImgHTMLAttributes<HTMLImageElement>, VariantProps<typeof imageVariants> {
|
|
104
|
+
}
|
|
105
|
+
declare const Image: react.ForwardRefExoticComponent<ImageProps & react.RefAttributes<HTMLImageElement>>;
|
|
106
|
+
|
|
107
|
+
type FaFamily = 'solid' | 'regular' | 'light' | 'brands';
|
|
108
|
+
|
|
109
|
+
type IconSize = 'xxs' | 'xs' | 's' | 'm' | 'l' | 'xl' | 'xxl';
|
|
110
|
+
type IconFamily = FaFamily;
|
|
111
|
+
type IconColor = ColorToken | 'red-500' | 'grey-500' | 'neutral-800' | 'white';
|
|
112
|
+
interface IconProps extends Omit<HTMLAttributes<HTMLElement>, 'color' | 'onClick'> {
|
|
113
|
+
/** Nom de l'icône FontAwesome, sans le préfixe `fa-` (ex. "truck", "magnifying-glass"). */
|
|
114
|
+
name: string;
|
|
115
|
+
family?: IconFamily;
|
|
116
|
+
size?: IconSize;
|
|
117
|
+
color?: IconColor;
|
|
118
|
+
className?: string;
|
|
119
|
+
onClick?: () => void;
|
|
120
|
+
/** Action indisponible : icône grisée, clic inerte. N'a de sens qu'avec `onClick`. */
|
|
121
|
+
disabled?: boolean;
|
|
122
|
+
}
|
|
123
|
+
/**
|
|
124
|
+
* `forwardRef` et propagation des props restantes sont nécessaires aux
|
|
125
|
+
* déclencheurs Radix montés en `asChild` — `Tooltip` en tête : sans elles, ni
|
|
126
|
+
* la ref ni les gestionnaires ne parviennent à l'icône, et le consommateur
|
|
127
|
+
* doit interposer un élément hors DZ pour lui servir de cible.
|
|
128
|
+
*/
|
|
129
|
+
declare const Icon: react.ForwardRefExoticComponent<IconProps & react.RefAttributes<HTMLElement>>;
|
|
130
|
+
|
|
131
|
+
/** `red-500` est le rouge vif d'action destructive (l'ancien `red_950` du DZ) —
|
|
132
|
+
* `red-900` reste le bordeaux d'état d'erreur. */
|
|
133
|
+
type ButtonColor = ColorToken | 'red-500';
|
|
134
|
+
declare const buttonVariants: (props?: ({
|
|
135
|
+
color?: "blue-700" | "blue-900" | "blue-950" | "red-900" | "green-700" | "grey-600" | "red-500" | null | undefined;
|
|
136
|
+
look?: "filled" | "outline" | null | undefined;
|
|
137
|
+
size?: "s" | "m" | "l" | null | undefined;
|
|
138
|
+
iconOnly?: boolean | null | undefined;
|
|
139
|
+
fullWidth?: boolean | null | undefined;
|
|
140
|
+
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
141
|
+
interface ButtonProps extends Omit<ButtonHTMLAttributes<HTMLButtonElement>, 'color'>, VariantProps<typeof buttonVariants> {
|
|
142
|
+
label?: string;
|
|
143
|
+
iconLeft?: ReactNode;
|
|
144
|
+
iconRight?: ReactNode;
|
|
145
|
+
isLoading?: boolean;
|
|
146
|
+
}
|
|
147
|
+
declare const Button: react.ForwardRefExoticComponent<ButtonProps & react.RefAttributes<HTMLButtonElement>>;
|
|
148
|
+
|
|
149
|
+
interface InputProps extends InputHTMLAttributes<HTMLInputElement> {
|
|
150
|
+
label?: string;
|
|
151
|
+
}
|
|
152
|
+
declare const Input: react.ForwardRefExoticComponent<InputProps & react.RefAttributes<HTMLInputElement>>;
|
|
153
|
+
|
|
154
|
+
type TextareaProps = TextareaHTMLAttributes<HTMLTextAreaElement>;
|
|
155
|
+
declare const Textarea: react.ForwardRefExoticComponent<TextareaProps & react.RefAttributes<HTMLTextAreaElement>>;
|
|
156
|
+
|
|
157
|
+
interface LabelProps extends React.ComponentPropsWithoutRef<typeof RadixLabel.Root> {
|
|
158
|
+
children?: ReactNode;
|
|
159
|
+
required?: boolean;
|
|
160
|
+
}
|
|
161
|
+
declare const Label: ({ children, required, className, ...props }: LabelProps) => react.JSX.Element;
|
|
162
|
+
|
|
163
|
+
type InputGroupProps = HTMLAttributes<HTMLDivElement>;
|
|
164
|
+
/** Conteneur relatif pour composer un champ avec des icônes/boutons ancrés dedans — calqué sur `InputGroup` de shadcn. Composer avec `InputGroupAddon`/`InputGroupButton`. */
|
|
165
|
+
declare const InputGroup: react.ForwardRefExoticComponent<InputGroupProps & react.RefAttributes<HTMLDivElement>>;
|
|
166
|
+
interface InputGroupAddonProps extends HTMLAttributes<HTMLDivElement> {
|
|
167
|
+
/** Bord du champ où ancrer l'addon. */
|
|
168
|
+
align?: 'inline-start' | 'inline-end';
|
|
169
|
+
}
|
|
170
|
+
/** Icône/bouton ancré à l'intérieur d'un `InputGroup`, verticalement centré. */
|
|
171
|
+
declare const InputGroupAddon: ({ align, className, ...props }: InputGroupAddonProps) => react.JSX.Element;
|
|
172
|
+
type InputGroupButtonProps = ButtonHTMLAttributes<HTMLButtonElement>;
|
|
173
|
+
/** Bouton interactif à l'intérieur d'un `InputGroupAddon` (celui-ci désactive `pointer-events`, ce bouton les réactive). */
|
|
174
|
+
declare const InputGroupButton: react.ForwardRefExoticComponent<InputGroupButtonProps & react.RefAttributes<HTMLButtonElement>>;
|
|
175
|
+
|
|
176
|
+
type PasswordInputProps = Omit<InputHTMLAttributes<HTMLInputElement>, 'type'>;
|
|
177
|
+
/** Extension maison au-dessus d'Input — shadcn n'a pas de champ mot de passe, composé ici sur `InputGroup` (son propre pattern pour un champ + icône ancrée). */
|
|
178
|
+
declare const PasswordInput: react.ForwardRefExoticComponent<PasswordInputProps & react.RefAttributes<HTMLInputElement>>;
|
|
179
|
+
|
|
180
|
+
interface SearchInputProps extends Omit<InputHTMLAttributes<HTMLInputElement>, 'type'> {
|
|
181
|
+
onClear?: () => void;
|
|
182
|
+
onSearch?: (value: string) => void;
|
|
183
|
+
}
|
|
184
|
+
/** Extension maison au-dessus d'Input, composée sur `InputGroup` — icône loupe à gauche, croix pour vider à droite quand `onClear` est fourni. */
|
|
185
|
+
declare const SearchInput: react.ForwardRefExoticComponent<SearchInputProps & react.RefAttributes<HTMLInputElement>>;
|
|
186
|
+
|
|
187
|
+
interface PhoneInputMeta {
|
|
188
|
+
phone: string;
|
|
189
|
+
dialCode: string;
|
|
190
|
+
countryIso2: string;
|
|
191
|
+
}
|
|
192
|
+
interface PhoneInputProps {
|
|
193
|
+
label?: string;
|
|
194
|
+
value?: string;
|
|
195
|
+
onChange?: (phone: string, meta: PhoneInputMeta) => void;
|
|
196
|
+
/** Code pays ISO2 (ex. "fr") pour le drapeau/l'indicatif par défaut. */
|
|
197
|
+
defaultCountry?: string;
|
|
198
|
+
disabled?: boolean;
|
|
199
|
+
required?: boolean;
|
|
200
|
+
width?: string;
|
|
201
|
+
className?: string;
|
|
202
|
+
}
|
|
203
|
+
/**
|
|
204
|
+
* Enveloppe react-international-phone + libphonenumber-js, retint sur la
|
|
205
|
+
* palette DZ (voir globals.css). Ne réimplémente pas la gestion indicatifs
|
|
206
|
+
* pays/masques de saisie — même logique que DatePicker + react-day-picker.
|
|
207
|
+
*/
|
|
208
|
+
declare const PhoneInput: ({ label, value, onChange, defaultCountry, disabled, required, width, className, }: PhoneInputProps) => react.JSX.Element;
|
|
209
|
+
|
|
210
|
+
interface EmailInputProps {
|
|
211
|
+
label?: string;
|
|
212
|
+
value: string[];
|
|
213
|
+
onChange: (emails: string[]) => void;
|
|
214
|
+
onInvalidMessage?: (message: string | null) => void;
|
|
215
|
+
placeholder?: string;
|
|
216
|
+
disabled?: boolean;
|
|
217
|
+
required?: boolean;
|
|
218
|
+
width?: string;
|
|
219
|
+
className?: string;
|
|
220
|
+
}
|
|
221
|
+
/** Enveloppe Tagify — retint sur la palette DZ (voir globals.css, classe .dz-tagify). */
|
|
222
|
+
declare const EmailInput: ({ label, value, onChange, onInvalidMessage, placeholder, disabled, required, width, className, }: EmailInputProps) => react.JSX.Element;
|
|
223
|
+
|
|
224
|
+
declare const checkboxVariants: (props?: ({
|
|
225
|
+
color?: "blue-700" | "blue-900" | "blue-950" | "red-900" | "green-700" | "grey-600" | null | undefined;
|
|
226
|
+
size?: "s" | "m" | "l" | null | undefined;
|
|
227
|
+
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
228
|
+
interface CheckboxProps extends Omit<React.ComponentPropsWithoutRef<typeof RadixCheckbox.Root>, 'color' | 'onCheckedChange' | 'onChange'>, VariantProps<typeof checkboxVariants> {
|
|
229
|
+
label?: string;
|
|
230
|
+
onChange?: (checked: boolean) => void;
|
|
231
|
+
}
|
|
232
|
+
declare const Checkbox: ({ label, color, size, onChange, id, className, ...props }: CheckboxProps) => react.JSX.Element;
|
|
233
|
+
|
|
234
|
+
declare const trackVariants$1: (props?: ({
|
|
235
|
+
size?: "s" | "m" | null | undefined;
|
|
236
|
+
color?: "blue-700" | "blue-900" | "blue-950" | "red-900" | "green-700" | "grey-600" | null | undefined;
|
|
237
|
+
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
238
|
+
interface SwitchProps extends Omit<React.ComponentPropsWithoutRef<typeof RadixSwitch.Root>, 'color' | 'onCheckedChange' | 'onChange'>, VariantProps<typeof trackVariants$1> {
|
|
239
|
+
onChange?: (checked: boolean) => void;
|
|
240
|
+
label?: string;
|
|
241
|
+
labelPosition?: 'left' | 'right';
|
|
242
|
+
}
|
|
243
|
+
declare const Switch: ({ size, color, onChange, label, labelPosition, id, className, ...props }: SwitchProps) => react.JSX.Element;
|
|
244
|
+
|
|
245
|
+
declare const badgeVariants: (props?: ({
|
|
246
|
+
color?: "blue-700" | "blue-900" | "blue-950" | "red-900" | "green-700" | "grey-600" | null | undefined;
|
|
247
|
+
size?: "s" | "xs" | "m" | "l" | "xxs" | "xl" | "xxl" | null | undefined;
|
|
248
|
+
isRound?: boolean | null | undefined;
|
|
249
|
+
pointer?: boolean | null | undefined;
|
|
250
|
+
pulse?: boolean | null | undefined;
|
|
251
|
+
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
252
|
+
interface BadgeProps extends Omit<HTMLAttributes<HTMLSpanElement>, 'color'>, VariantProps<typeof badgeVariants> {
|
|
253
|
+
}
|
|
254
|
+
declare const Badge: react.ForwardRefExoticComponent<BadgeProps & react.RefAttributes<HTMLSpanElement>>;
|
|
255
|
+
|
|
256
|
+
type TabsVariant = 'line' | 'pills';
|
|
257
|
+
interface TabItem {
|
|
258
|
+
id: string;
|
|
259
|
+
label: string;
|
|
260
|
+
disabled?: boolean;
|
|
261
|
+
bubbleNumber?: number | null;
|
|
262
|
+
}
|
|
263
|
+
interface TabsProps {
|
|
264
|
+
value: string;
|
|
265
|
+
onChange: (id: string) => void;
|
|
266
|
+
items: TabItem[];
|
|
267
|
+
variant?: TabsVariant;
|
|
268
|
+
/** Chaque item se partage la largeur à parts égales (`100% / items.length`) au lieu de s'ajuster à son contenu. */
|
|
269
|
+
fullWidth?: boolean;
|
|
270
|
+
className?: string;
|
|
271
|
+
}
|
|
272
|
+
declare const Tabs: ({ value, onChange, items, variant, fullWidth, className, }: TabsProps) => react.JSX.Element;
|
|
273
|
+
|
|
274
|
+
interface ModalProps {
|
|
275
|
+
children?: ReactNode;
|
|
276
|
+
open?: boolean;
|
|
277
|
+
onClose?: () => void;
|
|
278
|
+
width?: string;
|
|
279
|
+
/** L'en-tête (`ModalHeader`) devient une poignée de glisser-déposer. */
|
|
280
|
+
draggable?: boolean;
|
|
281
|
+
className?: string;
|
|
282
|
+
}
|
|
283
|
+
/** Construit sur `@radix-ui/react-dialog` — compose-le avec `ModalHeader`/`ModalTitle`/`ModalDescription`/`ModalBody`/`ModalFooter`/`ModalClose`, comme le `Table`. */
|
|
284
|
+
declare const Modal: ({ children, open, onClose, width, draggable, className, }: ModalProps) => react.JSX.Element;
|
|
285
|
+
declare const ModalHeader: ({ className, ...props }: React.HTMLAttributes<HTMLDivElement>) => react.JSX.Element;
|
|
286
|
+
declare const ModalTitle: ({ className, ...props }: React.ComponentPropsWithoutRef<typeof RadixDialog.Title>) => react.JSX.Element;
|
|
287
|
+
declare const ModalDescription: ({ className, ...props }: React.ComponentPropsWithoutRef<typeof RadixDialog.Description>) => react.JSX.Element;
|
|
288
|
+
declare const ModalBody: ({ className, ...props }: React.HTMLAttributes<HTMLDivElement>) => react.JSX.Element;
|
|
289
|
+
declare const ModalFooter: ({ className, ...props }: React.HTMLAttributes<HTMLDivElement>) => react.JSX.Element;
|
|
290
|
+
declare const ModalClose: react.ForwardRefExoticComponent<RadixDialog.DialogCloseProps & react.RefAttributes<HTMLButtonElement>>;
|
|
291
|
+
|
|
292
|
+
interface SelectOption {
|
|
293
|
+
value: string;
|
|
294
|
+
label: string;
|
|
295
|
+
}
|
|
296
|
+
interface SelectSharedProps {
|
|
297
|
+
label?: string;
|
|
298
|
+
options: SelectOption[];
|
|
299
|
+
placeholder?: string;
|
|
300
|
+
width?: string;
|
|
301
|
+
required?: boolean;
|
|
302
|
+
disabled?: boolean;
|
|
303
|
+
/** Masque la barre de recherche — affichée par défaut. */
|
|
304
|
+
hideSearchBar?: boolean;
|
|
305
|
+
className?: string;
|
|
306
|
+
}
|
|
307
|
+
interface SingleSelectProps extends SelectSharedProps {
|
|
308
|
+
multiple?: false;
|
|
309
|
+
value?: string;
|
|
310
|
+
onChange?: (value: string) => void;
|
|
311
|
+
}
|
|
312
|
+
interface MultiSelectProps extends SelectSharedProps {
|
|
313
|
+
multiple: true;
|
|
314
|
+
value?: string[];
|
|
315
|
+
onChange?: (value: string[]) => void;
|
|
316
|
+
}
|
|
317
|
+
type SelectProps = SingleSelectProps | MultiSelectProps;
|
|
318
|
+
declare const Select: (props: SelectProps) => react.JSX.Element;
|
|
319
|
+
|
|
320
|
+
interface TagOption {
|
|
321
|
+
value: string;
|
|
322
|
+
label: string;
|
|
323
|
+
}
|
|
324
|
+
interface TagSelectProps {
|
|
325
|
+
label?: string;
|
|
326
|
+
options: TagOption[];
|
|
327
|
+
value?: TagOption[];
|
|
328
|
+
onChange?: (value: TagOption[]) => void;
|
|
329
|
+
placeholder?: string;
|
|
330
|
+
disabled?: boolean;
|
|
331
|
+
width?: string;
|
|
332
|
+
className?: string;
|
|
333
|
+
}
|
|
334
|
+
/**
|
|
335
|
+
* Multiselect à puces (combobox) — remplace le widget maison `InputSelect`
|
|
336
|
+
* (wrapper react-select) utilisé partout à la place du MultiSelect DZ.
|
|
337
|
+
* Champ à hauteur variable (les puces peuvent passer à la ligne), donc pas
|
|
338
|
+
* aligné sur le h-9 des champs mono-ligne (Input/Select/DatePicker).
|
|
339
|
+
*/
|
|
340
|
+
declare const TagSelect: ({ label, options, value, onChange, placeholder, disabled, width, className, }: TagSelectProps) => react.JSX.Element;
|
|
341
|
+
|
|
342
|
+
interface TableEmptyState {
|
|
343
|
+
icon: ReactNode;
|
|
344
|
+
label: string;
|
|
345
|
+
buttonLabel?: string;
|
|
346
|
+
action?: () => void;
|
|
347
|
+
}
|
|
348
|
+
interface TablePagination {
|
|
349
|
+
itemsPerPage: number;
|
|
350
|
+
currentPage: number;
|
|
351
|
+
/** Total réel côté serveur (ex. `count` renvoyé par la RPC) — `rows` ne contient que la page courante. */
|
|
352
|
+
totalItems: number;
|
|
353
|
+
onPageChange: (page: number) => void;
|
|
354
|
+
}
|
|
355
|
+
interface TableProps {
|
|
356
|
+
/** Largeur du tableau (défaut : 100% du conteneur). Les largeurs par colonne se posent sur chaque `TableHeaderCell`/`TableCell`/`TableFooterCell`. */
|
|
357
|
+
width?: string;
|
|
358
|
+
/** `<TableHeader>` déjà construit — compose-le toi-même avec `TableHeader`/`TableHeaderRow`/`TableHeaderCell` (le tri, s'il y en a, est géré dans ce composant). */
|
|
359
|
+
header: ReactNode;
|
|
360
|
+
/** Une ligne déjà construite (`TableRow`/`TableCell`, ou ton propre composant qui les compose) par élément. */
|
|
361
|
+
rows: ReactNode[];
|
|
362
|
+
/** `<TableFooter>` déjà construit — compose-le toi-même avec `TableFooter`/`TableFooterRow`/`TableFooterCell`. */
|
|
363
|
+
footer?: ReactNode;
|
|
364
|
+
/** Masque emptyState et la pagination pendant un chargement — pour l'état visuel des lignes (ex. squelettes), compose `rows` toi-même selon ce booléen. */
|
|
365
|
+
loading?: boolean;
|
|
366
|
+
/** Icône dans un cercle bleu + texte (+ bouton d'action optionnel), affiché quand `rows` est vide (et hors chargement). */
|
|
367
|
+
emptyState?: TableEmptyState | null;
|
|
368
|
+
maxHeight?: string;
|
|
369
|
+
/** Hauteur plancher — le tableau garde son gabarit même sans lignes, pour que
|
|
370
|
+
* la page ne se replie pas entre un résultat vide et une liste chargée. */
|
|
371
|
+
minHeight?: string;
|
|
372
|
+
className?: string;
|
|
373
|
+
/** `rows` ne contient que la page courante (venue d'une RPC) — `Table` affiche le pied de pagination et te redonne la main via `onPageChange` pour refetch. */
|
|
374
|
+
pagination?: TablePagination;
|
|
375
|
+
/** Alterne le fond des lignes une sur deux. */
|
|
376
|
+
zebra?: boolean;
|
|
377
|
+
/** Séparateur vertical entre toutes les colonnes (header, lignes, footer) — pas besoin de le poser cellule par cellule. */
|
|
378
|
+
borderLeft?: boolean;
|
|
379
|
+
}
|
|
380
|
+
declare const Table: ({ width, header, rows, footer, loading, emptyState, maxHeight, minHeight, className, pagination, zebra, borderLeft, }: TableProps) => react.JSX.Element;
|
|
381
|
+
|
|
382
|
+
interface TableHeaderProps {
|
|
383
|
+
children?: ReactNode;
|
|
384
|
+
}
|
|
385
|
+
declare const TableHeader: ({ children }: TableHeaderProps) => react.JSX.Element;
|
|
386
|
+
|
|
387
|
+
interface TableHeaderRowProps {
|
|
388
|
+
children?: ReactNode;
|
|
389
|
+
}
|
|
390
|
+
declare const TableHeaderRow: ({ children }: TableHeaderRowProps) => react.JSX.Element;
|
|
391
|
+
|
|
392
|
+
declare const SURFACE_CLASS$1: {
|
|
393
|
+
readonly white: "bg-white";
|
|
394
|
+
readonly 'grey-100': "bg-grey-100";
|
|
395
|
+
};
|
|
396
|
+
interface TableHeaderCellProps {
|
|
397
|
+
children?: ReactNode;
|
|
398
|
+
width?: string;
|
|
399
|
+
/** Freeze this column while the table scrolls horizontally. */
|
|
400
|
+
sticky?: 'left' | 'right';
|
|
401
|
+
/** Offset from the sticky edge — the sum of the widths of any columns already frozen on that side. */
|
|
402
|
+
stickyOffset?: string;
|
|
403
|
+
/** Solid surface so scrolling columns don't show through the frozen one. */
|
|
404
|
+
surface?: keyof typeof SURFACE_CLASS$1;
|
|
405
|
+
/** Séparateur vertical entre colonnes. */
|
|
406
|
+
borderLeft?: boolean;
|
|
407
|
+
className?: string;
|
|
408
|
+
}
|
|
409
|
+
declare const TableHeaderCell: ({ children, width, sticky, stickyOffset, surface, borderLeft, className, }: TableHeaderCellProps) => react.JSX.Element;
|
|
410
|
+
|
|
411
|
+
interface TableRowProps {
|
|
412
|
+
children?: ReactNode;
|
|
413
|
+
onClick?: (e: MouseEvent<HTMLTableRowElement>) => void;
|
|
414
|
+
className?: string;
|
|
415
|
+
}
|
|
416
|
+
declare const TableRow: ({ children, onClick, className }: TableRowProps) => react.JSX.Element;
|
|
417
|
+
|
|
418
|
+
declare const SURFACE_CLASS: {
|
|
419
|
+
readonly white: "bg-white";
|
|
420
|
+
readonly 'grey-100': "bg-grey-100";
|
|
421
|
+
};
|
|
422
|
+
interface TableCellProps {
|
|
423
|
+
children?: ReactNode;
|
|
424
|
+
width?: string;
|
|
425
|
+
centerContent?: boolean;
|
|
426
|
+
/** Freeze this column while the table scrolls horizontally. */
|
|
427
|
+
sticky?: 'left' | 'right';
|
|
428
|
+
/** Offset from the sticky edge — the sum of the widths of any columns already frozen on that side. */
|
|
429
|
+
stickyOffset?: string;
|
|
430
|
+
/** Solid surface so scrolling columns don't show through the frozen one. */
|
|
431
|
+
surface?: keyof typeof SURFACE_CLASS;
|
|
432
|
+
/** Séparateur vertical entre colonnes. */
|
|
433
|
+
borderLeft?: boolean;
|
|
434
|
+
className?: string;
|
|
435
|
+
}
|
|
436
|
+
declare const TableCell: ({ children, width, centerContent, sticky, stickyOffset, surface, borderLeft, className, }: TableCellProps) => react.JSX.Element;
|
|
437
|
+
|
|
438
|
+
interface TableFooterProps {
|
|
439
|
+
children?: ReactNode;
|
|
440
|
+
className?: string;
|
|
441
|
+
}
|
|
442
|
+
declare const TableFooter: ({ children, className }: TableFooterProps) => react.JSX.Element;
|
|
443
|
+
|
|
444
|
+
interface TableFooterRowProps {
|
|
445
|
+
children?: ReactNode;
|
|
446
|
+
}
|
|
447
|
+
declare const TableFooterRow: ({ children }: TableFooterRowProps) => react.JSX.Element;
|
|
448
|
+
|
|
449
|
+
interface TableFooterCellProps {
|
|
450
|
+
children?: ReactNode;
|
|
451
|
+
width?: string;
|
|
452
|
+
/** Séparateur vertical entre colonnes. */
|
|
453
|
+
borderLeft?: boolean;
|
|
454
|
+
className?: string;
|
|
455
|
+
}
|
|
456
|
+
declare const TableFooterCell: ({ children, width, borderLeft, className, }: TableFooterCellProps) => react.JSX.Element;
|
|
457
|
+
|
|
458
|
+
declare const useAvatarSize: () => number;
|
|
459
|
+
interface AvatarBadgeConfig {
|
|
460
|
+
/** Nom de l'icône FontAwesome, sans le préfixe `fa-`. */
|
|
461
|
+
icon: string;
|
|
462
|
+
iconFamily?: IconFamily;
|
|
463
|
+
backgroundColor: ColorToken;
|
|
464
|
+
iconColor: ColorToken;
|
|
465
|
+
}
|
|
466
|
+
interface AvatarProps extends Omit<ComponentPropsWithoutRef<typeof RadixAvatar.Root>, 'color'> {
|
|
467
|
+
size?: number;
|
|
468
|
+
shape?: 'circle' | 'square';
|
|
469
|
+
/** Mode raccourci : nom affiché en initiales si `src` absent/en erreur. Ignoré si `children` est fourni. */
|
|
470
|
+
name?: string;
|
|
471
|
+
src?: string | null;
|
|
472
|
+
color?: ColorToken;
|
|
473
|
+
badge?: AvatarBadgeConfig;
|
|
474
|
+
}
|
|
475
|
+
/** Sans `children` : mode raccourci, auto-compose Image/Fallback/Badge à partir de `name`/`src`/`color`/`badge`. Avec `children` : composition manuelle (`AvatarImage`, `AvatarFallback`, `AvatarBadge`) pour un contrôle total. */
|
|
476
|
+
declare const Avatar: react.ForwardRefExoticComponent<AvatarProps & react.RefAttributes<HTMLSpanElement>>;
|
|
477
|
+
type AvatarImageProps = ComponentPropsWithoutRef<typeof RadixAvatar.Image>;
|
|
478
|
+
declare const AvatarImage: react.ForwardRefExoticComponent<Omit<RadixAvatar.AvatarImageProps & react.RefAttributes<HTMLImageElement>, "ref"> & react.RefAttributes<HTMLImageElement>>;
|
|
479
|
+
interface AvatarFallbackProps extends ComponentPropsWithoutRef<typeof RadixAvatar.Fallback> {
|
|
480
|
+
color?: ColorToken;
|
|
481
|
+
}
|
|
482
|
+
declare const AvatarFallback: react.ForwardRefExoticComponent<AvatarFallbackProps & react.RefAttributes<HTMLSpanElement>>;
|
|
483
|
+
type AvatarBadgeProps = HTMLAttributes<HTMLDivElement>;
|
|
484
|
+
/** Positionné dans le coin bas-droit de l'Avatar parent (via context de taille) — un point de statut nu (`<AvatarBadge className="bg-green-700" />`) ou une icône en enfant. */
|
|
485
|
+
declare const AvatarBadge: react.ForwardRefExoticComponent<AvatarBadgeProps & react.RefAttributes<HTMLDivElement>>;
|
|
486
|
+
interface AvatarGroupProps extends HTMLAttributes<HTMLDivElement> {
|
|
487
|
+
size?: number;
|
|
488
|
+
max?: number;
|
|
489
|
+
}
|
|
490
|
+
/** Force `size` sur chaque `Avatar` enfant et ajoute un anneau blanc pour les séparer visuellement dans l'empilement. */
|
|
491
|
+
declare const AvatarGroup: ({ size, max, className, children, ...props }: AvatarGroupProps) => react.JSX.Element;
|
|
492
|
+
|
|
493
|
+
declare const radioVariants: (props?: ({
|
|
494
|
+
color?: "blue-700" | "blue-900" | "blue-950" | "red-900" | "green-700" | "grey-600" | null | undefined;
|
|
495
|
+
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
496
|
+
interface RadioOption {
|
|
497
|
+
value: string;
|
|
498
|
+
label?: string;
|
|
499
|
+
}
|
|
500
|
+
interface RadioProps extends VariantProps<typeof radioVariants> {
|
|
501
|
+
items: RadioOption[];
|
|
502
|
+
value?: string;
|
|
503
|
+
onChange?: (value: string) => void;
|
|
504
|
+
disabled?: boolean;
|
|
505
|
+
width?: string;
|
|
506
|
+
className?: string;
|
|
507
|
+
}
|
|
508
|
+
declare const Radio: ({ items, value, onChange, disabled, color, width, className, }: RadioProps) => react.JSX.Element;
|
|
509
|
+
|
|
510
|
+
declare const trackVariants: (props?: ({
|
|
511
|
+
height?: "sm" | "md" | "lg" | null | undefined;
|
|
512
|
+
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
513
|
+
interface ProgressBarProps extends VariantProps<typeof trackVariants> {
|
|
514
|
+
/** Sur la plage `min`–`max`, clampée. */
|
|
515
|
+
value: number;
|
|
516
|
+
/** Rend la barre déplaçable au doigt/souris (slider) — sans, c'est une barre en lecture seule. */
|
|
517
|
+
onChange?: (value: number) => void;
|
|
518
|
+
min?: number;
|
|
519
|
+
max?: number;
|
|
520
|
+
step?: number;
|
|
521
|
+
disabled?: boolean;
|
|
522
|
+
color?: ColorToken;
|
|
523
|
+
label?: string;
|
|
524
|
+
showLabel?: boolean;
|
|
525
|
+
formatValue?: (value: number) => string;
|
|
526
|
+
className?: string;
|
|
527
|
+
}
|
|
528
|
+
declare const ProgressBar: ({ value, onChange, min, max, step, disabled, color, height, label, showLabel, formatValue, className, }: ProgressBarProps) => react.JSX.Element;
|
|
529
|
+
|
|
530
|
+
declare const Collapsible: react.ForwardRefExoticComponent<RadixCollapsible.CollapsibleProps & react.RefAttributes<HTMLDivElement>>;
|
|
531
|
+
declare const CollapsibleTrigger: react.ForwardRefExoticComponent<RadixCollapsible.CollapsibleTriggerProps & react.RefAttributes<HTMLButtonElement>>;
|
|
532
|
+
declare const CollapsibleContent: ({ className, ...props }: React.ComponentPropsWithoutRef<typeof RadixCollapsible.Content>) => react.JSX.Element;
|
|
533
|
+
|
|
534
|
+
type DrawerDirection = 'top' | 'bottom' | 'left' | 'right';
|
|
535
|
+
interface DrawerProps {
|
|
536
|
+
children?: ReactNode;
|
|
537
|
+
open?: boolean;
|
|
538
|
+
onClose?: () => void;
|
|
539
|
+
/** Bord de l'écran depuis lequel le panneau glisse (défaut : `right`). */
|
|
540
|
+
direction?: DrawerDirection;
|
|
541
|
+
/** Largeur (directions `left`/`right`) ou hauteur (directions `top`/`bottom`) du panneau. */
|
|
542
|
+
size?: string;
|
|
543
|
+
className?: string;
|
|
544
|
+
}
|
|
545
|
+
/** Panneau — construit sur `vaul` (la lib derrière le vrai `Drawer` de shadcn). Compose-le avec `DrawerHeader`/`DrawerTitle`/`DrawerDescription`/`DrawerBody`/`DrawerFooter`/`DrawerClose`, comme le `Table`. Flotte : une marge le sépare des bords de la page, l'overlay se voit tout autour. */
|
|
546
|
+
declare const Drawer: ({ children, open, onClose, direction, size, className, }: DrawerProps) => react.JSX.Element;
|
|
547
|
+
declare const DrawerHeader: ({ className, ...props }: React.HTMLAttributes<HTMLDivElement>) => react.JSX.Element;
|
|
548
|
+
declare const DrawerTitle: ({ className, ...props }: React.ComponentPropsWithoutRef<typeof Drawer$1.Title>) => react.JSX.Element;
|
|
549
|
+
declare const DrawerDescription: ({ className, ...props }: React.ComponentPropsWithoutRef<typeof Drawer$1.Description>) => react.JSX.Element;
|
|
550
|
+
declare const DrawerBody: ({ className, ...props }: React.HTMLAttributes<HTMLDivElement>) => react.JSX.Element;
|
|
551
|
+
declare const DrawerFooter: ({ className, ...props }: React.HTMLAttributes<HTMLDivElement>) => react.JSX.Element;
|
|
552
|
+
declare const DrawerClose: react.ForwardRefExoticComponent<RadixDialog.DialogCloseProps & react.RefAttributes<HTMLButtonElement>>;
|
|
553
|
+
|
|
554
|
+
interface PopoverMenuItem {
|
|
555
|
+
label: ReactNode;
|
|
556
|
+
action: () => void;
|
|
557
|
+
}
|
|
558
|
+
interface PopoverProps {
|
|
559
|
+
trigger: ReactNode;
|
|
560
|
+
items?: PopoverMenuItem[];
|
|
561
|
+
children?: ReactNode;
|
|
562
|
+
align?: 'start' | 'center' | 'end';
|
|
563
|
+
side?: 'top' | 'bottom' | 'left' | 'right';
|
|
564
|
+
className?: string;
|
|
565
|
+
}
|
|
566
|
+
declare const Popover: ({ trigger, items, children, align, side, className, }: PopoverProps) => react.JSX.Element;
|
|
567
|
+
|
|
568
|
+
interface TooltipProps {
|
|
569
|
+
children: ReactNode;
|
|
570
|
+
content: ReactNode;
|
|
571
|
+
side?: 'top' | 'bottom' | 'left' | 'right';
|
|
572
|
+
/** Bord de la cible sur lequel la bulle s'aligne. Combiné à `side`, il donne
|
|
573
|
+
* les positions composées : `bottom` + `end` = en bas à droite. */
|
|
574
|
+
align?: 'start' | 'center' | 'end';
|
|
575
|
+
className?: string;
|
|
576
|
+
}
|
|
577
|
+
/** Enveloppe son propre Provider — pour partager `delayDuration` entre plusieurs Tooltip, monter un seul `RadixTooltip.Provider` à la racine de l'app à la place. */
|
|
578
|
+
declare const Tooltip: ({ children, content, side, align, className, }: TooltipProps) => react.JSX.Element;
|
|
579
|
+
|
|
580
|
+
/** Monter une seule fois à la racine de l'app, à côté du router — construit sur `sonner` (le moteur recommandé par shadcn), retint via `ToastCard`. */
|
|
581
|
+
declare const Toaster: () => react.JSX.Element;
|
|
582
|
+
|
|
583
|
+
type ToastType = 'success' | 'error' | 'warning' | 'info';
|
|
584
|
+
interface ToastOptions {
|
|
585
|
+
title?: string;
|
|
586
|
+
timeOut?: number;
|
|
587
|
+
}
|
|
588
|
+
/** API impérative, appelable hors composant React. Monte `<Toaster />` une fois à la racine de l'app. */
|
|
589
|
+
declare const toast: {
|
|
590
|
+
success: (message: string, options?: ToastOptions) => void;
|
|
591
|
+
error: (message: string, options?: ToastOptions) => void;
|
|
592
|
+
warning: (message: string, options?: ToastOptions) => void;
|
|
593
|
+
info: (message: string, options?: ToastOptions) => void;
|
|
594
|
+
};
|
|
595
|
+
|
|
596
|
+
declare const pageContainerVariants: (props?: ({
|
|
597
|
+
padding?: "none" | "sm" | "md" | "lg" | null | undefined;
|
|
598
|
+
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
599
|
+
interface PageContainerProps extends HTMLAttributes<HTMLDivElement>, VariantProps<typeof pageContainerVariants> {
|
|
600
|
+
}
|
|
601
|
+
/** Container plein cadre — la largeur/hauteur dépend du parent (flex/grid de l'app), pas d'un offset sidebar codé en dur. */
|
|
602
|
+
declare const PageContainer: react.ForwardRefExoticComponent<PageContainerProps & react.RefAttributes<HTMLDivElement>>;
|
|
603
|
+
|
|
604
|
+
interface IconTabItem {
|
|
605
|
+
/** Nom de l'icône FontAwesome, sans le préfixe `fa-` (ex. "map", "chart-bar"). */
|
|
606
|
+
icon: string;
|
|
607
|
+
iconFamily?: IconFamily;
|
|
608
|
+
label?: string;
|
|
609
|
+
}
|
|
610
|
+
interface IconTabsProps {
|
|
611
|
+
items: IconTabItem[];
|
|
612
|
+
value: number;
|
|
613
|
+
onChange?: (index: number) => void;
|
|
614
|
+
disabledIndexes?: number[];
|
|
615
|
+
className?: string;
|
|
616
|
+
}
|
|
617
|
+
declare const IconTabs: ({ items, value, onChange, disabledIndexes, className, }: IconTabsProps) => react.JSX.Element;
|
|
618
|
+
|
|
619
|
+
interface EmptyStateProps {
|
|
620
|
+
icon?: ReactNode;
|
|
621
|
+
title?: string;
|
|
622
|
+
description?: string;
|
|
623
|
+
actionLabel?: string;
|
|
624
|
+
onAction?: () => void;
|
|
625
|
+
className?: string;
|
|
626
|
+
}
|
|
627
|
+
/** Structure calquée sur `Empty`/`EmptyHeader`/`EmptyMedia`/`EmptyContent` de shadcn, retint DZ. */
|
|
628
|
+
declare const EmptyState: ({ icon, title, description, actionLabel, onAction, className, }: EmptyStateProps) => react.JSX.Element;
|
|
629
|
+
|
|
630
|
+
declare const bannerVariants: (props?: ({
|
|
631
|
+
tone?: "blue-700" | "blue-900" | "blue-950" | "red-900" | "green-700" | "grey-600" | null | undefined;
|
|
632
|
+
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
633
|
+
interface BannerAction {
|
|
634
|
+
label: string;
|
|
635
|
+
icon?: ReactNode;
|
|
636
|
+
onClick?: () => void;
|
|
637
|
+
}
|
|
638
|
+
interface BannerToggle {
|
|
639
|
+
checked: boolean;
|
|
640
|
+
onChange: (checked: boolean) => void;
|
|
641
|
+
disabled?: boolean;
|
|
642
|
+
}
|
|
643
|
+
interface BannerProps extends VariantProps<typeof bannerVariants> {
|
|
644
|
+
badge?: string;
|
|
645
|
+
title?: string;
|
|
646
|
+
subtitle?: string;
|
|
647
|
+
message?: string;
|
|
648
|
+
action?: BannerAction;
|
|
649
|
+
toggle?: BannerToggle;
|
|
650
|
+
children?: ReactNode;
|
|
651
|
+
fullWidth?: boolean;
|
|
652
|
+
width?: string;
|
|
653
|
+
className?: string;
|
|
654
|
+
}
|
|
655
|
+
declare const Banner: ({ tone, badge, title, subtitle, message, action, toggle, children, fullWidth, width, className, }: BannerProps) => react.JSX.Element;
|
|
656
|
+
|
|
657
|
+
interface FloatingAction {
|
|
658
|
+
id: string;
|
|
659
|
+
label: string;
|
|
660
|
+
icon: ReactNode;
|
|
661
|
+
badge?: number;
|
|
662
|
+
onClick: () => void;
|
|
663
|
+
}
|
|
664
|
+
interface FloatingButtonProps {
|
|
665
|
+
isOpen: boolean;
|
|
666
|
+
onToggle: () => void;
|
|
667
|
+
actions: FloatingAction[];
|
|
668
|
+
mainBadge?: number;
|
|
669
|
+
icon?: ReactNode;
|
|
670
|
+
label?: string;
|
|
671
|
+
color?: ColorToken;
|
|
672
|
+
/** Le bouton principal devient une poignée de glisser-déposer — la position se garde tant que le composant reste monté. */
|
|
673
|
+
draggable?: boolean;
|
|
674
|
+
/** Sauvegarde la position glissée dans localStorage sous cette clé et la restaure au montage — sans clé, la position ne survit pas à un refresh/changement de page. */
|
|
675
|
+
persistKey?: string;
|
|
676
|
+
}
|
|
677
|
+
declare const FloatingButton: ({ isOpen, onToggle, actions, mainBadge, icon, label, color, draggable, persistKey, }: FloatingButtonProps) => react.JSX.Element;
|
|
678
|
+
|
|
679
|
+
interface MetricCardProps {
|
|
680
|
+
/** Nom de l'icône FontAwesome, sans le préfixe `fa-` (ex. "truck"). */
|
|
681
|
+
icon: string;
|
|
682
|
+
iconFamily?: IconFamily;
|
|
683
|
+
title?: string;
|
|
684
|
+
value?: string | number;
|
|
685
|
+
valueColor?: ColorToken;
|
|
686
|
+
subtitle?: string;
|
|
687
|
+
accent?: ColorToken;
|
|
688
|
+
layout?: 'row' | 'column';
|
|
689
|
+
onClick?: () => void;
|
|
690
|
+
selected?: boolean;
|
|
691
|
+
children?: ReactNode;
|
|
692
|
+
className?: string;
|
|
693
|
+
}
|
|
694
|
+
declare const MetricCard: ({ icon, iconFamily, title, value, valueColor, subtitle, accent, layout, onClick, selected, children, className, }: MetricCardProps) => react.JSX.Element;
|
|
695
|
+
|
|
696
|
+
type SpinnerSize = 's' | 'm' | 'l';
|
|
697
|
+
interface SpinnerProps {
|
|
698
|
+
size?: SpinnerSize;
|
|
699
|
+
/** Sans couleur, hérite du `currentColor` ambiant (utile dans un Button dont le texte change déjà de couleur). */
|
|
700
|
+
color?: ColorToken;
|
|
701
|
+
className?: string;
|
|
702
|
+
}
|
|
703
|
+
declare const Spinner: ({ size, color, className }: SpinnerProps) => react.JSX.Element;
|
|
704
|
+
|
|
705
|
+
interface SkeletonProps extends HTMLAttributes<HTMLDivElement> {
|
|
706
|
+
width?: string | number;
|
|
707
|
+
height?: string | number;
|
|
708
|
+
isRound?: boolean;
|
|
709
|
+
}
|
|
710
|
+
declare const Skeleton: ({ width, height, isRound, className, style, ...props }: SkeletonProps) => react.JSX.Element;
|
|
711
|
+
|
|
712
|
+
interface PaginationProps {
|
|
713
|
+
currentPage: number;
|
|
714
|
+
totalItems: number;
|
|
715
|
+
itemsPerPage: number;
|
|
716
|
+
onPageChange: (page: number) => void;
|
|
717
|
+
showSummary?: boolean;
|
|
718
|
+
summaryLabel?: string;
|
|
719
|
+
}
|
|
720
|
+
/** Structure calquée sur `Pagination`/`PaginationContent`/`PaginationItem` de shadcn (nav > ul > li). */
|
|
721
|
+
declare const Pagination: ({ currentPage, totalItems, itemsPerPage, onPageChange, showSummary, summaryLabel, }: PaginationProps) => react.JSX.Element;
|
|
722
|
+
|
|
723
|
+
interface TagBubbleProps {
|
|
724
|
+
label: string;
|
|
725
|
+
hideDot?: boolean;
|
|
726
|
+
active?: boolean;
|
|
727
|
+
activeColor?: ColorToken;
|
|
728
|
+
inactiveColor?: ColorToken;
|
|
729
|
+
count?: number | string | null;
|
|
730
|
+
countColor?: ColorToken;
|
|
731
|
+
onClick?: () => void;
|
|
732
|
+
className?: string;
|
|
733
|
+
}
|
|
734
|
+
/** Construit sur `@radix-ui/react-toggle` (comme le `Toggle` de shadcn) — chip filtre à deux états, pressable au clavier. */
|
|
735
|
+
declare const TagBubble: ({ label, hideDot, active, activeColor, inactiveColor, count, countColor, onClick, className, }: TagBubbleProps) => react.JSX.Element;
|
|
736
|
+
|
|
737
|
+
interface GanttDay {
|
|
738
|
+
key: string | number;
|
|
739
|
+
leftPct: number;
|
|
740
|
+
widthPct: number;
|
|
741
|
+
label: string;
|
|
742
|
+
}
|
|
743
|
+
interface GanttBar {
|
|
744
|
+
leftPct: number;
|
|
745
|
+
widthPct: number;
|
|
746
|
+
color: string;
|
|
747
|
+
textColor?: string;
|
|
748
|
+
label?: string | null;
|
|
749
|
+
title?: string;
|
|
750
|
+
dashed?: boolean;
|
|
751
|
+
}
|
|
752
|
+
interface GanttRow<T = unknown> {
|
|
753
|
+
key: string | number;
|
|
754
|
+
bar?: GanttBar | null;
|
|
755
|
+
data: T;
|
|
756
|
+
}
|
|
757
|
+
interface GanttBand {
|
|
758
|
+
key: string | number;
|
|
759
|
+
leftPct: number;
|
|
760
|
+
widthPct: number;
|
|
761
|
+
title?: string;
|
|
762
|
+
}
|
|
763
|
+
interface GanttProps<T = unknown> {
|
|
764
|
+
days: GanttDay[];
|
|
765
|
+
rows: GanttRow<T>[];
|
|
766
|
+
bands?: GanttBand[];
|
|
767
|
+
labelHeader?: string;
|
|
768
|
+
renderLabel: (row: GanttRow<T>, index: number) => ReactNode;
|
|
769
|
+
onRowClick?: (row: GanttRow<T>, index: number) => void;
|
|
770
|
+
labelWidth?: number;
|
|
771
|
+
rowHeight?: number;
|
|
772
|
+
maxHeight?: number;
|
|
773
|
+
className?: string;
|
|
774
|
+
}
|
|
775
|
+
declare const Gantt: <T>({ days, rows, bands, labelHeader, renderLabel, onRowClick, labelWidth, rowHeight, maxHeight, className, }: GanttProps<T>) => react.JSX.Element;
|
|
776
|
+
declare const GanttDot: ({ color }: {
|
|
777
|
+
color: string;
|
|
778
|
+
}) => react.JSX.Element;
|
|
779
|
+
declare const GanttSwatch: ({ color, filled, }: {
|
|
780
|
+
color: string;
|
|
781
|
+
filled?: boolean;
|
|
782
|
+
}) => react.JSX.Element;
|
|
783
|
+
|
|
784
|
+
interface BulkSection {
|
|
785
|
+
title: string;
|
|
786
|
+
icon: ReactNode;
|
|
787
|
+
action: () => void;
|
|
788
|
+
disabled?: boolean;
|
|
789
|
+
}
|
|
790
|
+
interface BulkProps {
|
|
791
|
+
onClose?: () => void;
|
|
792
|
+
leftTitle?: string;
|
|
793
|
+
sections: BulkSection[];
|
|
794
|
+
color?: ColorToken;
|
|
795
|
+
className?: string;
|
|
796
|
+
}
|
|
797
|
+
declare const Bulk: ({ onClose, leftTitle, sections, color, className, }: BulkProps) => react.JSX.Element;
|
|
798
|
+
|
|
799
|
+
interface TimelineItem {
|
|
800
|
+
id: string | number;
|
|
801
|
+
title: string;
|
|
802
|
+
subtitle?: string;
|
|
803
|
+
description?: string;
|
|
804
|
+
/** Couleur du point — pilotée par la donnée (statut métier), hex libre. */
|
|
805
|
+
color?: string;
|
|
806
|
+
highlighted?: boolean;
|
|
807
|
+
}
|
|
808
|
+
interface TimelineProps {
|
|
809
|
+
items: TimelineItem[];
|
|
810
|
+
lineColor?: string;
|
|
811
|
+
emptyLabel?: string;
|
|
812
|
+
className?: string;
|
|
813
|
+
}
|
|
814
|
+
declare const Timeline: ({ items, lineColor, emptyLabel, className, }: TimelineProps) => react.JSX.Element;
|
|
815
|
+
|
|
816
|
+
declare const swatchVariants: (props?: ({
|
|
817
|
+
size?: "s" | "m" | "l" | null | undefined;
|
|
818
|
+
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
819
|
+
interface ColorPickerProps extends VariantProps<typeof swatchVariants> {
|
|
820
|
+
label?: string;
|
|
821
|
+
value?: string;
|
|
822
|
+
defaultValue?: string;
|
|
823
|
+
onChange?: (color: string) => void;
|
|
824
|
+
disabled?: boolean;
|
|
825
|
+
className?: string;
|
|
826
|
+
}
|
|
827
|
+
declare const ColorPicker: react.ForwardRefExoticComponent<ColorPickerProps & react.RefAttributes<HTMLInputElement>>;
|
|
828
|
+
|
|
829
|
+
interface FileUploadZoneProps {
|
|
830
|
+
onSave?: (file: File) => void;
|
|
831
|
+
multiple?: boolean;
|
|
832
|
+
onSaveMultiple?: (files: File[]) => void;
|
|
833
|
+
onRemove?: () => void;
|
|
834
|
+
onError?: (message: string) => void;
|
|
835
|
+
/** Extensions acceptées: ['png', 'jpg', 'pdf'] — toutes par défaut. */
|
|
836
|
+
accept?: string[];
|
|
837
|
+
acceptOnlyPdf?: boolean;
|
|
838
|
+
maxSizeMB?: number;
|
|
839
|
+
label?: string;
|
|
840
|
+
sublabel?: string;
|
|
841
|
+
browseLabel?: string | false;
|
|
842
|
+
disabled?: boolean;
|
|
843
|
+
showPreview?: boolean;
|
|
844
|
+
previewUrl?: string;
|
|
845
|
+
fullWidth?: boolean;
|
|
846
|
+
compact?: boolean;
|
|
847
|
+
showIcon?: boolean;
|
|
848
|
+
showFileName?: boolean;
|
|
849
|
+
className?: string;
|
|
850
|
+
}
|
|
851
|
+
declare const FileUploadZone: ({ onSave, multiple, onSaveMultiple, onRemove, onError, accept, acceptOnlyPdf, maxSizeMB, label, sublabel, browseLabel, disabled, showPreview, previewUrl: controlledPreviewUrl, fullWidth, compact, showIcon, showFileName, className, }: FileUploadZoneProps) => react.JSX.Element;
|
|
852
|
+
|
|
853
|
+
declare const itemVariants: (props?: ({
|
|
854
|
+
variant?: "default" | "outline" | "muted" | null | undefined;
|
|
855
|
+
size?: "default" | "sm" | null | undefined;
|
|
856
|
+
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
857
|
+
interface ItemProps extends HTMLAttributes<HTMLDivElement>, VariantProps<typeof itemVariants> {
|
|
858
|
+
}
|
|
859
|
+
/** Ligne icône/contenu/actions — calqué sur `Item`/`ItemMedia`/`ItemContent`/`ItemActions` de shadcn. */
|
|
860
|
+
declare const Item: react.ForwardRefExoticComponent<ItemProps & react.RefAttributes<HTMLDivElement>>;
|
|
861
|
+
declare const itemMediaVariants: (props?: ({
|
|
862
|
+
variant?: "default" | "icon" | "image" | null | undefined;
|
|
863
|
+
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
864
|
+
interface ItemMediaProps extends HTMLAttributes<HTMLDivElement>, VariantProps<typeof itemMediaVariants> {
|
|
865
|
+
}
|
|
866
|
+
declare const ItemMedia: ({ variant, className, ...props }: ItemMediaProps) => react.JSX.Element;
|
|
867
|
+
declare const ItemContent: ({ className, ...props }: HTMLAttributes<HTMLDivElement>) => react.JSX.Element;
|
|
868
|
+
declare const ItemTitle: ({ className, ...props }: HTMLAttributes<HTMLDivElement>) => react.JSX.Element;
|
|
869
|
+
declare const ItemDescription: ({ className, ...props }: HTMLAttributes<HTMLDivElement>) => react.JSX.Element;
|
|
870
|
+
declare const ItemActions: ({ className, ...props }: HTMLAttributes<HTMLDivElement>) => react.JSX.Element;
|
|
871
|
+
|
|
872
|
+
type AttachmentStatus = 'uploading' | 'error' | 'done';
|
|
873
|
+
interface AttachmentProps {
|
|
874
|
+
name: string;
|
|
875
|
+
size?: string;
|
|
876
|
+
status?: AttachmentStatus;
|
|
877
|
+
/** 0–100, affiché quand `status="uploading"`. */
|
|
878
|
+
progress?: number;
|
|
879
|
+
errorMessage?: string;
|
|
880
|
+
onRemove?: () => void;
|
|
881
|
+
/** Affiché uniquement si `status="error"`. */
|
|
882
|
+
onRetry?: () => void;
|
|
883
|
+
/** Défaut : 100% du parent. */
|
|
884
|
+
width?: string;
|
|
885
|
+
className?: string;
|
|
886
|
+
}
|
|
887
|
+
/** Chip représentant un fichier attaché — icône doc uniquement (pas de miniature image), avec états upload/erreur. Construit sur `Item`, rendu proche d'un `ToastCard` (carte blanche + ombre) plutôt qu'une simple ligne bordée. */
|
|
888
|
+
declare const Attachment: ({ name, size, status, progress, errorMessage, onRemove, onRetry, width, className, }: AttachmentProps) => react.JSX.Element;
|
|
889
|
+
|
|
890
|
+
interface PdfPreviewProps {
|
|
891
|
+
/** URL, `File` (input fichier), ou objet source pdf.js. */
|
|
892
|
+
file: DocumentProps['file'];
|
|
893
|
+
width?: number;
|
|
894
|
+
/** Hauteur max avant défilement vertical. */
|
|
895
|
+
maxHeight?: string;
|
|
896
|
+
className?: string;
|
|
897
|
+
}
|
|
898
|
+
/** Lecture complète d'un PDF (toutes les pages, défilement vertical) — construit sur `react-pdf` (wrapper de `pdf.js`), shadcn n'a pas de composant de rendu de document. */
|
|
899
|
+
declare const PdfPreview: ({ file, width, maxHeight, className, }: PdfPreviewProps) => react.JSX.Element;
|
|
900
|
+
|
|
901
|
+
interface ScrollAreaProps extends Omit<ComponentPropsWithoutRef<typeof RadixScrollArea.Root>, 'children'> {
|
|
902
|
+
children?: ReactNode;
|
|
903
|
+
orientation?: 'vertical' | 'horizontal' | 'both';
|
|
904
|
+
}
|
|
905
|
+
/** Construit sur `@radix-ui/react-scroll-area` (comme le `ScrollArea` de shadcn) — scrollbars custom au lieu de celles du système. */
|
|
906
|
+
declare const ScrollArea: ({ children, className, orientation, ...props }: ScrollAreaProps) => react.JSX.Element;
|
|
907
|
+
|
|
908
|
+
interface StepperProps {
|
|
909
|
+
numberOfSteps: number;
|
|
910
|
+
current?: number;
|
|
911
|
+
size?: number;
|
|
912
|
+
className?: string;
|
|
913
|
+
}
|
|
914
|
+
declare const Stepper: ({ numberOfSteps, current, size, className, }: StepperProps) => react.JSX.Element;
|
|
915
|
+
|
|
916
|
+
type DatePickerMode = 'single' | 'range';
|
|
917
|
+
interface DatePreset {
|
|
918
|
+
label: string;
|
|
919
|
+
icon?: ReactNode;
|
|
920
|
+
/** Renvoie une Date pour le mode "single", ou [début, fin] pour le mode "range". */
|
|
921
|
+
getValue: () => Date | [Date, Date];
|
|
922
|
+
}
|
|
923
|
+
interface DatePickerProps {
|
|
924
|
+
mode?: DatePickerMode;
|
|
925
|
+
/** Mode "single". */
|
|
926
|
+
value?: Date | null;
|
|
927
|
+
onChange?: (date: Date | null) => void;
|
|
928
|
+
/** Mode "range". */
|
|
929
|
+
startDate?: Date | null;
|
|
930
|
+
endDate?: Date | null;
|
|
931
|
+
onRangeChange?: (start: Date | null, end: Date | null) => void;
|
|
932
|
+
/** Rendu "dashboard Ops" — boutons icône (raccourcis + déclencheur calendrier) au lieu d'un champ texte. */
|
|
933
|
+
showPresets?: boolean;
|
|
934
|
+
/** Surcharge les raccourcis par défaut (Ce mois/Ce trimestre/Cette année en range, Aujourd'hui/Demain/+7j en single). */
|
|
935
|
+
presets?: DatePreset[];
|
|
936
|
+
placeholder?: string;
|
|
937
|
+
disabled?: boolean;
|
|
938
|
+
minDate?: Date;
|
|
939
|
+
maxDate?: Date;
|
|
940
|
+
width?: string;
|
|
941
|
+
/** Bord du champ sur lequel le calendrier s'aligne — `end` quand le champ est
|
|
942
|
+
* à droite de la page, pour que le panneau ne déborde pas. */
|
|
943
|
+
align?: 'start' | 'center' | 'end';
|
|
944
|
+
className?: string;
|
|
945
|
+
}
|
|
946
|
+
/** Construit sur `react-day-picker` — la lib derrière le vrai `Calendar`/`DatePicker` de shadcn. */
|
|
947
|
+
declare const DatePicker: ({ mode, value, onChange, startDate, endDate, onRangeChange, showPresets, presets, placeholder, disabled, minDate, maxDate, width, align, className, }: DatePickerProps) => react.JSX.Element;
|
|
948
|
+
|
|
949
|
+
declare const colors: {
|
|
950
|
+
readonly neutral_00: "#FFFFFF00";
|
|
951
|
+
readonly neutral_50: "#fff";
|
|
952
|
+
readonly neutral_100: "#f8f9fa";
|
|
953
|
+
readonly neutral_200: "#f2F2F2";
|
|
954
|
+
readonly neutral_400: "#ccc";
|
|
955
|
+
readonly neutral_500: "#A4A4A4";
|
|
956
|
+
readonly neutral_600: "#808080";
|
|
957
|
+
readonly neutral_800: "#343a40";
|
|
958
|
+
readonly neutral_950: "#000";
|
|
959
|
+
readonly grey_100: "#F8FAFC";
|
|
960
|
+
readonly grey_200: "#F1F5F9";
|
|
961
|
+
readonly grey_300: "#E2E8F0";
|
|
962
|
+
readonly grey_400: "#CBD5E1";
|
|
963
|
+
readonly grey_500: "#94A3B8";
|
|
964
|
+
readonly grey_600: "#646B73";
|
|
965
|
+
readonly dark_100: "#42979D";
|
|
966
|
+
readonly dark_200: "#317176";
|
|
967
|
+
readonly dark_300: "#1D1C1C";
|
|
968
|
+
readonly blue_50: "#DBE9FE";
|
|
969
|
+
readonly blue_100: "#CCEAF8";
|
|
970
|
+
readonly blue_200: "#B9DCED";
|
|
971
|
+
readonly blue_300: "#A7CFE2";
|
|
972
|
+
readonly blue_400: "#94C1D7";
|
|
973
|
+
readonly blue_500: "#82B4CC";
|
|
974
|
+
readonly blue_600: "#5C99B7";
|
|
975
|
+
readonly blue_700: "#377EA1";
|
|
976
|
+
readonly blue_800: "#12638B";
|
|
977
|
+
readonly blue_900: "#0E4F6F";
|
|
978
|
+
readonly blue_950: "#1C4ED8";
|
|
979
|
+
readonly red_500: "#F44649";
|
|
980
|
+
readonly red_50: "#FEE9E9";
|
|
981
|
+
readonly red_900: "#7F1D1D";
|
|
982
|
+
readonly turquoise_50: "#EEF8F9";
|
|
983
|
+
readonly turquoise_100: "#DCF2F3";
|
|
984
|
+
readonly turquoise_200: "#CBEBED";
|
|
985
|
+
readonly turquoise_300: "#BAE5E7";
|
|
986
|
+
readonly turquoise_400: "#97D7DC";
|
|
987
|
+
readonly yellow_50: "#FEF7EA";
|
|
988
|
+
readonly yellow_100: "#FEEDD5";
|
|
989
|
+
readonly yellow_200: "#FFD700";
|
|
990
|
+
readonly yellow_300: "#F8AF2D";
|
|
991
|
+
readonly yellow_400: "#DF8F00";
|
|
992
|
+
readonly yellow_500: "#A16207";
|
|
993
|
+
readonly orange_50: "#FFEEE6";
|
|
994
|
+
readonly orange_100: "#FFCEB8";
|
|
995
|
+
readonly orange_300: "#FFAF8A";
|
|
996
|
+
readonly orange_400: "#FF8F5C";
|
|
997
|
+
readonly orange_500: "#FF641C";
|
|
998
|
+
readonly orange_600: "#FF5100";
|
|
999
|
+
readonly purple_50: "#EDE9FE";
|
|
1000
|
+
readonly purple_700: "#7230DB";
|
|
1001
|
+
readonly pink_50: "#FDF2F8";
|
|
1002
|
+
readonly pink_100: "#FCE7F3";
|
|
1003
|
+
readonly pink_300: "#FBCFE8";
|
|
1004
|
+
readonly pink_400: "#F9A8D4";
|
|
1005
|
+
readonly pink_500: "#CF0F9E";
|
|
1006
|
+
readonly pink_600: "#EC4899";
|
|
1007
|
+
readonly pink_700: "#DB2777";
|
|
1008
|
+
readonly pink_800: "#BE185D";
|
|
1009
|
+
readonly pink_900: "#9D174D";
|
|
1010
|
+
readonly fuchsia_300: "#FFB3EC";
|
|
1011
|
+
readonly green_50: "#DCFCE7";
|
|
1012
|
+
readonly green_100: "#12B76A";
|
|
1013
|
+
readonly green_700: "#17803D";
|
|
1014
|
+
readonly green_900: "#006123";
|
|
1015
|
+
readonly brown_50: "#EFEBE9";
|
|
1016
|
+
readonly brown_100: "#D7CCC8";
|
|
1017
|
+
readonly brown_300: "#A1887F";
|
|
1018
|
+
readonly brown_400: "#8D6E63";
|
|
1019
|
+
readonly brown_500: "#795548";
|
|
1020
|
+
readonly brown_600: "#CD7F32";
|
|
1021
|
+
readonly brown_700: "#5D4037";
|
|
1022
|
+
readonly brown_800: "#4E342E";
|
|
1023
|
+
readonly brown_900: "#3E2723";
|
|
1024
|
+
readonly brown_950: "#333222";
|
|
1025
|
+
readonly gradient_blue_deep: "linear-gradient(131.36deg, rgb(3, 62, 113) 0%, rgb(0, 87, 138) 20%, rgb(1, 113, 164) 40%, rgb(1, 113, 164) 50%, rgb(0, 87, 138) 80%, rgb(3, 62, 113) 100%)";
|
|
1026
|
+
};
|
|
1027
|
+
type ColorKey = keyof typeof colors;
|
|
1028
|
+
|
|
1029
|
+
/**
|
|
1030
|
+
* Miroir de DesignSystem/src/data/globalMethods.ts.
|
|
1031
|
+
*
|
|
1032
|
+
* formatDate(date, type?, language?)
|
|
1033
|
+
* - language : fr/en/es/... (locale déduite), défaut "en"
|
|
1034
|
+
* - type:
|
|
1035
|
+
* - "date": date courte locale (ex: 16/05/2024)
|
|
1036
|
+
* - "dateTime": date courte + heure (24h)
|
|
1037
|
+
* - "dateTimeSeconds": DD/MM/YY + heure avec secondes (24h) (ex: 16/05/24 14:32:07)
|
|
1038
|
+
* - "weekday": jour court + jour + mois (année si différente)
|
|
1039
|
+
* - "weekdayDay": jour court + jour
|
|
1040
|
+
* - "weekdayYear": jour court + jour + mois + année
|
|
1041
|
+
* - "weekdayTime": jour/date + heure (24h)
|
|
1042
|
+
* - "longDate": jour + mois complet + année, sans jour de semaine (ex: 16 mai 2024)
|
|
1043
|
+
* - "dateISO": format ISO YYYY-MM-DD (safe timezone pour le backend)
|
|
1044
|
+
*/
|
|
1045
|
+
declare const formatDate: (dateString: Date | string | number | null | undefined, type?: string, language?: string) => string;
|
|
1046
|
+
/** distanceKm -> formatté en km ou miles selon la langue (en => miles, sinon km) */
|
|
1047
|
+
declare const formatDistance: (distanceKm: number | string | null | undefined, language?: string) => string;
|
|
1048
|
+
/** minutes -> "0 min" / "1h05" (fr/es) ou "1:05" (en) */
|
|
1049
|
+
declare const formatDuration: (minutes: number | null | undefined, language?: string) => string;
|
|
1050
|
+
/** "Grand nom de fichier" -> "Grand nom d..." */
|
|
1051
|
+
declare const truncateText: (text: string | null | undefined, maxLength?: number) => string;
|
|
1052
|
+
/** "Grand_nom_de_fichier.pdf" -> "Grand_nom_....pdf" (préserve l'extension) */
|
|
1053
|
+
declare const truncateFileName: (fileName: string | null | undefined, maxLength?: number) => string;
|
|
1054
|
+
/** amount -> format monétaire français, 2 décimales, ex. 5190 -> "5 190,00 €" */
|
|
1055
|
+
declare const formatEuro: (amount?: number | null) => string;
|
|
1056
|
+
/** { firstname, lastname } -> "Jean Dupont" ; fallback si les deux sont vides/absents */
|
|
1057
|
+
declare const formatName: (person?: {
|
|
1058
|
+
firstname?: string | null;
|
|
1059
|
+
lastname?: string | null;
|
|
1060
|
+
} | null, fallback?: string) => string;
|
|
1061
|
+
|
|
1062
|
+
declare const getRelativeTime: (date: Date | string) => string;
|
|
1063
|
+
|
|
1064
|
+
declare const formatTime: (time: string | null | undefined) => string;
|
|
1065
|
+
|
|
1066
|
+
declare const easterDate: (year: number) => Date;
|
|
1067
|
+
|
|
1068
|
+
declare const isHoliday: (date: Date) => boolean;
|
|
1069
|
+
|
|
1070
|
+
declare const addBusinessDays: (originalDate: Date, numDaysToAdd: number) => Date;
|
|
1071
|
+
|
|
1072
|
+
declare const parseIsoDate: (value: string | null) => Date | null;
|
|
1073
|
+
|
|
1074
|
+
declare const isSameDay: (a: Date | string, b: Date | string) => boolean;
|
|
1075
|
+
|
|
1076
|
+
/**
|
|
1077
|
+
* Réexporte les utilitaires partagés `src/utils/date/` — une seule
|
|
1078
|
+
* implémentation pour `ui` et `ui-legacy`, pas de copie à maintenir.
|
|
1079
|
+
*
|
|
1080
|
+
* Exception : `formatDateWithTime` reste ici, self-contained — sa version
|
|
1081
|
+
* partagée dépend de `ui-legacy/data/globalMethods`, ce qui recréerait un
|
|
1082
|
+
* couplage `ui` → `ui-legacy` qu'on veut justement éviter (cf. `lib/format.ts`,
|
|
1083
|
+
* miroir volontaire de `globalMethods.ts` pour ce genre de cas).
|
|
1084
|
+
*/
|
|
1085
|
+
|
|
1086
|
+
/** Ex : ('1995-04-24', '18:40') → '24/04/1995 à 18h40' */
|
|
1087
|
+
declare const formatDateWithTime: (date: string, time: string | null) => string;
|
|
1088
|
+
|
|
1089
|
+
declare const formatAddress: (address: string | null | undefined) => string | null;
|
|
1090
|
+
|
|
1091
|
+
declare const formatLocality: (locality: string | null | undefined) => string | null;
|
|
1092
|
+
|
|
1093
|
+
declare const formatRegionCode: (postalCode: string | null | undefined) => string;
|
|
1094
|
+
|
|
1095
|
+
declare const formatCityFromFormattedAddress: (address: string | null | undefined) => string;
|
|
1096
|
+
|
|
1097
|
+
declare const formatPostalCodeFromFormattedAddress: (address: string | null | undefined) => string;
|
|
1098
|
+
|
|
1099
|
+
declare const isolateCity: (addr: string | null | undefined) => string;
|
|
1100
|
+
|
|
1101
|
+
declare const formatCityWithPostalCode: (city: string | null, postalCode: string | null) => string;
|
|
1102
|
+
|
|
1103
|
+
declare const formatPhoneNumber: (phone: string | null | undefined) => string | null;
|
|
1104
|
+
|
|
1105
|
+
declare const formatPlate: (plate: string | null | undefined) => string | null;
|
|
1106
|
+
|
|
1107
|
+
declare const formatPlateWithoutDashes: (plate: string | null | undefined) => string | null;
|
|
1108
|
+
|
|
1109
|
+
declare const capitalizeFirstLetter: (str: string | null | undefined) => string | null;
|
|
1110
|
+
|
|
1111
|
+
declare const generateHexColor: (firstName?: string, lastName?: string) => string;
|
|
1112
|
+
|
|
1113
|
+
interface AuthorLike {
|
|
1114
|
+
first_name?: string | null;
|
|
1115
|
+
firstname?: string | null;
|
|
1116
|
+
firstName?: string | null;
|
|
1117
|
+
last_name?: string | null;
|
|
1118
|
+
lastname?: string | null;
|
|
1119
|
+
lastName?: string | null;
|
|
1120
|
+
name?: string | null;
|
|
1121
|
+
display_name?: string | null;
|
|
1122
|
+
email?: string | null;
|
|
1123
|
+
}
|
|
1124
|
+
declare const getInitials: (author: AuthorLike | null | undefined) => string;
|
|
1125
|
+
|
|
1126
|
+
declare const getAvatarColor: (key: string) => string;
|
|
1127
|
+
|
|
1128
|
+
declare const formatNameWithInitial: (firstname: string | null, lastname: string | null) => string | null;
|
|
1129
|
+
|
|
1130
|
+
declare const getFileNameFromUrl: (url: string | null | undefined, fallback?: string) => string;
|
|
1131
|
+
|
|
1132
|
+
declare const getFileKind: (url: string | null | undefined) => "image" | "pdf" | "other";
|
|
1133
|
+
|
|
1134
|
+
declare const appendQueryParam: (url: string, key: string, value: string) => string;
|
|
1135
|
+
|
|
1136
|
+
declare const appendCacheBuster: (url: string) => string;
|
|
1137
|
+
|
|
1138
|
+
declare const getMimeCategory: (mimeType: string | null | undefined) => string;
|
|
1139
|
+
|
|
1140
|
+
declare const getCleanFileName: (fileName: string | null | undefined) => string;
|
|
1141
|
+
|
|
1142
|
+
declare const getFileIconByMimeType: (mimeType: string | null) => string;
|
|
1143
|
+
|
|
1144
|
+
declare const formatVin: (vin: string | null | undefined) => string;
|
|
1145
|
+
|
|
1146
|
+
declare const formatKM: (value: string | number | null | undefined) => string;
|
|
1147
|
+
|
|
1148
|
+
declare const parseAmount: (value: string) => number | null;
|
|
1149
|
+
|
|
1150
|
+
/**
|
|
1151
|
+
* Optimise une image :
|
|
1152
|
+
* - Convertit en webp (ou png/jpeg selon le support navigateur)
|
|
1153
|
+
* - Redimensionne pour ne pas dépasser maxDimension
|
|
1154
|
+
* - Compresse vers la taille cible (meilleur effort)
|
|
1155
|
+
*
|
|
1156
|
+
* Renvoie { file, error } — jamais de throw. Si error !== null, l'appelant
|
|
1157
|
+
* peut afficher un message à l'utilisateur. Si l'environnement ne supporte
|
|
1158
|
+
* pas les APIs nécessaires, passthrough silencieux.
|
|
1159
|
+
*/
|
|
1160
|
+
interface OptimizeImageResult {
|
|
1161
|
+
file: File | null | undefined;
|
|
1162
|
+
error: string | null;
|
|
1163
|
+
}
|
|
1164
|
+
interface OptimizeImageOptions {
|
|
1165
|
+
maxDimension?: number;
|
|
1166
|
+
targetSizeKB?: number;
|
|
1167
|
+
qualityStart?: number;
|
|
1168
|
+
qualityMin?: number;
|
|
1169
|
+
qualityStep?: number;
|
|
1170
|
+
/** Timeout en ms pour le chargement de l'image (défaut : 15 000) */
|
|
1171
|
+
imageLoadTimeoutMs?: number;
|
|
1172
|
+
/** Timeout en ms pour toBlob (défaut : 15 000) */
|
|
1173
|
+
toBlobTimeoutMs?: number;
|
|
1174
|
+
}
|
|
1175
|
+
declare const optimizeImage: (file: File | null | undefined, desiredBaseName: string, opts?: OptimizeImageOptions) => Promise<OptimizeImageResult>;
|
|
1176
|
+
|
|
1177
|
+
export { Attachment, type AttachmentProps, type AttachmentStatus, Avatar, AvatarBadge, type AvatarBadgeConfig, type AvatarBadgeProps, AvatarFallback, type AvatarFallbackProps, AvatarGroup, type AvatarGroupProps, AvatarImage, type AvatarImageProps, type AvatarProps, Badge, type BadgeProps, Banner, type BannerAction, type BannerProps, type BannerToggle, Box, type BoxProps, Bulk, type BulkProps, type BulkSection, Button, type ButtonColor, type ButtonProps, COLOR_TOKENS, Checkbox, type CheckboxProps, Collapsible, CollapsibleContent, CollapsibleTrigger, type ColorKey, ColorPicker, type ColorPickerProps, type ColorToken, DatePicker, type DatePickerMode, type DatePickerProps, type DatePreset, Divider, type DividerProps, Drawer, DrawerBody, DrawerClose, DrawerDescription, type DrawerDirection, DrawerFooter, DrawerHeader, type DrawerProps, DrawerTitle, EmailInput, type EmailInputProps, EmptyState, type EmptyStateProps, FileUploadZone, type FileUploadZoneProps, type FloatingAction, FloatingButton, type FloatingButtonProps, Gantt, type GanttBand, type GanttBar, type GanttDay, GanttDot, type GanttProps, type GanttRow, GanttSwatch, Icon, type IconColor, type IconFamily, type IconProps, type IconSize, type IconTabItem, IconTabs, type IconTabsProps, Image, type ImageProps, Input, InputGroup, InputGroupAddon, type InputGroupAddonProps, InputGroupButton, type InputGroupButtonProps, type InputGroupProps, type InputProps, Item, ItemActions, ItemContent, ItemDescription, ItemMedia, type ItemMediaProps, type ItemProps, ItemTitle, Label, type LabelProps, Layout, type LayoutProps, Link, type LinkProps, MetricCard, type MetricCardProps, Modal, ModalBody, ModalClose, ModalDescription, ModalFooter, ModalHeader, type ModalProps, ModalTitle, type MultiSelectProps, type OptimizeImageOptions, type OptimizeImageResult, PageContainer, type PageContainerProps, Pagination, type PaginationProps, PasswordInput, type PasswordInputProps, PdfPreview, type PdfPreviewProps, PhoneInput, type PhoneInputMeta, type PhoneInputProps, Popover, type PopoverMenuItem, type PopoverProps, ProgressBar, type ProgressBarProps, Radio, type RadioOption, type RadioProps, ScrollArea, type ScrollAreaProps, SearchInput, type SearchInputProps, Select, type SelectOption, type SelectProps, type SingleSelectProps, Skeleton, type SkeletonProps, Spinner, type SpinnerProps, type SpinnerSize, Stepper, type StepperProps, Switch, type SwitchProps, type TabItem, Table, TableCell, type TableCellProps, type TableEmptyState, TableFooter, TableFooterCell, type TableFooterCellProps, type TableFooterProps, TableFooterRow, type TableFooterRowProps, TableHeader, TableHeaderCell, type TableHeaderCellProps, type TableHeaderProps, TableHeaderRow, type TableHeaderRowProps, type TablePagination, type TableProps, TableRow, type TableRowProps, Tabs, type TabsProps, type TabsVariant, TagBubble, type TagBubbleProps, type TagOption, TagSelect, type TagSelectProps, Text, type TextProps, Textarea, type TextareaProps, Timeline, type TimelineItem, type TimelineProps, type ToastOptions, type ToastType, Toaster, Tooltip, type TooltipProps, addBusinessDays, appendCacheBuster, appendQueryParam, buttonVariants, capitalizeFirstLetter, colors, easterDate, formatAddress, formatCityFromFormattedAddress, formatCityWithPostalCode, formatDate, formatDateWithTime, formatDistance, formatDuration, formatEuro, formatKM, formatLocality, formatName, formatNameWithInitial, formatPhoneNumber, formatPlate, formatPlateWithoutDashes, formatPostalCodeFromFormattedAddress, formatRegionCode, formatTime, formatVin, generateHexColor, getAvatarColor, getCleanFileName, getFileIconByMimeType, getFileKind, getFileNameFromUrl, getInitials, getMimeCategory, getRelativeTime, isHoliday, isSameDay, isolateCity, optimizeImage, parseAmount, parseIsoDate, toast, truncateFileName, truncateText, useAvatarSize };
|