componentes-sinco 1.0.39 → 1.0.40

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.cjs CHANGED
@@ -104,6 +104,7 @@ __export(index_exports, {
104
104
  SCMenu: () => SCMenu,
105
105
  SCModal: () => SCModal,
106
106
  SCSelect: () => SCSelect,
107
+ SCSnackBar: () => SCSnackBar,
107
108
  SCTabs: () => SCTabs,
108
109
  SCTextArea: () => SCTextArea,
109
110
  SCTextField: () => SCTextField,
@@ -5346,11 +5347,55 @@ var AttachmentMobile = ({
5346
5347
  ));
5347
5348
  };
5348
5349
 
5350
+ // src/Components/SCSnackbar.tsx
5351
+ var import_react53 = __toESM(require("react"), 1);
5352
+ var import_Alert = __toESM(require("@mui/material/Alert"), 1);
5353
+ var import_es4 = require("dayjs/locale/es");
5354
+ var import_Button = __toESM(require("@mui/material/Button"), 1);
5355
+ var import_Snackbar = __toESM(require("@mui/material/Snackbar"), 1);
5356
+ var SCSnackBar = ({
5357
+ type = "success",
5358
+ close = true,
5359
+ openState,
5360
+ setOpenState,
5361
+ mensaje,
5362
+ duration = 3e3,
5363
+ position = "Center"
5364
+ }) => {
5365
+ const posicionVertical = position == "Center" ? "bottom" : position.split("-")[1] == "Up" ? "top" : "bottom";
5366
+ const posicionHorizontal = position == "Center" ? "center" : position.split("-")[0] == "Left" ? "left" : "right";
5367
+ const handleClick = () => {
5368
+ setOpenState(true);
5369
+ };
5370
+ const handleClose = (event2, reason) => {
5371
+ if (reason === "clickaway") {
5372
+ return;
5373
+ }
5374
+ setOpenState(false);
5375
+ };
5376
+ return /* @__PURE__ */ import_react53.default.createElement(import_react53.default.Fragment, null, /* @__PURE__ */ import_react53.default.createElement(import_Button.default, { onClick: handleClick }, "Open Snackbar"), /* @__PURE__ */ import_react53.default.createElement(
5377
+ import_Snackbar.default,
5378
+ __spreadValues({
5379
+ anchorOrigin: { vertical: posicionVertical, horizontal: posicionHorizontal },
5380
+ open: openState,
5381
+ autoHideDuration: duration
5382
+ }, close ? { onClose: handleClose } : {}),
5383
+ /* @__PURE__ */ import_react53.default.createElement(
5384
+ import_Alert.default,
5385
+ __spreadProps(__spreadValues({}, close ? { onClose: handleClose } : {}), {
5386
+ severity: type,
5387
+ sx: { backgroundColor: type == "success" ? "success.50" : type == "error" ? "#F9E8E8" : type == "warning" ? "#FFF0E0" : "#E6F3F8" }
5388
+ }),
5389
+ mensaje
5390
+ )
5391
+ ));
5392
+ };
5393
+
5349
5394
  // src/Theme/index.ts
5350
5395
  var import_styles3 = require("@mui/material/styles");
5351
5396
 
5352
5397
  // src/Theme/components.ts
5353
- var import_react53 = __toESM(require("react"), 1);
5398
+ var import_react54 = __toESM(require("react"), 1);
5354
5399
  var import_icons_material14 = require("@mui/icons-material");
5355
5400
  var components = {
5356
5401
  MuiSelect: {
@@ -6048,10 +6093,10 @@ var components = {
6048
6093
  MuiAlert: {
6049
6094
  defaultProps: {
6050
6095
  iconMapping: {
6051
- success: import_react53.default.createElement(import_icons_material14.CheckCircleRounded),
6052
- error: import_react53.default.createElement(import_icons_material14.ErrorRounded),
6053
- warning: import_react53.default.createElement(import_icons_material14.WarningRounded),
6054
- info: import_react53.default.createElement(import_icons_material14.InfoRounded)
6096
+ success: import_react54.default.createElement(import_icons_material14.CheckCircleRounded),
6097
+ error: import_react54.default.createElement(import_icons_material14.ErrorRounded),
6098
+ warning: import_react54.default.createElement(import_icons_material14.WarningRounded),
6099
+ info: import_react54.default.createElement(import_icons_material14.InfoRounded)
6055
6100
  }
6056
6101
  },
6057
6102
  variants: [
@@ -7116,6 +7161,7 @@ var ADCSincoTheme = (0, import_styles3.createTheme)(__spreadValues({}, ADCTheme)
7116
7161
  SCMenu,
7117
7162
  SCModal,
7118
7163
  SCSelect,
7164
+ SCSnackBar,
7119
7165
  SCTabs,
7120
7166
  SCTextArea,
7121
7167
  SCTextField,