chore(dropzone): full fidelity#6446
Conversation
|
1b2b242 to
607abae
Compare
📚 Branch Preview Links🔍 Gen1 Visual Regression Test ResultsWhen a visual regression test fails (or has previously failed while working on this branch), its results can be found in the following URLs:
Deployed to Azure Blob Storage: If the changes are expected, update the |
94ac3a6 to
2aab51e
Compare
607abae to
26dc7e5
Compare
2aab51e to
42b0387
Compare
26dc7e5 to
87928fd
Compare
5t3ph
left a comment
There was a problem hiding this comment.
Blocking to assess a functional change of possibly adding a filled-content slot.
420a581 to
40b81e4
Compare
42b0387 to
fce646e
Compare
15ada21 to
972adaa
Compare
fce646e to
2acf4ea
Compare
972adaa to
a32b450
Compare
5t3ph
left a comment
There was a problem hiding this comment.
Would you mind creating a ticket to investigate if we'd want to add something akin to React's FileTrigger (embedded in their DropZone demo, no separate docs) to help facilitate more of the upload operation? It's still feeling odd to me that we turn over so much to consumers to have to handle for the logic.
S1 showed a very rudimentary way to open a hidden file input, which we might want to demo at minimum. Could be done in the docs phase.
| } as const satisfies Record<DropzoneSize, string>; | ||
|
|
||
| const DROPZONE_SVG = ` | ||
| <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 150 103" slot="" aria-hidden="true"> |
There was a problem hiding this comment.
Let's go ahead and update this to the linear version shown in the Figma, per Design's guidance in the Slack thread, so we aren't using an unexpected illustration.
<svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" viewBox="0 0 96 96"><path d="M12 68.74a2 2 0 0 1 2 2v3.5a1.5 1.5 0 0 0 1.5 1.5H19a2 2 0 1 1 0 4h-3.5a5.5 5.5 0 0 1-5.5-5.5v-3.5a2 2 0 0 1 2-2m22.5 7a2 2 0 1 1 0 4H27a2 2 0 1 1 0-4zm17 0a2 2 0 1 1 0 4H44a2 2 0 1 1 0-4zm17 0a2 2 0 1 1 0 4H61a2 2 0 1 1 0-4zm15.5-7a2 2 0 0 1 2 2v3.5a5.5 5.5 0 0 1-5.5 5.5H77a2 2 0 1 1 0-4h3.5a1.5 1.5 0 0 0 1.5-1.5v-3.5a2 2 0 0 1 2-2m-36.441-53c1.973 0 3.868.78 5.267 2.17l14.987 14.9A7.4 7.4 0 0 1 70 38.063v21.254c0 4.11-3.348 7.423-7.454 7.423H33.454c-4.106 0-7.454-3.313-7.454-7.423V23.163c0-4.11 3.348-7.423 7.454-7.423zM84 55.24a2 2 0 0 1 2 2v7.5a2 2 0 1 1-4 0v-7.5a2 2 0 0 1 2-2m-72-.5a2 2 0 0 1 2 2v7.5a2 2 0 1 1-4 0v-7.5a2 2 0 0 1 2-2m21.454-35c-1.918 0-3.454 1.544-3.454 3.423v36.154c0 1.88 1.536 3.423 3.454 3.423h29.092c1.918 0 3.454-1.544 3.454-3.423V38.063c0-.904-.361-1.773-1.008-2.416l-14.986-14.9a3.47 3.47 0 0 0-2.447-1.007zm13.594 12a2 2 0 0 1 1.996 2.004l-.035 15.781 5.214-4.324a2 2 0 0 1 2.554 3.078l-8.438 7a2 2 0 0 1-1.31.459l-.033.002a2 2 0 0 1-1.54-.729l-8.222-6.722a2 2 0 0 1 2.532-3.098l5.243 4.286.035-15.74a2 2 0 0 1 2.004-1.997M19 40.74a2 2 0 1 1 0 4h-3.5a1.5 1.5 0 0 0-1.5 1.5v3.5a2 2 0 1 1-4 0v-3.5a5.5 5.5 0 0 1 5.5-5.5zm61.5 0a5.5 5.5 0 0 1 5.5 5.5v3.5a2 2 0 1 1-4 0v-3.5a1.5 1.5 0 0 0-1.5-1.5H77a2 2 0 1 1 0-4z"/></svg>
e8780f7 to
5096f04
Compare
5t3ph
left a comment
There was a problem hiding this comment.
This is getting close! A couple minor things besides the Illustrated Message fix we also chatted about.
| } as const satisfies Record<DropzoneSize, string>; | ||
|
|
||
| const DROPZONE_SVG = ` | ||
| <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 150 103" slot="" aria-hidden="true"> |
There was a problem hiding this comment.
Let's go ahead and update this to the linear version shown in the Figma, per Design's guidance in the Slack thread, so we aren't using an unexpected illustration.
<svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" viewBox="0 0 96 96"><path d="M12 68.74a2 2 0 0 1 2 2v3.5a1.5 1.5 0 0 0 1.5 1.5H19a2 2 0 1 1 0 4h-3.5a5.5 5.5 0 0 1-5.5-5.5v-3.5a2 2 0 0 1 2-2m22.5 7a2 2 0 1 1 0 4H27a2 2 0 1 1 0-4zm17 0a2 2 0 1 1 0 4H44a2 2 0 1 1 0-4zm17 0a2 2 0 1 1 0 4H61a2 2 0 1 1 0-4zm15.5-7a2 2 0 0 1 2 2v3.5a5.5 5.5 0 0 1-5.5 5.5H77a2 2 0 1 1 0-4h3.5a1.5 1.5 0 0 0 1.5-1.5v-3.5a2 2 0 0 1 2-2m-36.441-53c1.973 0 3.868.78 5.267 2.17l14.987 14.9A7.4 7.4 0 0 1 70 38.063v21.254c0 4.11-3.348 7.423-7.454 7.423H33.454c-4.106 0-7.454-3.313-7.454-7.423V23.163c0-4.11 3.348-7.423 7.454-7.423zM84 55.24a2 2 0 0 1 2 2v7.5a2 2 0 1 1-4 0v-7.5a2 2 0 0 1 2-2m-72-.5a2 2 0 0 1 2 2v7.5a2 2 0 1 1-4 0v-7.5a2 2 0 0 1 2-2m21.454-35c-1.918 0-3.454 1.544-3.454 3.423v36.154c0 1.88 1.536 3.423 3.454 3.423h29.092c1.918 0 3.454-1.544 3.454-3.423V38.063c0-.904-.361-1.773-1.008-2.416l-14.986-14.9a3.47 3.47 0 0 0-2.447-1.007zm13.594 12a2 2 0 0 1 1.996 2.004l-.035 15.781 5.214-4.324a2 2 0 0 1 2.554 3.078l-8.438 7a2 2 0 0 1-1.31.459l-.033.002a2 2 0 0 1-1.54-.729l-8.222-6.722a2 2 0 0 1 2.532-3.098l5.243 4.286.035-15.74a2 2 0 0 1 2.004-1.997M19 40.74a2 2 0 1 1 0 4h-3.5a1.5 1.5 0 0 0-1.5 1.5v3.5a2 2 0 1 1-4 0v-3.5a5.5 5.5 0 0 1 5.5-5.5zm61.5 0a5.5 5.5 0 0 1 5.5 5.5v3.5a2 2 0 1 1-4 0v-3.5a1.5 1.5 0 0 0-1.5-1.5H77a2 2 0 1 1 0-4z"/></svg>
5f0439f to
439a3ee
Compare
5d7aa5d to
c383d98
Compare
…override directly
439a3ee to
19eb783
Compare
5t3ph
left a comment
There was a problem hiding this comment.
One suggestion for the Illustrated Message update - thanks for adding that in!


Description
Phase 5 (CSS migration and stories) of the
swc-dropzoneSpectrum 2 migration. This PR is stacked on top of the file-structure PR and should be merged after that PR lands.Changes in this PR:
Dropzone.types.ts— AddedDropzoneSizetype andDROPZONE_VALID_SIZESconstant ('s' | 'm' | 'l'); addedDropzoneEventDetailtype alias for consumers who imported it from the 1st-gen packageDropzone.base.ts— AppliedSizedMixinwithvalidSizes: DROPZONE_VALID_SIZESto expose thesizeattribute on the base class;sizeis new in 2nd-gen (not in 1st-gen)Dropzone.ts— Updatedrender()to emit a.swc-Dropzonewrapper and aswc-Dropzone-statusvisually-hidden live region; added@csspropJSDoc for all five exposed custom properties; fixed@paramname mismatch in_onDragStateChangeJSDocdropzone.css— Full S2 token-based stylesheet: CSS-only dashed/solid border, size-variant padding overrides, dragged and filled state selectors,--swc-illustrated-message-illustration-colorcascade for accent-colored illustration in dragged state, and@media (forced-colors: active)blockdropzone.stories.ts— New stories file with Playground, Overview, Anatomy, Sizes (options), and States stories; Behaviors and Accessibility stubs deferred to Phase 7preview.ts— Added'Migration plan'to the Dropzone reference doc list in the Storybook sidebarMotivation and context
This is Phase 5 of the Dropzone Spectrum 2 migration. The CSS migration replaces the 1st-gen Spectrum CSS dependency with 2nd-gen S2 tokens (
token()calls), introduces size variants (new in 2nd-gen), and ensures the component renders correctly in both default and dragged/filled states.Key design decisions resolved during this phase:
border(dashed/solid toggling) rather than an SVG stroke, matching the currentspectrum-cssmain branch approach; SVG stroke can be revisited if the Figma or CSS spec diverges--swc-illustrated-message-illustration-coloris set on:host([dragged])and cascades through the DOM intoswc-illustrated-message's shadow via normal CSS custom property inheritance; no::slotted()selector needed for colorRelated issue(s)
Screenshots (if appropriate)
Author's checklist
Reviewer's checklist
patch,minor, ormajorfeaturesManual review test cases
Default state renders correctly
mDragged state applies correctly
draggedin the Playground controls; confirm the transition is immediateFilled state hides the illustrated message
Size variants change padding only
s,m, andlinstancesForced-colors / high-contrast mode
ButtonText; dragged: backgroundCanvas, borderHighlightDevice review
Accessibility testing checklist
Required: Complete each applicable item and document your testing steps.
Keyboard (required — document steps below)
role="group"is announced and the accessible name is readScreen reader (required — document steps below)
aria-live="polite") announces the state change whendraggedis toggled programmaticallydisplay: nonewhen[filled]) and only the uploaded-content region is announced