From 8962f1418917365975b164fa85f686aee51a3d5d Mon Sep 17 00:00:00 2001 From: "copilot-action[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Thu, 19 Nov 2026 14:33:33 +0100 Subject: [PATCH 1/4] docs(sdd): specify issue contract in specs/numeric-text-field.md --- specs/CATALOG.md | 10 ++- specs/catalog.json | 3 +- specs/numeric-text-field.md | 163 ++++++++++++++++++++++++++++++++++++ 3 files changed, 171 insertions(+), 5 deletions(-) create mode 100644 specs/numeric-text-field.md diff --git a/specs/CATALOG.md b/specs/CATALOG.md index 4245aa7..139b442 100644 --- a/specs/CATALOG.md +++ b/specs/CATALOG.md @@ -1,7 +1,7 @@ # Product capability specification catalog > Generated from [`catalog.json`](./catalog.json). Do not edit this table by hand. -> Run `pnpm run generate:specifications` after changing catalog metadata. +> Regenerate this view after metadata changes using verified repository specification tooling. This catalog answers which product contract owns a capability and where its implementation, verification, workflow, and user-documentation evidence lives. @@ -10,7 +10,7 @@ debt or convert unknown historic intent into a design decision. | Capability ID | Status | Scope | Primary SDD | Evidence | |---|---|---|---|---| -| `shared-ui-foundation` | Proposed | One DOM component implementation with React, Vue, Angular and Svelte adapters, direct Lit/DOM use, shared Storybook and verified Gateway/Domus adoption. Partial source; no complete capability or release accepted. | [Shared Home Assistant presentation components and framework adapters](./shared-ui-foundation.md) + 1 companion | 337 paths · 2026-11-05 | +| `shared-ui-foundation` | Proposed | One DOM component implementation with React, Vue, Angular and Svelte adapters, direct Lit/DOM use, shared Storybook and verified Gateway/Domus adoption. Partial source; no complete capability or release accepted. | [Shared Home Assistant presentation components and framework adapters](./shared-ui-foundation.md) + 2 companion | 337 paths · 2026-11-05 | ## Evidence map @@ -18,7 +18,7 @@ debt or convert unknown historic intent into a design decision. - Owner: vypdev maintainers; Efrain Espada (accountable product/publication owner) - Last verified: 2026-11-05 -- Specifications: [`specs/shared-ui-foundation.md`](./shared-ui-foundation.md) · [`specs/shared-ui-framework-delivery.md`](./shared-ui-framework-delivery.md) +- Specifications: [`specs/shared-ui-foundation.md`](./shared-ui-foundation.md) · [`specs/shared-ui-framework-delivery.md`](./shared-ui-framework-delivery.md) · [`specs/numeric-text-field.md`](./numeric-text-field.md) - Workflows: [`.github/workflows/copilot_issue.yml`](../.github/workflows/copilot_issue.yml) · [`.github/workflows/ci_check.yml`](../.github/workflows/ci_check.yml) · [`.github/workflows/npm_release.yml`](../.github/workflows/npm_release.yml) · [`.github/workflows/storybook_pages.yml`](../.github/workflows/storybook_pages.yml) - Entrypoints: [`packages/core/src/index.ts`](../packages/core/src/index.ts) · [`packages/core/src/components/tabs.ts`](../packages/core/src/components/tabs.ts) · [`packages/react/src/index.ts`](../packages/react/src/index.ts) · [`packages/vue/src/index.ts`](../packages/vue/src/index.ts) · [`packages/angular/src/index.ts`](../packages/angular/src/index.ts) · [`packages/svelte/src/index.ts`](../packages/svelte/src/index.ts) · [`packages/core/src/components/field.ts`](../packages/core/src/components/field.ts) · [`packages/core/src/field-contracts.ts`](../packages/core/src/field-contracts.ts) · [`.storybook/main.ts`](../.storybook/main.ts) · [`packages/core/src/button-contracts.ts`](../packages/core/src/button-contracts.ts) · [`packages/core/src/components/button.ts`](../packages/core/src/components/button.ts) · [`packages/core/src/select-contracts.ts`](../packages/core/src/select-contracts.ts) · [`packages/core/src/components/select.ts`](../packages/core/src/components/select.ts) · [`packages/core/src/checkbox-contracts.ts`](../packages/core/src/checkbox-contracts.ts) · [`packages/core/src/components/checkbox.ts`](../packages/core/src/components/checkbox.ts) · [`packages/core/src/components/dialog.ts`](../packages/core/src/components/dialog.ts) · [`packages/core/src/dialog-contracts.ts`](../packages/core/src/dialog-contracts.ts) · [`packages/core/src/components/card.ts`](../packages/core/src/components/card.ts) · [`packages/core/src/card-contracts.ts`](../packages/core/src/card-contracts.ts) · [`packages/core/src/layout-contracts.ts`](../packages/core/src/layout-contracts.ts) · [`packages/core/src/components/layout.ts`](../packages/core/src/components/layout.ts) · [`packages/core/src/components/feedback.ts`](../packages/core/src/components/feedback.ts) · [`packages/core/src/feedback-contracts.ts`](../packages/core/src/feedback-contracts.ts) - Core code: [`packages/core/src/contracts.ts`](../packages/core/src/contracts.ts) · [`tooling/coverage.mjs`](../tooling/coverage.mjs) · [`packages/core/src/components/tabs.ts`](../packages/core/src/components/tabs.ts) · [`packages/react/src/index.ts`](../packages/react/src/index.ts) · [`packages/vue/src/index.ts`](../packages/vue/src/index.ts) · [`packages/angular/src/index.ts`](../packages/angular/src/index.ts) · [`packages/svelte/src/index.ts`](../packages/svelte/src/index.ts) · [`packages/svelte/src/Tabs.svelte`](../packages/svelte/src/Tabs.svelte) · [`packages/svelte/src/types.ts`](../packages/svelte/src/types.ts) · [`packages/core/src/components/field.ts`](../packages/core/src/components/field.ts) · [`packages/core/src/field-contracts.ts`](../packages/core/src/field-contracts.ts) · [`packages/core/src/presentation-text.ts`](../packages/core/src/presentation-text.ts) · [`packages/react/src/text-field.ts`](../packages/react/src/text-field.ts) · [`packages/vue/src/text-field.ts`](../packages/vue/src/text-field.ts) · [`packages/angular/src/text-field.ts`](../packages/angular/src/text-field.ts) · [`packages/svelte/src/Field.svelte`](../packages/svelte/src/Field.svelte) · [`stories/catalog-state.ts`](../stories/catalog-state.ts) · [`stories/catalog-frame.ts`](../stories/catalog-frame.ts) · [`stories/catalog-example.ts`](../stories/catalog-example.ts) · [`stories/foundation.example.ts`](../stories/foundation.example.ts) · [`stories/panels.example.ts`](../stories/panels.example.ts) · [`stories/field.example.ts`](../stories/field.example.ts) · [`.storybook/preview.ts`](../.storybook/preview.ts) · [`packages/core/src/button-contracts.ts`](../packages/core/src/button-contracts.ts) · [`packages/core/src/components/button.ts`](../packages/core/src/components/button.ts) · [`stories/button.example.ts`](../stories/button.example.ts) · [`packages/react/src/button.ts`](../packages/react/src/button.ts) · [`packages/vue/src/button.ts`](../packages/vue/src/button.ts) · [`packages/angular/src/button.ts`](../packages/angular/src/button.ts) · [`packages/svelte/src/Button.svelte`](../packages/svelte/src/Button.svelte) · [`packages/core/src/select-contracts.ts`](../packages/core/src/select-contracts.ts) · [`packages/core/src/components/select.ts`](../packages/core/src/components/select.ts) · [`packages/react/src/select.ts`](../packages/react/src/select.ts) · [`packages/vue/src/select.ts`](../packages/vue/src/select.ts) · [`packages/angular/src/select.ts`](../packages/angular/src/select.ts) · [`packages/svelte/src/Select.svelte`](../packages/svelte/src/Select.svelte) · [`stories/select.example.ts`](../stories/select.example.ts) · [`packages/core/src/checkbox-contracts.ts`](../packages/core/src/checkbox-contracts.ts) · [`packages/core/src/components/checkbox.ts`](../packages/core/src/components/checkbox.ts) · [`packages/core/src/components/implicit-submit.ts`](../packages/core/src/components/implicit-submit.ts) · [`packages/react/src/checkbox.ts`](../packages/react/src/checkbox.ts) · [`packages/vue/src/checkbox.ts`](../packages/vue/src/checkbox.ts) · [`packages/angular/src/checkbox.ts`](../packages/angular/src/checkbox.ts) · [`packages/svelte/src/Checkbox.svelte`](../packages/svelte/src/Checkbox.svelte) · [`stories/checkbox.example.ts`](../stories/checkbox.example.ts) · [`stories/catalog-completion.ts`](../stories/catalog-completion.ts) · [`stories/navigation-icons.ts`](../stories/navigation-icons.ts) · [`packages/core/src/navigation-scroll.ts`](../packages/core/src/navigation-scroll.ts) · [`packages/core/src/components/navigation-overflow.ts`](../packages/core/src/components/navigation-overflow.ts) · [`packages/vue/src/native-host-attributes.ts`](../packages/vue/src/native-host-attributes.ts) · [`packages/core/src/components/dialog.ts`](../packages/core/src/components/dialog.ts) · [`packages/core/src/dialog-contracts.ts`](../packages/core/src/dialog-contracts.ts) · [`packages/core/src/components/card.ts`](../packages/core/src/components/card.ts) · [`packages/core/src/card-contracts.ts`](../packages/core/src/card-contracts.ts) · [`packages/react/src/dialog.ts`](../packages/react/src/dialog.ts) · [`packages/react/src/card.ts`](../packages/react/src/card.ts) · [`packages/vue/src/dialog.ts`](../packages/vue/src/dialog.ts) · [`packages/vue/src/card.ts`](../packages/vue/src/card.ts) · [`packages/angular/src/dialog.ts`](../packages/angular/src/dialog.ts) · [`packages/angular/src/card.ts`](../packages/angular/src/card.ts) · [`packages/svelte/src/Dialog.svelte`](../packages/svelte/src/Dialog.svelte) · [`packages/svelte/src/Card.svelte`](../packages/svelte/src/Card.svelte) · [`stories/dialog.example.ts`](../stories/dialog.example.ts) · [`stories/card.example.ts`](../stories/card.example.ts) · [`tooling/raster-archive.mjs`](../tooling/raster-archive.mjs) · [`packages/core/src/layout-contracts.ts`](../packages/core/src/layout-contracts.ts) · [`packages/core/src/components/layout.ts`](../packages/core/src/components/layout.ts) · [`packages/react/src/layout.ts`](../packages/react/src/layout.ts) · [`packages/vue/src/layout.ts`](../packages/vue/src/layout.ts) · [`packages/angular/src/layout.ts`](../packages/angular/src/layout.ts) · [`packages/svelte/src/Row.svelte`](../packages/svelte/src/Row.svelte) · [`packages/svelte/src/Grid.svelte`](../packages/svelte/src/Grid.svelte) · [`stories/row.example.ts`](../stories/row.example.ts) · [`stories/grid.example.ts`](../stories/grid.example.ts) · [`packages/angular/src/feedback.ts`](../packages/angular/src/feedback.ts) · [`packages/core/src/components/feedback.ts`](../packages/core/src/components/feedback.ts) · [`packages/core/src/feedback-contracts.ts`](../packages/core/src/feedback-contracts.ts) · [`packages/react/src/feedback.ts`](../packages/react/src/feedback.ts) · [`packages/svelte/src/Feedback.svelte`](../packages/svelte/src/Feedback.svelte) · [`packages/vue/src/feedback.ts`](../packages/vue/src/feedback.ts) · [`stories/feedback.example.ts`](../stories/feedback.example.ts) · [`tooling/compatibility.mjs`](../tooling/compatibility.mjs) · [`tooling/packaging.mjs`](../tooling/packaging.mjs) · [`tooling/npm-prerelease.mjs`](../tooling/npm-prerelease.mjs) @@ -32,4 +32,6 @@ debt or convert unknown historic intent into a design decision. behavior or an architecture boundary changes. 3. Use repository-relative paths in `catalog.json`; each path is validated and every top-level product SDD must have exactly one capability owner. -4. Run `pnpm run validate:specifications` in local and CI validation. +4. Validate specification structure, catalog ownership/evidence, and this generated + view with tooling verified for the selected repository. Command declarations + and structural validation are not proof that product tests have executed. diff --git a/specs/catalog.json b/specs/catalog.json index 90bdef0..b4fe221 100644 --- a/specs/catalog.json +++ b/specs/catalog.json @@ -10,7 +10,8 @@ "lastVerified": "2026-11-05", "specs": [ "specs/shared-ui-foundation.md", - "specs/shared-ui-framework-delivery.md" + "specs/shared-ui-framework-delivery.md", + "specs/numeric-text-field.md" ], "workflows": [ ".github/workflows/copilot_issue.yml", diff --git a/specs/numeric-text-field.md b/specs/numeric-text-field.md new file mode 100644 index 0000000..e9e1460 --- /dev/null +++ b/specs/numeric-text-field.md @@ -0,0 +1,163 @@ +# Numeric keyboard hints for the controlled text field + +- Status: Draft +- Owners: vypdev maintainers and shared UI consumers +- Scope: The optional numeric hint in the shared text-field state +- Open decisions blocking readiness: none + +## 1. Executive summary + +An application opts into a numeric keyboard hint for an integer identifier. +The existing shared text input retains exact controlled strings. All framework +adapters consume the same validated state and renderer. + +## 2. Problem, current behavior, and evidence + +The current public field state admits the optional decimal hint. Its contract +validator and tests reject numeric. Domus #91 enters GTIN strings with leading +zeroes and needs the numeric hint through the released component API. + +## 3. Actors, surfaces, and terminology + +An application supplies field state and accepts controlled value requests. +The member edits the rendered text field with keyboard or touch. Numeric and +decimal are native input-mode hints. Application code owns domain parsing, +normalization and validation. + +## 4. Goals, non-goals, and fixed invariants + +| Requirement | Behavior | +|---|---| +| numeric-field-R01 | Accept optional inputMode numeric through the validated public field state, alongside decimal and omission. Reject other unsupported values through the existing field error contract. | +| numeric-field-R02 | Apply the chosen native hint to the text input and preserve exact strings, leading zeroes, controlled requests, form values, focus, selection, reset and existing validation and disabled/readonly semantics. | +| numeric-field-R03 | Verify the shared behavior through direct and framework consumers, packed packages and SSR, and document it with an accessible catalog example for the Domus integer-identifier use case. | + +The renderer uses the existing native text-input type. Applications select the +mode and supply their own label, help and validation. The new hint adds one +admitted state value to the established contract. + +## 5. Current versus proposed product journey + +The application creates field state with the numeric mode and an accessible +barcode-number label. The member enters a string such as 00036000291452. +The application receives that exact string and applies its barcode rules. +Switching the hint preserves the field's current controlled value and focus. + +## 6. Functional behavior and state model + +Extend the optional typed inputMode union to decimal and numeric. The shared +validator accepts those values and omits an absent hint. The renderer reflects +the selected value on its native text input. Controlled value and validity +ownership follow the existing field contract. + +## 7. User-facing configuration + +Applications select the hint through TextFieldState. Existing labels, help, +validation messages, name, defaultValue, readOnly and disabled configuration +continue through their established entry points. + +## 8. Clean Architecture design + +The framework-neutral core contract validates field state. One DOM component +renders it. React, Vue, Angular and Svelte adapters forward state and controlled +value requests. Domain-specific GTIN parsing belongs to Domus. + +## 9. Data, persistence, and wire contracts + +The public state type admits the numeric literal. The input remains text. +Controlled request payloads and form entries use exact strings. The shared +component keeps its existing form ownership, reset and restoration contracts. + +## 10. Errors, retries, and partial failure + +Unsupported state values raise the established FieldInputError. Invalid state +assignment preserves the prior accepted configuration atomically. Existing +canceled edits and deferred acknowledgments retain their controlled behavior. + +## 11. Security and privacy + +Labels and help remain inert bounded presentation text. Values use the existing +single-line value validator. The public input-mode hint retains the field's +existing validation and form-association boundaries. + +## 12. Observability and operational UX + +The catalog exposes a labeled numeric-identifier example and its exact string +value. Required/help/error associations and keyboard focus use the existing +component behavior. Verify English and Spanish narrow interaction. + +## 13. Compatibility, migration, rollout, and rollback + +The additive state value keeps decimal and omitted-mode consumers usable. +Verify all five package coordinates as one compatible prerelease cohort through +the documented publication flow. Qualify the published component in Domus #91. + +## 14. Testing strategy and numeric budget + +Minimum five distinct cases. + +| Area | Minimum distinct cases | Behaviors/risks covered | +|---|---:|---| +| Typed contract | 1 | Observable scenarios in the case inventory. | +| Browser form behavior | 1 | Observable scenarios in the case inventory. | +| Framework behavior | 1 | Observable scenarios in the case inventory. | +| Packed and server consumers | 1 | Observable scenarios in the case inventory. | +| Catalog and accessibility | 1 | Observable scenarios in the case inventory. | +| Total | 5 | Distinct inventory cases; repeated executions do not add cases. | + +| Case ID | Area | Requirements | Scenario | +|---|---|---|---| +| numeric-field-C01 | Typed contract | numeric-field-R01 | Accept numeric, decimal and omitted modes. Reject unsupported literals and malformed values with the existing error. Verify the public type through normal consumers. | +| numeric-field-C02 | Browser form behavior | numeric-field-R01, numeric-field-R02 | Edit an exact leading-zero identifier, verify the native numeric hint and text type, and change hints while preserving controlled value, selection, focus and successful form data. Exercise reset and existing validation/disabled/readonly behavior. | +| numeric-field-C03 | Framework behavior | numeric-field-R02, numeric-field-R03 | Use the shared numeric state in direct DOM/Lit, React, Vue, Angular and Svelte entry points. Accept controlled requests and preserve the exact leading-zero string and form entry. | +| numeric-field-C04 | Packed and server consumers | numeric-field-R01, numeric-field-R02, numeric-field-R03 | Install the verified packed cohort and compile/render the normal consumers with numeric state. Verify exact strings and server imports through the established package and SSR harnesses. | +| numeric-field-C05 | Catalog and accessibility | numeric-field-R02, numeric-field-R03 | Exercise the labeled numeric example with English keyboard and narrow Spanish touch. Verify help, focus, exact entered text and the reflected hint in the rebuilt catalog. | + +## 15. Documentation and discoverability + +[specs/numeric-text-field.md](numeric-text-field.md) · [packages/core/src/field-contracts.ts](../packages/core/src/field-contracts.ts) · [tests/contracts/field.test.ts](../tests/contracts/field.test.ts) · [tests/browser/field.test.ts](../tests/browser/field.test.ts) · [tests/consumers/fields.ts](../tests/consumers/fields.ts) · [tests/consumers/packed.test.ts](../tests/consumers/packed.test.ts) · [stories/field.example.ts](../stories/field.example.ts) · [stories/field.stories.ts](../stories/field.stories.ts) · [docs/field-contract.md](../docs/field-contract.md) + +| Path | Change | +|---|---| +| specs/numeric-text-field.md | create | +| packages/core/src/field-contracts.ts | update | +| tests/contracts/field.test.ts | update | +| tests/browser/field.test.ts | update | +| tests/consumers/fields.ts | update | +| tests/consumers/packed.test.ts | update | +| stories/field.example.ts | update | +| stories/field.stories.ts | update | +| docs/field-contract.md | update | + +## 16. Acceptance scenarios + +Exercise the five case definitions through their normal entry points. Enter a +leading-zero identifier and observe its exact controlled value and form data. +Use the packaged component with the same state through each supported adapter. + +## 17. Requirements traceability + +| Requirement | Cases | +|---|---| +| numeric-field-R01 | numeric-field-C01, numeric-field-C02, numeric-field-C04 | +| numeric-field-R02 | numeric-field-C02, numeric-field-C03, numeric-field-C04, numeric-field-C05 | +| numeric-field-R03 | numeric-field-C03, numeric-field-C04, numeric-field-C05 | + +## 18. Implementation sequence + +Extend the public core union and validation. Add the focused contract and browser +regressions, verify normal and packed framework consumers, then update the +catalog and documentation. Follow the documented prerelease flow for adoption. + +## 19. Definition of Done + +Verify all five cases and the repository's required coverage, typing, browser, +package, SSR and catalog gates. Merge the reviewed head through the normal path +and verify destination CI and Branch Sync. Follow publication and Domus adoption +under the authorized cross-repository workflow. + +## 20. References and decisions + +The shared UI foundation and framework-delivery specifications retain their +owning definitions. The decimal field increment establishes controlled values +and the optional native hint. Domus #91 motivates the numeric addition. From d6cbc8e528d538ba06670721a9ebe61a8adfc41d Mon Sep 17 00:00:00 2001 From: Efra Espada Date: Thu, 19 Nov 2026 14:46:49 +0100 Subject: [PATCH 2/4] feat: support numeric keyboard hints in text fields --- docs/field-contract.md | 7 ++++ packages/angular/package.json | 4 +- packages/core/package.json | 2 +- packages/core/src/field-contracts.ts | 4 +- packages/react/package.json | 2 +- packages/svelte/package.json | 2 +- packages/vue/package.json | 2 +- pnpm-lock.yaml | 2 +- stories/field.example.ts | 27 ++++++++++++- stories/field.stories.ts | 31 +++++++++++++++ tests/architecture.test.mjs | 2 +- tests/browser/field.test.ts | 38 +++++++++++++++++++ tests/consumers/fields.ts | 10 ++--- tests/consumers/fixtures/angular/model.ts | 2 +- tests/consumers/fixtures/angular/package.json | 4 +- .../consumers/fixtures/angular/pnpm-lock.yaml | 28 +++++++------- .../fixtures/angular/pnpm-workspace.yaml | 2 +- tests/consumers/fixtures/react/model.ts | 2 +- tests/consumers/fixtures/react/package.json | 4 +- tests/consumers/fixtures/react/pnpm-lock.yaml | 28 +++++++------- .../fixtures/react/pnpm-workspace.yaml | 2 +- tests/consumers/fixtures/svelte/model.ts | 2 +- tests/consumers/fixtures/svelte/package.json | 4 +- .../consumers/fixtures/svelte/pnpm-lock.yaml | 28 +++++++------- .../fixtures/svelte/pnpm-workspace.yaml | 2 +- tests/consumers/fixtures/vue/model.ts | 2 +- tests/consumers/fixtures/vue/package.json | 4 +- tests/consumers/fixtures/vue/pnpm-lock.yaml | 28 +++++++------- .../fixtures/vue/pnpm-workspace.yaml | 2 +- tests/consumers/frameworks.ts | 4 +- tests/consumers/packed.test.ts | 15 ++++---- .../ssr/fixtures/next/app/client-tabs.jsx | 11 +++++- .../consumers/ssr/fixtures/next/package.json | 4 +- .../ssr/fixtures/next/pnpm-lock.yaml | 28 +++++++------- .../ssr/fixtures/next/pnpm-workspace.yaml | 2 +- .../nuxt/app/components/ClientTabs.client.vue | 9 ++++- .../consumers/ssr/fixtures/nuxt/package.json | 4 +- .../ssr/fixtures/nuxt/pnpm-lock.yaml | 28 +++++++------- .../ssr/fixtures/nuxt/pnpm-workspace.yaml | 2 +- .../ssr/fixtures/sveltekit/package.json | 4 +- .../ssr/fixtures/sveltekit/pnpm-lock.yaml | 28 +++++++------- .../fixtures/sveltekit/pnpm-workspace.yaml | 2 +- .../sveltekit/src/routes/ClientTabs.svelte | 9 ++++- tests/consumers/ssr/journey.mjs | 10 ++++- tests/contracts/field.test.ts | 5 ++- tests/delivery.test.mjs | 4 +- tests/storybook/form-lifecycle.ts | 29 ++++++++++++++ tests/storybook/static.test.ts | 2 +- 48 files changed, 316 insertions(+), 161 deletions(-) diff --git a/docs/field-contract.md b/docs/field-contract.md index 6ef87e9..0b23b7c 100644 --- a/docs/field-contract.md +++ b/docs/field-contract.md @@ -25,6 +25,13 @@ The shared renderer applies the native `inputmode` hint to its text input. The c value and submitted form entry preserve the original string, including its decimal separator. Applications parse and validate the amount. Omitting the state key keeps the default text keyboard. +Set `inputMode: 'numeric'` for an integer identifier such as a printed barcode number. +The field retains `type="text"`, exact strings and leading zeroes through controlled +requests, form submission, reset and hint changes. Applications own identifier +validation and canonicalization. The catalog includes English and Spanish numeric +examples. This behavior covers `numeric-field-C01` through `numeric-field-C05` in +[the numeric field specification](../specs/numeric-text-field.md). + The default input begins 16px after the painted control's left edge. A real click at (4,4) therefore tests the padding itself. The Chromium source test asserts that measured boundary before checking the exact control target. Scoped installed-core checks retain the native diff --git a/packages/angular/package.json b/packages/angular/package.json index d540c9e..827b79a 100644 --- a/packages/angular/package.json +++ b/packages/angular/package.json @@ -1,6 +1,6 @@ { "name": "@vypdev/ha-ui-angular", - "version": "0.1.0-next.2", + "version": "0.1.0-next.3", "description": "Angular bindings for the shared Home Assistant UI components", "type": "module", "license": "MIT", @@ -17,7 +17,7 @@ ], "sideEffects": false, "dependencies": { - "@vypdev/ha-ui": "0.1.0-next.2", + "@vypdev/ha-ui": "0.1.0-next.3", "tslib": "2.8.1" }, "peerDependencies": { diff --git a/packages/core/package.json b/packages/core/package.json index 3eb5ff3..b6fc64c 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -1,6 +1,6 @@ { "name": "@vypdev/ha-ui", - "version": "0.1.0-next.2", + "version": "0.1.0-next.3", "description": "Shared presentation contracts and components for Home Assistant applications", "type": "module", "license": "(MIT AND Apache-2.0 AND CC-BY-4.0)", diff --git a/packages/core/src/field-contracts.ts b/packages/core/src/field-contracts.ts index 4b8e6ef..603d5b6 100644 --- a/packages/core/src/field-contracts.ts +++ b/packages/core/src/field-contracts.ts @@ -1,7 +1,7 @@ import {presentationText} from './presentation-text.js'; export interface TextFieldState { readonly label:string; readonly description:string; readonly placeholder:string; - readonly inputMode?:'decimal'; + readonly inputMode?:'decimal'|'numeric'; readonly required:boolean; readonly readOnly:boolean; readonly minLength:number; readonly maxLength:number; readonly error:string; readonly requiredMessage:string; readonly tooShortMessage:string; readonly tooLongMessage:string; } @@ -30,7 +30,7 @@ export function textFieldState(raw:unknown):TextFieldState { const minLength=length(source.minLength,0),maxLength=length(source.maxLength,16384); if(minLength>maxLength)invalid(); const inputMode=source.inputMode; - if(inputMode!==undefined&&inputMode!=='decimal')invalid(); + if(inputMode!==undefined&&inputMode!=='decimal'&&inputMode!=='numeric')invalid(); return Object.freeze({ label:text('label',256,false,''), description:text('description',512,true,''), diff --git a/packages/react/package.json b/packages/react/package.json index 112e865..c626054 100644 --- a/packages/react/package.json +++ b/packages/react/package.json @@ -1,6 +1,6 @@ { "name": "@vypdev/ha-ui-react", - "version": "0.1.0-next.2", + "version": "0.1.0-next.3", "description": "React bindings for the shared Home Assistant UI components", "type": "module", "license": "MIT", diff --git a/packages/svelte/package.json b/packages/svelte/package.json index 2c06abe..69c3f5e 100644 --- a/packages/svelte/package.json +++ b/packages/svelte/package.json @@ -1,6 +1,6 @@ { "name": "@vypdev/ha-ui-svelte", - "version": "0.1.0-next.2", + "version": "0.1.0-next.3", "description": "Svelte bindings for the shared Home Assistant UI components", "type": "module", "license": "MIT", diff --git a/packages/vue/package.json b/packages/vue/package.json index c26efc5..6f8144e 100644 --- a/packages/vue/package.json +++ b/packages/vue/package.json @@ -1,6 +1,6 @@ { "name": "@vypdev/ha-ui-vue", - "version": "0.1.0-next.2", + "version": "0.1.0-next.3", "description": "Vue bindings for the shared Home Assistant UI components", "type": "module", "license": "MIT", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 5460f7b..9e6c93f 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -134,7 +134,7 @@ importers: packages/angular: dependencies: '@vypdev/ha-ui': - specifier: 0.1.0-next.2 + specifier: 0.1.0-next.3 version: link:../core tslib: specifier: 2.8.1 diff --git a/stories/field.example.ts b/stories/field.example.ts index 0648237..12b23d1 100644 --- a/stories/field.example.ts +++ b/stories/field.example.ts @@ -3,13 +3,36 @@ import type {Meta} from '@storybook/web-components-vite'; import {catalogExample} from './catalog-example.js'; import {buttonState} from '@vypdev/ha-ui/button-contracts'; import {textFieldState,textFieldValue,fieldValueDetail} from '@vypdev/ha-ui/field-contracts'; +import type {TextFieldState} from '@vypdev/ha-ui/field-contracts'; import type {FieldValueEvent} from '@vypdev/ha-ui/field'; import {catalogSettings,catalogCopy} from './catalog-state.js'; -export interface Args {value:string;defaultValue:string;disabled:boolean;readOnly:boolean;required:boolean;error:boolean;submitted:string|null;placeholder?:string;description?:string;} +export interface Args { + value: string; + defaultValue: string; + disabled: boolean; + readOnly: boolean; + required: boolean; + error: boolean; + submitted: string | null; + placeholder?: string; + description?: string; + label?: string; + requiredMessage?: string; + inputMode?: TextFieldState['inputMode']; +} export const renderExample:NonNullable['render']>=(controls,context)=>{ const copy=catalogCopy[catalogSettings(context.globals).locale]; return catalogExample(controls,(args,setArgs)=>{ - const state=textFieldState({label:copy.fieldLabel,description:args.description===undefined?copy.description:args.description,placeholder:args.placeholder===undefined?copy.placeholder:args.placeholder,required:args.required,readOnly:args.readOnly,error:args.error?copy.error:'',requiredMessage:copy.required}); + const state = textFieldState({ + label: args.label ?? copy.fieldLabel, + inputMode: args.inputMode, + description: args.description === undefined ? copy.description : args.description, + placeholder: args.placeholder === undefined ? copy.placeholder : args.placeholder, + required: args.required, + readOnly: args.readOnly, + error: args.error ? copy.error : '', + requiredMessage: args.requiredMessage ?? copy.required, + }); return html`
{event.preventDefault();const value=textFieldValue(new FormData(event.currentTarget as HTMLFormElement).get('task'));setArgs({...args,submitted:value});}}> {const detail=fieldValueDetail(event.detail);setArgs({...args,value:detail.value,error:false,submitted:null});}}> diff --git a/stories/field.stories.ts b/stories/field.stories.ts index 4b0e9fd..28dadfa 100644 --- a/stories/field.stories.ts +++ b/stories/field.stories.ts @@ -29,3 +29,34 @@ export const FocusedOptional:Story={args:{value:'',required:false,placeholder:'' export const Error:Story={args:{error:true}}; export const SpanishDarkNarrow:Story={globals:{locale:'es',theme:'dark',width:'narrow',motion:'reduced'}}; export const EnglishFallback:Story={globals:{locale:'fr'}}; + +export const NumericIdentifier: Story = { + args: { + value: '00036000291452', defaultValue: '00036000291452', inputMode: 'numeric', + label: 'Barcode number', description: 'Enter the digits printed below the barcode.', + placeholder: '00036000291452', requiredMessage: 'Enter a barcode number.', + }, + play: async ({canvasElement}) => { + const field = canvasElement.querySelector('vyp-ha-field')!; + await field.updateComplete; + const input = field.shadowRoot!.querySelector('input')!; + field.focus(); + await expect(input.type).toBe('text'); + await expect(input.inputMode).toBe('numeric'); + await expect(field.shadowRoot!.activeElement).toBe(input); + await expect(input.getAttribute('aria-describedby')).toBe('help'); + input.value = '00012345'; + input.dispatchEvent(new InputEvent('input', {bubbles: true, composed: true})); + await waitFor(() => expect(field.value).toBe('00012345')); + await expect(new FormData(canvasElement.querySelector('form')!).get('task')).toBe('00012345'); + }, +}; +export const SpanishNumericIdentifier: Story = { + ...NumericIdentifier, + args: { + ...NumericIdentifier.args, label: 'Número del código de barras', + description: 'Introduce los dígitos impresos bajo el código de barras.', + requiredMessage: 'Introduce un código de barras.', + }, + globals: {locale: 'es', theme: 'dark', width: 'narrow', motion: 'reduced'}, +}; diff --git a/tests/architecture.test.mjs b/tests/architecture.test.mjs index 046db02..acc0ce1 100644 --- a/tests/architecture.test.mjs +++ b/tests/architecture.test.mjs @@ -128,7 +128,7 @@ test('adapter manifests keep other frameworks out and retain the exact shared co for (const [framework,peer] of Object.entries(adapterFrameworks)) { const manifest=JSON.parse(readFileSync('packages/'+framework+'/package.json','utf8')); expect(Object.keys(manifest.peerDependencies)).toEqual(framework==='angular'?[peer,'@angular/forms']:[peer]); - expect(manifest.dependencies['@vypdev/ha-ui']).toBe(framework==='angular'?'0.1.0-next.2':'workspace:*'); + expect(manifest.dependencies['@vypdev/ha-ui']).toBe(framework==='angular'?'0.1.0-next.3':'workspace:*'); expect(Object.keys(manifest.dependencies).sort()).toEqual(framework==='angular'?['@vypdev/ha-ui','tslib']:['@vypdev/ha-ui']); expect(manifest.version).toBe(JSON.parse(readFileSync('packages/core/package.json','utf8')).version); } diff --git a/tests/browser/field.test.ts b/tests/browser/field.test.ts index 6d6fd7d..1e81ad2 100644 --- a/tests/browser/field.test.ts +++ b/tests/browser/field.test.ts @@ -56,6 +56,44 @@ test('updates the native decimal hint without changing focused controlled text o expect(field.shadowRoot!.activeElement).toBe(control); expect(control.value).toBe('2,25');expect(entries(form)).toEqual([['task','2,25']]); }); +test('numeric identifiers retain zeroes, form data and selection across hint updates', async () => { + const {field, form} = await mount({inputMode: 'numeric', required: true, maxLength: 14}); + const control = input(field); + const identifier = '00036000291452'; + field.defaultValue = '00012345'; + accept(field); + field.focus(); + control.select(); + await userEvent.keyboard(identifier); + expect(control.type).toBe('text'); + expect(control.inputMode).toBe('numeric'); + expect(field.value).toBe(identifier); + expect(entries(form)).toEqual([['task', identifier]]); + control.setSelectionRange(2, 6, 'backward'); + for (const inputMode of ['decimal', undefined, 'numeric'] as const) { + field.state = model({inputMode, required: true, maxLength: 14}); + await field.updateComplete; + expect(control.getAttribute('inputmode')).toBe(inputMode ?? null); + expect(field.shadowRoot!.activeElement).toBe(control); + expect([control.selectionStart, control.selectionEnd, control.selectionDirection]).toEqual([2, 6, 'backward']); + expect(entries(form)).toEqual([['task', identifier]]); + } + const previous = field.state; + expect(() => {field.state = model({inputMode: 'tel'});}).toThrow(FieldInputError); + expect(field.state).toBe(previous); + field.readOnly = true; + await field.updateComplete; + expect(control.readOnly).toBe(true); + expect(entries(form)).toEqual([['task', identifier]]); + field.disabled = true; + expect(entries(form)).toEqual([]); + field.disabled = false; + field.readOnly = false; + form.reset(); + expect(field.value).toBe('00012345'); + field.value = ''; + expect(field.validity.valueMissing).toBe(true); +}); test('keeps accepted values controlled, requests once through shadow boundaries and supports cancellation',async()=>{ const {field,form}=await mount();field.value='Accepted';await field.updateComplete; const received:FieldValueEvent[]=[];form.addEventListener('ha-value-request',event=>{received.push(event);event.preventDefault();}); diff --git a/tests/consumers/fields.ts b/tests/consumers/fields.ts index b74c05c..acb3dd4 100644 --- a/tests/consumers/fields.ts +++ b/tests/consumers/fields.ts @@ -7,18 +7,18 @@ export async function exerciseField(page:Page){ const textbox=page.getByRole('textbox',{name:'Task name',exact:true}),model=page.getByLabel('Field model'),events=page.getByLabel('Field events'); const form=page.getByRole('form',{name:'Task form'}); assert.equal(await textbox.inputValue(),'Kitchen');assert.equal(await model.textContent(),'Kitchen'); - assert.equal(await textbox.getAttribute('inputmode'),'decimal'); + assert.equal(await textbox.getAttribute('inputmode'),'numeric'); assert.equal(await page.locator('vyp-ha-field').getAttribute('state'),null); const geometry=await page.locator('vyp-ha-field').evaluate(host=>{const control=host.shadowRoot!.querySelector('[part=control]')!,input=host.shadowRoot!.querySelector('input')!,label=host.shadowRoot!.querySelector('label')!,box=control.getBoundingClientRect();return{x:box.x,y:box.y,paintedHeight:box.height,nativeHeight:input.getBoundingClientRect().height,labelSize:getComputedStyle(label).fontSize,blockers:host.querySelectorAll('input[slot=native-blocker]').length};}); assert.equal(geometry.paintedHeight,56);assert.equal(geometry.nativeHeight,56);assert.equal(geometry.labelSize,'10px');assert.equal(geometry.blockers,1); await page.mouse.click(geometry.x+4,geometry.y+4);assert.equal(await textbox.evaluate(element=>element===(element.getRootNode() as ShadowRoot).activeElement),true);assert.equal(await events.textContent(),'0'); - await textbox.fill('2,25');await page.waitForFunction(()=>document.querySelector('output[aria-label="Field model"]')!.textContent==='2,25'); + await textbox.fill('00036000291452');await page.waitForFunction(()=>document.querySelector('output[aria-label="Field model"]')!.textContent==='00036000291452'); assert.equal(await events.textContent(),'1');await textbox.press('Enter'); await page.waitForFunction(()=>document.querySelector('output[aria-label="Saved task"]')!.textContent!==''); - assert.deepEqual(JSON.parse((await page.getByLabel('Saved task').textContent())!),[['task','2,25'],['action','save']]); + assert.deepEqual(JSON.parse((await page.getByLabel('Saved task').textContent())!),[['task','00036000291452'],['action','save']]); await page.getByRole('button',{name:'Reject field changes',exact:true}).click();await textbox.fill('Rejected'); await page.waitForFunction(()=>document.querySelector('output[aria-label="Field events"]')!.textContent==='2'); - assert.equal(await textbox.inputValue(),'2,25');assert.equal(await model.textContent(),'2,25');assert.equal(await events.textContent(),'2'); + assert.equal(await textbox.inputValue(),'00036000291452');assert.equal(await model.textContent(),'00036000291452');assert.equal(await events.textContent(),'2'); await page.getByRole('button',{name:'Reject field changes',exact:true}).click();await page.getByRole('button',{name:'Set field value',exact:true}).click(); await textbox.waitFor({state:'visible'});await page.waitForFunction(()=>document.querySelector('vyp-ha-field')!.value==='Programmatic'); assert.equal(await events.textContent(),'2');assert.notEqual(await page.locator('vyp-ha-field').getAttribute('value'),'Programmatic'); @@ -37,7 +37,7 @@ export async function exerciseField(page:Page){ await page.waitForFunction(()=>document.querySelector('output[aria-label="Field model"]')!.textContent==='Remounted'); assert.equal(await events.textContent(),String(Number(before)+1)); await page.getByRole('button',{name:'Reset task',exact:true}).click();await page.waitForFunction(()=>document.querySelector('output[aria-label="Field model"]')!.textContent==='Kitchen'); - return {controlledModel:true,exactlyOnce:true,cancellation:true,programmaticWrite:true,nativeSubmitter:true,requiredValidation:true,disabledSubmission:true,frameworkReset:true,teardownAndRemount:true,materialGeometry:geometry,paintedGutterFocusWithoutModelIntent:true,decimalInputMode:true}; + return {controlledModel:true,exactlyOnce:true,cancellation:true,programmaticWrite:true,nativeSubmitter:true,requiredValidation:true,disabledSubmission:true,frameworkReset:true,teardownAndRemount:true,materialGeometry:geometry,paintedGutterFocusWithoutModelIntent:true,numericInputMode:true}; } export async function exerciseInstalledDecimalField(page: Page) { diff --git a/tests/consumers/fixtures/angular/model.ts b/tests/consumers/fixtures/angular/model.ts index ec563a8..43223e8 100644 --- a/tests/consumers/fixtures/angular/model.ts +++ b/tests/consumers/fixtures/angular/model.ts @@ -5,7 +5,7 @@ export function model(spanish=false,selected='overview',disabled=false):Navigati } import {textFieldState} from '@vypdev/ha-ui/field-contracts'; -export function fieldModel(spanish=false){return textFieldState({label:spanish?'Nombre de la tarea':'Task name',description:spanish?'Una tarea del hogar.':'A household task.',inputMode:'decimal',required:true,minLength:3,maxLength:24,requiredMessage:spanish?'Introduce un valor.':'Enter a value.'});} +export function fieldModel(spanish=false){return textFieldState({label:spanish?'Nombre de la tarea':'Task name',description:spanish?'Una tarea del hogar.':'A household task.',inputMode:'numeric',required:true,minLength:3,maxLength:24,requiredMessage:spanish?'Introduce un valor.':'Enter a value.'});} import {buttonState} from '@vypdev/ha-ui/button-contracts'; export const actionModel=(spanish:boolean,loading=false)=>buttonState({label:spanish?'Guardar tarea':'Save task',loading,loadingLabel:spanish?'Guardando…':'Saving…'}); diff --git a/tests/consumers/fixtures/angular/package.json b/tests/consumers/fixtures/angular/package.json index 84be7c7..99fa8e6 100644 --- a/tests/consumers/fixtures/angular/package.json +++ b/tests/consumers/fixtures/angular/package.json @@ -4,8 +4,8 @@ "type": "module", "packageManager": "pnpm@10.34.0", "dependencies": { - "@vypdev/ha-ui": "file:../pack-1/vypdev-ha-ui-0.1.0-next.2.tgz", - "@vypdev/ha-ui-angular": "file:../pack-1/vypdev-ha-ui-angular-0.1.0-next.2.tgz", + "@vypdev/ha-ui": "file:../pack-1/vypdev-ha-ui-0.1.0-next.3.tgz", + "@vypdev/ha-ui-angular": "file:../pack-1/vypdev-ha-ui-angular-0.1.0-next.3.tgz", "@angular/core": "22.2.4", "@angular/common": "22.2.4", "@angular/compiler": "22.2.4", diff --git a/tests/consumers/fixtures/angular/pnpm-lock.yaml b/tests/consumers/fixtures/angular/pnpm-lock.yaml index 313aeb0..9d45298 100644 --- a/tests/consumers/fixtures/angular/pnpm-lock.yaml +++ b/tests/consumers/fixtures/angular/pnpm-lock.yaml @@ -5,7 +5,7 @@ settings: excludeLinksFromLockfile: false overrides: - '@vypdev/ha-ui': file:../pack-1/vypdev-ha-ui-0.1.0-next.2.tgz + '@vypdev/ha-ui': file:../pack-1/vypdev-ha-ui-0.1.0-next.3.tgz importers: @@ -27,11 +27,11 @@ importers: specifier: 22.2.4 version: 22.2.4(@angular/common@22.2.4(@angular/core@22.2.4(@angular/compiler@22.2.4)(rxjs@7.8.2))(rxjs@7.8.2))(@angular/core@22.2.4(@angular/compiler@22.2.4)(rxjs@7.8.2)) '@vypdev/ha-ui': - specifier: file:../pack-1/vypdev-ha-ui-0.1.0-next.2.tgz - version: file:../pack-1/vypdev-ha-ui-0.1.0-next.2.tgz + specifier: file:../pack-1/vypdev-ha-ui-0.1.0-next.3.tgz + version: file:../pack-1/vypdev-ha-ui-0.1.0-next.3.tgz '@vypdev/ha-ui-angular': - specifier: file:../pack-1/vypdev-ha-ui-angular-0.1.0-next.2.tgz - version: file:../pack-1/vypdev-ha-ui-angular-0.1.0-next.2.tgz(@angular/core@22.2.4(@angular/compiler@22.2.4)(rxjs@7.8.2))(@angular/forms@22.2.4(@angular/common@22.2.4(@angular/core@22.2.4(@angular/compiler@22.2.4)(rxjs@7.8.2))(rxjs@7.8.2))(@angular/core@22.2.4(@angular/compiler@22.2.4)(rxjs@7.8.2))(@angular/platform-browser@22.2.4(@angular/common@22.2.4(@angular/core@22.2.4(@angular/compiler@22.2.4)(rxjs@7.8.2))(rxjs@7.8.2))(@angular/core@22.2.4(@angular/compiler@22.2.4)(rxjs@7.8.2)))(rxjs@7.8.2)) + specifier: file:../pack-1/vypdev-ha-ui-angular-0.1.0-next.3.tgz + version: file:../pack-1/vypdev-ha-ui-angular-0.1.0-next.3.tgz(@angular/core@22.2.4(@angular/compiler@22.2.4)(rxjs@7.8.2))(@angular/forms@22.2.4(@angular/common@22.2.4(@angular/core@22.2.4(@angular/compiler@22.2.4)(rxjs@7.8.2))(rxjs@7.8.2))(@angular/core@22.2.4(@angular/compiler@22.2.4)(rxjs@7.8.2))(@angular/platform-browser@22.2.4(@angular/common@22.2.4(@angular/core@22.2.4(@angular/compiler@22.2.4)(rxjs@7.8.2))(rxjs@7.8.2))(@angular/core@22.2.4(@angular/compiler@22.2.4)(rxjs@7.8.2)))(rxjs@7.8.2)) rxjs: specifier: 7.8.2 version: 7.8.2 @@ -101,16 +101,16 @@ packages: '@types/trusted-types@2.0.7': resolution: {integrity: sha512-ScaPdn1dQczgbl0QFTeTOmVHFULt394XJgOQNoyVhZ6r2vLnMLJfBPd53SB52T/3G36VI1/g2MZaX0cwDuXsfw==} - '@vypdev/ha-ui-angular@file:../pack-1/vypdev-ha-ui-angular-0.1.0-next.2.tgz': - resolution: {integrity: sha512-yGs4ylEBWbktOQy/PMbdSVX/iJ6yD/YmPcWiJpRkgk1xNFdaELx42EWMfJu3bsbHn1DHaZ8bbuIfyMUOunJakA==, tarball: file:../pack-1/vypdev-ha-ui-angular-0.1.0-next.2.tgz} - version: 0.1.0-next.2 + '@vypdev/ha-ui-angular@file:../pack-1/vypdev-ha-ui-angular-0.1.0-next.3.tgz': + resolution: {integrity: sha512-yGs4ylEBWbktOQy/PMbdSVX/iJ6yD/YmPcWiJpRkgk1xNFdaELx42EWMfJu3bsbHn1DHaZ8bbuIfyMUOunJakA==, tarball: file:../pack-1/vypdev-ha-ui-angular-0.1.0-next.3.tgz} + version: 0.1.0-next.3 peerDependencies: '@angular/core': 22.2.4 '@angular/forms': 22.2.4 - '@vypdev/ha-ui@file:../pack-1/vypdev-ha-ui-0.1.0-next.2.tgz': - resolution: {integrity: sha512-eQ0pPhKQBB9PEJkyeOMiRnWl6o3X6QdxH/mop65f0RSFtuQQX7OQLGMtsupDUziFzcqhigZUKDDV85berl8Cig==, tarball: file:../pack-1/vypdev-ha-ui-0.1.0-next.2.tgz} - version: 0.1.0-next.2 + '@vypdev/ha-ui@file:../pack-1/vypdev-ha-ui-0.1.0-next.3.tgz': + resolution: {integrity: sha512-eQ0pPhKQBB9PEJkyeOMiRnWl6o3X6QdxH/mop65f0RSFtuQQX7OQLGMtsupDUziFzcqhigZUKDDV85berl8Cig==, tarball: file:../pack-1/vypdev-ha-ui-0.1.0-next.3.tgz} + version: 0.1.0-next.3 lit-element@4.2.2: resolution: {integrity: sha512-aFKhNToWxoyhkNDmWZwEva2SlQia+jfG0fjIWV//YeTaWrVnOxD89dPKfigCUspXFmjzOEUQpOkejH5Ly6sG0w==} @@ -180,14 +180,14 @@ snapshots: '@types/trusted-types@2.0.7': {} - '@vypdev/ha-ui-angular@file:../pack-1/vypdev-ha-ui-angular-0.1.0-next.2.tgz(@angular/core@22.2.4(@angular/compiler@22.2.4)(rxjs@7.8.2))(@angular/forms@22.2.4(@angular/common@22.2.4(@angular/core@22.2.4(@angular/compiler@22.2.4)(rxjs@7.8.2))(rxjs@7.8.2))(@angular/core@22.2.4(@angular/compiler@22.2.4)(rxjs@7.8.2))(@angular/platform-browser@22.2.4(@angular/common@22.2.4(@angular/core@22.2.4(@angular/compiler@22.2.4)(rxjs@7.8.2))(rxjs@7.8.2))(@angular/core@22.2.4(@angular/compiler@22.2.4)(rxjs@7.8.2)))(rxjs@7.8.2))': + '@vypdev/ha-ui-angular@file:../pack-1/vypdev-ha-ui-angular-0.1.0-next.3.tgz(@angular/core@22.2.4(@angular/compiler@22.2.4)(rxjs@7.8.2))(@angular/forms@22.2.4(@angular/common@22.2.4(@angular/core@22.2.4(@angular/compiler@22.2.4)(rxjs@7.8.2))(rxjs@7.8.2))(@angular/core@22.2.4(@angular/compiler@22.2.4)(rxjs@7.8.2))(@angular/platform-browser@22.2.4(@angular/common@22.2.4(@angular/core@22.2.4(@angular/compiler@22.2.4)(rxjs@7.8.2))(rxjs@7.8.2))(@angular/core@22.2.4(@angular/compiler@22.2.4)(rxjs@7.8.2)))(rxjs@7.8.2))': dependencies: '@angular/core': 22.2.4(@angular/compiler@22.2.4)(rxjs@7.8.2) '@angular/forms': 22.2.4(@angular/common@22.2.4(@angular/core@22.2.4(@angular/compiler@22.2.4)(rxjs@7.8.2))(rxjs@7.8.2))(@angular/core@22.2.4(@angular/compiler@22.2.4)(rxjs@7.8.2))(@angular/platform-browser@22.2.4(@angular/common@22.2.4(@angular/core@22.2.4(@angular/compiler@22.2.4)(rxjs@7.8.2))(rxjs@7.8.2))(@angular/core@22.2.4(@angular/compiler@22.2.4)(rxjs@7.8.2)))(rxjs@7.8.2) - '@vypdev/ha-ui': file:../pack-1/vypdev-ha-ui-0.1.0-next.2.tgz + '@vypdev/ha-ui': file:../pack-1/vypdev-ha-ui-0.1.0-next.3.tgz tslib: 2.8.1 - '@vypdev/ha-ui@file:../pack-1/vypdev-ha-ui-0.1.0-next.2.tgz': + '@vypdev/ha-ui@file:../pack-1/vypdev-ha-ui-0.1.0-next.3.tgz': dependencies: lit: 3.3.3 diff --git a/tests/consumers/fixtures/angular/pnpm-workspace.yaml b/tests/consumers/fixtures/angular/pnpm-workspace.yaml index 4364e36..455ae25 100644 --- a/tests/consumers/fixtures/angular/pnpm-workspace.yaml +++ b/tests/consumers/fixtures/angular/pnpm-workspace.yaml @@ -1,4 +1,4 @@ packages: [] autoInstallPeers: false overrides: - "@vypdev/ha-ui": file:../pack-1/vypdev-ha-ui-0.1.0-next.2.tgz + "@vypdev/ha-ui": file:../pack-1/vypdev-ha-ui-0.1.0-next.3.tgz diff --git a/tests/consumers/fixtures/react/model.ts b/tests/consumers/fixtures/react/model.ts index ec563a8..43223e8 100644 --- a/tests/consumers/fixtures/react/model.ts +++ b/tests/consumers/fixtures/react/model.ts @@ -5,7 +5,7 @@ export function model(spanish=false,selected='overview',disabled=false):Navigati } import {textFieldState} from '@vypdev/ha-ui/field-contracts'; -export function fieldModel(spanish=false){return textFieldState({label:spanish?'Nombre de la tarea':'Task name',description:spanish?'Una tarea del hogar.':'A household task.',inputMode:'decimal',required:true,minLength:3,maxLength:24,requiredMessage:spanish?'Introduce un valor.':'Enter a value.'});} +export function fieldModel(spanish=false){return textFieldState({label:spanish?'Nombre de la tarea':'Task name',description:spanish?'Una tarea del hogar.':'A household task.',inputMode:'numeric',required:true,minLength:3,maxLength:24,requiredMessage:spanish?'Introduce un valor.':'Enter a value.'});} import {buttonState} from '@vypdev/ha-ui/button-contracts'; export const actionModel=(spanish:boolean,loading=false)=>buttonState({label:spanish?'Guardar tarea':'Save task',loading,loadingLabel:spanish?'Guardando…':'Saving…'}); diff --git a/tests/consumers/fixtures/react/package.json b/tests/consumers/fixtures/react/package.json index 4b43abe..886abb3 100644 --- a/tests/consumers/fixtures/react/package.json +++ b/tests/consumers/fixtures/react/package.json @@ -4,8 +4,8 @@ "type": "module", "packageManager": "pnpm@10.34.0", "dependencies": { - "@vypdev/ha-ui": "file:../pack-1/vypdev-ha-ui-0.1.0-next.2.tgz", - "@vypdev/ha-ui-react": "file:../pack-1/vypdev-ha-ui-react-0.1.0-next.2.tgz", + "@vypdev/ha-ui": "file:../pack-1/vypdev-ha-ui-0.1.0-next.3.tgz", + "@vypdev/ha-ui-react": "file:../pack-1/vypdev-ha-ui-react-0.1.0-next.3.tgz", "react": "19.3.1", "react-dom": "19.3.1" }, diff --git a/tests/consumers/fixtures/react/pnpm-lock.yaml b/tests/consumers/fixtures/react/pnpm-lock.yaml index 0bb21f7..1fcf445 100644 --- a/tests/consumers/fixtures/react/pnpm-lock.yaml +++ b/tests/consumers/fixtures/react/pnpm-lock.yaml @@ -5,18 +5,18 @@ settings: excludeLinksFromLockfile: false overrides: - '@vypdev/ha-ui': file:../pack-1/vypdev-ha-ui-0.1.0-next.2.tgz + '@vypdev/ha-ui': file:../pack-1/vypdev-ha-ui-0.1.0-next.3.tgz importers: .: dependencies: '@vypdev/ha-ui': - specifier: file:../pack-1/vypdev-ha-ui-0.1.0-next.2.tgz - version: file:../pack-1/vypdev-ha-ui-0.1.0-next.2.tgz + specifier: file:../pack-1/vypdev-ha-ui-0.1.0-next.3.tgz + version: file:../pack-1/vypdev-ha-ui-0.1.0-next.3.tgz '@vypdev/ha-ui-react': - specifier: file:../pack-1/vypdev-ha-ui-react-0.1.0-next.2.tgz - version: file:../pack-1/vypdev-ha-ui-react-0.1.0-next.2.tgz(react@19.3.1) + specifier: file:../pack-1/vypdev-ha-ui-react-0.1.0-next.3.tgz + version: file:../pack-1/vypdev-ha-ui-react-0.1.0-next.3.tgz(react@19.3.1) react: specifier: 19.3.1 version: 19.3.1 @@ -53,15 +53,15 @@ packages: '@types/trusted-types@2.0.7': resolution: {integrity: sha512-ScaPdn1dQczgbl0QFTeTOmVHFULt394XJgOQNoyVhZ6r2vLnMLJfBPd53SB52T/3G36VI1/g2MZaX0cwDuXsfw==} - '@vypdev/ha-ui-react@file:../pack-1/vypdev-ha-ui-react-0.1.0-next.2.tgz': - resolution: {integrity: sha512-9L1HO9Lr5jlc7dowSlmU78DdLL90lIoi5pm/UNiadLeg+O5ci8WED/hTWClEiKL3wxfTbHm5mqGVpFxv6xIi5g==, tarball: file:../pack-1/vypdev-ha-ui-react-0.1.0-next.2.tgz} - version: 0.1.0-next.2 + '@vypdev/ha-ui-react@file:../pack-1/vypdev-ha-ui-react-0.1.0-next.3.tgz': + resolution: {integrity: sha512-9L1HO9Lr5jlc7dowSlmU78DdLL90lIoi5pm/UNiadLeg+O5ci8WED/hTWClEiKL3wxfTbHm5mqGVpFxv6xIi5g==, tarball: file:../pack-1/vypdev-ha-ui-react-0.1.0-next.3.tgz} + version: 0.1.0-next.3 peerDependencies: react: 19.3.1 - '@vypdev/ha-ui@file:../pack-1/vypdev-ha-ui-0.1.0-next.2.tgz': - resolution: {integrity: sha512-eQ0pPhKQBB9PEJkyeOMiRnWl6o3X6QdxH/mop65f0RSFtuQQX7OQLGMtsupDUziFzcqhigZUKDDV85berl8Cig==, tarball: file:../pack-1/vypdev-ha-ui-0.1.0-next.2.tgz} - version: 0.1.0-next.2 + '@vypdev/ha-ui@file:../pack-1/vypdev-ha-ui-0.1.0-next.3.tgz': + resolution: {integrity: sha512-eQ0pPhKQBB9PEJkyeOMiRnWl6o3X6QdxH/mop65f0RSFtuQQX7OQLGMtsupDUziFzcqhigZUKDDV85berl8Cig==, tarball: file:../pack-1/vypdev-ha-ui-0.1.0-next.3.tgz} + version: 0.1.0-next.3 csstype@3.2.3: resolution: {integrity: sha512-z1HGKcYy2xA8AGQfwrn0PAy+PB7X/GSj3UVJW9qKyn43xWa+gl5nXmU4qqLMRzWVLFC8KusUX8T/0kCiOYpAIQ==} @@ -110,12 +110,12 @@ snapshots: '@types/trusted-types@2.0.7': {} - '@vypdev/ha-ui-react@file:../pack-1/vypdev-ha-ui-react-0.1.0-next.2.tgz(react@19.3.1)': + '@vypdev/ha-ui-react@file:../pack-1/vypdev-ha-ui-react-0.1.0-next.3.tgz(react@19.3.1)': dependencies: - '@vypdev/ha-ui': file:../pack-1/vypdev-ha-ui-0.1.0-next.2.tgz + '@vypdev/ha-ui': file:../pack-1/vypdev-ha-ui-0.1.0-next.3.tgz react: 19.3.1 - '@vypdev/ha-ui@file:../pack-1/vypdev-ha-ui-0.1.0-next.2.tgz': + '@vypdev/ha-ui@file:../pack-1/vypdev-ha-ui-0.1.0-next.3.tgz': dependencies: lit: 3.3.3 diff --git a/tests/consumers/fixtures/react/pnpm-workspace.yaml b/tests/consumers/fixtures/react/pnpm-workspace.yaml index 4364e36..455ae25 100644 --- a/tests/consumers/fixtures/react/pnpm-workspace.yaml +++ b/tests/consumers/fixtures/react/pnpm-workspace.yaml @@ -1,4 +1,4 @@ packages: [] autoInstallPeers: false overrides: - "@vypdev/ha-ui": file:../pack-1/vypdev-ha-ui-0.1.0-next.2.tgz + "@vypdev/ha-ui": file:../pack-1/vypdev-ha-ui-0.1.0-next.3.tgz diff --git a/tests/consumers/fixtures/svelte/model.ts b/tests/consumers/fixtures/svelte/model.ts index ec563a8..43223e8 100644 --- a/tests/consumers/fixtures/svelte/model.ts +++ b/tests/consumers/fixtures/svelte/model.ts @@ -5,7 +5,7 @@ export function model(spanish=false,selected='overview',disabled=false):Navigati } import {textFieldState} from '@vypdev/ha-ui/field-contracts'; -export function fieldModel(spanish=false){return textFieldState({label:spanish?'Nombre de la tarea':'Task name',description:spanish?'Una tarea del hogar.':'A household task.',inputMode:'decimal',required:true,minLength:3,maxLength:24,requiredMessage:spanish?'Introduce un valor.':'Enter a value.'});} +export function fieldModel(spanish=false){return textFieldState({label:spanish?'Nombre de la tarea':'Task name',description:spanish?'Una tarea del hogar.':'A household task.',inputMode:'numeric',required:true,minLength:3,maxLength:24,requiredMessage:spanish?'Introduce un valor.':'Enter a value.'});} import {buttonState} from '@vypdev/ha-ui/button-contracts'; export const actionModel=(spanish:boolean,loading=false)=>buttonState({label:spanish?'Guardar tarea':'Save task',loading,loadingLabel:spanish?'Guardando…':'Saving…'}); diff --git a/tests/consumers/fixtures/svelte/package.json b/tests/consumers/fixtures/svelte/package.json index ff9c768..be4fe2d 100644 --- a/tests/consumers/fixtures/svelte/package.json +++ b/tests/consumers/fixtures/svelte/package.json @@ -4,8 +4,8 @@ "type": "module", "packageManager": "pnpm@10.34.0", "dependencies": { - "@vypdev/ha-ui": "file:../pack-1/vypdev-ha-ui-0.1.0-next.2.tgz", - "@vypdev/ha-ui-svelte": "file:../pack-1/vypdev-ha-ui-svelte-0.1.0-next.2.tgz", + "@vypdev/ha-ui": "file:../pack-1/vypdev-ha-ui-0.1.0-next.3.tgz", + "@vypdev/ha-ui-svelte": "file:../pack-1/vypdev-ha-ui-svelte-0.1.0-next.3.tgz", "svelte": "5.57.3" }, "devDependencies": { diff --git a/tests/consumers/fixtures/svelte/pnpm-lock.yaml b/tests/consumers/fixtures/svelte/pnpm-lock.yaml index c0748ef..9b7a572 100644 --- a/tests/consumers/fixtures/svelte/pnpm-lock.yaml +++ b/tests/consumers/fixtures/svelte/pnpm-lock.yaml @@ -5,18 +5,18 @@ settings: excludeLinksFromLockfile: false overrides: - '@vypdev/ha-ui': file:../pack-1/vypdev-ha-ui-0.1.0-next.2.tgz + '@vypdev/ha-ui': file:../pack-1/vypdev-ha-ui-0.1.0-next.3.tgz importers: .: dependencies: '@vypdev/ha-ui': - specifier: file:../pack-1/vypdev-ha-ui-0.1.0-next.2.tgz - version: file:../pack-1/vypdev-ha-ui-0.1.0-next.2.tgz + specifier: file:../pack-1/vypdev-ha-ui-0.1.0-next.3.tgz + version: file:../pack-1/vypdev-ha-ui-0.1.0-next.3.tgz '@vypdev/ha-ui-svelte': - specifier: file:../pack-1/vypdev-ha-ui-svelte-0.1.0-next.2.tgz - version: file:../pack-1/vypdev-ha-ui-svelte-0.1.0-next.2.tgz(svelte@5.57.3) + specifier: file:../pack-1/vypdev-ha-ui-svelte-0.1.0-next.3.tgz + version: file:../pack-1/vypdev-ha-ui-svelte-0.1.0-next.3.tgz(svelte@5.57.3) svelte: specifier: 5.57.3 version: 5.57.3 @@ -60,15 +60,15 @@ packages: '@types/trusted-types@2.0.7': resolution: {integrity: sha512-ScaPdn1dQczgbl0QFTeTOmVHFULt394XJgOQNoyVhZ6r2vLnMLJfBPd53SB52T/3G36VI1/g2MZaX0cwDuXsfw==} - '@vypdev/ha-ui-svelte@file:../pack-1/vypdev-ha-ui-svelte-0.1.0-next.2.tgz': - resolution: {integrity: sha512-EKozyab8BCoCl9QsXiaXim5XlCJD9qkiIobcLCyFLKAi/Qr+Tr8Els1FhkYPTtGTHBYp9KPIdyKIWUH7SbWjlg==, tarball: file:../pack-1/vypdev-ha-ui-svelte-0.1.0-next.2.tgz} - version: 0.1.0-next.2 + '@vypdev/ha-ui-svelte@file:../pack-1/vypdev-ha-ui-svelte-0.1.0-next.3.tgz': + resolution: {integrity: sha512-EKozyab8BCoCl9QsXiaXim5XlCJD9qkiIobcLCyFLKAi/Qr+Tr8Els1FhkYPTtGTHBYp9KPIdyKIWUH7SbWjlg==, tarball: file:../pack-1/vypdev-ha-ui-svelte-0.1.0-next.3.tgz} + version: 0.1.0-next.3 peerDependencies: svelte: 5.57.3 - '@vypdev/ha-ui@file:../pack-1/vypdev-ha-ui-0.1.0-next.2.tgz': - resolution: {integrity: sha512-eQ0pPhKQBB9PEJkyeOMiRnWl6o3X6QdxH/mop65f0RSFtuQQX7OQLGMtsupDUziFzcqhigZUKDDV85berl8Cig==, tarball: file:../pack-1/vypdev-ha-ui-0.1.0-next.2.tgz} - version: 0.1.0-next.2 + '@vypdev/ha-ui@file:../pack-1/vypdev-ha-ui-0.1.0-next.3.tgz': + resolution: {integrity: sha512-eQ0pPhKQBB9PEJkyeOMiRnWl6o3X6QdxH/mop65f0RSFtuQQX7OQLGMtsupDUziFzcqhigZUKDDV85berl8Cig==, tarball: file:../pack-1/vypdev-ha-ui-0.1.0-next.3.tgz} + version: 0.1.0-next.3 acorn@8.19.0: resolution: {integrity: sha512-oJlA3XiRm7Cyk6qFD2Jn8ak9B7jSy0qy00ADO3+8dpT0LSjFihQYv4C02LFCSYJV3Q37xYwwRy5m+IpIiUzqWw==} @@ -166,12 +166,12 @@ snapshots: '@types/trusted-types@2.0.7': {} - '@vypdev/ha-ui-svelte@file:../pack-1/vypdev-ha-ui-svelte-0.1.0-next.2.tgz(svelte@5.57.3)': + '@vypdev/ha-ui-svelte@file:../pack-1/vypdev-ha-ui-svelte-0.1.0-next.3.tgz(svelte@5.57.3)': dependencies: - '@vypdev/ha-ui': file:../pack-1/vypdev-ha-ui-0.1.0-next.2.tgz + '@vypdev/ha-ui': file:../pack-1/vypdev-ha-ui-0.1.0-next.3.tgz svelte: 5.57.3 - '@vypdev/ha-ui@file:../pack-1/vypdev-ha-ui-0.1.0-next.2.tgz': + '@vypdev/ha-ui@file:../pack-1/vypdev-ha-ui-0.1.0-next.3.tgz': dependencies: lit: 3.3.3 diff --git a/tests/consumers/fixtures/svelte/pnpm-workspace.yaml b/tests/consumers/fixtures/svelte/pnpm-workspace.yaml index 4364e36..455ae25 100644 --- a/tests/consumers/fixtures/svelte/pnpm-workspace.yaml +++ b/tests/consumers/fixtures/svelte/pnpm-workspace.yaml @@ -1,4 +1,4 @@ packages: [] autoInstallPeers: false overrides: - "@vypdev/ha-ui": file:../pack-1/vypdev-ha-ui-0.1.0-next.2.tgz + "@vypdev/ha-ui": file:../pack-1/vypdev-ha-ui-0.1.0-next.3.tgz diff --git a/tests/consumers/fixtures/vue/model.ts b/tests/consumers/fixtures/vue/model.ts index ec563a8..43223e8 100644 --- a/tests/consumers/fixtures/vue/model.ts +++ b/tests/consumers/fixtures/vue/model.ts @@ -5,7 +5,7 @@ export function model(spanish=false,selected='overview',disabled=false):Navigati } import {textFieldState} from '@vypdev/ha-ui/field-contracts'; -export function fieldModel(spanish=false){return textFieldState({label:spanish?'Nombre de la tarea':'Task name',description:spanish?'Una tarea del hogar.':'A household task.',inputMode:'decimal',required:true,minLength:3,maxLength:24,requiredMessage:spanish?'Introduce un valor.':'Enter a value.'});} +export function fieldModel(spanish=false){return textFieldState({label:spanish?'Nombre de la tarea':'Task name',description:spanish?'Una tarea del hogar.':'A household task.',inputMode:'numeric',required:true,minLength:3,maxLength:24,requiredMessage:spanish?'Introduce un valor.':'Enter a value.'});} import {buttonState} from '@vypdev/ha-ui/button-contracts'; export const actionModel=(spanish:boolean,loading=false)=>buttonState({label:spanish?'Guardar tarea':'Save task',loading,loadingLabel:spanish?'Guardando…':'Saving…'}); diff --git a/tests/consumers/fixtures/vue/package.json b/tests/consumers/fixtures/vue/package.json index 37be23b..178b3e0 100644 --- a/tests/consumers/fixtures/vue/package.json +++ b/tests/consumers/fixtures/vue/package.json @@ -4,8 +4,8 @@ "type": "module", "packageManager": "pnpm@10.34.0", "dependencies": { - "@vypdev/ha-ui": "file:../pack-1/vypdev-ha-ui-0.1.0-next.2.tgz", - "@vypdev/ha-ui-vue": "file:../pack-1/vypdev-ha-ui-vue-0.1.0-next.2.tgz", + "@vypdev/ha-ui": "file:../pack-1/vypdev-ha-ui-0.1.0-next.3.tgz", + "@vypdev/ha-ui-vue": "file:../pack-1/vypdev-ha-ui-vue-0.1.0-next.3.tgz", "vue": "3.5.44" }, "devDependencies": { diff --git a/tests/consumers/fixtures/vue/pnpm-lock.yaml b/tests/consumers/fixtures/vue/pnpm-lock.yaml index c1158e0..f9818cd 100644 --- a/tests/consumers/fixtures/vue/pnpm-lock.yaml +++ b/tests/consumers/fixtures/vue/pnpm-lock.yaml @@ -5,18 +5,18 @@ settings: excludeLinksFromLockfile: false overrides: - '@vypdev/ha-ui': file:../pack-1/vypdev-ha-ui-0.1.0-next.2.tgz + '@vypdev/ha-ui': file:../pack-1/vypdev-ha-ui-0.1.0-next.3.tgz importers: .: dependencies: '@vypdev/ha-ui': - specifier: file:../pack-1/vypdev-ha-ui-0.1.0-next.2.tgz - version: file:../pack-1/vypdev-ha-ui-0.1.0-next.2.tgz + specifier: file:../pack-1/vypdev-ha-ui-0.1.0-next.3.tgz + version: file:../pack-1/vypdev-ha-ui-0.1.0-next.3.tgz '@vypdev/ha-ui-vue': - specifier: file:../pack-1/vypdev-ha-ui-vue-0.1.0-next.2.tgz - version: file:../pack-1/vypdev-ha-ui-vue-0.1.0-next.2.tgz(vue@3.5.44(typescript@6.0.3)) + specifier: file:../pack-1/vypdev-ha-ui-vue-0.1.0-next.3.tgz + version: file:../pack-1/vypdev-ha-ui-vue-0.1.0-next.3.tgz(vue@3.5.44(typescript@6.0.3)) vue: specifier: 3.5.44 version: 3.5.44(typescript@6.0.3) @@ -83,15 +83,15 @@ packages: '@vue/shared@3.5.44': resolution: {integrity: sha512-H82XLH0DjmSOdbEwO15x3QTo1f5PWEtv237eLpYKc0mqLu+B8hnq16lFWmuBmNurkeiG3wr+oM1FhOll/YVFRg==} - '@vypdev/ha-ui-vue@file:../pack-1/vypdev-ha-ui-vue-0.1.0-next.2.tgz': - resolution: {integrity: sha512-C1ccI0yUN24wsuANpVcSpVTpE+m+puWY0093paTYQUf9Fm+z+D489BL1xQRFBhNaAS6sdzBZF27HL5VLWKo10Q==, tarball: file:../pack-1/vypdev-ha-ui-vue-0.1.0-next.2.tgz} - version: 0.1.0-next.2 + '@vypdev/ha-ui-vue@file:../pack-1/vypdev-ha-ui-vue-0.1.0-next.3.tgz': + resolution: {integrity: sha512-C1ccI0yUN24wsuANpVcSpVTpE+m+puWY0093paTYQUf9Fm+z+D489BL1xQRFBhNaAS6sdzBZF27HL5VLWKo10Q==, tarball: file:../pack-1/vypdev-ha-ui-vue-0.1.0-next.3.tgz} + version: 0.1.0-next.3 peerDependencies: vue: 3.5.44 - '@vypdev/ha-ui@file:../pack-1/vypdev-ha-ui-0.1.0-next.2.tgz': - resolution: {integrity: sha512-eQ0pPhKQBB9PEJkyeOMiRnWl6o3X6QdxH/mop65f0RSFtuQQX7OQLGMtsupDUziFzcqhigZUKDDV85berl8Cig==, tarball: file:../pack-1/vypdev-ha-ui-0.1.0-next.2.tgz} - version: 0.1.0-next.2 + '@vypdev/ha-ui@file:../pack-1/vypdev-ha-ui-0.1.0-next.3.tgz': + resolution: {integrity: sha512-eQ0pPhKQBB9PEJkyeOMiRnWl6o3X6QdxH/mop65f0RSFtuQQX7OQLGMtsupDUziFzcqhigZUKDDV85berl8Cig==, tarball: file:../pack-1/vypdev-ha-ui-0.1.0-next.3.tgz} + version: 0.1.0-next.3 csstype@3.2.3: resolution: {integrity: sha512-z1HGKcYy2xA8AGQfwrn0PAy+PB7X/GSj3UVJW9qKyn43xWa+gl5nXmU4qqLMRzWVLFC8KusUX8T/0kCiOYpAIQ==} @@ -223,12 +223,12 @@ snapshots: '@vue/shared@3.5.44': {} - '@vypdev/ha-ui-vue@file:../pack-1/vypdev-ha-ui-vue-0.1.0-next.2.tgz(vue@3.5.44(typescript@6.0.3))': + '@vypdev/ha-ui-vue@file:../pack-1/vypdev-ha-ui-vue-0.1.0-next.3.tgz(vue@3.5.44(typescript@6.0.3))': dependencies: - '@vypdev/ha-ui': file:../pack-1/vypdev-ha-ui-0.1.0-next.2.tgz + '@vypdev/ha-ui': file:../pack-1/vypdev-ha-ui-0.1.0-next.3.tgz vue: 3.5.44(typescript@6.0.3) - '@vypdev/ha-ui@file:../pack-1/vypdev-ha-ui-0.1.0-next.2.tgz': + '@vypdev/ha-ui@file:../pack-1/vypdev-ha-ui-0.1.0-next.3.tgz': dependencies: lit: 3.3.3 diff --git a/tests/consumers/fixtures/vue/pnpm-workspace.yaml b/tests/consumers/fixtures/vue/pnpm-workspace.yaml index 4364e36..455ae25 100644 --- a/tests/consumers/fixtures/vue/pnpm-workspace.yaml +++ b/tests/consumers/fixtures/vue/pnpm-workspace.yaml @@ -1,4 +1,4 @@ packages: [] autoInstallPeers: false overrides: - "@vypdev/ha-ui": file:../pack-1/vypdev-ha-ui-0.1.0-next.2.tgz + "@vypdev/ha-ui": file:../pack-1/vypdev-ha-ui-0.1.0-next.3.tgz diff --git a/tests/consumers/frameworks.ts b/tests/consumers/frameworks.ts index 2c6b280..78c86dc 100644 --- a/tests/consumers/frameworks.ts +++ b/tests/consumers/frameworks.ts @@ -51,8 +51,8 @@ export async function exerciseFrameworks(root:string,scratch:string,browser:Brow assert.equal(await readFile(join(folder,'pnpm-lock.yaml'),'utf8'),frozen); const installedRoot=join(folder,'node_modules/@vypdev/ha-ui-'+framework); const published=JSON.parse(await readFile(join(installedRoot,'package.json'),'utf8')); - assert.equal(published.version,'0.1.0-next.2'); - assert.equal(published.dependencies['@vypdev/ha-ui'],'0.1.0-next.2'); + assert.equal(published.version,'0.1.0-next.3'); + assert.equal(published.dependencies['@vypdev/ha-ui'],'0.1.0-next.3'); assert.doesNotMatch(JSON.stringify(published),/workspace:|file:/u,'Published metadata cannot retain fixture or workspace references'); for (const source of globSync('packages/'+framework+'/src/**/*.{ts,svelte}',{cwd:root})) assert.deepEqual(await readFile(join(installedRoot,relative(join(root,'packages',framework),join(root,source)))),await readFile(join(root,source)),'Installed authored source must match '+source); diff --git a/tests/consumers/packed.test.ts b/tests/consumers/packed.test.ts index 0ebf67b..1a0e0cc 100644 --- a/tests/consumers/packed.test.ts +++ b/tests/consumers/packed.test.ts @@ -79,7 +79,7 @@ test('the actual packed package is reproducible and passes clean DOM-free and re const path=join(destination,name); await writeFile(path,canonicalPackageArchive(await readFile(path))); } - archives.push(join(destination, 'vypdev-ha-ui-0.1.0-next.2.tgz')); + archives.push(join(destination, 'vypdev-ha-ui-0.1.0-next.3.tgz')); if(index===2)for(const file of names)assert.deepEqual(await readFile(join(scratch,'pack-1',file)),await readFile(join(destination,file)),'Every cohort coordinate must reproduce: '+file); } const cohort=[]; @@ -88,7 +88,7 @@ test('the actual packed package is reproducible and passes clean DOM-free and re const bytes=await readFile(join(scratch,'pack-1',file)); const packedMetadata=await execute('tar',['-xOf',join(scratch,'pack-1',file),'package/package.json']); const manifest=JSON.parse(packedMetadata.stdout); - assert.equal(manifest.version,'0.1.0-next.2');assert.doesNotMatch(packedMetadata.stdout,/workspace:|file:/u); + assert.equal(manifest.version,'0.1.0-next.3');assert.doesNotMatch(packedMetadata.stdout,/workspace:|file:/u); cohort.push({coordinate:manifest.name,version:manifest.version,sha256:digest(bytes),bytes:bytes.byteLength}); artifacts.push({coordinate:manifest.name,version:manifest.version,bytes}); } @@ -147,7 +147,8 @@ if(checkboxChecked(false)||!checkboxValidity(false,checkboxState({label:'Notify' import {selectState,selectSelection,selectEntries,selectRestoreState,selectRestoreValue,type SelectSelection} from '@vypdev/ha-ui/select-contracts'; const choice:SelectSelection=selectSelection([1,'1',false]);const choices=selectState({label:'Category',multiple:true,options:[{value:1,label:'Number'},{value:'1',label:'Text'},{value:false,label:'Other'}]});if(selectEntries(choice,choices).length!==3||!Array.isArray(selectRestoreValue(selectRestoreState(choice))))throw Error('Expected typed pure select policy'); const action:ButtonType='submit';if(buttonState({label:'Save'}).loading||buttonPressDetail({type:action}).type!=='submit')throw Error('Expected pure button policy'); -const field=textFieldState({label:'Name',required:true}); +const field=textFieldState({label:'Name',required:true,inputMode:'numeric'}); +if(field.inputMode!=='numeric')throw Error('Expected numeric keyboard hint'); if(!textFieldValidity('',field).flags.valueMissing)throw Error('Expected pure field validation'); const request=fieldValueDetail({value:'Kitchen',reason:'input'});if(request.reason!=='input')throw Error('Expected typed request'); const kind: NavigationKind = 'panels'; @@ -206,7 +207,7 @@ element.addEventListener('ha-selection-request',event=>{event.preventDefault();e document.querySelector('main')!.append(element); registerField();registerButton();registerSelect();registerCheckbox();registerDialog();registerCard();registerGrid();registerRow();registerFeedback(); const form=document.createElement('form'),field=document.createElement('vyp-ha-field'); -field.state=textFieldState({label:'Task name',description:'A name for this task.',required:true,inputMode:'decimal'});field.name='task';field.defaultValue='Kitchen'; +field.state=textFieldState({label:'Task name',description:'A name for this task.',required:true,inputMode:'numeric'});field.name='task';field.defaultValue='Kitchen'; field.addEventListener('ha-value-request',event=>{if(!event.defaultPrevented)field.value=event.detail.value;}); const save=document.createElement('vyp-ha-button');save.type='submit';save.name='action';save.value='save';save.state=buttonState({label:'Save task'}); const reset=document.createElement('vyp-ha-button');reset.type='reset';reset.state=buttonState({label:'Reset task'});form.append(field,save,reset); @@ -242,13 +243,13 @@ document.querySelector('main')!.append(form);`); assert.equal(await browserPage.getByRole('button',{name:'Nueva tarea',exact:true}).isVisible(),true); await browserPage.locator('vyp-ha-tabs').screenshot({path:resolve(root,'test-results/packed-panels-dark-es.png')}); const textbox=browserPage.getByRole('textbox',{name:'Task name',exact:true}); - assert.equal(await textbox.getAttribute('inputmode'),'decimal'); + assert.equal(await textbox.getAttribute('inputmode'),'numeric'); assert.equal(await textbox.inputValue(),'Kitchen');await textbox.fill('');await browserPage.getByRole('button',{name:'Save task',exact:true}).click(); assert.equal(await textbox.getAttribute('aria-invalid'),'true');assert.equal(await browserPage.getByText('Enter a value.',{exact:true}).isVisible(),true); assert.equal(await browserPage.locator('form').getAttribute('data-submitted'),null); - await textbox.fill('2,25');await textbox.press('Enter'); + await textbox.fill('00036000291452');await textbox.press('Enter'); await browserPage.waitForFunction(()=>document.querySelector('form')!.dataset.submitted!==undefined); - assert.deepEqual(JSON.parse((await browserPage.locator('form').getAttribute('data-submitted'))!),[['task','2,25'],['action','save']]); + assert.deepEqual(JSON.parse((await browserPage.locator('form').getAttribute('data-submitted'))!),[['task','00036000291452'],['action','save']]); await browserPage.getByRole('button',{name:'Reset task',exact:true}).click();await browserPage.waitForFunction(()=>document.querySelector('vyp-ha-field')!.value==='Kitchen');assert.equal(await textbox.inputValue(),'Kitchen'); await browserPage.evaluate(async()=>{ const field=document.querySelector('vyp-ha-field')!; diff --git a/tests/consumers/ssr/fixtures/next/app/client-tabs.jsx b/tests/consumers/ssr/fixtures/next/app/client-tabs.jsx index 44ecda1..e133c2a 100644 --- a/tests/consumers/ssr/fixtures/next/app/client-tabs.jsx +++ b/tests/consumers/ssr/fixtures/next/app/client-tabs.jsx @@ -1,16 +1,23 @@ 'use client'; import {useState} from 'react'; -import {Tabs} from '@vypdev/ha-ui-react'; +import {Tabs,TextField} from '@vypdev/ha-ui-react'; import {registerTabs} from '@vypdev/ha-ui/tabs'; -registerTabs(); +import {registerField} from '@vypdev/ha-ui/field'; +import {textFieldState} from '@vypdev/ha-ui/field-contracts'; +registerTabs();registerField(); +const barcodeState=textFieldState({label:'Barcode number',inputMode:'numeric'}); export default function ClientTabs({initial}) { const [state,setState]=useState(initial),[count,setCount]=useState(0),[mounted,setMounted]=useState(true); + const [barcode,setBarcode]=useState('00012345'); function select(event) { setCount(value=>value+1); setState(value=>({...value,selected:event.detail.id})); } return <> + + + {count} {mounted&& diff --git a/tests/consumers/ssr/fixtures/next/package.json b/tests/consumers/ssr/fixtures/next/package.json index 182ac67..25e0277 100644 --- a/tests/consumers/ssr/fixtures/next/package.json +++ b/tests/consumers/ssr/fixtures/next/package.json @@ -11,8 +11,8 @@ "start": "next start" }, "dependencies": { - "@vypdev/ha-ui": "file:../pack-1/vypdev-ha-ui-0.1.0-next.2.tgz", - "@vypdev/ha-ui-react": "file:../pack-1/vypdev-ha-ui-react-0.1.0-next.2.tgz", + "@vypdev/ha-ui": "file:../pack-1/vypdev-ha-ui-0.1.0-next.3.tgz", + "@vypdev/ha-ui-react": "file:../pack-1/vypdev-ha-ui-react-0.1.0-next.3.tgz", "next": "16.4.5", "react": "19.3.1", "react-dom": "19.3.1" diff --git a/tests/consumers/ssr/fixtures/next/pnpm-lock.yaml b/tests/consumers/ssr/fixtures/next/pnpm-lock.yaml index a825132..7f1d0f0 100644 --- a/tests/consumers/ssr/fixtures/next/pnpm-lock.yaml +++ b/tests/consumers/ssr/fixtures/next/pnpm-lock.yaml @@ -5,18 +5,18 @@ settings: excludeLinksFromLockfile: false overrides: - '@vypdev/ha-ui': file:../pack-1/vypdev-ha-ui-0.1.0-next.2.tgz + '@vypdev/ha-ui': file:../pack-1/vypdev-ha-ui-0.1.0-next.3.tgz importers: .: dependencies: '@vypdev/ha-ui': - specifier: file:../pack-1/vypdev-ha-ui-0.1.0-next.2.tgz - version: file:../pack-1/vypdev-ha-ui-0.1.0-next.2.tgz + specifier: file:../pack-1/vypdev-ha-ui-0.1.0-next.3.tgz + version: file:../pack-1/vypdev-ha-ui-0.1.0-next.3.tgz '@vypdev/ha-ui-react': - specifier: file:../pack-1/vypdev-ha-ui-react-0.1.0-next.2.tgz - version: file:../pack-1/vypdev-ha-ui-react-0.1.0-next.2.tgz(react@19.3.1) + specifier: file:../pack-1/vypdev-ha-ui-react-0.1.0-next.3.tgz + version: file:../pack-1/vypdev-ha-ui-react-0.1.0-next.3.tgz(react@19.3.1) next: specifier: 16.4.5 version: 16.4.5(react-dom@19.3.1(react@19.3.1))(react@19.3.1) @@ -261,15 +261,15 @@ packages: '@types/trusted-types@2.0.7': resolution: {integrity: sha512-ScaPdn1dQczgbl0QFTeTOmVHFULt394XJgOQNoyVhZ6r2vLnMLJfBPd53SB52T/3G36VI1/g2MZaX0cwDuXsfw==} - '@vypdev/ha-ui-react@file:../pack-1/vypdev-ha-ui-react-0.1.0-next.2.tgz': - resolution: {integrity: sha512-papnt/BEPTnsPyzSV0gi4mF5Om2YNAN3OP6hn/VHD3RCo6rFl39RO7VVzW+VsmDSq01iCr0AtYk1sp5tUO5rrQ==, tarball: file:../pack-1/vypdev-ha-ui-react-0.1.0-next.2.tgz} - version: 0.1.0-next.2 + '@vypdev/ha-ui-react@file:../pack-1/vypdev-ha-ui-react-0.1.0-next.3.tgz': + resolution: {integrity: sha512-papnt/BEPTnsPyzSV0gi4mF5Om2YNAN3OP6hn/VHD3RCo6rFl39RO7VVzW+VsmDSq01iCr0AtYk1sp5tUO5rrQ==, tarball: file:../pack-1/vypdev-ha-ui-react-0.1.0-next.3.tgz} + version: 0.1.0-next.3 peerDependencies: react: 19.3.1 - '@vypdev/ha-ui@file:../pack-1/vypdev-ha-ui-0.1.0-next.2.tgz': - resolution: {integrity: sha512-hbYWDU7X71meaogXzz/u0tBUTKb9MNVS+yPFy5dH/aEOWr0TlQgXpbkYzf0CLoFlMGhdHq7co+ayQ7Yr6ujq5g==, tarball: file:../pack-1/vypdev-ha-ui-0.1.0-next.2.tgz} - version: 0.1.0-next.2 + '@vypdev/ha-ui@file:../pack-1/vypdev-ha-ui-0.1.0-next.3.tgz': + resolution: {integrity: sha512-hbYWDU7X71meaogXzz/u0tBUTKb9MNVS+yPFy5dH/aEOWr0TlQgXpbkYzf0CLoFlMGhdHq7co+ayQ7Yr6ujq5g==, tarball: file:../pack-1/vypdev-ha-ui-0.1.0-next.3.tgz} + version: 0.1.0-next.3 baseline-browser-mapping@2.11.35: resolution: {integrity: sha512-GNk8KX52CHqeNKGk8+7tZnQab/2k1t/BgrUHPKNdijzpEhF1saPQZHVKb6m5loSAxB39gyrTYw34Qf9CQ3u1qQ==} @@ -526,12 +526,12 @@ snapshots: '@types/trusted-types@2.0.7': {} - '@vypdev/ha-ui-react@file:../pack-1/vypdev-ha-ui-react-0.1.0-next.2.tgz(react@19.3.1)': + '@vypdev/ha-ui-react@file:../pack-1/vypdev-ha-ui-react-0.1.0-next.3.tgz(react@19.3.1)': dependencies: - '@vypdev/ha-ui': file:../pack-1/vypdev-ha-ui-0.1.0-next.2.tgz + '@vypdev/ha-ui': file:../pack-1/vypdev-ha-ui-0.1.0-next.3.tgz react: 19.3.1 - '@vypdev/ha-ui@file:../pack-1/vypdev-ha-ui-0.1.0-next.2.tgz': + '@vypdev/ha-ui@file:../pack-1/vypdev-ha-ui-0.1.0-next.3.tgz': dependencies: lit: 3.3.3 diff --git a/tests/consumers/ssr/fixtures/next/pnpm-workspace.yaml b/tests/consumers/ssr/fixtures/next/pnpm-workspace.yaml index 4364e36..455ae25 100644 --- a/tests/consumers/ssr/fixtures/next/pnpm-workspace.yaml +++ b/tests/consumers/ssr/fixtures/next/pnpm-workspace.yaml @@ -1,4 +1,4 @@ packages: [] autoInstallPeers: false overrides: - "@vypdev/ha-ui": file:../pack-1/vypdev-ha-ui-0.1.0-next.2.tgz + "@vypdev/ha-ui": file:../pack-1/vypdev-ha-ui-0.1.0-next.3.tgz diff --git a/tests/consumers/ssr/fixtures/nuxt/app/components/ClientTabs.client.vue b/tests/consumers/ssr/fixtures/nuxt/app/components/ClientTabs.client.vue index 600db69..44512dc 100644 --- a/tests/consumers/ssr/fixtures/nuxt/app/components/ClientTabs.client.vue +++ b/tests/consumers/ssr/fixtures/nuxt/app/components/ClientTabs.client.vue @@ -1,9 +1,13 @@