@emporix/cockpit-component-library 1.0.2 → 1.0.3
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.d.ts +1252 -0
- package/dist/index.es.js +2513 -0
- package/dist/index.umd.js +49 -0
- package/dist/quill-B5-e7UWH.js +7531 -0
- package/dist/style.css +7 -0
- package/dist/styles.d.ts +1 -0
- package/package.json +5 -4
- package/dist/assets/index-2pPRHV5R.css +0 -1
- package/dist/assets/index-Ds9O7aHV.js +0 -40
- package/dist/index.html +0 -14
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,1252 @@
|
|
|
1
|
+
import { default as default_2 } from 'react';
|
|
2
|
+
import { JSX as JSX_2 } from 'react/jsx-runtime';
|
|
3
|
+
import { MouseEventHandler } from 'react';
|
|
4
|
+
import { ReactNode } from 'react';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Contextual banner for surfacing validation errors, warnings,
|
|
8
|
+
* informational notes, or success confirmations.
|
|
9
|
+
*/
|
|
10
|
+
export declare const AlertBox: ({ variant, title, children, className, "data-testid": testId, ...props }: AlertBoxProps) => JSX_2.Element;
|
|
11
|
+
|
|
12
|
+
export declare interface AlertBoxProps extends Omit<default_2.HTMLAttributes<HTMLDivElement>, 'title'> {
|
|
13
|
+
/** Visual style of the alert. */
|
|
14
|
+
variant?: AlertBoxVariant;
|
|
15
|
+
/** Bold heading rendered next to the icon. */
|
|
16
|
+
title?: default_2.ReactNode;
|
|
17
|
+
/** Body content rendered below the title. */
|
|
18
|
+
children?: default_2.ReactNode;
|
|
19
|
+
/** Additional CSS class name. */
|
|
20
|
+
className?: string;
|
|
21
|
+
'data-testid'?: string;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export declare type AlertBoxVariant = 'error' | 'warning' | 'info' | 'success';
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* Horizontal breadcrumb with optional Back action, chevron separators, link segments, and a static current page.
|
|
28
|
+
*/
|
|
29
|
+
export declare const Breadcrumb: ({ items, onBack, backLabel, className, "data-testid": testId, }: BreadcrumbProps) => JSX_2.Element;
|
|
30
|
+
|
|
31
|
+
export declare interface BreadcrumbItem {
|
|
32
|
+
/**
|
|
33
|
+
* Visible label for this segment
|
|
34
|
+
*/
|
|
35
|
+
label: string;
|
|
36
|
+
/**
|
|
37
|
+
* When set on a non-final segment, renders as a link
|
|
38
|
+
*/
|
|
39
|
+
href?: string;
|
|
40
|
+
/**
|
|
41
|
+
* Optional click handler (e.g. SPA navigation). Can be used with or without `href`
|
|
42
|
+
*/
|
|
43
|
+
onClick?: MouseEventHandler<HTMLAnchorElement | HTMLButtonElement>;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
export declare interface BreadcrumbProps {
|
|
47
|
+
/**
|
|
48
|
+
* Ordered trail: every entry except the last is a parent; the last is the current page
|
|
49
|
+
*/
|
|
50
|
+
items: BreadcrumbItem[];
|
|
51
|
+
/**
|
|
52
|
+
* When set, shows a leading Back control
|
|
53
|
+
*/
|
|
54
|
+
onBack?: () => void;
|
|
55
|
+
/**
|
|
56
|
+
* Label for the back control (default: Back)
|
|
57
|
+
*/
|
|
58
|
+
backLabel?: string;
|
|
59
|
+
className?: string;
|
|
60
|
+
'data-testid'?: string;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
/**
|
|
64
|
+
* Card shell and layout primitives aligned with the Figma card pattern
|
|
65
|
+
* (bordered panel, header row with optional chip + actions, title, meta rows, footer).
|
|
66
|
+
*/
|
|
67
|
+
export declare const Card: CardComponent;
|
|
68
|
+
|
|
69
|
+
declare const CardBody: ({ children, className, ...props }: CardBodyProps) => JSX_2.Element;
|
|
70
|
+
|
|
71
|
+
export declare interface CardBodyProps extends default_2.HTMLAttributes<HTMLDivElement> {
|
|
72
|
+
children: default_2.ReactNode;
|
|
73
|
+
className?: string;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
/**
|
|
77
|
+
* Compound card root plus static subcomponents (`Card.Body`, `Card.Header`, …).
|
|
78
|
+
*/
|
|
79
|
+
export declare type CardComponent = default_2.FC<CardProps> & {
|
|
80
|
+
Body: typeof CardBody;
|
|
81
|
+
Header: typeof CardHeader;
|
|
82
|
+
Title: typeof CardTitle;
|
|
83
|
+
Meta: typeof CardMeta;
|
|
84
|
+
MetaRow: typeof CardMetaRow;
|
|
85
|
+
Footer: typeof CardFooter;
|
|
86
|
+
IconButton: typeof CardIconButton;
|
|
87
|
+
};
|
|
88
|
+
|
|
89
|
+
declare const CardFooter: ({ children, className, ...props }: CardFooterProps) => JSX_2.Element;
|
|
90
|
+
|
|
91
|
+
export declare interface CardFooterProps extends default_2.HTMLAttributes<HTMLDivElement> {
|
|
92
|
+
children: default_2.ReactNode;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
declare const CardHeader: ({ tag, actions, children, className, ...props }: CardHeaderProps) => JSX_2.Element;
|
|
96
|
+
|
|
97
|
+
export declare interface CardHeaderProps extends default_2.HTMLAttributes<HTMLDivElement> {
|
|
98
|
+
/**
|
|
99
|
+
* Left side (e.g. `<Chip variant="error">Blocker</Chip>`).
|
|
100
|
+
*/
|
|
101
|
+
tag?: default_2.ReactNode;
|
|
102
|
+
/**
|
|
103
|
+
* Right side (e.g. icon action buttons).
|
|
104
|
+
*/
|
|
105
|
+
actions?: default_2.ReactNode;
|
|
106
|
+
children?: default_2.ReactNode;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
declare const CardIconButton: default_2.ForwardRefExoticComponent<default_2.ButtonHTMLAttributes<HTMLButtonElement> & {
|
|
110
|
+
/**
|
|
111
|
+
* Use `danger` for destructive actions (e.g. delete); matches neutral `Card.IconButton` footprint and focus style.
|
|
112
|
+
*/
|
|
113
|
+
variant?: "default" | "danger";
|
|
114
|
+
} & default_2.RefAttributes<HTMLButtonElement>>;
|
|
115
|
+
|
|
116
|
+
export declare type CardIconButtonProps = default_2.ButtonHTMLAttributes<HTMLButtonElement> & {
|
|
117
|
+
/**
|
|
118
|
+
* Use `danger` for destructive actions (e.g. delete); matches neutral `Card.IconButton` footprint and focus style.
|
|
119
|
+
*/
|
|
120
|
+
variant?: 'default' | 'danger';
|
|
121
|
+
};
|
|
122
|
+
|
|
123
|
+
declare const CardMeta: ({ children, className, ...props }: CardMetaProps) => JSX_2.Element;
|
|
124
|
+
|
|
125
|
+
export declare interface CardMetaProps extends default_2.HTMLAttributes<HTMLDivElement> {
|
|
126
|
+
children: default_2.ReactNode;
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
declare const CardMetaRow: ({ icon, children, className, ...props }: CardMetaRowProps) => JSX_2.Element;
|
|
130
|
+
|
|
131
|
+
export declare interface CardMetaRowProps extends default_2.HTMLAttributes<HTMLDivElement> {
|
|
132
|
+
/**
|
|
133
|
+
* Leading icon; layout uses a 20×20px frame (SVGs are styled to ~18×18px in the default theme).
|
|
134
|
+
*/
|
|
135
|
+
icon: default_2.ReactNode;
|
|
136
|
+
children: default_2.ReactNode;
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
export declare interface CardProps extends default_2.HTMLAttributes<HTMLDivElement> {
|
|
140
|
+
/**
|
|
141
|
+
* Card content.
|
|
142
|
+
*/
|
|
143
|
+
children: default_2.ReactNode;
|
|
144
|
+
/**
|
|
145
|
+
* Additional CSS class name.
|
|
146
|
+
*/
|
|
147
|
+
className?: string;
|
|
148
|
+
/**
|
|
149
|
+
* Test ID for testing.
|
|
150
|
+
*/
|
|
151
|
+
'data-testid'?: string;
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
declare const CardTitle: ({ children, className, ...props }: CardTitleProps) => JSX_2.Element;
|
|
155
|
+
|
|
156
|
+
export declare interface CardTitleProps extends default_2.HTMLAttributes<HTMLHeadingElement> {
|
|
157
|
+
children: default_2.ReactNode;
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
/**
|
|
161
|
+
* Compact pill-shaped status label with semantic color variants.
|
|
162
|
+
* Use in `Card.Header` `tag` for issue-style headers (e.g. `variant="error"` for “Blocker”).
|
|
163
|
+
*/
|
|
164
|
+
export declare const Chip: ({ variant, children, className, "data-testid": testId, ...props }: ChipProps) => JSX_2.Element;
|
|
165
|
+
|
|
166
|
+
export declare interface ChipProps extends default_2.HTMLAttributes<HTMLSpanElement> {
|
|
167
|
+
/**
|
|
168
|
+
* Visual style: success (green), warning (orange), info (blue), error (burgundy on rose — matches Figma card header chips e.g. “Blocker”).
|
|
169
|
+
*/
|
|
170
|
+
variant?: ChipVariant;
|
|
171
|
+
/**
|
|
172
|
+
* Label or content inside the chip.
|
|
173
|
+
*/
|
|
174
|
+
children: default_2.ReactNode;
|
|
175
|
+
/**
|
|
176
|
+
* Additional CSS class name.
|
|
177
|
+
*/
|
|
178
|
+
className?: string;
|
|
179
|
+
/**
|
|
180
|
+
* Test ID for testing.
|
|
181
|
+
*/
|
|
182
|
+
'data-testid'?: string;
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
export declare type ChipVariant = 'error' | 'info' | 'success' | 'warning';
|
|
186
|
+
|
|
187
|
+
/**
|
|
188
|
+
* A focused confirmation dialog built on top of `Modal`.
|
|
189
|
+
* Use it wherever you need the user to explicitly confirm a destructive or
|
|
190
|
+
* irreversible action instead of relying on the browser's native `confirm()`.
|
|
191
|
+
*/
|
|
192
|
+
export declare const ConfirmDialog: ({ open, onClose, onConfirm, title, message, confirmLabel, cancelLabel, loading, variant, "data-testid": testId, }: ConfirmDialogProps) => JSX_2.Element;
|
|
193
|
+
|
|
194
|
+
export declare interface ConfirmDialogProps {
|
|
195
|
+
/** Whether the dialog is visible. */
|
|
196
|
+
open: boolean;
|
|
197
|
+
/** Called when the user cancels or closes. */
|
|
198
|
+
onClose: () => void;
|
|
199
|
+
/** Called when the user confirms. */
|
|
200
|
+
onConfirm: () => void;
|
|
201
|
+
/** Dialog heading. */
|
|
202
|
+
title: string;
|
|
203
|
+
/** Descriptive message body. */
|
|
204
|
+
message: string;
|
|
205
|
+
/** Label for the confirm button. Defaults to "Confirm". */
|
|
206
|
+
confirmLabel?: string;
|
|
207
|
+
/** Label for the cancel button. Defaults to "Cancel". */
|
|
208
|
+
cancelLabel?: string;
|
|
209
|
+
/** Shows a spinner on the confirm button and disables both buttons. */
|
|
210
|
+
loading?: boolean;
|
|
211
|
+
/**
|
|
212
|
+
* Visual variant for the confirm button.
|
|
213
|
+
* - `'default'` uses the primary brand color.
|
|
214
|
+
* - `'danger'` uses a destructive red color.
|
|
215
|
+
* @default 'default'
|
|
216
|
+
*/
|
|
217
|
+
variant?: ConfirmDialogVariant;
|
|
218
|
+
'data-testid'?: string;
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
export declare type ConfirmDialogVariant = 'default' | 'danger';
|
|
222
|
+
|
|
223
|
+
export declare const ContrastButton: ({ label, disabled, icon, iconPos, className, ...rest }: ContrastButtonProps) => JSX_2.Element;
|
|
224
|
+
|
|
225
|
+
/**
|
|
226
|
+
* Native `<button>` props plus label/icon layout. Either a visible `label` or `aria-label` is required
|
|
227
|
+
* so the control always has an accessible name (icon-only buttons need `aria-label`).
|
|
228
|
+
*/
|
|
229
|
+
export declare type ContrastButtonProps = ContrastButtonShared & ({
|
|
230
|
+
label: string;
|
|
231
|
+
} | {
|
|
232
|
+
'aria-label': string;
|
|
233
|
+
});
|
|
234
|
+
|
|
235
|
+
declare type ContrastButtonShared = Omit<default_2.ButtonHTMLAttributes<HTMLButtonElement>, 'type' | 'children'> & {
|
|
236
|
+
/**
|
|
237
|
+
* Text label displayed inside the button. When omitted (icon-only), you must pass `aria-label`.
|
|
238
|
+
*/
|
|
239
|
+
label?: string;
|
|
240
|
+
/** Optional icon */
|
|
241
|
+
icon?: default_2.ReactNode;
|
|
242
|
+
/** Icon position relative to the label */
|
|
243
|
+
iconPos?: 'left' | 'right';
|
|
244
|
+
};
|
|
245
|
+
|
|
246
|
+
export declare const Dropdown: <T extends Record<string, unknown>>({ value, onChange, onEditEnd, options, optionLabel, optionValue, optionDisabled, placeholder, filter, filterPlaceholder, onFilter, loading, hasMore, onLoadMore, panelPosition, editable, disabled, required, label, inputId, className, panelClassName, valueTemplate, itemTemplate, "data-testid": testId, }: DropdownProps<T>) => JSX_2.Element;
|
|
247
|
+
|
|
248
|
+
export declare interface DropdownChangeEvent {
|
|
249
|
+
value: DropdownOption['value'] | null;
|
|
250
|
+
originalEvent: default_2.SyntheticEvent;
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
export declare interface DropdownEditEndEvent {
|
|
254
|
+
/** Trimmed value that was in the input when Enter was pressed */
|
|
255
|
+
value: string;
|
|
256
|
+
/** Selected option value if a matching option was found and selected; null otherwise */
|
|
257
|
+
selectedValue: DropdownOption['value'] | null;
|
|
258
|
+
originalEvent: default_2.KeyboardEvent;
|
|
259
|
+
}
|
|
260
|
+
|
|
261
|
+
export declare interface DropdownOption {
|
|
262
|
+
label?: string;
|
|
263
|
+
value?: string;
|
|
264
|
+
[key: string]: unknown;
|
|
265
|
+
}
|
|
266
|
+
|
|
267
|
+
export declare interface DropdownProps<T = DropdownOption> {
|
|
268
|
+
/**
|
|
269
|
+
* Selected value (controlled). Must match optionValue of the selected option.
|
|
270
|
+
*/
|
|
271
|
+
value?: unknown;
|
|
272
|
+
/**
|
|
273
|
+
* Callback when selection changes
|
|
274
|
+
*/
|
|
275
|
+
onChange?: (e: DropdownChangeEvent) => void;
|
|
276
|
+
/**
|
|
277
|
+
* Array of options
|
|
278
|
+
*/
|
|
279
|
+
options: T[];
|
|
280
|
+
/**
|
|
281
|
+
* Property name for the option label (default: "label")
|
|
282
|
+
*/
|
|
283
|
+
optionLabel?: keyof T | string;
|
|
284
|
+
/**
|
|
285
|
+
* Property name for the option value (default: "value")
|
|
286
|
+
*/
|
|
287
|
+
optionValue?: keyof T | string;
|
|
288
|
+
/**
|
|
289
|
+
* Name of the property in the option object that indicates whether the option is disabled.
|
|
290
|
+
* When set (e.g. optionDisabled="disabled"), options with a truthy value for that key
|
|
291
|
+
* are disabled and cannot be selected. Matches PrimeReact Dropdown optionDisabled API.
|
|
292
|
+
* @see https://primereact.org/dropdown/#api.Dropdown.props.optionDisabled
|
|
293
|
+
*/
|
|
294
|
+
optionDisabled?: keyof T | string;
|
|
295
|
+
/**
|
|
296
|
+
* Placeholder when no value selected
|
|
297
|
+
*/
|
|
298
|
+
placeholder?: string;
|
|
299
|
+
/**
|
|
300
|
+
* Enable filter (search) in the overlay
|
|
301
|
+
*/
|
|
302
|
+
filter?: boolean;
|
|
303
|
+
/**
|
|
304
|
+
* Placeholder text for the filter input (default: "Search...")
|
|
305
|
+
*/
|
|
306
|
+
filterPlaceholder?: string;
|
|
307
|
+
/**
|
|
308
|
+
* External filter callback for server-side / lazy search.
|
|
309
|
+
* When provided, in-memory filtering is disabled and this callback is invoked
|
|
310
|
+
* with the current filter query on each keystroke. The parent is responsible
|
|
311
|
+
* for updating `options` with the results.
|
|
312
|
+
*/
|
|
313
|
+
onFilter?: (query: string) => void;
|
|
314
|
+
/**
|
|
315
|
+
* Whether the dropdown is currently loading options (e.g. from an API).
|
|
316
|
+
* Shows a spinner / "Loading…" indicator at the bottom of the list.
|
|
317
|
+
*/
|
|
318
|
+
loading?: boolean;
|
|
319
|
+
/**
|
|
320
|
+
* Whether more options can be loaded via pagination.
|
|
321
|
+
* When true, scrolling to the bottom of the options list triggers `onLoadMore`.
|
|
322
|
+
*/
|
|
323
|
+
hasMore?: boolean;
|
|
324
|
+
/**
|
|
325
|
+
* Called when the user scrolls near the bottom of the options list and `hasMore` is true.
|
|
326
|
+
* Use this to load the next page of results.
|
|
327
|
+
*/
|
|
328
|
+
onLoadMore?: () => void;
|
|
329
|
+
/**
|
|
330
|
+
* Controls where the options panel appears relative to the trigger.
|
|
331
|
+
* - `'auto'` (default): opens below if there is enough viewport space, otherwise above.
|
|
332
|
+
* - `'bottom'`: always opens below the trigger.
|
|
333
|
+
* - `'top'`: always opens above the trigger.
|
|
334
|
+
*/
|
|
335
|
+
panelPosition?: 'auto' | 'top' | 'bottom';
|
|
336
|
+
/**
|
|
337
|
+
* When true, the trigger is an editable input: user can type to filter options
|
|
338
|
+
* and select from the list. Matches PrimeReact Dropdown editable behavior.
|
|
339
|
+
* @see https://primereact.org/dropdown/#editable
|
|
340
|
+
*/
|
|
341
|
+
editable?: boolean;
|
|
342
|
+
/**
|
|
343
|
+
* Called when the user ends editing by pressing Enter in the editable input.
|
|
344
|
+
* Fires with the trimmed input value and the selected option value (if a match was found).
|
|
345
|
+
*/
|
|
346
|
+
onEditEnd?: (e: DropdownEditEndEvent) => void;
|
|
347
|
+
/**
|
|
348
|
+
* Whether the dropdown is disabled
|
|
349
|
+
*/
|
|
350
|
+
disabled?: boolean;
|
|
351
|
+
/**
|
|
352
|
+
* Whether the field is required (shows asterisk on label)
|
|
353
|
+
*/
|
|
354
|
+
required?: boolean;
|
|
355
|
+
/**
|
|
356
|
+
* Label text displayed above the input
|
|
357
|
+
*/
|
|
358
|
+
label?: default_2.ReactNode;
|
|
359
|
+
/**
|
|
360
|
+
* Input element id for label association
|
|
361
|
+
*/
|
|
362
|
+
inputId?: string;
|
|
363
|
+
/**
|
|
364
|
+
* Additional CSS class name for the root
|
|
365
|
+
*/
|
|
366
|
+
className?: string;
|
|
367
|
+
/**
|
|
368
|
+
* Additional CSS class name for the overlay panel
|
|
369
|
+
*/
|
|
370
|
+
panelClassName?: string;
|
|
371
|
+
/**
|
|
372
|
+
* Template for the selected value displayed in the trigger.
|
|
373
|
+
* Receives the selected option object or null when no value is selected.
|
|
374
|
+
* @see https://primereact.org/dropdown/#template
|
|
375
|
+
*/
|
|
376
|
+
valueTemplate?: (option: T | null) => default_2.ReactNode;
|
|
377
|
+
/**
|
|
378
|
+
* Template for each option in the dropdown list.
|
|
379
|
+
* Receives the option object.
|
|
380
|
+
* @see https://primereact.org/dropdown/#template
|
|
381
|
+
*/
|
|
382
|
+
itemTemplate?: (option: T) => default_2.ReactNode;
|
|
383
|
+
/**
|
|
384
|
+
* Test ID for testing
|
|
385
|
+
*/
|
|
386
|
+
'data-testid'?: string;
|
|
387
|
+
}
|
|
388
|
+
|
|
389
|
+
declare const EmporixLogo: () => JSX_2.Element;
|
|
390
|
+
|
|
391
|
+
/**
|
|
392
|
+
* Built-in file kinds for {@link FileUploadDropzone}. Extend the registry here when adding new presets.
|
|
393
|
+
*/
|
|
394
|
+
declare const FILE_UPLOAD_TYPE_REGISTRY: {
|
|
395
|
+
readonly pdf: {
|
|
396
|
+
readonly extensions: readonly [".pdf"];
|
|
397
|
+
readonly mimeTypes: readonly ["application/pdf"];
|
|
398
|
+
};
|
|
399
|
+
readonly doc: {
|
|
400
|
+
readonly extensions: readonly [".doc"];
|
|
401
|
+
readonly mimeTypes: readonly ["application/msword"];
|
|
402
|
+
};
|
|
403
|
+
readonly docx: {
|
|
404
|
+
readonly extensions: readonly [".docx"];
|
|
405
|
+
readonly mimeTypes: readonly ["application/vnd.openxmlformats-officedocument.wordprocessingml.document"];
|
|
406
|
+
};
|
|
407
|
+
readonly xls: {
|
|
408
|
+
readonly extensions: readonly [".xls"];
|
|
409
|
+
readonly mimeTypes: readonly ["application/vnd.ms-excel"];
|
|
410
|
+
};
|
|
411
|
+
readonly xlsx: {
|
|
412
|
+
readonly extensions: readonly [".xlsx"];
|
|
413
|
+
readonly mimeTypes: readonly ["application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"];
|
|
414
|
+
};
|
|
415
|
+
readonly png: {
|
|
416
|
+
readonly extensions: readonly [".png"];
|
|
417
|
+
readonly mimeTypes: readonly ["image/png"];
|
|
418
|
+
};
|
|
419
|
+
readonly jpeg: {
|
|
420
|
+
readonly extensions: readonly [".jpg", ".jpeg"];
|
|
421
|
+
readonly mimeTypes: readonly ["image/jpeg"];
|
|
422
|
+
};
|
|
423
|
+
};
|
|
424
|
+
|
|
425
|
+
/**
|
|
426
|
+
* Drag-and-drop file picker inside a {@link Card}, using library tokens and {@link SecondaryButton}.
|
|
427
|
+
*/
|
|
428
|
+
export declare const FileUploadDropzone: ({ supportedTypes, onFileSelect, onRejectFile, maxSizeBytes, uploading, dropHint, formatsHint, browseLabel, uploadingLabel, className, "data-testid": testId, }: FileUploadDropzoneProps) => JSX_2.Element;
|
|
429
|
+
|
|
430
|
+
export declare interface FileUploadDropzoneProps {
|
|
431
|
+
/**
|
|
432
|
+
* Which built-in file kinds are allowed (drives `accept`, MIME/extension checks).
|
|
433
|
+
* Must include at least one type. Empty arrays fall back to `["pdf"]` at runtime with a dev warning.
|
|
434
|
+
*/
|
|
435
|
+
supportedTypes: NonEmptyFileUploadTypeIds;
|
|
436
|
+
/**
|
|
437
|
+
* Called only after the file passes type and optional size checks.
|
|
438
|
+
*/
|
|
439
|
+
onFileSelect: (file: File) => void;
|
|
440
|
+
/**
|
|
441
|
+
* Invoked when a picked/dropped file fails validation (wrong type or over size limit).
|
|
442
|
+
*/
|
|
443
|
+
onRejectFile?: (file: File, reason: 'type' | 'size') => void;
|
|
444
|
+
/** When set, files larger than this (bytes) are rejected with reason `'size'`. */
|
|
445
|
+
maxSizeBytes?: number;
|
|
446
|
+
/** Disables interaction and shows uploading label on the browse control. */
|
|
447
|
+
uploading?: boolean;
|
|
448
|
+
dropHint: string;
|
|
449
|
+
formatsHint: string;
|
|
450
|
+
browseLabel: string;
|
|
451
|
+
uploadingLabel: string;
|
|
452
|
+
className?: string;
|
|
453
|
+
'data-testid'?: string;
|
|
454
|
+
}
|
|
455
|
+
|
|
456
|
+
export declare type FileUploadTypeId = keyof typeof FILE_UPLOAD_TYPE_REGISTRY;
|
|
457
|
+
|
|
458
|
+
/**
|
|
459
|
+
* Card with a prominent icon panel on the left and a flexible content area
|
|
460
|
+
* on the right. Compose freely: put any layout (Card.Header, Card.Body, etc.)
|
|
461
|
+
* inside `IconCard.Content`.
|
|
462
|
+
*
|
|
463
|
+
* ```tsx
|
|
464
|
+
* <IconCard>
|
|
465
|
+
* <IconCard.Icon><MyIcon /></IconCard.Icon>
|
|
466
|
+
* <IconCard.Content>
|
|
467
|
+
* <Card.Header actions={…}><Card.Title>Title</Card.Title></Card.Header>
|
|
468
|
+
* <Card.Body>…</Card.Body>
|
|
469
|
+
* </IconCard.Content>
|
|
470
|
+
* </IconCard>
|
|
471
|
+
* ```
|
|
472
|
+
*/
|
|
473
|
+
export declare const IconCard: IconCardComponent;
|
|
474
|
+
|
|
475
|
+
/**
|
|
476
|
+
* Compound root plus static subcomponents (`IconCard.Icon`, `IconCard.Content`).
|
|
477
|
+
*/
|
|
478
|
+
export declare type IconCardComponent = default_2.FC<IconCardProps> & {
|
|
479
|
+
Icon: typeof IconCardIcon;
|
|
480
|
+
Content: typeof IconCardContent;
|
|
481
|
+
};
|
|
482
|
+
|
|
483
|
+
declare const IconCardContent: ({ children, className, ...props }: IconCardContentProps) => JSX_2.Element;
|
|
484
|
+
|
|
485
|
+
export declare interface IconCardContentProps extends default_2.HTMLAttributes<HTMLDivElement> {
|
|
486
|
+
children: default_2.ReactNode;
|
|
487
|
+
className?: string;
|
|
488
|
+
}
|
|
489
|
+
|
|
490
|
+
declare const IconCardIcon: ({ children, className, ...props }: IconCardIconProps) => JSX_2.Element;
|
|
491
|
+
|
|
492
|
+
export declare interface IconCardIconProps extends default_2.HTMLAttributes<HTMLDivElement> {
|
|
493
|
+
children: default_2.ReactNode;
|
|
494
|
+
className?: string;
|
|
495
|
+
}
|
|
496
|
+
|
|
497
|
+
export declare interface IconCardProps extends default_2.HTMLAttributes<HTMLDivElement> {
|
|
498
|
+
children: default_2.ReactNode;
|
|
499
|
+
className?: string;
|
|
500
|
+
'data-testid'?: string;
|
|
501
|
+
}
|
|
502
|
+
|
|
503
|
+
export declare const InputText: ({ label, tooltip, required, inputId: inputIdProp, textarea, rows: rowsProp, className, "data-testid": testId, disabled, ...rest }: InputTextProps) => JSX_2.Element;
|
|
504
|
+
|
|
505
|
+
export declare interface InputTextProps extends Omit<default_2.InputHTMLAttributes<HTMLInputElement>, 'size' | 'className'> {
|
|
506
|
+
/**
|
|
507
|
+
* Label text displayed above the input
|
|
508
|
+
*/
|
|
509
|
+
label?: default_2.ReactNode;
|
|
510
|
+
/**
|
|
511
|
+
* When set, an info icon is shown next to the label with this string as tooltip
|
|
512
|
+
*/
|
|
513
|
+
tooltip?: string;
|
|
514
|
+
/**
|
|
515
|
+
* Whether the field is required (shows asterisk on label)
|
|
516
|
+
*/
|
|
517
|
+
required?: boolean;
|
|
518
|
+
/**
|
|
519
|
+
* Input element id for label association
|
|
520
|
+
*/
|
|
521
|
+
inputId?: string;
|
|
522
|
+
/**
|
|
523
|
+
* When true, renders a <textarea> instead of <input>
|
|
524
|
+
*/
|
|
525
|
+
textarea?: boolean;
|
|
526
|
+
/**
|
|
527
|
+
* Number of visible rows (textarea only). Defaults to 3 when textarea is true.
|
|
528
|
+
*/
|
|
529
|
+
rows?: number;
|
|
530
|
+
/**
|
|
531
|
+
* Additional CSS class name for the root
|
|
532
|
+
*/
|
|
533
|
+
className?: string;
|
|
534
|
+
/**
|
|
535
|
+
* Test ID for testing
|
|
536
|
+
*/
|
|
537
|
+
'data-testid'?: string;
|
|
538
|
+
}
|
|
539
|
+
|
|
540
|
+
/**
|
|
541
|
+
* Generic modal dialog with overlay, header (title + close), scrollable body
|
|
542
|
+
* and an optional sticky footer.
|
|
543
|
+
*/
|
|
544
|
+
export declare const Modal: ({ open, onClose, title, subtitle, children, footer, maxWidth, disableClose, className, titleId, "data-testid": testId, }: ModalProps) => JSX_2.Element | null;
|
|
545
|
+
|
|
546
|
+
export declare interface ModalProps {
|
|
547
|
+
/** Whether the modal is visible. */
|
|
548
|
+
open: boolean;
|
|
549
|
+
/** Called when the user requests to close (overlay click, Escape, close button). */
|
|
550
|
+
onClose: () => void;
|
|
551
|
+
/** Primary heading rendered in the header. */
|
|
552
|
+
title: string;
|
|
553
|
+
/** Optional secondary line below the title. */
|
|
554
|
+
subtitle?: string;
|
|
555
|
+
/** Body content. */
|
|
556
|
+
children: ReactNode;
|
|
557
|
+
/** Content rendered in the sticky footer area. */
|
|
558
|
+
footer?: ReactNode;
|
|
559
|
+
/**
|
|
560
|
+
* CSS max-width for the dialog panel.
|
|
561
|
+
* @default '520px'
|
|
562
|
+
*/
|
|
563
|
+
maxWidth?: string;
|
|
564
|
+
/**
|
|
565
|
+
* When true, overlay click, Escape and the close button are disabled.
|
|
566
|
+
* @default false
|
|
567
|
+
*/
|
|
568
|
+
disableClose?: boolean;
|
|
569
|
+
/** Additional CSS class applied to the root overlay element. */
|
|
570
|
+
className?: string;
|
|
571
|
+
/** Accessible id for the title (used by `aria-labelledby`). */
|
|
572
|
+
titleId?: string;
|
|
573
|
+
'data-testid'?: string;
|
|
574
|
+
}
|
|
575
|
+
|
|
576
|
+
export declare const MultiSelect: <T extends Record<string, unknown>>({ value, onChange, options, optionLabel, optionValue, placeholder, disabled, label, className, "data-testid": testId, }: MultiSelectProps<T>) => JSX_2.Element;
|
|
577
|
+
|
|
578
|
+
export declare interface MultiSelectOption {
|
|
579
|
+
label?: string;
|
|
580
|
+
value?: string;
|
|
581
|
+
[key: string]: unknown;
|
|
582
|
+
}
|
|
583
|
+
|
|
584
|
+
export declare interface MultiSelectProps<T = MultiSelectOption> {
|
|
585
|
+
value: string[];
|
|
586
|
+
onChange: (value: string[]) => void;
|
|
587
|
+
options: T[];
|
|
588
|
+
optionLabel?: keyof T | string;
|
|
589
|
+
optionValue?: keyof T | string;
|
|
590
|
+
placeholder?: string;
|
|
591
|
+
disabled?: boolean;
|
|
592
|
+
label?: React.ReactNode;
|
|
593
|
+
className?: string;
|
|
594
|
+
'data-testid'?: string;
|
|
595
|
+
}
|
|
596
|
+
|
|
597
|
+
/** At least one type id — prevents empty `supportedTypes` at compile time. */
|
|
598
|
+
export declare type NonEmptyFileUploadTypeIds = readonly [
|
|
599
|
+
FileUploadTypeId,
|
|
600
|
+
...FileUploadTypeId[]
|
|
601
|
+
];
|
|
602
|
+
|
|
603
|
+
export declare type OrderStatus = 'IN_CHECKOUT' | 'CREATED' | 'CONFIRMED' | 'DECLINED' | 'SHIPPED' | 'COMPLETED';
|
|
604
|
+
|
|
605
|
+
export declare type OrderStatusLike = OrderStatus | (string & {});
|
|
606
|
+
|
|
607
|
+
/**
|
|
608
|
+
* Status tag in the same visual pattern as design chips: light fill, subtle border,
|
|
609
|
+
* saturated label text. Colors vary by status (CREATED = blue, COMPLETED = green, etc.).
|
|
610
|
+
*/
|
|
611
|
+
export declare const OrderStatusTag: ({ status, className, "data-testid": testId, }: OrderStatusTagProps) => JSX_2.Element;
|
|
612
|
+
|
|
613
|
+
export declare interface OrderStatusTagProps {
|
|
614
|
+
status: OrderStatusLike;
|
|
615
|
+
className?: string;
|
|
616
|
+
'data-testid'?: string;
|
|
617
|
+
}
|
|
618
|
+
|
|
619
|
+
/**
|
|
620
|
+
* Order list table: order # (navigable), status badge, customer, dates, address, payment, value.
|
|
621
|
+
* No row actions column — open details via `getOrderHref` or `onOrderNavigate` on the id.
|
|
622
|
+
*/
|
|
623
|
+
export declare const OrderTable: ({ items, title, getOrderHref, onOrderNavigate, emptyMessage, embedded, className, "data-testid": testId, }: OrderTableProps) => JSX_2.Element;
|
|
624
|
+
|
|
625
|
+
export declare interface OrderTableProps {
|
|
626
|
+
items: OrderTableRow[];
|
|
627
|
+
/**
|
|
628
|
+
* Optional section title above the table.
|
|
629
|
+
*/
|
|
630
|
+
title?: string;
|
|
631
|
+
/**
|
|
632
|
+
* When set, the order id is a link (e.g. React Router `href` or absolute URL).
|
|
633
|
+
*/
|
|
634
|
+
getOrderHref?: (row: OrderTableRow) => string;
|
|
635
|
+
/**
|
|
636
|
+
* When set (and `getOrderHref` is not), the order id is a button that calls this handler
|
|
637
|
+
* (e.g. `navigate(\`/orders/${row.id}\`)`).
|
|
638
|
+
*/
|
|
639
|
+
onOrderNavigate?: (row: OrderTableRow) => void;
|
|
640
|
+
/**
|
|
641
|
+
* Message when `items` is empty. Defaults to `"No orders."`.
|
|
642
|
+
*/
|
|
643
|
+
emptyMessage?: string;
|
|
644
|
+
/**
|
|
645
|
+
* When true, no outer border on the wrapper (for use inside a card).
|
|
646
|
+
*/
|
|
647
|
+
embedded?: boolean;
|
|
648
|
+
className?: string;
|
|
649
|
+
'data-testid'?: string;
|
|
650
|
+
}
|
|
651
|
+
|
|
652
|
+
export declare interface OrderTableRow {
|
|
653
|
+
/**
|
|
654
|
+
* Order identifier shown as `#${id}` in the first column.
|
|
655
|
+
*/
|
|
656
|
+
id: string;
|
|
657
|
+
status: OrderStatusLike;
|
|
658
|
+
customerName: string;
|
|
659
|
+
/**
|
|
660
|
+
* Shown as order date (`DD.MM.YYYY` in `de-DE`). `Date`, full ISO datetimes, or date-only
|
|
661
|
+
* `YYYY-MM-DD` (interpreted as a local calendar day, not UTC midnight).
|
|
662
|
+
*/
|
|
663
|
+
orderDate: Date | string;
|
|
664
|
+
/**
|
|
665
|
+
* When omitted or `null`, the cell shows "—". Same date rules as `orderDate`.
|
|
666
|
+
*/
|
|
667
|
+
deliveryDate?: Date | string | null;
|
|
668
|
+
/**
|
|
669
|
+
* e.g. `Berlin, DE`
|
|
670
|
+
*/
|
|
671
|
+
deliveryAddress: string;
|
|
672
|
+
payment: string;
|
|
673
|
+
orderValue: {
|
|
674
|
+
amount: number;
|
|
675
|
+
currency: string;
|
|
676
|
+
};
|
|
677
|
+
}
|
|
678
|
+
|
|
679
|
+
export declare const PrimaryButton: ({ label, disabled, loading, icon, iconPos, onClick, className, "data-testid": testId, ...props }: PrimaryButtonProps) => JSX_2.Element;
|
|
680
|
+
|
|
681
|
+
export declare interface PrimaryButtonProps {
|
|
682
|
+
/**
|
|
683
|
+
* Text label displayed inside the button
|
|
684
|
+
*/
|
|
685
|
+
label?: string;
|
|
686
|
+
/**
|
|
687
|
+
* Whether the button is disabled
|
|
688
|
+
*/
|
|
689
|
+
disabled?: boolean;
|
|
690
|
+
/**
|
|
691
|
+
* Whether the button is loading
|
|
692
|
+
*/
|
|
693
|
+
loading?: boolean;
|
|
694
|
+
/**
|
|
695
|
+
* Optional icon
|
|
696
|
+
*/
|
|
697
|
+
icon?: default_2.ReactNode;
|
|
698
|
+
/**
|
|
699
|
+
* Icon position relative to the label
|
|
700
|
+
*/
|
|
701
|
+
iconPos?: 'left' | 'right';
|
|
702
|
+
/**
|
|
703
|
+
* Click handler
|
|
704
|
+
*/
|
|
705
|
+
onClick?: () => void;
|
|
706
|
+
/**
|
|
707
|
+
* Additional CSS class name
|
|
708
|
+
*/
|
|
709
|
+
className?: string;
|
|
710
|
+
/**
|
|
711
|
+
* Test ID for testing
|
|
712
|
+
*/
|
|
713
|
+
'data-testid'?: string;
|
|
714
|
+
}
|
|
715
|
+
|
|
716
|
+
/**
|
|
717
|
+
* Bordered product table with built-in Name column (thumbnail + name + code),
|
|
718
|
+
* configurable data columns, and optional Add / Delete actions.
|
|
719
|
+
*
|
|
720
|
+
* Follows the compact table pattern from the order-processing design.
|
|
721
|
+
*/
|
|
722
|
+
export declare const ProductTable: <T extends ProductTableItem = ProductTableItem>({ items, columns, onDelete, onRowAdd, rowAddLabel, disableRowActions, isRowAddDisabled, onAdd, addLabel, addInActionsColumnHeader, title, emptyMessage, busyItemIds, invalidItemIds, nameColumnHeader, actionsColumnHeader, renderProductMeta, embedded, className, "data-testid": testId, }: ProductTableProps<T>) => JSX_2.Element;
|
|
723
|
+
|
|
724
|
+
export declare interface ProductTableColumn<T extends ProductTableItem> {
|
|
725
|
+
/**
|
|
726
|
+
* Unique key used as the React key for the column.
|
|
727
|
+
*/
|
|
728
|
+
key: string;
|
|
729
|
+
/**
|
|
730
|
+
* Header label rendered in the `<thead>`.
|
|
731
|
+
*/
|
|
732
|
+
header: string;
|
|
733
|
+
/**
|
|
734
|
+
* Horizontal text alignment for both header and cell.
|
|
735
|
+
*/
|
|
736
|
+
align?: 'left' | 'center' | 'right';
|
|
737
|
+
/**
|
|
738
|
+
* Cell renderer. Receives the item and its index.
|
|
739
|
+
*/
|
|
740
|
+
render: (item: T, index: number) => default_2.ReactNode;
|
|
741
|
+
/**
|
|
742
|
+
* When true the cell text is rendered with the highlight style
|
|
743
|
+
* (bold, italic, accent colour — used for the "Total" column).
|
|
744
|
+
*/
|
|
745
|
+
highlight?: boolean;
|
|
746
|
+
}
|
|
747
|
+
|
|
748
|
+
/**
|
|
749
|
+
* Icon-only “+” control matching the per-row add button in {@link ProductTable}.
|
|
750
|
+
*/
|
|
751
|
+
export declare const ProductTableIconAddButton: default_2.ForwardRefExoticComponent<Omit<default_2.ButtonHTMLAttributes<HTMLButtonElement>, "children" | "type"> & {
|
|
752
|
+
/**
|
|
753
|
+
* Required: visible text is not shown; use a clear action label.
|
|
754
|
+
*/
|
|
755
|
+
'aria-label': string;
|
|
756
|
+
} & default_2.RefAttributes<HTMLButtonElement>>;
|
|
757
|
+
|
|
758
|
+
export declare type ProductTableIconAddButtonProps = Omit<default_2.ButtonHTMLAttributes<HTMLButtonElement>, 'children' | 'type'> & {
|
|
759
|
+
/**
|
|
760
|
+
* Required: visible text is not shown; use a clear action label.
|
|
761
|
+
*/
|
|
762
|
+
'aria-label': string;
|
|
763
|
+
};
|
|
764
|
+
|
|
765
|
+
export declare interface ProductTableItem {
|
|
766
|
+
/**
|
|
767
|
+
* Unique identifier for the row.
|
|
768
|
+
*/
|
|
769
|
+
id: string;
|
|
770
|
+
/**
|
|
771
|
+
* Product display name.
|
|
772
|
+
*/
|
|
773
|
+
name: string;
|
|
774
|
+
/**
|
|
775
|
+
* Product code / SKU shown below the name.
|
|
776
|
+
*/
|
|
777
|
+
code?: string;
|
|
778
|
+
/**
|
|
779
|
+
* Thumbnail URL. Falls back to a placeholder when omitted.
|
|
780
|
+
*/
|
|
781
|
+
imageUrl?: string;
|
|
782
|
+
}
|
|
783
|
+
|
|
784
|
+
export declare interface ProductTableProps<T extends ProductTableItem = ProductTableItem> {
|
|
785
|
+
/**
|
|
786
|
+
* Rows to display. Each must satisfy `ProductTableItem` at minimum.
|
|
787
|
+
*/
|
|
788
|
+
items: T[];
|
|
789
|
+
/**
|
|
790
|
+
* Extra columns rendered between the built-in Name column and the
|
|
791
|
+
* Actions column. Define quantity, prices, tax, etc. here.
|
|
792
|
+
*/
|
|
793
|
+
columns: ProductTableColumn<T>[];
|
|
794
|
+
/**
|
|
795
|
+
* When provided the Actions column appears with a delete button per row.
|
|
796
|
+
*/
|
|
797
|
+
onDelete?: (item: T) => void;
|
|
798
|
+
/**
|
|
799
|
+
* When provided the Actions column shows an icon-only add button per row
|
|
800
|
+
* (same footprint as delete; e.g. suggested alternatives). Can be combined with `onDelete`.
|
|
801
|
+
*/
|
|
802
|
+
onRowAdd?: (item: T) => void;
|
|
803
|
+
/**
|
|
804
|
+
* Accessible name for the per-row Add icon button (not shown as visible text).
|
|
805
|
+
* Defaults to `"Add"`. Pass a function for per-row labels (e.g. loading state).
|
|
806
|
+
*/
|
|
807
|
+
rowAddLabel?: string | ((item: T, index: number) => string);
|
|
808
|
+
/**
|
|
809
|
+
* When true, row action buttons (delete / add) are disabled without dimming rows.
|
|
810
|
+
*/
|
|
811
|
+
disableRowActions?: boolean;
|
|
812
|
+
/**
|
|
813
|
+
* Per-row: disable only the Add button (e.g. until price match is ready).
|
|
814
|
+
*/
|
|
815
|
+
isRowAddDisabled?: (item: T) => boolean;
|
|
816
|
+
/**
|
|
817
|
+
* When provided an "Add" button is rendered in the table header area.
|
|
818
|
+
*/
|
|
819
|
+
onAdd?: () => void;
|
|
820
|
+
/**
|
|
821
|
+
* Label for the add button (toolbar) or accessible name when using
|
|
822
|
+
* {@link addInActionsColumnHeader}. Defaults to `"Add Item"`.
|
|
823
|
+
*/
|
|
824
|
+
addLabel?: string;
|
|
825
|
+
/**
|
|
826
|
+
* When true with `onAdd` and an actions column (`onRowAdd` / `onDelete`),
|
|
827
|
+
* renders an icon-only + in the actions column header instead of the toolbar.
|
|
828
|
+
*/
|
|
829
|
+
addInActionsColumnHeader?: boolean;
|
|
830
|
+
/**
|
|
831
|
+
* Optional section title rendered above the table.
|
|
832
|
+
*/
|
|
833
|
+
title?: string;
|
|
834
|
+
/**
|
|
835
|
+
* Message shown when `items` is empty. Defaults to `"No items."`.
|
|
836
|
+
*/
|
|
837
|
+
emptyMessage?: string;
|
|
838
|
+
/**
|
|
839
|
+
* IDs of items currently busy (saving / deleting). Those rows are
|
|
840
|
+
* visually dimmed and non-interactive.
|
|
841
|
+
*/
|
|
842
|
+
busyItemIds?: string[];
|
|
843
|
+
/**
|
|
844
|
+
* Row IDs that should show invalid / warning styling (e.g. validation issues).
|
|
845
|
+
*/
|
|
846
|
+
invalidItemIds?: string[];
|
|
847
|
+
/**
|
|
848
|
+
* First column header label. Defaults to `"Name"`.
|
|
849
|
+
*/
|
|
850
|
+
nameColumnHeader?: string;
|
|
851
|
+
/**
|
|
852
|
+
* Actions column header. Defaults to `"Actions"`. Use `''` for an empty header cell.
|
|
853
|
+
*/
|
|
854
|
+
actionsColumnHeader?: string;
|
|
855
|
+
/**
|
|
856
|
+
* Extra content rendered below the product code in the name cell.
|
|
857
|
+
*/
|
|
858
|
+
renderProductMeta?: (item: T, index: number) => default_2.ReactNode;
|
|
859
|
+
/**
|
|
860
|
+
* When true, the table sits flush inside a parent card (no outer border on the wrapper).
|
|
861
|
+
*/
|
|
862
|
+
embedded?: boolean;
|
|
863
|
+
/**
|
|
864
|
+
* Additional CSS class name for the root element.
|
|
865
|
+
*/
|
|
866
|
+
className?: string;
|
|
867
|
+
/**
|
|
868
|
+
* Test ID for testing.
|
|
869
|
+
*/
|
|
870
|
+
'data-testid'?: string;
|
|
871
|
+
}
|
|
872
|
+
|
|
873
|
+
/**
|
|
874
|
+
* WYSIWYG editor (Quill, snow theme). Quill and `quill.snow.css` are loaded via
|
|
875
|
+
* dynamic `import()` on first client mount so this module stays safe for SSR/build
|
|
876
|
+
* environments and consumers only pay the editor cost when the component mounts.
|
|
877
|
+
*/
|
|
878
|
+
export declare const RichTextEditor: ({ value, onChange, placeholder, className, readOnly, "data-testid": testId, }: RichTextEditorProps) => JSX_2.Element;
|
|
879
|
+
|
|
880
|
+
export declare interface RichTextEditorProps {
|
|
881
|
+
value: string;
|
|
882
|
+
onChange: (value: string) => void;
|
|
883
|
+
placeholder?: string;
|
|
884
|
+
className?: string;
|
|
885
|
+
readOnly?: boolean;
|
|
886
|
+
'data-testid'?: string;
|
|
887
|
+
}
|
|
888
|
+
|
|
889
|
+
export declare const SecondaryButton: ({ label, disabled, icon, iconPos, onClick, className, "data-testid": testId, ...props }: SecondaryButtonProps) => JSX_2.Element;
|
|
890
|
+
|
|
891
|
+
export declare interface SecondaryButtonProps {
|
|
892
|
+
/**
|
|
893
|
+
* Text label displayed inside the button
|
|
894
|
+
*/
|
|
895
|
+
label?: string;
|
|
896
|
+
/**
|
|
897
|
+
* Whether the button is disabled
|
|
898
|
+
*/
|
|
899
|
+
disabled?: boolean;
|
|
900
|
+
/**
|
|
901
|
+
* Optional icon
|
|
902
|
+
*/
|
|
903
|
+
icon?: default_2.ReactNode;
|
|
904
|
+
/**
|
|
905
|
+
* Icon position relative to the label
|
|
906
|
+
*/
|
|
907
|
+
iconPos?: 'left' | 'right';
|
|
908
|
+
/**
|
|
909
|
+
* Click handler
|
|
910
|
+
*/
|
|
911
|
+
onClick?: () => void;
|
|
912
|
+
/**
|
|
913
|
+
* Additional CSS class name
|
|
914
|
+
*/
|
|
915
|
+
className?: string;
|
|
916
|
+
/**
|
|
917
|
+
* Test ID for testing
|
|
918
|
+
*/
|
|
919
|
+
'data-testid'?: string;
|
|
920
|
+
}
|
|
921
|
+
|
|
922
|
+
export declare const SelectButton: <T extends Record<string, unknown>>({ value, onChange, options, optionLabel, optionValue, optionDisabled, multiple, itemTemplate, disabled, invalid, className, "data-testid": testId, }: SelectButtonProps<T>) => JSX_2.Element;
|
|
923
|
+
|
|
924
|
+
export declare interface SelectButtonChangeEvent {
|
|
925
|
+
value: SelectButtonOption['value'] | SelectButtonOption['value'][] | null;
|
|
926
|
+
originalEvent: default_2.SyntheticEvent;
|
|
927
|
+
}
|
|
928
|
+
|
|
929
|
+
export declare interface SelectButtonOption {
|
|
930
|
+
label?: string;
|
|
931
|
+
value?: string;
|
|
932
|
+
[key: string]: unknown;
|
|
933
|
+
}
|
|
934
|
+
|
|
935
|
+
export declare interface SelectButtonProps<T = SelectButtonOption> {
|
|
936
|
+
/**
|
|
937
|
+
* Selected value (controlled). Single value or array when multiple.
|
|
938
|
+
*/
|
|
939
|
+
value?: unknown;
|
|
940
|
+
/**
|
|
941
|
+
* Callback when selection changes
|
|
942
|
+
*/
|
|
943
|
+
onChange?: (e: SelectButtonChangeEvent) => void;
|
|
944
|
+
/**
|
|
945
|
+
* Array of options
|
|
946
|
+
*/
|
|
947
|
+
options: T[];
|
|
948
|
+
/**
|
|
949
|
+
* Property name for the option label (default: "label")
|
|
950
|
+
*/
|
|
951
|
+
optionLabel?: keyof T | string;
|
|
952
|
+
/**
|
|
953
|
+
* Property name for the option value (default: "value")
|
|
954
|
+
*/
|
|
955
|
+
optionValue?: keyof T | string;
|
|
956
|
+
/**
|
|
957
|
+
* Name of the property that indicates whether an option is disabled.
|
|
958
|
+
* @see https://primereact.org/selectbutton/
|
|
959
|
+
*/
|
|
960
|
+
optionDisabled?: keyof T | string;
|
|
961
|
+
/**
|
|
962
|
+
* When true, allows multiple selection (value is an array).
|
|
963
|
+
*/
|
|
964
|
+
multiple?: boolean;
|
|
965
|
+
/**
|
|
966
|
+
* Template for each option. Receives the option object.
|
|
967
|
+
*/
|
|
968
|
+
itemTemplate?: (option: T) => default_2.ReactNode;
|
|
969
|
+
/**
|
|
970
|
+
* Whether the component is disabled
|
|
971
|
+
*/
|
|
972
|
+
disabled?: boolean;
|
|
973
|
+
/**
|
|
974
|
+
* Invalid state for validation styling
|
|
975
|
+
*/
|
|
976
|
+
invalid?: boolean;
|
|
977
|
+
/**
|
|
978
|
+
* Additional CSS class name for the root
|
|
979
|
+
*/
|
|
980
|
+
className?: string;
|
|
981
|
+
/**
|
|
982
|
+
* Test ID for testing
|
|
983
|
+
*/
|
|
984
|
+
'data-testid'?: string;
|
|
985
|
+
}
|
|
986
|
+
|
|
987
|
+
/**
|
|
988
|
+
* Compound side-menu component for cockpit navigation.
|
|
989
|
+
*
|
|
990
|
+
* Sub-components: `SideMenu.Brand`, `SideMenu.Nav`, `SideMenu.NavItem`, `SideMenu.Footer`.
|
|
991
|
+
*
|
|
992
|
+
* `SideMenu.NavItem` is presentational — wrap it with your router's link
|
|
993
|
+
* (e.g. `NavLink`) and pass `active={isActive}` (keep default `as="div"`).
|
|
994
|
+
* For a row that is not wrapped by a link, use `as="button"` and `onClick`.
|
|
995
|
+
*/
|
|
996
|
+
export declare const SideMenu: SideMenuComponent;
|
|
997
|
+
|
|
998
|
+
declare const SideMenuBrand: ({ title, subtitle, logo, className, ...props }: SideMenuBrandProps) => JSX_2.Element;
|
|
999
|
+
|
|
1000
|
+
export declare interface SideMenuBrandProps extends default_2.HTMLAttributes<HTMLDivElement> {
|
|
1001
|
+
/** Brand name displayed prominently. Defaults to "EMPORIX". */
|
|
1002
|
+
title?: string;
|
|
1003
|
+
/** Secondary text below the brand name (e.g. "Order Processing"). */
|
|
1004
|
+
subtitle?: string;
|
|
1005
|
+
/** Custom logo element. Defaults to the "E" mark. */
|
|
1006
|
+
logo?: default_2.ReactNode;
|
|
1007
|
+
className?: string;
|
|
1008
|
+
}
|
|
1009
|
+
|
|
1010
|
+
/**
|
|
1011
|
+
* Compound root plus static subcomponents (`SideMenu.Brand`, `SideMenu.Nav`, …).
|
|
1012
|
+
*/
|
|
1013
|
+
export declare type SideMenuComponent = default_2.FC<SideMenuProps> & {
|
|
1014
|
+
Brand: typeof SideMenuBrand;
|
|
1015
|
+
Nav: typeof SideMenuNav;
|
|
1016
|
+
NavItem: typeof SideMenuNavItem;
|
|
1017
|
+
Footer: typeof SideMenuFooter;
|
|
1018
|
+
};
|
|
1019
|
+
|
|
1020
|
+
declare const SideMenuFooter: ({ children, className, ...props }: SideMenuFooterProps) => JSX_2.Element;
|
|
1021
|
+
|
|
1022
|
+
export declare interface SideMenuFooterProps extends default_2.HTMLAttributes<HTMLDivElement> {
|
|
1023
|
+
children: default_2.ReactNode;
|
|
1024
|
+
className?: string;
|
|
1025
|
+
}
|
|
1026
|
+
|
|
1027
|
+
declare const SideMenuNav: ({ label, children, className, ...props }: SideMenuNavProps) => JSX_2.Element;
|
|
1028
|
+
|
|
1029
|
+
declare const SideMenuNavItem: ({ icon, active, badge, children, className, as, type, ...props }: SideMenuNavItemProps) => JSX_2.Element;
|
|
1030
|
+
|
|
1031
|
+
export declare interface SideMenuNavItemProps extends Omit<default_2.HTMLAttributes<HTMLElement>, 'children'> {
|
|
1032
|
+
/** Leading icon element (24×24). */
|
|
1033
|
+
icon?: default_2.ReactNode;
|
|
1034
|
+
/** Highlights the item as currently active (blue left border + tinted bg). */
|
|
1035
|
+
active?: boolean;
|
|
1036
|
+
/** Optional badge value shown on the right (e.g. a count). */
|
|
1037
|
+
badge?: default_2.ReactNode;
|
|
1038
|
+
children: default_2.ReactNode;
|
|
1039
|
+
className?: string;
|
|
1040
|
+
/**
|
|
1041
|
+
* `div` (default) when the row is wrapped by `NavLink` or `<a>` — do not use `button` there
|
|
1042
|
+
* (nested interactive elements). Use `button` for standalone clickable items.
|
|
1043
|
+
*/
|
|
1044
|
+
as?: 'div' | 'button';
|
|
1045
|
+
/** Only when `as="button"`. Defaults to `button`. */
|
|
1046
|
+
type?: default_2.ButtonHTMLAttributes<HTMLButtonElement>['type'];
|
|
1047
|
+
}
|
|
1048
|
+
|
|
1049
|
+
export declare interface SideMenuNavProps extends default_2.HTMLAttributes<HTMLElement> {
|
|
1050
|
+
/** Optional section label rendered above the nav items (e.g. "NAVIGATION"). */
|
|
1051
|
+
label?: string;
|
|
1052
|
+
children: default_2.ReactNode;
|
|
1053
|
+
className?: string;
|
|
1054
|
+
}
|
|
1055
|
+
|
|
1056
|
+
export declare interface SideMenuProps extends default_2.HTMLAttributes<HTMLElement> {
|
|
1057
|
+
children: default_2.ReactNode;
|
|
1058
|
+
className?: string;
|
|
1059
|
+
'data-testid'?: string;
|
|
1060
|
+
}
|
|
1061
|
+
|
|
1062
|
+
export declare const Spinner: ({ size, label, "aria-label": ariaLabel, className, "data-testid": testId, }: SpinnerProps) => JSX_2.Element;
|
|
1063
|
+
|
|
1064
|
+
export declare interface SpinnerProps {
|
|
1065
|
+
size?: SpinnerSize;
|
|
1066
|
+
label?: string;
|
|
1067
|
+
/** Accessible name when no visible label is provided. @default "Loading" */
|
|
1068
|
+
'aria-label'?: string;
|
|
1069
|
+
className?: string;
|
|
1070
|
+
'data-testid'?: string;
|
|
1071
|
+
}
|
|
1072
|
+
|
|
1073
|
+
export declare type SpinnerSize = 'sm' | 'md' | 'lg';
|
|
1074
|
+
|
|
1075
|
+
export declare interface TabItem {
|
|
1076
|
+
/**
|
|
1077
|
+
* Unique identifier for the tab
|
|
1078
|
+
*/
|
|
1079
|
+
id: string;
|
|
1080
|
+
/**
|
|
1081
|
+
* Display label for the tab
|
|
1082
|
+
*/
|
|
1083
|
+
label: string;
|
|
1084
|
+
/**
|
|
1085
|
+
* Content to display when tab is active
|
|
1086
|
+
*/
|
|
1087
|
+
content: ReactNode;
|
|
1088
|
+
}
|
|
1089
|
+
|
|
1090
|
+
export declare const Tabs: ({ tabs, activeTabId, onTabChange, className, "data-testid": testId, ...props }: TabsProps) => JSX_2.Element;
|
|
1091
|
+
|
|
1092
|
+
export declare interface TabsProps {
|
|
1093
|
+
/**
|
|
1094
|
+
* Array of tab items to display
|
|
1095
|
+
*/
|
|
1096
|
+
tabs: TabItem[];
|
|
1097
|
+
/**
|
|
1098
|
+
* ID of the currently active tab
|
|
1099
|
+
*/
|
|
1100
|
+
activeTabId: string;
|
|
1101
|
+
/**
|
|
1102
|
+
* Callback function when tab is changed
|
|
1103
|
+
*/
|
|
1104
|
+
onTabChange: (tabId: string) => void;
|
|
1105
|
+
/**
|
|
1106
|
+
* Additional CSS class name
|
|
1107
|
+
*/
|
|
1108
|
+
className?: string;
|
|
1109
|
+
/**
|
|
1110
|
+
* Test ID for testing
|
|
1111
|
+
*/
|
|
1112
|
+
'data-testid'?: string;
|
|
1113
|
+
}
|
|
1114
|
+
|
|
1115
|
+
export declare const TertiaryButton: ({ label, disabled, icon, iconPos, className, ...rest }: TertiaryButtonProps) => JSX_2.Element;
|
|
1116
|
+
|
|
1117
|
+
/**
|
|
1118
|
+
* Native `<button>` props plus label/icon layout. Either a visible `label` or `aria-label` is required
|
|
1119
|
+
* so the control always has an accessible name (icon-only buttons need `aria-label`).
|
|
1120
|
+
*/
|
|
1121
|
+
export declare type TertiaryButtonProps = TertiaryButtonShared & ({
|
|
1122
|
+
label: string;
|
|
1123
|
+
} | {
|
|
1124
|
+
'aria-label': string;
|
|
1125
|
+
});
|
|
1126
|
+
|
|
1127
|
+
declare type TertiaryButtonShared = Omit<default_2.ButtonHTMLAttributes<HTMLButtonElement>, 'type' | 'children'> & {
|
|
1128
|
+
/**
|
|
1129
|
+
* Text label displayed inside the button. When omitted (icon-only), you must pass `aria-label`.
|
|
1130
|
+
*/
|
|
1131
|
+
label?: string;
|
|
1132
|
+
/** Optional icon */
|
|
1133
|
+
icon?: default_2.ReactNode;
|
|
1134
|
+
/** Icon position relative to the label */
|
|
1135
|
+
iconPos?: 'left' | 'right';
|
|
1136
|
+
};
|
|
1137
|
+
|
|
1138
|
+
export declare const Timeline: ({ events, animated, animateLine, className, "data-testid": testId, }: TimelineProps) => JSX_2.Element | null;
|
|
1139
|
+
|
|
1140
|
+
export declare interface TimelineEvent {
|
|
1141
|
+
id: string;
|
|
1142
|
+
title: string;
|
|
1143
|
+
description?: string;
|
|
1144
|
+
timestamp?: string;
|
|
1145
|
+
icon?: default_2.ReactNode;
|
|
1146
|
+
variant?: 'default' | 'info' | 'success' | 'warning' | 'error';
|
|
1147
|
+
}
|
|
1148
|
+
|
|
1149
|
+
export declare interface TimelineProps {
|
|
1150
|
+
events: TimelineEvent[];
|
|
1151
|
+
/** Animate events staggering in on mount. @default true */
|
|
1152
|
+
animated?: boolean;
|
|
1153
|
+
/** Animate the vertical connector (draw + pulse). @default true */
|
|
1154
|
+
animateLine?: boolean;
|
|
1155
|
+
/** Additional CSS class. */
|
|
1156
|
+
className?: string;
|
|
1157
|
+
'data-testid'?: string;
|
|
1158
|
+
}
|
|
1159
|
+
|
|
1160
|
+
export declare const Toast: ({ entry, onClose }: ToastProps) => JSX_2.Element;
|
|
1161
|
+
|
|
1162
|
+
export declare interface ToastContextValue {
|
|
1163
|
+
showToast: (message: string, variant?: ToastVariant, duration?: number) => void;
|
|
1164
|
+
}
|
|
1165
|
+
|
|
1166
|
+
export declare interface ToastEntry {
|
|
1167
|
+
id: string;
|
|
1168
|
+
message: string;
|
|
1169
|
+
variant: ToastVariant;
|
|
1170
|
+
duration?: number;
|
|
1171
|
+
}
|
|
1172
|
+
|
|
1173
|
+
export declare interface ToastProps {
|
|
1174
|
+
entry: ToastEntry;
|
|
1175
|
+
onClose: (id: string) => void;
|
|
1176
|
+
}
|
|
1177
|
+
|
|
1178
|
+
export declare const ToastProvider: ({ children }: ToastProviderProps) => JSX_2.Element;
|
|
1179
|
+
|
|
1180
|
+
export declare interface ToastProviderProps {
|
|
1181
|
+
children: default_2.ReactNode;
|
|
1182
|
+
}
|
|
1183
|
+
|
|
1184
|
+
export declare type ToastVariant = 'success' | 'error' | 'warning' | 'info';
|
|
1185
|
+
|
|
1186
|
+
/**
|
|
1187
|
+
* Full-width blue top navigation bar for cockpit layouts.
|
|
1188
|
+
*
|
|
1189
|
+
* Sub-components: `TopNav.Logo`
|
|
1190
|
+
*/
|
|
1191
|
+
export declare const TopNav: TopNavComponent;
|
|
1192
|
+
|
|
1193
|
+
/**
|
|
1194
|
+
* Compound root plus static `TopNav.Logo` (default Emporix wordmark).
|
|
1195
|
+
*/
|
|
1196
|
+
export declare type TopNavComponent = default_2.FC<TopNavProps> & {
|
|
1197
|
+
Logo: typeof EmporixLogo;
|
|
1198
|
+
};
|
|
1199
|
+
|
|
1200
|
+
export declare interface TopNavProps extends default_2.HTMLAttributes<HTMLElement> {
|
|
1201
|
+
/** Logo element in the left group. Defaults to the Emporix wordmark. */
|
|
1202
|
+
logo?: default_2.ReactNode;
|
|
1203
|
+
/** Content before the logo in the left group (e.g. sidebar toggle button). */
|
|
1204
|
+
start?: default_2.ReactNode;
|
|
1205
|
+
/** Content anchored to the right edge (e.g. user avatar, action buttons). */
|
|
1206
|
+
children?: default_2.ReactNode;
|
|
1207
|
+
className?: string;
|
|
1208
|
+
'data-testid'?: string;
|
|
1209
|
+
}
|
|
1210
|
+
|
|
1211
|
+
export declare const useToast: () => ToastContextValue;
|
|
1212
|
+
|
|
1213
|
+
export declare const Wizard: ({ steps, activeStep, onStepChange, onSubmit, backLabel, nextLabel, submitLabel, submitting, className, "data-testid": testId, }: WizardProps) => JSX_2.Element;
|
|
1214
|
+
|
|
1215
|
+
export declare interface WizardProps {
|
|
1216
|
+
/** Ordered array of steps. */
|
|
1217
|
+
steps: WizardStep[];
|
|
1218
|
+
/** Index (0-based) of the currently active step. */
|
|
1219
|
+
activeStep: number;
|
|
1220
|
+
/** Called when the active step changes (via Back / Next). */
|
|
1221
|
+
onStepChange: (index: number) => void;
|
|
1222
|
+
/** Called when the user clicks "Submit" on the last step. */
|
|
1223
|
+
onSubmit?: () => void;
|
|
1224
|
+
/** Label for the Back button. @default "Back" */
|
|
1225
|
+
backLabel?: string;
|
|
1226
|
+
/** Label for the Next button. @default "Next" */
|
|
1227
|
+
nextLabel?: string;
|
|
1228
|
+
/** Label for the Submit button on the last step. @default "Submit" */
|
|
1229
|
+
submitLabel?: string;
|
|
1230
|
+
/** When true, the submit button is disabled (e.g. while saving). */
|
|
1231
|
+
submitting?: boolean;
|
|
1232
|
+
/** Additional CSS class name for the root element. */
|
|
1233
|
+
className?: string;
|
|
1234
|
+
/** Test ID for testing. */
|
|
1235
|
+
'data-testid'?: string;
|
|
1236
|
+
}
|
|
1237
|
+
|
|
1238
|
+
export declare interface WizardStep {
|
|
1239
|
+
/** Unique identifier for the step. */
|
|
1240
|
+
id: string;
|
|
1241
|
+
/** Label shown in the stepper indicator. */
|
|
1242
|
+
label: string;
|
|
1243
|
+
/** Content rendered when this step is active. */
|
|
1244
|
+
content: default_2.ReactNode;
|
|
1245
|
+
/**
|
|
1246
|
+
* Whether the user can proceed past this step.
|
|
1247
|
+
* Defaults to `true`. When `false`, the "Next" / "Submit" button is disabled.
|
|
1248
|
+
*/
|
|
1249
|
+
canProceed?: boolean;
|
|
1250
|
+
}
|
|
1251
|
+
|
|
1252
|
+
export { }
|