analytica-frontend-lib 1.0.52 → 1.0.54

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.
@@ -92,7 +92,7 @@ var getDayStyles = (day, variant, showActivities) => {
92
92
  let textStyle = "";
93
93
  if (variant === "selection" && day.isSelected) {
94
94
  dayStyle = "bg-primary-800";
95
- textStyle = "text-white";
95
+ textStyle = "text-text";
96
96
  } else if (day.isToday) {
97
97
  textStyle = "text-primary-800";
98
98
  } else if (variant === "navigation" && showActivities && day.activities?.length) {
@@ -464,7 +464,7 @@ var Calendar = ({
464
464
  )
465
465
  ] })
466
466
  ] }),
467
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "grid grid-cols-7 gap-1 mb-2", children: WEEK_DAYS.map((day) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
467
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "grid grid-cols-7 mb-2", children: WEEK_DAYS.map((day) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
468
468
  "div",
469
469
  {
470
470
  className: "h-4 flex items-center justify-center text-xs font-semibold text-text-500",
@@ -472,7 +472,7 @@ var Calendar = ({
472
472
  },
473
473
  day
474
474
  )) }),
475
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "grid grid-cols-7 gap-1", children: calendarData.map((day) => {
475
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "grid grid-cols-7", children: calendarData.map((day) => {
476
476
  if (!day.isCurrentMonth) {
477
477
  return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
478
478
  "div",
@@ -496,9 +496,9 @@ var Calendar = ({
496
496
  "button",
497
497
  {
498
498
  className: `
499
- w-10 h-10
499
+ w-9 h-9
500
500
  flex items-center justify-center
501
- text-xl font-normal
501
+ text-lg font-normal
502
502
  cursor-pointer
503
503
  rounded-full
504
504
  focus:outline-none focus:ring-2 focus:ring-primary-600 focus:ring-offset-1
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/components/Calendar/Calendar.tsx"],"sourcesContent":["import {\n useState,\n useMemo,\n useEffect,\n useRef,\n MouseEvent,\n RefObject,\n} 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: 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 = ({\n monthPickerRef,\n availableYears,\n currentDate,\n onYearChange,\n onMonthChange,\n}: MonthYearPickerProps) => (\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-primary-800';\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: Event) => {\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: 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-primary-800 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,mBAOO;AAyGH;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,kBAAkB,CAAC;AAAA,EACvB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,MACE;AAAA,EAAC;AAAA;AAAA,IACC,KAAK;AAAA,IACL,WAAU;AAAA,IAEV;AAAA,mDAAC,SAAI,WAAU,QACb;AAAA,oDAAC,QAAG,WAAU,0CAAyC,4BAAc;AAAA,QACrE,4CAAC,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,QA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AQ,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":[]}
1
+ {"version":3,"sources":["../../src/components/Calendar/Calendar.tsx"],"sourcesContent":["import {\n useState,\n useMemo,\n useEffect,\n useRef,\n MouseEvent,\n RefObject,\n} 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: 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 = ({\n monthPickerRef,\n availableYears,\n currentDate,\n onYearChange,\n onMonthChange,\n}: MonthYearPickerProps) => (\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-text';\n } else if (day.isToday) {\n textStyle = 'text-primary-800';\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: Event) => {\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: 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-primary-800 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 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\">\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-9 h-9\n flex items-center justify-center\n text-lg 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,mBAOO;AAyGH;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,kBAAkB,CAAC;AAAA,EACvB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,MACE;AAAA,EAAC;AAAA;AAAA,IACC,KAAK;AAAA,IACL,WAAU;AAAA,IAEV;AAAA,mDAAC,SAAI,WAAU,QACb;AAAA,oDAAC,QAAG,WA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ACF;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":[]}
@@ -72,7 +72,7 @@ var getDayStyles = (day, variant, showActivities) => {
72
72
  let textStyle = "";
73
73
  if (variant === "selection" && day.isSelected) {
74
74
  dayStyle = "bg-primary-800";
75
- textStyle = "text-white";
75
+ textStyle = "text-text";
76
76
  } else if (day.isToday) {
77
77
  textStyle = "text-primary-800";
78
78
  } else if (variant === "navigation" && showActivities && day.activities?.length) {
@@ -444,7 +444,7 @@ var Calendar = ({
444
444
  )
445
445
  ] })
446
446
  ] }),
447
- /* @__PURE__ */ jsx("div", { className: "grid grid-cols-7 gap-1 mb-2", children: WEEK_DAYS.map((day) => /* @__PURE__ */ jsx(
447
+ /* @__PURE__ */ jsx("div", { className: "grid grid-cols-7 mb-2", children: WEEK_DAYS.map((day) => /* @__PURE__ */ jsx(
448
448
  "div",
449
449
  {
450
450
  className: "h-4 flex items-center justify-center text-xs font-semibold text-text-500",
@@ -452,7 +452,7 @@ var Calendar = ({
452
452
  },
453
453
  day
454
454
  )) }),
455
- /* @__PURE__ */ jsx("div", { className: "grid grid-cols-7 gap-1", children: calendarData.map((day) => {
455
+ /* @__PURE__ */ jsx("div", { className: "grid grid-cols-7", children: calendarData.map((day) => {
456
456
  if (!day.isCurrentMonth) {
457
457
  return /* @__PURE__ */ jsx(
458
458
  "div",
@@ -476,9 +476,9 @@ var Calendar = ({
476
476
  "button",
477
477
  {
478
478
  className: `
479
- w-10 h-10
479
+ w-9 h-9
480
480
  flex items-center justify-center
481
- text-xl font-normal
481
+ text-lg font-normal
482
482
  cursor-pointer
483
483
  rounded-full
484
484
  focus:outline-none focus:ring-2 focus:ring-primary-600 focus:ring-offset-1
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/components/Calendar/Calendar.tsx"],"sourcesContent":["import {\n useState,\n useMemo,\n useEffect,\n useRef,\n MouseEvent,\n RefObject,\n} 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: 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 = ({\n monthPickerRef,\n availableYears,\n currentDate,\n onYearChange,\n onMonthChange,\n}: MonthYearPickerProps) => (\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-primary-800';\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: Event) => {\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: 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-primary-800 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,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OAGK;AAyGH,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,kBAAkB,CAAC;AAAA,EACvB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,MACE;AAAA,EAAC;AAAA;AAAA,IACC,KAAK;AAAA,IACL,WAAU;AAAA,IAEV;AAAA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,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":[]}
1
+ {"version":3,"sources":["../../src/components/Calendar/Calendar.tsx"],"sourcesContent":["import {\n useState,\n useMemo,\n useEffect,\n useRef,\n MouseEvent,\n RefObject,\n} 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: 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 = ({\n monthPickerRef,\n availableYears,\n currentDate,\n onYearChange,\n onMonthChange,\n}: MonthYearPickerProps) => (\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-text';\n } else if (day.isToday) {\n textStyle = 'text-primary-800';\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: Event) => {\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: 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-primary-800 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 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\">\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-9 h-9\n flex items-center justify-center\n text-lg 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,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OAGK;AAyGH,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,EAC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,IAAI,CAAC,QAAQ;AAEzB,UAAI,CAAC,IAAI,gBAAgB;AACvB,eACE;AAAA,UAAC;AAAA;AAAA,YAEC,WAAU;AAAA,YAEV,8BAAC,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":[]}
@@ -27,7 +27,7 @@ declare const MenuLabel: react.ForwardRefExoticComponent<HTMLAttributes<HTMLDivE
27
27
  inset?: boolean;
28
28
  store?: DropdownStoreApi;
29
29
  } & react.RefAttributes<HTMLDivElement>>;
30
- declare const MenuContent: react.ForwardRefExoticComponent<HTMLAttributes<HTMLDivElement> & {
30
+ declare const DropdownMenuContent: react.ForwardRefExoticComponent<HTMLAttributes<HTMLDivElement> & {
31
31
  align?: "start" | "center" | "end";
32
32
  side?: "top" | "right" | "bottom" | "left";
33
33
  variant?: "menu" | "profile";
@@ -65,4 +65,4 @@ declare const ProfileMenuFooter: {
65
65
  displayName: string;
66
66
  };
67
67
 
68
- export { DropdownMenuItem, DropdownMenuSeparator, DropdownMenuTrigger, MenuContent, MenuLabel, ProfileMenuFooter, ProfileMenuHeader, ProfileMenuSection, ProfileMenuTrigger, createDropdownStore, DropdownMenu as default, useDropdownStore };
68
+ export { DropdownMenuContent, DropdownMenuItem, DropdownMenuSeparator, DropdownMenuTrigger, MenuLabel, ProfileMenuFooter, ProfileMenuHeader, ProfileMenuSection, ProfileMenuTrigger, createDropdownStore, DropdownMenu as default, useDropdownStore };
@@ -27,7 +27,7 @@ declare const MenuLabel: react.ForwardRefExoticComponent<HTMLAttributes<HTMLDivE
27
27
  inset?: boolean;
28
28
  store?: DropdownStoreApi;
29
29
  } & react.RefAttributes<HTMLDivElement>>;
30
- declare const MenuContent: react.ForwardRefExoticComponent<HTMLAttributes<HTMLDivElement> & {
30
+ declare const DropdownMenuContent: react.ForwardRefExoticComponent<HTMLAttributes<HTMLDivElement> & {
31
31
  align?: "start" | "center" | "end";
32
32
  side?: "top" | "right" | "bottom" | "left";
33
33
  variant?: "menu" | "profile";
@@ -65,4 +65,4 @@ declare const ProfileMenuFooter: {
65
65
  displayName: string;
66
66
  };
67
67
 
68
- export { DropdownMenuItem, DropdownMenuSeparator, DropdownMenuTrigger, MenuContent, MenuLabel, ProfileMenuFooter, ProfileMenuHeader, ProfileMenuSection, ProfileMenuTrigger, createDropdownStore, DropdownMenu as default, useDropdownStore };
68
+ export { DropdownMenuContent, DropdownMenuItem, DropdownMenuSeparator, DropdownMenuTrigger, MenuLabel, ProfileMenuFooter, ProfileMenuHeader, ProfileMenuSection, ProfileMenuTrigger, createDropdownStore, DropdownMenu as default, useDropdownStore };
@@ -20,10 +20,10 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
20
20
  // src/components/DropdownMenu/DropdownMenu.tsx
21
21
  var DropdownMenu_exports = {};
22
22
  __export(DropdownMenu_exports, {
23
+ DropdownMenuContent: () => DropdownMenuContent,
23
24
  DropdownMenuItem: () => DropdownMenuItem,
24
25
  DropdownMenuSeparator: () => DropdownMenuSeparator,
25
26
  DropdownMenuTrigger: () => DropdownMenuTrigger,
26
- MenuContent: () => MenuContent,
27
27
  MenuLabel: () => MenuLabel,
28
28
  ProfileMenuFooter: () => ProfileMenuFooter,
29
29
  ProfileMenuHeader: () => ProfileMenuHeader,
@@ -251,7 +251,7 @@ var MenuLabel = (0, import_react.forwardRef)(({ className, inset, store: _store,
251
251
  );
252
252
  });
253
253
  MenuLabel.displayName = "MenuLabel";
254
- var MenuContent = (0, import_react.forwardRef)(
254
+ var DropdownMenuContent = (0, import_react.forwardRef)(
255
255
  ({
256
256
  className,
257
257
  align = "start",
@@ -304,7 +304,7 @@ var MenuContent = (0, import_react.forwardRef)(
304
304
  );
305
305
  }
306
306
  );
307
- MenuContent.displayName = "MenuContent";
307
+ DropdownMenuContent.displayName = "DropdownMenuContent";
308
308
  var DropdownMenuItem = (0, import_react.forwardRef)(
309
309
  ({
310
310
  className,
@@ -467,10 +467,10 @@ ProfileMenuFooter.displayName = "ProfileMenuFooter";
467
467
  var DropdownMenu_default = DropdownMenu;
468
468
  // Annotate the CommonJS export names for ESM import in node:
469
469
  0 && (module.exports = {
470
+ DropdownMenuContent,
470
471
  DropdownMenuItem,
471
472
  DropdownMenuSeparator,
472
473
  DropdownMenuTrigger,
473
- MenuContent,
474
474
  MenuLabel,
475
475
  ProfileMenuFooter,
476
476
  ProfileMenuHeader,
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/components/DropdownMenu/DropdownMenu.tsx","../../src/components/Button/Button.tsx"],"sourcesContent":["import { SignOut, User } from 'phosphor-react';\nimport {\n forwardRef,\n ReactNode,\n ButtonHTMLAttributes,\n useEffect,\n useRef,\n HTMLAttributes,\n MouseEvent,\n KeyboardEvent,\n isValidElement,\n Children,\n cloneElement,\n ReactElement,\n useState,\n} from 'react';\nimport { create, StoreApi, useStore } from 'zustand';\nimport Button from '../Button/Button';\n\ninterface DropdownStore {\n open: boolean;\n setOpen: (open: boolean) => void;\n}\n\ntype DropdownStoreApi = StoreApi<DropdownStore>;\n\nexport function createDropdownStore(): DropdownStoreApi {\n return create<DropdownStore>((set) => ({\n open: false,\n setOpen: (open) => set({ open }),\n }));\n}\n\nexport const useDropdownStore = (externalStore?: DropdownStoreApi) => {\n if (!externalStore) {\n throw new Error(\n 'Component must be used within a DropdownMenu (store is missing)'\n );\n }\n\n return externalStore;\n};\n\nconst injectStore = (\n children: ReactNode,\n store: DropdownStoreApi\n): ReactNode => {\n return Children.map(children, (child) => {\n if (isValidElement(child)) {\n const typedChild = child as ReactElement<{\n store?: DropdownStoreApi;\n children?: ReactNode;\n }>;\n\n const newProps: Partial<{\n store: DropdownStoreApi;\n children: ReactNode;\n }> = {\n store,\n };\n\n if (typedChild.props.children) {\n newProps.children = injectStore(typedChild.props.children, store);\n }\n\n return cloneElement(typedChild, newProps);\n }\n return child;\n });\n};\n\ninterface DropdownMenuProps {\n children: ReactNode;\n open?: boolean;\n onOpenChange?: (open: boolean) => void;\n}\n\nconst DropdownMenu = ({\n children,\n open: propOpen,\n onOpenChange,\n}: DropdownMenuProps) => {\n const storeRef = useRef<DropdownStoreApi | null>(null);\n storeRef.current ??= createDropdownStore();\n const store = storeRef.current;\n const { open, setOpen: storeSetOpen } = useStore(store, (s) => s);\n\n const setOpen = (newOpen: boolean) => {\n storeSetOpen(newOpen);\n };\n\n const menuRef = useRef<HTMLDivElement | null>(null);\n\n const handleArrowDownOrArrowUp = (event: globalThis.KeyboardEvent) => {\n const menuContent = menuRef.current?.querySelector('[role=\"menu\"]');\n if (menuContent) {\n event.preventDefault();\n\n const items = Array.from(\n menuContent.querySelectorAll(\n '[role=\"menuitem\"]:not([aria-disabled=\"true\"])'\n )\n ).filter((el): el is HTMLElement => el instanceof HTMLElement);\n\n if (items.length === 0) return;\n\n const focusedItem = document.activeElement as HTMLElement;\n const currentIndex = items.findIndex((item) => item === focusedItem);\n\n let nextIndex;\n if (event.key === 'ArrowDown') {\n nextIndex = currentIndex === -1 ? 0 : (currentIndex + 1) % items.length;\n } else {\n // ArrowUp\n nextIndex =\n currentIndex === -1\n ? items.length - 1\n : (currentIndex - 1 + items.length) % items.length;\n }\n\n items[nextIndex]?.focus();\n }\n };\n\n const handleDownkey = (event: globalThis.KeyboardEvent) => {\n if (event.key === 'Escape') {\n setOpen(false);\n } else if (event.key === 'ArrowDown' || event.key === 'ArrowUp') {\n handleArrowDownOrArrowUp(event);\n }\n };\n\n const handleClickOutside = (event: globalThis.MouseEvent) => {\n if (menuRef.current && !menuRef.current.contains(event.target as Node)) {\n setOpen(false);\n }\n };\n\n useEffect(() => {\n if (open) {\n document.addEventListener('mousedown', handleClickOutside);\n document.addEventListener('keydown', handleDownkey);\n }\n\n return () => {\n document.removeEventListener('mousedown', handleClickOutside);\n document.removeEventListener('keydown', handleDownkey);\n };\n }, [open]);\n\n useEffect(() => {\n setOpen(open);\n onOpenChange?.(open);\n }, [open, onOpenChange]);\n\n useEffect(() => {\n if (propOpen) {\n setOpen(propOpen);\n }\n }, [propOpen]);\n\n return (\n <div className=\"relative\" ref={menuRef}>\n {injectStore(children, store)}\n </div>\n );\n};\n\n// Componentes genéricos do DropdownMenu\nconst DropdownMenuTrigger = ({\n className,\n children,\n onClick,\n store: externalStore,\n ...props\n}: HTMLAttributes<HTMLButtonElement> & {\n disabled?: boolean;\n store?: DropdownStoreApi;\n}) => {\n const store = useDropdownStore(externalStore);\n\n const open = useStore(store, (s) => s.open);\n const toggleOpen = () => store.setState({ open: !open });\n\n return (\n <Button\n variant=\"outline\"\n onClick={(e) => {\n e.stopPropagation();\n toggleOpen();\n if (onClick) onClick(e);\n }}\n aria-expanded={open}\n className={`${className}`}\n {...props}\n >\n {children}\n </Button>\n );\n};\nDropdownMenuTrigger.displayName = 'DropdownMenuTrigger';\n\nconst ITEM_SIZE_CLASSES = {\n small: 'text-sm',\n medium: 'text-md',\n} as const;\n\nconst SIDE_CLASSES = {\n top: 'bottom-full',\n right: 'top-full',\n bottom: 'top-full',\n left: 'top-full',\n};\n\nconst ALIGN_CLASSES = {\n start: 'left-0',\n center: 'left-1/2 -translate-x-1/2',\n end: 'right-0',\n};\n\nconst MENUCONTENT_VARIANT_CLASSES = {\n menu: 'p-1',\n profile: 'p-6',\n};\n\nconst MenuLabel = forwardRef<\n HTMLDivElement,\n HTMLAttributes<HTMLDivElement> & {\n inset?: boolean;\n store?: DropdownStoreApi;\n }\n>(({ className, inset, store: _store, ...props }, ref) => {\n return (\n <div\n ref={ref}\n className={`text-sm w-full ${inset ? 'pl-8' : ''} ${className ?? ''}`}\n {...props}\n />\n );\n});\nMenuLabel.displayName = 'MenuLabel';\n\nconst MenuContent = forwardRef<\n HTMLDivElement,\n HTMLAttributes<HTMLDivElement> & {\n align?: 'start' | 'center' | 'end';\n side?: 'top' | 'right' | 'bottom' | 'left';\n variant?: 'menu' | 'profile';\n sideOffset?: number;\n store?: DropdownStoreApi;\n }\n>(\n (\n {\n className,\n align = 'start',\n side = 'bottom',\n variant = 'menu',\n sideOffset = 4,\n children,\n store: externalStore,\n ...props\n },\n ref\n ) => {\n const store = useDropdownStore(externalStore);\n const open = useStore(store, (s) => s.open);\n const [isVisible, setIsVisible] = useState(open);\n\n useEffect(() => {\n if (open) {\n setIsVisible(true);\n } else {\n const timer = setTimeout(() => setIsVisible(false), 200);\n return () => clearTimeout(timer);\n }\n }, [open]);\n\n if (!isVisible) return null;\n\n const getPositionClasses = () => {\n const vertical = SIDE_CLASSES[side];\n const horizontal = ALIGN_CLASSES[align];\n\n return `absolute ${vertical} ${horizontal}`;\n };\n\n const variantClasses = MENUCONTENT_VARIANT_CLASSES[variant];\n return (\n <div\n ref={ref}\n role=\"menu\"\n className={`\n bg-background z-50 min-w-[210px] overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md border-border-100\n ${open ? 'animate-in fade-in-0 zoom-in-95' : 'animate-out fade-out-0 zoom-out-95'}\n ${getPositionClasses()}\n ${variantClasses}\n ${className}\n `}\n style={{\n marginTop: side === 'bottom' ? sideOffset : undefined,\n marginBottom: side === 'top' ? sideOffset : undefined,\n marginLeft: side === 'right' ? sideOffset : undefined,\n marginRight: side === 'left' ? sideOffset : undefined,\n }}\n {...props}\n >\n {children}\n </div>\n );\n }\n);\nMenuContent.displayName = 'MenuContent';\n\nconst DropdownMenuItem = forwardRef<\n HTMLDivElement,\n HTMLAttributes<HTMLDivElement> & {\n inset?: boolean;\n size?: 'small' | 'medium';\n iconLeft?: ReactNode;\n iconRight?: ReactNode;\n disabled?: boolean;\n variant?: 'profile' | 'menu';\n store?: DropdownStoreApi;\n }\n>(\n (\n {\n className,\n size = 'small',\n children,\n iconRight,\n iconLeft,\n disabled = false,\n onClick,\n variant = 'menu',\n store: externalStore,\n ...props\n },\n ref\n ) => {\n const store = useDropdownStore(externalStore);\n const setOpen = useStore(store, (s) => s.setOpen);\n const sizeClasses = ITEM_SIZE_CLASSES[size];\n\n const handleClick = (\n e: MouseEvent<HTMLDivElement> | KeyboardEvent<HTMLDivElement>\n ) => {\n if (disabled) {\n e.preventDefault();\n e.stopPropagation();\n return;\n }\n onClick?.(e as MouseEvent<HTMLDivElement>);\n setOpen(false);\n };\n\n const getVariantClasses = () => {\n if (variant === 'profile') {\n return 'relative flex flex-row justify-between select-none items-center gap-2 rounded-sm p-4 text-sm outline-none transition-colors [&>svg]:size-6 [&>svg]:shrink-0';\n }\n return 'relative flex select-none items-center gap-2 rounded-sm p-3 text-sm outline-none transition-colors [&>svg]:size-4 [&>svg]:shrink-0';\n };\n\n const getVariantProps = () => {\n return variant === 'profile' ? { 'data-variant': 'profile' } : {};\n };\n\n return (\n <div\n ref={ref}\n role=\"menuitem\"\n {...getVariantProps()}\n aria-disabled={disabled}\n className={`\n focus-visible:bg-background-50\n ${getVariantClasses()}\n ${sizeClasses}\n ${className}\n ${\n disabled\n ? 'cursor-not-allowed text-text-400'\n : 'cursor-pointer hover:bg-background-50 text-text-700 focus:bg-accent focus:text-accent-foreground hover:bg-accent hover:text-accent-foreground'\n }\n `}\n onClick={handleClick}\n onKeyDown={(e) => {\n if (e.key === 'Enter' || e.key === ' ') handleClick(e);\n }}\n tabIndex={disabled ? -1 : 0}\n {...props}\n >\n {iconLeft}\n <span className=\"w-full text-md\">{children}</span>\n {iconRight}\n </div>\n );\n }\n);\nDropdownMenuItem.displayName = 'DropdownMenuItem';\n\nconst DropdownMenuSeparator = forwardRef<\n HTMLDivElement,\n HTMLAttributes<HTMLDivElement> & { store?: DropdownStoreApi }\n>(({ className, store: _store, ...props }, ref) => (\n <div\n ref={ref}\n className={`my-1 h-px bg-border-200 ${className}`}\n {...props}\n />\n));\nDropdownMenuSeparator.displayName = 'DropdownMenuSeparator';\n\n// Componentes específicos do ProfileMenu\nconst ProfileMenuTrigger = forwardRef<\n HTMLButtonElement,\n ButtonHTMLAttributes<HTMLButtonElement> & { store?: DropdownStoreApi }\n>(({ className, onClick, store: externalStore, ...props }, ref) => {\n const store = useDropdownStore(externalStore);\n const open = useStore(store, (s) => s.open);\n const toggleOpen = () => store.setState({ open: !open });\n\n return (\n <button\n ref={ref}\n className={`rounded-lg size-10 bg-background-50 flex items-center justify-center ${className}`}\n onClick={(e) => {\n e.stopPropagation();\n toggleOpen();\n onClick?.(e);\n }}\n aria-expanded={open}\n {...props}\n >\n <span className=\"size-6 rounded-full bg-background-100 flex items-center justify-center\">\n <User className=\"text-background-950\" size={18} />\n </span>\n </button>\n );\n});\nProfileMenuTrigger.displayName = 'ProfileMenuTrigger';\n\nconst ProfileMenuHeader = forwardRef<\n HTMLDivElement,\n HTMLAttributes<HTMLDivElement> & {\n name: string;\n email: string;\n store?: DropdownStoreApi;\n }\n>(({ className, name, email, store: _store, ...props }, ref) => {\n return (\n <div\n ref={ref}\n data-component=\"ProfileMenuHeader\"\n className={`\n flex flex-row gap-4 items-center\n ${className}\n `}\n {...props}\n >\n <span className=\"size-16 bg-background-100 rounded-full flex items-center justify-center\">\n <User size={34} className=\"text-background-950\" />\n </span>\n <div className=\"flex flex-col \">\n <p className=\"text-xl font-bold text-text-950\">{name}</p>\n <p className=\"text-md text-text-600\">{email}</p>\n </div>\n </div>\n );\n});\nProfileMenuHeader.displayName = 'ProfileMenuHeader';\n\nconst ProfileMenuSection = forwardRef<\n HTMLDivElement,\n HTMLAttributes<HTMLDivElement> & { store?: DropdownStoreApi }\n>(({ className, children, store: _store, ...props }, ref) => {\n return (\n <div\n ref={ref}\n className={`\n flex flex-col p-2\n ${className}\n `}\n {...props}\n >\n {children}\n </div>\n );\n});\nProfileMenuSection.displayName = 'ProfileMenuSection';\n\nconst ProfileMenuFooter = ({\n className,\n disabled = false,\n onClick,\n store: externalStore,\n ...props\n}: HTMLAttributes<HTMLButtonElement> & {\n disabled?: boolean;\n store?: DropdownStoreApi;\n}) => {\n const store = useDropdownStore(externalStore);\n const setOpen = useStore(store, (s) => s.setOpen);\n\n return (\n <Button\n variant=\"outline\"\n className={`w-full ${className}`}\n disabled={disabled}\n onClick={(e) => {\n setOpen(false);\n onClick?.(e);\n }}\n {...props}\n >\n <span className=\"mr-2 flex items-center\">\n <SignOut />\n </span>\n <span>Sair</span>\n </Button>\n );\n};\nProfileMenuFooter.displayName = 'ProfileMenuFooter';\n\n// Exportações\nexport default DropdownMenu;\nexport {\n // Componentes genéricos\n DropdownMenuTrigger,\n MenuContent,\n DropdownMenuItem,\n MenuLabel,\n DropdownMenuSeparator,\n\n // Componentes específicos do ProfileMenu\n ProfileMenuTrigger,\n ProfileMenuHeader,\n ProfileMenuSection,\n ProfileMenuFooter,\n};\n","import { ButtonHTMLAttributes, ReactNode } from 'react';\n\n/**\n * Lookup table for variant and action class combinations\n */\nconst VARIANT_ACTION_CLASSES = {\n solid: {\n primary:\n 'bg-primary-950 text-text border border-primary-950 hover:bg-primary-800 hover:border-primary-800 focus-visible:outline-none focus-visible:bg-primary-950 focus-visible:ring-2 focus-visible:ring-offset-0 focus-visible:ring-indicator-info active:bg-primary-700 active:border-primary-700 disabled:bg-primary-500 disabled:border-primary-500 disabled:opacity-40 disabled:cursor-not-allowed',\n positive:\n 'bg-success-500 text-text border border-success-500 hover:bg-success-600 hover:border-success-600 focus-visible:outline-none focus-visible:bg-success-500 focus-visible:ring-2 focus-visible:ring-offset-0 focus-visible:ring-indicator-info active:bg-success-700 active:border-success-700 disabled:bg-success-500 disabled:border-success-500 disabled:opacity-40 disabled:cursor-not-allowed',\n negative:\n 'bg-error-500 text-text border border-error-500 hover:bg-error-600 hover:border-error-600 focus-visible:outline-none focus-visible:bg-error-500 focus-visible:ring-2 focus-visible:ring-offset-0 focus-visible:ring-indicator-info active:bg-error-700 active:border-error-700 disabled:bg-error-500 disabled:border-error-500 disabled:opacity-40 disabled:cursor-not-allowed',\n },\n outline: {\n primary:\n 'bg-transparent text-primary-950 border border-primary-950 hover:bg-background-50 hover:text-primary-400 hover:border-primary-400 focus-visible:border-0 focus-visible:outline-none focus-visible:text-primary-600 focus-visible:ring-2 focus-visible:ring-offset-0 focus-visible:ring-indicator-info active:text-primary-700 active:border-primary-700 disabled:opacity-40 disabled:cursor-not-allowed',\n positive:\n 'bg-transparent text-success-500 border border-success-300 hover:bg-background-50 hover:text-success-400 hover:border-success-400 focus-visible:border-0 focus-visible:outline-none focus-visible:text-success-600 focus-visible:ring-2 focus-visible:ring-offset-0 focus-visible:ring-indicator-info active:text-success-700 active:border-success-700 disabled:opacity-40 disabled:cursor-not-allowed',\n negative:\n 'bg-transparent text-error-500 border border-error-300 hover:bg-background-50 hover:text-error-400 hover:border-error-400 focus-visible:border-0 focus-visible:outline-none focus-visible:text-error-600 focus-visible:ring-2 focus-visible:ring-offset-0 focus-visible:ring-indicator-info active:text-error-700 active:border-error-700 disabled:opacity-40 disabled:cursor-not-allowed',\n },\n link: {\n primary:\n 'bg-transparent text-primary-950 hover:text-primary-400 focus-visible:outline-none focus-visible:text-primary-600 focus-visible:ring-2 focus-visible:ring-offset-0 focus-visible:ring-indicator-info active:text-primary-700 disabled:opacity-40 disabled:cursor-not-allowed',\n positive:\n 'bg-transparent text-success-500 hover:text-success-400 focus-visible:outline-none focus-visible:text-success-600 focus-visible:ring-2 focus-visible:ring-offset-0 focus-visible:ring-indicator-info active:text-success-700 disabled:opacity-40 disabled:cursor-not-allowed',\n negative:\n 'bg-transparent text-error-500 hover:text-error-400 focus-visible:outline-none focus-visible:text-error-600 focus-visible:ring-2 focus-visible:ring-offset-0 focus-visible:ring-indicator-info active:text-error-700 disabled:opacity-40 disabled:cursor-not-allowed',\n },\n} as const;\n\n/**\n * Lookup table for size classes\n */\nconst SIZE_CLASSES = {\n 'extra-small': 'text-xs px-3.5 py-2',\n small: 'text-sm px-4 py-2.5',\n medium: 'text-md px-5 py-2.5',\n large: 'text-lg px-6 py-3',\n 'extra-large': 'text-lg px-7 py-3.5',\n} as const;\n\n/**\n * Button component props interface\n */\ntype ButtonProps = {\n /** Content to be displayed inside the button */\n children: ReactNode;\n /** Ícone à esquerda do texto */\n iconLeft?: ReactNode;\n /** Ícone à direita do texto */\n iconRight?: ReactNode;\n /** Size of the button */\n size?: 'extra-small' | 'small' | 'medium' | 'large' | 'extra-large';\n /** Visual variant of the button */\n variant?: 'solid' | 'outline' | 'link';\n /** Action type of the button */\n action?: 'primary' | 'positive' | 'negative';\n /** Additional CSS classes to apply */\n className?: string;\n} & ButtonHTMLAttributes<HTMLButtonElement>;\n\n/**\n * Button component for Analytica Ensino platforms\n *\n * A flexible button component with multiple variants, sizes and actions.\n *\n * @param children - The content to display inside the button\n * @param size - The size variant (extra-small, small, medium, large, extra-large)\n * @param variant - The visual style variant (solid, outline, link)\n * @param action - The action type (primary, positive, negative)\n * @param className - Additional CSS classes\n * @param props - All other standard button HTML attributes\n * @returns A styled button element\n *\n * @example\n * ```tsx\n * <Button variant=\"solid\" action=\"primary\" size=\"medium\" onClick={() => console.log('clicked')}>\n * Click me\n * </Button>\n * ```\n */\nconst Button = ({\n children,\n iconLeft,\n iconRight,\n size = 'medium',\n variant = 'solid',\n action = 'primary',\n className = '',\n disabled,\n type = 'button',\n ...props\n}: ButtonProps) => {\n // Get classes from lookup tables\n const sizeClasses = SIZE_CLASSES[size];\n const variantClasses = VARIANT_ACTION_CLASSES[variant][action];\n\n const baseClasses =\n 'inline-flex items-center justify-center rounded-full cursor-pointer font-medium';\n\n return (\n <button\n className={`${baseClasses} ${variantClasses} ${sizeClasses} ${className}`}\n disabled={disabled}\n type={type}\n {...props}\n >\n {iconLeft && <span className=\"mr-2 flex items-center\">{iconLeft}</span>}\n {children}\n {iconRight && <span className=\"ml-2 flex items-center\">{iconRight}</span>}\n </button>\n );\n};\n\nexport default Button;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,4BAA8B;AAC9B,mBAcO;AACP,qBAA2C;;;ACuFvC;AAlGJ,IAAM,yBAAyB;AAAA,EAC7B,OAAO;AAAA,IACL,SACE;AAAA,IACF,UACE;AAAA,IACF,UACE;AAAA,EACJ;AAAA,EACA,SAAS;AAAA,IACP,SACE;AAAA,IACF,UACE;AAAA,IACF,UACE;AAAA,EACJ;AAAA,EACA,MAAM;AAAA,IACJ,SACE;AAAA,IACF,UACE;AAAA,IACF,UACE;AAAA,EACJ;AACF;AAKA,IAAM,eAAe;AAAA,EACnB,eAAe;AAAA,EACf,OAAO;AAAA,EACP,QAAQ;AAAA,EACR,OAAO;AAAA,EACP,eAAe;AACjB;AA0CA,IAAM,SAAS,CAAC;AAAA,EACd;AAAA,EACA;AAAA,EACA;AAAA,EACA,OAAO;AAAA,EACP,UAAU;AAAA,EACV,SAAS;AAAA,EACT,YAAY;AAAA,EACZ;AAAA,EACA,OAAO;AAAA,EACP,GAAG;AACL,MAAmB;AAEjB,QAAM,cAAc,aAAa,IAAI;AACrC,QAAM,iBAAiB,uBAAuB,OAAO,EAAE,MAAM;AAE7D,QAAM,cACJ;AAEF,SACE;AAAA,IAAC;AAAA;AAAA,MACC,WAAW,GAAG,WAAW,IAAI,cAAc,I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AAc;AAEhC,IAAM,yBAAqB,yBAGzB,CAAC,EAAE,WAAW,UAAU,OAAO,QAAQ,GAAG,MAAM,GAAG,QAAQ;AAC3D,SACE;AAAA,IAAC;AAAA;AAAA,MACC;AAAA,MACA,WAAW;AAAA;AAAA,YAEL,SAAS;AAAA;AAAA,MAEd,GAAG;AAAA,MAEH;AAAA;AAAA,EACH;AAEJ,CAAC;AACD,mBAAmB,cAAc;AAEjC,IAAM,oBAAoB,CAAC;AAAA,EACzB;AAAA,EACA,WAAW;AAAA,EACX;AAAA,EACA,OAAO;AAAA,EACP,GAAG;AACL,MAGM;AACJ,QAAM,QAAQ,iBAAiB,aAAa;AAC5C,QAAM,cAAU,yBAAS,OAAO,CAAC,MAAM,EAAE,OAAO;AAEhD,SACE;AAAA,IAAC;AAAA;AAAA,MACC,SAAQ;AAAA,MACR,WAAW,UAAU,SAAS;AAAA,MAC9B;AAAA,MACA,SAAS,CAAC,MAAM;AACd,gBAAQ,KAAK;AACb,kBAAU,CAAC;AAAA,MACb;AAAA,MACC,GAAG;AAAA,MAEJ;AAAA,qDAAC,UAAK,WAAU,0BACd,uDAAC,iCAAQ,GACX;AAAA,QACA,6CAAC,UAAK,kBAAI;AAAA;AAAA;AAAA,EACZ;AAEJ;AACA,kBAAkB,cAAc;AAGhC,IAAO,uBAAQ;","names":["import_jsx_runtime"]}
1
+ {"version":3,"sources":["../../src/components/DropdownMenu/DropdownMenu.tsx","../../src/components/Button/Button.tsx"],"sourcesContent":["import { SignOut, User } from 'phosphor-react';\nimport {\n forwardRef,\n ReactNode,\n ButtonHTMLAttributes,\n useEffect,\n useRef,\n HTMLAttributes,\n MouseEvent,\n KeyboardEvent,\n isValidElement,\n Children,\n cloneElement,\n ReactElement,\n useState,\n} from 'react';\nimport { create, StoreApi, useStore } from 'zustand';\nimport Button from '../Button/Button';\n\ninterface DropdownStore {\n open: boolean;\n setOpen: (open: boolean) => void;\n}\n\ntype DropdownStoreApi = StoreApi<DropdownStore>;\n\nexport function createDropdownStore(): DropdownStoreApi {\n return create<DropdownStore>((set) => ({\n open: false,\n setOpen: (open) => set({ open }),\n }));\n}\n\nexport const useDropdownStore = (externalStore?: DropdownStoreApi) => {\n if (!externalStore) {\n throw new Error(\n 'Component must be used within a DropdownMenu (store is missing)'\n );\n }\n\n return externalStore;\n};\n\nconst injectStore = (\n children: ReactNode,\n store: DropdownStoreApi\n): ReactNode => {\n return Children.map(children, (child) => {\n if (isValidElement(child)) {\n const typedChild = child as ReactElement<{\n store?: DropdownStoreApi;\n children?: ReactNode;\n }>;\n\n const newProps: Partial<{\n store: DropdownStoreApi;\n children: ReactNode;\n }> = {\n store,\n };\n\n if (typedChild.props.children) {\n newProps.children = injectStore(typedChild.props.children, store);\n }\n\n return cloneElement(typedChild, newProps);\n }\n return child;\n });\n};\n\ninterface DropdownMenuProps {\n children: ReactNode;\n open?: boolean;\n onOpenChange?: (open: boolean) => void;\n}\n\nconst DropdownMenu = ({\n children,\n open: propOpen,\n onOpenChange,\n}: DropdownMenuProps) => {\n const storeRef = useRef<DropdownStoreApi | null>(null);\n storeRef.current ??= createDropdownStore();\n const store = storeRef.current;\n const { open, setOpen: storeSetOpen } = useStore(store, (s) => s);\n\n const setOpen = (newOpen: boolean) => {\n storeSetOpen(newOpen);\n };\n\n const menuRef = useRef<HTMLDivElement | null>(null);\n\n const handleArrowDownOrArrowUp = (event: globalThis.KeyboardEvent) => {\n const menuContent = menuRef.current?.querySelector('[role=\"menu\"]');\n if (menuContent) {\n event.preventDefault();\n\n const items = Array.from(\n menuContent.querySelectorAll(\n '[role=\"menuitem\"]:not([aria-disabled=\"true\"])'\n )\n ).filter((el): el is HTMLElement => el instanceof HTMLElement);\n\n if (items.length === 0) return;\n\n const focusedItem = document.activeElement as HTMLElement;\n const currentIndex = items.findIndex((item) => item === focusedItem);\n\n let nextIndex;\n if (event.key === 'ArrowDown') {\n nextIndex = currentIndex === -1 ? 0 : (currentIndex + 1) % items.length;\n } else {\n // ArrowUp\n nextIndex =\n currentIndex === -1\n ? items.length - 1\n : (currentIndex - 1 + items.length) % items.length;\n }\n\n items[nextIndex]?.focus();\n }\n };\n\n const handleDownkey = (event: globalThis.KeyboardEvent) => {\n if (event.key === 'Escape') {\n setOpen(false);\n } else if (event.key === 'ArrowDown' || event.key === 'ArrowUp') {\n handleArrowDownOrArrowUp(event);\n }\n };\n\n const handleClickOutside = (event: globalThis.MouseEvent) => {\n if (menuRef.current && !menuRef.current.contains(event.target as Node)) {\n setOpen(false);\n }\n };\n\n useEffect(() => {\n if (open) {\n document.addEventListener('mousedown', handleClickOutside);\n document.addEventListener('keydown', handleDownkey);\n }\n\n return () => {\n document.removeEventListener('mousedown', handleClickOutside);\n document.removeEventListener('keydown', handleDownkey);\n };\n }, [open]);\n\n useEffect(() => {\n setOpen(open);\n onOpenChange?.(open);\n }, [open, onOpenChange]);\n\n useEffect(() => {\n if (propOpen) {\n setOpen(propOpen);\n }\n }, [propOpen]);\n\n return (\n <div className=\"relative\" ref={menuRef}>\n {injectStore(children, store)}\n </div>\n );\n};\n\n// Componentes genéricos do DropdownMenu\nconst DropdownMenuTrigger = ({\n className,\n children,\n onClick,\n store: externalStore,\n ...props\n}: HTMLAttributes<HTMLButtonElement> & {\n disabled?: boolean;\n store?: DropdownStoreApi;\n}) => {\n const store = useDropdownStore(externalStore);\n\n const open = useStore(store, (s) => s.open);\n const toggleOpen = () => store.setState({ open: !open });\n\n return (\n <Button\n variant=\"outline\"\n onClick={(e) => {\n e.stopPropagation();\n toggleOpen();\n if (onClick) onClick(e);\n }}\n aria-expanded={open}\n className={`${className}`}\n {...props}\n >\n {children}\n </Button>\n );\n};\nDropdownMenuTrigger.displayName = 'DropdownMenuTrigger';\n\nconst ITEM_SIZE_CLASSES = {\n small: 'text-sm',\n medium: 'text-md',\n} as const;\n\nconst SIDE_CLASSES = {\n top: 'bottom-full',\n right: 'top-full',\n bottom: 'top-full',\n left: 'top-full',\n};\n\nconst ALIGN_CLASSES = {\n start: 'left-0',\n center: 'left-1/2 -translate-x-1/2',\n end: 'right-0',\n};\n\nconst MENUCONTENT_VARIANT_CLASSES = {\n menu: 'p-1',\n profile: 'p-6',\n};\n\nconst MenuLabel = forwardRef<\n HTMLDivElement,\n HTMLAttributes<HTMLDivElement> & {\n inset?: boolean;\n store?: DropdownStoreApi;\n }\n>(({ className, inset, store: _store, ...props }, ref) => {\n return (\n <div\n ref={ref}\n className={`text-sm w-full ${inset ? 'pl-8' : ''} ${className ?? ''}`}\n {...props}\n />\n );\n});\nMenuLabel.displayName = 'MenuLabel';\n\nconst DropdownMenuContent = forwardRef<\n HTMLDivElement,\n HTMLAttributes<HTMLDivElement> & {\n align?: 'start' | 'center' | 'end';\n side?: 'top' | 'right' | 'bottom' | 'left';\n variant?: 'menu' | 'profile';\n sideOffset?: number;\n store?: DropdownStoreApi;\n }\n>(\n (\n {\n className,\n align = 'start',\n side = 'bottom',\n variant = 'menu',\n sideOffset = 4,\n children,\n store: externalStore,\n ...props\n },\n ref\n ) => {\n const store = useDropdownStore(externalStore);\n const open = useStore(store, (s) => s.open);\n const [isVisible, setIsVisible] = useState(open);\n\n useEffect(() => {\n if (open) {\n setIsVisible(true);\n } else {\n const timer = setTimeout(() => setIsVisible(false), 200);\n return () => clearTimeout(timer);\n }\n }, [open]);\n\n if (!isVisible) return null;\n\n const getPositionClasses = () => {\n const vertical = SIDE_CLASSES[side];\n const horizontal = ALIGN_CLASSES[align];\n\n return `absolute ${vertical} ${horizontal}`;\n };\n\n const variantClasses = MENUCONTENT_VARIANT_CLASSES[variant];\n return (\n <div\n ref={ref}\n role=\"menu\"\n className={`\n bg-background z-50 min-w-[210px] overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md border-border-100\n ${open ? 'animate-in fade-in-0 zoom-in-95' : 'animate-out fade-out-0 zoom-out-95'}\n ${getPositionClasses()}\n ${variantClasses}\n ${className}\n `}\n style={{\n marginTop: side === 'bottom' ? sideOffset : undefined,\n marginBottom: side === 'top' ? sideOffset : undefined,\n marginLeft: side === 'right' ? sideOffset : undefined,\n marginRight: side === 'left' ? sideOffset : undefined,\n }}\n {...props}\n >\n {children}\n </div>\n );\n }\n);\nDropdownMenuContent.displayName = 'DropdownMenuContent';\n\nconst DropdownMenuItem = forwardRef<\n HTMLDivElement,\n HTMLAttributes<HTMLDivElement> & {\n inset?: boolean;\n size?: 'small' | 'medium';\n iconLeft?: ReactNode;\n iconRight?: ReactNode;\n disabled?: boolean;\n variant?: 'profile' | 'menu';\n store?: DropdownStoreApi;\n }\n>(\n (\n {\n className,\n size = 'small',\n children,\n iconRight,\n iconLeft,\n disabled = false,\n onClick,\n variant = 'menu',\n store: externalStore,\n ...props\n },\n ref\n ) => {\n const store = useDropdownStore(externalStore);\n const setOpen = useStore(store, (s) => s.setOpen);\n const sizeClasses = ITEM_SIZE_CLASSES[size];\n\n const handleClick = (\n e: MouseEvent<HTMLDivElement> | KeyboardEvent<HTMLDivElement>\n ) => {\n if (disabled) {\n e.preventDefault();\n e.stopPropagation();\n return;\n }\n onClick?.(e as MouseEvent<HTMLDivElement>);\n setOpen(false);\n };\n\n const getVariantClasses = () => {\n if (variant === 'profile') {\n return 'relative flex flex-row justify-between select-none items-center gap-2 rounded-sm p-4 text-sm outline-none transition-colors [&>svg]:size-6 [&>svg]:shrink-0';\n }\n return 'relative flex select-none items-center gap-2 rounded-sm p-3 text-sm outline-none transition-colors [&>svg]:size-4 [&>svg]:shrink-0';\n };\n\n const getVariantProps = () => {\n return variant === 'profile' ? { 'data-variant': 'profile' } : {};\n };\n\n return (\n <div\n ref={ref}\n role=\"menuitem\"\n {...getVariantProps()}\n aria-disabled={disabled}\n className={`\n focus-visible:bg-background-50\n ${getVariantClasses()}\n ${sizeClasses}\n ${className}\n ${\n disabled\n ? 'cursor-not-allowed text-text-400'\n : 'cursor-pointer hover:bg-background-50 text-text-700 focus:bg-accent focus:text-accent-foreground hover:bg-accent hover:text-accent-foreground'\n }\n `}\n onClick={handleClick}\n onKeyDown={(e) => {\n if (e.key === 'Enter' || e.key === ' ') handleClick(e);\n }}\n tabIndex={disabled ? -1 : 0}\n {...props}\n >\n {iconLeft}\n <span className=\"w-full text-md\">{children}</span>\n {iconRight}\n </div>\n );\n }\n);\nDropdownMenuItem.displayName = 'DropdownMenuItem';\n\nconst DropdownMenuSeparator = forwardRef<\n HTMLDivElement,\n HTMLAttributes<HTMLDivElement> & { store?: DropdownStoreApi }\n>(({ className, store: _store, ...props }, ref) => (\n <div\n ref={ref}\n className={`my-1 h-px bg-border-200 ${className}`}\n {...props}\n />\n));\nDropdownMenuSeparator.displayName = 'DropdownMenuSeparator';\n\n// Componentes específicos do ProfileMenu\nconst ProfileMenuTrigger = forwardRef<\n HTMLButtonElement,\n ButtonHTMLAttributes<HTMLButtonElement> & { store?: DropdownStoreApi }\n>(({ className, onClick, store: externalStore, ...props }, ref) => {\n const store = useDropdownStore(externalStore);\n const open = useStore(store, (s) => s.open);\n const toggleOpen = () => store.setState({ open: !open });\n\n return (\n <button\n ref={ref}\n className={`rounded-lg size-10 bg-background-50 flex items-center justify-center ${className}`}\n onClick={(e) => {\n e.stopPropagation();\n toggleOpen();\n onClick?.(e);\n }}\n aria-expanded={open}\n {...props}\n >\n <span className=\"size-6 rounded-full bg-background-100 flex items-center justify-center\">\n <User className=\"text-background-950\" size={18} />\n </span>\n </button>\n );\n});\nProfileMenuTrigger.displayName = 'ProfileMenuTrigger';\n\nconst ProfileMenuHeader = forwardRef<\n HTMLDivElement,\n HTMLAttributes<HTMLDivElement> & {\n name: string;\n email: string;\n store?: DropdownStoreApi;\n }\n>(({ className, name, email, store: _store, ...props }, ref) => {\n return (\n <div\n ref={ref}\n data-component=\"ProfileMenuHeader\"\n className={`\n flex flex-row gap-4 items-center\n ${className}\n `}\n {...props}\n >\n <span className=\"size-16 bg-background-100 rounded-full flex items-center justify-center\">\n <User size={34} className=\"text-background-950\" />\n </span>\n <div className=\"flex flex-col \">\n <p className=\"text-xl font-bold text-text-950\">{name}</p>\n <p className=\"text-md text-text-600\">{email}</p>\n </div>\n </div>\n );\n});\nProfileMenuHeader.displayName = 'ProfileMenuHeader';\n\nconst ProfileMenuSection = forwardRef<\n HTMLDivElement,\n HTMLAttributes<HTMLDivElement> & { store?: DropdownStoreApi }\n>(({ className, children, store: _store, ...props }, ref) => {\n return (\n <div\n ref={ref}\n className={`\n flex flex-col p-2\n ${className}\n `}\n {...props}\n >\n {children}\n </div>\n );\n});\nProfileMenuSection.displayName = 'ProfileMenuSection';\n\nconst ProfileMenuFooter = ({\n className,\n disabled = false,\n onClick,\n store: externalStore,\n ...props\n}: HTMLAttributes<HTMLButtonElement> & {\n disabled?: boolean;\n store?: DropdownStoreApi;\n}) => {\n const store = useDropdownStore(externalStore);\n const setOpen = useStore(store, (s) => s.setOpen);\n\n return (\n <Button\n variant=\"outline\"\n className={`w-full ${className}`}\n disabled={disabled}\n onClick={(e) => {\n setOpen(false);\n onClick?.(e);\n }}\n {...props}\n >\n <span className=\"mr-2 flex items-center\">\n <SignOut />\n </span>\n <span>Sair</span>\n </Button>\n );\n};\nProfileMenuFooter.displayName = 'ProfileMenuFooter';\n\n// Exportações\nexport default DropdownMenu;\nexport {\n // Componentes genéricos\n DropdownMenuTrigger,\n DropdownMenuContent,\n DropdownMenuItem,\n MenuLabel,\n DropdownMenuSeparator,\n\n // Componentes específicos do ProfileMenu\n ProfileMenuTrigger,\n ProfileMenuHeader,\n ProfileMenuSection,\n ProfileMenuFooter,\n};\n","import { ButtonHTMLAttributes, ReactNode } from 'react';\n\n/**\n * Lookup table for variant and action class combinations\n */\nconst VARIANT_ACTION_CLASSES = {\n solid: {\n primary:\n 'bg-primary-950 text-text border border-primary-950 hover:bg-primary-800 hover:border-primary-800 focus-visible:outline-none focus-visible:bg-primary-950 focus-visible:ring-2 focus-visible:ring-offset-0 focus-visible:ring-indicator-info active:bg-primary-700 active:border-primary-700 disabled:bg-primary-500 disabled:border-primary-500 disabled:opacity-40 disabled:cursor-not-allowed',\n positive:\n 'bg-success-500 text-text border border-success-500 hover:bg-success-600 hover:border-success-600 focus-visible:outline-none focus-visible:bg-success-500 focus-visible:ring-2 focus-visible:ring-offset-0 focus-visible:ring-indicator-info active:bg-success-700 active:border-success-700 disabled:bg-success-500 disabled:border-success-500 disabled:opacity-40 disabled:cursor-not-allowed',\n negative:\n 'bg-error-500 text-text border border-error-500 hover:bg-error-600 hover:border-error-600 focus-visible:outline-none focus-visible:bg-error-500 focus-visible:ring-2 focus-visible:ring-offset-0 focus-visible:ring-indicator-info active:bg-error-700 active:border-error-700 disabled:bg-error-500 disabled:border-error-500 disabled:opacity-40 disabled:cursor-not-allowed',\n },\n outline: {\n primary:\n 'bg-transparent text-primary-950 border border-primary-950 hover:bg-background-50 hover:text-primary-400 hover:border-primary-400 focus-visible:border-0 focus-visible:outline-none focus-visible:text-primary-600 focus-visible:ring-2 focus-visible:ring-offset-0 focus-visible:ring-indicator-info active:text-primary-700 active:border-primary-700 disabled:opacity-40 disabled:cursor-not-allowed',\n positive:\n 'bg-transparent text-success-500 border border-success-300 hover:bg-background-50 hover:text-success-400 hover:border-success-400 focus-visible:border-0 focus-visible:outline-none focus-visible:text-success-600 focus-visible:ring-2 focus-visible:ring-offset-0 focus-visible:ring-indicator-info active:text-success-700 active:border-success-700 disabled:opacity-40 disabled:cursor-not-allowed',\n negative:\n 'bg-transparent text-error-500 border border-error-300 hover:bg-background-50 hover:text-error-400 hover:border-error-400 focus-visible:border-0 focus-visible:outline-none focus-visible:text-error-600 focus-visible:ring-2 focus-visible:ring-offset-0 focus-visible:ring-indicator-info active:text-error-700 active:border-error-700 disabled:opacity-40 disabled:cursor-not-allowed',\n },\n link: {\n primary:\n 'bg-transparent text-primary-950 hover:text-primary-400 focus-visible:outline-none focus-visible:text-primary-600 focus-visible:ring-2 focus-visible:ring-offset-0 focus-visible:ring-indicator-info active:text-primary-700 disabled:opacity-40 disabled:cursor-not-allowed',\n positive:\n 'bg-transparent text-success-500 hover:text-success-400 focus-visible:outline-none focus-visible:text-success-600 focus-visible:ring-2 focus-visible:ring-offset-0 focus-visible:ring-indicator-info active:text-success-700 disabled:opacity-40 disabled:cursor-not-allowed',\n negative:\n 'bg-transparent text-error-500 hover:text-error-400 focus-visible:outline-none focus-visible:text-error-600 focus-visible:ring-2 focus-visible:ring-offset-0 focus-visible:ring-indicator-info active:text-error-700 disabled:opacity-40 disabled:cursor-not-allowed',\n },\n} as const;\n\n/**\n * Lookup table for size classes\n */\nconst SIZE_CLASSES = {\n 'extra-small': 'text-xs px-3.5 py-2',\n small: 'text-sm px-4 py-2.5',\n medium: 'text-md px-5 py-2.5',\n large: 'text-lg px-6 py-3',\n 'extra-large': 'text-lg px-7 py-3.5',\n} as const;\n\n/**\n * Button component props interface\n */\ntype ButtonProps = {\n /** Content to be displayed inside the button */\n children: ReactNode;\n /** Ícone à esquerda do texto */\n iconLeft?: ReactNode;\n /** Ícone à direita do texto */\n iconRight?: ReactNode;\n /** Size of the button */\n size?: 'extra-small' | 'small' | 'medium' | 'large' | 'extra-large';\n /** Visual variant of the button */\n variant?: 'solid' | 'outline' | 'link';\n /** Action type of the button */\n action?: 'primary' | 'positive' | 'negative';\n /** Additional CSS classes to apply */\n className?: string;\n} & ButtonHTMLAttributes<HTMLButtonElement>;\n\n/**\n * Button component for Analytica Ensino platforms\n *\n * A flexible button component with multiple variants, sizes and actions.\n *\n * @param children - The content to display inside the button\n * @param size - The size variant (extra-small, small, medium, large, extra-large)\n * @param variant - The visual style variant (solid, outline, link)\n * @param action - The action type (primary, positive, negative)\n * @param className - Additional CSS classes\n * @param props - All other standard button HTML attributes\n * @returns A styled button element\n *\n * @example\n * ```tsx\n * <Button variant=\"solid\" action=\"primary\" size=\"medium\" onClick={() => console.log('clicked')}>\n * Click me\n * </Button>\n * ```\n */\nconst Button = ({\n children,\n iconLeft,\n iconRight,\n size = 'medium',\n variant = 'solid',\n action = 'primary',\n className = '',\n disabled,\n type = 'button',\n ...props\n}: ButtonProps) => {\n // Get classes from lookup tables\n const sizeClasses = SIZE_CLASSES[size];\n const variantClasses = VARIANT_ACTION_CLASSES[variant][action];\n\n const baseClasses =\n 'inline-flex items-center justify-center rounded-full cursor-pointer font-medium';\n\n return (\n <button\n className={`${baseClasses} ${variantClasses} ${sizeClasses} ${className}`}\n disabled={disabled}\n type={type}\n {...props}\n >\n {iconLeft && <span className=\"mr-2 flex items-center\">{iconLeft}</span>}\n {children}\n {iconRight && <span className=\"ml-2 flex items-center\">{iconRight}</span>}\n </button>\n );\n};\n\nexport default Button;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,4BAA8B;AAC9B,mBAcO;AACP,qBAA2C;;;ACuFvC;AAlGJ,IAAM,yBAAyB;AAAA,EAC7B,OAAO;AAAA,IACL,SACE;AAAA,IACF,UACE;AAAA,IACF,UACE;AAAA,EACJ;AAAA,EACA,SAAS;AAAA,IACP,SACE;AAAA,IACF,UACE;AAAA,IACF,UACE;AAAA,EACJ;AAAA,EACA,MAAM;AAAA,IACJ,SACE;AAAA,IACF,UACE;AAAA,IACF,UACE;AAAA,EACJ;AACF;AAKA,IAAM,eAAe;AAAA,EACnB,eAAe;AAAA,EACf,OAAO;AAAA,EACP,QAAQ;AAAA,EACR,OAAO;AAAA,EACP,eAAe;AACjB;AA0CA,IAAM,SAAS,CAAC;AAAA,EACd;AAAA,EACA;AAAA,EACA;AAAA,EACA,OAAO;AAAA,EACP,UAAU;AAAA,EACV,SAAS;AAAA,EACT,YAAY;AAAA,EACZ;AAAA,EACA,OAAO;AAAA,EACP,GAAG;AACL,MAAmB;AAEjB,QAAM,cAAc,aAAa,IAAI;AACrC,QAAM,iBAAiB,uBAAuB,OAAO,EAAE,MAAM;AAE7D,QAAM,cACJ;AAEF,SACE;AAAA,IAAC;AAAA;AAAA,MACC,WAAW,GAAG,WAAW,IAAI,cAAc,IAAI,WAAW,IAAI,SAAS;AAAA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