UNPKG

react-calendar-kit

Version:

React Calendar Kit is a powerful and flexible library for building accessible and highly customizable calendar and date/time picker components in your React applications. React Calendar Kit provides a solid foundation for creating inclusive user experienc

3 lines (2 loc) 1.45 kB
'use client'; import{a as h}from"./chunk-5C3O2YLN.mjs";import{a as i,b as m,f as g}from"./chunk-WABH67VC.mjs";import{b as c}from"./chunk-VMZM6ONT.mjs";import e from"react";import{endOfMonth as x,getWeeksInMonth as D}from"@internationalized/date";import{useCalendarGrid as H}from"@react-aria/calendar";import{useLocale as M}from"@react-aria/i18n";var B=C=>{let{startDate:t,currentMonth:k,...f}=C,{state:o,weekdayStyle:b,isPickerExpanded:l,classNames:r,styles:a}=c(),{locale:N}=M(),P=D(t,N),{gridProps:p,headerProps:n,weekDays:u}=H({...f,weekdayStyle:b,endDate:x(t)},o),w=[...new Array(P).keys()].map(s=>e.createElement("tr",{role:"grid-body-row",className:r.gridBodyRow,key:s,"data-picker-expanded":m(l)},o.getDatesInWeek(s,t).map((d,y)=>d?e.createElement(h,{key:y,state:o,currentMonth:t,date:d,isPickerVisible:l,classNames:r,styles:a}):e.createElement("td",{key:y}))));return e.createElement("table",{...p,role:"grid",className:i(r.grid,p.className),"aria-hidden":m(l),tabIndex:-1},e.createElement("thead",{...n,className:i(r.gridHead,n.className),style:g(n.style,a?.gridHead),role:"grid-header"},e.createElement("tr",{className:r.gridHeadRow,style:a?.gridHeadRow,role:"grid-header-row"},u.map((s,d)=>e.createElement("th",{key:d,role:"grid-header-cell",className:r.gridHeadCell,style:a?.gridHeadCell},e.createElement("span",null,s))))),e.createElement("tbody",{key:k,className:r.gridBody,style:a?.gridBody,role:"grid-body"},w))},O=B;export{O as a};