@nar-bus/lena-ui-shared 1.1.4 → 1.2.1
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 +150 -8
- package/dist/index.js +4648 -4317
- package/dist/index.js.map +1 -1
- package/dist/theme.css +111 -4
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -9,8 +9,10 @@ import { Column } from '@tanstack/react-table';
|
|
|
9
9
|
import { ColumnDef } from '@tanstack/react-table';
|
|
10
10
|
import { Command as Command_2 } from 'cmdk';
|
|
11
11
|
import { Component } from 'react';
|
|
12
|
+
import { ComponentType } from 'react';
|
|
12
13
|
import * as ContextMenuPrimitive from '@radix-ui/react-context-menu';
|
|
13
14
|
import { Control } from 'react-hook-form';
|
|
15
|
+
import { CSSProperties } from 'react';
|
|
14
16
|
import { DayPicker } from 'react-day-picker';
|
|
15
17
|
import * as DialogPrimitive from '@radix-ui/react-dialog';
|
|
16
18
|
import * as DropdownMenuPrimitive from '@radix-ui/react-dropdown-menu';
|
|
@@ -122,7 +124,7 @@ export declare interface ApiResponse<T> {
|
|
|
122
124
|
meta: MetaInfo;
|
|
123
125
|
}
|
|
124
126
|
|
|
125
|
-
export declare function AppHeader({ breadcrumbs, theme, onThemeChange, locale, onLocaleChange, user, isAuthenticated, onLogout, onLogin, homeHref, className, }: AppHeaderProps): JSX.Element;
|
|
127
|
+
export declare function AppHeader({ breadcrumbs, theme, onThemeChange, locale, onLocaleChange, user, isAuthenticated, onLogout, onLogin, homeHref, centerSlot, className, }: AppHeaderProps): JSX.Element;
|
|
126
128
|
|
|
127
129
|
export declare interface AppHeaderProps {
|
|
128
130
|
breadcrumbs: BreadcrumbItem[];
|
|
@@ -135,6 +137,7 @@ export declare interface AppHeaderProps {
|
|
|
135
137
|
onLogout: () => void;
|
|
136
138
|
onLogin?: () => void;
|
|
137
139
|
homeHref?: string;
|
|
140
|
+
centerSlot?: ReactNode;
|
|
138
141
|
className?: string;
|
|
139
142
|
}
|
|
140
143
|
|
|
@@ -154,6 +157,7 @@ export declare interface AppSidebarProps {
|
|
|
154
157
|
title: string;
|
|
155
158
|
subtitle?: string;
|
|
156
159
|
letter?: string;
|
|
160
|
+
imageSrc?: string;
|
|
157
161
|
};
|
|
158
162
|
version?: string;
|
|
159
163
|
}
|
|
@@ -202,7 +206,7 @@ export declare function BadgeCell({ value, variant, className, }: BadgeCellProps
|
|
|
202
206
|
|
|
203
207
|
declare interface BadgeCellProps {
|
|
204
208
|
value: string | number | null | undefined;
|
|
205
|
-
variant?: 'default' | 'accent';
|
|
209
|
+
variant?: 'default' | 'accent' | 'destructive';
|
|
206
210
|
className?: string;
|
|
207
211
|
}
|
|
208
212
|
|
|
@@ -707,7 +711,7 @@ export declare interface CRUDTabContentProps<T extends {
|
|
|
707
711
|
onExternalCreateSheetOpenChange?: (open: boolean) => void;
|
|
708
712
|
}
|
|
709
713
|
|
|
710
|
-
export declare function DataRow({ label, value, mono, suffix, className }: DataRowProps): JSX.Element;
|
|
714
|
+
export declare function DataRow({ label, value, mono, suffix, className, size }: DataRowProps): JSX.Element;
|
|
711
715
|
|
|
712
716
|
export declare interface DataRowProps {
|
|
713
717
|
label: string;
|
|
@@ -715,6 +719,7 @@ export declare interface DataRowProps {
|
|
|
715
719
|
mono?: boolean;
|
|
716
720
|
suffix?: string;
|
|
717
721
|
className?: string;
|
|
722
|
+
size?: 'sm' | 'md';
|
|
718
723
|
}
|
|
719
724
|
|
|
720
725
|
export declare function DataTable<TData>({ columns, getRowId, data, isLoading, error, pagination, onPageChange, onPageSizeChange, onPrefetchPage, pageSizeOptions, sortBy, sortDirection, onSortChange, searchValue, onSearchChange, searchPlaceholder, searchDebounceMs, fieldConfig, filters, onFiltersChange, enableRowSelection, rowSelection, onRowSelectionChange, bulkActions, rowActions, toolbarStart, toolbarEnd, className, emptyIcon, emptyTitle, emptyDescription, onRowClick, onRowHover, rowClassName, meta, headerColor, }: DataTableComponentProps<TData>): JSX.Element;
|
|
@@ -854,6 +859,16 @@ export declare interface DataTableProps<TData> extends DataTableDataProps<TData>
|
|
|
854
859
|
columns: ColumnDef<TData, unknown>[];
|
|
855
860
|
}
|
|
856
861
|
|
|
862
|
+
export declare function DataTableSearch({ value, onChange, placeholder, debounceMs, className, }: DataTableSearchInputProps): JSX.Element;
|
|
863
|
+
|
|
864
|
+
export declare interface DataTableSearchInputProps {
|
|
865
|
+
value: string;
|
|
866
|
+
onChange: (value: string) => void;
|
|
867
|
+
placeholder?: string;
|
|
868
|
+
debounceMs?: number;
|
|
869
|
+
className?: string;
|
|
870
|
+
}
|
|
871
|
+
|
|
857
872
|
/** Search props */
|
|
858
873
|
export declare interface DataTableSearchProps {
|
|
859
874
|
searchValue: string;
|
|
@@ -974,6 +989,18 @@ export declare function dateStringToTimestamp(dateStr: string, endOfDay?: boolea
|
|
|
974
989
|
*/
|
|
975
990
|
export declare const DEFAULT_PAGE_SIZE_OPTIONS: number[];
|
|
976
991
|
|
|
992
|
+
/**
|
|
993
|
+
* Default pagination state — use as initial value when API hasn't responded yet
|
|
994
|
+
*/
|
|
995
|
+
export declare const DEFAULT_PAGINATION: {
|
|
996
|
+
readonly page: 0;
|
|
997
|
+
readonly size: 20;
|
|
998
|
+
readonly totalElements: 0;
|
|
999
|
+
readonly totalPages: 0;
|
|
1000
|
+
readonly hasNext: false;
|
|
1001
|
+
readonly hasPrevious: false;
|
|
1002
|
+
};
|
|
1003
|
+
|
|
977
1004
|
/**
|
|
978
1005
|
* Default values
|
|
979
1006
|
*/
|
|
@@ -1201,6 +1228,44 @@ declare interface FileFieldProps<TFieldValues extends FieldValues> {
|
|
|
1201
1228
|
errorHint?: string;
|
|
1202
1229
|
}
|
|
1203
1230
|
|
|
1231
|
+
export declare function FilterableListLayout({ fieldConfig, filters, onFiltersChange, filterPanelOpen, onFilterPanelToggle, searchValue, onSearchChange, searchPlaceholder, onRefresh, isRefreshing, activeFilterCount, toolbarStart, addButton, filterLabel, refreshLabel, children, className, }: FilterableListLayoutProps): JSX.Element;
|
|
1232
|
+
|
|
1233
|
+
export declare interface FilterableListLayoutProps {
|
|
1234
|
+
/** FieldConfig array for FilterSidePanel + ActiveFiltersBar */
|
|
1235
|
+
fieldConfig: FieldConfig[];
|
|
1236
|
+
/** Current filter state */
|
|
1237
|
+
filters: FilterState[];
|
|
1238
|
+
/** Filter change handler — passed to FilterSidePanel + ActiveFiltersBar */
|
|
1239
|
+
onFiltersChange: (filters: FilterState[]) => void;
|
|
1240
|
+
/** Whether the filter side panel is open */
|
|
1241
|
+
filterPanelOpen: boolean;
|
|
1242
|
+
/** Toggle filter panel */
|
|
1243
|
+
onFilterPanelToggle: () => void;
|
|
1244
|
+
/** Debounced search value */
|
|
1245
|
+
searchValue: string;
|
|
1246
|
+
/** Search change handler */
|
|
1247
|
+
onSearchChange: (value: string) => void;
|
|
1248
|
+
/** Search input placeholder */
|
|
1249
|
+
searchPlaceholder?: string;
|
|
1250
|
+
/** Refresh handler — typically queryClient.invalidateQueries */
|
|
1251
|
+
onRefresh: () => void;
|
|
1252
|
+
/** Shows spinning animation on refresh button */
|
|
1253
|
+
isRefreshing?: boolean;
|
|
1254
|
+
/** Number of active filters — shown as badge on filter button */
|
|
1255
|
+
activeFilterCount?: number;
|
|
1256
|
+
/** Slot: entity label (left side of toolbar) — e.g. ToolbarEntityLabel */
|
|
1257
|
+
toolbarStart?: ReactNode;
|
|
1258
|
+
/** Slot: add/create button (right side of toolbar) */
|
|
1259
|
+
addButton?: ReactNode;
|
|
1260
|
+
/** i18n labels */
|
|
1261
|
+
filterLabel?: string;
|
|
1262
|
+
refreshLabel?: string;
|
|
1263
|
+
/** Main content — typically DataTable */
|
|
1264
|
+
children: ReactNode;
|
|
1265
|
+
/** Additional className for the outer container */
|
|
1266
|
+
className?: string;
|
|
1267
|
+
}
|
|
1268
|
+
|
|
1204
1269
|
export declare function FilterFieldRow({ fieldConfig, filter, onFilterChange }: FilterFieldRowProps): JSX.Element;
|
|
1205
1270
|
|
|
1206
1271
|
export declare interface FilterFieldRowProps {
|
|
@@ -1338,9 +1403,11 @@ declare interface FormSectionProps {
|
|
|
1338
1403
|
icon?: ReactNode;
|
|
1339
1404
|
}
|
|
1340
1405
|
|
|
1341
|
-
export declare function FormSheet({ open, onOpenChange, title, description, children, onSubmit, onCancel, isSubmitting, submitLabel, cancelLabel, side, className, icon, }: FormSheetProps): JSX.Element;
|
|
1406
|
+
export declare function FormSheet({ open, onOpenChange, title, description, children, onSubmit, onCancel, isSubmitting, submitLabel, cancelLabel, side, className, icon, variant, headerGradient, headerIcon: HeaderIcon, }: FormSheetProps): JSX.Element;
|
|
1407
|
+
|
|
1408
|
+
export declare type FormSheetGradient = 'navy' | 'cherry' | 'emerald' | 'amber';
|
|
1342
1409
|
|
|
1343
|
-
declare interface FormSheetProps {
|
|
1410
|
+
export declare interface FormSheetProps {
|
|
1344
1411
|
open: boolean;
|
|
1345
1412
|
onOpenChange: (open: boolean) => void;
|
|
1346
1413
|
title: string;
|
|
@@ -1354,6 +1421,15 @@ declare interface FormSheetProps {
|
|
|
1354
1421
|
side?: 'top' | 'bottom' | 'left' | 'right';
|
|
1355
1422
|
className?: string;
|
|
1356
1423
|
icon?: ReactNode;
|
|
1424
|
+
/** Use 'gradient' for entity-colored header with gradient background */
|
|
1425
|
+
variant?: 'default' | 'gradient';
|
|
1426
|
+
/** Gradient color for variant="gradient" */
|
|
1427
|
+
headerGradient?: FormSheetGradient;
|
|
1428
|
+
/** Icon component for variant="gradient" header */
|
|
1429
|
+
headerIcon?: ComponentType<{
|
|
1430
|
+
className?: string;
|
|
1431
|
+
style?: CSSProperties;
|
|
1432
|
+
}>;
|
|
1357
1433
|
}
|
|
1358
1434
|
|
|
1359
1435
|
/**
|
|
@@ -1389,6 +1465,21 @@ export declare function getStatusColor<T extends string>(value: T | null | undef
|
|
|
1389
1465
|
*/
|
|
1390
1466
|
export declare function getTabDirection(tabIds: string[], fromTab: string | null, toTab: string): -1 | 0 | 1;
|
|
1391
1467
|
|
|
1468
|
+
export declare function HeaderQuickSearch({ placeholder, value, onValueChange, open, onOpenChange, loading, shortcutKey, shouldFilter, className, children, }: HeaderQuickSearchProps): JSX.Element;
|
|
1469
|
+
|
|
1470
|
+
export declare interface HeaderQuickSearchProps {
|
|
1471
|
+
placeholder?: string;
|
|
1472
|
+
value: string;
|
|
1473
|
+
onValueChange: (value: string) => void;
|
|
1474
|
+
open: boolean;
|
|
1475
|
+
onOpenChange: (open: boolean) => void;
|
|
1476
|
+
loading?: boolean;
|
|
1477
|
+
shortcutKey?: string;
|
|
1478
|
+
shouldFilter?: boolean;
|
|
1479
|
+
className?: string;
|
|
1480
|
+
children?: ReactNode;
|
|
1481
|
+
}
|
|
1482
|
+
|
|
1392
1483
|
export declare function HistoryList({ items, className }: HistoryListProps): JSX.Element;
|
|
1393
1484
|
|
|
1394
1485
|
declare interface HistoryListItem {
|
|
@@ -1419,6 +1510,19 @@ declare interface IconTextCellProps {
|
|
|
1419
1510
|
className?: string;
|
|
1420
1511
|
}
|
|
1421
1512
|
|
|
1513
|
+
export declare function IconTooltipButton({ icon: Icon, tooltip, onClick, disabled, variant, size, className, spinning, }: IconTooltipButtonProps): JSX.Element;
|
|
1514
|
+
|
|
1515
|
+
export declare interface IconTooltipButtonProps {
|
|
1516
|
+
icon: LucideIcon;
|
|
1517
|
+
tooltip: string;
|
|
1518
|
+
onClick: () => void;
|
|
1519
|
+
disabled?: boolean;
|
|
1520
|
+
variant?: 'ghost' | 'outline';
|
|
1521
|
+
size?: 'sm' | 'icon';
|
|
1522
|
+
className?: string;
|
|
1523
|
+
spinning?: boolean;
|
|
1524
|
+
}
|
|
1525
|
+
|
|
1422
1526
|
export declare function InfoCard({ icon, label, value, variant, iconColor, className, }: InfoCardProps): JSX.Element;
|
|
1423
1527
|
|
|
1424
1528
|
export declare function InfoCardGrid({ children, columns, className, }: InfoCardGridProps): JSX.Element;
|
|
@@ -1724,13 +1828,14 @@ export declare interface OverviewPanelProps {
|
|
|
1724
1828
|
className?: string;
|
|
1725
1829
|
}
|
|
1726
1830
|
|
|
1727
|
-
export declare function OverviewPanelTopBar({ icon: Icon, segments, actions, className }: OverviewPanelTopBarProps): JSX.Element;
|
|
1831
|
+
export declare function OverviewPanelTopBar({ icon: Icon, segments, actions, className, variant }: OverviewPanelTopBarProps): JSX.Element;
|
|
1728
1832
|
|
|
1729
1833
|
export declare interface OverviewPanelTopBarProps {
|
|
1730
1834
|
icon: LucideIcon;
|
|
1731
1835
|
segments: string[];
|
|
1732
1836
|
actions?: ReactNode;
|
|
1733
1837
|
className?: string;
|
|
1838
|
+
variant?: 'default' | 'navy' | 'cherry' | 'emerald' | 'amber';
|
|
1734
1839
|
}
|
|
1735
1840
|
|
|
1736
1841
|
export declare interface PagedResponse<T> {
|
|
@@ -2154,9 +2259,10 @@ export declare function Sheet({ ...props }: React_2.ComponentProps<typeof Dialog
|
|
|
2154
2259
|
|
|
2155
2260
|
export declare function SheetClose({ ...props }: React_2.ComponentProps<typeof DialogPrimitive.Close>): JSX.Element;
|
|
2156
2261
|
|
|
2157
|
-
export declare function SheetContent({ className, children, side, showCloseButton, ...props }: React_2.ComponentProps<typeof DialogPrimitive.Content> & {
|
|
2262
|
+
export declare function SheetContent({ className, children, side, showCloseButton, showOverlay, ...props }: React_2.ComponentProps<typeof DialogPrimitive.Content> & {
|
|
2158
2263
|
side?: "top" | "right" | "bottom" | "left";
|
|
2159
2264
|
showCloseButton?: boolean;
|
|
2265
|
+
showOverlay?: boolean;
|
|
2160
2266
|
}): JSX.Element;
|
|
2161
2267
|
|
|
2162
2268
|
export declare function SheetDescription({ className, ...props }: React_2.ComponentProps<typeof DialogPrimitive.Description>): JSX.Element;
|
|
@@ -2592,6 +2698,16 @@ export declare const toggleVariants: (props?: ({
|
|
|
2592
2698
|
size?: "default" | "sm" | "lg" | null | undefined;
|
|
2593
2699
|
} & ClassProp) | undefined) => string;
|
|
2594
2700
|
|
|
2701
|
+
export declare function ToolbarEntityLabel({ icon: Icon, entityName, totalElements, countLabel, className, }: ToolbarEntityLabelProps): JSX.Element;
|
|
2702
|
+
|
|
2703
|
+
export declare interface ToolbarEntityLabelProps {
|
|
2704
|
+
icon: LucideIcon;
|
|
2705
|
+
entityName: string;
|
|
2706
|
+
totalElements: number;
|
|
2707
|
+
countLabel?: string;
|
|
2708
|
+
className?: string;
|
|
2709
|
+
}
|
|
2710
|
+
|
|
2595
2711
|
export declare function Tooltip({ ...props }: React_2.ComponentProps<typeof TooltipPrimitive.Root>): JSX.Element;
|
|
2596
2712
|
|
|
2597
2713
|
export declare function TooltipContent({ className, sideOffset, children, ...props }: React_2.ComponentProps<typeof TooltipPrimitive.Content>): JSX.Element;
|
|
@@ -2625,6 +2741,17 @@ declare interface TreeNodeOperation {
|
|
|
2625
2741
|
|
|
2626
2742
|
export declare const trLabels: LenaUILabels;
|
|
2627
2743
|
|
|
2744
|
+
export declare function UnderConstructionPage({ title, description, goBackLabel, homeLabel, onGoBack, onGoHome, }: UnderConstructionPageProps): JSX.Element;
|
|
2745
|
+
|
|
2746
|
+
export declare interface UnderConstructionPageProps {
|
|
2747
|
+
title?: string;
|
|
2748
|
+
description?: string;
|
|
2749
|
+
goBackLabel?: string;
|
|
2750
|
+
homeLabel?: string;
|
|
2751
|
+
onGoBack?: () => void;
|
|
2752
|
+
onGoHome?: () => void;
|
|
2753
|
+
}
|
|
2754
|
+
|
|
2628
2755
|
/**
|
|
2629
2756
|
* UnifiedTabs - Single tab component for both list and detail pages
|
|
2630
2757
|
*/
|
|
@@ -2691,7 +2818,7 @@ declare interface UseDataTableOptions<TData> extends CreateDataTableStoreOptions
|
|
|
2691
2818
|
data?: TData[];
|
|
2692
2819
|
}
|
|
2693
2820
|
|
|
2694
|
-
declare interface UseDataTableReturn<TData> {
|
|
2821
|
+
export declare interface UseDataTableReturn<TData> {
|
|
2695
2822
|
/** Search request ready for API call (100% backend compatible) */
|
|
2696
2823
|
searchRequest: SearchRequest;
|
|
2697
2824
|
/** Pagination props to spread to DataTable */
|
|
@@ -2742,6 +2869,21 @@ declare interface UseDataTableUrlOptions {
|
|
|
2742
2869
|
debounceMs?: number;
|
|
2743
2870
|
}
|
|
2744
2871
|
|
|
2872
|
+
/**
|
|
2873
|
+
* Debounces a value by the specified delay.
|
|
2874
|
+
* Returns the debounced value that only updates after `delay` ms of inactivity.
|
|
2875
|
+
*/
|
|
2876
|
+
export declare function useDebounce<T>(value: T, delay?: number): T;
|
|
2877
|
+
|
|
2878
|
+
export declare function useDoubleClickHandler<T>({ getRowId, onSingleClick, onDoubleClick, delay, }: UseDoubleClickHandlerOptions<T>): (row: T) => void;
|
|
2879
|
+
|
|
2880
|
+
export declare interface UseDoubleClickHandlerOptions<T> {
|
|
2881
|
+
getRowId: (row: T) => string | number;
|
|
2882
|
+
onSingleClick: (row: T) => void;
|
|
2883
|
+
onDoubleClick: (row: T) => void;
|
|
2884
|
+
delay?: number;
|
|
2885
|
+
}
|
|
2886
|
+
|
|
2745
2887
|
export declare function useJsonTree({ value, onChange }: UseJsonTreeOptions): UseJsonTreeReturn;
|
|
2746
2888
|
|
|
2747
2889
|
declare interface UseJsonTreeOptions {
|