@gaulatti/bleecker 0.1.30 → 0.1.31

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.
Files changed (86) hide show
  1. package/dist/components/area-chart.d.ts +13 -0
  2. package/dist/components/area-chart.js +9 -0
  3. package/dist/components/bar-chart.d.ts +13 -0
  4. package/dist/components/bar-chart.js +6 -0
  5. package/dist/components/button.d.ts +3 -1
  6. package/dist/components/button.js +6 -2
  7. package/dist/components/chart-theme.d.ts +46 -0
  8. package/dist/components/chart-theme.js +56 -0
  9. package/dist/components/chart.js +3 -10
  10. package/dist/components/dashboard-grid.d.ts +13 -0
  11. package/dist/components/dashboard-grid.js +8 -0
  12. package/dist/components/dashboard-section.d.ts +10 -0
  13. package/dist/components/dashboard-section.js +5 -0
  14. package/dist/components/data-list.d.ts +13 -0
  15. package/dist/components/data-list.js +5 -0
  16. package/dist/components/data-table-column-toggle.d.ts +7 -0
  17. package/dist/components/data-table-column-toggle.js +27 -0
  18. package/dist/components/data-table-filters.d.ts +22 -0
  19. package/dist/components/data-table-filters.js +11 -0
  20. package/dist/components/data-table-pagination.d.ts +7 -0
  21. package/dist/components/data-table-pagination.js +11 -0
  22. package/dist/components/data-table-toolbar.d.ts +11 -0
  23. package/dist/components/data-table-toolbar.js +9 -0
  24. package/dist/components/date-range-picker.d.ts +15 -0
  25. package/dist/components/date-range-picker.js +17 -0
  26. package/dist/components/donut-chart.d.ts +9 -0
  27. package/dist/components/donut-chart.js +5 -0
  28. package/dist/components/dropdown-menu.d.ts +27 -0
  29. package/dist/components/dropdown-menu.js +32 -0
  30. package/dist/components/error-state.d.ts +10 -0
  31. package/dist/components/error-state.js +7 -0
  32. package/dist/components/filter-chip.d.ts +13 -0
  33. package/dist/components/filter-chip.js +11 -0
  34. package/dist/components/funnel-chart.d.ts +12 -0
  35. package/dist/components/funnel-chart.js +10 -0
  36. package/dist/components/line-chart.d.ts +12 -0
  37. package/dist/components/line-chart.js +6 -0
  38. package/dist/components/loading-overlay.d.ts +8 -0
  39. package/dist/components/loading-overlay.js +9 -0
  40. package/dist/components/metric.d.ts +13 -0
  41. package/dist/components/metric.js +21 -0
  42. package/dist/components/notification-badge.d.ts +15 -0
  43. package/dist/components/notification-badge.js +9 -0
  44. package/dist/components/page-header.d.ts +11 -0
  45. package/dist/components/page-header.js +8 -0
  46. package/dist/components/pie-chart.d.ts +14 -0
  47. package/dist/components/pie-chart.js +6 -0
  48. package/dist/components/progress-stack.d.ts +14 -0
  49. package/dist/components/progress-stack.js +9 -0
  50. package/dist/components/radar-chart.d.ts +15 -0
  51. package/dist/components/radar-chart.js +9 -0
  52. package/dist/components/radial-bar-chart.d.ts +15 -0
  53. package/dist/components/radial-bar-chart.js +10 -0
  54. package/dist/components/sankey-chart.d.ts +29 -0
  55. package/dist/components/sankey-chart.js +26 -0
  56. package/dist/components/scatter-chart.d.ts +19 -0
  57. package/dist/components/scatter-chart.js +6 -0
  58. package/dist/components/search-input.d.ts +6 -0
  59. package/dist/components/search-input.js +9 -0
  60. package/dist/components/sidebar.d.ts +28 -0
  61. package/dist/components/sidebar.js +26 -0
  62. package/dist/components/skeleton.d.ts +18 -0
  63. package/dist/components/skeleton.js +11 -0
  64. package/dist/components/sortable-table-header.d.ts +14 -0
  65. package/dist/components/sortable-table-header.js +11 -0
  66. package/dist/components/sparkline.d.ts +9 -0
  67. package/dist/components/sparkline.js +7 -0
  68. package/dist/components/stat-card.d.ts +19 -0
  69. package/dist/components/stat-card.js +19 -0
  70. package/dist/components/stepper.d.ts +16 -0
  71. package/dist/components/stepper.js +33 -0
  72. package/dist/components/sunburst-chart.d.ts +14 -0
  73. package/dist/components/sunburst-chart.js +35 -0
  74. package/dist/components/timeline.d.ts +15 -0
  75. package/dist/components/timeline.js +15 -0
  76. package/dist/index.d.ts +38 -0
  77. package/dist/index.js +38 -0
  78. package/dist/layout/admin-shell.d.ts +10 -0
  79. package/dist/layout/admin-shell.js +5 -0
  80. package/dist/styles.css +1 -1
  81. package/dist/utils/format.d.ts +15 -0
  82. package/dist/utils/format.js +63 -0
  83. package/dist/utils/hooks.d.ts +22 -0
  84. package/dist/utils/hooks.js +58 -0
  85. package/package.json +5 -3
  86. package/src/styles/global.css +153 -0
@@ -0,0 +1,13 @@
1
+ import { type ChartSeries } from './chart-theme';
2
+ export interface AreaChartProps {
3
+ data: Record<string, unknown>[];
4
+ height?: number;
5
+ series: ChartSeries[];
6
+ xAxisKey: string;
7
+ showGrid?: boolean;
8
+ showLegend?: boolean;
9
+ yAxisTickFormatter?: (value: number) => string;
10
+ tooltipFormatter?: (value: number) => string;
11
+ stacked?: boolean;
12
+ }
13
+ export declare function AreaChart({ data, height, series, xAxisKey, showGrid, showLegend, yAxisTickFormatter, tooltipFormatter, stacked }: AreaChartProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,9 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { Area, AreaChart as RechartsAreaChart, CartesianGrid, Legend, ResponsiveContainer, Tooltip, XAxis, YAxis } from 'recharts';
3
+ import { chartTheme } from './chart-theme.js';
4
+ export function AreaChart({ data, height = 300, series, xAxisKey, showGrid = true, showLegend = true, yAxisTickFormatter, tooltipFormatter, stacked = false }) {
5
+ return (_jsx("div", { className: 'w-full', style: { height }, children: _jsx(ResponsiveContainer, { width: '100%', height: '100%', children: _jsxs(RechartsAreaChart, { data: data, margin: { top: 10, right: 20, bottom: 5, left: 0 }, children: [showGrid && _jsx(CartesianGrid, { stroke: chartTheme.grid.stroke, strokeDasharray: chartTheme.grid.strokeDasharray, vertical: false }), _jsx(XAxis, { dataKey: xAxisKey, stroke: chartTheme.axis.stroke, tick: chartTheme.axis.tick, tickLine: false, axisLine: false }), _jsx(YAxis, { stroke: chartTheme.axis.stroke, tick: chartTheme.axis.tick, tickLine: false, axisLine: false, tickFormatter: yAxisTickFormatter }), _jsx(Tooltip, { ...chartTheme.tooltip, formatter: (value) => [tooltipFormatter && typeof value === 'number' ? tooltipFormatter(value) : value ?? '', ''] }), showLegend && _jsx(Legend, { wrapperStyle: { paddingTop: '1rem' } }), series.map((s, i) => {
6
+ const color = s.color ?? chartTheme.palette[i % chartTheme.palette.length];
7
+ return (_jsx(Area, { type: 'monotone', dataKey: s.key, name: s.name, stroke: color, fill: color, fillOpacity: 0.2, strokeWidth: 2, stackId: stacked ? 'total' : undefined }, s.key));
8
+ })] }) }) }));
9
+ }
@@ -0,0 +1,13 @@
1
+ import { type ChartSeries } from './chart-theme';
2
+ export interface BarChartProps {
3
+ data: Record<string, unknown>[];
4
+ height?: number;
5
+ series: ChartSeries[];
6
+ xAxisKey: string;
7
+ showGrid?: boolean;
8
+ showLegend?: boolean;
9
+ yAxisTickFormatter?: (value: number) => string;
10
+ tooltipFormatter?: (value: number) => string;
11
+ layout?: 'horizontal' | 'vertical';
12
+ }
13
+ export declare function BarChart({ data, height, series, xAxisKey, showGrid, showLegend, yAxisTickFormatter, tooltipFormatter, layout }: BarChartProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,6 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { Bar, BarChart as RechartsBarChart, CartesianGrid, Legend, ResponsiveContainer, Tooltip, XAxis, YAxis } from 'recharts';
3
+ import { chartTheme } from './chart-theme.js';
4
+ export function BarChart({ data, height = 300, series, xAxisKey, showGrid = true, showLegend = true, yAxisTickFormatter, tooltipFormatter, layout = 'horizontal' }) {
5
+ return (_jsx("div", { className: 'w-full', style: { height }, children: _jsx(ResponsiveContainer, { width: '100%', height: '100%', children: _jsxs(RechartsBarChart, { data: data, layout: layout, margin: { top: 10, right: 20, bottom: 5, left: 0 }, children: [showGrid && _jsx(CartesianGrid, { stroke: chartTheme.grid.stroke, strokeDasharray: chartTheme.grid.strokeDasharray }), _jsx(XAxis, { type: layout === 'horizontal' ? 'category' : 'number', dataKey: layout === 'horizontal' ? xAxisKey : undefined, stroke: chartTheme.axis.stroke, tick: chartTheme.axis.tick, tickLine: false, axisLine: false }), _jsx(YAxis, { type: layout === 'horizontal' ? 'number' : 'category', dataKey: layout === 'vertical' ? xAxisKey : undefined, stroke: chartTheme.axis.stroke, tick: chartTheme.axis.tick, tickLine: false, axisLine: false, tickFormatter: yAxisTickFormatter }), _jsx(Tooltip, { ...chartTheme.tooltip, formatter: (value) => [tooltipFormatter && typeof value === 'number' ? tooltipFormatter(value) : value ?? '', ''], cursor: { fill: 'var(--color-muted)' } }), showLegend && _jsx(Legend, { wrapperStyle: { paddingTop: '1rem' } }), series.map((s, i) => (_jsx(Bar, { dataKey: s.key, name: s.name, fill: s.color ?? chartTheme.palette[i % chartTheme.palette.length], radius: [4, 4, 0, 0] }, s.key)))] }) }) }));
6
+ }
@@ -4,5 +4,7 @@ export type ButtonSize = 'sm' | 'md' | 'lg';
4
4
  export interface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {
5
5
  variant?: ButtonVariant;
6
6
  size?: ButtonSize;
7
+ as?: 'button' | 'a';
8
+ href?: string;
7
9
  }
8
- export declare const Button: React.ForwardRefExoticComponent<ButtonProps & React.RefAttributes<HTMLButtonElement>>;
10
+ export declare const Button: React.ForwardRefExoticComponent<ButtonProps & React.RefAttributes<HTMLAnchorElement | HTMLButtonElement>>;
@@ -12,6 +12,10 @@ const sizeClasses = {
12
12
  md: 'px-4 py-2 text-sm',
13
13
  lg: 'px-6 py-2.5 text-base'
14
14
  };
15
- export const Button = React.forwardRef(function Button({ className, size = 'md', type = 'button', variant = 'primary', ...props }, ref) {
16
- return (_jsx("button", { ref: ref, type: type, className: cn('inline-flex items-center justify-center gap-2 rounded-[var(--radius-button)] border font-[family-name:var(--font-header)] font-medium tracking-ui transition-all duration-200 active:scale-[0.98] outline-none focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:ring-offset-white focus-visible:ring-sea disabled:pointer-events-none disabled:opacity-50 dark:focus-visible:ring-offset-deep-sea dark:focus-visible:ring-accent-blue', variantClasses[variant], sizeClasses[size], className), ...props }));
15
+ export const Button = React.forwardRef(function Button({ className, size = 'md', type = 'button', variant = 'primary', as = 'button', href, ...props }, ref) {
16
+ const classes = cn('inline-flex items-center justify-center gap-2 rounded-[var(--radius-button)] border font-[family-name:var(--font-header)] font-medium tracking-ui transition-all duration-200 active:scale-[0.98] outline-none focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:ring-offset-white focus-visible:ring-sea disabled:pointer-events-none disabled:opacity-50 dark:focus-visible:ring-offset-deep-sea dark:focus-visible:ring-accent-blue', variantClasses[variant], sizeClasses[size], className);
17
+ if (as === 'a' || href) {
18
+ return (_jsx("a", { ref: ref, href: href, className: classes, ...props }));
19
+ }
20
+ return (_jsx("button", { ref: ref, type: type, className: classes, ...props }));
17
21
  });
@@ -0,0 +1,46 @@
1
+ import * as React from 'react';
2
+ /**
3
+ * Shared theming helpers for Recharts-based dashboard charts.
4
+ *
5
+ * Components in this library use CSS custom properties so charts automatically
6
+ * adapt to the active Bleecker theme (light / dark / custom brand overrides).
7
+ */
8
+ export declare const chartTheme: {
9
+ colors: {
10
+ sea: string;
11
+ desert: string;
12
+ terracotta: string;
13
+ sunset: string;
14
+ dusk: string;
15
+ accentGold: string;
16
+ accentBlue: string;
17
+ textPrimary: string;
18
+ textSecondary: string;
19
+ background: string;
20
+ card: string;
21
+ border: string;
22
+ };
23
+ palette: string[];
24
+ grid: {
25
+ stroke: string;
26
+ strokeDasharray: string;
27
+ };
28
+ axis: {
29
+ stroke: string;
30
+ tick: {
31
+ fill: string;
32
+ fontSize: number;
33
+ };
34
+ };
35
+ tooltip: {
36
+ contentStyle: React.CSSProperties;
37
+ itemStyle: React.CSSProperties;
38
+ labelStyle: React.CSSProperties;
39
+ };
40
+ };
41
+ export declare function pickColor(index: number): string;
42
+ export interface ChartSeries {
43
+ key: string;
44
+ name: string;
45
+ color?: string;
46
+ }
@@ -0,0 +1,56 @@
1
+ /**
2
+ * Shared theming helpers for Recharts-based dashboard charts.
3
+ *
4
+ * Components in this library use CSS custom properties so charts automatically
5
+ * adapt to the active Bleecker theme (light / dark / custom brand overrides).
6
+ */
7
+ export const chartTheme = {
8
+ colors: {
9
+ sea: 'var(--color-sea)',
10
+ desert: 'var(--color-desert)',
11
+ terracotta: 'var(--color-terracotta)',
12
+ sunset: 'var(--color-sunset)',
13
+ dusk: 'var(--color-dusk)',
14
+ accentGold: 'var(--color-accent-gold)',
15
+ accentBlue: 'var(--color-accent-blue)',
16
+ textPrimary: 'var(--color-text-primary)',
17
+ textSecondary: 'var(--color-text-secondary)',
18
+ background: 'var(--color-background)',
19
+ card: 'var(--color-card)',
20
+ border: 'var(--color-border)'
21
+ },
22
+ palette: [
23
+ 'var(--color-sea)',
24
+ 'var(--color-desert)',
25
+ 'var(--color-terracotta)',
26
+ 'var(--color-sunset)',
27
+ 'var(--color-dusk)',
28
+ 'var(--color-accent-gold)',
29
+ 'var(--color-accent-blue)',
30
+ 'var(--color-accent-oxblood)',
31
+ 'var(--color-accent-bronze)',
32
+ 'var(--color-accent-yellow)'
33
+ ],
34
+ grid: {
35
+ stroke: 'var(--color-border)',
36
+ strokeDasharray: '3 3'
37
+ },
38
+ axis: {
39
+ stroke: 'var(--color-border)',
40
+ tick: { fill: 'var(--color-text-secondary)', fontSize: 12 }
41
+ },
42
+ tooltip: {
43
+ contentStyle: {
44
+ backgroundColor: 'var(--color-card)',
45
+ borderRadius: '12px',
46
+ border: '1px solid var(--color-border)',
47
+ boxShadow: '0 8px 32px rgba(0,0,0,0.08)',
48
+ backdropFilter: 'blur(8px)'
49
+ },
50
+ itemStyle: { color: 'var(--color-text-primary)' },
51
+ labelStyle: { color: 'var(--color-text-secondary)', fontWeight: 600 }
52
+ }
53
+ };
54
+ export function pickColor(index) {
55
+ return chartTheme.palette[index % chartTheme.palette.length];
56
+ }
@@ -1,13 +1,6 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { Line, LineChart as RechartsLineChart, ResponsiveContainer, Tooltip, XAxis, YAxis } from 'recharts';
2
+ import { CartesianGrid, Line, LineChart as RechartsLineChart, ResponsiveContainer, Tooltip, XAxis, YAxis } from 'recharts';
3
+ import { chartTheme } from './chart-theme.js';
3
4
  export function Chart({ data, height = 300 }) {
4
- return (_jsx("div", { className: 'w-full', style: { height }, children: _jsx(ResponsiveContainer, { width: '100%', height: '100%', children: _jsxs(RechartsLineChart, { data: data, margin: { top: 5, right: 20, bottom: 5, left: 0 }, children: [_jsx(XAxis, { dataKey: 'name', stroke: '#1a374d' // color-sea idea
5
- , fontSize: 12, tickLine: false, axisLine: false }), _jsx(YAxis, { stroke: '#1a374d', fontSize: 12, tickLine: false, axisLine: false, tickFormatter: (value) => `$${value}` }), _jsx(Tooltip, { contentStyle: {
6
- backgroundColor: 'rgba(255, 255, 255, 0.95)',
7
- borderRadius: '8px',
8
- border: '1px solid rgba(0,0,0,0.1)',
9
- boxShadow: '0 8px 32px rgba(0,0,0,0.08)',
10
- backdropFilter: 'blur(8px)'
11
- }, itemStyle: { color: '#1a374d' } }), _jsx(Line, { type: 'monotone', dataKey: 'total', stroke: '#c8825f' // color-terracotta or similar accent
12
- , strokeWidth: 2, dot: false, activeDot: { r: 6, fill: '#c8825f', stroke: '#fff', strokeWidth: 2 } })] }) }) }));
5
+ return (_jsx("div", { className: 'w-full', style: { height }, children: _jsx(ResponsiveContainer, { width: '100%', height: '100%', children: _jsxs(RechartsLineChart, { data: data, margin: { top: 5, right: 20, bottom: 5, left: 0 }, children: [_jsx(CartesianGrid, { stroke: chartTheme.grid.stroke, strokeDasharray: chartTheme.grid.strokeDasharray, vertical: false }), _jsx(XAxis, { dataKey: 'name', stroke: chartTheme.axis.stroke, tick: chartTheme.axis.tick, tickLine: false, axisLine: false }), _jsx(YAxis, { stroke: chartTheme.axis.stroke, tick: chartTheme.axis.tick, tickLine: false, axisLine: false, tickFormatter: (value) => `$${value}` }), _jsx(Tooltip, { ...chartTheme.tooltip, formatter: (value) => [value !== undefined ? `$${value}` : '', 'Total'] }), _jsx(Line, { type: 'monotone', dataKey: 'total', stroke: chartTheme.colors.desert, strokeWidth: 2, dot: false, activeDot: { r: 6, fill: chartTheme.colors.desert, stroke: 'var(--color-card)', strokeWidth: 2 } })] }) }) }));
13
6
  }
@@ -0,0 +1,13 @@
1
+ import * as React from 'react';
2
+ export interface DashboardGridProps {
3
+ children: React.ReactNode;
4
+ className?: string;
5
+ columns?: 1 | 2 | 3 | 4 | 5 | 6;
6
+ }
7
+ export declare function DashboardGrid({ children, className, columns }: DashboardGridProps): import("react/jsx-runtime").JSX.Element;
8
+ export interface DashboardSpanProps {
9
+ children: React.ReactNode;
10
+ className?: string;
11
+ span?: 1 | 2 | 3 | 4 | 'full';
12
+ }
13
+ export declare function DashboardSpan({ children, className, span }: DashboardSpanProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,8 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { cn } from '../utils/cn.js';
3
+ export function DashboardGrid({ children, className, columns }) {
4
+ return (_jsx("div", { className: cn('grid gap-6', columns === 1 && 'grid-cols-1', columns === 2 && 'grid-cols-1 sm:grid-cols-2', columns === 3 && 'grid-cols-1 sm:grid-cols-2 lg:grid-cols-3', columns === 4 && 'grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4', columns === 5 && 'grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-5', columns === 6 && 'grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-6', !columns && 'dashboard-grid', className), children: children }));
5
+ }
6
+ export function DashboardSpan({ children, className, span = 1 }) {
7
+ return (_jsx("div", { className: cn('min-w-0', span === 1 && 'col-span-1', span === 2 && 'col-span-1 sm:col-span-2', span === 3 && 'col-span-1 sm:col-span-2 lg:col-span-3', span === 4 && 'col-span-1 sm:col-span-2 lg:col-span-3 xl:col-span-4', span === 'full' && 'col-span-full', className), children: children }));
8
+ }
@@ -0,0 +1,10 @@
1
+ import * as React from 'react';
2
+ export interface DashboardSectionProps {
3
+ title?: string;
4
+ description?: string;
5
+ children: React.ReactNode;
6
+ className?: string;
7
+ headerClassName?: string;
8
+ action?: React.ReactNode;
9
+ }
10
+ export declare function DashboardSection({ title, description, children, className, headerClassName, action }: DashboardSectionProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,5 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { cn } from '../utils/cn.js';
3
+ export function DashboardSection({ title, description, children, className, headerClassName, action }) {
4
+ return (_jsxs("section", { className: cn('space-y-4', className), children: [(title || description || action) && (_jsxs("div", { className: cn('flex flex-col gap-1 sm:flex-row sm:items-center sm:justify-between', headerClassName), children: [_jsxs("div", { children: [title && _jsx("h2", { className: 'text-lg font-semibold tracking-refined text-text-primary dark:text-text-primary', children: title }), description && _jsx("p", { className: 'text-sm text-text-secondary dark:text-text-secondary', children: description })] }), action && _jsx("div", { className: 'flex items-center gap-2', children: action })] })), children] }));
5
+ }
@@ -0,0 +1,13 @@
1
+ import * as React from 'react';
2
+ export interface DataListItem {
3
+ id: string;
4
+ label: React.ReactNode;
5
+ value: React.ReactNode;
6
+ description?: React.ReactNode;
7
+ }
8
+ export interface DataListProps {
9
+ items: DataListItem[];
10
+ className?: string;
11
+ striped?: boolean;
12
+ }
13
+ export declare function DataList({ items, className, striped }: DataListProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,5 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { cn } from '../utils/cn.js';
3
+ export function DataList({ items, className, striped = false }) {
4
+ return (_jsx("dl", { className: cn('divide-y divide-border', className), children: items.map((item, index) => (_jsxs("div", { className: cn('flex flex-col gap-1 py-3 sm:flex-row sm:items-start sm:justify-between sm:gap-4', striped && index % 2 === 0 && 'bg-muted/30 px-3'), children: [_jsx("dt", { className: 'text-sm font-medium text-text-secondary dark:text-text-secondary', children: item.label }), _jsxs("dd", { className: 'text-right text-sm font-semibold text-text-primary dark:text-text-primary sm:text-right', children: [item.value, item.description && (_jsx("p", { className: 'mt-0.5 text-xs font-normal text-text-secondary dark:text-text-secondary', children: item.description }))] })] }, item.id))) }));
5
+ }
@@ -0,0 +1,7 @@
1
+ import { Table } from '@tanstack/react-table';
2
+ export interface DataTableColumnToggleProps<TData> {
3
+ table: Table<TData>;
4
+ className?: string;
5
+ label?: string;
6
+ }
7
+ export declare function DataTableColumnToggle<TData>({ table, className, label }: DataTableColumnToggleProps<TData>): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,27 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import * as React from 'react';
3
+ import { Settings2 } from 'lucide-react';
4
+ import { cn } from '../utils/cn.js';
5
+ import { Button } from './button.js';
6
+ import { Checkbox } from './checkbox.js';
7
+ export function DataTableColumnToggle({ table, className, label = 'Columns' }) {
8
+ const [open, setOpen] = React.useState(false);
9
+ const containerRef = React.useRef(null);
10
+ React.useEffect(() => {
11
+ if (!open)
12
+ return undefined;
13
+ const handleClickOutside = (event) => {
14
+ if (containerRef.current && !containerRef.current.contains(event.target)) {
15
+ setOpen(false);
16
+ }
17
+ };
18
+ document.addEventListener('mousedown', handleClickOutside);
19
+ return () => document.removeEventListener('mousedown', handleClickOutside);
20
+ }, [open]);
21
+ return (_jsxs("div", { ref: containerRef, className: cn('relative', className), children: [_jsxs(Button, { variant: 'secondary', size: 'sm', onClick: () => setOpen((prev) => !prev), children: [_jsx(Settings2, { size: 14 }), label] }), open && (_jsxs("div", { className: 'absolute right-0 top-full z-50 mt-2 w-48 rounded-[var(--radius-card)] border border-border bg-card p-2 shadow-lg', children: [_jsx("p", { className: 'px-2 py-1.5 text-xs font-semibold uppercase tracking-wider text-text-secondary', children: "Toggle columns" }), _jsx("div", { className: 'max-h-60 overflow-y-auto', children: table
22
+ .getAllColumns()
23
+ .filter((column) => typeof column.accessorFn !== 'undefined' && column.getCanHide())
24
+ .map((column) => {
25
+ return (_jsxs("label", { className: 'flex cursor-pointer items-center gap-2 rounded-md px-2 py-1.5 text-sm text-text-primary hover:bg-sand/10 dark:text-text-primary dark:hover:bg-sand/15', children: [_jsx(Checkbox, { checked: column.getIsVisible(), onChange: (event) => column.toggleVisibility(event.target.checked) }), _jsx("span", { className: 'truncate', children: typeof column.columnDef.header === 'string' ? column.columnDef.header : column.id })] }, column.id));
26
+ }) })] }))] }));
27
+ }
@@ -0,0 +1,22 @@
1
+ import * as React from 'react';
2
+ import { Table, Column } from '@tanstack/react-table';
3
+ import { SelectOption } from './select';
4
+ export interface DataTableSelectFilterProps<TData> {
5
+ table: Table<TData>;
6
+ columnId: string;
7
+ placeholder?: string;
8
+ options: SelectOption[];
9
+ className?: string;
10
+ }
11
+ export declare function DataTableSelectFilter<TData>({ table, columnId, placeholder, options, className }: DataTableSelectFilterProps<TData>): import("react/jsx-runtime").JSX.Element | null;
12
+ export interface DataTableFacetedFilterProps<TData, TValue = string> {
13
+ column?: Column<TData, unknown>;
14
+ title?: string;
15
+ options: {
16
+ label: string;
17
+ value: TValue;
18
+ icon?: React.ComponentType<{
19
+ className?: string;
20
+ }>;
21
+ }[];
22
+ }
@@ -0,0 +1,11 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { cn } from '../utils/cn.js';
3
+ import { Select } from './select.js';
4
+ export function DataTableSelectFilter({ table, columnId, placeholder = 'All', options, className }) {
5
+ const column = table.getColumn(columnId);
6
+ if (!column)
7
+ return null;
8
+ const value = column.getFilterValue() ?? '';
9
+ const selectOptions = [{ label: placeholder, value: '' }, ...options];
10
+ return (_jsx("div", { className: cn('w-full sm:w-44', className), children: _jsx(Select, { value: value, options: selectOptions, placeholder: placeholder, onChange: (next) => column.setFilterValue(next || undefined) }) }));
11
+ }
@@ -0,0 +1,7 @@
1
+ import { Table } from '@tanstack/react-table';
2
+ export interface DataTablePaginationProps<TData> {
3
+ table: Table<TData>;
4
+ className?: string;
5
+ pageSizeOptions?: number[];
6
+ }
7
+ export declare function DataTablePagination<TData>({ table, className, pageSizeOptions }: DataTablePaginationProps<TData>): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,11 @@
1
+ import { Fragment as _Fragment, jsxs as _jsxs, jsx as _jsx } from "react/jsx-runtime";
2
+ import { ChevronLeft, ChevronRight, ChevronsLeft, ChevronsRight } from 'lucide-react';
3
+ import { cn } from '../utils/cn.js';
4
+ import { Button } from './button.js';
5
+ import { Select } from './select.js';
6
+ export function DataTablePagination({ table, className, pageSizeOptions = [10, 20, 30, 50, 100] }) {
7
+ const pageSize = table.getState().pagination.pageSize;
8
+ const pageOptions = table.getPageOptions();
9
+ const sizeOptions = pageSizeOptions.map((size) => ({ label: `${size}`, value: String(size) }));
10
+ return (_jsxs("div", { className: cn('flex flex-col items-center justify-between gap-4 px-2 sm:flex-row', className), children: [_jsx("div", { className: 'text-sm text-text-secondary dark:text-text-secondary', children: table.getFilteredSelectedRowModel().rows.length > 0 && (_jsxs(_Fragment, { children: [table.getFilteredSelectedRowModel().rows.length, " of ", table.getFilteredRowModel().rows.length, " row(s) selected."] })) }), _jsxs("div", { className: 'flex items-center gap-4', children: [_jsxs("div", { className: 'flex items-center gap-2 text-sm text-text-secondary', children: [_jsx("span", { children: "Rows per page" }), _jsx("div", { className: 'w-20', children: _jsx(Select, { value: String(pageSize), options: sizeOptions, onChange: (value) => table.setPageSize(Number(value)) }) })] }), _jsxs("div", { className: 'text-sm font-medium text-text-primary dark:text-text-primary', children: ["Page ", table.getState().pagination.pageIndex + 1, " of ", table.getPageCount()] }), _jsxs("div", { className: 'flex items-center gap-1', children: [_jsx(Button, { variant: 'secondary', size: 'sm', className: 'hidden h-8 w-8 p-0 sm:flex', onClick: () => table.setPageIndex(0), disabled: !table.getCanPreviousPage(), children: _jsx(ChevronsLeft, { className: 'h-4 w-4' }) }), _jsx(Button, { variant: 'secondary', size: 'sm', className: 'h-8 w-8 p-0', onClick: () => table.previousPage(), disabled: !table.getCanPreviousPage(), children: _jsx(ChevronLeft, { className: 'h-4 w-4' }) }), _jsx(Button, { variant: 'secondary', size: 'sm', className: 'h-8 w-8 p-0', onClick: () => table.nextPage(), disabled: !table.getCanNextPage(), children: _jsx(ChevronRight, { className: 'h-4 w-4' }) }), _jsx(Button, { variant: 'secondary', size: 'sm', className: 'hidden h-8 w-8 p-0 sm:flex', onClick: () => table.setPageIndex(table.getPageCount() - 1), disabled: !table.getCanNextPage(), children: _jsx(ChevronsRight, { className: 'h-4 w-4' }) })] })] })] }));
11
+ }
@@ -0,0 +1,11 @@
1
+ import * as React from 'react';
2
+ import { Table } from '@tanstack/react-table';
3
+ export interface DataTableToolbarProps<TData> {
4
+ table: Table<TData>;
5
+ searchColumn?: string;
6
+ searchPlaceholder?: string;
7
+ filterRenderers?: React.ReactNode;
8
+ actions?: React.ReactNode;
9
+ className?: string;
10
+ }
11
+ export declare function DataTableToolbar<TData>({ table, searchColumn, searchPlaceholder, filterRenderers, actions, className }: DataTableToolbarProps<TData>): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,9 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { X } from 'lucide-react';
3
+ import { cn } from '../utils/cn.js';
4
+ import { Button } from './button.js';
5
+ import { Input } from './input.js';
6
+ export function DataTableToolbar({ table, searchColumn, searchPlaceholder = 'Search...', filterRenderers, actions, className }) {
7
+ const isFiltered = table.getState().columnFilters.length > 0 || Boolean(table.getState().globalFilter);
8
+ return (_jsxs("div", { className: cn('flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between', className), children: [_jsxs("div", { className: 'flex flex-1 flex-col gap-3 sm:flex-row sm:items-center', children: [searchColumn && (_jsx(Input, { placeholder: searchPlaceholder, value: table.getColumn(searchColumn)?.getFilterValue() ?? '', onChange: (event) => table.getColumn(searchColumn)?.setFilterValue(event.target.value), className: 'h-9 w-full sm:max-w-xs' })), filterRenderers] }), _jsxs("div", { className: 'flex items-center gap-2', children: [isFiltered && (_jsxs(Button, { variant: 'ghost', size: 'sm', onClick: () => table.resetColumnFilters(), children: [_jsx(X, { size: 14 }), "Reset"] })), actions] })] }));
9
+ }
@@ -0,0 +1,15 @@
1
+ export interface DateRange {
2
+ from?: string;
3
+ to?: string;
4
+ }
5
+ export interface DateRangePickerProps {
6
+ value: DateRange;
7
+ onChange: (range: DateRange) => void;
8
+ className?: string;
9
+ placeholder?: string;
10
+ presets?: {
11
+ label: string;
12
+ days: number;
13
+ }[];
14
+ }
15
+ export declare function DateRangePicker({ value, onChange, className, placeholder, presets }: DateRangePickerProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,17 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { Calendar as CalendarIcon, X } from 'lucide-react';
3
+ import { cn } from '../utils/cn.js';
4
+ import { Button } from './button.js';
5
+ export function DateRangePicker({ value, onChange, className, placeholder = 'Pick a date range', presets }) {
6
+ const hasValue = value.from || value.to;
7
+ const applyPreset = (days) => {
8
+ const to = new Date();
9
+ const from = new Date();
10
+ from.setDate(to.getDate() - days);
11
+ onChange({
12
+ from: from.toISOString().split('T')[0],
13
+ to: to.toISOString().split('T')[0]
14
+ });
15
+ };
16
+ return (_jsxs("div", { className: cn('flex flex-wrap items-center gap-2', className), children: [_jsxs("div", { className: 'relative flex items-center rounded-[var(--radius-ui)] bg-light-sand/50 ring-1 ring-inset ring-black/10 transition-all hover:bg-white focus-within:bg-white focus-within:ring-2 focus-within:ring-sea dark:bg-deep-sea/50 dark:ring-white/10 dark:focus-within:ring-accent-blue', children: [_jsx(CalendarIcon, { size: 16, className: 'ml-3 text-text-secondary dark:text-text-secondary' }), _jsx("input", { type: 'date', value: value.from ?? '', max: value.to, onChange: (e) => onChange({ ...value, from: e.target.value || undefined }), className: 'h-9 border-none bg-transparent px-2 text-sm text-text-primary outline-none dark:text-text-primary' }), _jsx("span", { className: 'text-sm text-text-secondary dark:text-text-secondary', children: "-" }), _jsx("input", { type: 'date', value: value.to ?? '', min: value.from, onChange: (e) => onChange({ ...value, to: e.target.value || undefined }), className: 'h-9 border-none bg-transparent px-2 text-sm text-text-primary outline-none dark:text-text-primary' }), hasValue && (_jsx("button", { type: 'button', onClick: () => onChange({}), className: 'mr-2 rounded-md p-1 text-text-secondary hover:bg-sand/10 hover:text-text-primary dark:hover:bg-sand/15', children: _jsx(X, { size: 14 }) }))] }), presets && (_jsx("div", { className: 'flex flex-wrap items-center gap-1', children: presets.map((preset) => (_jsx(Button, { variant: 'ghost', size: 'sm', onClick: () => applyPreset(preset.days), children: preset.label }, preset.label))) }))] }));
17
+ }
@@ -0,0 +1,9 @@
1
+ import { type PieChartDatum } from './pie-chart';
2
+ export interface DonutChartProps {
3
+ data: PieChartDatum[];
4
+ height?: number;
5
+ showLegend?: boolean;
6
+ centerLabel?: string;
7
+ centerValue?: string;
8
+ }
9
+ export declare function DonutChart({ data, height, showLegend, centerLabel, centerValue }: DonutChartProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,5 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { PieChart } from './pie-chart.js';
3
+ export function DonutChart({ data, height = 300, showLegend = true, centerLabel, centerValue }) {
4
+ return (_jsxs("div", { className: 'relative w-full', style: { height }, children: [_jsx(PieChart, { data: data, height: height, showLegend: showLegend, innerRadius: '60%' }), (centerLabel || centerValue) && (_jsxs("div", { className: 'pointer-events-none absolute inset-0 flex flex-col items-center justify-center pb-6', children: [centerValue && _jsx("span", { className: 'text-2xl font-bold text-text-primary dark:text-text-primary', children: centerValue }), centerLabel && _jsx("span", { className: 'text-xs text-text-secondary dark:text-text-secondary', children: centerLabel })] }))] }));
5
+ }
@@ -0,0 +1,27 @@
1
+ import * as React from 'react';
2
+ import * as DropdownMenuPrimitive from '@radix-ui/react-dropdown-menu';
3
+ declare const DropdownMenu: React.FC<DropdownMenuPrimitive.DropdownMenuProps>;
4
+ declare const DropdownMenuTrigger: React.ForwardRefExoticComponent<DropdownMenuPrimitive.DropdownMenuTriggerProps & React.RefAttributes<HTMLButtonElement>>;
5
+ declare const DropdownMenuGroup: React.ForwardRefExoticComponent<DropdownMenuPrimitive.DropdownMenuGroupProps & React.RefAttributes<HTMLDivElement>>;
6
+ declare const DropdownMenuPortal: React.FC<DropdownMenuPrimitive.DropdownMenuPortalProps>;
7
+ declare const DropdownMenuSub: React.FC<DropdownMenuPrimitive.DropdownMenuSubProps>;
8
+ declare const DropdownMenuRadioGroup: React.ForwardRefExoticComponent<DropdownMenuPrimitive.DropdownMenuRadioGroupProps & React.RefAttributes<HTMLDivElement>>;
9
+ declare const DropdownMenuSubTrigger: React.ForwardRefExoticComponent<Omit<DropdownMenuPrimitive.DropdownMenuSubTriggerProps & React.RefAttributes<HTMLDivElement>, "ref"> & {
10
+ inset?: boolean;
11
+ } & React.RefAttributes<HTMLDivElement>>;
12
+ declare const DropdownMenuSubContent: React.ForwardRefExoticComponent<Omit<DropdownMenuPrimitive.DropdownMenuSubContentProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
13
+ declare const DropdownMenuContent: React.ForwardRefExoticComponent<Omit<DropdownMenuPrimitive.DropdownMenuContentProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
14
+ declare const DropdownMenuItem: React.ForwardRefExoticComponent<Omit<DropdownMenuPrimitive.DropdownMenuItemProps & React.RefAttributes<HTMLDivElement>, "ref"> & {
15
+ inset?: boolean;
16
+ } & React.RefAttributes<HTMLDivElement>>;
17
+ declare const DropdownMenuCheckboxItem: React.ForwardRefExoticComponent<Omit<DropdownMenuPrimitive.DropdownMenuCheckboxItemProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
18
+ declare const DropdownMenuRadioItem: React.ForwardRefExoticComponent<Omit<DropdownMenuPrimitive.DropdownMenuRadioItemProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
19
+ declare const DropdownMenuLabel: React.ForwardRefExoticComponent<Omit<DropdownMenuPrimitive.DropdownMenuLabelProps & React.RefAttributes<HTMLDivElement>, "ref"> & {
20
+ inset?: boolean;
21
+ } & React.RefAttributes<HTMLDivElement>>;
22
+ declare const DropdownMenuSeparator: React.ForwardRefExoticComponent<Omit<DropdownMenuPrimitive.DropdownMenuSeparatorProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
23
+ declare const DropdownMenuShortcut: {
24
+ ({ className, ...props }: React.HTMLAttributes<HTMLSpanElement>): import("react/jsx-runtime").JSX.Element;
25
+ displayName: string;
26
+ };
27
+ export { DropdownMenu, DropdownMenuTrigger, DropdownMenuContent, DropdownMenuItem, DropdownMenuCheckboxItem, DropdownMenuRadioItem, DropdownMenuLabel, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuGroup, DropdownMenuPortal, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuRadioGroup };
@@ -0,0 +1,32 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import * as React from 'react';
3
+ import * as DropdownMenuPrimitive from '@radix-ui/react-dropdown-menu';
4
+ import { Check, ChevronRight, Circle } from 'lucide-react';
5
+ import { cn } from '../utils/cn.js';
6
+ const DropdownMenu = DropdownMenuPrimitive.Root;
7
+ const DropdownMenuTrigger = DropdownMenuPrimitive.Trigger;
8
+ const DropdownMenuGroup = DropdownMenuPrimitive.Group;
9
+ const DropdownMenuPortal = DropdownMenuPrimitive.Portal;
10
+ const DropdownMenuSub = DropdownMenuPrimitive.Sub;
11
+ const DropdownMenuRadioGroup = DropdownMenuPrimitive.RadioGroup;
12
+ const DropdownMenuSubTrigger = React.forwardRef(({ className, inset, children, ...props }, ref) => (_jsxs(DropdownMenuPrimitive.SubTrigger, { ref: ref, className: cn('flex cursor-default select-none items-center rounded-[var(--radius-ui)] px-2 py-1.5 text-sm text-text-primary outline-none focus:bg-sand/10 data-[state=open]:bg-sand/10 dark:text-text-primary dark:focus:bg-sand/15', inset && 'pl-8', className), ...props, children: [children, _jsx(ChevronRight, { size: 16, className: 'ml-auto' })] })));
13
+ DropdownMenuSubTrigger.displayName = DropdownMenuPrimitive.SubTrigger.displayName;
14
+ const DropdownMenuSubContent = React.forwardRef(({ className, ...props }, ref) => (_jsx(DropdownMenuPrimitive.SubContent, { ref: ref, className: cn('z-50 min-w-[8rem] overflow-hidden rounded-[var(--radius-card)] border border-border bg-card p-1 shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 dark:bg-deep-sea', className), ...props })));
15
+ DropdownMenuSubContent.displayName = DropdownMenuPrimitive.SubContent.displayName;
16
+ const DropdownMenuContent = React.forwardRef(({ className, sideOffset = 4, ...props }, ref) => (_jsx(DropdownMenuPrimitive.Portal, { children: _jsx(DropdownMenuPrimitive.Content, { ref: ref, sideOffset: sideOffset, className: cn('z-50 min-w-[10rem] overflow-hidden rounded-[var(--radius-card)] border border-border bg-card p-1.5 shadow-[0_8px_32px_rgba(0,0,0,0.08)] data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 dark:border-white/10 dark:bg-deep-sea dark:shadow-[0_8px_32px_rgba(0,0,0,0.3)]', className), ...props }) })));
17
+ DropdownMenuContent.displayName = DropdownMenuPrimitive.Content.displayName;
18
+ const DropdownMenuItem = React.forwardRef(({ className, inset, ...props }, ref) => (_jsx(DropdownMenuPrimitive.Item, { ref: ref, className: cn('relative flex cursor-pointer select-none items-center rounded-[var(--radius-ui)] px-2 py-1.5 text-sm text-text-primary outline-none transition-colors focus:bg-sand/10 focus:text-text-primary data-[disabled]:pointer-events-none data-[disabled]:opacity-50 dark:text-text-primary dark:focus:bg-sand/15', inset && 'pl-8', className), ...props })));
19
+ DropdownMenuItem.displayName = DropdownMenuPrimitive.Item.displayName;
20
+ const DropdownMenuCheckboxItem = React.forwardRef(({ className, children, checked, ...props }, ref) => (_jsxs(DropdownMenuPrimitive.CheckboxItem, { ref: ref, className: cn('relative flex cursor-pointer select-none items-center rounded-[var(--radius-ui)] py-1.5 pl-8 pr-2 text-sm text-text-primary outline-none transition-colors focus:bg-sand/10 focus:text-text-primary data-[disabled]:pointer-events-none data-[disabled]:opacity-50 dark:text-text-primary dark:focus:bg-sand/15', className), checked: checked, ...props, children: [_jsx("span", { className: 'absolute left-2 flex h-3.5 w-3.5 items-center justify-center', children: _jsx(DropdownMenuPrimitive.ItemIndicator, { children: _jsx(Check, { size: 16 }) }) }), children] })));
21
+ DropdownMenuCheckboxItem.displayName = DropdownMenuPrimitive.CheckboxItem.displayName;
22
+ const DropdownMenuRadioItem = React.forwardRef(({ className, children, ...props }, ref) => (_jsxs(DropdownMenuPrimitive.RadioItem, { ref: ref, className: cn('relative flex cursor-pointer select-none items-center rounded-[var(--radius-ui)] py-1.5 pl-8 pr-2 text-sm text-text-primary outline-none transition-colors focus:bg-sand/10 focus:text-text-primary data-[disabled]:pointer-events-none data-[disabled]:opacity-50 dark:text-text-primary dark:focus:bg-sand/15', className), ...props, children: [_jsx("span", { className: 'absolute left-2 flex h-3.5 w-3.5 items-center justify-center', children: _jsx(DropdownMenuPrimitive.ItemIndicator, { children: _jsx(Circle, { size: 8, fill: 'currentColor' }) }) }), children] })));
23
+ DropdownMenuRadioItem.displayName = DropdownMenuPrimitive.RadioItem.displayName;
24
+ const DropdownMenuLabel = React.forwardRef(({ className, inset, ...props }, ref) => (_jsx(DropdownMenuPrimitive.Label, { ref: ref, className: cn('px-2 py-1.5 text-xs font-semibold uppercase tracking-wider text-text-secondary', inset && 'pl-8', className), ...props })));
25
+ DropdownMenuLabel.displayName = DropdownMenuPrimitive.Label.displayName;
26
+ const DropdownMenuSeparator = React.forwardRef(({ className, ...props }, ref) => (_jsx(DropdownMenuPrimitive.Separator, { ref: ref, className: cn('-mx-1.5 my-1 h-px bg-border', className), ...props })));
27
+ DropdownMenuSeparator.displayName = DropdownMenuPrimitive.Separator.displayName;
28
+ const DropdownMenuShortcut = ({ className, ...props }) => {
29
+ return _jsx("span", { className: cn('ml-auto text-xs tracking-widest text-text-secondary', className), ...props });
30
+ };
31
+ DropdownMenuShortcut.displayName = 'DropdownMenuShortcut';
32
+ export { DropdownMenu, DropdownMenuTrigger, DropdownMenuContent, DropdownMenuItem, DropdownMenuCheckboxItem, DropdownMenuRadioItem, DropdownMenuLabel, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuGroup, DropdownMenuPortal, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuRadioGroup };
@@ -0,0 +1,10 @@
1
+ import * as React from 'react';
2
+ export interface ErrorStateProps {
3
+ title?: string;
4
+ description?: string;
5
+ onRetry?: () => void;
6
+ retryLabel?: string;
7
+ className?: string;
8
+ icon?: React.ReactNode;
9
+ }
10
+ export declare function ErrorState({ title, description, onRetry, retryLabel, className, icon }: ErrorStateProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,7 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { AlertCircle, RefreshCw } from 'lucide-react';
3
+ import { cn } from '../utils/cn.js';
4
+ import { Button } from './button.js';
5
+ export function ErrorState({ title = 'Something went wrong', description = 'We couldn\'t load this data. Please try again.', onRetry, retryLabel = 'Try again', className, icon }) {
6
+ return (_jsxs("div", { className: cn('flex flex-col items-center justify-center gap-4 rounded-2xl border border-dashed border-terracotta/30 bg-terracotta/5 px-6 py-12 text-center dark:bg-terracotta/10', className), children: [_jsx("div", { className: 'flex h-14 w-14 items-center justify-center rounded-full bg-terracotta/10 text-terracotta dark:bg-terracotta/20', children: icon ?? _jsx(AlertCircle, { size: 28 }) }), _jsxs("div", { className: 'space-y-1', children: [_jsx("h3", { className: 'text-base font-semibold text-text-primary dark:text-text-primary', children: title }), description && _jsx("p", { className: 'max-w-xs text-sm text-text-secondary dark:text-text-secondary', children: description })] }), onRetry && (_jsxs(Button, { variant: 'secondary', size: 'sm', onClick: onRetry, children: [_jsx(RefreshCw, { size: 14 }), retryLabel] }))] }));
7
+ }
@@ -0,0 +1,13 @@
1
+ export interface FilterChipProps {
2
+ label: string;
3
+ value?: string;
4
+ onRemove?: () => void;
5
+ className?: string;
6
+ }
7
+ export declare function FilterChip({ label, value, onRemove, className }: FilterChipProps): import("react/jsx-runtime").JSX.Element;
8
+ export interface FilterGroupProps {
9
+ filters: FilterChipProps[];
10
+ className?: string;
11
+ onClearAll?: () => void;
12
+ }
13
+ export declare function FilterGroup({ filters, className, onClearAll }: FilterGroupProps): import("react/jsx-runtime").JSX.Element | null;
@@ -0,0 +1,11 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { X } from 'lucide-react';
3
+ import { cn } from '../utils/cn.js';
4
+ export function FilterChip({ label, value, onRemove, className }) {
5
+ return (_jsxs("span", { className: cn('inline-flex items-center gap-1.5 rounded-full border border-border bg-muted px-2.5 py-1 text-xs font-medium text-text-primary dark:text-text-primary', className), children: [_jsx("span", { className: 'text-text-secondary dark:text-text-secondary', children: label }), value && _jsx("span", { className: 'font-semibold', children: value }), onRemove && (_jsx("button", { type: 'button', onClick: onRemove, className: 'rounded-full p-0.5 text-text-secondary transition-colors hover:bg-sand/20 hover:text-text-primary dark:hover:bg-sand/20', children: _jsx(X, { size: 12 }) }))] }));
6
+ }
7
+ export function FilterGroup({ filters, className, onClearAll }) {
8
+ if (filters.length === 0)
9
+ return null;
10
+ return (_jsxs("div", { className: cn('flex flex-wrap items-center gap-2', className), children: [filters.map((filter, index) => (_jsx(FilterChip, { ...filter }, `${filter.label}-${index}`))), onClearAll && (_jsx("button", { type: 'button', onClick: onClearAll, className: 'text-xs font-medium text-sea hover:underline dark:text-accent-blue', children: "Clear all" }))] }));
11
+ }
@@ -0,0 +1,12 @@
1
+ export interface FunnelChartDatum {
2
+ name: string;
3
+ value: number;
4
+ fill?: string;
5
+ }
6
+ export interface FunnelChartProps {
7
+ data: FunnelChartDatum[];
8
+ height?: number;
9
+ showLabels?: boolean;
10
+ valueFormatter?: (value: number) => string;
11
+ }
12
+ export declare function FunnelChart({ data, height, showLabels, valueFormatter }: FunnelChartProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,10 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { Funnel, FunnelChart as RechartsFunnelChart, LabelList, ResponsiveContainer, Tooltip } from 'recharts';
3
+ import { chartTheme } from './chart-theme.js';
4
+ export function FunnelChart({ data, height = 350, showLabels = true, valueFormatter }) {
5
+ const coloredData = data.map((entry, index) => ({
6
+ ...entry,
7
+ fill: entry.fill ?? chartTheme.palette[index % chartTheme.palette.length]
8
+ }));
9
+ return (_jsx("div", { className: 'w-full', style: { height }, children: _jsx(ResponsiveContainer, { width: '100%', height: '100%', children: _jsxs(RechartsFunnelChart, { children: [_jsx(Tooltip, { ...chartTheme.tooltip, formatter: (value) => [valueFormatter && typeof value === 'number' ? valueFormatter(value) : value, ''] }), _jsx(Funnel, { data: coloredData, dataKey: 'value', nameKey: 'name', isAnimationActive: true, children: showLabels && (_jsx(LabelList, { position: 'inside', fill: 'var(--color-text-primary)', stroke: 'none', dataKey: 'name', formatter: ((value, entry) => `${value ?? ''}: ${entry?.value ?? ''}`) })) })] }) }) }));
10
+ }
@@ -0,0 +1,12 @@
1
+ import { type ChartSeries } from './chart-theme';
2
+ export interface LineChartProps {
3
+ data: Record<string, unknown>[];
4
+ height?: number;
5
+ series: ChartSeries[];
6
+ xAxisKey: string;
7
+ showGrid?: boolean;
8
+ showLegend?: boolean;
9
+ yAxisTickFormatter?: (value: number) => string;
10
+ tooltipFormatter?: (value: number) => string;
11
+ }
12
+ export declare function LineChart({ data, height, series, xAxisKey, showGrid, showLegend, yAxisTickFormatter, tooltipFormatter }: LineChartProps): import("react/jsx-runtime").JSX.Element;