tcce-design-system-test 0.1.7 → 0.2.0

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.
@@ -1,11 +1,60 @@
1
+ import { AnchorHTMLAttributes } from 'react';
2
+ import { Context } from 'react';
1
3
  import { default as default_2 } from 'react';
2
4
  import { DetailedHTMLProps } from 'react';
5
+ import { ForwardRefExoticComponent } from 'react';
6
+ import { HTMLAttributeAnchorTarget } from 'react';
3
7
  import { HTMLAttributes } from 'react';
4
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';
5
14
  import { RemixiconComponentType } from '@remixicon/react';
6
15
  import { RuleSet } from 'styled-components';
7
16
  import { Substitute } from 'styled-components/dist/types';
8
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
+
9
58
  declare const bodyTextStyles: {
10
59
  80: RuleSet<object>;
11
60
  60: RuleSet<object>;
@@ -15,36 +64,413 @@ declare const bodyTextStyles: {
15
64
  20: RuleSet<object>;
16
65
  18: RuleSet<object>;
17
66
  16: RuleSet<object>;
67
+ 14: RuleSet<object>;
18
68
  12: RuleSet<object>;
19
69
  };
20
70
 
21
71
  export declare const Button: default_2.FC<ButtonProps>;
22
72
 
23
- declare interface ButtonProps extends default_2.ButtonHTMLAttributes<HTMLButtonElement> {
73
+ declare interface ButtonProps extends default_2.ButtonHTMLAttributes<HTMLButtonElement>, WithIconsProps {
24
74
  variant?: ButtonVariant;
25
75
  size?: ButtonSize;
26
76
  isLoading?: boolean;
27
- leftIcon?: default_2.ReactNode | RemixiconComponentType;
28
- rightIcon?: default_2.ReactNode | RemixiconComponentType;
29
- iconSize?: IconSize | string | number;
30
- iconColor?: string;
31
77
  }
32
78
 
33
79
  declare type ButtonSize = 'sm' | 'md' | 'lg';
34
80
 
35
81
  export declare const ButtonSpinner: default_2.FC<{
36
- color?: 'primary' | 'orange' | 'white' | 'gray';
82
+ color?: ColorKey;
83
+ variant?: Variant;
37
84
  }>;
38
85
 
39
86
  declare type ButtonVariant = 'primary' | 'secondary' | 'cancel';
40
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
+
41
311
  export declare const FullScreenSpinner: default_2.FC<{
42
312
  message?: string;
43
- color?: 'primary' | 'orange' | 'white' | 'gray';
313
+ color?: ColorKey;
314
+ variant?: Variant;
44
315
  }>;
45
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
+ * Checks if the user has at least one of the required permissions.
418
+ *
419
+ * @param {string[]} userRoles - The roles or permissions assigned to the user.
420
+ * @param {string[]} permissions - The required permissions to check against.
421
+ * @returns {boolean} True if the user has permission, otherwise false.
422
+ *
423
+ * - Returns false if no permissions are provided.
424
+ * - Returns true if 'all' is included in the permissions array.
425
+ * - Returns true if any of the user's roles match the required permissions.
426
+ */
427
+ export declare const hasPermission: (userRoles?: string[], permissions?: string[]) => boolean;
428
+
429
+ /**
430
+ * Main Header component for the application.
431
+ * Displays notifications, user profile, and optional children.
432
+ *
433
+ * @param {HeaderProps} props - Header component props.
434
+ * @returns {JSX.Element} The rendered header.
435
+ */
436
+ export declare const Header: default_2.FC<HeaderProps>;
437
+
438
+ /**
439
+ * Props for the Header component.
440
+ * @parram sidebarCollapsed: Whether the sidebar is collapsed.
441
+ * @parram user: User information for profile display.
442
+ * @param hasNotifications: Whether there are new notifications.
443
+ * @param notificationCount: Optional count of notifications to display.
444
+ * @param onNotificationClick: Callback when notification button is clicked.
445
+ * @param onUserProfileClick: Callback when user profile is clicked.
446
+ * @param children: Any additional elements to render in the left section.
447
+ */
448
+ export declare interface HeaderProps {
449
+ sidebarCollapsed?: boolean;
450
+ user?: HeaderUser;
451
+ hasNotifications?: boolean;
452
+ /** Optional count. If provided and > 0, overrides hasNotifications and shows the number (capped). */
453
+ notificationCount?: number;
454
+ onNotificationClick?: () => void;
455
+ onUserProfileClick?: () => void;
456
+ children?: default_2.ReactNode;
457
+ }
458
+
459
+ /**
460
+ * User information for the Header component.
461
+ * @param name User's full name.
462
+ * @param role User's role or title.
463
+ * @param avatarUrl Optional URL for user's avatar image.
464
+ */
465
+ export declare interface HeaderUser {
466
+ name: string;
467
+ role: string;
468
+ avatarUrl?: string;
469
+ }
470
+
46
471
  export declare const HeadingBold: IStyledComponentBase<"web", Substitute<DetailedHTMLProps<HTMLAttributes<HTMLHeadingElement>, HTMLHeadingElement>, {
47
472
  size?: keyof typeof headingBoldStyles;
473
+ color?: string;
48
474
  }>> & string;
49
475
 
50
476
  declare const headingBoldStyles: {
@@ -59,6 +485,7 @@ declare const headingBoldStyles: {
59
485
 
60
486
  export declare const HeadingRegular: IStyledComponentBase<"web", Substitute<DetailedHTMLProps<HTMLAttributes<HTMLHeadingElement>, HTMLHeadingElement>, {
61
487
  size?: keyof typeof headingRegularStyles;
488
+ color?: string;
62
489
  }>> & string;
63
490
 
64
491
  declare const headingRegularStyles: {
@@ -75,33 +502,530 @@ export declare const Icon: default_2.FC<IconProps>;
75
502
 
76
503
  declare interface IconProps {
77
504
  component: default_2.ReactNode | RemixiconComponentType;
78
- size?: IconSize_2 | string | number;
505
+ size?: IconSizes | string | number;
79
506
  color?: string;
80
507
  className?: string;
81
508
  iconProps?: Record<string, unknown>;
82
509
  }
83
510
 
84
- declare type IconSize = 'tn' | 'sm' | 'md' | 'lg';
511
+ declare type IconSizes = 'tn' | 'sm' | 'md' | 'lg';
512
+
513
+ export declare const IconWrapperStyles: RuleSet<object>;
514
+
515
+ /**
516
+ * Input component props interfaces for the getPropsForInputType function
517
+ */
518
+ export declare interface InputComponentProps {
519
+ field: any;
520
+ id?: string | number;
521
+ name: string;
522
+ className?: string;
523
+ hasError: boolean;
524
+ disabled: boolean;
525
+ size: FormFieldSize;
526
+ placeholder?: string;
527
+ type?: string;
528
+ onChange?: (event: default_2.ChangeEvent<HTMLInputElement>) => void;
529
+ [key: string]: any;
530
+ }
531
+
532
+ /**
533
+ * CodeInputUtils - Utilities for handling verification code input fields
534
+ *
535
+ * This utility provides functions to manage multi-digit input fields commonly used
536
+ * for verification codes, OTP (One-Time Password), or similar authentication flows.
537
+ *
538
+ * Key features:
539
+ * - Auto-focus navigation between input fields
540
+ * - Paste support for complete codes
541
+ * - Backspace navigation to previous fields
542
+ * - Single character validation per field
543
+ *
544
+ * Used by: PinInputGroup component for PIN/verification code workflows
545
+ */
546
+ export declare type InputRef = default_2.RefObject<HTMLInputElement | null>;
547
+
548
+ export declare type InputRefs = default_2.RefObject<HTMLInputElement | null>[];
549
+
550
+ export declare const Label: default_2.FC<BaseLabelProps>;
551
+
552
+ export declare type LabelSize = 'sm' | 'md' | 'lg';
553
+
554
+ export declare const Layout: default_2.FC<LayoutProps>;
555
+
556
+ export declare interface LayoutProps {
557
+ children: default_2.ReactNode;
558
+ navigationConfig: NavigationItem[];
559
+ userRoles?: string[];
560
+ activePath?: string;
561
+ user?: HeaderUser;
562
+ hasNotifications?: boolean;
563
+ onNavigate?: (path: string) => void;
564
+ onNotificationClick?: () => void;
565
+ onUserProfileClick?: () => void;
566
+ contentClassName?: string;
567
+ }
568
+
569
+ /**
570
+ * Link component with support for icons, variants, sizes, and accessibility.
571
+ *
572
+ * @param props - LinkProps
573
+ * @param ref - Ref to the anchor element
574
+ * @return JSX.Element
575
+ */
576
+ export declare const Link: default_2.ForwardRefExoticComponent<LinkProps & default_2.RefAttributes<HTMLAnchorElement>>;
577
+
578
+ /**
579
+ * Props for the Link component.
580
+ * Extends standard anchor attributes and WithIconsProps.
581
+ */
582
+ export declare interface LinkProps extends AnchorHTMLAttributes<HTMLAnchorElement>, WithIconsProps {
583
+ id?: string;
584
+ size?: LinkSize;
585
+ variant?: LinkVariant;
586
+ children: ReactNode;
587
+ disabled?: boolean;
588
+ /** Target attribute for the anchor */
589
+ target?: HTMLAttributeAnchorTarget;
590
+ rel?: string;
591
+ className?: string;
592
+ truncate?: boolean;
593
+ /** Accessible label for the link */
594
+ 'aria-label'?: string;
595
+ /** Accessible description for the link */
596
+ 'aria-describedby'?: string;
597
+ tabIndex?: number;
598
+ onClick?: MouseEventHandler<HTMLAnchorElement>;
599
+ }
600
+
601
+ /**
602
+ * Defines the available sizes for the Link component.
603
+ */
604
+ export declare type LinkSize = 'sm' | 'md' | 'lg';
605
+
606
+ /**
607
+ * Defines the available visual variants for the Link component.
608
+ */
609
+ export declare type LinkVariant = 'underlined' | 'plain';
610
+
611
+ /**
612
+ * Represents a navigation item used in the sidebar navigation component.
613
+ *
614
+ * @property id - Unique identifier for the navigation item.
615
+ * @property label - Display text for the navigation item.
616
+ * @property icon - Optional icon component or React node to display alongside the label.
617
+ * @property iconSize - Optional size for the icon; can be a predefined IconSizes value, string, or number.
618
+ * @property iconColor - Optional color for the icon.
619
+ * @property path - Optional navigation path or URL associated with the item.
620
+ * @property permissions - List of permissions required to access this navigation item.
621
+ * @property children - Optional array of child navigation items for nested navigation structures.
622
+ */
623
+ export declare interface NavigationItem {
624
+ id: string;
625
+ label: string;
626
+ icon?: React.ReactNode | RemixiconComponentType;
627
+ iconSize?: IconSizes | string | number;
628
+ iconColor?: string;
629
+ path?: string;
630
+ permissions: Permission[];
631
+ children?: NavigationItem[];
632
+ }
633
+
634
+ /**
635
+ * Normalizes field configurations to ensure only valid types are used
636
+ * @param fields - Array of field configurations
637
+ * @returns Normalized field configurations with valid types
638
+ */
639
+ export declare const normalizeFieldTypes: (fields: Partial<FieldConfig>[]) => FieldConfig[];
640
+
641
+ /**
642
+ * Transforms select options to the expected format
643
+ * @param options - Options in various formats
644
+ * @returns Normalized SelectOption array
645
+ */
646
+ export declare const normalizeSelectOptions: (options: Array<{
647
+ value: string | number;
648
+ label: string;
649
+ }> | SelectOption[]) => SelectOption[];
85
650
 
86
- declare type IconSize_2 = 'tn' | 'sm' | 'md' | 'lg';
651
+ export declare const PasswordInput: default_2.FC<PasswordInputProps>;
652
+
653
+ export declare interface PasswordInputProps extends BaseFormFieldProps, Omit<WithIconsProps, 'rightIcon'> {
654
+ }
655
+
656
+ export declare type Permission = string;
657
+
658
+ export declare const PinInput: ForwardRefExoticComponent<PinInputProps & RefAttributes<HTMLInputElement>>;
659
+
660
+ export declare const PinInputGroup: default_2.FC<PinInputGroupProps>;
661
+
662
+ export declare interface PinInputGroupProps {
663
+ length?: number;
664
+ size?: FormFieldSize;
665
+ variant?: 'outlined' | 'filled';
666
+ hasError?: boolean;
667
+ type?: 'text' | 'number';
668
+ onChange?: (value: string) => void;
669
+ onComplete?: (value: string) => void;
670
+ className?: string;
671
+ pinInputClassName?: string;
672
+ }
673
+
674
+ export declare interface PinInputProps extends BaseFormFieldProps {
675
+ variant?: 'outlined' | 'filled';
676
+ }
677
+
678
+ export declare interface PinSpecificProps {
679
+ pinLength?: number;
680
+ pinType?: 'text' | 'number';
681
+ onPinComplete?: (value: string) => void;
682
+ }
683
+
684
+ export declare const RadioInput: ForwardRefExoticComponent<RadioInputProps & RefAttributes<HTMLInputElement>>;
685
+
686
+ export declare const RadioInputDot: default_2.ForwardRefExoticComponent<RadioInputDotProps & default_2.RefAttributes<HTMLInputElement>>;
687
+
688
+ declare interface RadioInputDotProps extends Omit<default_2.InputHTMLAttributes<HTMLInputElement>, 'size' | 'type'> {
689
+ size?: FormFieldSize;
690
+ hasError?: boolean;
691
+ dotClassName?: string;
692
+ }
693
+
694
+ export declare const RadioInputLabel: React.FC<BaseLabelProps>;
695
+
696
+ export declare interface RadioInputProps extends Omit<React.InputHTMLAttributes<HTMLInputElement>, 'size' | 'type'> {
697
+ size?: FormFieldSize;
698
+ label?: string;
699
+ hasError?: boolean;
700
+ dotClassName?: string;
701
+ labelClassName?: string;
702
+ }
703
+
704
+ export declare interface RadioSpecificProps {
705
+ options: Array<{
706
+ value: string | number;
707
+ label: string;
708
+ }>;
709
+ radioName?: string;
710
+ onRadioChange?: (event: default_2.ChangeEvent<HTMLInputElement>) => void;
711
+ }
712
+
713
+ export declare const SearchInput: default_2.FC<SearchInputProps>;
714
+
715
+ export declare interface SearchInputProps extends WithIconsProps {
716
+ size?: FormFieldSize;
717
+ placeholder?: string;
718
+ onSearch?: (value: string) => void;
719
+ className?: string;
720
+ }
721
+
722
+ export declare interface SearchSpecificProps {
723
+ onSearch?: (value: string) => void;
724
+ }
87
725
 
88
726
  export declare const SectionSpinner: default_2.FC<{
89
727
  message?: string;
90
- color?: 'primary' | 'orange' | 'white' | 'gray';
728
+ color?: ColorKey;
729
+ variant?: Variant;
91
730
  }>;
92
731
 
732
+ export declare const SelectInput: default_2.ForwardRefExoticComponent<SelectInputProps & default_2.RefAttributes<HTMLButtonElement>>;
733
+
734
+ export declare interface SelectInputProps extends Omit<React.SelectHTMLAttributes<HTMLSelectElement>, 'size'> {
735
+ size?: FormFieldSize;
736
+ hasError?: boolean;
737
+ disabled?: boolean;
738
+ options: SelectOption[];
739
+ placeholder?: string;
740
+ onOptionSelect?: (option: SelectOption) => void;
741
+ className?: string;
742
+ inputClassName?: string;
743
+ optionsClassName?: string;
744
+ optionClassName?: string;
745
+ }
746
+
747
+ export declare interface SelectOption {
748
+ value: string | number;
749
+ label: string;
750
+ disabled?: boolean;
751
+ }
752
+
753
+ export declare interface SelectSpecificProps {
754
+ options: SelectOption[];
755
+ onOptionSelect?: (option: SelectOption) => void;
756
+ }
757
+
758
+ export declare type SetDigits = default_2.Dispatch<default_2.SetStateAction<string[]>>;
759
+
760
+ /**
761
+ * Sidebar component for navigation.
762
+ *
763
+ * @param {SidebarProps} props - Sidebar properties.
764
+ * @param {Array} props.navigationConfig - Navigation items configuration.
765
+ * @param {Array} [props.userRoles=[]] - User roles for access control.
766
+ * @param {Function} [props.onNavigate] - Callback when navigation occurs.
767
+ * @param {string} [props.activePath] - Currently active navigation path.
768
+ * @returns {JSX.Element} Sidebar navigation component.
769
+ */
770
+ export declare const Sidebar: default_2.FC<SidebarProps>;
771
+
772
+ export declare const SidebarContext: Context<SidebarContextValue | undefined>;
773
+
774
+ /**
775
+ * Context value for managing the sidebar state.
776
+ * @property isCollapsed - Boolean indicating whether the sidebar is collapsed.
777
+ * @property setIsCollapsed - Function to toggle the collapsed state of the sidebar.
778
+ * @property isMobileOpen - Boolean indicating whether the sidebar is open on mobile devices.
779
+ * @property setIsMobileOpen - Function to toggle the mobile open state of the sidebar.
780
+ */
781
+ export declare interface SidebarContextValue {
782
+ isCollapsed: boolean;
783
+ setIsCollapsed: (v: boolean) => void;
784
+ isMobileOpen: boolean;
785
+ setIsMobileOpen: (v: boolean) => void;
786
+ }
787
+
788
+ /**
789
+ * Props for the Sidebar component.
790
+ *
791
+ * @property navigationConfig - Array of NavigationItem objects defining the sidebar structure.
792
+ * @property userRoles - Optional array of roles assigned to the current user for permission checks.
793
+ * @property currentUser - Optional SidebarUser object containing user information like name and role.
794
+ * @property onNavigate - Optional callback function invoked when a navigation item is clicked, receiving the item's path as an argument.
795
+ * @property activePath - Optional string representing the currently active navigation path for highlighting purposes.
796
+ */
797
+ export declare interface SidebarProps {
798
+ navigationConfig: NavigationItem[];
799
+ userRoles?: string[];
800
+ currentUser?: SidebarUser;
801
+ onNavigate?: (path: string) => void;
802
+ activePath?: string;
803
+ }
804
+
805
+ export declare const SidebarProvider: ({ children }: PropsWithChildren) => JSX.Element;
806
+
807
+ export declare interface SidebarUser {
808
+ name?: string;
809
+ role?: string;
810
+ }
811
+
812
+ declare type Size = 'sm' | 'md' | 'lg' | 'xl';
813
+
814
+ export declare const sizeStyles: {
815
+ sm: RuleSet<object>;
816
+ md: RuleSet<object>;
817
+ lg: RuleSet<object>;
818
+ };
819
+
820
+ export declare type SortDirection = 'asc' | 'desc' | 'none';
821
+
822
+ export declare interface SortState {
823
+ columnId: string | null;
824
+ direction: SortDirection;
825
+ }
826
+
93
827
  export declare const Spinner: default_2.FC<SpinnerProps>;
94
828
 
95
829
  declare interface SpinnerProps {
96
- size?: 'sm' | 'md' | 'lg' | 'xl';
97
- color?: 'primary' | 'orange' | 'white' | 'gray';
830
+ size?: Size;
831
+ color?: ColorKey;
98
832
  centered?: boolean;
99
833
  message?: string;
834
+ title?: string;
835
+ variant?: Variant;
836
+ }
837
+
838
+ /**
839
+ * Table component for rendering customizable tables with support for
840
+ * sticky headers, sorting, and custom cell rendering.
841
+ *
842
+ * @param columns - Array of column definitions.
843
+ * @param rows - Array of row data.
844
+ * @param size - Table size variant ('sm', 'md', 'lg'). Default is 'md'.
845
+ * @param variant - Table visual variant. Default is 'default'.
846
+ * @param className - Optional CSS class for the table.
847
+ * @param stickyHeader - Enables sticky table headers.
848
+ * @param onSortChange - Callback for sort direction changes.
849
+ */
850
+ export declare const Table: {
851
+ ({ columns, rows, size, variant, className, stickyHeader, onSortChange, }: TableProps): JSX.Element;
852
+ displayName: string;
853
+ };
854
+
855
+ /**
856
+ * TableCell component for rendering a styled table cell with optional icons and content.
857
+ *
858
+ * @param {TableCellProps} props - Props for the TableCell component you can see them in @components/tables/types/table.types.ts.
859
+ * @returns {JSX.Element} The rendered table cell.
860
+ */
861
+ export declare const TableCell: default_2.FC<TableCellProps>;
862
+
863
+ export declare interface TableCellData<T = default_2.ReactNode> extends WithIconsProps {
864
+ content: default_2.ReactNode | T;
865
+ size?: TableCellSize;
866
+ align?: 'left' | 'center' | 'right';
867
+ width?: string | number;
868
+ truncate?: boolean;
869
+ variant?: 'default' | 'numeric';
870
+ className?: string;
871
+ }
872
+
873
+ export declare interface TableCellProps extends default_2.HTMLAttributes<HTMLTableCellElement>, WithIconsProps {
874
+ children: default_2.ReactNode;
875
+ size?: TableCellSize;
876
+ align?: 'left' | 'center' | 'right';
877
+ width?: string | number;
878
+ truncate?: boolean;
879
+ variant?: 'default' | 'numeric';
880
+ }
881
+
882
+ export declare type TableCellSize = 'sm' | 'md' | 'lg';
883
+
884
+ export declare interface TableColumnDef<T = default_2.ReactNode> extends WithIconsProps, Omit<TableHeaderCellProps, 'children' | 'onSort'> {
885
+ id?: string;
886
+ header: default_2.ReactNode | T;
887
+ sortable?: boolean;
888
+ filterable?: boolean;
889
+ resizable?: boolean;
890
+ fixed?: 'left' | 'right';
891
+ stickyHeader?: boolean;
892
+ onSort?: (direction: SortDirection) => void;
893
+ }
894
+
895
+ /**
896
+ * TableHeaderCell component for rendering a table header cell with optional sorting and icons.
897
+ *
898
+ * @param {TableHeaderCellProps} props - The props for the TableHeaderCell component.
899
+ * @returns {JSX.Element} The rendered table header cell.
900
+ */
901
+ export declare const TableHeaderCell: default_2.FC<TableHeaderCellProps>;
902
+
903
+ export declare interface TableHeaderCellProps extends default_2.HTMLAttributes<HTMLTableCellElement>, WithIconsProps {
904
+ children: default_2.ReactNode;
905
+ size?: TableCellSize;
906
+ sortable?: boolean;
907
+ sortDirection?: SortDirection;
908
+ align?: 'left' | 'center' | 'right';
909
+ width?: string | number;
910
+ active?: boolean;
911
+ sticky?: boolean;
912
+ fixed?: 'left' | 'right';
913
+ onSort?: (direction: SortDirection) => void;
914
+ }
915
+
916
+ export declare const tableHoverMixin: RuleSet<object>;
917
+
918
+ export declare const tableIconContainerStyles: RuleSet<object>;
919
+
920
+ export declare interface TableProps<T = default_2.ReactNode> {
921
+ columns: TableColumnDef<T>[];
922
+ rows: TableRowData<T>[];
923
+ size?: TableCellSize;
924
+ variant?: TableVariant;
925
+ className?: string;
926
+ stickyHeader?: boolean;
927
+ sortState?: SortState;
928
+ onSortChange?: (state: SortState) => void;
929
+ }
930
+
931
+ export declare const tableResponsiveMixin: RuleSet<object>;
932
+
933
+ export declare interface TableRowData<T = default_2.ReactNode> {
934
+ id?: string | number;
935
+ cells?: TableCellData<T>[];
936
+ size?: TableCellSize;
937
+ align?: 'left' | 'center' | 'right';
938
+ width?: string | number;
939
+ truncate?: boolean;
940
+ variant?: 'default' | 'numeric';
941
+ className?: string;
942
+ }
943
+
944
+ export declare type TableVariant = 'default' | 'striped';
945
+
946
+ export declare const tableVariants: {
947
+ default: RuleSet<object>;
948
+ striped: RuleSet<object>;
949
+ };
950
+
951
+ export declare const TermsAndConditions: default_2.FC<TermsAndConditionsProps>;
952
+
953
+ export declare interface TermsAndConditionsProps {
954
+ isOpen: boolean;
955
+ onAccept: () => void;
956
+ onCancel: () => void;
957
+ title: string;
958
+ subtitle?: string;
959
+ content: default_2.ReactNode;
960
+ bodyFooter?: default_2.ReactNode;
961
+ confirmationLabel?: string;
962
+ acceptLabel?: string;
963
+ cancelLabel?: string;
964
+ size?: 'sm' | 'md' | 'lg';
965
+ fullScreen?: boolean;
966
+ showCloseButton?: boolean;
967
+ closeOnBackdropClick?: boolean;
968
+ containerClassName?: string;
969
+ headerClassName?: string;
970
+ bodyClassName?: string;
971
+ footerClassName?: string;
972
+ initiallyConfirmed?: boolean;
973
+ onConfirmChange?: (checked: boolean) => void;
100
974
  }
101
975
 
102
976
  declare const Text_2: IStyledComponentBase<"web", Substitute<DetailedHTMLProps<HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, {
103
977
  size?: keyof typeof bodyTextStyles;
978
+ color?: string;
104
979
  }>> & string;
105
980
  export { Text_2 as Text }
106
981
 
982
+ export declare const TextAreaInput: ForwardRefExoticComponent<TextAreaInputProps & RefAttributes<HTMLTextAreaElement>>;
983
+
984
+ export declare interface TextAreaInputProps extends Omit<React.TextareaHTMLAttributes<HTMLTextAreaElement>, 'size'> {
985
+ size?: FormFieldSize;
986
+ hasError?: boolean;
987
+ disabled?: boolean;
988
+ minRows?: number;
989
+ maxRows?: number;
990
+ resize?: 'none' | 'vertical' | 'horizontal' | 'both';
991
+ autoResize?: boolean;
992
+ }
993
+
994
+ export declare interface TextAreaSpecificProps {
995
+ rows?: number;
996
+ }
997
+
998
+ /**
999
+ * ToastProvider component for displaying toast notifications.
1000
+ *
1001
+ * This component wraps the Toaster component from the 'sonner' library
1002
+ * to provide a consistent toast notification system across the application.
1003
+ *
1004
+ * @returns The rendered ToastProvider component.
1005
+ */
1006
+ export declare const ToastProvider: () => JSX.Element;
1007
+
1008
+ /**
1009
+ * Validates if a complete code meets certain criteria
1010
+ *
1011
+ * @param code - The complete code string
1012
+ * @param length - Expected length
1013
+ * @param type - Expected type ('text' | 'number')
1014
+ * @returns boolean indicating if code is valid
1015
+ */
1016
+ export declare const validateCode: (code: string, length: number, type?: "text" | "number") => boolean;
1017
+
1018
+ declare type Variant = 'rotate' | 'sweep';
1019
+
1020
+ /**
1021
+ * Interfaz base para componentes que soportan iconos a la izquierda y derecha
1022
+ * Puede ser extendida por cualquier componente que necesite funcionalidad de iconos
1023
+ */
1024
+ declare interface WithIconsProps {
1025
+ leftIcon?: React.ReactNode | RemixiconComponentType;
1026
+ rightIcon?: React.ReactNode | RemixiconComponentType;
1027
+ iconSize?: IconSizes | string | number;
1028
+ iconColor?: string;
1029
+ }
1030
+
107
1031
  export { }