teraprox-ui-kit 0.1.1 → 0.1.5

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "teraprox-ui-kit",
3
- "version": "0.1.1",
3
+ "version": "0.1.5",
4
4
  "description": "Componentes visuais compartilhados entre módulos federados TeraproX",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",
@@ -41,16 +41,36 @@
41
41
  "file-saver": ">=2.0.0"
42
42
  },
43
43
  "peerDependenciesMeta": {
44
- "react-bootstrap-typeahead": { "optional": true },
45
- "browser-image-compression": { "optional": true },
46
- "react-dropzone": { "optional": true },
47
- "react-color": { "optional": true },
48
- "recharts": { "optional": true },
49
- "qr-scanner": { "optional": true },
50
- "qrcode": { "optional": true },
51
- "react-qr-code": { "optional": true },
52
- "file-saver": { "optional": true },
53
- "dayjs": { "optional": true }
44
+ "react-bootstrap-typeahead": {
45
+ "optional": true
46
+ },
47
+ "browser-image-compression": {
48
+ "optional": true
49
+ },
50
+ "react-dropzone": {
51
+ "optional": true
52
+ },
53
+ "react-color": {
54
+ "optional": true
55
+ },
56
+ "recharts": {
57
+ "optional": true
58
+ },
59
+ "qr-scanner": {
60
+ "optional": true
61
+ },
62
+ "qrcode": {
63
+ "optional": true
64
+ },
65
+ "react-qr-code": {
66
+ "optional": true
67
+ },
68
+ "file-saver": {
69
+ "optional": true
70
+ },
71
+ "dayjs": {
72
+ "optional": true
73
+ }
54
74
  },
55
75
  "devDependencies": {
56
76
  "@types/react": "^18.2.0",
package/dist/index.d.mts DELETED
@@ -1,164 +0,0 @@
1
- import React from 'react';
2
-
3
- interface AddButtonProps {
4
- callback: () => void;
5
- hiddenBool?: boolean;
6
- size?: number;
7
- }
8
- declare const AddButton: React.FC<AddButtonProps>;
9
-
10
- interface DeleteButtonProps {
11
- title: string;
12
- onDeleteClick: () => void;
13
- }
14
- declare const DeleteButton: React.FC<DeleteButtonProps>;
15
-
16
- interface ResponsiveContainerProps {
17
- title?: string;
18
- show: boolean;
19
- setShow: (show: boolean) => void;
20
- children: React.ReactNode;
21
- onClose?: () => void;
22
- scrollable?: boolean;
23
- }
24
- /**
25
- * ResponsiveContainer Component
26
- *
27
- * Renders a Modal for displaying content in a responsive container.
28
- * Previously used GenericOffCanvas for mobile, now uses Modal consistently.
29
- *
30
- * @param title - The title of the modal.
31
- * @param show - Controls the visibility of the modal.
32
- * @param setShow - Function to update the visibility state.
33
- * @param children - Content to be rendered inside the modal.
34
- * @param onClose - Optional function to be executed on close.
35
- * @param scrollable - Optional prop to enable scrolling the content.
36
- */
37
- declare const ResponsiveContainer: React.FC<ResponsiveContainerProps>;
38
-
39
- interface UuidPillProps {
40
- uuid: string | null | undefined;
41
- bg?: string;
42
- textColor?: string;
43
- short?: number;
44
- }
45
- declare const UuidPill: React.FC<UuidPillProps>;
46
-
47
- declare class ConfigObject {
48
- dotNotation: string;
49
- style?: React.CSSProperties;
50
- onClick?: () => void;
51
- onBlur?: () => void;
52
- onHideClick?: () => void;
53
- hidden?: boolean;
54
- mapData?: any;
55
- additionalComponents?: (() => React.ReactNode)[];
56
- constructor(dotNotation: string, style?: React.CSSProperties, onClick?: () => void, onBlur?: () => void, onHideClick?: () => void, hidden?: boolean, mapData?: any, additionalComponents?: (() => React.ReactNode)[]);
57
- }
58
- interface GenericDisplayProps {
59
- ops?: any[];
60
- loadFunc?: () => Promise<any>;
61
- configObjects?: ConfigObject[];
62
- rootName?: string;
63
- context?: string;
64
- /** Optional hook to call on mount/context update. Replaces the app-specific useContextUpdateHandler. */
65
- onRefresh?: (refreshFunc: () => void) => void;
66
- /** Optional renderer for edit buttons on root objects. */
67
- editButtonRenderer?: (obj: any, location: string | null) => React.ReactNode;
68
- }
69
- declare const GenericDisplay: React.FC<GenericDisplayProps>;
70
-
71
- interface MailSenderProps {
72
- /** Conteúdo HTML a ser enviado no corpo do e-mail */
73
- htmlContent: string;
74
- /** Nome da empresa para o assunto/corpo padrão */
75
- companyName: string;
76
- /** Callback para buscar a lista de e-mails da companhia */
77
- onFetchEmails: () => Promise<Array<{
78
- email: string;
79
- }>>;
80
- /** Callback para enviar o e-mail consolidado */
81
- onSendEmail: (emailData: {
82
- to: string;
83
- subject: string;
84
- text: string;
85
- html: string;
86
- }) => Promise<void>;
87
- /** Flag para ocultar o componente */
88
- hide?: boolean;
89
- /** Render prop opcional para o botão de ativação customizado */
90
- renderTrigger?: (props: {
91
- onClick: () => void;
92
- loading: boolean;
93
- }) => React.ReactNode;
94
- }
95
- /**
96
- * Componente para seleção de destinatários e envio de e-mails.
97
- * Refatorado para ser agnóstico a implementações de hooks/endpoints específicos das apps.
98
- */
99
- declare const MailSender: React.FC<MailSenderProps>;
100
-
101
- interface SelectOption {
102
- label: string;
103
- value: string | number;
104
- }
105
- interface FieldDefinition {
106
- label: string;
107
- key: string;
108
- type: 'text' | 'number' | 'select' | 'date' | 'custom-select';
109
- options?: SelectOption[];
110
- placeholder?: string;
111
- required?: boolean;
112
- }
113
- interface GenericFormProps {
114
- fields: FieldDefinition[];
115
- onSubmit: (values: Record<string, any>) => void;
116
- /** Optional custom select renderer. If not provided, custom-select falls back to native select. */
117
- renderCustomSelect?: (props: {
118
- label: string;
119
- value: any;
120
- options?: SelectOption[];
121
- onChange: (value: any) => void;
122
- placeholder?: string;
123
- }) => React.ReactNode;
124
- }
125
- declare const GenericForm: React.FC<GenericFormProps>;
126
-
127
- interface GenericSelectProps {
128
- noLabel?: boolean;
129
- title?: string;
130
- onChange: (value: any) => void;
131
- ops?: any[];
132
- selection?: any;
133
- returnType?: string;
134
- displayType?: string;
135
- filter?: string;
136
- filterField?: string;
137
- valueType?: string;
138
- loadFunc?: () => Promise<any>;
139
- loadCondition?: boolean;
140
- actionClick?: () => React.ReactNode;
141
- locked?: boolean;
142
- isBold?: boolean;
143
- default?: string;
144
- }
145
- declare class GenericSelectOps {
146
- noLabel?: boolean;
147
- title?: string;
148
- onChange?: (value: any) => void;
149
- ops?: any[];
150
- selection?: any;
151
- returnType?: string;
152
- displayType?: string;
153
- filter?: string;
154
- filterField?: string;
155
- valueType?: string;
156
- loadFunc?: () => Promise<any>;
157
- loadCondition?: boolean;
158
- actionClick?: () => React.ReactNode;
159
- locked?: boolean;
160
- constructor(noLabel?: boolean, title?: string, onChange?: (value: any) => void, ops?: any[], selection?: any, returnType?: string, displayType?: string, filter?: string, filterField?: string, valueType?: string, loadFunc?: () => Promise<any>, loadCondition?: boolean, actionClick?: () => React.ReactNode, locked?: boolean);
161
- }
162
- declare const GenericSelect: React.FC<GenericSelectProps>;
163
-
164
- export { AddButton, ConfigObject, DeleteButton, GenericDisplay, GenericForm, GenericSelect, GenericSelectOps, MailSender, type MailSenderProps, ResponsiveContainer, UuidPill };
package/dist/index.d.ts DELETED
@@ -1,164 +0,0 @@
1
- import React from 'react';
2
-
3
- interface AddButtonProps {
4
- callback: () => void;
5
- hiddenBool?: boolean;
6
- size?: number;
7
- }
8
- declare const AddButton: React.FC<AddButtonProps>;
9
-
10
- interface DeleteButtonProps {
11
- title: string;
12
- onDeleteClick: () => void;
13
- }
14
- declare const DeleteButton: React.FC<DeleteButtonProps>;
15
-
16
- interface ResponsiveContainerProps {
17
- title?: string;
18
- show: boolean;
19
- setShow: (show: boolean) => void;
20
- children: React.ReactNode;
21
- onClose?: () => void;
22
- scrollable?: boolean;
23
- }
24
- /**
25
- * ResponsiveContainer Component
26
- *
27
- * Renders a Modal for displaying content in a responsive container.
28
- * Previously used GenericOffCanvas for mobile, now uses Modal consistently.
29
- *
30
- * @param title - The title of the modal.
31
- * @param show - Controls the visibility of the modal.
32
- * @param setShow - Function to update the visibility state.
33
- * @param children - Content to be rendered inside the modal.
34
- * @param onClose - Optional function to be executed on close.
35
- * @param scrollable - Optional prop to enable scrolling the content.
36
- */
37
- declare const ResponsiveContainer: React.FC<ResponsiveContainerProps>;
38
-
39
- interface UuidPillProps {
40
- uuid: string | null | undefined;
41
- bg?: string;
42
- textColor?: string;
43
- short?: number;
44
- }
45
- declare const UuidPill: React.FC<UuidPillProps>;
46
-
47
- declare class ConfigObject {
48
- dotNotation: string;
49
- style?: React.CSSProperties;
50
- onClick?: () => void;
51
- onBlur?: () => void;
52
- onHideClick?: () => void;
53
- hidden?: boolean;
54
- mapData?: any;
55
- additionalComponents?: (() => React.ReactNode)[];
56
- constructor(dotNotation: string, style?: React.CSSProperties, onClick?: () => void, onBlur?: () => void, onHideClick?: () => void, hidden?: boolean, mapData?: any, additionalComponents?: (() => React.ReactNode)[]);
57
- }
58
- interface GenericDisplayProps {
59
- ops?: any[];
60
- loadFunc?: () => Promise<any>;
61
- configObjects?: ConfigObject[];
62
- rootName?: string;
63
- context?: string;
64
- /** Optional hook to call on mount/context update. Replaces the app-specific useContextUpdateHandler. */
65
- onRefresh?: (refreshFunc: () => void) => void;
66
- /** Optional renderer for edit buttons on root objects. */
67
- editButtonRenderer?: (obj: any, location: string | null) => React.ReactNode;
68
- }
69
- declare const GenericDisplay: React.FC<GenericDisplayProps>;
70
-
71
- interface MailSenderProps {
72
- /** Conteúdo HTML a ser enviado no corpo do e-mail */
73
- htmlContent: string;
74
- /** Nome da empresa para o assunto/corpo padrão */
75
- companyName: string;
76
- /** Callback para buscar a lista de e-mails da companhia */
77
- onFetchEmails: () => Promise<Array<{
78
- email: string;
79
- }>>;
80
- /** Callback para enviar o e-mail consolidado */
81
- onSendEmail: (emailData: {
82
- to: string;
83
- subject: string;
84
- text: string;
85
- html: string;
86
- }) => Promise<void>;
87
- /** Flag para ocultar o componente */
88
- hide?: boolean;
89
- /** Render prop opcional para o botão de ativação customizado */
90
- renderTrigger?: (props: {
91
- onClick: () => void;
92
- loading: boolean;
93
- }) => React.ReactNode;
94
- }
95
- /**
96
- * Componente para seleção de destinatários e envio de e-mails.
97
- * Refatorado para ser agnóstico a implementações de hooks/endpoints específicos das apps.
98
- */
99
- declare const MailSender: React.FC<MailSenderProps>;
100
-
101
- interface SelectOption {
102
- label: string;
103
- value: string | number;
104
- }
105
- interface FieldDefinition {
106
- label: string;
107
- key: string;
108
- type: 'text' | 'number' | 'select' | 'date' | 'custom-select';
109
- options?: SelectOption[];
110
- placeholder?: string;
111
- required?: boolean;
112
- }
113
- interface GenericFormProps {
114
- fields: FieldDefinition[];
115
- onSubmit: (values: Record<string, any>) => void;
116
- /** Optional custom select renderer. If not provided, custom-select falls back to native select. */
117
- renderCustomSelect?: (props: {
118
- label: string;
119
- value: any;
120
- options?: SelectOption[];
121
- onChange: (value: any) => void;
122
- placeholder?: string;
123
- }) => React.ReactNode;
124
- }
125
- declare const GenericForm: React.FC<GenericFormProps>;
126
-
127
- interface GenericSelectProps {
128
- noLabel?: boolean;
129
- title?: string;
130
- onChange: (value: any) => void;
131
- ops?: any[];
132
- selection?: any;
133
- returnType?: string;
134
- displayType?: string;
135
- filter?: string;
136
- filterField?: string;
137
- valueType?: string;
138
- loadFunc?: () => Promise<any>;
139
- loadCondition?: boolean;
140
- actionClick?: () => React.ReactNode;
141
- locked?: boolean;
142
- isBold?: boolean;
143
- default?: string;
144
- }
145
- declare class GenericSelectOps {
146
- noLabel?: boolean;
147
- title?: string;
148
- onChange?: (value: any) => void;
149
- ops?: any[];
150
- selection?: any;
151
- returnType?: string;
152
- displayType?: string;
153
- filter?: string;
154
- filterField?: string;
155
- valueType?: string;
156
- loadFunc?: () => Promise<any>;
157
- loadCondition?: boolean;
158
- actionClick?: () => React.ReactNode;
159
- locked?: boolean;
160
- constructor(noLabel?: boolean, title?: string, onChange?: (value: any) => void, ops?: any[], selection?: any, returnType?: string, displayType?: string, filter?: string, filterField?: string, valueType?: string, loadFunc?: () => Promise<any>, loadCondition?: boolean, actionClick?: () => React.ReactNode, locked?: boolean);
161
- }
162
- declare const GenericSelect: React.FC<GenericSelectProps>;
163
-
164
- export { AddButton, ConfigObject, DeleteButton, GenericDisplay, GenericForm, GenericSelect, GenericSelectOps, MailSender, type MailSenderProps, ResponsiveContainer, UuidPill };