@vantageos/mosaic-blocks 0.4.7-alpha → 0.4.9-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.9-alpha";
50
50
  function Placeholder({ label = "mosaic-blocks placeholder" }) {
51
51
  return /* @__PURE__ */ jsxRuntime.jsx("div", { "data-mosaic-block": "placeholder", children: label });
52
52
  }
@@ -6047,25 +6047,24 @@ var SOURCE_ICONS = {
6047
6047
  document: FileIcon,
6048
6048
  url: LinkIcon
6049
6049
  };
6050
- function MosaicMemoryCard({
6051
- memory,
6052
- variant = "detailed",
6053
- onEdit,
6054
- onDelete,
6055
- editLabel,
6056
- deleteLabel,
6057
- moreActionsLabel,
6058
- formatScope,
6059
- formatTimeAgo,
6060
- formatUsageCount,
6061
- formatMoreTags,
6062
- className,
6063
- ref
6064
- }) {
6050
+ function MosaicMemoryCard(props) {
6051
+ const {
6052
+ memory,
6053
+ onEdit,
6054
+ onDelete,
6055
+ editLabel,
6056
+ deleteLabel,
6057
+ moreActionsLabel,
6058
+ formatScope,
6059
+ formatTimeAgo,
6060
+ formatUsageCount,
6061
+ className,
6062
+ ref
6063
+ } = props;
6064
+ const variant = props.variant ?? "detailed";
6065
6065
  const [menuOpen, setMenuOpen] = React28__namespace.useState(false);
6066
6066
  const menuRef = React28__namespace.useRef(null);
6067
6067
  const SourceIcon = SOURCE_ICONS[memory.source];
6068
- const isDetailed = variant === "detailed";
6069
6068
  React28__namespace.useEffect(() => {
6070
6069
  if (!menuOpen) return;
6071
6070
  const handler = (event) => {
@@ -6137,7 +6136,7 @@ function MosaicMemoryCard({
6137
6136
  "data-slot": "memory-card",
6138
6137
  "data-variant": variant,
6139
6138
  className: cn53(memoryCardVariants({ variant }), className),
6140
- children: isDetailed ? /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-3", children: [
6139
+ children: props.variant !== "compact" ? /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-3", children: [
6141
6140
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-start justify-between gap-3", children: [
6142
6141
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex min-w-0 flex-1 items-start gap-3", children: [
6143
6142
  /* @__PURE__ */ jsxRuntime.jsx("div", { className: "rounded-lg bg-muted p-2 text-muted-foreground", children: /* @__PURE__ */ jsxRuntime.jsx(SourceIcon, {}) }),
@@ -6160,7 +6159,7 @@ function MosaicMemoryCard({
6160
6159
  /* @__PURE__ */ jsxRuntime.jsx("p", { className: "line-clamp-3 text-sm text-muted-foreground", children: memory.content }),
6161
6160
  /* @__PURE__ */ jsxRuntime.jsxs("div", { "data-slot": "memory-tags", className: "flex flex-wrap gap-1", children: [
6162
6161
  visibleTags.map((tag) => /* @__PURE__ */ jsxRuntime.jsx("span", { className: cn53(memoryTagBadgeVariants()), children: tag }, tag)),
6163
- hiddenTagCount > 0 && /* @__PURE__ */ jsxRuntime.jsx("span", { className: cn53(memoryTagBadgeVariants()), children: formatMoreTags(hiddenTagCount) })
6162
+ hiddenTagCount > 0 && /* @__PURE__ */ jsxRuntime.jsx("span", { className: cn53(memoryTagBadgeVariants()), children: props.formatMoreTags(hiddenTagCount) })
6164
6163
  ] }),
6165
6164
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center justify-between border-t pt-2 text-xs text-muted-foreground", children: [
6166
6165
  /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "flex items-center gap-1", children: [
@@ -8568,21 +8567,20 @@ function XIcon2() {
8568
8567
  }
8569
8568
  );
8570
8569
  }
8571
- function MosaicModuleForm({
8572
- item,
8573
- mode,
8574
- formFields = [],
8575
- onSave,
8576
- onCancel,
8577
- nameFieldLabel,
8578
- descriptionFieldLabel,
8579
- namePlaceholder,
8580
- descriptionPlaceholder,
8581
- cancelLabel,
8582
- saveChangesLabel,
8583
- createItemLabel,
8584
- tagListAddPlaceholder
8585
- }) {
8570
+ function MosaicModuleForm(props) {
8571
+ const {
8572
+ item,
8573
+ mode,
8574
+ formFields = [],
8575
+ onSave,
8576
+ onCancel,
8577
+ nameFieldLabel,
8578
+ descriptionFieldLabel,
8579
+ namePlaceholder,
8580
+ descriptionPlaceholder,
8581
+ cancelLabel,
8582
+ tagListAddPlaceholder
8583
+ } = props;
8586
8584
  const [formData, setFormData] = React28__namespace.useState({
8587
8585
  name: item?.name ?? "",
8588
8586
  description: item?.description ?? "",
@@ -8780,7 +8778,7 @@ function MosaicModuleForm({
8780
8778
  onClick: handleSave,
8781
8779
  disabled: !formData.name,
8782
8780
  className: "inline-flex min-h-[44px] items-center justify-center rounded-md bg-primary px-4 text-sm font-medium text-primary-foreground hover:bg-primary/90 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring disabled:opacity-50 disabled:pointer-events-none",
8783
- children: mode === "edit" ? saveChangesLabel : createItemLabel
8781
+ children: props.mode === "edit" ? props.saveChangesLabel : props.createItemLabel
8784
8782
  }
8785
8783
  )
8786
8784
  ] })
@@ -9001,7 +8999,6 @@ function LibraryContent({
9001
8999
  MosaicModuleForm,
9002
9000
  {
9003
9001
  item: editingItem,
9004
- mode: editorMode,
9005
9002
  formFields,
9006
9003
  onSave: handleSave,
9007
9004
  onCancel: () => setEditorOpen(false),
@@ -9010,9 +9007,8 @@ function LibraryContent({
9010
9007
  namePlaceholder,
9011
9008
  descriptionPlaceholder,
9012
9009
  cancelLabel,
9013
- saveChangesLabel,
9014
- createItemLabel,
9015
- tagListAddPlaceholder
9010
+ tagListAddPlaceholder,
9011
+ ...editorMode === "edit" ? { mode: "edit", saveChangesLabel } : { mode: "create", createItemLabel }
9016
9012
  }
9017
9013
  )
9018
9014
  }
@@ -11281,6 +11277,208 @@ function MosaicDocumentUpload({
11281
11277
  ] });
11282
11278
  }
11283
11279
  MosaicDocumentUpload.displayName = "MosaicDocumentUpload";
11280
+ var urlScraperInputVariants = classVarianceAuthority.cva(
11281
+ [
11282
+ "min-h-9 flex-1 rounded-md border bg-transparent px-3 text-sm outline-none",
11283
+ "transition-colors focus-visible:ring-2 focus-visible:ring-ring disabled:opacity-50"
11284
+ ],
11285
+ {
11286
+ variants: {
11287
+ invalid: {
11288
+ true: "border-destructive",
11289
+ false: "border-border"
11290
+ }
11291
+ },
11292
+ defaultVariants: {
11293
+ invalid: false
11294
+ }
11295
+ }
11296
+ );
11297
+ var urlScraperMessageVariants = classVarianceAuthority.cva(["text-sm"], {
11298
+ variants: {
11299
+ tone: {
11300
+ error: "text-destructive",
11301
+ muted: "text-muted-foreground"
11302
+ }
11303
+ },
11304
+ defaultVariants: {
11305
+ tone: "muted"
11306
+ }
11307
+ });
11308
+ var urlScraperCardVariants = classVarianceAuthority.cva(["flex flex-col gap-2 rounded-lg border p-4"], {
11309
+ variants: {
11310
+ tone: {
11311
+ neutral: "border-border bg-card",
11312
+ error: "border-destructive/40 bg-destructive/5"
11313
+ }
11314
+ },
11315
+ defaultVariants: {
11316
+ tone: "neutral"
11317
+ }
11318
+ });
11319
+ function cn72(...classes) {
11320
+ return classes.filter(Boolean).join(" ");
11321
+ }
11322
+ function isSyntacticallyValidUrl(candidate) {
11323
+ try {
11324
+ new URL(candidate);
11325
+ return true;
11326
+ } catch {
11327
+ return false;
11328
+ }
11329
+ }
11330
+ function MosaicUrlScraper(props) {
11331
+ const {
11332
+ url,
11333
+ onUrlChange,
11334
+ onScrape,
11335
+ inputAriaLabel,
11336
+ inputPlaceholder,
11337
+ scrapeButtonLabel,
11338
+ invalidUrlMessage,
11339
+ className,
11340
+ ref
11341
+ } = props;
11342
+ const [isLocallyInvalid, setIsLocallyInvalid] = React28.useState(false);
11343
+ const isBusy = props.status === "loading" || props.status === "success";
11344
+ function handleSubmit(event) {
11345
+ event.preventDefault();
11346
+ const trimmed = url.trim();
11347
+ if (!isSyntacticallyValidUrl(trimmed)) {
11348
+ setIsLocallyInvalid(true);
11349
+ return;
11350
+ }
11351
+ setIsLocallyInvalid(false);
11352
+ onScrape(trimmed);
11353
+ }
11354
+ function handleUrlChange(event) {
11355
+ setIsLocallyInvalid(false);
11356
+ onUrlChange(event.target.value);
11357
+ }
11358
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { ref, "data-slot": "url-scraper", className: cn72("flex flex-col gap-4", className), children: [
11359
+ /* @__PURE__ */ jsxRuntime.jsxs(
11360
+ "form",
11361
+ {
11362
+ "data-slot": "url-scraper-form",
11363
+ onSubmit: handleSubmit,
11364
+ className: "flex flex-col gap-2 md:flex-row",
11365
+ children: [
11366
+ /* @__PURE__ */ jsxRuntime.jsx(
11367
+ "input",
11368
+ {
11369
+ type: "url",
11370
+ "data-slot": "url-scraper-input",
11371
+ "aria-label": inputAriaLabel,
11372
+ placeholder: inputPlaceholder,
11373
+ value: url,
11374
+ onChange: handleUrlChange,
11375
+ disabled: isBusy,
11376
+ className: urlScraperInputVariants({ invalid: isLocallyInvalid })
11377
+ }
11378
+ ),
11379
+ /* @__PURE__ */ jsxRuntime.jsx(
11380
+ "button",
11381
+ {
11382
+ type: "submit",
11383
+ "data-slot": "url-scraper-submit-button",
11384
+ disabled: isBusy,
11385
+ 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",
11386
+ children: props.status === "loading" ? props.scrapingLabel : scrapeButtonLabel
11387
+ }
11388
+ )
11389
+ ]
11390
+ }
11391
+ ),
11392
+ isLocallyInvalid && /* @__PURE__ */ jsxRuntime.jsx(
11393
+ "p",
11394
+ {
11395
+ "data-slot": "url-scraper-invalid-message",
11396
+ className: urlScraperMessageVariants({ tone: "error" }),
11397
+ children: invalidUrlMessage
11398
+ }
11399
+ ),
11400
+ props.status === "loading" && /* @__PURE__ */ jsxRuntime.jsx(
11401
+ "output",
11402
+ {
11403
+ "data-slot": "url-scraper-loading",
11404
+ className: urlScraperCardVariants({ tone: "neutral" }),
11405
+ children: /* @__PURE__ */ jsxRuntime.jsx("p", { className: urlScraperMessageVariants({ tone: "muted" }), children: props.loadingMessage })
11406
+ }
11407
+ ),
11408
+ props.status === "error" && /* @__PURE__ */ jsxRuntime.jsxs("div", { "data-slot": "url-scraper-error", className: urlScraperCardVariants({ tone: "error" }), children: [
11409
+ /* @__PURE__ */ jsxRuntime.jsx(
11410
+ "p",
11411
+ {
11412
+ "data-slot": "url-scraper-error-message",
11413
+ className: urlScraperMessageVariants({ tone: "error" }),
11414
+ children: props.errorMessage
11415
+ }
11416
+ ),
11417
+ /* @__PURE__ */ jsxRuntime.jsx(
11418
+ "button",
11419
+ {
11420
+ type: "button",
11421
+ "data-slot": "url-scraper-reset-button",
11422
+ onClick: props.onReset,
11423
+ 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",
11424
+ children: props.resetButtonLabel
11425
+ }
11426
+ )
11427
+ ] }),
11428
+ props.status === "success" && /* @__PURE__ */ jsxRuntime.jsxs(
11429
+ "div",
11430
+ {
11431
+ "data-slot": "url-scraper-content",
11432
+ className: urlScraperCardVariants({ tone: "neutral" }),
11433
+ children: [
11434
+ props.content.image !== void 0 && /* @__PURE__ */ jsxRuntime.jsx(
11435
+ "img",
11436
+ {
11437
+ "data-slot": "url-scraper-image",
11438
+ src: props.content.image,
11439
+ alt: props.imageAlt(props.content.title),
11440
+ className: "h-32 w-full rounded-md object-cover md:h-48"
11441
+ }
11442
+ ),
11443
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-start justify-between gap-2", children: [
11444
+ /* @__PURE__ */ jsxRuntime.jsx("h3", { "data-slot": "url-scraper-title", className: "text-base font-semibold md:text-lg", children: props.content.title }),
11445
+ /* @__PURE__ */ jsxRuntime.jsx(
11446
+ "a",
11447
+ {
11448
+ "data-slot": "url-scraper-link",
11449
+ href: props.content.url,
11450
+ target: "_blank",
11451
+ rel: "noopener noreferrer",
11452
+ "aria-label": props.openLinkAriaLabel(props.content.url),
11453
+ className: "shrink-0 text-sm text-muted-foreground transition-colors hover:text-foreground",
11454
+ children: "\u2197"
11455
+ }
11456
+ )
11457
+ ] }),
11458
+ /* @__PURE__ */ jsxRuntime.jsx(
11459
+ "p",
11460
+ {
11461
+ "data-slot": "url-scraper-description",
11462
+ className: urlScraperMessageVariants({ tone: "muted" }),
11463
+ children: props.content.description
11464
+ }
11465
+ ),
11466
+ /* @__PURE__ */ jsxRuntime.jsx(
11467
+ "button",
11468
+ {
11469
+ type: "button",
11470
+ "data-slot": "url-scraper-reset-button",
11471
+ onClick: props.onReset,
11472
+ 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",
11473
+ children: props.resetButtonLabel
11474
+ }
11475
+ )
11476
+ ]
11477
+ }
11478
+ )
11479
+ ] });
11480
+ }
11481
+ MosaicUrlScraper.displayName = "MosaicUrlScraper";
11284
11482
 
11285
11483
  Object.defineProperty(exports, "Accordion", {
11286
11484
  enumerable: true,
@@ -11413,6 +11611,7 @@ exports.MosaicTooltipContent = MosaicTooltipContent;
11413
11611
  exports.MosaicTooltipProvider = MosaicTooltipProvider;
11414
11612
  exports.MosaicTooltipRoot = MosaicTooltipRoot;
11415
11613
  exports.MosaicTooltipTrigger = MosaicTooltipTrigger;
11614
+ exports.MosaicUrlScraper = MosaicUrlScraper;
11416
11615
  exports.MosaicUserButton = MosaicUserButton;
11417
11616
  exports.Placeholder = Placeholder;
11418
11617
  exports.badgeVariants = badgeVariants;