componentes-sinco 1.1.3 → 1.1.4

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
@@ -429,7 +429,7 @@ interface SCDialogProps {
429
429
  }
430
430
  declare const SCDialog: ({ title, iconTitle, subtitle, content, actions, buttonDialog, disableClose, dividers, widthContent, heightContent, background, typeView, setShow, show }: SCDialogProps) => React__default.JSX.Element;
431
431
 
432
- interface Option$2 {
432
+ interface Option$3 {
433
433
  title?: string;
434
434
  subtitle?: any;
435
435
  description?: any;
@@ -443,13 +443,13 @@ interface Option$2 {
443
443
  fn?: any;
444
444
  }
445
445
  interface SCListContentProps {
446
- options: Option$2[];
446
+ options: Option$3[];
447
447
  iconLeftType?: "Icon" | "Avatar";
448
448
  iconRightType?: "Icon" | "Avatar";
449
449
  }
450
450
  declare const SCListContent: ({ options, iconLeftType, iconRightType }: SCListContentProps) => React__default.JSX.Element;
451
451
 
452
- interface Option$1 {
452
+ interface Option$2 {
453
453
  name?: string;
454
454
  iconLeft?: any | React__default.ReactNode | React__default.ReactElement | React__default.ElementType | null;
455
455
  iconRight?: any | React__default.ReactNode | React__default.ReactElement | React__default.ElementType | null;
@@ -458,7 +458,7 @@ interface Option$1 {
458
458
  }
459
459
  interface SCMenuProps {
460
460
  header?: any;
461
- options: Option$1[];
461
+ options: Option$2[];
462
462
  defaultOption?: string;
463
463
  disable?: boolean;
464
464
  widthMenu?: string;
@@ -507,14 +507,14 @@ interface SCSelectProps<T> {
507
507
  }
508
508
  declare function SCSelect<T>({ label, data, getItemValue, width, size, variant, background, required, disabled, setState, state, }: SCSelectProps<T>): React__default.JSX.Element;
509
509
 
510
- interface Option {
510
+ interface Option$1 {
511
511
  name?: string;
512
512
  iconOrBadge: string | number | null | undefined | any | React__default.ReactNode | React__default.ReactElement | React__default.ElementType;
513
513
  disabled?: boolean;
514
514
  page: React__default.ReactNode | React__default.ReactElement;
515
515
  }
516
516
  interface SCTabsProps {
517
- options: Option[];
517
+ options: Option$1[];
518
518
  defaultOption?: string;
519
519
  typeIcon?: "badge" | "icon";
520
520
  background?: string;
@@ -677,8 +677,25 @@ interface SCSnackBarProps {
677
677
  }
678
678
  declare const SCSnackBar: ({ type, close, openState, setOpenState, mensaje, duration, position }: SCSnackBarProps) => React__default.JSX.Element;
679
679
 
680
+ interface Option {
681
+ name: string;
682
+ fn?: () => void;
683
+ disabled?: boolean;
684
+ }
685
+ interface SCAppBarProps {
686
+ background?: string;
687
+ contenidoExtra?: React__default.ReactNode;
688
+ menuItems?: React__default.ReactNode;
689
+ options: Option[];
690
+ fnVolver?: () => void;
691
+ visibleVolver?: boolean;
692
+ visibleConexion?: boolean;
693
+ visibleMenu?: boolean;
694
+ }
695
+ declare const SCAppBar: ({ background, contenidoExtra, options, fnVolver, visibleVolver, visibleConexion, visibleMenu, }: SCAppBarProps) => React__default.JSX.Element;
696
+
680
697
  declare const SincoTheme: _mui_material_styles.Theme;
681
698
  declare let AdproSincoTheme: _mui_material_styles.Theme;
682
699
  declare let ADCSincoTheme: _mui_material_styles.Theme;
683
700
 
684
- export { ADCSincoTheme, AdproSincoTheme, Attachment, AttachmentMobile, 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 ReplyButtonVariants, type ReplyPalette$1 as ReplyPalette, type ReplyTextPalette, type ReplyVariants, type RepplyAnchorPositions, type RepplySizeVariants, SCActivityCalendar, SCAutocomplete, SCCalendarSwipeable, SCCard, SCDataGrid, SCDataGridInitial, SCDateRange, SCDialog, SCDrawer, SCListContent, SCMenu, SCModal, SCSelect, SCSnackBar, 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 };
701
+ export { ADCSincoTheme, AdproSincoTheme, Attachment, AttachmentMobile, 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 ReplyButtonVariants, type ReplyPalette$1 as ReplyPalette, type ReplyTextPalette, type ReplyVariants, type RepplyAnchorPositions, type RepplySizeVariants, SCActivityCalendar, SCAppBar, SCAutocomplete, SCCalendarSwipeable, SCCard, SCDataGrid, SCDataGridInitial, SCDateRange, SCDialog, SCDrawer, SCListContent, SCMenu, SCModal, SCSelect, SCSnackBar, 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
@@ -429,7 +429,7 @@ interface SCDialogProps {
429
429
  }
430
430
  declare const SCDialog: ({ title, iconTitle, subtitle, content, actions, buttonDialog, disableClose, dividers, widthContent, heightContent, background, typeView, setShow, show }: SCDialogProps) => React__default.JSX.Element;
431
431
 
432
- interface Option$2 {
432
+ interface Option$3 {
433
433
  title?: string;
434
434
  subtitle?: any;
435
435
  description?: any;
@@ -443,13 +443,13 @@ interface Option$2 {
443
443
  fn?: any;
444
444
  }
445
445
  interface SCListContentProps {
446
- options: Option$2[];
446
+ options: Option$3[];
447
447
  iconLeftType?: "Icon" | "Avatar";
448
448
  iconRightType?: "Icon" | "Avatar";
449
449
  }
450
450
  declare const SCListContent: ({ options, iconLeftType, iconRightType }: SCListContentProps) => React__default.JSX.Element;
451
451
 
452
- interface Option$1 {
452
+ interface Option$2 {
453
453
  name?: string;
454
454
  iconLeft?: any | React__default.ReactNode | React__default.ReactElement | React__default.ElementType | null;
455
455
  iconRight?: any | React__default.ReactNode | React__default.ReactElement | React__default.ElementType | null;
@@ -458,7 +458,7 @@ interface Option$1 {
458
458
  }
459
459
  interface SCMenuProps {
460
460
  header?: any;
461
- options: Option$1[];
461
+ options: Option$2[];
462
462
  defaultOption?: string;
463
463
  disable?: boolean;
464
464
  widthMenu?: string;
@@ -507,14 +507,14 @@ interface SCSelectProps<T> {
507
507
  }
508
508
  declare function SCSelect<T>({ label, data, getItemValue, width, size, variant, background, required, disabled, setState, state, }: SCSelectProps<T>): React__default.JSX.Element;
509
509
 
510
- interface Option {
510
+ interface Option$1 {
511
511
  name?: string;
512
512
  iconOrBadge: string | number | null | undefined | any | React__default.ReactNode | React__default.ReactElement | React__default.ElementType;
513
513
  disabled?: boolean;
514
514
  page: React__default.ReactNode | React__default.ReactElement;
515
515
  }
516
516
  interface SCTabsProps {
517
- options: Option[];
517
+ options: Option$1[];
518
518
  defaultOption?: string;
519
519
  typeIcon?: "badge" | "icon";
520
520
  background?: string;
@@ -677,8 +677,25 @@ interface SCSnackBarProps {
677
677
  }
678
678
  declare const SCSnackBar: ({ type, close, openState, setOpenState, mensaje, duration, position }: SCSnackBarProps) => React__default.JSX.Element;
679
679
 
680
+ interface Option {
681
+ name: string;
682
+ fn?: () => void;
683
+ disabled?: boolean;
684
+ }
685
+ interface SCAppBarProps {
686
+ background?: string;
687
+ contenidoExtra?: React__default.ReactNode;
688
+ menuItems?: React__default.ReactNode;
689
+ options: Option[];
690
+ fnVolver?: () => void;
691
+ visibleVolver?: boolean;
692
+ visibleConexion?: boolean;
693
+ visibleMenu?: boolean;
694
+ }
695
+ declare const SCAppBar: ({ background, contenidoExtra, options, fnVolver, visibleVolver, visibleConexion, visibleMenu, }: SCAppBarProps) => React__default.JSX.Element;
696
+
680
697
  declare const SincoTheme: _mui_material_styles.Theme;
681
698
  declare let AdproSincoTheme: _mui_material_styles.Theme;
682
699
  declare let ADCSincoTheme: _mui_material_styles.Theme;
683
700
 
684
- export { ADCSincoTheme, AdproSincoTheme, Attachment, AttachmentMobile, 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 ReplyButtonVariants, type ReplyPalette$1 as ReplyPalette, type ReplyTextPalette, type ReplyVariants, type RepplyAnchorPositions, type RepplySizeVariants, SCActivityCalendar, SCAutocomplete, SCCalendarSwipeable, SCCard, SCDataGrid, SCDataGridInitial, SCDateRange, SCDialog, SCDrawer, SCListContent, SCMenu, SCModal, SCSelect, SCSnackBar, 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 };
701
+ export { ADCSincoTheme, AdproSincoTheme, Attachment, AttachmentMobile, 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 ReplyButtonVariants, type ReplyPalette$1 as ReplyPalette, type ReplyTextPalette, type ReplyVariants, type RepplyAnchorPositions, type RepplySizeVariants, SCActivityCalendar, SCAppBar, SCAutocomplete, SCCalendarSwipeable, SCCard, SCDataGrid, SCDataGridInitial, SCDateRange, SCDialog, SCDrawer, SCListContent, SCMenu, SCModal, SCSelect, SCSnackBar, 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.js CHANGED
@@ -5309,11 +5309,88 @@ var SCSnackBar = ({
5309
5309
  ));
5310
5310
  };
5311
5311
 
5312
+ // src/Components/SCAppBar.tsx
5313
+ import React46, { useState as useState26, useEffect as useEffect22 } from "react";
5314
+ import { Menu as Menu3, Box as Box29, Typography as Typography27, MenuItem as MenuItem8, IconButton as IconButton17, Badge as Badge3 } from "@mui/material";
5315
+ import Grid12 from "@mui/material/Grid";
5316
+ import "dayjs/locale/es";
5317
+ import MenuIcon from "@mui/icons-material/Menu";
5318
+ import ArrowBackIcon from "@mui/icons-material/ArrowBack";
5319
+ import { Wifi, WifiOff } from "@mui/icons-material";
5320
+ var SCAppBar = ({
5321
+ background = "linear-gradient(180deg, #BBE9FC, #FFFFFF)",
5322
+ contenidoExtra,
5323
+ options,
5324
+ fnVolver,
5325
+ visibleVolver = true,
5326
+ visibleConexion = true,
5327
+ visibleMenu = true
5328
+ }) => {
5329
+ const [isOnline, setIsOnline] = useState26(window.navigator.onLine);
5330
+ const [anchorEl, setAnchorEl] = useState26(null);
5331
+ const openMenu = Boolean(anchorEl);
5332
+ const handleMenuClick = (event2) => {
5333
+ setAnchorEl(event2.currentTarget);
5334
+ };
5335
+ const handleMenuClose = () => {
5336
+ setAnchorEl(null);
5337
+ };
5338
+ useEffect22(() => {
5339
+ const handleOnline = () => {
5340
+ console.log("tiene internet");
5341
+ setIsOnline(true);
5342
+ };
5343
+ const handleOffline = () => {
5344
+ console.log(" no tiene internet");
5345
+ setIsOnline(false);
5346
+ };
5347
+ window.addEventListener("online", handleOnline);
5348
+ window.addEventListener("offline", handleOffline);
5349
+ return () => {
5350
+ window.removeEventListener("online", handleOnline);
5351
+ window.removeEventListener("offline", handleOffline);
5352
+ };
5353
+ }, []);
5354
+ return /* @__PURE__ */ React46.createElement(React46.Fragment, null, /* @__PURE__ */ React46.createElement(Grid12, { sx: { display: "flex", flexDirection: "column", background } }, /* @__PURE__ */ React46.createElement(Grid12, { size: 12, sx: { display: "flex", flexDirection: "row", alignItems: "center", padding: "0px 16px", justifyContent: "space-between" } }, visibleVolver && /* @__PURE__ */ React46.createElement(IconButton17, { size: "medium", onClick: fnVolver }, /* @__PURE__ */ React46.createElement(ArrowBackIcon, { color: "action" })), /* @__PURE__ */ React46.createElement(Grid12, { sx: { display: "flex", flexDirection: "row", alignItems: "center" } }, visibleConexion && /* @__PURE__ */ React46.createElement(Grid12, { sx: { display: "flex", flexDirection: "row", alignItems: "center" } }, isOnline ? /* @__PURE__ */ React46.createElement(Wifi, { color: "action", sx: { marginRight: "8px" } }) : /* @__PURE__ */ React46.createElement(WifiOff, { color: "action", sx: { marginRight: "8px" } }), /* @__PURE__ */ React46.createElement(
5355
+ Badge3,
5356
+ {
5357
+ anchorOrigin: {
5358
+ vertical: "top",
5359
+ horizontal: "left"
5360
+ },
5361
+ variant: "dot",
5362
+ sx: {
5363
+ position: "relative",
5364
+ top: "-3px",
5365
+ left: "-4px"
5366
+ },
5367
+ color: isOnline ? "success" : "error"
5368
+ }
5369
+ ), /* @__PURE__ */ React46.createElement(Typography27, { variant: "caption", color: "text.secondary" }, isOnline ? "Online" : "Offline")), visibleMenu && /* @__PURE__ */ React46.createElement(React46.Fragment, null, /* @__PURE__ */ React46.createElement(IconButton17, { size: "medium", onClick: handleMenuClick }, /* @__PURE__ */ React46.createElement(MenuIcon, { color: "action" })), /* @__PURE__ */ React46.createElement(
5370
+ Menu3,
5371
+ {
5372
+ anchorEl,
5373
+ open: openMenu,
5374
+ onClose: handleMenuClose,
5375
+ anchorOrigin: {
5376
+ vertical: "bottom",
5377
+ horizontal: "right"
5378
+ },
5379
+ transformOrigin: {
5380
+ vertical: "top",
5381
+ horizontal: "right"
5382
+ },
5383
+ sx: { zIndex: "2000" }
5384
+ },
5385
+ options.map((option, index) => /* @__PURE__ */ React46.createElement(MenuItem8, { onClick: option.fn, disabled: option.disabled, key: index }, /* @__PURE__ */ React46.createElement(Typography27, { variant: "body2" }, option.name)))
5386
+ )))), /* @__PURE__ */ React46.createElement(Box29, { sx: { padding: "0px 16px" } }, contenidoExtra)));
5387
+ };
5388
+
5312
5389
  // src/Theme/index.ts
5313
5390
  import { createTheme } from "@mui/material/styles";
5314
5391
 
5315
5392
  // src/Theme/components.ts
5316
- import React46 from "react";
5393
+ import React47 from "react";
5317
5394
  import {
5318
5395
  InfoRounded as InfoRounded2,
5319
5396
  CheckCircleRounded as CheckCircleRounded2,
@@ -6016,10 +6093,10 @@ var components = {
6016
6093
  MuiAlert: {
6017
6094
  defaultProps: {
6018
6095
  iconMapping: {
6019
- success: React46.createElement(CheckCircleRounded2),
6020
- error: React46.createElement(ErrorRounded2),
6021
- warning: React46.createElement(WarningRounded2),
6022
- info: React46.createElement(InfoRounded2)
6096
+ success: React47.createElement(CheckCircleRounded2),
6097
+ error: React47.createElement(ErrorRounded2),
6098
+ warning: React47.createElement(WarningRounded2),
6099
+ info: React47.createElement(InfoRounded2)
6023
6100
  }
6024
6101
  },
6025
6102
  variants: [
@@ -7071,6 +7148,7 @@ export {
7071
7148
  MultiSelect,
7072
7149
  PageHeader,
7073
7150
  SCActivityCalendar,
7151
+ SCAppBar,
7074
7152
  SCAutocomplete,
7075
7153
  SCCalendarSwipeable,
7076
7154
  SCCard,