@stfrigerio/sito-template 0.1.57 → 0.1.58
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/organisms/Calendar/Calendar.d.ts +21 -1
- package/dist/components/organisms/Calendar/Calendar.d.ts.map +1 -1
- package/dist/components/organisms/Calendar/Calendar.stories.d.ts +1 -0
- package/dist/components/organisms/Calendar/Calendar.stories.d.ts.map +1 -1
- package/dist/index.esm.js +21 -5
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +21 -5
- package/dist/index.js.map +1 -1
- package/dist/styles.css +1 -1
- package/dist/styles.css.map +1 -1
- package/dist/themes/dao.css +16 -1
- package/package.json +1 -1
|
@@ -21,6 +21,8 @@ export interface CalendarEvent {
|
|
|
21
21
|
status?: 'pending' | 'completed' | 'cancelled' | string;
|
|
22
22
|
/** Priority level for color coding */
|
|
23
23
|
priority?: 'high' | 'medium' | 'low' | string;
|
|
24
|
+
/** Category id used by the built-in category filter (see CalendarConfig.categories) */
|
|
25
|
+
category?: string;
|
|
24
26
|
/** Background color override */
|
|
25
27
|
color?: string;
|
|
26
28
|
/** Text color override */
|
|
@@ -59,6 +61,20 @@ export interface CalendarConfig {
|
|
|
59
61
|
dayLabels?: string[];
|
|
60
62
|
/** Custom month names */
|
|
61
63
|
monthNames?: string[];
|
|
64
|
+
/** Categories for the built-in segmented filter. When provided, Calendar renders a pill row
|
|
65
|
+
* below the header with an "All" toggle plus one pill per category. Events with a matching
|
|
66
|
+
* `category` are filtered by selection; events with no `category` are always shown. */
|
|
67
|
+
categories?: Array<{
|
|
68
|
+
id: string;
|
|
69
|
+
label: string;
|
|
70
|
+
color: string;
|
|
71
|
+
}>;
|
|
72
|
+
}
|
|
73
|
+
/** A category for the built-in filter */
|
|
74
|
+
export interface CalendarCategory {
|
|
75
|
+
id: string;
|
|
76
|
+
label: string;
|
|
77
|
+
color: string;
|
|
62
78
|
}
|
|
63
79
|
/**
|
|
64
80
|
* Props for the Calendar component
|
|
@@ -113,6 +129,10 @@ export interface CalendarProps {
|
|
|
113
129
|
compact?: boolean;
|
|
114
130
|
/** Externally controlled selected date highlight (distinct from initialDate which controls navigation) */
|
|
115
131
|
selectedDate?: Date;
|
|
132
|
+
/** Controlled category filter selection. `null` means "All". Omit for uncontrolled. */
|
|
133
|
+
selectedCategoryId?: string | null;
|
|
134
|
+
/** Called when the user picks a pill in the category filter. `null` = "All". */
|
|
135
|
+
onCategoryChange?: (categoryId: string | null) => void;
|
|
116
136
|
}
|
|
117
137
|
/**
|
|
118
138
|
* Calendar component - A flexible, reusable calendar for displaying events
|
|
@@ -143,5 +163,5 @@ export interface CalendarProps {
|
|
|
143
163
|
* onEventClick={handleEventClick}
|
|
144
164
|
* />
|
|
145
165
|
*/
|
|
146
|
-
export declare function Calendar({ events, onEventClick, onDateClick, onEventClickByView, onDateClickByView, onTimeSlotClick, onEventDrop, onEventComplete, onEventDelete, onEventEdit, viewMode, initialDate, config, className, style, loading, emptyState, hideHeader, compact, selectedDate }: CalendarProps): import("react/jsx-runtime").JSX.Element;
|
|
166
|
+
export declare function Calendar({ events, onEventClick, onDateClick, onEventClickByView, onDateClickByView, onTimeSlotClick, onEventDrop, onEventComplete, onEventDelete, onEventEdit, viewMode, initialDate, config, className, style, loading, emptyState, hideHeader, compact, selectedDate, selectedCategoryId, onCategoryChange }: CalendarProps): import("react/jsx-runtime").JSX.Element;
|
|
147
167
|
//# sourceMappingURL=Calendar.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Calendar.d.ts","sourceRoot":"","sources":["../../../../src/components/organisms/Calendar/Calendar.tsx"],"names":[],"mappings":"AAKA;;;GAGG;AACH,MAAM,WAAW,aAAa;IAC1B,sCAAsC;IACtC,EAAE,EAAE,MAAM,CAAC;IACX,uBAAuB;IACvB,KAAK,EAAE,MAAM,CAAC;IACd,iBAAiB;IACjB,IAAI,EAAE,IAAI,GAAG,MAAM,CAAC;IACpB,iDAAiD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AM,CAAC;IAChB,wBAAwB;IACxB,SAAS,CAAC,EAAE,MAAM,EAAE,CAAC;IACrB,yBAAyB;IACzB,UAAU,CAAC,EAAE,MAAM,EAAE,CAAC;
|
|
1
|
+
{"version":3,"file":"Calendar.d.ts","sourceRoot":"","sources":["../../../../src/components/organisms/Calendar/Calendar.tsx"],"names":[],"mappings":"AAKA;;;GAGG;AACH,MAAM,WAAW,aAAa;IAC1B,sCAAsC;IACtC,EAAE,EAAE,MAAM,CAAC;IACX,uBAAuB;IACvB,KAAK,EAAE,MAAM,CAAC;IACd,iBAAiB;IACjB,IAAI,EAAE,IAAI,GAAG,MAAM,CAAC;IACpB,iDAAiD;IACjD,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,4FAA4F;IAC5F,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,yEAAyE;IACzE,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,gDAAgD;IAChD,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,iDAAiD;IACjD,MAAM,CAAC,EAAE,SAAS,GAAG,WAAW,GAAG,WAAW,GAAG,MAAM,CAAC;IACxD,sCAAsC;IACtC,QAAQ,CAAC,EAAE,MAAM,GAAG,QAAQ,GAAG,KAAK,GAAG,MAAM,CAAC;IAC9C,uFAAuF;IACvF,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,gCAAgC;IAChC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,0BAA0B;IAC1B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,0BAA0B;IAC1B,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACtC;AAED;;;GAGG;AACH,MAAM,WAAW,cAAc;IAC3B,0CAA0C;IAC1C,WAAW,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACrC,2CAA2C;IAC3C,YAAY,CAAC,EAAE,CAAC,KAAK,EAAE,aAAa,KAAK,KAAK,CAAC,SAAS,CA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AAC;IAClB,mCAAmC;IACnC,UAAU,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC7B,kEAAkE;IAClE,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,gFAAgF;IAChF,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,0GAA0G;IAC1G,YAAY,CAAC,EAAE,IAAI,CAAC;IACpB,uFAAuF;IACvF,kBAAkB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACnC,gFAAgF;IAChF,gBAAgB,CAAC,EAAE,CAAC,UAAU,EAAE,MAAM,GAAG,IAAI,KAAK,IAAI,CAAC;CAC1D;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,wBAAgB,QAAQ,CAAC,EACrB,MAAM,EACN,YAAY,EACZ,WAAW,EACX,kBAAkB,EAClB,iBAAiB,EACjB,eAAe,EACf,WAAW,EACX,eAAe,EACf,aAAa,EACb,WAAW,EACX,QAAkB,EAClB,WAAwB,EACxB,MAAW,EACX,SAAc,EACd,KAAU,EACV,OAAe,EACf,UAAU,EACV,UAAkB,EAClB,OAAe,EACf,YAAY,EACZ,kBAAkB,EAClB,gBAAgB,EACnB,EAAE,aAAa,2CAmnBf"}
|
|
@@ -39,5 +39,6 @@ export declare const WithWeekNumbers: Story;
|
|
|
39
39
|
export declare const OverflowDay: Story;
|
|
40
40
|
export declare const Loading: Story;
|
|
41
41
|
export declare const Empty: Story;
|
|
42
|
+
export declare const WithCategoryFilter: Story;
|
|
42
43
|
export declare const ControlledSelection: Story;
|
|
43
44
|
//# sourceMappingURL=Calendar.stories.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Calendar.stories.d.ts","sourceRoot":"","sources":["../../../../src/components/organisms/Calendar/Calendar.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAQ,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAE5D,OAAO,EAAE,QAAQ,EAAsB,MAAM,YAAY,CAAC;AAE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KrB,CAAC;AAGF,eAAO,MAAM,KAAK,EAAE,KAWnB,CAAC;AAKF,eAAO,MAAM,kBAAkB,EAAE,KAoBhC,CAAC;AAKF,eAAO,MAAM,mBAAmB,EAAE,KAoBjC,CAAC"}
|
package/dist/index.esm.js
CHANGED
|
@@ -2954,7 +2954,7 @@ const LiquidButton = ({ actions, icon: Icon = Plus, className = '', }) => {
|
|
|
2954
2954
|
}, onClick: () => handleAction(action), children: [jsx(action.icon, { size: 18, color: action.color }), jsx("span", { className: styles$b.actionLabel, children: action.label })] }, action.key))) })) }), jsx(motion.button, { type: "button", className: styles$b.button, onClick: handleToggle, animate: { rotate: expanded ? 45 : 0 }, transition: { duration: 0.2 }, "aria-label": expanded ? 'Close actions' : 'Open actions', children: jsx(Icon, { size: 24, strokeWidth: 2.5 }) })] })] }));
|
|
2955
2955
|
};
|
|
2956
2956
|
|
|
2957
|
-
var styles$a = {"calendar":"Calendar-module_calendar__3mIJS","loading":"Calendar-module_loading__59Z9-","loadingSpinner":"Calendar-module_loadingSpinner__7MXqV","header":"Calendar-module_header__cZHNA","navigation":"Calendar-module_navigation__PGkpY","navButton":"Calendar-module_navButton__kOe-w","title":"Calendar-module_title__oJZ7m","controls":"Calendar-module_controls__i1Z38","todayButton":"Calendar-module_todayButton__Ac9zc","viewToggle":"Calendar-module_viewToggle__Fhg2t","viewButton":"Calendar-module_viewButton__J2WY6","active":"Calendar-module_active__lIqH-","weekDays":"Calendar-module_weekDays__4J-8f","weekNumberHeader":"Calendar-module_weekNumberHeader__xhKbB","weekDay":"Calendar-module_weekDay__cg8Gr","daysGrid":"Calendar-module_daysGrid__ER0GM","weekView":"Calendar-module_weekView__bdtGs","dayCell":"Calendar-module_dayCell__TV-HR","dayNumber":"Calendar-module_dayNumber__ICH-X","today":"Calendar-module_today__eGuUU","events":"Calendar-module_events__qdbs7","event":"Calendar-module_event__Q1Zq3","eventTitle":"Calendar-module_eventTitle__XU7Wd","eventTime":"Calendar-module_eventTime__pMGEB","otherMonth":"Calendar-module_otherMonth__r6VJK","selected":"Calendar-module_selected__5e6h0","compact":"Calendar-module_compact__i0SF3","dots":"Calendar-module_dots__1Q7QR","dot":"Calendar-module_dot__tsCR1","dotMore":"Calendar-module_dotMore__emasD","weekNumber":"Calendar-module_weekNumber__nlo50","completed":"Calendar-module_completed__B-SHI","completedIcon":"Calendar-module_completedIcon__-oDZ9","moreEvents":"Calendar-module_moreEvents__TIKaT","emptyState":"Calendar-module_emptyState__2fcj7","dayView":"Calendar-module_dayView__PCIos","dayViewHeader":"Calendar-module_dayViewHeader__Gvxx2","timeColumnHeader":"Calendar-module_timeColumnHeader__B0btR","dayColumnHeader":"Calendar-module_dayColumnHeader__Rjqwg","allDayStrip":"Calendar-module_allDayStrip__VOqbV","allDayLabel":"Calendar-module_allDayLabel__2AmyT","allDayList":"Calendar-module_allDayList__6hFSb","dayViewScrollContainer":"Calendar-module_dayViewScrollContainer__84Byq","dayTimelineGrid":"Calendar-module_dayTimelineGrid__r1BNI","hourRow":"Calendar-module_hourRow__U-YN-","hourLabel":"Calendar-module_hourLabel__im84k","hourSlots":"Calendar-module_hourSlots__vbtYy","halfHourSlot":"Calendar-module_halfHourSlot__UWIri","halfHourSlotBottom":"Calendar-module_halfHourSlotBottom__aE5Mo","dayEventAnchor":"Calendar-module_dayEventAnchor__oryAi","currentTimeIndicator":"Calendar-module_currentTimeIndicator__GntOZ"};
|
|
2957
|
+
var styles$a = {"calendar":"Calendar-module_calendar__3mIJS","loading":"Calendar-module_loading__59Z9-","loadingSpinner":"Calendar-module_loadingSpinner__7MXqV","header":"Calendar-module_header__cZHNA","navigation":"Calendar-module_navigation__PGkpY","navButton":"Calendar-module_navButton__kOe-w","title":"Calendar-module_title__oJZ7m","controls":"Calendar-module_controls__i1Z38","todayButton":"Calendar-module_todayButton__Ac9zc","viewToggle":"Calendar-module_viewToggle__Fhg2t","viewButton":"Calendar-module_viewButton__J2WY6","active":"Calendar-module_active__lIqH-","filterBar":"Calendar-module_filterBar__ZD-lX","filterPill":"Calendar-module_filterPill__f7S8p","filterPillActive":"Calendar-module_filterPillActive__9Wtm9","filterDot":"Calendar-module_filterDot__E1Hp8","weekDays":"Calendar-module_weekDays__4J-8f","weekNumberHeader":"Calendar-module_weekNumberHeader__xhKbB","weekDay":"Calendar-module_weekDay__cg8Gr","daysGrid":"Calendar-module_daysGrid__ER0GM","weekView":"Calendar-module_weekView__bdtGs","dayCell":"Calendar-module_dayCell__TV-HR","dayNumber":"Calendar-module_dayNumber__ICH-X","today":"Calendar-module_today__eGuUU","events":"Calendar-module_events__qdbs7","event":"Calendar-module_event__Q1Zq3","eventTitle":"Calendar-module_eventTitle__XU7Wd","eventTime":"Calendar-module_eventTime__pMGEB","otherMonth":"Calendar-module_otherMonth__r6VJK","selected":"Calendar-module_selected__5e6h0","compact":"Calendar-module_compact__i0SF3","dots":"Calendar-module_dots__1Q7QR","dot":"Calendar-module_dot__tsCR1","dotMore":"Calendar-module_dotMore__emasD","weekNumber":"Calendar-module_weekNumber__nlo50","completed":"Calendar-module_completed__B-SHI","completedIcon":"Calendar-module_completedIcon__-oDZ9","moreEvents":"Calendar-module_moreEvents__TIKaT","emptyState":"Calendar-module_emptyState__2fcj7","dayView":"Calendar-module_dayView__PCIos","dayViewHeader":"Calendar-module_dayViewHeader__Gvxx2","timeColumnHeader":"Calendar-module_timeColumnHeader__B0btR","dayColumnHeader":"Calendar-module_dayColumnHeader__Rjqwg","allDayStrip":"Calendar-module_allDayStrip__VOqbV","allDayLabel":"Calendar-module_allDayLabel__2AmyT","allDayList":"Calendar-module_allDayList__6hFSb","dayViewScrollContainer":"Calendar-module_dayViewScrollContainer__84Byq","dayTimelineGrid":"Calendar-module_dayTimelineGrid__r1BNI","hourRow":"Calendar-module_hourRow__U-YN-","hourLabel":"Calendar-module_hourLabel__im84k","hourSlots":"Calendar-module_hourSlots__vbtYy","halfHourSlot":"Calendar-module_halfHourSlot__UWIri","halfHourSlotBottom":"Calendar-module_halfHourSlotBottom__aE5Mo","dayEventAnchor":"Calendar-module_dayEventAnchor__oryAi","currentTimeIndicator":"Calendar-module_currentTimeIndicator__GntOZ"};
|
|
2958
2958
|
|
|
2959
2959
|
var styles$9 = {"wrapper":"DayEventCard-module_wrapper__qvRgl","deleteUnderlay":"DayEventCard-module_deleteUnderlay__fTtuX","card":"DayEventCard-module_card__V9xTi","dragging":"DayEventCard-module_dragging__q19ID","completed":"DayEventCard-module_completed__tq8ol","text":"DayEventCard-module_text__3dWF7","grip":"DayEventCard-module_grip__tmim4","checkIcon":"DayEventCard-module_checkIcon__Ki67j","time":"DayEventCard-module_time__Ojdye","editButton":"DayEventCard-module_editButton__nDi-e"};
|
|
2960
2960
|
|
|
@@ -3053,11 +3053,24 @@ const DayEventCard = ({ event, color, textColor, onComplete, onEdit, onDelete, o
|
|
|
3053
3053
|
* onEventClick={handleEventClick}
|
|
3054
3054
|
* />
|
|
3055
3055
|
*/
|
|
3056
|
-
function Calendar({ events, onEventClick, onDateClick, onEventClickByView, onDateClickByView, onTimeSlotClick, onEventDrop, onEventComplete, onEventDelete, onEventEdit, viewMode = 'month', initialDate = new Date(), config = {}, className = '', style = {}, loading = false, emptyState, hideHeader = false, compact = false, selectedDate }) {
|
|
3056
|
+
function Calendar({ events, onEventClick, onDateClick, onEventClickByView, onDateClickByView, onTimeSlotClick, onEventDrop, onEventComplete, onEventDelete, onEventEdit, viewMode = 'month', initialDate = new Date(), config = {}, className = '', style = {}, loading = false, emptyState, hideHeader = false, compact = false, selectedDate, selectedCategoryId, onCategoryChange }) {
|
|
3057
3057
|
const [currentDate, setCurrentDate] = useState(initialDate);
|
|
3058
3058
|
const [currentViewMode, setCurrentViewMode] = useState(viewMode);
|
|
3059
|
+
const [internalCategoryId, setInternalCategoryId] = useState(null);
|
|
3060
|
+
const isCategoryControlled = selectedCategoryId !== undefined;
|
|
3061
|
+
const activeCategoryId = isCategoryControlled ? selectedCategoryId ?? null : internalCategoryId;
|
|
3062
|
+
const handleCategoryPick = (id) => {
|
|
3063
|
+
if (!isCategoryControlled)
|
|
3064
|
+
setInternalCategoryId(id);
|
|
3065
|
+
onCategoryChange?.(id);
|
|
3066
|
+
};
|
|
3059
3067
|
const dayViewScrollRef = useRef(null);
|
|
3060
|
-
const { eventColors = {}, iconRenderer, maxEventsPerDay = 3, mondayStart = false, showWeekNumbers = false, dateFormat = { month: 'long', year: 'numeric' }, locale = 'en-US', dayLabels, monthNames, startHour = 0, endHour = 24, hourHeight = 60, halfHourSlots = false } = config;
|
|
3068
|
+
const { eventColors = {}, iconRenderer, maxEventsPerDay = 3, mondayStart = false, showWeekNumbers = false, dateFormat = { month: 'long', year: 'numeric' }, locale = 'en-US', dayLabels, monthNames, startHour = 0, endHour = 24, hourHeight = 60, halfHourSlots = false, categories } = config;
|
|
3069
|
+
const filteredEvents = useMemo(() => {
|
|
3070
|
+
if (!categories || categories.length === 0 || activeCategoryId === null)
|
|
3071
|
+
return events;
|
|
3072
|
+
return events.filter(e => !e.category || e.category === activeCategoryId);
|
|
3073
|
+
}, [events, categories, activeCategoryId]);
|
|
3061
3074
|
const defaultDayLabels = mondayStart
|
|
3062
3075
|
? ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun']
|
|
3063
3076
|
: ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'];
|
|
@@ -3141,7 +3154,7 @@ function Calendar({ events, onEventClick, onDateClick, onEventClickByView, onDat
|
|
|
3141
3154
|
return { days, displayTitle };
|
|
3142
3155
|
}, [currentDate, currentViewMode, mondayStart, locale, dateFormat, monthNames]);
|
|
3143
3156
|
const getDayEvents = (day) => {
|
|
3144
|
-
const dayEvents =
|
|
3157
|
+
const dayEvents = filteredEvents.filter(event => {
|
|
3145
3158
|
const eventDate = new Date(event.date);
|
|
3146
3159
|
return eventDate.toDateString() === day.toDateString();
|
|
3147
3160
|
});
|
|
@@ -3257,7 +3270,10 @@ function Calendar({ events, onEventClick, onDateClick, onEventClickByView, onDat
|
|
|
3257
3270
|
if (loading) {
|
|
3258
3271
|
return (jsx("div", { className: `${styles$a.calendar} ${styles$a.loading} ${className}`, style: style, children: jsx("div", { className: styles$a.loadingSpinner, children: "Loading..." }) }));
|
|
3259
3272
|
}
|
|
3260
|
-
return (jsxs("div", { className: `${styles$a.calendar} ${compact ? styles$a.compact : ''} ${className}`, style: style, children: [!hideHeader && (jsxs("div", { className: styles$a.header, children: [jsxs("div", { className: styles$a.navigation, children: [jsx("button", { onClick: handlePrevious, className: styles$a.navButton, "aria-label": "Previous", children: jsx("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", children: jsx("polyline", { points: "15,18 9,12 15,6" }) }) }), jsx("h3", { className: styles$a.title, children: calendarData.displayTitle }), jsx("button", { onClick: handleNext, className: styles$a.navButton, "aria-label": "Next", children: jsx("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", children: jsx("polyline", { points: "9,6 15,12 9,18" }) }) })] }),
|
|
3273
|
+
return (jsxs("div", { className: `${styles$a.calendar} ${compact ? styles$a.compact : ''} ${className}`, style: style, children: [!hideHeader && (jsxs("div", { className: styles$a.header, children: [jsxs("div", { className: styles$a.navigation, children: [jsx("button", { onClick: handlePrevious, className: styles$a.navButton, "aria-label": "Previous", children: jsx("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", children: jsx("polyline", { points: "15,18 9,12 15,6" }) }) }), jsx("h3", { className: styles$a.title, children: calendarData.displayTitle }), jsx("button", { onClick: handleNext, className: styles$a.navButton, "aria-label": "Next", children: jsx("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", children: jsx("polyline", { points: "9,6 15,12 9,18" }) }) })] }), categories && categories.length > 0 && (jsxs("div", { className: styles$a.filterBar, role: "tablist", "aria-label": "Filter by category", children: [jsx("button", { type: "button", role: "tab", "aria-selected": activeCategoryId === null, className: `${styles$a.filterPill} ${activeCategoryId === null ? styles$a.filterPillActive : ''}`, onClick: () => handleCategoryPick(null), children: "All" }), categories.map(cat => {
|
|
3274
|
+
const active = activeCategoryId === cat.id;
|
|
3275
|
+
return (jsxs("button", { type: "button", role: "tab", "aria-selected": active, className: `${styles$a.filterPill} ${active ? styles$a.filterPillActive : ''}`, style: active ? { background: cat.color, borderColor: cat.color, color: '#ffffff' } : undefined, onClick: () => handleCategoryPick(cat.id), children: [!active && (jsx("span", { className: styles$a.filterDot, style: { background: cat.color } })), cat.label] }, cat.id));
|
|
3276
|
+
})] })), jsxs("div", { className: styles$a.controls, children: [jsx("button", { onClick: handleToday, className: styles$a.todayButton, children: "Today" }), jsxs("div", { className: styles$a.viewToggle, children: [jsx("button", { className: `${styles$a.viewButton} ${currentViewMode === 'month' ? styles$a.active : ''}`, onClick: () => setCurrentViewMode('month'), children: "Month" }), jsx("button", { className: `${styles$a.viewButton} ${currentViewMode === 'week' ? styles$a.active : ''}`, onClick: () => setCurrentViewMode('week'), children: "Week" }), jsx("button", { className: `${styles$a.viewButton} ${currentViewMode === 'day' ? styles$a.active : ''}`, onClick: () => setCurrentViewMode('day'), children: "Day" })] })] })] })), currentViewMode !== 'day' && (jsxs("div", { className: styles$a.weekDays, children: [showWeekNumbers && jsx("div", { className: styles$a.weekNumberHeader, children: "Week" }), finalDayLabels.map((day) => (jsx("div", { className: styles$a.weekDay, children: day }, day)))] })), currentViewMode === 'day' ? (
|
|
3261
3277
|
// Day view layout — positioned events with duration, all-day strip, now-line
|
|
3262
3278
|
(() => {
|
|
3263
3279
|
const dayEvents = getDayEvents(currentDate);
|