Skip to content

feat(evo-marko): evo-calendar#679

Open
LuLaValva wants to merge 4 commits into
mainfrom
evo-calendar
Open

feat(evo-marko): evo-calendar#679
LuLaValva wants to merge 4 commits into
mainfrom
evo-calendar

Conversation

@LuLaValva
Copy link
Copy Markdown
Member

  • Add tags API <evo-calendar> component

API Changes ebay-calendarevo-calendar

  • navigable + get-a11y-show-month-texta11yNavigateText
    • callback's presence necessary for navigation
  • interactive  → selectMode?: "day" | "range"
    • Not 100% sure about this one day & range work nicely with controllable selected but we might need to add a third "custom" option in case devs just want days to be buttons
  • selected: DayISO | [DayISO, DayISO]selected: DayISO | { from: DayISO, to: DayISO } + selectedChange
    • Maybe unnecessary, but it simplified some logic and made it easier to read
  • disable-*disable: { * }
    • Also added callback for completely custom disable schemes
  • a11y-range-*-texta11yRangeText: { * }
    • Allows us to be a little more strict with TS
  • a11y-separator → (removed)
    • In other places we unconditionally use " - " so this is for consistency

New in evo-calendar

  • viewStart + viewStartChange
    • Force the calendar to show a specific month or set of months, defaults to the month containing today

Notes

  • For this first pass, I didn't ever force a11y text. I think this can be improved in a variety of ways
    • a11yTodayText and a11ySelectedText are only used in non-interactive dialogs, and required in that case
    • a11yRangeText should be required for selectMode: "range"
  • CLDR updated its structure, so we needed to change our process to convert it to locale info

Copilot AI review requested due to automatic review settings May 14, 2026 23:09
@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented May 14, 2026

🦋 Changeset detected

Latest commit: 1798982

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@evo-web/marko Patch

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

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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-calendar with 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 after selectMode is 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, not disabled, so these dates are never disabled. Update the test data to use disable: { 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

  • getHref is not an evo-calendar input prop; the link callback is named linkBuilder. 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 interactive prop, which evo-calendar ignores. Use selectMode (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 reads disable, so this snapshot does not cover disabled rendering. Rename this input to disable to match the new API.
        await snapshotHTML(Default, {
            interactive: true,
            todayISO: "2025-01-15",
            disabled: { before: "2025-01-05", after: "2025-01-25" },

Comment thread packages/evo-marko/src/tags/evo-calendar/index.marko
Comment thread packages/evo-marko/src/tags/evo-calendar/index.marko Outdated
Comment on lines +13 to +14
it("renders with todayISO pinned", async () => {
await snapshotHTML(Default, { todayISO: "2025-01-15" });
Comment on lines +33 to +35
component = await render(Default, {
interactive: true,
todayISO: "2025-01-15",
Comment thread packages/evo-marko/package.json
Comment thread packages/evo-marko/src/tags/evo-calendar/README.md
LuLaValva and others added 2 commits May 14, 2026 16:25
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants