@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 CHANGED
@@ -10,7 +10,7 @@
10
10
 
11
11
  ## 1. Hero & Positioning
12
12
 
13
- `@vantageos/mosaic-blocks` is the **React composed-block layer** of the VantageOS Mosaic design system. It provides 123 opinionated, fully-typed UI components that integrate natively with:
13
+ `@vantageos/mosaic-blocks` is the **React composed-block layer** of the VantageOS Mosaic design system. It provides 124 opinionated, fully-typed UI components that integrate natively with:
14
14
 
15
15
  - **Clerk** — auth sign-in/up flows, org switcher, RBAC, webhook sync
16
16
  - **Convex** — real-time data binding ready
@@ -169,7 +169,7 @@ For OKLCH design tokens, pair with `@vantageos/mosaic-tokens` — see [Section 1
169
169
 
170
170
  ## 6. Component Catalogue Summary
171
171
 
172
- 123 exported `Mosaic*` components across 9 sections (140 total named exports including hooks, variant helpers, and unprefixed aliases such as `Tooltip`/`Accordion`). This count is enforced by `src/__tests__/readme-matches-exports.test.ts` — it fails CI if this README drifts from `src/index.ts` again. Full reference: [docs/components-catalog.md](docs/components-catalog.md).
172
+ 124 exported `Mosaic*` components across 9 sections (141 total named exports including hooks, variant helpers, and unprefixed aliases such as `Tooltip`/`Accordion`). This count is enforced by `src/__tests__/readme-matches-exports.test.ts` — it fails CI if this README drifts from `src/index.ts` again. Full reference: [docs/components-catalog.md](docs/components-catalog.md).
173
173
 
174
174
  > There is **no "Debate" section**. No `Mosaic*` debate component (room/timer/participant) is exported by this package — despite the "absorbed from anydebate" origin story below, the debate UI was never ported. If you need debate-room UI, it does not exist here yet.
175
175
 
@@ -179,7 +179,7 @@ For OKLCH design tokens, pair with `@vantageos/mosaic-tokens` — see [Section 1
179
179
  | Device / Adaptive | `MosaicDeviceProvider`, `MosaicAdaptiveGrid`, `MosaicAdaptiveModal`, `MosaicAdaptiveNavigation` | 4 |
180
180
  | Auth / Multi-tenant | `MosaicMultiTenantProvider`, `MosaicSignInLayout`, `MosaicOrgPanel`, `MosaicClerkWebhookHandler` | 14 |
181
181
  | Agents & messaging | `MosaicAgentComposer`, `MosaicAgentCard`, `MosaicAgentList`, `MosaicMessageList`, `MosaicMarketplaceList` | 28 |
182
- | Data display | `MosaicDataTable`, `MosaicKanbanBoard`, `MosaicStepPipeline`, `MosaicActivityFeed` | 6 |
182
+ | Data display | `MosaicDataTable`, `MosaicKanbanBoard`, `MosaicStepPipeline`, `MosaicActivityFeed`, `MosaicDocumentUpload` | 7 |
183
183
  | Forms & inputs | `MosaicInput`, `MosaicSelect`, `MosaicField`, `MosaicCombobox`, `MosaicFilterBar` | 17 |
184
184
  | Primitives (incl. base-ui atoms) | `MosaicButton`, `MosaicBadge`, `MosaicCard`, `MosaicTabs`, `MosaicTooltip`, `MosaicAccordion` | 30 |
185
185
  | Landing & utility blocks | `MosaicHeroSplit`, `MosaicStatsGrid`, `MosaicPricingCard`, `MosaicCounter`, `MosaicThemeToggle` | 13 |
@@ -470,7 +470,7 @@ This package follows [Semantic Versioning](https://semver.org/). While in alpha
470
470
 
471
471
  | Version | Status | Notes |
472
472
  |---|---|---|
473
- | `0.4.6-alpha` | Current | 123 exported `Mosaic*` components, Clerk auth, mobile-first, Storybook 10, 30 stories |
473
+ | `0.4.7-alpha` | Current | 124 exported `Mosaic*` components, Clerk auth, mobile-first, Storybook 10, 30 stories |
474
474
  | `0.2.0-alpha` | Historical | anydebate absorb (partial) — counts quoted for this release are historical and superseded by the Current row above; see [CHANGELOG.md](CHANGELOG.md) |
475
475
  | `0.1.0-alpha.1` | Historical | Initial alpha publish |
476
476
 
package/dist/index.cjs CHANGED
@@ -46,7 +46,7 @@ function _interopNamespace(e) {
46
46
  var React28__namespace = /*#__PURE__*/_interopNamespace(React28);
47
47
 
48
48
  // src/version.ts
49
- var version = "0.4.6-alpha";
49
+ var version = "0.4.7-alpha";
50
50
  function Placeholder({ label = "mosaic-blocks placeholder" }) {
51
51
  return /* @__PURE__ */ jsxRuntime.jsx("div", { "data-mosaic-block": "placeholder", children: label });
52
52
  }
@@ -11078,6 +11078,209 @@ async function MosaicClerkWebhookHandler(req, options) {
11078
11078
  }
11079
11079
  return new Response("OK", { status: 200 });
11080
11080
  }
11081
+ var documentUploadDropZoneVariants = classVarianceAuthority.cva(
11082
+ [
11083
+ "flex flex-col items-center justify-center text-center",
11084
+ "rounded-lg border-2 border-dashed p-8 gap-2",
11085
+ "transition-colors cursor-pointer"
11086
+ ],
11087
+ {
11088
+ variants: {
11089
+ dragActive: {
11090
+ true: "border-ring bg-accent/40",
11091
+ false: "border-border hover:border-ring/50"
11092
+ }
11093
+ },
11094
+ defaultVariants: {
11095
+ dragActive: false
11096
+ }
11097
+ }
11098
+ );
11099
+ var documentUploadFileRowVariants = classVarianceAuthority.cva(
11100
+ ["flex items-start gap-3 rounded-lg border p-4 transition-colors"],
11101
+ {
11102
+ variants: {
11103
+ status: {
11104
+ uploading: "border-border bg-card",
11105
+ success: "border-border bg-card",
11106
+ error: "border-destructive/40 bg-destructive/5"
11107
+ }
11108
+ },
11109
+ defaultVariants: {
11110
+ status: "uploading"
11111
+ }
11112
+ }
11113
+ );
11114
+ var documentUploadStatusLabelVariants = classVarianceAuthority.cva(["text-xs font-medium"], {
11115
+ variants: {
11116
+ status: {
11117
+ uploading: "text-muted-foreground",
11118
+ success: "text-foreground",
11119
+ error: "text-destructive"
11120
+ }
11121
+ },
11122
+ defaultVariants: {
11123
+ status: "uploading"
11124
+ }
11125
+ });
11126
+ var documentUploadProgressTrackVariants = classVarianceAuthority.cva(
11127
+ ["h-1.5 w-full overflow-hidden rounded-full bg-muted"],
11128
+ {
11129
+ variants: {},
11130
+ defaultVariants: {}
11131
+ }
11132
+ );
11133
+ var documentUploadProgressFillVariants = classVarianceAuthority.cva(
11134
+ ["h-full rounded-full bg-foreground transition-[width]"],
11135
+ {
11136
+ variants: {},
11137
+ defaultVariants: {}
11138
+ }
11139
+ );
11140
+ function cn71(...classes) {
11141
+ return classes.filter(Boolean).join(" ");
11142
+ }
11143
+ function MosaicDocumentUpload({
11144
+ files,
11145
+ onFilesSelected,
11146
+ onRemoveFile,
11147
+ idleLabel,
11148
+ dragActiveLabel,
11149
+ browseButtonLabel,
11150
+ acceptHint,
11151
+ dropZoneAriaLabel,
11152
+ removeFileAriaLabel,
11153
+ statusLabels,
11154
+ sizeLabel,
11155
+ accept,
11156
+ multiple = false,
11157
+ className,
11158
+ ref
11159
+ }) {
11160
+ const [isDragActive, setIsDragActive] = React28.useState(false);
11161
+ const inputRef = React28.useRef(null);
11162
+ const inputId = React28.useId();
11163
+ function handleDragOver(event) {
11164
+ event.preventDefault();
11165
+ setIsDragActive(true);
11166
+ }
11167
+ function handleDragLeave() {
11168
+ setIsDragActive(false);
11169
+ }
11170
+ function handleDrop(event) {
11171
+ event.preventDefault();
11172
+ setIsDragActive(false);
11173
+ const dropped = Array.from(event.dataTransfer.files);
11174
+ if (dropped.length > 0) onFilesSelected(dropped);
11175
+ }
11176
+ function handleInputChange(event) {
11177
+ const selected = event.target.files ? Array.from(event.target.files) : [];
11178
+ if (selected.length > 0) onFilesSelected(selected);
11179
+ event.target.value = "";
11180
+ }
11181
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { ref, "data-slot": "document-upload", className: cn71("flex flex-col gap-4", className), children: [
11182
+ /* @__PURE__ */ jsxRuntime.jsxs(
11183
+ "div",
11184
+ {
11185
+ "data-slot": "document-upload-drop-zone",
11186
+ "aria-label": dropZoneAriaLabel,
11187
+ onDragOver: handleDragOver,
11188
+ onDragLeave: handleDragLeave,
11189
+ onDrop: handleDrop,
11190
+ className: documentUploadDropZoneVariants({ dragActive: isDragActive }),
11191
+ children: [
11192
+ /* @__PURE__ */ jsxRuntime.jsx("p", { "data-slot": "document-upload-idle-label", className: "text-sm font-medium", children: isDragActive ? dragActiveLabel : idleLabel }),
11193
+ /* @__PURE__ */ jsxRuntime.jsx(
11194
+ "input",
11195
+ {
11196
+ ref: inputRef,
11197
+ id: inputId,
11198
+ type: "file",
11199
+ className: "hidden",
11200
+ accept,
11201
+ multiple,
11202
+ onChange: handleInputChange
11203
+ }
11204
+ ),
11205
+ /* @__PURE__ */ jsxRuntime.jsx("label", { htmlFor: inputId, children: /* @__PURE__ */ jsxRuntime.jsx(
11206
+ "span",
11207
+ {
11208
+ "data-slot": "document-upload-browse-button",
11209
+ 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",
11210
+ children: browseButtonLabel
11211
+ }
11212
+ ) }),
11213
+ /* @__PURE__ */ jsxRuntime.jsx("p", { "data-slot": "document-upload-accept-hint", className: "text-xs text-muted-foreground", children: acceptHint })
11214
+ ]
11215
+ }
11216
+ ),
11217
+ files.length > 0 && /* @__PURE__ */ jsxRuntime.jsx("ul", { "data-slot": "document-upload-file-list", className: "flex flex-col gap-2", children: files.map((file) => /* @__PURE__ */ jsxRuntime.jsxs(
11218
+ "li",
11219
+ {
11220
+ "data-slot": "document-upload-file-row",
11221
+ "data-status": file.status,
11222
+ className: documentUploadFileRowVariants({ status: file.status }),
11223
+ children: [
11224
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex-1 min-w-0", children: [
11225
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-start justify-between gap-2", children: [
11226
+ /* @__PURE__ */ jsxRuntime.jsx("p", { "data-slot": "document-upload-file-name", className: "text-sm font-medium truncate", children: file.name }),
11227
+ /* @__PURE__ */ jsxRuntime.jsx(
11228
+ "span",
11229
+ {
11230
+ "data-slot": "document-upload-status-label",
11231
+ className: documentUploadStatusLabelVariants({ status: file.status }),
11232
+ children: statusLabels[file.status]
11233
+ }
11234
+ )
11235
+ ] }),
11236
+ /* @__PURE__ */ jsxRuntime.jsx("p", { "data-slot": "document-upload-file-size", className: "text-xs text-muted-foreground", children: sizeLabel(file.sizeBytes) }),
11237
+ file.status === "uploading" && /* @__PURE__ */ jsxRuntime.jsx(
11238
+ "div",
11239
+ {
11240
+ "data-slot": "document-upload-progress-track",
11241
+ role: "progressbar",
11242
+ tabIndex: -1,
11243
+ "aria-valuemin": 0,
11244
+ "aria-valuemax": 100,
11245
+ "aria-valuenow": file.progress ?? 0,
11246
+ className: cn71(documentUploadProgressTrackVariants(), "mt-2"),
11247
+ children: /* @__PURE__ */ jsxRuntime.jsx(
11248
+ "div",
11249
+ {
11250
+ "data-slot": "document-upload-progress-fill",
11251
+ className: documentUploadProgressFillVariants(),
11252
+ style: { width: `${file.progress ?? 0}%` }
11253
+ }
11254
+ )
11255
+ }
11256
+ ),
11257
+ file.status === "error" && file.errorMessage !== void 0 && /* @__PURE__ */ jsxRuntime.jsx(
11258
+ "p",
11259
+ {
11260
+ "data-slot": "document-upload-error-message",
11261
+ className: "mt-1 text-xs text-destructive",
11262
+ children: file.errorMessage
11263
+ }
11264
+ )
11265
+ ] }),
11266
+ /* @__PURE__ */ jsxRuntime.jsx(
11267
+ "button",
11268
+ {
11269
+ type: "button",
11270
+ "data-slot": "document-upload-remove-button",
11271
+ "aria-label": removeFileAriaLabel(file.name),
11272
+ onClick: () => onRemoveFile(file.id),
11273
+ className: "shrink-0 inline-flex min-h-9 min-w-9 items-center justify-center rounded-md hover:bg-accent/50 transition-colors",
11274
+ children: file.status === "success" ? "\u2713" : "\u2715"
11275
+ }
11276
+ )
11277
+ ]
11278
+ },
11279
+ file.id
11280
+ )) })
11281
+ ] });
11282
+ }
11283
+ MosaicDocumentUpload.displayName = "MosaicDocumentUpload";
11081
11284
 
11082
11285
  Object.defineProperty(exports, "Accordion", {
11083
11286
  enumerable: true,
@@ -11131,6 +11334,7 @@ exports.MosaicDashboardLayout = MosaicDashboardLayout;
11131
11334
  exports.MosaicDataTable = MosaicDataTable;
11132
11335
  exports.MosaicDeleteConfirmationDialog = MosaicDeleteConfirmationDialog;
11133
11336
  exports.MosaicDeviceProvider = MosaicDeviceProvider;
11337
+ exports.MosaicDocumentUpload = MosaicDocumentUpload;
11134
11338
  exports.MosaicDropdownMenu = MosaicDropdownMenu;
11135
11339
  exports.MosaicEmptyState = MosaicEmptyState;
11136
11340
  exports.MosaicFallingPattern = MosaicFallingPattern;