feat(drop-zone): add DropZone component with examples and documentation#216
Draft
rmojica-godaddy wants to merge 2 commits into
Draft
feat(drop-zone): add DropZone component with examples and documentation#216rmojica-godaddy wants to merge 2 commits into
rmojica-godaddy wants to merge 2 commits into
Conversation
🦋 Changeset detectedLatest commit: f97339f The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Contributor
Docs Site PreviewPreview URL: https://godaddy.github.io/antares/pr-216-site/ Preview will be automatically deleted when this PR is closed. |
Wraps react-aria-components DropZone with Antares styling and Flex layout. CSS module covers all RAC data-attribute states (hovered, focused, focus-visible, drop-target, disabled) with TODO markers for pending design specs. Includes SSR and browser tests, Storybook story, and barrel export from @godaddy/antares.
24819c3 to
0792b0b
Compare
Contributor
📚 Storybook PreviewPreview URL: https://godaddy.github.io/antares/pr-216-storybook/ Preview will be automatically deleted when this PR is closed. |
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.
Summary
Adds a new
DropZonecomponent — a standalone drag-and-drop target region for file uploads. It wrapsreact-aria-componentsDropZone(v1.18.0), which handles all DnD event management, keyboard accessibility, and screen reader support out of the box.The component uses a
Flexwrapper withas={RACDropZone}to compose Antares layout with RAC behavior, applying a teal dashed border and semi-transparent background from design tokens. Default children render an instructional text label; consumers can replace it withchildrento communicate accepted file types and size limits.Changes Made
src/index.tsx—DropZonecomponent:forwardRefwrapper around RACDropZoneviaFlex as={RACDropZone}; re-exportsisFileDropItem,isTextDropItem,isDirectoryDropItemsrc/index.module.css— CSS module with design tokens and all RAC data-attribute states:[data-hovered],[data-focused],[data-focus-visible],[data-drop-target],[data-disabled]; TODO markers for hover/focused visual treatment and consumer-controlled invalid/processing states pending Design Foundations specexamples/—default.tsx,disabled.tsx,custom-content.tsx,drop-zone-playground.tsxtest/drop-zone.browser.test.tsx— 5 browser tests (container render, default text, custom children, no default text with custom children,data-disabledattribute)test/drop-zone.node.test.tsx— SSRrenderToStringsnapshot tests for all 4 examplesdrop-zone.stories.tsx— Storybook stories with Props table, Default, CustomContent, Disabled, and PlaygroundREADME.mdx— component docs: installation, props, examples, keyboard/screen reader accessibility, best practicespackages/@godaddy/antares/index.ts— barrel exportLinks
DropZone
Test Plan
[data-drop-target])[data-focus-visible])npx vitest run drop-zone)Checklist
npm run changesetif this affects packages)Pending
[data-hovered]): visual treatment TBD — awaiting Design Foundations spec from Sean Rice[data-focused]): visual treatment TBD — awaiting Design Foundations spec