@zach.codes/react-calendar
Advanced tools
Comparing version 0.2.0 to 0.3.0-beta
@@ -42,3 +42,3 @@ 'use strict'; | ||
return React__default.createElement("div", { | ||
className: "flex justify-end mb-4" | ||
className: "rc-flex rc-justify-end rc-mb-4" | ||
}, React__default.createElement("button", { | ||
@@ -48,5 +48,5 @@ onClick: function onClick() { | ||
}, | ||
className: "cursor-pointer" | ||
className: "rc-cursor-pointer" | ||
}, "Previous"), React__default.createElement("div", { | ||
className: "ml-4 mr-4 w-32 text-center", | ||
className: "rc-ml-4 rc-mr-4 rc-w-32 rc-text-center", | ||
"aria-label": "Current Month" | ||
@@ -59,3 +59,3 @@ }, dateFns.format(currentMonth, dateFns.getYear(currentMonth) === dateFns.getYear(new Date()) ? 'LLLL' : 'LLLL yyyy', { | ||
}, | ||
className: "cursor-pointer" | ||
className: "rc-cursor-pointer" | ||
}, "Next")); | ||
@@ -136,7 +136,7 @@ }; | ||
var headingClasses = { | ||
l3: 'lg:grid-cols-3', | ||
l4: 'lg:grid-cols-4', | ||
l5: 'lg:grid-cols-5', | ||
l6: 'lg:grid-cols-6', | ||
l7: 'lg:grid-cols-7' | ||
l3: 'lg:rc-grid-cols-3', | ||
l4: 'lg:rc-grid-cols-4', | ||
l5: 'lg:rc-grid-cols-5', | ||
l6: 'lg:rc-grid-cols-6', | ||
l7: 'lg:rc-grid-cols-7' | ||
}; | ||
@@ -161,7 +161,7 @@ function MonthlyBody(_ref2) { | ||
var headingClassName = 'border-b-2 p-2 border-r-2 lg:block hidden'; | ||
var headingClassName = 'rc-border-b-2 rc-p-2 rc-border-r-2 lg:rc-block rc-hidden'; | ||
return React__default.createElement("div", { | ||
className: "bg-white border-l-2 border-t-2" | ||
className: "rc-bg-white rc-border-l-2 rc-border-t-2" | ||
}, React__default.createElement("div", { | ||
className: "grid grid-cols-1 sm:grid-cols-2 md:grid-cols-4 " + //@ts-ignore | ||
className: "rc-grid rc-grid-cols-1 sm:rc-grid-cols-2 md:rc-grid-cols-4 " + //@ts-ignore | ||
headingClasses["l" + headings.length] | ||
@@ -207,13 +207,13 @@ }, headings.map(function (day) { | ||
"aria-label": "Events for day " + dayNumber, | ||
className: "h-48 p-2 border-b-2 border-r-2" | ||
className: "rc-h-48 rc-p-2 rc-border-b-2 rc-border-r-2" | ||
}, React__default.createElement("div", { | ||
className: "flex justify-between" | ||
className: "rc-flex rc-justify-between" | ||
}, React__default.createElement("div", { | ||
className: "font-bold" | ||
className: "rc-font-bold" | ||
}, dayNumber), React__default.createElement("div", { | ||
className: "lg:hidden block" | ||
className: "lg:rc-hidden rc-block" | ||
}, dateFns.format(day, 'EEEE', { | ||
locale: locale | ||
}))), React__default.createElement("ul", { | ||
className: "divide-gray-200 divide-y overflow-hidden max-h-36 overflow-y-auto" | ||
className: "rc-divide-gray-200 rc-divide-y rc-overflow-hidden rc-max-h-36 rc-overflow-y-auto" | ||
}, renderDay(events))); | ||
@@ -226,9 +226,9 @@ } | ||
return React__default.createElement("li", { | ||
className: "py-2" | ||
className: "rc-py-2" | ||
}, React__default.createElement("div", { | ||
className: "flex text-sm flex-1 justify-between" | ||
className: "rc-flex rc-text-sm rc-flex-1 rc-justify-between" | ||
}, React__default.createElement("h3", { | ||
className: "font-medium" | ||
className: "rc-font-medium" | ||
}, title), React__default.createElement("p", { | ||
className: "text-gray-500" | ||
className: "rc-text-gray-500" | ||
}, date))); | ||
@@ -266,3 +266,3 @@ }; | ||
return React__default.createElement("div", { | ||
className: "md:flex md:justify-between" | ||
className: "md:rc-flex md:rc-justify-between" | ||
}, children); | ||
@@ -288,8 +288,8 @@ }; | ||
}, | ||
className: "bg-white cursor-pointer", | ||
className: "rc-bg-white rc-cursor-pointer", | ||
"aria-label": "Day of Week" | ||
}, React__default.createElement("div", { | ||
className: "rounded-lg border sm:w-36 text-center py-4 " + (isSelected ? 'border-indigo-600' : 'border-gray-300 hover:border-gray-500') | ||
className: "rc-rounded-lg rc-border sm:rc-w-36 rc-text-center rc-py-4 " + (isSelected ? 'rc-border-indigo-600' : 'rc-border-gray-300 hover:rc-border-gray-500') | ||
}, React__default.createElement("p", { | ||
className: "font-medium text-sm text-gray-800" | ||
className: "rc-font-medium rc-text-sm rc-text-gray-800" | ||
}, day.label, " ", dateFns.format(currentDate, 'do', { | ||
@@ -319,3 +319,3 @@ locale: locale | ||
return React__default.createElement("ul", { | ||
className: "grid md:grid-cols-1 grid-cols-2 gap-2" | ||
className: "rc-grid md:rc-grid-cols-1 rc-grid-cols-2 rc-gap-2" | ||
}, daysToRender.map(function (day) { | ||
@@ -338,6 +338,6 @@ return React__default.createElement(DayButton, { | ||
return React__default.createElement("div", { | ||
className: "overflow-auto max-h-96", | ||
className: "rc-overflow-auto rc-max-h-96", | ||
style: style | ||
}, React__default.createElement("ul", { | ||
className: "divide-y divide-gray-200 " | ||
className: "rc-divide-y rc-divide-gray-200 " | ||
}, events.map(function (item) { | ||
@@ -361,3 +361,3 @@ // If they select a single day, filter out events for different days | ||
return React__default.createElement("div", { | ||
className: "border p-4 md:w-3/4 lg:w-1/2 w-full" | ||
className: "rc-border rc-p-4 md:rc-w-3/4 lg:rc-w-1/2 rc-w-full" | ||
}, children); | ||
@@ -370,9 +370,9 @@ }; | ||
return React__default.createElement("li", { | ||
className: "py-4 w-72" | ||
className: "rc-py-4 rc-w-72" | ||
}, React__default.createElement("div", { | ||
className: "text-sm flex justify-between" | ||
className: "rc-text-sm rc-flex rc-justify-between" | ||
}, React__default.createElement("h3", { | ||
className: "font-medium" | ||
className: "rc-font-medium" | ||
}, title), React__default.createElement("p", { | ||
className: "text-gray-500" | ||
className: "rc-text-gray-500" | ||
}, date))); | ||
@@ -379,0 +379,0 @@ }; |
@@ -1,2 +0,2 @@ | ||
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e,t=require("date-fns"),a=require("react"),l=(e=a)&&"object"==typeof e&&"default"in e?e.default:e,r=require("date-fns/locale"),n=l.createContext({}),o=function(){return a.useContext(n)},c=function(e){var t,a,l,n,o,c,d,i=e.locale,s=void 0===i?r.enUS:i;return[{day:0,label:null==(t=s.localize)?void 0:t.day(0)},{day:1,label:null==(a=s.localize)?void 0:a.day(1)},{day:2,label:null==(l=s.localize)?void 0:l.day(2)},{day:3,label:null==(n=s.localize)?void 0:n.day(3)},{day:4,label:null==(o=s.localize)?void 0:o.day(4)},{day:5,label:null==(c=s.localize)?void 0:c.day(5)},{day:6,label:null==(d=s.localize)?void 0:d.day(6)}]},d=l.createContext({});function i(){return a.useContext(d)}var s=function(e){var a=e.days,l=e.omitDays,r=e.locale,n=c({locale:r}),o=a;l&&(n=c({locale:r}).filter((function(e){return!l.includes(e.day)})),o=a.filter((function(e){return!l.includes(t.getDay(e))})));var d=t.getDay(o[0]);if(l){var i=l.filter((function(e){return e<d})).length;d-=i}return{headings:n,daysToRender:o,padding:new Array(d).fill(0)}},u={l3:"lg:grid-cols-3",l4:"lg:grid-cols-4",l5:"lg:grid-cols-5",l6:"lg:grid-cols-6",l7:"lg:grid-cols-7"},m=l.createContext({}),y=function(){return a.useContext(m)},f=function(e){var a=e.day,r=y(),n=r.locale,o=r.week,c=r.selectedDay,d=r.changeSelectedDay,i=!!c&&t.getDay(c)===a.day,s=t.setDay(o,a.day,{locale:n});return l.createElement("li",{onClick:function(){return d(i?void 0:s)},className:"bg-white cursor-pointer","aria-label":"Day of Week"},l.createElement("div",{className:"rounded-lg border sm:w-36 text-center py-4 "+(i?"border-indigo-600":"border-gray-300 hover:border-gray-500")},l.createElement("p",{className:"font-medium text-sm text-gray-800"},a.label," ",t.format(s,"do",{locale:n}))))};exports.DefaultMonthlyEventItem=function(e){var t=e.date;return l.createElement("li",{className:"py-2"},l.createElement("div",{className:"flex text-sm flex-1 justify-between"},l.createElement("h3",{className:"font-medium"},e.title),l.createElement("p",{className:"text-gray-500"},t)))},exports.DefaultWeeklyEventItem=function(e){var t=e.date;return l.createElement("li",{className:"py-4 w-72"},l.createElement("div",{className:"text-sm flex justify-between"},l.createElement("h3",{className:"font-medium"},e.title),l.createElement("p",{className:"text-gray-500"},t)))},exports.MonthlyBody=function(e){var a=e.omitDays,r=e.events,n=e.children,c=o(),i=s({days:c.days,omitDays:a,locale:c.locale}),m=i.headings,y=i.daysToRender,f=i.padding;return l.createElement("div",{className:"bg-white border-l-2 border-t-2"},l.createElement("div",{className:"grid grid-cols-1 sm:grid-cols-2 md:grid-cols-4 "+u["l"+m.length]},m.map((function(e){return l.createElement("div",{key:e.day,className:"border-b-2 p-2 border-r-2 lg:block hidden","aria-label":"Day of Week"},e.label)})),f.map((function(e,t){return l.createElement("div",{key:t,className:"border-b-2 p-2 border-r-2 lg:block hidden","aria-label":"Empty Day"})})),y.map((function(e){return l.createElement(d.Provider,{key:e.toISOString(),value:{day:e,events:r.filter((function(a){return t.isSameDay(a.date,e)}))}},n)}))))},exports.MonthlyCalendar=function(e){var a=e.locale,r=e.onCurrentMonthChange,o=e.children,c=t.startOfMonth(e.currentMonth),d=t.eachDayOfInterval({start:c,end:t.endOfMonth(c)});return l.createElement(n.Provider,{value:{days:d,locale:a,onCurrentMonthChange:r,currentMonth:c}},o)},exports.MonthlyDay=function(e){var a=e.renderDay,r=o().locale,n=i(),c=n.day,d=n.events,s=t.format(c,"d",{locale:r});return l.createElement("div",{"aria-label":"Events for day "+s,className:"h-48 p-2 border-b-2 border-r-2"},l.createElement("div",{className:"flex justify-between"},l.createElement("div",{className:"font-bold"},s),l.createElement("div",{className:"lg:hidden block"},t.format(c,"EEEE",{locale:r}))),l.createElement("ul",{className:"divide-gray-200 divide-y overflow-hidden max-h-36 overflow-y-auto"},a(d)))},exports.MonthlyNav=function(){var e=o(),a=e.locale,r=e.currentMonth,n=e.onCurrentMonthChange;return l.createElement("div",{className:"flex justify-end mb-4"},l.createElement("button",{onClick:function(){return n(t.subMonths(r,1))},className:"cursor-pointer"},"Previous"),l.createElement("div",{className:"ml-4 mr-4 w-32 text-center","aria-label":"Current Month"},t.format(r,t.getYear(r)===t.getYear(new Date)?"LLLL":"LLLL yyyy",{locale:a})),l.createElement("button",{onClick:function(){return n(t.addMonths(r,1))},className:"cursor-pointer"},"Next"))},exports.WeeklyBody=function(e){var a=e.events,r=e.renderItem,n=e.style,o=y(),c=o.week,d=o.selectedDay;return l.createElement("div",{className:"overflow-auto max-h-96",style:n},l.createElement("ul",{className:"divide-y divide-gray-200 "},a.map((function(e){return d&&!t.isSameDay(d,e.date)?null:t.isSameWeek(c,e.date)?r({item:e,showingFullWeek:void 0===d}):null}))))},exports.WeeklyCalendar=function(e){var r=e.locale,n=e.week,o=e.children,c=a.useState(),d=c[0],i=c[1];return a.useEffect((function(){i(void 0)}),[n]),l.createElement(m.Provider,{value:{locale:r,selectedDay:d,week:t.startOfWeek(n),changeSelectedDay:i}},o)},exports.WeeklyContainer=function(e){return l.createElement("div",{className:"md:flex md:justify-between"},e.children)},exports.WeeklyDays=function(e){var t=e.omitDays,a=y().locale,r=c({locale:a});return t&&(r=c({locale:a}).filter((function(e){return!t.includes(e.day)}))),l.createElement("ul",{className:"grid md:grid-cols-1 grid-cols-2 gap-2"},r.map((function(e){return l.createElement(f,{key:e.day,day:e})})))},exports.WeeklyResponsiveContainer=function(e){return l.createElement("div",{className:"border p-4 md:w-3/4 lg:w-1/2 w-full"},e.children)},exports.handleOmittedDays=s,exports.useMonthlyBody=i,exports.useMonthlyCalendar=o,exports.useWeeklyCalendar=y; | ||
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e,r=require("date-fns"),t=require("react"),a=(e=t)&&"object"==typeof e&&"default"in e?e.default:e,l=require("date-fns/locale"),c=a.createContext({}),n=function(){return t.useContext(c)},o=function(e){var r,t,a,c,n,o,d,i=e.locale,s=void 0===i?l.enUS:i;return[{day:0,label:null==(r=s.localize)?void 0:r.day(0)},{day:1,label:null==(t=s.localize)?void 0:t.day(1)},{day:2,label:null==(a=s.localize)?void 0:a.day(2)},{day:3,label:null==(c=s.localize)?void 0:c.day(3)},{day:4,label:null==(n=s.localize)?void 0:n.day(4)},{day:5,label:null==(o=s.localize)?void 0:o.day(5)},{day:6,label:null==(d=s.localize)?void 0:d.day(6)}]},d=a.createContext({});function i(){return t.useContext(d)}var s=function(e){var t=e.days,a=e.omitDays,l=e.locale,c=o({locale:l}),n=t;a&&(c=o({locale:l}).filter((function(e){return!a.includes(e.day)})),n=t.filter((function(e){return!a.includes(r.getDay(e))})));var d=r.getDay(n[0]);if(a){var i=a.filter((function(e){return e<d})).length;d-=i}return{headings:c,daysToRender:n,padding:new Array(d).fill(0)}},u={l3:"lg:rc-grid-cols-3",l4:"lg:rc-grid-cols-4",l5:"lg:rc-grid-cols-5",l6:"lg:rc-grid-cols-6",l7:"lg:rc-grid-cols-7"},m=a.createContext({}),y=function(){return t.useContext(m)},f=function(e){var t=e.day,l=y(),c=l.locale,n=l.week,o=l.selectedDay,d=l.changeSelectedDay,i=!!o&&r.getDay(o)===t.day,s=r.setDay(n,t.day,{locale:c});return a.createElement("li",{onClick:function(){return d(i?void 0:s)},className:"rc-bg-white rc-cursor-pointer","aria-label":"Day of Week"},a.createElement("div",{className:"rc-rounded-lg rc-border sm:rc-w-36 rc-text-center rc-py-4 "+(i?"rc-border-indigo-600":"rc-border-gray-300 hover:rc-border-gray-500")},a.createElement("p",{className:"rc-font-medium rc-text-sm rc-text-gray-800"},t.label," ",r.format(s,"do",{locale:c}))))};exports.DefaultMonthlyEventItem=function(e){var r=e.date;return a.createElement("li",{className:"rc-py-2"},a.createElement("div",{className:"rc-flex rc-text-sm rc-flex-1 rc-justify-between"},a.createElement("h3",{className:"rc-font-medium"},e.title),a.createElement("p",{className:"rc-text-gray-500"},r)))},exports.DefaultWeeklyEventItem=function(e){var r=e.date;return a.createElement("li",{className:"rc-py-4 rc-w-72"},a.createElement("div",{className:"rc-text-sm rc-flex rc-justify-between"},a.createElement("h3",{className:"rc-font-medium"},e.title),a.createElement("p",{className:"rc-text-gray-500"},r)))},exports.MonthlyBody=function(e){var t=e.omitDays,l=e.events,c=e.children,o=n(),i=s({days:o.days,omitDays:t,locale:o.locale}),m=i.headings,y=i.daysToRender,f=i.padding,v="rc-border-b-2 rc-p-2 rc-border-r-2 lg:rc-block rc-hidden";return a.createElement("div",{className:"rc-bg-white rc-border-l-2 rc-border-t-2"},a.createElement("div",{className:"rc-grid rc-grid-cols-1 sm:rc-grid-cols-2 md:rc-grid-cols-4 "+u["l"+m.length]},m.map((function(e){return a.createElement("div",{key:e.day,className:v,"aria-label":"Day of Week"},e.label)})),f.map((function(e,r){return a.createElement("div",{key:r,className:v,"aria-label":"Empty Day"})})),y.map((function(e){return a.createElement(d.Provider,{key:e.toISOString(),value:{day:e,events:l.filter((function(t){return r.isSameDay(t.date,e)}))}},c)}))))},exports.MonthlyCalendar=function(e){var t=e.locale,l=e.onCurrentMonthChange,n=e.children,o=r.startOfMonth(e.currentMonth),d=r.eachDayOfInterval({start:o,end:r.endOfMonth(o)});return a.createElement(c.Provider,{value:{days:d,locale:t,onCurrentMonthChange:l,currentMonth:o}},n)},exports.MonthlyDay=function(e){var t=e.renderDay,l=n().locale,c=i(),o=c.day,d=c.events,s=r.format(o,"d",{locale:l});return a.createElement("div",{"aria-label":"Events for day "+s,className:"rc-h-48 rc-p-2 rc-border-b-2 rc-border-r-2"},a.createElement("div",{className:"rc-flex rc-justify-between"},a.createElement("div",{className:"rc-font-bold"},s),a.createElement("div",{className:"lg:rc-hidden rc-block"},r.format(o,"EEEE",{locale:l}))),a.createElement("ul",{className:"rc-divide-gray-200 rc-divide-y rc-overflow-hidden rc-max-h-36 rc-overflow-y-auto"},t(d)))},exports.MonthlyNav=function(){var e=n(),t=e.locale,l=e.currentMonth,c=e.onCurrentMonthChange;return a.createElement("div",{className:"rc-flex rc-justify-end rc-mb-4"},a.createElement("button",{onClick:function(){return c(r.subMonths(l,1))},className:"rc-cursor-pointer"},"Previous"),a.createElement("div",{className:"rc-ml-4 rc-mr-4 rc-w-32 rc-text-center","aria-label":"Current Month"},r.format(l,r.getYear(l)===r.getYear(new Date)?"LLLL":"LLLL yyyy",{locale:t})),a.createElement("button",{onClick:function(){return c(r.addMonths(l,1))},className:"rc-cursor-pointer"},"Next"))},exports.WeeklyBody=function(e){var t=e.events,l=e.renderItem,c=e.style,n=y(),o=n.week,d=n.selectedDay;return a.createElement("div",{className:"rc-overflow-auto rc-max-h-96",style:c},a.createElement("ul",{className:"rc-divide-y rc-divide-gray-200 "},t.map((function(e){return d&&!r.isSameDay(d,e.date)?null:r.isSameWeek(o,e.date)?l({item:e,showingFullWeek:void 0===d}):null}))))},exports.WeeklyCalendar=function(e){var l=e.locale,c=e.week,n=e.children,o=t.useState(),d=o[0],i=o[1];return t.useEffect((function(){i(void 0)}),[c]),a.createElement(m.Provider,{value:{locale:l,selectedDay:d,week:r.startOfWeek(c),changeSelectedDay:i}},n)},exports.WeeklyContainer=function(e){return a.createElement("div",{className:"md:rc-flex md:rc-justify-between"},e.children)},exports.WeeklyDays=function(e){var r=e.omitDays,t=y().locale,l=o({locale:t});return r&&(l=o({locale:t}).filter((function(e){return!r.includes(e.day)}))),a.createElement("ul",{className:"rc-grid md:rc-grid-cols-1 rc-grid-cols-2 rc-gap-2"},l.map((function(e){return a.createElement(f,{key:e.day,day:e})})))},exports.WeeklyResponsiveContainer=function(e){return a.createElement("div",{className:"rc-border rc-p-4 md:rc-w-3/4 lg:rc-w-1/2 rc-w-full"},e.children)},exports.handleOmittedDays=s,exports.useMonthlyBody=i,exports.useMonthlyCalendar=n,exports.useWeeklyCalendar=y; | ||
//# sourceMappingURL=react-calendar.cjs.production.min.js.map |
@@ -35,3 +35,3 @@ import { startOfMonth, eachDayOfInterval, endOfMonth, subMonths, format, getYear, addMonths, getDay, isSameDay, startOfWeek, isSameWeek, setDay } from 'date-fns'; | ||
return React.createElement("div", { | ||
className: "flex justify-end mb-4" | ||
className: "rc-flex rc-justify-end rc-mb-4" | ||
}, React.createElement("button", { | ||
@@ -41,5 +41,5 @@ onClick: function onClick() { | ||
}, | ||
className: "cursor-pointer" | ||
className: "rc-cursor-pointer" | ||
}, "Previous"), React.createElement("div", { | ||
className: "ml-4 mr-4 w-32 text-center", | ||
className: "rc-ml-4 rc-mr-4 rc-w-32 rc-text-center", | ||
"aria-label": "Current Month" | ||
@@ -52,3 +52,3 @@ }, format(currentMonth, getYear(currentMonth) === getYear(new Date()) ? 'LLLL' : 'LLLL yyyy', { | ||
}, | ||
className: "cursor-pointer" | ||
className: "rc-cursor-pointer" | ||
}, "Next")); | ||
@@ -129,7 +129,7 @@ }; | ||
var headingClasses = { | ||
l3: 'lg:grid-cols-3', | ||
l4: 'lg:grid-cols-4', | ||
l5: 'lg:grid-cols-5', | ||
l6: 'lg:grid-cols-6', | ||
l7: 'lg:grid-cols-7' | ||
l3: 'lg:rc-grid-cols-3', | ||
l4: 'lg:rc-grid-cols-4', | ||
l5: 'lg:rc-grid-cols-5', | ||
l6: 'lg:rc-grid-cols-6', | ||
l7: 'lg:rc-grid-cols-7' | ||
}; | ||
@@ -154,7 +154,7 @@ function MonthlyBody(_ref2) { | ||
var headingClassName = 'border-b-2 p-2 border-r-2 lg:block hidden'; | ||
var headingClassName = 'rc-border-b-2 rc-p-2 rc-border-r-2 lg:rc-block rc-hidden'; | ||
return React.createElement("div", { | ||
className: "bg-white border-l-2 border-t-2" | ||
className: "rc-bg-white rc-border-l-2 rc-border-t-2" | ||
}, React.createElement("div", { | ||
className: "grid grid-cols-1 sm:grid-cols-2 md:grid-cols-4 " + //@ts-ignore | ||
className: "rc-grid rc-grid-cols-1 sm:rc-grid-cols-2 md:rc-grid-cols-4 " + //@ts-ignore | ||
headingClasses["l" + headings.length] | ||
@@ -200,13 +200,13 @@ }, headings.map(function (day) { | ||
"aria-label": "Events for day " + dayNumber, | ||
className: "h-48 p-2 border-b-2 border-r-2" | ||
className: "rc-h-48 rc-p-2 rc-border-b-2 rc-border-r-2" | ||
}, React.createElement("div", { | ||
className: "flex justify-between" | ||
className: "rc-flex rc-justify-between" | ||
}, React.createElement("div", { | ||
className: "font-bold" | ||
className: "rc-font-bold" | ||
}, dayNumber), React.createElement("div", { | ||
className: "lg:hidden block" | ||
className: "lg:rc-hidden rc-block" | ||
}, format(day, 'EEEE', { | ||
locale: locale | ||
}))), React.createElement("ul", { | ||
className: "divide-gray-200 divide-y overflow-hidden max-h-36 overflow-y-auto" | ||
className: "rc-divide-gray-200 rc-divide-y rc-overflow-hidden rc-max-h-36 rc-overflow-y-auto" | ||
}, renderDay(events))); | ||
@@ -219,9 +219,9 @@ } | ||
return React.createElement("li", { | ||
className: "py-2" | ||
className: "rc-py-2" | ||
}, React.createElement("div", { | ||
className: "flex text-sm flex-1 justify-between" | ||
className: "rc-flex rc-text-sm rc-flex-1 rc-justify-between" | ||
}, React.createElement("h3", { | ||
className: "font-medium" | ||
className: "rc-font-medium" | ||
}, title), React.createElement("p", { | ||
className: "text-gray-500" | ||
className: "rc-text-gray-500" | ||
}, date))); | ||
@@ -259,3 +259,3 @@ }; | ||
return React.createElement("div", { | ||
className: "md:flex md:justify-between" | ||
className: "md:rc-flex md:rc-justify-between" | ||
}, children); | ||
@@ -281,8 +281,8 @@ }; | ||
}, | ||
className: "bg-white cursor-pointer", | ||
className: "rc-bg-white rc-cursor-pointer", | ||
"aria-label": "Day of Week" | ||
}, React.createElement("div", { | ||
className: "rounded-lg border sm:w-36 text-center py-4 " + (isSelected ? 'border-indigo-600' : 'border-gray-300 hover:border-gray-500') | ||
className: "rc-rounded-lg rc-border sm:rc-w-36 rc-text-center rc-py-4 " + (isSelected ? 'rc-border-indigo-600' : 'rc-border-gray-300 hover:rc-border-gray-500') | ||
}, React.createElement("p", { | ||
className: "font-medium text-sm text-gray-800" | ||
className: "rc-font-medium rc-text-sm rc-text-gray-800" | ||
}, day.label, " ", format(currentDate, 'do', { | ||
@@ -312,3 +312,3 @@ locale: locale | ||
return React.createElement("ul", { | ||
className: "grid md:grid-cols-1 grid-cols-2 gap-2" | ||
className: "rc-grid md:rc-grid-cols-1 rc-grid-cols-2 rc-gap-2" | ||
}, daysToRender.map(function (day) { | ||
@@ -331,6 +331,6 @@ return React.createElement(DayButton, { | ||
return React.createElement("div", { | ||
className: "overflow-auto max-h-96", | ||
className: "rc-overflow-auto rc-max-h-96", | ||
style: style | ||
}, React.createElement("ul", { | ||
className: "divide-y divide-gray-200 " | ||
className: "rc-divide-y rc-divide-gray-200 " | ||
}, events.map(function (item) { | ||
@@ -354,3 +354,3 @@ // If they select a single day, filter out events for different days | ||
return React.createElement("div", { | ||
className: "border p-4 md:w-3/4 lg:w-1/2 w-full" | ||
className: "rc-border rc-p-4 md:rc-w-3/4 lg:rc-w-1/2 rc-w-full" | ||
}, children); | ||
@@ -363,9 +363,9 @@ }; | ||
return React.createElement("li", { | ||
className: "py-4 w-72" | ||
className: "rc-py-4 rc-w-72" | ||
}, React.createElement("div", { | ||
className: "text-sm flex justify-between" | ||
className: "rc-text-sm rc-flex rc-justify-between" | ||
}, React.createElement("h3", { | ||
className: "font-medium" | ||
className: "rc-font-medium" | ||
}, title), React.createElement("p", { | ||
className: "text-gray-500" | ||
className: "rc-text-gray-500" | ||
}, date))); | ||
@@ -372,0 +372,0 @@ }; |
{ | ||
"version": "0.2.0", | ||
"version": "0.3.0-beta", | ||
"license": "MIT", | ||
@@ -9,3 +9,4 @@ "name": "@zach.codes/react-calendar", | ||
"dist", | ||
"src" | ||
"src", | ||
"tw-check.js" | ||
], | ||
@@ -19,2 +20,3 @@ "engines": { | ||
"test": "tsdx test", | ||
"postinstall": "node tw-check.js", | ||
"lint": "tsdx lint", | ||
@@ -26,3 +28,3 @@ "prepare": "tsdx build && npm run build-tailwind", | ||
"build-storybook": "build-storybook", | ||
"build-tailwind": "NODE_ENV=production tailwindcss build src/tailwind.css -o dist/calendar-tailwind.css" | ||
"build-tailwind": "NODE_ENV=production tailwindcss build src/tailwind.css -o dist/calendar-tailwind.css && NODE_ENV=production TW_PREFLIGHT=false tailwindcss build src/tailwind.css -o dist/calendar-tailwind-no-reset.css" | ||
}, | ||
@@ -96,2 +98,2 @@ "peerDependencies": { | ||
} | ||
} | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Install scripts
Supply chain riskInstall scripts are run when the package is installed. The majority of malware in npm is hidden in install scripts.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 1 instance in 1 package
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
137481
28
2125
1
5