pipesol-notificationbar 1.0.1 → 1.0.3-beta.0

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.
@@ -0,0 +1,16 @@
1
+ interface TermsAndPrivacyBarProps {
2
+ url_termo_uso: string;
3
+ url_politica_privacidade: string;
4
+ background_color: string;
5
+ color: string;
6
+ background_color_button_ok: string;
7
+ color_button_ok: string;
8
+ background_color_button_cancel?: string;
9
+ color_button_cancel: string;
10
+ background_color_link?: string;
11
+ color_link: string;
12
+ background_color_hover_link?: string;
13
+ color_hover_link: string;
14
+ }
15
+ declare const TermsAndPrivacyBar: React.FC<TermsAndPrivacyBarProps>;
16
+ export default TermsAndPrivacyBar;
@@ -0,0 +1,133 @@
1
+ 'use client';
2
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
+ import { useState } from 'react';
4
+ import { Box, styled } from '@mui/material';
5
+ import { parseCookies, setCookie } from 'nookies';
6
+ const Container = styled('div', {
7
+ shouldForwardProp: (prop) => ![
8
+ 'background_color',
9
+ 'show'
10
+ ].includes(prop)
11
+ })(({ show, background_color }) => ({
12
+ position: 'fixed',
13
+ bottom: 0,
14
+ width: '100%',
15
+ backgroundColor: background_color,
16
+ display: show ? 'block' : 'none',
17
+ zIndex: 4000,
18
+ }));
19
+ const BotaoNotificationBar = styled('button', {
20
+ shouldForwardProp: (prop) => ![
21
+ 'background_color',
22
+ 'color',
23
+ ].includes(prop),
24
+ })(({ theme, background_color, color }) => {
25
+ var _a, _b, _c, _d;
26
+ return ({
27
+ backgroundColor: background_color,
28
+ color: color,
29
+ padding: '8px 24px',
30
+ border: 'none',
31
+ cursor: 'pointer',
32
+ margin: '0 0 0 20px',
33
+ borderRadius: theme.shape.borderRadius,
34
+ fontFamily: theme.typography.fontFamily,
35
+ fontWeight: 600,
36
+ fontStyle: (_a = theme.typography.body1) === null || _a === void 0 ? void 0 : _a.fontStyle,
37
+ lineHeight: (_b = theme.typography.body1) === null || _b === void 0 ? void 0 : _b.lineHeight,
38
+ letterSpacing: (_c = theme.typography.body1) === null || _c === void 0 ? void 0 : _c.letterSpacing,
39
+ fontSize: (_d = theme.typography.body1) === null || _d === void 0 ? void 0 : _d.fontSize,
40
+ });
41
+ });
42
+ const LinkStyled = styled('a', {
43
+ shouldForwardProp: (prop) => ![
44
+ 'background_color',
45
+ 'background_color_hover',
46
+ 'color',
47
+ 'color_hover'
48
+ ].includes(prop),
49
+ })(({ background_color, background_color_hover, color, color_hover, }) => ({
50
+ width: 'auto',
51
+ cursor: 'pointer',
52
+ textDecoration: 'none',
53
+ textTransform: 'none',
54
+ textAlign: 'center',
55
+ boxShadow: 'none',
56
+ backgroundColor: background_color,
57
+ color: color,
58
+ padding: '0',
59
+ margin: '0',
60
+ '&:hover': {
61
+ backgroundColor: background_color_hover,
62
+ borderBottom: `1px solid ${color_hover}`,
63
+ color: color_hover,
64
+ },
65
+ }));
66
+ const Content = styled('div')({
67
+ display: 'flex',
68
+ flexDirection: 'row',
69
+ justifyContent: 'center',
70
+ alignItems: 'center',
71
+ padding: '24px',
72
+ width: '100%',
73
+ boxSizing: 'border-box',
74
+ flexWrap: 'wrap',
75
+ });
76
+ const AreaTexto = styled('div', {
77
+ shouldForwardProp: (prop) => ![
78
+ 'color',
79
+ ].includes(prop),
80
+ })(({ theme, color }) => {
81
+ var _a, _b, _c, _d, _e, _f;
82
+ return ({
83
+ color: color,
84
+ flexGrow: 1,
85
+ fontFamily: theme.typography.fontFamily,
86
+ fontWeight: (_a = theme.typography.body1) === null || _a === void 0 ? void 0 : _a.fontWeight,
87
+ fontStyle: (_b = theme.typography.body1) === null || _b === void 0 ? void 0 : _b.fontStyle,
88
+ lineHeight: (_c = theme.typography.body1) === null || _c === void 0 ? void 0 : _c.lineHeight,
89
+ letterSpacing: (_d = theme.typography.body1) === null || _d === void 0 ? void 0 : _d.letterSpacing,
90
+ fontSize: (_e = theme.typography.body1) === null || _e === void 0 ? void 0 : _e.fontSize,
91
+ margin: (_f = theme.typography.body1) === null || _f === void 0 ? void 0 : _f.margin,
92
+ // Breakpoints para diferentes larguras de tela
93
+ [theme.breakpoints.down('sm')]: {
94
+ width: '100%'
95
+ },
96
+ [theme.breakpoints.up('sm')]: {
97
+ width: '100%'
98
+ },
99
+ [theme.breakpoints.up('md')]: {
100
+ width: 'calc(100% - 290px)'
101
+ },
102
+ [theme.breakpoints.up('lg')]: {
103
+ width: 'calc(100% - 290px)'
104
+ },
105
+ [theme.breakpoints.up('xl')]: {
106
+ width: 'calc(100% - 290px)'
107
+ },
108
+ });
109
+ });
110
+ const TermsAndPrivacyBar = (props) => {
111
+ const { url_termo_uso, url_politica_privacidade, background_color, color, background_color_button_ok, color_button_ok, background_color_button_cancel = 'transparent', color_button_cancel, background_color_link = 'transparent', color_link, background_color_hover_link = 'transparent', color_hover_link, } = props;
112
+ const [showNotification, setShowNotification] = useState(() => {
113
+ const cookies = parseCookies();
114
+ return cookies.cookieConsent !== 'true' && cookies.cookieConsent !== 'false';
115
+ });
116
+ const handleAccept = () => {
117
+ setCookie(null, 'cookieConsent', 'true', {
118
+ maxAge: 60 * 60 * 24 * 365,
119
+ path: '/',
120
+ });
121
+ setShowNotification(false);
122
+ };
123
+ const handleReject = () => {
124
+ setCookie(null, 'cookieConsent', 'false', {
125
+ maxAge: 60 * 60 * 24 * 365,
126
+ path: '/',
127
+ });
128
+ setShowNotification(false);
129
+ };
130
+ return (_jsx(Container, { show: showNotification, background_color: background_color, children: _jsxs(Content, { children: [_jsxs(AreaTexto, { color: color, children: ["Este site usa cookies e dados pessoais de acordo com os nossos", ' ', _jsx(LinkStyled, { href: url_termo_uso, background_color: background_color_link, background_color_hover: background_color_hover_link, color: color_link, color_hover: color_hover_link, children: "Termos de Uso" }), " e", ' ', _jsx(LinkStyled, { href: url_politica_privacidade, background_color: background_color_link, background_color_hover: background_color_hover_link, color: color_link, color_hover: color_hover_link, children: "Pol\u00EDtica de Privacidade" }), ". Ao continuar navegando neste site, voc\u00EA declara estar ciente dessas condi\u00E7\u00F5es."] }), _jsxs(Box, { display: "flex", flexDirection: "row", alignItems: "center", justifyContent: "center", sx: { padding: '16px' }, children: [_jsx(BotaoNotificationBar, { background_color: background_color_button_cancel, color: color_button_cancel, onClick: handleReject, children: "Cancelar" }), _jsx(BotaoNotificationBar, { background_color: background_color_button_ok, color: color_button_ok, onClick: handleAccept, children: "Ok" })] })] }) }));
131
+ };
132
+ export default TermsAndPrivacyBar;
133
+ //# sourceMappingURL=TermsAndPrivacyBar.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TermsAndPrivacyBar.js","sourceRoot":"","sources":["../../src/components/TermsAndPrivacyBar.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACjC,OAAO,EAAE,GAAG,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAElD,MAAM,SAAS,GAAG,MAAM,CAAC,KAAK,EAC5B;IACE,iBAAiB,EAAE,CAAC,IAAI,EAAE,EAAE,CAC5B,CAAC;QACE,kBAAkB;QAClB,MAAM;KACR,CAAC,QAAQ,CAAC,IAAc,CAAC;CAC3B,CAAC,CAKD,CAAC,EAAE,IAAI,EAAE,gBAAgB,EAAE,EAAE,EAAE,CAAC,CAAC;IAClC,QAAQ,EAAE,OAAO;IACjB,MAAM,EAAE,CAAC;IACT,KAAK,EAAE,MAAM;IACb,eAAe,EAAE,gBAAgB;IACjC,OAAO,EAAE,IAAI,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM;IAChC,MAAM,EAAE,IAAI;CACb,CAAC,CAAC,CAAC;AAEJ,MAAM,oBAAoB,GAAG,MAAM,CAAC,QAAQ,EAC1C;IACE,iBAAiB,EAAE,CAAC,IAAI,EAAE,EAAE,CAC5B,CAAC;QACE,kBAAkB;QAClB,OAAO;KACT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kBAAkB,CAAC"}
package/dist/index.d.ts CHANGED
@@ -1 +1 @@
1
- export { default as NotificationBar } from './components/NotificationBar';
1
+ export { default as TermsAndPrivacyBar } from './components/TermsAndPrivacyBar';
package/dist/index.js CHANGED
@@ -1,2 +1,2 @@
1
- export { default as NotificationBar } from './components/NotificationBar';
1
+ export { default as TermsAndPrivacyBar } from './components/TermsAndPrivacyBar';
2
2
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,IAAI,eAAe,EAAC,MAAM,8BAA8B,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,IAAI,kBAAkB,EAAC,MAAM,iCAAiC,CAAC"}