@omniumretail/component-library 1.2.43 → 1.2.45
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/bundle.js +1 -1
- package/dist/main.css +2 -1
- package/dist/types/components/Footer2/Footer.stories.d.ts +5 -0
- package/dist/types/components/Footer2/index.d.ts +38 -0
- package/dist/types/components/index.d.ts +1 -0
- package/package.json +1 -1
- package/src/components/BellNotifications/BellNotifications.stories.tsx +14 -0
- package/src/components/BellNotifications/index.tsx +2 -3
- package/src/components/BellNotifications/styles.module.scss +11 -6
- package/src/components/Footer2/Footer.stories.tsx +198 -0
- package/src/components/Footer2/index.tsx +209 -0
- package/src/components/Footer2/styles.module.scss +122 -0
- package/src/components/Tag/index.tsx +3 -3
- package/src/components/index.tsx +1 -0
- package/src/locales/en.json +8 -1
- package/src/locales/es.json +8 -1
- package/src/locales/pt.json +9 -2
package/dist/main.css
CHANGED
|
@@ -31,5 +31,6 @@
|
|
|
31
31
|
.aZEBTQus3Y3MyodeDwkf{display:flex;flex-direction:column;align-items:center;justify-content:center}.cc1pbQlAgw2CmXVml3bs{height:300px;width:400px}.aTf_CXAsyp0tySsoZdD_{display:flex;justify-content:space-between;margin:10px 10px 0px 10px;font-size:20px}.kuu1hf_JTvYD55IW6Nxl{color:#ff4d4f}.N8ODEO3zDbY7gmecjTrp{color:#52c41a}.WIsL9Shu6c0mGJq9qSSz{margin-top:20px;border-radius:4px;overflow:hidden}.WIsL9Shu6c0mGJq9qSSz img{width:100%;height:auto}
|
|
32
32
|
.OJKeuXyOSPIeCCssVum2{display:flex;gap:32px}.jzxszvL7wzCV5nztJL0S{padding:12px}.OGA8oJw8RDyohcRftjmo{width:100%}.y2_7QVPOhjRZlAHCRWKf{display:grid;grid-template-columns:minmax(200px, 1fr) auto auto auto auto;gap:46px}.Smkcs3LGp1uPuQge2GxE{margin-top:16px}Label{margin-bottom:8px}.djarlYFkE9Kb7wUjUnrY{height:36px}
|
|
33
33
|
:root{--color-grey: #e4e4e4;--color-grey-100: #E5E5E5}.SF5f_Q_Ggz_4JHUHS2Xa{display:flex;align-items:center;padding:13px 20px;box-sizing:border-box;height:72px}.SF5f_Q_Ggz_4JHUHS2Xa *{box-sizing:border-box}.gSVYvBn1sLbcMsGI32b9{display:flex;flex-grow:1;align-items:flex-end;justify-content:center;max-width:calc(100% - 60px)}.gSVYvBn1sLbcMsGI32b9 img{max-width:196px}.gSVYvBn1sLbcMsGI32b9 .fVSt3bSZBcJGsOdA5nIN{font-weight:var(--font-weight-semibold);text-transform:uppercase;color:var(--color-black)}.BIBQmS_NwoMw2Ncq5yuN{cursor:pointer;padding:4px 4px 4px 0;font-size:20px;width:30px;display:flex;align-items:center;justify-content:center}.ZinSgUtysxITkbGRKdux{position:fixed;top:0;left:-100%;bottom:0;width:100%;max-width:430px;background-color:var(--color-white);padding-inline:15px;z-index:999;box-shadow:0 3px 12px rgba(0,0,0,.45);transition:.6s ease-out}.ZinSgUtysxITkbGRKdux.FW1pOdad0uN5LO9h5PgQ{left:0;transition:.3s ease-in}.ZfA8OEmbRzRsNqLAmdtn{background-color:rgba(0,0,0,.3);backdrop-filter:blur(1px);position:absolute;left:0;top:0;right:0;bottom:0;z-index:998;pointer-events:none;opacity:0;transition:.3s}.ZfA8OEmbRzRsNqLAmdtn.FW1pOdad0uN5LO9h5PgQ{opacity:1;pointer-events:all}.YKSQJmdRP_7tKwvQpeuV{width:calc(100% + 30px);margin-left:-15px;background-color:var(--color-orange);display:flex;align-items:center;justify-content:center}.ISssYC5Uz452JVWP0xDc img{max-width:160px}.E6YZPpa60LxA7qqIW7jQ{position:absolute;top:23px;right:15px;font-size:25px;cursor:pointer;color:var(--color-white)}.YYp3pzktjEDEyW8knAZQ{overflow-y:auto;height:calc(100% - 51px);margin:0;padding:0}.u7k2VQ30AQDk6mKA22GX{height:60px;padding:10px;display:flex;align-items:center;border-bottom:1px solid var(--color-black);cursor:pointer;transition:.3s;text-transform:uppercase;width:100%}.u7k2VQ30AQDk6mKA22GX:hover{background-color:var(--color-grey);color:var(--color-black)}.QQoDB9XPcAK18l2DIym4{list-style:none}.QQoDB9XPcAK18l2DIym4.wrXCksst57UpQuCNgGkN{height:auto;display:flex;flex-direction:column;align-items:flex-start;justify-content:flex-start;padding-bottom:0}.QQoDB9XPcAK18l2DIym4.wrXCksst57UpQuCNgGkN>.u7k2VQ30AQDk6mKA22GX{position:relative}.QQoDB9XPcAK18l2DIym4.wrXCksst57UpQuCNgGkN>.u7k2VQ30AQDk6mKA22GX .NytmT59TmaWHc4FLM2wa{position:absolute;width:60px;height:100%;background:var(--color-black);right:0;display:flex;align-items:center;justify-content:center}.QQoDB9XPcAK18l2DIym4.wrXCksst57UpQuCNgGkN>.u7k2VQ30AQDk6mKA22GX .NytmT59TmaWHc4FLM2wa:hover{background-color:var(--color-orange)}.QQoDB9XPcAK18l2DIym4.wrXCksst57UpQuCNgGkN>.u7k2VQ30AQDk6mKA22GX .zo7CFksIKx7Fahu4e4S_{color:var(--color-white)}.QQoDB9XPcAK18l2DIym4.wrXCksst57UpQuCNgGkN.yk4DnBgiUlzk23Yg_q6E{background:var(--color-grey)}.QQoDB9XPcAK18l2DIym4.wrXCksst57UpQuCNgGkN.yk4DnBgiUlzk23Yg_q6E .NytmT59TmaWHc4FLM2wa{background-color:var(--color-orange)}.QQoDB9XPcAK18l2DIym4.wrXCksst57UpQuCNgGkN.yk4DnBgiUlzk23Yg_q6E .uLgjMU9sbvfaa0qKEguP{height:auto;opacity:1}.uLgjMU9sbvfaa0qKEguP{padding:0;width:100%;margin:0;background-color:var(--color-orange);color:var(--color-white);height:0;opacity:0;overflow:hidden;transition:height .3s ease,opacity .3s ease}.uLgjMU9sbvfaa0qKEguP .u7k2VQ30AQDk6mKA22GX{min-height:60px;height:auto;padding-inline:40px}.efnjUnudkE0UTVQ6wrgH{cursor:pointer}.u7k2VQ30AQDk6mKA22GX .fjNRYZMP1O0pTvBDBB3L span{margin-left:8px;transform:translateY(-2px);display:inline-block;font-size:var(--font-size-body-3);text-transform:capitalize}
|
|
34
|
-
@media(max-width: 768px){.muC1BdCbIEMIs70EtJoA{position:unset}}.msELhnfhfo6un3c4Spoc{max-width:300px;max-height:400px;padding:0 !important}@media(max-width: 768px){.msELhnfhfo6un3c4Spoc{max-width:100vw}}@media(min-width: 1024px){.msELhnfhfo6un3c4Spoc{max-width:600px;max-height:700px}}@media(max-width: 768px){.oGsIq0O_Hzwg2mLR72la{position:absolute}}.KSVguXBQ_A1SUSR6e8Wq{overflow-y:auto;max-height:calc(100vh - 60px - 72px - 43px)}.GeNg2HVTmhQDmsLLTpWj{display:flex;flex-direction:column;align-items:unset !important;padding:10px;border-bottom:1px solid #f0f0f0;background-color:#fff !important;cursor:pointer}.GeNg2HVTmhQDmsLLTpWj:hover{background-color:#f9f9f9}@media(max-width: 768px){.GeNg2HVTmhQDmsLLTpWj{padding:8px}}.GBb48KXbGnQtAY8xqmUp{display:flex;justify-content:space-between;align-items:center;padding:10px;background-color:#f5f5f5;border-bottom:1px solid #e8e8e8}.LoCH7sYpmK3VgRASqTgz{font-size:20px;cursor:pointer;color:#595959}.Xjs10kZPSsD_BVFomnIe{color:#ff674c;margin-right:8px}.oibCayv_cOyhyWCKzHSr{display:flex;align-items:center;gap:10px}.oibCayv_cOyhyWCKzHSr span{font-size:14px;font-weight:500;color:#595959}.hhwYXSd0CR75D8ETnUML{display:flex;align-items:center;position:relative;padding-left:12px}@media(max-width: 768px){.hhwYXSd0CR75D8ETnUML{padding-left:8px}}.LkP1cqeAyAYI9rCurnE8{position:absolute;left:0;top:50%;transform:translateY(-50%);font-size:16px}@media(max-width: 768px){.LkP1cqeAyAYI9rCurnE8{font-size:12px}}.u_jT9kmq2kyThRlj8HT1{width:50px;height:50px;margin-left:10px;margin-right:10px}@media(max-width: 768px){.u_jT9kmq2kyThRlj8HT1{width:40px;height:40px;margin-left:8px;margin-right:8px}}.ieGdf5FTgLUPcfuZi7Xz{flex:1;overflow:hidden}.QgZ3oHW9IRTexL8xWVqP{font-weight:bold;font-size:14px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;display:block;max-width:100%}@media(max-width: 768px){.QgZ3oHW9IRTexL8xWVqP{font-size:12px}}.JwfbSOSIRAz5OO2hiSFc{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;display:block;max-width:100%;font-size:12px;color:#666;margin-top:2px}@media(max-width: 768px){.JwfbSOSIRAz5OO2hiSFc{font-size:10px}}.XfXQBYqMfZc4p8s2Mhla{width:6px;height:6px;background-color:#1890ff;border-radius:50%;margin-left:10px}@media(max-width: 768px){.XfXQBYqMfZc4p8s2Mhla{width:4px;height:4px;margin-left:8px}}.RGXTlVxCxbZpD6__J5_g{font-size:12px
|
|
34
|
+
@media(max-width: 768px){.muC1BdCbIEMIs70EtJoA{position:unset}}.msELhnfhfo6un3c4Spoc{max-width:300px;max-height:400px;padding:0 !important}@media(max-width: 768px){.msELhnfhfo6un3c4Spoc{max-width:100vw}}@media(min-width: 1024px){.msELhnfhfo6un3c4Spoc{max-width:600px;max-height:700px}}@media(max-width: 768px){.oGsIq0O_Hzwg2mLR72la{position:absolute}}.KSVguXBQ_A1SUSR6e8Wq{overflow-y:auto;max-height:calc(100vh - 60px - 72px - 43px)}.GeNg2HVTmhQDmsLLTpWj{display:flex;flex-direction:column;align-items:unset !important;padding:10px;border-bottom:1px solid #f0f0f0;background-color:#fff !important;cursor:pointer}.GeNg2HVTmhQDmsLLTpWj:hover{background-color:#f9f9f9}@media(max-width: 768px){.GeNg2HVTmhQDmsLLTpWj{padding:8px}}.GBb48KXbGnQtAY8xqmUp{display:flex;justify-content:space-between;align-items:center;padding:10px;background-color:#f5f5f5;border-bottom:1px solid #e8e8e8}.LoCH7sYpmK3VgRASqTgz{font-size:20px;cursor:pointer;color:#595959}.Xjs10kZPSsD_BVFomnIe{color:#ff674c;margin-right:8px}.oibCayv_cOyhyWCKzHSr{display:flex;align-items:center;gap:10px}.oibCayv_cOyhyWCKzHSr span{font-size:14px;font-weight:500;color:#595959}.hhwYXSd0CR75D8ETnUML{display:flex;align-items:center;position:relative;padding-left:12px}@media(max-width: 768px){.hhwYXSd0CR75D8ETnUML{padding-left:8px}}.LkP1cqeAyAYI9rCurnE8{position:absolute;left:0;top:50%;transform:translateY(-50%);font-size:16px}@media(max-width: 768px){.LkP1cqeAyAYI9rCurnE8{font-size:12px}}.u_jT9kmq2kyThRlj8HT1{width:50px;height:50px;margin-left:10px;margin-right:10px}@media(max-width: 768px){.u_jT9kmq2kyThRlj8HT1{width:40px;height:40px;margin-left:8px;margin-right:8px}}.ieGdf5FTgLUPcfuZi7Xz{flex:1;overflow:hidden}.QgZ3oHW9IRTexL8xWVqP{font-weight:bold;font-size:14px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;display:block;max-width:100%}@media(max-width: 768px){.QgZ3oHW9IRTexL8xWVqP{font-size:12px}}.JwfbSOSIRAz5OO2hiSFc{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;display:block;max-width:100%;font-size:12px;color:#666;margin-top:2px}@media(max-width: 768px){.JwfbSOSIRAz5OO2hiSFc{font-size:10px}}.XfXQBYqMfZc4p8s2Mhla{width:6px;height:6px;background-color:#1890ff;border-radius:50%;margin-left:10px}@media(max-width: 768px){.XfXQBYqMfZc4p8s2Mhla{width:4px;height:4px;margin-left:8px}}.RGXTlVxCxbZpD6__J5_g .ant-badge-count{font-size:12px !important;min-width:16px !important;height:16px !important;line-height:16px !important;transform:translate(40%, -50%) !important}.rWa5cnbZQLDtxFxJU6qA{font-size:26px;cursor:pointer;color:#0033a0}.Pus_rAoqX05D4Qz2pYxo{animation:Pus_rAoqX05D4Qz2pYxo 1s ease-in-out infinite}@keyframes Pus_rAoqX05D4Qz2pYxo{0%{transform:rotate(0deg)}25%{transform:rotate(10deg)}50%{transform:rotate(-10deg)}75%{transform:rotate(10deg)}100%{transform:rotate(0deg)}}
|
|
35
35
|
.rUOcBpTPxrzfRw36v939{display:flex;align-items:center;width:100%;margin:16px 0;box-sizing:border-box}.rUOcBpTPxrzfRw36v939 .ant-descriptions{width:calc(100vw - 24px)}.rUOcBpTPxrzfRw36v939 .ant-descriptions-item-label{max-width:140px !important;padding:8px 16px !important;color:var(--color-blue) !important;font-weight:700 !important;font-size:12px !important}.rUOcBpTPxrzfRw36v939 .ant-descriptions-item-content{padding:8px 16px !important;font-size:12px !important}.cyz9pmVdkD7z1n7QUlfu{width:100vw !important;max-width:100vw !important;padding:0px 12px}.PQ794lq3KZF_sigL5bbI{overflow:hidden !important}.PQ794lq3KZF_sigL5bbI .ant-modal .ant-modal-body{overflow-y:auto;overflow-x:hidden;max-height:80vh}.PQ794lq3KZF_sigL5bbI .ant-modal .ant-modal-content{padding:20px 12px !important}.PQ794lq3KZF_sigL5bbI .ant-modal-header{text-align:center !important}.PQ794lq3KZF_sigL5bbI .ant-modal-close{color:var(--button-default-background-hover-color)}.b23UIWngPXOEh5FC2mcC{display:flex;justify-content:center}.b23UIWngPXOEh5FC2mcC.DEfmwZ5CmWvodIcPVgfo{justify-content:space-between}.lIEwxxVD_vq2cGux3ehI{color:var(--button-default-background);font-size:26px}.ckRiBia09XQRtMVbNqvy{color:#c7cac9;pointer-events:none}
|
|
36
|
+
.lXrWb7XQPRt4cDHlwta4{display:flex;justify-content:space-between;align-items:center;position:fixed;bottom:10px;width:100%;height:60px;padding:0 10px;box-sizing:border-box;z-index:10}.lXrWb7XQPRt4cDHlwta4 .EqVJkSj9Vem7EVpPIYW_{display:flex;flex-direction:column;align-items:center;justify-content:center;flex:1}.lXrWb7XQPRt4cDHlwta4 .EqVJkSj9Vem7EVpPIYW_ .YA6MXmjAZZwtbSZYmcEw{font-size:26px;color:#0033a0;cursor:pointer}.lXrWb7XQPRt4cDHlwta4 .EqVJkSj9Vem7EVpPIYW_ .C4jdW5oFYxdgldUsYeMg{font-size:12px;margin-top:4px;color:#0033a0}.lXrWb7XQPRt4cDHlwta4 .FiQHpDUl90uFjStr9OAg{display:flex;justify-content:center;flex:1}.lXrWb7XQPRt4cDHlwta4 .FiQHpDUl90uFjStr9OAg .iFeWqTLSjbpgaVFy6shj{display:flex;justify-content:center;align-items:center;width:50px;height:50px;background-color:#0033a0;border-radius:8px;cursor:pointer}.lXrWb7XQPRt4cDHlwta4 .FiQHpDUl90uFjStr9OAg .iFeWqTLSjbpgaVFy6shj .wbWHzMmDsgEQ056VQENK{font-size:20px;color:#fff}.lXrWb7XQPRt4cDHlwta4 .pPyAGD44QA4U6r5_xMLN{position:relative}.MGvcBnUleTUDOtqafxZd{transform:rotate(45deg);transition:transform .3s ease}.m5JXPA_4FcCHUN17ucxY{position:absolute;bottom:70px;width:180px;left:50%;transform:translateX(-50%);display:flex;flex-direction:column;align-items:center;gap:12px;z-index:999}.Rtyw1XuncdBWZdUEV1qj{display:flex;align-items:center;background-color:#fff;padding:8px 16px;border-radius:20px;box-shadow:0 4px 12px rgba(0,51,160,.5);cursor:pointer;transition:all .2s ease;animation:g8HDTZ2GSb3rGEQ5ICmJ .3s cubic-bezier(0.34, 1.56, 0.64, 1)}.Rtyw1XuncdBWZdUEV1qj:hover{transform:translateY(-2px);box-shadow:0 6px 16px rgba(0,0,0,.12)}@keyframes g8HDTZ2GSb3rGEQ5ICmJ{from{opacity:0;transform:scale(0.8) translateY(10px)}to{opacity:1;transform:scale(1) translateY(0)}}.ZVQGcR7lZkCRgAxqbZt1{width:28px;height:28px;border-radius:50%;background-color:#f3f4f6;display:flex;align-items:center;justify-content:center;margin-right:10px;color:#4b5563}.c87nj1oXjBwCQjx_Jq7T{font-size:14px;font-weight:500;color:#374151}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
interface Action {
|
|
3
|
+
key: string;
|
|
4
|
+
label: string;
|
|
5
|
+
icon: React.ReactNode;
|
|
6
|
+
onClick?: () => void;
|
|
7
|
+
}
|
|
8
|
+
interface Criticality {
|
|
9
|
+
Id: string;
|
|
10
|
+
Name: string;
|
|
11
|
+
ColorHex: string;
|
|
12
|
+
}
|
|
13
|
+
interface BellNotification {
|
|
14
|
+
Id: string;
|
|
15
|
+
Title: string;
|
|
16
|
+
Description: string;
|
|
17
|
+
RedirectURL: string;
|
|
18
|
+
Icon: string;
|
|
19
|
+
ExpirationDate: number;
|
|
20
|
+
Criticality: Criticality;
|
|
21
|
+
IsRead: boolean;
|
|
22
|
+
}
|
|
23
|
+
export interface Footer2Props {
|
|
24
|
+
onBackClick?: () => void;
|
|
25
|
+
notifications: BellNotification[];
|
|
26
|
+
onFilterChange: (filter: 'all' | 'unread') => void;
|
|
27
|
+
onNotificationClick: (id: string, url: string) => void;
|
|
28
|
+
handleMarkAllAsRead: () => void;
|
|
29
|
+
actions?: Action[];
|
|
30
|
+
onDelete?: () => void;
|
|
31
|
+
onUpdate?: () => void;
|
|
32
|
+
onCreate?: () => void;
|
|
33
|
+
onEdit?: () => void;
|
|
34
|
+
onExport?: () => void;
|
|
35
|
+
onPrint?: () => void;
|
|
36
|
+
}
|
|
37
|
+
export declare const Footer2: (props: Footer2Props) => import("react/jsx-runtime").JSX.Element;
|
|
38
|
+
export {};
|
package/package.json
CHANGED
|
@@ -163,6 +163,20 @@ const notifications = [
|
|
|
163
163
|
},
|
|
164
164
|
"IsRead": false
|
|
165
165
|
},
|
|
166
|
+
{
|
|
167
|
+
"Id": "D6FB96EE-3255-42B7-8EC1-27E7AC3F5249",
|
|
168
|
+
"Title": "Creation of a new action of inspection",
|
|
169
|
+
"Description": "A new inspection action was created.",
|
|
170
|
+
"RedirectURL": "https://www.google.pt",
|
|
171
|
+
"Icon": "https://omnium-user-images.s3.eu-west-1.amazonaws.com/omniumretail-bigwingame-logotipo-vermelho.svg",
|
|
172
|
+
"ExpirationDate": 1736985600,
|
|
173
|
+
"Criticality": {
|
|
174
|
+
"Id": "F133ED4C-6C72-4CDC-86A1-27A76E6BDE7F",
|
|
175
|
+
"Name": "High",
|
|
176
|
+
"ColorHex": "#E05151"
|
|
177
|
+
},
|
|
178
|
+
"IsRead": false
|
|
179
|
+
},
|
|
166
180
|
{
|
|
167
181
|
"Id": "D6FB96EE-3255-42B7-8EC1-27E7AC3F5249",
|
|
168
182
|
"Title": "Creation of a new action of inspection",
|
|
@@ -51,11 +51,10 @@ export const BellNotifications = ({ notifications, onFilterChange, onNotificatio
|
|
|
51
51
|
const interval = setInterval(() => {
|
|
52
52
|
setIsShaking(true);
|
|
53
53
|
|
|
54
|
-
// Parar a animação após 2 segundos
|
|
55
54
|
const stopShakeTimeout = setTimeout(() => setIsShaking(false), 2000);
|
|
56
55
|
|
|
57
56
|
return () => clearTimeout(stopShakeTimeout);
|
|
58
|
-
},
|
|
57
|
+
}, 30000);
|
|
59
58
|
|
|
60
59
|
return () => clearInterval(interval);
|
|
61
60
|
}
|
|
@@ -133,7 +132,7 @@ export const BellNotifications = ({ notifications, onFilterChange, onNotificatio
|
|
|
133
132
|
|
|
134
133
|
return (
|
|
135
134
|
<Dropdown overlayClassName={styles.dropdownContainer} overlay={menu} trigger={['click']}>
|
|
136
|
-
<Badge count={unreadCount} className={styles.badgeStyle} overflowCount={99}
|
|
135
|
+
<Badge count={unreadCount} className={styles.badgeStyle} overflowCount={99}>
|
|
137
136
|
<BellOutlined className={`${styles.bellIcon} ${isShaking ? styles.shake : ''}`} />
|
|
138
137
|
</Badge>
|
|
139
138
|
</Dropdown>
|
|
@@ -166,16 +166,21 @@
|
|
|
166
166
|
}
|
|
167
167
|
|
|
168
168
|
.badgeStyle {
|
|
169
|
-
|
|
169
|
+
:global {
|
|
170
|
+
.ant-badge-count {
|
|
171
|
+
font-size: 12px !important;
|
|
172
|
+
min-width: 16px !important;
|
|
173
|
+
height: 16px !important;
|
|
174
|
+
line-height: 16px !important;
|
|
175
|
+
transform: translate(40%, -50%) !important;
|
|
176
|
+
}
|
|
177
|
+
}
|
|
170
178
|
}
|
|
171
179
|
|
|
172
180
|
.bellIcon {
|
|
173
|
-
font-size:
|
|
181
|
+
font-size: 26px;
|
|
174
182
|
cursor: pointer;
|
|
175
|
-
|
|
176
|
-
@media (max-width: 768px) {
|
|
177
|
-
font-size: 18px;
|
|
178
|
-
}
|
|
183
|
+
color: #0033a0;
|
|
179
184
|
}
|
|
180
185
|
|
|
181
186
|
.shake {
|
|
@@ -0,0 +1,198 @@
|
|
|
1
|
+
import { Meta, Story } from "@storybook/react";
|
|
2
|
+
import { Footer2, Footer2Props } from '.';
|
|
3
|
+
import {
|
|
4
|
+
SettingOutlined,
|
|
5
|
+
} from '@ant-design/icons';
|
|
6
|
+
|
|
7
|
+
export default {
|
|
8
|
+
title: 'Footer2',
|
|
9
|
+
component: Footer2,
|
|
10
|
+
} as Meta;
|
|
11
|
+
|
|
12
|
+
const Template: Story<Footer2Props> = (args) => <Footer2 {...args}></Footer2>;
|
|
13
|
+
|
|
14
|
+
const notifications = [
|
|
15
|
+
{
|
|
16
|
+
"Id": "662C390B-A38F-45AB-B97C-2D00F0A8ACAD",
|
|
17
|
+
"Title": "Creation of an Evaluation Cycle",
|
|
18
|
+
"Description": "A new evaluation cycle was created. You must answer it.",
|
|
19
|
+
"RedirectURL": "https://www.google.pt",
|
|
20
|
+
"Icon": "https://omniumfont.s3.eu-west-1.amazonaws.com/Assets/images/aacp-image.png",
|
|
21
|
+
"ExpirationDate": 1736899200,
|
|
22
|
+
"Criticality": {
|
|
23
|
+
"Id": "F133ED4C-6C72-4CDC-86A1-27A76E6BDE7F",
|
|
24
|
+
"Name": "High",
|
|
25
|
+
"ColorHex": "#E05151"
|
|
26
|
+
},
|
|
27
|
+
"IsRead": true
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
"Id": "0AF18720-1C94-48CD-8DF3-D254077E8363",
|
|
31
|
+
"Title": "Creation of an Evaluation Cycle",
|
|
32
|
+
"Description": "A new evaluation cycle was created. You must answer it.",
|
|
33
|
+
"RedirectURL": "https://www.google.pt",
|
|
34
|
+
"Icon": "https://omniumfont.s3.eu-west-1.amazonaws.com/Assets/images/aacp-image.png",
|
|
35
|
+
"ExpirationDate": 1736899200,
|
|
36
|
+
"Criticality": {
|
|
37
|
+
"Id": "F133ED4C-6C72-4CDC-86A1-27A76E6BDE7F",
|
|
38
|
+
"Name": "High",
|
|
39
|
+
"ColorHex": "#E05151"
|
|
40
|
+
},
|
|
41
|
+
"IsRead": true
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
"Id": "0419654F-66FE-41EA-BBA4-D8BB6E3D6B33",
|
|
45
|
+
"Title": "Creation of an Evaluation Cycle",
|
|
46
|
+
"Description": "A new evaluation cycle was created. You must answer it.",
|
|
47
|
+
"RedirectURL": "https://www.google.pt",
|
|
48
|
+
"Icon": "https://omniumfont.s3.eu-west-1.amazonaws.com/Assets/images/aacp-image.png",
|
|
49
|
+
"ExpirationDate": 1736899200,
|
|
50
|
+
"Criticality": {
|
|
51
|
+
"Id": "F133ED4C-6C72-4CDC-86A1-27A76E6BDE7F",
|
|
52
|
+
"Name": "High",
|
|
53
|
+
"ColorHex": "#E05151"
|
|
54
|
+
},
|
|
55
|
+
"IsRead": true
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
"Id": "CC98EDA1-0461-4D08-982E-8424EF4AFB3B",
|
|
59
|
+
"Title": "Creation of an Evaluation Cycle",
|
|
60
|
+
"Description": "A new evaluation cycle was created. You must answer it.",
|
|
61
|
+
"RedirectURL": "https://www.google.pt",
|
|
62
|
+
"Icon": "https://omniumfont.s3.eu-west-1.amazonaws.com/Assets/images/aacp-image.png",
|
|
63
|
+
"ExpirationDate": 1736899200,
|
|
64
|
+
"Criticality": {
|
|
65
|
+
"Id": "F133ED4C-6C72-4CDC-86A1-27A76E6BDE7F",
|
|
66
|
+
"Name": "High",
|
|
67
|
+
"ColorHex": "#E05151"
|
|
68
|
+
},
|
|
69
|
+
"IsRead": false
|
|
70
|
+
},
|
|
71
|
+
{
|
|
72
|
+
"Id": "3DB9310A-4BF8-4B90-8D5A-7583473664BB",
|
|
73
|
+
"Title": "Creation of an Evaluation Cycle",
|
|
74
|
+
"Description": "A new evaluation cycle was created. You must answer it.",
|
|
75
|
+
"RedirectURL": "https://www.google.pt",
|
|
76
|
+
"Icon": "https://omniumfont.s3.eu-west-1.amazonaws.com/Assets/images/aacp-image.png",
|
|
77
|
+
"ExpirationDate": 1736899200,
|
|
78
|
+
"Criticality": {
|
|
79
|
+
"Id": "F133ED4C-6C72-4CDC-86A1-27A76E6BDE7F",
|
|
80
|
+
"Name": "High",
|
|
81
|
+
"ColorHex": "#E05151"
|
|
82
|
+
},
|
|
83
|
+
"IsRead": false
|
|
84
|
+
},
|
|
85
|
+
{
|
|
86
|
+
"Id": "D6FB93EE-3255-42B2-8EC1-27E7AC3F5249",
|
|
87
|
+
"Title": "Creation of a new user",
|
|
88
|
+
"Description": "A new user was created in the platform with the mecanographic number 8111.",
|
|
89
|
+
"RedirectURL": "https://www.google.pt",
|
|
90
|
+
"Icon": "https://omnium-user-images.s3.eu-west-1.amazonaws.com/omniumretail-bigwingame-logotipo-vermelho.svg",
|
|
91
|
+
"ExpirationDate": 1736985600,
|
|
92
|
+
"Criticality": {
|
|
93
|
+
"Id": "F133ED4C-6C72-4CDC-86A1-27A76E6BDE7F",
|
|
94
|
+
"Name": "High",
|
|
95
|
+
"ColorHex": "#E05151"
|
|
96
|
+
},
|
|
97
|
+
"IsRead": false
|
|
98
|
+
},
|
|
99
|
+
{
|
|
100
|
+
"Id": "D6FB96EE-3255-42B2-8EC1-27E7AC3F5249",
|
|
101
|
+
"Title": "Creation of a new action of inspection",
|
|
102
|
+
"Description": "A new inspection action was created.",
|
|
103
|
+
"RedirectURL": "https://www.google.pt",
|
|
104
|
+
"Icon": "https://omnium-user-images.s3.eu-west-1.amazonaws.com/omniumretail-bigwingame-logotipo-vermelho.svg",
|
|
105
|
+
"ExpirationDate": 1736985600,
|
|
106
|
+
"Criticality": {
|
|
107
|
+
"Id": "F133ED4C-6C72-4CDC-86A1-27A76E6BDE7F",
|
|
108
|
+
"Name": "High",
|
|
109
|
+
"ColorHex": "#E05151"
|
|
110
|
+
},
|
|
111
|
+
"IsRead": false
|
|
112
|
+
},
|
|
113
|
+
{
|
|
114
|
+
"Id": "D6FB96EE-3655-42B2-8EC1-27E7AC3F5249",
|
|
115
|
+
"Title": "Creation of a new action of inspection",
|
|
116
|
+
"Description": "A new inspection action was created.",
|
|
117
|
+
"RedirectURL": "https://www.google.pt",
|
|
118
|
+
"Icon": "https://omnium-user-images.s3.eu-west-1.amazonaws.com/omniumretail-bigwingame-logotipo-vermelho.svg",
|
|
119
|
+
"ExpirationDate": 1736985600,
|
|
120
|
+
"Criticality": {
|
|
121
|
+
"Id": "F133ED4C-6C72-4CDC-86A1-27A76E6BDE7F",
|
|
122
|
+
"Name": "Low",
|
|
123
|
+
"ColorHex": "#E05151"
|
|
124
|
+
},
|
|
125
|
+
"IsRead": false
|
|
126
|
+
},
|
|
127
|
+
{
|
|
128
|
+
"Id": "D6FB96EE-3255-46B2-8EC1-27E7AC3F5249",
|
|
129
|
+
"Title": "Creation of a new action of inspection",
|
|
130
|
+
"Description": "A new inspection action was created.",
|
|
131
|
+
"RedirectURL": "https://www.google.pt",
|
|
132
|
+
"Icon": "https://omnium-user-images.s3.eu-west-1.amazonaws.com/omniumretail-bigwingame-logotipo-vermelho.svg",
|
|
133
|
+
"ExpirationDate": 1736985600,
|
|
134
|
+
"Criticality": {
|
|
135
|
+
"Id": "F133ED4C-6C72-4CDC-86A1-27A76E6BDE7F",
|
|
136
|
+
"Name": "High",
|
|
137
|
+
"ColorHex": "#E05151"
|
|
138
|
+
},
|
|
139
|
+
"IsRead": false
|
|
140
|
+
},
|
|
141
|
+
{
|
|
142
|
+
"Id": "D9FB96EE-3255-42B2-8EC1-27E7AC3F5249",
|
|
143
|
+
"Title": "Creation of a new action of inspection",
|
|
144
|
+
"Description": "A new inspection action was created.",
|
|
145
|
+
"RedirectURL": "https://www.google.pt",
|
|
146
|
+
"Icon": "https://omnium-user-images.s3.eu-west-1.amazonaws.com/omniumretail-bigwingame-logotipo-vermelho.svg",
|
|
147
|
+
"ExpirationDate": 1736985600,
|
|
148
|
+
"Criticality": {
|
|
149
|
+
"Id": "F133ED4C-6C72-4CDC-86A1-27A76E6BDE7F",
|
|
150
|
+
"Name": "High",
|
|
151
|
+
"ColorHex": "#E05151"
|
|
152
|
+
},
|
|
153
|
+
"IsRead": false
|
|
154
|
+
},
|
|
155
|
+
{
|
|
156
|
+
"Id": "D6FB96EE-5955-42B2-8EC1-27E7AC3F5249",
|
|
157
|
+
"Title": "Creation of a new action of inspection",
|
|
158
|
+
"Description": "A new inspection action was created.",
|
|
159
|
+
"RedirectURL": "https://www.google.pt",
|
|
160
|
+
"Icon": "https://omnium-user-images.s3.eu-west-1.amazonaws.com/omniumretail-bigwingame-logotipo-vermelho.svg",
|
|
161
|
+
"ExpirationDate": 1736985600,
|
|
162
|
+
"Criticality": {
|
|
163
|
+
"Id": "F133ED4C-6C72-4CDC-86A1-27A76E6BDE7F",
|
|
164
|
+
"Name": "High",
|
|
165
|
+
"ColorHex": "#E05151"
|
|
166
|
+
},
|
|
167
|
+
"IsRead": false
|
|
168
|
+
},
|
|
169
|
+
{
|
|
170
|
+
"Id": "D6FB96EE-3255-42B7-8EC1-27E7AC3F5249",
|
|
171
|
+
"Title": "Creation of a new action of inspection",
|
|
172
|
+
"Description": "A new inspection action was created.",
|
|
173
|
+
"RedirectURL": "https://www.google.pt",
|
|
174
|
+
"Icon": "https://omnium-user-images.s3.eu-west-1.amazonaws.com/omniumretail-bigwingame-logotipo-vermelho.svg",
|
|
175
|
+
"ExpirationDate": 1736985600,
|
|
176
|
+
"Criticality": {
|
|
177
|
+
"Id": "F133ED4C-6C72-4CDC-86A1-27A76E6BDE7F",
|
|
178
|
+
"Name": "High",
|
|
179
|
+
"ColorHex": "#E05151"
|
|
180
|
+
},
|
|
181
|
+
"IsRead": false
|
|
182
|
+
}
|
|
183
|
+
];
|
|
184
|
+
|
|
185
|
+
const actions = [
|
|
186
|
+
{
|
|
187
|
+
key: 'rederecionar',
|
|
188
|
+
label: 'Definições',
|
|
189
|
+
icon: <SettingOutlined />,
|
|
190
|
+
onClick: () => console.log('Definições'),
|
|
191
|
+
}
|
|
192
|
+
];
|
|
193
|
+
|
|
194
|
+
export const Primary = Template.bind({});
|
|
195
|
+
Primary.args = {
|
|
196
|
+
notifications: notifications,
|
|
197
|
+
actions: actions,
|
|
198
|
+
};
|
|
@@ -0,0 +1,209 @@
|
|
|
1
|
+
import { BellNotifications } from '../BellNotifications';
|
|
2
|
+
import styles from './styles.module.scss';
|
|
3
|
+
import {
|
|
4
|
+
ArrowLeftOutlined,
|
|
5
|
+
PlusOutlined,
|
|
6
|
+
DeleteOutlined,
|
|
7
|
+
ReloadOutlined,
|
|
8
|
+
EditOutlined,
|
|
9
|
+
ExportOutlined,
|
|
10
|
+
PrinterOutlined
|
|
11
|
+
} from '@ant-design/icons';
|
|
12
|
+
import { t } from 'i18next';
|
|
13
|
+
import React, { useEffect, useRef } from 'react';
|
|
14
|
+
|
|
15
|
+
interface Action {
|
|
16
|
+
key: string;
|
|
17
|
+
label: string;
|
|
18
|
+
icon: React.ReactNode;
|
|
19
|
+
onClick?: () => void;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
interface Criticality {
|
|
23
|
+
Id: string;
|
|
24
|
+
Name: string;
|
|
25
|
+
ColorHex: string;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
interface BellNotification {
|
|
29
|
+
Id: string;
|
|
30
|
+
Title: string;
|
|
31
|
+
Description: string;
|
|
32
|
+
RedirectURL: string;
|
|
33
|
+
Icon: string;
|
|
34
|
+
ExpirationDate: number;
|
|
35
|
+
Criticality: Criticality;
|
|
36
|
+
IsRead: boolean;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
export interface Footer2Props {
|
|
40
|
+
onBackClick?: () => void;
|
|
41
|
+
notifications: BellNotification[];
|
|
42
|
+
onFilterChange: (filter: 'all' | 'unread') => void;
|
|
43
|
+
onNotificationClick: (id: string, url: string) => void;
|
|
44
|
+
handleMarkAllAsRead: () => void;
|
|
45
|
+
actions?: Action[];
|
|
46
|
+
onDelete?: () => void;
|
|
47
|
+
onUpdate?: () => void;
|
|
48
|
+
onCreate?: () => void;
|
|
49
|
+
onEdit?: () => void;
|
|
50
|
+
onExport?: () => void;
|
|
51
|
+
onPrint?: () => void;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
export const Footer2 = (props: Footer2Props) => {
|
|
55
|
+
const {
|
|
56
|
+
onBackClick,
|
|
57
|
+
notifications,
|
|
58
|
+
onFilterChange,
|
|
59
|
+
onNotificationClick,
|
|
60
|
+
handleMarkAllAsRead,
|
|
61
|
+
actions = [],
|
|
62
|
+
onDelete,
|
|
63
|
+
onUpdate,
|
|
64
|
+
onCreate,
|
|
65
|
+
onEdit,
|
|
66
|
+
onExport,
|
|
67
|
+
onPrint
|
|
68
|
+
} = props;
|
|
69
|
+
|
|
70
|
+
const [isMenuOpen, setIsMenuOpen] = React.useState(false);
|
|
71
|
+
const menuRef = useRef<HTMLDivElement>(null);
|
|
72
|
+
|
|
73
|
+
const getDefaultAndCustomActions = (): Action[] => {
|
|
74
|
+
const combinedActions = [...actions];
|
|
75
|
+
|
|
76
|
+
if (onDelete) {
|
|
77
|
+
combinedActions.push({
|
|
78
|
+
key: 'delete',
|
|
79
|
+
label: t('navigation.delete'),
|
|
80
|
+
icon: <DeleteOutlined />,
|
|
81
|
+
onClick: onDelete
|
|
82
|
+
});
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
if (onUpdate) {
|
|
86
|
+
combinedActions.push({
|
|
87
|
+
key: 'update',
|
|
88
|
+
label: t('navigation.update'),
|
|
89
|
+
icon: <ReloadOutlined />,
|
|
90
|
+
onClick: onUpdate
|
|
91
|
+
});
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
if (onCreate) {
|
|
95
|
+
combinedActions.push({
|
|
96
|
+
key: 'create',
|
|
97
|
+
label: t('navigation.create'),
|
|
98
|
+
icon: <PlusOutlined />,
|
|
99
|
+
onClick: onCreate
|
|
100
|
+
});
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
if (onEdit) {
|
|
104
|
+
combinedActions.push({
|
|
105
|
+
key: 'edit',
|
|
106
|
+
label: t('navigation.edit'),
|
|
107
|
+
icon: <EditOutlined />,
|
|
108
|
+
onClick: onEdit
|
|
109
|
+
});
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
if (onExport) {
|
|
113
|
+
combinedActions.push({
|
|
114
|
+
key: 'export',
|
|
115
|
+
label: t('navigation.export'),
|
|
116
|
+
icon: <ExportOutlined />,
|
|
117
|
+
onClick: onExport
|
|
118
|
+
});
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
if (onPrint) {
|
|
122
|
+
combinedActions.push({
|
|
123
|
+
key: 'print',
|
|
124
|
+
label: t('navigation.print'),
|
|
125
|
+
icon: <PrinterOutlined />,
|
|
126
|
+
onClick: onPrint
|
|
127
|
+
});
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
return combinedActions.sort((a, b) => a.label.localeCompare(b.label));
|
|
131
|
+
};
|
|
132
|
+
|
|
133
|
+
const allActions = getDefaultAndCustomActions();
|
|
134
|
+
|
|
135
|
+
const toggleMenu = () => {
|
|
136
|
+
setIsMenuOpen(!isMenuOpen);
|
|
137
|
+
};
|
|
138
|
+
|
|
139
|
+
// Handle click outside to close menu
|
|
140
|
+
useEffect(() => {
|
|
141
|
+
const handleClickOutside = (event: MouseEvent) => {
|
|
142
|
+
if (
|
|
143
|
+
isMenuOpen &&
|
|
144
|
+
menuRef.current &&
|
|
145
|
+
!menuRef.current.contains(event.target as Node) &&
|
|
146
|
+
!(event.target as Element).closest(`.${styles.addButton}`)
|
|
147
|
+
) {
|
|
148
|
+
setIsMenuOpen(false);
|
|
149
|
+
}
|
|
150
|
+
};
|
|
151
|
+
|
|
152
|
+
document.addEventListener('mousedown', handleClickOutside);
|
|
153
|
+
|
|
154
|
+
return () => {
|
|
155
|
+
document.removeEventListener('mousedown', handleClickOutside);
|
|
156
|
+
};
|
|
157
|
+
}, [isMenuOpen]);
|
|
158
|
+
|
|
159
|
+
const plusIconClass = isMenuOpen ? `${styles.addIcon} ${styles.rotateIcon}` : styles.addIcon;
|
|
160
|
+
|
|
161
|
+
return (
|
|
162
|
+
<div className={styles.mobileFooter}>
|
|
163
|
+
<div className={styles.navItem} onClick={onBackClick}>
|
|
164
|
+
<ArrowLeftOutlined className={styles.navIcon} />
|
|
165
|
+
<span className={styles.navText}>{t('navigation.back')}</span>
|
|
166
|
+
</div>
|
|
167
|
+
|
|
168
|
+
<div className={styles.addButtonContainer}>
|
|
169
|
+
<div className={styles.addButton} onClick={toggleMenu}>
|
|
170
|
+
<PlusOutlined className={plusIconClass} />
|
|
171
|
+
</div>
|
|
172
|
+
|
|
173
|
+
{isMenuOpen && (
|
|
174
|
+
<div className={styles.circularMenu} ref={menuRef}>
|
|
175
|
+
{allActions?.map((action) => (
|
|
176
|
+
<div
|
|
177
|
+
key={action.key}
|
|
178
|
+
className={styles.circleMenuItem}
|
|
179
|
+
onClick={() => {
|
|
180
|
+
if (action.onClick) {
|
|
181
|
+
action.onClick();
|
|
182
|
+
setIsMenuOpen(false);
|
|
183
|
+
}
|
|
184
|
+
}}
|
|
185
|
+
>
|
|
186
|
+
<div className={styles.circleMenuIcon}>
|
|
187
|
+
{action.icon}
|
|
188
|
+
</div>
|
|
189
|
+
|
|
190
|
+
<div className={styles.circleMenuLabel}>{action.label}</div>
|
|
191
|
+
</div>
|
|
192
|
+
))}
|
|
193
|
+
</div>
|
|
194
|
+
)}
|
|
195
|
+
</div>
|
|
196
|
+
|
|
197
|
+
<div className={styles.navItem}>
|
|
198
|
+
<BellNotifications
|
|
199
|
+
notifications={notifications}
|
|
200
|
+
onFilterChange={onFilterChange}
|
|
201
|
+
onNotificationClick={onNotificationClick}
|
|
202
|
+
handleMarkAllAsRead={handleMarkAllAsRead}
|
|
203
|
+
/>
|
|
204
|
+
|
|
205
|
+
<span className={styles.navText}>{t('navigation.notifications')}</span>
|
|
206
|
+
</div>
|
|
207
|
+
</div>
|
|
208
|
+
);
|
|
209
|
+
};
|