@ai-matrx/sharing 0.1.4 → 0.1.6
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/CHANGELOG.md +51 -1
- package/dist/access-react.cjs +113 -137
- package/dist/access-react.cjs.map +1 -1
- package/dist/access-react.js +30 -54
- package/dist/access-react.js.map +1 -1
- package/dist/core.cjs +5 -204
- package/dist/core.cjs.map +1 -1
- package/dist/core.js +5 -194
- package/dist/core.js.map +1 -1
- package/dist/react.cjs +207 -234
- package/dist/react.cjs.map +1 -1
- package/dist/react.js +79 -106
- package/dist/react.js.map +1 -1
- package/package.json +5 -5
package/dist/access-react.js
CHANGED
|
@@ -163,12 +163,13 @@ import {
|
|
|
163
163
|
Trash2,
|
|
164
164
|
TriangleAlert
|
|
165
165
|
} from "lucide-react";
|
|
166
|
-
import { Avatar as Avatar2, AvatarFallback as AvatarFallback2, AvatarImage as AvatarImage2
|
|
166
|
+
import { Avatar as Avatar2, AvatarFallback as AvatarFallback2, AvatarImage as AvatarImage2 } from "@ai-matrx/design-system";
|
|
167
|
+
import { Button as Button3 } from "@ai-matrx/design-system/controls";
|
|
167
168
|
|
|
168
169
|
// src/access/react/RequestAccessPanel.tsx
|
|
169
170
|
import { useState } from "react";
|
|
170
171
|
import { Check, Loader2, Send, Undo2 } from "lucide-react";
|
|
171
|
-
import { Button } from "@ai-matrx/design-system";
|
|
172
|
+
import { Button } from "@ai-matrx/design-system/controls";
|
|
172
173
|
import { getAccessEnv } from "@ai-matrx/data/access";
|
|
173
174
|
import {
|
|
174
175
|
createAccessRequest,
|
|
@@ -264,18 +265,15 @@ function RequestAccessPanel({
|
|
|
264
265
|
cmsToken ? "Your request is saved. Once an owner adds you to the organization, this site will open." : delivered === 0 ? "We couldn't reach them with a message, but your request is saved and they'll see it." : "They\u2019ve been messaged. You\u2019ll get a message back the moment they answer, and this page will open.",
|
|
265
266
|
ui.renderErrorMenu({})
|
|
266
267
|
] }),
|
|
267
|
-
/* @__PURE__ */
|
|
268
|
+
/* @__PURE__ */ jsx2(
|
|
268
269
|
Button,
|
|
269
270
|
{
|
|
270
|
-
className: "mt-3
|
|
271
|
-
|
|
271
|
+
className: "mt-3",
|
|
272
|
+
icon: busy ? /* @__PURE__ */ jsx2(Loader2, { className: "animate-spin", "aria-hidden": true }) : /* @__PURE__ */ jsx2(Undo2, { "aria-hidden": true }),
|
|
272
273
|
variant: "outline",
|
|
273
274
|
disabled: busy,
|
|
274
275
|
onClick: () => void withdraw(),
|
|
275
|
-
children:
|
|
276
|
-
busy ? /* @__PURE__ */ jsx2(Loader2, { className: "mr-1.5 h-3.5 w-3.5 animate-spin", "aria-hidden": true }) : /* @__PURE__ */ jsx2(Undo2, { className: "mr-1.5 h-3.5 w-3.5", "aria-hidden": true }),
|
|
277
|
-
"Withdraw request"
|
|
278
|
-
]
|
|
276
|
+
children: "Withdraw request"
|
|
279
277
|
}
|
|
280
278
|
)
|
|
281
279
|
] });
|
|
@@ -291,17 +289,14 @@ function RequestAccessPanel({
|
|
|
291
289
|
request.decisionNote,
|
|
292
290
|
"\u201D"
|
|
293
291
|
] }) : null,
|
|
294
|
-
/* @__PURE__ */
|
|
292
|
+
/* @__PURE__ */ jsx2(
|
|
295
293
|
Button,
|
|
296
294
|
{
|
|
297
|
-
className: "mt-3
|
|
298
|
-
|
|
295
|
+
className: "mt-3",
|
|
296
|
+
icon: /* @__PURE__ */ jsx2(Send, { "aria-hidden": true }),
|
|
299
297
|
variant: "outline",
|
|
300
298
|
onClick: () => setReasking(true),
|
|
301
|
-
children:
|
|
302
|
-
/* @__PURE__ */ jsx2(Send, { className: "mr-1.5 h-3.5 w-3.5", "aria-hidden": true }),
|
|
303
|
-
"Ask again"
|
|
304
|
-
]
|
|
299
|
+
children: "Ask again"
|
|
305
300
|
}
|
|
306
301
|
)
|
|
307
302
|
] });
|
|
@@ -343,17 +338,15 @@ function RequestAccessPanel({
|
|
|
343
338
|
onChange: (event) => setNote(event.target.value)
|
|
344
339
|
}
|
|
345
340
|
),
|
|
346
|
-
/* @__PURE__ */
|
|
341
|
+
/* @__PURE__ */ jsx2(
|
|
347
342
|
Button,
|
|
348
343
|
{
|
|
349
344
|
className: "mt-3",
|
|
350
|
-
|
|
345
|
+
icon: busy ? /* @__PURE__ */ jsx2(Loader2, { className: "animate-spin", "aria-hidden": true }) : /* @__PURE__ */ jsx2(Send, { "aria-hidden": true }),
|
|
346
|
+
variant: "primary",
|
|
351
347
|
disabled: busy,
|
|
352
348
|
onClick: () => void send(),
|
|
353
|
-
children:
|
|
354
|
-
busy ? /* @__PURE__ */ jsx2(Loader2, { className: "mr-1.5 h-4 w-4 animate-spin", "aria-hidden": true }) : /* @__PURE__ */ jsx2(Send, { className: "mr-1.5 h-4 w-4", "aria-hidden": true }),
|
|
355
|
-
"Request access"
|
|
356
|
-
]
|
|
349
|
+
children: "Request access"
|
|
357
350
|
}
|
|
358
351
|
)
|
|
359
352
|
] });
|
|
@@ -381,7 +374,7 @@ function LevelChoice({
|
|
|
381
374
|
// src/access/react/BlindAccessAsk.tsx
|
|
382
375
|
import { useState as useState2 } from "react";
|
|
383
376
|
import { KeyRound } from "lucide-react";
|
|
384
|
-
import { Button as Button2 } from "@ai-matrx/design-system";
|
|
377
|
+
import { Button as Button2 } from "@ai-matrx/design-system/controls";
|
|
385
378
|
import { askForAccessBlind, BLIND_ASK_ANSWER } from "@ai-matrx/data/access";
|
|
386
379
|
import { jsx as jsx3, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
387
380
|
function BlindAccessAsk({
|
|
@@ -395,10 +388,11 @@ function BlindAccessAsk({
|
|
|
395
388
|
return /* @__PURE__ */ jsx3("p", { className: "text-sm text-foreground", role: "status", "data-blind-ask": "asked", children: state.says || BLIND_ASK_ANSWER });
|
|
396
389
|
}
|
|
397
390
|
return /* @__PURE__ */ jsxs3("div", { className: "flex flex-col items-start gap-2", "data-blind-ask": state.kind, children: [
|
|
398
|
-
/* @__PURE__ */
|
|
391
|
+
/* @__PURE__ */ jsx3(
|
|
399
392
|
Button2,
|
|
400
393
|
{
|
|
401
|
-
|
|
394
|
+
icon: /* @__PURE__ */ jsx3(KeyRound, { "aria-hidden": true }),
|
|
395
|
+
variant: "primary",
|
|
402
396
|
disabled: state.kind === "asking",
|
|
403
397
|
"aria-busy": state.kind === "asking",
|
|
404
398
|
onClick: () => {
|
|
@@ -416,10 +410,7 @@ function BlindAccessAsk({
|
|
|
416
410
|
);
|
|
417
411
|
},
|
|
418
412
|
"data-tap-target": true,
|
|
419
|
-
children:
|
|
420
|
-
/* @__PURE__ */ jsx3(KeyRound, { className: "mr-1.5 h-4 w-4", "aria-hidden": true }),
|
|
421
|
-
state.kind === "asking" ? "Asking\u2026" : "Ask for access"
|
|
422
|
-
]
|
|
413
|
+
children: state.kind === "asking" ? "Asking\u2026" : "Ask for access"
|
|
423
414
|
}
|
|
424
415
|
),
|
|
425
416
|
state.kind === "failed" ? /* @__PURE__ */ jsxs3("p", { className: "text-xs text-destructive", role: "alert", children: [
|
|
@@ -488,10 +479,11 @@ function RestoreArchived({
|
|
|
488
479
|
const [busy, setBusy] = useState4(false);
|
|
489
480
|
const [failure, setFailure] = useState4(null);
|
|
490
481
|
return /* @__PURE__ */ jsxs4(Fragment, { children: [
|
|
491
|
-
/* @__PURE__ */
|
|
482
|
+
/* @__PURE__ */ jsx4(
|
|
492
483
|
Button3,
|
|
493
484
|
{
|
|
494
|
-
|
|
485
|
+
icon: /* @__PURE__ */ jsx4(RotateCcw, { "aria-hidden": true }),
|
|
486
|
+
variant: "primary",
|
|
495
487
|
disabled: busy,
|
|
496
488
|
onClick: async () => {
|
|
497
489
|
setBusy(true);
|
|
@@ -506,10 +498,7 @@ function RestoreArchived({
|
|
|
506
498
|
setBusy(false);
|
|
507
499
|
}
|
|
508
500
|
},
|
|
509
|
-
children:
|
|
510
|
-
/* @__PURE__ */ jsx4(RotateCcw, { className: "mr-1.5 h-4 w-4", "aria-hidden": true }),
|
|
511
|
-
busy ? "Restoring\u2026" : "Restore"
|
|
512
|
-
]
|
|
501
|
+
children: busy ? "Restoring\u2026" : "Restore"
|
|
513
502
|
}
|
|
514
503
|
),
|
|
515
504
|
failure ? /* @__PURE__ */ jsx4(
|
|
@@ -627,7 +616,7 @@ function AccessDeniedView({
|
|
|
627
616
|
const absolute = requestability === "absolute" && context.status === "denied";
|
|
628
617
|
const title = headlineOverride?.trim() || (absolute ? "You can't open this here" : headline(context));
|
|
629
618
|
const body = reason?.trim() || (absolute ? "" : explanation(context));
|
|
630
|
-
return /* @__PURE__ */ jsx4("div", { className: "matrx-touch-targets flex h-full min-h-64 w-full items-center justify-center p-6", children: /* @__PURE__ */ jsxs4("div", { className: "w-full max-w-xl", children: [
|
|
619
|
+
return /* @__PURE__ */ jsx4("div", { "data-matrx-access-refused": "", className: "matrx-touch-targets flex h-full min-h-64 w-full items-center justify-center p-6", children: /* @__PURE__ */ jsxs4("div", { className: "w-full max-w-xl", children: [
|
|
631
620
|
/* @__PURE__ */ jsxs4("div", { className: "flex items-start gap-4", children: [
|
|
632
621
|
/* @__PURE__ */ jsx4("div", { className: "flex h-14 w-14 shrink-0 items-center justify-center rounded-2xl border border-border bg-muted", children: /* @__PURE__ */ jsx4(StatusIcon, { status: context.status }) }),
|
|
633
622
|
/* @__PURE__ */ jsxs4("div", { className: "min-w-0 flex-1", children: [
|
|
@@ -720,10 +709,7 @@ function AccessDeniedView({
|
|
|
720
709
|
}) }) : null,
|
|
721
710
|
footer ? /* @__PURE__ */ jsx4("div", { className: "mt-4", children: footer }) : null,
|
|
722
711
|
/* @__PURE__ */ jsxs4("div", { className: "mt-5 flex flex-wrap items-center gap-2", children: [
|
|
723
|
-
context.status === "anonymous" ? /* @__PURE__ */ jsx4(Button3, { asChild: true,
|
|
724
|
-
/* @__PURE__ */ jsx4(LogIn, { className: "mr-1.5 h-4 w-4", "aria-hidden": true }),
|
|
725
|
-
"Sign in"
|
|
726
|
-
] }) }) : null,
|
|
712
|
+
context.status === "anonymous" ? /* @__PURE__ */ jsx4(Button3, { asChild: true, icon: /* @__PURE__ */ jsx4(LogIn, { "aria-hidden": true }), variant: "primary", children: /* @__PURE__ */ jsx4(AccessLink, { href: signInHref, "data-tap-target": true, children: "Sign in" }) }) : null,
|
|
727
713
|
mayRestoreArchived(context) ? /* @__PURE__ */ jsx4(
|
|
728
714
|
RestoreArchived,
|
|
729
715
|
{
|
|
@@ -737,21 +723,11 @@ function AccessDeniedView({
|
|
|
737
723
|
}
|
|
738
724
|
}
|
|
739
725
|
) : null,
|
|
740
|
-
(context.status === "ok" || context.status === "error") && onRetry ? /* @__PURE__ */
|
|
741
|
-
|
|
742
|
-
"Try again"
|
|
743
|
-
] }) : null,
|
|
744
|
-
ancestor && ancestorHref ? /* @__PURE__ */ jsx4(Button3, { asChild: true, size: "sm", variant: "outline", children: /* @__PURE__ */ jsxs4(AccessLink, { href: ancestorHref, "data-tap-target": true, children: [
|
|
745
|
-
/* @__PURE__ */ jsx4(ArrowLeft, { className: "mr-1.5 h-4 w-4", "aria-hidden": true }),
|
|
726
|
+
(context.status === "ok" || context.status === "error") && onRetry ? /* @__PURE__ */ jsx4(Button3, { icon: /* @__PURE__ */ jsx4(RefreshCw, { "aria-hidden": true }), variant: "primary", onClick: onRetry, children: "Try again" }) : null,
|
|
727
|
+
ancestor && ancestorHref ? /* @__PURE__ */ jsx4(Button3, { asChild: true, icon: /* @__PURE__ */ jsx4(ArrowLeft, { "aria-hidden": true }), variant: "outline", children: /* @__PURE__ */ jsxs4(AccessLink, { href: ancestorHref, "data-tap-target": true, children: [
|
|
746
728
|
"Open ",
|
|
747
729
|
ancestor.title ?? ancestor.label.toLowerCase()
|
|
748
|
-
] }) }) : fallbackHref ? /* @__PURE__ */ jsx4(Button3, { asChild: true,
|
|
749
|
-
/* @__PURE__ */ jsx4(ArrowLeft, { className: "mr-1.5 h-4 w-4", "aria-hidden": true }),
|
|
750
|
-
fallbackLabel ?? "Back to what you can see"
|
|
751
|
-
] }) }) : /* @__PURE__ */ jsxs4(Button3, { size: "sm", variant: "outline", onClick: () => router.back(), children: [
|
|
752
|
-
/* @__PURE__ */ jsx4(ArrowLeft, { className: "mr-1.5 h-4 w-4", "aria-hidden": true }),
|
|
753
|
-
"Go back"
|
|
754
|
-
] })
|
|
730
|
+
] }) }) : fallbackHref ? /* @__PURE__ */ jsx4(Button3, { asChild: true, icon: /* @__PURE__ */ jsx4(ArrowLeft, { "aria-hidden": true }), variant: "outline", children: /* @__PURE__ */ jsx4(AccessLink, { href: fallbackHref, "data-tap-target": true, children: fallbackLabel ?? "Back to what you can see" }) }) : /* @__PURE__ */ jsx4(Button3, { icon: /* @__PURE__ */ jsx4(ArrowLeft, { "aria-hidden": true }), variant: "outline", onClick: () => router.back(), children: "Go back" })
|
|
755
731
|
] })
|
|
756
732
|
] }) });
|
|
757
733
|
}
|
|
@@ -1071,7 +1047,7 @@ function ForbiddenSurfaceView({
|
|
|
1071
1047
|
homeHref = "/dashboard"
|
|
1072
1048
|
}) {
|
|
1073
1049
|
const unverified = state === "unverified";
|
|
1074
|
-
return /* @__PURE__ */ jsx8("div", { className: "flex h-full min-h-64 w-full items-center justify-center p-6", children: /* @__PURE__ */ jsxs8("div", { className: "w-full max-w-lg", children: [
|
|
1050
|
+
return /* @__PURE__ */ jsx8("div", { "data-matrx-access-refused": "", className: "flex h-full min-h-64 w-full items-center justify-center p-6", children: /* @__PURE__ */ jsxs8("div", { className: "w-full max-w-lg", children: [
|
|
1075
1051
|
/* @__PURE__ */ jsxs8("div", { className: "flex items-start gap-4", children: [
|
|
1076
1052
|
/* @__PURE__ */ jsx8("div", { className: "flex h-12 w-12 shrink-0 items-center justify-center rounded-full bg-muted", children: /* @__PURE__ */ jsx8(Lock3, { className: "h-6 w-6 text-muted-foreground", "aria-hidden": true }) }),
|
|
1077
1053
|
/* @__PURE__ */ jsxs8("div", { className: "min-w-0 flex-1", children: [
|