@pattern-stack/frontend-patterns 0.0.6 → 0.1.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.
Files changed (86) hide show
  1. package/dist/atoms/composed/index.d.ts +0 -1
  2. package/dist/atoms/composed/index.d.ts.map +1 -1
  3. package/dist/atoms/types/index.d.ts +0 -2
  4. package/dist/atoms/types/index.d.ts.map +1 -1
  5. package/dist/atoms/ui/ErrorBoundary.d.ts +1 -1
  6. package/dist/atoms/ui/button.d.ts +1 -1
  7. package/dist/atoms/utils/utils.d.ts +0 -2
  8. package/dist/atoms/utils/utils.d.ts.map +1 -1
  9. package/dist/features/auth/components/ProtectedRoute.d.ts +1 -1
  10. package/dist/frontend-patterns.css +1 -1
  11. package/dist/index.es.js +15 -403
  12. package/dist/index.es.js.map +1 -1
  13. package/dist/index.js +14 -403
  14. package/dist/index.js.map +1 -1
  15. package/dist/molecules/layout/Sidebar.d.ts.map +1 -1
  16. package/dist/molecules/layout/SidebarButton/SidebarButton.d.ts +0 -2
  17. package/dist/molecules/layout/SidebarButton/SidebarButton.d.ts.map +1 -1
  18. package/dist/molecules/layout/index.d.ts +0 -3
  19. package/dist/molecules/layout/index.d.ts.map +1 -1
  20. package/dist/templates/factory.d.ts +1 -2
  21. package/dist/templates/factory.d.ts.map +1 -1
  22. package/dist/templates/index.d.ts.map +1 -1
  23. package/package.json +3 -7
  24. package/src/App.tsx +1 -11
  25. package/src/atoms/composed/index.ts +0 -1
  26. package/src/atoms/types/index.ts +1 -3
  27. package/src/atoms/utils/utils.ts +2 -4
  28. package/src/molecules/layout/Sidebar.tsx +23 -10
  29. package/src/molecules/layout/SidebarButton/SidebarButton.tsx +10 -32
  30. package/src/molecules/layout/index.ts +1 -4
  31. package/src/organisms/index.ts +1 -5
  32. package/src/pages/AdminShowcase/AdminDashboardShowcase.tsx +75 -77
  33. package/src/pages/AdminShowcase/index.tsx +1 -2
  34. package/src/pages/index.ts +1 -2
  35. package/src/templates/factory.tsx +7 -14
  36. package/src/templates/index.ts +0 -4
  37. package/dist/atoms/composed/SalesPanel/SalesPanel.d.ts +0 -19
  38. package/dist/atoms/composed/SalesPanel/SalesPanel.d.ts.map +0 -1
  39. package/dist/atoms/composed/SalesPanel/index.d.ts +0 -2
  40. package/dist/atoms/composed/SalesPanel/index.d.ts.map +0 -1
  41. package/dist/atoms/composed/SalesPanel/mockSalesData.d.ts +0 -63
  42. package/dist/atoms/composed/SalesPanel/mockSalesData.d.ts.map +0 -1
  43. package/dist/atoms/types/entity-config.d.ts +0 -117
  44. package/dist/atoms/types/entity-config.d.ts.map +0 -1
  45. package/dist/atoms/types/navigation.d.ts +0 -30
  46. package/dist/atoms/types/navigation.d.ts.map +0 -1
  47. package/dist/atoms/utils/icon-resolver.d.ts +0 -72
  48. package/dist/atoms/utils/icon-resolver.d.ts.map +0 -1
  49. package/dist/atoms/utils/metric-engine.d.ts +0 -30
  50. package/dist/atoms/utils/metric-engine.d.ts.map +0 -1
  51. package/dist/molecules/layout/DashboardWithSidePanel/DashboardWithSidePanel.d.ts +0 -16
  52. package/dist/molecules/layout/DashboardWithSidePanel/DashboardWithSidePanel.d.ts.map +0 -1
  53. package/dist/molecules/layout/DashboardWithSidePanel/index.d.ts +0 -2
  54. package/dist/molecules/layout/DashboardWithSidePanel/index.d.ts.map +0 -1
  55. package/dist/molecules/layout/NavigationContext.d.ts +0 -15
  56. package/dist/molecules/layout/NavigationContext.d.ts.map +0 -1
  57. package/src/__tests__/atoms/composed/databadge.test.tsx +0 -106
  58. package/src/__tests__/atoms/composed/statcard.test.tsx +0 -133
  59. package/src/__tests__/atoms/utils/icon-resolver.test.tsx +0 -140
  60. package/src/atoms/composed/SalesPanel/SalesPanel.tsx +0 -116
  61. package/src/atoms/composed/SalesPanel/index.ts +0 -1
  62. package/src/atoms/composed/SalesPanel/mockSalesData.ts +0 -151
  63. package/src/atoms/types/entity-config.ts +0 -127
  64. package/src/atoms/types/navigation.ts +0 -43
  65. package/src/atoms/utils/icon-resolver.tsx +0 -54
  66. package/src/atoms/utils/metric-engine.ts +0 -236
  67. package/src/molecules/layout/DashboardWithSidePanel/DashboardWithSidePanel.tsx +0 -42
  68. package/src/molecules/layout/DashboardWithSidePanel/index.ts +0 -1
  69. package/src/molecules/layout/NavigationContext.tsx +0 -63
  70. package/src/organisms/entity/CategoryBreakdownPanel.tsx +0 -427
  71. package/src/organisms/entity/EntityListPanel.tsx +0 -339
  72. package/src/organisms/entity/MetricsOverviewPanel.tsx +0 -236
  73. package/src/organisms/entity/TrendAnalysisPanel.tsx +0 -337
  74. package/src/organisms/entity/index.ts +0 -4
  75. package/src/pages/AdminShowcase/SalesPerformanceDashboard.tsx +0 -158
  76. package/src/pages/EntityShowcase/EntityManagementShowcase.tsx +0 -137
  77. package/src/pages/EntityShowcase/EntityPerformanceShowcase.tsx +0 -117
  78. package/src/pages/EntityShowcase/index.ts +0 -2
  79. package/src/pages/EntityTemplateExample.tsx +0 -229
  80. package/src/pages/TestEntityTemplate.tsx +0 -40
  81. package/src/templates/entity/EntityManagementTemplate.tsx +0 -430
  82. package/src/templates/entity/EntityPerformanceDashboardTemplate.tsx +0 -277
  83. package/src/templates/entity/configs/financial-config.ts +0 -141
  84. package/src/templates/entity/configs/index.ts +0 -1
  85. package/src/templates/entity/index.ts +0 -3
  86. package/src/templates/financial/FinancialDashboardTemplate.tsx +0 -326
@@ -28,10 +28,6 @@ export {
28
28
  // Admin templates for administrative interfaces
29
29
  export * from './admin';
30
30
 
31
- // Entity templates for cross-domain configurable layouts
32
- // TODO: Fix TypeScript errors in entity templates before uncommenting
33
- // export * from './entity';
34
-
35
31
  // React App Factory
36
32
  export {
37
33
  createReactApp,
@@ -1,19 +0,0 @@
1
- import React from 'react';
2
- interface SalesPanelProps {
3
- sales: Array<{
4
- id: string;
5
- customer: string;
6
- product: string;
7
- amount: number;
8
- stage: string;
9
- salesperson: string;
10
- region: string;
11
- closeDate: string;
12
- dealSize: string;
13
- }>;
14
- onSaleClick?: (sale: any) => void;
15
- onClose?: () => void;
16
- }
17
- export declare const SalesPanel: React.FC<SalesPanelProps>;
18
- export {};
19
- //# sourceMappingURL=SalesPanel.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"SalesPanel.d.ts","sourceRoot":"","sources":["../../../../src/atoms/composed/SalesPanel/SalesPanel.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAQ1B,UAAU,eAAe;IACvB,KAAK,EAAE,KAAK,CAAC;QACX,EAAE,EAAE,MAAM,CAAC;QACX,QAAQ,EAAE,MAAM,CAAC;QACjB,OAAO,EAAE,MAAM,CAAC;QAChB,MAAM,EAAE,MAAM,CAAC;QACf,KAAK,EAAE,MAAM,CAAC;QACd,WAAW,EAAE,MAAM,CAAC;QACpB,MAAM,EAAE,MAAM,CAAC;QACf,SAAS,EAAE,MAAM,CAAC;QAClB,QAAQ,EAAE,MAAM,CAAC;KAClB,CAAC,CAAC;IACH,WAAW,CAAC,EAAE,CAAC,IAAI,EAAE,GAAG,KAAK,IAAI,CAAC;IAClC,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;CACtB;AAaD,eAAO,MAAM,UAAU,EAAE,KAAK,CAAC,EAAE,CAAC,eAAe,CAgFhD,CAAC"}
@@ -1,2 +0,0 @@
1
- export { SalesPanel } from './SalesPanel';
2
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/atoms/composed/SalesPanel/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC"}
@@ -1,63 +0,0 @@
1
- export declare const mockSalesData: {
2
- id: string;
3
- customer: string;
4
- product: string;
5
- amount: number;
6
- stage: string;
7
- salesperson: string;
8
- region: string;
9
- closeDate: string;
10
- dealSize: string;
11
- }[];
12
- export declare const salesConfig: {
13
- entityType: "performance";
14
- display: {
15
- title: string;
16
- subtitle: string;
17
- category: 3;
18
- };
19
- metrics: ({
20
- key: string;
21
- label: string;
22
- type: "currency";
23
- aggregate: string;
24
- showTrend: boolean;
25
- category: number;
26
- } | {
27
- key: string;
28
- label: string;
29
- type: "number";
30
- aggregate: string;
31
- showTrend: boolean;
32
- category: number;
33
- } | {
34
- key: string;
35
- label: string;
36
- type: "percentage";
37
- aggregate: string;
38
- showTrend: boolean;
39
- category: number;
40
- })[];
41
- categories: {
42
- key: string;
43
- label: string;
44
- type: string;
45
- }[];
46
- trends: {
47
- periods: string[];
48
- defaultPeriod: string;
49
- };
50
- };
51
- export declare const salesPerformanceData: {
52
- id: string;
53
- revenue: number;
54
- deals: number;
55
- conversion: number;
56
- pipeline: number;
57
- region: string;
58
- product: string;
59
- stage: string;
60
- date: string;
61
- salesperson: string;
62
- }[];
63
- //# sourceMappingURL=mockSalesData.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"mockSalesData.d.ts","sourceRoot":"","sources":["../../../../src/atoms/composed/SalesPanel/mockSalesData.ts"],"names":[],"mappings":"AACA,eAAO,MAAM,aAAa;;;;;;;;;;GAwDzB,CAAC;AAGF,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAkDvB,CAAC;AAGF,eAAO,MAAM,oBAAoB;;;;;;;;;;;GAqChC,CAAC"}
@@ -1,117 +0,0 @@
1
- import * as React from 'react';
2
- export type EntityType = 'transactional' | 'categorical' | 'temporal';
3
- export type MetricType = 'currency' | 'percentage' | 'count' | 'duration' | 'ratio';
4
- export type AggregationType = 'sum' | 'avg' | 'count' | 'min' | 'max';
5
- export type TemporalCycle = 'daily' | 'weekly' | 'monthly' | 'quarterly' | 'yearly';
6
- export type ForecastingAlgorithm = 'linear' | 'seasonal' | 'ml';
7
- export type ActionType = 'primary' | 'secondary' | 'danger';
8
- export interface FormatConfig {
9
- decimals?: number;
10
- prefix?: string;
11
- suffix?: string;
12
- thousands?: boolean;
13
- }
14
- export interface MetricConfig {
15
- key: string;
16
- label: string;
17
- type: MetricType;
18
- format?: FormatConfig;
19
- trend?: boolean;
20
- target?: number | ((data: EntityData[]) => number);
21
- aggregation?: AggregationType;
22
- icon?: React.ComponentType;
23
- }
24
- export interface TemporalConfig {
25
- cycles: TemporalCycle[];
26
- defaultCycle: TemporalCycle;
27
- enableComparisons: boolean;
28
- forecasting?: {
29
- enabled: boolean;
30
- periods: number;
31
- algorithm: ForecastingAlgorithm;
32
- };
33
- }
34
- export interface CategoryConfig {
35
- hierarchy: string[];
36
- defaultGroupBy: string;
37
- enableDrillDown: boolean;
38
- colorCoding?: boolean;
39
- }
40
- export interface ActionConfig {
41
- label: string;
42
- type: ActionType;
43
- onClick: (context: {
44
- selectedItems?: EntityData[];
45
- data?: EntityData[];
46
- config?: EntityTemplateConfig;
47
- }) => void | Promise<void>;
48
- icon?: React.ComponentType;
49
- permissions?: string[];
50
- validation?: (context: {
51
- selectedItems?: EntityData[];
52
- data?: EntityData[];
53
- config?: EntityTemplateConfig;
54
- }) => boolean;
55
- }
56
- export interface BusinessRulesConfig<T> {
57
- validation?: (item: T) => string[];
58
- constraints?: {
59
- [key: string]: {
60
- min?: number;
61
- max?: number;
62
- required?: boolean;
63
- pattern?: RegExp;
64
- };
65
- };
66
- workflows?: {
67
- [status: string]: string[];
68
- };
69
- }
70
- export interface EntityDisplayConfig {
71
- title: string;
72
- description?: string;
73
- category?: 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8;
74
- }
75
- export interface EntityTemplateConfig<T = EntityData> {
76
- entityType: EntityType;
77
- display: EntityDisplayConfig;
78
- metrics: MetricConfig[];
79
- temporal?: TemporalConfig;
80
- categories?: CategoryConfig;
81
- businessRules?: BusinessRulesConfig<T>;
82
- actions?: ActionConfig[];
83
- }
84
- export interface EntityData {
85
- id: string | number;
86
- [key: string]: unknown;
87
- }
88
- export interface MetricValue {
89
- current: number;
90
- previous?: number;
91
- trend?: 'up' | 'down' | 'neutral';
92
- target?: number;
93
- formattedValue: string;
94
- }
95
- export interface CategoryBreakdown {
96
- category: string;
97
- value: number;
98
- percentage: number;
99
- color?: string;
100
- subcategories?: CategoryBreakdown[];
101
- }
102
- export interface TrendDataPoint {
103
- date: string;
104
- value: number;
105
- label?: string;
106
- }
107
- export interface EntityAnalyticsData {
108
- metrics: Record<string, MetricValue>;
109
- categories: CategoryBreakdown[];
110
- trends: Record<string, TrendDataPoint[]>;
111
- insights?: {
112
- type: 'positive' | 'negative' | 'neutral';
113
- message: string;
114
- value?: number;
115
- }[];
116
- }
117
- //# sourceMappingURL=entity-config.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"entity-config.d.ts","sourceRoot":"","sources":["../../../src/atoms/types/entity-config.ts"],"names":[],"mappings":"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"}
@@ -1,30 +0,0 @@
1
- export type IconName = 'Palette' | 'Menu' | 'X' | 'Shield' | 'Users' | 'BarChart3' | 'Database' | 'TrendingUp' | 'Layout' | 'Home' | 'Settings' | 'Bell' | 'Search' | 'Plus' | 'Edit' | 'Trash2' | 'Eye' | 'Download' | 'Upload' | 'Share' | 'Lock' | 'Unlock' | 'Mail' | 'Phone' | 'Calendar' | 'Clock' | 'MapPin' | 'Star' | 'Heart' | 'Bookmark' | 'Tag' | 'Flag' | 'File' | 'Folder' | 'Image' | 'Video' | 'Music' | 'ChevronRight' | 'ChevronDown' | 'ChevronLeft' | 'ChevronUp' | 'ArrowRight' | 'ArrowLeft' | 'ArrowUp' | 'ArrowDown' | 'Check' | 'AlertCircle' | 'Info' | 'HelpCircle';
2
- export interface NavigationItem {
3
- /** Unique identifier for the navigation item */
4
- value: string;
5
- /** Display label for the navigation item */
6
- label: string;
7
- /** Path to navigate to when clicked */
8
- path: string;
9
- /** Icon name from Lucide React icons */
10
- icon: IconName;
11
- /** Optional category for color theming (1-8) */
12
- category?: 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8;
13
- /** Optional badge text/count to display */
14
- badge?: string | number;
15
- /** Whether this item is disabled */
16
- disabled?: boolean;
17
- /** Child navigation items for nested menus */
18
- children?: NavigationItem[];
19
- }
20
- export interface NavigationConfig {
21
- /** Main navigation items */
22
- items: NavigationItem[];
23
- /** Whether to show the default showcase navigation as fallback */
24
- showDefaultNavigation?: boolean;
25
- /** Custom logo or title for the sidebar header */
26
- logo?: string;
27
- /** Whether the sidebar starts expanded */
28
- defaultExpanded?: boolean;
29
- }
30
- //# sourceMappingURL=navigation.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"navigation.d.ts","sourceRoot":"","sources":["../../../src/atoms/types/navigation.ts"],"names":[],"mappings":"AAEA,MAAM,MAAM,QAAQ,GAChB,SAAS,GAAG,MAAM,GAAG,GAAG,GAAG,QAAQ,GAAG,OAAO,GAAG,WAAW,GAC3D,UAAU,GAAG,YAAY,GAAG,QAAQ,GAAG,MAAM,GAAG,UAAU,GAC1D,MAAM,GAAG,QAAQ,GAAG,MAAM,GAAG,MAAM,GAAG,QAAQ,GAAG,KAAK,GACtD,UAAU,GAAG,QAAQ,GAAG,OAAO,GAAG,MAAM,GAAG,QAAQ,GACnD,MAAM,GAAG,OAAO,GAAG,UAAU,GAAG,OAAO,GAAG,QAAQ,GAClD,MAAM,GAAG,OAAO,GAAG,UAAU,GAAG,KAAK,GAAG,MAAM,GAC9C,MAAM,GAAG,QAAQ,GAAG,OAAO,GAAG,OAAO,GAAG,OAAO,GAC/C,cAAc,GAAG,aAAa,GAAG,aAAa,GAAG,WAAW,GAC5D,YAAY,GAAG,WAAW,GAAG,SAAS,GAAG,WAAW,GACpD,OAAO,GAAG,aAAa,GAAG,MAAM,GAAG,YAAY,CAAA;AAEnD,MAAM,WAAW,cAAc;IAC7B,gDAAgD;IAChD,KAAK,EAAE,MAAM,CAAA;IACb,4CAA4C;IAC5C,KAAK,EAAE,MAAM,CAAA;IACb,uCAAuC;IACvC,IAAI,EAAE,MAAM,CAAA;IACZ,wCAAwC;IACxC,IAAI,EAAE,QAAQ,CAAA;IACd,gDAAgD;IAChD,QAAQ,CAAC,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,CAAA;IACxC,2CAA2C;IAC3C,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,CAAA;IACvB,oCAAoC;IACpC,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,8CAA8C;IAC9C,QAAQ,CAAC,EAAE,cAAc,EAAE,CAAA;CAC5B;AAED,MAAM,WAAW,gBAAgB;IAC/B,4BAA4B;IAC5B,KAAK,EAAE,cAAc,EAAE,CAAA;IACvB,kEAAkE;IAClE,qBAAqB,CAAC,EAAE,OAAO,CAAA;IAC/B,kDAAkD;IAClD,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,0CAA0C;IAC1C,eAAe,CAAC,EAAE,OAAO,CAAA;CAC1B"}
@@ -1,72 +0,0 @@
1
- import type { IconName } from '../types';
2
- export declare const iconMap: {
3
- Palette: import("react").ForwardRefExoticComponent<Omit<import("lucide-react").LucideProps, "ref"> & import("react").RefAttributes<SVGSVGElement>>;
4
- Menu: import("react").ForwardRefExoticComponent<Omit<import("lucide-react").LucideProps, "ref"> & import("react").RefAttributes<SVGSVGElement>>;
5
- X: import("react").ForwardRefExoticComponent<Omit<import("lucide-react").LucideProps, "ref"> & import("react").RefAttributes<SVGSVGElement>>;
6
- Shield: import("react").ForwardRefExoticComponent<Omit<import("lucide-react").LucideProps, "ref"> & import("react").RefAttributes<SVGSVGElement>>;
7
- Users: import("react").ForwardRefExoticComponent<Omit<import("lucide-react").LucideProps, "ref"> & import("react").RefAttributes<SVGSVGElement>>;
8
- BarChart3: import("react").ForwardRefExoticComponent<Omit<import("lucide-react").LucideProps, "ref"> & import("react").RefAttributes<SVGSVGElement>>;
9
- Database: import("react").ForwardRefExoticComponent<Omit<import("lucide-react").LucideProps, "ref"> & import("react").RefAttributes<SVGSVGElement>>;
10
- TrendingUp: import("react").ForwardRefExoticComponent<Omit<import("lucide-react").LucideProps, "ref"> & import("react").RefAttributes<SVGSVGElement>>;
11
- Layout: import("react").ForwardRefExoticComponent<Omit<import("lucide-react").LucideProps, "ref"> & import("react").RefAttributes<SVGSVGElement>>;
12
- Home: import("react").ForwardRefExoticComponent<Omit<import("lucide-react").LucideProps, "ref"> & import("react").RefAttributes<SVGSVGElement>>;
13
- Settings: import("react").ForwardRefExoticComponent<Omit<import("lucide-react").LucideProps, "ref"> & import("react").RefAttributes<SVGSVGElement>>;
14
- Bell: import("react").ForwardRefExoticComponent<Omit<import("lucide-react").LucideProps, "ref"> & import("react").RefAttributes<SVGSVGElement>>;
15
- Search: import("react").ForwardRefExoticComponent<Omit<import("lucide-react").LucideProps, "ref"> & import("react").RefAttributes<SVGSVGElement>>;
16
- Plus: import("react").ForwardRefExoticComponent<Omit<import("lucide-react").LucideProps, "ref"> & import("react").RefAttributes<SVGSVGElement>>;
17
- Edit: import("react").ForwardRefExoticComponent<Omit<import("lucide-react").LucideProps, "ref"> & import("react").RefAttributes<SVGSVGElement>>;
18
- Trash2: import("react").ForwardRefExoticComponent<Omit<import("lucide-react").LucideProps, "ref"> & import("react").RefAttributes<SVGSVGElement>>;
19
- Eye: import("react").ForwardRefExoticComponent<Omit<import("lucide-react").LucideProps, "ref"> & import("react").RefAttributes<SVGSVGElement>>;
20
- Download: import("react").ForwardRefExoticComponent<Omit<import("lucide-react").LucideProps, "ref"> & import("react").RefAttributes<SVGSVGElement>>;
21
- Upload: import("react").ForwardRefExoticComponent<Omit<import("lucide-react").LucideProps, "ref"> & import("react").RefAttributes<SVGSVGElement>>;
22
- Share: import("react").ForwardRefExoticComponent<Omit<import("lucide-react").LucideProps, "ref"> & import("react").RefAttributes<SVGSVGElement>>;
23
- Lock: import("react").ForwardRefExoticComponent<Omit<import("lucide-react").LucideProps, "ref"> & import("react").RefAttributes<SVGSVGElement>>;
24
- Unlock: import("react").ForwardRefExoticComponent<Omit<import("lucide-react").LucideProps, "ref"> & import("react").RefAttributes<SVGSVGElement>>;
25
- Mail: import("react").ForwardRefExoticComponent<Omit<import("lucide-react").LucideProps, "ref"> & import("react").RefAttributes<SVGSVGElement>>;
26
- Phone: import("react").ForwardRefExoticComponent<Omit<import("lucide-react").LucideProps, "ref"> & import("react").RefAttributes<SVGSVGElement>>;
27
- Calendar: import("react").ForwardRefExoticComponent<Omit<import("lucide-react").LucideProps, "ref"> & import("react").RefAttributes<SVGSVGElement>>;
28
- Clock: import("react").ForwardRefExoticComponent<Omit<import("lucide-react").LucideProps, "ref"> & import("react").RefAttributes<SVGSVGElement>>;
29
- MapPin: import("react").ForwardRefExoticComponent<Omit<import("lucide-react").LucideProps, "ref"> & import("react").RefAttributes<SVGSVGElement>>;
30
- Star: import("react").ForwardRefExoticComponent<Omit<import("lucide-react").LucideProps, "ref"> & import("react").RefAttributes<SVGSVGElement>>;
31
- Heart: import("react").ForwardRefExoticComponent<Omit<import("lucide-react").LucideProps, "ref"> & import("react").RefAttributes<SVGSVGElement>>;
32
- Bookmark: import("react").ForwardRefExoticComponent<Omit<import("lucide-react").LucideProps, "ref"> & import("react").RefAttributes<SVGSVGElement>>;
33
- Tag: import("react").ForwardRefExoticComponent<Omit<import("lucide-react").LucideProps, "ref"> & import("react").RefAttributes<SVGSVGElement>>;
34
- Flag: import("react").ForwardRefExoticComponent<Omit<import("lucide-react").LucideProps, "ref"> & import("react").RefAttributes<SVGSVGElement>>;
35
- File: import("react").ForwardRefExoticComponent<Omit<import("lucide-react").LucideProps, "ref"> & import("react").RefAttributes<SVGSVGElement>>;
36
- Folder: import("react").ForwardRefExoticComponent<Omit<import("lucide-react").LucideProps, "ref"> & import("react").RefAttributes<SVGSVGElement>>;
37
- Image: import("react").ForwardRefExoticComponent<Omit<import("lucide-react").LucideProps, "ref"> & import("react").RefAttributes<SVGSVGElement>>;
38
- Video: import("react").ForwardRefExoticComponent<Omit<import("lucide-react").LucideProps, "ref"> & import("react").RefAttributes<SVGSVGElement>>;
39
- Music: import("react").ForwardRefExoticComponent<Omit<import("lucide-react").LucideProps, "ref"> & import("react").RefAttributes<SVGSVGElement>>;
40
- ChevronRight: import("react").ForwardRefExoticComponent<Omit<import("lucide-react").LucideProps, "ref"> & import("react").RefAttributes<SVGSVGElement>>;
41
- ChevronDown: import("react").ForwardRefExoticComponent<Omit<import("lucide-react").LucideProps, "ref"> & import("react").RefAttributes<SVGSVGElement>>;
42
- ChevronLeft: import("react").ForwardRefExoticComponent<Omit<import("lucide-react").LucideProps, "ref"> & import("react").RefAttributes<SVGSVGElement>>;
43
- ChevronUp: import("react").ForwardRefExoticComponent<Omit<import("lucide-react").LucideProps, "ref"> & import("react").RefAttributes<SVGSVGElement>>;
44
- ArrowRight: import("react").ForwardRefExoticComponent<Omit<import("lucide-react").LucideProps, "ref"> & import("react").RefAttributes<SVGSVGElement>>;
45
- ArrowLeft: import("react").ForwardRefExoticComponent<Omit<import("lucide-react").LucideProps, "ref"> & import("react").RefAttributes<SVGSVGElement>>;
46
- ArrowUp: import("react").ForwardRefExoticComponent<Omit<import("lucide-react").LucideProps, "ref"> & import("react").RefAttributes<SVGSVGElement>>;
47
- ArrowDown: import("react").ForwardRefExoticComponent<Omit<import("lucide-react").LucideProps, "ref"> & import("react").RefAttributes<SVGSVGElement>>;
48
- Check: import("react").ForwardRefExoticComponent<Omit<import("lucide-react").LucideProps, "ref"> & import("react").RefAttributes<SVGSVGElement>>;
49
- AlertCircle: import("react").ForwardRefExoticComponent<Omit<import("lucide-react").LucideProps, "ref"> & import("react").RefAttributes<SVGSVGElement>>;
50
- Info: import("react").ForwardRefExoticComponent<Omit<import("lucide-react").LucideProps, "ref"> & import("react").RefAttributes<SVGSVGElement>>;
51
- HelpCircle: import("react").ForwardRefExoticComponent<Omit<import("lucide-react").LucideProps, "ref"> & import("react").RefAttributes<SVGSVGElement>>;
52
- };
53
- interface IconProps {
54
- name: IconName;
55
- className?: string;
56
- size?: number;
57
- [key: string]: any;
58
- }
59
- /**
60
- * Resolves an icon name to the corresponding Lucide React component
61
- */
62
- export declare const Icon: ({ name, className, size, ...props }: IconProps) => import("react/jsx-runtime").JSX.Element;
63
- /**
64
- * Get the icon component directly for custom rendering
65
- */
66
- export declare const getIcon: (name: IconName) => import("react").ForwardRefExoticComponent<Omit<import("lucide-react").LucideProps, "ref"> & import("react").RefAttributes<SVGSVGElement>>;
67
- /**
68
- * Check if an icon name is valid
69
- */
70
- export declare const isValidIcon: (name: string) => name is IconName;
71
- export {};
72
- //# sourceMappingURL=icon-resolver.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"icon-resolver.d.ts","sourceRoot":"","sources":["../../../src/atoms/utils/icon-resolver.tsx"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAA;AAGxC,eAAO,MAAM,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAOnB,CAAA;AAED,UAAU,SAAS;IACjB,IAAI,EAAE,QAAQ,CAAA;IACd,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAA;CACnB;AAED;;GAEG;AACH,eAAO,MAAM,IAAI,GAAI,qCAAiD,SAAS,4CAS9E,CAAA;AAED;;GAEG;AACH,eAAO,MAAM,OAAO,GAAI,MAAM,QAAQ,8IAErC,CAAA;AAED;;GAEG;AACH,eAAO,MAAM,WAAW,GAAI,MAAM,MAAM,KAAG,IAAI,IAAI,QAElD,CAAA"}
@@ -1,30 +0,0 @@
1
- import type { MetricConfig, MetricValue, EntityData, TrendDataPoint } from '../types';
2
- export declare class MetricCalculationEngine {
3
- static calculateMetric(config: MetricConfig, data: EntityData[], previousData?: EntityData[]): MetricValue;
4
- private static aggregateValue;
5
- private static extractValue;
6
- private static calculateTrend;
7
- private static formatValue;
8
- private static formatDuration;
9
- static calculateTrendData(config: MetricConfig, data: EntityData[], dateField?: string, periods?: number): TrendDataPoint[];
10
- private static groupByPeriod;
11
- private static formatDateLabel;
12
- static calculateCategoryBreakdown(data: EntityData[], categoryField: string, valueField: string, maxCategories?: number): {
13
- category: string;
14
- value: number;
15
- percentage: number;
16
- }[];
17
- static detectInsights(metrics: Record<string, MetricValue>, thresholds?: Record<string, {
18
- warning: number;
19
- critical: number;
20
- }>): ({
21
- type: "negative";
22
- message: string;
23
- value: number;
24
- } | {
25
- type: "positive";
26
- message: string;
27
- value: number;
28
- })[];
29
- }
30
- //# sourceMappingURL=metric-engine.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"metric-engine.d.ts","sourceRoot":"","sources":["../../../src/atoms/utils/metric-engine.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,WAAW,EAAE,UAAU,EAAgB,cAAc,EAAE,MAAM,UAAU,CAAC;AAEpG,qBAAa,uBAAuB;IAClC,MAAM,CAAC,eAAe,CACpB,MAAM,EAAE,YAAY,EACpB,IAAI,EAAE,UAAU,EAAE,EAClB,YAAY,CAAC,EAAE,UAAU,EAAE,GAC1B,WAAW;IAoBd,OAAO,CAAC,MAAM,CAAC,cAAc;IA4B7B,OAAO,CAAC,MAAM,CAAC,YAAY;IAI3B,OAAO,CAAC,MAAM,CAAC,cAAc;IAU7B,OAAO,CAAC,MAAM,CAAC,WAAW;IAuC1B,OAAO,CAAC,MAAM,CAAC,cAAc;IAU7B,MAAM,CAAC,kBAAkB,CACvB,MAAM,EAAE,YAAY,EACpB,IAAI,EAAE,UAAU,EAAE,EAClB,SAAS,GAAE,MAAe,EAC1B,OAAO,GAAE,MAAW,GACnB,cAAc,EAAE;IAWnB,OAAO,CAAC,MAAM,CAAC,aAAa;IAc5B,OAAO,CAAC,MAAM,CAAC,eAAe;IAQ9B,MAAM,CAAC,0BAA0B,CAC/B,IAAI,EAAE,UAAU,EAAE,EAClB,aAAa,EAAE,MAAM,EACrB,UAAU,EAAE,MAAM,EAClB,aAAa,GAAE,MAAU;;;;;IAuC3B,MAAM,CAAC,cAAc,CACnB,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,WAAW,CAAC,EACpC,UAAU,GAAE,MAAM,CAAC,MAAM,EAAE;QAAE,OAAO,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE,MAAM,CAAA;KAAE,CAAM;;;;;;;;;CAkCzE"}
@@ -1,16 +0,0 @@
1
- import React from 'react';
2
- interface DashboardWithSidePanelProps {
3
- /** Main dashboard content */
4
- children: React.ReactNode;
5
- /** Side panel component to display */
6
- sidePanel?: React.ReactNode;
7
- /** Whether to show the side panel */
8
- showSidePanel?: boolean;
9
- /** Side panel width in Tailwind units (e.g., 72, 80) */
10
- sidePanelWidth?: number;
11
- /** Additional CSS classes */
12
- className?: string;
13
- }
14
- export declare const DashboardWithSidePanel: React.FC<DashboardWithSidePanelProps>;
15
- export {};
16
- //# sourceMappingURL=DashboardWithSidePanel.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"DashboardWithSidePanel.d.ts","sourceRoot":"","sources":["../../../../src/molecules/layout/DashboardWithSidePanel/DashboardWithSidePanel.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,UAAU,2BAA2B;IACnC,6BAA6B;IAC7B,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,sCAAsC;IACtC,SAAS,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC5B,qCAAqC;IACrC,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,wDAAwD;IACxD,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,6BAA6B;IAC7B,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,eAAO,MAAM,sBAAsB,EAAE,KAAK,CAAC,EAAE,CAAC,2BAA2B,CAyBxE,CAAC"}
@@ -1,2 +0,0 @@
1
- export { DashboardWithSidePanel } from './DashboardWithSidePanel';
2
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/molecules/layout/DashboardWithSidePanel/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC"}
@@ -1,15 +0,0 @@
1
- import { type ReactNode } from 'react';
2
- import type { NavigationConfig, NavigationItem } from '../../atoms/types';
3
- interface NavigationContextType {
4
- navigation: NavigationConfig;
5
- setNavigation: (config: NavigationConfig) => void;
6
- }
7
- interface NavigationProviderProps {
8
- children: ReactNode;
9
- initialNavigation?: NavigationConfig;
10
- }
11
- export declare const NavigationProvider: ({ children, initialNavigation }: NavigationProviderProps) => import("react/jsx-runtime").JSX.Element;
12
- export declare const useNavigation: () => NavigationContextType;
13
- export declare const getNavigationItems: (config: NavigationConfig) => NavigationItem[];
14
- export {};
15
- //# sourceMappingURL=NavigationContext.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"NavigationContext.d.ts","sourceRoot":"","sources":["../../../src/molecules/layout/NavigationContext.tsx"],"names":[],"mappings":"AAAA,OAAc,EAA6B,KAAK,SAAS,EAAE,MAAM,OAAO,CAAA;AACxE,OAAO,KAAK,EAAE,gBAAgB,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAA;AAEzE,UAAU,qBAAqB;IAC7B,UAAU,EAAE,gBAAgB,CAAA;IAC5B,aAAa,EAAE,CAAC,MAAM,EAAE,gBAAgB,KAAK,IAAI,CAAA;CAClD;AAID,UAAU,uBAAuB;IAC/B,QAAQ,EAAE,SAAS,CAAA;IACnB,iBAAiB,CAAC,EAAE,gBAAgB,CAAA;CACrC;AAaD,eAAO,MAAM,kBAAkB,GAAI,iCAAiC,uBAAuB,4CAc1F,CAAA;AAED,eAAO,MAAM,aAAa,6BAMzB,CAAA;AAGD,eAAO,MAAM,kBAAkB,GAAI,QAAQ,gBAAgB,KAAG,cAAc,EAW3E,CAAA"}
@@ -1,106 +0,0 @@
1
- import { describe, it, expect } from 'vitest'
2
- import { render, screen } from '../../utils'
3
- import { DataBadge } from '../../../atoms/composed/DataBadge'
4
-
5
- describe('DataBadge (Composed)', () => {
6
- describe('status variant', () => {
7
- it('renders success status badge', () => {
8
- render(<DataBadge variant="status" status="success">Active</DataBadge>)
9
-
10
- const badge = screen.getByText('Active')
11
- expect(badge).toBeInTheDocument()
12
- expect(badge.className).toContain('status-success')
13
- })
14
-
15
- it('renders warning status badge', () => {
16
- render(<DataBadge variant="status" status="warning">Pending</DataBadge>)
17
-
18
- const badge = screen.getByText('Pending')
19
- expect(badge.className).toContain('status-warning')
20
- })
21
-
22
- it('renders error status badge', () => {
23
- render(<DataBadge variant="status" status="error">Failed</DataBadge>)
24
-
25
- const badge = screen.getByText('Failed')
26
- expect(badge.className).toContain('status-error')
27
- })
28
-
29
- it('renders info status badge', () => {
30
- render(<DataBadge variant="status" status="info">Processing</DataBadge>)
31
-
32
- const badge = screen.getByText('Processing')
33
- expect(badge.className).toContain('status-info')
34
- })
35
-
36
- it('renders neutral status badge', () => {
37
- render(<DataBadge variant="status" status="neutral">Draft</DataBadge>)
38
-
39
- const badge = screen.getByText('Draft')
40
- expect(badge.className).toContain('status-neutral')
41
- })
42
- })
43
-
44
- describe('category variant', () => {
45
- it('renders category 1 badge', () => {
46
- render(<DataBadge variant="category" category={1}>Category 1</DataBadge>)
47
-
48
- const badge = screen.getByText('Category 1')
49
- expect(badge).toBeInTheDocument()
50
- expect(badge.className).toContain('badge-category-1')
51
- })
52
-
53
- it('renders category 5 badge', () => {
54
- render(<DataBadge variant="category" category={5}>Category 5</DataBadge>)
55
-
56
- const badge = screen.getByText('Category 5')
57
- expect(badge.className).toContain('badge-category-5')
58
- })
59
-
60
- it('renders category 8 badge', () => {
61
- render(<DataBadge variant="category" category={8}>Category 8</DataBadge>)
62
-
63
- const badge = screen.getByText('Category 8')
64
- expect(badge.className).toContain('badge-category-8')
65
- })
66
- })
67
-
68
- it('applies additional className props', () => {
69
- render(
70
- <DataBadge variant="status" status="success" className="custom-class">
71
- Custom
72
- </DataBadge>
73
- )
74
-
75
- const badge = screen.getByText('Custom')
76
- expect(badge.className).toContain('custom-class')
77
- })
78
-
79
- it('renders with component data attribute', () => {
80
- render(
81
- <DataBadge variant="status" status="info">
82
- Test
83
- </DataBadge>
84
- )
85
-
86
- expect(screen.getByText('Test')).toHaveAttribute('data-component-name', 'DataBadge')
87
- })
88
-
89
- it('automatically uses default category', () => {
90
- render(<DataBadge>Default</DataBadge>)
91
-
92
- const badge = screen.getByText('Default')
93
- expect(badge.className).toContain('badge-category-1')
94
- })
95
-
96
- it('handles string and number status values', () => {
97
- const { rerender } = render(
98
- <DataBadge variant="status" status="success">String Status</DataBadge>
99
- )
100
-
101
- expect(screen.getByText('String Status')).toBeInTheDocument()
102
-
103
- rerender(<DataBadge variant="category" category={3}>Number Category</DataBadge>)
104
- expect(screen.getByText('Number Category')).toBeInTheDocument()
105
- })
106
- })