@vantageos/mosaic-blocks 0.5.24-alpha → 0.5.26-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 159 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 161 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
- 159 exported `Mosaic*` components across 9 sections (215 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
+ 161 exported `Mosaic*` components across 9 sections (219 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
 
@@ -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.5.17-alpha` | Current | 159 exported `Mosaic*` components — adds `MosaicResizableSplitPane` (presentational resizable two-pane content layout: drag or arrow-key resize, host-controlled width and collapsed state; forms a pair with `MosaicPdfViewer` for side-by-side document preview + edit panel) — superseded row below kept for history |
473
+ | `0.5.17-alpha` | Current | 161 exported `Mosaic*` components — adds `MosaicResizableSplitPane` (presentational resizable two-pane content layout: drag or arrow-key resize, host-controlled width and collapsed state; forms a pair with `MosaicPdfViewer` for side-by-side document preview + edit panel) — superseded row below kept for history |
474
474
  | `0.5.16-alpha` | Historical | 136 exported `Mosaic*` components — adds `MosaicPdfViewer` (presentational inline PDF preview via the browser's native PDF renderer: host-controlled page navigation + zoom, local loading/error status, no PDF library, no network call by the component itself) — superseded by the Current row above |
475
475
  | `0.5.15-alpha` | Historical | 135 exported `Mosaic*` components — adds `MosaicToast` + `MosaicToastProvider` (presentational ephemeral notification: 4 variants, optional `durationMs` auto-dismiss, host-controlled action node; provider positions the stack top-right/top-center/bottom-right/bottom-center) — superseded by the Current row above |
476
476
  | `0.5.14-alpha` | Historical | 133 exported `Mosaic*` components — no new component: adds `scripts/docs-counts.mjs`, a generator that derives every README.md / docs/components-catalog.md component/export count from `src/index.ts` (`pnpm docs:counts` writes, `pnpm docs:counts --check` verifies without writing, wired into CI's Gates job) — closes the class of defect where a count goes stale only AFTER two branches compose, invisible to any per-branch CI run — superseded by the Current row above |
package/dist/index.cjs CHANGED
@@ -25,6 +25,7 @@ var combobox = require('@base-ui/react/combobox');
25
25
  var menu = require('@base-ui/react/menu');
26
26
  var dialog = require('@base-ui/react/dialog');
27
27
  var alertDialog = require('@base-ui/react/alert-dialog');
28
+ var popover = require('@base-ui/react/popover');
28
29
 
29
30
  function _interopNamespace(e) {
30
31
  if (e && e.__esModule) return e;
@@ -47,7 +48,7 @@ function _interopNamespace(e) {
47
48
  var React30__namespace = /*#__PURE__*/_interopNamespace(React30);
48
49
 
49
50
  // src/version.ts
50
- var version = "0.5.24-alpha";
51
+ var version = "0.5.26-alpha";
51
52
  function Placeholder({ label = "mosaic-blocks placeholder" }) {
52
53
  return /* @__PURE__ */ jsxRuntime.jsx("div", { "data-mosaic-block": "placeholder", children: label });
53
54
  }
@@ -14435,6 +14436,52 @@ function MosaicDrawer({
14435
14436
  ] }) });
14436
14437
  }
14437
14438
  MosaicDrawer.displayName = "MosaicDrawer";
14439
+ var popoverPopupVariants = classVarianceAuthority.cva([
14440
+ "z-50 min-w-[8rem] overflow-hidden rounded-md border border-border",
14441
+ "bg-popover text-popover-foreground shadow-md outline-none",
14442
+ "origin-[var(--transform-origin)]",
14443
+ "transition-[transform,scale,opacity]",
14444
+ "data-[open]:scale-100 data-[open]:opacity-100",
14445
+ "data-[ending-style]:scale-95 data-[ending-style]:opacity-0",
14446
+ "data-[starting-style]:scale-95 data-[starting-style]:opacity-0"
14447
+ ]);
14448
+ function cn93(...classes) {
14449
+ return classes.filter(Boolean).join(" ");
14450
+ }
14451
+ function MosaicPopover({
14452
+ open,
14453
+ onOpenChange,
14454
+ anchor,
14455
+ children,
14456
+ side = "bottom",
14457
+ align = "start",
14458
+ modal = false,
14459
+ initialFocus = false,
14460
+ "aria-label": ariaLabel,
14461
+ className
14462
+ }) {
14463
+ return /* @__PURE__ */ jsxRuntime.jsx(popover.Popover.Root, { open, onOpenChange: (nextOpen) => onOpenChange(nextOpen), modal, children: /* @__PURE__ */ jsxRuntime.jsx(popover.Popover.Portal, { children: /* @__PURE__ */ jsxRuntime.jsx(
14464
+ popover.Popover.Positioner,
14465
+ {
14466
+ "data-slot": "popover-positioner",
14467
+ anchor,
14468
+ side,
14469
+ align,
14470
+ sideOffset: 4,
14471
+ children: /* @__PURE__ */ jsxRuntime.jsx(
14472
+ popover.Popover.Popup,
14473
+ {
14474
+ "data-slot": "popover",
14475
+ "aria-label": ariaLabel,
14476
+ initialFocus,
14477
+ className: cn93(popoverPopupVariants(), className),
14478
+ children
14479
+ }
14480
+ )
14481
+ }
14482
+ ) }) });
14483
+ }
14484
+ MosaicPopover.displayName = "MosaicPopover";
14438
14485
  var templateCategoryChipVariants = classVarianceAuthority.cva(
14439
14486
  [
14440
14487
  "inline-flex items-center justify-center whitespace-nowrap",
@@ -14454,7 +14501,7 @@ var templateCategoryChipVariants = classVarianceAuthority.cva(
14454
14501
  }
14455
14502
  }
14456
14503
  );
14457
- function cn93(...classes) {
14504
+ function cn94(...classes) {
14458
14505
  return classes.filter(Boolean).join(" ");
14459
14506
  }
14460
14507
  function MosaicTemplateCategoryChips({
@@ -14469,7 +14516,7 @@ function MosaicTemplateCategoryChips({
14469
14516
  {
14470
14517
  ref,
14471
14518
  "data-slot": "template-category-chips",
14472
- className: cn93("flex flex-wrap items-center gap-2", className),
14519
+ className: cn94("flex flex-wrap items-center gap-2", className),
14473
14520
  children: categories.map((category) => {
14474
14521
  const isSelected = category.id === selected;
14475
14522
  return /* @__PURE__ */ jsxRuntime.jsx(
@@ -14512,7 +14559,7 @@ var saveTemplateModalButtonVariants = classVarianceAuthority.cva(
14512
14559
  }
14513
14560
  }
14514
14561
  );
14515
- function cn94(...classes) {
14562
+ function cn95(...classes) {
14516
14563
  return classes.filter(Boolean).join(" ");
14517
14564
  }
14518
14565
  function MosaicSaveTemplateModal({
@@ -14568,7 +14615,7 @@ function MosaicSaveTemplateModal({
14568
14615
  "div",
14569
14616
  {
14570
14617
  "data-slot": "save-template-modal",
14571
- className: cn94(saveTemplateModalBodyVariants(), className),
14618
+ className: cn95(saveTemplateModalBodyVariants(), className),
14572
14619
  children: [
14573
14620
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: saveTemplateModalFieldVariants(), children: [
14574
14621
  /* @__PURE__ */ jsxRuntime.jsx(
@@ -14687,7 +14734,7 @@ var templateListVariants = classVarianceAuthority.cva(["grid gap-4"], {
14687
14734
  layout: "grid"
14688
14735
  }
14689
14736
  });
14690
- function cn95(...classes) {
14737
+ function cn96(...classes) {
14691
14738
  return classes.filter(Boolean).join(" ");
14692
14739
  }
14693
14740
  var NEXT_KEYS = /* @__PURE__ */ new Set(["ArrowRight", "ArrowDown"]);
@@ -14732,7 +14779,7 @@ function MosaicTemplateList({
14732
14779
  {
14733
14780
  ref,
14734
14781
  "data-slot": "template-list",
14735
- className: cn95(templateListVariants({ layout }), className),
14782
+ className: cn96(templateListVariants({ layout }), className),
14736
14783
  children: /* @__PURE__ */ jsxRuntime.jsx(
14737
14784
  "p",
14738
14785
  {
@@ -14749,7 +14796,7 @@ function MosaicTemplateList({
14749
14796
  {
14750
14797
  ref,
14751
14798
  "data-slot": "template-list",
14752
- className: cn95("list-none", templateListVariants({ layout }), className),
14799
+ className: cn96("list-none", templateListVariants({ layout }), className),
14753
14800
  children: items.map((item, index) => /* @__PURE__ */ jsxRuntime.jsx(
14754
14801
  "li",
14755
14802
  {
@@ -14769,6 +14816,135 @@ function MosaicTemplateList({
14769
14816
  );
14770
14817
  }
14771
14818
  MosaicTemplateList.displayName = "MosaicTemplateList";
14819
+ var templateManagementRowVariants = classVarianceAuthority.cva(
14820
+ "flex items-center justify-between gap-3 border-b border-border px-4 py-3 last:border-b-0"
14821
+ );
14822
+ function cn97(...classes) {
14823
+ return classes.filter(Boolean).join(" ");
14824
+ }
14825
+ function MosaicTemplateManagementPanel({
14826
+ templates,
14827
+ heading,
14828
+ emptyMessage,
14829
+ renameLabel,
14830
+ duplicateLabel,
14831
+ deleteLabel,
14832
+ saveLabel,
14833
+ cancelLabel,
14834
+ renameInputAriaLabel,
14835
+ actionsAriaLabelFor,
14836
+ onRename,
14837
+ onDuplicate,
14838
+ onDelete,
14839
+ className
14840
+ }) {
14841
+ const [renamingId, setRenamingId] = React30__namespace.useState(null);
14842
+ const [draftName, setDraftName] = React30__namespace.useState("");
14843
+ const startRename = (item) => {
14844
+ setRenamingId(item.id);
14845
+ setDraftName(item.name);
14846
+ };
14847
+ const cancelRename = () => {
14848
+ setRenamingId(null);
14849
+ setDraftName("");
14850
+ };
14851
+ const saveRename = (id) => {
14852
+ const trimmed = draftName.trim();
14853
+ if (trimmed.length > 0) {
14854
+ onRename(id, trimmed);
14855
+ }
14856
+ setRenamingId(null);
14857
+ setDraftName("");
14858
+ };
14859
+ const menuItems = [
14860
+ { id: "rename", label: renameLabel },
14861
+ { id: "duplicate", label: duplicateLabel },
14862
+ { id: "delete", label: deleteLabel, separator: true }
14863
+ ];
14864
+ const handleItemSelect = (item, actionId) => {
14865
+ if (actionId === "rename") {
14866
+ startRename(item);
14867
+ } else if (actionId === "duplicate") {
14868
+ onDuplicate(item.id);
14869
+ } else if (actionId === "delete") {
14870
+ onDelete(item.id);
14871
+ }
14872
+ };
14873
+ return /* @__PURE__ */ jsxRuntime.jsxs(
14874
+ "div",
14875
+ {
14876
+ "data-slot": "template-management-panel",
14877
+ className: cn97("flex flex-col rounded-lg border border-border bg-background", className),
14878
+ children: [
14879
+ /* @__PURE__ */ jsxRuntime.jsx("h2", { className: "border-b border-border px-4 py-3 font-semibold text-foreground text-sm", children: heading }),
14880
+ templates.length === 0 ? /* @__PURE__ */ jsxRuntime.jsx("p", { className: "px-4 py-6 text-center text-muted-foreground text-sm", children: emptyMessage }) : /* @__PURE__ */ jsxRuntime.jsx("ul", { children: templates.map((item) => {
14881
+ const isRenaming = renamingId === item.id;
14882
+ return /* @__PURE__ */ jsxRuntime.jsx(
14883
+ "li",
14884
+ {
14885
+ "data-slot": "template-management-row",
14886
+ className: templateManagementRowVariants(),
14887
+ children: isRenaming ? /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-1 items-center gap-2", children: [
14888
+ /* @__PURE__ */ jsxRuntime.jsx(
14889
+ MosaicInput,
14890
+ {
14891
+ "aria-label": renameInputAriaLabel,
14892
+ value: draftName,
14893
+ onChange: (event) => setDraftName(event.target.value),
14894
+ className: "flex-1"
14895
+ }
14896
+ ),
14897
+ /* @__PURE__ */ jsxRuntime.jsx(MosaicButton, { type: "button", size: "sm", onClick: () => saveRename(item.id), children: saveLabel }),
14898
+ /* @__PURE__ */ jsxRuntime.jsx(MosaicButton, { type: "button", variant: "outline", size: "sm", onClick: cancelRename, children: cancelLabel })
14899
+ ] }) : /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
14900
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "truncate text-foreground text-sm", children: item.name }),
14901
+ /* @__PURE__ */ jsxRuntime.jsx(
14902
+ MosaicDropdownMenu,
14903
+ {
14904
+ trigger: /* @__PURE__ */ jsxRuntime.jsx(
14905
+ "button",
14906
+ {
14907
+ type: "button",
14908
+ "aria-label": actionsAriaLabelFor(item.name),
14909
+ className: cn97(
14910
+ "flex size-8 items-center justify-center rounded-md",
14911
+ "text-muted-foreground hover:bg-muted hover:text-foreground"
14912
+ ),
14913
+ children: /* @__PURE__ */ jsxRuntime.jsx(DotsIcon, {})
14914
+ }
14915
+ ),
14916
+ items: menuItems,
14917
+ onItemSelect: (actionId) => handleItemSelect(item, actionId)
14918
+ }
14919
+ )
14920
+ ] })
14921
+ },
14922
+ item.id
14923
+ );
14924
+ }) })
14925
+ ]
14926
+ }
14927
+ );
14928
+ }
14929
+ MosaicTemplateManagementPanel.displayName = "MosaicTemplateManagementPanel";
14930
+ function DotsIcon() {
14931
+ return /* @__PURE__ */ jsxRuntime.jsxs(
14932
+ "svg",
14933
+ {
14934
+ xmlns: "http://www.w3.org/2000/svg",
14935
+ width: "16",
14936
+ height: "16",
14937
+ viewBox: "0 0 24 24",
14938
+ fill: "currentColor",
14939
+ "aria-hidden": "true",
14940
+ children: [
14941
+ /* @__PURE__ */ jsxRuntime.jsx("circle", { cx: "12", cy: "5", r: "1.5" }),
14942
+ /* @__PURE__ */ jsxRuntime.jsx("circle", { cx: "12", cy: "12", r: "1.5" }),
14943
+ /* @__PURE__ */ jsxRuntime.jsx("circle", { cx: "12", cy: "19", r: "1.5" })
14944
+ ]
14945
+ }
14946
+ );
14947
+ }
14772
14948
 
14773
14949
  Object.defineProperty(exports, "Accordion", {
14774
14950
  enumerable: true,
@@ -14889,6 +15065,7 @@ exports.MosaicOrgProfilePage = MosaicOrgProfilePage;
14889
15065
  exports.MosaicOrgRoleBadge = MosaicOrgRoleBadge;
14890
15066
  exports.MosaicOrgSwitcher = MosaicOrgSwitcher;
14891
15067
  exports.MosaicPdfViewer = MosaicPdfViewer;
15068
+ exports.MosaicPopover = MosaicPopover;
14892
15069
  exports.MosaicPreferencesPanel = MosaicPreferencesPanel;
14893
15070
  exports.MosaicPricingCard = MosaicPricingCard;
14894
15071
  exports.MosaicProfilePanel = MosaicProfilePanel;
@@ -14922,6 +15099,7 @@ exports.MosaicTemplateCard = MosaicTemplateCard;
14922
15099
  exports.MosaicTemplateCategoryChips = MosaicTemplateCategoryChips;
14923
15100
  exports.MosaicTemplateGallery = MosaicTemplateGallery;
14924
15101
  exports.MosaicTemplateList = MosaicTemplateList;
15102
+ exports.MosaicTemplateManagementPanel = MosaicTemplateManagementPanel;
14925
15103
  exports.MosaicTemplatePreview = MosaicTemplatePreview;
14926
15104
  exports.MosaicTestimonialsGrid = MosaicTestimonialsGrid;
14927
15105
  exports.MosaicTextarea = MosaicTextarea;
@@ -14956,6 +15134,7 @@ exports.marketplaceCardVariants = marketplaceCardVariants;
14956
15134
  exports.pdfViewerFrameVariants = pdfViewerFrameVariants;
14957
15135
  exports.pdfViewerStatusVariants = pdfViewerStatusVariants;
14958
15136
  exports.pdfViewerToolbarButtonVariants = pdfViewerToolbarButtonVariants;
15137
+ exports.popoverPopupVariants = popoverPopupVariants;
14959
15138
  exports.saveTemplateModalBodyVariants = saveTemplateModalBodyVariants;
14960
15139
  exports.saveTemplateModalButtonVariants = saveTemplateModalButtonVariants;
14961
15140
  exports.saveTemplateModalErrorVariants = saveTemplateModalErrorVariants;
@@ -14974,6 +15153,7 @@ exports.templateAgentCardTagVariants = templateAgentCardTagVariants;
14974
15153
  exports.templateAgentCardVariants = templateAgentCardVariants;
14975
15154
  exports.templateCategoryChipVariants = templateCategoryChipVariants;
14976
15155
  exports.templateListVariants = templateListVariants;
15156
+ exports.templateManagementRowVariants = templateManagementRowVariants;
14977
15157
  exports.toastCardVariants = toastCardVariants;
14978
15158
  exports.toastDismissButtonVariants = toastDismissButtonVariants;
14979
15159
  exports.toastProviderPositionVariants = toastProviderPositionVariants;