@vantageos/mosaic-blocks 0.5.13-alpha → 0.5.18-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 +7 -3
- package/dist/index.cjs +595 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +491 -2
- package/dist/index.d.ts +491 -2
- package/dist/index.js +578 -3
- package/dist/index.js.map +1 -1
- package/package.json +2 -1
- package/registry.json +62 -1
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
|
|
13
|
+
`@vantageos/mosaic-blocks` is the **React composed-block layer** of the VantageOS Mosaic design system. It provides 138 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
|
-
|
|
172
|
+
138 exported `Mosaic*` components across 9 sections (175 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,11 @@ This package follows [Semantic Versioning](https://semver.org/). While in alpha
|
|
|
470
470
|
|
|
471
471
|
| Version | Status | Notes |
|
|
472
472
|
|---|---|---|
|
|
473
|
-
| `0.5.
|
|
473
|
+
| `0.5.17-alpha` | Current | 138 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
|
+
| `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
|
+
| `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
|
+
| `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 |
|
|
477
|
+
| `0.5.13-alpha` | Historical | 133 exported `Mosaic*` components — adds `MosaicAgentChat` (presentational session harness: send a turn, resume a session, forward approval responses to the agent runtime) — superseded by the Current row above |
|
|
474
478
|
| `0.5.12-alpha` | Historical | 132 exported `Mosaic*` components — adds `MosaicApiKeyPanel` (presentational BYOK panel: idle/validating/valid/invalid, no storage, no network) — superseded by the Current row above |
|
|
475
479
|
| `0.5.11-alpha` | Historical | 131 exported `Mosaic*` components — guard fix only, no new component: `readme-matches-exports.test.ts` now exempts Historical rows by their Status column (structural), not by wording — superseded by the Current row above |
|
|
476
480
|
| `0.5.10-alpha` | Historical | 131 exported `Mosaic*` components, adds `MosaicToolToggleList` (per-tool switch + approval-level selector) — superseded by the Current row above |
|
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.5.
|
|
49
|
+
var version = "0.5.18-alpha";
|
|
50
50
|
function Placeholder({ label = "mosaic-blocks placeholder" }) {
|
|
51
51
|
return /* @__PURE__ */ jsxRuntime.jsx("div", { "data-mosaic-block": "placeholder", children: label });
|
|
52
52
|
}
|
|
@@ -12856,6 +12856,581 @@ function MosaicAgentChat(props) {
|
|
|
12856
12856
|
] });
|
|
12857
12857
|
}
|
|
12858
12858
|
MosaicAgentChat.displayName = "MosaicAgentChat";
|
|
12859
|
+
var toastCardVariants = classVarianceAuthority.cva(
|
|
12860
|
+
["flex w-full items-start gap-3 rounded-lg border p-4 shadow-lg sm:max-w-sm"],
|
|
12861
|
+
{
|
|
12862
|
+
variants: {
|
|
12863
|
+
variant: {
|
|
12864
|
+
success: "border-border bg-card",
|
|
12865
|
+
error: "border-destructive/40 bg-destructive/5",
|
|
12866
|
+
info: "border-border bg-card",
|
|
12867
|
+
warning: "border-amber-500/40 bg-amber-500/5"
|
|
12868
|
+
}
|
|
12869
|
+
},
|
|
12870
|
+
defaultVariants: {
|
|
12871
|
+
variant: "info"
|
|
12872
|
+
}
|
|
12873
|
+
}
|
|
12874
|
+
);
|
|
12875
|
+
var toastTitleVariants = classVarianceAuthority.cva(["text-sm font-medium"], {
|
|
12876
|
+
variants: {
|
|
12877
|
+
variant: {
|
|
12878
|
+
success: "text-foreground",
|
|
12879
|
+
error: "text-destructive",
|
|
12880
|
+
info: "text-foreground",
|
|
12881
|
+
warning: "text-amber-600 dark:text-amber-400"
|
|
12882
|
+
}
|
|
12883
|
+
},
|
|
12884
|
+
defaultVariants: {
|
|
12885
|
+
variant: "info"
|
|
12886
|
+
}
|
|
12887
|
+
});
|
|
12888
|
+
var toastDismissButtonVariants = classVarianceAuthority.cva([
|
|
12889
|
+
"inline-flex size-6 shrink-0 items-center justify-center rounded-md text-muted-foreground transition-colors hover:bg-accent/50 hover:text-foreground"
|
|
12890
|
+
]);
|
|
12891
|
+
var toastProviderPositionVariants = classVarianceAuthority.cva(
|
|
12892
|
+
["pointer-events-none fixed z-50 flex flex-col gap-2 p-4"],
|
|
12893
|
+
{
|
|
12894
|
+
variants: {
|
|
12895
|
+
position: {
|
|
12896
|
+
"top-right": "top-0 right-0 items-end",
|
|
12897
|
+
"top-center": "top-0 left-1/2 -translate-x-1/2 items-center",
|
|
12898
|
+
"bottom-right": "bottom-0 right-0 items-end",
|
|
12899
|
+
"bottom-center": "bottom-0 left-1/2 -translate-x-1/2 items-center"
|
|
12900
|
+
}
|
|
12901
|
+
},
|
|
12902
|
+
defaultVariants: {
|
|
12903
|
+
position: "top-right"
|
|
12904
|
+
}
|
|
12905
|
+
}
|
|
12906
|
+
);
|
|
12907
|
+
function cn81(...classes) {
|
|
12908
|
+
return classes.filter(Boolean).join(" ");
|
|
12909
|
+
}
|
|
12910
|
+
function MosaicToast({
|
|
12911
|
+
variant,
|
|
12912
|
+
title,
|
|
12913
|
+
description,
|
|
12914
|
+
action,
|
|
12915
|
+
onDismiss,
|
|
12916
|
+
dismissAriaLabel,
|
|
12917
|
+
durationMs,
|
|
12918
|
+
className,
|
|
12919
|
+
ref
|
|
12920
|
+
}) {
|
|
12921
|
+
React28.useEffect(() => {
|
|
12922
|
+
if (durationMs === void 0) return;
|
|
12923
|
+
const timer = setTimeout(onDismiss, durationMs);
|
|
12924
|
+
return () => clearTimeout(timer);
|
|
12925
|
+
}, [durationMs, onDismiss]);
|
|
12926
|
+
const role = variant === "error" ? "alert" : "status";
|
|
12927
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
12928
|
+
"div",
|
|
12929
|
+
{
|
|
12930
|
+
ref,
|
|
12931
|
+
"data-slot": "toast",
|
|
12932
|
+
role,
|
|
12933
|
+
className: cn81(toastCardVariants({ variant }), className),
|
|
12934
|
+
children: [
|
|
12935
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { "data-slot": "toast-body", className: "flex min-w-0 flex-1 flex-col gap-1", children: [
|
|
12936
|
+
/* @__PURE__ */ jsxRuntime.jsx("p", { "data-slot": "toast-title", className: toastTitleVariants({ variant }), children: title }),
|
|
12937
|
+
description !== void 0 && /* @__PURE__ */ jsxRuntime.jsx("p", { "data-slot": "toast-description", className: "text-sm text-muted-foreground", children: description }),
|
|
12938
|
+
action !== void 0 && /* @__PURE__ */ jsxRuntime.jsx("div", { "data-slot": "toast-action", children: action })
|
|
12939
|
+
] }),
|
|
12940
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
12941
|
+
"button",
|
|
12942
|
+
{
|
|
12943
|
+
type: "button",
|
|
12944
|
+
"data-slot": "toast-dismiss-button",
|
|
12945
|
+
onClick: onDismiss,
|
|
12946
|
+
"aria-label": dismissAriaLabel,
|
|
12947
|
+
className: toastDismissButtonVariants(),
|
|
12948
|
+
children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
12949
|
+
"svg",
|
|
12950
|
+
{
|
|
12951
|
+
"aria-hidden": "true",
|
|
12952
|
+
viewBox: "0 0 24 24",
|
|
12953
|
+
width: "16",
|
|
12954
|
+
height: "16",
|
|
12955
|
+
fill: "none",
|
|
12956
|
+
stroke: "currentColor",
|
|
12957
|
+
strokeWidth: "2",
|
|
12958
|
+
strokeLinecap: "round",
|
|
12959
|
+
strokeLinejoin: "round",
|
|
12960
|
+
children: [
|
|
12961
|
+
/* @__PURE__ */ jsxRuntime.jsx("path", { d: "M18 6 6 18" }),
|
|
12962
|
+
/* @__PURE__ */ jsxRuntime.jsx("path", { d: "m6 6 12 12" })
|
|
12963
|
+
]
|
|
12964
|
+
}
|
|
12965
|
+
)
|
|
12966
|
+
}
|
|
12967
|
+
)
|
|
12968
|
+
]
|
|
12969
|
+
}
|
|
12970
|
+
);
|
|
12971
|
+
}
|
|
12972
|
+
MosaicToast.displayName = "MosaicToast";
|
|
12973
|
+
function cn82(...classes) {
|
|
12974
|
+
return classes.filter(Boolean).join(" ");
|
|
12975
|
+
}
|
|
12976
|
+
function MosaicToastProvider({
|
|
12977
|
+
children,
|
|
12978
|
+
position = "top-right",
|
|
12979
|
+
className,
|
|
12980
|
+
ref
|
|
12981
|
+
}) {
|
|
12982
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
12983
|
+
"div",
|
|
12984
|
+
{
|
|
12985
|
+
ref,
|
|
12986
|
+
"data-slot": "toast-provider",
|
|
12987
|
+
className: cn82(toastProviderPositionVariants({ position }), className),
|
|
12988
|
+
children
|
|
12989
|
+
}
|
|
12990
|
+
);
|
|
12991
|
+
}
|
|
12992
|
+
MosaicToastProvider.displayName = "MosaicToastProvider";
|
|
12993
|
+
var pdfViewerFrameVariants = classVarianceAuthority.cva([
|
|
12994
|
+
"relative min-h-64 w-full flex-1 overflow-hidden rounded-lg border border-border bg-card"
|
|
12995
|
+
]);
|
|
12996
|
+
var pdfViewerStatusVariants = classVarianceAuthority.cva(
|
|
12997
|
+
["flex h-full w-full flex-col items-center justify-center gap-2 p-4 text-center text-sm"],
|
|
12998
|
+
{
|
|
12999
|
+
variants: {
|
|
13000
|
+
tone: {
|
|
13001
|
+
loading: "text-muted-foreground",
|
|
13002
|
+
error: "text-destructive"
|
|
13003
|
+
}
|
|
13004
|
+
},
|
|
13005
|
+
defaultVariants: {
|
|
13006
|
+
tone: "loading"
|
|
13007
|
+
}
|
|
13008
|
+
}
|
|
13009
|
+
);
|
|
13010
|
+
var pdfViewerToolbarButtonVariants = classVarianceAuthority.cva([
|
|
13011
|
+
"inline-flex min-h-8 min-w-8 items-center justify-center rounded-md border border-border text-sm",
|
|
13012
|
+
"transition-colors hover:bg-accent/50 disabled:opacity-50 disabled:hover:bg-transparent"
|
|
13013
|
+
]);
|
|
13014
|
+
function cn83(...classes) {
|
|
13015
|
+
return classes.filter(Boolean).join(" ");
|
|
13016
|
+
}
|
|
13017
|
+
function buildFrameSrc(fileUrl, currentPage, zoom) {
|
|
13018
|
+
const fragmentParts = [];
|
|
13019
|
+
if (currentPage !== void 0) fragmentParts.push(`page=${currentPage}`);
|
|
13020
|
+
if (zoom !== void 0) fragmentParts.push(`zoom=${Math.round(zoom * 100)}`);
|
|
13021
|
+
if (fragmentParts.length === 0) return fileUrl;
|
|
13022
|
+
const separator = fileUrl.includes("#") ? "&" : "#";
|
|
13023
|
+
return `${fileUrl}${separator}${fragmentParts.join("&")}`;
|
|
13024
|
+
}
|
|
13025
|
+
function MosaicPdfViewer({
|
|
13026
|
+
fileUrl,
|
|
13027
|
+
currentPage,
|
|
13028
|
+
onPageChange,
|
|
13029
|
+
totalPages,
|
|
13030
|
+
zoom,
|
|
13031
|
+
onZoomChange,
|
|
13032
|
+
loadingLabel,
|
|
13033
|
+
errorLabel,
|
|
13034
|
+
className,
|
|
13035
|
+
ref
|
|
13036
|
+
}) {
|
|
13037
|
+
const [status, setStatus] = React28.useState("loading");
|
|
13038
|
+
const [trackedFileUrl, setTrackedFileUrl] = React28.useState(fileUrl);
|
|
13039
|
+
const frameRef = React28.useRef(null);
|
|
13040
|
+
if (fileUrl !== trackedFileUrl) {
|
|
13041
|
+
setTrackedFileUrl(fileUrl);
|
|
13042
|
+
setStatus("loading");
|
|
13043
|
+
}
|
|
13044
|
+
React28.useEffect(() => {
|
|
13045
|
+
const node = frameRef.current;
|
|
13046
|
+
if (!node) return;
|
|
13047
|
+
function handleLoad() {
|
|
13048
|
+
setStatus("loaded");
|
|
13049
|
+
}
|
|
13050
|
+
function handleError() {
|
|
13051
|
+
setStatus("error");
|
|
13052
|
+
}
|
|
13053
|
+
node.addEventListener("load", handleLoad);
|
|
13054
|
+
node.addEventListener("error", handleError);
|
|
13055
|
+
return () => {
|
|
13056
|
+
node.removeEventListener("load", handleLoad);
|
|
13057
|
+
node.removeEventListener("error", handleError);
|
|
13058
|
+
};
|
|
13059
|
+
}, []);
|
|
13060
|
+
const showPageControls = currentPage !== void 0;
|
|
13061
|
+
const showZoomControls = zoom !== void 0;
|
|
13062
|
+
function handlePrevPage() {
|
|
13063
|
+
if (currentPage === void 0 || onPageChange === void 0 || currentPage <= 1) return;
|
|
13064
|
+
onPageChange(currentPage - 1);
|
|
13065
|
+
}
|
|
13066
|
+
function handleNextPage() {
|
|
13067
|
+
if (currentPage === void 0 || onPageChange === void 0) return;
|
|
13068
|
+
if (totalPages !== void 0 && currentPage >= totalPages) return;
|
|
13069
|
+
onPageChange(currentPage + 1);
|
|
13070
|
+
}
|
|
13071
|
+
function handleZoomOut() {
|
|
13072
|
+
if (zoom === void 0 || onZoomChange === void 0) return;
|
|
13073
|
+
onZoomChange(Math.round((zoom - 0.1) * 100) / 100);
|
|
13074
|
+
}
|
|
13075
|
+
function handleZoomIn() {
|
|
13076
|
+
if (zoom === void 0 || onZoomChange === void 0) return;
|
|
13077
|
+
onZoomChange(Math.round((zoom + 0.1) * 100) / 100);
|
|
13078
|
+
}
|
|
13079
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { ref, "data-slot": "pdf-viewer", className: cn83("flex flex-col gap-2", className), children: [
|
|
13080
|
+
(showPageControls || showZoomControls) && /* @__PURE__ */ jsxRuntime.jsxs(
|
|
13081
|
+
"div",
|
|
13082
|
+
{
|
|
13083
|
+
"data-slot": "pdf-viewer-toolbar",
|
|
13084
|
+
className: "flex items-center justify-between gap-2 text-sm",
|
|
13085
|
+
children: [
|
|
13086
|
+
showPageControls && /* @__PURE__ */ jsxRuntime.jsxs("div", { "data-slot": "pdf-viewer-page-controls", className: "flex items-center gap-2", children: [
|
|
13087
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
13088
|
+
"button",
|
|
13089
|
+
{
|
|
13090
|
+
type: "button",
|
|
13091
|
+
"data-slot": "pdf-viewer-prev-page-button",
|
|
13092
|
+
onClick: handlePrevPage,
|
|
13093
|
+
disabled: (currentPage ?? 1) <= 1,
|
|
13094
|
+
className: pdfViewerToolbarButtonVariants(),
|
|
13095
|
+
children: "\u2039"
|
|
13096
|
+
}
|
|
13097
|
+
),
|
|
13098
|
+
/* @__PURE__ */ jsxRuntime.jsxs("span", { "data-slot": "pdf-viewer-page-indicator", children: [
|
|
13099
|
+
currentPage,
|
|
13100
|
+
totalPages !== void 0 ? ` / ${totalPages}` : ""
|
|
13101
|
+
] }),
|
|
13102
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
13103
|
+
"button",
|
|
13104
|
+
{
|
|
13105
|
+
type: "button",
|
|
13106
|
+
"data-slot": "pdf-viewer-next-page-button",
|
|
13107
|
+
onClick: handleNextPage,
|
|
13108
|
+
disabled: totalPages !== void 0 && (currentPage ?? 0) >= totalPages,
|
|
13109
|
+
className: pdfViewerToolbarButtonVariants(),
|
|
13110
|
+
children: "\u203A"
|
|
13111
|
+
}
|
|
13112
|
+
)
|
|
13113
|
+
] }),
|
|
13114
|
+
showZoomControls && /* @__PURE__ */ jsxRuntime.jsxs("div", { "data-slot": "pdf-viewer-zoom-controls", className: "flex items-center gap-2", children: [
|
|
13115
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
13116
|
+
"button",
|
|
13117
|
+
{
|
|
13118
|
+
type: "button",
|
|
13119
|
+
"data-slot": "pdf-viewer-zoom-out-button",
|
|
13120
|
+
onClick: handleZoomOut,
|
|
13121
|
+
className: pdfViewerToolbarButtonVariants(),
|
|
13122
|
+
children: "\u2212"
|
|
13123
|
+
}
|
|
13124
|
+
),
|
|
13125
|
+
/* @__PURE__ */ jsxRuntime.jsxs("span", { "data-slot": "pdf-viewer-zoom-indicator", children: [
|
|
13126
|
+
Math.round((zoom ?? 1) * 100),
|
|
13127
|
+
"%"
|
|
13128
|
+
] }),
|
|
13129
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
13130
|
+
"button",
|
|
13131
|
+
{
|
|
13132
|
+
type: "button",
|
|
13133
|
+
"data-slot": "pdf-viewer-zoom-in-button",
|
|
13134
|
+
onClick: handleZoomIn,
|
|
13135
|
+
className: pdfViewerToolbarButtonVariants(),
|
|
13136
|
+
children: "+"
|
|
13137
|
+
}
|
|
13138
|
+
)
|
|
13139
|
+
] })
|
|
13140
|
+
]
|
|
13141
|
+
}
|
|
13142
|
+
),
|
|
13143
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { "data-slot": "pdf-viewer-frame-container", className: pdfViewerFrameVariants(), children: [
|
|
13144
|
+
status === "loading" && /* @__PURE__ */ jsxRuntime.jsx(
|
|
13145
|
+
"output",
|
|
13146
|
+
{
|
|
13147
|
+
"data-slot": "pdf-viewer-loading",
|
|
13148
|
+
className: pdfViewerStatusVariants({ tone: "loading" }),
|
|
13149
|
+
children: loadingLabel
|
|
13150
|
+
}
|
|
13151
|
+
),
|
|
13152
|
+
status === "error" && /* @__PURE__ */ jsxRuntime.jsx(
|
|
13153
|
+
"div",
|
|
13154
|
+
{
|
|
13155
|
+
"data-slot": "pdf-viewer-error",
|
|
13156
|
+
role: "alert",
|
|
13157
|
+
className: pdfViewerStatusVariants({ tone: "error" }),
|
|
13158
|
+
children: errorLabel
|
|
13159
|
+
}
|
|
13160
|
+
),
|
|
13161
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
13162
|
+
"iframe",
|
|
13163
|
+
{
|
|
13164
|
+
ref: frameRef,
|
|
13165
|
+
"data-slot": "pdf-viewer-frame",
|
|
13166
|
+
src: buildFrameSrc(fileUrl, currentPage, zoom),
|
|
13167
|
+
title: fileUrl,
|
|
13168
|
+
className: cn83(
|
|
13169
|
+
"h-full min-h-64 w-full border-0",
|
|
13170
|
+
status !== "loaded" && "pointer-events-none absolute inset-0 opacity-0"
|
|
13171
|
+
)
|
|
13172
|
+
}
|
|
13173
|
+
)
|
|
13174
|
+
] })
|
|
13175
|
+
] });
|
|
13176
|
+
}
|
|
13177
|
+
MosaicPdfViewer.displayName = "MosaicPdfViewer";
|
|
13178
|
+
var splitPaneRootVariants = classVarianceAuthority.cva(["flex h-full w-full min-h-0"]);
|
|
13179
|
+
var splitPaneHandleVariants = classVarianceAuthority.cva([
|
|
13180
|
+
"relative w-1 shrink-0 cursor-col-resize touch-none select-none bg-border",
|
|
13181
|
+
"transition-colors hover:bg-accent focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring"
|
|
13182
|
+
]);
|
|
13183
|
+
var splitPaneCollapseButtonVariants = classVarianceAuthority.cva([
|
|
13184
|
+
"inline-flex h-11 w-6 shrink-0 items-center justify-center self-center rounded-md border border-border text-sm",
|
|
13185
|
+
"transition-colors hover:bg-accent/50"
|
|
13186
|
+
]);
|
|
13187
|
+
function cn84(...classes) {
|
|
13188
|
+
return classes.filter(Boolean).join(" ");
|
|
13189
|
+
}
|
|
13190
|
+
function mergeRefs(externalRef, node) {
|
|
13191
|
+
if (typeof externalRef === "function") {
|
|
13192
|
+
externalRef(node);
|
|
13193
|
+
} else if (externalRef && typeof externalRef === "object") {
|
|
13194
|
+
externalRef.current = node;
|
|
13195
|
+
}
|
|
13196
|
+
}
|
|
13197
|
+
var DEFAULT_SIDE_WIDTH = 30;
|
|
13198
|
+
var MIN_SIDE_WIDTH = 15;
|
|
13199
|
+
var MAX_SIDE_WIDTH = 70;
|
|
13200
|
+
var KEYBOARD_STEP = 5;
|
|
13201
|
+
function clampSideWidth(width) {
|
|
13202
|
+
return Math.min(MAX_SIDE_WIDTH, Math.max(MIN_SIDE_WIDTH, width));
|
|
13203
|
+
}
|
|
13204
|
+
function MosaicResizableSplitPane({
|
|
13205
|
+
main,
|
|
13206
|
+
side,
|
|
13207
|
+
sideWidth = DEFAULT_SIDE_WIDTH,
|
|
13208
|
+
onSideWidthChange,
|
|
13209
|
+
isSideCollapsed = false,
|
|
13210
|
+
onToggleSideCollapsed,
|
|
13211
|
+
collapseButtonAriaLabel,
|
|
13212
|
+
resizeHandleAriaLabel,
|
|
13213
|
+
className,
|
|
13214
|
+
ref
|
|
13215
|
+
}) {
|
|
13216
|
+
const rootRef = React28.useRef(null);
|
|
13217
|
+
const isDraggingRef = React28.useRef(false);
|
|
13218
|
+
React28.useEffect(() => {
|
|
13219
|
+
function handlePointerMove(event) {
|
|
13220
|
+
if (!isDraggingRef.current) return;
|
|
13221
|
+
const rootNode = rootRef.current;
|
|
13222
|
+
if (!rootNode || onSideWidthChange === void 0) return;
|
|
13223
|
+
const rect = rootNode.getBoundingClientRect();
|
|
13224
|
+
if (rect.width === 0) return;
|
|
13225
|
+
const distanceFromRight = rect.right - event.clientX;
|
|
13226
|
+
const rawWidth = distanceFromRight / rect.width * 100;
|
|
13227
|
+
onSideWidthChange(clampSideWidth(rawWidth));
|
|
13228
|
+
}
|
|
13229
|
+
function handlePointerUp() {
|
|
13230
|
+
isDraggingRef.current = false;
|
|
13231
|
+
}
|
|
13232
|
+
window.addEventListener("pointermove", handlePointerMove);
|
|
13233
|
+
window.addEventListener("pointerup", handlePointerUp);
|
|
13234
|
+
return () => {
|
|
13235
|
+
window.removeEventListener("pointermove", handlePointerMove);
|
|
13236
|
+
window.removeEventListener("pointerup", handlePointerUp);
|
|
13237
|
+
};
|
|
13238
|
+
}, [onSideWidthChange]);
|
|
13239
|
+
function handleHandlePointerDown() {
|
|
13240
|
+
isDraggingRef.current = true;
|
|
13241
|
+
}
|
|
13242
|
+
function handleHandleKeyDown(event) {
|
|
13243
|
+
if (onSideWidthChange === void 0) return;
|
|
13244
|
+
if (event.key === "ArrowLeft") {
|
|
13245
|
+
event.preventDefault();
|
|
13246
|
+
onSideWidthChange(clampSideWidth(sideWidth - KEYBOARD_STEP));
|
|
13247
|
+
} else if (event.key === "ArrowRight") {
|
|
13248
|
+
event.preventDefault();
|
|
13249
|
+
onSideWidthChange(clampSideWidth(sideWidth + KEYBOARD_STEP));
|
|
13250
|
+
}
|
|
13251
|
+
}
|
|
13252
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
13253
|
+
"div",
|
|
13254
|
+
{
|
|
13255
|
+
ref: (node) => {
|
|
13256
|
+
rootRef.current = node;
|
|
13257
|
+
mergeRefs(ref, node);
|
|
13258
|
+
},
|
|
13259
|
+
"data-slot": "resizable-split-pane",
|
|
13260
|
+
className: cn84(splitPaneRootVariants(), className),
|
|
13261
|
+
children: [
|
|
13262
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { "data-slot": "resizable-split-pane-main", className: "min-h-0 min-w-0 flex-1 overflow-auto", children: main }),
|
|
13263
|
+
!isSideCollapsed && /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
13264
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
13265
|
+
"div",
|
|
13266
|
+
{
|
|
13267
|
+
role: "separator",
|
|
13268
|
+
"aria-orientation": "vertical",
|
|
13269
|
+
"aria-valuenow": Math.round(sideWidth),
|
|
13270
|
+
"aria-valuemin": MIN_SIDE_WIDTH,
|
|
13271
|
+
"aria-valuemax": MAX_SIDE_WIDTH,
|
|
13272
|
+
"aria-label": resizeHandleAriaLabel,
|
|
13273
|
+
tabIndex: 0,
|
|
13274
|
+
"data-slot": "resizable-split-pane-handle",
|
|
13275
|
+
onPointerDown: handleHandlePointerDown,
|
|
13276
|
+
onKeyDown: handleHandleKeyDown,
|
|
13277
|
+
className: splitPaneHandleVariants()
|
|
13278
|
+
}
|
|
13279
|
+
),
|
|
13280
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
13281
|
+
"div",
|
|
13282
|
+
{
|
|
13283
|
+
"data-slot": "resizable-split-pane-side",
|
|
13284
|
+
style: { width: `${sideWidth}%` },
|
|
13285
|
+
className: "min-h-0 shrink-0 overflow-auto",
|
|
13286
|
+
children: side
|
|
13287
|
+
}
|
|
13288
|
+
)
|
|
13289
|
+
] }),
|
|
13290
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
13291
|
+
"button",
|
|
13292
|
+
{
|
|
13293
|
+
type: "button",
|
|
13294
|
+
"data-slot": "resizable-split-pane-collapse-button",
|
|
13295
|
+
"aria-label": collapseButtonAriaLabel,
|
|
13296
|
+
"aria-expanded": !isSideCollapsed,
|
|
13297
|
+
onClick: onToggleSideCollapsed,
|
|
13298
|
+
className: splitPaneCollapseButtonVariants(),
|
|
13299
|
+
children: isSideCollapsed ? "\u2039" : "\u203A"
|
|
13300
|
+
}
|
|
13301
|
+
)
|
|
13302
|
+
]
|
|
13303
|
+
}
|
|
13304
|
+
);
|
|
13305
|
+
}
|
|
13306
|
+
MosaicResizableSplitPane.displayName = "MosaicResizableSplitPane";
|
|
13307
|
+
var tagInputRootVariants = classVarianceAuthority.cva([
|
|
13308
|
+
"flex w-full flex-wrap items-center gap-1.5 rounded-md border border-border",
|
|
13309
|
+
"bg-background px-2 py-1.5 text-sm shadow-xs",
|
|
13310
|
+
"focus-within:ring-ring focus-within:ring-[3px]",
|
|
13311
|
+
"has-[input[aria-disabled='true']]:cursor-not-allowed has-[input[aria-disabled='true']]:opacity-50"
|
|
13312
|
+
]);
|
|
13313
|
+
var tagInputTagVariants = classVarianceAuthority.cva([
|
|
13314
|
+
"inline-flex items-center gap-1 rounded-md bg-accent px-2 py-0.5",
|
|
13315
|
+
"text-sm text-accent-foreground"
|
|
13316
|
+
]);
|
|
13317
|
+
var tagInputRemoveButtonVariants = classVarianceAuthority.cva([
|
|
13318
|
+
"inline-flex size-4 shrink-0 items-center justify-center rounded-sm",
|
|
13319
|
+
"text-accent-foreground/70 outline-none transition-colors",
|
|
13320
|
+
"hover:bg-accent-foreground/10 hover:text-accent-foreground",
|
|
13321
|
+
"focus-visible:ring-ring focus-visible:ring-[2px]"
|
|
13322
|
+
]);
|
|
13323
|
+
var tagInputFieldVariants = classVarianceAuthority.cva([
|
|
13324
|
+
"min-w-[6ch] flex-1 border-none bg-transparent px-1 py-0.5 text-sm text-foreground outline-none",
|
|
13325
|
+
"placeholder:text-muted-foreground"
|
|
13326
|
+
]);
|
|
13327
|
+
function cn85(...classes) {
|
|
13328
|
+
return classes.filter(Boolean).join(" ");
|
|
13329
|
+
}
|
|
13330
|
+
function mergeRefs2(externalRef, node) {
|
|
13331
|
+
if (typeof externalRef === "function") {
|
|
13332
|
+
externalRef(node);
|
|
13333
|
+
} else if (externalRef && typeof externalRef === "object") {
|
|
13334
|
+
externalRef.current = node;
|
|
13335
|
+
}
|
|
13336
|
+
}
|
|
13337
|
+
function MosaicTagInput({
|
|
13338
|
+
tags,
|
|
13339
|
+
onAddTag,
|
|
13340
|
+
onRemoveTag,
|
|
13341
|
+
placeholder,
|
|
13342
|
+
removeTagAriaLabel,
|
|
13343
|
+
suggestions,
|
|
13344
|
+
maxTags,
|
|
13345
|
+
className,
|
|
13346
|
+
ref
|
|
13347
|
+
}) {
|
|
13348
|
+
const [inputValue, setInputValue] = React28.useState("");
|
|
13349
|
+
const inputRef = React28.useRef(null);
|
|
13350
|
+
const filter = combobox.Combobox.useFilter({ sensitivity: "base" });
|
|
13351
|
+
const isMaxReached = maxTags !== void 0 && tags.length >= maxTags;
|
|
13352
|
+
const trimmedValue = inputValue.trim();
|
|
13353
|
+
const filteredSuggestions = React28.useMemo(() => {
|
|
13354
|
+
if (!suggestions || trimmedValue.length === 0) return [];
|
|
13355
|
+
return suggestions.filter(
|
|
13356
|
+
(suggestion) => !tags.includes(suggestion) && filter.contains(suggestion, trimmedValue)
|
|
13357
|
+
);
|
|
13358
|
+
}, [suggestions, tags, trimmedValue, filter]);
|
|
13359
|
+
function commitTag(rawValue) {
|
|
13360
|
+
if (isMaxReached) return;
|
|
13361
|
+
const trimmed = rawValue.trim();
|
|
13362
|
+
if (trimmed.length === 0) return;
|
|
13363
|
+
if (tags.includes(trimmed)) return;
|
|
13364
|
+
onAddTag(trimmed);
|
|
13365
|
+
setInputValue("");
|
|
13366
|
+
}
|
|
13367
|
+
function handleKeyDown(event) {
|
|
13368
|
+
if (event.key === "Enter") {
|
|
13369
|
+
event.preventDefault();
|
|
13370
|
+
commitTag(inputValue);
|
|
13371
|
+
return;
|
|
13372
|
+
}
|
|
13373
|
+
if (event.key === "Backspace" && inputValue.length === 0 && tags.length > 0) {
|
|
13374
|
+
const lastTag = tags[tags.length - 1];
|
|
13375
|
+
if (lastTag !== void 0) onRemoveTag(lastTag);
|
|
13376
|
+
}
|
|
13377
|
+
}
|
|
13378
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { "data-slot": "tag-input", className: cn85(tagInputRootVariants(), className), children: [
|
|
13379
|
+
tags.map((tag) => /* @__PURE__ */ jsxRuntime.jsxs("span", { "data-slot": "tag-input-tag", className: tagInputTagVariants(), children: [
|
|
13380
|
+
tag,
|
|
13381
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
13382
|
+
"button",
|
|
13383
|
+
{
|
|
13384
|
+
type: "button",
|
|
13385
|
+
"aria-label": removeTagAriaLabel(tag),
|
|
13386
|
+
"data-slot": "tag-input-remove-button",
|
|
13387
|
+
className: tagInputRemoveButtonVariants(),
|
|
13388
|
+
onClick: () => onRemoveTag(tag),
|
|
13389
|
+
children: "\xD7"
|
|
13390
|
+
}
|
|
13391
|
+
)
|
|
13392
|
+
] }, tag)),
|
|
13393
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
13394
|
+
"input",
|
|
13395
|
+
{
|
|
13396
|
+
ref: (node) => {
|
|
13397
|
+
inputRef.current = node;
|
|
13398
|
+
mergeRefs2(ref, node);
|
|
13399
|
+
},
|
|
13400
|
+
type: "text",
|
|
13401
|
+
value: inputValue,
|
|
13402
|
+
placeholder,
|
|
13403
|
+
onChange: (event) => setInputValue(event.target.value),
|
|
13404
|
+
onKeyDown: handleKeyDown,
|
|
13405
|
+
"aria-disabled": isMaxReached ? true : void 0,
|
|
13406
|
+
"data-max-reached": isMaxReached ? true : void 0,
|
|
13407
|
+
"data-slot": "tag-input-field",
|
|
13408
|
+
className: tagInputFieldVariants()
|
|
13409
|
+
}
|
|
13410
|
+
),
|
|
13411
|
+
filteredSuggestions.length > 0 && /* @__PURE__ */ jsxRuntime.jsx(
|
|
13412
|
+
"ul",
|
|
13413
|
+
{
|
|
13414
|
+
"data-slot": "tag-input-suggestions",
|
|
13415
|
+
className: cn85(
|
|
13416
|
+
"z-50 mt-1 w-full min-w-[8rem] overflow-hidden rounded-md border border-border",
|
|
13417
|
+
"bg-popover p-1 text-sm text-popover-foreground shadow-md"
|
|
13418
|
+
),
|
|
13419
|
+
children: filteredSuggestions.map((suggestion) => /* @__PURE__ */ jsxRuntime.jsx("li", { children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
13420
|
+
"button",
|
|
13421
|
+
{
|
|
13422
|
+
type: "button",
|
|
13423
|
+
"data-slot": "tag-input-suggestion",
|
|
13424
|
+
className: "w-full cursor-pointer select-none rounded-sm px-2 py-1.5 text-left outline-none hover:bg-accent hover:text-accent-foreground focus-visible:ring-ring focus-visible:ring-[2px]",
|
|
13425
|
+
onClick: () => commitTag(suggestion),
|
|
13426
|
+
children: suggestion
|
|
13427
|
+
}
|
|
13428
|
+
) }, suggestion))
|
|
13429
|
+
}
|
|
13430
|
+
)
|
|
13431
|
+
] });
|
|
13432
|
+
}
|
|
13433
|
+
MosaicTagInput.displayName = "MosaicTagInput";
|
|
12859
13434
|
|
|
12860
13435
|
Object.defineProperty(exports, "Accordion", {
|
|
12861
13436
|
enumerable: true,
|
|
@@ -12958,6 +13533,7 @@ exports.MosaicOrgPanel = MosaicOrgPanel;
|
|
|
12958
13533
|
exports.MosaicOrgProfilePage = MosaicOrgProfilePage;
|
|
12959
13534
|
exports.MosaicOrgRoleBadge = MosaicOrgRoleBadge;
|
|
12960
13535
|
exports.MosaicOrgSwitcher = MosaicOrgSwitcher;
|
|
13536
|
+
exports.MosaicPdfViewer = MosaicPdfViewer;
|
|
12961
13537
|
exports.MosaicPreferencesPanel = MosaicPreferencesPanel;
|
|
12962
13538
|
exports.MosaicPricingCard = MosaicPricingCard;
|
|
12963
13539
|
exports.MosaicProfilePanel = MosaicProfilePanel;
|
|
@@ -12968,6 +13544,7 @@ exports.MosaicQuickAgentSelector = MosaicQuickAgentSelector;
|
|
|
12968
13544
|
exports.MosaicQuickStartPanel = MosaicQuickStartPanel;
|
|
12969
13545
|
exports.MosaicRadioGroup = MosaicRadioGroup;
|
|
12970
13546
|
exports.MosaicRadioGroupItem = MosaicRadioGroupItem;
|
|
13547
|
+
exports.MosaicResizableSplitPane = MosaicResizableSplitPane;
|
|
12971
13548
|
exports.MosaicScrollArea = MosaicScrollArea;
|
|
12972
13549
|
exports.MosaicSelect = MosaicSelect;
|
|
12973
13550
|
exports.MosaicSelectorModal = MosaicSelectorModal;
|
|
@@ -12983,6 +13560,7 @@ exports.MosaicTabs = MosaicTabs;
|
|
|
12983
13560
|
exports.MosaicTabsList = MosaicTabsList;
|
|
12984
13561
|
exports.MosaicTabsPanel = MosaicTabsPanel;
|
|
12985
13562
|
exports.MosaicTabsTrigger = MosaicTabsTrigger;
|
|
13563
|
+
exports.MosaicTagInput = MosaicTagInput;
|
|
12986
13564
|
exports.MosaicTemplateCard = MosaicTemplateCard;
|
|
12987
13565
|
exports.MosaicTemplateGallery = MosaicTemplateGallery;
|
|
12988
13566
|
exports.MosaicTemplatePreview = MosaicTemplatePreview;
|
|
@@ -12990,6 +13568,8 @@ exports.MosaicTestimonialsGrid = MosaicTestimonialsGrid;
|
|
|
12990
13568
|
exports.MosaicTextarea = MosaicTextarea;
|
|
12991
13569
|
exports.MosaicThemeProvider = MosaicThemeProvider;
|
|
12992
13570
|
exports.MosaicThemeToggle = MosaicThemeToggle;
|
|
13571
|
+
exports.MosaicToast = MosaicToast;
|
|
13572
|
+
exports.MosaicToastProvider = MosaicToastProvider;
|
|
12993
13573
|
exports.MosaicToolToggleList = MosaicToolToggleList;
|
|
12994
13574
|
exports.MosaicTooltip = MosaicTooltip;
|
|
12995
13575
|
exports.MosaicTooltipContent = MosaicTooltipContent;
|
|
@@ -13005,7 +13585,21 @@ exports.buttonVariants = buttonVariants;
|
|
|
13005
13585
|
exports.chatMessageBubbleVariants = chatMessageBubbleVariants;
|
|
13006
13586
|
exports.chatMessageContainerVariants = chatMessageContainerVariants;
|
|
13007
13587
|
exports.chatMessageToolStatusVariants = chatMessageToolStatusVariants;
|
|
13588
|
+
exports.pdfViewerFrameVariants = pdfViewerFrameVariants;
|
|
13589
|
+
exports.pdfViewerStatusVariants = pdfViewerStatusVariants;
|
|
13590
|
+
exports.pdfViewerToolbarButtonVariants = pdfViewerToolbarButtonVariants;
|
|
13008
13591
|
exports.skeletonVariants = skeletonVariants;
|
|
13592
|
+
exports.splitPaneCollapseButtonVariants = splitPaneCollapseButtonVariants;
|
|
13593
|
+
exports.splitPaneHandleVariants = splitPaneHandleVariants;
|
|
13594
|
+
exports.splitPaneRootVariants = splitPaneRootVariants;
|
|
13595
|
+
exports.tagInputFieldVariants = tagInputFieldVariants;
|
|
13596
|
+
exports.tagInputRemoveButtonVariants = tagInputRemoveButtonVariants;
|
|
13597
|
+
exports.tagInputRootVariants = tagInputRootVariants;
|
|
13598
|
+
exports.tagInputTagVariants = tagInputTagVariants;
|
|
13599
|
+
exports.toastCardVariants = toastCardVariants;
|
|
13600
|
+
exports.toastDismissButtonVariants = toastDismissButtonVariants;
|
|
13601
|
+
exports.toastProviderPositionVariants = toastProviderPositionVariants;
|
|
13602
|
+
exports.toastTitleVariants = toastTitleVariants;
|
|
13009
13603
|
exports.toolToggleListRowVariants = toolToggleListRowVariants;
|
|
13010
13604
|
exports.toolToggleListSectionVariants = toolToggleListSectionVariants;
|
|
13011
13605
|
exports.useBreakpoint = useBreakpoint;
|