feat(components): add Form Field to the token-proof bundle (#87) #219
No reviewers
Labels
No labels
build-dist
priority
P1
priority
P2
priority
P3
priority
P4
bug
duplicate
enhancement
help wanted
invalid
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
Toilville/toilville-design!219
Loading…
Reference in a new issue
No description provided.
Delete branch "feat/87-form-field-component"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
closes #87
Scope
Adds exactly one component to the brand-agnostic bundle, as ville decided in #87: a Form Field (
components/form-field.html) with label, text input, help text, and default / focus / invalid / disabled states. It exists to prove the one DTCG tier Button and Card don't touch,border.jsonplus the focus ring.var(--*)only. No literal colours, sizes or radii. The few fallbacks are other vars (--border-interactivefalls back to--text-secondary,--focus-ringto--text-primary), because five short-var skins (chestnutstand, cosmiccrisp, pardner, sundered, truancy) define no--border-interactive, and pardner has no--focus-ring.:focus-visibledraws a--border-width-emphasis(3px) solid outline in--focus-ring, offset by--space-1so it never merges with the border. Contrast is checked in the test below.aria-invalid="true"turns the border--error, and the help line switches to error text, so colour is not the only signal._bundle.jsnow carries acomponentsregistry (button,card,form-field).tools/export_public_repo.pyships the new file and the same registry in the public kit. Without that the kit would lack the component.Not added, per ville: Badge/Tag, nav, hero, footer, ForgeBlock or product-specific components.
Testing
New
generator/tests/unit/test_components.py(32 cases, 30 pass, 2 skip because pardner's--focus-ringis not a plain hex). Full suitepytest generator tools: 560 passed, 2 skipped. Covers:_bundle.jsequals thecomponents/*.htmlfiles on disk, and equals the public-kit export;--focus-ring, and is nevernone;--focus-ringagainst--bg-surfaceis at least 3:1 for every short-var product, light and dark;--focus-ringand--errordiffer between the toilville and chestnutstand skins, with the same markup;Control (checks fail when the fix is broken, then restored):
3pxradius and#666colour in the component: fails;_bundle.js: 3 fail;outline: none: fails;--focus-ringset to#FFFFFF: contrast test fails;form-field: fails.Not run: a browser visual pass. The skin-switch and contrast checks read the generated
skin.cssvalues, not rendered pixels.Impact Statement
ToilvilleDesignSystem.componentsis a new list on the bundle namespace; the public kit gets the same underDesignKit.components.dist/change.components/and in the public kit export.publish-public-design-kit.ymlalready triggers oncomponents/**andtools/export_public_repo.py, so the public kit picks it up on merge.