@vantageos/mosaic-blocks 0.5.25-alpha → 0.5.27-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 160 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 162 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
- 160 exported `Mosaic*` components across 9 sections (217 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
+ 162 exported `Mosaic*` components across 9 sections (221 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 | 160 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 | 162 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.25-alpha";
51
+ var version = "0.5.27-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
  {
@@ -14772,7 +14819,7 @@ MosaicTemplateList.displayName = "MosaicTemplateList";
14772
14819
  var templateManagementRowVariants = classVarianceAuthority.cva(
14773
14820
  "flex items-center justify-between gap-3 border-b border-border px-4 py-3 last:border-b-0"
14774
14821
  );
14775
- function cn96(...classes) {
14822
+ function cn97(...classes) {
14776
14823
  return classes.filter(Boolean).join(" ");
14777
14824
  }
14778
14825
  function MosaicTemplateManagementPanel({
@@ -14827,7 +14874,7 @@ function MosaicTemplateManagementPanel({
14827
14874
  "div",
14828
14875
  {
14829
14876
  "data-slot": "template-management-panel",
14830
- className: cn96("flex flex-col rounded-lg border border-border bg-background", className),
14877
+ className: cn97("flex flex-col rounded-lg border border-border bg-background", className),
14831
14878
  children: [
14832
14879
  /* @__PURE__ */ jsxRuntime.jsx("h2", { className: "border-b border-border px-4 py-3 font-semibold text-foreground text-sm", children: heading }),
14833
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) => {
@@ -14859,7 +14906,7 @@ function MosaicTemplateManagementPanel({
14859
14906
  {
14860
14907
  type: "button",
14861
14908
  "aria-label": actionsAriaLabelFor(item.name),
14862
- className: cn96(
14909
+ className: cn97(
14863
14910
  "flex size-8 items-center justify-center rounded-md",
14864
14911
  "text-muted-foreground hover:bg-muted hover:text-foreground"
14865
14912
  ),
@@ -14898,6 +14945,115 @@ function DotsIcon() {
14898
14945
  }
14899
14946
  );
14900
14947
  }
14948
+ var chatSidebarThreadVariants = classVarianceAuthority.cva(
14949
+ ["w-full cursor-pointer rounded-md px-2 py-1.5 text-left transition-colors"],
14950
+ {
14951
+ variants: {
14952
+ active: {
14953
+ true: "bg-accent text-accent-foreground",
14954
+ false: "text-foreground hover:bg-muted"
14955
+ }
14956
+ },
14957
+ defaultVariants: {
14958
+ active: false
14959
+ }
14960
+ }
14961
+ );
14962
+ function cn98(...classes) {
14963
+ return classes.filter(Boolean).join(" ");
14964
+ }
14965
+ var NEXT_KEYS2 = /* @__PURE__ */ new Set(["ArrowDown"]);
14966
+ var PREV_KEYS2 = /* @__PURE__ */ new Set(["ArrowUp"]);
14967
+ var SELECT_KEYS = /* @__PURE__ */ new Set(["Enter", " "]);
14968
+ function MosaicChatSidebar({
14969
+ threads,
14970
+ renderThread,
14971
+ activeThreadId,
14972
+ onSelectThread,
14973
+ onNewThread,
14974
+ newThreadLabel,
14975
+ emptyMessage,
14976
+ className,
14977
+ itemClassName,
14978
+ ref
14979
+ }) {
14980
+ const itemRefs = React30.useRef([]);
14981
+ const [focusedIndex, setFocusedIndex] = React30.useState(0);
14982
+ function focusItem(index) {
14983
+ if (threads.length === 0) {
14984
+ return;
14985
+ }
14986
+ const clamped = Math.max(0, Math.min(threads.length - 1, index));
14987
+ setFocusedIndex(clamped);
14988
+ itemRefs.current[clamped]?.focus();
14989
+ }
14990
+ function handleKeyDown(event, index, id) {
14991
+ if (NEXT_KEYS2.has(event.key)) {
14992
+ event.preventDefault();
14993
+ focusItem(index + 1);
14994
+ } else if (PREV_KEYS2.has(event.key)) {
14995
+ event.preventDefault();
14996
+ focusItem(index - 1);
14997
+ } else if (event.key === "Home") {
14998
+ event.preventDefault();
14999
+ focusItem(0);
15000
+ } else if (event.key === "End") {
15001
+ event.preventDefault();
15002
+ focusItem(threads.length - 1);
15003
+ } else if (SELECT_KEYS.has(event.key)) {
15004
+ event.preventDefault();
15005
+ onSelectThread(id);
15006
+ }
15007
+ }
15008
+ return /* @__PURE__ */ jsxRuntime.jsxs(
15009
+ "div",
15010
+ {
15011
+ ref,
15012
+ "data-slot": "chat-sidebar",
15013
+ className: cn98("flex h-full flex-col gap-2 overflow-y-auto", className),
15014
+ children: [
15015
+ /* @__PURE__ */ jsxRuntime.jsx(
15016
+ "button",
15017
+ {
15018
+ type: "button",
15019
+ "data-slot": "chat-sidebar-new-thread",
15020
+ onClick: onNewThread,
15021
+ className: "w-full rounded-md border border-border px-3 py-2 text-left text-foreground text-sm hover:bg-muted",
15022
+ children: newThreadLabel
15023
+ }
15024
+ ),
15025
+ threads.length === 0 ? /* @__PURE__ */ jsxRuntime.jsx(
15026
+ "p",
15027
+ {
15028
+ "data-slot": "chat-sidebar-empty",
15029
+ className: "py-8 text-center text-muted-foreground text-sm",
15030
+ children: emptyMessage
15031
+ }
15032
+ ) : /* @__PURE__ */ jsxRuntime.jsx("ul", { "data-slot": "chat-sidebar-list", className: "list-none", children: threads.map((thread, index) => {
15033
+ const isActive = activeThreadId === thread.id;
15034
+ return /* @__PURE__ */ jsxRuntime.jsx(
15035
+ "li",
15036
+ {
15037
+ ref: (node) => {
15038
+ itemRefs.current[index] = node;
15039
+ },
15040
+ "data-slot": "chat-sidebar-thread",
15041
+ "data-active": isActive,
15042
+ tabIndex: index === focusedIndex ? 0 : -1,
15043
+ onKeyDown: (event) => handleKeyDown(event, index, thread.id),
15044
+ onFocus: () => setFocusedIndex(index),
15045
+ onClick: () => onSelectThread(thread.id),
15046
+ className: cn98(chatSidebarThreadVariants({ active: isActive }), itemClassName),
15047
+ children: renderThread(thread, index)
15048
+ },
15049
+ thread.id
15050
+ );
15051
+ }) })
15052
+ ]
15053
+ }
15054
+ );
15055
+ }
15056
+ MosaicChatSidebar.displayName = "MosaicChatSidebar";
14901
15057
 
14902
15058
  Object.defineProperty(exports, "Accordion", {
14903
15059
  enumerable: true,
@@ -14955,6 +15111,7 @@ exports.MosaicCardHeader = MosaicCardHeader;
14955
15111
  exports.MosaicCardTitle = MosaicCardTitle;
14956
15112
  exports.MosaicChatComposer = MosaicChatComposer;
14957
15113
  exports.MosaicChatMessage = MosaicChatMessage;
15114
+ exports.MosaicChatSidebar = MosaicChatSidebar;
14958
15115
  exports.MosaicChatThread = MosaicChatThread;
14959
15116
  exports.MosaicCheckbox = MosaicCheckbox;
14960
15117
  exports.MosaicClerkOrgSwitcher = MosaicClerkOrgSwitcher;
@@ -15018,6 +15175,7 @@ exports.MosaicOrgProfilePage = MosaicOrgProfilePage;
15018
15175
  exports.MosaicOrgRoleBadge = MosaicOrgRoleBadge;
15019
15176
  exports.MosaicOrgSwitcher = MosaicOrgSwitcher;
15020
15177
  exports.MosaicPdfViewer = MosaicPdfViewer;
15178
+ exports.MosaicPopover = MosaicPopover;
15021
15179
  exports.MosaicPreferencesPanel = MosaicPreferencesPanel;
15022
15180
  exports.MosaicPricingCard = MosaicPricingCard;
15023
15181
  exports.MosaicProfilePanel = MosaicProfilePanel;
@@ -15080,12 +15238,14 @@ exports.buttonVariants = buttonVariants;
15080
15238
  exports.chatMessageBubbleVariants = chatMessageBubbleVariants;
15081
15239
  exports.chatMessageContainerVariants = chatMessageContainerVariants;
15082
15240
  exports.chatMessageToolStatusVariants = chatMessageToolStatusVariants;
15241
+ exports.chatSidebarThreadVariants = chatSidebarThreadVariants;
15083
15242
  exports.drawerBackdropVariants = drawerBackdropVariants;
15084
15243
  exports.drawerPopupVariants = drawerPopupVariants;
15085
15244
  exports.marketplaceCardVariants = marketplaceCardVariants;
15086
15245
  exports.pdfViewerFrameVariants = pdfViewerFrameVariants;
15087
15246
  exports.pdfViewerStatusVariants = pdfViewerStatusVariants;
15088
15247
  exports.pdfViewerToolbarButtonVariants = pdfViewerToolbarButtonVariants;
15248
+ exports.popoverPopupVariants = popoverPopupVariants;
15089
15249
  exports.saveTemplateModalBodyVariants = saveTemplateModalBodyVariants;
15090
15250
  exports.saveTemplateModalButtonVariants = saveTemplateModalButtonVariants;
15091
15251
  exports.saveTemplateModalErrorVariants = saveTemplateModalErrorVariants;