You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: 2nd-gen/packages/swc/components/dropzone/migration-guide.mdx
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -278,7 +278,7 @@ Spectrum 2 exposes a small set of public CSS custom properties on `<swc-dropzone
278
278
279
279
None of the other ~30 `--mod-drop-zone-*` / `--mod-illustrated-message-*` properties have a replacement above; retoken or remove them. CJK-specific font-size overrides (e.g. `--mod-illustrated-message-title-font-size` under `:lang(ja|ko|zh)`) need no replacement: `swc-illustrated-message` now applies CJK sizing automatically.
280
280
281
-
`dropEffect` gained a development-mode console warning for invalid values (it was silently ignored before); no markup or code change is required.
281
+
`dropEffect` gained a development-mode console warning for invalid values (it was silently ignored before) and now reacts to the `drop-effect` attribute, both at parse time and at runtime; it was JavaScript-property-only in Spectrum 1. No markup change is required for consumers already setting `element.dropEffect` in JavaScript; consumers using `drop-effect="..."` in markup will see it take effect for the first time.
Copy file name to clipboardExpand all lines: CONTRIBUTOR-DOCS/03_project-planning/03_components/dropzone/migration-plan.md
+26-14Lines changed: 26 additions & 14 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -236,10 +236,11 @@ No sequencing, shared-base, or inheritance decisions require explicit user confi
236
236
|**B2**| JS property rename: `isDragged` → `dragged`|`element.isDragged`|`element.dragged`| Update JS references; HTML attribute `dragged` is unchanged. Lit template `?dragged=…` bindings are unaffected. |
237
237
|**B3**| JS property rename: `isFilled` → `filled`|`element.isFilled`|`element.filled`| Update JS references; HTML attribute `filled` is unchanged. Lit template `?filled=…` bindings are unaffected. |
238
238
|**B4**| Fix `filled` reflection | Setting `element.isFilled = true` did not update the attribute; styles never applied via JS | Setting `element.filled = true` now reflects to `[filled]` attribute; styles apply correctly | No consumer migration needed. This is a silent bug fix. |
239
-
|**B5**|`dropEffect` becomes a proper `@property`| Manual getter/setter; attribute changes at runtime not reactive |`@property({ type: String, attribute: 'drop-effect', reflect: true })`; fully reactive | No migration needed for consumers using the attribute. JS consumers using `element.dropEffect = 'move'` are unaffected. |
239
+
|**B5**|`dropEffect` becomes a proper `@property`| Manual getter/setter; the `drop-effect`attribute had no effect at parse time or at runtime |`@property({ type: String, attribute: 'drop-effect' })` (no `reflect`; controls browser drag chrome, not visual state); fully reactive to the attribute at parse time and at runtime | No migration needed for consumers using the attribute: it now works where it silently did nothing before. JS consumers using `element.dropEffect = 'move'` are unaffected. |
240
240
|**B6**| Public methods `onDragOver`, `onDragLeave`, `onDrop` visibility |`public`|`protected`| Consumers who subclass `Dropzone` and override these methods must update visibility. **Inferred** as low-risk (see Q9). |
241
241
|**B7**| Event prefix |`sp-dropzone-should-accept`, `sp-dropzone-dragover`, `sp-dropzone-dragleave`, `sp-dropzone-drop`|**Confirmed.** Rename to `swc-dropzone-should-accept`, `swc-dropzone-dragover`, `swc-dropzone-dragleave`, `swc-dropzone-drop`. Consistent with all other migrated 2nd-gen components. | Update all `addEventListener` calls. |
242
242
|**B17**|`DropzoneEventDetail` type removed |`export type DropzoneEventDetail = DragEvent;` exported from `src/index.ts`| Not exported. Clean break, same posture as other migrated components (no retained type aliases elsewhere in 2nd-gen). | Replace `DropzoneEventDetail` imports with `DragEvent` directly; the two types were always structurally identical. |
243
+
|**B18**| New `filled-content` slot; `filled` swaps slots instead of restyling in place | Setting `isFilled`/`filled` only changed styling; the same slotted content stayed in the DOM and consumers updated it in place. |**Shipped.** A dedicated `filled-content` slot holds uploaded-state content. `render()` conditionally renders either the default slot or the `filled-content` slot based on `filled`, so the entire default slot (illustrated message, browse control) is unslotted while `filled` is `true`. Supersedes the narrower "replace" slot discussed in [A4](#additive--ships-when-ready-zero-breakage-for-consumers-already-on-2nd-gen), which is resolved by this broader slot rather than deferred. | Move uploaded-state content into `slot="filled-content"` instead of mutating the default slot's content in place. Keep a reachable control (e.g. "Replace file") in `filled-content` since the default slot's browse control is hidden while `filled` is `true`. See `migration-guide.mdx`. |
243
244
244
245
#### Styling and visuals
245
246
@@ -267,7 +268,7 @@ No sequencing, shared-base, or inheritance decisions require explicit user confi
267
268
|**A1**| Error state |**Figma shows no error state.** Deferred. Create a follow-up Jira ticket when design spec is available. |
268
269
|**A2**|~~Hover state visually distinct from keyboard focus~~|**Resolved by Figma.** The "Hover" state in Figma is the same as the drag-over state; no separate pointer-hover treatment exists. The same accent border applies to `:focus-visible` on the browse control. No additive work needed; this is fully in scope as part of B10. |
269
270
|**A3**|~~Illustration accent color passthrough when dragged~~|**Resolved by Figma.** The icon/illustration switches to the accent/gradient treatment in the "Hover" (dragged) state. This is confirmed Must-ship and is absorbed into the styling phase; see the B8/size matrix in the visual matrix section. No separate additive ticket needed. |
270
-
|**A4**| Customizable replace-state overlay content |The filled+dragged state shows "Drop file to replace." A named slot (e.g. `replace`) could allow consumer-provided replace-state content. Deferred; the default announcement covers a11y requirements without a slot. |
271
+
|**A4**|~~Customizable replace-state overlay content~~|**Resolved during implementation.** A `filled-content` slot shipped as Must-ship (see [B18](#must-ship--breaking-or-a11y-required)), broader than the "replace" slot originally scoped here: it holds all uploaded-state content, not just the filled+dragged overlay text. No separate additive ticket needed. |
271
272
272
273
---
273
274
@@ -287,7 +288,7 @@ Use lightweight confidence labels:
|`dropEffect`|`DropEffects`|`'copy'`|`drop-effect`|No| Confirmed | Proper `@property` declaration; reactive to the attribute at parse time and at runtime. Not reflected back to the attribute (intentional; controls browser drag chrome, not visual component state). Values validated: `'copy' \| 'move' \| 'link' \| 'none'`. |
|`filled`|`boolean`|`false`|`filled`|**Yes**| Confirmed | Renamed from `isFilled`. Attribute unchanged. Reflection is a bug fix. |
293
294
|`size`|`'s' \| 'm' \| 'l'`|`'m'`|`size`| Yes | Confirmed |**New in 2nd-gen.** Figma shows Small, Medium, Large sizes. Maps to `'s'`, `'m'`, `'l'` per SWC conventions. Not present in 1st-gen; additive, not breaking. |
@@ -319,7 +320,8 @@ Figma state labels and their component attribute equivalents:
319
320
320
321
| Slot | Content | Notes |
321
322
| ---- | ------- | ----- |
322
-
| default |`swc-illustrated-message` with the browse control placed in its `button-group` slot. This is the canonical pattern and aligns with the React Spectrum `DropZone` + `FileTrigger` model. When `filled`, the consumer replaces this content with the uploaded state. |**Confirmed.**`swc-dropzone` renders no built-in content. A browse control is required in every usage for WCAG 2.1.1 compliance. Note: `swc-illustrated-message`'s `button-group` slot is additive (A3 in that component's migration plan) and not yet implemented; examples must use a temporary pattern (browse control alongside `swc-illustrated-message` in the dropzone slot) until it ships. |
323
+
| default |`swc-illustrated-message` with the browse control placed in its `button-group` slot. This is the canonical pattern and aligns with the React Spectrum `DropZone` + `FileTrigger` model. |**Confirmed.**`swc-dropzone` renders no built-in content. A browse control is required in every usage for WCAG 2.1.1 compliance. Note: `swc-illustrated-message`'s `button-group` slot is additive (A3 in that component's migration plan) and not yet implemented; examples must use a temporary pattern (browse control alongside `swc-illustrated-message` in the dropzone slot) until it ships. Rendered only while `filled` is `false`; see `filled-content` below. |
324
+
|`filled-content`| Uploaded-state content (e.g. a file name or image preview), shown once a file has been accepted. |**Shipped (B18).** Not in the original plan; added during implementation. `render()` swaps to this slot instead of restyling the default slot in place; the default slot is fully unslotted while `filled` is `true`. See [B18](#must-ship--breaking-or-a11y-required). |
323
325
324
326
#### CSS custom properties (2nd-gen)
325
327
@@ -429,8 +431,10 @@ No `DropzoneEventDetail` alias is exported. 2nd-gen is a clean break from 1st-ge
0 commit comments