@open-webapp/calendar 0.14.0 → 0.14.2
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/README.md +8 -0
- package/dist/react/CalendarPane.d.ts +3 -0
- package/dist/react/CalendarPane.js +1 -1
- package/dist/react/EventDetails.js +2 -6
- package/dist/styles.css +0 -13
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -334,6 +334,14 @@ The shared `.calendar-selector-trigger` uses border-box inline-flex, centered al
|
|
|
334
334
|
|
|
335
335
|
Done, Select all and Clear use the approved action-only flat styling via `.calendar-selector-actions > button` in standalone and grouped footer dropdowns: transparent resting background, zero border, no shadow, inherited font, `--calendar-selector-text` color and pointer cursor. Hover uses `--calendar-hover`; pointer focus has no decorative outline, while keyboard `:focus-visible` uses a 2px solid `--calendar-focus` outline with 2px offset. Action padding, row flex layout and 8px gap/top/bottom margins, footer/dropdown geometry, trigger/search/option styling, other native controls and all selection, callback and focus-return contracts are preserved.
|
|
336
336
|
|
|
337
|
+
## 0.14.2 (patch)
|
|
338
|
+
|
|
339
|
+
- The overlay top row carries the card's `calendar-event-row--rsvp-{status}` class so the Join link gets the same status-coloured styling as on the card. The Organizer row under the title is dropped when the invitee list is shown (the organizer is tagged in the list), and invitee statuses use the card's icon-only status badge instead of a text pill. No API change.
|
|
340
|
+
|
|
341
|
+
## 0.14.1 (patch)
|
|
342
|
+
|
|
343
|
+
- The event details overlay top row now reuses the event card's markup and classes (`calendar-event-header`, `calendar-event-time`, `calendar-event-actions`, `calendar-event-join`, and the same RSVP status icon), so Join and the RSVP badge look identical to the card. The close button sits at the end of the actions group. No API change.
|
|
344
|
+
|
|
337
345
|
## 0.14.0 (minor, additive, non-breaking)
|
|
338
346
|
|
|
339
347
|
- Additive only. No existing prop, return value, thrown error, storage field or contract test changed. No migration is required. The version bump is 0.13.0 to 0.14.0.
|
|
@@ -37,5 +37,8 @@ export declare function RsvpGlyph({ path, size, strokeWidth }: {
|
|
|
37
37
|
size?: number;
|
|
38
38
|
strokeWidth?: number;
|
|
39
39
|
}): import("react").JSX.Element;
|
|
40
|
+
export declare function RsvpStatusIcon({ status }: {
|
|
41
|
+
status: CalendarEvent['selfResponseStatus'];
|
|
42
|
+
}): import("react").JSX.Element;
|
|
40
43
|
export declare function formatTimeRange(event: CalendarEvent): string;
|
|
41
44
|
export declare function CalendarPane(props: CalendarPaneProps): import("react").JSX.Element;
|
|
@@ -52,7 +52,7 @@ export const RSVP_CHIPS = [
|
|
|
52
52
|
export function RsvpGlyph({ path, size = 16, strokeWidth = 2.2 }) {
|
|
53
53
|
return (_jsx("svg", { width: size, height: size, viewBox: "0 0 24 24", fill: "none", "aria-hidden": "true", focusable: "false", children: _jsx("path", { d: path, stroke: "currentColor", strokeWidth: strokeWidth, strokeLinecap: "round", strokeLinejoin: "round" }) }));
|
|
54
54
|
}
|
|
55
|
-
function RsvpStatusIcon({ status }) {
|
|
55
|
+
export function RsvpStatusIcon({ status }) {
|
|
56
56
|
const glyph = RSVP_CHIPS.find((chip) => chip.status === status) ?? RSVP_CHIPS[3];
|
|
57
57
|
return (_jsx("span", { className: `calendar-event-rsvp calendar-event-rsvp--${glyph.status}`, role: "img", "aria-label": glyph.status, title: glyph.status, children: _jsx(RsvpGlyph, { path: glyph.path, size: 14, strokeWidth: 2.4 }) }));
|
|
58
58
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
2
|
import { useEffect, useRef, useState } from 'react';
|
|
3
3
|
import { getOrganizerLabel } from '../core/events.js';
|
|
4
|
-
import { RSVP_CHIPS,
|
|
4
|
+
import { RSVP_CHIPS, RsvpStatusIcon, formatTimeRange } from './CalendarPane.js';
|
|
5
5
|
import { htmlToPlainText, linkifyText } from './detailsText.js';
|
|
6
6
|
import { sortInvitees, summarizeInvitees } from './inviteeUtils.js';
|
|
7
7
|
const RSVP_OPTIONS = [
|
|
@@ -14,10 +14,6 @@ const FOCUSABLE = 'a[href],button:not([disabled]),[tabindex]:not([tabindex="-1"]
|
|
|
14
14
|
function rsvpOf(status) {
|
|
15
15
|
return RSVP_CHIPS.find((c) => c.status === status) ?? RSVP_CHIPS[3];
|
|
16
16
|
}
|
|
17
|
-
function Status({ status }) {
|
|
18
|
-
const g = rsvpOf(status);
|
|
19
|
-
return (_jsxs("span", { className: `calendar-event-rsvp calendar-event-rsvp--${g.status}`, children: [_jsx(RsvpGlyph, { path: g.path, size: 14, strokeWidth: 2.4 }), " ", g.label] }));
|
|
20
|
-
}
|
|
21
17
|
export function EventDetails({ event, calendar, sourceLabel, onClose, onOpenLink, onRsvpChange, pending, error, onRetry }) {
|
|
22
18
|
const sheetRef = useRef(null);
|
|
23
19
|
const lastStatus = useRef(null);
|
|
@@ -82,7 +78,7 @@ export function EventDetails({ event, calendar, sourceLabel, onClose, onOpenLink
|
|
|
82
78
|
const checkedStatus = RSVP_OPTIONS.some((o) => o.status === event.selfResponseStatus)
|
|
83
79
|
? event.selfResponseStatus
|
|
84
80
|
: RSVP_OPTIONS[0].status;
|
|
85
|
-
return (_jsx("div", { className: "calendar-event-details", onClick: onClose, onKeyDown: onKeyDown, children: _jsxs("div", { ref: sheetRef, className: "calendar-event-details-sheet", role: "dialog", "aria-modal": "true", "aria-label": event.summary, tabIndex: -1, onClick: (e) => e.stopPropagation(), children: [_jsx("div", { className: "calendar-event-details-grabber", "aria-hidden": "true" }), _jsxs("div", { className:
|
|
81
|
+
return (_jsx("div", { className: "calendar-event-details", onClick: onClose, onKeyDown: onKeyDown, children: _jsxs("div", { ref: sheetRef, className: "calendar-event-details-sheet", role: "dialog", "aria-modal": "true", "aria-label": event.summary, tabIndex: -1, onClick: (e) => e.stopPropagation(), children: [_jsx("div", { className: "calendar-event-details-grabber", "aria-hidden": "true" }), _jsxs("div", { className: `calendar-event-header calendar-event-details-toprow calendar-event-row--rsvp-${rsvpOf(event.selfResponseStatus).status}`, children: [_jsx("span", { className: "calendar-event-time", children: time }), _jsxs("div", { className: "calendar-event-actions", children: [event.joinUrl && (_jsx("a", { className: "calendar-event-join", href: event.joinUrl, target: "_blank", rel: "noopener noreferrer", children: "Join" })), _jsx(RsvpStatusIcon, { status: event.selfResponseStatus }), _jsx("button", { type: "button", className: "calendar-event-details-close", "aria-label": "Close", onClick: onClose, children: "\u00D7" })] })] }), _jsx("div", { className: "calendar-event-details-header", children: _jsx("h2", { className: "calendar-event-details-title", children: event.summary }) }), _jsxs("div", { className: "calendar-event-details-body", children: [organizer && !showInvitees && (_jsxs("section", { className: "calendar-event-details-organizer", children: [_jsx("span", { children: "Organizer" }), " ", _jsx("span", { children: organizer }), event.organizer.self && _jsx("span", { children: " (you)" })] })), (calendar || sourceLabel || event.location) && (_jsxs("section", { className: "calendar-event-details-calendar", children: [_jsx("span", { className: "calendar-event-details-dot", "aria-hidden": "true", style: { background: calendar?.backgroundColor } }), calendar?.summary && _jsx("span", { children: calendar.summary }), sourceLabel && _jsxs("span", { children: [" ", sourceLabel] }), event.location && _jsxs("span", { className: "calendar-event-details-location", children: [" ", event.location] })] })), description && (_jsx("section", { className: "calendar-event-details-description", style: { whiteSpace: 'pre-wrap' }, children: linkifyText(description).map((t, i) => t.type === 'link' ? (_jsx("a", { href: t.href, target: "_blank", rel: "noopener noreferrer", children: t.text }, i)) : (_jsx("span", { children: t.text }, i))) })), showInvitees && (_jsxs("section", { className: "calendar-event-details-invitees", children: [_jsxs("h3", { children: ["Invitees (", attendees.length, ")"] }), _jsx("div", { className: "calendar-event-details-invitee-summary", children: summarizeInvitees(attendees) }), _jsx("ul", { children: visible.map((a, i) => (_jsxs("li", { children: [_jsx("span", { children: a.displayName || a.email }), a.organizer && _jsx("span", { className: "calendar-event-details-tag", children: " Organizer" }), a.self && _jsx("span", { className: "calendar-event-details-tag", children: " (you)" }), ' ', _jsx(RsvpStatusIcon, { status: a.responseStatus })] }, `${a.email}-${i}`))) }), sorted.length > MAX_INVITEES && (_jsx("button", { type: "button", "aria-expanded": expanded, onClick: () => setExpanded((v) => !v), children: expanded ? 'Show fewer' : `Show all ${sorted.length}` }))] })), showRsvp && (_jsxs("section", { className: "calendar-event-details-rsvp", children: [_jsx("div", { role: "radiogroup", "aria-label": "Change RSVP", children: RSVP_OPTIONS.map((o) => (_jsx("button", { type: "button", role: "radio", "aria-checked": event.selfResponseStatus === o.status, tabIndex: o.status === checkedStatus ? 0 : -1, disabled: !!pending, onClick: () => choose(o.status), onKeyDown: onRadioKeyDown, children: o.label }, o.status))) }), _jsx("div", { "aria-live": "polite", className: "calendar-event-details-rsvp-status", children: pending ? ('Updating RSVP...') : error ? (_jsxs(_Fragment, { children: [_jsx("span", { children: "Couldn't update RSVP." }), ' ', _jsx("button", { type: "button", onClick: retry, children: "Retry" })] })) : null })] })), event.htmlLink && (_jsx("section", { className: "calendar-event-details-open", children: _jsx("a", { href: event.htmlLink, target: "_blank", rel: "noopener noreferrer", onClick: (e) => {
|
|
86
82
|
e.preventDefault();
|
|
87
83
|
onOpenLink(event.htmlLink);
|
|
88
84
|
}, children: "Open in Google Calendar" }) }))] })] }) }));
|
package/dist/styles.css
CHANGED
|
@@ -910,19 +910,6 @@
|
|
|
910
910
|
cursor: pointer;
|
|
911
911
|
}
|
|
912
912
|
|
|
913
|
-
.calendar-event-details-toprow {
|
|
914
|
-
display: flex;
|
|
915
|
-
flex-wrap: wrap;
|
|
916
|
-
align-items: center;
|
|
917
|
-
gap: 8px;
|
|
918
|
-
}
|
|
919
|
-
|
|
920
|
-
.calendar-event-details-time {
|
|
921
|
-
flex: 1;
|
|
922
|
-
min-width: 0;
|
|
923
|
-
font-variant-numeric: tabular-nums;
|
|
924
|
-
}
|
|
925
|
-
|
|
926
913
|
.calendar-event-details-organizer,
|
|
927
914
|
.calendar-event-details-calendar {
|
|
928
915
|
display: flex;
|