@vantageos/mosaic-blocks 0.5.26-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 161 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
- 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).
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 | 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 |
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
@@ -48,7 +48,7 @@ function _interopNamespace(e) {
48
48
  var React30__namespace = /*#__PURE__*/_interopNamespace(React30);
49
49
 
50
50
  // src/version.ts
51
- var version = "0.5.26-alpha";
51
+ var version = "0.5.27-alpha";
52
52
  function Placeholder({ label = "mosaic-blocks placeholder" }) {
53
53
  return /* @__PURE__ */ jsxRuntime.jsx("div", { "data-mosaic-block": "placeholder", children: label });
54
54
  }
@@ -14945,6 +14945,115 @@ function DotsIcon() {
14945
14945
  }
14946
14946
  );
14947
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";
14948
15057
 
14949
15058
  Object.defineProperty(exports, "Accordion", {
14950
15059
  enumerable: true,
@@ -15002,6 +15111,7 @@ exports.MosaicCardHeader = MosaicCardHeader;
15002
15111
  exports.MosaicCardTitle = MosaicCardTitle;
15003
15112
  exports.MosaicChatComposer = MosaicChatComposer;
15004
15113
  exports.MosaicChatMessage = MosaicChatMessage;
15114
+ exports.MosaicChatSidebar = MosaicChatSidebar;
15005
15115
  exports.MosaicChatThread = MosaicChatThread;
15006
15116
  exports.MosaicCheckbox = MosaicCheckbox;
15007
15117
  exports.MosaicClerkOrgSwitcher = MosaicClerkOrgSwitcher;
@@ -15128,6 +15238,7 @@ exports.buttonVariants = buttonVariants;
15128
15238
  exports.chatMessageBubbleVariants = chatMessageBubbleVariants;
15129
15239
  exports.chatMessageContainerVariants = chatMessageContainerVariants;
15130
15240
  exports.chatMessageToolStatusVariants = chatMessageToolStatusVariants;
15241
+ exports.chatSidebarThreadVariants = chatSidebarThreadVariants;
15131
15242
  exports.drawerBackdropVariants = drawerBackdropVariants;
15132
15243
  exports.drawerPopupVariants = drawerPopupVariants;
15133
15244
  exports.marketplaceCardVariants = marketplaceCardVariants;