Skip to content

feat(theme): add input-date recipe#278

Open
alexgrozav wants to merge 3 commits into
mainfrom
recipe/input-date
Open

feat(theme): add input-date recipe#278
alexgrozav wants to merge 3 commits into
mainfrom
recipe/input-date

Conversation

@alexgrozav

@alexgrozav alexgrozav commented Jun 24, 2026

Copy link
Copy Markdown
Contributor

Summary

Adds a segmented Input Date recipe family to @styleframe/theme, inspired by Nuxt UI's input-date. It styles the segmented date input surface only — calendar/popover styling stays in the existing calendar recipe.

Two recipes:

  • useInputDateRecipe() — the wrapper that owns the visual field (border, background, padding, :focus-within ring). A member of the field recipes family, so it shares the Input recipe's color / style / state surface: Container colors (light / dark / neutral), default / soft / ghost variants, sm / md / lg sizes, and invalid / disabled / readonly states. Its setup callback lays the inner .input-date-field row out as flex and registers the muted .input-date-separator glyph.
  • useInputDateSegmentRecipe() — the individually-focusable date/time segment. Transparent, inherits typography from the wrapper, centers digits with tabular figures, and paints a :focus highlight (@color.primary / @color.white). Single size axis.

What's included

  • Recipetheme/src/recipes/input-date/ (useInputDateRecipe, useInputDateSegmentRecipe, barrel) + root barrel export.
  • Tests — Vitest specs for both recipes (compound variants, setup selectors, size axis, filtering). Full theme suite: 288 files / 3245 tests passing.
  • Showcase — Storybook registration, InputDate.vue, InputDateGrid.vue / InputDateSizeGrid.vue preview grids, and 15 stories under Theme/Recipes/Forms/InputDate.
  • Docsapps/docs/content/docs/05.components/05.forms/06.input-date.md, grounded in the recipe source with 10 live story embeds. The forms docs were renumbered (06.otp → 07.otp, …) to slot input-date alphabetically between input and otp; routes strip numeric prefixes, so the renumber is link-safe.

Verification

  • pnpm typecheck — 15/15 tasks pass (incl. storybook vue-tsc)
  • pnpm --filter @styleframe/theme test — 288 files / 3245 tests pass
  • pnpm lint (oxlint) — 0 errors, no warnings in input-date

Refs

Refs UXF-2

Test plan

  • pnpm typecheck
  • pnpm --filter @styleframe/theme test
  • pnpm lint
  • Storybook: review Theme/Recipes/Forms/InputDate stories (colors, variants, sizes, states)
  • Docs: confirm 06.input-date.md renders and the 10 story-preview embeds resolve

Add a segmented date-input recipe family inspired by Nuxt UI's input-date:
a wrapper recipe (useInputDateRecipe) that owns the field surface and
:focus-within ring as a member of the field family, plus a segment recipe
(useInputDateSegmentRecipe) for the individually-focusable date parts. Includes
tests, Storybook showcase (registration, component, grids, stories), and docs.

Refs UXF-2.
@vercel

vercel Bot commented Jun 24, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
storybook-styleframe-dev Ready Ready Preview, Comment Jun 24, 2026 9:13am
styleframe-dev Ready Ready Preview, Comment Jun 24, 2026 9:13am

Request Review

@changeset-bot

changeset-bot Bot commented Jun 24, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: efb88d1

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@codecov

codecov Bot commented Jun 24, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

Raw selector() declarations don't auto-declare numeric spacing multiplier
variables the way recipe base/variant values do, so referencing "@0.125" in the
input-date wrapper setup threw "Variable 0.125 is not defined" at Storybook
build time. Inline the calc against the spacing base variable instead, matching
the calendar recipe pattern. Update the test instance to declare spacing.

Refs UXF-2.
Replace the verbose css`calc(${ref("spacing")} * 0.125)` setup-selector
form with the embedded-reference expression `calc(@spacing * 0.125)`.
Styleframe's resolver parses an @-ref embedded in an expression without
validation, so a raw selector can scale a token inline without a
pre-declared multiplier variable. The arithmetic must stay inside calc()
or the output is invalid CSS (var(--spacing) * .125).

Document the pattern in the implement-recipe and verify-recipe skills,
and promote the Storybook production build to a required verification
step (it is the only check that catches undefined-token errors).

Refs UXF-2.
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.

1 participant