@sinco/react 1.0.15-rc.22 → 1.0.15-rc.29

Sign up to get free protection for your applications and to get access to all the features.
package/index.js CHANGED
@@ -1,10 +1,7 @@
1
- import { createTheme, ThemeProvider } from '@mui/material/styles';
1
+ import { createTheme } from '@mui/material/styles';
2
2
  import React, { useState, useEffect } from 'react';
3
- import { CheckCircleRounded, ErrorRounded, WarningRounded, InfoRounded } from '@mui/icons-material';
4
- import { Stack, Typography, Box as Box$1, IconButton, AppBar, Toolbar, alpha } from '@mui/material';
5
- import Typography$1 from '@mui/material/Typography';
6
- import CloseIcon from '@mui/icons-material/Close';
7
- import Drawer from '@mui/material/Drawer';
3
+ import { CheckCircleRounded, ErrorRounded, WarningRounded, InfoRounded, Close, KeyboardArrowDown, KeyboardArrowUp } from '@mui/icons-material';
4
+ import { Stack, Typography, Drawer, IconButton, AppBar, Toolbar, Box as Box$1, Divider, Button, LinearProgress, alpha } from '@mui/material';
8
5
 
9
6
  var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
10
7
 
@@ -1097,31 +1094,31 @@ const components = {
1097
1094
  defaultProps: {
1098
1095
  columnHeaderHeight: 35,
1099
1096
  rowHeight: 32,
1100
- density: 'compact'
1097
+ density: "compact"
1101
1098
  },
1102
1099
  styleOverrides: {
1103
1100
  iconButtonContainer: {
1104
1101
  fontSize: 16
1105
1102
  },
1106
1103
  columnHeaderTitle: {
1107
- fontFamily: 'Roboto',
1104
+ fontFamily: "Roboto",
1108
1105
  fontWeight: 500,
1109
1106
  fontSize: 13,
1110
1107
  lineHeight: 1.5,
1111
- letterSpacing: .17
1108
+ letterSpacing: 0.17
1112
1109
  },
1113
1110
  cell: {
1114
- fontFamily: 'Roboto',
1111
+ fontFamily: "Roboto",
1115
1112
  fontWeight: 300,
1116
1113
  fontSize: 12,
1117
1114
  lineHeight: 1.5,
1118
- letterSpacing: .17,
1115
+ letterSpacing: 0.17,
1119
1116
  // COMPONENTES DENTRO DE CELDAS
1120
1117
  ".MuiButtonBase-root": {
1121
1118
  lineHeight: 0,
1122
1119
  textTransform: "capitalize"
1123
1120
  },
1124
- // CELDA ENFOCADA
1121
+ // CELDA ENFOCADA
1125
1122
  ".MuiDataGrid-cell": {
1126
1123
  "&:focus": {
1127
1124
  outline: "transparent",
@@ -1131,17 +1128,17 @@ const components = {
1131
1128
  },
1132
1129
  // BOTOM MENU EN LAS CABECERA DE CADA COLUMNA
1133
1130
  menuIconButton: {
1134
- "svg": {
1135
- fontSize: '16px'
1131
+ svg: {
1132
+ fontSize: "16px"
1136
1133
  }
1137
1134
  },
1138
1135
  menu: {
1139
- "svg": {
1140
- fontSize: '16px !important'
1136
+ svg: {
1137
+ fontSize: "16px !important"
1141
1138
  },
1142
1139
  ".MuiMenuItem-root": {
1143
- minHeight: '28px',
1144
- height: '28px'
1140
+ minHeight: "28px",
1141
+ height: "28px"
1145
1142
  }
1146
1143
  },
1147
1144
  pinnedRows: {
@@ -1150,10 +1147,10 @@ const components = {
1150
1147
  root: {
1151
1148
  // FONT-SIZE DE CELDA EN MODO EDICION
1152
1149
  ".MuiInputBase-root": {
1153
- fontFamily: 'Roboto',
1150
+ fontFamily: "Roboto",
1154
1151
  fontWeight: 300,
1155
1152
  fontSize: 12,
1156
- letterSpacing: .17,
1153
+ letterSpacing: 0.17,
1157
1154
  borderRadius: "0px"
1158
1155
  },
1159
1156
  // CELDA FOCUS
@@ -1176,7 +1173,7 @@ const components = {
1176
1173
  },
1177
1174
  MuiRating: {
1178
1175
  defaultProps: {
1179
- size: 'small'
1176
+ size: "small"
1180
1177
  },
1181
1178
  styleOverrides: {
1182
1179
  sizeSmall: {
@@ -1200,18 +1197,18 @@ const components = {
1200
1197
  MuiDrawer: {
1201
1198
  styleOverrides: {
1202
1199
  root: {
1203
- boxShadow: "0px 3px 1px -2px rgba(24, 39, 75, 0.20), 0px 2px 2px 0px rgba(24, 39, 75, 0.14), 0px 1px 5px 0px rgba(24, 39, 75, 0.12)",
1204
- '-webkit-backdrop-filter': '#f0f0f099 !important',
1205
- '.MuiBackdrop-root': {
1206
- backgroundColor: '#F0f0f099 !important'
1207
- }
1200
+ boxShadow: "0px 3px 1px -2px rgba(24, 39, 75, 0.20), 0px 2px 2px 0px rgba(24, 39, 75, 0.14), 0px 1px 5px 0px rgba(24, 39, 75, 0.12)"
1208
1201
  }
1209
1202
  }
1210
1203
  },
1211
1204
  MuiDialog: {
1212
1205
  styleOverrides: {
1213
1206
  root: {
1214
- boxShadow: " 0px 2px 1px -2px rgba(24, 39, 75, 0.20), 0px 1px 1px -1px rgba(24, 39, 75, 0.14), 0px 1px 3px 0px rgba(24, 39, 75, 0.12)"
1207
+ boxShadow: " 0px 2px 1px -2px rgba(24, 39, 75, 0.20), 0px 1px 1px -1px rgba(24, 39, 75, 0.14), 0px 1px 3px 0px rgba(24, 39, 75, 0.12)",
1208
+ ".MuiBackdrop-root": {
1209
+ backgroundColor: "#f0f0f099",
1210
+ backdropFilter: "blur(2px) !important"
1211
+ }
1215
1212
  }
1216
1213
  }
1217
1214
  },
@@ -1225,11 +1222,23 @@ const components = {
1225
1222
  },
1226
1223
  MuiCheckbox: {
1227
1224
  variants: [{
1225
+ props: {
1226
+ size: "large"
1227
+ },
1228
+ style: {
1229
+ padding: 9,
1230
+ "& .MuiSvgIcon-fontSizeLarge": {
1231
+ height: 24,
1232
+ width: 24,
1233
+ fontSize: 24
1234
+ }
1235
+ }
1236
+ }, {
1228
1237
  props: {
1229
1238
  size: "small"
1230
1239
  },
1231
1240
  style: {
1232
- padding: 2
1241
+ padding: 3
1233
1242
  }
1234
1243
  }, {
1235
1244
  props: {
@@ -1246,13 +1255,6 @@ const components = {
1246
1255
  MuiChip: {
1247
1256
  styleOverrides: {
1248
1257
  sizeSmall: {
1249
- fontFamily: "Roboto",
1250
- fontSize: "10px",
1251
- fontStyle: "normal",
1252
- fontWeight: 400,
1253
- lineHeight: "10px",
1254
- letterSpacing: " 0.15px",
1255
- color: "text.primary",
1256
1258
  height: 16
1257
1259
  },
1258
1260
  sizeMedium: {
@@ -1261,13 +1263,17 @@ const components = {
1261
1263
  root: {
1262
1264
  height: "inherit",
1263
1265
  borderRadius: 4,
1264
- ".MuiChip-deleteIconSmall": {
1266
+ ".MuiChip-deleteIconXsmall": {
1265
1267
  height: 12,
1266
1268
  width: 12
1267
1269
  },
1268
- ".MuiChip-deleteIconMedium": {
1270
+ ".MuiChip-deleteIconSmall": {
1269
1271
  height: 16,
1270
1272
  widht: 16
1273
+ },
1274
+ ".MuiChip-deleteIconMedium": {
1275
+ height: 20,
1276
+ widht: 20
1271
1277
  }
1272
1278
  }
1273
1279
  }
@@ -1283,7 +1289,7 @@ const components = {
1283
1289
  },
1284
1290
  styleOverrides: {
1285
1291
  root: {
1286
- paddingY: .5,
1292
+ paddingY: 0.5,
1287
1293
  paddingX: 2,
1288
1294
  alignItems: "center",
1289
1295
  border: "none"
@@ -1292,37 +1298,51 @@ const components = {
1292
1298
  },
1293
1299
  MuiButton: {
1294
1300
  styleOverrides: {
1295
- endIcon: {
1301
+ startIcon: {
1296
1302
  marginLeft: 2
1297
1303
  },
1298
- iconSizeSmall: {
1299
- height: 14,
1300
- width: 14
1301
- },
1302
- iconSizeMedium: {
1303
- height: 18,
1304
- width: 18
1305
- },
1306
- iconSizeLarge: {
1307
- height: 18,
1308
- width: 22
1304
+ endIcon: {
1305
+ marginRight: 2
1309
1306
  },
1310
1307
  sizeSmall: {
1311
- height: 26
1308
+ height: 26,
1309
+ ".MuiSvgIcon-fontSizeSmall": {
1310
+ height: 16,
1311
+ width: 16
1312
+ },
1313
+ ".MuiSvgIcon-fontSizeMedium": {
1314
+ height: 18,
1315
+ width: 18
1316
+ },
1317
+ ".MuiSvgIcon-fontSizeLarge": {
1318
+ height: 20,
1319
+ width: 20
1320
+ }
1312
1321
  },
1313
1322
  sizeMedium: {
1314
1323
  height: 32,
1324
+ ".MuiSvgIcon-fontSizeSmall": {
1325
+ height: 16,
1326
+ width: 16
1327
+ },
1315
1328
  ".MuiSvgIcon-fontSizeMedium": {
1316
1329
  height: 18,
1317
1330
  width: 18
1331
+ },
1332
+ ".MuiSvgIcon-fontSizeLarge": {
1333
+ height: 20,
1334
+ width: 20
1318
1335
  }
1319
1336
  },
1320
1337
  sizeLarge: {
1321
1338
  height: 38,
1322
- fontSize: 14,
1323
- ".MuiSvgIcon-fontSizeLarge": {
1324
- height: 20,
1325
- width: 20
1339
+ ".MuiSvgIcon-fontSizeSmall": {
1340
+ height: 16,
1341
+ width: 16
1342
+ },
1343
+ "&.MuiSvgIcon-fontSizeMedium": {
1344
+ height: 18,
1345
+ width: 18
1326
1346
  }
1327
1347
  }
1328
1348
  }
@@ -1426,15 +1446,12 @@ const components = {
1426
1446
  MuiIconButton: {
1427
1447
  styleOverrides: {
1428
1448
  sizeSmall: {
1429
- fontSize: 14,
1430
- padding: 4
1449
+ padding: 3
1431
1450
  },
1432
1451
  sizeMedium: {
1433
- fontSize: 20,
1434
- padding: 13
1452
+ padding: 12
1435
1453
  },
1436
1454
  sizeLarge: {
1437
- fontSize: 33,
1438
1455
  padding: 17
1439
1456
  }
1440
1457
  }
@@ -1508,12 +1525,12 @@ const components = {
1508
1525
  MuiInputLabel: {
1509
1526
  styleOverrides: {
1510
1527
  asterisk: {
1511
- color: '#D14343'
1528
+ color: "#D14343"
1512
1529
  },
1513
1530
  root: {
1514
- display: 'flex',
1515
- gap: '.2rem',
1516
- flexDirection: 'row-reverse'
1531
+ display: "flex",
1532
+ gap: ".2rem",
1533
+ flexDirection: "row-reverse"
1517
1534
  },
1518
1535
  outlined: {
1519
1536
  "&.MuiInputLabel-outlined.MuiInputLabel-sizeSmall ": {
@@ -1544,14 +1561,26 @@ const components = {
1544
1561
  size: "small"
1545
1562
  },
1546
1563
  style: {
1547
- padding: 2
1564
+ padding: 3
1548
1565
  }
1549
1566
  }, {
1550
1567
  props: {
1551
1568
  size: "medium"
1552
1569
  },
1553
1570
  style: {
1554
- padding: 9
1571
+ padding: 4
1572
+ }
1573
+ }, {
1574
+ props: {
1575
+ size: "large"
1576
+ },
1577
+ style: {
1578
+ padding: 9,
1579
+ "& .MuiSvgIcon-fontSizeLarge": {
1580
+ width: 24,
1581
+ height: 24,
1582
+ fontSize: 24
1583
+ }
1555
1584
  }
1556
1585
  }],
1557
1586
  defaultProps: {
@@ -1559,6 +1588,17 @@ const components = {
1559
1588
  }
1560
1589
  },
1561
1590
  MuiSwitch: {
1591
+ variants: [{
1592
+ props: {
1593
+ size: "small"
1594
+ },
1595
+ style: {
1596
+ height: 22,
1597
+ ".MuiSwitch-switchBase": {
1598
+ padding: 3
1599
+ }
1600
+ }
1601
+ }],
1562
1602
  defaultProps: {
1563
1603
  size: "small"
1564
1604
  }
@@ -1588,286 +1628,145 @@ const components = {
1588
1628
 
1589
1629
  const palette = {
1590
1630
  primary: {
1591
- 50: "#E4ECF4",
1592
- 100: "#BCD0E3",
1593
- 200: "#8FB1D0",
1594
- 300: "#6392BD",
1595
- light: "#417AAE",
1596
- main: "#2063A0",
1597
- 600: "#1C5B98",
1598
- 700: "#18518E",
1599
- 800: "#134784",
1600
- dark: "#0B3573",
1601
- A100: "#A5C5FF",
1602
- A200: "#72A4FF",
1603
- A400: "#3F83FF",
1604
- A700: "#2572FF",
1605
- contrastText: "#ffffff"
1631
+ 50: '#E4ECF4',
1632
+ 100: '#BCD0E3',
1633
+ 200: '#8FB1D0',
1634
+ 300: '#6392BD',
1635
+ light: '#417AAE',
1636
+ main: '#2063A0',
1637
+ 600: '#1C5B98',
1638
+ 700: '#18518E',
1639
+ 800: '#134784',
1640
+ dark: '#0B3573',
1641
+ A100: '#A5C5FF',
1642
+ A200: '#72A4FF',
1643
+ A400: '#3F83FF',
1644
+ A700: '#2572FF',
1645
+ contrastText: '#ffffff'
1606
1646
  },
1607
1647
  secondary: {
1608
- 50: "#E0F7FA",
1609
- 100: "#B3EBF2",
1610
- 200: "#80DEEA",
1611
- 300: "#4DD0E1",
1612
- light: "#26C6DA",
1613
- main: "#00BCD4",
1614
- 600: "#00B6CF",
1615
- 700: "#00ADC9",
1616
- 800: "#00A5C3",
1617
- dark: "#0097B9",
1618
- A100: "#E2F9FF",
1619
- A200: "#AFEEFF",
1620
- A400: "#7CE3FF",
1621
- A700: "#63DDFF",
1622
- contrastText: "#ffffff"
1648
+ 50: '#E0F7FA',
1649
+ 100: '#B3EBF2',
1650
+ 200: '#80DEEA',
1651
+ 300: '#4DD0E1',
1652
+ light: '#26C6DA',
1653
+ main: '#00BCD4',
1654
+ 600: '#00B6CF',
1655
+ 700: '#00ADC9',
1656
+ 800: '#00A5C3',
1657
+ dark: '#0097B9',
1658
+ A100: '#E2F9FF',
1659
+ A200: '#AFEEFF',
1660
+ A400: '#7CE3FF',
1661
+ A700: '#63DDFF',
1662
+ contrastText: '#ffffff'
1623
1663
  },
1624
1664
  error: {
1625
- 50: "#F9E8E8",
1626
- 100: "#F1C7C7",
1627
- 200: "#E8A1A1",
1628
- 300: "#DF7B7B",
1629
- light: "#D85F5F",
1630
- main: "#D14343",
1631
- 600: "#CC3D3D",
1632
- 700: "#C63434",
1633
- 800: "#C02C2C",
1634
- dark: "#B51E1E",
1635
- A100: "#FFECEC",
1636
- A200: "#FFB9B9",
1637
- A400: "#FF8686",
1638
- A700: "#FF6D6D",
1639
- contrastText: "#ffffff"
1665
+ 50: '#F9E8E8',
1666
+ 100: '#F1C7C7',
1667
+ 200: '#E8A1A1',
1668
+ 300: '#DF7B7B',
1669
+ light: '#D85F5F',
1670
+ main: '#D14343',
1671
+ 600: '#CC3D3D',
1672
+ 700: '#C63434',
1673
+ 800: '#C02C2C',
1674
+ dark: '#B51E1E',
1675
+ A100: '#FFECEC',
1676
+ A200: '#FFB9B9',
1677
+ A400: '#FF8686',
1678
+ A700: '#FF6D6D',
1679
+ contrastText: '#ffffff'
1640
1680
  },
1641
1681
  warning: {
1642
- 50: "#FFF0E0",
1643
- 100: "#FEDAB3",
1644
- 200: "#FDC280",
1645
- 300: "#FCAA4D",
1646
- light: "#FC9726",
1647
- main: "#FB8500",
1648
- 600: "#FA7D00",
1649
- 700: "#FA7200",
1650
- 800: "#F96800",
1651
- dark: "#F85500",
1652
- A100: "#FFFFFF",
1653
- A200: "#FFF1EB",
1654
- A400: "#FFCCB8",
1655
- A700: "#FFBA9F",
1656
- contrastText: "#ffffff"
1682
+ 50: '#FFF0E0',
1683
+ 100: '#FEDAB3',
1684
+ 200: '#FDC280',
1685
+ 300: '#FCAA4D',
1686
+ light: '#FC9726',
1687
+ main: '#FB8500',
1688
+ 600: '#FA7D00',
1689
+ 700: '#FA7200',
1690
+ 800: '#F96800',
1691
+ dark: '#F85500',
1692
+ A100: '#FFFFFF',
1693
+ A200: '#FFF1EB',
1694
+ A400: '#FFCCB8',
1695
+ A700: '#FFBA9F',
1696
+ contrastText: '#ffffff'
1657
1697
  },
1658
1698
  info: {
1659
- 50: "#E6F3F8",
1660
- 100: "#C0E2EE",
1661
- 200: "#96CFE2",
1662
- 300: "#6CBCD6",
1663
- light: "#4DADCE",
1664
- main: "#2D9FC5",
1665
- 600: "#2897BF",
1666
- 700: "#228DB8",
1667
- 800: "#1C83B0",
1668
- dark: "#1172A3",
1669
- A100: "#D4EFFF",
1670
- A200: "#A1DCFF",
1671
- A400: "#6ECAFF",
1672
- A700: "#54C1FF",
1673
- contrastText: "#ffffff"
1699
+ 50: '#E6F3F8',
1700
+ 100: '#C0E2EE',
1701
+ 200: '#96CFE2',
1702
+ 300: '#6CBCD6',
1703
+ light: '#4DADCE',
1704
+ main: '#2D9FC5',
1705
+ 600: '#2897BF',
1706
+ 700: '#228DB8',
1707
+ 800: '#1C83B0',
1708
+ dark: '#1172A3',
1709
+ A100: '#D4EFFF',
1710
+ A200: '#A1DCFF',
1711
+ A400: '#6ECAFF',
1712
+ A700: '#54C1FF',
1713
+ contrastText: '#ffffff'
1674
1714
  },
1675
1715
  success: {
1676
- 50: "#F2F9E7",
1677
- 100: "#DDEFC4",
1678
- 200: "#C7E49D",
1679
- 300: "#B1D975",
1680
- light: "#A0D158",
1681
- main: "#8FC93A",
1682
- 600: "#87C334",
1683
- 700: "#7CBC2C",
1684
- 800: "#72B525",
1685
- dark: "#60A918",
1686
- A100: "#EDFFDE",
1687
- A200: "#D2FFAB",
1688
- A400: "#B6FF78",
1689
- A700: "#A9FF5E",
1690
- contrastText: "#ffffff"
1716
+ 50: '#F2F9E7',
1717
+ 100: '#DDEFC4',
1718
+ 200: '#C7E49D',
1719
+ 300: '#B1D975',
1720
+ light: '#A0D158',
1721
+ main: '#8FC93A',
1722
+ 600: '#87C334',
1723
+ 700: '#7CBC2C',
1724
+ 800: '#72B525',
1725
+ dark: '#60A918',
1726
+ A100: '#EDFFDE',
1727
+ A200: '#D2FFAB',
1728
+ A400: '#B6FF78',
1729
+ A700: '#A9FF5E',
1730
+ contrastText: '#ffffff'
1691
1731
  },
1692
1732
  grey: {
1693
- 50: "#F7F7F8",
1694
- 100: "#EAEBEC",
1695
- 200: "#DCDEE0",
1696
- 300: "#CED1D4",
1697
- 400: "#C4C7CA",
1698
- 500: "#B9BDC1",
1699
- 600: "#B2B7BB",
1700
- 700: "#AAAEB3",
1701
- 800: "#A2A6AB",
1702
- 900: "#93989E",
1703
- A100: "#FFFFFF",
1704
- A200: "#FFFFFF",
1705
- A400: "#D4EAFF",
1706
- A700: "#BBDDFF"
1733
+ 50: '#F7F7F8',
1734
+ 100: '#EAEBEC',
1735
+ 200: '#DCDEE0',
1736
+ 300: '#CED1D4',
1737
+ 400: '#C4C7CA',
1738
+ 500: '#B9BDC1',
1739
+ 600: '#B2B7BB',
1740
+ 700: '#AAAEB3',
1741
+ 800: '#A2A6AB',
1742
+ 900: '#93989E',
1743
+ A100: '#FFFFFF',
1744
+ A200: '#FFFFFF',
1745
+ A400: '#D4EAFF',
1746
+ A700: '#BBDDFF'
1707
1747
  },
1708
1748
  text: {
1709
- primary: "#101840de",
1710
- secondary: "#10184099",
1711
- disabled: "#10184061"
1749
+ primary: '#101840de',
1750
+ secondary: '#10184099',
1751
+ disabled: '#10184061'
1712
1752
  },
1713
1753
  action: {
1714
- active: "rgba(16, 24, 64, 0.54)",
1715
- hover: "rgba(16, 24, 64, 0.04)",
1716
- selected: "rgba(16, 24, 64, 0.08)",
1717
- disabled: "rgba(16, 24, 64, 0.26)",
1718
- disabledBackground: "rgba(16, 24, 64, 0.12)",
1719
- focus: "rgba(16, 24, 64, 0.12)"
1754
+ active: '#0a12288a',
1755
+ hover: '#0a122866',
1756
+ selected: '#0a1228cc',
1757
+ disabled: '#10184042',
1758
+ disabledBackground: '#1018401f',
1759
+ focus: '#1018401f'
1720
1760
  },
1721
1761
  background: {
1722
1762
  default: '#f5f5f5',
1723
- paper: "#fff"
1763
+ paper: '#fff'
1724
1764
  },
1725
1765
  common: {
1726
1766
  black: '#000',
1727
1767
  white: '#fff'
1728
1768
  },
1729
- divider: "rgba(16,24,64,0.12)"
1730
- };
1731
- const paletteADPRO = {
1732
- primary: {
1733
- 50: "#F8FAFB",
1734
- 100: "#E6EFF0",
1735
- 200: "#D2E3E4",
1736
- 300: "#82C6CB",
1737
- 400: "#2B9DA7",
1738
- 500: "#058C97",
1739
- 600: "#04848F",
1740
- 700: "#047984",
1741
- 800: "#036F7A",
1742
- 900: "#015C69",
1743
- A100: "#98F0FF",
1744
- A200: "#65E9FF",
1745
- A400: "#32E1FF",
1746
- A700: "#32E1FF"
1747
- },
1748
- secondary: {
1749
- 50: "#E0F7FA",
1750
- 100: "#B3EBF2",
1751
- 200: "#80DEEA",
1752
- 300: "#4DD0E1",
1753
- light: "#26C6DA",
1754
- main: "#00BCD4",
1755
- 600: "#00B6CF",
1756
- 700: "#00ADC9",
1757
- 800: "#00A5C3",
1758
- dark: "#0097B9",
1759
- A100: "#E2F9FF",
1760
- A200: "#AFEEFF",
1761
- A400: "#7CE3FF",
1762
- A700: "#63DDFF",
1763
- contrastText: "#ffffff"
1764
- },
1765
- error: {
1766
- 50: "#F9E8E8",
1767
- 100: "#F1C7C7",
1768
- 200: "#E8A1A1",
1769
- 300: "#DF7B7B",
1770
- light: "#D85F5F",
1771
- main: "#D14343",
1772
- 600: "#CC3D3D",
1773
- 700: "#C63434",
1774
- 800: "#C02C2C",
1775
- dark: "#B51E1E",
1776
- A100: "#FFECEC",
1777
- A200: "#FFB9B9",
1778
- A400: "#FF8686",
1779
- A700: "#FF6D6D",
1780
- contrastText: "#ffffff"
1781
- },
1782
- warning: {
1783
- 50: "#FFF0E0",
1784
- 100: "#FEDAB3",
1785
- 200: "#FDC280",
1786
- 300: "#FCAA4D",
1787
- light: "#FC9726",
1788
- main: "#FB8500",
1789
- 600: "#FA7D00",
1790
- 700: "#FA7200",
1791
- 800: "#F96800",
1792
- dark: "#F85500",
1793
- A100: "#FFFFFF",
1794
- A200: "#FFF1EB",
1795
- A400: "#FFCCB8",
1796
- A700: "#FFBA9F",
1797
- contrastText: "#ffffff"
1798
- },
1799
- info: {
1800
- 50: "#E6F3F8",
1801
- 100: "#C0E2EE",
1802
- 200: "#96CFE2",
1803
- 300: "#6CBCD6",
1804
- light: "#4DADCE",
1805
- main: "#2D9FC5",
1806
- 600: "#2897BF",
1807
- 700: "#228DB8",
1808
- 800: "#1C83B0",
1809
- dark: "#1172A3",
1810
- A100: "#D4EFFF",
1811
- A200: "#A1DCFF",
1812
- A400: "#6ECAFF",
1813
- A700: "#54C1FF",
1814
- contrastText: "#ffffff"
1815
- },
1816
- success: {
1817
- 50: "#F2F9E7",
1818
- 100: "#DDEFC4",
1819
- 200: "#C7E49D",
1820
- 300: "#B1D975",
1821
- light: "#A0D158",
1822
- main: "#8FC93A",
1823
- 600: "#87C334",
1824
- 700: "#7CBC2C",
1825
- 800: "#72B525",
1826
- dark: "#60A918",
1827
- A100: "#EDFFDE",
1828
- A200: "#D2FFAB",
1829
- A400: "#B6FF78",
1830
- A700: "#A9FF5E",
1831
- contrastText: "#ffffff"
1832
- },
1833
- grey: {
1834
- 50: "#FAFBFF",
1835
- 100: "#F4F6FA",
1836
- 200: "#EDEFF5",
1837
- 300: "#E6E8F0",
1838
- 400: "#D8DAE5",
1839
- 500: "#C1C4D6",
1840
- 600: "#8F95B2",
1841
- 700: "#696F8C",
1842
- 800: "#474D66",
1843
- 900: "#101840",
1844
- A100: "#D8DAE5",
1845
- A200: "#C1C4D6",
1846
- A400: "#696F8C",
1847
- A700: "#101840"
1848
- },
1849
- text: {
1850
- primary: "#101840de",
1851
- secondary: "#10184099",
1852
- disabled: "#10184061"
1853
- },
1854
- action: {
1855
- active: "#0a12288a",
1856
- hover: "#0a122866",
1857
- selected: "#0a1228cc",
1858
- disabled: "#10184042",
1859
- disabledBackground: "#1018401f",
1860
- focus: "#1018401f"
1861
- },
1862
- background: {
1863
- default: '#f5f5f5',
1864
- paper: "#fff"
1865
- },
1866
- common: {
1867
- black: '#000',
1868
- white: '#fff'
1869
- },
1870
- divider: "#0000001f"
1769
+ divider: '#0000001f'
1871
1770
  };
1872
1771
 
1873
1772
  function _extends() {
@@ -2020,7 +1919,7 @@ const typography = {
2020
1919
  },
2021
1920
  body3: {
2022
1921
  fontFamily: 'Roboto',
2023
- fontWeight: 310,
1922
+ fontWeight: 300,
2024
1923
  fontSize: 12,
2025
1924
  letterSpacing: 0.17,
2026
1925
  lineHeight: 1.2,
@@ -2136,7 +2035,24 @@ const themeAdproOptions = {
2136
2035
  spacing: 8,
2137
2036
  mixins,
2138
2037
  breakpoints,
2139
- palette: paletteADPRO
2038
+ palette: Object.assign({
2039
+ primary: {
2040
+ 50: '#F8FAFB',
2041
+ 100: '#E6EFF0',
2042
+ 200: '#D2E3E4',
2043
+ 300: '#82C6CB',
2044
+ 400: '#2B9DA7',
2045
+ 500: '#058C97',
2046
+ 600: '#04848F',
2047
+ 700: '#047984',
2048
+ 800: '#036F7A',
2049
+ 900: '#015C69',
2050
+ A100: '#98F0FF',
2051
+ A200: '#65E9FF',
2052
+ A400: '#32E1FF',
2053
+ A700: '#32E1FF'
2054
+ }
2055
+ }, palette)
2140
2056
  };
2141
2057
 
2142
2058
  const SincoTheme = createTheme(Object.assign({}, themeOptions));
@@ -2739,80 +2655,73 @@ for (var COLLECTION_NAME in DOMIterables) {
2739
2655
 
2740
2656
  handlePrototype(DOMTokenListPrototype, 'DOMTokenList');
2741
2657
 
2742
- const DrawerContainer = {
2743
- display: 'flex',
2744
- flexDirection: 'column',
2745
- alignContent: 'flex-start',
2746
- justifyContent: 'space-between',
2747
- height: '100%',
2748
- overflow: 'hidden'
2749
- };
2750
- const DrawerHeader = {
2751
- display: 'flex',
2752
- alignContent: 'center',
2753
- justifyContent: 'space-between',
2754
- backgroundColor: 'secondary.main',
2755
- py: '12px',
2756
- px: '8px'
2757
- };
2758
- const DrawerContent = {
2759
- display: 'flex',
2760
- overflow: 'auto',
2761
- alignItems: 'flex-start',
2762
- flexDirection: 'column',
2763
- height: '-webkit-fill-available',
2764
- py: '12px',
2765
- px: '8px'
2766
- };
2767
- const DrawerActions = {
2768
- display: 'flex',
2769
- alignContent: 'center',
2770
- justifyContent: 'flex-end',
2771
- borderTop: '1px solid rgba(16, 24, 64, 0.23)',
2772
- backgroundColor: '#F1F0EE',
2773
- gap: '8px',
2774
- mt: '4px',
2775
- py: '12px',
2776
- px: '8px'
2658
+ const borderStyles = {
2659
+ left: {
2660
+ borderTopRightRadius: "4px"
2661
+ },
2662
+ right: {
2663
+ borderTopLeftRadius: "4px"
2664
+ }
2777
2665
  };
2778
2666
  const DrawerComponent = ({
2779
2667
  title,
2780
2668
  children,
2781
- renderActions,
2669
+ actions,
2782
2670
  showActions,
2783
- position,
2671
+ anchor: _anchor = "left",
2784
2672
  width,
2785
2673
  open,
2786
- onClose
2674
+ onClose,
2675
+ sx
2787
2676
  }) => {
2788
2677
  const [stateActions, setActionsState] = useState(showActions);
2789
2678
  const handleDrawerActions = () => {
2790
2679
  setActionsState(true);
2791
2680
  };
2792
- return /*#__PURE__*/React.createElement(ThemeProvider, {
2793
- theme: SincoTheme
2794
- }, /*#__PURE__*/React.createElement(Drawer, {
2795
- anchor: position,
2681
+ const paperSx = borderStyles[_anchor];
2682
+ return /*#__PURE__*/React.createElement(Drawer, {
2683
+ anchor: _anchor,
2796
2684
  open: open,
2797
- onClose: onClose
2798
- }, /*#__PURE__*/React.createElement(Box$1, {
2799
- sx: DrawerContainer,
2800
- width: width
2801
- }, /*#__PURE__*/React.createElement(Box$1, {
2802
- sx: DrawerHeader
2803
- }, /*#__PURE__*/React.createElement(Typography$1, {
2685
+ onClose: onClose,
2686
+ sx: {
2687
+ "& .MuiBackdrop-root": {
2688
+ backgroundColor: "#F0f0f099 !important",
2689
+ backdropFilter: "blur(4px)"
2690
+ },
2691
+ "& .MuiDrawer-paper": Object.assign({
2692
+ width: width
2693
+ }, paperSx)
2694
+ }
2695
+ }, /*#__PURE__*/React.createElement(Stack, {
2696
+ height: "100%"
2697
+ }, /*#__PURE__*/React.createElement(Stack, {
2698
+ justifyContent: "space-between",
2699
+ alignItems: "center",
2700
+ direction: "row",
2701
+ py: 1.5,
2702
+ px: 1,
2703
+ bgcolor: "secondary.main"
2704
+ }, /*#__PURE__*/React.createElement(Typography, {
2705
+ sx: Object.assign({}, sx),
2804
2706
  variant: "h6"
2805
- }, title), /*#__PURE__*/React.createElement(Box$1, null, /*#__PURE__*/React.createElement(IconButton, {
2707
+ }, title), /*#__PURE__*/React.createElement(IconButton, {
2806
2708
  onClick: onClose,
2807
2709
  size: "small"
2808
- }, /*#__PURE__*/React.createElement(CloseIcon, {
2710
+ }, /*#__PURE__*/React.createElement(Close, {
2809
2711
  fontSize: "small"
2810
- })))), /*#__PURE__*/React.createElement(Box$1, {
2811
- sx: DrawerContent,
2712
+ }))), /*#__PURE__*/React.createElement(Stack, {
2713
+ py: 1.5,
2714
+ px: 1,
2715
+ overflow: "auto",
2716
+ height: "-webkit-fill-available",
2812
2717
  onClick: handleDrawerActions
2813
- }, children), stateActions && /*#__PURE__*/React.createElement(Box$1, {
2814
- sx: DrawerActions
2815
- }, renderActions))));
2718
+ }, children), stateActions && /*#__PURE__*/React.createElement(Stack, {
2719
+ gap: 1,
2720
+ mt: 0.5,
2721
+ py: 1.5,
2722
+ px: 1,
2723
+ bgcolor: "#F1F0EE"
2724
+ }, actions)));
2816
2725
  };
2817
2726
 
2818
2727
  const FooterActionComponent = ({
@@ -2829,22 +2738,172 @@ const FooterActionComponent = ({
2829
2738
  }
2830
2739
  }, /*#__PURE__*/React.createElement(Toolbar, {
2831
2740
  sx: {
2832
- gap: 1.5
2741
+ gap: 1.5,
2742
+ minHeight: "50px !important"
2833
2743
  }
2834
2744
  }, renderLeftContent, /*#__PURE__*/React.createElement(Box$1, {
2835
2745
  flexGrow: 1
2836
2746
  }), /*#__PURE__*/React.createElement(Box$1, null, labelChangeCounter), renderRightContent));
2837
2747
  };
2838
2748
 
2839
- function PageHeaderWraps({
2749
+ const useProgress = timeProgress => {
2750
+ const [progress, setProgress] = useState(100);
2751
+ useEffect(() => {
2752
+ const interval = setInterval(() => {
2753
+ setProgress(prev => {
2754
+ if (prev <= 0) {
2755
+ clearInterval(interval);
2756
+ }
2757
+ return prev - 1;
2758
+ });
2759
+ }, timeProgress * 10);
2760
+ return () => {
2761
+ clearInterval(interval);
2762
+ };
2763
+ }, [timeProgress]);
2764
+ return {
2765
+ progressToast: progress
2766
+ };
2767
+ };
2768
+
2769
+ const ToastNotificationComponent = toast => {
2770
+ const [stateOptions, setStateOptions] = useState(true);
2771
+ const [stateToast, setStateToast] = useState(true);
2772
+ const timeProgress = toast.time || 10;
2773
+ const {
2774
+ progressToast
2775
+ } = useProgress(timeProgress);
2776
+ const toastColorConfig = toast.type || "info";
2777
+ const toastIconOption = {
2778
+ success: /*#__PURE__*/React.createElement(CheckCircleRounded, null),
2779
+ error: /*#__PURE__*/React.createElement(ErrorRounded, null),
2780
+ warning: /*#__PURE__*/React.createElement(WarningRounded, null),
2781
+ info: /*#__PURE__*/React.createElement(InfoRounded, null)
2782
+ };
2783
+ const ToastIconConfig = toastIconOption[toast.type || "info"];
2784
+ const closeToast = () => {
2785
+ setStateToast(false);
2786
+ };
2787
+ const toggleToastOptions = () => {
2788
+ setStateOptions(prevShowOptions => !prevShowOptions);
2789
+ };
2790
+ useEffect(() => {
2791
+ progressToast <= 0 && setStateToast(false);
2792
+ }, [progressToast]);
2793
+ return /*#__PURE__*/React.createElement(React.Fragment, null, stateToast && /*#__PURE__*/React.createElement(Stack, {
2794
+ position: "fixed",
2795
+ zIndex: 1400,
2796
+ right: 16,
2797
+ top: 16,
2798
+ width: 370,
2799
+ sx: {
2800
+ boxShadow: theme => theme.shadows[8]
2801
+ }
2802
+ }, /*#__PURE__*/React.createElement(Box$1, {
2803
+ padding: 1.5,
2804
+ gap: 1.5,
2805
+ display: "flex",
2806
+ alignItems: "center",
2807
+ sx: {
2808
+ // "&.color-error": {
2809
+ // backgroundColor: "#FEEBEE",
2810
+ // },
2811
+ "&.color-info": {
2812
+ backgroundColor: "#E1F5FE"
2813
+ },
2814
+ "&.color-warning": {
2815
+ backgroundColor: "#FFF3E0"
2816
+ },
2817
+ "&.color-success": {
2818
+ backgroundColor: "#E8F5E9"
2819
+ }
2820
+ },
2821
+ className: `color-${toastColorConfig}`
2822
+ }, /*#__PURE__*/React.createElement(Stack, {
2823
+ p: 1,
2824
+ gap: 1,
2825
+ height: 20,
2826
+ borderRadius: 50,
2827
+ sx: {
2828
+ "&.ripple-error": {
2829
+ backgroundColor: "#D143431F"
2830
+ },
2831
+ "&.ripple-info": {
2832
+ backgroundColor: "#2D9FC51F"
2833
+ },
2834
+ "&.ripple-warning": {
2835
+ backgroundColor: "#FB85001F"
2836
+ },
2837
+ "&.ripple-success": {
2838
+ backgroundColor: "#8FC93A1F"
2839
+ }
2840
+ },
2841
+ className: `ripple-${toast.type || "info"}`
2842
+ }, /*#__PURE__*/React.createElement(Stack, {
2843
+ sx: {
2844
+ "&.icon-color.color-info": {
2845
+ color: theme => theme.palette.info.main
2846
+ },
2847
+ "&.icon-color.color-error": {
2848
+ color: theme => theme.palette.error.main
2849
+ },
2850
+ "&.icon-color.color-warning": {
2851
+ color: theme => theme.palette.warning.main
2852
+ },
2853
+ "&.icon-color.color-success": {
2854
+ color: theme => theme.palette.success.main
2855
+ }
2856
+ },
2857
+ className: `icon-color color-${toast.type || "info"}`
2858
+ }, ToastIconConfig)), /*#__PURE__*/React.createElement(Divider, {
2859
+ orientation: "vertical",
2860
+ flexItem: true
2861
+ }), /*#__PURE__*/React.createElement(Stack, {
2862
+ width: 285
2863
+ }, /*#__PURE__*/React.createElement(Stack, {
2864
+ justifyContent: "space-between",
2865
+ flexDirection: "row",
2866
+ alignItems: "center"
2867
+ }, /*#__PURE__*/React.createElement(Typography, {
2868
+ variant: "subtitle2",
2869
+ color: "text.primary"
2870
+ }, toast.title), /*#__PURE__*/React.createElement(IconButton, {
2871
+ size: "small",
2872
+ onClick: closeToast
2873
+ }, /*#__PURE__*/React.createElement(Close, {
2874
+ fontSize: "small"
2875
+ }))), /*#__PURE__*/React.createElement(Stack, {
2876
+ gap: 0.5
2877
+ }, /*#__PURE__*/React.createElement(Typography, {
2878
+ color: "text.primary",
2879
+ variant: "body2"
2880
+ }, toast.subtitle), !stateOptions && toast.dataOpt && toast.dataOpt.length > 0 && /*#__PURE__*/React.createElement(Stack, null, toast.dataOpt.map((element, i) => /*#__PURE__*/React.createElement(Typography, {
2881
+ variant: "caption",
2882
+ key: i
2883
+ }, "\u2022 ", element)))), /*#__PURE__*/React.createElement(Stack, {
2884
+ justifyContent: "flex-end",
2885
+ flexDirection: "row"
2886
+ }, toast.actions && /*#__PURE__*/React.createElement(Stack, {
2887
+ flexDirection: "row",
2888
+ gap: 1
2889
+ }, toast.actions), toast.seeMore && /*#__PURE__*/React.createElement(Button, {
2890
+ onClick: toggleToastOptions,
2891
+ size: "small",
2892
+ variant: "text",
2893
+ color: toastColorConfig
2894
+ }, stateOptions ? "Ver más" : "Ver menos", stateOptions ? /*#__PURE__*/React.createElement(KeyboardArrowDown, null) : /*#__PURE__*/React.createElement(KeyboardArrowUp, null))))), /*#__PURE__*/React.createElement(LinearProgress, {
2895
+ color: toastColorConfig,
2896
+ variant: "determinate",
2897
+ value: progressToast
2898
+ })));
2899
+ };
2900
+
2901
+ function PageHeaderWrapper({
2840
2902
  item,
2841
- Color,
2903
+ color,
2842
2904
  variant
2843
2905
  }) {
2844
- return /*#__PURE__*/React.createElement(Typography, {
2845
- variant: variant,
2846
- color: Color
2847
- }, item);
2906
+ return /*#__PURE__*/React.createElement(React.Fragment, null, item);
2848
2907
  }
2849
2908
  const PageHeaderComponent = ({
2850
2909
  title,
@@ -2871,16 +2930,16 @@ const PageHeaderComponent = ({
2871
2930
  gap: 1.5,
2872
2931
  flexDirection: "row",
2873
2932
  alignItems: "center"
2874
- }, buttonBack, /*#__PURE__*/React.createElement(Stack, null, /*#__PURE__*/React.createElement(Stack, null, /*#__PURE__*/React.createElement(PageHeaderWraps, {
2875
- Color: "text.primary",
2933
+ }, buttonBack, /*#__PURE__*/React.createElement(Stack, null, /*#__PURE__*/React.createElement(Stack, null, /*#__PURE__*/React.createElement(PageHeaderWrapper, {
2934
+ color: "text.primary",
2876
2935
  item: title,
2877
2936
  variant: "h6"
2878
2937
  })), subtitle && /*#__PURE__*/React.createElement(Stack, {
2879
2938
  alignItems: "center",
2880
2939
  flexDirection: "row",
2881
2940
  gap: 2
2882
- }, /*#__PURE__*/React.createElement(PageHeaderWraps, {
2883
- Color: "text.secondary",
2941
+ }, /*#__PURE__*/React.createElement(PageHeaderWrapper, {
2942
+ color: "text.secondary",
2884
2943
  item: subtitle,
2885
2944
  variant: "caption"
2886
2945
  })))), actions && /*#__PURE__*/React.createElement(Stack, {
@@ -8394,4 +8453,4 @@ const useDynamicColor = url => {
8394
8453
  };
8395
8454
  };
8396
8455
 
8397
- export { AdproSincoTheme, DrawerComponent, DynamicColor, EmptyStateComponent as EmptyState, EmptyStateComponent, EmptyStateImageUrls, FooterActionComponent, PageHeaderComponent, PageHeaderWraps, SincoTheme, useDynamicColor };
8456
+ export { AdproSincoTheme, DrawerComponent, DynamicColor, EmptyStateComponent as EmptyState, EmptyStateComponent, EmptyStateImageUrls, FooterActionComponent, PageHeaderComponent, PageHeaderWrapper, SincoTheme, ToastNotificationComponent, useDynamicColor };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sinco/react",
3
- "version": "1.0.15-rc.22",
3
+ "version": "1.0.15-rc.29",
4
4
  "description": "package for the configuration of mui react sinco",
5
5
  "private": false,
6
6
  "license": "MIT",
@@ -1,13 +1,15 @@
1
- import { ReactNode } from 'react';
2
- export type handleDrawerPosition = 'left' | 'right';
1
+ import { ReactNode } from "react";
2
+ import { SxProps } from "@mui/material";
3
+ export type DrawerPosition = "left" | "right";
3
4
  export interface DrawerComponentProperties {
4
5
  title: string;
5
6
  children: ReactNode;
6
- renderActions: ReactNode;
7
+ actions: ReactNode;
7
8
  showActions?: boolean;
8
- position?: handleDrawerPosition;
9
+ anchor?: DrawerPosition;
9
10
  width: string;
10
11
  open: boolean;
11
12
  onClose: () => void;
13
+ sx?: SxProps;
12
14
  }
13
- export declare const DrawerComponent: ({ title, children, renderActions, showActions, position, width, open, onClose, }: DrawerComponentProperties) => JSX.Element;
15
+ export declare const DrawerComponent: ({ title, children, actions, showActions, anchor, width, open, onClose, sx, }: DrawerComponentProperties) => JSX.Element;
@@ -7,9 +7,9 @@ export interface PageheaderProperties {
7
7
  buttonBack?: React.ReactNode;
8
8
  fixed?: boolean;
9
9
  }
10
- export declare function PageHeaderWraps({ item, Color, variant, }: {
10
+ export declare function PageHeaderWrapper({ item, color, variant, }: {
11
11
  item: string | React.ReactNode;
12
- Color: string;
12
+ color: string;
13
13
  variant: Variant;
14
14
  }): JSX.Element;
15
15
  export declare const PageHeaderComponent: ({ title, subtitle, actions, buttonBack, fixed, }: PageheaderProperties) => JSX.Element;
@@ -0,0 +1,12 @@
1
+ import React from "react";
2
+ export type toastType = "success" | "error" | "warning" | "info";
3
+ export interface ToastBaseProperties {
4
+ type?: toastType;
5
+ subtitle?: string;
6
+ title: string;
7
+ time?: number | any;
8
+ dataOpt?: string[];
9
+ actions?: React.ReactNode;
10
+ seeMore?: boolean;
11
+ }
12
+ export declare const ToastNotificationComponent: (toast: ToastBaseProperties) => JSX.Element;
@@ -1,4 +1,5 @@
1
- export * from './EmptyState';
2
- export * from './Drawer';
3
- export * from './FooterAction';
4
- export * from './PageHeader';
1
+ export * from "./EmptyState";
2
+ export * from "./Drawer";
3
+ export * from "./FooterAction";
4
+ export * from "./ToastNotification";
5
+ export * from "./PageHeader";
@@ -0,0 +1,3 @@
1
+ export declare const useProgress: (timeProgress: number) => {
2
+ progressToast: number;
3
+ };
@@ -1,2 +1,12 @@
1
- import { Components } from '@mui/material';
1
+ import { Components } from "@mui/material";
2
+ declare module "@mui/material/Radio" {
3
+ interface RadioPropsSizeOverrides {
4
+ large: true;
5
+ }
6
+ }
7
+ declare module "@mui/material/Checkbox" {
8
+ interface CheckboxPropsSizeOverrides {
9
+ large: true;
10
+ }
11
+ }
2
12
  export declare const components: Components;
@@ -1,3 +1,2 @@
1
1
  import { PaletteOptions } from '@mui/material';
2
2
  export declare const palette: PaletteOptions;
3
- export declare const paletteADPRO: PaletteOptions;