@vantageos/mosaic-blocks 0.4.7-alpha → 0.4.8-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 124 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 125 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
- 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).
172
+ 125 exported `Mosaic*` components across 9 sections (142 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`, `MosaicDocumentUpload` | 7 |
182
+ | Data display | `MosaicDataTable`, `MosaicKanbanBoard`, `MosaicStepPipeline`, `MosaicActivityFeed`, `MosaicDocumentUpload`, `MosaicUrlScraper` | 8 |
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,8 @@ This package follows [Semantic Versioning](https://semver.org/). While in alpha
470
470
 
471
471
  | Version | Status | Notes |
472
472
  |---|---|---|
473
- | `0.4.7-alpha` | Current | 124 exported `Mosaic*` components, Clerk auth, mobile-first, Storybook 10, 30 stories |
473
+ | `0.4.8-alpha` | Current | 125 exported `Mosaic*` components, Clerk auth, mobile-first, Storybook 10, 30 stories |
474
+ | `0.4.7-alpha` | Historical | 124 shipped `Mosaic*` components — superseded by the Current row above |
474
475
  | `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
476
  | `0.1.0-alpha.1` | Historical | Initial alpha publish |
476
477
 
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.7-alpha";
49
+ var version = "0.4.8-alpha";
50
50
  function Placeholder({ label = "mosaic-blocks placeholder" }) {
51
51
  return /* @__PURE__ */ jsxRuntime.jsx("div", { "data-mosaic-block": "placeholder", children: label });
52
52
  }
@@ -11281,6 +11281,208 @@ function MosaicDocumentUpload({
11281
11281
  ] });
11282
11282
  }
11283
11283
  MosaicDocumentUpload.displayName = "MosaicDocumentUpload";
11284
+ var urlScraperInputVariants = classVarianceAuthority.cva(
11285
+ [
11286
+ "min-h-9 flex-1 rounded-md border bg-transparent px-3 text-sm outline-none",
11287
+ "transition-colors focus-visible:ring-2 focus-visible:ring-ring disabled:opacity-50"
11288
+ ],
11289
+ {
11290
+ variants: {
11291
+ invalid: {
11292
+ true: "border-destructive",
11293
+ false: "border-border"
11294
+ }
11295
+ },
11296
+ defaultVariants: {
11297
+ invalid: false
11298
+ }
11299
+ }
11300
+ );
11301
+ var urlScraperMessageVariants = classVarianceAuthority.cva(["text-sm"], {
11302
+ variants: {
11303
+ tone: {
11304
+ error: "text-destructive",
11305
+ muted: "text-muted-foreground"
11306
+ }
11307
+ },
11308
+ defaultVariants: {
11309
+ tone: "muted"
11310
+ }
11311
+ });
11312
+ var urlScraperCardVariants = classVarianceAuthority.cva(["flex flex-col gap-2 rounded-lg border p-4"], {
11313
+ variants: {
11314
+ tone: {
11315
+ neutral: "border-border bg-card",
11316
+ error: "border-destructive/40 bg-destructive/5"
11317
+ }
11318
+ },
11319
+ defaultVariants: {
11320
+ tone: "neutral"
11321
+ }
11322
+ });
11323
+ function cn72(...classes) {
11324
+ return classes.filter(Boolean).join(" ");
11325
+ }
11326
+ function isSyntacticallyValidUrl(candidate) {
11327
+ try {
11328
+ new URL(candidate);
11329
+ return true;
11330
+ } catch {
11331
+ return false;
11332
+ }
11333
+ }
11334
+ function MosaicUrlScraper(props) {
11335
+ const {
11336
+ url,
11337
+ onUrlChange,
11338
+ onScrape,
11339
+ inputAriaLabel,
11340
+ inputPlaceholder,
11341
+ scrapeButtonLabel,
11342
+ invalidUrlMessage,
11343
+ className,
11344
+ ref
11345
+ } = props;
11346
+ const [isLocallyInvalid, setIsLocallyInvalid] = React28.useState(false);
11347
+ const isBusy = props.status === "loading" || props.status === "success";
11348
+ function handleSubmit(event) {
11349
+ event.preventDefault();
11350
+ const trimmed = url.trim();
11351
+ if (!isSyntacticallyValidUrl(trimmed)) {
11352
+ setIsLocallyInvalid(true);
11353
+ return;
11354
+ }
11355
+ setIsLocallyInvalid(false);
11356
+ onScrape(trimmed);
11357
+ }
11358
+ function handleUrlChange(event) {
11359
+ setIsLocallyInvalid(false);
11360
+ onUrlChange(event.target.value);
11361
+ }
11362
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { ref, "data-slot": "url-scraper", className: cn72("flex flex-col gap-4", className), children: [
11363
+ /* @__PURE__ */ jsxRuntime.jsxs(
11364
+ "form",
11365
+ {
11366
+ "data-slot": "url-scraper-form",
11367
+ onSubmit: handleSubmit,
11368
+ className: "flex flex-col gap-2 md:flex-row",
11369
+ children: [
11370
+ /* @__PURE__ */ jsxRuntime.jsx(
11371
+ "input",
11372
+ {
11373
+ type: "url",
11374
+ "data-slot": "url-scraper-input",
11375
+ "aria-label": inputAriaLabel,
11376
+ placeholder: inputPlaceholder,
11377
+ value: url,
11378
+ onChange: handleUrlChange,
11379
+ disabled: isBusy,
11380
+ className: urlScraperInputVariants({ invalid: isLocallyInvalid })
11381
+ }
11382
+ ),
11383
+ /* @__PURE__ */ jsxRuntime.jsx(
11384
+ "button",
11385
+ {
11386
+ type: "submit",
11387
+ "data-slot": "url-scraper-submit-button",
11388
+ disabled: isBusy,
11389
+ className: "min-h-9 inline-flex items-center justify-center rounded-md border border-border px-4 text-sm font-medium transition-colors hover:bg-accent/50 disabled:opacity-50",
11390
+ children: props.status === "loading" ? props.scrapingLabel : scrapeButtonLabel
11391
+ }
11392
+ )
11393
+ ]
11394
+ }
11395
+ ),
11396
+ isLocallyInvalid && /* @__PURE__ */ jsxRuntime.jsx(
11397
+ "p",
11398
+ {
11399
+ "data-slot": "url-scraper-invalid-message",
11400
+ className: urlScraperMessageVariants({ tone: "error" }),
11401
+ children: invalidUrlMessage
11402
+ }
11403
+ ),
11404
+ props.status === "loading" && /* @__PURE__ */ jsxRuntime.jsx(
11405
+ "output",
11406
+ {
11407
+ "data-slot": "url-scraper-loading",
11408
+ className: urlScraperCardVariants({ tone: "neutral" }),
11409
+ children: /* @__PURE__ */ jsxRuntime.jsx("p", { className: urlScraperMessageVariants({ tone: "muted" }), children: props.loadingMessage })
11410
+ }
11411
+ ),
11412
+ props.status === "error" && /* @__PURE__ */ jsxRuntime.jsxs("div", { "data-slot": "url-scraper-error", className: urlScraperCardVariants({ tone: "error" }), children: [
11413
+ /* @__PURE__ */ jsxRuntime.jsx(
11414
+ "p",
11415
+ {
11416
+ "data-slot": "url-scraper-error-message",
11417
+ className: urlScraperMessageVariants({ tone: "error" }),
11418
+ children: props.errorMessage
11419
+ }
11420
+ ),
11421
+ /* @__PURE__ */ jsxRuntime.jsx(
11422
+ "button",
11423
+ {
11424
+ type: "button",
11425
+ "data-slot": "url-scraper-reset-button",
11426
+ onClick: props.onReset,
11427
+ className: "min-h-9 inline-flex w-fit items-center justify-center rounded-md border border-border px-3 text-sm font-medium transition-colors hover:bg-accent/50",
11428
+ children: props.resetButtonLabel
11429
+ }
11430
+ )
11431
+ ] }),
11432
+ props.status === "success" && /* @__PURE__ */ jsxRuntime.jsxs(
11433
+ "div",
11434
+ {
11435
+ "data-slot": "url-scraper-content",
11436
+ className: urlScraperCardVariants({ tone: "neutral" }),
11437
+ children: [
11438
+ props.content.image !== void 0 && /* @__PURE__ */ jsxRuntime.jsx(
11439
+ "img",
11440
+ {
11441
+ "data-slot": "url-scraper-image",
11442
+ src: props.content.image,
11443
+ alt: props.imageAlt(props.content.title),
11444
+ className: "h-32 w-full rounded-md object-cover md:h-48"
11445
+ }
11446
+ ),
11447
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-start justify-between gap-2", children: [
11448
+ /* @__PURE__ */ jsxRuntime.jsx("h3", { "data-slot": "url-scraper-title", className: "text-base font-semibold md:text-lg", children: props.content.title }),
11449
+ /* @__PURE__ */ jsxRuntime.jsx(
11450
+ "a",
11451
+ {
11452
+ "data-slot": "url-scraper-link",
11453
+ href: props.content.url,
11454
+ target: "_blank",
11455
+ rel: "noopener noreferrer",
11456
+ "aria-label": props.openLinkAriaLabel(props.content.url),
11457
+ className: "shrink-0 text-sm text-muted-foreground transition-colors hover:text-foreground",
11458
+ children: "\u2197"
11459
+ }
11460
+ )
11461
+ ] }),
11462
+ /* @__PURE__ */ jsxRuntime.jsx(
11463
+ "p",
11464
+ {
11465
+ "data-slot": "url-scraper-description",
11466
+ className: urlScraperMessageVariants({ tone: "muted" }),
11467
+ children: props.content.description
11468
+ }
11469
+ ),
11470
+ /* @__PURE__ */ jsxRuntime.jsx(
11471
+ "button",
11472
+ {
11473
+ type: "button",
11474
+ "data-slot": "url-scraper-reset-button",
11475
+ onClick: props.onReset,
11476
+ className: "min-h-9 inline-flex w-fit items-center justify-center rounded-md border border-border px-3 text-sm font-medium transition-colors hover:bg-accent/50",
11477
+ children: props.resetButtonLabel
11478
+ }
11479
+ )
11480
+ ]
11481
+ }
11482
+ )
11483
+ ] });
11484
+ }
11485
+ MosaicUrlScraper.displayName = "MosaicUrlScraper";
11284
11486
 
11285
11487
  Object.defineProperty(exports, "Accordion", {
11286
11488
  enumerable: true,
@@ -11413,6 +11615,7 @@ exports.MosaicTooltipContent = MosaicTooltipContent;
11413
11615
  exports.MosaicTooltipProvider = MosaicTooltipProvider;
11414
11616
  exports.MosaicTooltipRoot = MosaicTooltipRoot;
11415
11617
  exports.MosaicTooltipTrigger = MosaicTooltipTrigger;
11618
+ exports.MosaicUrlScraper = MosaicUrlScraper;
11416
11619
  exports.MosaicUserButton = MosaicUserButton;
11417
11620
  exports.Placeholder = Placeholder;
11418
11621
  exports.badgeVariants = badgeVariants;