@nar-bus/lena-ui-shared 1.3.6 → 1.3.8

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 CHANGED
@@ -26,6 +26,7 @@ import { default as L_2 } from 'leaflet';
26
26
  import * as LabelPrimitive from '@radix-ui/react-label';
27
27
  import { Layer } from 'leaflet';
28
28
  import { LeafletMouseEvent } from 'leaflet';
29
+ import { Locale } from 'date-fns';
29
30
  import { LucideIcon } from 'lucide-react';
30
31
  import { MultiPolygon } from 'geojson';
31
32
  import { NamedExoticComponent } from 'react';
@@ -208,7 +209,7 @@ export declare interface AreaSeriesConfig {
208
209
  /** Stroke dash pattern (e.g. "6 3") */
209
210
  strokeDasharray?: string;
210
211
  /** Curve interpolation type (default: "monotone") */
211
- type?: 'monotone' | 'linear' | 'basis' | 'natural' | 'step';
212
+ type?: BaseCurveType;
212
213
  }
213
214
 
214
215
  /**
@@ -283,6 +284,9 @@ export declare interface BarSeriesConfig {
283
284
  maxBarSize?: number;
284
285
  }
285
286
 
287
+ /** Shared curve interpolation types supported by Recharts */
288
+ declare type BaseCurveType = 'monotone' | 'linear' | 'basis' | 'natural' | 'step';
289
+
286
290
  /**
287
291
  * Boolean cell for displaying true/false values.
288
292
  * Shows check/X icons with consistent styling.
@@ -1079,9 +1083,6 @@ declare type DateInput = number | string | Date | null | undefined;
1079
1083
 
1080
1084
  declare type DateInput_2 = number | string | Date | null | undefined;
1081
1085
 
1082
- /**
1083
- * Shared date formatting utilities for detail pages and table cells
1084
- */
1085
1086
  declare type DateInput_3 = number | string | Date | null | undefined;
1086
1087
 
1087
1088
  export declare function DateRangeField<TFieldValues extends FieldValues>({ name, control, label, description, required, placeholder, minDate, maxDate, dateFormat, disabled, className, cols, clearable, errorHint, }: DateRangeFieldProps<TFieldValues>): JSX.Element;
@@ -1380,7 +1381,7 @@ declare interface FileFieldProps<TFieldValues extends FieldValues> {
1380
1381
 
1381
1382
  export declare const FILTER_CONTAINER_CLASSES = "flex flex-wrap items-center gap-2";
1382
1383
 
1383
- export declare function FilterableListLayout({ fieldConfig, filters, onFiltersChange, filterPanelOpen, onFilterPanelToggle, searchValue, onSearchChange, searchPlaceholder, onRefresh, isRefreshing, activeFilterCount, toolbarStart, addButton, filterLabel, refreshLabel, children, className, }: FilterableListLayoutProps): JSX.Element;
1384
+ export declare function FilterableListLayout({ fieldConfig, filters, onFiltersChange, filterPanelOpen, onFilterPanelToggle, searchValue, onSearchChange, searchPlaceholder, onRefresh, isRefreshing, activeFilterCount, toolbarStart, addButton, filterLabel, refreshLabel, children, className, gradient, }: FilterableListLayoutProps): JSX.Element;
1384
1385
 
1385
1386
  export declare interface FilterableListLayoutProps {
1386
1387
  /** FieldConfig array for FilterSidePanel + ActiveFiltersBar */
@@ -1416,6 +1417,8 @@ export declare interface FilterableListLayoutProps {
1416
1417
  children: ReactNode;
1417
1418
  /** Additional className for the outer container */
1418
1419
  className?: string;
1420
+ /** Gradient theme for the filter panel header — matches LenaPanel gradient presets */
1421
+ gradient?: HeaderGradient;
1419
1422
  }
1420
1423
 
1421
1424
  export declare function FilterFieldRow({ fieldConfig, filter, onFilterChange }: FilterFieldRowProps): JSX.Element;
@@ -1438,12 +1441,16 @@ export declare interface FilterPanelLabels {
1438
1441
  empty: string;
1439
1442
  notEmpty: string;
1440
1443
  select: string;
1444
+ datePlaceholder: string;
1445
+ multiSelectPlaceholder: string;
1446
+ minPlaceholder: string;
1447
+ maxPlaceholder: string;
1441
1448
  yes: string;
1442
1449
  no: string;
1443
1450
  operators: Record<string, string>;
1444
1451
  }
1445
1452
 
1446
- export declare function FilterSidePanel({ open, onClose, fieldConfig, filters, onFiltersChange, }: FilterSidePanelProps): JSX.Element;
1453
+ export declare function FilterSidePanel({ open, onClose, fieldConfig, filters, onFiltersChange, gradient, }: FilterSidePanelProps): JSX.Element;
1447
1454
 
1448
1455
  export declare interface FilterSidePanelProps {
1449
1456
  open: boolean;
@@ -1451,6 +1458,8 @@ export declare interface FilterSidePanelProps {
1451
1458
  fieldConfig: FieldConfig[];
1452
1459
  filters: FilterState[];
1453
1460
  onFiltersChange: (filters: FilterState[]) => void;
1461
+ /** Gradient theme for the panel header — matches LenaPanel gradient presets */
1462
+ gradient?: HeaderGradient;
1454
1463
  }
1455
1464
 
1456
1465
  export declare interface FilterState {
@@ -1473,17 +1482,17 @@ declare function Footer({ children, className }: LenaPanelFooterProps): JSX.Elem
1473
1482
  /**
1474
1483
  * Format backend timestamp to short datetime (e.g., "27 Oca 00:44")
1475
1484
  */
1476
- export declare function formatBackendTimestamp(timestamp: number | string | null | undefined): string;
1485
+ export declare function formatBackendTimestamp(timestamp: number | string | null | undefined, locale?: Locale): string;
1477
1486
 
1478
1487
  /**
1479
1488
  * Format a timestamp to a short date string (e.g., "Jan 1, 2024")
1480
1489
  */
1481
- export declare function formatDate(timestamp: DateInput_3): string;
1490
+ export declare function formatDate(timestamp: DateInput_3, locale?: Locale): string;
1482
1491
 
1483
1492
  /**
1484
1493
  * Format a timestamp to date with time (e.g., "Jan 1, 2024 14:30")
1485
1494
  */
1486
- export declare function formatDateTime(timestamp: DateInput_3): string;
1495
+ export declare function formatDateTime(timestamp: DateInput_3, locale?: Locale): string;
1487
1496
 
1488
1497
  /**
1489
1498
  * Format a timestamp to compact date with time (e.g., "27.03.26 15:30")
@@ -1498,7 +1507,7 @@ export declare function formatDateTimeCompactFull(timestamp: DateInput_3): strin
1498
1507
  /**
1499
1508
  * Format a timestamp to full date with seconds (e.g., "Jan 1, 2024 14:30:45")
1500
1509
  */
1501
- export declare function formatDateTimeFull(timestamp: DateInput_3): string;
1510
+ export declare function formatDateTimeFull(timestamp: DateInput_3, locale?: Locale): string;
1502
1511
 
1503
1512
  /**
1504
1513
  * Format a timestamp to ISO string (e.g., "2024-01-01T14:30:00Z")
@@ -1508,7 +1517,7 @@ export declare function formatISODate(timestamp: DateInput_3): string;
1508
1517
  /**
1509
1518
  * Format a timestamp to relative time (e.g., "2 hours ago")
1510
1519
  */
1511
- export declare function formatRelativeTime(timestamp: DateInput_3, locale?: 'en' | 'tr'): string;
1520
+ export declare function formatRelativeTime(timestamp: DateInput_3, locale?: Locale): string;
1512
1521
 
1513
1522
  /**
1514
1523
  * Format a timestamp to a short time string (e.g., "14:30")
@@ -1570,7 +1579,7 @@ declare interface FormSectionProps {
1570
1579
 
1571
1580
  export declare function FormSheet({ open, onOpenChange, title, description, children, onSubmit, onCancel, isSubmitting, submitLabel, cancelLabel, side, className, icon, variant, headerGradient, headerIcon: HeaderIcon, }: FormSheetProps): JSX.Element;
1572
1581
 
1573
- export declare type FormSheetGradient = 'navy' | 'cherry' | 'emerald' | 'amber';
1582
+ export declare type FormSheetGradient = 'navy' | 'cherry' | 'emerald' | 'amber' | 'teal' | 'violet' | 'rose' | 'indigo' | 'orange';
1574
1583
 
1575
1584
  export declare interface FormSheetProps {
1576
1585
  open: boolean;
@@ -1635,7 +1644,7 @@ export declare type GradientPair = [topColor: string, bottomColor: string];
1635
1644
 
1636
1645
  declare function Header({ children, icon: Icon, iconClassName, subtitle, actions, gradient, className, }: LenaPanelHeaderProps): JSX.Element;
1637
1646
 
1638
- export declare type HeaderGradient = 'teal' | 'navy' | 'cherry' | 'emerald' | 'amber' | 'violet';
1647
+ export declare type HeaderGradient = 'teal' | 'navy' | 'cherry' | 'emerald' | 'amber' | 'violet' | 'rose' | 'indigo' | 'orange';
1639
1648
 
1640
1649
  export declare function HeaderQuickSearch({ placeholder, value, onValueChange, open, onOpenChange, loading, shortcutKey, shouldFilter, className, children, }: HeaderQuickSearchProps): JSX.Element;
1641
1650
 
@@ -1938,6 +1947,20 @@ export declare interface LenaChoroplethMapProps {
1938
1947
  className?: string;
1939
1948
  }
1940
1949
 
1950
+ export declare function LenaComposedChart<T extends object>({ data, barSeries, lineSeries, xAxisDataKey, height, showLegend, yAxisWidth, yAxisTickFormatter, tooltipItemColor, margin, barCategoryGap, barGap, className, }: LenaComposedChartProps<T>): JSX.Element;
1951
+
1952
+ /** Props for LenaComposedChart (bar + line overlay) */
1953
+ export declare interface LenaComposedChartProps<T extends object> extends LenaChartBaseProps<T> {
1954
+ /** Bar series configurations */
1955
+ barSeries: BarSeriesConfig[];
1956
+ /** Line series configurations (rendered on top of bars) */
1957
+ lineSeries: LineSeriesConfig[];
1958
+ /** Gap between bar categories (default: "20%") */
1959
+ barCategoryGap?: string;
1960
+ /** Gap between bars in same category */
1961
+ barGap?: number;
1962
+ }
1963
+
1941
1964
  export declare const LenaPanel: typeof _LenaPanel & {
1942
1965
  Header: typeof Header;
1943
1966
  Content: typeof Content;
@@ -2016,6 +2039,33 @@ export declare interface LenaUIProviderProps {
2016
2039
  children: ReactNode;
2017
2040
  }
2018
2041
 
2042
+ /** Extended curve types (Line supports additional step variants) */
2043
+ declare type LineCurveType = BaseCurveType | 'stepAfter' | 'stepBefore';
2044
+
2045
+ /** Configuration for a single line series (used in ComposedChart) */
2046
+ export declare interface LineSeriesConfig {
2047
+ /** Data key matching a field in the data array */
2048
+ dataKey: string;
2049
+ /** Display name (shown in tooltip/legend) */
2050
+ name: string;
2051
+ /** Stroke color */
2052
+ color: string;
2053
+ /** Stroke width (default: 2) */
2054
+ strokeWidth?: number;
2055
+ /** Stroke dash pattern (e.g. "6 3") */
2056
+ strokeDasharray?: string;
2057
+ /** Curve interpolation type (default: "monotone") */
2058
+ type?: LineCurveType;
2059
+ /** Custom active dot config */
2060
+ activeDot?: {
2061
+ r: number;
2062
+ strokeWidth: number;
2063
+ fill: string;
2064
+ };
2065
+ /** Whether to show in legend (default: true) */
2066
+ showInLegend?: boolean;
2067
+ }
2068
+
2019
2069
  /**
2020
2070
  * Link cell for navigable table values.
2021
2071
  * Shows external link icon on hover and supports different hover colors.
@@ -2903,6 +2953,8 @@ export declare interface TabConfig {
2903
2953
  description?: string;
2904
2954
  /** Per-tab mount strategy override (only used when lazyMount is enabled) */
2905
2955
  mountStrategy?: MountStrategy;
2956
+ /** Per-tab accent color override — gradient name (e.g. 'teal', 'indigo', 'orange') */
2957
+ accentColor?: string;
2906
2958
  }
2907
2959
 
2908
2960
  export declare function Table({ className, ...props }: React_2.ComponentProps<"table">): JSX.Element;
@@ -2911,7 +2963,7 @@ export declare const TABLE_CELL_CLASSES = "px-2.5 py-1.5 text-xs";
2911
2963
 
2912
2964
  export declare const TABLE_CONTAINER_CLASSES = "isolate rounded-lg border border-border/80 bg-card overflow-clip shadow-sm";
2913
2965
 
2914
- export declare const TABLE_HEADER_CLASSES = "px-2 py-0.5 text-xs font-semibold uppercase tracking-wider transition-colors";
2966
+ export declare const TABLE_HEADER_CLASSES = "px-2 py-0.5 text-xs font-semibold tracking-wider transition-colors";
2915
2967
 
2916
2968
  export declare const TABLE_HEADER_ROW_CLASSES = "hover:bg-transparent border-b border-border/80";
2917
2969
 
@@ -3085,7 +3137,7 @@ export declare interface ToolbarEntityLabelProps {
3085
3137
  }
3086
3138
 
3087
3139
  /** Available toolbar color variants */
3088
- declare type ToolbarVariant = 'dark' | 'cherry' | 'emerald' | 'amber';
3140
+ declare type ToolbarVariant = 'dark' | 'navy' | 'cherry' | 'emerald' | 'amber' | 'teal' | 'violet' | 'rose' | 'indigo' | 'orange';
3089
3141
 
3090
3142
  export declare function Tooltip({ ...props }: React_2.ComponentProps<typeof TooltipPrimitive.Root>): JSX.Element;
3091
3143
 
@@ -3532,6 +3584,13 @@ export declare interface ValidationStatusProps {
3532
3584
  showDetails?: boolean;
3533
3585
  }
3534
3586
 
3587
+ /**
3588
+ * Adds monthly average fields to chart data.
3589
+ * Date format: "dd/MM" — groups by month part, calculates average per key.
3590
+ * Each data point receives a `{key}_avg` field with its month's average.
3591
+ */
3592
+ export declare function withMonthlyAvg<T extends Record<string, unknown>>(data: T[], dateKey: string, valueKeys: string[]): (T & Record<string, number>)[];
3593
+
3535
3594
  export { }
3536
3595
 
3537
3596