feat(color-loupe): implement Color Loupe component #6147
Draft
blunteshwar wants to merge 1 commit intocolor-loupe-migrationfrom
Draft
feat(color-loupe): implement Color Loupe component #6147blunteshwar wants to merge 1 commit intocolor-loupe-migrationfrom
blunteshwar wants to merge 1 commit intocolor-loupe-migrationfrom
Conversation
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
feat(color-loupe): migrate
sp-color-loupetoswc-color-loupe(2nd gen)Migrates the
color-loupecomponent from 1st-gen (sp-color-loupe) to 2nd-gen(
swc-color-loupe) following the washing machine workflow. All 7 migration stepsare complete and the status table has been updated.
What was done
Core package (
2nd-gen/packages/core/components/color-loupe/)ColorLoupe.types.ts— minimal types file with the default color constantColorLoupe.base.ts— abstract base class extendingSpectrumElement; holdsthe two public properties (
open,color)index.ts— re-exportsSWC package (
2nd-gen/packages/swc/components/color-loupe/)ColorLoupe.ts— concrete class withrender()andstylescolor-loupe.css— token-based CSS following the S2 migration guideindex.ts—defineElement('swc-color-loupe', ColorLoupe)registrationstories/color-loupe.stories.ts— Playground, Overview, Anatomy, States,ColorDisplay (behaviors), and Accessibility stories
test/color-loupe.test.ts— Storybook play-function tests (defaults,openreflection,
colorproperty)test/color-loupe.a11y.spec.ts— Playwright ARIA snapshot tests (empty tree;component is fully
aria-hidden)Migration docs
1st-gen/packages/color-loupe/MIGRATION_ANALYSIS.md— full API surface, DOMstructure, factor assessment, and gen-2 delta notes
CONTRIBUTOR-DOCS/.../01_status.md— all 7 columns marked for Color LoupeNotable changes from 1st-gen
61.575ZZ→61.575Z)xlink:href="#path"→href="#loupe-path")xlink:hrefxlink:hrefto modernhrefthroughout the SVG@spectrum-web-components/opacity-checkerboardimport with an inlinerepeating-conic-gradientusing--swc-opacity-checkerboard-*tokens andlight-dark()for theme support--spectrum-drop-shadow-xto S2token("drop-shadow-elevated-*")--spectrum-color-loupe-*/--mod-colorloupe-*chains replaced withtoken()and--swc-color-loupe-*exposed overridesdiv.swc-ColorLoupe-colorFillwithbackground: ${this.color}instead of setting--spectrum-picked-coloron the SVG inline styleAccessibility
The loupe is a visual-only component with no keyboard interaction or focus
management. The SVG is
aria-hidden="true"and the component has no tab stop —semantics are owned by the parent color-field/picker. This aligns with the
existing a11y analysis and the known WCAG 1.4.11 limitation documented in
SWC-1193.
Test plan
checkerboard, and color fill
opencontrol — loupe should animate in/outcolorcontrol — fill should update including transparencyover the checkerboard
yarn test:a11y:2nd— ARIA snapshot tests should pass (empty tree)yarn lint:2nd-gen— no CSS/TS/Prettier errors