tcce-design-system 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.
- package/README.md +204 -0
- package/dist/assets/brand/Logo_Total_Civil_Construction/Entrega_Logo_Total.ai +2795 -7
- package/dist/assets/brand/Logo_Total_Civil_Construction/Entrega_Logo_Total.pdf +2950 -10
- package/dist/assets/brand/Logo_Total_Civil_Construction/Entrega_Logo_Total_AW.png +0 -0
- package/dist/assets/brand/Logo_Total_Civil_Construction/Entrega_Logo_Total_CB.png +0 -0
- package/dist/assets/brand/Logo_Total_Civil_Construction/Entrega_Logo_Total_CBT.png +0 -0
- package/dist/assets/brand/Logo_Total_Civil_Construction/Entrega_Logo_Total_CC.png +0 -0
- package/dist/assets/brand/Logo_Total_Civil_Construction/Entrega_Logo_Total_M.png +0 -0
- package/dist/assets/brand/Logo_Total_Civil_Construction/Entrega_Logo_Total_NT.png +0 -0
- package/dist/assets/brand/Logo_Total_Civil_Construction_Optimize/Entrega_Logo_Total_AW.webp +0 -0
- package/dist/assets/brand/Logo_Total_Civil_Construction_Optimize/Entrega_Logo_Total_AW.webp:Zone.Identifier +0 -0
- package/dist/assets/brand/Logo_Total_Civil_Construction_Optimize/Entrega_Logo_Total_CB.webp +0 -0
- package/dist/assets/brand/Logo_Total_Civil_Construction_Optimize/Entrega_Logo_Total_CB.webp:Zone.Identifier +0 -0
- package/dist/assets/brand/Logo_Total_Civil_Construction_Optimize/Entrega_Logo_Total_CBT.webp +0 -0
- package/dist/assets/brand/Logo_Total_Civil_Construction_Optimize/Entrega_Logo_Total_CBT.webp:Zone.Identifier +0 -0
- package/dist/assets/brand/Logo_Total_Civil_Construction_Optimize/Entrega_Logo_Total_CC.webp +0 -0
- package/dist/assets/brand/Logo_Total_Civil_Construction_Optimize/Entrega_Logo_Total_CC.webp:Zone.Identifier +0 -0
- package/dist/assets/brand/Logo_Total_Civil_Construction_Optimize/Entrega_Logo_Total_M.webp +0 -0
- package/dist/assets/brand/Logo_Total_Civil_Construction_Optimize/Entrega_Logo_Total_M.webp:Zone.Identifier +0 -0
- package/dist/assets/brand/Logo_Total_Civil_Construction_Optimize/Entrega_Logo_Total_NT.webp +0 -0
- package/dist/assets/brand/Logo_Total_Civil_Construction_Optimize/Entrega_Logo_Total_NT.webp:Zone.Identifier +0 -0
- package/dist/assets/brand/favicon.svg +7 -0
- package/dist/assets/fonts/Dax-Bold/Dax-Bold.otf +0 -0
- package/dist/assets/fonts/Helvetica-Neue/HelveticaNeueBlack.otf +0 -0
- package/dist/assets/fonts/Helvetica-Neue/HelveticaNeueBlackItalic.otf +0 -0
- package/dist/assets/fonts/Helvetica-Neue/HelveticaNeueBold.otf +0 -0
- package/dist/assets/fonts/Helvetica-Neue/HelveticaNeueBoldItalic.otf +0 -0
- package/dist/assets/fonts/Helvetica-Neue/HelveticaNeueHeavy.otf +0 -0
- package/dist/assets/fonts/Helvetica-Neue/HelveticaNeueHeavyItalic.otf +0 -0
- package/dist/assets/fonts/Helvetica-Neue/HelveticaNeueItalic.ttf +0 -0
- package/dist/assets/fonts/Helvetica-Neue/HelveticaNeueLight.otf +0 -0
- package/dist/assets/fonts/Helvetica-Neue/HelveticaNeueLightItalic.otf +0 -0
- package/dist/assets/fonts/Helvetica-Neue/HelveticaNeueMedium.otf +0 -0
- package/dist/assets/fonts/Helvetica-Neue/HelveticaNeueMediumItalic.otf +0 -0
- package/dist/assets/fonts/Helvetica-Neue/HelveticaNeueRoman.otf +0 -0
- package/dist/assets/fonts/Helvetica-Neue/HelveticaNeueThin.otf +0 -0
- package/dist/assets/fonts/Helvetica-Neue/HelveticaNeueThinItalic.otf +0 -0
- package/dist/assets/fonts/Helvetica-Neue/HelveticaNeueUltraLight.otf +0 -0
- package/dist/assets/fonts/Helvetica-Neue/HelveticaNeueUltraLightItalic.otf +0 -0
- package/dist/assets/fonts/dax-regular/dax-regular.ttf +0 -0
- package/dist/tcce-design-system-components.css +1 -0
- package/dist/tcce-design-system-components.d.ts +1069 -0
- package/dist/tcce-design-system-components.js +10469 -0
- package/dist/tcce-design-system-components.umd.cjs +1655 -0
- package/package.json +74 -0
|
@@ -0,0 +1,1069 @@
|
|
|
1
|
+
import { AnchorHTMLAttributes } from 'react';
|
|
2
|
+
import { Context } from 'react';
|
|
3
|
+
import { default as default_2 } from 'react';
|
|
4
|
+
import { DetailedHTMLProps } from 'react';
|
|
5
|
+
import { ForwardRefExoticComponent } from 'react';
|
|
6
|
+
import { HTMLAttributeAnchorTarget } from 'react';
|
|
7
|
+
import { HTMLAttributes } from 'react';
|
|
8
|
+
import { IStyledComponentBase } from 'styled-components/dist/types';
|
|
9
|
+
import { JSX } from 'react/jsx-runtime';
|
|
10
|
+
import { MouseEventHandler } from 'react';
|
|
11
|
+
import { PropsWithChildren } from 'react';
|
|
12
|
+
import { ReactNode } from 'react';
|
|
13
|
+
import { RefAttributes } from 'react';
|
|
14
|
+
import { RemixiconComponentType } from '@remixicon/react';
|
|
15
|
+
import { RuleSet } from 'styled-components';
|
|
16
|
+
import { Substitute } from 'styled-components/dist/types';
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* Valid input types supported by the FormField component
|
|
20
|
+
*/
|
|
21
|
+
export declare const ALLOWED_INPUT_TYPES: readonly ["text", "email", "password", "number", "tel", "url", "date", "datetime-local", "time", "search", "textarea", "select", "checkbox", "radio", "pin"];
|
|
22
|
+
|
|
23
|
+
export declare type AllowedInputType = (typeof ALLOWED_INPUT_TYPES)[number];
|
|
24
|
+
|
|
25
|
+
export declare const baseContentTableStyles: RuleSet<object>;
|
|
26
|
+
|
|
27
|
+
export declare const baseFieldStyles: RuleSet<object>;
|
|
28
|
+
|
|
29
|
+
export declare interface BaseFormFieldProps extends Omit<React.InputHTMLAttributes<HTMLInputElement>, 'size'> {
|
|
30
|
+
size?: FormFieldSize;
|
|
31
|
+
hasError?: boolean;
|
|
32
|
+
disabled?: boolean;
|
|
33
|
+
className?: string;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
export declare const BaseInput: ForwardRefExoticComponent<BaseInputProps & RefAttributes<HTMLInputElement>>;
|
|
37
|
+
|
|
38
|
+
export declare interface BaseInputProps extends Omit<BaseFormFieldProps, 'type'>, WithIconsProps {
|
|
39
|
+
type?: 'text' | 'email' | 'password' | 'number' | 'tel' | 'url';
|
|
40
|
+
flushed?: boolean;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
export declare const baseInputStyles: RuleSet<object>;
|
|
44
|
+
|
|
45
|
+
export declare interface BaseLabelProps extends React.LabelHTMLAttributes<HTMLLabelElement> {
|
|
46
|
+
size?: LabelSize;
|
|
47
|
+
disabled?: boolean;
|
|
48
|
+
required?: boolean;
|
|
49
|
+
className?: string;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
export declare const baseTableCellsSizes: {
|
|
53
|
+
sm: RuleSet<object>;
|
|
54
|
+
md: RuleSet<object>;
|
|
55
|
+
lg: RuleSet<object>;
|
|
56
|
+
};
|
|
57
|
+
|
|
58
|
+
declare const bodyTextStyles: {
|
|
59
|
+
80: RuleSet<object>;
|
|
60
|
+
60: RuleSet<object>;
|
|
61
|
+
40: RuleSet<object>;
|
|
62
|
+
30: RuleSet<object>;
|
|
63
|
+
24: RuleSet<object>;
|
|
64
|
+
20: RuleSet<object>;
|
|
65
|
+
18: RuleSet<object>;
|
|
66
|
+
16: RuleSet<object>;
|
|
67
|
+
14: RuleSet<object>;
|
|
68
|
+
12: RuleSet<object>;
|
|
69
|
+
};
|
|
70
|
+
|
|
71
|
+
export declare const Button: default_2.FC<ButtonProps>;
|
|
72
|
+
|
|
73
|
+
declare interface ButtonProps extends default_2.ButtonHTMLAttributes<HTMLButtonElement>, WithIconsProps {
|
|
74
|
+
variant?: ButtonVariant;
|
|
75
|
+
size?: ButtonSize;
|
|
76
|
+
isLoading?: boolean;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
declare type ButtonSize = 'sm' | 'md' | 'lg';
|
|
80
|
+
|
|
81
|
+
export declare const ButtonSpinner: default_2.FC<{
|
|
82
|
+
color?: ColorKey;
|
|
83
|
+
variant?: Variant;
|
|
84
|
+
}>;
|
|
85
|
+
|
|
86
|
+
declare type ButtonVariant = 'primary' | 'secondary' | 'cancel';
|
|
87
|
+
|
|
88
|
+
export declare const Card: default_2.FC<CardProps>;
|
|
89
|
+
|
|
90
|
+
export declare const CardBody: React.FC<React.HTMLAttributes<HTMLDivElement>>;
|
|
91
|
+
|
|
92
|
+
export declare const CardFooter: React.FC<React.HTMLAttributes<HTMLDivElement>>;
|
|
93
|
+
|
|
94
|
+
export declare const CardHeader: React.FC<React.HTMLAttributes<HTMLDivElement>>;
|
|
95
|
+
|
|
96
|
+
declare interface CardProps extends default_2.HTMLAttributes<HTMLDivElement> {
|
|
97
|
+
variant?: CardVariant;
|
|
98
|
+
size?: CardSize;
|
|
99
|
+
disabled?: boolean;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
declare type CardSize = 'sm' | 'md' | 'lg';
|
|
103
|
+
|
|
104
|
+
declare type CardVariant = 'elevated' | 'flat' | 'info';
|
|
105
|
+
|
|
106
|
+
export declare const Checkbox: ForwardRefExoticComponent<CheckboxProps & RefAttributes<HTMLInputElement>>;
|
|
107
|
+
|
|
108
|
+
export declare const CheckboxInput: default_2.ForwardRefExoticComponent<CheckboxInputProps & default_2.RefAttributes<HTMLInputElement>>;
|
|
109
|
+
|
|
110
|
+
declare interface CheckboxInputProps extends Omit<default_2.InputHTMLAttributes<HTMLInputElement>, 'size'> {
|
|
111
|
+
size?: FormFieldSize;
|
|
112
|
+
hasError?: boolean;
|
|
113
|
+
indeterminate?: boolean;
|
|
114
|
+
checkboxClassName?: string;
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
export declare const CheckboxLabel: React.FC<CheckboxLabelProps>;
|
|
118
|
+
|
|
119
|
+
declare interface CheckboxLabelProps extends BaseLabelProps {
|
|
120
|
+
onLabelClick?: () => void;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
export declare interface CheckboxProps extends Omit<React.InputHTMLAttributes<HTMLInputElement>, 'size'> {
|
|
124
|
+
size?: FormFieldSize;
|
|
125
|
+
label?: string;
|
|
126
|
+
hasError?: boolean;
|
|
127
|
+
indeterminate?: boolean;
|
|
128
|
+
checkboxClassName?: string;
|
|
129
|
+
labelClassName?: string;
|
|
130
|
+
onLabelClick?: () => void;
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
export declare interface CheckboxSpecificProps {
|
|
134
|
+
label?: string;
|
|
135
|
+
checked?: boolean;
|
|
136
|
+
checkboxLabel?: string;
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
declare type ColorKey = 'primary' | 'orange' | 'white' | 'gray';
|
|
140
|
+
|
|
141
|
+
/**
|
|
142
|
+
* Helper to create field configurations for common patterns
|
|
143
|
+
*/
|
|
144
|
+
export declare const createFieldConfig: {
|
|
145
|
+
/**
|
|
146
|
+
* Creates a text input field configuration
|
|
147
|
+
*/
|
|
148
|
+
text: (name: string, label: string, options?: Partial<FieldConfig>) => FieldConfig;
|
|
149
|
+
/**
|
|
150
|
+
* Creates an email input field configuration
|
|
151
|
+
*/
|
|
152
|
+
email: (name: string, label: string, options?: Partial<FieldConfig>) => FieldConfig;
|
|
153
|
+
/**
|
|
154
|
+
* Creates a password input field configuration
|
|
155
|
+
*/
|
|
156
|
+
password: (name: string, label: string, options?: Partial<FieldConfig>) => FieldConfig;
|
|
157
|
+
/**
|
|
158
|
+
* Creates a select input field configuration
|
|
159
|
+
*/
|
|
160
|
+
select: (name: string, label: string, options: SelectOption[], config?: Partial<FieldConfig>) => FieldConfig;
|
|
161
|
+
/**
|
|
162
|
+
* Creates a checkbox input field configuration
|
|
163
|
+
*/
|
|
164
|
+
checkbox: (name: string, label: string, options?: Partial<FieldConfig>) => FieldConfig;
|
|
165
|
+
/**
|
|
166
|
+
* Creates a radio group field configuration
|
|
167
|
+
*/
|
|
168
|
+
radio: (name: string, label: string, options: Array<{
|
|
169
|
+
value: string | number;
|
|
170
|
+
label: string;
|
|
171
|
+
}>, config?: Partial<FieldConfig>) => FieldConfig;
|
|
172
|
+
/**
|
|
173
|
+
* Creates a PIN input field configuration
|
|
174
|
+
*/
|
|
175
|
+
pin: (name: string, label: string, length?: number, options?: Partial<FieldConfig>) => FieldConfig;
|
|
176
|
+
};
|
|
177
|
+
|
|
178
|
+
/**
|
|
179
|
+
* Creates an array of refs for input fields
|
|
180
|
+
*
|
|
181
|
+
* @param length - Number of input fields
|
|
182
|
+
* @returns Array of refs initialized to null
|
|
183
|
+
*/
|
|
184
|
+
export declare const createInputRefs: (length: number) => InputRef[];
|
|
185
|
+
|
|
186
|
+
export declare const Dialog: React.FC<DialogProps>;
|
|
187
|
+
|
|
188
|
+
export declare const DialogBody: React.FC<DialogBodyProps>;
|
|
189
|
+
|
|
190
|
+
declare interface DialogBodyProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
191
|
+
padded?: boolean;
|
|
192
|
+
showTopDivider?: boolean;
|
|
193
|
+
showBottomDivider?: boolean;
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
export declare const DialogFooter: React.FC<DialogFooterProps>;
|
|
197
|
+
|
|
198
|
+
declare interface DialogFooterProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
199
|
+
align?: 'start' | 'center' | 'end' | 'space-between';
|
|
200
|
+
showDivider?: boolean;
|
|
201
|
+
gap?: number;
|
|
202
|
+
sticky?: boolean;
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
export declare const DialogHeader: React.FC<DialogHeaderProps>;
|
|
206
|
+
|
|
207
|
+
declare interface DialogHeaderProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
208
|
+
showDivider?: boolean;
|
|
209
|
+
variant?: 'default' | 'compact';
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
declare interface DialogProps {
|
|
213
|
+
isOpen: boolean;
|
|
214
|
+
onClose: () => void;
|
|
215
|
+
children: React.ReactNode;
|
|
216
|
+
className?: string;
|
|
217
|
+
closeOnBackdropClick?: boolean;
|
|
218
|
+
showCloseButton?: boolean;
|
|
219
|
+
size?: 'sm' | 'md' | 'lg';
|
|
220
|
+
fullScreen?: boolean;
|
|
221
|
+
closeOnEsc?: boolean;
|
|
222
|
+
ariaLabel?: string;
|
|
223
|
+
ariaLabelledBy?: string;
|
|
224
|
+
ariaDescribedBy?: string;
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
export declare const disabledStyles: RuleSet<object>;
|
|
228
|
+
|
|
229
|
+
export declare const ErrorMessage: default_2.FC<ErrorMessageProps>;
|
|
230
|
+
|
|
231
|
+
declare interface ErrorMessageProps extends default_2.HTMLAttributes<HTMLDivElement> {
|
|
232
|
+
size?: ErrorMessageSize;
|
|
233
|
+
className?: string;
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
declare type ErrorMessageSize = 'sm' | 'md' | 'lg';
|
|
237
|
+
|
|
238
|
+
export declare const errorStyles: RuleSet<object>;
|
|
239
|
+
|
|
240
|
+
/**
|
|
241
|
+
* Standard field configuration interface
|
|
242
|
+
*/
|
|
243
|
+
export declare interface FieldConfig {
|
|
244
|
+
name: string;
|
|
245
|
+
label: string;
|
|
246
|
+
type: AllowedInputType;
|
|
247
|
+
placeholder?: string;
|
|
248
|
+
required?: boolean;
|
|
249
|
+
disabled?: boolean;
|
|
250
|
+
options?: SelectOption[] | Array<{
|
|
251
|
+
value: string | number;
|
|
252
|
+
label: string;
|
|
253
|
+
}>;
|
|
254
|
+
validation?: {
|
|
255
|
+
min?: number;
|
|
256
|
+
max?: number;
|
|
257
|
+
pattern?: string;
|
|
258
|
+
custom?: (value: any) => string | undefined;
|
|
259
|
+
};
|
|
260
|
+
checkboxLabel?: string;
|
|
261
|
+
radioName?: string;
|
|
262
|
+
pinLength?: number;
|
|
263
|
+
pinType?: 'text' | 'number';
|
|
264
|
+
rows?: number;
|
|
265
|
+
}
|
|
266
|
+
|
|
267
|
+
export declare const flushedStyles: RuleSet<object>;
|
|
268
|
+
|
|
269
|
+
export declare const FormField: default_2.FC<FormFieldComponentProps>;
|
|
270
|
+
|
|
271
|
+
export declare interface FormFieldComponentProps extends WithIconsProps {
|
|
272
|
+
id?: string | number;
|
|
273
|
+
name: string;
|
|
274
|
+
label?: string;
|
|
275
|
+
type?: 'text' | 'email' | 'password' | 'number' | 'tel' | 'url' | 'date' | 'datetime-local' | 'time' | 'search' | 'textarea' | 'select' | 'checkbox' | 'radio' | 'pin';
|
|
276
|
+
size?: FormFieldSize;
|
|
277
|
+
placeholder?: string;
|
|
278
|
+
disabled?: boolean;
|
|
279
|
+
required?: boolean;
|
|
280
|
+
options?: SelectOption[] | Array<{
|
|
281
|
+
value: string | number;
|
|
282
|
+
label: string;
|
|
283
|
+
}>;
|
|
284
|
+
checkboxValue?: boolean;
|
|
285
|
+
checkboxLabel?: string;
|
|
286
|
+
radioName?: string;
|
|
287
|
+
pinLength?: number;
|
|
288
|
+
pinType?: 'text' | 'number';
|
|
289
|
+
className?: string;
|
|
290
|
+
inputClassName?: string;
|
|
291
|
+
labelClassName?: string;
|
|
292
|
+
messageErrorClassName?: string;
|
|
293
|
+
onOptionSelect?: (option: SelectOption) => void;
|
|
294
|
+
onRadioChange?: (event: default_2.ChangeEvent<HTMLInputElement>) => void;
|
|
295
|
+
onPinComplete?: (value: string) => void;
|
|
296
|
+
onChange?: (event: default_2.ChangeEvent<HTMLInputElement>) => void;
|
|
297
|
+
[key: string]: any;
|
|
298
|
+
}
|
|
299
|
+
|
|
300
|
+
export declare interface FormFieldProps extends BaseFormFieldProps, Omit<WithIconsProps, 'rightIcon'> {
|
|
301
|
+
size?: FormFieldSize;
|
|
302
|
+
hasError?: boolean;
|
|
303
|
+
disabled?: boolean;
|
|
304
|
+
className?: string;
|
|
305
|
+
}
|
|
306
|
+
|
|
307
|
+
export declare type FormFieldSize = 'sm' | 'md' | 'lg';
|
|
308
|
+
|
|
309
|
+
export declare type FormFieldState = 'default' | 'hover' | 'focus' | 'error' | 'disabled';
|
|
310
|
+
|
|
311
|
+
export declare const FullScreenSpinner: default_2.FC<{
|
|
312
|
+
message?: string;
|
|
313
|
+
color?: ColorKey;
|
|
314
|
+
variant?: Variant;
|
|
315
|
+
}>;
|
|
316
|
+
|
|
317
|
+
/**
|
|
318
|
+
* Returns normalized props for different input types based on the type
|
|
319
|
+
* This function replaces the renderInput switch logic from FormField component
|
|
320
|
+
*/
|
|
321
|
+
export declare const getPropsForInputType: (type: string | null | undefined, baseProps: InputComponentProps, selectProps?: SelectSpecificProps, checkboxProps?: CheckboxSpecificProps, radioProps?: RadioSpecificProps, pinProps?: PinSpecificProps, textAreaProps?: TextAreaSpecificProps, searchProps?: SearchSpecificProps) => {
|
|
322
|
+
component: string;
|
|
323
|
+
props: any;
|
|
324
|
+
};
|
|
325
|
+
|
|
326
|
+
/**
|
|
327
|
+
* Handles user input in a single digit field of a verification code.
|
|
328
|
+
*
|
|
329
|
+
* This function manages the core input behavior:
|
|
330
|
+
* - Restricts input to single characters only
|
|
331
|
+
* - Updates the digits array at the correct position
|
|
332
|
+
* - Automatically moves focus to the next field when a digit is entered
|
|
333
|
+
* - Prevents multiple characters from being entered in one field
|
|
334
|
+
* - Supports both text and number validation
|
|
335
|
+
*
|
|
336
|
+
* @param e - The input change event containing the new value
|
|
337
|
+
* @param index - Current input field position (0-based)
|
|
338
|
+
* @param digits - Current state array of all digit values
|
|
339
|
+
* @param setDigits - React state setter to update the digits array
|
|
340
|
+
* @param inputRefs - Array of refs to all input fields for focus management
|
|
341
|
+
* @param length - Total number of input fields
|
|
342
|
+
* @param type - Input type validation ('text' | 'number')
|
|
343
|
+
* @param onChange - Optional callback when value changes
|
|
344
|
+
* @param onComplete - Optional callback when all fields are filled
|
|
345
|
+
*
|
|
346
|
+
* @example
|
|
347
|
+
* ```tsx
|
|
348
|
+
* <input
|
|
349
|
+
* onChange={(e) => handleDigitChange(e, 0, digits, setDigits, inputRefs, 6, 'number', onChange, onComplete)}
|
|
350
|
+
* value={digits[0]}
|
|
351
|
+
* />
|
|
352
|
+
* ```
|
|
353
|
+
*/
|
|
354
|
+
export declare const handleDigitChange: (e: default_2.ChangeEvent<HTMLInputElement>, index: number, digits: string[], setDigits: SetDigits, inputRefs: InputRefs, length: number, type?: "text" | "number", onChange?: (value: string) => void, onComplete?: (value: string) => void) => void;
|
|
355
|
+
|
|
356
|
+
/**
|
|
357
|
+
* Handles keyboard navigation in verification code input fields.
|
|
358
|
+
*
|
|
359
|
+
* Provides intuitive backspace behavior that moves focus to the previous
|
|
360
|
+
* field when the current field is empty. This creates a smooth user experience
|
|
361
|
+
* when correcting mistakes or clearing fields. Also supports arrow key navigation.
|
|
362
|
+
*
|
|
363
|
+
* @param e - The keyboard event (watching for 'Backspace', 'ArrowLeft', 'ArrowRight')
|
|
364
|
+
* @param index - Current input field position (0-based)
|
|
365
|
+
* @param digits - Current state array of all digit values
|
|
366
|
+
* @param inputRefs - Array of refs to all input fields for focus management
|
|
367
|
+
* @param setDigits - React state setter to update the digits array
|
|
368
|
+
* @param onChange - Optional callback when value changes
|
|
369
|
+
*
|
|
370
|
+
* @example
|
|
371
|
+
* ```tsx
|
|
372
|
+
* <input
|
|
373
|
+
* onKeyDown={(e) => handleKeyDown(e, 2, digits, inputRefs, setDigits, onChange)}
|
|
374
|
+
* // When backspace is pressed on empty field 2, focus moves to field 1
|
|
375
|
+
* />
|
|
376
|
+
* ```
|
|
377
|
+
*/
|
|
378
|
+
export declare const handleKeyDown: (e: default_2.KeyboardEvent<HTMLInputElement>, index: number, digits: string[], inputRefs: InputRefs, setDigits: SetDigits, onChange?: (value: string) => void) => void;
|
|
379
|
+
|
|
380
|
+
/**
|
|
381
|
+
* Handles paste operations for verification code input fields.
|
|
382
|
+
*
|
|
383
|
+
* Enables users to paste complete verification codes (like from SMS or email)
|
|
384
|
+
* and automatically distributes the digits across multiple input fields.
|
|
385
|
+
* This greatly improves user experience by avoiding manual digit-by-digit entry.
|
|
386
|
+
*
|
|
387
|
+
* Features:
|
|
388
|
+
* - Prevents default paste behavior to handle custom distribution
|
|
389
|
+
* - Splits pasted text into individual characters
|
|
390
|
+
* - Fills consecutive input fields starting from the paste position
|
|
391
|
+
* - Respects the length limit (won't paste beyond field boundaries)
|
|
392
|
+
* - Supports type validation (number-only if specified)
|
|
393
|
+
* - Moves focus to the appropriate field after paste
|
|
394
|
+
* - Calls completion callback if all fields are filled
|
|
395
|
+
*
|
|
396
|
+
* @param e - The clipboard paste event containing the pasted data
|
|
397
|
+
* @param index - Starting input field position where paste occurred
|
|
398
|
+
* @param digits - Current state array of all digit values
|
|
399
|
+
* @param setDigits - React state setter to update the digits array
|
|
400
|
+
* @param inputRefs - Array of refs to all input fields for focus management
|
|
401
|
+
* @param length - Total number of input fields
|
|
402
|
+
* @param type - Input type validation ('text' | 'number')
|
|
403
|
+
* @param onChange - Optional callback when value changes
|
|
404
|
+
* @param onComplete - Optional callback when all fields are filled
|
|
405
|
+
*
|
|
406
|
+
* @example
|
|
407
|
+
* ```tsx
|
|
408
|
+
* <input
|
|
409
|
+
* onPaste={(e) => handlePaste(e, 0, digits, setDigits, inputRefs, 6, 'number', onChange, onComplete)}
|
|
410
|
+
* // Pasting "123456" at field 0 fills all 6 fields and focuses field 5
|
|
411
|
+
* />
|
|
412
|
+
* ```
|
|
413
|
+
*/
|
|
414
|
+
export declare const handlePaste: (e: default_2.ClipboardEvent<HTMLInputElement>, index: number, digits: string[], setDigits: SetDigits, inputRefs: InputRefs, length: number, type?: "text" | "number", onChange?: (value: string) => void, onComplete?: (value: string) => void) => void;
|
|
415
|
+
|
|
416
|
+
/**
|
|
417
|
+
* Tipo helper para determinar si un componente tiene iconos
|
|
418
|
+
*/
|
|
419
|
+
export declare type HasIcons<T extends WithIconsProps> = {
|
|
420
|
+
hasLeftIcon: boolean;
|
|
421
|
+
hasRightIcon: boolean;
|
|
422
|
+
} & T;
|
|
423
|
+
|
|
424
|
+
/**
|
|
425
|
+
* Checks if the user has at least one of the required permissions.
|
|
426
|
+
*
|
|
427
|
+
* @param {string[]} userRoles - The roles or permissions assigned to the user.
|
|
428
|
+
* @param {string[]} permissions - The required permissions to check against.
|
|
429
|
+
* @returns {boolean} True if the user has permission, otherwise false.
|
|
430
|
+
*
|
|
431
|
+
* - Returns false if no permissions are provided.
|
|
432
|
+
* - Returns true if 'all' is included in the permissions array.
|
|
433
|
+
* - Returns true if any of the user's roles match the required permissions.
|
|
434
|
+
*/
|
|
435
|
+
export declare const hasPermission: (userRoles?: string[], permissions?: string[]) => boolean;
|
|
436
|
+
|
|
437
|
+
/**
|
|
438
|
+
* Main Header component for the application.
|
|
439
|
+
* Displays notifications, user profile, and optional children.
|
|
440
|
+
*
|
|
441
|
+
* @param {HeaderProps} props - Header component props.
|
|
442
|
+
* @returns {JSX.Element} The rendered header.
|
|
443
|
+
*/
|
|
444
|
+
export declare const Header: default_2.FC<HeaderProps>;
|
|
445
|
+
|
|
446
|
+
/**
|
|
447
|
+
* Props for the Header component.
|
|
448
|
+
* @parram sidebarCollapsed: Whether the sidebar is collapsed.
|
|
449
|
+
* @parram user: User information for profile display.
|
|
450
|
+
* @param hasNotifications: Whether there are new notifications.
|
|
451
|
+
* @param notificationCount: Optional count of notifications to display.
|
|
452
|
+
* @param onNotificationClick: Callback when notification button is clicked.
|
|
453
|
+
* @param onUserProfileClick: Callback when user profile is clicked.
|
|
454
|
+
* @param children: Any additional elements to render in the left section.
|
|
455
|
+
*/
|
|
456
|
+
export declare interface HeaderProps {
|
|
457
|
+
sidebarCollapsed?: boolean;
|
|
458
|
+
user?: HeaderUser;
|
|
459
|
+
hasNotifications?: boolean;
|
|
460
|
+
/** Optional count. If provided and > 0, overrides hasNotifications and shows the number (capped). */
|
|
461
|
+
notificationCount?: number;
|
|
462
|
+
onNotificationClick?: () => void;
|
|
463
|
+
onUserProfileClick?: () => void;
|
|
464
|
+
children?: default_2.ReactNode;
|
|
465
|
+
}
|
|
466
|
+
|
|
467
|
+
/**
|
|
468
|
+
* User information for the Header component.
|
|
469
|
+
* @param name User's full name.
|
|
470
|
+
* @param role User's role or title.
|
|
471
|
+
* @param avatarUrl Optional URL for user's avatar image.
|
|
472
|
+
*/
|
|
473
|
+
export declare interface HeaderUser {
|
|
474
|
+
name: string;
|
|
475
|
+
role: string;
|
|
476
|
+
avatarUrl?: string;
|
|
477
|
+
}
|
|
478
|
+
|
|
479
|
+
export declare const HeadingBold: IStyledComponentBase<"web", Substitute<DetailedHTMLProps<HTMLAttributes<HTMLHeadingElement>, HTMLHeadingElement>, {
|
|
480
|
+
size?: keyof typeof headingBoldStyles;
|
|
481
|
+
color?: string;
|
|
482
|
+
}>> & string;
|
|
483
|
+
|
|
484
|
+
declare const headingBoldStyles: {
|
|
485
|
+
80: RuleSet<object>;
|
|
486
|
+
60: RuleSet<object>;
|
|
487
|
+
40: RuleSet<object>;
|
|
488
|
+
30: RuleSet<object>;
|
|
489
|
+
24: RuleSet<object>;
|
|
490
|
+
20: RuleSet<object>;
|
|
491
|
+
16: RuleSet<object>;
|
|
492
|
+
};
|
|
493
|
+
|
|
494
|
+
export declare const HeadingRegular: IStyledComponentBase<"web", Substitute<DetailedHTMLProps<HTMLAttributes<HTMLHeadingElement>, HTMLHeadingElement>, {
|
|
495
|
+
size?: keyof typeof headingRegularStyles;
|
|
496
|
+
color?: string;
|
|
497
|
+
}>> & string;
|
|
498
|
+
|
|
499
|
+
declare const headingRegularStyles: {
|
|
500
|
+
80: RuleSet<object>;
|
|
501
|
+
60: RuleSet<object>;
|
|
502
|
+
40: RuleSet<object>;
|
|
503
|
+
30: RuleSet<object>;
|
|
504
|
+
24: RuleSet<object>;
|
|
505
|
+
20: RuleSet<object>;
|
|
506
|
+
16: RuleSet<object>;
|
|
507
|
+
};
|
|
508
|
+
|
|
509
|
+
export declare const Icon: default_2.FC<IconProps>;
|
|
510
|
+
|
|
511
|
+
declare interface IconProps {
|
|
512
|
+
component: default_2.ReactNode | RemixiconComponentType;
|
|
513
|
+
size?: IconSizes | string | number;
|
|
514
|
+
color?: string;
|
|
515
|
+
className?: string;
|
|
516
|
+
iconProps?: Record<string, unknown>;
|
|
517
|
+
}
|
|
518
|
+
|
|
519
|
+
declare type IconSizes = 'tn' | 'sm' | 'md' | 'lg';
|
|
520
|
+
|
|
521
|
+
export declare const IconWrapperStyles: RuleSet<object>;
|
|
522
|
+
|
|
523
|
+
/**
|
|
524
|
+
* Input component props interfaces for the getPropsForInputType function
|
|
525
|
+
*/
|
|
526
|
+
export declare interface InputComponentProps {
|
|
527
|
+
field: any;
|
|
528
|
+
id?: string | number;
|
|
529
|
+
name: string;
|
|
530
|
+
className?: string;
|
|
531
|
+
hasError: boolean;
|
|
532
|
+
disabled: boolean;
|
|
533
|
+
size: FormFieldSize;
|
|
534
|
+
placeholder?: string;
|
|
535
|
+
type?: string;
|
|
536
|
+
onChange?: (event: default_2.ChangeEvent<HTMLInputElement>) => void;
|
|
537
|
+
[key: string]: any;
|
|
538
|
+
}
|
|
539
|
+
|
|
540
|
+
/**
|
|
541
|
+
* CodeInputUtils - Utilities for handling verification code input fields
|
|
542
|
+
*
|
|
543
|
+
* This utility provides functions to manage multi-digit input fields commonly used
|
|
544
|
+
* for verification codes, OTP (One-Time Password), or similar authentication flows.
|
|
545
|
+
*
|
|
546
|
+
* Key features:
|
|
547
|
+
* - Auto-focus navigation between input fields
|
|
548
|
+
* - Paste support for complete codes
|
|
549
|
+
* - Backspace navigation to previous fields
|
|
550
|
+
* - Single character validation per field
|
|
551
|
+
*
|
|
552
|
+
* Used by: PinInputGroup component for PIN/verification code workflows
|
|
553
|
+
*/
|
|
554
|
+
export declare type InputRef = default_2.RefObject<HTMLInputElement | null>;
|
|
555
|
+
|
|
556
|
+
export declare type InputRefs = default_2.RefObject<HTMLInputElement | null>[];
|
|
557
|
+
|
|
558
|
+
/**
|
|
559
|
+
* Interfaz específica para componentes de input que necesitan iconos
|
|
560
|
+
* Extiende WithIconsProps con propiedades específicas para inputs
|
|
561
|
+
*/
|
|
562
|
+
export declare interface InputWithIconsProps extends WithIconsProps {
|
|
563
|
+
hasLeftIcon?: boolean;
|
|
564
|
+
hasRightIcon?: boolean;
|
|
565
|
+
}
|
|
566
|
+
|
|
567
|
+
export declare const Label: default_2.FC<BaseLabelProps>;
|
|
568
|
+
|
|
569
|
+
export declare type LabelSize = 'sm' | 'md' | 'lg';
|
|
570
|
+
|
|
571
|
+
/**
|
|
572
|
+
* Top-level Layout component.
|
|
573
|
+
* Wraps the layout in a SidebarProvider context.
|
|
574
|
+
* @param props - Layout properties
|
|
575
|
+
*/
|
|
576
|
+
export declare const Layout: default_2.FC<LayoutProps>;
|
|
577
|
+
|
|
578
|
+
/**
|
|
579
|
+
* Props for the Layout component.
|
|
580
|
+
* Includes navigation config, user info, and event handlers.
|
|
581
|
+
* @children - Main content to be rendered within the layout.
|
|
582
|
+
* @navigationConfig - Configuration for sidebar navigation items.
|
|
583
|
+
* @userRoles - Roles of the current user for permission-based rendering.
|
|
584
|
+
* @activePath - Currently active navigation path.
|
|
585
|
+
* @user - User information for the header profile section.
|
|
586
|
+
* @hasNotifications - Whether to show notification indicator in header.
|
|
587
|
+
* @onNavigate - Callback when a navigation item is clicked.
|
|
588
|
+
* @onNotificationClick - Callback when notification icon is clicked.
|
|
589
|
+
* @onUserProfileClick - Callback when user profile area is clicked.
|
|
590
|
+
* @contentClassName - Optional class name for main content area.
|
|
591
|
+
*/
|
|
592
|
+
export declare interface LayoutProps {
|
|
593
|
+
children: default_2.ReactNode;
|
|
594
|
+
navigationConfig: NavigationItem[];
|
|
595
|
+
userRoles?: string[];
|
|
596
|
+
activePath?: string;
|
|
597
|
+
user?: HeaderUser;
|
|
598
|
+
hasNotifications?: boolean;
|
|
599
|
+
onNavigate?: (path: string) => void;
|
|
600
|
+
onNotificationClick?: () => void;
|
|
601
|
+
onUserProfileClick?: () => void;
|
|
602
|
+
contentClassName?: string;
|
|
603
|
+
}
|
|
604
|
+
|
|
605
|
+
/**
|
|
606
|
+
* Link component with support for icons, variants, sizes, and accessibility.
|
|
607
|
+
*
|
|
608
|
+
* @param props - LinkProps
|
|
609
|
+
* @param ref - Ref to the anchor element
|
|
610
|
+
* @return JSX.Element
|
|
611
|
+
*/
|
|
612
|
+
export declare const Link: default_2.ForwardRefExoticComponent<LinkProps & default_2.RefAttributes<HTMLAnchorElement>>;
|
|
613
|
+
|
|
614
|
+
/**
|
|
615
|
+
* Props for the Link component.
|
|
616
|
+
* Extends standard anchor attributes and WithIconsProps.
|
|
617
|
+
*/
|
|
618
|
+
export declare interface LinkProps extends AnchorHTMLAttributes<HTMLAnchorElement>, WithIconsProps {
|
|
619
|
+
id?: string;
|
|
620
|
+
size?: LinkSize;
|
|
621
|
+
variant?: LinkVariant;
|
|
622
|
+
children: ReactNode;
|
|
623
|
+
disabled?: boolean;
|
|
624
|
+
/** Target attribute for the anchor */
|
|
625
|
+
target?: HTMLAttributeAnchorTarget;
|
|
626
|
+
rel?: string;
|
|
627
|
+
className?: string;
|
|
628
|
+
truncate?: boolean;
|
|
629
|
+
/** Accessible label for the link */
|
|
630
|
+
'aria-label'?: string;
|
|
631
|
+
/** Accessible description for the link */
|
|
632
|
+
'aria-describedby'?: string;
|
|
633
|
+
tabIndex?: number;
|
|
634
|
+
onClick?: MouseEventHandler<HTMLAnchorElement>;
|
|
635
|
+
}
|
|
636
|
+
|
|
637
|
+
/**
|
|
638
|
+
* Defines the available sizes for the Link component.
|
|
639
|
+
*/
|
|
640
|
+
export declare type LinkSize = 'sm' | 'md' | 'lg';
|
|
641
|
+
|
|
642
|
+
/**
|
|
643
|
+
* Defines the available visual variants for the Link component.
|
|
644
|
+
*/
|
|
645
|
+
export declare type LinkVariant = 'underlined' | 'plain';
|
|
646
|
+
|
|
647
|
+
/**
|
|
648
|
+
* Represents a navigation item used in the sidebar navigation component.
|
|
649
|
+
*
|
|
650
|
+
* @property id - Unique identifier for the navigation item.
|
|
651
|
+
* @property label - Display text for the navigation item.
|
|
652
|
+
* @property icon - Optional icon component or React node to display alongside the label.
|
|
653
|
+
* @property iconSize - Optional size for the icon; can be a predefined IconSizes value, string, or number.
|
|
654
|
+
* @property iconColor - Optional color for the icon.
|
|
655
|
+
* @property path - Optional navigation path or URL associated with the item.
|
|
656
|
+
* @property permissions - List of permissions required to access this navigation item.
|
|
657
|
+
* @property children - Optional array of child navigation items for nested navigation structures.
|
|
658
|
+
*/
|
|
659
|
+
export declare interface NavigationItem {
|
|
660
|
+
id: string;
|
|
661
|
+
label: string;
|
|
662
|
+
icon?: React.ReactNode | RemixiconComponentType;
|
|
663
|
+
iconSize?: IconSizes | string | number;
|
|
664
|
+
iconColor?: string;
|
|
665
|
+
path?: string;
|
|
666
|
+
permissions: Permission[];
|
|
667
|
+
children?: NavigationItem[];
|
|
668
|
+
}
|
|
669
|
+
|
|
670
|
+
/**
|
|
671
|
+
* Normalizes field configurations to ensure only valid types are used
|
|
672
|
+
* @param fields - Array of field configurations
|
|
673
|
+
* @returns Normalized field configurations with valid types
|
|
674
|
+
*/
|
|
675
|
+
export declare const normalizeFieldTypes: (fields: Partial<FieldConfig>[]) => FieldConfig[];
|
|
676
|
+
|
|
677
|
+
/**
|
|
678
|
+
* Transforms select options to the expected format
|
|
679
|
+
* @param options - Options in various formats
|
|
680
|
+
* @returns Normalized SelectOption array
|
|
681
|
+
*/
|
|
682
|
+
export declare const normalizeSelectOptions: (options: Array<{
|
|
683
|
+
value: string | number;
|
|
684
|
+
label: string;
|
|
685
|
+
}> | SelectOption[]) => SelectOption[];
|
|
686
|
+
|
|
687
|
+
export declare const PasswordInput: default_2.FC<PasswordInputProps>;
|
|
688
|
+
|
|
689
|
+
export declare interface PasswordInputProps extends BaseFormFieldProps, Omit<WithIconsProps, 'rightIcon'> {
|
|
690
|
+
}
|
|
691
|
+
|
|
692
|
+
export declare type Permission = string;
|
|
693
|
+
|
|
694
|
+
export declare const PinInput: ForwardRefExoticComponent<PinInputProps & RefAttributes<HTMLInputElement>>;
|
|
695
|
+
|
|
696
|
+
export declare const PinInputGroup: default_2.FC<PinInputGroupProps>;
|
|
697
|
+
|
|
698
|
+
export declare interface PinInputGroupProps {
|
|
699
|
+
length?: number;
|
|
700
|
+
size?: FormFieldSize;
|
|
701
|
+
variant?: 'outlined' | 'filled';
|
|
702
|
+
hasError?: boolean;
|
|
703
|
+
type?: 'text' | 'number';
|
|
704
|
+
onChange?: (value: string) => void;
|
|
705
|
+
onComplete?: (value: string) => void;
|
|
706
|
+
className?: string;
|
|
707
|
+
pinInputClassName?: string;
|
|
708
|
+
}
|
|
709
|
+
|
|
710
|
+
export declare interface PinInputProps extends BaseFormFieldProps {
|
|
711
|
+
variant?: 'outlined' | 'filled';
|
|
712
|
+
}
|
|
713
|
+
|
|
714
|
+
export declare interface PinSpecificProps {
|
|
715
|
+
pinLength?: number;
|
|
716
|
+
pinType?: 'text' | 'number';
|
|
717
|
+
onPinComplete?: (value: string) => void;
|
|
718
|
+
}
|
|
719
|
+
|
|
720
|
+
export declare const RadioInput: ForwardRefExoticComponent<RadioInputProps & RefAttributes<HTMLInputElement>>;
|
|
721
|
+
|
|
722
|
+
export declare const RadioInputDot: default_2.ForwardRefExoticComponent<RadioInputDotProps & default_2.RefAttributes<HTMLInputElement>>;
|
|
723
|
+
|
|
724
|
+
declare interface RadioInputDotProps extends Omit<default_2.InputHTMLAttributes<HTMLInputElement>, 'size' | 'type'> {
|
|
725
|
+
size?: FormFieldSize;
|
|
726
|
+
hasError?: boolean;
|
|
727
|
+
dotClassName?: string;
|
|
728
|
+
}
|
|
729
|
+
|
|
730
|
+
export declare const RadioInputLabel: React.FC<BaseLabelProps>;
|
|
731
|
+
|
|
732
|
+
export declare interface RadioInputProps extends Omit<React.InputHTMLAttributes<HTMLInputElement>, 'size' | 'type'> {
|
|
733
|
+
size?: FormFieldSize;
|
|
734
|
+
label?: string;
|
|
735
|
+
hasError?: boolean;
|
|
736
|
+
dotClassName?: string;
|
|
737
|
+
labelClassName?: string;
|
|
738
|
+
}
|
|
739
|
+
|
|
740
|
+
export declare interface RadioSpecificProps {
|
|
741
|
+
options: Array<{
|
|
742
|
+
value: string | number;
|
|
743
|
+
label: string;
|
|
744
|
+
}>;
|
|
745
|
+
radioName?: string;
|
|
746
|
+
onRadioChange?: (event: default_2.ChangeEvent<HTMLInputElement>) => void;
|
|
747
|
+
}
|
|
748
|
+
|
|
749
|
+
export declare const SearchInput: default_2.FC<SearchInputProps>;
|
|
750
|
+
|
|
751
|
+
export declare interface SearchInputProps extends WithIconsProps {
|
|
752
|
+
size?: FormFieldSize;
|
|
753
|
+
placeholder?: string;
|
|
754
|
+
onSearch?: (value: string) => void;
|
|
755
|
+
className?: string;
|
|
756
|
+
}
|
|
757
|
+
|
|
758
|
+
export declare interface SearchSpecificProps {
|
|
759
|
+
onSearch?: (value: string) => void;
|
|
760
|
+
}
|
|
761
|
+
|
|
762
|
+
export declare const SectionSpinner: default_2.FC<{
|
|
763
|
+
message?: string;
|
|
764
|
+
color?: ColorKey;
|
|
765
|
+
variant?: Variant;
|
|
766
|
+
}>;
|
|
767
|
+
|
|
768
|
+
export declare const SelectInput: default_2.ForwardRefExoticComponent<SelectInputProps & default_2.RefAttributes<HTMLButtonElement>>;
|
|
769
|
+
|
|
770
|
+
export declare interface SelectInputProps extends Omit<React.SelectHTMLAttributes<HTMLSelectElement>, 'size'> {
|
|
771
|
+
size?: FormFieldSize;
|
|
772
|
+
hasError?: boolean;
|
|
773
|
+
disabled?: boolean;
|
|
774
|
+
options: SelectOption[];
|
|
775
|
+
placeholder?: string;
|
|
776
|
+
onOptionSelect?: (option: SelectOption) => void;
|
|
777
|
+
className?: string;
|
|
778
|
+
inputClassName?: string;
|
|
779
|
+
optionsClassName?: string;
|
|
780
|
+
optionClassName?: string;
|
|
781
|
+
}
|
|
782
|
+
|
|
783
|
+
export declare interface SelectOption {
|
|
784
|
+
value: string | number;
|
|
785
|
+
label: string;
|
|
786
|
+
disabled?: boolean;
|
|
787
|
+
}
|
|
788
|
+
|
|
789
|
+
export declare interface SelectSpecificProps {
|
|
790
|
+
options: SelectOption[];
|
|
791
|
+
onOptionSelect?: (option: SelectOption) => void;
|
|
792
|
+
}
|
|
793
|
+
|
|
794
|
+
export declare type SetDigits = default_2.Dispatch<default_2.SetStateAction<string[]>>;
|
|
795
|
+
|
|
796
|
+
/**
|
|
797
|
+
* Sidebar component for navigation.
|
|
798
|
+
*
|
|
799
|
+
* @param {SidebarProps} props - Sidebar properties.
|
|
800
|
+
* @param {Array} props.navigationConfig - Navigation items configuration.
|
|
801
|
+
* @param {Array} [props.userRoles=[]] - User roles for access control.
|
|
802
|
+
* @param {Function} [props.onNavigate] - Callback when navigation occurs.
|
|
803
|
+
* @param {string} [props.activePath] - Currently active navigation path.
|
|
804
|
+
* @returns {JSX.Element} Sidebar navigation component.
|
|
805
|
+
*/
|
|
806
|
+
export declare const Sidebar: default_2.FC<SidebarProps>;
|
|
807
|
+
|
|
808
|
+
export declare const SidebarContext: Context<SidebarContextValue | undefined>;
|
|
809
|
+
|
|
810
|
+
/**
|
|
811
|
+
* Context value for managing the sidebar state.
|
|
812
|
+
* @property isCollapsed - Boolean indicating whether the sidebar is collapsed.
|
|
813
|
+
* @property setIsCollapsed - Function to toggle the collapsed state of the sidebar.
|
|
814
|
+
* @property isMobileOpen - Boolean indicating whether the sidebar is open on mobile devices.
|
|
815
|
+
* @property setIsMobileOpen - Function to toggle the mobile open state of the sidebar.
|
|
816
|
+
*/
|
|
817
|
+
export declare interface SidebarContextValue {
|
|
818
|
+
isCollapsed: boolean;
|
|
819
|
+
setIsCollapsed: (v: boolean) => void;
|
|
820
|
+
isMobileOpen: boolean;
|
|
821
|
+
setIsMobileOpen: (v: boolean) => void;
|
|
822
|
+
}
|
|
823
|
+
|
|
824
|
+
/**
|
|
825
|
+
* Props for the Sidebar component.
|
|
826
|
+
*
|
|
827
|
+
* @property navigationConfig - Array of NavigationItem objects defining the sidebar structure.
|
|
828
|
+
* @property userRoles - Optional array of roles assigned to the current user for permission checks.
|
|
829
|
+
* @property currentUser - Optional SidebarUser object containing user information like name and role.
|
|
830
|
+
* @property onNavigate - Optional callback function invoked when a navigation item is clicked, receiving the item's path as an argument.
|
|
831
|
+
* @property activePath - Optional string representing the currently active navigation path for highlighting purposes.
|
|
832
|
+
*/
|
|
833
|
+
export declare interface SidebarProps {
|
|
834
|
+
navigationConfig: NavigationItem[];
|
|
835
|
+
userRoles?: string[];
|
|
836
|
+
currentUser?: SidebarUser;
|
|
837
|
+
onNavigate?: (path: string) => void;
|
|
838
|
+
activePath?: string;
|
|
839
|
+
logoImgSrc?: string;
|
|
840
|
+
logoImgCollapse?: string;
|
|
841
|
+
}
|
|
842
|
+
|
|
843
|
+
export declare const SidebarProvider: ({ children }: PropsWithChildren) => JSX.Element;
|
|
844
|
+
|
|
845
|
+
export declare interface SidebarUser {
|
|
846
|
+
name?: string;
|
|
847
|
+
role?: string;
|
|
848
|
+
}
|
|
849
|
+
|
|
850
|
+
declare type Size = 'sm' | 'md' | 'lg' | 'xl';
|
|
851
|
+
|
|
852
|
+
export declare const sizeStyles: {
|
|
853
|
+
sm: RuleSet<object>;
|
|
854
|
+
md: RuleSet<object>;
|
|
855
|
+
lg: RuleSet<object>;
|
|
856
|
+
};
|
|
857
|
+
|
|
858
|
+
export declare type SortDirection = 'asc' | 'desc' | 'none';
|
|
859
|
+
|
|
860
|
+
export declare interface SortState {
|
|
861
|
+
columnId: string | null;
|
|
862
|
+
direction: SortDirection;
|
|
863
|
+
}
|
|
864
|
+
|
|
865
|
+
export declare const Spinner: default_2.FC<SpinnerProps>;
|
|
866
|
+
|
|
867
|
+
declare interface SpinnerProps {
|
|
868
|
+
size?: Size;
|
|
869
|
+
color?: ColorKey;
|
|
870
|
+
centered?: boolean;
|
|
871
|
+
message?: string;
|
|
872
|
+
title?: string;
|
|
873
|
+
variant?: Variant;
|
|
874
|
+
}
|
|
875
|
+
|
|
876
|
+
/**
|
|
877
|
+
* Table component for rendering customizable tables with support for
|
|
878
|
+
* sticky headers, sorting, and custom cell rendering.
|
|
879
|
+
*
|
|
880
|
+
* @param columns - Array of column definitions.
|
|
881
|
+
* @param rows - Array of row data.
|
|
882
|
+
* @param size - Table size variant ('sm', 'md', 'lg'). Default is 'md'.
|
|
883
|
+
* @param variant - Table visual variant. Default is 'default'.
|
|
884
|
+
* @param className - Optional CSS class for the table.
|
|
885
|
+
* @param stickyHeader - Enables sticky table headers.
|
|
886
|
+
* @param onSortChange - Callback for sort direction changes.
|
|
887
|
+
*/
|
|
888
|
+
export declare const Table: {
|
|
889
|
+
({ columns, rows, size, variant, className, stickyHeader, onSortChange, }: TableProps): JSX.Element;
|
|
890
|
+
displayName: string;
|
|
891
|
+
};
|
|
892
|
+
|
|
893
|
+
/**
|
|
894
|
+
* TableCell component for rendering a styled table cell with optional icons and content.
|
|
895
|
+
*
|
|
896
|
+
* @param {TableCellProps} props - Props for the TableCell component you can see them in @components/tables/types/table.types.ts.
|
|
897
|
+
* @returns {JSX.Element} The rendered table cell.
|
|
898
|
+
*/
|
|
899
|
+
export declare const TableCell: default_2.FC<TableCellProps>;
|
|
900
|
+
|
|
901
|
+
export declare interface TableCellData<T = default_2.ReactNode> extends WithIconsProps {
|
|
902
|
+
content: default_2.ReactNode | T;
|
|
903
|
+
size?: TableCellSize;
|
|
904
|
+
align?: 'left' | 'center' | 'right';
|
|
905
|
+
width?: string | number;
|
|
906
|
+
truncate?: boolean;
|
|
907
|
+
variant?: 'default' | 'numeric';
|
|
908
|
+
className?: string;
|
|
909
|
+
}
|
|
910
|
+
|
|
911
|
+
export declare interface TableCellProps extends default_2.HTMLAttributes<HTMLTableCellElement>, WithIconsProps {
|
|
912
|
+
children: default_2.ReactNode;
|
|
913
|
+
size?: TableCellSize;
|
|
914
|
+
align?: 'left' | 'center' | 'right';
|
|
915
|
+
width?: string | number;
|
|
916
|
+
truncate?: boolean;
|
|
917
|
+
variant?: 'default' | 'numeric';
|
|
918
|
+
}
|
|
919
|
+
|
|
920
|
+
export declare type TableCellSize = 'sm' | 'md' | 'lg';
|
|
921
|
+
|
|
922
|
+
export declare interface TableColumnDef<T = default_2.ReactNode> extends WithIconsProps, Omit<TableHeaderCellProps, 'children' | 'onSort'> {
|
|
923
|
+
id?: string;
|
|
924
|
+
header: default_2.ReactNode | T;
|
|
925
|
+
sortable?: boolean;
|
|
926
|
+
filterable?: boolean;
|
|
927
|
+
resizable?: boolean;
|
|
928
|
+
fixed?: 'left' | 'right';
|
|
929
|
+
stickyHeader?: boolean;
|
|
930
|
+
onSort?: (direction: SortDirection) => void;
|
|
931
|
+
}
|
|
932
|
+
|
|
933
|
+
/**
|
|
934
|
+
* TableHeaderCell component for rendering a table header cell with optional sorting and icons.
|
|
935
|
+
*
|
|
936
|
+
* @param {TableHeaderCellProps} props - The props for the TableHeaderCell component.
|
|
937
|
+
* @returns {JSX.Element} The rendered table header cell.
|
|
938
|
+
*/
|
|
939
|
+
export declare const TableHeaderCell: default_2.FC<TableHeaderCellProps>;
|
|
940
|
+
|
|
941
|
+
export declare interface TableHeaderCellProps extends default_2.HTMLAttributes<HTMLTableCellElement>, WithIconsProps {
|
|
942
|
+
children: default_2.ReactNode;
|
|
943
|
+
size?: TableCellSize;
|
|
944
|
+
sortable?: boolean;
|
|
945
|
+
sortDirection?: SortDirection;
|
|
946
|
+
align?: 'left' | 'center' | 'right';
|
|
947
|
+
width?: string | number;
|
|
948
|
+
active?: boolean;
|
|
949
|
+
sticky?: boolean;
|
|
950
|
+
fixed?: 'left' | 'right';
|
|
951
|
+
onSort?: (direction: SortDirection) => void;
|
|
952
|
+
}
|
|
953
|
+
|
|
954
|
+
export declare const tableHoverMixin: RuleSet<object>;
|
|
955
|
+
|
|
956
|
+
export declare const tableIconContainerStyles: RuleSet<object>;
|
|
957
|
+
|
|
958
|
+
export declare interface TableProps<T = default_2.ReactNode> {
|
|
959
|
+
columns: TableColumnDef<T>[];
|
|
960
|
+
rows: TableRowData<T>[];
|
|
961
|
+
size?: TableCellSize;
|
|
962
|
+
variant?: TableVariant;
|
|
963
|
+
className?: string;
|
|
964
|
+
stickyHeader?: boolean;
|
|
965
|
+
sortState?: SortState;
|
|
966
|
+
onSortChange?: (state: SortState) => void;
|
|
967
|
+
}
|
|
968
|
+
|
|
969
|
+
export declare const tableResponsiveMixin: RuleSet<object>;
|
|
970
|
+
|
|
971
|
+
export declare interface TableRowData<T = default_2.ReactNode> {
|
|
972
|
+
id?: string | number;
|
|
973
|
+
cells?: TableCellData<T>[];
|
|
974
|
+
size?: TableCellSize;
|
|
975
|
+
align?: 'left' | 'center' | 'right';
|
|
976
|
+
width?: string | number;
|
|
977
|
+
truncate?: boolean;
|
|
978
|
+
variant?: 'default' | 'numeric';
|
|
979
|
+
className?: string;
|
|
980
|
+
}
|
|
981
|
+
|
|
982
|
+
export declare type TableVariant = 'default' | 'striped';
|
|
983
|
+
|
|
984
|
+
export declare const tableVariants: {
|
|
985
|
+
default: RuleSet<object>;
|
|
986
|
+
striped: RuleSet<object>;
|
|
987
|
+
};
|
|
988
|
+
|
|
989
|
+
export declare const TermsAndConditions: default_2.FC<TermsAndConditionsProps>;
|
|
990
|
+
|
|
991
|
+
export declare interface TermsAndConditionsProps {
|
|
992
|
+
isOpen: boolean;
|
|
993
|
+
onAccept: () => void;
|
|
994
|
+
onCancel: () => void;
|
|
995
|
+
title: string;
|
|
996
|
+
subtitle?: string;
|
|
997
|
+
content: default_2.ReactNode;
|
|
998
|
+
bodyFooter?: default_2.ReactNode;
|
|
999
|
+
confirmationLabel?: string;
|
|
1000
|
+
acceptLabel?: string;
|
|
1001
|
+
cancelLabel?: string;
|
|
1002
|
+
size?: 'sm' | 'md' | 'lg';
|
|
1003
|
+
fullScreen?: boolean;
|
|
1004
|
+
showCloseButton?: boolean;
|
|
1005
|
+
closeOnBackdropClick?: boolean;
|
|
1006
|
+
containerClassName?: string;
|
|
1007
|
+
headerClassName?: string;
|
|
1008
|
+
bodyClassName?: string;
|
|
1009
|
+
footerClassName?: string;
|
|
1010
|
+
initiallyConfirmed?: boolean;
|
|
1011
|
+
onConfirmChange?: (checked: boolean) => void;
|
|
1012
|
+
}
|
|
1013
|
+
|
|
1014
|
+
declare const Text_2: IStyledComponentBase<"web", Substitute<DetailedHTMLProps<HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, {
|
|
1015
|
+
size?: keyof typeof bodyTextStyles;
|
|
1016
|
+
color?: string;
|
|
1017
|
+
}>> & string;
|
|
1018
|
+
export { Text_2 as Text }
|
|
1019
|
+
|
|
1020
|
+
export declare const TextAreaInput: ForwardRefExoticComponent<TextAreaInputProps & RefAttributes<HTMLTextAreaElement>>;
|
|
1021
|
+
|
|
1022
|
+
export declare interface TextAreaInputProps extends Omit<React.TextareaHTMLAttributes<HTMLTextAreaElement>, 'size'> {
|
|
1023
|
+
size?: FormFieldSize;
|
|
1024
|
+
hasError?: boolean;
|
|
1025
|
+
disabled?: boolean;
|
|
1026
|
+
minRows?: number;
|
|
1027
|
+
maxRows?: number;
|
|
1028
|
+
resize?: 'none' | 'vertical' | 'horizontal' | 'both';
|
|
1029
|
+
autoResize?: boolean;
|
|
1030
|
+
}
|
|
1031
|
+
|
|
1032
|
+
export declare interface TextAreaSpecificProps {
|
|
1033
|
+
rows?: number;
|
|
1034
|
+
}
|
|
1035
|
+
|
|
1036
|
+
/**
|
|
1037
|
+
* ToastProvider component for displaying toast notifications.
|
|
1038
|
+
*
|
|
1039
|
+
* This component wraps the Toaster component from the 'sonner' library
|
|
1040
|
+
* to provide a consistent toast notification system across the application.
|
|
1041
|
+
*
|
|
1042
|
+
* @returns The rendered ToastProvider component.
|
|
1043
|
+
*/
|
|
1044
|
+
export declare const ToastProvider: () => JSX.Element;
|
|
1045
|
+
|
|
1046
|
+
/**
|
|
1047
|
+
* Validates if a complete code meets certain criteria
|
|
1048
|
+
*
|
|
1049
|
+
* @param code - The complete code string
|
|
1050
|
+
* @param length - Expected length
|
|
1051
|
+
* @param type - Expected type ('text' | 'number')
|
|
1052
|
+
* @returns boolean indicating if code is valid
|
|
1053
|
+
*/
|
|
1054
|
+
export declare const validateCode: (code: string, length: number, type?: "text" | "number") => boolean;
|
|
1055
|
+
|
|
1056
|
+
declare type Variant = 'rotate' | 'sweep';
|
|
1057
|
+
|
|
1058
|
+
/**
|
|
1059
|
+
* Interfaz base para componentes que soportan iconos a la izquierda y derecha
|
|
1060
|
+
* Puede ser extendida por cualquier componente que necesite funcionalidad de iconos
|
|
1061
|
+
*/
|
|
1062
|
+
export declare interface WithIconsProps {
|
|
1063
|
+
leftIcon?: React.ReactNode | RemixiconComponentType;
|
|
1064
|
+
rightIcon?: React.ReactNode | RemixiconComponentType;
|
|
1065
|
+
iconSize?: IconSizes | string | number;
|
|
1066
|
+
iconColor?: string;
|
|
1067
|
+
}
|
|
1068
|
+
|
|
1069
|
+
export { }
|