@vantageos/mosaic-blocks 0.4.6-alpha → 0.4.7-alpha
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +4 -4
- package/dist/index.cjs +205 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +129 -2
- package/dist/index.d.ts +129 -2
- package/dist/index.js +206 -3
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -20,7 +20,7 @@ import { Switch } from '@base-ui/react/switch';
|
|
|
20
20
|
export { Tooltip } from '@base-ui/react/tooltip';
|
|
21
21
|
import 'class-variance-authority/types';
|
|
22
22
|
|
|
23
|
-
declare const version = "0.4.
|
|
23
|
+
declare const version = "0.4.7-alpha";
|
|
24
24
|
|
|
25
25
|
/**
|
|
26
26
|
* Placeholder component — infra scaffold only.
|
|
@@ -5026,4 +5026,131 @@ interface MosaicClerkWebhookHandlerOptions {
|
|
|
5026
5026
|
*/
|
|
5027
5027
|
declare function MosaicClerkWebhookHandler(req: Request, options: MosaicClerkWebhookHandlerOptions): Promise<Response>;
|
|
5028
5028
|
|
|
5029
|
-
|
|
5029
|
+
/**
|
|
5030
|
+
* MosaicDocumentUpload — presentational document drop-zone + file status list
|
|
5031
|
+
*
|
|
5032
|
+
* Presentational atom. Renders a drag&drop / click-to-browse zone and, below
|
|
5033
|
+
* it, one status row per file (uploading / success / error). The component
|
|
5034
|
+
* never performs a network call: file selection (drop or file-input change)
|
|
5035
|
+
* is surfaced via `onFilesSelected(files: File[])` — the host owns where the
|
|
5036
|
+
* upload goes, how progress is tracked, and how errors are produced. `files`
|
|
5037
|
+
* is fully host-controlled state (id, name, sizeBytes, status, optional
|
|
5038
|
+
* progress / errorMessage).
|
|
5039
|
+
*
|
|
5040
|
+
* Pattern: MosaicStepPipeline.tsx (data-slot, inline cn, React 19 ref prop,
|
|
5041
|
+
* displayName, JSDoc, pure variants module).
|
|
5042
|
+
* No "use client" — prepend-use-client.mjs adds it to dist.
|
|
5043
|
+
* Design tokens: --foreground, --muted, --muted-foreground, --border,
|
|
5044
|
+
* --destructive, --ring, --accent, --card, --background.
|
|
5045
|
+
* No icon library — uses ✓ / ✕ chars for success/error, matching the
|
|
5046
|
+
* step-pipeline convention (no lucide-react runtime dependency).
|
|
5047
|
+
* a11y: drop-zone is a labelled, keyboard-reachable button; file rows use
|
|
5048
|
+
* role="status" region semantics; remove buttons have a required per-file
|
|
5049
|
+
* accessible name.
|
|
5050
|
+
* Bilingual: every user-facing string (idle/drag/browse/accept-hint/status
|
|
5051
|
+
* labels/remove label/error message) is a required caller-supplied prop —
|
|
5052
|
+
* zero hardcoded copy, zero default.
|
|
5053
|
+
*
|
|
5054
|
+
* Ported from any-debate-ai components/memory/document-upload.tsx (rewritten
|
|
5055
|
+
* from scratch — no shared code, no license carried over): dropped the
|
|
5056
|
+
* embedded mock "extracted memories" review UI (app-specific business logic)
|
|
5057
|
+
* and the network/simulation logic (violates presentational-component rule),
|
|
5058
|
+
* kept the upload zone + per-file status list shape.
|
|
5059
|
+
*
|
|
5060
|
+
* @example
|
|
5061
|
+
* <MosaicDocumentUpload
|
|
5062
|
+
* files={files}
|
|
5063
|
+
* onFilesSelected={(selected) => uploadFiles(selected)}
|
|
5064
|
+
* onRemoveFile={(id) => removeFile(id)}
|
|
5065
|
+
* idleLabel="Glissez-déposez un fichier ici, ou cliquez pour parcourir"
|
|
5066
|
+
* dragActiveLabel="Déposez le fichier ici"
|
|
5067
|
+
* browseButtonLabel="Choisir un fichier"
|
|
5068
|
+
* acceptHint="PDF, DOC, DOCX, TXT, MD (10 Mo max)"
|
|
5069
|
+
* accept=".pdf,.doc,.docx,.txt,.md"
|
|
5070
|
+
* removeFileAriaLabel={(name) => `Supprimer ${name}`}
|
|
5071
|
+
* statusLabels={{ uploading: "Envoi en cours", success: "Envoyé", error: "Échec" }}
|
|
5072
|
+
* sizeLabel={(bytes) => `${(bytes / 1024).toFixed(1)} Ko`}
|
|
5073
|
+
* dropZoneAriaLabel="Zone de dépôt de document"
|
|
5074
|
+
* />
|
|
5075
|
+
*/
|
|
5076
|
+
|
|
5077
|
+
type MosaicDocumentUploadFileStatus = "uploading" | "success" | "error";
|
|
5078
|
+
interface MosaicDocumentUploadFile {
|
|
5079
|
+
/** Stable id — used as React key and passed back to onRemoveFile. */
|
|
5080
|
+
id: string;
|
|
5081
|
+
/** File name, displayed as-is. */
|
|
5082
|
+
name: string;
|
|
5083
|
+
/** File size in bytes — formatted for display via the required sizeLabel prop. */
|
|
5084
|
+
sizeBytes: number;
|
|
5085
|
+
/** Current upload status, fully host-controlled. */
|
|
5086
|
+
status: MosaicDocumentUploadFileStatus;
|
|
5087
|
+
/** Upload progress 0-100, rendered only while status === "uploading". */
|
|
5088
|
+
progress?: number;
|
|
5089
|
+
/**
|
|
5090
|
+
* Host-provided, host-localized error message (e.g. "File too large",
|
|
5091
|
+
* "Unsupported format"). Required content when status === "error" — the
|
|
5092
|
+
* library never generates its own error strings.
|
|
5093
|
+
*/
|
|
5094
|
+
errorMessage?: string;
|
|
5095
|
+
}
|
|
5096
|
+
interface MosaicDocumentUploadProps {
|
|
5097
|
+
/** Host-controlled list of files with their upload status. */
|
|
5098
|
+
files: MosaicDocumentUploadFile[];
|
|
5099
|
+
/**
|
|
5100
|
+
* Called with the raw browser `File[]` chosen via drag&drop or the file
|
|
5101
|
+
* picker. The component performs no upload itself — the host decides
|
|
5102
|
+
* where the files go and how `files` state is updated afterward.
|
|
5103
|
+
*/
|
|
5104
|
+
onFilesSelected: (files: File[]) => void;
|
|
5105
|
+
/** Called with a file's id when its remove button is activated. */
|
|
5106
|
+
onRemoveFile: (id: string) => void;
|
|
5107
|
+
/** Drop-zone label shown when idle (not dragging). Required, no default. */
|
|
5108
|
+
idleLabel: string;
|
|
5109
|
+
/** Drop-zone label shown while a drag is over the zone. Required, no default. */
|
|
5110
|
+
dragActiveLabel: string;
|
|
5111
|
+
/** Label for the click-to-browse button. Required, no default. */
|
|
5112
|
+
browseButtonLabel: string;
|
|
5113
|
+
/** Supporting hint text (accepted formats / size limit). Required, no default. */
|
|
5114
|
+
acceptHint: string;
|
|
5115
|
+
/** Accessible name for the drop-zone region (`aria-label`). Required, no default. */
|
|
5116
|
+
dropZoneAriaLabel: string;
|
|
5117
|
+
/**
|
|
5118
|
+
* Per-file accessible name for the remove button, e.g.
|
|
5119
|
+
* `(name) => \`Remove ${name}\``. Required — no hardcoded "Remove" string
|
|
5120
|
+
* in the library.
|
|
5121
|
+
*/
|
|
5122
|
+
removeFileAriaLabel: (fileName: string) => string;
|
|
5123
|
+
/** Status labels rendered next to each file row. All three required, no default. */
|
|
5124
|
+
statusLabels: {
|
|
5125
|
+
uploading: string;
|
|
5126
|
+
success: string;
|
|
5127
|
+
error: string;
|
|
5128
|
+
};
|
|
5129
|
+
/**
|
|
5130
|
+
* Formats a file's size for display, e.g. `(bytes) => \`${(bytes/1024).toFixed(1)} KB\``.
|
|
5131
|
+
* Required — the library never hardcodes a unit string ("KB", "Ko", ...).
|
|
5132
|
+
*/
|
|
5133
|
+
sizeLabel: (sizeBytes: number) => string;
|
|
5134
|
+
/** Native `accept` attribute forwarded to the hidden file input. */
|
|
5135
|
+
accept?: string;
|
|
5136
|
+
/** Allow selecting/dropping more than one file at a time. @default false */
|
|
5137
|
+
multiple?: boolean;
|
|
5138
|
+
/** Additional Tailwind classes on the root element. */
|
|
5139
|
+
className?: string;
|
|
5140
|
+
/** React 19 ref prop — forwarded to the root element. */
|
|
5141
|
+
ref?: React.Ref<HTMLDivElement>;
|
|
5142
|
+
}
|
|
5143
|
+
/**
|
|
5144
|
+
* MosaicDocumentUpload — production document-upload atom for
|
|
5145
|
+
* @vantageos/mosaic-blocks.
|
|
5146
|
+
*
|
|
5147
|
+
* Purely presentational: renders the drop-zone and the file status list from
|
|
5148
|
+
* props, and reports file selection / removal via callbacks. No network
|
|
5149
|
+
* call, no upload simulation, no built-in copy.
|
|
5150
|
+
*/
|
|
5151
|
+
declare function MosaicDocumentUpload({ files, onFilesSelected, onRemoveFile, idleLabel, dragActiveLabel, browseButtonLabel, acceptHint, dropZoneAriaLabel, removeFileAriaLabel, statusLabels, sizeLabel, accept, multiple, className, ref, }: MosaicDocumentUploadProps): React.JSX.Element;
|
|
5152
|
+
declare namespace MosaicDocumentUpload {
|
|
5153
|
+
var displayName: string;
|
|
5154
|
+
}
|
|
5155
|
+
|
|
5156
|
+
export { type Breakpoint, type DeviceContextValue, type Feature3ColItem, type FeatureItem, type FooterColumn, type FooterLink, type HeroCta, type LogoItem, MosaicAccordion, MosaicAccordionItem, type MosaicAccordionItemProps, MosaicAccordionPanel, type MosaicAccordionPanelProps, type MosaicAccordionProps, MosaicAccordionTrigger, type MosaicAccordionTriggerProps, type MosaicActionAccent, type MosaicActivity, MosaicActivityFeed, type MosaicActivityFeedProps, MosaicActivityItem, type MosaicActivityItemProps, type MosaicActivityStatus, MosaicAdaptiveGrid, type MosaicAdaptiveGridProps, MosaicAdaptiveModal, type MosaicAdaptiveModalProps, MosaicAdaptiveNavigation, type MosaicAdaptiveNavigationProps, MosaicAgentCard, type MosaicAgentCardProps, MosaicAgentComposer, MosaicAgentComposerDesktop, MosaicAgentComposerMobile, type MosaicAgentComposerMobileProps, type MosaicAgentComposerProps, type MosaicAgentData, MosaicAgentList, AgentListDesktop as MosaicAgentListDesktop, AgentListMobile as MosaicAgentListMobile, type MosaicAgentListProps, type MosaicAgentPreset, MosaicAgentTeamPreview, type MosaicAgentTeamPreviewProps, MosaicAnimatedList, type MosaicAnimatedListProps, MosaicAppSidebar, type MosaicAppSidebarProps, MosaicAvatar, type MosaicAvatarProps, MosaicBadge, type MosaicBadgeProps, MosaicBlurredOrb, type MosaicBlurredOrbProps, type MosaicBreadcrumb, MosaicButton, type MosaicButtonProps, MosaicCard, MosaicCardContent, type MosaicCardContentProps, MosaicCardDescription, type MosaicCardDescriptionProps, MosaicCardFooter, type MosaicCardFooterProps, MosaicCardHeader, type MosaicCardHeaderProps, type MosaicCardProps, MosaicCardTitle, type MosaicCardTitleProps, MosaicCheckbox, type MosaicCheckboxProps, type MosaicClerkMembership, MosaicClerkOrgSwitcher, type MosaicClerkOrgSwitcherProps, type MosaicClerkOrganization, MosaicClerkWebhookHandler, type MosaicClerkWebhookHandlerOptions, MosaicCollapsible, MosaicCollapsiblePanel, type MosaicCollapsiblePanelProps, type MosaicCollapsibleProps, MosaicCollapsibleTrigger, type MosaicCollapsibleTriggerProps, MosaicCombobox, type MosaicComboboxItem, type MosaicComboboxProps, type MosaicComposerModel, type MosaicComposerModule, MosaicCounter, type MosaicCounterProps, MosaicCreateOrgDialog, type MosaicCreateOrgDialogProps, MosaicDashboardContent, type MosaicDashboardContentProps, MosaicDashboardHeader, type MosaicDashboardHeaderProps, MosaicDashboardLayout, type MosaicDashboardLayoutProps, type MosaicDashboardView, MosaicDataTable, type MosaicDataTableColumn, type MosaicDataTablePagination, type MosaicDataTableProps, MosaicDeleteConfirmationDialog, type MosaicDeleteConfirmationDialogProps, MosaicDeviceProvider, type MosaicDeviceProviderProps, MosaicDocumentUpload, type MosaicDocumentUploadFile, type MosaicDocumentUploadFileStatus, type MosaicDocumentUploadProps, MosaicDropdownMenu, type MosaicDropdownMenuItem, type MosaicDropdownMenuProps, MosaicEmptyState, type MosaicEmptyStateProps, MosaicFallingPattern, type MosaicFallingPatternProps, MosaicFeature3Col, type MosaicFeature3ColProps, MosaicFeatureCenteredMedia, type MosaicFeatureCenteredMediaProps, MosaicField, MosaicFieldControl, type MosaicFieldControlProps, MosaicFieldDescription, type MosaicFieldDescriptionProps, MosaicFieldError, type MosaicFieldErrorProps, MosaicFieldLabel, type MosaicFieldLabelProps, type MosaicFieldProps, MosaicFilterBar, type MosaicFilterBarProps, type MosaicFilterOption, MosaicFilterSidebar, type MosaicFilterSidebarProps, MosaicFooterSimple, type MosaicFooterSimpleProps, MosaicHeroSplit, type MosaicHeroSplitProps, MosaicInput, MosaicInputGroup, type MosaicInputGroupProps, type MosaicInputProps, MosaicIntegrationsBadge, type MosaicIntegrationsBadgeProps, MosaicInviteMemberDialog, type MosaicInviteMemberDialogProps, MosaicKanbanBoard, type MosaicKanbanBoardProps, MosaicKanbanColumn, type MosaicKanbanColumnProps, MosaicLogosGrid, type MosaicLogosGridProps, MosaicMainNav, type MosaicMainNavProps, type MosaicMarketplaceItem, MosaicMarketplaceList, MarketplaceListDesktop as MosaicMarketplaceListDesktop, MarketplaceListMobile as MosaicMarketplaceListMobile, type MosaicMarketplaceListProps, MosaicMemberList, type MosaicMemberListProps, MosaicMemoryCard, type MosaicMemoryCardProps, type MosaicMemoryData, type MosaicMemoryScope, type MosaicMemorySource, type MosaicMessage, MosaicMessageCard, type MosaicMessageCardProps, MosaicMessageList, MessageListDesktop as MosaicMessageListDesktop, MessageListMobile as MosaicMessageListMobile, type MosaicMessageListProps, type MosaicMessageReactions, type MosaicMessageSender, type MosaicMessageSenderType, MosaicModuleCard, type MosaicModuleCardProps, type MosaicModuleData, MosaicModuleForm, type MosaicModuleFormField, type MosaicModuleFormProps, type MosaicModuleItem, MosaicModuleLibrary, type MosaicModuleLibraryProps, type MosaicModuleType, MosaicMultiOrgIndicator, type MosaicMultiOrgIndicatorProps, MosaicMultiTenantProvider, type MosaicMultiTenantProviderProps, type MosaicNavItem, MosaicNavbar, type MosaicNavbarProps, type MosaicNavigationItem, type MosaicOrg, type MosaicOrgInfo, type MosaicOrgMember, MosaicOrgPanel, type MosaicOrgPanelProps, type MosaicOrgPanelTab, MosaicOrgProfilePage, type MosaicOrgProfilePageProps, type MosaicOrgRole, MosaicOrgRoleBadge, type MosaicOrgRoleBadgeProps, type MosaicOrgStats, MosaicOrgSwitcher, type MosaicOrgSwitcherProps, type MosaicSelectItem as MosaicPrefSelectItem, type MosaicPreference, type MosaicPreferenceGroup, MosaicPreferencesPanel, type MosaicPreferencesPanelProps, MosaicPricingCard, type MosaicPricingCardProps, type MosaicProfileField, MosaicProfilePanel, type MosaicProfilePanelProps, MosaicProgress, type MosaicProgressProps, type MosaicQuickAction$1 as MosaicQuickAction, MosaicQuickActionCard, type MosaicQuickActionCardProps, MosaicQuickActionsMenu, type MosaicQuickAction as MosaicQuickActionsMenuItem, type MosaicQuickActionsMenuProps, type MosaicQuickAgent, MosaicQuickAgentSelector, type MosaicQuickAgentSelectorProps, MosaicQuickStartPanel, type MosaicQuickStartPanelProps, MosaicRadioGroup, MosaicRadioGroupItem, type MosaicRadioGroupItemProps, type MosaicRadioGroupProps, type MosaicScenario, MosaicScrollArea, type MosaicScrollAreaProps, MosaicSelect, type MosaicSelectItem$1 as MosaicSelectItem, type MosaicSelectProps, type MosaicSelectorCategory, type MosaicSelectorItem, MosaicSelectorModal, type MosaicSelectorModalProps, MosaicSeparator, type MosaicSeparatorProps, type MosaicSidebarFooterStatus, type MosaicSidebarNavItem, type MosaicSidebarQuickAction, type MosaicSidebarRecentItem, MosaicSignInLayout, type MosaicSignInLayoutProps, MosaicSignUpLayout, type MosaicSignUpLayoutProps, MosaicSkeleton, type MosaicSkeletonProps, MosaicSlider, type MosaicSliderProps, type MosaicStatItem, MosaicStatsGrid, type MosaicStatsGridProps, type MosaicStep, MosaicStepPipeline, type MosaicStepPipelineDotsProps, type MosaicStepPipelineProps, type MosaicStepPipelineSegmentsProps, type MosaicStepStatus, MosaicSwitch, type MosaicSwitchProps, MosaicTabs, MosaicTabsList, type MosaicTabsListProps, MosaicTabsPanel, type MosaicTabsPanelProps, type MosaicTabsProps, MosaicTabsTrigger, type MosaicTabsTriggerProps, type MosaicTemplate, type MosaicTemplateAgent, MosaicTemplateCard, type MosaicTemplateCardProps, MosaicTemplateGallery, type MosaicTemplateGalleryProps, type MosaicTemplateMetadata, MosaicTemplatePreview, type MosaicTemplatePreviewProps, MosaicTestimonialsGrid, type MosaicTestimonialsGridProps, MosaicTextarea, type MosaicTextareaProps, MosaicThemeProvider, type MosaicThemeProviderProps, MosaicThemeToggle, type MosaicThemeToggleProps, MosaicTooltip, MosaicTooltipContent, type MosaicTooltipContentProps, type MosaicTooltipProps, MosaicTooltipProvider, type MosaicTooltipProviderProps, MosaicTooltipRoot, type MosaicTooltipRootProps, MosaicTooltipTrigger, type MosaicTooltipTriggerProps, MosaicUserButton, type MosaicUserButtonProps, type MosaicWorkspaceContext, type NavCta, type NavLink, type OrbPosition, type Orientation, Placeholder, type PricingCta, type SocialLink, type StatItem, type TestimonialItem, type Theme, badgeVariants, buttonVariants, skeletonVariants, useBreakpoint, useDevice, useMosaicWorkspace as useEffectiveWorkspaceId, useIsDesktop, useIsMobile, useIsTablet, useMediaQuery, useMosaicWorkspace, useOrientation, useViewport, version };
|
package/dist/index.d.ts
CHANGED
|
@@ -20,7 +20,7 @@ import { Switch } from '@base-ui/react/switch';
|
|
|
20
20
|
export { Tooltip } from '@base-ui/react/tooltip';
|
|
21
21
|
import 'class-variance-authority/types';
|
|
22
22
|
|
|
23
|
-
declare const version = "0.4.
|
|
23
|
+
declare const version = "0.4.7-alpha";
|
|
24
24
|
|
|
25
25
|
/**
|
|
26
26
|
* Placeholder component — infra scaffold only.
|
|
@@ -5026,4 +5026,131 @@ interface MosaicClerkWebhookHandlerOptions {
|
|
|
5026
5026
|
*/
|
|
5027
5027
|
declare function MosaicClerkWebhookHandler(req: Request, options: MosaicClerkWebhookHandlerOptions): Promise<Response>;
|
|
5028
5028
|
|
|
5029
|
-
|
|
5029
|
+
/**
|
|
5030
|
+
* MosaicDocumentUpload — presentational document drop-zone + file status list
|
|
5031
|
+
*
|
|
5032
|
+
* Presentational atom. Renders a drag&drop / click-to-browse zone and, below
|
|
5033
|
+
* it, one status row per file (uploading / success / error). The component
|
|
5034
|
+
* never performs a network call: file selection (drop or file-input change)
|
|
5035
|
+
* is surfaced via `onFilesSelected(files: File[])` — the host owns where the
|
|
5036
|
+
* upload goes, how progress is tracked, and how errors are produced. `files`
|
|
5037
|
+
* is fully host-controlled state (id, name, sizeBytes, status, optional
|
|
5038
|
+
* progress / errorMessage).
|
|
5039
|
+
*
|
|
5040
|
+
* Pattern: MosaicStepPipeline.tsx (data-slot, inline cn, React 19 ref prop,
|
|
5041
|
+
* displayName, JSDoc, pure variants module).
|
|
5042
|
+
* No "use client" — prepend-use-client.mjs adds it to dist.
|
|
5043
|
+
* Design tokens: --foreground, --muted, --muted-foreground, --border,
|
|
5044
|
+
* --destructive, --ring, --accent, --card, --background.
|
|
5045
|
+
* No icon library — uses ✓ / ✕ chars for success/error, matching the
|
|
5046
|
+
* step-pipeline convention (no lucide-react runtime dependency).
|
|
5047
|
+
* a11y: drop-zone is a labelled, keyboard-reachable button; file rows use
|
|
5048
|
+
* role="status" region semantics; remove buttons have a required per-file
|
|
5049
|
+
* accessible name.
|
|
5050
|
+
* Bilingual: every user-facing string (idle/drag/browse/accept-hint/status
|
|
5051
|
+
* labels/remove label/error message) is a required caller-supplied prop —
|
|
5052
|
+
* zero hardcoded copy, zero default.
|
|
5053
|
+
*
|
|
5054
|
+
* Ported from any-debate-ai components/memory/document-upload.tsx (rewritten
|
|
5055
|
+
* from scratch — no shared code, no license carried over): dropped the
|
|
5056
|
+
* embedded mock "extracted memories" review UI (app-specific business logic)
|
|
5057
|
+
* and the network/simulation logic (violates presentational-component rule),
|
|
5058
|
+
* kept the upload zone + per-file status list shape.
|
|
5059
|
+
*
|
|
5060
|
+
* @example
|
|
5061
|
+
* <MosaicDocumentUpload
|
|
5062
|
+
* files={files}
|
|
5063
|
+
* onFilesSelected={(selected) => uploadFiles(selected)}
|
|
5064
|
+
* onRemoveFile={(id) => removeFile(id)}
|
|
5065
|
+
* idleLabel="Glissez-déposez un fichier ici, ou cliquez pour parcourir"
|
|
5066
|
+
* dragActiveLabel="Déposez le fichier ici"
|
|
5067
|
+
* browseButtonLabel="Choisir un fichier"
|
|
5068
|
+
* acceptHint="PDF, DOC, DOCX, TXT, MD (10 Mo max)"
|
|
5069
|
+
* accept=".pdf,.doc,.docx,.txt,.md"
|
|
5070
|
+
* removeFileAriaLabel={(name) => `Supprimer ${name}`}
|
|
5071
|
+
* statusLabels={{ uploading: "Envoi en cours", success: "Envoyé", error: "Échec" }}
|
|
5072
|
+
* sizeLabel={(bytes) => `${(bytes / 1024).toFixed(1)} Ko`}
|
|
5073
|
+
* dropZoneAriaLabel="Zone de dépôt de document"
|
|
5074
|
+
* />
|
|
5075
|
+
*/
|
|
5076
|
+
|
|
5077
|
+
type MosaicDocumentUploadFileStatus = "uploading" | "success" | "error";
|
|
5078
|
+
interface MosaicDocumentUploadFile {
|
|
5079
|
+
/** Stable id — used as React key and passed back to onRemoveFile. */
|
|
5080
|
+
id: string;
|
|
5081
|
+
/** File name, displayed as-is. */
|
|
5082
|
+
name: string;
|
|
5083
|
+
/** File size in bytes — formatted for display via the required sizeLabel prop. */
|
|
5084
|
+
sizeBytes: number;
|
|
5085
|
+
/** Current upload status, fully host-controlled. */
|
|
5086
|
+
status: MosaicDocumentUploadFileStatus;
|
|
5087
|
+
/** Upload progress 0-100, rendered only while status === "uploading". */
|
|
5088
|
+
progress?: number;
|
|
5089
|
+
/**
|
|
5090
|
+
* Host-provided, host-localized error message (e.g. "File too large",
|
|
5091
|
+
* "Unsupported format"). Required content when status === "error" — the
|
|
5092
|
+
* library never generates its own error strings.
|
|
5093
|
+
*/
|
|
5094
|
+
errorMessage?: string;
|
|
5095
|
+
}
|
|
5096
|
+
interface MosaicDocumentUploadProps {
|
|
5097
|
+
/** Host-controlled list of files with their upload status. */
|
|
5098
|
+
files: MosaicDocumentUploadFile[];
|
|
5099
|
+
/**
|
|
5100
|
+
* Called with the raw browser `File[]` chosen via drag&drop or the file
|
|
5101
|
+
* picker. The component performs no upload itself — the host decides
|
|
5102
|
+
* where the files go and how `files` state is updated afterward.
|
|
5103
|
+
*/
|
|
5104
|
+
onFilesSelected: (files: File[]) => void;
|
|
5105
|
+
/** Called with a file's id when its remove button is activated. */
|
|
5106
|
+
onRemoveFile: (id: string) => void;
|
|
5107
|
+
/** Drop-zone label shown when idle (not dragging). Required, no default. */
|
|
5108
|
+
idleLabel: string;
|
|
5109
|
+
/** Drop-zone label shown while a drag is over the zone. Required, no default. */
|
|
5110
|
+
dragActiveLabel: string;
|
|
5111
|
+
/** Label for the click-to-browse button. Required, no default. */
|
|
5112
|
+
browseButtonLabel: string;
|
|
5113
|
+
/** Supporting hint text (accepted formats / size limit). Required, no default. */
|
|
5114
|
+
acceptHint: string;
|
|
5115
|
+
/** Accessible name for the drop-zone region (`aria-label`). Required, no default. */
|
|
5116
|
+
dropZoneAriaLabel: string;
|
|
5117
|
+
/**
|
|
5118
|
+
* Per-file accessible name for the remove button, e.g.
|
|
5119
|
+
* `(name) => \`Remove ${name}\``. Required — no hardcoded "Remove" string
|
|
5120
|
+
* in the library.
|
|
5121
|
+
*/
|
|
5122
|
+
removeFileAriaLabel: (fileName: string) => string;
|
|
5123
|
+
/** Status labels rendered next to each file row. All three required, no default. */
|
|
5124
|
+
statusLabels: {
|
|
5125
|
+
uploading: string;
|
|
5126
|
+
success: string;
|
|
5127
|
+
error: string;
|
|
5128
|
+
};
|
|
5129
|
+
/**
|
|
5130
|
+
* Formats a file's size for display, e.g. `(bytes) => \`${(bytes/1024).toFixed(1)} KB\``.
|
|
5131
|
+
* Required — the library never hardcodes a unit string ("KB", "Ko", ...).
|
|
5132
|
+
*/
|
|
5133
|
+
sizeLabel: (sizeBytes: number) => string;
|
|
5134
|
+
/** Native `accept` attribute forwarded to the hidden file input. */
|
|
5135
|
+
accept?: string;
|
|
5136
|
+
/** Allow selecting/dropping more than one file at a time. @default false */
|
|
5137
|
+
multiple?: boolean;
|
|
5138
|
+
/** Additional Tailwind classes on the root element. */
|
|
5139
|
+
className?: string;
|
|
5140
|
+
/** React 19 ref prop — forwarded to the root element. */
|
|
5141
|
+
ref?: React.Ref<HTMLDivElement>;
|
|
5142
|
+
}
|
|
5143
|
+
/**
|
|
5144
|
+
* MosaicDocumentUpload — production document-upload atom for
|
|
5145
|
+
* @vantageos/mosaic-blocks.
|
|
5146
|
+
*
|
|
5147
|
+
* Purely presentational: renders the drop-zone and the file status list from
|
|
5148
|
+
* props, and reports file selection / removal via callbacks. No network
|
|
5149
|
+
* call, no upload simulation, no built-in copy.
|
|
5150
|
+
*/
|
|
5151
|
+
declare function MosaicDocumentUpload({ files, onFilesSelected, onRemoveFile, idleLabel, dragActiveLabel, browseButtonLabel, acceptHint, dropZoneAriaLabel, removeFileAriaLabel, statusLabels, sizeLabel, accept, multiple, className, ref, }: MosaicDocumentUploadProps): React.JSX.Element;
|
|
5152
|
+
declare namespace MosaicDocumentUpload {
|
|
5153
|
+
var displayName: string;
|
|
5154
|
+
}
|
|
5155
|
+
|
|
5156
|
+
export { type Breakpoint, type DeviceContextValue, type Feature3ColItem, type FeatureItem, type FooterColumn, type FooterLink, type HeroCta, type LogoItem, MosaicAccordion, MosaicAccordionItem, type MosaicAccordionItemProps, MosaicAccordionPanel, type MosaicAccordionPanelProps, type MosaicAccordionProps, MosaicAccordionTrigger, type MosaicAccordionTriggerProps, type MosaicActionAccent, type MosaicActivity, MosaicActivityFeed, type MosaicActivityFeedProps, MosaicActivityItem, type MosaicActivityItemProps, type MosaicActivityStatus, MosaicAdaptiveGrid, type MosaicAdaptiveGridProps, MosaicAdaptiveModal, type MosaicAdaptiveModalProps, MosaicAdaptiveNavigation, type MosaicAdaptiveNavigationProps, MosaicAgentCard, type MosaicAgentCardProps, MosaicAgentComposer, MosaicAgentComposerDesktop, MosaicAgentComposerMobile, type MosaicAgentComposerMobileProps, type MosaicAgentComposerProps, type MosaicAgentData, MosaicAgentList, AgentListDesktop as MosaicAgentListDesktop, AgentListMobile as MosaicAgentListMobile, type MosaicAgentListProps, type MosaicAgentPreset, MosaicAgentTeamPreview, type MosaicAgentTeamPreviewProps, MosaicAnimatedList, type MosaicAnimatedListProps, MosaicAppSidebar, type MosaicAppSidebarProps, MosaicAvatar, type MosaicAvatarProps, MosaicBadge, type MosaicBadgeProps, MosaicBlurredOrb, type MosaicBlurredOrbProps, type MosaicBreadcrumb, MosaicButton, type MosaicButtonProps, MosaicCard, MosaicCardContent, type MosaicCardContentProps, MosaicCardDescription, type MosaicCardDescriptionProps, MosaicCardFooter, type MosaicCardFooterProps, MosaicCardHeader, type MosaicCardHeaderProps, type MosaicCardProps, MosaicCardTitle, type MosaicCardTitleProps, MosaicCheckbox, type MosaicCheckboxProps, type MosaicClerkMembership, MosaicClerkOrgSwitcher, type MosaicClerkOrgSwitcherProps, type MosaicClerkOrganization, MosaicClerkWebhookHandler, type MosaicClerkWebhookHandlerOptions, MosaicCollapsible, MosaicCollapsiblePanel, type MosaicCollapsiblePanelProps, type MosaicCollapsibleProps, MosaicCollapsibleTrigger, type MosaicCollapsibleTriggerProps, MosaicCombobox, type MosaicComboboxItem, type MosaicComboboxProps, type MosaicComposerModel, type MosaicComposerModule, MosaicCounter, type MosaicCounterProps, MosaicCreateOrgDialog, type MosaicCreateOrgDialogProps, MosaicDashboardContent, type MosaicDashboardContentProps, MosaicDashboardHeader, type MosaicDashboardHeaderProps, MosaicDashboardLayout, type MosaicDashboardLayoutProps, type MosaicDashboardView, MosaicDataTable, type MosaicDataTableColumn, type MosaicDataTablePagination, type MosaicDataTableProps, MosaicDeleteConfirmationDialog, type MosaicDeleteConfirmationDialogProps, MosaicDeviceProvider, type MosaicDeviceProviderProps, MosaicDocumentUpload, type MosaicDocumentUploadFile, type MosaicDocumentUploadFileStatus, type MosaicDocumentUploadProps, MosaicDropdownMenu, type MosaicDropdownMenuItem, type MosaicDropdownMenuProps, MosaicEmptyState, type MosaicEmptyStateProps, MosaicFallingPattern, type MosaicFallingPatternProps, MosaicFeature3Col, type MosaicFeature3ColProps, MosaicFeatureCenteredMedia, type MosaicFeatureCenteredMediaProps, MosaicField, MosaicFieldControl, type MosaicFieldControlProps, MosaicFieldDescription, type MosaicFieldDescriptionProps, MosaicFieldError, type MosaicFieldErrorProps, MosaicFieldLabel, type MosaicFieldLabelProps, type MosaicFieldProps, MosaicFilterBar, type MosaicFilterBarProps, type MosaicFilterOption, MosaicFilterSidebar, type MosaicFilterSidebarProps, MosaicFooterSimple, type MosaicFooterSimpleProps, MosaicHeroSplit, type MosaicHeroSplitProps, MosaicInput, MosaicInputGroup, type MosaicInputGroupProps, type MosaicInputProps, MosaicIntegrationsBadge, type MosaicIntegrationsBadgeProps, MosaicInviteMemberDialog, type MosaicInviteMemberDialogProps, MosaicKanbanBoard, type MosaicKanbanBoardProps, MosaicKanbanColumn, type MosaicKanbanColumnProps, MosaicLogosGrid, type MosaicLogosGridProps, MosaicMainNav, type MosaicMainNavProps, type MosaicMarketplaceItem, MosaicMarketplaceList, MarketplaceListDesktop as MosaicMarketplaceListDesktop, MarketplaceListMobile as MosaicMarketplaceListMobile, type MosaicMarketplaceListProps, MosaicMemberList, type MosaicMemberListProps, MosaicMemoryCard, type MosaicMemoryCardProps, type MosaicMemoryData, type MosaicMemoryScope, type MosaicMemorySource, type MosaicMessage, MosaicMessageCard, type MosaicMessageCardProps, MosaicMessageList, MessageListDesktop as MosaicMessageListDesktop, MessageListMobile as MosaicMessageListMobile, type MosaicMessageListProps, type MosaicMessageReactions, type MosaicMessageSender, type MosaicMessageSenderType, MosaicModuleCard, type MosaicModuleCardProps, type MosaicModuleData, MosaicModuleForm, type MosaicModuleFormField, type MosaicModuleFormProps, type MosaicModuleItem, MosaicModuleLibrary, type MosaicModuleLibraryProps, type MosaicModuleType, MosaicMultiOrgIndicator, type MosaicMultiOrgIndicatorProps, MosaicMultiTenantProvider, type MosaicMultiTenantProviderProps, type MosaicNavItem, MosaicNavbar, type MosaicNavbarProps, type MosaicNavigationItem, type MosaicOrg, type MosaicOrgInfo, type MosaicOrgMember, MosaicOrgPanel, type MosaicOrgPanelProps, type MosaicOrgPanelTab, MosaicOrgProfilePage, type MosaicOrgProfilePageProps, type MosaicOrgRole, MosaicOrgRoleBadge, type MosaicOrgRoleBadgeProps, type MosaicOrgStats, MosaicOrgSwitcher, type MosaicOrgSwitcherProps, type MosaicSelectItem as MosaicPrefSelectItem, type MosaicPreference, type MosaicPreferenceGroup, MosaicPreferencesPanel, type MosaicPreferencesPanelProps, MosaicPricingCard, type MosaicPricingCardProps, type MosaicProfileField, MosaicProfilePanel, type MosaicProfilePanelProps, MosaicProgress, type MosaicProgressProps, type MosaicQuickAction$1 as MosaicQuickAction, MosaicQuickActionCard, type MosaicQuickActionCardProps, MosaicQuickActionsMenu, type MosaicQuickAction as MosaicQuickActionsMenuItem, type MosaicQuickActionsMenuProps, type MosaicQuickAgent, MosaicQuickAgentSelector, type MosaicQuickAgentSelectorProps, MosaicQuickStartPanel, type MosaicQuickStartPanelProps, MosaicRadioGroup, MosaicRadioGroupItem, type MosaicRadioGroupItemProps, type MosaicRadioGroupProps, type MosaicScenario, MosaicScrollArea, type MosaicScrollAreaProps, MosaicSelect, type MosaicSelectItem$1 as MosaicSelectItem, type MosaicSelectProps, type MosaicSelectorCategory, type MosaicSelectorItem, MosaicSelectorModal, type MosaicSelectorModalProps, MosaicSeparator, type MosaicSeparatorProps, type MosaicSidebarFooterStatus, type MosaicSidebarNavItem, type MosaicSidebarQuickAction, type MosaicSidebarRecentItem, MosaicSignInLayout, type MosaicSignInLayoutProps, MosaicSignUpLayout, type MosaicSignUpLayoutProps, MosaicSkeleton, type MosaicSkeletonProps, MosaicSlider, type MosaicSliderProps, type MosaicStatItem, MosaicStatsGrid, type MosaicStatsGridProps, type MosaicStep, MosaicStepPipeline, type MosaicStepPipelineDotsProps, type MosaicStepPipelineProps, type MosaicStepPipelineSegmentsProps, type MosaicStepStatus, MosaicSwitch, type MosaicSwitchProps, MosaicTabs, MosaicTabsList, type MosaicTabsListProps, MosaicTabsPanel, type MosaicTabsPanelProps, type MosaicTabsProps, MosaicTabsTrigger, type MosaicTabsTriggerProps, type MosaicTemplate, type MosaicTemplateAgent, MosaicTemplateCard, type MosaicTemplateCardProps, MosaicTemplateGallery, type MosaicTemplateGalleryProps, type MosaicTemplateMetadata, MosaicTemplatePreview, type MosaicTemplatePreviewProps, MosaicTestimonialsGrid, type MosaicTestimonialsGridProps, MosaicTextarea, type MosaicTextareaProps, MosaicThemeProvider, type MosaicThemeProviderProps, MosaicThemeToggle, type MosaicThemeToggleProps, MosaicTooltip, MosaicTooltipContent, type MosaicTooltipContentProps, type MosaicTooltipProps, MosaicTooltipProvider, type MosaicTooltipProviderProps, MosaicTooltipRoot, type MosaicTooltipRootProps, MosaicTooltipTrigger, type MosaicTooltipTriggerProps, MosaicUserButton, type MosaicUserButtonProps, type MosaicWorkspaceContext, type NavCta, type NavLink, type OrbPosition, type Orientation, Placeholder, type PricingCta, type SocialLink, type StatItem, type TestimonialItem, type Theme, badgeVariants, buttonVariants, skeletonVariants, useBreakpoint, useDevice, useMosaicWorkspace as useEffectiveWorkspaceId, useIsDesktop, useIsMobile, useIsTablet, useMediaQuery, useMosaicWorkspace, useOrientation, useViewport, version };
|
package/dist/index.js
CHANGED
|
@@ -3,7 +3,7 @@ import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
|
3
3
|
import { Button } from '@base-ui/react/button';
|
|
4
4
|
import { cva } from 'class-variance-authority';
|
|
5
5
|
import * as React28 from 'react';
|
|
6
|
-
import { useState, useEffect } from 'react';
|
|
6
|
+
import { useState, useEffect, useRef, useId } from 'react';
|
|
7
7
|
import { Accordion } from '@base-ui/react/accordion';
|
|
8
8
|
export { Accordion } from '@base-ui/react/accordion';
|
|
9
9
|
import { Checkbox } from '@base-ui/react/checkbox';
|
|
@@ -27,7 +27,7 @@ import { Menu } from '@base-ui/react/menu';
|
|
|
27
27
|
import { AlertDialog } from '@base-ui/react/alert-dialog';
|
|
28
28
|
|
|
29
29
|
// src/version.ts
|
|
30
|
-
var version = "0.4.
|
|
30
|
+
var version = "0.4.7-alpha";
|
|
31
31
|
function Placeholder({ label = "mosaic-blocks placeholder" }) {
|
|
32
32
|
return /* @__PURE__ */ jsx("div", { "data-mosaic-block": "placeholder", children: label });
|
|
33
33
|
}
|
|
@@ -11059,7 +11059,210 @@ async function MosaicClerkWebhookHandler(req, options) {
|
|
|
11059
11059
|
}
|
|
11060
11060
|
return new Response("OK", { status: 200 });
|
|
11061
11061
|
}
|
|
11062
|
+
var documentUploadDropZoneVariants = cva(
|
|
11063
|
+
[
|
|
11064
|
+
"flex flex-col items-center justify-center text-center",
|
|
11065
|
+
"rounded-lg border-2 border-dashed p-8 gap-2",
|
|
11066
|
+
"transition-colors cursor-pointer"
|
|
11067
|
+
],
|
|
11068
|
+
{
|
|
11069
|
+
variants: {
|
|
11070
|
+
dragActive: {
|
|
11071
|
+
true: "border-ring bg-accent/40",
|
|
11072
|
+
false: "border-border hover:border-ring/50"
|
|
11073
|
+
}
|
|
11074
|
+
},
|
|
11075
|
+
defaultVariants: {
|
|
11076
|
+
dragActive: false
|
|
11077
|
+
}
|
|
11078
|
+
}
|
|
11079
|
+
);
|
|
11080
|
+
var documentUploadFileRowVariants = cva(
|
|
11081
|
+
["flex items-start gap-3 rounded-lg border p-4 transition-colors"],
|
|
11082
|
+
{
|
|
11083
|
+
variants: {
|
|
11084
|
+
status: {
|
|
11085
|
+
uploading: "border-border bg-card",
|
|
11086
|
+
success: "border-border bg-card",
|
|
11087
|
+
error: "border-destructive/40 bg-destructive/5"
|
|
11088
|
+
}
|
|
11089
|
+
},
|
|
11090
|
+
defaultVariants: {
|
|
11091
|
+
status: "uploading"
|
|
11092
|
+
}
|
|
11093
|
+
}
|
|
11094
|
+
);
|
|
11095
|
+
var documentUploadStatusLabelVariants = cva(["text-xs font-medium"], {
|
|
11096
|
+
variants: {
|
|
11097
|
+
status: {
|
|
11098
|
+
uploading: "text-muted-foreground",
|
|
11099
|
+
success: "text-foreground",
|
|
11100
|
+
error: "text-destructive"
|
|
11101
|
+
}
|
|
11102
|
+
},
|
|
11103
|
+
defaultVariants: {
|
|
11104
|
+
status: "uploading"
|
|
11105
|
+
}
|
|
11106
|
+
});
|
|
11107
|
+
var documentUploadProgressTrackVariants = cva(
|
|
11108
|
+
["h-1.5 w-full overflow-hidden rounded-full bg-muted"],
|
|
11109
|
+
{
|
|
11110
|
+
variants: {},
|
|
11111
|
+
defaultVariants: {}
|
|
11112
|
+
}
|
|
11113
|
+
);
|
|
11114
|
+
var documentUploadProgressFillVariants = cva(
|
|
11115
|
+
["h-full rounded-full bg-foreground transition-[width]"],
|
|
11116
|
+
{
|
|
11117
|
+
variants: {},
|
|
11118
|
+
defaultVariants: {}
|
|
11119
|
+
}
|
|
11120
|
+
);
|
|
11121
|
+
function cn71(...classes) {
|
|
11122
|
+
return classes.filter(Boolean).join(" ");
|
|
11123
|
+
}
|
|
11124
|
+
function MosaicDocumentUpload({
|
|
11125
|
+
files,
|
|
11126
|
+
onFilesSelected,
|
|
11127
|
+
onRemoveFile,
|
|
11128
|
+
idleLabel,
|
|
11129
|
+
dragActiveLabel,
|
|
11130
|
+
browseButtonLabel,
|
|
11131
|
+
acceptHint,
|
|
11132
|
+
dropZoneAriaLabel,
|
|
11133
|
+
removeFileAriaLabel,
|
|
11134
|
+
statusLabels,
|
|
11135
|
+
sizeLabel,
|
|
11136
|
+
accept,
|
|
11137
|
+
multiple = false,
|
|
11138
|
+
className,
|
|
11139
|
+
ref
|
|
11140
|
+
}) {
|
|
11141
|
+
const [isDragActive, setIsDragActive] = useState(false);
|
|
11142
|
+
const inputRef = useRef(null);
|
|
11143
|
+
const inputId = useId();
|
|
11144
|
+
function handleDragOver(event) {
|
|
11145
|
+
event.preventDefault();
|
|
11146
|
+
setIsDragActive(true);
|
|
11147
|
+
}
|
|
11148
|
+
function handleDragLeave() {
|
|
11149
|
+
setIsDragActive(false);
|
|
11150
|
+
}
|
|
11151
|
+
function handleDrop(event) {
|
|
11152
|
+
event.preventDefault();
|
|
11153
|
+
setIsDragActive(false);
|
|
11154
|
+
const dropped = Array.from(event.dataTransfer.files);
|
|
11155
|
+
if (dropped.length > 0) onFilesSelected(dropped);
|
|
11156
|
+
}
|
|
11157
|
+
function handleInputChange(event) {
|
|
11158
|
+
const selected = event.target.files ? Array.from(event.target.files) : [];
|
|
11159
|
+
if (selected.length > 0) onFilesSelected(selected);
|
|
11160
|
+
event.target.value = "";
|
|
11161
|
+
}
|
|
11162
|
+
return /* @__PURE__ */ jsxs("div", { ref, "data-slot": "document-upload", className: cn71("flex flex-col gap-4", className), children: [
|
|
11163
|
+
/* @__PURE__ */ jsxs(
|
|
11164
|
+
"div",
|
|
11165
|
+
{
|
|
11166
|
+
"data-slot": "document-upload-drop-zone",
|
|
11167
|
+
"aria-label": dropZoneAriaLabel,
|
|
11168
|
+
onDragOver: handleDragOver,
|
|
11169
|
+
onDragLeave: handleDragLeave,
|
|
11170
|
+
onDrop: handleDrop,
|
|
11171
|
+
className: documentUploadDropZoneVariants({ dragActive: isDragActive }),
|
|
11172
|
+
children: [
|
|
11173
|
+
/* @__PURE__ */ jsx("p", { "data-slot": "document-upload-idle-label", className: "text-sm font-medium", children: isDragActive ? dragActiveLabel : idleLabel }),
|
|
11174
|
+
/* @__PURE__ */ jsx(
|
|
11175
|
+
"input",
|
|
11176
|
+
{
|
|
11177
|
+
ref: inputRef,
|
|
11178
|
+
id: inputId,
|
|
11179
|
+
type: "file",
|
|
11180
|
+
className: "hidden",
|
|
11181
|
+
accept,
|
|
11182
|
+
multiple,
|
|
11183
|
+
onChange: handleInputChange
|
|
11184
|
+
}
|
|
11185
|
+
),
|
|
11186
|
+
/* @__PURE__ */ jsx("label", { htmlFor: inputId, children: /* @__PURE__ */ jsx(
|
|
11187
|
+
"span",
|
|
11188
|
+
{
|
|
11189
|
+
"data-slot": "document-upload-browse-button",
|
|
11190
|
+
className: "inline-flex min-h-9 items-center justify-center rounded-md border border-border px-3 text-sm font-medium hover:bg-accent/50 transition-colors",
|
|
11191
|
+
children: browseButtonLabel
|
|
11192
|
+
}
|
|
11193
|
+
) }),
|
|
11194
|
+
/* @__PURE__ */ jsx("p", { "data-slot": "document-upload-accept-hint", className: "text-xs text-muted-foreground", children: acceptHint })
|
|
11195
|
+
]
|
|
11196
|
+
}
|
|
11197
|
+
),
|
|
11198
|
+
files.length > 0 && /* @__PURE__ */ jsx("ul", { "data-slot": "document-upload-file-list", className: "flex flex-col gap-2", children: files.map((file) => /* @__PURE__ */ jsxs(
|
|
11199
|
+
"li",
|
|
11200
|
+
{
|
|
11201
|
+
"data-slot": "document-upload-file-row",
|
|
11202
|
+
"data-status": file.status,
|
|
11203
|
+
className: documentUploadFileRowVariants({ status: file.status }),
|
|
11204
|
+
children: [
|
|
11205
|
+
/* @__PURE__ */ jsxs("div", { className: "flex-1 min-w-0", children: [
|
|
11206
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-start justify-between gap-2", children: [
|
|
11207
|
+
/* @__PURE__ */ jsx("p", { "data-slot": "document-upload-file-name", className: "text-sm font-medium truncate", children: file.name }),
|
|
11208
|
+
/* @__PURE__ */ jsx(
|
|
11209
|
+
"span",
|
|
11210
|
+
{
|
|
11211
|
+
"data-slot": "document-upload-status-label",
|
|
11212
|
+
className: documentUploadStatusLabelVariants({ status: file.status }),
|
|
11213
|
+
children: statusLabels[file.status]
|
|
11214
|
+
}
|
|
11215
|
+
)
|
|
11216
|
+
] }),
|
|
11217
|
+
/* @__PURE__ */ jsx("p", { "data-slot": "document-upload-file-size", className: "text-xs text-muted-foreground", children: sizeLabel(file.sizeBytes) }),
|
|
11218
|
+
file.status === "uploading" && /* @__PURE__ */ jsx(
|
|
11219
|
+
"div",
|
|
11220
|
+
{
|
|
11221
|
+
"data-slot": "document-upload-progress-track",
|
|
11222
|
+
role: "progressbar",
|
|
11223
|
+
tabIndex: -1,
|
|
11224
|
+
"aria-valuemin": 0,
|
|
11225
|
+
"aria-valuemax": 100,
|
|
11226
|
+
"aria-valuenow": file.progress ?? 0,
|
|
11227
|
+
className: cn71(documentUploadProgressTrackVariants(), "mt-2"),
|
|
11228
|
+
children: /* @__PURE__ */ jsx(
|
|
11229
|
+
"div",
|
|
11230
|
+
{
|
|
11231
|
+
"data-slot": "document-upload-progress-fill",
|
|
11232
|
+
className: documentUploadProgressFillVariants(),
|
|
11233
|
+
style: { width: `${file.progress ?? 0}%` }
|
|
11234
|
+
}
|
|
11235
|
+
)
|
|
11236
|
+
}
|
|
11237
|
+
),
|
|
11238
|
+
file.status === "error" && file.errorMessage !== void 0 && /* @__PURE__ */ jsx(
|
|
11239
|
+
"p",
|
|
11240
|
+
{
|
|
11241
|
+
"data-slot": "document-upload-error-message",
|
|
11242
|
+
className: "mt-1 text-xs text-destructive",
|
|
11243
|
+
children: file.errorMessage
|
|
11244
|
+
}
|
|
11245
|
+
)
|
|
11246
|
+
] }),
|
|
11247
|
+
/* @__PURE__ */ jsx(
|
|
11248
|
+
"button",
|
|
11249
|
+
{
|
|
11250
|
+
type: "button",
|
|
11251
|
+
"data-slot": "document-upload-remove-button",
|
|
11252
|
+
"aria-label": removeFileAriaLabel(file.name),
|
|
11253
|
+
onClick: () => onRemoveFile(file.id),
|
|
11254
|
+
className: "shrink-0 inline-flex min-h-9 min-w-9 items-center justify-center rounded-md hover:bg-accent/50 transition-colors",
|
|
11255
|
+
children: file.status === "success" ? "\u2713" : "\u2715"
|
|
11256
|
+
}
|
|
11257
|
+
)
|
|
11258
|
+
]
|
|
11259
|
+
},
|
|
11260
|
+
file.id
|
|
11261
|
+
)) })
|
|
11262
|
+
] });
|
|
11263
|
+
}
|
|
11264
|
+
MosaicDocumentUpload.displayName = "MosaicDocumentUpload";
|
|
11062
11265
|
|
|
11063
|
-
export { MosaicAccordion, MosaicAccordionItem, MosaicAccordionPanel, MosaicAccordionTrigger, MosaicActivityFeed, MosaicActivityItem, MosaicAdaptiveGrid, MosaicAdaptiveModal, MosaicAdaptiveNavigation, MosaicAgentCard, MosaicAgentComposer, MosaicAgentComposerDesktop, MosaicAgentComposerMobile, MosaicAgentList, AgentListDesktop as MosaicAgentListDesktop, AgentListMobile as MosaicAgentListMobile, MosaicAgentTeamPreview, MosaicAnimatedList, MosaicAppSidebar, MosaicAvatar, MosaicBadge, MosaicBlurredOrb, MosaicButton, MosaicCard, MosaicCardContent, MosaicCardDescription, MosaicCardFooter, MosaicCardHeader, MosaicCardTitle, MosaicCheckbox, MosaicClerkOrgSwitcher, MosaicClerkWebhookHandler, MosaicCollapsible, MosaicCollapsiblePanel, MosaicCollapsibleTrigger, MosaicCombobox, MosaicCounter, MosaicCreateOrgDialog, MosaicDashboardContent, MosaicDashboardHeader, MosaicDashboardLayout, MosaicDataTable, MosaicDeleteConfirmationDialog, MosaicDeviceProvider, MosaicDropdownMenu, MosaicEmptyState, MosaicFallingPattern, MosaicFeature3Col, MosaicFeatureCenteredMedia, MosaicField, MosaicFieldControl, MosaicFieldDescription, MosaicFieldError, MosaicFieldLabel, MosaicFilterBar, MosaicFilterSidebar, MosaicFooterSimple, MosaicHeroSplit, MosaicInput, MosaicInputGroup, MosaicIntegrationsBadge, MosaicInviteMemberDialog, MosaicKanbanBoard, MosaicKanbanColumn, MosaicLogosGrid, MosaicMainNav, MosaicMarketplaceList, MarketplaceListDesktop as MosaicMarketplaceListDesktop, MarketplaceListMobile as MosaicMarketplaceListMobile, MosaicMemberList, MosaicMemoryCard, MosaicMessageCard, MosaicMessageList, MessageListDesktop as MosaicMessageListDesktop, MessageListMobile as MosaicMessageListMobile, MosaicModuleCard, MosaicModuleForm, MosaicModuleLibrary, MosaicMultiOrgIndicator, MosaicMultiTenantProvider, MosaicNavbar, MosaicOrgPanel, MosaicOrgProfilePage, MosaicOrgRoleBadge, MosaicOrgSwitcher, MosaicPreferencesPanel, MosaicPricingCard, MosaicProfilePanel, MosaicProgress, MosaicQuickActionCard, MosaicQuickActionsMenu, MosaicQuickAgentSelector, MosaicQuickStartPanel, MosaicRadioGroup, MosaicRadioGroupItem, MosaicScrollArea, MosaicSelect, MosaicSelectorModal, MosaicSeparator, MosaicSignInLayout, MosaicSignUpLayout, MosaicSkeleton, MosaicSlider, MosaicStatsGrid, MosaicStepPipeline, MosaicSwitch, MosaicTabs, MosaicTabsList, MosaicTabsPanel, MosaicTabsTrigger, MosaicTemplateCard, MosaicTemplateGallery, MosaicTemplatePreview, MosaicTestimonialsGrid, MosaicTextarea, MosaicThemeProvider, MosaicThemeToggle, MosaicTooltip, MosaicTooltipContent, MosaicTooltipProvider, MosaicTooltipRoot, MosaicTooltipTrigger, MosaicUserButton, Placeholder, badgeVariants, buttonVariants, skeletonVariants, useBreakpoint, useDevice, useMosaicWorkspace as useEffectiveWorkspaceId, useIsDesktop, useIsMobile, useIsTablet, useMediaQuery, useMosaicWorkspace, useOrientation, useViewport, version };
|
|
11266
|
+
export { MosaicAccordion, MosaicAccordionItem, MosaicAccordionPanel, MosaicAccordionTrigger, MosaicActivityFeed, MosaicActivityItem, MosaicAdaptiveGrid, MosaicAdaptiveModal, MosaicAdaptiveNavigation, MosaicAgentCard, MosaicAgentComposer, MosaicAgentComposerDesktop, MosaicAgentComposerMobile, MosaicAgentList, AgentListDesktop as MosaicAgentListDesktop, AgentListMobile as MosaicAgentListMobile, MosaicAgentTeamPreview, MosaicAnimatedList, MosaicAppSidebar, MosaicAvatar, MosaicBadge, MosaicBlurredOrb, MosaicButton, MosaicCard, MosaicCardContent, MosaicCardDescription, MosaicCardFooter, MosaicCardHeader, MosaicCardTitle, MosaicCheckbox, MosaicClerkOrgSwitcher, MosaicClerkWebhookHandler, MosaicCollapsible, MosaicCollapsiblePanel, MosaicCollapsibleTrigger, MosaicCombobox, MosaicCounter, MosaicCreateOrgDialog, MosaicDashboardContent, MosaicDashboardHeader, MosaicDashboardLayout, MosaicDataTable, MosaicDeleteConfirmationDialog, MosaicDeviceProvider, MosaicDocumentUpload, MosaicDropdownMenu, MosaicEmptyState, MosaicFallingPattern, MosaicFeature3Col, MosaicFeatureCenteredMedia, MosaicField, MosaicFieldControl, MosaicFieldDescription, MosaicFieldError, MosaicFieldLabel, MosaicFilterBar, MosaicFilterSidebar, MosaicFooterSimple, MosaicHeroSplit, MosaicInput, MosaicInputGroup, MosaicIntegrationsBadge, MosaicInviteMemberDialog, MosaicKanbanBoard, MosaicKanbanColumn, MosaicLogosGrid, MosaicMainNav, MosaicMarketplaceList, MarketplaceListDesktop as MosaicMarketplaceListDesktop, MarketplaceListMobile as MosaicMarketplaceListMobile, MosaicMemberList, MosaicMemoryCard, MosaicMessageCard, MosaicMessageList, MessageListDesktop as MosaicMessageListDesktop, MessageListMobile as MosaicMessageListMobile, MosaicModuleCard, MosaicModuleForm, MosaicModuleLibrary, MosaicMultiOrgIndicator, MosaicMultiTenantProvider, MosaicNavbar, MosaicOrgPanel, MosaicOrgProfilePage, MosaicOrgRoleBadge, MosaicOrgSwitcher, MosaicPreferencesPanel, MosaicPricingCard, MosaicProfilePanel, MosaicProgress, MosaicQuickActionCard, MosaicQuickActionsMenu, MosaicQuickAgentSelector, MosaicQuickStartPanel, MosaicRadioGroup, MosaicRadioGroupItem, MosaicScrollArea, MosaicSelect, MosaicSelectorModal, MosaicSeparator, MosaicSignInLayout, MosaicSignUpLayout, MosaicSkeleton, MosaicSlider, MosaicStatsGrid, MosaicStepPipeline, MosaicSwitch, MosaicTabs, MosaicTabsList, MosaicTabsPanel, MosaicTabsTrigger, MosaicTemplateCard, MosaicTemplateGallery, MosaicTemplatePreview, MosaicTestimonialsGrid, MosaicTextarea, MosaicThemeProvider, MosaicThemeToggle, MosaicTooltip, MosaicTooltipContent, MosaicTooltipProvider, MosaicTooltipRoot, MosaicTooltipTrigger, MosaicUserButton, Placeholder, badgeVariants, buttonVariants, skeletonVariants, useBreakpoint, useDevice, useMosaicWorkspace as useEffectiveWorkspaceId, useIsDesktop, useIsMobile, useIsTablet, useMediaQuery, useMosaicWorkspace, useOrientation, useViewport, version };
|
|
11064
11267
|
//# sourceMappingURL=index.js.map
|
|
11065
11268
|
//# sourceMappingURL=index.js.map
|