@attabot/complaint-app 1.0.10 → 1.0.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts CHANGED
@@ -1,217 +1,217 @@
1
- import type { ReactNode, CSSProperties, ChangeEvent, KeyboardEvent, MouseEvent } from 'react';
2
- import type { EnhancedStore } from '@reduxjs/toolkit';
3
-
4
- export interface SystemItem {
5
- id?: string | number;
6
- title?: string;
7
- name?: string;
8
- status?: 'active' | 'inactive' | string;
9
- statusLabel?: string;
10
- description?: string;
11
- descriptionHref?: string;
12
- departments?: number;
13
- workflows?: number;
14
- fields?: number;
15
- formsFilled?: number;
16
- updatedOn?: string;
17
- titleAsLink?: boolean;
18
- [key: string]: unknown;
19
- }
20
-
21
- export interface ComplaintAppProps {
22
- apiUrl?: string;
23
- authToken?: string;
24
- /** Optional isolated Redux store. When omitted, the package reuses a parent Provider, or creates its standalone store if none exists. */
25
- store?: EnhancedStore;
26
- basePath?: string;
27
- /** Static theme file `{ light, dark }` or flat token overrides. */
28
- theme?: ThemeFile | ThemeTokens;
29
- /** Parent-controlled dark mode. */
30
- darkMode?: boolean;
31
- title?: string;
32
- description?: string;
33
- systems?: SystemItem[];
34
- systemsEndpoint?: string;
35
- useDemoData?: boolean;
36
- createLabel?: string;
37
- onCreateForm?: () => void;
38
- onConfigure?: (system: SystemItem) => void;
39
- onOpen?: (system: Pick<SystemItem, 'id' | 'title'>) => void;
40
- onTitleClick?: (system: Pick<SystemItem, 'id' | 'title'>) => void;
41
- onDescriptionClick?: (payload: {
42
- id?: string | number;
43
- title?: string;
44
- descriptionHref?: string;
45
- }) => void;
46
- onSearch?: (query: string) => void;
47
- onPublish?: (payload: { systemId?: string; step?: number }) => void;
48
- onSaveDraft?: (payload: { systemId?: string; step?: number }) => void;
49
- showSaveButton?: boolean;
50
- showNextButton?: boolean;
51
- onStepChange?: (payload: {
52
- systemId?: string;
53
- step: number;
54
- substep?: number;
55
- }) => void;
56
- children?: ReactNode;
57
- }
58
-
59
- export interface ThemeTokens {
60
- mode?: 'light' | 'dark';
61
- colors?: Record<string, string>;
62
- radii?: Record<string, string>;
63
- spacing?: Record<string, string>;
64
- typography?: Record<string, string>;
65
- shadow?: Record<string, string>;
66
- }
67
-
68
- export interface ThemeFile {
69
- light?: ThemeTokens;
70
- dark?: ThemeTokens;
71
- }
72
-
73
- export declare const lightTheme: ThemeTokens;
74
- export declare const darkTheme: ThemeTokens;
75
- export declare const defaultThemeFile: ThemeFile;
76
- export declare function ThemeProvider(props: {
77
- theme?: ThemeFile | ThemeTokens;
78
- darkMode?: boolean;
79
- children: ReactNode;
80
- }): JSX.Element;
81
- export declare function useTheme(): {
82
- darkMode: boolean;
83
- mode: 'light' | 'dark';
84
- theme: ThemeTokens;
85
- themeFile: ThemeFile;
86
- cssVars: Record<string, string>;
87
- };
88
-
89
- export interface ApiProviderProps {
90
- children: ReactNode;
91
- apiUrl?: string;
92
- authToken?: string | null;
93
- }
94
-
95
- export declare const ComplaintApp: (props: ComplaintAppProps) => JSX.Element;
96
- export default ComplaintApp;
97
-
98
- export declare const ApiProvider: (props: ApiProviderProps) => JSX.Element;
99
- export declare function setBaseUrl(url: string): void;
100
- export declare function setAuthToken(token: string | null): void;
101
- export declare const api: import('axios').AxiosInstance;
102
- export declare const store: EnhancedStore;
103
- export declare function createComplaintStore(preloadedState?: unknown): EnhancedStore;
104
-
105
- export interface ComplaintResourceState<T = Record<string, unknown>> {
106
- data: T[];
107
- selected: T | null;
108
- pagination: Record<string, unknown> | null;
109
- isLoading: boolean;
110
- isMutating: boolean;
111
- error: string | null;
112
- }
113
-
114
- export interface ComplaintReduxState {
115
- complaintAppComplaint: {
116
- types: ComplaintResourceState;
117
- departments: ComplaintResourceState;
118
- priorities: ComplaintResourceState;
119
- workflows: ComplaintResourceState;
120
- statuses: ComplaintResourceState;
121
- departmentTree: Record<string, unknown>[];
122
- workflowSteps: Record<string, unknown>;
123
- isLoadingDepartmentTree: boolean;
124
- isLoadingWorkflowSteps: boolean;
125
- error: string | null;
126
- };
127
- }
128
-
129
- export declare const COMPLAINT_ENDPOINTS: Readonly<Record<string, string>>;
130
- export declare const complaintTypeActions: Record<string, unknown>;
131
- export declare const complaintDepartmentActions: Record<string, unknown>;
132
- export declare const complaintPriorityActions: Record<string, unknown>;
133
- export declare const complaintWorkflowActions: Record<string, unknown>;
134
- export declare const complaintStatusActions: Record<string, unknown>;
135
-
136
- export declare const DEMO_SYSTEMS: SystemItem[];
137
- export declare const DEFAULT_PAGE_DESCRIPTION: string;
138
-
139
- export declare const colors: Record<string, string>;
140
- export declare const radii: Record<string, string>;
141
- export declare const spacing: Record<string, string>;
142
- export declare const typography: Record<string, CSSProperties | string>;
143
-
144
- export declare function Button(props: {
145
- children?: ReactNode;
146
- variant?: 'primary' | 'secondary' | 'outline' | 'ghost' | 'link';
147
- size?: 'md' | 'sm' | 'lg';
148
- startIcon?: ReactNode;
149
- endIcon?: ReactNode;
150
- className?: string;
151
- type?: 'button' | 'submit' | 'reset';
152
- disabled?: boolean;
153
- onClick?: (e: MouseEvent<HTMLButtonElement>) => void;
154
- [key: string]: unknown;
155
- }): JSX.Element;
156
-
157
- export declare function Input(props: {
158
- value?: string;
159
- onChange?: (e: ChangeEvent<HTMLInputElement>) => void;
160
- onKeyDown?: (e: KeyboardEvent<HTMLInputElement>) => void;
161
- placeholder?: string;
162
- type?: string;
163
- icon?: ReactNode;
164
- className?: string;
165
- inputClassName?: string;
166
- [key: string]: unknown;
167
- }): JSX.Element;
168
-
169
- export declare function StatusBadge(props: {
170
- status?: string;
171
- label?: string;
172
- className?: string;
173
- }): JSX.Element;
174
-
175
- export declare function SearchBar(props: {
176
- value?: string;
177
- onChange?: (e: ChangeEvent<HTMLInputElement>) => void;
178
- onSearch?: (value?: string) => void;
179
- placeholder?: string;
180
- className?: string;
181
- }): JSX.Element;
182
-
183
- export declare function SystemCard(props: SystemItem & {
184
- onConfigure?: (system: SystemItem) => void;
185
- onOpen?: (system: Pick<SystemItem, 'id' | 'title'>) => void;
186
- onTitleClick?: (system: Pick<SystemItem, 'id' | 'title'>) => void;
187
- onDescriptionClick?: (payload: {
188
- id?: string | number;
189
- title?: string;
190
- descriptionHref?: string;
191
- }) => void;
192
- className?: string;
193
- }): JSX.Element;
194
-
195
- export declare function PageHeader(props: {
196
- title?: string;
197
- description?: string;
198
- actionLabel?: string;
199
- onAction?: () => void;
200
- className?: string;
201
- }): JSX.Element;
202
-
203
- export declare function SystemCardGrid(props: {
204
- systems?: SystemItem[];
205
- onConfigure?: (system: SystemItem) => void;
206
- onOpen?: (system: Pick<SystemItem, 'id' | 'title'>) => void;
207
- onTitleClick?: (system: Pick<SystemItem, 'id' | 'title'>) => void;
208
- onDescriptionClick?: (payload: {
209
- id?: string | number;
210
- title?: string;
211
- descriptionHref?: string;
212
- }) => void;
213
- emptyMessage?: string;
214
- className?: string;
215
- }): JSX.Element;
216
-
217
- export declare function ComplaintManagementPage(props: Omit<ComplaintAppProps, 'apiUrl' | 'authToken' | 'basePath' | 'children'>): JSX.Element;
1
+ import type { ReactNode, CSSProperties, ChangeEvent, KeyboardEvent, MouseEvent } from 'react';
2
+ import type { EnhancedStore } from '@reduxjs/toolkit';
3
+
4
+ export interface SystemItem {
5
+ id?: string | number;
6
+ title?: string;
7
+ name?: string;
8
+ status?: 'active' | 'inactive' | string;
9
+ statusLabel?: string;
10
+ description?: string;
11
+ descriptionHref?: string;
12
+ departments?: number;
13
+ workflows?: number;
14
+ fields?: number;
15
+ formsFilled?: number;
16
+ updatedOn?: string;
17
+ titleAsLink?: boolean;
18
+ [key: string]: unknown;
19
+ }
20
+
21
+ export interface ComplaintAppProps {
22
+ apiUrl?: string;
23
+ authToken?: string;
24
+ /** Optional isolated Redux store. When omitted, the package reuses a parent Provider, or creates its standalone store if none exists. */
25
+ store?: EnhancedStore;
26
+ basePath?: string;
27
+ /** Static theme file `{ light, dark }` or flat token overrides. */
28
+ theme?: ThemeFile | ThemeTokens;
29
+ /** Parent-controlled dark mode. */
30
+ darkMode?: boolean;
31
+ title?: string;
32
+ description?: string;
33
+ systems?: SystemItem[];
34
+ systemsEndpoint?: string;
35
+ useDemoData?: boolean;
36
+ createLabel?: string;
37
+ onCreateForm?: () => void;
38
+ onConfigure?: (system: SystemItem) => void;
39
+ onOpen?: (system: Pick<SystemItem, 'id' | 'title'>) => void;
40
+ onTitleClick?: (system: Pick<SystemItem, 'id' | 'title'>) => void;
41
+ onDescriptionClick?: (payload: {
42
+ id?: string | number;
43
+ title?: string;
44
+ descriptionHref?: string;
45
+ }) => void;
46
+ onSearch?: (query: string) => void;
47
+ onPublish?: (payload: { systemId?: string; step?: number }) => void;
48
+ onSaveDraft?: (payload: { systemId?: string; step?: number }) => void;
49
+ showSaveButton?: boolean;
50
+ showNextButton?: boolean;
51
+ onStepChange?: (payload: {
52
+ systemId?: string;
53
+ step: number;
54
+ substep?: number;
55
+ }) => void;
56
+ children?: ReactNode;
57
+ }
58
+
59
+ export interface ThemeTokens {
60
+ mode?: 'light' | 'dark';
61
+ colors?: Record<string, string>;
62
+ radii?: Record<string, string>;
63
+ spacing?: Record<string, string>;
64
+ typography?: Record<string, string>;
65
+ shadow?: Record<string, string>;
66
+ }
67
+
68
+ export interface ThemeFile {
69
+ light?: ThemeTokens;
70
+ dark?: ThemeTokens;
71
+ }
72
+
73
+ export declare const lightTheme: ThemeTokens;
74
+ export declare const darkTheme: ThemeTokens;
75
+ export declare const defaultThemeFile: ThemeFile;
76
+ export declare function ThemeProvider(props: {
77
+ theme?: ThemeFile | ThemeTokens;
78
+ darkMode?: boolean;
79
+ children: ReactNode;
80
+ }): JSX.Element;
81
+ export declare function useTheme(): {
82
+ darkMode: boolean;
83
+ mode: 'light' | 'dark';
84
+ theme: ThemeTokens;
85
+ themeFile: ThemeFile;
86
+ cssVars: Record<string, string>;
87
+ };
88
+
89
+ export interface ApiProviderProps {
90
+ children: ReactNode;
91
+ apiUrl?: string;
92
+ authToken?: string | null;
93
+ }
94
+
95
+ export declare const ComplaintApp: (props: ComplaintAppProps) => JSX.Element;
96
+ export default ComplaintApp;
97
+
98
+ export declare const ApiProvider: (props: ApiProviderProps) => JSX.Element;
99
+ export declare function setBaseUrl(url: string): void;
100
+ export declare function setAuthToken(token: string | null): void;
101
+ export declare const api: import('axios').AxiosInstance;
102
+ export declare const store: EnhancedStore;
103
+ export declare function createComplaintStore(preloadedState?: unknown): EnhancedStore;
104
+
105
+ export interface ComplaintResourceState<T = Record<string, unknown>> {
106
+ data: T[];
107
+ selected: T | null;
108
+ pagination: Record<string, unknown> | null;
109
+ isLoading: boolean;
110
+ isMutating: boolean;
111
+ error: string | null;
112
+ }
113
+
114
+ export interface ComplaintReduxState {
115
+ complaintAppComplaint: {
116
+ types: ComplaintResourceState;
117
+ departments: ComplaintResourceState;
118
+ priorities: ComplaintResourceState;
119
+ workflows: ComplaintResourceState;
120
+ statuses: ComplaintResourceState;
121
+ departmentTree: Record<string, unknown>[];
122
+ workflowSteps: Record<string, unknown>;
123
+ isLoadingDepartmentTree: boolean;
124
+ isLoadingWorkflowSteps: boolean;
125
+ error: string | null;
126
+ };
127
+ }
128
+
129
+ export declare const COMPLAINT_ENDPOINTS: Readonly<Record<string, string>>;
130
+ export declare const complaintTypeActions: Record<string, unknown>;
131
+ export declare const complaintDepartmentActions: Record<string, unknown>;
132
+ export declare const complaintPriorityActions: Record<string, unknown>;
133
+ export declare const complaintWorkflowActions: Record<string, unknown>;
134
+ export declare const complaintStatusActions: Record<string, unknown>;
135
+
136
+ export declare const DEMO_SYSTEMS: SystemItem[];
137
+ export declare const DEFAULT_PAGE_DESCRIPTION: string;
138
+
139
+ export declare const colors: Record<string, string>;
140
+ export declare const radii: Record<string, string>;
141
+ export declare const spacing: Record<string, string>;
142
+ export declare const typography: Record<string, CSSProperties | string>;
143
+
144
+ export declare function Button(props: {
145
+ children?: ReactNode;
146
+ variant?: 'primary' | 'secondary' | 'outline' | 'ghost' | 'link';
147
+ size?: 'md' | 'sm' | 'lg';
148
+ startIcon?: ReactNode;
149
+ endIcon?: ReactNode;
150
+ className?: string;
151
+ type?: 'button' | 'submit' | 'reset';
152
+ disabled?: boolean;
153
+ onClick?: (e: MouseEvent<HTMLButtonElement>) => void;
154
+ [key: string]: unknown;
155
+ }): JSX.Element;
156
+
157
+ export declare function Input(props: {
158
+ value?: string;
159
+ onChange?: (e: ChangeEvent<HTMLInputElement>) => void;
160
+ onKeyDown?: (e: KeyboardEvent<HTMLInputElement>) => void;
161
+ placeholder?: string;
162
+ type?: string;
163
+ icon?: ReactNode;
164
+ className?: string;
165
+ inputClassName?: string;
166
+ [key: string]: unknown;
167
+ }): JSX.Element;
168
+
169
+ export declare function StatusBadge(props: {
170
+ status?: string;
171
+ label?: string;
172
+ className?: string;
173
+ }): JSX.Element;
174
+
175
+ export declare function SearchBar(props: {
176
+ value?: string;
177
+ onChange?: (e: ChangeEvent<HTMLInputElement>) => void;
178
+ onSearch?: (value?: string) => void;
179
+ placeholder?: string;
180
+ className?: string;
181
+ }): JSX.Element;
182
+
183
+ export declare function SystemCard(props: SystemItem & {
184
+ onConfigure?: (system: SystemItem) => void;
185
+ onOpen?: (system: Pick<SystemItem, 'id' | 'title'>) => void;
186
+ onTitleClick?: (system: Pick<SystemItem, 'id' | 'title'>) => void;
187
+ onDescriptionClick?: (payload: {
188
+ id?: string | number;
189
+ title?: string;
190
+ descriptionHref?: string;
191
+ }) => void;
192
+ className?: string;
193
+ }): JSX.Element;
194
+
195
+ export declare function PageHeader(props: {
196
+ title?: string;
197
+ description?: string;
198
+ actionLabel?: string;
199
+ onAction?: () => void;
200
+ className?: string;
201
+ }): JSX.Element;
202
+
203
+ export declare function SystemCardGrid(props: {
204
+ systems?: SystemItem[];
205
+ onConfigure?: (system: SystemItem) => void;
206
+ onOpen?: (system: Pick<SystemItem, 'id' | 'title'>) => void;
207
+ onTitleClick?: (system: Pick<SystemItem, 'id' | 'title'>) => void;
208
+ onDescriptionClick?: (payload: {
209
+ id?: string | number;
210
+ title?: string;
211
+ descriptionHref?: string;
212
+ }) => void;
213
+ emptyMessage?: string;
214
+ className?: string;
215
+ }): JSX.Element;
216
+
217
+ export declare function ComplaintManagementPage(props: Omit<ComplaintAppProps, 'apiUrl' | 'authToken' | 'basePath' | 'children'>): JSX.Element;