@integrativedesigndevelopment/dashboard-core 0.0.2

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 (88) hide show
  1. package/README.md +775 -0
  2. package/dist/actions/pluginActions.d.ts +48 -0
  3. package/dist/actions/pluginActions.d.ts.map +1 -0
  4. package/dist/actions/types.d.ts +17 -0
  5. package/dist/actions/types.d.ts.map +1 -0
  6. package/dist/components/ActivityProvider/index.d.ts +10 -0
  7. package/dist/components/ActivityProvider/index.d.ts.map +1 -0
  8. package/dist/components/CancelActionButton/index.d.ts +11 -0
  9. package/dist/components/CancelActionButton/index.d.ts.map +1 -0
  10. package/dist/components/ConfirmActionButton/index.d.ts +12 -0
  11. package/dist/components/ConfirmActionButton/index.d.ts.map +1 -0
  12. package/dist/components/ErrorBoundary/index.d.ts +18 -0
  13. package/dist/components/ErrorBoundary/index.d.ts.map +1 -0
  14. package/dist/components/IDDLink/index.d.ts +10 -0
  15. package/dist/components/IDDLink/index.d.ts.map +1 -0
  16. package/dist/components/IDDLinkInputItem/index.d.ts +18 -0
  17. package/dist/components/IDDLinkInputItem/index.d.ts.map +1 -0
  18. package/dist/components/Layout/SimpleLayout.d.ts +8 -0
  19. package/dist/components/Layout/SimpleLayout.d.ts.map +1 -0
  20. package/dist/components/Layout/index.d.ts +8 -0
  21. package/dist/components/Layout/index.d.ts.map +1 -0
  22. package/dist/components/Password/index.d.ts +15 -0
  23. package/dist/components/Password/index.d.ts.map +1 -0
  24. package/dist/components/SimpleButton/index.d.ts +10 -0
  25. package/dist/components/SimpleButton/index.d.ts.map +1 -0
  26. package/dist/components/TextInput/index.d.ts +16 -0
  27. package/dist/components/TextInput/index.d.ts.map +1 -0
  28. package/dist/components/helpers.d.ts +5 -0
  29. package/dist/components/helpers.d.ts.map +1 -0
  30. package/dist/components/index.d.ts +16 -0
  31. package/dist/components/index.d.ts.map +1 -0
  32. package/dist/config/index.d.ts +23 -0
  33. package/dist/config/index.d.ts.map +1 -0
  34. package/dist/hooks/index.d.ts +3 -0
  35. package/dist/hooks/index.d.ts.map +1 -0
  36. package/dist/hooks/useAsyncOperation.d.ts +12 -0
  37. package/dist/hooks/useAsyncOperation.d.ts.map +1 -0
  38. package/dist/hooks/useUpdateUser.d.ts +32 -0
  39. package/dist/hooks/useUpdateUser.d.ts.map +1 -0
  40. package/dist/hooks/useUserManagement.d.ts +51 -0
  41. package/dist/hooks/useUserManagement.d.ts.map +1 -0
  42. package/dist/index.d.ts +16 -0
  43. package/dist/index.d.ts.map +1 -0
  44. package/dist/index.esm.js +14 -0
  45. package/dist/index.esm.js.map +1 -0
  46. package/dist/index.js +14 -0
  47. package/dist/index.js.map +1 -0
  48. package/dist/metrics/clsMetrics.d.ts +3 -0
  49. package/dist/metrics/clsMetrics.d.ts.map +1 -0
  50. package/dist/metrics/fcpMetrics.d.ts +3 -0
  51. package/dist/metrics/fcpMetrics.d.ts.map +1 -0
  52. package/dist/metrics/fidMetrics.d.ts +3 -0
  53. package/dist/metrics/fidMetrics.d.ts.map +1 -0
  54. package/dist/metrics/index.d.ts +3 -0
  55. package/dist/metrics/index.d.ts.map +1 -0
  56. package/dist/metrics/lcpMetrics.d.ts +3 -0
  57. package/dist/metrics/lcpMetrics.d.ts.map +1 -0
  58. package/dist/metrics/ttfbMetrics.d.ts +3 -0
  59. package/dist/metrics/ttfbMetrics.d.ts.map +1 -0
  60. package/dist/plugin-system/DashboardProvider.d.ts +14 -0
  61. package/dist/plugin-system/DashboardProvider.d.ts.map +1 -0
  62. package/dist/plugin-system/PluginManager.d.ts +9 -0
  63. package/dist/plugin-system/PluginManager.d.ts.map +1 -0
  64. package/dist/plugin-system/core/Dashboard/Icon.d.ts +6 -0
  65. package/dist/plugin-system/core/Dashboard/Icon.d.ts.map +1 -0
  66. package/dist/plugin-system/core/Dashboard/index.d.ts +4 -0
  67. package/dist/plugin-system/core/Dashboard/index.d.ts.map +1 -0
  68. package/dist/plugin-system/core/Dashboard/tab0.d.ts +8 -0
  69. package/dist/plugin-system/core/Dashboard/tab0.d.ts.map +1 -0
  70. package/dist/plugin-system/core/Dashboard/views/DashboardView/index.d.ts +3 -0
  71. package/dist/plugin-system/core/Dashboard/views/DashboardView/index.d.ts.map +1 -0
  72. package/dist/plugin-system/index.d.ts +6 -0
  73. package/dist/plugin-system/index.d.ts.map +1 -0
  74. package/dist/plugin-system/plugin_manifest.d.ts +2 -0
  75. package/dist/plugin-system/plugin_manifest.d.ts.map +1 -0
  76. package/dist/plugin-system/types.d.ts +76 -0
  77. package/dist/plugin-system/types.d.ts.map +1 -0
  78. package/dist/services/errorServices.d.ts +37 -0
  79. package/dist/services/errorServices.d.ts.map +1 -0
  80. package/dist/types/index.d.ts +66 -0
  81. package/dist/types/index.d.ts.map +1 -0
  82. package/dist/utils/array-safety.d.ts +32 -0
  83. package/dist/utils/array-safety.d.ts.map +1 -0
  84. package/dist/utils/fromReq.d.ts +3 -0
  85. package/dist/utils/fromReq.d.ts.map +1 -0
  86. package/dist/utils/helpers.d.ts +27 -0
  87. package/dist/utils/helpers.d.ts.map +1 -0
  88. package/package.json +59 -0
@@ -0,0 +1,3 @@
1
+ import type { NextWebVitalsMetric } from 'next/app';
2
+ export default function clsMetrics(metric: NextWebVitalsMetric): void;
3
+ //# sourceMappingURL=clsMetrics.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"clsMetrics.d.ts","sourceRoot":"","sources":["../../src/metrics/clsMetrics.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAC;AAEpD,MAAM,CAAC,OAAO,UAAU,UAAU,CAAC,MAAM,EAAE,mBAAmB,QAqB7D"}
@@ -0,0 +1,3 @@
1
+ import type { NextWebVitalsMetric } from 'next/app';
2
+ export default function fcpMetrics(metric: NextWebVitalsMetric): void;
3
+ //# sourceMappingURL=fcpMetrics.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"fcpMetrics.d.ts","sourceRoot":"","sources":["../../src/metrics/fcpMetrics.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAC;AAEpD,MAAM,CAAC,OAAO,UAAU,UAAU,CAAC,MAAM,EAAE,mBAAmB,QAyB7D"}
@@ -0,0 +1,3 @@
1
+ import type { NextWebVitalsMetric } from 'next/app';
2
+ export default function fidMetrics(metric: NextWebVitalsMetric): void;
3
+ //# sourceMappingURL=fidMetrics.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"fidMetrics.d.ts","sourceRoot":"","sources":["../../src/metrics/fidMetrics.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAC;AAEpD,MAAM,CAAC,OAAO,UAAU,UAAU,CAAC,MAAM,EAAE,mBAAmB,QAoB7D"}
@@ -0,0 +1,3 @@
1
+ import type { NextWebVitalsMetric } from 'next/app';
2
+ export default function metrics(metric: NextWebVitalsMetric): void;
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/metrics/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAC;AAOpD,MAAM,CAAC,OAAO,UAAU,OAAO,CAAC,MAAM,EAAE,mBAAmB,QAqC1D"}
@@ -0,0 +1,3 @@
1
+ import type { NextWebVitalsMetric } from 'next/app';
2
+ export default function lcpMetrics(metric: NextWebVitalsMetric): void;
3
+ //# sourceMappingURL=lcpMetrics.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"lcpMetrics.d.ts","sourceRoot":"","sources":["../../src/metrics/lcpMetrics.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAC;AAEpD,MAAM,CAAC,OAAO,UAAU,UAAU,CAAC,MAAM,EAAE,mBAAmB,QAoB7D"}
@@ -0,0 +1,3 @@
1
+ import type { NextWebVitalsMetric } from 'next/app';
2
+ export default function ttfbMetrics(metric: NextWebVitalsMetric): void;
3
+ //# sourceMappingURL=ttfbMetrics.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ttfbMetrics.d.ts","sourceRoot":"","sources":["../../src/metrics/ttfbMetrics.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAC;AAEpD,MAAM,CAAC,OAAO,UAAU,WAAW,CAAC,MAAM,EAAE,mBAAmB,QAqB9D"}
@@ -0,0 +1,14 @@
1
+ import React, { type ReactNode } from 'react';
2
+ import type { DashboardConfig } from '../types';
3
+ interface DashboardContextType {
4
+ config: DashboardConfig;
5
+ updateConfig: (updates: Partial<DashboardConfig>) => void;
6
+ }
7
+ export interface DashboardProviderProps {
8
+ config: DashboardConfig;
9
+ children: ReactNode;
10
+ }
11
+ export declare const DashboardProvider: React.FC<DashboardProviderProps>;
12
+ export declare const useDashboard: () => DashboardContextType;
13
+ export default DashboardProvider;
14
+ //# sourceMappingURL=DashboardProvider.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DashboardProvider.d.ts","sourceRoot":"","sources":["../../src/plugin-system/DashboardProvider.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAiB,KAAK,SAAS,EAAc,MAAM,OAAO,CAAC;AACzE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAEhD,UAAU,oBAAoB;IAC5B,MAAM,EAAE,eAAe,CAAC;IACxB,YAAY,EAAE,CAAC,OAAO,EAAE,OAAO,CAAC,eAAe,CAAC,KAAK,IAAI,CAAC;CAC3D;AAMD,MAAM,WAAW,sBAAsB;IACrC,MAAM,EAAE,eAAe,CAAC;IACxB,QAAQ,EAAE,SAAS,CAAC;CACrB;AAED,eAAO,MAAM,iBAAiB,EAAE,KAAK,CAAC,EAAE,CAAC,sBAAsB,CAqB9D,CAAC;AAEF,eAAO,MAAM,YAAY,QAAO,oBAM/B,CAAC;AAEF,eAAe,iBAAiB,CAAC"}
@@ -0,0 +1,9 @@
1
+ import type React from 'react';
2
+ import type { IDDPlugin } from './types';
3
+ export interface PluginManagerProps {
4
+ plugins: IDDPlugin[];
5
+ children?: React.ReactNode;
6
+ }
7
+ declare const PluginManager: React.FC<PluginManagerProps>;
8
+ export default PluginManager;
9
+ //# sourceMappingURL=PluginManager.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PluginManager.d.ts","sourceRoot":"","sources":["../../src/plugin-system/PluginManager.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAEzC,MAAM,WAAW,kBAAkB;IACjC,OAAO,EAAE,SAAS,EAAE,CAAC;IACrB,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAC5B;AAED,QAAA,MAAM,aAAa,EAAE,KAAK,CAAC,EAAE,CAAC,kBAAkB,CAmD/C,CAAC;AAEF,eAAe,aAAa,CAAC"}
@@ -0,0 +1,6 @@
1
+ import type { FC } from 'react';
2
+ declare const Icon: FC<{
3
+ color: string;
4
+ }>;
5
+ export default Icon;
6
+ //# sourceMappingURL=Icon.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Icon.d.ts","sourceRoot":"","sources":["../../../../src/plugin-system/core/Dashboard/Icon.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,EAAgB,MAAM,OAAO,CAAC;AAE9C,QAAA,MAAM,IAAI,EAAE,EAAE,CAAC;IAAE,KAAK,EAAE,MAAM,CAAA;CAAE,CAyC/B,CAAC;AAEF,eAAe,IAAI,CAAC"}
@@ -0,0 +1,4 @@
1
+ import type { IDDPlugin } from '../../types';
2
+ declare const get_dashboard_plugin: () => IDDPlugin;
3
+ export default get_dashboard_plugin;
4
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/plugin-system/core/Dashboard/index.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAG7C,QAAA,MAAM,oBAAoB,QAAO,SAM/B,CAAC;AAEH,eAAe,oBAAoB,CAAC"}
@@ -0,0 +1,8 @@
1
+ import { type ReactElement } from 'react';
2
+ import type { IDDPluginTab } from '../../types';
3
+ export interface WidgetizerProps {
4
+ widgets: ReactElement[];
5
+ }
6
+ declare const DashboardTab: IDDPluginTab;
7
+ export default DashboardTab;
8
+ //# sourceMappingURL=tab0.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tab0.d.ts","sourceRoot":"","sources":["../../../../src/plugin-system/core/Dashboard/tab0.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAqB,KAAK,YAAY,EAAE,MAAM,OAAO,CAAC;AAC7D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAGhD,MAAM,WAAW,eAAe;IAC9B,OAAO,EAAE,YAAY,EAAE,CAAC;CACzB;AAUD,QAAA,MAAM,YAAY,EAAE,YAInB,CAAC;AAEF,eAAe,YAAY,CAAC"}
@@ -0,0 +1,3 @@
1
+ declare const _default: any;
2
+ export default _default;
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/plugin-system/core/Dashboard/views/DashboardView/index.tsx"],"names":[],"mappings":"wBA+I4B,GAAG;AAN/B,wBAMgC"}
@@ -0,0 +1,6 @@
1
+ import type { IDDPlugin } from './types';
2
+ export declare const get_all_plugins: (_icon_color?: string) => IDDPlugin[];
3
+ export type { DashboardProviderProps } from './DashboardProvider';
4
+ export { default as DashboardProvider, useDashboard, } from './DashboardProvider';
5
+ export { default as PluginManager } from './PluginManager';
6
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/plugin-system/index.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAmB,MAAM,SAAS,CAAC;AAU1D,eAAO,MAAM,eAAe,GAAI,cAAc,MAAM,KAAG,SAAS,EAG/D,CAAC;AAEF,YAAY,EAAE,sBAAsB,EAAE,MAAM,qBAAqB,CAAC;AAClE,OAAO,EACL,OAAO,IAAI,iBAAiB,EAC5B,YAAY,GACb,MAAM,qBAAqB,CAAC;AAE7B,OAAO,EAAE,OAAO,IAAI,aAAa,EAAE,MAAM,iBAAiB,CAAC"}
@@ -0,0 +1,2 @@
1
+ export declare const project_plugins: never[];
2
+ //# sourceMappingURL=plugin_manifest.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"plugin_manifest.d.ts","sourceRoot":"","sources":["../../src/plugin-system/plugin_manifest.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,eAAe,SAAK,CAAC"}
@@ -0,0 +1,76 @@
1
+ import type { IDDIconProps } from '@integrativedesigndevelopment/idd-icons';
2
+ import type React from 'react';
3
+ import type { FC, ReactElement, ReactNode } from 'react';
4
+ /**
5
+ * @name IDDPlugin
6
+ * @description type extended by all plugins
7
+ * @param id - name by which programs reference plugin
8
+ * @param name - plugin name as seen on frontend
9
+ * @param order - desired order in side-bar from top to bottom
10
+ * @param actions - array of PluginActions used within plugin
11
+ * @param tabs - ordered array of tabs within plugin, minimum length of one
12
+ * @param dashboardWidget - widget presented to default dashboard plugin
13
+ * @param data - data of Plugin
14
+ * @param options - plugin specific options that appear in the settings menu
15
+ */
16
+ export interface WidgetizerProps extends React.Component<any, any> {
17
+ widgets?: ReactElement[];
18
+ }
19
+ export interface IDDPlugin {
20
+ id: string;
21
+ name: string;
22
+ order: number;
23
+ tabs: IDDPluginTab[];
24
+ icon?: FC<IDDIconProps>;
25
+ dashboardWidget?: FC;
26
+ actions?: any;
27
+ types?: Object;
28
+ state?: any;
29
+ settings?: IDDPluginSetting[];
30
+ }
31
+ export interface IDDPluginSetting {
32
+ key: string;
33
+ label: string;
34
+ type: 'dropdown' | 'toggle';
35
+ options?: string[];
36
+ }
37
+ /**
38
+ * @name IDDPluginTab
39
+ * @description Tab optionally contained within
40
+ * @param id - programmer refereced id of tab
41
+ * @param name - tab name seen on frontend
42
+ * @param content - react content displayed on tab
43
+ */
44
+ export interface IDDPluginTab {
45
+ id: string;
46
+ name: string;
47
+ content: any;
48
+ icon?: ReactNode;
49
+ }
50
+ export interface IDDCurrentPlugin {
51
+ id: string;
52
+ tab: number;
53
+ }
54
+ /**
55
+ * @name IDDPluginNotification
56
+ * @description notification that is on Navbar of dashboard
57
+ * @param title - short title of notification
58
+ * @param msg - verbose message of notification
59
+ * @param origin - id of plugin from which notification originated
60
+ * @param date - date of notification creation
61
+ */
62
+ export interface IDDPluginNotification {
63
+ title: ReactNode;
64
+ msg: string;
65
+ date: string;
66
+ origin?: string;
67
+ }
68
+ export interface WidgetizerProps extends React.Component<any, any> {
69
+ widgets?: ReactElement[];
70
+ }
71
+ /**
72
+ * @name IDDPluginExport
73
+ * @description Type for plugin exports - can be a single plugin or array of plugins
74
+ */
75
+ export type IDDPluginExport = IDDPlugin | IDDPlugin[];
76
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/plugin-system/types.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,yCAAyC,CAAC;AAC5E,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,EAAE,EAAE,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEzD;;;;;;;;;;;GAWG;AAEH,MAAM,WAAW,eAAgB,SAAQ,KAAK,CAAC,SAAS,CAAC,GAAG,EAAE,GAAG,CAAC;IAChE,OAAO,CAAC,EAAE,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"}
@@ -0,0 +1,37 @@
1
+ import type React from 'react';
2
+ import { type ReactNode } from 'react';
3
+ export type ErrorType = 'error' | 'success' | 'warning' | 'info';
4
+ export interface ErrorMessage {
5
+ id: string;
6
+ type: ErrorType;
7
+ message: string;
8
+ timestamp: number;
9
+ autoHide?: boolean;
10
+ duration?: number;
11
+ }
12
+ interface ErrorContextValue {
13
+ errors: ErrorMessage[];
14
+ addError: (message: string, type?: ErrorType, autoHide?: boolean, duration?: number) => string;
15
+ removeError: (id: string) => void;
16
+ clearErrors: () => void;
17
+ showError: (message: string, autoHide?: boolean) => string;
18
+ showSuccess: (message: string, autoHide?: boolean) => string;
19
+ showWarning: (message: string, autoHide?: boolean) => string;
20
+ showInfo: (message: string, autoHide?: boolean) => string;
21
+ }
22
+ interface ErrorProviderProps {
23
+ children: ReactNode;
24
+ }
25
+ export declare const ErrorProvider: React.FC<ErrorProviderProps>;
26
+ export declare const useError: () => ErrorContextValue;
27
+ export declare const useErrorBoundary: () => {
28
+ handleError: (error: Error, errorInfo?: any) => void;
29
+ };
30
+ interface ErrorToastProps {
31
+ error: ErrorMessage;
32
+ onClose: (id: string) => void;
33
+ }
34
+ export declare const ErrorToast: React.FC<ErrorToastProps>;
35
+ export declare const ErrorToastContainer: React.FC;
36
+ export {};
37
+ //# sourceMappingURL=errorServices.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"errorServices.d.ts","sourceRoot":"","sources":["../../src/services/errorServices.tsx"],"names":[],"mappings":"AAOA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAEL,KAAK,SAAS,EAMf,MAAM,OAAO,CAAC;AAEf,MAAM,MAAM,SAAS,GAAG,OAAO,GAAG,SAAS,GAAG,SAAS,GAAG,MAAM,CAAC;AAEjE,MAAM,WAAW,YAAY;IAC3B,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,SAAS,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,M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,EAAE,KAAK,CAAC,EAiBvC,CAAC"}
@@ -0,0 +1,66 @@
1
+ export interface DashboardConfig {
2
+ theme: ThemeConfig;
3
+ auth: AuthConfig;
4
+ plugins: PluginConfig[];
5
+ navigation: NavigationConfig;
6
+ branding: BrandingConfig;
7
+ }
8
+ export interface ThemeConfig {
9
+ primaryColor: string;
10
+ darkMode: boolean;
11
+ customCSS?: string;
12
+ }
13
+ export interface AuthConfig {
14
+ provider: 'jwt' | 'oauth' | 'custom';
15
+ endpoints: {
16
+ login: string;
17
+ logout: string;
18
+ refresh: string;
19
+ };
20
+ }
21
+ export interface PluginConfig {
22
+ id: string;
23
+ enabled: boolean;
24
+ settings?: Record<string, any>;
25
+ }
26
+ export interface NavigationConfig {
27
+ sideNavCollapsed: boolean;
28
+ showNotifications: boolean;
29
+ customLinks?: NavLink[];
30
+ }
31
+ export interface NavLink {
32
+ id: string;
33
+ label: string;
34
+ href: string;
35
+ icon?: React.ComponentType;
36
+ external?: boolean;
37
+ }
38
+ export interface BrandingConfig {
39
+ logo: string;
40
+ appName: string;
41
+ favicon?: string;
42
+ }
43
+ export interface BaseComponentProps {
44
+ className?: string;
45
+ children?: React.ReactNode;
46
+ }
47
+ export interface IDDError {
48
+ message: string;
49
+ code?: string;
50
+ details?: any;
51
+ }
52
+ export interface User {
53
+ id: string;
54
+ email: string;
55
+ name: string;
56
+ role: string;
57
+ avatar?: string;
58
+ }
59
+ export interface Activity {
60
+ id: string;
61
+ type: string;
62
+ message: string;
63
+ timestamp: Date;
64
+ userId?: string;
65
+ }
66
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"AACA,MAAM,WAAW,eAAe;IAC9B,KAAK,EAAE,WAAW,CAAC;IACnB,IAAI,EAAE,UAAU,CAAC;IACjB,OAAO,EAAE,YAAY,EAAE,CAAC;IACxB,UAAU,EAAE,gBAAgB,CAAC;IAC7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C;CACf;AAGD,MAAM,WAAW,IAAI;IACnB,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAGD,MAAM,WAAW,QAAQ;IACvB,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,IAAI,CAAC;IAChB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB"}
@@ -0,0 +1,32 @@
1
+ /**
2
+ * Utility functions for safe array operations during SSR and client-side rendering
3
+ */
4
+ /**
5
+ * Safely ensures a value is an array, returning empty array if null/undefined
6
+ */
7
+ export declare function ensureArray<T>(value: T[] | null | undefined): T[];
8
+ /**
9
+ * Safely filter an array with null/undefined checks
10
+ */
11
+ export declare function safeFilter<T>(array: T[] | null | undefined, predicate: (value: T, index: number, array: T[]) => boolean): T[];
12
+ /**
13
+ * Safely map an array with null/undefined checks
14
+ */
15
+ export declare function safeMap<T, U>(array: T[] | null | undefined, mapper: (value: T, index: number, array: T[]) => U): U[];
16
+ /**
17
+ * Safely find in an array with null/undefined checks
18
+ */
19
+ export declare function safeFind<T>(array: T[] | null | undefined, predicate: (value: T, index: number, array: T[]) => boolean): T | undefined;
20
+ /**
21
+ * Safely check if array has some element matching predicate
22
+ */
23
+ export declare function safeSome<T>(array: T[] | null | undefined, predicate: (value: T, index: number, array: T[]) => boolean): boolean;
24
+ /**
25
+ * Safely get array length
26
+ */
27
+ export declare function safeLength<T>(array: T[] | null | undefined): number;
28
+ /**
29
+ * Type guard to check if value is a non-empty array
30
+ */
31
+ export declare function isNonEmptyArray<T>(value: any): value is T[];
32
+ //# sourceMappingURL=array-safety.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"array-safety.d.ts","sourceRoot":"","sources":["../../src/utils/array-safety.ts"],"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gB,eAAe,CAAC,CAAC,EAAE,KAAK,EAAE,GAAG,GAAG,KAAK,IAAI,CAAC,EAAE,CAE3D"}
@@ -0,0 +1,3 @@
1
+ declare const getLangFromReq: (req?: object | any) => string;
2
+ export { getLangFromReq };
3
+ //# sourceMappingURL=fromReq.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"fromReq.d.ts","sourceRoot":"","sources":["../../src/utils/fromReq.ts"],"names":[],"mappings":"AAKA,QAAA,MAAM,cAAc,GAAI,MAAK,MAAM,GAAG,GAAQ,KAAG,MAMhD,CAAC;AAEF,OAAO,EAAE,cAAc,EAAE,CAAC"}
@@ -0,0 +1,27 @@
1
+ import { type FC } from 'react';
2
+ export interface ContentItemProps {
3
+ type: string;
4
+ style: string;
5
+ text: string;
6
+ items: any;
7
+ orderedListStyle?: string;
8
+ unorderedListStyle?: string;
9
+ paragraphStyle?: string;
10
+ }
11
+ export declare const ContentItem: FC<ContentItemProps>;
12
+ export declare const truncate: (str: string, maxLength: number) => string;
13
+ export interface WindowDimensionsProps {
14
+ width: number;
15
+ height: number;
16
+ }
17
+ export declare const useWindowDimensions: () => WindowDimensionsProps;
18
+ export declare function getArraysDiff<T>(a: T[], b: T[]): T[];
19
+ export declare function flatten(arr: any[]): any[];
20
+ export declare const getLocationString: (loc: any) => string;
21
+ /**
22
+ * Maps EVALUATOR role to MODERATOR role to avoid adding extra role values
23
+ * @param role - The user role
24
+ * @returns The mapped role (EVALUATOR becomes MODERATOR, others unchanged)
25
+ */
26
+ export declare const mapUserRole: (role: string) => string;
27
+ //# sourceMappingURL=helpers.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"helpers.d.ts","sourceRoot":"","sources":["../../src/utils/helpers.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,EAA0C,MAAM,OAAO,CAAC;AAqBxE,MAAM,WAAW,gBAAgB;IAC/B,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,GAAG,CAAC;IACX,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB;AAGD,eAAO,MAAM,WAAW,EAAE,EAAE,CAAC,gBAAgB,CAyE5C,CAAC;AAEF,eAAO,MAAM,QAAQ,GAAI,KAAK,MAAM,EAAE,WAAW,MAAM,WAMtD,CAAC;AAEF,MAAM,WAAW,qBAAqB;IACpC,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,eAAO,MAAM,mBAAmB,QAAO,qBAmBtC,CAAC;AAEF,wBAAgB,aAAa,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,EAAE,CAAC,EAAE,GAAG,CAAC,EAAE,CAQpD;AAED,wBAAgB,OAAO,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,GAAG,EAAE,CAQzC;AAED,eAAO,MAAM,iBAAiB,GAAI,KAAK,GAAG,KAAG,MAwB5C,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,WAAW,GAAI,MAAM,MAAM,KAAG,MAE1C,CAAC"}
package/package.json ADDED
@@ -0,0 +1,59 @@
1
+ {
2
+ "name": "@integrativedesigndevelopment/dashboard-core",
3
+ "version": "0.0.2",
4
+ "description": "Core components and utilities for IDD Dashboard",
5
+ "main": "dist/index.js",
6
+ "module": "dist/index.esm.js",
7
+ "types": "dist/index.d.ts",
8
+ "files": [
9
+ "dist"
10
+ ],
11
+ "scripts": {
12
+ "build": "rollup -c",
13
+ "dev": "rollup -c -w",
14
+ "test": "bun test --preload ./test-setup.ts",
15
+ "test:watch": "bun test --watch --preload ./test-setup.ts",
16
+ "lint": "eslint src --ext .ts,.tsx",
17
+ "lint:fix": "eslint src --ext .ts,.tsx --fix",
18
+ "type-check": "tsc --noEmit",
19
+ "clean": "rm -rf dist"
20
+ },
21
+ "keywords": [
22
+ "dashboard",
23
+ "react",
24
+ "typescript",
25
+ "components",
26
+ "plugin-system"
27
+ ],
28
+ "author": "Integrative Design Development",
29
+ "license": "MIT",
30
+ "peerDependencies": {
31
+ "react": "^18.0.0",
32
+ "react-dom": "^18.0.0"
33
+ },
34
+ "dependencies": {
35
+ "@integrativedesigndevelopment/idd-common": "^3.1.31",
36
+ "deepmerge": "^4.3.1",
37
+ "luxon": "^3.6.1",
38
+ "react-redux": "^7.2.9",
39
+ "redux": "^5.0.1",
40
+ "reselect": "^5.1.1"
41
+ },
42
+ "devDependencies": {
43
+ "@rollup/plugin-commonjs": "^28.0.6",
44
+ "@rollup/plugin-node-resolve": "^16.0.1",
45
+ "@rollup/plugin-typescript": "^12.1.4",
46
+ "@types/jsdom": "21.1.7",
47
+ "@types/react": "^18.3.0",
48
+ "@types/react-dom": "^18.3.0",
49
+ "jsdom": "26.1.0",
50
+ "rollup": "^4.46.2",
51
+ "rollup-plugin-peer-deps-external": "^2.2.4",
52
+ "rollup-plugin-terser": "^7.0.2",
53
+ "typescript": "^5.0.4"
54
+ },
55
+ "publishConfig": {
56
+ "access": "restricted"
57
+ },
58
+ "gitHead": "a19da2114d52e94a297e0d1a39f881af857ac959"
59
+ }