feat(evo-marko): evo-calendar#679
Conversation
🦋 Changeset detectedLatest commit: 1798982 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
There was a problem hiding this comment.
Pull request overview
Adds the new evo-calendar Marko component, including date utilities, locale generation support, examples, Storybook docs, and SSR/browser test coverage.
Changes:
- Introduces
evo-calendarwith selectable days/ranges, navigation, disabled dates, links, and locale-aware weekday/month rendering. - Adds shared date/locale utilities plus a CLDR-based locale-info generation script.
- Adds Storybook examples and Vitest SSR/browser tests with snapshots.
Reviewed changes
Copilot reviewed 14 out of 15 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
packages/evo-marko/src/tags/evo-calendar/index.marko |
Implements the calendar component API and rendering logic. |
packages/evo-marko/src/tags/evo-calendar/style.ts |
Imports Skin calendar styles. |
packages/evo-marko/src/tags/evo-calendar/README.md |
Adds component documentation links. |
packages/evo-marko/src/tags/evo-calendar/calendar.stories.ts |
Adds Storybook metadata and stories. |
packages/evo-marko/src/tags/evo-calendar/examples/default.marko |
Adds default example. |
packages/evo-marko/src/tags/evo-calendar/examples/controllable.marko |
Adds controlled selection example. |
packages/evo-marko/src/tags/evo-calendar/examples/with-links.marko |
Adds link-building example. |
packages/evo-marko/src/tags/evo-calendar/test/test.server.ts |
Adds SSR snapshot tests. |
packages/evo-marko/src/tags/evo-calendar/test/test.browser.ts |
Adds browser interaction/accessibility tests. |
packages/evo-marko/src/tags/evo-calendar/test/__snapshots__/test.server.ts.snap |
Adds initial SSR snapshots. |
packages/evo-marko/src/common/dates/date-utils.ts |
Adds shared ISO date and locale helper functions. |
packages/evo-marko/src/common/dates/locale-info.ts |
Adds generated CLDR locale metadata. |
packages/evo-marko/scripts/generate-locale-info.js |
Adds locale metadata generation script. |
packages/evo-marko/package.json |
Adds locale-info generation npm script. |
package-lock.json |
Updates lockfile metadata for dependencies. |
Comments suppressed due to low confidence (5)
packages/evo-marko/src/tags/evo-calendar/test/test.browser.ts:78
- This uses the old navigation prop name, so the header is not enabled for this test. Switch to
a11yNavigateText; otherwise the test can pass because of day buttons afterselectModeis fixed without actually verifying navigation buttons.
component = await render(Default, {
interactive: true,
todayISO: "2025-01-15",
getA11yNavigateText: (month: string) => `Show ${month}`,
packages/evo-marko/src/tags/evo-calendar/test/test.browser.ts:95
- The component input is named
disable, notdisabled, so these dates are never disabled. Update the test data to usedisable: { list: [...] }so the assertion covers the new API.
component = await render(Default, {
interactive: true,
todayISO: "2025-01-15",
disabled: { list: ["2025-01-10", "2025-01-20"] },
packages/evo-marko/src/tags/evo-calendar/test/test.browser.ts:112
getHrefis not anevo-calendarinput prop; the link callback is namedlinkBuilder. As written, this test renders no links and will fail instead of covering the non-interactive link path.
component = await render(Default, {
interactive: false,
todayISO: "2025-01-15",
getHref: (iso: string) =>
packages/evo-marko/src/tags/evo-calendar/test/test.server.ts:20
- These SSR cases still pass the old
interactiveprop, whichevo-calendarignores. UseselectMode(for example"day"or"range") so the snapshots actually cover the interactive markup instead of rendering the non-interactive calendar.
it("renders interactive mode", async () => {
await snapshotHTML(Default, {
interactive: true,
todayISO: "2025-01-15",
packages/evo-marko/src/tags/evo-calendar/test/test.server.ts:52
- The disabled-date SSR case uses the old prop name
disabled, but the component readsdisable, so this snapshot does not cover disabled rendering. Rename this input todisableto match the new API.
await snapshotHTML(Default, {
interactive: true,
todayISO: "2025-01-15",
disabled: { before: "2025-01-05", after: "2025-01-25" },
| it("renders with todayISO pinned", async () => { | ||
| await snapshotHTML(Default, { todayISO: "2025-01-15" }); |
| component = await render(Default, { | ||
| interactive: true, | ||
| todayISO: "2025-01-15", |
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
<evo-calendar>componentAPI Changes
ebay-calendar→evo-calendarnavigable+get-a11y-show-month-text→a11yNavigateTextinteractive→selectMode?: "day" | "range"selectedbut we might need to add a third"custom"option in case devs just want days to be buttonsselected: DayISO | [DayISO, DayISO]→selected: DayISO | { from: DayISO, to: DayISO }+selectedChangedisable-*→disable: { * }callbackfor completely custom disable schemesa11y-range-*-text→a11yRangeText: { * }a11y-separator→ (removed)" - "so this is for consistencyNew in
evo-calendarviewStart+viewStartChangetodayNotes
a11ytext. I think this can be improved in a variety of waysa11yTodayTextanda11ySelectedTextare only used in non-interactive dialogs, and required in that casea11yRangeTextshould be required forselectMode: "range"