componentes-sinco 1.0.27 → 1.0.29

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.cts CHANGED
@@ -176,6 +176,7 @@ interface ModalProps {
176
176
  fn: () => void;
177
177
  disabled?: boolean;
178
178
  }[];
179
+ setOpen?: React.Dispatch<React.SetStateAction<boolean>>;
179
180
  buttonModal?: {
180
181
  icon?: string;
181
182
  text?: string;
@@ -190,9 +191,7 @@ declare const getIconComponent: (iconName?: string) => React.ElementType;
190
191
  declare const getModalColor: (state: string) => string;
191
192
  declare const getButtonColor: (state: string) => 'inherit' | 'info' | 'error' | 'warning';
192
193
 
193
- declare const SCModal: ({ buttonModal, state, open, setOpen, title, description, action, }: ModalProps & {
194
- setOpen?: React__default.Dispatch<React__default.SetStateAction<boolean>> | undefined;
195
- }) => React__default.JSX.Element;
194
+ declare const SCModal: ({ buttonModal, state, open, setOpen, title, description, action, }: ModalProps) => React__default.JSX.Element;
196
195
 
197
196
  interface MultiSelectProps<T> {
198
197
  textButton?: string;
@@ -311,33 +310,6 @@ interface SCTextFieldProps {
311
310
 
312
311
  declare const SCTextField: ({ title, iconTitle, infoTitle, label, placeholder, infoElement, iconInputStart, iconInputEnd, maxLength, variant, format, disabled, required, size, width, color, background, setState, state, onChange, onBlur, onKeyDown, }: SCTextFieldProps) => React__default.JSX.Element;
313
312
 
314
- interface SCAutocompleteProps<T> {
315
- label?: string;
316
- data: T[];
317
- columnGroup?: string;
318
- getItemValue: (item: T) => {
319
- icon?: any;
320
- text: string;
321
- value: string;
322
- component?: any;
323
- };
324
- typeFormat?: "normal" | "multiselect";
325
- checkMassive?: boolean;
326
- deleteType?: "button" | "icon";
327
- required?: boolean;
328
- disabled?: boolean;
329
- background?: string;
330
- fnAplicar?: () => void | React__default.ReactNode;
331
- setState: React__default.Dispatch<React__default.SetStateAction<any>>;
332
- state: {
333
- hiddenValue: string | string[];
334
- textValue: string | string[];
335
- };
336
- inputChange?: (value: string) => void;
337
- maxCheck?: number;
338
- }
339
- declare function SCAutocomplete<T>({ label, data, columnGroup, getItemValue, typeFormat, checkMassive, deleteType, fnAplicar, required, disabled, background, setState, state, inputChange, maxCheck, }: SCAutocompleteProps<T>): React__default.JSX.Element;
340
-
341
313
  interface SCCalendarSwipeableProps {
342
314
  background?: string;
343
315
  setState: React__default.Dispatch<React__default.SetStateAction<string>>;
@@ -365,6 +337,33 @@ interface SCDataGridInitialProps<T> {
365
337
  declare function SCDataGridInitial<T>({ data, columns, groupColumns, rowsTable, checkboxSelection, width, maxHeight, density }: SCDataGridInitialProps<T>): React__default.JSX.Element;
366
338
  declare const SCDataGrid: React__default.MemoExoticComponent<typeof SCDataGridInitial>;
367
339
 
340
+ interface SCAutocompleteProps<T> {
341
+ label?: string;
342
+ data: T[];
343
+ columnGroup?: string;
344
+ getItemValue: (item: T) => {
345
+ icon?: any;
346
+ text: string;
347
+ value: string;
348
+ component?: any;
349
+ };
350
+ typeFormat?: "normal" | "multiselect";
351
+ checkMassive?: boolean;
352
+ deleteType?: "button" | "icon";
353
+ required?: boolean;
354
+ disabled?: boolean;
355
+ background?: string;
356
+ fnAplicar?: () => void | React__default.ReactNode;
357
+ setState: React__default.Dispatch<React__default.SetStateAction<any>>;
358
+ state: {
359
+ hiddenValue: string | string[];
360
+ textValue: string | string[];
361
+ };
362
+ inputChange?: (value: string) => void;
363
+ maxCheck?: number;
364
+ }
365
+ declare function SCAutocomplete<T>({ label, data, columnGroup, getItemValue, typeFormat, checkMassive, deleteType, fnAplicar, required, disabled, background, setState, state, inputChange, maxCheck, }: SCAutocompleteProps<T>): React__default.JSX.Element;
366
+
368
367
  type EmptyStateStates = 'create' | 'error' | 'noResult' | 'search';
369
368
  type EmptyStateSize = 'small' | 'large';
370
369
  interface EmptyStateProperties {
@@ -465,6 +464,23 @@ interface SCMenuProps {
465
464
  }
466
465
  declare const SCMenu: ({ header, options, defaultOption, disable, widthMenu, heightMenu, widthPage }: SCMenuProps) => React__default.JSX.Element;
467
466
 
467
+ interface BasicMenuProps {
468
+ open?: boolean;
469
+ onClose?: () => void;
470
+ button?: {
471
+ icon?: string;
472
+ text?: string;
473
+ color?: ReplyPalette$1;
474
+ variant?: RepplyButtonVariants;
475
+ iconPosition?: 'left' | 'right';
476
+ size?: "small" | "medium" | "large";
477
+ };
478
+ anchorEl?: null | HTMLElement;
479
+ handleClick?: (event: React__default.MouseEvent<HTMLButtonElement>) => void;
480
+ options?: [];
481
+ }
482
+ declare const BasicMenu: ({ open, onClose, button, anchorEl, handleClick, options }: BasicMenuProps) => React__default.JSX.Element;
483
+
468
484
  interface SCSelectProps<T> {
469
485
  label?: string;
470
486
  data: T[];
@@ -509,12 +525,13 @@ interface SCTabsProps {
509
525
  declare const SCTabs: ({ options, defaultOption, typeIcon, background, iconPosition, colorTab, orientation, variant, scrollButtons, children }: SCTabsProps) => React__default.JSX.Element;
510
526
 
511
527
  type CalendarView = 'month' | 'week' | 'day';
528
+ type EventState = 'En progreso' | 'Finalizada' | 'Vencida' | 'Asignada' | 'Aplazada' | 'Generada';
512
529
  interface CalendarEvent {
513
530
  id: string;
514
531
  title: string;
515
532
  start: dayjs.Dayjs;
516
533
  end: dayjs.Dayjs;
517
- state: 'En progreso' | 'Finalizada' | 'Vencida' | 'Asignada' | 'Aplazada' | 'Generada';
534
+ state: EventState;
518
535
  }
519
536
  interface CalendarProps {
520
537
  events: CalendarEvent[];
@@ -534,6 +551,46 @@ interface CalendarProps {
534
551
 
535
552
  declare const Calendar: React__default.FC<CalendarProps>;
536
553
 
554
+ declare const CALENDAR_CONSTANTS: {
555
+ readonly GRID_TEMPLATE: "repeat(7, minmax(150px, 1fr))";
556
+ readonly DAY_HEIGHT: 60;
557
+ readonly SIDEBAR_WIDTH: 47;
558
+ readonly MIN_CELL_HEIGHT: 120;
559
+ readonly DEFAULT_START_HOUR: 0;
560
+ readonly DEFAULT_END_HOUR: 23;
561
+ readonly DRAWER_WIDTH: "350px";
562
+ readonly MAX_VISIBLE_EVENTS: 2;
563
+ readonly MIN_WIDTH: "1050px";
564
+ readonly LOADING_SPINNER_SIZE: "60px";
565
+ readonly LOADING_CONTAINER_HEIGHT: "450px";
566
+ readonly DAY_CIRCLE_SIZE: 24;
567
+ };
568
+
569
+ type NavigationAction = 'PREV' | 'NEXT' | 'TODAY';
570
+ declare const useCalendarNavigation: (initialDate?: dayjs.Dayjs, onDateChange?: ((date: dayjs.Dayjs) => void) | undefined) => {
571
+ currentDate: dayjs.Dayjs;
572
+ setCurrentDate: React$1.Dispatch<React$1.SetStateAction<dayjs.Dayjs>>;
573
+ navigateDate: (action: NavigationAction, view: CalendarView) => void;
574
+ };
575
+
576
+ type CellBorderType = 'full' | 'start' | 'end' | 'middle' | 'none';
577
+ declare const filterEventsForDay: (events: CalendarEvent[], day: Dayjs) => CalendarEvent[];
578
+ declare const getCellBorderType: (cellHour: number, dayEvents: CalendarEvent[]) => CellBorderType;
579
+ declare const clampEventToVisibleRange: (event: CalendarEvent, currentDate: Dayjs, startHour: number, endHour: number) => {
580
+ startMinutes: number;
581
+ durationMinutes: number;
582
+ clampedStart: dayjs.Dayjs;
583
+ clampedEnd: dayjs.Dayjs;
584
+ };
585
+
586
+ interface DayEventsListProps {
587
+ events: CalendarEvent[];
588
+ day: dayjs.Dayjs;
589
+ onEventClick?: (event: CalendarEvent, date?: dayjs.Dayjs) => void;
590
+ onEventHover?: (event: CalendarEvent) => React__default.ReactNode;
591
+ }
592
+ declare const DayEventsList: React__default.FC<DayEventsListProps>;
593
+
537
594
  interface SCTimeProps {
538
595
  label?: string;
539
596
  required?: boolean;
@@ -579,4 +636,4 @@ declare const SincoTheme: _mui_material_styles.Theme;
579
636
  declare let AdproSincoTheme: _mui_material_styles.Theme;
580
637
  declare let ADCSincoTheme: _mui_material_styles.Theme;
581
638
 
582
- export { ADCSincoTheme, AdproSincoTheme, Attachment, Calendar, type CalendarEvent, type CalendarProps, type CalendarView, EmptyState, type EmptyStateProperties, type EmptyStateSize, type EmptyStateStates, FooterAction, type FooterActionsProperties, type ModalProps, type ModalStates, MultiSelect, type MultiSelectProps, PageHeader, type PageheaderProperties, type ReplyPalette$1 as ReplyPalette, type ReplyTextPalette, type ReplyVariants, type RepplyButtonVariants, SCActivityCalendar, SCAutocomplete, SCCalendarSwipeable, SCCard, SCDataGrid, SCDataGridInitial, SCDateRange, SCDialog, SCDrawer, SCListContent, SCMenu, SCModal, SCSelect, SCTabs, SCTextArea, type SCTextAreaProps, SCTextField, type SCTextFieldProps, SCTime, SCToastNotification, SincoTheme, type ToastBaseProperties, ToastProgress, type ToastType, capitalize, getButtonColor, getIcon, getIconComponent, getIconMultiSelect, getModalColor, modalStateConfig, useFilteredItems, useMultiSelectHandlers, useProgress };
639
+ export { ADCSincoTheme, AdproSincoTheme, Attachment, BasicMenu, type BasicMenuProps, CALENDAR_CONSTANTS, Calendar, type CalendarEvent, type CalendarProps, type CalendarView, type CellBorderType, DayEventsList, EmptyState, type EmptyStateProperties, type EmptyStateSize, type EmptyStateStates, type EventState, FooterAction, type FooterActionsProperties, type ModalProps, type ModalStates, MultiSelect, type MultiSelectProps, type NavigationAction, PageHeader, type PageheaderProperties, type ReplyPalette$1 as ReplyPalette, type ReplyTextPalette, type ReplyVariants, type RepplyButtonVariants, SCActivityCalendar, SCAutocomplete, SCCalendarSwipeable, SCCard, SCDataGrid, SCDataGridInitial, SCDateRange, SCDialog, SCDrawer, SCListContent, SCMenu, SCModal, SCSelect, SCTabs, SCTextArea, type SCTextAreaProps, SCTextField, type SCTextFieldProps, SCTime, SCToastNotification, SincoTheme, type ToastBaseProperties, ToastProgress, type ToastType, capitalize, clampEventToVisibleRange, filterEventsForDay, getButtonColor, getCellBorderType, getIcon, getIconComponent, getIconMultiSelect, getModalColor, modalStateConfig, useCalendarNavigation, useFilteredItems, useMultiSelectHandlers, useProgress };
package/dist/index.d.ts CHANGED
@@ -176,6 +176,7 @@ interface ModalProps {
176
176
  fn: () => void;
177
177
  disabled?: boolean;
178
178
  }[];
179
+ setOpen?: React.Dispatch<React.SetStateAction<boolean>>;
179
180
  buttonModal?: {
180
181
  icon?: string;
181
182
  text?: string;
@@ -190,9 +191,7 @@ declare const getIconComponent: (iconName?: string) => React.ElementType;
190
191
  declare const getModalColor: (state: string) => string;
191
192
  declare const getButtonColor: (state: string) => 'inherit' | 'info' | 'error' | 'warning';
192
193
 
193
- declare const SCModal: ({ buttonModal, state, open, setOpen, title, description, action, }: ModalProps & {
194
- setOpen?: React__default.Dispatch<React__default.SetStateAction<boolean>> | undefined;
195
- }) => React__default.JSX.Element;
194
+ declare const SCModal: ({ buttonModal, state, open, setOpen, title, description, action, }: ModalProps) => React__default.JSX.Element;
196
195
 
197
196
  interface MultiSelectProps<T> {
198
197
  textButton?: string;
@@ -311,33 +310,6 @@ interface SCTextFieldProps {
311
310
 
312
311
  declare const SCTextField: ({ title, iconTitle, infoTitle, label, placeholder, infoElement, iconInputStart, iconInputEnd, maxLength, variant, format, disabled, required, size, width, color, background, setState, state, onChange, onBlur, onKeyDown, }: SCTextFieldProps) => React__default.JSX.Element;
313
312
 
314
- interface SCAutocompleteProps<T> {
315
- label?: string;
316
- data: T[];
317
- columnGroup?: string;
318
- getItemValue: (item: T) => {
319
- icon?: any;
320
- text: string;
321
- value: string;
322
- component?: any;
323
- };
324
- typeFormat?: "normal" | "multiselect";
325
- checkMassive?: boolean;
326
- deleteType?: "button" | "icon";
327
- required?: boolean;
328
- disabled?: boolean;
329
- background?: string;
330
- fnAplicar?: () => void | React__default.ReactNode;
331
- setState: React__default.Dispatch<React__default.SetStateAction<any>>;
332
- state: {
333
- hiddenValue: string | string[];
334
- textValue: string | string[];
335
- };
336
- inputChange?: (value: string) => void;
337
- maxCheck?: number;
338
- }
339
- declare function SCAutocomplete<T>({ label, data, columnGroup, getItemValue, typeFormat, checkMassive, deleteType, fnAplicar, required, disabled, background, setState, state, inputChange, maxCheck, }: SCAutocompleteProps<T>): React__default.JSX.Element;
340
-
341
313
  interface SCCalendarSwipeableProps {
342
314
  background?: string;
343
315
  setState: React__default.Dispatch<React__default.SetStateAction<string>>;
@@ -365,6 +337,33 @@ interface SCDataGridInitialProps<T> {
365
337
  declare function SCDataGridInitial<T>({ data, columns, groupColumns, rowsTable, checkboxSelection, width, maxHeight, density }: SCDataGridInitialProps<T>): React__default.JSX.Element;
366
338
  declare const SCDataGrid: React__default.MemoExoticComponent<typeof SCDataGridInitial>;
367
339
 
340
+ interface SCAutocompleteProps<T> {
341
+ label?: string;
342
+ data: T[];
343
+ columnGroup?: string;
344
+ getItemValue: (item: T) => {
345
+ icon?: any;
346
+ text: string;
347
+ value: string;
348
+ component?: any;
349
+ };
350
+ typeFormat?: "normal" | "multiselect";
351
+ checkMassive?: boolean;
352
+ deleteType?: "button" | "icon";
353
+ required?: boolean;
354
+ disabled?: boolean;
355
+ background?: string;
356
+ fnAplicar?: () => void | React__default.ReactNode;
357
+ setState: React__default.Dispatch<React__default.SetStateAction<any>>;
358
+ state: {
359
+ hiddenValue: string | string[];
360
+ textValue: string | string[];
361
+ };
362
+ inputChange?: (value: string) => void;
363
+ maxCheck?: number;
364
+ }
365
+ declare function SCAutocomplete<T>({ label, data, columnGroup, getItemValue, typeFormat, checkMassive, deleteType, fnAplicar, required, disabled, background, setState, state, inputChange, maxCheck, }: SCAutocompleteProps<T>): React__default.JSX.Element;
366
+
368
367
  type EmptyStateStates = 'create' | 'error' | 'noResult' | 'search';
369
368
  type EmptyStateSize = 'small' | 'large';
370
369
  interface EmptyStateProperties {
@@ -465,6 +464,23 @@ interface SCMenuProps {
465
464
  }
466
465
  declare const SCMenu: ({ header, options, defaultOption, disable, widthMenu, heightMenu, widthPage }: SCMenuProps) => React__default.JSX.Element;
467
466
 
467
+ interface BasicMenuProps {
468
+ open?: boolean;
469
+ onClose?: () => void;
470
+ button?: {
471
+ icon?: string;
472
+ text?: string;
473
+ color?: ReplyPalette$1;
474
+ variant?: RepplyButtonVariants;
475
+ iconPosition?: 'left' | 'right';
476
+ size?: "small" | "medium" | "large";
477
+ };
478
+ anchorEl?: null | HTMLElement;
479
+ handleClick?: (event: React__default.MouseEvent<HTMLButtonElement>) => void;
480
+ options?: [];
481
+ }
482
+ declare const BasicMenu: ({ open, onClose, button, anchorEl, handleClick, options }: BasicMenuProps) => React__default.JSX.Element;
483
+
468
484
  interface SCSelectProps<T> {
469
485
  label?: string;
470
486
  data: T[];
@@ -509,12 +525,13 @@ interface SCTabsProps {
509
525
  declare const SCTabs: ({ options, defaultOption, typeIcon, background, iconPosition, colorTab, orientation, variant, scrollButtons, children }: SCTabsProps) => React__default.JSX.Element;
510
526
 
511
527
  type CalendarView = 'month' | 'week' | 'day';
528
+ type EventState = 'En progreso' | 'Finalizada' | 'Vencida' | 'Asignada' | 'Aplazada' | 'Generada';
512
529
  interface CalendarEvent {
513
530
  id: string;
514
531
  title: string;
515
532
  start: dayjs.Dayjs;
516
533
  end: dayjs.Dayjs;
517
- state: 'En progreso' | 'Finalizada' | 'Vencida' | 'Asignada' | 'Aplazada' | 'Generada';
534
+ state: EventState;
518
535
  }
519
536
  interface CalendarProps {
520
537
  events: CalendarEvent[];
@@ -534,6 +551,46 @@ interface CalendarProps {
534
551
 
535
552
  declare const Calendar: React__default.FC<CalendarProps>;
536
553
 
554
+ declare const CALENDAR_CONSTANTS: {
555
+ readonly GRID_TEMPLATE: "repeat(7, minmax(150px, 1fr))";
556
+ readonly DAY_HEIGHT: 60;
557
+ readonly SIDEBAR_WIDTH: 47;
558
+ readonly MIN_CELL_HEIGHT: 120;
559
+ readonly DEFAULT_START_HOUR: 0;
560
+ readonly DEFAULT_END_HOUR: 23;
561
+ readonly DRAWER_WIDTH: "350px";
562
+ readonly MAX_VISIBLE_EVENTS: 2;
563
+ readonly MIN_WIDTH: "1050px";
564
+ readonly LOADING_SPINNER_SIZE: "60px";
565
+ readonly LOADING_CONTAINER_HEIGHT: "450px";
566
+ readonly DAY_CIRCLE_SIZE: 24;
567
+ };
568
+
569
+ type NavigationAction = 'PREV' | 'NEXT' | 'TODAY';
570
+ declare const useCalendarNavigation: (initialDate?: dayjs.Dayjs, onDateChange?: ((date: dayjs.Dayjs) => void) | undefined) => {
571
+ currentDate: dayjs.Dayjs;
572
+ setCurrentDate: React$1.Dispatch<React$1.SetStateAction<dayjs.Dayjs>>;
573
+ navigateDate: (action: NavigationAction, view: CalendarView) => void;
574
+ };
575
+
576
+ type CellBorderType = 'full' | 'start' | 'end' | 'middle' | 'none';
577
+ declare const filterEventsForDay: (events: CalendarEvent[], day: Dayjs) => CalendarEvent[];
578
+ declare const getCellBorderType: (cellHour: number, dayEvents: CalendarEvent[]) => CellBorderType;
579
+ declare const clampEventToVisibleRange: (event: CalendarEvent, currentDate: Dayjs, startHour: number, endHour: number) => {
580
+ startMinutes: number;
581
+ durationMinutes: number;
582
+ clampedStart: dayjs.Dayjs;
583
+ clampedEnd: dayjs.Dayjs;
584
+ };
585
+
586
+ interface DayEventsListProps {
587
+ events: CalendarEvent[];
588
+ day: dayjs.Dayjs;
589
+ onEventClick?: (event: CalendarEvent, date?: dayjs.Dayjs) => void;
590
+ onEventHover?: (event: CalendarEvent) => React__default.ReactNode;
591
+ }
592
+ declare const DayEventsList: React__default.FC<DayEventsListProps>;
593
+
537
594
  interface SCTimeProps {
538
595
  label?: string;
539
596
  required?: boolean;
@@ -579,4 +636,4 @@ declare const SincoTheme: _mui_material_styles.Theme;
579
636
  declare let AdproSincoTheme: _mui_material_styles.Theme;
580
637
  declare let ADCSincoTheme: _mui_material_styles.Theme;
581
638
 
582
- export { ADCSincoTheme, AdproSincoTheme, Attachment, Calendar, type CalendarEvent, type CalendarProps, type CalendarView, EmptyState, type EmptyStateProperties, type EmptyStateSize, type EmptyStateStates, FooterAction, type FooterActionsProperties, type ModalProps, type ModalStates, MultiSelect, type MultiSelectProps, PageHeader, type PageheaderProperties, type ReplyPalette$1 as ReplyPalette, type ReplyTextPalette, type ReplyVariants, type RepplyButtonVariants, SCActivityCalendar, SCAutocomplete, SCCalendarSwipeable, SCCard, SCDataGrid, SCDataGridInitial, SCDateRange, SCDialog, SCDrawer, SCListContent, SCMenu, SCModal, SCSelect, SCTabs, SCTextArea, type SCTextAreaProps, SCTextField, type SCTextFieldProps, SCTime, SCToastNotification, SincoTheme, type ToastBaseProperties, ToastProgress, type ToastType, capitalize, getButtonColor, getIcon, getIconComponent, getIconMultiSelect, getModalColor, modalStateConfig, useFilteredItems, useMultiSelectHandlers, useProgress };
639
+ export { ADCSincoTheme, AdproSincoTheme, Attachment, BasicMenu, type BasicMenuProps, CALENDAR_CONSTANTS, Calendar, type CalendarEvent, type CalendarProps, type CalendarView, type CellBorderType, DayEventsList, EmptyState, type EmptyStateProperties, type EmptyStateSize, type EmptyStateStates, type EventState, FooterAction, type FooterActionsProperties, type ModalProps, type ModalStates, MultiSelect, type MultiSelectProps, type NavigationAction, PageHeader, type PageheaderProperties, type ReplyPalette$1 as ReplyPalette, type ReplyTextPalette, type ReplyVariants, type RepplyButtonVariants, SCActivityCalendar, SCAutocomplete, SCCalendarSwipeable, SCCard, SCDataGrid, SCDataGridInitial, SCDateRange, SCDialog, SCDrawer, SCListContent, SCMenu, SCModal, SCSelect, SCTabs, SCTextArea, type SCTextAreaProps, SCTextField, type SCTextFieldProps, SCTime, SCToastNotification, SincoTheme, type ToastBaseProperties, ToastProgress, type ToastType, capitalize, clampEventToVisibleRange, filterEventsForDay, getButtonColor, getCellBorderType, getIcon, getIconComponent, getIconMultiSelect, getModalColor, modalStateConfig, useCalendarNavigation, useFilteredItems, useMultiSelectHandlers, useProgress };