@nubitio/ui 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +75 -0
- package/dist/index.cjs +2396 -0
- package/dist/index.d.cts +780 -0
- package/dist/index.d.mts +780 -0
- package/dist/index.mjs +2332 -0
- package/dist/style.css +2614 -0
- package/dist/themes/nb-theme-dark.css +79 -0
- package/dist/themes/nb-theme-light.css +78 -0
- package/package.json +56 -0
package/dist/index.d.cts
ADDED
|
@@ -0,0 +1,780 @@
|
|
|
1
|
+
import React$1, { ButtonHTMLAttributes, InputHTMLAttributes, LabelHTMLAttributes, ReactNode, SelectHTMLAttributes, TextareaHTMLAttributes } from "react";
|
|
2
|
+
|
|
3
|
+
//#region packages/ui/Avatar.d.ts
|
|
4
|
+
type AvatarShape = 'circle' | 'square';
|
|
5
|
+
type AvatarSize = 'xs' | 'sm' | 'md' | 'lg' | 'xl';
|
|
6
|
+
interface AvatarProps {
|
|
7
|
+
/**
|
|
8
|
+
* The name used to derive initials and background color.
|
|
9
|
+
* Initials are extracted from up to the first two words.
|
|
10
|
+
*/
|
|
11
|
+
owner?: string;
|
|
12
|
+
/**
|
|
13
|
+
* Explicit size in px. If not provided, uses one of the named sizes.
|
|
14
|
+
* Named sizes: xs=20, sm=24, md=32, lg=40, xl=48.
|
|
15
|
+
*/
|
|
16
|
+
size?: number;
|
|
17
|
+
/** Named size variant — overridden by explicit `size` prop. */
|
|
18
|
+
variant?: AvatarSize;
|
|
19
|
+
/** Circle (default) or rounded-square. */
|
|
20
|
+
shape?: AvatarShape;
|
|
21
|
+
/** Optional alt text. Defaults to owner name or "Avatar". */
|
|
22
|
+
alt?: string;
|
|
23
|
+
className?: string;
|
|
24
|
+
}
|
|
25
|
+
declare function getAvatarInitials(owner?: string): string;
|
|
26
|
+
declare function getAvatarHue(owner?: string): number;
|
|
27
|
+
declare const Avatar: ({
|
|
28
|
+
owner,
|
|
29
|
+
size,
|
|
30
|
+
variant,
|
|
31
|
+
shape,
|
|
32
|
+
alt,
|
|
33
|
+
className
|
|
34
|
+
}: AvatarProps) => React$1.JSX.Element;
|
|
35
|
+
//#endregion
|
|
36
|
+
//#region packages/ui/AppDialog.d.ts
|
|
37
|
+
interface AppDialogProps {
|
|
38
|
+
visible?: boolean;
|
|
39
|
+
open?: boolean;
|
|
40
|
+
title: string;
|
|
41
|
+
onClose: () => void;
|
|
42
|
+
children: React$1.ReactNode;
|
|
43
|
+
footer?: React$1.ReactNode;
|
|
44
|
+
width?: number | string;
|
|
45
|
+
maxWidth?: number | string;
|
|
46
|
+
height?: number | string;
|
|
47
|
+
fullScreen?: boolean;
|
|
48
|
+
showCloseButton?: boolean;
|
|
49
|
+
/** Accessible label for the close button. Defaults to UiStrings `close`. */
|
|
50
|
+
closeLabel?: string;
|
|
51
|
+
/** Accessible label for the backdrop scrim. Defaults to UiStrings `closeDialog`. */
|
|
52
|
+
scrimLabel?: string;
|
|
53
|
+
closeOnOutsideClick?: boolean;
|
|
54
|
+
closeOnEscape?: boolean;
|
|
55
|
+
restoreFocus?: boolean;
|
|
56
|
+
keepMounted?: boolean;
|
|
57
|
+
rootClassName?: string;
|
|
58
|
+
className?: string;
|
|
59
|
+
headerClassName?: string;
|
|
60
|
+
titleClassName?: string;
|
|
61
|
+
bodyClassName?: string;
|
|
62
|
+
footerClassName?: string;
|
|
63
|
+
role?: string;
|
|
64
|
+
}
|
|
65
|
+
declare const AppDialog: ({
|
|
66
|
+
visible,
|
|
67
|
+
open,
|
|
68
|
+
title,
|
|
69
|
+
onClose,
|
|
70
|
+
children,
|
|
71
|
+
footer,
|
|
72
|
+
width,
|
|
73
|
+
maxWidth,
|
|
74
|
+
height,
|
|
75
|
+
fullScreen,
|
|
76
|
+
showCloseButton,
|
|
77
|
+
closeLabel,
|
|
78
|
+
scrimLabel,
|
|
79
|
+
closeOnOutsideClick,
|
|
80
|
+
closeOnEscape,
|
|
81
|
+
restoreFocus,
|
|
82
|
+
keepMounted,
|
|
83
|
+
rootClassName,
|
|
84
|
+
className,
|
|
85
|
+
headerClassName,
|
|
86
|
+
titleClassName,
|
|
87
|
+
bodyClassName,
|
|
88
|
+
footerClassName,
|
|
89
|
+
role
|
|
90
|
+
}: AppDialogProps) => React$1.ReactPortal | null;
|
|
91
|
+
//#endregion
|
|
92
|
+
//#region packages/ui/ConfirmDialog.d.ts
|
|
93
|
+
interface ConfirmDialogProps {
|
|
94
|
+
open: boolean;
|
|
95
|
+
title: string;
|
|
96
|
+
message: string;
|
|
97
|
+
onConfirm: () => void;
|
|
98
|
+
onCancel: () => void;
|
|
99
|
+
confirmLabel?: string;
|
|
100
|
+
cancelLabel?: string;
|
|
101
|
+
variant?: 'danger' | 'warning' | 'info';
|
|
102
|
+
}
|
|
103
|
+
declare function ConfirmDialog({
|
|
104
|
+
open,
|
|
105
|
+
title,
|
|
106
|
+
message,
|
|
107
|
+
onConfirm,
|
|
108
|
+
onCancel,
|
|
109
|
+
confirmLabel,
|
|
110
|
+
cancelLabel,
|
|
111
|
+
variant
|
|
112
|
+
}: ConfirmDialogProps): import("react").JSX.Element;
|
|
113
|
+
//#endregion
|
|
114
|
+
//#region packages/ui/AppToolbar.d.ts
|
|
115
|
+
interface AppToolbarProps {
|
|
116
|
+
title: string;
|
|
117
|
+
additionalToolbarContent?: ReactNode;
|
|
118
|
+
showRefreshButton?: boolean;
|
|
119
|
+
onRefresh?: () => void;
|
|
120
|
+
icon?: string;
|
|
121
|
+
refreshLabel?: string;
|
|
122
|
+
}
|
|
123
|
+
declare const AppToolbar: ({
|
|
124
|
+
title,
|
|
125
|
+
additionalToolbarContent,
|
|
126
|
+
showRefreshButton,
|
|
127
|
+
onRefresh,
|
|
128
|
+
icon,
|
|
129
|
+
refreshLabel,
|
|
130
|
+
children
|
|
131
|
+
}: AppToolbarProps & React$1.PropsWithChildren) => React$1.JSX.Element;
|
|
132
|
+
//#endregion
|
|
133
|
+
//#region packages/ui/Button.d.ts
|
|
134
|
+
type ButtonVariant = 'primary' | 'secondary' | 'success' | 'danger' | 'ghost';
|
|
135
|
+
type ButtonSize = 'sm' | 'md';
|
|
136
|
+
interface ButtonProps extends ButtonHTMLAttributes<HTMLButtonElement> {
|
|
137
|
+
variant?: ButtonVariant;
|
|
138
|
+
size?: ButtonSize;
|
|
139
|
+
fullWidth?: boolean;
|
|
140
|
+
icon?: string;
|
|
141
|
+
loading?: boolean;
|
|
142
|
+
children?: ReactNode;
|
|
143
|
+
}
|
|
144
|
+
declare const Button: ({
|
|
145
|
+
variant,
|
|
146
|
+
size,
|
|
147
|
+
fullWidth,
|
|
148
|
+
icon,
|
|
149
|
+
loading,
|
|
150
|
+
className,
|
|
151
|
+
children,
|
|
152
|
+
disabled,
|
|
153
|
+
...props
|
|
154
|
+
}: ButtonProps) => import("react").JSX.Element;
|
|
155
|
+
interface IconButtonProps extends ButtonHTMLAttributes<HTMLButtonElement> {
|
|
156
|
+
icon: string;
|
|
157
|
+
label: string;
|
|
158
|
+
variant?: 'default' | 'danger';
|
|
159
|
+
}
|
|
160
|
+
declare const IconButton: ({
|
|
161
|
+
icon,
|
|
162
|
+
label,
|
|
163
|
+
variant,
|
|
164
|
+
className,
|
|
165
|
+
...props
|
|
166
|
+
}: IconButtonProps) => import("react").JSX.Element;
|
|
167
|
+
//#endregion
|
|
168
|
+
//#region packages/ui/Card.d.ts
|
|
169
|
+
interface CardProps {
|
|
170
|
+
title?: string;
|
|
171
|
+
description?: string;
|
|
172
|
+
}
|
|
173
|
+
declare const Card: ({
|
|
174
|
+
title,
|
|
175
|
+
description,
|
|
176
|
+
children
|
|
177
|
+
}: React$1.PropsWithChildren<CardProps>) => React$1.JSX.Element;
|
|
178
|
+
//#endregion
|
|
179
|
+
//#region packages/ui/FormControls.d.ts
|
|
180
|
+
interface FormFieldProps extends LabelHTMLAttributes<HTMLLabelElement> {
|
|
181
|
+
label?: ReactNode;
|
|
182
|
+
error?: ReactNode;
|
|
183
|
+
helpText?: ReactNode;
|
|
184
|
+
children: ReactNode;
|
|
185
|
+
}
|
|
186
|
+
declare const FormField: ({
|
|
187
|
+
label,
|
|
188
|
+
error,
|
|
189
|
+
helpText,
|
|
190
|
+
children,
|
|
191
|
+
className,
|
|
192
|
+
...props
|
|
193
|
+
}: FormFieldProps) => import("react").JSX.Element;
|
|
194
|
+
interface TextFieldProps extends InputHTMLAttributes<HTMLInputElement> {
|
|
195
|
+
invalid?: boolean;
|
|
196
|
+
}
|
|
197
|
+
declare const TextField: import("react").ForwardRefExoticComponent<TextFieldProps & import("react").RefAttributes<HTMLInputElement>>;
|
|
198
|
+
interface SelectFieldProps extends SelectHTMLAttributes<HTMLSelectElement> {
|
|
199
|
+
invalid?: boolean;
|
|
200
|
+
}
|
|
201
|
+
declare const SelectField: import("react").ForwardRefExoticComponent<SelectFieldProps & import("react").RefAttributes<HTMLSelectElement>>;
|
|
202
|
+
interface TextAreaFieldProps extends TextareaHTMLAttributes<HTMLTextAreaElement> {
|
|
203
|
+
invalid?: boolean;
|
|
204
|
+
}
|
|
205
|
+
declare const TextAreaField: import("react").ForwardRefExoticComponent<TextAreaFieldProps & import("react").RefAttributes<HTMLTextAreaElement>>;
|
|
206
|
+
//#endregion
|
|
207
|
+
//#region packages/ui/AppDropdown.d.ts
|
|
208
|
+
interface AppDropdownOption {
|
|
209
|
+
value: string;
|
|
210
|
+
label: string;
|
|
211
|
+
selectedLabel?: string;
|
|
212
|
+
iconText?: string;
|
|
213
|
+
disabled?: boolean;
|
|
214
|
+
}
|
|
215
|
+
type AppDropdownVariant = 'form' | 'toolbar' | 'compact';
|
|
216
|
+
interface AppDropdownProps {
|
|
217
|
+
id?: string;
|
|
218
|
+
label?: ReactNode;
|
|
219
|
+
icon?: string;
|
|
220
|
+
value: string;
|
|
221
|
+
options: AppDropdownOption[];
|
|
222
|
+
onChange: (value: string) => void;
|
|
223
|
+
disabled?: boolean;
|
|
224
|
+
placeholder?: string;
|
|
225
|
+
variant?: AppDropdownVariant;
|
|
226
|
+
className?: string;
|
|
227
|
+
/** When true, wraps the control in a form-field label (form variant only). */
|
|
228
|
+
showFieldLabel?: boolean;
|
|
229
|
+
menuMinWidth?: number;
|
|
230
|
+
error?: ReactNode;
|
|
231
|
+
helpText?: ReactNode;
|
|
232
|
+
}
|
|
233
|
+
declare function AppDropdown({
|
|
234
|
+
id: idProp,
|
|
235
|
+
label,
|
|
236
|
+
icon,
|
|
237
|
+
value,
|
|
238
|
+
options,
|
|
239
|
+
onChange,
|
|
240
|
+
disabled,
|
|
241
|
+
placeholder,
|
|
242
|
+
variant,
|
|
243
|
+
className,
|
|
244
|
+
showFieldLabel,
|
|
245
|
+
menuMinWidth,
|
|
246
|
+
error,
|
|
247
|
+
helpText
|
|
248
|
+
}: AppDropdownProps): import("react").JSX.Element;
|
|
249
|
+
//#endregion
|
|
250
|
+
//#region packages/ui/theme/ThemeProvider.d.ts
|
|
251
|
+
type Theme = 'light' | 'dark';
|
|
252
|
+
type ThemeMode = 'light' | 'dark' | 'auto';
|
|
253
|
+
interface ThemeContextValue {
|
|
254
|
+
theme: Theme;
|
|
255
|
+
mode: ThemeMode;
|
|
256
|
+
switchTheme: () => void;
|
|
257
|
+
isLoaded: boolean;
|
|
258
|
+
}
|
|
259
|
+
declare const ThemeContext: React$1.Context<ThemeContextValue | null>;
|
|
260
|
+
declare function useTheme(): ThemeContextValue;
|
|
261
|
+
interface ThemeProviderProps {
|
|
262
|
+
storageKey?: string;
|
|
263
|
+
themePrefix?: string;
|
|
264
|
+
basePath?: string;
|
|
265
|
+
children: React$1.ReactNode;
|
|
266
|
+
}
|
|
267
|
+
declare const ThemeProvider: ({
|
|
268
|
+
storageKey,
|
|
269
|
+
themePrefix,
|
|
270
|
+
basePath,
|
|
271
|
+
children
|
|
272
|
+
}: ThemeProviderProps) => React$1.JSX.Element;
|
|
273
|
+
//#endregion
|
|
274
|
+
//#region packages/ui/theme/ThemeSwitcher.d.ts
|
|
275
|
+
declare const labelByMode: {
|
|
276
|
+
readonly light: "Theme: Light";
|
|
277
|
+
readonly dark: "Theme: Dark";
|
|
278
|
+
readonly auto: "Theme: System";
|
|
279
|
+
};
|
|
280
|
+
interface ThemeSwitcherProps {
|
|
281
|
+
labelByMode?: Partial<Record<keyof typeof labelByMode, string>>;
|
|
282
|
+
}
|
|
283
|
+
declare const ThemeSwitcher: ({
|
|
284
|
+
labelByMode: overrides
|
|
285
|
+
}?: ThemeSwitcherProps) => React$1.JSX.Element;
|
|
286
|
+
//#endregion
|
|
287
|
+
//#region packages/ui/theme/DensityProvider.d.ts
|
|
288
|
+
type Density = 'normal' | 'compact';
|
|
289
|
+
interface DensityContextValue {
|
|
290
|
+
density: Density;
|
|
291
|
+
toggleDensity: () => void;
|
|
292
|
+
}
|
|
293
|
+
declare const DensityContext: React$1.Context<DensityContextValue | null>;
|
|
294
|
+
declare function useDensity(): DensityContextValue;
|
|
295
|
+
declare const DensityProvider: ({
|
|
296
|
+
children
|
|
297
|
+
}: {
|
|
298
|
+
children: React$1.ReactNode;
|
|
299
|
+
}) => React$1.JSX.Element;
|
|
300
|
+
//#endregion
|
|
301
|
+
//#region packages/ui/theme/useAccentColor.d.ts
|
|
302
|
+
interface AccentPreset {
|
|
303
|
+
label: string;
|
|
304
|
+
value: string;
|
|
305
|
+
}
|
|
306
|
+
declare const ACCENT_PRESETS: AccentPreset[];
|
|
307
|
+
declare function useAccentColor(): {
|
|
308
|
+
accent: string;
|
|
309
|
+
changeAccent: (color: string) => void;
|
|
310
|
+
presets: AccentPreset[];
|
|
311
|
+
};
|
|
312
|
+
//#endregion
|
|
313
|
+
//#region packages/ui/SettingsPanel.d.ts
|
|
314
|
+
interface SettingsPanelProps {
|
|
315
|
+
onClose?: () => void;
|
|
316
|
+
}
|
|
317
|
+
declare const SettingsPanel: ({
|
|
318
|
+
onClose: _onClose
|
|
319
|
+
}: SettingsPanelProps) => React$1.JSX.Element;
|
|
320
|
+
//#endregion
|
|
321
|
+
//#region packages/ui/Badge.d.ts
|
|
322
|
+
type BadgeVariant = 'primary' | 'secondary' | 'success' | 'danger' | 'warning' | 'info' | 'light' | 'dark';
|
|
323
|
+
type BadgeSize = 'sm' | 'md';
|
|
324
|
+
interface BadgeProps {
|
|
325
|
+
/** Color variant — maps to semantic CSS tokens. */
|
|
326
|
+
variant?: BadgeVariant;
|
|
327
|
+
/** Size: md (default) or sm. */
|
|
328
|
+
size?: BadgeSize;
|
|
329
|
+
/** Outlined style — transparent background with colored border and text. */
|
|
330
|
+
outlined?: boolean;
|
|
331
|
+
/** Render as a pill (fully rounded). */
|
|
332
|
+
pill?: boolean;
|
|
333
|
+
/** Dot-only mode — renders a small colored circle with no text. */
|
|
334
|
+
dot?: boolean;
|
|
335
|
+
children?: ReactNode;
|
|
336
|
+
className?: string;
|
|
337
|
+
}
|
|
338
|
+
declare const Badge: ({
|
|
339
|
+
variant,
|
|
340
|
+
size,
|
|
341
|
+
outlined,
|
|
342
|
+
pill,
|
|
343
|
+
dot,
|
|
344
|
+
children,
|
|
345
|
+
className
|
|
346
|
+
}: BadgeProps) => import("react").JSX.Element;
|
|
347
|
+
//#endregion
|
|
348
|
+
//#region packages/ui/Skeleton.d.ts
|
|
349
|
+
interface SkeletonProps {
|
|
350
|
+
/** Rendered shape. */
|
|
351
|
+
variant?: 'text' | 'rect' | 'circle';
|
|
352
|
+
/** Explicit width (number = px, string = any CSS value). */
|
|
353
|
+
width?: number | string;
|
|
354
|
+
/** Explicit height (number = px, string = any CSS value). */
|
|
355
|
+
height?: number | string;
|
|
356
|
+
/** Number of text skeleton lines to render. Only used when variant="text". */
|
|
357
|
+
lines?: number;
|
|
358
|
+
className?: string;
|
|
359
|
+
}
|
|
360
|
+
declare const Skeleton: ({
|
|
361
|
+
variant,
|
|
362
|
+
width,
|
|
363
|
+
height,
|
|
364
|
+
lines,
|
|
365
|
+
className
|
|
366
|
+
}: SkeletonProps) => import("react").JSX.Element;
|
|
367
|
+
//#endregion
|
|
368
|
+
//#region packages/ui/EmptyState.d.ts
|
|
369
|
+
type EmptyStateVariant = 'default' | 'danger' | 'warning' | 'success';
|
|
370
|
+
type EmptyStateSize = 'sm' | 'md' | 'lg';
|
|
371
|
+
interface EmptyStateProps {
|
|
372
|
+
/** Phosphor icon name without the "ph-" prefix, e.g. "warning" or "folder-open". */
|
|
373
|
+
icon?: string;
|
|
374
|
+
/** Semantic variant — controls the icon and accent color. */
|
|
375
|
+
variant?: EmptyStateVariant;
|
|
376
|
+
/** Title text — required. */
|
|
377
|
+
title: string;
|
|
378
|
+
/** Optional supporting description. */
|
|
379
|
+
description?: string;
|
|
380
|
+
/** Optional action slot (buttons, links, etc.). */
|
|
381
|
+
action?: ReactNode;
|
|
382
|
+
/** Visual size. */
|
|
383
|
+
size?: EmptyStateSize;
|
|
384
|
+
/** Fill parent height — useful when used as a page-level fallback. */
|
|
385
|
+
fill?: boolean;
|
|
386
|
+
className?: string;
|
|
387
|
+
}
|
|
388
|
+
declare const EmptyState: ({
|
|
389
|
+
icon,
|
|
390
|
+
variant,
|
|
391
|
+
title,
|
|
392
|
+
description,
|
|
393
|
+
action,
|
|
394
|
+
size,
|
|
395
|
+
fill,
|
|
396
|
+
className
|
|
397
|
+
}: EmptyStateProps) => import("react").JSX.Element;
|
|
398
|
+
//#endregion
|
|
399
|
+
//#region packages/ui/Chip.d.ts
|
|
400
|
+
interface ChipProps {
|
|
401
|
+
/** Displayed label */
|
|
402
|
+
label: ReactNode;
|
|
403
|
+
/** Whether the chip is in selected/active state */
|
|
404
|
+
active?: boolean;
|
|
405
|
+
/** Optional count badge shown inside the chip */
|
|
406
|
+
count?: number;
|
|
407
|
+
/** Optional leading icon class (e.g. 'ph ph-tag') */
|
|
408
|
+
icon?: string;
|
|
409
|
+
/** Size variant */
|
|
410
|
+
size?: 'sm' | 'md' | 'lg';
|
|
411
|
+
/** Disabled state */
|
|
412
|
+
disabled?: boolean;
|
|
413
|
+
onClick?: () => void;
|
|
414
|
+
className?: string;
|
|
415
|
+
}
|
|
416
|
+
/**
|
|
417
|
+
* Pill-shaped filter/tag chip. Stateless — caller controls `active`.
|
|
418
|
+
* Use for category filters, tag lists, and multi-select inputs.
|
|
419
|
+
*/
|
|
420
|
+
declare const Chip: ({
|
|
421
|
+
label,
|
|
422
|
+
active,
|
|
423
|
+
count,
|
|
424
|
+
icon,
|
|
425
|
+
size,
|
|
426
|
+
disabled,
|
|
427
|
+
onClick,
|
|
428
|
+
className
|
|
429
|
+
}: ChipProps) => React$1.JSX.Element;
|
|
430
|
+
//#endregion
|
|
431
|
+
//#region packages/ui/Toggle.d.ts
|
|
432
|
+
interface ToggleProps {
|
|
433
|
+
/** Controlled checked value */
|
|
434
|
+
checked: boolean;
|
|
435
|
+
onChange: (checked: boolean) => void;
|
|
436
|
+
/** Optional label rendered in a flex row alongside the toggle */
|
|
437
|
+
label?: React$1.ReactNode;
|
|
438
|
+
/** Size variant */
|
|
439
|
+
size?: 'sm' | 'md';
|
|
440
|
+
disabled?: boolean;
|
|
441
|
+
/** Accessible name when no visible label is provided */
|
|
442
|
+
'aria-label'?: string;
|
|
443
|
+
className?: string;
|
|
444
|
+
}
|
|
445
|
+
/**
|
|
446
|
+
* Accessible toggle switch. Always controlled — pass `checked` + `onChange`.
|
|
447
|
+
* Renders a visually-hidden `<input type="checkbox">` with a custom track.
|
|
448
|
+
*
|
|
449
|
+
* With `label`: wraps in `.nb-toggle-row` for a label ↔ toggle layout.
|
|
450
|
+
* Without `label`: renders bare `.nb-toggle`.
|
|
451
|
+
*/
|
|
452
|
+
declare const Toggle: ({
|
|
453
|
+
checked,
|
|
454
|
+
onChange,
|
|
455
|
+
label,
|
|
456
|
+
size,
|
|
457
|
+
disabled,
|
|
458
|
+
"aria-label": ariaLabel,
|
|
459
|
+
className
|
|
460
|
+
}: ToggleProps) => React$1.JSX.Element;
|
|
461
|
+
//#endregion
|
|
462
|
+
//#region packages/ui/ContextMenu.d.ts
|
|
463
|
+
interface ContextMenuItem {
|
|
464
|
+
label: string;
|
|
465
|
+
icon?: string;
|
|
466
|
+
/** Renders item in error color */
|
|
467
|
+
danger?: boolean;
|
|
468
|
+
disabled?: boolean;
|
|
469
|
+
onClick?: () => void;
|
|
470
|
+
/** If true, renders a separator ABOVE this item */
|
|
471
|
+
separator?: boolean;
|
|
472
|
+
}
|
|
473
|
+
interface ContextMenuProps {
|
|
474
|
+
items: ContextMenuItem[];
|
|
475
|
+
/** Whether the trigger button is visible at all */
|
|
476
|
+
visible?: boolean;
|
|
477
|
+
/** Custom trigger element. Defaults to three-dot icon button. */
|
|
478
|
+
trigger?: ReactNode;
|
|
479
|
+
/** Accessible label for the default trigger button */
|
|
480
|
+
triggerLabel?: string;
|
|
481
|
+
/** Alignment of the dropdown relative to the trigger */
|
|
482
|
+
align?: 'right' | 'left';
|
|
483
|
+
className?: string;
|
|
484
|
+
}
|
|
485
|
+
/**
|
|
486
|
+
* Three-dot overflow context menu.
|
|
487
|
+
* Replaces the legacy `shared/ui/library/card-menu/CardMenu` component.
|
|
488
|
+
*
|
|
489
|
+
* Features over CardMenu:
|
|
490
|
+
* - `danger` variant items
|
|
491
|
+
* - `separator` support
|
|
492
|
+
* - `icon` per item
|
|
493
|
+
* - Custom trigger slot
|
|
494
|
+
* - Left/right alignment
|
|
495
|
+
* - Click-outside + Escape to close
|
|
496
|
+
*/
|
|
497
|
+
declare const ContextMenu: ({
|
|
498
|
+
items,
|
|
499
|
+
visible,
|
|
500
|
+
trigger,
|
|
501
|
+
triggerLabel,
|
|
502
|
+
align,
|
|
503
|
+
className
|
|
504
|
+
}: ContextMenuProps) => React$1.JSX.Element | null;
|
|
505
|
+
//#endregion
|
|
506
|
+
//#region packages/ui/StatCard.d.ts
|
|
507
|
+
interface StatCardProps {
|
|
508
|
+
title?: string;
|
|
509
|
+
/** Extra content rendered in the header row (e.g. a date-range badge) */
|
|
510
|
+
headerExtra?: ReactNode;
|
|
511
|
+
/** Whether to show the three-dot overflow menu */
|
|
512
|
+
menuVisible?: boolean;
|
|
513
|
+
/** Items for the overflow menu */
|
|
514
|
+
menuItems?: ContextMenuItem[];
|
|
515
|
+
/** When true children are not rendered (skeleton/loading state) */
|
|
516
|
+
isLoading?: boolean;
|
|
517
|
+
className?: string;
|
|
518
|
+
children?: ReactNode;
|
|
519
|
+
}
|
|
520
|
+
/**
|
|
521
|
+
* General-purpose analytics / dashboard card.
|
|
522
|
+
* Replaces the legacy `shared/ui/card-analytics/CardAnalytics` component.
|
|
523
|
+
* Uses `ContextMenu` from `@nubitio/ui` for the overflow menu.
|
|
524
|
+
*/
|
|
525
|
+
declare const StatCard: ({
|
|
526
|
+
title,
|
|
527
|
+
headerExtra,
|
|
528
|
+
menuVisible,
|
|
529
|
+
menuItems,
|
|
530
|
+
isLoading,
|
|
531
|
+
className,
|
|
532
|
+
children
|
|
533
|
+
}: StatCardProps) => React$1.JSX.Element;
|
|
534
|
+
//#endregion
|
|
535
|
+
//#region packages/ui/CollapsibleSection.d.ts
|
|
536
|
+
interface CollapsibleSectionProps {
|
|
537
|
+
/** Section heading text. */
|
|
538
|
+
label: React$1.ReactNode;
|
|
539
|
+
/** Optional Phosphor icon class string, e.g. "ph ph-chat-circle". */
|
|
540
|
+
icon?: string;
|
|
541
|
+
/** Controlled open state. */
|
|
542
|
+
open: boolean;
|
|
543
|
+
/** Called when the header trigger is clicked. */
|
|
544
|
+
onToggle: () => void;
|
|
545
|
+
/** Body content — always mounted, hidden via CSS when collapsed. */
|
|
546
|
+
children: React$1.ReactNode;
|
|
547
|
+
/**
|
|
548
|
+
* Optional trailing slot rendered to the right of the label.
|
|
549
|
+
* Useful for a clear button or indicator badge.
|
|
550
|
+
*/
|
|
551
|
+
trailing?: React$1.ReactNode;
|
|
552
|
+
className?: string;
|
|
553
|
+
/** Additional class applied to the body container. */
|
|
554
|
+
bodyClassName?: string;
|
|
555
|
+
/** Forwarded to the root element for testing. */
|
|
556
|
+
'data-testid'?: string;
|
|
557
|
+
}
|
|
558
|
+
/**
|
|
559
|
+
* Accessible collapsible section with a labelled header trigger.
|
|
560
|
+
*
|
|
561
|
+
* - Uses `aria-expanded` and `aria-controls` for screen reader support.
|
|
562
|
+
* - The body is conditionally rendered (not just hidden) to avoid mounting
|
|
563
|
+
* heavy children before they are needed. Pass `keepMounted` if you need
|
|
564
|
+
* the body always in the DOM.
|
|
565
|
+
*/
|
|
566
|
+
declare const CollapsibleSection: ({
|
|
567
|
+
label,
|
|
568
|
+
icon,
|
|
569
|
+
open,
|
|
570
|
+
onToggle,
|
|
571
|
+
children,
|
|
572
|
+
trailing,
|
|
573
|
+
className,
|
|
574
|
+
bodyClassName,
|
|
575
|
+
"data-testid": testId
|
|
576
|
+
}: CollapsibleSectionProps) => React$1.JSX.Element;
|
|
577
|
+
//#endregion
|
|
578
|
+
//#region packages/ui/DatePicker.d.ts
|
|
579
|
+
interface DatePickerProps {
|
|
580
|
+
id?: string;
|
|
581
|
+
name?: string;
|
|
582
|
+
value?: string | null;
|
|
583
|
+
placeholder?: string;
|
|
584
|
+
disabled?: boolean;
|
|
585
|
+
readOnly?: boolean;
|
|
586
|
+
required?: boolean;
|
|
587
|
+
invalid?: boolean;
|
|
588
|
+
locale?: string;
|
|
589
|
+
/** Show the inline ✕ clear button when a value is present. Default: true.
|
|
590
|
+
* Set to false when the parent (e.g. datagrid filter row) already provides its own clear action. */
|
|
591
|
+
clearable?: boolean;
|
|
592
|
+
min?: string;
|
|
593
|
+
max?: string;
|
|
594
|
+
className?: string;
|
|
595
|
+
ariaLabel?: string;
|
|
596
|
+
onChange?: (value: string) => void;
|
|
597
|
+
onBlur?: React$1.FocusEventHandler<HTMLElement>;
|
|
598
|
+
}
|
|
599
|
+
declare const DatePicker: React$1.ForwardRefExoticComponent<DatePickerProps & React$1.RefAttributes<HTMLInputElement>>;
|
|
600
|
+
//#endregion
|
|
601
|
+
//#region packages/ui/DateRangePicker.d.ts
|
|
602
|
+
interface DateRangePickerProps {
|
|
603
|
+
startValue?: string | null;
|
|
604
|
+
endValue?: string | null;
|
|
605
|
+
placeholder?: string;
|
|
606
|
+
disabled?: boolean;
|
|
607
|
+
readOnly?: boolean;
|
|
608
|
+
required?: boolean;
|
|
609
|
+
invalid?: boolean;
|
|
610
|
+
locale?: string;
|
|
611
|
+
min?: string;
|
|
612
|
+
max?: string;
|
|
613
|
+
className?: string;
|
|
614
|
+
ariaLabel?: string;
|
|
615
|
+
onChange?: (startValue: string, endValue: string) => void;
|
|
616
|
+
onBlur?: React$1.FocusEventHandler<HTMLElement>;
|
|
617
|
+
}
|
|
618
|
+
declare function DateRangePicker({
|
|
619
|
+
startValue,
|
|
620
|
+
endValue,
|
|
621
|
+
placeholder,
|
|
622
|
+
disabled,
|
|
623
|
+
readOnly,
|
|
624
|
+
required,
|
|
625
|
+
invalid,
|
|
626
|
+
locale,
|
|
627
|
+
min,
|
|
628
|
+
max,
|
|
629
|
+
className,
|
|
630
|
+
ariaLabel,
|
|
631
|
+
onChange,
|
|
632
|
+
onBlur
|
|
633
|
+
}: DateRangePickerProps): React$1.JSX.Element;
|
|
634
|
+
//#endregion
|
|
635
|
+
//#region packages/ui/Popover.d.ts
|
|
636
|
+
type PopoverAlign = 'start' | 'end';
|
|
637
|
+
interface PopoverProps {
|
|
638
|
+
/**
|
|
639
|
+
* Render prop for the trigger element.
|
|
640
|
+
* The open state is passed so the trigger can reflect aria-expanded.
|
|
641
|
+
*/
|
|
642
|
+
trigger: (props: {
|
|
643
|
+
open: boolean;
|
|
644
|
+
toggle: () => void;
|
|
645
|
+
}) => React$1.ReactNode;
|
|
646
|
+
/**
|
|
647
|
+
* Render prop for the panel content.
|
|
648
|
+
* `close` is a callback to close the popover.
|
|
649
|
+
*/
|
|
650
|
+
panel: (props: {
|
|
651
|
+
close: () => void;
|
|
652
|
+
}) => React$1.ReactNode;
|
|
653
|
+
/**
|
|
654
|
+
* Horizontal alignment of the panel relative to the container.
|
|
655
|
+
* - 'end' (default): right-aligns the panel (panel right = container right)
|
|
656
|
+
* - 'start': left-aligns the panel (panel left = container left)
|
|
657
|
+
*/
|
|
658
|
+
align?: PopoverAlign;
|
|
659
|
+
/** Accessible label for the panel dialog wrapper. */
|
|
660
|
+
ariaLabel?: string;
|
|
661
|
+
className?: string;
|
|
662
|
+
}
|
|
663
|
+
declare const Popover: ({
|
|
664
|
+
trigger,
|
|
665
|
+
panel,
|
|
666
|
+
align,
|
|
667
|
+
ariaLabel,
|
|
668
|
+
className
|
|
669
|
+
}: PopoverProps) => React$1.JSX.Element;
|
|
670
|
+
//#endregion
|
|
671
|
+
//#region packages/ui/useFloatingPanel.d.ts
|
|
672
|
+
interface UseFloatingPanelOptions {
|
|
673
|
+
/** Called when the panel is closed by click-outside or Escape. */
|
|
674
|
+
onClose?: () => void;
|
|
675
|
+
}
|
|
676
|
+
interface UseFloatingPanelResult {
|
|
677
|
+
open: boolean;
|
|
678
|
+
setOpen: (open: boolean) => void;
|
|
679
|
+
toggle: () => void;
|
|
680
|
+
/** Attach this ref to the element that contains both trigger and panel. */
|
|
681
|
+
containerRef: React.RefObject<HTMLDivElement | null>;
|
|
682
|
+
}
|
|
683
|
+
declare function useFloatingPanel(options?: UseFloatingPanelOptions): UseFloatingPanelResult;
|
|
684
|
+
//#endregion
|
|
685
|
+
//#region packages/ui/Drawer.d.ts
|
|
686
|
+
type DrawerSide = 'right' | 'left';
|
|
687
|
+
interface DrawerProps {
|
|
688
|
+
/** Controls visibility. The drawer mounts/unmounts with this flag. */
|
|
689
|
+
isOpen: boolean;
|
|
690
|
+
/** Called on Escape, scrim click, or the built-in close button. */
|
|
691
|
+
onClose: () => void;
|
|
692
|
+
/** Optional title rendered in the header. */
|
|
693
|
+
title?: React$1.ReactNode;
|
|
694
|
+
/** Width of the panel. Accepts any CSS value or a number (px). */
|
|
695
|
+
width?: number | string;
|
|
696
|
+
/** Which side the drawer slides in from. Default: right. */
|
|
697
|
+
side?: DrawerSide;
|
|
698
|
+
/**
|
|
699
|
+
* Scrim opacity level.
|
|
700
|
+
* - 'subtle' — dimly tints background (default, keeps content legible)
|
|
701
|
+
* - 'overlay' — solid overlay, same as modal backdrop
|
|
702
|
+
*/
|
|
703
|
+
scrim?: 'subtle' | 'overlay';
|
|
704
|
+
/** Content rendered inside the scrollable body. */
|
|
705
|
+
children: React$1.ReactNode;
|
|
706
|
+
/** Optional sticky footer (e.g. action buttons). */
|
|
707
|
+
footer?: React$1.ReactNode;
|
|
708
|
+
/** Accessible label for the close button. Defaults to UiStrings `close`. */
|
|
709
|
+
closeLabel?: string;
|
|
710
|
+
/** Accessible label for the backdrop scrim. Defaults to UiStrings `closePanel`. */
|
|
711
|
+
scrimLabel?: string;
|
|
712
|
+
/** Extra class applied to the panel element. */
|
|
713
|
+
className?: string;
|
|
714
|
+
/** aria-label for the dialog when no title is provided. */
|
|
715
|
+
'aria-label'?: string;
|
|
716
|
+
}
|
|
717
|
+
declare const Drawer: React$1.FC<DrawerProps>;
|
|
718
|
+
//#endregion
|
|
719
|
+
//#region packages/ui/UiStrings.d.ts
|
|
720
|
+
/**
|
|
721
|
+
* Built-in UI strings for @nubitio/ui components (aria-labels, tooltips).
|
|
722
|
+
*
|
|
723
|
+
* English is the default. Localize once at the app root:
|
|
724
|
+
*
|
|
725
|
+
* <UiStringsProvider strings={ES_UI_STRINGS}>...</UiStringsProvider>
|
|
726
|
+
*
|
|
727
|
+
* or override per key: `strings={{ close: 'Cerrar' }}`. Individual components
|
|
728
|
+
* also accept label props (e.g. `closeLabel`) that win over the provider.
|
|
729
|
+
*/
|
|
730
|
+
interface UiStrings {
|
|
731
|
+
/** Generic close action (dialog/drawer close buttons). */
|
|
732
|
+
close: string;
|
|
733
|
+
/** Backdrop scrim of a modal dialog. */
|
|
734
|
+
closeDialog: string;
|
|
735
|
+
/** Backdrop scrim of a side drawer. */
|
|
736
|
+
closePanel: string;
|
|
737
|
+
/** DatePicker: clear the selected date. */
|
|
738
|
+
clearDate: string;
|
|
739
|
+
/** DateRangePicker: clear the selected range. */
|
|
740
|
+
clearDateRange: string;
|
|
741
|
+
/** Date pickers: open the calendar popover. */
|
|
742
|
+
openCalendar: string;
|
|
743
|
+
/** DatePicker: label for the date text input. */
|
|
744
|
+
selectDate: string;
|
|
745
|
+
/** DateRangePicker: label for the range text inputs. */
|
|
746
|
+
selectDateRange: string;
|
|
747
|
+
previousMonth: string;
|
|
748
|
+
nextMonth: string;
|
|
749
|
+
previousYear: string;
|
|
750
|
+
nextYear: string;
|
|
751
|
+
/** DatePicker: header button that switches to month/year selection. */
|
|
752
|
+
selectMonthAndYear: string;
|
|
753
|
+
/** DatePicker: header button that switches to year selection. */
|
|
754
|
+
selectYear: string;
|
|
755
|
+
/** Date pickers: footer button that clears the value. */
|
|
756
|
+
clear: string;
|
|
757
|
+
/** Date pickers: footer button that jumps to today. */
|
|
758
|
+
today: string;
|
|
759
|
+
/** Generic cancel action. */
|
|
760
|
+
cancel: string;
|
|
761
|
+
/** Generic confirm action (ConfirmDialog accept button). */
|
|
762
|
+
confirm: string;
|
|
763
|
+
/** DatePicker: footer button returning to the previous view. */
|
|
764
|
+
back: string;
|
|
765
|
+
/** DatePicker years view: previous 12-year range. */
|
|
766
|
+
previousYears: string;
|
|
767
|
+
/** DatePicker years view: next 12-year range. */
|
|
768
|
+
nextYears: string;
|
|
769
|
+
}
|
|
770
|
+
declare const EN_UI_STRINGS: UiStrings;
|
|
771
|
+
declare const ES_UI_STRINGS: UiStrings;
|
|
772
|
+
interface UiStringsProviderProps {
|
|
773
|
+
/** Full or partial string set; missing keys fall back to English. */
|
|
774
|
+
strings: Partial<UiStrings>;
|
|
775
|
+
children: React$1.ReactNode;
|
|
776
|
+
}
|
|
777
|
+
declare const UiStringsProvider: React$1.FC<UiStringsProviderProps>;
|
|
778
|
+
declare const useUiStrings: () => UiStrings;
|
|
779
|
+
//#endregion
|
|
780
|
+
export { ACCENT_PRESETS, type AccentPreset, AppDialog, type AppDialogProps, AppDropdown, type AppDropdownOption, type AppDropdownProps, type AppDropdownVariant, AppToolbar, type AppToolbarProps, Avatar, type AvatarProps, type AvatarShape, type AvatarSize, Badge, type BadgeProps, type BadgeSize, type BadgeVariant, Button, type ButtonProps, type ButtonSize, type ButtonVariant, Card, type CardProps, Chip, type ChipProps, CollapsibleSection, type CollapsibleSectionProps, ConfirmDialog, type ConfirmDialogProps, ContextMenu, type ContextMenuItem, type ContextMenuProps, DatePicker, type DatePickerProps, DateRangePicker, type DateRangePickerProps, type Density, DensityContext, type DensityContextValue, DensityProvider, Drawer, type DrawerProps, type DrawerSide, EN_UI_STRINGS, ES_UI_STRINGS, EmptyState, type EmptyStateProps, FormField, type FormFieldProps, IconButton, type IconButtonProps, Popover, type PopoverAlign, type PopoverProps, SelectField, type SelectFieldProps, SettingsPanel, type SettingsPanelProps, Skeleton, type SkeletonProps, StatCard, type StatCardProps, TextAreaField, type TextAreaFieldProps, TextField, type TextFieldProps, type Theme, ThemeContext, type ThemeContextValue, type ThemeMode, ThemeProvider, type ThemeProviderProps, ThemeSwitcher, type ThemeSwitcherProps, Toggle, type ToggleProps, type UiStrings, UiStringsProvider, type UiStringsProviderProps, type UseFloatingPanelOptions, type UseFloatingPanelResult, getAvatarHue, getAvatarInitials, useAccentColor, useDensity, useFloatingPanel, useTheme, useUiStrings };
|