@egov3/system-design 1.3.112 → 1.3.119

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.
Files changed (36) hide show
  1. package/dist/cjs/baseComponents/BaseField/index.js +1 -1
  2. package/dist/cjs/baseComponents/BaseField/index.js.map +1 -1
  3. package/dist/cjs/components/Notification/Item/NotificationComponent.module.css.js +22 -0
  4. package/dist/cjs/components/Notification/Item/index.js +22 -0
  5. package/dist/cjs/components/Notification/Item/index.js.map +1 -0
  6. package/dist/cjs/components/Notification/Wrapper/NotificationWrapper.module.css.js +22 -0
  7. package/dist/cjs/components/Notification/Wrapper/NotificationWrapper.module.css.js.map +1 -0
  8. package/dist/cjs/components/Notification/Wrapper/index.js +142 -0
  9. package/dist/cjs/components/Notification/Wrapper/index.js.map +1 -0
  10. package/dist/cjs/components/index.js +52 -50
  11. package/dist/cjs/components/index.js.map +1 -1
  12. package/dist/esm/baseComponents/BaseField/index.js +1 -1
  13. package/dist/esm/baseComponents/BaseField/index.js.map +1 -1
  14. package/dist/esm/components/Notification/Item/NotificationComponent.module.css.js +18 -0
  15. package/dist/esm/components/Notification/Item/index.js +20 -0
  16. package/dist/esm/components/Notification/Item/index.js.map +1 -0
  17. package/dist/esm/components/Notification/Wrapper/NotificationWrapper.module.css.js +18 -0
  18. package/dist/esm/components/Notification/Wrapper/NotificationWrapper.module.css.js.map +1 -0
  19. package/dist/esm/components/Notification/Wrapper/index.js +140 -0
  20. package/dist/esm/components/Notification/Wrapper/index.js.map +1 -0
  21. package/dist/esm/components/index.js +4 -2
  22. package/dist/esm/components/index.js.map +1 -1
  23. package/dist/types/components/{NotificationComponent → Notification/Item}/index.d.ts +1 -1
  24. package/dist/types/components/Notification/Wrapper/index.d.ts +8 -0
  25. package/dist/types/constants/Notification.d.ts +8 -0
  26. package/dist/types/index.d.ts +4 -2
  27. package/dist/types/interfaces/Notification.d.ts +11 -0
  28. package/package.json +1 -1
  29. package/dist/cjs/components/NotificationComponent/NotificationComponent.module.css.js +0 -22
  30. package/dist/cjs/components/NotificationComponent/index.js +0 -29
  31. package/dist/cjs/components/NotificationComponent/index.js.map +0 -1
  32. package/dist/esm/components/NotificationComponent/NotificationComponent.module.css.js +0 -18
  33. package/dist/esm/components/NotificationComponent/index.js +0 -27
  34. package/dist/esm/components/NotificationComponent/index.js.map +0 -1
  35. /package/dist/cjs/components/{NotificationComponent → Notification/Item}/NotificationComponent.module.css.js.map +0 -0
  36. /package/dist/esm/components/{NotificationComponent → Notification/Item}/NotificationComponent.module.css.js.map +0 -0
@@ -38,7 +38,7 @@ const BaseFieldInner = ({ value = "", labelText, inputLeftIcon, isClearable, cla
38
38
  handleFocus,
39
39
  handleBlur,
40
40
  handleChange,
41
- })] })] }), isFocused && isClearable && value && (jsxRuntime.jsx(graphics.Icons.General.Clear, { className: BaseField_module.default.clearIcon, onMouseDown: (e) => e.preventDefault(), onClick: handleClear, "data-testid": "Icons_CLEAR" }))] }), hintText && hintText.length > 0 && (jsxRuntime.jsx("span", { "data-testid": `${dataTestid}_HINT_TEXT`, className: joinClasses.joinClasses(BaseField_module.default.hintText, typography_module.default.body2Regular, isError && BaseField_module.default.error), children: hintText }))] }));
41
+ })] })] }), isFocused && isClearable && value && (jsxRuntime.jsx(graphics.Icons.General.Clear, { className: BaseField_module.default.clearIcon, onMouseDown: (e) => e.preventDefault(), onClick: handleClear, "data-testid": "Icons_CLEAR" }))] }), hintText && hintText.length > 0 && (jsxRuntime.jsx("span", { "data-testid": `${dataTestid}_HINT_TEXT`, className: joinClasses.joinClasses(BaseField_module.default.hintText, typography_module.default.caption1Regular, isError && BaseField_module.default.error), children: hintText }))] }));
42
42
  };
43
43
  const BaseField = React.forwardRef(BaseFieldInner);
44
44
 
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../../../../src/baseComponents/BaseField/index.tsx"],"sourcesContent":[null],"names":["useState","_jsxs","joinClasses","styles","typography","_jsx","Icons","forwardRef"],"mappings":";;;;;;;;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,CAAC,cAAc,EAAE,EACtC,OAAO,EAAE,WAAW,iBACR,aAAa,EAAA,CACzB,CACH,CAAA,EAAA,CACG,EACL,QAAQ,IAAI,QAAQ,CAAC,MAAM,GAAG,CAAC,KAC9BE,wCACe,CAAA,EAAG,UAAU,YAAY,EACtC,SAAS,EAAEH,uBAAW,CACpBC,wBAAM,CAAC,QAAQ,EACfC,yBAAU,CAAC,YAAY,EACvB,OAAO,IAAID,wBAAM,CAAC,KAAK,CACxB,EAAA,QAAA,EAEA,QAAQ,GACJ,CACR,CAAA,EAAA,CACG;AAEV,CAAC;MAEY,SAAS,GAAGI,gBAAU,CAAC,cAAc;;;;"}
1
+ {"version":3,"file":"index.js","sources":["../../../../src/baseComponents/BaseField/index.tsx"],"sourcesContent":[null],"names":["useState","_jsxs","joinClasses","styles","typography","_jsx","Icons","forwardRef"],"mappings":";;;;;;;;;AAqCA,MAAM,cAAc,GAAG,CACrB,EACE,KAAK,GAAG,EAAE,EACV,SAAS,EACT,aAAa,EACb,WAAW,EACX,SAAS,EACT,KAAK,EACL,EAAE,EACF,SAAS,EAAE,iBAAiB,EAC5B,YAAY,EACZ,QAAQ,EACR,UAAU,GAAG,gBAAgB,EAC7B,QAAQ,EACR,OAAO,EACP,QAAQ,GACW,EACrB,GAA8B,KAC5B;IACF,MAAM,CAAC,YAAY,EAAE,eAAe,CAAC,GAAGA,cAAQ,CAAC,KAAK,CAAC;AACvD,IAAA,MAAM,SAAS,GAAG,iBAAiB,IAAI,YAAY;AAEnD,IAAA,MAAM,YAAY,GAAG,CAAC,CAAC,SAAS,KAAK,SAAS,IAAI,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC;AACnE,IAAA,MAAM,uBAAuB,GAC3B,CAAC,CAAC,SAAS,IAAI,CAAC,SAAS,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC;IAEjD,MAAM,WAAW,GAAG,MAAK;QACvB,eAAe,CAAC,IAAI,CAAC;AACrB,QAAA,YAAY,GAAG,IAAI,CAA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KAAK,CACxB,EAAA,QAAA,EAEA,SAAS,EAAA,CACJ,CACT,EACDF,eAAA,CAAA,KAAA,EAAA,EACE,SAAS,EAAEE,wBAAM,CAAC,kBAAkB,EAAA,aAAA,EACvB,CAAA,EAAG,UAAU,CAAA,qBAAA,CAAuB,EAAA,QAAA,EAAA,CAEhD,aAAa,EACb,QAAQ,CAAC;wCACR,SAAS;AACT,wCAAA,WAAW,EAAE,YAAY;AACzB,wCAAA,iBAAiB,EAAE,uBAAuB;wCAC1C,WAAW;wCACX,UAAU;wCACV,YAAY;AACb,qCAAA,CAAC,IACE,CAAA,EAAA,CACF,EACL,SAAS,IAAI,WAAW,IAAI,KAAK,KAChCE,eAACC,cAAK,CAAC,OAAO,CAAC,KAAK,IAClB,SAAS,EAAEH,wBAAM,CAAC,SAAS,EAC3B,WAAW,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,cAAc,EAAE,EACtC,OAAO,EAAE,WAAW,iBACR,aAAa,EAAA,CACzB,CACH,CAAA,EAAA,CACG,EACL,QAAQ,IAAI,QAAQ,CAAC,MAAM,GAAG,CAAC,KAC9BE,wCACe,CAAA,EAAG,UAAU,YAAY,EACtC,SAAS,EAAEH,uBAAW,CACpBC,wBAAM,CAAC,QAAQ,EACfC,yBAAU,CAAC,eAAe,EAC1B,OAAO,IAAID,wBAAM,CAAC,KAAK,CACxB,EAAA,QAAA,EAEA,QAAQ,GACJ,CACR,CAAA,EAAA,CACG;AAEV,CAAC;MAEY,SAAS,GAAGI,gBAAU,CAAC,cAAc;;;;"}
@@ -0,0 +1,22 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ var css_248z = ".NotificationComponent-module_snackbar__PtpSi {\n padding: 16px 20px;\n border-radius: 12px;\n display: flex;\n justify-content: space-between;\n align-items: center;\n gap: 12px;\n z-index: 1000;\n box-shadow: 0px 12px 32px 0px rgba(128, 130, 136, 0.12);\n}\n\n.NotificationComponent-module_snackbar__PtpSi .NotificationComponent-module_text__jVDme {\n color: var(--text-white-nonconvert-color);\n}\n\n.NotificationComponent-module_success__z-Mvq {\n background-color: var(--icon-success);\n}\n\n.NotificationComponent-module_error__-9ZE1 {\n background-color: var(--icon-error-color);\n}\n\n.NotificationComponent-module_info__qSq09 {\n background-color: var(--icon-accent-color);\n}\n\n.NotificationComponent-module_warning__A3bKG {\n background-color: var(--icon-warning-color);\n}\n";
6
+ var styles = {"snackbar":"NotificationComponent-module_snackbar__PtpSi","text":"NotificationComponent-module_text__jVDme","success":"NotificationComponent-module_success__z-Mvq","error":"NotificationComponent-module_error__-9ZE1","info":"NotificationComponent-module_info__qSq09","warning":"NotificationComponent-module_warning__A3bKG"};
7
+ function styleInject(css, options) {
8
+ if (typeof document === 'undefined') return;
9
+ const head = document.head || document.getElementsByTagName('head')[0];
10
+ const style = document.createElement('style');
11
+ style.type = 'text/css';
12
+ if (style.styleSheet) {
13
+ style.styleSheet.cssText = css;
14
+ } else {
15
+ style.appendChild(document.createTextNode(css));
16
+ }
17
+ head.appendChild(style);
18
+ }
19
+ styleInject(css_248z);
20
+
21
+ exports.default = styles;
22
+ //# sourceMappingURL=NotificationComponent.module.css.js.map
@@ -0,0 +1,22 @@
1
+ 'use strict';
2
+
3
+ var jsxRuntime = require('react/jsx-runtime');
4
+ var graphics = require('@egov3/graphics');
5
+ var index = require('../../../baseComponents/index.js');
6
+ var joinClasses = require('../../../utils/joinClasses.js');
7
+ var toPascalCase = require('../../../utils/string/toPascalCase.js');
8
+ var NotificationComponent_module = require('./NotificationComponent.module.css.js');
9
+
10
+ const notificationIconTypes = {
11
+ success: graphics.Icons.Basic.Check,
12
+ error: graphics.Icons.General.Clear,
13
+ warning: graphics.Icons.General.WarningFilled,
14
+ info: graphics.Icons.General.InfoFilled,
15
+ };
16
+ const NotificationItem = ({ type = "info", text, onClick, }) => {
17
+ const Icon = notificationIconTypes[type];
18
+ return (jsxRuntime.jsxs("button", { type: "button", onClick: onClick, className: joinClasses.joinClasses(NotificationComponent_module.default.snackbar, NotificationComponent_module.default[type]), "data-testid": "NotificationComponent_SNACKBAR", children: [jsxRuntime.jsx(Icon, { fill: "var(--icon-white-nonconvert-color)", "data-testid": `NotificationComponentIcon_${toPascalCase.toPascalCase(type)}` }), jsxRuntime.jsx(index.BaseComponents.Typography, { "aria-label": text, className: NotificationComponent_module.default.text, "data-testid": "NotificationComponent_TEXT", fontClass: "body2Regular", tag: "span", children: text })] }));
19
+ };
20
+
21
+ exports.NotificationItem = NotificationItem;
22
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sources":["../../../../../src/components/Notification/Item/index.tsx"],"sourcesContent":[null],"names":["Icons","_jsxs","joinClasses","styles","_jsx","toPascalCase","BaseComponents"],"mappings":";;;;;;;;;AASA,MAAM,qBAAqB,GAAG;AAC5B,IAAA,OAAO,EAAEA,cAAK,CAAC,KAAK,CAAC,KAAK;AAC1B,IAAA,KAAK,EAAEA,cAAK,CAAC,OAAO,CAAC,KAAK;AAC1B,IAAA,OAAO,EAAEA,cAAK,CAAC,OAAO,CAAC,aAAa;AACpC,IAAA,IAAI,EAAEA,cAAK,CAAC,OAAO,CAAC,UAAU;CAI/B;AAQM,MAAM,gBAAgB,GAAG,CAAC,EAC/B,IAAI,GAAG,MAAM,EACb,IAAI,EACJ,OAAO,GACqB,KAAI;AAChC,IAAA,MAAM,IAAI,GAAG,qBAAqB,CAAC,IAAI,CAAC;AAExC,IAAA,QACEC,eAAA,CAAA,QAAA,EAAA,EACE,IAAI,EAAC,QAAQ,EACb,OAAO,EAAE,OAAO,EAChB,SAAS,EAAEC,uBAAW,CAACC,oCAAM,CAAC,QAAQ,EAAEA,oCAAM,CAAC,IAAI,CAAC,CAAC,EAAA,aAAA,EACzC,gCAAgC,EAAA,QAAA,EAAA,CAE5CC,cAAA,CAAC,IAAI,EAAA,EACH,IAAI,EAAC,oCAAoC,EAAA,aAAA,EAC5B,CAAA,0BAAA,EAA6BC,yBAAY,CAAC,IAAI,CAAC,CAAA,CAAE,EAAA,CAC9D,EACFD,cAAA,CAACE,oBAAc,CAAC,UAAU,EAAA,EAAA,YAAA,EACZ,IAAI,EAChB,SAAS,EAAEH,oCAAM,CAAC,IAAI,EAAA,aAAA,EACV,4BAA4B,EACxC,SAAS,EAAC,cAAc,EACxB,GAAG,EAAC,MAAM,EAAA,QAAA,EAET,IAAI,EAAA,CACqB,CAAA,EAAA,CACrB;AAEb;;;;"}
@@ -0,0 +1,22 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ var css_248z = ".NotificationWrapper-module_wrapper__uK2xb {\n position: fixed;\n top: 24px;\n left: 50%;\n transform: translateX(-50%);\n\n display: flex;\n flex-direction: column;\n justify-content: center;\n align-items: center;\n gap: 16px;\n z-index: 1000;\n}\n\n.NotificationWrapper-module_item__45Lg0 {\n will-change: transform, opacity;\n}\n\n.NotificationWrapper-module_flyDown__mntT4 {\n animation: NotificationWrapper-module_flyDown__mntT4 300ms ease-in-out;\n}\n\n.NotificationWrapper-module_flyUp__a5Sa9 {\n animation: NotificationWrapper-module_flyUp__a5Sa9 300ms ease-in-out;\n animation-fill-mode: forwards;\n pointer-events: none;\n}\n\n@keyframes NotificationWrapper-module_flyDown__mntT4 {\n from {\n transform: translateY(-100px);\n opacity: 0;\n }\n to {\n transform: translateY(0);\n opacity: 1;\n }\n}\n\n@keyframes NotificationWrapper-module_flyUp__a5Sa9 {\n from {\n transform: translateY(0);\n opacity: 1;\n }\n to {\n transform: translateY(-100px);\n opacity: 0;\n }\n}\n";
6
+ var styles = {"wrapper":"NotificationWrapper-module_wrapper__uK2xb","item":"NotificationWrapper-module_item__45Lg0","flyDown":"NotificationWrapper-module_flyDown__mntT4","flyUp":"NotificationWrapper-module_flyUp__a5Sa9"};
7
+ function styleInject(css, options) {
8
+ if (typeof document === 'undefined') return;
9
+ const head = document.head || document.getElementsByTagName('head')[0];
10
+ const style = document.createElement('style');
11
+ style.type = 'text/css';
12
+ if (style.styleSheet) {
13
+ style.styleSheet.cssText = css;
14
+ } else {
15
+ style.appendChild(document.createTextNode(css));
16
+ }
17
+ head.appendChild(style);
18
+ }
19
+ styleInject(css_248z);
20
+
21
+ exports.default = styles;
22
+ //# sourceMappingURL=NotificationWrapper.module.css.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"NotificationWrapper.module.css.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;"}
@@ -0,0 +1,142 @@
1
+ 'use strict';
2
+
3
+ var jsxRuntime = require('react/jsx-runtime');
4
+ var React = require('react');
5
+ var index = require('../Item/index.js');
6
+ var NotificationWrapper_module = require('./NotificationWrapper.module.css.js');
7
+
8
+ const AUTO_CLOSE_DELAY_MS = 7000;
9
+ const FLIP_DURATION_MS = 300;
10
+ const FLIP_EASING = "ease-in-out";
11
+ const NotificationWrapper = ({ items, removeNotificationData, }) => {
12
+ const [closingTopId, setClosingTopId] = React.useState(null);
13
+ const topNotificationId = items[0]?.id ?? null;
14
+ const topNotificationIdRef = React.useRef(null);
15
+ const closeTimersRef = React.useRef(new Map());
16
+ const itemRefs = React.useRef(new Map());
17
+ const prevTopByIdRef = React.useRef(new Map());
18
+ const prevIdsRef = React.useRef(new Set());
19
+ const clearCloseTimer = React.useCallback((id) => {
20
+ const timer = closeTimersRef.current.get(id);
21
+ if (!timer) {
22
+ return;
23
+ }
24
+ clearTimeout(timer);
25
+ closeTimersRef.current.delete(id);
26
+ }, []);
27
+ const removeNotification = React.useCallback((id) => {
28
+ clearCloseTimer(id);
29
+ removeNotificationData(id);
30
+ }, [clearCloseTimer, removeNotificationData]);
31
+ const startTopCloseAnimation = React.useCallback((id) => {
32
+ clearCloseTimer(id);
33
+ setClosingTopId((current) => (current === id ? current : id));
34
+ }, [clearCloseTimer]);
35
+ const closeNotification = React.useCallback((id) => {
36
+ if (id !== topNotificationId) {
37
+ removeNotification(id);
38
+ return;
39
+ }
40
+ startTopCloseAnimation(id);
41
+ }, [topNotificationId, startTopCloseAnimation, removeNotification]);
42
+ const handleTopAnimationEnd = React.useCallback((event, id) => {
43
+ if (event.currentTarget !== event.target || closingTopId !== id) {
44
+ return;
45
+ }
46
+ removeNotification(id);
47
+ setClosingTopId(null);
48
+ }, [closingTopId, removeNotification]);
49
+ React.useEffect(() => {
50
+ topNotificationIdRef.current = topNotificationId;
51
+ }, [topNotificationId]);
52
+ React.useEffect(() => {
53
+ items.forEach((item) => {
54
+ if (closeTimersRef.current.has(item.id)) {
55
+ return;
56
+ }
57
+ const timer = setTimeout(() => {
58
+ if (topNotificationIdRef.current === item.id) {
59
+ startTopCloseAnimation(item.id);
60
+ return;
61
+ }
62
+ removeNotification(item.id);
63
+ }, AUTO_CLOSE_DELAY_MS);
64
+ closeTimersRef.current.set(item.id, timer);
65
+ });
66
+ const currentIds = new Set(items.map((item) => item.id));
67
+ closeTimersRef.current.forEach((timer, id) => {
68
+ if (currentIds.has(id)) {
69
+ return;
70
+ }
71
+ clearTimeout(timer);
72
+ closeTimersRef.current.delete(id);
73
+ });
74
+ }, [items, startTopCloseAnimation, removeNotification]);
75
+ React.useEffect(() => () => {
76
+ closeTimersRef.current.forEach((timer) => {
77
+ clearTimeout(timer);
78
+ });
79
+ closeTimersRef.current.clear();
80
+ }, []);
81
+ React.useLayoutEffect(() => {
82
+ const currentTopById = new Map();
83
+ const currentIds = new Set(items.map((item) => item.id));
84
+ items.forEach((item) => {
85
+ const element = itemRefs.current.get(item.id);
86
+ if (!element) {
87
+ return;
88
+ }
89
+ currentTopById.set(item.id, element.getBoundingClientRect().top);
90
+ const isNewItem = !prevIdsRef.current.has(item.id);
91
+ if (isNewItem) {
92
+ element.classList.add(NotificationWrapper_module.default.flyDown);
93
+ globalThis.setTimeout(() => {
94
+ element.classList.remove(NotificationWrapper_module.default.flyDown);
95
+ }, FLIP_DURATION_MS);
96
+ }
97
+ });
98
+ if (items.length <= 1) {
99
+ prevTopByIdRef.current = currentTopById;
100
+ prevIdsRef.current = currentIds;
101
+ return;
102
+ }
103
+ items.forEach((item) => {
104
+ if (item.id === closingTopId) {
105
+ return;
106
+ }
107
+ const element = itemRefs.current.get(item.id);
108
+ const currentTop = currentTopById.get(item.id);
109
+ const previousTop = prevTopByIdRef.current.get(item.id);
110
+ if (!element || currentTop === undefined || previousTop === undefined) {
111
+ return;
112
+ }
113
+ const deltaY = previousTop - currentTop;
114
+ if (Math.abs(deltaY) <= 1) {
115
+ return;
116
+ }
117
+ element.animate([
118
+ { transform: `translateY(${deltaY}px)` },
119
+ { transform: "translateY(0)" },
120
+ ], { duration: FLIP_DURATION_MS, easing: FLIP_EASING });
121
+ });
122
+ prevTopByIdRef.current = currentTopById;
123
+ prevIdsRef.current = currentIds;
124
+ }, [items, closingTopId]);
125
+ if (items.length === 0) {
126
+ return null;
127
+ }
128
+ return (jsxRuntime.jsx("div", { className: NotificationWrapper_module.default.wrapper, "data-testid": "NotificationWrapper_LIST", children: items.map((notification) => (jsxRuntime.jsx("div", { className: `${NotificationWrapper_module.default.item} ${closingTopId === notification.id ? NotificationWrapper_module.default.flyUp : ""}`, onAnimationEnd: (event) => {
129
+ handleTopAnimationEnd(event, notification.id);
130
+ }, ref: (el) => {
131
+ if (el) {
132
+ itemRefs.current.set(notification.id, el);
133
+ return;
134
+ }
135
+ itemRefs.current.delete(notification.id);
136
+ }, "data-testid": `NotificationWrapper_ITEM_${notification.id}`, children: jsxRuntime.jsx(index.NotificationItem, { text: notification.text, type: notification.type, onClick: () => {
137
+ closeNotification(notification.id);
138
+ } }) }, notification.id))) }));
139
+ };
140
+
141
+ exports.NotificationWrapper = NotificationWrapper;
142
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sources":["../../../../../src/components/Notification/Wrapper/index.tsx"],"sourcesContent":[null],"names":["useState","useRef","useCallback","useEffect","useLayoutEffect","styles","_jsx","NotificationItem"],"mappings":";;;;;;;AAYA,MAAM,mBAAmB,GAAG,IA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AAI,EAAE,YAAY,CAAC,IAAI,EACvB,OAAO,EAAE,MAAK;AACZ,oBAAA,iBAAiB,CAAC,YAAY,CAAC,EAAE,CAAC;gBACpC,CAAC,EAAA,CACD,EAAA,EApBG,YAAY,CAAC,EAAE,CAqBhB,CACP,CAAC,EAAA,CACE;AAEV;;;;"}
@@ -1,58 +1,60 @@
1
1
  'use strict';
2
2
 
3
3
  require('../styles/colors.css.js');
4
- var index$j = require('./ErrorModal/index.js');
5
- var index$o = require('./Identity/Agreement/index.js');
6
- var index$n = require('./Identity/Auth/index.js');
7
- var index$l = require('./Identity/EdsSuccess/index.js');
8
- var index$3 = require('./Identity/HelpInstruction/index.js');
9
- var index$d = require('./Identity/IdentityHeader/index.js');
10
- var index$c = require('./Identity/IdentityModal/index.js');
11
- var index$k = require('./Messages/EmptyMessages/index.js');
12
- var index$g = require('./Messages/HelpNotification/index.js');
13
- var index$f = require('./Messages/HelpNotificationItem/index.js');
14
- var index$b = require('./Messages/MsgBody/index.js');
15
- var index$a = require('./Messages/MsgComponentHeader/index.js');
16
- var index$9 = require('./Messages/MsgSearch/index.js');
17
- var index$4 = require('./Navigation/ViewToggle/index.js');
18
- var index = require('./NotificationComponent/index.js');
19
- var index$2 = require('./Presale/index.js');
20
- var index$m = require('./Profile/DocCard/index.js');
21
- var index$e = require('./Profile/IconToggleItem/index.js');
22
- var index$7 = require('./Profile/ProfileHealthGeneral/index.js');
23
- var index$6 = require('./Profile/RightMenuSectionItem/index.js');
24
- var index$5 = require('./Profile/SetUpAccess/index.js');
25
- var index$1 = require('./ServiceCardComponent/index.js');
26
- var index$i = require('./Services/Feedback/index.js');
27
- var index$h = require('./Services/FileForUpload/index.js');
28
- var index$8 = require('./Services/NextStepComponent/index.js');
4
+ var index$k = require('./ErrorModal/index.js');
5
+ var index$p = require('./Identity/Agreement/index.js');
6
+ var index$o = require('./Identity/Auth/index.js');
7
+ var index$m = require('./Identity/EdsSuccess/index.js');
8
+ var index$4 = require('./Identity/HelpInstruction/index.js');
9
+ var index$e = require('./Identity/IdentityHeader/index.js');
10
+ var index$d = require('./Identity/IdentityModal/index.js');
11
+ var index$l = require('./Messages/EmptyMessages/index.js');
12
+ var index$h = require('./Messages/HelpNotification/index.js');
13
+ var index$g = require('./Messages/HelpNotificationItem/index.js');
14
+ var index$c = require('./Messages/MsgBody/index.js');
15
+ var index$b = require('./Messages/MsgComponentHeader/index.js');
16
+ var index$a = require('./Messages/MsgSearch/index.js');
17
+ var index$5 = require('./Navigation/ViewToggle/index.js');
18
+ var index$1 = require('./Notification/Item/index.js');
19
+ var index = require('./Notification/Wrapper/index.js');
20
+ var index$3 = require('./Presale/index.js');
21
+ var index$n = require('./Profile/DocCard/index.js');
22
+ var index$f = require('./Profile/IconToggleItem/index.js');
23
+ var index$8 = require('./Profile/ProfileHealthGeneral/index.js');
24
+ var index$7 = require('./Profile/RightMenuSectionItem/index.js');
25
+ var index$6 = require('./Profile/SetUpAccess/index.js');
26
+ var index$2 = require('./ServiceCardComponent/index.js');
27
+ var index$j = require('./Services/Feedback/index.js');
28
+ var index$i = require('./Services/FileForUpload/index.js');
29
+ var index$9 = require('./Services/NextStepComponent/index.js');
29
30
 
30
31
  const Components = {
31
- Agreement: index$o.Agreement,
32
- Auth: index$n.Auth,
33
- DocCard: index$m.DocCard,
34
- EdsSuccess: index$l.EdsSuccess,
35
- EmptyMessages: index$k.EmptyMessages,
36
- ErrorModal: index$j.ErrorModal,
37
- Feedback: index$i.Feedback,
38
- FileForUpload: index$h.FileForUpload,
39
- HelpNotification: index$g.HelpNotification,
40
- HelpNotificationItem: index$f.HelpNotificationItem,
41
- IconToggleItem: index$e.IconToggleItem,
42
- IdentityHeader: index$d.IdentityHeader,
43
- IdentityModal: index$c.IdentityModal,
44
- MsgBody: index$b.MsgBody,
45
- MsgComponentHeader: index$a.MsgComponentHeader,
46
- MsgSearch: index$9.MsgSearch,
47
- NextStepComponent: index$8.NextStepComponent,
48
- ProfileHealthGeneral: index$7.ProfileHealthGeneral,
49
- RightMenuSectionItem: index$6.RightMenuSectionItem,
50
- SetUpAccess: index$5.SetUpAccess,
51
- ViewToggle: index$4.ViewToggle,
52
- HelpInstruction: index$3.HelpInstruction,
53
- PresaleComponent: index$2.PresaleComponent,
54
- ServiceCardComponent: index$1.ServiceCardComponent,
55
- NotificationComponent: index.NotificationComponent,
32
+ Agreement: index$p.Agreement,
33
+ Auth: index$o.Auth,
34
+ DocCard: index$n.DocCard,
35
+ EdsSuccess: index$m.EdsSuccess,
36
+ EmptyMessages: index$l.EmptyMessages,
37
+ ErrorModal: index$k.ErrorModal,
38
+ Feedback: index$j.Feedback,
39
+ FileForUpload: index$i.FileForUpload,
40
+ HelpNotification: index$h.HelpNotification,
41
+ HelpNotificationItem: index$g.HelpNotificationItem,
42
+ IconToggleItem: index$f.IconToggleItem,
43
+ IdentityHeader: index$e.IdentityHeader,
44
+ IdentityModal: index$d.IdentityModal,
45
+ MsgBody: index$c.MsgBody,
46
+ MsgComponentHeader: index$b.MsgComponentHeader,
47
+ MsgSearch: index$a.MsgSearch,
48
+ NextStepComponent: index$9.NextStepComponent,
49
+ ProfileHealthGeneral: index$8.ProfileHealthGeneral,
50
+ RightMenuSectionItem: index$7.RightMenuSectionItem,
51
+ SetUpAccess: index$6.SetUpAccess,
52
+ ViewToggle: index$5.ViewToggle,
53
+ HelpInstruction: index$4.HelpInstruction,
54
+ PresaleComponent: index$3.PresaleComponent,
55
+ ServiceCardComponent: index$2.ServiceCardComponent,
56
+ NotificationItem: index$1.NotificationItem,
57
+ NotificationWrapper: index.NotificationWrapper,
56
58
  };
57
59
 
58
60
  exports.Components = Components;
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../../../src/components/index.ts"],"sourcesContent":[null],"names":["Agreement","Auth","DocCard","EdsSuccess","EmptyMessages","ErrorModal","Feedback","FileForUpload","HelpNotification","HelpNotificationItem","IconToggleItem","IdentityHeader","IdentityModal","MsgBody","MsgComponentHeader","MsgSearch","NextStepComponent","ProfileHealthGeneral","RightMenuSectionItem","SetUpAccess","ViewToggle","HelpInstruction","PresaleComponent","ServiceCardComponent","NotificationComponent"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA2BO,MAAM,UAAU,GAAG;eACxBA,iBAAS;UACTC,YAAI;aACJC,eAAO;gBACPC,kBAAU;mBACVC,qBAAa;gBACbC,kBAAU;cACVC,gBAAQ;mBACRC,qBAAa;sBACbC,wBAAgB;0BAChBC,4BAAoB;oBACpBC,sBAAc;oBACdC,sBAAc;mBACdC,qBAAa;aACbC,eAAO;wBACPC,0BAAkB;eAClBC,iBAAS;uBACTC,yBAAiB;0BACjBC,4BAAoB;0BACpBC,4BAAoB;iBACpBC,mBAAW;gBACXC,kBAAU;qBACVC,uBAAe;sBACfC,wBAAgB;0BAChBC,4BAAoB;2BACpBC,2BAAqB;;;;;"}
1
+ {"version":3,"file":"index.js","sources":["../../../src/components/index.ts"],"sourcesContent":[null],"names":["Agreement","Auth","DocCard","EdsSuccess","EmptyMessages","ErrorModal","Feedback","FileForUpload","HelpNotification","HelpNotificationItem","IconToggleItem","IdentityHeader","IdentityModal","MsgBody","MsgComponentHeader","MsgSearch","NextStepComponent","ProfileHealthGeneral","RightMenuSectionItem","SetUpAccess","ViewToggle","HelpInstruction","PresaleComponent","ServiceCardComponent","NotificationItem","NotificationWrapper"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA4BO,MAAM,UAAU,GAAG;eACxBA,iBAAS;UACTC,YAAI;aACJC,eAAO;gBACPC,kBAAU;mBACVC,qBAAa;gBACbC,kBAAU;cACVC,gBAAQ;mBACRC,qBAAa;sBACbC,wBAAgB;0BAChBC,4BAAoB;oBACpBC,sBAAc;oBACdC,sBAAc;mBACdC,qBAAa;aACbC,eAAO;wBACPC,0BAAkB;eAClBC,iBAAS;uBACTC,yBAAiB;0BACjBC,4BAAoB;0BACpBC,4BAAoB;iBACpBC,mBAAW;gBACXC,kBAAU;qBACVC,uBAAe;sBACfC,wBAAgB;0BAChBC,4BAAoB;sBACpBC,wBAAgB;yBAChBC,yBAAmB;;;;;"}
@@ -36,7 +36,7 @@ const BaseFieldInner = ({ value = "", labelText, inputLeftIcon, isClearable, cla
36
36
  handleFocus,
37
37
  handleBlur,
38
38
  handleChange,
39
- })] })] }), isFocused && isClearable && value && (jsx(Icons.General.Clear, { className: styles.clearIcon, onMouseDown: (e) => e.preventDefault(), onClick: handleClear, "data-testid": "Icons_CLEAR" }))] }), hintText && hintText.length > 0 && (jsx("span", { "data-testid": `${dataTestid}_HINT_TEXT`, className: joinClasses(styles.hintText, typography.body2Regular, isError && styles.error), children: hintText }))] }));
39
+ })] })] }), isFocused && isClearable && value && (jsx(Icons.General.Clear, { className: styles.clearIcon, onMouseDown: (e) => e.preventDefault(), onClick: handleClear, "data-testid": "Icons_CLEAR" }))] }), hintText && hintText.length > 0 && (jsx("span", { "data-testid": `${dataTestid}_HINT_TEXT`, className: joinClasses(styles.hintText, typography.caption1Regular, isError && styles.error), children: hintText }))] }));
40
40
  };
41
41
  const BaseField = forwardRef(BaseFieldInner);
42
42
 
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../../../../src/baseComponents/BaseField/index.tsx"],"sourcesContent":[null],"names":["_jsxs","_jsx"],"mappings":";;;;;;;AAqCA,MAAM,cAAc,GAAG,CACrB,EACE,KAAK,GAAG,EAAE,EACV,SAAS,EACT,aAAa,EACb,WAAW,EACX,SAAS,EACT,KAAK,EACL,EAAE,EACF,SAAS,EAAE,iBAAiB,EAC5B,YAAY,EACZ,QAAQ,EACR,UAAU,GAAG,gBAAgB,EAC7B,QAAQ,EACR,OAAO,EACP,QAAQ,GACW,EACrB,GAA8B,KAC5B;IACF,MAAM,CAAC,YAAY,EAAE,eAAe,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC;AACvD,IAAA,MAAM,SAAS,GAAG,iBAAiB,IAAI,YAAY;AAEnD,IAAA,MAAM,YAAY,GAAG,CAAC,CAAC,SAAS,KAAK,SAAS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,qBAAqB,EAAA,aAAA,EAC1B,CAAA,EAAG,UAAU,0BAA0B,EAAA,QAAA,EAAA,CAEnD,YAAY,KACXC,GAAA,CAAA,OAAA,EAAA,EACE,OAAO,EAAE,EAAE,EACX,SAAS,EAAE,WAAW,CACpB,UAAU,CAAC,eAAe,EAC1B,OAAO,IAAI,MAAM,CAAC,KAAK,CACxB,EAAA,QAAA,EAEA,SAAS,EAAA,CACJ,CACT,EACDD,IAAA,CAAA,KAAA,EAAA,EACE,SAAS,EAAE,MAAM,CAAC,kBAAkB,EAAA,aAAA,EACvB,CAAA,EAAG,UAAU,CAAA,qBAAA,CAAuB,EAAA,QAAA,EAAA,CAEhD,aAAa,EACb,QAAQ,CAAC;wCACR,SAAS;AACT,wCAAA,WAAW,EAAE,YAAY;AACzB,wCAAA,iBAAiB,EAAE,uBAAuB;wCAC1C,WAAW;wCACX,UAAU;wCACV,YAAY;AACb,qCAAA,CAAC,IACE,CAAA,EAAA,CACF,EACL,SAAS,IAAI,WAAW,IAAI,KAAK,KAChCC,IAAC,KAAK,CAAC,OAAO,CAAC,KAAK,IAClB,SAAS,EAAE,MAAM,CAAC,SAAS,EAC3B,WAAW,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,cAAc,EAAE,EACtC,OAAO,EAAE,WAAW,iBACR,aAAa,EAAA,CACzB,CACH,CAAA,EAAA,CACG,EACL,QAAQ,IAAI,QAAQ,CAAC,MAAM,GAAG,CAAC,KAC9BA,6BACe,CAAA,EAAG,UAAU,YAAY,EACtC,SAAS,EAAE,WAAW,CACpB,MAAM,CAAC,QAAQ,EACf,UAAU,CAAC,YAAY,EACvB,OAAO,IAAI,MAAM,CAAC,KAAK,CACxB,EAAA,QAAA,EAEA,QAAQ,GACJ,CACR,CAAA,EAAA,CACG;AAEV,CAAC;MAEY,SAAS,GAAG,UAAU,CAAC,cAAc;;;;"}
1
+ {"version":3,"file":"index.js","sources":["../../../../src/baseComponents/BaseField/index.tsx"],"sourcesContent":[null],"names":["_j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cAAc,EAAE,EACtC,OAAO,EAAE,WAAW,iBACR,aAAa,EAAA,CACzB,CACH,CAAA,EAAA,CACG,EACL,QAAQ,IAAI,QAAQ,CAAC,MAAM,GAAG,CAAC,KAC9BA,6BACe,CAAA,EAAG,UAAU,YAAY,EACtC,SAAS,EAAE,WAAW,CACpB,MAAM,CAAC,QAAQ,EACf,UAAU,CAAC,eAAe,EAC1B,OAAO,IAAI,MAAM,CAAC,KAAK,CACxB,EAAA,QAAA,EAEA,QAAQ,GACJ,CACR,CAAA,EAAA,CACG;AAEV,CAAC;MAEY,SAAS,GAAG,UAAU,CAAC,cAAc;;;;"}
@@ -0,0 +1,18 @@
1
+ var css_248z = ".NotificationComponent-module_snackbar__PtpSi {\n padding: 16px 20px;\n border-radius: 12px;\n display: flex;\n justify-content: space-between;\n align-items: center;\n gap: 12px;\n z-index: 1000;\n box-shadow: 0px 12px 32px 0px rgba(128, 130, 136, 0.12);\n}\n\n.NotificationComponent-module_snackbar__PtpSi .NotificationComponent-module_text__jVDme {\n color: var(--text-white-nonconvert-color);\n}\n\n.NotificationComponent-module_success__z-Mvq {\n background-color: var(--icon-success);\n}\n\n.NotificationComponent-module_error__-9ZE1 {\n background-color: var(--icon-error-color);\n}\n\n.NotificationComponent-module_info__qSq09 {\n background-color: var(--icon-accent-color);\n}\n\n.NotificationComponent-module_warning__A3bKG {\n background-color: var(--icon-warning-color);\n}\n";
2
+ var styles = {"snackbar":"NotificationComponent-module_snackbar__PtpSi","text":"NotificationComponent-module_text__jVDme","success":"NotificationComponent-module_success__z-Mvq","error":"NotificationComponent-module_error__-9ZE1","info":"NotificationComponent-module_info__qSq09","warning":"NotificationComponent-module_warning__A3bKG"};
3
+ function styleInject(css, options) {
4
+ if (typeof document === 'undefined') return;
5
+ const head = document.head || document.getElementsByTagName('head')[0];
6
+ const style = document.createElement('style');
7
+ style.type = 'text/css';
8
+ if (style.styleSheet) {
9
+ style.styleSheet.cssText = css;
10
+ } else {
11
+ style.appendChild(document.createTextNode(css));
12
+ }
13
+ head.appendChild(style);
14
+ }
15
+ styleInject(css_248z);
16
+
17
+ export { styles as default };
18
+ //# sourceMappingURL=NotificationComponent.module.css.js.map
@@ -0,0 +1,20 @@
1
+ import { jsxs, jsx } from 'react/jsx-runtime';
2
+ import { Icons } from '@egov3/graphics';
3
+ import { BaseComponents } from '../../../baseComponents/index.js';
4
+ import { joinClasses } from '../../../utils/joinClasses.js';
5
+ import { toPascalCase } from '../../../utils/string/toPascalCase.js';
6
+ import styles from './NotificationComponent.module.css.js';
7
+
8
+ const notificationIconTypes = {
9
+ success: Icons.Basic.Check,
10
+ error: Icons.General.Clear,
11
+ warning: Icons.General.WarningFilled,
12
+ info: Icons.General.InfoFilled,
13
+ };
14
+ const NotificationItem = ({ type = "info", text, onClick, }) => {
15
+ const Icon = notificationIconTypes[type];
16
+ return (jsxs("button", { type: "button", onClick: onClick, className: joinClasses(styles.snackbar, styles[type]), "data-testid": "NotificationComponent_SNACKBAR", children: [jsx(Icon, { fill: "var(--icon-white-nonconvert-color)", "data-testid": `NotificationComponentIcon_${toPascalCase(type)}` }), jsx(BaseComponents.Typography, { "aria-label": text, className: styles.text, "data-testid": "NotificationComponent_TEXT", fontClass: "body2Regular", tag: "span", children: text })] }));
17
+ };
18
+
19
+ export { NotificationItem };
20
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sources":["../../../../../src/components/Notification/Item/index.tsx"],"sourcesContent":[null],"names":["_jsxs","_jsx"],"mappings":";;;;;;;AASA,MAAM,qBAAqB,GAAG;AAC5B,IAAA,OAAO,EAAE,KAAK,CAAC,KAAK,CAAC,KAAK;AAC1B,IAAA,KAAK,EAAE,KAAK,CAAC,OAAO,CAAC,KAAK;AAC1B,IAAA,OAAO,EAAE,KAAK,CAAC,OAAO,CAAC,aAAa;AACpC,IAAA,IAAI,EAAE,KAAK,CAAC,OAAO,CAAC,UAAU;CAI/B;AAQM,MAAM,gBAAgB,GAAG,CAAC,EAC/B,IAAI,GAAG,MAAM,EACb,IAAI,EACJ,OAAO,GACqB,KAAI;AAChC,IAAA,MAAM,IAAI,GAAG,qBAAqB,CAAC,IAAI,CAAC;AAExC,IAAA,QACEA,IAAA,CAAA,QAAA,EAAA,EACE,IAAI,EAAC,QAAQ,EACb,OAAO,EAAE,OAAO,EAChB,SAAS,EAAE,WAAW,CAAC,MAAM,CAAC,QAAQ,EAAE,MAAM,CAAC,IAAI,CAAC,CAAC,EAAA,aAAA,EACzC,gCAAgC,EAAA,QAAA,EAAA,CAE5CC,GAAA,CAAC,IAAI,EAAA,EACH,IAAI,EAAC,oCAAoC,EAAA,aAAA,EAC5B,CAAA,0BAAA,EAA6B,YAAY,CAAC,IAAI,CAAC,CAAA,CAAE,EAAA,CAC9D,EACFA,GAAA,CAAC,cAAc,CAAC,UAAU,EAAA,EAAA,YAAA,EACZ,IAAI,EAChB,SAAS,EAAE,MAAM,CAAC,IAAI,EAAA,aAAA,EACV,4BAA4B,EACxC,SAAS,EAAC,cAAc,EACxB,GAAG,EAAC,MAAM,EAAA,QAAA,EAET,IAAI,EAAA,CACqB,CAAA,EAAA,CACrB;AAEb;;;;"}
@@ -0,0 +1,18 @@
1
+ var css_248z = ".NotificationWrapper-module_wrapper__uK2xb {\n position: fixed;\n top: 24px;\n left: 50%;\n transform: translateX(-50%);\n\n display: flex;\n flex-direction: column;\n justify-content: center;\n align-items: center;\n gap: 16px;\n z-index: 1000;\n}\n\n.NotificationWrapper-module_item__45Lg0 {\n will-change: transform, opacity;\n}\n\n.NotificationWrapper-module_flyDown__mntT4 {\n animation: NotificationWrapper-module_flyDown__mntT4 300ms ease-in-out;\n}\n\n.NotificationWrapper-module_flyUp__a5Sa9 {\n animation: NotificationWrapper-module_flyUp__a5Sa9 300ms ease-in-out;\n animation-fill-mode: forwards;\n pointer-events: none;\n}\n\n@keyframes NotificationWrapper-module_flyDown__mntT4 {\n from {\n transform: translateY(-100px);\n opacity: 0;\n }\n to {\n transform: translateY(0);\n opacity: 1;\n }\n}\n\n@keyframes NotificationWrapper-module_flyUp__a5Sa9 {\n from {\n transform: translateY(0);\n opacity: 1;\n }\n to {\n transform: translateY(-100px);\n opacity: 0;\n }\n}\n";
2
+ var styles = {"wrapper":"NotificationWrapper-module_wrapper__uK2xb","item":"NotificationWrapper-module_item__45Lg0","flyDown":"NotificationWrapper-module_flyDown__mntT4","flyUp":"NotificationWrapper-module_flyUp__a5Sa9"};
3
+ function styleInject(css, options) {
4
+ if (typeof document === 'undefined') return;
5
+ const head = document.head || document.getElementsByTagName('head')[0];
6
+ const style = document.createElement('style');
7
+ style.type = 'text/css';
8
+ if (style.styleSheet) {
9
+ style.styleSheet.cssText = css;
10
+ } else {
11
+ style.appendChild(document.createTextNode(css));
12
+ }
13
+ head.appendChild(style);
14
+ }
15
+ styleInject(css_248z);
16
+
17
+ export { styles as default };
18
+ //# sourceMappingURL=NotificationWrapper.module.css.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"NotificationWrapper.module.css.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;"}
@@ -0,0 +1,140 @@
1
+ import { jsx } from 'react/jsx-runtime';
2
+ import { useState, useRef, useCallback, useEffect, useLayoutEffect } from 'react';
3
+ import { NotificationItem } from '../Item/index.js';
4
+ import styles from './NotificationWrapper.module.css.js';
5
+
6
+ const AUTO_CLOSE_DELAY_MS = 7000;
7
+ const FLIP_DURATION_MS = 300;
8
+ const FLIP_EASING = "ease-in-out";
9
+ const NotificationWrapper = ({ items, removeNotificationData, }) => {
10
+ const [closingTopId, setClosingTopId] = useState(null);
11
+ const topNotificationId = items[0]?.id ?? null;
12
+ const topNotificationIdRef = useRef(null);
13
+ const closeTimersRef = useRef(new Map());
14
+ const itemRefs = useRef(new Map());
15
+ const prevTopByIdRef = useRef(new Map());
16
+ const prevIdsRef = useRef(new Set());
17
+ const clearCloseTimer = useCallback((id) => {
18
+ const timer = closeTimersRef.current.get(id);
19
+ if (!timer) {
20
+ return;
21
+ }
22
+ clearTimeout(timer);
23
+ closeTimersRef.current.delete(id);
24
+ }, []);
25
+ const removeNotification = useCallback((id) => {
26
+ clearCloseTimer(id);
27
+ removeNotificationData(id);
28
+ }, [clearCloseTimer, removeNotificationData]);
29
+ const startTopCloseAnimation = useCallback((id) => {
30
+ clearCloseTimer(id);
31
+ setClosingTopId((current) => (current === id ? current : id));
32
+ }, [clearCloseTimer]);
33
+ const closeNotification = useCallback((id) => {
34
+ if (id !== topNotificationId) {
35
+ removeNotification(id);
36
+ return;
37
+ }
38
+ startTopCloseAnimation(id);
39
+ }, [topNotificationId, startTopCloseAnimation, removeNotification]);
40
+ const handleTopAnimationEnd = useCallback((event, id) => {
41
+ if (event.currentTarget !== event.target || closingTopId !== id) {
42
+ return;
43
+ }
44
+ removeNotification(id);
45
+ setClosingTopId(null);
46
+ }, [closingTopId, removeNotification]);
47
+ useEffect(() => {
48
+ topNotificationIdRef.current = topNotificationId;
49
+ }, [topNotificationId]);
50
+ useEffect(() => {
51
+ items.forEach((item) => {
52
+ if (closeTimersRef.current.has(item.id)) {
53
+ return;
54
+ }
55
+ const timer = setTimeout(() => {
56
+ if (topNotificationIdRef.current === item.id) {
57
+ startTopCloseAnimation(item.id);
58
+ return;
59
+ }
60
+ removeNotification(item.id);
61
+ }, AUTO_CLOSE_DELAY_MS);
62
+ closeTimersRef.current.set(item.id, timer);
63
+ });
64
+ const currentIds = new Set(items.map((item) => item.id));
65
+ closeTimersRef.current.forEach((timer, id) => {
66
+ if (currentIds.has(id)) {
67
+ return;
68
+ }
69
+ clearTimeout(timer);
70
+ closeTimersRef.current.delete(id);
71
+ });
72
+ }, [items, startTopCloseAnimation, removeNotification]);
73
+ useEffect(() => () => {
74
+ closeTimersRef.current.forEach((timer) => {
75
+ clearTimeout(timer);
76
+ });
77
+ closeTimersRef.current.clear();
78
+ }, []);
79
+ useLayoutEffect(() => {
80
+ const currentTopById = new Map();
81
+ const currentIds = new Set(items.map((item) => item.id));
82
+ items.forEach((item) => {
83
+ const element = itemRefs.current.get(item.id);
84
+ if (!element) {
85
+ return;
86
+ }
87
+ currentTopById.set(item.id, element.getBoundingClientRect().top);
88
+ const isNewItem = !prevIdsRef.current.has(item.id);
89
+ if (isNewItem) {
90
+ element.classList.add(styles.flyDown);
91
+ globalThis.setTimeout(() => {
92
+ element.classList.remove(styles.flyDown);
93
+ }, FLIP_DURATION_MS);
94
+ }
95
+ });
96
+ if (items.length <= 1) {
97
+ prevTopByIdRef.current = currentTopById;
98
+ prevIdsRef.current = currentIds;
99
+ return;
100
+ }
101
+ items.forEach((item) => {
102
+ if (item.id === closingTopId) {
103
+ return;
104
+ }
105
+ const element = itemRefs.current.get(item.id);
106
+ const currentTop = currentTopById.get(item.id);
107
+ const previousTop = prevTopByIdRef.current.get(item.id);
108
+ if (!element || currentTop === undefined || previousTop === undefined) {
109
+ return;
110
+ }
111
+ const deltaY = previousTop - currentTop;
112
+ if (Math.abs(deltaY) <= 1) {
113
+ return;
114
+ }
115
+ element.animate([
116
+ { transform: `translateY(${deltaY}px)` },
117
+ { transform: "translateY(0)" },
118
+ ], { duration: FLIP_DURATION_MS, easing: FLIP_EASING });
119
+ });
120
+ prevTopByIdRef.current = currentTopById;
121
+ prevIdsRef.current = currentIds;
122
+ }, [items, closingTopId]);
123
+ if (items.length === 0) {
124
+ return null;
125
+ }
126
+ return (jsx("div", { className: styles.wrapper, "data-testid": "NotificationWrapper_LIST", children: items.map((notification) => (jsx("div", { className: `${styles.item} ${closingTopId === notification.id ? styles.flyUp : ""}`, onAnimationEnd: (event) => {
127
+ handleTopAnimationEnd(event, notification.id);
128
+ }, ref: (el) => {
129
+ if (el) {
130
+ itemRefs.current.set(notification.id, el);
131
+ return;
132
+ }
133
+ itemRefs.current.delete(notification.id);
134
+ }, "data-testid": `NotificationWrapper_ITEM_${notification.id}`, children: jsx(NotificationItem, { text: notification.text, type: notification.type, onClick: () => {
135
+ closeNotification(notification.id);
136
+ } }) }, notification.id))) }));
137
+ };
138
+
139
+ export { NotificationWrapper };
140
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sources":["../../../../../src/components/Notification/Wrapper/index.tsx"],"sourcesContent":[null],"names":["_jsx"],"mappings":";;;;;AAYA,MAAM,mBAAmB,GAAG,IAAI;AAChC,MAAM,gBAAgB,GAAG,GAAG;AAC5B,MAAM,WAAW,GAAG,aAAa;AAO1B,MAAM,mBAAmB,GAAG,CAAC,EAClC,KAAK,EACL,sBAAsB,GACI,KAAI;IAC9B,MAAM,CAAC,YAAY,EAAE,eAAe,CAAC,GAAG,QAAQ,CAAgB,IAAI,CAAC;IACrE,MAAM,iBAAiB,GAAG,KAAK,CAAC,CAAC,CAAC,EAAE,EAAE,IAAI,IAAI;AAE9C,IAAA,MAAM,oBAAoB,GAAG,MAAM,CAAgB,IAAI,CAAC;IACxD,MAAM,cAAc,GAAG,MAAM,CAC3B,IAAI,GAAG,EAAE,CACV;IAED,MAAM,QAAQ,GAAG,MAAM,CAA8B,IAAI,GAAG,EAAE,CAAC;IAC/D,MAAM,cAAc,GAAG,MAAM,CAAsB,IAAI,GAAG,EAAE,CAAC;IAC7D,MAAM,UAAU,GAAG,MAAM,CAAc,IAAI,GAAG,EAAE,CAAC;AAEjD,IAAA,MAAM,eAAe,GAAG,WAAW,CAAC,CAAC,EAAU,KAAI;QACjD,MAAM,KAAK,GAAG,cAAc,CAAC,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC;QAC5C,IAAI,CAAC,KAAK,EAAE;YACV;AACD,QAAA;QACD,YAAY,CAAC,KAAK,CAAC;AACnB,QAAA,cAAc,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE,CAAC;IACnC,CAAC,EAAE,EAAE,CAAC;AAEN,IAAA,MAAM,kBAAkB,GAAG,WAAW,CACpC,CAAC,EAAU,KAAI;QACb,eAAe,CAAC,EAAE,CAAC;QACnB,sBAAsB,CAAC,EAAE,CAAC;AAC5B,IAAA,CAAC,E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C,CAAC,EAAA,aAAA,EACY,CAAA,yBAAA,EAA4B,YAAY,CAAC,EAAE,EAAE,EAAA,QAAA,EAE1DA,GAAA,CAAC,gBAAgB,EAAA,EACf,IAAI,EAAE,YAAY,CAAC,IAAI,EACvB,IAAI,EAAE,YAAY,CAAC,IAAI,EACvB,OAAO,EAAE,MAAK;AACZ,oBAAA,iBAAiB,CAAC,YAAY,CAAC,EAAE,CAAC;gBACpC,CAAC,EAAA,CACD,EAAA,EApBG,YAAY,CAAC,EAAE,CAqBhB,CACP,CAAC,EAAA,CACE;AAEV;;;;"}
@@ -13,7 +13,8 @@ import { MsgBody } from './Messages/MsgBody/index.js';
13
13
  import { MsgComponentHeader } from './Messages/MsgComponentHeader/index.js';
14
14
  import { MsgSearch } from './Messages/MsgSearch/index.js';
15
15
  import { ViewToggle } from './Navigation/ViewToggle/index.js';
16
- import { NotificationComponent } from './NotificationComponent/index.js';
16
+ import { NotificationItem } from './Notification/Item/index.js';
17
+ import { NotificationWrapper } from './Notification/Wrapper/index.js';
17
18
  import { PresaleComponent } from './Presale/index.js';
18
19
  import { DocCard } from './Profile/DocCard/index.js';
19
20
  import { IconToggleItem } from './Profile/IconToggleItem/index.js';
@@ -50,7 +51,8 @@ const Components = {
50
51
  HelpInstruction,
51
52
  PresaleComponent,
52
53
  ServiceCardComponent,
53
- NotificationComponent,
54
+ NotificationItem,
55
+ NotificationWrapper,
54
56
  };
55
57
 
56
58
  export { Components };
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../../../src/components/index.ts"],"sourcesContent":[null],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AA2BO,MAAM,UAAU,GAAG;IACxB,SAAS;IACT,IAAI;IACJ,OAAO;IACP,UAAU;IACV,aAAa;IACb,UAAU;IACV,QAAQ;IACR,aAAa;IACb,gBAAgB;IAChB,oBAAoB;IACpB,cAAc;IACd,cAAc;IACd,aAAa;IACb,OAAO;IACP,kBAAkB;IAClB,SAAS;IACT,iBAAiB;IACjB,oBAAoB;IACpB,oBAAoB;IACpB,WAAW;IACX,UAAU;IACV,eAAe;IACf,gBAAgB;IAChB,oBAAoB;IACpB,qBAAqB;;;;;"}
1
+ {"version":3,"file":"index.js","sources":["../../../src/components/index.ts"],"sourcesContent":[null],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AA4BO,MAAM,UAAU,GAAG;IACxB,SAAS;IACT,IAAI;IACJ,OAAO;IACP,UAAU;IACV,aAAa;IACb,UAAU;IACV,QAAQ;IACR,aAAa;IACb,gBAAgB;IAChB,oBAAoB;IACpB,cAAc;IACd,cAAc;IACd,aAAa;IACb,OAAO;IACP,kBAAkB;IAClB,SAAS;IACT,iBAAiB;IACjB,oBAAoB;IACpB,oBAAoB;IACpB,WAAW;IACX,UAAU;IACV,eAAe;IACf,gBAAgB;IAChB,oBAAoB;IACpB,gBAAgB;IAChB,mBAAmB;;;;;"}
@@ -2,7 +2,7 @@ type TNotificationType = "success" | "error" | "warning" | "info";
2
2
  interface INotificationComponentProps {
3
3
  text: string;
4
4
  type?: TNotificationType;
5
- toggleNotification: (open: boolean) => void;
5
+ onClick?: () => void;
6
6
  }
7
7
 
8
8
  export type { INotificationComponentProps, TNotificationType };
@@ -0,0 +1,8 @@
1
+ import { INotificationData } from '../../../interfaces/Notification.js';
2
+
3
+ interface INotificationWrapperProps {
4
+ items: INotificationData[];
5
+ removeNotificationData: (id: string) => void;
6
+ }
7
+
8
+ export type { INotificationWrapperProps };
@@ -0,0 +1,8 @@
1
+ declare const NotificationTypeObj: {
2
+ readonly success: "success";
3
+ readonly error: "error";
4
+ readonly warning: "warning";
5
+ readonly info: "info";
6
+ };
7
+
8
+ export { NotificationTypeObj };
@@ -1,4 +1,5 @@
1
- import { INotificationComponentProps } from './components/NotificationComponent/index.js';
1
+ import { INotificationWrapperProps } from './components/Notification/Wrapper/index.js';
2
+ import { INotificationComponentProps } from './components/Notification/Item/index.js';
2
3
  import { IServiceCardComponentProps } from './components/ServiceCardComponent/index.js';
3
4
  import { IAccordionTitleProps } from './components/Presale/AccordionTitle/index.js';
4
5
  import { IServiceDetailsProps } from './components/Presale/ServiceDetails/index.js';
@@ -96,7 +97,8 @@ declare const SystemDesign: {
96
97
  AccordionTitle: ({ title }: IAccordionTitleProps) => react_jsx_runtime.JSX.Element;
97
98
  };
98
99
  ServiceCardComponent: ({ handleOrderService, badge, isNew, title, }: IServiceCardComponentProps) => react_jsx_runtime.JSX.Element;
99
- NotificationComponent: ({ type, text, toggleNotification, }: INotificationComponentProps) => react_jsx_runtime.JSX.Element;
100
+ NotificationItem: ({ type, text, onClick, }: INotificationComponentProps) => react_jsx_runtime.JSX.Element;
101
+ NotificationWrapper: ({ items, removeNotificationData, }: INotificationWrapperProps) => react_jsx_runtime.JSX.Element | null;
100
102
  };
101
103
  };
102
104
 
@@ -0,0 +1,11 @@
1
+ import { NotificationTypeObj } from '../constants/Notification.js';
2
+
3
+ type TNotificationType = keyof typeof NotificationTypeObj;
4
+ interface INotificationData {
5
+ id: string;
6
+ isOpen: boolean;
7
+ text: string;
8
+ type: TNotificationType;
9
+ }
10
+
11
+ export type { INotificationData, TNotificationType };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@egov3/system-design",
3
- "version": "1.3.112",
3
+ "version": "1.3.119",
4
4
  "type": "module",
5
5
  "main": "dist/cjs/index.js",
6
6
  "types": "dist/types/index.d.ts",
@@ -1,22 +0,0 @@
1
- 'use strict';
2
-
3
- Object.defineProperty(exports, '__esModule', { value: true });
4
-
5
- var css_248z = ".NotificationComponent-module_snackbar__KQKHo {\n position: fixed;\n top: 24px;\n left: 50%;\n transform: translateX(-50%);\n padding: 16px 20px;\n border-radius: 12px;\n display: flex;\n justify-content: space-between;\n align-items: center;\n gap: 12px;\n z-index: 1000;\n box-shadow: 0px 12px 32px 0px rgba(128, 130, 136, 0.12);\n}\n\n.NotificationComponent-module_snackbar__KQKHo .NotificationComponent-module_text__YNCyD {\n color: var(--text-white-nonconvert-color);\n}\n\n.NotificationComponent-module_success__CSgbV {\n background-color: var(--icon-success);\n}\n\n.NotificationComponent-module_error__xiTCd {\n background-color: var(--icon-error-color);\n}\n\n.NotificationComponent-module_info__45pPe {\n background-color: var(--icon-accent-color);\n}\n\n.NotificationComponent-module_warning__wNp3m {\n background-color: var(--icon-warning-color);\n}\n";
6
- var styles = {"snackbar":"NotificationComponent-module_snackbar__KQKHo","text":"NotificationComponent-module_text__YNCyD","success":"NotificationComponent-module_success__CSgbV","error":"NotificationComponent-module_error__xiTCd","info":"NotificationComponent-module_info__45pPe","warning":"NotificationComponent-module_warning__wNp3m"};
7
- function styleInject(css, options) {
8
- if (typeof document === 'undefined') return;
9
- const head = document.head || document.getElementsByTagName('head')[0];
10
- const style = document.createElement('style');
11
- style.type = 'text/css';
12
- if (style.styleSheet) {
13
- style.styleSheet.cssText = css;
14
- } else {
15
- style.appendChild(document.createTextNode(css));
16
- }
17
- head.appendChild(style);
18
- }
19
- styleInject(css_248z);
20
-
21
- exports.default = styles;
22
- //# sourceMappingURL=NotificationComponent.module.css.js.map
@@ -1,29 +0,0 @@
1
- 'use strict';
2
-
3
- var jsxRuntime = require('react/jsx-runtime');
4
- var graphics = require('@egov3/graphics');
5
- var React = require('react');
6
- var index = require('../../baseComponents/index.js');
7
- var joinClasses = require('../../utils/joinClasses.js');
8
- var toPascalCase = require('../../utils/string/toPascalCase.js');
9
- var NotificationComponent_module = require('./NotificationComponent.module.css.js');
10
-
11
- const notificationIconTypes = {
12
- success: graphics.Icons.Basic.Check,
13
- error: graphics.Icons.General.Clear,
14
- warning: graphics.Icons.General.WarningFilled,
15
- info: graphics.Icons.General.InfoFilled,
16
- };
17
- const NotificationComponent = ({ type = "info", text, toggleNotification, }) => {
18
- const Icon = notificationIconTypes[type];
19
- React.useEffect(() => {
20
- const timer = setTimeout(() => {
21
- toggleNotification(false);
22
- }, 5000);
23
- return () => clearTimeout(timer);
24
- }, [toggleNotification]);
25
- return (jsxRuntime.jsxs("div", { className: joinClasses.joinClasses(NotificationComponent_module.default.snackbar, NotificationComponent_module.default[type]), "data-testid": "NotificationComponent_SNACKBAR", children: [jsxRuntime.jsx(Icon, { fill: "var(--icon-white-nonconvert-color)", "data-testid": `NotificationComponentIcon_${toPascalCase.toPascalCase(type)}` }), jsxRuntime.jsx(index.BaseComponents.Typography, { "aria-label": text, className: NotificationComponent_module.default.text, "data-testid": "NotificationComponent_TEXT", fontClass: "body2Regular", tag: "span", children: text })] }));
26
- };
27
-
28
- exports.NotificationComponent = NotificationComponent;
29
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sources":["../../../../src/components/NotificationComponent/index.tsx"],"sourcesContent":[null],"names":["Icons","useEffect","_jsxs","joinClasses","styles","_jsx","toPascalCase","BaseComponents"],"mappings":";;;;;;;;;;AASA,MAAM,qBAAqB,GAAG;AAC5B,IAAA,OAAO,EAAEA,cAAK,CAAC,KAAK,CAAC,KAAK;AAC1B,IAAA,KAAK,EAAEA,cAAK,CAAC,OAAO,CAAC,KAAK;AAC1B,IAAA,OAAO,EAAEA,cAAK,CAAC,OAAO,CAAC,aAAa;AACpC,IAAA,IAAI,EAAEA,cAAK,CAAC,OAAO,CAAC,UAAU;CAI/B;AAQM,MAAM,qBAAqB,GAAG,CAAC,EACpC,IAAI,GAAG,MAAM,EACb,IAAI,EACJ,kBAAkB,GACU,KAAI;AAChC,IAAA,MAAM,IAAI,GAAG,qBAAqB,CAAC,IAAI,CAAC;IAExCC,eAAS,CAAC,MAAK;AACb,QAAA,MAAM,KAAK,GAAG,UAAU,CAAC,MAAK;YAC5B,kBAAkB,CAAC,KAAK,CAAC;QAC3B,CAAC,EAAE,IAAI,CAAC;AAER,QAAA,OAAO,MAAM,YAAY,CAAC,KAAK,CAAC;AAClC,IAAA,CAAC,EAAE,CAAC,kBAAkB,CAAC,CAAC;AAExB,IAAA,QACEC,eAAA,CAAA,KAAA,EAAA,EACE,SAAS,EAAEC,uBAAW,CAACC,oCAAM,CAAC,QAAQ,EAAEA,oCAAM,CAAC,IAAI,CAAC,CAAC,EAAA,aAAA,EACzC,gCAAgC,EAAA,QAAA,EAAA,CAE5CC,cAAA,CAAC,IAAI,EAAA,EACH,IAAI,EAAC,oCAAoC,EAAA,aAAA,EAC5B,CAAA,0BAAA,EAA6BC,yBAAY,CAAC,IAAI,CAAC,CAAA,CAAE,EAAA,CAC9D,EACFD,cAAA,CAACE,oBAAc,CAAC,UAAU,EAAA,EAAA,YAAA,EACZ,IAAI,EAChB,SAAS,EAAEH,oCAAM,CAAC,IAAI,EAAA,aAAA,EACV,4BAA4B,EACxC,SAAS,EAAC,cAAc,EACxB,GAAG,EAAC,MAAM,EAAA,QAAA,EAET,IAAI,EAAA,CACqB,CAAA,EAAA,CACxB;AAEV;;;;"}
@@ -1,18 +0,0 @@
1
- var css_248z = ".NotificationComponent-module_snackbar__KQKHo {\n position: fixed;\n top: 24px;\n left: 50%;\n transform: translateX(-50%);\n padding: 16px 20px;\n border-radius: 12px;\n display: flex;\n justify-content: space-between;\n align-items: center;\n gap: 12px;\n z-index: 1000;\n box-shadow: 0px 12px 32px 0px rgba(128, 130, 136, 0.12);\n}\n\n.NotificationComponent-module_snackbar__KQKHo .NotificationComponent-module_text__YNCyD {\n color: var(--text-white-nonconvert-color);\n}\n\n.NotificationComponent-module_success__CSgbV {\n background-color: var(--icon-success);\n}\n\n.NotificationComponent-module_error__xiTCd {\n background-color: var(--icon-error-color);\n}\n\n.NotificationComponent-module_info__45pPe {\n background-color: var(--icon-accent-color);\n}\n\n.NotificationComponent-module_warning__wNp3m {\n background-color: var(--icon-warning-color);\n}\n";
2
- var styles = {"snackbar":"NotificationComponent-module_snackbar__KQKHo","text":"NotificationComponent-module_text__YNCyD","success":"NotificationComponent-module_success__CSgbV","error":"NotificationComponent-module_error__xiTCd","info":"NotificationComponent-module_info__45pPe","warning":"NotificationComponent-module_warning__wNp3m"};
3
- function styleInject(css, options) {
4
- if (typeof document === 'undefined') return;
5
- const head = document.head || document.getElementsByTagName('head')[0];
6
- const style = document.createElement('style');
7
- style.type = 'text/css';
8
- if (style.styleSheet) {
9
- style.styleSheet.cssText = css;
10
- } else {
11
- style.appendChild(document.createTextNode(css));
12
- }
13
- head.appendChild(style);
14
- }
15
- styleInject(css_248z);
16
-
17
- export { styles as default };
18
- //# sourceMappingURL=NotificationComponent.module.css.js.map
@@ -1,27 +0,0 @@
1
- import { jsxs, jsx } from 'react/jsx-runtime';
2
- import { Icons } from '@egov3/graphics';
3
- import { useEffect } from 'react';
4
- import { BaseComponents } from '../../baseComponents/index.js';
5
- import { joinClasses } from '../../utils/joinClasses.js';
6
- import { toPascalCase } from '../../utils/string/toPascalCase.js';
7
- import styles from './NotificationComponent.module.css.js';
8
-
9
- const notificationIconTypes = {
10
- success: Icons.Basic.Check,
11
- error: Icons.General.Clear,
12
- warning: Icons.General.WarningFilled,
13
- info: Icons.General.InfoFilled,
14
- };
15
- const NotificationComponent = ({ type = "info", text, toggleNotification, }) => {
16
- const Icon = notificationIconTypes[type];
17
- useEffect(() => {
18
- const timer = setTimeout(() => {
19
- toggleNotification(false);
20
- }, 5000);
21
- return () => clearTimeout(timer);
22
- }, [toggleNotification]);
23
- return (jsxs("div", { className: joinClasses(styles.snackbar, styles[type]), "data-testid": "NotificationComponent_SNACKBAR", children: [jsx(Icon, { fill: "var(--icon-white-nonconvert-color)", "data-testid": `NotificationComponentIcon_${toPascalCase(type)}` }), jsx(BaseComponents.Typography, { "aria-label": text, className: styles.text, "data-testid": "NotificationComponent_TEXT", fontClass: "body2Regular", tag: "span", children: text })] }));
24
- };
25
-
26
- export { NotificationComponent };
27
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sources":["../../../../src/components/NotificationComponent/index.tsx"],"sourcesContent":[null],"names":["_jsxs","_jsx"],"mappings":";;;;;;;;AASA,MAAM,qBAAqB,GAAG;AAC5B,IAAA,OAAO,EAAE,KAAK,CAAC,K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