@ssplib/react-components 0.0.20 → 0.0.22

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.
@@ -62,6 +62,8 @@ function DatePicker(_a) {
62
62
  var _a;
63
63
  return (react_1.default.createElement(material_1.TextField, Object.assign({ size: 'small' }, params, context === null || context === void 0 ? void 0 : context.formRegister(name, {
64
64
  validate: (v, f) => {
65
+ if (!v)
66
+ v = '';
65
67
  if (v.length <= 0 && required)
66
68
  return 'Este campo é obrigatório';
67
69
  if (v.length < 10 && required)
@@ -47,6 +47,8 @@ function TimePicker({ name, required = false, title, xs = 12, sm, md }) {
47
47
  var _a;
48
48
  return (react_1.default.createElement(material_1.TextField, Object.assign({ size: 'small' }, params, context === null || context === void 0 ? void 0 : context.formRegister(name, {
49
49
  validate: (v, f) => {
50
+ if (!v)
51
+ v = '';
50
52
  if (v.length <= 0 && required)
51
53
  return 'Este campo é obrigatório';
52
54
  if (v.length < 5 && required)
@@ -1,5 +1,5 @@
1
1
  /// <reference types="react" />
2
- export default function NavBar({ links, title, img, pos, next, el, }: {
2
+ export default function NavBar({ links, title, img, pos, next, el, menuItems, }: {
3
3
  links: {
4
4
  name: string;
5
5
  path: string;
@@ -7,6 +7,7 @@ export default function NavBar({ links, title, img, pos, next, el, }: {
7
7
  title: string;
8
8
  img: string;
9
9
  next?: boolean;
10
+ menuItems: JSX.Element | JSX.Element[];
10
11
  el?: JSX.Element;
11
12
  pos?: 'fixed' | 'inherit';
12
13
  }): JSX.Element;
@@ -37,7 +37,7 @@ const link_1 = __importDefault(require("next/link"));
37
37
  const router_1 = require("next/router");
38
38
  const react_1 = __importStar(require("react"));
39
39
  const auth_1 = require("../../context/auth");
40
- function NavBar({ links, title, img, pos = 'fixed', next = true, el, }) {
40
+ function NavBar({ links, title, img, pos = 'fixed', next = true, el, menuItems, }) {
41
41
  let router = undefined;
42
42
  if (next)
43
43
  router = (0, router_1.useRouter)();
@@ -104,40 +104,7 @@ function NavBar({ links, title, img, pos = 'fixed', next = true, el, }) {
104
104
  react_1.default.createElement(material_1.Box, { sx: { display: 'flex', alignItems: 'center' } },
105
105
  react_1.default.createElement(material_1.Avatar, { sx: { width: 30, height: 30 }, src: user.image }),
106
106
  react_1.default.createElement(material_1.Menu, { open: avatarMenu, onClose: (e) => setAvatarAnchor(null), anchorEl: avatarAnchor, disableScrollLock: true, transformOrigin: { horizontal: 'right', vertical: 'top' }, anchorOrigin: { horizontal: 'right', vertical: 'bottom' }, sx: { '.MuiMenu-paper': { borderRadius: 4 } } },
107
- react_1.default.createElement(material_1.Box, { sx: { paddingTop: 2 } },
108
- react_1.default.createElement(material_1.Typography, { textTransform: 'capitalize', fontFamily: 'Inter', fontSize: 14, paddingLeft: 2 }, "Minha conta"),
109
- react_1.default.createElement(material_1.Box, { sx: { borderBottom: 1, borderColor: '#c9d1d1', marginX: 2 } })),
110
- react_1.default.createElement(material_1.Box, { sx: { '& a': { textDecoration: 'none' } } },
111
- react_1.default.createElement(link_1.default, { href: 'https://contas.staging.acesso.gov.br/alteracao_cadastro' },
112
- react_1.default.createElement(material_1.MenuItem, { sx: { paddingY: 2 } },
113
- react_1.default.createElement(material_1.Typography, { textTransform: 'capitalize', color: '#3B82F6' }, "Dados pessoais")))),
114
- react_1.default.createElement(material_1.Box, { sx: { '& a': { textDecoration: 'none' } } },
115
- react_1.default.createElement(link_1.default, { href: 'https://contas.staging.acesso.gov.br/seguranca' },
116
- react_1.default.createElement(material_1.MenuItem, { sx: { paddingY: 2 } },
117
- react_1.default.createElement(material_1.Typography, { textTransform: 'capitalize', color: '#3B82F6' }, "Seguran\u00E7a da Conta")))),
118
- react_1.default.createElement(material_1.Box, { sx: { '& a': { textDecoration: 'none' } } },
119
- react_1.default.createElement(link_1.default, { href: 'https://contas.staging.acesso.gov.br/privacidade' },
120
- react_1.default.createElement(material_1.MenuItem, { sx: { paddingY: 2 } },
121
- react_1.default.createElement(material_1.Typography, { textTransform: 'capitalize', color: '#3B82F6' }, "Privacidade")))),
122
- react_1.default.createElement(material_1.Box, null,
123
- react_1.default.createElement(material_1.Typography, { textTransform: 'capitalize', fontFamily: 'Inter', fontSize: 14, paddingLeft: 2 }, "Servi\u00E7os"),
124
- react_1.default.createElement(material_1.Box, { sx: { borderBottom: 1, borderColor: '#c9d1d1', marginX: 2 } })),
125
- react_1.default.createElement(material_1.Box, { sx: { '& a': { textDecoration: 'none' } } },
126
- react_1.default.createElement(link_1.default, { href: 'https://servicos.staging.acesso.gov.br/carteira' },
127
- react_1.default.createElement(material_1.MenuItem, { sx: { paddingY: 2 } },
128
- react_1.default.createElement(material_1.Typography, { textTransform: 'capitalize', color: '#3B82F6' }, "Carteira de Documentos")))),
129
- react_1.default.createElement(material_1.Box, { sx: { '& a': { textDecoration: 'none' } } },
130
- react_1.default.createElement(link_1.default, { href: 'https://servicos.staging.acesso.gov.br/certidoes' },
131
- react_1.default.createElement(material_1.MenuItem, { sx: { paddingY: 2 } },
132
- react_1.default.createElement(material_1.Typography, { textTransform: 'capitalize', color: '#3B82F6' }, "Baixar certid\u00F5es")))),
133
- react_1.default.createElement(material_1.Box, { sx: { '& a': { textDecoration: 'none' } } },
134
- react_1.default.createElement(link_1.default, { href: 'https://servicos.staging.acesso.gov.br/notificacoes' },
135
- react_1.default.createElement(material_1.MenuItem, { sx: { paddingY: 2 } },
136
- react_1.default.createElement(material_1.Typography, { textTransform: 'capitalize', color: '#3B82F6' }, "Notifica\u00E7\u00F5es")))),
137
- react_1.default.createElement(material_1.Box, { sx: { '& a': { textDecoration: 'none' } } },
138
- react_1.default.createElement(link_1.default, { href: 'https://www.gov.br/governodigital/pt-br/conta-gov-br/perguntas-frequentes' },
139
- react_1.default.createElement(material_1.MenuItem, { sx: { paddingY: 2 } },
140
- react_1.default.createElement(material_1.Typography, { textTransform: 'capitalize', color: '#3B82F6' }, "Perguntas frequentes")))),
107
+ menuItems,
141
108
  react_1.default.createElement(material_1.MenuItem, { onClick: (e) => {
142
109
  setAvatarAnchor(null);
143
110
  logout();
package/package.json CHANGED
@@ -1,38 +1,25 @@
1
1
  {
2
2
  "name": "@ssplib/react-components",
3
- "version": "0.0.20",
3
+ "version": "0.0.22",
4
4
  "description": "SSP React Components",
5
5
  "main": "index.js",
6
6
  "author": "Pedro Henrique <sr.hudrick@gmail.com>",
7
7
  "license": "MIT",
8
- "dependencies": {
9
- "@emotion/react": "^11.10.6",
10
- "@emotion/styled": "^11.10.6",
8
+ "peerDependencies": {
11
9
  "@mui/icons-material": "^5.11.16",
12
10
  "@mui/lab": "^5.0.0-alpha.127",
13
11
  "@mui/material": "^5.12.1",
14
12
  "@mui/x-date-pickers": "^6.2.0",
15
- "cookies-next": "^2.1.1",
16
- "dayjs": "^1.11.7",
17
- "jwt-decode": "^3.1.2",
13
+ "@emotion/react": "^11.10.6",
14
+ "@emotion/styled": "^11.10.6",
15
+ "@types/lodash.get": "^4.4.7",
18
16
  "lodash.get": "^4.4.2",
19
- "next": "^13.3.0",
20
- "react": "^18.2.0",
21
- "react-hook-form": "^7.43.9",
22
- "react-imask": "^6.6.0",
17
+ "jwt-decode": "^3.1.2",
23
18
  "react-query": "^3.39.3",
24
- "typescript": "^5.0.4"
25
- },
26
- "devDependencies": {
27
- "@babel/preset-env": "^7.21.4",
28
- "@babel/preset-react": "^7.18.6",
29
- "@babel/preset-typescript": "^7.21.4",
30
- "@tsconfig/recommended": "^1.0.2",
31
- "@types/lodash.get": "^4.4.7",
32
- "@types/react": "^18.0.37",
33
- "prop-types": "15.8.1",
34
- "react-dom": "18.2.0",
35
- "@types/node": "18.16.1"
19
+ "react-hook-form": "^7.43.9",
20
+ "dayjs": "^1.11.7",
21
+ "cookies-next": "^2.1.1",
22
+ "react-imask": "^6.6.0"
36
23
  },
37
24
  "repository": {
38
25
  "type": "git",