feat(color-handle): scaffold 2nd-gen core/SWC structure (Phase 2)#6443
feat(color-handle): scaffold 2nd-gen core/SWC structure (Phase 2)#6443blunteshwar wants to merge 1 commit into
Conversation
Set up the 2nd-gen file and folder structure for Color Handle, mirroring the migrated color-loupe core/SWC split. Stub-only; implementation lands in later phases. Core (@spectrum-web-components/core): - ColorHandle.base.ts: abstract ColorHandleBase with the 5-property contract (color, disabled, focused, open, fill) and pointer/touch open-close behavior ported from 1st-gen. - ColorHandle.types.ts: ColorHandleProperties interface. - index.ts re-export; explicit exports + typesVersions wired in package.json (badge pattern). SWC (@adobe/spectrum-wc): - ColorHandle.ts (swc-color-handle): stub render composing inner swatch over the shared opacity checkerboard plus a built-in swc-color-loupe. - color-handle.css: Phase 2 stub (full S2 styling in Phase 5). - index.ts class re-export; swc-color-handle.ts side-effect registration. - empty stories/ and test/ dirs. Covered by existing wildcard exports. Both package builds succeed and the element registers via swc-color-handle.js. Updates the migration plan Setup checklist and the workstream status table. Refs SWC-2137, SWC-2295
|
Coverage Report for CI Build 28034858084Warning No base build found for commit Coverage: 96.246%Details
Uncovered ChangesNo uncovered changes found. Coverage RegressionsRequires a base build to compare against. How to fix this → Coverage Stats💛 - Coveralls |
Description
Phase 2 (Setup) of the
sp-color-handle1st-gen → 2nd-gen migration. Scaffolds the 2nd-gen core/SWC file structure for Color Handle, mirroring the already-migratedcolor-loupesplit. Stub only — no public behavior, styling, tests, or stories yet; those land in Phases 3–7.Core (
@spectrum-web-components/core) —2nd-gen/packages/core/components/color-handle/ColorHandle.base.ts: abstractColorHandleBasedeclaring the agreed 5-property contract (color,disabled,focused,open,fill) and the pointer/touch open-close behavior ported from 1st-gen.ColorHandle.types.ts:ColorHandlePropertiesinterface (the primitive has no variant/size/treatment enums).index.ts: re-exports base + types. Explicitexports+typesVersionsentries added topackage.json(badge pattern).SWC (
@adobe/spectrum-wc) —2nd-gen/packages/swc/components/color-handle/ColorHandle.ts(swc-color-handle): stubrender()composing the inner color swatch over the shared opacity checkerboard plus a built-inswc-color-loupe.color-handle.css: Phase 2 stub; full S2 styling (sizing, adaptive dual-border, grow-on-focus) comes fromspectrum-css@spectrum-twoin Phase 5.index.ts: class re-export only.swc-color-handle.ts: side-effectdefineElementregistration +HTMLElementTagNameMapaugmentation.stories/andtest/dirs. Covered by the existing./components/*.jswildcard exports — no SWCpackage.jsonedit needed.Also updates the migration plan Setup checklist and the workstream status table (Analyze, Factor Component, Move to Core).
Motivation and context
Establishes the foundation for the Color Handle migration so later phases (API, a11y, styling, testing, docs) have a correct core/SWC structure to build on. Part of Epic SWC-2137; the adaptive non-text-contrast a11y work (SWC-2295) is implemented in later phases on top of this scaffold.
Related issue(s)
Screenshots (if appropriate)
N/A — no visual surface in this phase (stub CSS only).
Author's checklist
Reviewer's checklist
patch,minor, ormajorfeaturesManual review test cases
Both packages build
yarn workspace @spectrum-web-components/core buildyarn workspace @adobe/spectrum-wc builddist/components/color-handle/swc-color-handle.jsand coreColorHandle.base.jsemitted.Element registration vs class re-export
import '@adobe/spectrum-wc/components/color-handle/swc-color-handle.js'customElements.get('swc-color-handle')to be defined.import { ColorHandle } from '@adobe/spectrum-wc/color-handle'should NOT register the element.Device review
Accessibility testing checklist
Color Handle is a non-interactive visual primitive with no ARIA role/name and is not independently focusable; accessibility is owned by the parent color-area/slider/wheel. This PR is a stub scaffold and introduces no functional behavior, so there is nothing new to test for a11y in this phase. The net-new a11y obligation (WCAG 1.4.11 adaptive border, SWC-2295) is implemented and tested in Phases 4–6.
Keyboard (required — document steps below)
Screen reader (required — document steps below)
swc-color-loupe.