analytica-frontend-lib 1.0.42 → 1.0.43
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/Calendar/index.d.mts +60 -0
- package/dist/Calendar/index.d.ts +60 -0
- package/dist/Calendar/index.js +526 -0
- package/dist/Calendar/index.js.map +1 -0
- package/dist/Calendar/index.mjs +501 -0
- package/dist/Calendar/index.mjs.map +1 -0
- package/dist/index.css +98 -0
- package/dist/index.css.map +1 -1
- package/dist/index.d.mts +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +576 -77
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +556 -58
- package/dist/index.mjs.map +1 -1
- package/dist/styles.css +98 -0
- package/dist/styles.css.map +1 -1
- package/package.json +2 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/components/Calendar/Calendar.tsx"],"sourcesContent":["import React, { useState, useMemo, useEffect, useRef } from 'react';\n\n/**\n * Activity status types for calendar days\n */\nexport type ActivityStatus = 'near-deadline' | 'overdue' | 'in-deadline';\n\n/**\n * Activity data for a specific day\n */\nexport interface CalendarActivity {\n id: string;\n status: ActivityStatus;\n title?: string;\n}\n\n/**\n * Calendar day data\n */\nexport interface CalendarDay {\n date: Date;\n isCurrentMonth: boolean;\n isToday: boolean;\n isSelected: boolean;\n activities?: CalendarActivity[];\n}\n\n/**\n * Calendar variant types\n */\nexport type CalendarVariant = 'navigation' | 'selection';\n\n/**\n * Calendar component props\n */\nexport interface CalendarProps {\n /** Calendar variant - navigation (compact) or selection (full) */\n variant?: CalendarVariant;\n /** Currently selected date */\n selectedDate?: Date;\n /** Function called when a date is selected */\n onDateSelect?: (date: Date) => void;\n /** Function called when month changes */\n onMonthChange?: (date: Date) => void;\n /** Activities data for calendar days */\n activities?: Record<string, CalendarActivity[]>;\n /** Show activities indicators */\n showActivities?: boolean;\n /** Additional CSS classes */\n className?: string;\n}\n\n/**\n * Day names abbreviations\n */\nexport const WEEK_DAYS = ['SEG', 'TER', 'QUA', 'QUI', 'SEX', 'SÁB', 'DOM'];\n\n/**\n * Day names single-letter abbreviations\n */\nconst WEEK_DAYS_SHORT = ['S', 'T', 'Q', 'Q', 'S', 'S', 'D'];\n\n/**\n * Month names in Portuguese\n */\nconst MONTH_NAMES = [\n 'Janeiro',\n 'Fevereiro',\n 'Março',\n 'Abril',\n 'Maio',\n 'Junho',\n 'Julho',\n 'Agosto',\n 'Setembro',\n 'Outubro',\n 'Novembro',\n 'Dezembro',\n];\n\n/**\n * Month/Year picker props\n */\ninterface MonthYearPickerProps {\n monthPickerRef: React.RefObject<HTMLDivElement | null>;\n availableYears: number[];\n currentDate: Date;\n onYearChange: (year: number) => void;\n onMonthChange: (month: number, year: number) => void;\n}\n\n/**\n * Month/Year picker component\n */\nconst MonthYearPicker: React.FC<MonthYearPickerProps> = ({\n monthPickerRef,\n availableYears,\n currentDate,\n onYearChange,\n onMonthChange,\n}) => (\n <div\n ref={monthPickerRef}\n className=\"absolute top-full left-0 z-50 mt-1 bg-white rounded-lg shadow-lg border border-border-200 p-4 min-w-[280px]\"\n >\n <div className=\"mb-4\">\n <h3 className=\"text-sm font-medium text-text-700 mb-2\">Selecionar Ano</h3>\n <div className=\"grid grid-cols-4 gap-1 max-h-32 overflow-y-auto\">\n {availableYears.map((year) => (\n <button\n key={year}\n onClick={() => onYearChange(year)}\n className={`\n px-2 py-1 text-xs rounded text-center hover:bg-background-100 transition-colors\n ${\n year === currentDate.getFullYear()\n ? 'bg-primary-800 text-text font-medium hover:text-text-950'\n : 'text-text-700'\n }\n `}\n >\n {year}\n </button>\n ))}\n </div>\n </div>\n\n <div>\n <h3 className=\"text-sm font-medium text-text-700 mb-2\">Selecionar Mês</h3>\n <div className=\"grid grid-cols-3 gap-1\">\n {MONTH_NAMES.map((month, index) => (\n <button\n key={month}\n onClick={() => onMonthChange(index, currentDate.getFullYear())}\n className={`\n px-2 py-2 text-xs rounded text-center hover:bg-background-100 transition-colors\n ${\n index === currentDate.getMonth()\n ? 'bg-primary-800 text-text font-medium hover:text-text-950'\n : 'text-text-700'\n }\n `}\n >\n {month.substring(0, 3)}\n </button>\n ))}\n </div>\n </div>\n </div>\n);\n\n/**\n * Helper function to get day styles based on variant and conditions\n */\nconst getDayStyles = (\n day: CalendarDay,\n variant: CalendarVariant,\n showActivities: boolean\n) => {\n let dayStyle = '';\n let textStyle = '';\n\n if (variant === 'selection' && day.isSelected) {\n dayStyle = 'bg-primary-800';\n textStyle = 'text-white';\n } else if (day.isToday) {\n textStyle = 'text-[#1c61b2]';\n } else if (\n variant === 'navigation' &&\n showActivities &&\n day.activities?.length\n ) {\n const primaryActivity = day.activities[0];\n if (primaryActivity.status === 'near-deadline') {\n dayStyle = 'bg-warning-background border-2 border-warning-400';\n textStyle = 'text-text-950';\n } else if (primaryActivity.status === 'in-deadline') {\n dayStyle = 'bg-success-background border-2 border-success-300';\n textStyle = 'text-text-950';\n } else if (primaryActivity.status === 'overdue') {\n dayStyle = 'bg-error-background border-2 border-error-300';\n textStyle = 'text-text-950';\n } else {\n dayStyle = 'border-2 border-blue-500';\n textStyle = 'text-blue-500';\n }\n } else {\n textStyle = 'text-text-950 hover:bg-background-100';\n }\n\n return { dayStyle, textStyle };\n};\n\n/**\n * Calendar component for Analytica Ensino platforms\n *\n * A comprehensive calendar component with activity indicators,\n * date selection, and navigation capabilities.\n */\nconst Calendar = ({\n variant = 'selection',\n selectedDate,\n onDateSelect,\n onMonthChange,\n activities = {},\n showActivities = true,\n className = '',\n}: CalendarProps) => {\n const [currentDate, setCurrentDate] = useState(selectedDate || new Date());\n const [isMonthPickerOpen, setIsMonthPickerOpen] = useState(false);\n const monthPickerRef = useRef<HTMLDivElement>(null);\n const monthPickerContainerRef = useRef<HTMLDivElement>(null);\n\n // Close month picker when clicking outside\n useEffect(() => {\n const handleClickOutside = (event: MouseEvent) => {\n if (\n monthPickerContainerRef.current &&\n !monthPickerContainerRef.current.contains(event.target as Node)\n ) {\n setIsMonthPickerOpen(false);\n }\n };\n\n if (isMonthPickerOpen) {\n document.addEventListener('mousedown', handleClickOutside);\n }\n\n return () => {\n document.removeEventListener('mousedown', handleClickOutside);\n };\n }, [isMonthPickerOpen]);\n\n // Get today's date for comparison\n const today = new Date();\n\n // Generate available years (current year ± 10 years)\n const availableYears = useMemo(() => {\n const currentYear = new Date().getFullYear();\n const years = [];\n for (let year = currentYear - 10; year <= currentYear + 10; year++) {\n years.push(year);\n }\n return years;\n }, []);\n\n // Calculate calendar data\n const calendarData = useMemo(() => {\n const year = currentDate.getFullYear();\n const month = currentDate.getMonth();\n\n // First day of the month\n const firstDay = new Date(year, month, 1);\n\n // Get the first Monday of the calendar view\n const startDate = new Date(firstDay);\n const firstDayOfWeek = (firstDay.getDay() + 6) % 7; // Convert Sunday=0 to Monday=0\n startDate.setDate(startDate.getDate() - firstDayOfWeek);\n\n const days: CalendarDay[] = [];\n const currentCalendarDate = new Date(startDate);\n\n // Generate 42 days (6 weeks)\n for (let i = 0; i < 42; i++) {\n const dateKey = currentCalendarDate.toISOString().split('T')[0];\n const dayActivities = activities[dateKey] || [];\n\n days.push({\n date: new Date(currentCalendarDate),\n isCurrentMonth: currentCalendarDate.getMonth() === month,\n isToday:\n currentCalendarDate.getFullYear() === today.getFullYear() &&\n currentCalendarDate.getMonth() === today.getMonth() &&\n currentCalendarDate.getDate() === today.getDate(),\n isSelected: selectedDate\n ? currentCalendarDate.getFullYear() === selectedDate.getFullYear() &&\n currentCalendarDate.getMonth() === selectedDate.getMonth() &&\n currentCalendarDate.getDate() === selectedDate.getDate()\n : false,\n activities: dayActivities,\n });\n\n currentCalendarDate.setDate(currentCalendarDate.getDate() + 1);\n }\n\n return days;\n }, [currentDate, selectedDate, activities]);\n\n // Navigation functions\n const goToPreviousMonth = () => {\n const newDate = new Date(currentDate);\n newDate.setMonth(newDate.getMonth() - 1);\n setCurrentDate(newDate);\n onMonthChange?.(newDate);\n };\n\n const goToNextMonth = () => {\n const newDate = new Date(currentDate);\n newDate.setMonth(newDate.getMonth() + 1);\n setCurrentDate(newDate);\n onMonthChange?.(newDate);\n };\n\n // Month/Year selection functions\n const goToMonth = (month: number, year: number) => {\n const newDate = new Date(year, month, 1);\n setCurrentDate(newDate);\n setIsMonthPickerOpen(false);\n onMonthChange?.(newDate);\n };\n\n const handleYearChange = (year: number) => {\n const newDate = new Date(year, currentDate.getMonth(), 1);\n setCurrentDate(newDate);\n };\n\n const toggleMonthPicker = (event: React.MouseEvent<HTMLButtonElement>) => {\n event.stopPropagation();\n setIsMonthPickerOpen(!isMonthPickerOpen);\n };\n\n // Date selection handler\n const handleDateSelect = (day: CalendarDay) => {\n onDateSelect?.(day.date);\n };\n\n // Navigation variant (compact)\n if (variant === 'navigation') {\n return (\n <div className={`bg-background rounded-xl p-3 ${className}`}>\n {/* Compact header */}\n <div className=\"flex items-center justify-between mb-4 px-6\">\n <div className=\"relative\" ref={monthPickerContainerRef}>\n <button\n onClick={toggleMonthPicker}\n className=\"flex items-center gap-1 hover:bg-background-100 rounded px-2 py-1 transition-colors\"\n >\n <span className=\"text-sm font-medium text-text-600\">\n {MONTH_NAMES[currentDate.getMonth()]}{' '}\n {currentDate.getFullYear()}\n </span>\n <svg\n className={`w-4 h-4 text-primary-950 transition-transform ${\n isMonthPickerOpen ? 'rotate-180' : ''\n }`}\n fill=\"none\"\n stroke=\"currentColor\"\n viewBox=\"0 0 24 24\"\n >\n <path\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n strokeWidth={2}\n d=\"M19 9l-7 7-7-7\"\n />\n </svg>\n </button>\n {isMonthPickerOpen && (\n <MonthYearPicker\n monthPickerRef={monthPickerRef}\n availableYears={availableYears}\n currentDate={currentDate}\n onYearChange={handleYearChange}\n onMonthChange={goToMonth}\n />\n )}\n </div>\n <div className=\"flex items-center gap-10\">\n <button\n onClick={goToPreviousMonth}\n className=\"p-1 rounded hover:bg-background-100 transition-colors\"\n aria-label=\"Mês anterior\"\n >\n <svg\n className=\"w-6 h-6 text-primary-950\"\n fill=\"none\"\n stroke=\"currentColor\"\n viewBox=\"0 0 24 24\"\n >\n <path\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n strokeWidth={2}\n d=\"M15 19l-7-7 7-7\"\n />\n </svg>\n </button>\n <button\n onClick={goToNextMonth}\n className=\"p-1 rounded hover:bg-background-100 transition-colors\"\n aria-label=\"Próximo mês\"\n >\n <svg\n className=\"w-6 h-6 text-primary-950\"\n fill=\"none\"\n stroke=\"currentColor\"\n viewBox=\"0 0 24 24\"\n >\n <path\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n strokeWidth={2}\n d=\"M9 5l7 7-7 7\"\n />\n </svg>\n </button>\n </div>\n </div>\n\n {/* Compact week days */}\n <div className=\"grid grid-cols-7 gap-1 mb-2\">\n {WEEK_DAYS_SHORT.map((day, index) => (\n <div\n key={`${day}-${index}`}\n className=\"h-9 flex items-center justify-center text-xs font-normal text-text-600\"\n >\n {day}\n </div>\n ))}\n </div>\n\n {/* Compact calendar grid */}\n <div className=\"grid grid-cols-7 gap-1\">\n {calendarData.map((day) => {\n // Não renderizar dias que não pertencem ao mês atual\n if (!day.isCurrentMonth) {\n return (\n <div\n key={day.date.getTime()}\n className=\"flex items-center justify-center\"\n >\n <div className=\"w-9 h-9\"></div>\n </div>\n );\n }\n\n const { dayStyle, textStyle } = getDayStyles(\n day,\n variant,\n showActivities\n );\n\n let spanClass = '';\n if (day.isSelected && day.isToday) {\n spanClass = 'h-6 w-6 rounded-full bg-[#1c61b2] text-text';\n } else if (day.isSelected) {\n spanClass = 'h-6 w-6 rounded-full bg-primary-950 text-text';\n }\n\n return (\n <div\n key={day.date.getTime()}\n className=\"flex items-center justify-center\"\n >\n <button\n className={`\n w-9 h-9 \n flex items-center justify-center \n text-md font-normal \n cursor-pointer \n rounded-full\n ${dayStyle} \n ${textStyle}\n `}\n onClick={() => handleDateSelect(day)}\n aria-label={`${day.date.getDate()} de ${MONTH_NAMES[day.date.getMonth()]}`}\n aria-current={day.isToday ? 'date' : undefined}\n tabIndex={0}\n >\n <span className={spanClass}>{day.date.getDate()}</span>\n </button>\n </div>\n );\n })}\n </div>\n </div>\n );\n }\n\n // Selection variant (full)\n return (\n <div className={`bg-background rounded-xl p-4 ${className}`}>\n {/* Full header */}\n <div className=\"flex items-center justify-between mb-3.5\">\n <div className=\"relative\" ref={monthPickerContainerRef}>\n <button\n onClick={toggleMonthPicker}\n className=\"flex items-center gap-2 hover:bg-background-100 rounded px-2 py-1 transition-colors\"\n >\n <h2 className=\"text-lg font-semibold text-text-950\">\n {MONTH_NAMES[currentDate.getMonth()]} {currentDate.getFullYear()}\n </h2>\n <svg\n className={`w-4 h-4 text-text-400 transition-transform ${\n isMonthPickerOpen ? 'rotate-180' : ''\n }`}\n fill=\"none\"\n stroke=\"currentColor\"\n viewBox=\"0 0 24 24\"\n >\n <path\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n strokeWidth={2}\n d=\"M19 9l-7 7-7-7\"\n />\n </svg>\n </button>\n {isMonthPickerOpen && (\n <MonthYearPicker\n monthPickerRef={monthPickerRef}\n availableYears={availableYears}\n currentDate={currentDate}\n onYearChange={handleYearChange}\n onMonthChange={goToMonth}\n />\n )}\n </div>\n <div className=\"flex items-center gap-1\">\n <button\n onClick={goToPreviousMonth}\n className=\"p-1 rounded-md hover:bg-background-100 transition-colors\"\n aria-label=\"Mês anterior\"\n >\n <svg\n className=\"w-6 h-6 text-primary-950\"\n fill=\"none\"\n stroke=\"currentColor\"\n viewBox=\"0 0 24 24\"\n >\n <path\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n strokeWidth={2}\n d=\"M15 19l-7-7 7-7\"\n />\n </svg>\n </button>\n <button\n onClick={goToNextMonth}\n className=\"p-1 rounded-md hover:bg-background-100 transition-colors\"\n aria-label=\"Próximo mês\"\n >\n <svg\n className=\"w-6 h-6 text-primary-950\"\n fill=\"none\"\n stroke=\"currentColor\"\n viewBox=\"0 0 24 24\"\n >\n <path\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n strokeWidth={2}\n d=\"M9 5l7 7-7 7\"\n />\n </svg>\n </button>\n </div>\n </div>\n\n {/* Week days header */}\n <div className=\"grid grid-cols-7 gap-1 mb-2\">\n {WEEK_DAYS.map((day) => (\n <div\n key={day}\n className=\"h-4 flex items-center justify-center text-xs font-semibold text-text-500\"\n >\n {day}\n </div>\n ))}\n </div>\n\n {/* Calendar grid */}\n <div className=\"grid grid-cols-7 gap-1\">\n {calendarData.map((day) => {\n // Não renderizar dias que não pertencem ao mês atual\n if (!day.isCurrentMonth) {\n return (\n <div\n key={day.date.getTime()}\n className=\"flex items-center justify-center\"\n >\n <div className=\"w-10 h-10\"></div>\n </div>\n );\n }\n\n const { dayStyle, textStyle } = getDayStyles(\n day,\n variant,\n showActivities\n );\n\n return (\n <div\n key={day.date.getTime()}\n className=\"flex items-center justify-center\"\n >\n <button\n className={`\n w-10 h-10 \n flex items-center justify-center \n text-xl font-normal \n cursor-pointer \n rounded-full\n focus:outline-none focus:ring-2 focus:ring-primary-600 focus:ring-offset-1\n ${dayStyle} \n ${textStyle}\n `}\n onClick={() => handleDateSelect(day)}\n aria-label={`${day.date.getDate()} de ${MONTH_NAMES[day.date.getMonth()]}`}\n aria-current={day.isToday ? 'date' : undefined}\n tabIndex={0}\n >\n {day.date.getDate()}\n </button>\n </div>\n );\n })}\n </div>\n </div>\n );\n};\n\nexport default Calendar;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,mBAA4D;AAyGxD;AAlDG,IAAM,YAAY,CAAC,OAAO,OAAO,OAAO,OAAO,OAAO,UAAO,KAAK;AAKzE,IAAM,kBAAkB,CAAC,KAAK,KAAK,KAAK,KAAK,KAAK,KAAK,GAAG;AAK1D,IAAM,cAAc;AAAA,EAClB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;A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UAAI,CAAC,IAAI,gBAAgB;AACvB,eACE;AAAA,UAAC;AAAA;AAAA,YAEC,WAAU;AAAA,YAEV,sDAAC,SAAI,WAAU,aAAY;AAAA;AAAA,UAHtB,IAAI,KAAK,QAAQ;AAAA,QAIxB;AAAA,MAEJ;AAEA,YAAM,EAAE,UAAU,UAAU,IAAI;AAAA,QAC9B;AAAA,QACA;AAAA,QACA;AAAA,MACF;AAEA,aACE;AAAA,QAAC;AAAA;AAAA,UAEC,WAAU;AAAA,UAEV;AAAA,YAAC;AAAA;AAAA,cACC,WAAW;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,oBAOP,QAAQ;AAAA,oBACR,SAAS;AAAA;AAAA,cAEb,SAAS,MAAM,iBAAiB,GAAG;AAAA,cACnC,cAAY,GAAG,IAAI,KAAK,QAAQ,CAAC,OAAO,YAAY,IAAI,KAAK,SAAS,CAAC,CAAC;AAAA,cACxE,gBAAc,IAAI,UAAU,SAAS;AAAA,cACrC,UAAU;AAAA,cAET,cAAI,KAAK,QAAQ;AAAA;AAAA,UACpB;AAAA;AAAA,QApBK,IAAI,KAAK,QAAQ;AAAA,MAqBxB;AAAA,IAEJ,CAAC,GACH;AAAA,KACF;AAEJ;AAEA,IAAO,mBAAQ;","names":[]}
|
|
@@ -0,0 +1,501 @@
|
|
|
1
|
+
// src/components/Calendar/Calendar.tsx
|
|
2
|
+
import { useState, useMemo, useEffect, useRef } from "react";
|
|
3
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
4
|
+
var WEEK_DAYS = ["SEG", "TER", "QUA", "QUI", "SEX", "S\xC1B", "DOM"];
|
|
5
|
+
var WEEK_DAYS_SHORT = ["S", "T", "Q", "Q", "S", "S", "D"];
|
|
6
|
+
var MONTH_NAMES = [
|
|
7
|
+
"Janeiro",
|
|
8
|
+
"Fevereiro",
|
|
9
|
+
"Mar\xE7o",
|
|
10
|
+
"Abril",
|
|
11
|
+
"Maio",
|
|
12
|
+
"Junho",
|
|
13
|
+
"Julho",
|
|
14
|
+
"Agosto",
|
|
15
|
+
"Setembro",
|
|
16
|
+
"Outubro",
|
|
17
|
+
"Novembro",
|
|
18
|
+
"Dezembro"
|
|
19
|
+
];
|
|
20
|
+
var MonthYearPicker = ({
|
|
21
|
+
monthPickerRef,
|
|
22
|
+
availableYears,
|
|
23
|
+
currentDate,
|
|
24
|
+
onYearChange,
|
|
25
|
+
onMonthChange
|
|
26
|
+
}) => /* @__PURE__ */ jsxs(
|
|
27
|
+
"div",
|
|
28
|
+
{
|
|
29
|
+
ref: monthPickerRef,
|
|
30
|
+
className: "absolute top-full left-0 z-50 mt-1 bg-white rounded-lg shadow-lg border border-border-200 p-4 min-w-[280px]",
|
|
31
|
+
children: [
|
|
32
|
+
/* @__PURE__ */ jsxs("div", { className: "mb-4", children: [
|
|
33
|
+
/* @__PURE__ */ jsx("h3", { className: "text-sm font-medium text-text-700 mb-2", children: "Selecionar Ano" }),
|
|
34
|
+
/* @__PURE__ */ jsx("div", { className: "grid grid-cols-4 gap-1 max-h-32 overflow-y-auto", children: availableYears.map((year) => /* @__PURE__ */ jsx(
|
|
35
|
+
"button",
|
|
36
|
+
{
|
|
37
|
+
onClick: () => onYearChange(year),
|
|
38
|
+
className: `
|
|
39
|
+
px-2 py-1 text-xs rounded text-center hover:bg-background-100 transition-colors
|
|
40
|
+
${year === currentDate.getFullYear() ? "bg-primary-800 text-text font-medium hover:text-text-950" : "text-text-700"}
|
|
41
|
+
`,
|
|
42
|
+
children: year
|
|
43
|
+
},
|
|
44
|
+
year
|
|
45
|
+
)) })
|
|
46
|
+
] }),
|
|
47
|
+
/* @__PURE__ */ jsxs("div", { children: [
|
|
48
|
+
/* @__PURE__ */ jsx("h3", { className: "text-sm font-medium text-text-700 mb-2", children: "Selecionar M\xEAs" }),
|
|
49
|
+
/* @__PURE__ */ jsx("div", { className: "grid grid-cols-3 gap-1", children: MONTH_NAMES.map((month, index) => /* @__PURE__ */ jsx(
|
|
50
|
+
"button",
|
|
51
|
+
{
|
|
52
|
+
onClick: () => onMonthChange(index, currentDate.getFullYear()),
|
|
53
|
+
className: `
|
|
54
|
+
px-2 py-2 text-xs rounded text-center hover:bg-background-100 transition-colors
|
|
55
|
+
${index === currentDate.getMonth() ? "bg-primary-800 text-text font-medium hover:text-text-950" : "text-text-700"}
|
|
56
|
+
`,
|
|
57
|
+
children: month.substring(0, 3)
|
|
58
|
+
},
|
|
59
|
+
month
|
|
60
|
+
)) })
|
|
61
|
+
] })
|
|
62
|
+
]
|
|
63
|
+
}
|
|
64
|
+
);
|
|
65
|
+
var getDayStyles = (day, variant, showActivities) => {
|
|
66
|
+
let dayStyle = "";
|
|
67
|
+
let textStyle = "";
|
|
68
|
+
if (variant === "selection" && day.isSelected) {
|
|
69
|
+
dayStyle = "bg-primary-800";
|
|
70
|
+
textStyle = "text-white";
|
|
71
|
+
} else if (day.isToday) {
|
|
72
|
+
textStyle = "text-[#1c61b2]";
|
|
73
|
+
} else if (variant === "navigation" && showActivities && day.activities?.length) {
|
|
74
|
+
const primaryActivity = day.activities[0];
|
|
75
|
+
if (primaryActivity.status === "near-deadline") {
|
|
76
|
+
dayStyle = "bg-warning-background border-2 border-warning-400";
|
|
77
|
+
textStyle = "text-text-950";
|
|
78
|
+
} else if (primaryActivity.status === "in-deadline") {
|
|
79
|
+
dayStyle = "bg-success-background border-2 border-success-300";
|
|
80
|
+
textStyle = "text-text-950";
|
|
81
|
+
} else if (primaryActivity.status === "overdue") {
|
|
82
|
+
dayStyle = "bg-error-background border-2 border-error-300";
|
|
83
|
+
textStyle = "text-text-950";
|
|
84
|
+
} else {
|
|
85
|
+
dayStyle = "border-2 border-blue-500";
|
|
86
|
+
textStyle = "text-blue-500";
|
|
87
|
+
}
|
|
88
|
+
} else {
|
|
89
|
+
textStyle = "text-text-950 hover:bg-background-100";
|
|
90
|
+
}
|
|
91
|
+
return { dayStyle, textStyle };
|
|
92
|
+
};
|
|
93
|
+
var Calendar = ({
|
|
94
|
+
variant = "selection",
|
|
95
|
+
selectedDate,
|
|
96
|
+
onDateSelect,
|
|
97
|
+
onMonthChange,
|
|
98
|
+
activities = {},
|
|
99
|
+
showActivities = true,
|
|
100
|
+
className = ""
|
|
101
|
+
}) => {
|
|
102
|
+
const [currentDate, setCurrentDate] = useState(selectedDate || /* @__PURE__ */ new Date());
|
|
103
|
+
const [isMonthPickerOpen, setIsMonthPickerOpen] = useState(false);
|
|
104
|
+
const monthPickerRef = useRef(null);
|
|
105
|
+
const monthPickerContainerRef = useRef(null);
|
|
106
|
+
useEffect(() => {
|
|
107
|
+
const handleClickOutside = (event) => {
|
|
108
|
+
if (monthPickerContainerRef.current && !monthPickerContainerRef.current.contains(event.target)) {
|
|
109
|
+
setIsMonthPickerOpen(false);
|
|
110
|
+
}
|
|
111
|
+
};
|
|
112
|
+
if (isMonthPickerOpen) {
|
|
113
|
+
document.addEventListener("mousedown", handleClickOutside);
|
|
114
|
+
}
|
|
115
|
+
return () => {
|
|
116
|
+
document.removeEventListener("mousedown", handleClickOutside);
|
|
117
|
+
};
|
|
118
|
+
}, [isMonthPickerOpen]);
|
|
119
|
+
const today = /* @__PURE__ */ new Date();
|
|
120
|
+
const availableYears = useMemo(() => {
|
|
121
|
+
const currentYear = (/* @__PURE__ */ new Date()).getFullYear();
|
|
122
|
+
const years = [];
|
|
123
|
+
for (let year = currentYear - 10; year <= currentYear + 10; year++) {
|
|
124
|
+
years.push(year);
|
|
125
|
+
}
|
|
126
|
+
return years;
|
|
127
|
+
}, []);
|
|
128
|
+
const calendarData = useMemo(() => {
|
|
129
|
+
const year = currentDate.getFullYear();
|
|
130
|
+
const month = currentDate.getMonth();
|
|
131
|
+
const firstDay = new Date(year, month, 1);
|
|
132
|
+
const startDate = new Date(firstDay);
|
|
133
|
+
const firstDayOfWeek = (firstDay.getDay() + 6) % 7;
|
|
134
|
+
startDate.setDate(startDate.getDate() - firstDayOfWeek);
|
|
135
|
+
const days = [];
|
|
136
|
+
const currentCalendarDate = new Date(startDate);
|
|
137
|
+
for (let i = 0; i < 42; i++) {
|
|
138
|
+
const dateKey = currentCalendarDate.toISOString().split("T")[0];
|
|
139
|
+
const dayActivities = activities[dateKey] || [];
|
|
140
|
+
days.push({
|
|
141
|
+
date: new Date(currentCalendarDate),
|
|
142
|
+
isCurrentMonth: currentCalendarDate.getMonth() === month,
|
|
143
|
+
isToday: currentCalendarDate.getFullYear() === today.getFullYear() && currentCalendarDate.getMonth() === today.getMonth() && currentCalendarDate.getDate() === today.getDate(),
|
|
144
|
+
isSelected: selectedDate ? currentCalendarDate.getFullYear() === selectedDate.getFullYear() && currentCalendarDate.getMonth() === selectedDate.getMonth() && currentCalendarDate.getDate() === selectedDate.getDate() : false,
|
|
145
|
+
activities: dayActivities
|
|
146
|
+
});
|
|
147
|
+
currentCalendarDate.setDate(currentCalendarDate.getDate() + 1);
|
|
148
|
+
}
|
|
149
|
+
return days;
|
|
150
|
+
}, [currentDate, selectedDate, activities]);
|
|
151
|
+
const goToPreviousMonth = () => {
|
|
152
|
+
const newDate = new Date(currentDate);
|
|
153
|
+
newDate.setMonth(newDate.getMonth() - 1);
|
|
154
|
+
setCurrentDate(newDate);
|
|
155
|
+
onMonthChange?.(newDate);
|
|
156
|
+
};
|
|
157
|
+
const goToNextMonth = () => {
|
|
158
|
+
const newDate = new Date(currentDate);
|
|
159
|
+
newDate.setMonth(newDate.getMonth() + 1);
|
|
160
|
+
setCurrentDate(newDate);
|
|
161
|
+
onMonthChange?.(newDate);
|
|
162
|
+
};
|
|
163
|
+
const goToMonth = (month, year) => {
|
|
164
|
+
const newDate = new Date(year, month, 1);
|
|
165
|
+
setCurrentDate(newDate);
|
|
166
|
+
setIsMonthPickerOpen(false);
|
|
167
|
+
onMonthChange?.(newDate);
|
|
168
|
+
};
|
|
169
|
+
const handleYearChange = (year) => {
|
|
170
|
+
const newDate = new Date(year, currentDate.getMonth(), 1);
|
|
171
|
+
setCurrentDate(newDate);
|
|
172
|
+
};
|
|
173
|
+
const toggleMonthPicker = (event) => {
|
|
174
|
+
event.stopPropagation();
|
|
175
|
+
setIsMonthPickerOpen(!isMonthPickerOpen);
|
|
176
|
+
};
|
|
177
|
+
const handleDateSelect = (day) => {
|
|
178
|
+
onDateSelect?.(day.date);
|
|
179
|
+
};
|
|
180
|
+
if (variant === "navigation") {
|
|
181
|
+
return /* @__PURE__ */ jsxs("div", { className: `bg-background rounded-xl p-3 ${className}`, children: [
|
|
182
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between mb-4 px-6", children: [
|
|
183
|
+
/* @__PURE__ */ jsxs("div", { className: "relative", ref: monthPickerContainerRef, children: [
|
|
184
|
+
/* @__PURE__ */ jsxs(
|
|
185
|
+
"button",
|
|
186
|
+
{
|
|
187
|
+
onClick: toggleMonthPicker,
|
|
188
|
+
className: "flex items-center gap-1 hover:bg-background-100 rounded px-2 py-1 transition-colors",
|
|
189
|
+
children: [
|
|
190
|
+
/* @__PURE__ */ jsxs("span", { className: "text-sm font-medium text-text-600", children: [
|
|
191
|
+
MONTH_NAMES[currentDate.getMonth()],
|
|
192
|
+
" ",
|
|
193
|
+
currentDate.getFullYear()
|
|
194
|
+
] }),
|
|
195
|
+
/* @__PURE__ */ jsx(
|
|
196
|
+
"svg",
|
|
197
|
+
{
|
|
198
|
+
className: `w-4 h-4 text-primary-950 transition-transform ${isMonthPickerOpen ? "rotate-180" : ""}`,
|
|
199
|
+
fill: "none",
|
|
200
|
+
stroke: "currentColor",
|
|
201
|
+
viewBox: "0 0 24 24",
|
|
202
|
+
children: /* @__PURE__ */ jsx(
|
|
203
|
+
"path",
|
|
204
|
+
{
|
|
205
|
+
strokeLinecap: "round",
|
|
206
|
+
strokeLinejoin: "round",
|
|
207
|
+
strokeWidth: 2,
|
|
208
|
+
d: "M19 9l-7 7-7-7"
|
|
209
|
+
}
|
|
210
|
+
)
|
|
211
|
+
}
|
|
212
|
+
)
|
|
213
|
+
]
|
|
214
|
+
}
|
|
215
|
+
),
|
|
216
|
+
isMonthPickerOpen && /* @__PURE__ */ jsx(
|
|
217
|
+
MonthYearPicker,
|
|
218
|
+
{
|
|
219
|
+
monthPickerRef,
|
|
220
|
+
availableYears,
|
|
221
|
+
currentDate,
|
|
222
|
+
onYearChange: handleYearChange,
|
|
223
|
+
onMonthChange: goToMonth
|
|
224
|
+
}
|
|
225
|
+
)
|
|
226
|
+
] }),
|
|
227
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-10", children: [
|
|
228
|
+
/* @__PURE__ */ jsx(
|
|
229
|
+
"button",
|
|
230
|
+
{
|
|
231
|
+
onClick: goToPreviousMonth,
|
|
232
|
+
className: "p-1 rounded hover:bg-background-100 transition-colors",
|
|
233
|
+
"aria-label": "M\xEAs anterior",
|
|
234
|
+
children: /* @__PURE__ */ jsx(
|
|
235
|
+
"svg",
|
|
236
|
+
{
|
|
237
|
+
className: "w-6 h-6 text-primary-950",
|
|
238
|
+
fill: "none",
|
|
239
|
+
stroke: "currentColor",
|
|
240
|
+
viewBox: "0 0 24 24",
|
|
241
|
+
children: /* @__PURE__ */ jsx(
|
|
242
|
+
"path",
|
|
243
|
+
{
|
|
244
|
+
strokeLinecap: "round",
|
|
245
|
+
strokeLinejoin: "round",
|
|
246
|
+
strokeWidth: 2,
|
|
247
|
+
d: "M15 19l-7-7 7-7"
|
|
248
|
+
}
|
|
249
|
+
)
|
|
250
|
+
}
|
|
251
|
+
)
|
|
252
|
+
}
|
|
253
|
+
),
|
|
254
|
+
/* @__PURE__ */ jsx(
|
|
255
|
+
"button",
|
|
256
|
+
{
|
|
257
|
+
onClick: goToNextMonth,
|
|
258
|
+
className: "p-1 rounded hover:bg-background-100 transition-colors",
|
|
259
|
+
"aria-label": "Pr\xF3ximo m\xEAs",
|
|
260
|
+
children: /* @__PURE__ */ jsx(
|
|
261
|
+
"svg",
|
|
262
|
+
{
|
|
263
|
+
className: "w-6 h-6 text-primary-950",
|
|
264
|
+
fill: "none",
|
|
265
|
+
stroke: "currentColor",
|
|
266
|
+
viewBox: "0 0 24 24",
|
|
267
|
+
children: /* @__PURE__ */ jsx(
|
|
268
|
+
"path",
|
|
269
|
+
{
|
|
270
|
+
strokeLinecap: "round",
|
|
271
|
+
strokeLinejoin: "round",
|
|
272
|
+
strokeWidth: 2,
|
|
273
|
+
d: "M9 5l7 7-7 7"
|
|
274
|
+
}
|
|
275
|
+
)
|
|
276
|
+
}
|
|
277
|
+
)
|
|
278
|
+
}
|
|
279
|
+
)
|
|
280
|
+
] })
|
|
281
|
+
] }),
|
|
282
|
+
/* @__PURE__ */ jsx("div", { className: "grid grid-cols-7 gap-1 mb-2", children: WEEK_DAYS_SHORT.map((day, index) => /* @__PURE__ */ jsx(
|
|
283
|
+
"div",
|
|
284
|
+
{
|
|
285
|
+
className: "h-9 flex items-center justify-center text-xs font-normal text-text-600",
|
|
286
|
+
children: day
|
|
287
|
+
},
|
|
288
|
+
`${day}-${index}`
|
|
289
|
+
)) }),
|
|
290
|
+
/* @__PURE__ */ jsx("div", { className: "grid grid-cols-7 gap-1", children: calendarData.map((day) => {
|
|
291
|
+
if (!day.isCurrentMonth) {
|
|
292
|
+
return /* @__PURE__ */ jsx(
|
|
293
|
+
"div",
|
|
294
|
+
{
|
|
295
|
+
className: "flex items-center justify-center",
|
|
296
|
+
children: /* @__PURE__ */ jsx("div", { className: "w-9 h-9" })
|
|
297
|
+
},
|
|
298
|
+
day.date.getTime()
|
|
299
|
+
);
|
|
300
|
+
}
|
|
301
|
+
const { dayStyle, textStyle } = getDayStyles(
|
|
302
|
+
day,
|
|
303
|
+
variant,
|
|
304
|
+
showActivities
|
|
305
|
+
);
|
|
306
|
+
let spanClass = "";
|
|
307
|
+
if (day.isSelected && day.isToday) {
|
|
308
|
+
spanClass = "h-6 w-6 rounded-full bg-[#1c61b2] text-text";
|
|
309
|
+
} else if (day.isSelected) {
|
|
310
|
+
spanClass = "h-6 w-6 rounded-full bg-primary-950 text-text";
|
|
311
|
+
}
|
|
312
|
+
return /* @__PURE__ */ jsx(
|
|
313
|
+
"div",
|
|
314
|
+
{
|
|
315
|
+
className: "flex items-center justify-center",
|
|
316
|
+
children: /* @__PURE__ */ jsx(
|
|
317
|
+
"button",
|
|
318
|
+
{
|
|
319
|
+
className: `
|
|
320
|
+
w-9 h-9
|
|
321
|
+
flex items-center justify-center
|
|
322
|
+
text-md font-normal
|
|
323
|
+
cursor-pointer
|
|
324
|
+
rounded-full
|
|
325
|
+
${dayStyle}
|
|
326
|
+
${textStyle}
|
|
327
|
+
`,
|
|
328
|
+
onClick: () => handleDateSelect(day),
|
|
329
|
+
"aria-label": `${day.date.getDate()} de ${MONTH_NAMES[day.date.getMonth()]}`,
|
|
330
|
+
"aria-current": day.isToday ? "date" : void 0,
|
|
331
|
+
tabIndex: 0,
|
|
332
|
+
children: /* @__PURE__ */ jsx("span", { className: spanClass, children: day.date.getDate() })
|
|
333
|
+
}
|
|
334
|
+
)
|
|
335
|
+
},
|
|
336
|
+
day.date.getTime()
|
|
337
|
+
);
|
|
338
|
+
}) })
|
|
339
|
+
] });
|
|
340
|
+
}
|
|
341
|
+
return /* @__PURE__ */ jsxs("div", { className: `bg-background rounded-xl p-4 ${className}`, children: [
|
|
342
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between mb-3.5", children: [
|
|
343
|
+
/* @__PURE__ */ jsxs("div", { className: "relative", ref: monthPickerContainerRef, children: [
|
|
344
|
+
/* @__PURE__ */ jsxs(
|
|
345
|
+
"button",
|
|
346
|
+
{
|
|
347
|
+
onClick: toggleMonthPicker,
|
|
348
|
+
className: "flex items-center gap-2 hover:bg-background-100 rounded px-2 py-1 transition-colors",
|
|
349
|
+
children: [
|
|
350
|
+
/* @__PURE__ */ jsxs("h2", { className: "text-lg font-semibold text-text-950", children: [
|
|
351
|
+
MONTH_NAMES[currentDate.getMonth()],
|
|
352
|
+
" ",
|
|
353
|
+
currentDate.getFullYear()
|
|
354
|
+
] }),
|
|
355
|
+
/* @__PURE__ */ jsx(
|
|
356
|
+
"svg",
|
|
357
|
+
{
|
|
358
|
+
className: `w-4 h-4 text-text-400 transition-transform ${isMonthPickerOpen ? "rotate-180" : ""}`,
|
|
359
|
+
fill: "none",
|
|
360
|
+
stroke: "currentColor",
|
|
361
|
+
viewBox: "0 0 24 24",
|
|
362
|
+
children: /* @__PURE__ */ jsx(
|
|
363
|
+
"path",
|
|
364
|
+
{
|
|
365
|
+
strokeLinecap: "round",
|
|
366
|
+
strokeLinejoin: "round",
|
|
367
|
+
strokeWidth: 2,
|
|
368
|
+
d: "M19 9l-7 7-7-7"
|
|
369
|
+
}
|
|
370
|
+
)
|
|
371
|
+
}
|
|
372
|
+
)
|
|
373
|
+
]
|
|
374
|
+
}
|
|
375
|
+
),
|
|
376
|
+
isMonthPickerOpen && /* @__PURE__ */ jsx(
|
|
377
|
+
MonthYearPicker,
|
|
378
|
+
{
|
|
379
|
+
monthPickerRef,
|
|
380
|
+
availableYears,
|
|
381
|
+
currentDate,
|
|
382
|
+
onYearChange: handleYearChange,
|
|
383
|
+
onMonthChange: goToMonth
|
|
384
|
+
}
|
|
385
|
+
)
|
|
386
|
+
] }),
|
|
387
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-1", children: [
|
|
388
|
+
/* @__PURE__ */ jsx(
|
|
389
|
+
"button",
|
|
390
|
+
{
|
|
391
|
+
onClick: goToPreviousMonth,
|
|
392
|
+
className: "p-1 rounded-md hover:bg-background-100 transition-colors",
|
|
393
|
+
"aria-label": "M\xEAs anterior",
|
|
394
|
+
children: /* @__PURE__ */ jsx(
|
|
395
|
+
"svg",
|
|
396
|
+
{
|
|
397
|
+
className: "w-6 h-6 text-primary-950",
|
|
398
|
+
fill: "none",
|
|
399
|
+
stroke: "currentColor",
|
|
400
|
+
viewBox: "0 0 24 24",
|
|
401
|
+
children: /* @__PURE__ */ jsx(
|
|
402
|
+
"path",
|
|
403
|
+
{
|
|
404
|
+
strokeLinecap: "round",
|
|
405
|
+
strokeLinejoin: "round",
|
|
406
|
+
strokeWidth: 2,
|
|
407
|
+
d: "M15 19l-7-7 7-7"
|
|
408
|
+
}
|
|
409
|
+
)
|
|
410
|
+
}
|
|
411
|
+
)
|
|
412
|
+
}
|
|
413
|
+
),
|
|
414
|
+
/* @__PURE__ */ jsx(
|
|
415
|
+
"button",
|
|
416
|
+
{
|
|
417
|
+
onClick: goToNextMonth,
|
|
418
|
+
className: "p-1 rounded-md hover:bg-background-100 transition-colors",
|
|
419
|
+
"aria-label": "Pr\xF3ximo m\xEAs",
|
|
420
|
+
children: /* @__PURE__ */ jsx(
|
|
421
|
+
"svg",
|
|
422
|
+
{
|
|
423
|
+
className: "w-6 h-6 text-primary-950",
|
|
424
|
+
fill: "none",
|
|
425
|
+
stroke: "currentColor",
|
|
426
|
+
viewBox: "0 0 24 24",
|
|
427
|
+
children: /* @__PURE__ */ jsx(
|
|
428
|
+
"path",
|
|
429
|
+
{
|
|
430
|
+
strokeLinecap: "round",
|
|
431
|
+
strokeLinejoin: "round",
|
|
432
|
+
strokeWidth: 2,
|
|
433
|
+
d: "M9 5l7 7-7 7"
|
|
434
|
+
}
|
|
435
|
+
)
|
|
436
|
+
}
|
|
437
|
+
)
|
|
438
|
+
}
|
|
439
|
+
)
|
|
440
|
+
] })
|
|
441
|
+
] }),
|
|
442
|
+
/* @__PURE__ */ jsx("div", { className: "grid grid-cols-7 gap-1 mb-2", children: WEEK_DAYS.map((day) => /* @__PURE__ */ jsx(
|
|
443
|
+
"div",
|
|
444
|
+
{
|
|
445
|
+
className: "h-4 flex items-center justify-center text-xs font-semibold text-text-500",
|
|
446
|
+
children: day
|
|
447
|
+
},
|
|
448
|
+
day
|
|
449
|
+
)) }),
|
|
450
|
+
/* @__PURE__ */ jsx("div", { className: "grid grid-cols-7 gap-1", children: calendarData.map((day) => {
|
|
451
|
+
if (!day.isCurrentMonth) {
|
|
452
|
+
return /* @__PURE__ */ jsx(
|
|
453
|
+
"div",
|
|
454
|
+
{
|
|
455
|
+
className: "flex items-center justify-center",
|
|
456
|
+
children: /* @__PURE__ */ jsx("div", { className: "w-10 h-10" })
|
|
457
|
+
},
|
|
458
|
+
day.date.getTime()
|
|
459
|
+
);
|
|
460
|
+
}
|
|
461
|
+
const { dayStyle, textStyle } = getDayStyles(
|
|
462
|
+
day,
|
|
463
|
+
variant,
|
|
464
|
+
showActivities
|
|
465
|
+
);
|
|
466
|
+
return /* @__PURE__ */ jsx(
|
|
467
|
+
"div",
|
|
468
|
+
{
|
|
469
|
+
className: "flex items-center justify-center",
|
|
470
|
+
children: /* @__PURE__ */ jsx(
|
|
471
|
+
"button",
|
|
472
|
+
{
|
|
473
|
+
className: `
|
|
474
|
+
w-10 h-10
|
|
475
|
+
flex items-center justify-center
|
|
476
|
+
text-xl font-normal
|
|
477
|
+
cursor-pointer
|
|
478
|
+
rounded-full
|
|
479
|
+
focus:outline-none focus:ring-2 focus:ring-primary-600 focus:ring-offset-1
|
|
480
|
+
${dayStyle}
|
|
481
|
+
${textStyle}
|
|
482
|
+
`,
|
|
483
|
+
onClick: () => handleDateSelect(day),
|
|
484
|
+
"aria-label": `${day.date.getDate()} de ${MONTH_NAMES[day.date.getMonth()]}`,
|
|
485
|
+
"aria-current": day.isToday ? "date" : void 0,
|
|
486
|
+
tabIndex: 0,
|
|
487
|
+
children: day.date.getDate()
|
|
488
|
+
}
|
|
489
|
+
)
|
|
490
|
+
},
|
|
491
|
+
day.date.getTime()
|
|
492
|
+
);
|
|
493
|
+
}) })
|
|
494
|
+
] });
|
|
495
|
+
};
|
|
496
|
+
var Calendar_default = Calendar;
|
|
497
|
+
export {
|
|
498
|
+
WEEK_DAYS,
|
|
499
|
+
Calendar_default as default
|
|
500
|
+
};
|
|
501
|
+
//# sourceMappingURL=index.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/components/Calendar/Calendar.tsx"],"sourcesContent":["import React, { useState, useMemo, useEffect, useRef } from 'react';\n\n/**\n * Activity status types for calendar days\n */\nexport type ActivityStatus = 'near-deadline' | 'overdue' | 'in-deadline';\n\n/**\n * Activity data for a specific day\n */\nexport interface CalendarActivity {\n id: string;\n status: ActivityStatus;\n title?: string;\n}\n\n/**\n * Calendar day data\n */\nexport interface CalendarDay {\n date: Date;\n isCurrentMonth: boolean;\n isToday: boolean;\n isSelected: boolean;\n activities?: CalendarActivity[];\n}\n\n/**\n * Calendar variant types\n */\nexport type CalendarVariant = 'navigation' | 'selection';\n\n/**\n * Calendar component props\n */\nexport interface CalendarProps {\n /** Calendar variant - navigation (compact) or selection (full) */\n variant?: CalendarVariant;\n /** Currently selected date */\n selectedDate?: Date;\n /** Function called when a date is selected */\n onDateSelect?: (date: Date) => void;\n /** Function called when month changes */\n onMonthChange?: (date: Date) => void;\n /** Activities data for calendar days */\n activities?: Record<string, CalendarActivity[]>;\n /** Show activities indicators */\n showActivities?: boolean;\n /** Additional CSS classes */\n className?: string;\n}\n\n/**\n * Day names abbreviations\n */\nexport const WEEK_DAYS = ['SEG', 'TER', 'QUA', 'QUI', 'SEX', 'SÁB', 'DOM'];\n\n/**\n * Day names single-letter abbreviations\n */\nconst WEEK_DAYS_SHORT = ['S', 'T', 'Q', 'Q', 'S', 'S', 'D'];\n\n/**\n * Month names in Portuguese\n */\nconst MONTH_NAMES = [\n 'Janeiro',\n 'Fevereiro',\n 'Março',\n 'Abril',\n 'Maio',\n 'Junho',\n 'Julho',\n 'Agosto',\n 'Setembro',\n 'Outubro',\n 'Novembro',\n 'Dezembro',\n];\n\n/**\n * Month/Year picker props\n */\ninterface MonthYearPickerProps {\n monthPickerRef: React.RefObject<HTMLDivElement | null>;\n availableYears: number[];\n currentDate: Date;\n onYearChange: (year: number) => void;\n onMonthChange: (month: number, year: number) => void;\n}\n\n/**\n * Month/Year picker component\n */\nconst MonthYearPicker: React.FC<MonthYearPickerProps> = ({\n monthPickerRef,\n availableYears,\n currentDate,\n onYearChange,\n onMonthChange,\n}) => (\n <div\n ref={monthPickerRef}\n className=\"absolute top-full left-0 z-50 mt-1 bg-white rounded-lg shadow-lg border border-border-200 p-4 min-w-[280px]\"\n >\n <div className=\"mb-4\">\n <h3 className=\"text-sm font-medium text-text-700 mb-2\">Selecionar Ano</h3>\n <div className=\"grid grid-cols-4 gap-1 max-h-32 overflow-y-auto\">\n {availableYears.map((year) => (\n <button\n key={year}\n onClick={() => onYearChange(year)}\n className={`\n px-2 py-1 text-xs rounded text-center hover:bg-background-100 transition-colors\n ${\n year === currentDate.getFullYear()\n ? 'bg-primary-800 text-text font-medium hover:text-text-950'\n : 'text-text-700'\n }\n `}\n >\n {year}\n </button>\n ))}\n </div>\n </div>\n\n <div>\n <h3 className=\"text-sm font-medium text-text-700 mb-2\">Selecionar Mês</h3>\n <div className=\"grid grid-cols-3 gap-1\">\n {MONTH_NAMES.map((month, index) => (\n <button\n key={month}\n onClick={() => onMonthChange(index, currentDate.getFullYear())}\n className={`\n px-2 py-2 text-xs rounded text-center hover:bg-background-100 transition-colors\n ${\n index === currentDate.getMonth()\n ? 'bg-primary-800 text-text font-medium hover:text-text-950'\n : 'text-text-700'\n }\n `}\n >\n {month.substring(0, 3)}\n </button>\n ))}\n </div>\n </div>\n </div>\n);\n\n/**\n * Helper function to get day styles based on variant and conditions\n */\nconst getDayStyles = (\n day: CalendarDay,\n variant: CalendarVariant,\n showActivities: boolean\n) => {\n let dayStyle = '';\n let textStyle = '';\n\n if (variant === 'selection' && day.isSelected) {\n dayStyle = 'bg-primary-800';\n textStyle = 'text-white';\n } else if (day.isToday) {\n textStyle = 'text-[#1c61b2]';\n } else if (\n variant === 'navigation' &&\n showActivities &&\n day.activities?.length\n ) {\n const primaryActivity = day.activities[0];\n if (primaryActivity.status === 'near-deadline') {\n dayStyle = 'bg-warning-background border-2 border-warning-400';\n textStyle = 'text-text-950';\n } else if (primaryActivity.status === 'in-deadline') {\n dayStyle = 'bg-success-background border-2 border-success-300';\n textStyle = 'text-text-950';\n } else if (primaryActivity.status === 'overdue') {\n dayStyle = 'bg-error-background border-2 border-error-300';\n textStyle = 'text-text-950';\n } else {\n dayStyle = 'border-2 border-blue-500';\n textStyle = 'text-blue-500';\n }\n } else {\n textStyle = 'text-text-950 hover:bg-background-100';\n }\n\n return { dayStyle, textStyle };\n};\n\n/**\n * Calendar component for Analytica Ensino platforms\n *\n * A comprehensive calendar component with activity indicators,\n * date selection, and navigation capabilities.\n */\nconst Calendar = ({\n variant = 'selection',\n selectedDate,\n onDateSelect,\n onMonthChange,\n activities = {},\n showActivities = true,\n className = '',\n}: CalendarProps) => {\n const [currentDate, setCurrentDate] = useState(selectedDate || new Date());\n const [isMonthPickerOpen, setIsMonthPickerOpen] = useState(false);\n const monthPickerRef = useRef<HTMLDivElement>(null);\n const monthPickerContainerRef = useRef<HTMLDivElement>(null);\n\n // Close month picker when clicking outside\n useEffect(() => {\n const handleClickOutside = (event: MouseEvent) => {\n if (\n monthPickerContainerRef.current &&\n !monthPickerContainerRef.current.contains(event.target as Node)\n ) {\n setIsMonthPickerOpen(false);\n }\n };\n\n if (isMonthPickerOpen) {\n document.addEventListener('mousedown', handleClickOutside);\n }\n\n return () => {\n document.removeEventListener('mousedown', handleClickOutside);\n };\n }, [isMonthPickerOpen]);\n\n // Get today's date for comparison\n const today = new Date();\n\n // Generate available years (current year ± 10 years)\n const availableYears = useMemo(() => {\n const currentYear = new Date().getFullYear();\n const years = [];\n for (let year = currentYear - 10; year <= currentYear + 10; year++) {\n years.push(year);\n }\n return years;\n }, []);\n\n // Calculate calendar data\n const calendarData = useMemo(() => {\n const year = currentDate.getFullYear();\n const month = currentDate.getMonth();\n\n // First day of the month\n const firstDay = new Date(year, month, 1);\n\n // Get the first Monday of the calendar view\n const startDate = new Date(firstDay);\n const firstDayOfWeek = (firstDay.getDay() + 6) % 7; // Convert Sunday=0 to Monday=0\n startDate.setDate(startDate.getDate() - firstDayOfWeek);\n\n const days: CalendarDay[] = [];\n const currentCalendarDate = new Date(startDate);\n\n // Generate 42 days (6 weeks)\n for (let i = 0; i < 42; i++) {\n const dateKey = currentCalendarDate.toISOString().split('T')[0];\n const dayActivities = activities[dateKey] || [];\n\n days.push({\n date: new Date(currentCalendarDate),\n isCurrentMonth: currentCalendarDate.getMonth() === month,\n isToday:\n currentCalendarDate.getFullYear() === today.getFullYear() &&\n currentCalendarDate.getMonth() === today.getMonth() &&\n currentCalendarDate.getDate() === today.getDate(),\n isSelected: selectedDate\n ? currentCalendarDate.getFullYear() === selectedDate.getFullYear() &&\n currentCalendarDate.getMonth() === selectedDate.getMonth() &&\n currentCalendarDate.getDate() === selectedDate.getDate()\n : false,\n activities: dayActivities,\n });\n\n currentCalendarDate.setDate(currentCalendarDate.getDate() + 1);\n }\n\n return days;\n }, [currentDate, selectedDate, activities]);\n\n // Navigation functions\n const goToPreviousMonth = () => {\n const newDate = new Date(currentDate);\n newDate.setMonth(newDate.getMonth() - 1);\n setCurrentDate(newDate);\n onMonthChange?.(newDate);\n };\n\n const goToNextMonth = () => {\n const newDate = new Date(currentDate);\n newDate.setMonth(newDate.getMonth() + 1);\n setCurrentDate(newDate);\n onMonthChange?.(newDate);\n };\n\n // Month/Year selection functions\n const goToMonth = (month: number, year: number) => {\n const newDate = new Date(year, month, 1);\n setCurrentDate(newDate);\n setIsMonthPickerOpen(false);\n onMonthChange?.(newDate);\n };\n\n const handleYearChange = (year: number) => {\n const newDate = new Date(year, currentDate.getMonth(), 1);\n setCurrentDate(newDate);\n };\n\n const toggleMonthPicker = (event: React.MouseEvent<HTMLButtonElement>) => {\n event.stopPropagation();\n setIsMonthPickerOpen(!isMonthPickerOpen);\n };\n\n // Date selection handler\n const handleDateSelect = (day: CalendarDay) => {\n onDateSelect?.(day.date);\n };\n\n // Navigation variant (compact)\n if (variant === 'navigation') {\n return (\n <div className={`bg-background rounded-xl p-3 ${className}`}>\n {/* Compact header */}\n <div className=\"flex items-center justify-between mb-4 px-6\">\n <div className=\"relative\" ref={monthPickerContainerRef}>\n <button\n onClick={toggleMonthPicker}\n className=\"flex items-center gap-1 hover:bg-background-100 rounded px-2 py-1 transition-colors\"\n >\n <span className=\"text-sm font-medium text-text-600\">\n {MONTH_NAMES[currentDate.getMonth()]}{' '}\n {currentDate.getFullYear()}\n </span>\n <svg\n className={`w-4 h-4 text-primary-950 transition-transform ${\n isMonthPickerOpen ? 'rotate-180' : ''\n }`}\n fill=\"none\"\n stroke=\"currentColor\"\n viewBox=\"0 0 24 24\"\n >\n <path\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n strokeWidth={2}\n d=\"M19 9l-7 7-7-7\"\n />\n </svg>\n </button>\n {isMonthPickerOpen && (\n <MonthYearPicker\n monthPickerRef={monthPickerRef}\n availableYears={availableYears}\n currentDate={currentDate}\n onYearChange={handleYearChange}\n onMonthChange={goToMonth}\n />\n )}\n </div>\n <div className=\"flex items-center gap-10\">\n <button\n onClick={goToPreviousMonth}\n className=\"p-1 rounded hover:bg-background-100 transition-colors\"\n aria-label=\"Mês anterior\"\n >\n <svg\n className=\"w-6 h-6 text-primary-950\"\n fill=\"none\"\n stroke=\"currentColor\"\n viewBox=\"0 0 24 24\"\n >\n <path\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n strokeWidth={2}\n d=\"M15 19l-7-7 7-7\"\n />\n </svg>\n </button>\n <button\n onClick={goToNextMonth}\n className=\"p-1 rounded hover:bg-background-100 transition-colors\"\n aria-label=\"Próximo mês\"\n >\n <svg\n className=\"w-6 h-6 text-primary-950\"\n fill=\"none\"\n stroke=\"currentColor\"\n viewBox=\"0 0 24 24\"\n >\n <path\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n strokeWidth={2}\n d=\"M9 5l7 7-7 7\"\n />\n </svg>\n </button>\n </div>\n </div>\n\n {/* Compact week days */}\n <div className=\"grid grid-cols-7 gap-1 mb-2\">\n {WEEK_DAYS_SHORT.map((day, index) => (\n <div\n key={`${day}-${index}`}\n className=\"h-9 flex items-center justify-center text-xs font-normal text-text-600\"\n >\n {day}\n </div>\n ))}\n </div>\n\n {/* Compact calendar grid */}\n <div className=\"grid grid-cols-7 gap-1\">\n {calendarData.map((day) => {\n // Não renderizar dias que não pertencem ao mês atual\n if (!day.isCurrentMonth) {\n return (\n <div\n key={day.date.getTime()}\n className=\"flex items-center justify-center\"\n >\n <div className=\"w-9 h-9\"></div>\n </div>\n );\n }\n\n const { dayStyle, textStyle } = getDayStyles(\n day,\n variant,\n showActivities\n );\n\n let spanClass = '';\n if (day.isSelected && day.isToday) {\n spanClass = 'h-6 w-6 rounded-full bg-[#1c61b2] text-text';\n } else if (day.isSelected) {\n spanClass = 'h-6 w-6 rounded-full bg-primary-950 text-text';\n }\n\n return (\n <div\n key={day.date.getTime()}\n className=\"flex items-center justify-center\"\n >\n <button\n className={`\n w-9 h-9 \n flex items-center justify-center \n text-md font-normal \n cursor-pointer \n rounded-full\n ${dayStyle} \n ${textStyle}\n `}\n onClick={() => handleDateSelect(day)}\n aria-label={`${day.date.getDate()} de ${MONTH_NAMES[day.date.getMonth()]}`}\n aria-current={day.isToday ? 'date' : undefined}\n tabIndex={0}\n >\n <span className={spanClass}>{day.date.getDate()}</span>\n </button>\n </div>\n );\n })}\n </div>\n </div>\n );\n }\n\n // Selection variant (full)\n return (\n <div className={`bg-background rounded-xl p-4 ${className}`}>\n {/* Full header */}\n <div className=\"flex items-center justify-between mb-3.5\">\n <div className=\"relative\" ref={monthPickerContainerRef}>\n <button\n onClick={toggleMonthPicker}\n className=\"flex items-center gap-2 hover:bg-background-100 rounded px-2 py-1 transition-colors\"\n >\n <h2 className=\"text-lg font-semibold text-text-950\">\n {MONTH_NAMES[currentDate.getMonth()]} {currentDate.getFullYear()}\n </h2>\n <svg\n className={`w-4 h-4 text-text-400 transition-transform ${\n isMonthPickerOpen ? 'rotate-180' : ''\n }`}\n fill=\"none\"\n stroke=\"currentColor\"\n viewBox=\"0 0 24 24\"\n >\n <path\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n strokeWidth={2}\n d=\"M19 9l-7 7-7-7\"\n />\n </svg>\n </button>\n {isMonthPickerOpen && (\n <MonthYearPicker\n monthPickerRef={monthPickerRef}\n availableYears={availableYears}\n currentDate={currentDate}\n onYearChange={handleYearChange}\n onMonthChange={goToMonth}\n />\n )}\n </div>\n <div className=\"flex items-center gap-1\">\n <button\n onClick={goToPreviousMonth}\n className=\"p-1 rounded-md hover:bg-background-100 transition-colors\"\n aria-label=\"Mês anterior\"\n >\n <svg\n className=\"w-6 h-6 text-primary-950\"\n fill=\"none\"\n stroke=\"currentColor\"\n viewBox=\"0 0 24 24\"\n >\n <path\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n strokeWidth={2}\n d=\"M15 19l-7-7 7-7\"\n />\n </svg>\n </button>\n <button\n onClick={goToNextMonth}\n className=\"p-1 rounded-md hover:bg-background-100 transition-colors\"\n aria-label=\"Próximo mês\"\n >\n <svg\n className=\"w-6 h-6 text-primary-950\"\n fill=\"none\"\n stroke=\"currentColor\"\n viewBox=\"0 0 24 24\"\n >\n <path\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n strokeWidth={2}\n d=\"M9 5l7 7-7 7\"\n />\n </svg>\n </button>\n </div>\n </div>\n\n {/* Week days header */}\n <div className=\"grid grid-cols-7 gap-1 mb-2\">\n {WEEK_DAYS.map((day) => (\n <div\n key={day}\n className=\"h-4 flex items-center justify-center text-xs font-semibold text-text-500\"\n >\n {day}\n </div>\n ))}\n </div>\n\n {/* Calendar grid */}\n <div className=\"grid grid-cols-7 gap-1\">\n {calendarData.map((day) => {\n // Não renderizar dias que não pertencem ao mês atual\n if (!day.isCurrentMonth) {\n return (\n <div\n key={day.date.getTime()}\n className=\"flex items-center justify-center\"\n >\n <div className=\"w-10 h-10\"></div>\n </div>\n );\n }\n\n const { dayStyle, textStyle } = getDayStyles(\n day,\n variant,\n showActivities\n );\n\n return (\n <div\n key={day.date.getTime()}\n className=\"flex items-center justify-center\"\n >\n <button\n className={`\n w-10 h-10 \n flex items-center justify-center \n text-xl font-normal \n cursor-pointer \n rounded-full\n focus:outline-none focus:ring-2 focus:ring-primary-600 focus:ring-offset-1\n ${dayStyle} \n ${textStyle}\n `}\n onClick={() => handleDateSelect(day)}\n aria-label={`${day.date.getDate()} de ${MONTH_NAMES[day.date.getMonth()]}`}\n aria-current={day.isToday ? 'date' : undefined}\n tabIndex={0}\n >\n {day.date.getDate()}\n </button>\n </div>\n );\n })}\n </div>\n </div>\n );\n};\n\nexport default Calendar;\n"],"mappings":";AAAA,SAAgB,UAAU,SAAS,WAAW,cAAc;AAyGxD,SACE,KADF;AAlDG,IAAM,YAAY,CAAC,OAAO,OAAO,OAAO,OAAO,OAAO,UAAO,KAAK;AAKzE,IAAM,kBAAkB,CAAC,KAAK,KAAK,KAAK,KAAK,KAAK,KAAK,GAAG;AAK1D,IAAM,cAAc;AAAA,EAClB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF;AAgBA,IAAM,kBAAkD,CAAC;AAAA,EACvD;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,MACE;AAAA,EAAC;AAAA;AAAA,IACC,KAAK;AAAA,IACL,WAAU;AAAA,IAEV;AAAA,2BAAC,SAAI,WAAU,QACb;AAAA,4BAAC,QAAG,WAAU,0CAAyC,4BAAc;AAAA,QACrE,oBAAC,SAAI,WAAU,mDACZ,yBAAe,IAAI,CAAC,SACnB;AAAA,UAAC;AAAA;AAAA,YAEC,SAAS,MAAM,aAAa,IAAI;AAAA,YAChC,WAAW;AAAA;AAAA,gBAGP,SAAS,YAAY,YAAY,IAC7B,6DACA,eACN;AAAA;AAAA,YAGD;AAAA;AAAA,UAXI;AAAA,QAYP,CACD,GACH;AAAA,SACF;AAAA,MAEA,qBAAC,SACC;AAAA,4BAAC,QAAG,WAAU,0CAAyC,+BAAc;AAAA,QACrE,oBAAC,SAAI,WAAU,0BACZ,sBAAY,IAAI,CAAC,OAAO,UACvB;AAAA,UAAC;AAAA;AAAA,YAEC,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