@egov3/system-design 1.3.120 → 1.3.122

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 (31) hide show
  1. package/dist/cjs/components/Calendar/Body/CalendarBody.module.css.js +22 -0
  2. package/dist/cjs/components/Calendar/Body/CalendarBody.module.css.js.map +1 -0
  3. package/dist/cjs/components/Calendar/Body/index.js +34 -0
  4. package/dist/cjs/components/Calendar/Body/index.js.map +1 -0
  5. package/dist/cjs/components/index.js +54 -52
  6. package/dist/cjs/components/index.js.map +1 -1
  7. package/dist/cjs/customHooks/useCalendar.js +46 -0
  8. package/dist/cjs/customHooks/useCalendar.js.map +1 -0
  9. package/dist/cjs/utils/date/getDaysInMonth.js +8 -0
  10. package/dist/cjs/utils/date/getDaysInMonth.js.map +1 -0
  11. package/dist/cjs/utils/date/getMonthNameProper.js +13 -0
  12. package/dist/cjs/utils/date/getMonthNameProper.js.map +1 -0
  13. package/dist/cjs/utils/date/index.js +9 -0
  14. package/dist/cjs/utils/date/index.js.map +1 -0
  15. package/dist/esm/components/Calendar/Body/CalendarBody.module.css.js +18 -0
  16. package/dist/esm/components/Calendar/Body/CalendarBody.module.css.js.map +1 -0
  17. package/dist/esm/components/Calendar/Body/index.js +32 -0
  18. package/dist/esm/components/Calendar/Body/index.js.map +1 -0
  19. package/dist/esm/components/index.js +2 -0
  20. package/dist/esm/components/index.js.map +1 -1
  21. package/dist/esm/customHooks/useCalendar.js +44 -0
  22. package/dist/esm/customHooks/useCalendar.js.map +1 -0
  23. package/dist/esm/utils/date/getDaysInMonth.js +6 -0
  24. package/dist/esm/utils/date/getDaysInMonth.js.map +1 -0
  25. package/dist/esm/utils/date/getMonthNameProper.js +11 -0
  26. package/dist/esm/utils/date/getMonthNameProper.js.map +1 -0
  27. package/dist/esm/utils/date/index.js +7 -0
  28. package/dist/esm/utils/date/index.js.map +1 -0
  29. package/dist/types/components/Calendar/Body/index.d.ts +9 -0
  30. package/dist/types/index.d.ts +2 -0
  31. package/package.json +1 -1
@@ -0,0 +1,22 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ var css_248z = ".CalendarBody-module_wrapper__fd17C {\n display: flex;\n flex-direction: column;\n gap: 8px;\n color: var(--text-disabled-color);\n}\n\n.CalendarBody-module_header__33b3Q {\n display: flex;\n align-items: center;\n gap: 8px;\n}\n\n.CalendarBody-module_monthYear__efUvQ {\n display: flex;\n align-items: center;\n gap: 6px;\n width: 100%;\n color: var(--text-primary);\n}\n\n.CalendarBody-module_yearButton__Y76y1 {\n display: flex;\n align-items: center;\n gap: 6px;\n}\n\n.CalendarBody-module_navButton__cGVVz {\n padding: 0;\n cursor: pointer;\n}\n\n.CalendarBody-module_weekDays__zXG3- {\n height: 24px;\n}\n\n.CalendarBody-module_grid__HNGTZ,\n.CalendarBody-module_weekDays__zXG3- {\n display: grid;\n grid-template-columns: repeat(7, 1fr);\n column-gap: calc((100% - 7 * 28px) / 6);\n text-align: center;\n}\n\n.CalendarBody-module_weekDay__hzksZ,\n.CalendarBody-module_day__0KNDZ {\n width: 28px;\n}\n\n.CalendarBody-module_day__0KNDZ {\n cursor: pointer;\n color: var(--text-primary);\n height: 28px;\n}\n\n.CalendarBody-module_muted__8XysY {\n color: var(--text-disabled-color);\n}\n\n.CalendarBody-module_hiddenDay__mCCeF {\n visibility: hidden;\n pointer-events: none;\n}\n\n.CalendarBody-module_selected__86UkJ {\n background-color: var(--surface-accent);\n color: var(--text-white-nonconvert-color);\n border-radius: 100px;\n}\n";
6
+ var styles = {"wrapper":"CalendarBody-module_wrapper__fd17C","header":"CalendarBody-module_header__33b3Q","monthYear":"CalendarBody-module_monthYear__efUvQ","yearButton":"CalendarBody-module_yearButton__Y76y1","navButton":"CalendarBody-module_navButton__cGVVz","weekDays":"CalendarBody-module_weekDays__zXG3-","grid":"CalendarBody-module_grid__HNGTZ","weekDay":"CalendarBody-module_weekDay__hzksZ","day":"CalendarBody-module_day__0KNDZ","hiddenDay":"CalendarBody-module_hiddenDay__mCCeF","selected":"CalendarBody-module_selected__86UkJ"};
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=CalendarBody.module.css.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CalendarBody.module.css.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;"}
@@ -0,0 +1,34 @@
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 getMonthNameProper = require('../../../utils/date/getMonthNameProper.js');
7
+ var joinClasses = require('../../../utils/joinClasses.js');
8
+ var useCalendar = require('../../../customHooks/useCalendar.js');
9
+ var CalendarBody_module = require('./CalendarBody.module.css.js');
10
+
11
+ const WEEK_DAYS = ["Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun"];
12
+ const CalendarBody = ({ month = new Date().getMonth(), year = new Date().getFullYear(), selectedDate = null, onDayClick, onMonthChange, }) => {
13
+ const { days, visibleMonth, visibleYear, changeMonth } = useCalendar.useCalendarBody({
14
+ month,
15
+ year,
16
+ selectedDate,
17
+ onMonthChange,
18
+ });
19
+ const monthName = getMonthNameProper.getMonthNameProper(visibleMonth);
20
+ return (jsxRuntime.jsxs("div", { className: CalendarBody_module.default.wrapper, "data-testid": "CalendarBody", children: [jsxRuntime.jsxs("div", { className: CalendarBody_module.default.header, children: [jsxRuntime.jsxs("div", { className: CalendarBody_module.default.monthYear, "data-testid": "Calendar_MONTH_YEAR_LABEL", children: [jsxRuntime.jsx(index.BaseComponents.Typography, { tag: "span", fontClass: "body1Medium", "data-testid": "CalendarBody_MONTH_YEAR", children: monthName }), jsxRuntime.jsxs("button", { className: CalendarBody_module.default.yearButton, type: "button", onClick: () => { }, "data-testid": "Calendar_CHOOSE_YEAR_BTN", children: [jsxRuntime.jsx(index.BaseComponents.Typography, { tag: "span", fontClass: "body1Medium", "data-testid": "Calendar_CURRENT_YEAR", children: visibleYear }), jsxRuntime.jsx(graphics.Icons.Basic.ChevronDownSmall, { width: "24px", height: "24px", fill: "var(--icon-accent-color)" })] })] }), jsxRuntime.jsx("button", { className: CalendarBody_module.default.navButton, type: "button", onClick: () => {
21
+ changeMonth(-1);
22
+ }, "data-testid": "Calendar_PREV_MONTH_BTN", children: jsxRuntime.jsx(graphics.Icons.Basic.ChevronLeft, { width: "24px", height: "24px", fill: "var(--icon-accent-color)" }) }), jsxRuntime.jsx("button", { className: CalendarBody_module.default.navButton, type: "button", onClick: () => {
23
+ changeMonth(1);
24
+ }, "data-testid": "Calendar_NEXT_MONTH_BTN", children: jsxRuntime.jsx(graphics.Icons.Basic.ChevronRight, { width: "24px", height: "24px", fill: "var(--icon-accent-color)" }) })] }), jsxRuntime.jsx("div", { className: CalendarBody_module.default.weekDays, children: WEEK_DAYS.map((day) => (jsxRuntime.jsx(index.BaseComponents.Typography, { tag: "span", fontClass: "body2Medium", className: CalendarBody_module.default.weekDay, children: day }, day))) }), jsxRuntime.jsx("div", { className: CalendarBody_module.default.grid, children: days.map((cell) => {
25
+ return (jsxRuntime.jsx("button", { type: "button", className: joinClasses.joinClasses(CalendarBody_module.default.day, !cell.isCurrentMonth && CalendarBody_module.default.hiddenDay, cell.isToday && CalendarBody_module.default.today, cell.isSelected && CalendarBody_module.default.selected), onClick: () => {
26
+ if (cell.isCurrentMonth) {
27
+ onDayClick?.(cell.date);
28
+ }
29
+ }, disabled: !cell.isCurrentMonth, "data-testid": `CalendarBody_DAY_${cell.date.toISOString().slice(0, 10)}`, children: cell.isCurrentMonth && (jsxRuntime.jsx(index.BaseComponents.Typography, { tag: "span", fontClass: "body2Medium", children: cell.day })) }, cell.date.toISOString()));
30
+ }) })] }));
31
+ };
32
+
33
+ exports.CalendarBody = CalendarBody;
34
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sources":["../../../../../src/components/Calendar/Body/index.tsx"],"sourcesContent":[null],"names":["useCalendarBody","getMonthNameProper","_jsxs","styles","_jsx","BaseComponents","Icons","joinClasses"],"mappings":";;;;;;;;;;AAOA,MAAM,SAAS,GAAG,CAAC,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,CAAC;AAU5D,MAAM,YAAY,GAAG,CAAC,EAC3B,KAAK,GAAG,IAAI,IAAI,EAAE,CAAC,QAAQ,EAAE,EAC7B,IAAI,GAAG,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE,EAC/B,YAAY,GAAG,IAAI,EACnB,UAAU,EACV,aAAa,GACM,KAAI;IACvB,MAAM,EAAE,IAAI,EAAE,YAAY,EAAE,WAAW,EAAE,WAAW,EAAE,GAAGA,2BAAe,CAAC;QACvE,KAAK;QACL,IAAI;QACJ,YAAY;QACZ,aAAa;AACd,KAAA,CAAC;AACF,IAAA,MAAM,SAAS,GAAGC,qCAAkB,CAAC,YAAY,CAAC;IAElD,QACEC,eAAA,CAAA,KAAA,EAAA,EAAK,SAAS,EAAEC,2BAAM,CAAC,OAAO,EAAA,aAAA,EAAc,cAAc,EAAA,QAAA,EAAA,CACxDD,eAAA,CAAA,KAAA,EAAA,EAAK,SAAS,EAAEC,2BAAM,CAAC,MAAM,EAAA,QAAA,EAAA,CAC3BD,eAAA,CAAA,KAAA,EAAA,EACE,SAAS,EAAEC,2BAAM,CAAC,SAAS,EAAA,aAAA,EACf,2BAA2B,EAAA,QAAA,EAAA,CAEvCC,cAAA,CAACC,oBAAc,CAAC,UAAU,EAAA,EAC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aAAa,EAAA,QAAA,EAC1D,IAAI,CAAC,GAAG,EAAA,CACiB,CAC7B,EAAA,EApBI,IAAI,CAAC,IAAI,CAAC,WAAW,EAAE,CAqBrB;AAEb,gBAAA,CAAC,CAAC,EAAA,CACE,CAAA,EAAA,CACF;AAEV;;;;"}
@@ -1,60 +1,62 @@
1
1
  'use strict';
2
2
 
3
3
  require('../styles/colors.css.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');
4
+ var index = require('./Calendar/Body/index.js');
5
+ var index$l = require('./ErrorModal/index.js');
6
+ var index$q = require('./Identity/Agreement/index.js');
7
+ var index$p = require('./Identity/Auth/index.js');
8
+ var index$n = require('./Identity/EdsSuccess/index.js');
9
+ var index$5 = require('./Identity/HelpInstruction/index.js');
10
+ var index$f = require('./Identity/IdentityHeader/index.js');
11
+ var index$e = require('./Identity/IdentityModal/index.js');
12
+ var index$m = require('./Messages/EmptyMessages/index.js');
13
+ var index$i = require('./Messages/HelpNotification/index.js');
14
+ var index$h = require('./Messages/HelpNotificationItem/index.js');
15
+ var index$d = require('./Messages/MsgBody/index.js');
16
+ var index$c = require('./Messages/MsgComponentHeader/index.js');
17
+ var index$b = require('./Messages/MsgSearch/index.js');
18
+ var index$6 = require('./Navigation/ViewToggle/index.js');
19
+ var index$2 = require('./Notification/Item/index.js');
20
+ var index$1 = require('./Notification/Wrapper/index.js');
21
+ var index$4 = require('./Presale/index.js');
22
+ var index$o = require('./Profile/DocCard/index.js');
23
+ var index$g = require('./Profile/IconToggleItem/index.js');
24
+ var index$9 = require('./Profile/ProfileHealthGeneral/index.js');
25
+ var index$8 = require('./Profile/RightMenuSectionItem/index.js');
26
+ var index$7 = require('./Profile/SetUpAccess/index.js');
27
+ var index$3 = require('./ServiceCardComponent/index.js');
28
+ var index$k = require('./Services/Feedback/index.js');
29
+ var index$j = require('./Services/FileForUpload/index.js');
30
+ var index$a = require('./Services/NextStepComponent/index.js');
30
31
 
31
32
  const Components = {
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,
33
+ Agreement: index$q.Agreement,
34
+ Auth: index$p.Auth,
35
+ DocCard: index$o.DocCard,
36
+ EdsSuccess: index$n.EdsSuccess,
37
+ EmptyMessages: index$m.EmptyMessages,
38
+ ErrorModal: index$l.ErrorModal,
39
+ Feedback: index$k.Feedback,
40
+ FileForUpload: index$j.FileForUpload,
41
+ HelpNotification: index$i.HelpNotification,
42
+ HelpNotificationItem: index$h.HelpNotificationItem,
43
+ IconToggleItem: index$g.IconToggleItem,
44
+ IdentityHeader: index$f.IdentityHeader,
45
+ IdentityModal: index$e.IdentityModal,
46
+ MsgBody: index$d.MsgBody,
47
+ MsgComponentHeader: index$c.MsgComponentHeader,
48
+ MsgSearch: index$b.MsgSearch,
49
+ NextStepComponent: index$a.NextStepComponent,
50
+ ProfileHealthGeneral: index$9.ProfileHealthGeneral,
51
+ RightMenuSectionItem: index$8.RightMenuSectionItem,
52
+ SetUpAccess: index$7.SetUpAccess,
53
+ ViewToggle: index$6.ViewToggle,
54
+ HelpInstruction: index$5.HelpInstruction,
55
+ PresaleComponent: index$4.PresaleComponent,
56
+ ServiceCardComponent: index$3.ServiceCardComponent,
57
+ NotificationItem: index$2.NotificationItem,
58
+ NotificationWrapper: index$1.NotificationWrapper,
59
+ CalendarBody: index.CalendarBody,
58
60
  };
59
61
 
60
62
  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","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;;;;;"}
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","CalendarBody"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA6BO,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,2BAAmB;kBACnBC,kBAAY;;;;;"}
@@ -0,0 +1,46 @@
1
+ 'use strict';
2
+
3
+ var React = require('react');
4
+ var getDaysInMonth = require('../utils/date/getDaysInMonth.js');
5
+
6
+ const TODAY = new Date();
7
+ const isSameDate = (left, right) => left.getFullYear() === right.getFullYear() &&
8
+ left.getMonth() === right.getMonth() &&
9
+ left.getDate() === right.getDate();
10
+ const buildCalendarDays = (month, year, selectedDate) => {
11
+ const firstDayIndex = (new Date(year, month, 1).getDay() + 6) % 7;
12
+ const daysInMonth = getDaysInMonth.getDaysInMonth(month, year);
13
+ const trailingDays = (7 - ((firstDayIndex + daysInMonth) % 7)) % 7;
14
+ const cellCount = firstDayIndex + daysInMonth + trailingDays;
15
+ const startDate = new Date(year, month, 1 - firstDayIndex);
16
+ return Array.from({ length: cellCount }, (_, index) => {
17
+ const date = new Date(startDate.getFullYear(), startDate.getMonth(), startDate.getDate() + index);
18
+ return {
19
+ date,
20
+ day: date.getDate(),
21
+ isCurrentMonth: date.getMonth() === month,
22
+ isToday: isSameDate(date, TODAY),
23
+ isSelected: selectedDate ? isSameDate(date, selectedDate) : false,
24
+ };
25
+ });
26
+ };
27
+ const useCalendarBody = ({ month, year, selectedDate, onMonthChange, }) => {
28
+ const [visibleDate, setVisibleDate] = React.useState(() => new Date(year, month, 1));
29
+ React.useEffect(() => {
30
+ setVisibleDate(new Date(year, month, 1));
31
+ }, [month, year]);
32
+ const visibleMonth = visibleDate.getMonth();
33
+ const visibleYear = visibleDate.getFullYear();
34
+ const days = React.useMemo(() => buildCalendarDays(visibleMonth, visibleYear, selectedDate), [visibleMonth, visibleYear, selectedDate]);
35
+ const changeMonth = (offset) => {
36
+ setVisibleDate((current) => {
37
+ const next = new Date(current.getFullYear(), current.getMonth() + offset, 1);
38
+ onMonthChange?.(next);
39
+ return next;
40
+ });
41
+ };
42
+ return { days, visibleMonth, visibleYear, changeMonth };
43
+ };
44
+
45
+ exports.useCalendarBody = useCalendarBody;
46
+ //# sourceMappingURL=useCalendar.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useCalendar.js","sources":["../../../src/customHooks/useCalendar.tsx"],"sourcesContent":[null],"names":["getDaysInMonth","useState","useEffect","useMemo"],"mappings":";;;;;AAIA,MAAM,KAAK,GAAG,IAAI,IAAI,EAAE;AASxB,MAAM,UAAU,GAAG,CAAC,IAAU,EAAE,KAAW,KACzC,IAAI,CAAC,WAAW,EAAE,KAAK,KAAK,CAAC,WAAW,EAAE;AAC1C,IAAA,IAAI,CAAC,QAAQ,EAAE,KAAK,KAAK,CAAC,QAAQ,EAAE;IACpC,IAAI,CAAC,OAAO,EAAE,KAAK,KAAK,CAAC,OAAO,EAAE;AAEpC,MAAM,iBAAiB,GAAG,CACxB,KAAa,EACb,IAAY,EACZ,YAA0B,KACJ;IACtB,MAAM,aAAa,GAAG,CAAC,IAAI,IAAI,CAAC,IAAI,EAAE,KAAK,EAAE,CAAC,CAAC,CAAC,MAAM,EAAE,GAAG,CAAC,IAAI,CAAC;IACjE,MAAM,WAAW,GAAGA,6BAAc,CAAC,KAAK,EAAE,IAAI,CAAC;AAC/C,IAAA,MAAM,YAAY,GAAG,CAAC,CAAC,IAAI,CAAC,aAAa,GAAG,WAAW,IAAI,CAAC,CAAC,IAAI,CAAC;AAClE,IAAA,MAAM,SAAS,GAAG,aAAa,GAAG,WAAW,GAAG,YAAY;AAC5D,IAAA,MAAM,SAAS,GAAG,IAAI,IAAI,CAAC,IAAI,EAAE,KAAK,EAAE,CAAC,GAAG,aAAa,CAAC;AAE1D,IAAA,OAAO,KAAK,CAAC,IAAI,CAAC,EAAE,MAAM,EAAE,SAAS,EAAE,EAAE,CAAC,CAAC,EAAE,KA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,GAAG,IAAI,IAAI,CACnB,OAAO,CAAC,WAAW,EAAE,EACrB,OAAO,CAAC,QAAQ,EAAE,GAAG,MAAM,EAC3B,CAAC,CACF;AACD,YAAA,aAAa,GAAG,IAAI,CAAC;AACrB,YAAA,OAAO,IAAI;AACb,QAAA,CAAC,CAAC;AACJ,IAAA,CAAC;IAED,OAAO,EAAE,IAAI,EAAE,YAAY,EAAE,WAAW,EAAE,WAAW,EAAE;AACzD;;;;"}
@@ -0,0 +1,8 @@
1
+ 'use strict';
2
+
3
+ const getDaysInMonth = (month, year) => {
4
+ return new Date(year, month + 1, 0).getDate();
5
+ };
6
+
7
+ exports.getDaysInMonth = getDaysInMonth;
8
+ //# sourceMappingURL=getDaysInMonth.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getDaysInMonth.js","sources":["../../../../src/utils/date/getDaysInMonth.tsx"],"sourcesContent":[null],"names":[],"mappings":";;MAAa,cAAc,GAAG,CAAC,KAAa,EAAE,IAAY,KAAY;AACpE,IAAA,OAAO,IAAI,IAAI,CAAC,IAAI,EAAE,KAAK,GAAG,CAAC,EAAE,CAAC,CAAC,CAAC,OAAO,EAAE;AAC/C;;;;"}
@@ -0,0 +1,13 @@
1
+ 'use strict';
2
+
3
+ var index = require('./index.js');
4
+
5
+ const getMonthNameProper = (month) => {
6
+ const monthName = new Date(index.currentYear, month).toLocaleString("ru-RU", {
7
+ month: "long",
8
+ });
9
+ return monthName.charAt(0).toUpperCase() + monthName.slice(1);
10
+ };
11
+
12
+ exports.getMonthNameProper = getMonthNameProper;
13
+ //# sourceMappingURL=getMonthNameProper.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getMonthNameProper.js","sources":["../../../../src/utils/date/getMonthNameProper.tsx"],"sourcesContent":[null],"names":["currentYear"],"mappings":";;;;AAEO,MAAM,kBAAkB,GAAG,CAAC,KAAa,KAAY;AAC1D,IAAA,MAAM,SAAS,GAAG,IAAI,IAAI,CAACA,iBAAW,EAAE,KAAK,CAAC,CAAC,cAAc,CAAC,OAAO,EAAE;AACrE,QAAA,KAAK,EAAE,MAAM;AACd,KAAA,CAAC;AACF,IAAA,OAAO,SAAS,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE,GAAG,SAAS,CAAC,KAAK,CAAC,CAAC,CAAC;AAC/D;;;;"}
@@ -0,0 +1,9 @@
1
+ 'use strict';
2
+
3
+ new Date(0).getFullYear();
4
+ const currentYear = new Date().getFullYear();
5
+ new Date().getMonth();
6
+ new Date().getDate();
7
+
8
+ exports.currentYear = currentYear;
9
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sources":["../../../../src/utils/date/index.tsx"],"sourcesContent":[null],"names":[],"mappings":";;AAAuB,IAAI,IAAI,CAAC,CAAC,CAAC,CAAC,WAAW;AAIvC,MAAM,WAAW,GAAG,IAAI,IAAI,EAAE,CAAC,WAAW;AACrB,IAAI,IAAI,EAAE,CAAC,QAAQ;AACrB,IAAI,IAAI,EAAE,CAAC,OAAO;;;;"}
@@ -0,0 +1,18 @@
1
+ var css_248z = ".CalendarBody-module_wrapper__fd17C {\n display: flex;\n flex-direction: column;\n gap: 8px;\n color: var(--text-disabled-color);\n}\n\n.CalendarBody-module_header__33b3Q {\n display: flex;\n align-items: center;\n gap: 8px;\n}\n\n.CalendarBody-module_monthYear__efUvQ {\n display: flex;\n align-items: center;\n gap: 6px;\n width: 100%;\n color: var(--text-primary);\n}\n\n.CalendarBody-module_yearButton__Y76y1 {\n display: flex;\n align-items: center;\n gap: 6px;\n}\n\n.CalendarBody-module_navButton__cGVVz {\n padding: 0;\n cursor: pointer;\n}\n\n.CalendarBody-module_weekDays__zXG3- {\n height: 24px;\n}\n\n.CalendarBody-module_grid__HNGTZ,\n.CalendarBody-module_weekDays__zXG3- {\n display: grid;\n grid-template-columns: repeat(7, 1fr);\n column-gap: calc((100% - 7 * 28px) / 6);\n text-align: center;\n}\n\n.CalendarBody-module_weekDay__hzksZ,\n.CalendarBody-module_day__0KNDZ {\n width: 28px;\n}\n\n.CalendarBody-module_day__0KNDZ {\n cursor: pointer;\n color: var(--text-primary);\n height: 28px;\n}\n\n.CalendarBody-module_muted__8XysY {\n color: var(--text-disabled-color);\n}\n\n.CalendarBody-module_hiddenDay__mCCeF {\n visibility: hidden;\n pointer-events: none;\n}\n\n.CalendarBody-module_selected__86UkJ {\n background-color: var(--surface-accent);\n color: var(--text-white-nonconvert-color);\n border-radius: 100px;\n}\n";
2
+ var styles = {"wrapper":"CalendarBody-module_wrapper__fd17C","header":"CalendarBody-module_header__33b3Q","monthYear":"CalendarBody-module_monthYear__efUvQ","yearButton":"CalendarBody-module_yearButton__Y76y1","navButton":"CalendarBody-module_navButton__cGVVz","weekDays":"CalendarBody-module_weekDays__zXG3-","grid":"CalendarBody-module_grid__HNGTZ","weekDay":"CalendarBody-module_weekDay__hzksZ","day":"CalendarBody-module_day__0KNDZ","hiddenDay":"CalendarBody-module_hiddenDay__mCCeF","selected":"CalendarBody-module_selected__86UkJ"};
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=CalendarBody.module.css.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CalendarBody.module.css.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;"}
@@ -0,0 +1,32 @@
1
+ import { jsxs, jsx } from 'react/jsx-runtime';
2
+ import { Icons } from '@egov3/graphics';
3
+ import { BaseComponents } from '../../../baseComponents/index.js';
4
+ import { getMonthNameProper } from '../../../utils/date/getMonthNameProper.js';
5
+ import { joinClasses } from '../../../utils/joinClasses.js';
6
+ import { useCalendarBody } from '../../../customHooks/useCalendar.js';
7
+ import styles from './CalendarBody.module.css.js';
8
+
9
+ const WEEK_DAYS = ["Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun"];
10
+ const CalendarBody = ({ month = new Date().getMonth(), year = new Date().getFullYear(), selectedDate = null, onDayClick, onMonthChange, }) => {
11
+ const { days, visibleMonth, visibleYear, changeMonth } = useCalendarBody({
12
+ month,
13
+ year,
14
+ selectedDate,
15
+ onMonthChange,
16
+ });
17
+ const monthName = getMonthNameProper(visibleMonth);
18
+ return (jsxs("div", { className: styles.wrapper, "data-testid": "CalendarBody", children: [jsxs("div", { className: styles.header, children: [jsxs("div", { className: styles.monthYear, "data-testid": "Calendar_MONTH_YEAR_LABEL", children: [jsx(BaseComponents.Typography, { tag: "span", fontClass: "body1Medium", "data-testid": "CalendarBody_MONTH_YEAR", children: monthName }), jsxs("button", { className: styles.yearButton, type: "button", onClick: () => { }, "data-testid": "Calendar_CHOOSE_YEAR_BTN", children: [jsx(BaseComponents.Typography, { tag: "span", fontClass: "body1Medium", "data-testid": "Calendar_CURRENT_YEAR", children: visibleYear }), jsx(Icons.Basic.ChevronDownSmall, { width: "24px", height: "24px", fill: "var(--icon-accent-color)" })] })] }), jsx("button", { className: styles.navButton, type: "button", onClick: () => {
19
+ changeMonth(-1);
20
+ }, "data-testid": "Calendar_PREV_MONTH_BTN", children: jsx(Icons.Basic.ChevronLeft, { width: "24px", height: "24px", fill: "var(--icon-accent-color)" }) }), jsx("button", { className: styles.navButton, type: "button", onClick: () => {
21
+ changeMonth(1);
22
+ }, "data-testid": "Calendar_NEXT_MONTH_BTN", children: jsx(Icons.Basic.ChevronRight, { width: "24px", height: "24px", fill: "var(--icon-accent-color)" }) })] }), jsx("div", { className: styles.weekDays, children: WEEK_DAYS.map((day) => (jsx(BaseComponents.Typography, { tag: "span", fontClass: "body2Medium", className: styles.weekDay, children: day }, day))) }), jsx("div", { className: styles.grid, children: days.map((cell) => {
23
+ return (jsx("button", { type: "button", className: joinClasses(styles.day, !cell.isCurrentMonth && styles.hiddenDay, cell.isToday && styles.today, cell.isSelected && styles.selected), onClick: () => {
24
+ if (cell.isCurrentMonth) {
25
+ onDayClick?.(cell.date);
26
+ }
27
+ }, disabled: !cell.isCurrentMonth, "data-testid": `CalendarBody_DAY_${cell.date.toISOString().slice(0, 10)}`, children: cell.isCurrentMonth && (jsx(BaseComponents.Typography, { tag: "span", fontClass: "body2Medium", children: cell.day })) }, cell.date.toISOString()));
28
+ }) })] }));
29
+ };
30
+
31
+ export { CalendarBody };
32
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sources":["../../../../../src/components/Calendar/Body/index.tsx"],"sourcesContent":[null],"names":["_jsxs","_jsx"],"mappings":";;;;;;;;AAOA,MAAM,SAAS,GAAG,CAAC,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,CAAC;AAU5D,MAAM,YAAY,GAAG,CAAC,EAC3B,KAAK,GAAG,IAAI,IAAI,EAAE,CAAC,QAAQ,EAAE,EAC7B,IAAI,GAAG,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE,EAC/B,YAAY,GAAG,IAAI,EACnB,UAAU,EACV,aAAa,GACM,KAAI;IACvB,MAAM,EAAE,IAAI,EAAE,YAAY,EAAE,WAAW,EAAE,WAAW,EAAE,GAAG,eAAe,CAAC;QACvE,KAAK;QACL,IAAI;QACJ,YAAY;QACZ,aAAa;AACd,KAAA,CAAC;AACF,IAAA,MAAM,SAAS,GAAG,kBAAkB,CAAC,YAAY,CAAC;IAElD,QACEA,IAAA,CAAA,KAAA,EAAA,EAAK,SAAS,EAAE,MAAM,CAAC,OAAO,EAAA,aAAA,EAAc,cAAc,EAAA,QAAA,EAAA,CACxDA,IAAA,CAAA,KAAA,EAAA,EAAK,SAAS,EAAE,MAAM,CAAC,MAAM,EAAA,QAAA,EAAA,CAC3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AE,EAAA,QAAA,EAEtE,IAAI,CAAC,cAAc,KAClBA,GAAA,CAAC,cAAc,CAAC,UAAU,EAAA,EAAC,GAAG,EAAC,MAAM,EAAC,SAAS,EAAC,aAAa,EAAA,QAAA,EAC1D,IAAI,CAAC,GAAG,EAAA,CACiB,CAC7B,EAAA,EApBI,IAAI,CAAC,IAAI,CAAC,WAAW,EAAE,CAqBrB;AAEb,gBAAA,CAAC,CAAC,EAAA,CACE,CAAA,EAAA,CACF;AAEV;;;;"}
@@ -1,4 +1,5 @@
1
1
  import '../styles/colors.css.js';
2
+ import { CalendarBody } from './Calendar/Body/index.js';
2
3
  import { ErrorModal } from './ErrorModal/index.js';
3
4
  import { Agreement } from './Identity/Agreement/index.js';
4
5
  import { Auth } from './Identity/Auth/index.js';
@@ -53,6 +54,7 @@ const Components = {
53
54
  ServiceCardComponent,
54
55
  NotificationItem,
55
56
  NotificationWrapper,
57
+ CalendarBody,
56
58
  };
57
59
 
58
60
  export { Components };
@@ -1 +1 @@
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;;;;;"}
1
+ {"version":3,"file":"index.js","sources":["../../../src/components/index.ts"],"sourcesContent":[null],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA6BO,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;IACnB,YAAY;;;;;"}
@@ -0,0 +1,44 @@
1
+ import { useState, useEffect, useMemo } from 'react';
2
+ import { getDaysInMonth } from '../utils/date/getDaysInMonth.js';
3
+
4
+ const TODAY = new Date();
5
+ const isSameDate = (left, right) => left.getFullYear() === right.getFullYear() &&
6
+ left.getMonth() === right.getMonth() &&
7
+ left.getDate() === right.getDate();
8
+ const buildCalendarDays = (month, year, selectedDate) => {
9
+ const firstDayIndex = (new Date(year, month, 1).getDay() + 6) % 7;
10
+ const daysInMonth = getDaysInMonth(month, year);
11
+ const trailingDays = (7 - ((firstDayIndex + daysInMonth) % 7)) % 7;
12
+ const cellCount = firstDayIndex + daysInMonth + trailingDays;
13
+ const startDate = new Date(year, month, 1 - firstDayIndex);
14
+ return Array.from({ length: cellCount }, (_, index) => {
15
+ const date = new Date(startDate.getFullYear(), startDate.getMonth(), startDate.getDate() + index);
16
+ return {
17
+ date,
18
+ day: date.getDate(),
19
+ isCurrentMonth: date.getMonth() === month,
20
+ isToday: isSameDate(date, TODAY),
21
+ isSelected: selectedDate ? isSameDate(date, selectedDate) : false,
22
+ };
23
+ });
24
+ };
25
+ const useCalendarBody = ({ month, year, selectedDate, onMonthChange, }) => {
26
+ const [visibleDate, setVisibleDate] = useState(() => new Date(year, month, 1));
27
+ useEffect(() => {
28
+ setVisibleDate(new Date(year, month, 1));
29
+ }, [month, year]);
30
+ const visibleMonth = visibleDate.getMonth();
31
+ const visibleYear = visibleDate.getFullYear();
32
+ const days = useMemo(() => buildCalendarDays(visibleMonth, visibleYear, selectedDate), [visibleMonth, visibleYear, selectedDate]);
33
+ const changeMonth = (offset) => {
34
+ setVisibleDate((current) => {
35
+ const next = new Date(current.getFullYear(), current.getMonth() + offset, 1);
36
+ onMonthChange?.(next);
37
+ return next;
38
+ });
39
+ };
40
+ return { days, visibleMonth, visibleYear, changeMonth };
41
+ };
42
+
43
+ export { useCalendarBody };
44
+ //# sourceMappingURL=useCalendar.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useCalendar.js","sources":["../../../src/customHooks/useCalendar.tsx"],"sourcesContent":[null],"names":[],"mappings":";;;AAIA,MAAM,KAAK,GAAG,IAAI,IAAI,EAAE;AASxB,MAAM,UAAU,GAAG,CAAC,IAAU,EAAE,KAAW,KACzC,IAAI,CAAC,WAAW,EAAE,KAAK,KAAK,CAAC,WAAW,EAAE;AAC1C,IAAA,IAAI,CAAC,QAAQ,EAAE,KAAK,KAAK,CAAC,QAAQ,EAAE;IACpC,IAAI,CAAC,OAAO,EAAE,KAAK,KAAK,CAAC,OAAO,EAAE;AAEpC,MAAM,iBAAiB,GAAG,CACxB,KAAa,EACb,IAAY,EACZ,YAA0B,KACJ;IACtB,MAAM,aAAa,GAAG,CAAC,IAAI,IAAI,CAAC,IAAI,EAAE,KAAK,EAAE,CAAC,CAAC,CAAC,MAAM,EAAE,GAAG,CAAC,IAAI,CAAC;IACjE,MAAM,WAAW,GAAG,cAAc,CAAC,KAAK,EAAE,IAAI,CAAC;AAC/C,IAAA,MAAM,YAAY,GAAG,CAAC,CAAC,IAAI,CAAC,aAAa,GAAG,WAAW,IAAI,CAAC,CAAC,IAAI,CAAC;AAClE,IAAA,MAAM,SAAS,GAAG,aAAa,GAAG,WAAW,GAAG,YAAY;AAC5D,IAAA,MAAM,SAAS,GAAG,IAAI,IAAI,CAAC,IAAI,EAAE,KAAK,EAAE,CAAC,GAAG,aAAa,CAAC;AAE1D,IAAA,OAAO,KAAK,CAAC,IAAI,CAAC,EAAE,MAAM,EAAE,SA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O,KAAI;AACzB,YAAA,MAAM,IAAI,GAAG,IAAI,IAAI,CACnB,OAAO,CAAC,WAAW,EAAE,EACrB,OAAO,CAAC,QAAQ,EAAE,GAAG,MAAM,EAC3B,CAAC,CACF;AACD,YAAA,aAAa,GAAG,IAAI,CAAC;AACrB,YAAA,OAAO,IAAI;AACb,QAAA,CAAC,CAAC;AACJ,IAAA,CAAC;IAED,OAAO,EAAE,IAAI,EAAE,YAAY,EAAE,WAAW,EAAE,WAAW,EAAE;AACzD;;;;"}
@@ -0,0 +1,6 @@
1
+ const getDaysInMonth = (month, year) => {
2
+ return new Date(year, month + 1, 0).getDate();
3
+ };
4
+
5
+ export { getDaysInMonth };
6
+ //# sourceMappingURL=getDaysInMonth.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getDaysInMonth.js","sources":["../../../../src/utils/date/getDaysInMonth.tsx"],"sourcesContent":[null],"names":[],"mappings":"MAAa,cAAc,GAAG,CAAC,KAAa,EAAE,IAAY,KAAY;AACpE,IAAA,OAAO,IAAI,IAAI,CAAC,IAAI,EAAE,KAAK,GAAG,CAAC,EAAE,CAAC,CAAC,CAAC,OAAO,EAAE;AAC/C;;;;"}
@@ -0,0 +1,11 @@
1
+ import { currentYear } from './index.js';
2
+
3
+ const getMonthNameProper = (month) => {
4
+ const monthName = new Date(currentYear, month).toLocaleString("ru-RU", {
5
+ month: "long",
6
+ });
7
+ return monthName.charAt(0).toUpperCase() + monthName.slice(1);
8
+ };
9
+
10
+ export { getMonthNameProper };
11
+ //# sourceMappingURL=getMonthNameProper.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getMonthNameProper.js","sources":["../../../../src/utils/date/getMonthNameProper.tsx"],"sourcesContent":[null],"names":[],"mappings":";;AAEO,MAAM,kBAAkB,GAAG,CAAC,KAAa,KAAY;AAC1D,IAAA,MAAM,SAAS,GAAG,IAAI,IAAI,CAAC,WAAW,EAAE,KAAK,CAAC,CAAC,cAAc,CAAC,OAAO,EAAE;AACrE,QAAA,KAAK,EAAE,MAAM;AACd,KAAA,CAAC;AACF,IAAA,OAAO,SAAS,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE,GAAG,SAAS,CAAC,KAAK,CAAC,CAAC,CAAC;AAC/D;;;;"}
@@ -0,0 +1,7 @@
1
+ new Date(0).getFullYear();
2
+ const currentYear = new Date().getFullYear();
3
+ new Date().getMonth();
4
+ new Date().getDate();
5
+
6
+ export { currentYear };
7
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sources":["../../../../src/utils/date/index.tsx"],"sourcesContent":[null],"names":[],"mappings":"AAAuB,IAAI,IAAI,CAAC,CAAC,CAAC,CAAC,WAAW;AAIvC,MAAM,WAAW,GAAG,IAAI,IAAI,EAAE,CAAC,WAAW;AACrB,IAAI,IAAI,EAAE,CAAC,QAAQ;AACrB,IAAI,IAAI,EAAE,CAAC,OAAO;;;;"}
@@ -0,0 +1,9 @@
1
+ interface ICalendarBodyProps {
2
+ month?: number;
3
+ year?: number;
4
+ selectedDate?: Date | null;
5
+ onDayClick?: (date: Date) => void;
6
+ onMonthChange?: (date: Date) => void;
7
+ }
8
+
9
+ export type { ICalendarBodyProps };
@@ -1,3 +1,4 @@
1
+ import { ICalendarBodyProps } from './components/Calendar/Body/index.js';
1
2
  import { INotificationWrapperProps } from './components/Notification/Wrapper/index.js';
2
3
  import { INotificationComponentProps } from './components/Notification/Item/index.js';
3
4
  import { IServiceCardComponentProps } from './components/ServiceCardComponent/index.js';
@@ -99,6 +100,7 @@ declare const SystemDesign: {
99
100
  ServiceCardComponent: ({ handleOrderService, badge, isNew, title, }: IServiceCardComponentProps) => react_jsx_runtime.JSX.Element;
100
101
  NotificationItem: ({ type, text, onClick, }: INotificationComponentProps) => react_jsx_runtime.JSX.Element;
101
102
  NotificationWrapper: ({ items, removeNotificationData, }: INotificationWrapperProps) => react_jsx_runtime.JSX.Element | null;
103
+ CalendarBody: ({ month, year, selectedDate, onDayClick, onMonthChange, }: ICalendarBodyProps) => react_jsx_runtime.JSX.Element;
102
104
  };
103
105
  };
104
106
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@egov3/system-design",
3
- "version": "1.3.120",
3
+ "version": "1.3.122",
4
4
  "type": "module",
5
5
  "main": "dist/cjs/index.js",
6
6
  "types": "dist/types/index.d.ts",