Skip to content

feat: add FileUploadCard and FileUploadStatus components - #3109

Merged
lariciamota merged 9 commits into
vtex:feat/quick-order-by-file-feature-branchfrom
cubos-vtex:BE-70
Feb 6, 2026
Merged

lariciamota merged 9 commits into
vtex:feat/quick-order-by-file-feature-branchfrom
cubos-vtex:BE-70

Conversation

@BrunaCubos

@BrunaCubos BrunaCubos commented Nov 10, 2025 •

Copy link
Copy Markdown
Collaborator

Tasks https://vtex-dev.atlassian.net/jira/software/projects/BE/boards/2868?selectedIssue=BE-69 BE-70

Here's the completed PR description in English:

  • Introduced FileUploadCard for file selection and upload functionality, including drag-and-drop support.
  • Added FileUploadStatus to display upload progress and error handling.
  • Updated index files to export new components and types.
  • Enhanced SearchInputField to include an attachment button that triggers the file upload card.
  • Added styles for both new components to ensure proper UI integration.

What's the purpose of this pull request?

This PR introduces a new file upload feature that allows users to perform bulk searches by uploading CSV files. The feature provides a modern, user-friendly interface with drag-and-drop support, real-time upload status tracking, and comprehensive error handling to guide users through the file upload process.

How it works?

FileUploadCard Component

  • File Selection: Users can either click "Select file" button or drag-and-drop files into the dropzone
  • Drag & Drop: Visual feedback with border color and background changes when dragging files
  • File Input: Hidden file input that's always present in the DOM to ensure file picker works in all states
  • Download Template: Provides a CSV template download option for users who need guidance on file format
  • Validation: Only accepts CSV files (.csv extension)
  • States: Manages upload states (uploading, completed, error) with appropriate UI updates

FileUploadStatus Component

Displays the current status of the uploaded file with three distinct states:

  1. Uploading State

    • Shows spinning CircleNotch icon
    • Displays "Uploading your file..." message
    • Shows filename
  2. Completed State

    • Shows Table icon in green background
    • Displays filename and file size
    • Shows "Search" button to proceed with the uploaded file
  3. Error State

    • Shows WarningOctagon icon in red background
    • Special styling: light pink background (#FDF6F5) with red border (#FFDFD9)
    • Displays error title and description in two lines
    • Shows two action buttons: "Download template" and "Select file"

Error Types

The component handles six different error scenarios:

  • Unsupported: Wrong file type (non-CSV files)
  • Unreadable: File can't be parsed or is corrupted
  • Invalid Structure: Missing headers or incorrect columns
  • Empty: File has no data
  • Too Large: File exceeds size limit
  • Unexpected: Generic error for unknown issues

Integration

  • Added attachment icon button to SearchInputField component
  • Clicking the attachment button toggles the FileUploadCard visibility
  • Card appears as a dropdown below the search input
  • Smooth animations for show/hide transitions

Key Features

  • File validation: Automatically checks file type on selection/drop
  • Error recovery: Users can easily select a new file or download template when errors occur
  • Responsive design: Components adapt to container width
  • Accessibility: Proper ARIA labels and keyboard navigation support
  • Visual feedback: Icons, colors, and animations provide clear status indication

How to test it?

Basic File Upload Flow

  1. Navigate to a page with the search input
  2. Click the attachment icon button (Paperclip icon)
  3. The FileUploadCard should appear below the search input
  4. Click "Select file" or drag-and-drop a CSV file
  5. Observe the uploading state with spinning icon
  6. After 2 seconds, see the completed state with "Search" button
  7. Click the X button to remove the file and return to initial state

Drag and Drop

  1. Open the FileUploadCard
  2. Drag a CSV file over the dropzone
  3. Observe the visual feedback (border and background color change)
  4. Drop the file to upload

Error Handling - Unsupported File Type

  1. Open the FileUploadCard
  2. Select or drop a non-CSV file (e.g., .txt, .pdf, .xlsx)
  3. Observe error state with red icon and pink background
  4. Read error message: "Unsupported file type." / "Upload a CSV or use the template provided."
  5. Click "Download template" to get a sample CSV
  6. Click "Select file" to try uploading again

File Removal

  1. Upload a file successfully
  2. Click the X button in the top-right of the file status
  3. Component should return to initial dropzone state

Starters Deploy Preview

References

Checklist

You may erase this after checking them all 😉

PR Title and Commit Messages

  • PR title and commit messages follow the Conventional Commits specification
    • Available prefixes: feat, fix, chore, docs, style, refactor, ci and test

PR Description

  • Added a label according to the PR goal - breaking change, bug, contributing, performance, documentation..

Dependencies

  • Committed the pnpm-lock.yaml file when there were changes to the packages

Documentation

  • PR description

Summary by CodeRabbit

Release Notes

  • New Features

    • File upload card component enabling file selection via drag-and-drop or file picker with status indicators
    • File upload status component displaying upload progress, success, and error states with customizable error handling
    • Attachment button in search input for quick file upload access
  • Chores

    • Added component styling and Storybook demonstrations

✏️ Tip: You can customize this high-level summary in your review settings.

@BrunaCubos
BrunaCubos requested a review from a team as a code owner November 10, 2025 19:15
@BrunaCubos
BrunaCubos requested review from lariciamota and lemagnetic and removed request for a team November 10, 2025 19:15
@codesandbox-ci

codesandbox-ci Bot commented Nov 10, 2025 •

Copy link
Copy Markdown

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

@icaroov icaroov mentioned this pull request Nov 12, 2025
1 of 5 tasks

@ArthurTriis1 ArthurTriis1 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

O projeto da FS conta com storybook, pode adicionar uma versão simples para ajudar na revisão de novos componentes?

@BrunaCubos
BrunaCubos changed the base branch from main to feat/quick-order-by-file-feature-branch November 21, 2025 13:53

@ArthurTriis1 ArthurTriis1 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Aprovado, muito bom o resultado dos componentes e o storybook ajudou na correção. Deixei alguns comentários, favor corrigir antes do merge

@lucasfp13 lucasfp13 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Deixei algumas sugestões de ajustes, mas em relação à funcionalidade me parece ok.

BrunaCubos and others added 5 commits January 14, 2026 11:50
- Introduced `FileUploadCard` for file selection and upload functionality, including drag-and-drop support.
- Added `FileUploadStatus` to display upload progress and error handling.
- Updated index files to export new components and types.
- Enhanced `SearchInputField` to include an attachment button that triggers the file upload card.
- Added styles for both new components to ensure proper UI integration.
- Replaced native input elements with custom Input and Button components for consistency.
- Simplified accepted file types in FileUploadCard to only '.csv'.
- Added TODO comment for file size formatting in FileUploadStatus.
- Adjusted SCSS variable formatting for improved readability.
@coderabbitai

coderabbitai Bot commented Jan 14, 2026 •

Copy link
Copy Markdown
Contributor

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

  • 🔍 Trigger a full review
📝 Walkthrough

Walkthrough

This PR introduces FileUploadCard and FileUploadStatus React components with drag-and-drop file selection, state management for upload workflows, and integration into SearchInput. Includes comprehensive styling, public API exports, and Storybook demonstrations.

Changes

Cohort / File(s) Summary
FileUploadCard Component
packages/components/src/molecules/FileUploadCard/FileUploadCard.tsx, packages/components/src/molecules/FileUploadCard/index.tsx
New React component supporting file selection via input or drag-and-drop. Manages upload state (uploading/completed/error), provides callbacks (onFileSelect, onDownloadTemplate, onSearch, onDismiss), and renders conditional UI with FileUploadStatus when file is selected. Default template CSV download included.
FileUploadStatus Component
packages/components/src/molecules/FileUploadStatus/FileUploadStatus.tsx, packages/components/src/molecules/FileUploadStatus/index.tsx
New React component displaying file upload status with icon/state indicators. Exports FileUploadState type, FileUploadErrorType enum (unexpected/unsupported/unreadable/invalid-structure/empty/too-large), and FileUploadStatusProps interface. Renders error/success/uploading states with conditional action buttons (remove, search, download template, select file).
SearchInput Integration
packages/core/src/components/search/SearchInput/SearchInput.tsx, packages/components/src/molecules/SearchInputField/SearchInputField.tsx
SearchInput adds file upload flow with new state (fileUploadVisible, isUploadOpen, hasFile) and integrates FileUploadCard. SearchInputField adds new props: showAttachmentButton, attachmentButtonProps, attachmentButtonIcon to render attachment button with separator.
Public API Exports
packages/components/src/index.ts
Exports FileUploadCard, FileUploadCardProps, FileUploadStatus, FileUploadState, FileUploadErrorType, and FileUploadStatusProps from molecule modules.
Styling
packages/ui/src/components/molecules/FileUploadCard/styles.scss, packages/ui/src/components/molecules/FileUploadStatus/styles.scss, packages/ui/src/components/molecules/SearchInputField/styles.scss, packages/ui/src/styles/components.scss, packages/core/src/components/sections/Navbar/section.module.scss
New complete SCSS modules for FileUploadCard (card container, dropzone, drag states, files panel) and FileUploadStatus (state icons, animations, error styling). Updated SearchInputField styles to accommodate new attachment button/separator layout. Global imports added.
Storybook Stories
packages/storybook/stories/fileupload.stories.tsx
Six story exports demonstrating FileUploadCard (default, with toggle), FileUploadStatus states (uploading, completed, error, all error types), and SearchInputField with file upload integration. Includes template download and interaction logging.

Sequence Diagram

sequenceDiagram
    actor User
    participant Card as FileUploadCard
    participant Status as FileUploadStatus
    participant Handler as Parent Component
    
    User->>Card: Click "Select file" / Drag-drop
    Card->>Card: Validate file (extension/type)
    alt File valid
        Card->>Card: Set selectedFile & uploadState='uploading'
        Card->>Status: Render with uploading state
        User->>Status: Monitor upload progress
        Card->>Card: Simulate 2s upload delay
        Card->>Card: uploadState='completed'
        Status->>Status: Display success icon
        User->>Status: Click "Search" or "Remove"
        Status->>Handler: onSearch() / onRemove() callback
    else File invalid
        Card->>Card: Set uploadState='error'
        Card->>Status: Render with error state
        User->>Status: Click "Download template" or "Select file"
        Status->>Handler: onDownloadTemplate() / onSelectFile() callback
    end
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~30 minutes

Poem

🐰 With cards that catch files mid-flight,
And dropzones draped in soft delight,
Upload, revert, or start anew—
A rabbit hops through states of two!
Files dance where I command. 📁✨

🚥 Pre-merge checks | ✅ 2 | ❌ 1
❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'feat: add FileUploadCard and FileUploadStatus components' clearly and specifically summarizes the main changes: two new components are being added to the codebase.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@lariciamota

Copy link
Copy Markdown
Contributor

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Jan 20, 2026

Copy link
Copy Markdown
Contributor
✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 5

🤖 Fix all issues with AI agents
In `@packages/components/src/molecules/FileUploadCard/FileUploadCard.tsx`:
- Around line 108-111: The simulated upload setTimeout in FileUploadCard
currently calls setUploadState('completed') without cleanup, risking state
updates after unmount; modify the component to store the timer id (e.g., in a
ref) and set the timeout inside a useEffect that returns a cleanup which clears
the timeout, or cancel the timer in an existing unmount effect so setUploadState
is never called after the component unmounts.

In `@packages/components/src/molecules/FileUploadStatus/FileUploadStatus.tsx`:
- Around line 202-233: The action buttons in FileUploadStatus (the Search button
with data-fs-file-upload-status-search-button, and the Download template and
Select file buttons with data-fs-file-upload-status-download-button and
data-fs-file-upload-status-select-button) are missing an explicit type and will
default to submit when rendered inside a form; update each Button element
rendered under state === 'completed' (onSearch) and state === 'error'
(onDownloadTemplate, onSelectFile) to include type="button" so they do not
trigger form submission.

In `@packages/storybook/stories/fileupload.stories.tsx`:
- Around line 133-143: The handleDownloadTemplate function currently triggers a
download by clicking a detached anchor which can be ignored by some browsers
(e.g., Firefox); modify handleDownloadTemplate to append the created <a> element
to document.body before calling a.click(), then remove the anchor after the
click and revoke the object URL (keep creating the Blob, setting
a.href/a.download as-is) to improve cross-browser reliability.

In `@packages/ui/src/components/molecules/SearchInputField/styles.scss`:
- Around line 109-122: There is a duplicate CSS rule for the selector
[data-fs-search-input-field-input]; remove the second block (the one that sets
padding-right) and consolidate any unique properties (background-color,
transition, height, and the media query) into the first definition so the rule
uses padding-inline-end for RTL support; ensure the merged rule retains the
media query (`@include` media("<notebook") { border: 0; }) and the
transition/background-color/height settings from the duplicate block.
- Around line 69-78: Remove the orphaned CSS properties block (the standalone
rules: right, display, gap, align-items and the media query) that are present
without a selector; these are duplicate/leftover and will break SCSS. Locate the
stray block near the end of the file and delete it, keeping the existing valid
styling defined under the [data-fs-search-input-field-actions] selector (which
already defines the same rules), and ensure only the selector-scoped styles
remain.
🧹 Nitpick comments (8)
packages/core/src/components/search/SearchInput/SearchInput.tsx (2)

115-120: Incomplete file upload handling.

The handleFileSelect function sets state but has a TODO indicating the actual file upload logic is not implemented. The commented-out setFileUploadVisible(false) suggests uncertainty about the intended behavior.

Consider completing the implementation or tracking this as a follow-up task.

Would you like me to open an issue to track the implementation of the actual file upload logic?


212-219: Redundant isOpen prop condition.

The isOpen prop evaluates to isUploadOpen || hasFile || fileUploadVisible, but since this block only renders when fileUploadVisible is true, isOpen will always be true. The isUploadOpen and hasFile conditions have no effect here.

Simplify the condition
            {fileUploadVisible && (
              <FileUploadCard
-               isOpen={isUploadOpen || hasFile || fileUploadVisible}
+               isOpen={fileUploadVisible}
                onDismiss={() => setFileUploadVisible(false)}
                onFileSelect={handleFileSelect}
                onDownloadTemplate={handleDownloadTemplate}
              />
            )}

Or consider removing isUploadOpen and hasFile states if they're not needed elsewhere.

packages/ui/src/components/molecules/FileUploadStatus/styles.scss (2)

13-15: Hardcoded colors reduce theming flexibility.

The icon background colors use hardcoded hex values (#08a822, #d31a15) instead of design tokens. This makes it harder to maintain consistent theming across the application.

Consider using design tokens
-  --fs-file-upload-status-icon-bg-completed: `#08a822`;
-  --fs-file-upload-status-icon-bg-uploading: `#08a822`;
-  --fs-file-upload-status-icon-bg-error: `#d31a15`;
+  --fs-file-upload-status-icon-bg-completed: var(--fs-color-success, `#08a822`);
+  --fs-file-upload-status-icon-bg-uploading: var(--fs-color-success, `#08a822`);
+  --fs-file-upload-status-icon-bg-error: var(--fs-color-danger, `#d31a15`);

This applies to other hardcoded colors in this file as well (lines 48-49, 198-200, 220-226).


29-29: Remove commented-out code.

The commented height: 188px; should either be removed or documented if it serves as a reference.

packages/ui/src/components/molecules/FileUploadCard/styles.scss (2)

49-51: Use rem units for fixed height.

The fixed height of 285px should be converted to rem units for consistency with the design system. Based on past review comments, pixel units should be avoided except in stories.

Convert to rem
  &[data-fs-file-upload-card-open="true"] {
-   height: 285px;
-   max-height: 285px;
+   height: 17.8125rem;
+   max-height: 17.8125rem;
    pointer-events: auto;

17-18: Hardcoded colors reduce theming flexibility.

The badge and shadow colors use hardcoded hex values. Consider using design tokens for better maintainability and theming support.

Consider using design tokens
-  --fs-file-upload-card-badge-bg-color:         `#0366dd`;
-  --fs-file-upload-card-shadow-color:           `#bfdbfe`;
+  --fs-file-upload-card-badge-bg-color:         var(--fs-color-primary, `#0366dd`);
+  --fs-file-upload-card-shadow-color:           var(--fs-color-primary-bkg-light, `#bfdbfe`);

This pattern applies to other hardcoded colors in this file (lines 161, 189-196).

packages/components/src/molecules/FileUploadCard/FileUploadCard.tsx (1)

92-117: Duplicate file processing logic.

handleFileChange and handleDrop contain nearly identical file processing logic (validation, state updates, simulated upload). Extract this into a shared helper function.

Extract shared file processing logic
+  const processFile = (file: File, files: File[]) => {
+    setSelectedFile(file)
+
+    if (!isValidFileType(file)) {
+      setUploadState('error')
+      setErrorType('unsupported')
+      return
+    }
+
+    setUploadState('uploading')
+    setErrorType(undefined)
+
+    // Simulate upload process
+    setTimeout(() => {
+      setUploadState('completed')
+    }, 2000)
+
+    onFileSelect?.(files)
+  }
+
   const handleFileChange = (e: ChangeEvent<HTMLInputElement>) => {
     const files = Array.from(e.target.files || [])
     if (files.length > 0) {
-      const file = files[0]
-      setSelectedFile(file)
-
-      // Validate file type
-      if (!isValidFileType(file)) {
-        setUploadState('error')
-        setErrorType('unsupported')
-        return
-      }
-
-      setUploadState('uploading')
-      setErrorType(undefined)
-
-      // Simulate upload process
-      setTimeout(() => {
-        setUploadState('completed')
-      }, 2000)
-
-      if (onFileSelect) {
-        onFileSelect(files)
-      }
+      processFile(files[0], files)
     }
   }

Apply similar refactoring to handleDrop.

Also applies to: 130-160

packages/storybook/stories/fileupload.stories.tsx (1)

1-7: Use the public type export instead of a deep dist import.

Deep imports can break with package refactors or alternate build outputs. Prefer the root export if available; otherwise consider exporting FileUploadErrorType from the package index.

🔧 Proposed change
-import type { FileUploadErrorType } from '@faststore/components/dist/esm/molecules/FileUploadStatus'
+import type { FileUploadErrorType } from '@faststore/components'

@ArthurTriis1 ArthurTriis1 self-assigned this Feb 5, 2026
@lariciamota
lariciamota merged commit 6a8e751 into vtex:feat/quick-order-by-file-feature-branch Feb 6, 2026
1 check passed
ArthurTriis1 added a commit that referenced this pull request Feb 10, 2026
Tasks
[https://vtex-dev.atlassian.net/jira/software/projects/BE/boards/2868?selectedIssue=BE-69](https://vtex-dev.atlassian.net/jira/software/projects/BE/boards/2868?selectedIssue=BE-69)
[BE-70](https://vtex-dev.atlassian.net/jira/software/projects/BE/boards/2868?selectedIssue=BE-70)

Here's the completed PR description in English:

- Introduced `FileUploadCard` for file selection and upload
functionality, including drag-and-drop support.
- Added `FileUploadStatus` to display upload progress and error
handling.
- Updated index files to export new components and types.
- Enhanced `SearchInputField` to include an attachment button that
triggers the file upload card.
- Added styles for both new components to ensure proper UI integration.

## What's the purpose of this pull request?

This PR introduces a new file upload feature that allows users to
perform bulk searches by uploading CSV files. The feature provides a
modern, user-friendly interface with drag-and-drop support, real-time
upload status tracking, and comprehensive error handling to guide users
through the file upload process.

## How it works?

### FileUploadCard Component
- **File Selection**: Users can either click "Select file" button or
drag-and-drop files into the dropzone
- **Drag & Drop**: Visual feedback with border color and background
changes when dragging files
- **File Input**: Hidden file input that's always present in the DOM to
ensure file picker works in all states
- **Download Template**: Provides a CSV template download option for
users who need guidance on file format
- **Validation**: Only accepts CSV files (`.csv` extension)
- **States**: Manages upload states (uploading, completed, error) with
appropriate UI updates

### FileUploadStatus Component
Displays the current status of the uploaded file with three distinct
states:

1. **Uploading State**
   - Shows spinning CircleNotch icon
   - Displays "Uploading your file..." message
   - Shows filename

2. **Completed State**
   - Shows Table icon in green background
   - Displays filename and file size
   - Shows "Search" button to proceed with the uploaded file

3. **Error State**
   - Shows WarningOctagon icon in red background
- Special styling: light pink background (#FDF6F5) with red border
(#FFDFD9)
   - Displays error title and description in two lines
   - Shows two action buttons: "Download template" and "Select file"

### Error Types
The component handles six different error scenarios:
- **Unsupported**: Wrong file type (non-CSV files)
- **Unreadable**: File can't be parsed or is corrupted
- **Invalid Structure**: Missing headers or incorrect columns
- **Empty**: File has no data
- **Too Large**: File exceeds size limit
- **Unexpected**: Generic error for unknown issues

### Integration
- Added attachment icon button to `SearchInputField` component
- Clicking the attachment button toggles the `FileUploadCard` visibility
- Card appears as a dropdown below the search input
- Smooth animations for show/hide transitions

### Key Features
- **File validation**: Automatically checks file type on selection/drop
- **Error recovery**: Users can easily select a new file or download
template when errors occur
- **Responsive design**: Components adapt to container width
- **Accessibility**: Proper ARIA labels and keyboard navigation support
- **Visual feedback**: Icons, colors, and animations provide clear
status indication

## How to test it?

### Basic File Upload Flow
1. Navigate to a page with the search input
2. Click the attachment icon button (Paperclip icon)
3. The FileUploadCard should appear below the search input
4. Click "Select file" or drag-and-drop a CSV file
5. Observe the uploading state with spinning icon
6. After 2 seconds, see the completed state with "Search" button
7. Click the X button to remove the file and return to initial state

### Drag and Drop
1. Open the FileUploadCard
2. Drag a CSV file over the dropzone
3. Observe the visual feedback (border and background color change)
4. Drop the file to upload

### Error Handling - Unsupported File Type
1. Open the FileUploadCard
2. Select or drop a non-CSV file (e.g., .txt, .pdf, .xlsx)
3. Observe error state with red icon and pink background
4. Read error message: "Unsupported file type." / "Upload a CSV or use
the template provided."
5. Click "Download template" to get a sample CSV
6. Click "Select file" to try uploading again

### File Removal
1. Upload a file successfully
2. Click the X button in the top-right of the file status
3. Component should return to initial dropzone state


### Starters Deploy Preview

<!-- Add your deploy preview link here -->

## References

- [Phosphor Icons](https://phosphoricons.com/) - Icon library used for
UI elements
- [Conventional Commits](https://www.conventionalcommits.org/) - Commit
message format

## Checklist

<em>You may erase this after checking them all 😉</em>

**PR Title and Commit Messages**

- [ ] PR title and commit messages follow the [Conventional
Commits](https://www.conventionalcommits.org/en/v1.0.0/) specification
- Available prefixes: `feat`, `fix`, `chore`, `docs`, `style`,
`refactor`, `ci` and `test`

**PR Description**

- [ ] Added a label according to the PR goal - `breaking change`, `bug`,
`contributing`, `performance`, `documentation`..

**Dependencies**

- [ ] Committed the `pnpm-lock.yaml` file when there were changes to the
packages

**Documentation**

- [ ] PR description


[BE-70]:
https://vtex-dev.atlassian.net/browse/BE-70?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

## Summary by CodeRabbit

## Release Notes

* **New Features**
* File upload card component enabling file selection via drag-and-drop
or file picker with status indicators
* File upload status component displaying upload progress, success, and
error states with customizable error handling
  * Attachment button in search input for quick file upload access

* **Chores**
  * Added component styling and Storybook demonstrations

<sub>✏️ Tip: You can customize this high-level summary in your review
settings.</sub>

<!-- end of auto-generated comment: release notes by coderabbit.ai -->

---------

Co-authored-by: Bruna Santos <[email protected]>
Co-authored-by: Arthur Andrade <[email protected]>
ataideverton pushed a commit that referenced this pull request Feb 23, 2026
Tasks
[https://vtex-dev.atlassian.net/jira/software/projects/BE/boards/2868?selectedIssue=BE-69](https://vtex-dev.atlassian.net/jira/software/projects/BE/boards/2868?selectedIssue=BE-69)
[BE-70](https://vtex-dev.atlassian.net/jira/software/projects/BE/boards/2868?selectedIssue=BE-70)

Here's the completed PR description in English:

- Introduced `FileUploadCard` for file selection and upload
functionality, including drag-and-drop support.
- Added `FileUploadStatus` to display upload progress and error
handling.
- Updated index files to export new components and types.
- Enhanced `SearchInputField` to include an attachment button that
triggers the file upload card.
- Added styles for both new components to ensure proper UI integration.

## What's the purpose of this pull request?

This PR introduces a new file upload feature that allows users to
perform bulk searches by uploading CSV files. The feature provides a
modern, user-friendly interface with drag-and-drop support, real-time
upload status tracking, and comprehensive error handling to guide users
through the file upload process.

## How it works?

### FileUploadCard Component
- **File Selection**: Users can either click "Select file" button or
drag-and-drop files into the dropzone
- **Drag & Drop**: Visual feedback with border color and background
changes when dragging files
- **File Input**: Hidden file input that's always present in the DOM to
ensure file picker works in all states
- **Download Template**: Provides a CSV template download option for
users who need guidance on file format
- **Validation**: Only accepts CSV files (`.csv` extension)
- **States**: Manages upload states (uploading, completed, error) with
appropriate UI updates

### FileUploadStatus Component
Displays the current status of the uploaded file with three distinct
states:

1. **Uploading State**
   - Shows spinning CircleNotch icon
   - Displays "Uploading your file..." message
   - Shows filename

2. **Completed State**
   - Shows Table icon in green background
   - Displays filename and file size
   - Shows "Search" button to proceed with the uploaded file

3. **Error State**
   - Shows WarningOctagon icon in red background
- Special styling: light pink background (#FDF6F5) with red border
(#FFDFD9)
   - Displays error title and description in two lines
   - Shows two action buttons: "Download template" and "Select file"

### Error Types
The component handles six different error scenarios:
- **Unsupported**: Wrong file type (non-CSV files)
- **Unreadable**: File can't be parsed or is corrupted
- **Invalid Structure**: Missing headers or incorrect columns
- **Empty**: File has no data
- **Too Large**: File exceeds size limit
- **Unexpected**: Generic error for unknown issues

### Integration
- Added attachment icon button to `SearchInputField` component
- Clicking the attachment button toggles the `FileUploadCard` visibility
- Card appears as a dropdown below the search input
- Smooth animations for show/hide transitions

### Key Features
- **File validation**: Automatically checks file type on selection/drop
- **Error recovery**: Users can easily select a new file or download
template when errors occur
- **Responsive design**: Components adapt to container width
- **Accessibility**: Proper ARIA labels and keyboard navigation support
- **Visual feedback**: Icons, colors, and animations provide clear
status indication

## How to test it?

### Basic File Upload Flow
1. Navigate to a page with the search input
2. Click the attachment icon button (Paperclip icon)
3. The FileUploadCard should appear below the search input
4. Click "Select file" or drag-and-drop a CSV file
5. Observe the uploading state with spinning icon
6. After 2 seconds, see the completed state with "Search" button
7. Click the X button to remove the file and return to initial state

### Drag and Drop
1. Open the FileUploadCard
2. Drag a CSV file over the dropzone
3. Observe the visual feedback (border and background color change)
4. Drop the file to upload

### Error Handling - Unsupported File Type
1. Open the FileUploadCard
2. Select or drop a non-CSV file (e.g., .txt, .pdf, .xlsx)
3. Observe error state with red icon and pink background
4. Read error message: "Unsupported file type." / "Upload a CSV or use
the template provided."
5. Click "Download template" to get a sample CSV
6. Click "Select file" to try uploading again

### File Removal
1. Upload a file successfully
2. Click the X button in the top-right of the file status
3. Component should return to initial dropzone state


### Starters Deploy Preview

<!-- Add your deploy preview link here -->

## References

- [Phosphor Icons](https://phosphoricons.com/) - Icon library used for
UI elements
- [Conventional Commits](https://www.conventionalcommits.org/) - Commit
message format

## Checklist

<em>You may erase this after checking them all 😉</em>

**PR Title and Commit Messages**

- [ ] PR title and commit messages follow the [Conventional
Commits](https://www.conventionalcommits.org/en/v1.0.0/) specification
- Available prefixes: `feat`, `fix`, `chore`, `docs`, `style`,
`refactor`, `ci` and `test`

**PR Description**

- [ ] Added a label according to the PR goal - `breaking change`, `bug`,
`contributing`, `performance`, `documentation`..

**Dependencies**

- [ ] Committed the `pnpm-lock.yaml` file when there were changes to the
packages

**Documentation**

- [ ] PR description


[BE-70]:
https://vtex-dev.atlassian.net/browse/BE-70?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

## Summary by CodeRabbit

## Release Notes

* **New Features**
* File upload card component enabling file selection via drag-and-drop
or file picker with status indicators
* File upload status component displaying upload progress, success, and
error states with customizable error handling
  * Attachment button in search input for quick file upload access

* **Chores**
  * Added component styling and Storybook demonstrations

<sub>✏️ Tip: You can customize this high-level summary in your review
settings.</sub>

<!-- end of auto-generated comment: release notes by coderabbit.ai -->

---------

Co-authored-by: Bruna Santos <[email protected]>
Co-authored-by: Arthur Andrade <[email protected]>
ataideverton pushed a commit that referenced this pull request Feb 23, 2026
Tasks
[https://vtex-dev.atlassian.net/jira/software/projects/BE/boards/2868?selectedIssue=BE-69](https://vtex-dev.atlassian.net/jira/software/projects/BE/boards/2868?selectedIssue=BE-69)
[BE-70](https://vtex-dev.atlassian.net/jira/software/projects/BE/boards/2868?selectedIssue=BE-70)

Here's the completed PR description in English:

- Introduced `FileUploadCard` for file selection and upload
functionality, including drag-and-drop support.
- Added `FileUploadStatus` to display upload progress and error
handling.
- Updated index files to export new components and types.
- Enhanced `SearchInputField` to include an attachment button that
triggers the file upload card.
- Added styles for both new components to ensure proper UI integration.

This PR introduces a new file upload feature that allows users to
perform bulk searches by uploading CSV files. The feature provides a
modern, user-friendly interface with drag-and-drop support, real-time
upload status tracking, and comprehensive error handling to guide users
through the file upload process.

- **File Selection**: Users can either click "Select file" button or
drag-and-drop files into the dropzone
- **Drag & Drop**: Visual feedback with border color and background
changes when dragging files
- **File Input**: Hidden file input that's always present in the DOM to
ensure file picker works in all states
- **Download Template**: Provides a CSV template download option for
users who need guidance on file format
- **Validation**: Only accepts CSV files (`.csv` extension)
- **States**: Manages upload states (uploading, completed, error) with
appropriate UI updates

Displays the current status of the uploaded file with three distinct
states:

1. **Uploading State**
   - Shows spinning CircleNotch icon
   - Displays "Uploading your file..." message
   - Shows filename

2. **Completed State**
   - Shows Table icon in green background
   - Displays filename and file size
   - Shows "Search" button to proceed with the uploaded file

3. **Error State**
   - Shows WarningOctagon icon in red background
- Special styling: light pink background (#FDF6F5) with red border
(#FFDFD9)
   - Displays error title and description in two lines
   - Shows two action buttons: "Download template" and "Select file"

The component handles six different error scenarios:
- **Unsupported**: Wrong file type (non-CSV files)
- **Unreadable**: File can't be parsed or is corrupted
- **Invalid Structure**: Missing headers or incorrect columns
- **Empty**: File has no data
- **Too Large**: File exceeds size limit
- **Unexpected**: Generic error for unknown issues

- Added attachment icon button to `SearchInputField` component
- Clicking the attachment button toggles the `FileUploadCard` visibility
- Card appears as a dropdown below the search input
- Smooth animations for show/hide transitions

- **File validation**: Automatically checks file type on selection/drop
- **Error recovery**: Users can easily select a new file or download
template when errors occur
- **Responsive design**: Components adapt to container width
- **Accessibility**: Proper ARIA labels and keyboard navigation support
- **Visual feedback**: Icons, colors, and animations provide clear
status indication

1. Navigate to a page with the search input
2. Click the attachment icon button (Paperclip icon)
3. The FileUploadCard should appear below the search input
4. Click "Select file" or drag-and-drop a CSV file
5. Observe the uploading state with spinning icon
6. After 2 seconds, see the completed state with "Search" button
7. Click the X button to remove the file and return to initial state

1. Open the FileUploadCard
2. Drag a CSV file over the dropzone
3. Observe the visual feedback (border and background color change)
4. Drop the file to upload

1. Open the FileUploadCard
2. Select or drop a non-CSV file (e.g., .txt, .pdf, .xlsx)
3. Observe error state with red icon and pink background
4. Read error message: "Unsupported file type." / "Upload a CSV or use
the template provided."
5. Click "Download template" to get a sample CSV
6. Click "Select file" to try uploading again

1. Upload a file successfully
2. Click the X button in the top-right of the file status
3. Component should return to initial dropzone state

<!-- Add your deploy preview link here -->

- [Phosphor Icons](https://phosphoricons.com/) - Icon library used for
UI elements
- [Conventional Commits](https://www.conventionalcommits.org/) - Commit
message format

<em>You may erase this after checking them all 😉</em>

**PR Title and Commit Messages**

- [ ] PR title and commit messages follow the [Conventional
Commits](https://www.conventionalcommits.org/en/v1.0.0/) specification
- Available prefixes: `feat`, `fix`, `chore`, `docs`, `style`,
`refactor`, `ci` and `test`

**PR Description**

- [ ] Added a label according to the PR goal - `breaking change`, `bug`,
`contributing`, `performance`, `documentation`..

**Dependencies**

- [ ] Committed the `pnpm-lock.yaml` file when there were changes to the
packages

**Documentation**

- [ ] PR description

[BE-70]:
https://vtex-dev.atlassian.net/browse/BE-70?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

* **New Features**
* File upload card component enabling file selection via drag-and-drop
or file picker with status indicators
* File upload status component displaying upload progress, success, and
error states with customizable error handling
  * Attachment button in search input for quick file upload access

* **Chores**
  * Added component styling and Storybook demonstrations

<sub>✏️ Tip: You can customize this high-level summary in your review
settings.</sub>

<!-- end of auto-generated comment: release notes by coderabbit.ai -->

---------

Co-authored-by: Bruna Santos <[email protected]>
Co-authored-by: Arthur Andrade <[email protected]>
ataideverton pushed a commit that referenced this pull request Feb 23, 2026
Tasks
[https://vtex-dev.atlassian.net/jira/software/projects/BE/boards/2868?selectedIssue=BE-69](https://vtex-dev.atlassian.net/jira/software/projects/BE/boards/2868?selectedIssue=BE-69)
[BE-70](https://vtex-dev.atlassian.net/jira/software/projects/BE/boards/2868?selectedIssue=BE-70)

Here's the completed PR description in English:

- Introduced `FileUploadCard` for file selection and upload
functionality, including drag-and-drop support.
- Added `FileUploadStatus` to display upload progress and error
handling.
- Updated index files to export new components and types.
- Enhanced `SearchInputField` to include an attachment button that
triggers the file upload card.
- Added styles for both new components to ensure proper UI integration.

## What's the purpose of this pull request?

This PR introduces a new file upload feature that allows users to
perform bulk searches by uploading CSV files. The feature provides a
modern, user-friendly interface with drag-and-drop support, real-time
upload status tracking, and comprehensive error handling to guide users
through the file upload process.

## How it works?

### FileUploadCard Component
- **File Selection**: Users can either click "Select file" button or
drag-and-drop files into the dropzone
- **Drag & Drop**: Visual feedback with border color and background
changes when dragging files
- **File Input**: Hidden file input that's always present in the DOM to
ensure file picker works in all states
- **Download Template**: Provides a CSV template download option for
users who need guidance on file format
- **Validation**: Only accepts CSV files (`.csv` extension)
- **States**: Manages upload states (uploading, completed, error) with
appropriate UI updates

### FileUploadStatus Component
Displays the current status of the uploaded file with three distinct
states:

1. **Uploading State**
   - Shows spinning CircleNotch icon
   - Displays "Uploading your file..." message
   - Shows filename

2. **Completed State**
   - Shows Table icon in green background
   - Displays filename and file size
   - Shows "Search" button to proceed with the uploaded file

3. **Error State**
   - Shows WarningOctagon icon in red background
- Special styling: light pink background (#FDF6F5) with red border
(#FFDFD9)
   - Displays error title and description in two lines
   - Shows two action buttons: "Download template" and "Select file"

### Error Types
The component handles six different error scenarios:
- **Unsupported**: Wrong file type (non-CSV files)
- **Unreadable**: File can't be parsed or is corrupted
- **Invalid Structure**: Missing headers or incorrect columns
- **Empty**: File has no data
- **Too Large**: File exceeds size limit
- **Unexpected**: Generic error for unknown issues

### Integration
- Added attachment icon button to `SearchInputField` component
- Clicking the attachment button toggles the `FileUploadCard` visibility
- Card appears as a dropdown below the search input
- Smooth animations for show/hide transitions

### Key Features
- **File validation**: Automatically checks file type on selection/drop
- **Error recovery**: Users can easily select a new file or download
template when errors occur
- **Responsive design**: Components adapt to container width
- **Accessibility**: Proper ARIA labels and keyboard navigation support
- **Visual feedback**: Icons, colors, and animations provide clear
status indication

## How to test it?

### Basic File Upload Flow
1. Navigate to a page with the search input
2. Click the attachment icon button (Paperclip icon)
3. The FileUploadCard should appear below the search input
4. Click "Select file" or drag-and-drop a CSV file
5. Observe the uploading state with spinning icon
6. After 2 seconds, see the completed state with "Search" button
7. Click the X button to remove the file and return to initial state

### Drag and Drop
1. Open the FileUploadCard
2. Drag a CSV file over the dropzone
3. Observe the visual feedback (border and background color change)
4. Drop the file to upload

### Error Handling - Unsupported File Type
1. Open the FileUploadCard
2. Select or drop a non-CSV file (e.g., .txt, .pdf, .xlsx)
3. Observe error state with red icon and pink background
4. Read error message: "Unsupported file type." / "Upload a CSV or use
the template provided."
5. Click "Download template" to get a sample CSV
6. Click "Select file" to try uploading again

### File Removal
1. Upload a file successfully
2. Click the X button in the top-right of the file status
3. Component should return to initial dropzone state


### Starters Deploy Preview

<!-- Add your deploy preview link here -->

## References

- [Phosphor Icons](https://phosphoricons.com/) - Icon library used for
UI elements
- [Conventional Commits](https://www.conventionalcommits.org/) - Commit
message format

## Checklist

<em>You may erase this after checking them all 😉</em>

**PR Title and Commit Messages**

- [ ] PR title and commit messages follow the [Conventional
Commits](https://www.conventionalcommits.org/en/v1.0.0/) specification
- Available prefixes: `feat`, `fix`, `chore`, `docs`, `style`,
`refactor`, `ci` and `test`

**PR Description**

- [ ] Added a label according to the PR goal - `breaking change`, `bug`,
`contributing`, `performance`, `documentation`..

**Dependencies**

- [ ] Committed the `pnpm-lock.yaml` file when there were changes to the
packages

**Documentation**

- [ ] PR description


[BE-70]:
https://vtex-dev.atlassian.net/browse/BE-70?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

## Summary by CodeRabbit

## Release Notes

* **New Features**
* File upload card component enabling file selection via drag-and-drop
or file picker with status indicators
* File upload status component displaying upload progress, success, and
error states with customizable error handling
  * Attachment button in search input for quick file upload access

* **Chores**
  * Added component styling and Storybook demonstrations

<sub>✏️ Tip: You can customize this high-level summary in your review
settings.</sub>

<!-- end of auto-generated comment: release notes by coderabbit.ai -->

---------

Co-authored-by: Bruna Santos <[email protected]>
Co-authored-by: Arthur Andrade <[email protected]>
ataideverton pushed a commit that referenced this pull request Feb 24, 2026
Tasks
[https://vtex-dev.atlassian.net/jira/software/projects/BE/boards/2868?selectedIssue=BE-69](https://vtex-dev.atlassian.net/jira/software/projects/BE/boards/2868?selectedIssue=BE-69)
[BE-70](https://vtex-dev.atlassian.net/jira/software/projects/BE/boards/2868?selectedIssue=BE-70)

Here's the completed PR description in English:

- Introduced `FileUploadCard` for file selection and upload
functionality, including drag-and-drop support.
- Added `FileUploadStatus` to display upload progress and error
handling.
- Updated index files to export new components and types.
- Enhanced `SearchInputField` to include an attachment button that
triggers the file upload card.
- Added styles for both new components to ensure proper UI integration.

This PR introduces a new file upload feature that allows users to
perform bulk searches by uploading CSV files. The feature provides a
modern, user-friendly interface with drag-and-drop support, real-time
upload status tracking, and comprehensive error handling to guide users
through the file upload process.

- **File Selection**: Users can either click "Select file" button or
drag-and-drop files into the dropzone
- **Drag & Drop**: Visual feedback with border color and background
changes when dragging files
- **File Input**: Hidden file input that's always present in the DOM to
ensure file picker works in all states
- **Download Template**: Provides a CSV template download option for
users who need guidance on file format
- **Validation**: Only accepts CSV files (`.csv` extension)
- **States**: Manages upload states (uploading, completed, error) with
appropriate UI updates

Displays the current status of the uploaded file with three distinct
states:

1. **Uploading State**
   - Shows spinning CircleNotch icon
   - Displays "Uploading your file..." message
   - Shows filename

2. **Completed State**
   - Shows Table icon in green background
   - Displays filename and file size
   - Shows "Search" button to proceed with the uploaded file

3. **Error State**
   - Shows WarningOctagon icon in red background
- Special styling: light pink background (#FDF6F5) with red border
(#FFDFD9)
   - Displays error title and description in two lines
   - Shows two action buttons: "Download template" and "Select file"

The component handles six different error scenarios:
- **Unsupported**: Wrong file type (non-CSV files)
- **Unreadable**: File can't be parsed or is corrupted
- **Invalid Structure**: Missing headers or incorrect columns
- **Empty**: File has no data
- **Too Large**: File exceeds size limit
- **Unexpected**: Generic error for unknown issues

- Added attachment icon button to `SearchInputField` component
- Clicking the attachment button toggles the `FileUploadCard` visibility
- Card appears as a dropdown below the search input
- Smooth animations for show/hide transitions

- **File validation**: Automatically checks file type on selection/drop
- **Error recovery**: Users can easily select a new file or download
template when errors occur
- **Responsive design**: Components adapt to container width
- **Accessibility**: Proper ARIA labels and keyboard navigation support
- **Visual feedback**: Icons, colors, and animations provide clear
status indication

1. Navigate to a page with the search input
2. Click the attachment icon button (Paperclip icon)
3. The FileUploadCard should appear below the search input
4. Click "Select file" or drag-and-drop a CSV file
5. Observe the uploading state with spinning icon
6. After 2 seconds, see the completed state with "Search" button
7. Click the X button to remove the file and return to initial state

1. Open the FileUploadCard
2. Drag a CSV file over the dropzone
3. Observe the visual feedback (border and background color change)
4. Drop the file to upload

1. Open the FileUploadCard
2. Select or drop a non-CSV file (e.g., .txt, .pdf, .xlsx)
3. Observe error state with red icon and pink background
4. Read error message: "Unsupported file type." / "Upload a CSV or use
the template provided."
5. Click "Download template" to get a sample CSV
6. Click "Select file" to try uploading again

1. Upload a file successfully
2. Click the X button in the top-right of the file status
3. Component should return to initial dropzone state

<!-- Add your deploy preview link here -->

- [Phosphor Icons](https://phosphoricons.com/) - Icon library used for
UI elements
- [Conventional Commits](https://www.conventionalcommits.org/) - Commit
message format

<em>You may erase this after checking them all 😉</em>

**PR Title and Commit Messages**

- [ ] PR title and commit messages follow the [Conventional
Commits](https://www.conventionalcommits.org/en/v1.0.0/) specification
- Available prefixes: `feat`, `fix`, `chore`, `docs`, `style`,
`refactor`, `ci` and `test`

**PR Description**

- [ ] Added a label according to the PR goal - `breaking change`, `bug`,
`contributing`, `performance`, `documentation`..

**Dependencies**

- [ ] Committed the `pnpm-lock.yaml` file when there were changes to the
packages

**Documentation**

- [ ] PR description

[BE-70]:
https://vtex-dev.atlassian.net/browse/BE-70?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

* **New Features**
* File upload card component enabling file selection via drag-and-drop
or file picker with status indicators
* File upload status component displaying upload progress, success, and
error states with customizable error handling
  * Attachment button in search input for quick file upload access

* **Chores**
  * Added component styling and Storybook demonstrations

<sub>✏️ Tip: You can customize this high-level summary in your review
settings.</sub>

<!-- end of auto-generated comment: release notes by coderabbit.ai -->

---------

Co-authored-by: Bruna Santos <[email protected]>
Co-authored-by: Arthur Andrade <[email protected]>
lariciamota pushed a commit that referenced this pull request Feb 25, 2026
## What's the purpose of this pull request?

This pull request introduces a new file upload and CSV parsing feature
to the `components` package, including reusable hooks and UI components.
The main changes are the addition of a `FileUploadCard` component for
uploading files, a `useCSVParser` hook for parsing CSV files in a web
worker, and a `useFileUpload` hook for managing file upload errors and
validation. These new utilities are exported for use in other parts of
the application.

This PR it was created from #3109 

## How it works?

**New hooks and utilities:**

* Added `useCSVParser` hook for parsing CSV files in a web worker, with
error handling and CSV template generation.
* Added `useFileUpload` hook to manage file upload errors, validation,
and rejection reasons.
* Exported new hooks from the hooks index for easier consumption.
* Added type exports for CSV parsing to the main index file.

**New UI components:**

* Added `FileUploadCard` component for file selection, drag-and-drop,
and template download, with error state and file validation.
* Added exports for `FileUploadCard` and `FileUploadStatus` components
and their types.

**Dependency updates:**

* Added `papaparse` to dependencies for running CSV parsing in a web
worker.

## How to test it?

![Nov-12-2025
14-49-47](https://github.com/user-attachments/assets/6aaf4cbd-4b2e-45ea-9a36-1278b8c2dc88)


### Starters Deploy Preview

<!--- Add a link to a deploy preview from `starter.store` with this
branch being used. --->

<!--- Tip: You can get an installable version of this branch from the
CodeSandbox generated when this PR is created. --->

## References

- [Card](https://vtex-dev.atlassian.net/browse/BE-71)
-
[Figma](https://www.figma.com/design/YjU7SKqgLar3oxCP3SwagX/B2B-%C2%B7-Order-entry?node-id=53-3753&t=khUOMzHdN5djYyKo-0)

## Checklist

<em>You may erase this after checking them all 😉</em>

**PR Title and Commit Messages**

- [x] PR title and commit messages follow the [Conventional
Commits](https://www.conventionalcommits.org/en/v1.0.0/) specification
- Available prefixes: `feat`, `fix`, `chore`, `docs`, `style`,
`refactor`, `ci` and `test`

**PR Description**

- [ ] Added a label according to the PR goal - `breaking change`, `bug`,
`contributing`, `performance`, `documentation`..

**Dependencies**

- [ ] Committed the `pnpm-lock.yaml` file when there were changes to the
packages

**Documentation**

- [ ] PR description
- [ ] For documentation changes, ping `@Mariana-Caetano` to review and
update (Or submit a doc request)


<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

* **New Features**
* CSV parsing with worker-backed parsing, template generation, Dropzone
upload UI and an Upload File dropdown; file-based search integration.

* **Enhancements**
* New file upload hooks, FileUploadCard and FileUploadStatus props for
richer status, customizable labels, and improved file name/size
formatting.
  * Template download and clearer upload error handling.

* **Refactor**
* Tightened public type signatures and expanded component/hook exports.

* **Style**
  * Added Dropzone and upload-related styles and Storybook stories.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->

---------

Co-authored-by: Giuliana Rigaud <[email protected]>
Co-authored-by: renato <[email protected]>
Co-authored-by: Bruna Santos <[email protected]>
Co-authored-by: Arthur Andrade <[email protected]>
Co-authored-by: BrunaCubos <[email protected]>
Co-authored-by: Bruna Santos <[email protected]>
Co-authored-by: Cursor <[email protected]>
Co-authored-by: Everton Ataide <[email protected]>
ataideverton pushed a commit that referenced this pull request Mar 4, 2026
Tasks
[https://vtex-dev.atlassian.net/jira/software/projects/BE/boards/2868?selectedIssue=BE-69](https://vtex-dev.atlassian.net/jira/software/projects/BE/boards/2868?selectedIssue=BE-69)
[BE-70](https://vtex-dev.atlassian.net/jira/software/projects/BE/boards/2868?selectedIssue=BE-70)

Here's the completed PR description in English:

- Introduced `FileUploadCard` for file selection and upload
functionality, including drag-and-drop support.
- Added `FileUploadStatus` to display upload progress and error
handling.
- Updated index files to export new components and types.
- Enhanced `SearchInputField` to include an attachment button that
triggers the file upload card.
- Added styles for both new components to ensure proper UI integration.

## What's the purpose of this pull request?

This PR introduces a new file upload feature that allows users to
perform bulk searches by uploading CSV files. The feature provides a
modern, user-friendly interface with drag-and-drop support, real-time
upload status tracking, and comprehensive error handling to guide users
through the file upload process.

## How it works?

### FileUploadCard Component
- **File Selection**: Users can either click "Select file" button or
drag-and-drop files into the dropzone
- **Drag & Drop**: Visual feedback with border color and background
changes when dragging files
- **File Input**: Hidden file input that's always present in the DOM to
ensure file picker works in all states
- **Download Template**: Provides a CSV template download option for
users who need guidance on file format
- **Validation**: Only accepts CSV files (`.csv` extension)
- **States**: Manages upload states (uploading, completed, error) with
appropriate UI updates

### FileUploadStatus Component
Displays the current status of the uploaded file with three distinct
states:

1. **Uploading State**
   - Shows spinning CircleNotch icon
   - Displays "Uploading your file..." message
   - Shows filename

2. **Completed State**
   - Shows Table icon in green background
   - Displays filename and file size
   - Shows "Search" button to proceed with the uploaded file

3. **Error State**
   - Shows WarningOctagon icon in red background
- Special styling: light pink background (#FDF6F5) with red border
(#FFDFD9)
   - Displays error title and description in two lines
   - Shows two action buttons: "Download template" and "Select file"

### Error Types
The component handles six different error scenarios:
- **Unsupported**: Wrong file type (non-CSV files)
- **Unreadable**: File can't be parsed or is corrupted
- **Invalid Structure**: Missing headers or incorrect columns
- **Empty**: File has no data
- **Too Large**: File exceeds size limit
- **Unexpected**: Generic error for unknown issues

### Integration
- Added attachment icon button to `SearchInputField` component
- Clicking the attachment button toggles the `FileUploadCard` visibility
- Card appears as a dropdown below the search input
- Smooth animations for show/hide transitions

### Key Features
- **File validation**: Automatically checks file type on selection/drop
- **Error recovery**: Users can easily select a new file or download
template when errors occur
- **Responsive design**: Components adapt to container width
- **Accessibility**: Proper ARIA labels and keyboard navigation support
- **Visual feedback**: Icons, colors, and animations provide clear
status indication

## How to test it?

### Basic File Upload Flow
1. Navigate to a page with the search input
2. Click the attachment icon button (Paperclip icon)
3. The FileUploadCard should appear below the search input
4. Click "Select file" or drag-and-drop a CSV file
5. Observe the uploading state with spinning icon
6. After 2 seconds, see the completed state with "Search" button
7. Click the X button to remove the file and return to initial state

### Drag and Drop
1. Open the FileUploadCard
2. Drag a CSV file over the dropzone
3. Observe the visual feedback (border and background color change)
4. Drop the file to upload

### Error Handling - Unsupported File Type
1. Open the FileUploadCard
2. Select or drop a non-CSV file (e.g., .txt, .pdf, .xlsx)
3. Observe error state with red icon and pink background
4. Read error message: "Unsupported file type." / "Upload a CSV or use
the template provided."
5. Click "Download template" to get a sample CSV
6. Click "Select file" to try uploading again

### File Removal
1. Upload a file successfully
2. Click the X button in the top-right of the file status
3. Component should return to initial dropzone state


### Starters Deploy Preview

<!-- Add your deploy preview link here -->

## References

- [Phosphor Icons](https://phosphoricons.com/) - Icon library used for
UI elements
- [Conventional Commits](https://www.conventionalcommits.org/) - Commit
message format

## Checklist

<em>You may erase this after checking them all 😉</em>

**PR Title and Commit Messages**

- [ ] PR title and commit messages follow the [Conventional
Commits](https://www.conventionalcommits.org/en/v1.0.0/) specification
- Available prefixes: `feat`, `fix`, `chore`, `docs`, `style`,
`refactor`, `ci` and `test`

**PR Description**

- [ ] Added a label according to the PR goal - `breaking change`, `bug`,
`contributing`, `performance`, `documentation`..

**Dependencies**

- [ ] Committed the `pnpm-lock.yaml` file when there were changes to the
packages

**Documentation**

- [ ] PR description


[BE-70]:
https://vtex-dev.atlassian.net/browse/BE-70?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

## Summary by CodeRabbit

## Release Notes

* **New Features**
* File upload card component enabling file selection via drag-and-drop
or file picker with status indicators
* File upload status component displaying upload progress, success, and
error states with customizable error handling
  * Attachment button in search input for quick file upload access

* **Chores**
  * Added component styling and Storybook demonstrations

<sub>✏️ Tip: You can customize this high-level summary in your review
settings.</sub>

<!-- end of auto-generated comment: release notes by coderabbit.ai -->

---------

Co-authored-by: Bruna Santos <[email protected]>
Co-authored-by: Arthur Andrade <[email protected]>
ataideverton added a commit that referenced this pull request Mar 4, 2026
This pull request introduces a new file upload and CSV parsing feature
to the `components` package, including reusable hooks and UI components.
The main changes are the addition of a `FileUploadCard` component for
uploading files, a `useCSVParser` hook for parsing CSV files in a web
worker, and a `useFileUpload` hook for managing file upload errors and
validation. These new utilities are exported for use in other parts of
the application.

This PR it was created from #3109

**New hooks and utilities:**

* Added `useCSVParser` hook for parsing CSV files in a web worker, with
error handling and CSV template generation.
* Added `useFileUpload` hook to manage file upload errors, validation,
and rejection reasons.
* Exported new hooks from the hooks index for easier consumption.
* Added type exports for CSV parsing to the main index file.

**New UI components:**

* Added `FileUploadCard` component for file selection, drag-and-drop,
and template download, with error state and file validation.
* Added exports for `FileUploadCard` and `FileUploadStatus` components
and their types.

**Dependency updates:**

* Added `papaparse` to dependencies for running CSV parsing in a web
worker.

![Nov-12-2025
14-49-47](https://github.com/user-attachments/assets/6aaf4cbd-4b2e-45ea-9a36-1278b8c2dc88)

<!--- Add a link to a deploy preview from `starter.store` with this
branch being used. --->

<!--- Tip: You can get an installable version of this branch from the
CodeSandbox generated when this PR is created. --->

- [Card](https://vtex-dev.atlassian.net/browse/BE-71)
-
[Figma](https://www.figma.com/design/YjU7SKqgLar3oxCP3SwagX/B2B-%C2%B7-Order-entry?node-id=53-3753&t=khUOMzHdN5djYyKo-0)

<em>You may erase this after checking them all 😉</em>

**PR Title and Commit Messages**

- [x] PR title and commit messages follow the [Conventional
Commits](https://www.conventionalcommits.org/en/v1.0.0/) specification
- Available prefixes: `feat`, `fix`, `chore`, `docs`, `style`,
`refactor`, `ci` and `test`

**PR Description**

- [ ] Added a label according to the PR goal - `breaking change`, `bug`,
`contributing`, `performance`, `documentation`..

**Dependencies**

- [ ] Committed the `pnpm-lock.yaml` file when there were changes to the
packages

**Documentation**

- [ ] PR description
- [ ] For documentation changes, ping `@Mariana-Caetano` to review and
update (Or submit a doc request)

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

* **New Features**
* CSV parsing with worker-backed parsing, template generation, Dropzone
upload UI and an Upload File dropdown; file-based search integration.

* **Enhancements**
* New file upload hooks, FileUploadCard and FileUploadStatus props for
richer status, customizable labels, and improved file name/size
formatting.
  * Template download and clearer upload error handling.

* **Refactor**
* Tightened public type signatures and expanded component/hook exports.

* **Style**
  * Added Dropzone and upload-related styles and Storybook stories.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->

---------

Co-authored-by: Giuliana Rigaud <[email protected]>
Co-authored-by: renato <[email protected]>
Co-authored-by: Bruna Santos <[email protected]>
Co-authored-by: Arthur Andrade <[email protected]>
Co-authored-by: BrunaCubos <[email protected]>
Co-authored-by: Bruna Santos <[email protected]>
Co-authored-by: Cursor <[email protected]>
Co-authored-by: Everton Ataide <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants