Skip to content

feat(NumberField): add new component/composables#183

Merged
johnleider merged 25 commits into
masterfrom
feat/number-field-component
Apr 6, 2026
Merged

feat(NumberField): add new component/composables#183
johnleider merged 25 commits into
masterfrom
feat/number-field-component

Conversation

@johnleider
Copy link
Copy Markdown
Member

Summary

  • createNumberField composable — orchestrates createInput + createNumeric + Intl.NumberFormat
  • NumberField compound component — Root, Input, Increment, Decrement, Scrub, Description, Error
  • Full WAI-ARIA spinbutton compliance (role="spinbutton", aria-valuenow/min/max/text)
  • Drag-to-scrub interaction via Pointer Lock API
  • Spin-on-hold for increment/decrement buttons
  • Keyboard: Arrow (step), PageUp/Down (leap), Shift+Arrow (×10), Home/End, Enter (commit)
  • Locale-aware formatting via Intl.NumberFormat (currency, percent, units)

Builds on #181 (createNumeric + createInput foundation).

Test plan

  • 42 createNumberField composable tests pass
  • Full suite: 4569/4569 tests pass
  • Typecheck clean
  • Lint clean
  • Package build succeeds
  • Docs pages: component + composable + 4 examples (basic, currency, scrub, composable)
  • maturity.json + README updated

@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new Bot commented Apr 5, 2026

Open in StackBlitz

commit: 6208158

Root creates number field context via createNumberField, manages
validation timing with validateOn, and provides context to children.
Input renders a spinbutton with keyboard navigation, text parsing,
and focus-dependent display formatting.

Also extends createNumberField to forward error/errorMessages to
createInput for manual validation state override.
Increment/Decrement buttons with spin-on-hold behavior (configurable
spinDelay and spinRate). Scrub uses Pointer Lock API for click-and-drag
value adjustment with configurable sensitivity.
Description and Error sub-components for help text and validation
messages with ARIA connectivity. Barrel file exports all sub-components
with JSDoc and compound NumberField object.
- Fix meta indentation to use 2-space indent per docs rules
- Rewrite intros to be user-facing, not mentioning internal composables
- Add missing aria-valuetext to ARIA attributes table
- Fix PageUp/PageDown to reference leap instead of hardcoded "10 steps"
- Remove inline comments from Control (code is self-documenting)
- Replace manual setTimeout/setInterval in Increment/Decrement with
  useTimer composable — auto-cleanup on scope dispose, cleaner API
…ean up Root

- Description/Error: add id prop with useId() default, destructure from props
- Same for Input.Description and Input.Error (consistency)
- Control: remove inline comments
- Root: destructure input from createNumberField inline
@johnleider johnleider force-pushed the feat/number-field-component branch from 4aeff03 to 6208158 Compare April 6, 2026 17:06
@johnleider johnleider self-assigned this Apr 6, 2026
@johnleider johnleider added this to the v0.2.x milestone Apr 6, 2026
@johnleider johnleider changed the title feat(NumberField): add numeric input component with scrub and Intl formatting feat(NumberField): add new component/composables Apr 6, 2026
@johnleider johnleider merged commit 193a2a5 into master Apr 6, 2026
14 of 16 checks passed
@johnleider johnleider deleted the feat/number-field-component branch April 6, 2026 17:13
johnleider added a commit that referenced this pull request Apr 11, 2026
Delete the standalone pkg-pr-new.yml workflow and add an equivalent
pkg-pr-new job inside pr-checks.yml that downloads the dist artifact
uploaded by the build job. Eliminates ~25s of duplicate install+build
CI minutes per PR push.

Drops the legacy 'labeled' pull_request trigger from the original
workflow - empirically confirmed it was firing but not load-bearing.
PR #183 (NumberField) alone republished 4 times on the same SHA
because taxonomy labels (C: NumberField, E: createNumberField,
E: createInput) were added one at a time, each triggering a fresh
publish. Dropping 'labeled' stops that waste entirely.

Uses the composite setup action (Stage 1c) for checkout/pnpm/node.
actions/upload-artifact@v4 and actions/download-artifact@v4 with
retention-days: 1 for minimal artifact lifetime.

Stage 1d of v0 CI build time spec. Completes Stage 1.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant