@lessly/ui 1.2.0 → 1.3.0
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/dist/index.d.ts +52 -1
- package/dist/index.js +394 -370
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -5311,14 +5311,36 @@ function AppShell({ sidebar, topBar, children, className }) {
|
|
|
5311
5311
|
}
|
|
5312
5312
|
var AuthenticatedLayout = AppShell;
|
|
5313
5313
|
|
|
5314
|
-
// src/components/
|
|
5314
|
+
// src/components/top-bar.tsx
|
|
5315
5315
|
import * as React71 from "react";
|
|
5316
|
+
import { jsx as jsx88, jsxs as jsxs59 } from "react/jsx-runtime";
|
|
5317
|
+
var TopBar = React71.forwardRef(
|
|
5318
|
+
({ left, right, className, ...props }, ref) => /* @__PURE__ */ jsxs59("div", { ref, className: cn("flex w-full items-center gap-1", className), ...props, children: [
|
|
5319
|
+
left,
|
|
5320
|
+
right && /* @__PURE__ */ jsx88("div", { className: "ml-auto flex items-center gap-2", children: right })
|
|
5321
|
+
] })
|
|
5322
|
+
);
|
|
5323
|
+
TopBar.displayName = "TopBar";
|
|
5324
|
+
|
|
5325
|
+
// src/components/top-bar-utilities.tsx
|
|
5326
|
+
import * as React72 from "react";
|
|
5327
|
+
import { jsx as jsx89, jsxs as jsxs60 } from "react/jsx-runtime";
|
|
5328
|
+
var TopBarUtilities = React72.forwardRef(
|
|
5329
|
+
({ items, className, ...props }, ref) => /* @__PURE__ */ jsx89("div", { ref, className: cn("flex items-center gap-1", className), ...props, children: items.map(({ name, icon, onClick }) => /* @__PURE__ */ jsxs60(Tooltip, { children: [
|
|
5330
|
+
/* @__PURE__ */ jsx89(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsx89(Button, { variant: "ghost", size: "sm", icon, "aria-label": name, onClick }) }),
|
|
5331
|
+
/* @__PURE__ */ jsx89(TooltipContent, { children: name })
|
|
5332
|
+
] }, name)) })
|
|
5333
|
+
);
|
|
5334
|
+
TopBarUtilities.displayName = "TopBarUtilities";
|
|
5335
|
+
|
|
5336
|
+
// src/components/grid.tsx
|
|
5337
|
+
import * as React73 from "react";
|
|
5316
5338
|
import { Slot as Slot7 } from "@radix-ui/react-slot";
|
|
5317
|
-
import { jsx as
|
|
5318
|
-
var Grid =
|
|
5339
|
+
import { jsx as jsx90 } from "react/jsx-runtime";
|
|
5340
|
+
var Grid = React73.forwardRef(
|
|
5319
5341
|
({ fluid = false, asChild = false, className, ...props }, ref) => {
|
|
5320
5342
|
const Comp = asChild ? Slot7 : "div";
|
|
5321
|
-
return /* @__PURE__ */
|
|
5343
|
+
return /* @__PURE__ */ jsx90(
|
|
5322
5344
|
Comp,
|
|
5323
5345
|
{
|
|
5324
5346
|
ref,
|
|
@@ -5336,9 +5358,9 @@ var Grid = React71.forwardRef(
|
|
|
5336
5358
|
Grid.displayName = "Grid";
|
|
5337
5359
|
|
|
5338
5360
|
// src/components/col.tsx
|
|
5339
|
-
import * as
|
|
5361
|
+
import * as React74 from "react";
|
|
5340
5362
|
import { Slot as Slot8 } from "@radix-ui/react-slot";
|
|
5341
|
-
import { jsx as
|
|
5363
|
+
import { jsx as jsx91 } from "react/jsx-runtime";
|
|
5342
5364
|
var TIER_MAX = { base: 4, md: 8, xl: 12 };
|
|
5343
5365
|
var SPAN = {
|
|
5344
5366
|
base: { 1: "col-span-1", 2: "col-span-2", 3: "col-span-3", 4: "col-span-4" },
|
|
@@ -5458,17 +5480,17 @@ function responsiveClasses(span, offset) {
|
|
|
5458
5480
|
}
|
|
5459
5481
|
return cn(...spanClasses, ...startClasses);
|
|
5460
5482
|
}
|
|
5461
|
-
var Col =
|
|
5483
|
+
var Col = React74.forwardRef(
|
|
5462
5484
|
({ span, offset, asChild = false, className, ...props }, ref) => {
|
|
5463
5485
|
const Comp = asChild ? Slot8 : "div";
|
|
5464
|
-
return /* @__PURE__ */
|
|
5486
|
+
return /* @__PURE__ */ jsx91(Comp, { ref, className: cn(responsiveClasses(span, offset), className), ...props });
|
|
5465
5487
|
}
|
|
5466
5488
|
);
|
|
5467
5489
|
Col.displayName = "Col";
|
|
5468
5490
|
|
|
5469
5491
|
// src/components/code-block.tsx
|
|
5470
|
-
import * as
|
|
5471
|
-
import { jsx as
|
|
5492
|
+
import * as React75 from "react";
|
|
5493
|
+
import { jsx as jsx92, jsxs as jsxs61 } from "react/jsx-runtime";
|
|
5472
5494
|
var TOKEN_CLASS = {
|
|
5473
5495
|
comment: "text-text-tertiary italic",
|
|
5474
5496
|
string: "text-text-success",
|
|
@@ -5639,30 +5661,30 @@ function dropLeading(tokens, count) {
|
|
|
5639
5661
|
}
|
|
5640
5662
|
return out;
|
|
5641
5663
|
}
|
|
5642
|
-
var CodeBlock =
|
|
5664
|
+
var CodeBlock = React75.forwardRef(
|
|
5643
5665
|
({ code, lang = "tsx", variant = "default", copy = false, filename, scroll = false, highlightLines, showLineNumbers = false, className, ...props }, ref) => {
|
|
5644
|
-
const lines =
|
|
5645
|
-
const rawLines =
|
|
5646
|
-
const highlighted =
|
|
5666
|
+
const lines = React75.useMemo(() => tokenizeLines(code, lang), [code, lang]);
|
|
5667
|
+
const rawLines = React75.useMemo(() => code.split("\n"), [code]);
|
|
5668
|
+
const highlighted = React75.useMemo(() => parseHighlightLines(highlightLines), [highlightLines]);
|
|
5647
5669
|
const isDiff = variant === "diff";
|
|
5648
5670
|
const isTerminal = variant === "terminal";
|
|
5649
5671
|
const showCopy = copy && !isTerminal;
|
|
5650
5672
|
const overlayCopy = showCopy && !filename;
|
|
5651
5673
|
const contentWhitespace = scroll ? "whitespace-pre" : "whitespace-pre-wrap break-words";
|
|
5652
|
-
const pre = /* @__PURE__ */
|
|
5674
|
+
const pre = /* @__PURE__ */ jsx92(
|
|
5653
5675
|
"pre",
|
|
5654
5676
|
{
|
|
5655
5677
|
ref,
|
|
5656
5678
|
className: cn("py-4 font-mono text-xs leading-6 text-text-secondary", scroll && "overflow-x-auto", className),
|
|
5657
5679
|
...props,
|
|
5658
|
-
children: /* @__PURE__ */
|
|
5680
|
+
children: /* @__PURE__ */ jsx92("code", { className: "block min-w-full", children: lines.map((tokens, i) => {
|
|
5659
5681
|
const n = i + 1;
|
|
5660
5682
|
const raw = rawLines[i] ?? "";
|
|
5661
5683
|
const diffKind = isDiff ? raw[0] === "+" ? "add" : raw[0] === "-" ? "remove" : null : null;
|
|
5662
5684
|
const promptLen = isTerminal && raw[0] === "$" ? 1 : 0;
|
|
5663
5685
|
const markerDrop = diffKind ? 1 : promptLen;
|
|
5664
5686
|
const body = markerDrop ? dropLeading(tokens, markerDrop) : tokens;
|
|
5665
|
-
return /* @__PURE__ */
|
|
5687
|
+
return /* @__PURE__ */ jsxs61(
|
|
5666
5688
|
"span",
|
|
5667
5689
|
{
|
|
5668
5690
|
"data-line": n,
|
|
@@ -5675,8 +5697,8 @@ var CodeBlock = React73.forwardRef(
|
|
|
5675
5697
|
!diffKind && highlighted.has(n) && "bg-bg-brand-subtle"
|
|
5676
5698
|
),
|
|
5677
5699
|
children: [
|
|
5678
|
-
showLineNumbers && /* @__PURE__ */
|
|
5679
|
-
(isDiff || isTerminal) && /* @__PURE__ */
|
|
5700
|
+
showLineNumbers && /* @__PURE__ */ jsx92("span", { "aria-hidden": true, className: "mr-3 w-8 shrink-0 select-none text-right text-text-tertiary", children: n }),
|
|
5701
|
+
(isDiff || isTerminal) && /* @__PURE__ */ jsx92(
|
|
5680
5702
|
"span",
|
|
5681
5703
|
{
|
|
5682
5704
|
"aria-hidden": true,
|
|
@@ -5689,7 +5711,7 @@ var CodeBlock = React73.forwardRef(
|
|
|
5689
5711
|
children: diffKind === "add" ? "+" : diffKind === "remove" ? "-" : promptLen > 0 ? "$" : ""
|
|
5690
5712
|
}
|
|
5691
5713
|
),
|
|
5692
|
-
/* @__PURE__ */
|
|
5714
|
+
/* @__PURE__ */ jsx92("span", { className: cn("min-w-0 flex-1", contentWhitespace), children: body.length ? body.map((token, j) => /* @__PURE__ */ jsx92("span", { className: TOKEN_CLASS[token.kind], children: token.text }, j)) : "\xA0" })
|
|
5693
5715
|
]
|
|
5694
5716
|
},
|
|
5695
5717
|
i
|
|
@@ -5697,16 +5719,16 @@ var CodeBlock = React73.forwardRef(
|
|
|
5697
5719
|
}) })
|
|
5698
5720
|
}
|
|
5699
5721
|
);
|
|
5700
|
-
return /* @__PURE__ */
|
|
5701
|
-
filename && /* @__PURE__ */
|
|
5702
|
-
/* @__PURE__ */
|
|
5703
|
-
showCopy && /* @__PURE__ */
|
|
5722
|
+
return /* @__PURE__ */ jsxs61("div", { className: "relative overflow-hidden rounded-lg border border-border-subtle bg-bg-primary", children: [
|
|
5723
|
+
filename && /* @__PURE__ */ jsxs61("div", { className: "flex items-center justify-between gap-3 border-b border-border-subtle px-4 py-2", children: [
|
|
5724
|
+
/* @__PURE__ */ jsx92("span", { className: "font-mono text-xs text-text-tertiary", children: filename }),
|
|
5725
|
+
showCopy && /* @__PURE__ */ jsx92(CopyButton, { value: code, label: "Copy code", className: "size-7" })
|
|
5704
5726
|
] }),
|
|
5705
5727
|
pre,
|
|
5706
5728
|
overlayCopy && // Always visible, on every device: a copy control you have to hover to discover is a
|
|
5707
5729
|
// control most people never find. Opaque (`bg-bg-primary`, the block's own surface) so it
|
|
5708
5730
|
// reads cleanly where a long first line runs under it.
|
|
5709
|
-
/* @__PURE__ */
|
|
5731
|
+
/* @__PURE__ */ jsx92(
|
|
5710
5732
|
CopyButton,
|
|
5711
5733
|
{
|
|
5712
5734
|
value: code,
|
|
@@ -5718,7 +5740,7 @@ var CodeBlock = React73.forwardRef(
|
|
|
5718
5740
|
}
|
|
5719
5741
|
);
|
|
5720
5742
|
CodeBlock.displayName = "CodeBlock";
|
|
5721
|
-
var Code =
|
|
5743
|
+
var Code = React75.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx92(
|
|
5722
5744
|
"code",
|
|
5723
5745
|
{
|
|
5724
5746
|
ref,
|
|
@@ -5732,13 +5754,13 @@ var Code = React73.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */
|
|
|
5732
5754
|
Code.displayName = "Code";
|
|
5733
5755
|
|
|
5734
5756
|
// src/components/grid-overlay.tsx
|
|
5735
|
-
import * as
|
|
5736
|
-
import { jsx as
|
|
5757
|
+
import * as React76 from "react";
|
|
5758
|
+
import { jsx as jsx93 } from "react/jsx-runtime";
|
|
5737
5759
|
var BASELINE = "var(--grid-gutter) / 2";
|
|
5738
|
-
var GridOverlay =
|
|
5760
|
+
var GridOverlay = React76.forwardRef(
|
|
5739
5761
|
({ columns, baseline = false, className, style, ...props }, ref) => {
|
|
5740
5762
|
const count = Number.isFinite(columns) ? Math.max(1, Math.floor(columns)) : 1;
|
|
5741
|
-
return /* @__PURE__ */
|
|
5763
|
+
return /* @__PURE__ */ jsx93(
|
|
5742
5764
|
"div",
|
|
5743
5765
|
{
|
|
5744
5766
|
ref,
|
|
@@ -5755,7 +5777,7 @@ var GridOverlay = React74.forwardRef(
|
|
|
5755
5777
|
...style
|
|
5756
5778
|
},
|
|
5757
5779
|
...props,
|
|
5758
|
-
children: Array.from({ length: count }).map((_, i) => /* @__PURE__ */
|
|
5780
|
+
children: Array.from({ length: count }).map((_, i) => /* @__PURE__ */ jsx93("span", { style: { backgroundColor: "var(--bg-brand)", opacity: 0.1 } }, i))
|
|
5759
5781
|
}
|
|
5760
5782
|
);
|
|
5761
5783
|
}
|
|
@@ -5763,10 +5785,10 @@ var GridOverlay = React74.forwardRef(
|
|
|
5763
5785
|
GridOverlay.displayName = "GridOverlay";
|
|
5764
5786
|
|
|
5765
5787
|
// src/components/attachment-chip.tsx
|
|
5766
|
-
import * as
|
|
5788
|
+
import * as React77 from "react";
|
|
5767
5789
|
import { cva as cva10 } from "class-variance-authority";
|
|
5768
5790
|
import { Link2 as Link22, Clock, Plus as Plus2 } from "lucide-react";
|
|
5769
|
-
import { jsx as
|
|
5791
|
+
import { jsx as jsx94, jsxs as jsxs62 } from "react/jsx-runtime";
|
|
5770
5792
|
var attachmentChipVariants = cva10(
|
|
5771
5793
|
"inline-flex items-center gap-1.5 rounded-lg border px-2.5 py-1 text-sm font-medium leading-tight",
|
|
5772
5794
|
{
|
|
@@ -5785,11 +5807,11 @@ var stateIcons = {
|
|
|
5785
5807
|
requested: Clock,
|
|
5786
5808
|
available: Plus2
|
|
5787
5809
|
};
|
|
5788
|
-
var AttachmentChip =
|
|
5810
|
+
var AttachmentChip = React77.forwardRef(
|
|
5789
5811
|
({ state: state2, account, icon, hideIcon = false, className, ...props }, ref) => {
|
|
5790
5812
|
const Icon = icon ?? stateIcons[state2 ?? "attached"];
|
|
5791
|
-
return /* @__PURE__ */
|
|
5792
|
-
!hideIcon && /* @__PURE__ */
|
|
5813
|
+
return /* @__PURE__ */ jsxs62("span", { ref, className: cn(attachmentChipVariants({ state: state2 }), className), ...props, children: [
|
|
5814
|
+
!hideIcon && /* @__PURE__ */ jsx94(Icon, { className: "size-3.5 shrink-0 opacity-90", "aria-hidden": "true" }),
|
|
5793
5815
|
account
|
|
5794
5816
|
] });
|
|
5795
5817
|
}
|
|
@@ -5797,9 +5819,9 @@ var AttachmentChip = React75.forwardRef(
|
|
|
5797
5819
|
AttachmentChip.displayName = "AttachmentChip";
|
|
5798
5820
|
|
|
5799
5821
|
// src/components/connector-card.tsx
|
|
5800
|
-
import * as
|
|
5822
|
+
import * as React78 from "react";
|
|
5801
5823
|
import { AlertTriangle, ChevronDown as ChevronDown6 } from "lucide-react";
|
|
5802
|
-
import { Fragment as Fragment12, jsx as
|
|
5824
|
+
import { Fragment as Fragment12, jsx as jsx95, jsxs as jsxs63 } from "react/jsx-runtime";
|
|
5803
5825
|
var originLabels = {
|
|
5804
5826
|
org: "Attached by the organization",
|
|
5805
5827
|
product: "Attached by this product"
|
|
@@ -5812,7 +5834,7 @@ var statusLabels = {
|
|
|
5812
5834
|
function monogram(name) {
|
|
5813
5835
|
return name.replace(/[^a-zA-Z0-9 ]/g, " ").split(/\s+/).filter(Boolean).slice(0, 2).map((w) => w[0].toUpperCase()).join("");
|
|
5814
5836
|
}
|
|
5815
|
-
var ConnectorCard =
|
|
5837
|
+
var ConnectorCard = React78.forwardRef(
|
|
5816
5838
|
({
|
|
5817
5839
|
name,
|
|
5818
5840
|
kind,
|
|
@@ -5833,7 +5855,7 @@ var ConnectorCard = React76.forwardRef(
|
|
|
5833
5855
|
}, ref) => {
|
|
5834
5856
|
const connected = status !== "not-connected";
|
|
5835
5857
|
const label = statusLabel ?? statusLabels[status];
|
|
5836
|
-
const glyphBox = /* @__PURE__ */
|
|
5858
|
+
const glyphBox = /* @__PURE__ */ jsx95(
|
|
5837
5859
|
"div",
|
|
5838
5860
|
{
|
|
5839
5861
|
"aria-hidden": "true",
|
|
@@ -5841,48 +5863,48 @@ var ConnectorCard = React76.forwardRef(
|
|
|
5841
5863
|
children: glyph ?? monogram(name)
|
|
5842
5864
|
}
|
|
5843
5865
|
);
|
|
5844
|
-
const identity = /* @__PURE__ */
|
|
5845
|
-
/* @__PURE__ */
|
|
5846
|
-
(kind || origin) && /* @__PURE__ */
|
|
5847
|
-
kind && /* @__PURE__ */
|
|
5848
|
-
origin && /* @__PURE__ */
|
|
5866
|
+
const identity = /* @__PURE__ */ jsxs63("div", { className: "min-w-0", children: [
|
|
5867
|
+
/* @__PURE__ */ jsx95("p", { className: "truncate text-sm font-semibold text-text-primary", children: name }),
|
|
5868
|
+
(kind || origin) && /* @__PURE__ */ jsxs63("div", { className: "mt-0.5 flex flex-wrap gap-1", children: [
|
|
5869
|
+
kind && /* @__PURE__ */ jsx95(Badge, { variant: "secondary", children: kind }),
|
|
5870
|
+
origin && /* @__PURE__ */ jsx95(Badge, { variant: "outline", children: originLabels[origin] })
|
|
5849
5871
|
] })
|
|
5850
5872
|
] });
|
|
5851
|
-
const statusBadge = label ? /* @__PURE__ */
|
|
5852
|
-
const accessNote = access ? /* @__PURE__ */
|
|
5873
|
+
const statusBadge = label ? /* @__PURE__ */ jsx95(Badge, { variant: "status", children: label }) : null;
|
|
5874
|
+
const accessNote = access ? /* @__PURE__ */ jsxs63(
|
|
5853
5875
|
"div",
|
|
5854
5876
|
{
|
|
5855
5877
|
role: "note",
|
|
5856
5878
|
className: "flex items-start gap-2 border-t border-border-subtle bg-bg-secondary px-4 py-2.5 text-xs font-medium text-text-secondary",
|
|
5857
5879
|
children: [
|
|
5858
|
-
/* @__PURE__ */
|
|
5859
|
-
/* @__PURE__ */
|
|
5880
|
+
/* @__PURE__ */ jsx95(AlertTriangle, { className: "mt-0.5 size-3.5 shrink-0", "aria-hidden": "true" }),
|
|
5881
|
+
/* @__PURE__ */ jsx95("span", { children: access })
|
|
5860
5882
|
]
|
|
5861
5883
|
}
|
|
5862
5884
|
) : null;
|
|
5863
5885
|
const footerAction = collapsible ? action : connected && action;
|
|
5864
|
-
const footer = attachedCount !== void 0 || footerAction ? /* @__PURE__ */
|
|
5865
|
-
/* @__PURE__ */
|
|
5886
|
+
const footer = attachedCount !== void 0 || footerAction ? /* @__PURE__ */ jsxs63("div", { className: "flex items-center justify-between border-t border-border-subtle px-4 py-3", children: [
|
|
5887
|
+
/* @__PURE__ */ jsx95("span", { className: "text-sm text-text-secondary", children: attachedCount !== void 0 ? /* @__PURE__ */ jsxs63(Fragment12, { children: [
|
|
5866
5888
|
"Attached to ",
|
|
5867
|
-
/* @__PURE__ */
|
|
5889
|
+
/* @__PURE__ */ jsx95("span", { className: "font-semibold text-text-primary", children: attachedCount }),
|
|
5868
5890
|
" ",
|
|
5869
5891
|
attachedCount === 1 ? "product" : "products"
|
|
5870
|
-
] }) : /* @__PURE__ */
|
|
5892
|
+
] }) : /* @__PURE__ */ jsx95("span", { className: "text-text-tertiary", children: "Not attached to any product yet" }) }),
|
|
5871
5893
|
footerAction
|
|
5872
5894
|
] }) : null;
|
|
5873
|
-
const drawer = children ? /* @__PURE__ */
|
|
5895
|
+
const drawer = children ? /* @__PURE__ */ jsx95("div", { "data-slot": "drawer", className: "border-t border-border-subtle", children }) : null;
|
|
5874
5896
|
if (!collapsible) {
|
|
5875
|
-
return /* @__PURE__ */
|
|
5897
|
+
return /* @__PURE__ */ jsxs63(
|
|
5876
5898
|
Card,
|
|
5877
5899
|
{
|
|
5878
5900
|
ref,
|
|
5879
5901
|
className: cn(status === "not-connected" && "border-dashed border-border-default", className),
|
|
5880
5902
|
...props,
|
|
5881
5903
|
children: [
|
|
5882
|
-
/* @__PURE__ */
|
|
5904
|
+
/* @__PURE__ */ jsxs63("div", { className: "flex items-center gap-3 p-4", children: [
|
|
5883
5905
|
glyphBox,
|
|
5884
5906
|
identity,
|
|
5885
|
-
/* @__PURE__ */
|
|
5907
|
+
/* @__PURE__ */ jsx95("div", { className: "ml-auto shrink-0", children: connected ? statusBadge : action ?? statusBadge })
|
|
5886
5908
|
] }),
|
|
5887
5909
|
accessNote,
|
|
5888
5910
|
footer,
|
|
@@ -5891,7 +5913,7 @@ var ConnectorCard = React76.forwardRef(
|
|
|
5891
5913
|
}
|
|
5892
5914
|
);
|
|
5893
5915
|
}
|
|
5894
|
-
return /* @__PURE__ */
|
|
5916
|
+
return /* @__PURE__ */ jsx95(Collapsible, { defaultOpen, open, onOpenChange, children: /* @__PURE__ */ jsxs63(
|
|
5895
5917
|
Card,
|
|
5896
5918
|
{
|
|
5897
5919
|
ref,
|
|
@@ -5902,7 +5924,7 @@ var ConnectorCard = React76.forwardRef(
|
|
|
5902
5924
|
),
|
|
5903
5925
|
...props,
|
|
5904
5926
|
children: [
|
|
5905
|
-
/* @__PURE__ */
|
|
5927
|
+
/* @__PURE__ */ jsx95(CollapsibleTrigger2, { asChild: true, children: /* @__PURE__ */ jsxs63(
|
|
5906
5928
|
"button",
|
|
5907
5929
|
{
|
|
5908
5930
|
type: "button",
|
|
@@ -5910,9 +5932,9 @@ var ConnectorCard = React76.forwardRef(
|
|
|
5910
5932
|
children: [
|
|
5911
5933
|
glyphBox,
|
|
5912
5934
|
identity,
|
|
5913
|
-
/* @__PURE__ */
|
|
5935
|
+
/* @__PURE__ */ jsxs63("div", { className: "ml-auto flex shrink-0 items-center gap-2", children: [
|
|
5914
5936
|
statusBadge,
|
|
5915
|
-
/* @__PURE__ */
|
|
5937
|
+
/* @__PURE__ */ jsx95(
|
|
5916
5938
|
ChevronDown6,
|
|
5917
5939
|
{
|
|
5918
5940
|
"aria-hidden": "true",
|
|
@@ -5923,7 +5945,7 @@ var ConnectorCard = React76.forwardRef(
|
|
|
5923
5945
|
]
|
|
5924
5946
|
}
|
|
5925
5947
|
) }),
|
|
5926
|
-
/* @__PURE__ */
|
|
5948
|
+
/* @__PURE__ */ jsxs63(CollapsibleContent2, { children: [
|
|
5927
5949
|
accessNote,
|
|
5928
5950
|
footer,
|
|
5929
5951
|
drawer
|
|
@@ -5936,33 +5958,33 @@ var ConnectorCard = React76.forwardRef(
|
|
|
5936
5958
|
ConnectorCard.displayName = "ConnectorCard";
|
|
5937
5959
|
|
|
5938
5960
|
// src/components/request-row.tsx
|
|
5939
|
-
import * as
|
|
5940
|
-
import { Fragment as Fragment13, jsx as
|
|
5961
|
+
import * as React79 from "react";
|
|
5962
|
+
import { Fragment as Fragment13, jsx as jsx96, jsxs as jsxs64 } from "react/jsx-runtime";
|
|
5941
5963
|
function monogram2(name) {
|
|
5942
5964
|
return name.replace(/[^a-zA-Z0-9 ]/g, " ").split(/\s+/).filter(Boolean).slice(0, 2).map((w) => w[0].toUpperCase()).join("");
|
|
5943
5965
|
}
|
|
5944
|
-
var RequestRow =
|
|
5966
|
+
var RequestRow = React79.forwardRef(
|
|
5945
5967
|
({ surface, name, state: state2, glyph, subtitle, account, onApprove, onDeny, onRequest, onRevoke, action, className, ...props }, ref) => {
|
|
5946
5968
|
let controls = action;
|
|
5947
5969
|
if (controls === void 0) {
|
|
5948
5970
|
if (surface === "org" && state2 === "pending") {
|
|
5949
|
-
controls = /* @__PURE__ */
|
|
5950
|
-
/* @__PURE__ */
|
|
5951
|
-
/* @__PURE__ */
|
|
5971
|
+
controls = /* @__PURE__ */ jsxs64(Fragment13, { children: [
|
|
5972
|
+
/* @__PURE__ */ jsx96(Button, { variant: "ghost", size: "sm", onClick: onDeny, children: "Deny" }),
|
|
5973
|
+
/* @__PURE__ */ jsx96(Button, { variant: "outline", size: "sm", onClick: onApprove, children: "Approve" })
|
|
5952
5974
|
] });
|
|
5953
5975
|
} else if (state2 === "sent") {
|
|
5954
|
-
controls = /* @__PURE__ */
|
|
5976
|
+
controls = /* @__PURE__ */ jsx96(Button, { variant: "destructive-ghost", size: "sm", onClick: onRevoke, children: "Revoke" });
|
|
5955
5977
|
} else if (state2 === "available") {
|
|
5956
|
-
controls = /* @__PURE__ */
|
|
5978
|
+
controls = /* @__PURE__ */ jsx96(Button, { variant: "outline", size: "sm", onClick: onRequest, children: "Request" });
|
|
5957
5979
|
} else if (state2 === "pending") {
|
|
5958
|
-
controls = /* @__PURE__ */
|
|
5980
|
+
controls = /* @__PURE__ */ jsx96(Badge, { variant: "status", children: "Requested" });
|
|
5959
5981
|
} else if (state2 === "denied") {
|
|
5960
|
-
controls = /* @__PURE__ */
|
|
5982
|
+
controls = /* @__PURE__ */ jsx96(Badge, { variant: "status", children: "Denied" });
|
|
5961
5983
|
} else if (state2 === "attached") {
|
|
5962
|
-
controls = account ? /* @__PURE__ */
|
|
5984
|
+
controls = account ? /* @__PURE__ */ jsx96(AttachmentChip, { state: "attached", account }) : /* @__PURE__ */ jsx96(Badge, { variant: "status", children: "In use" });
|
|
5963
5985
|
}
|
|
5964
5986
|
}
|
|
5965
|
-
return /* @__PURE__ */
|
|
5987
|
+
return /* @__PURE__ */ jsxs64(
|
|
5966
5988
|
"div",
|
|
5967
5989
|
{
|
|
5968
5990
|
ref,
|
|
@@ -5972,7 +5994,7 @@ var RequestRow = React77.forwardRef(
|
|
|
5972
5994
|
),
|
|
5973
5995
|
...props,
|
|
5974
5996
|
children: [
|
|
5975
|
-
/* @__PURE__ */
|
|
5997
|
+
/* @__PURE__ */ jsx96(
|
|
5976
5998
|
"div",
|
|
5977
5999
|
{
|
|
5978
6000
|
"aria-hidden": "true",
|
|
@@ -5980,11 +6002,11 @@ var RequestRow = React77.forwardRef(
|
|
|
5980
6002
|
children: glyph ?? monogram2(name)
|
|
5981
6003
|
}
|
|
5982
6004
|
),
|
|
5983
|
-
/* @__PURE__ */
|
|
5984
|
-
/* @__PURE__ */
|
|
5985
|
-
subtitle && /* @__PURE__ */
|
|
6005
|
+
/* @__PURE__ */ jsxs64("div", { className: "min-w-0", children: [
|
|
6006
|
+
/* @__PURE__ */ jsx96("p", { className: "truncate text-sm font-semibold text-text-primary", children: name }),
|
|
6007
|
+
subtitle && /* @__PURE__ */ jsx96("p", { className: "truncate text-xs text-text-tertiary", children: subtitle })
|
|
5986
6008
|
] }),
|
|
5987
|
-
/* @__PURE__ */
|
|
6009
|
+
/* @__PURE__ */ jsx96("div", { className: "ml-auto flex shrink-0 items-center gap-2", children: controls })
|
|
5988
6010
|
]
|
|
5989
6011
|
}
|
|
5990
6012
|
);
|
|
@@ -5993,9 +6015,9 @@ var RequestRow = React77.forwardRef(
|
|
|
5993
6015
|
RequestRow.displayName = "RequestRow";
|
|
5994
6016
|
|
|
5995
6017
|
// src/components/feedback-button.tsx
|
|
5996
|
-
import * as
|
|
6018
|
+
import * as React80 from "react";
|
|
5997
6019
|
import { MessageSquare, Loader2 as Loader23, CheckCircle2 } from "lucide-react";
|
|
5998
|
-
import { jsx as
|
|
6020
|
+
import { jsx as jsx97, jsxs as jsxs65 } from "react/jsx-runtime";
|
|
5999
6021
|
var TITLE_MAX = 256;
|
|
6000
6022
|
var DETAILS_MAX = 65536;
|
|
6001
6023
|
var DEFAULT_LABELS = {
|
|
@@ -6009,15 +6031,15 @@ var DEFAULT_LABELS = {
|
|
|
6009
6031
|
};
|
|
6010
6032
|
function FeedbackButton({ onSubmit, labels, className }) {
|
|
6011
6033
|
const l = { ...DEFAULT_LABELS, ...labels };
|
|
6012
|
-
const uid =
|
|
6034
|
+
const uid = React80.useId();
|
|
6013
6035
|
const titleId = `${uid}-title`;
|
|
6014
6036
|
const detailsId = `${uid}-details`;
|
|
6015
6037
|
const titleErrId = `${uid}-title-error`;
|
|
6016
6038
|
const detailsErrId = `${uid}-details-error`;
|
|
6017
|
-
const [open, setOpen] =
|
|
6018
|
-
const [status, setStatus] =
|
|
6019
|
-
const [title, setTitle] =
|
|
6020
|
-
const [details, setDetails] =
|
|
6039
|
+
const [open, setOpen] = React80.useState(false);
|
|
6040
|
+
const [status, setStatus] = React80.useState("idle");
|
|
6041
|
+
const [title, setTitle] = React80.useState("");
|
|
6042
|
+
const [details, setDetails] = React80.useState("");
|
|
6021
6043
|
const titleTooLong = title.length > TITLE_MAX;
|
|
6022
6044
|
const detailsTooLong = details.length > DETAILS_MAX;
|
|
6023
6045
|
const titleEmpty = title.trim().length === 0;
|
|
@@ -6042,20 +6064,20 @@ function FeedbackButton({ onSubmit, labels, className }) {
|
|
|
6042
6064
|
setStatus("error");
|
|
6043
6065
|
}
|
|
6044
6066
|
};
|
|
6045
|
-
return /* @__PURE__ */
|
|
6046
|
-
/* @__PURE__ */
|
|
6047
|
-
/* @__PURE__ */
|
|
6067
|
+
return /* @__PURE__ */ jsxs65(Popover, { open, onOpenChange: changeOpen, children: [
|
|
6068
|
+
/* @__PURE__ */ jsx97(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ jsxs65(Button, { variant: "ghost", size: "sm", "aria-label": l.trigger, className, children: [
|
|
6069
|
+
/* @__PURE__ */ jsx97(MessageSquare, { className: "size-4", "aria-hidden": "true" }),
|
|
6048
6070
|
l.trigger
|
|
6049
6071
|
] }) }),
|
|
6050
|
-
/* @__PURE__ */
|
|
6051
|
-
/* @__PURE__ */
|
|
6052
|
-
/* @__PURE__ */
|
|
6053
|
-
/* @__PURE__ */
|
|
6054
|
-
] }) : /* @__PURE__ */
|
|
6055
|
-
/* @__PURE__ */
|
|
6056
|
-
/* @__PURE__ */
|
|
6057
|
-
/* @__PURE__ */
|
|
6058
|
-
/* @__PURE__ */
|
|
6072
|
+
/* @__PURE__ */ jsx97(PopoverContent, { align: "end", side: "bottom", className: "w-80", children: status === "success" ? /* @__PURE__ */ jsxs65("div", { className: "flex flex-col items-center gap-3 py-2 text-center", children: [
|
|
6073
|
+
/* @__PURE__ */ jsx97(CheckCircle2, { className: "size-8 text-text-success", "aria-hidden": "true" }),
|
|
6074
|
+
/* @__PURE__ */ jsx97("p", { role: "status", className: "text-sm text-text-primary", children: l.success }),
|
|
6075
|
+
/* @__PURE__ */ jsx97(Button, { variant: "outline", size: "sm", onClick: () => changeOpen(false), children: "Close" })
|
|
6076
|
+
] }) : /* @__PURE__ */ jsxs65("form", { onSubmit: handleSubmit, className: "flex flex-col gap-3", children: [
|
|
6077
|
+
/* @__PURE__ */ jsx97("p", { className: "text-sm font-medium text-text-primary", children: l.title }),
|
|
6078
|
+
/* @__PURE__ */ jsxs65("div", { className: "flex flex-col gap-1.5", children: [
|
|
6079
|
+
/* @__PURE__ */ jsx97(Label2, { htmlFor: titleId, children: l.titleField }),
|
|
6080
|
+
/* @__PURE__ */ jsx97(
|
|
6059
6081
|
Input,
|
|
6060
6082
|
{
|
|
6061
6083
|
id: titleId,
|
|
@@ -6066,16 +6088,16 @@ function FeedbackButton({ onSubmit, labels, className }) {
|
|
|
6066
6088
|
"aria-describedby": titleTooLong ? titleErrId : void 0
|
|
6067
6089
|
}
|
|
6068
6090
|
),
|
|
6069
|
-
titleTooLong && /* @__PURE__ */
|
|
6091
|
+
titleTooLong && /* @__PURE__ */ jsxs65("p", { id: titleErrId, className: "text-xs text-text-danger", children: [
|
|
6070
6092
|
l.titleField,
|
|
6071
6093
|
" must be ",
|
|
6072
6094
|
TITLE_MAX,
|
|
6073
6095
|
" characters or fewer."
|
|
6074
6096
|
] })
|
|
6075
6097
|
] }),
|
|
6076
|
-
/* @__PURE__ */
|
|
6077
|
-
/* @__PURE__ */
|
|
6078
|
-
/* @__PURE__ */
|
|
6098
|
+
/* @__PURE__ */ jsxs65("div", { className: "flex flex-col gap-1.5", children: [
|
|
6099
|
+
/* @__PURE__ */ jsx97(Label2, { htmlFor: detailsId, children: l.detailsField }),
|
|
6100
|
+
/* @__PURE__ */ jsx97(
|
|
6079
6101
|
Textarea,
|
|
6080
6102
|
{
|
|
6081
6103
|
id: detailsId,
|
|
@@ -6086,16 +6108,16 @@ function FeedbackButton({ onSubmit, labels, className }) {
|
|
|
6086
6108
|
"aria-describedby": detailsTooLong ? detailsErrId : void 0
|
|
6087
6109
|
}
|
|
6088
6110
|
),
|
|
6089
|
-
detailsTooLong && /* @__PURE__ */
|
|
6111
|
+
detailsTooLong && /* @__PURE__ */ jsxs65("p", { id: detailsErrId, className: "text-xs text-text-danger", children: [
|
|
6090
6112
|
l.detailsField,
|
|
6091
6113
|
" must be ",
|
|
6092
6114
|
DETAILS_MAX,
|
|
6093
6115
|
" characters or fewer."
|
|
6094
6116
|
] })
|
|
6095
6117
|
] }),
|
|
6096
|
-
status === "error" && /* @__PURE__ */
|
|
6097
|
-
/* @__PURE__ */
|
|
6098
|
-
submitting && /* @__PURE__ */
|
|
6118
|
+
status === "error" && /* @__PURE__ */ jsx97(InlineError, { children: l.error }),
|
|
6119
|
+
/* @__PURE__ */ jsxs65(Button, { type: "submit", disabled: !valid || submitting, children: [
|
|
6120
|
+
submitting && /* @__PURE__ */ jsx97(Loader23, { className: "size-4 animate-spin", "aria-hidden": "true" }),
|
|
6099
6121
|
l.submit
|
|
6100
6122
|
] })
|
|
6101
6123
|
] }) })
|
|
@@ -6151,27 +6173,27 @@ function isNotificationSettled(item) {
|
|
|
6151
6173
|
}
|
|
6152
6174
|
|
|
6153
6175
|
// src/components/notification-bell.tsx
|
|
6154
|
-
import * as
|
|
6176
|
+
import * as React82 from "react";
|
|
6155
6177
|
import { BellRing, Settings } from "lucide-react";
|
|
6156
6178
|
|
|
6157
6179
|
// src/components/notification-row.tsx
|
|
6158
|
-
import * as
|
|
6180
|
+
import * as React81 from "react";
|
|
6159
6181
|
|
|
6160
6182
|
// src/components/notification-parts.tsx
|
|
6161
6183
|
import { Check as Check10 } from "lucide-react";
|
|
6162
|
-
import { jsx as
|
|
6184
|
+
import { jsx as jsx98 } from "react/jsx-runtime";
|
|
6163
6185
|
var rowControlHitArea = "relative after:absolute after:-inset-x-2 after:-top-1.5 after:-bottom-2.5";
|
|
6164
6186
|
function rowControlName(label, title) {
|
|
6165
6187
|
return `${label} "${title}"`;
|
|
6166
6188
|
}
|
|
6167
6189
|
function MarkReadButton({ title, onClick }) {
|
|
6168
6190
|
const label = `Mark "${title}" as read`;
|
|
6169
|
-
return /* @__PURE__ */
|
|
6191
|
+
return /* @__PURE__ */ jsx98(
|
|
6170
6192
|
Button,
|
|
6171
6193
|
{
|
|
6172
6194
|
variant: "ghost",
|
|
6173
6195
|
size: "xs",
|
|
6174
|
-
icon: /* @__PURE__ */
|
|
6196
|
+
icon: /* @__PURE__ */ jsx98(Check10, {}),
|
|
6175
6197
|
"aria-label": label,
|
|
6176
6198
|
onClick,
|
|
6177
6199
|
className: "relative text-text-secondary after:absolute after:-inset-3 hover:text-text-primary"
|
|
@@ -6185,12 +6207,12 @@ function DeepLinkControl({
|
|
|
6185
6207
|
onClick
|
|
6186
6208
|
}) {
|
|
6187
6209
|
const name = rowControlName(link.label, title);
|
|
6188
|
-
return link.href ? /* @__PURE__ */
|
|
6210
|
+
return link.href ? /* @__PURE__ */ jsx98("a", { href: link.href, "aria-label": name, onClick, className, children: link.label }) : /* @__PURE__ */ jsx98("button", { type: "button", "aria-label": name, onClick, className, children: link.label });
|
|
6189
6211
|
}
|
|
6190
6212
|
|
|
6191
6213
|
// src/components/notification-row.tsx
|
|
6192
|
-
import { jsx as
|
|
6193
|
-
var NotificationRow =
|
|
6214
|
+
import { jsx as jsx99, jsxs as jsxs66 } from "react/jsx-runtime";
|
|
6215
|
+
var NotificationRow = React81.forwardRef(
|
|
6194
6216
|
({ item, onItemClick, onActionClick, onMarkRead, formatAge, className, ...props }, ref) => {
|
|
6195
6217
|
const settled = isNotificationSettled(item);
|
|
6196
6218
|
const unread = !settled && !item.read;
|
|
@@ -6202,20 +6224,20 @@ var NotificationRow = React79.forwardRef(
|
|
|
6202
6224
|
// Three steps of one ladder, and every one of them a token a reader can read:
|
|
6203
6225
|
// unread is the loudest, read is quieter, settled is quietest. An opacity is
|
|
6204
6226
|
// not a step — it drags the text under the contrast floor with the row.
|
|
6205
|
-
/* @__PURE__ */
|
|
6227
|
+
/* @__PURE__ */ jsxs66(
|
|
6206
6228
|
"div",
|
|
6207
6229
|
{
|
|
6208
6230
|
ref,
|
|
6209
6231
|
className: cn("group rounded-lg bg-bg-surface px-3 py-2.5", className),
|
|
6210
6232
|
...props,
|
|
6211
6233
|
children: [
|
|
6212
|
-
/* @__PURE__ */
|
|
6213
|
-
/* @__PURE__ */
|
|
6214
|
-
/* @__PURE__ */
|
|
6215
|
-
/* @__PURE__ */
|
|
6234
|
+
/* @__PURE__ */ jsxs66("div", { className: "flex items-start gap-2.5", children: [
|
|
6235
|
+
/* @__PURE__ */ jsxs66("div", { className: "min-w-0 flex-1", children: [
|
|
6236
|
+
/* @__PURE__ */ jsxs66("p", { className: "truncate text-xs text-text-tertiary", children: [
|
|
6237
|
+
/* @__PURE__ */ jsx99("span", { className: "font-semibold uppercase tracking-wide text-text-secondary", children: item.source }),
|
|
6216
6238
|
item.receipt ? `, ${item.receipt}` : ""
|
|
6217
6239
|
] }),
|
|
6218
|
-
/* @__PURE__ */
|
|
6240
|
+
/* @__PURE__ */ jsx99(
|
|
6219
6241
|
"button",
|
|
6220
6242
|
{
|
|
6221
6243
|
type: "button",
|
|
@@ -6227,7 +6249,7 @@ var NotificationRow = React79.forwardRef(
|
|
|
6227
6249
|
children: item.title
|
|
6228
6250
|
}
|
|
6229
6251
|
),
|
|
6230
|
-
item.body && /* @__PURE__ */
|
|
6252
|
+
item.body && /* @__PURE__ */ jsx99(
|
|
6231
6253
|
"p",
|
|
6232
6254
|
{
|
|
6233
6255
|
className: cn(
|
|
@@ -6238,15 +6260,15 @@ var NotificationRow = React79.forwardRef(
|
|
|
6238
6260
|
}
|
|
6239
6261
|
)
|
|
6240
6262
|
] }),
|
|
6241
|
-
(age || markable) && /* @__PURE__ */
|
|
6242
|
-
stamp && age && /* @__PURE__ */
|
|
6243
|
-
markable && /* @__PURE__ */
|
|
6263
|
+
(age || markable) && /* @__PURE__ */ jsxs66("div", { className: "mt-px flex shrink-0 items-center gap-1", children: [
|
|
6264
|
+
stamp && age && /* @__PURE__ */ jsx99("time", { dateTime: toDateTimeAttribute(stamp), className: "text-xs text-text-tertiary", children: age }),
|
|
6265
|
+
markable && /* @__PURE__ */ jsx99(MarkReadButton, { title: item.title, onClick: () => onMarkRead(item.id) })
|
|
6244
6266
|
] })
|
|
6245
6267
|
] }),
|
|
6246
|
-
(actions.length > 0 || item.deepLink) && /* @__PURE__ */
|
|
6268
|
+
(actions.length > 0 || item.deepLink) && /* @__PURE__ */ jsxs66("div", { className: "mt-2 flex flex-wrap items-center gap-x-4 gap-y-2", children: [
|
|
6247
6269
|
actions.map((action) => {
|
|
6248
6270
|
const chip = action.variant === "primary" || action.variant === "destructive";
|
|
6249
|
-
return /* @__PURE__ */
|
|
6271
|
+
return /* @__PURE__ */ jsx99(
|
|
6250
6272
|
"button",
|
|
6251
6273
|
{
|
|
6252
6274
|
type: "button",
|
|
@@ -6263,7 +6285,7 @@ var NotificationRow = React79.forwardRef(
|
|
|
6263
6285
|
action.id
|
|
6264
6286
|
);
|
|
6265
6287
|
}),
|
|
6266
|
-
item.deepLink && /* @__PURE__ */
|
|
6288
|
+
item.deepLink && /* @__PURE__ */ jsx99(
|
|
6267
6289
|
DeepLinkControl,
|
|
6268
6290
|
{
|
|
6269
6291
|
link: item.deepLink,
|
|
@@ -6285,8 +6307,8 @@ var NotificationRow = React79.forwardRef(
|
|
|
6285
6307
|
NotificationRow.displayName = "NotificationRow";
|
|
6286
6308
|
|
|
6287
6309
|
// src/components/notification-bell.tsx
|
|
6288
|
-
import { jsx as
|
|
6289
|
-
var NotificationBell =
|
|
6310
|
+
import { jsx as jsx100, jsxs as jsxs67 } from "react/jsx-runtime";
|
|
6311
|
+
var NotificationBell = React82.forwardRef(
|
|
6290
6312
|
({
|
|
6291
6313
|
items,
|
|
6292
6314
|
unreadCount,
|
|
@@ -6306,8 +6328,8 @@ var NotificationBell = React80.forwardRef(
|
|
|
6306
6328
|
const unread = unreadCount ?? items.filter((n) => !n.read && n.cls !== "ephemeral").length;
|
|
6307
6329
|
const rows = items.slice(0, maxItems);
|
|
6308
6330
|
const hidden = items.length - rows.length;
|
|
6309
|
-
return /* @__PURE__ */
|
|
6310
|
-
/* @__PURE__ */
|
|
6331
|
+
return /* @__PURE__ */ jsxs67(Popover, { open, onOpenChange, children: [
|
|
6332
|
+
/* @__PURE__ */ jsx100(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ jsxs67(
|
|
6311
6333
|
"button",
|
|
6312
6334
|
{
|
|
6313
6335
|
ref,
|
|
@@ -6318,12 +6340,12 @@ var NotificationBell = React80.forwardRef(
|
|
|
6318
6340
|
className
|
|
6319
6341
|
),
|
|
6320
6342
|
children: [
|
|
6321
|
-
/* @__PURE__ */
|
|
6322
|
-
unread > 0 && /* @__PURE__ */
|
|
6343
|
+
/* @__PURE__ */ jsx100(BellRing, { className: "size-[18px]", "aria-hidden": "true" }),
|
|
6344
|
+
unread > 0 && /* @__PURE__ */ jsx100("span", { className: "absolute -right-1.5 -top-1.5 flex size-[17px] items-center justify-center rounded-full bg-bg-brand text-xs font-bold leading-none text-text-on-brand ring-2 ring-bg-surface", children: unread })
|
|
6323
6345
|
]
|
|
6324
6346
|
}
|
|
6325
6347
|
) }),
|
|
6326
|
-
/* @__PURE__ */
|
|
6348
|
+
/* @__PURE__ */ jsxs67(
|
|
6327
6349
|
PopoverContent,
|
|
6328
6350
|
{
|
|
6329
6351
|
align: "end",
|
|
@@ -6331,10 +6353,10 @@ var NotificationBell = React80.forwardRef(
|
|
|
6331
6353
|
style: { maxHeight: "var(--radix-popover-content-available-height, 32rem)" },
|
|
6332
6354
|
className: "flex w-[380px] flex-col overflow-hidden p-0",
|
|
6333
6355
|
children: [
|
|
6334
|
-
/* @__PURE__ */
|
|
6335
|
-
/* @__PURE__ */
|
|
6336
|
-
/* @__PURE__ */
|
|
6337
|
-
unread === 0 ? /* @__PURE__ */
|
|
6356
|
+
/* @__PURE__ */ jsxs67("div", { className: "flex shrink-0 items-center justify-between px-5 py-3", children: [
|
|
6357
|
+
/* @__PURE__ */ jsx100("span", { className: "text-sm font-bold text-text-primary", children: "Notification center" }),
|
|
6358
|
+
/* @__PURE__ */ jsxs67("div", { className: "flex items-center gap-3", children: [
|
|
6359
|
+
unread === 0 ? /* @__PURE__ */ jsx100("span", { className: "text-sm font-medium text-text-tertiary", children: "All read" }) : /* @__PURE__ */ jsx100(
|
|
6338
6360
|
"button",
|
|
6339
6361
|
{
|
|
6340
6362
|
type: "button",
|
|
@@ -6343,19 +6365,19 @@ var NotificationBell = React80.forwardRef(
|
|
|
6343
6365
|
children: "Mark all read"
|
|
6344
6366
|
}
|
|
6345
6367
|
),
|
|
6346
|
-
onOpenSettings && /* @__PURE__ */
|
|
6368
|
+
onOpenSettings && /* @__PURE__ */ jsx100(
|
|
6347
6369
|
"button",
|
|
6348
6370
|
{
|
|
6349
6371
|
type: "button",
|
|
6350
6372
|
"aria-label": "Notification settings",
|
|
6351
6373
|
onClick: () => onOpenSettings(),
|
|
6352
6374
|
className: "flex size-6 items-center justify-center rounded-md text-text-tertiary transition-colors hover:bg-bg-surface hover:text-text-primary",
|
|
6353
|
-
children: /* @__PURE__ */
|
|
6375
|
+
children: /* @__PURE__ */ jsx100(Settings, { className: "size-[15px]", "aria-hidden": "true" })
|
|
6354
6376
|
}
|
|
6355
6377
|
)
|
|
6356
6378
|
] })
|
|
6357
6379
|
] }),
|
|
6358
|
-
/* @__PURE__ */
|
|
6380
|
+
/* @__PURE__ */ jsx100("div", { className: "min-h-0 flex-1 space-y-1.5 overflow-y-auto px-2 pb-2", children: rows.length === 0 ? /* @__PURE__ */ jsx100("p", { className: "px-3 py-12 text-center text-xs leading-relaxed text-text-tertiary", children: "Nothing yet. Everything addressed to you lands here." }) : rows.map((item) => /* @__PURE__ */ jsx100(
|
|
6359
6381
|
NotificationRow,
|
|
6360
6382
|
{
|
|
6361
6383
|
item,
|
|
@@ -6366,8 +6388,8 @@ var NotificationBell = React80.forwardRef(
|
|
|
6366
6388
|
},
|
|
6367
6389
|
item.id
|
|
6368
6390
|
)) }),
|
|
6369
|
-
footer != null && /* @__PURE__ */
|
|
6370
|
-
items.length > 0 && onOpenArchive && /* @__PURE__ */
|
|
6391
|
+
footer != null && /* @__PURE__ */ jsx100("div", { className: "shrink-0 px-5 py-2.5 text-xs text-text-tertiary", children: footer }),
|
|
6392
|
+
items.length > 0 && onOpenArchive && /* @__PURE__ */ jsx100(
|
|
6371
6393
|
"button",
|
|
6372
6394
|
{
|
|
6373
6395
|
type: "button",
|
|
@@ -6385,9 +6407,9 @@ var NotificationBell = React80.forwardRef(
|
|
|
6385
6407
|
NotificationBell.displayName = "NotificationBell";
|
|
6386
6408
|
|
|
6387
6409
|
// src/components/notification-center.tsx
|
|
6388
|
-
import * as
|
|
6410
|
+
import * as React83 from "react";
|
|
6389
6411
|
import { Check as Check11, Search as Search2 } from "lucide-react";
|
|
6390
|
-
import { jsx as
|
|
6412
|
+
import { jsx as jsx101, jsxs as jsxs68 } from "react/jsx-runtime";
|
|
6391
6413
|
var chipBase = "rounded-lg px-3 py-1.5 text-sm font-medium transition-colors";
|
|
6392
6414
|
var chipOn = "bg-bg-brand-subtle text-text-brand";
|
|
6393
6415
|
var chipOff = "bg-bg-elevated text-text-secondary hover:text-text-primary";
|
|
@@ -6402,12 +6424,12 @@ function CenterRow({
|
|
|
6402
6424
|
const markable = Boolean(onMarkRead) && unread && item.cls !== "ephemeral";
|
|
6403
6425
|
const stamp = item.createdAt ? item.createdAt instanceof Date ? item.createdAt : new Date(item.createdAt) : null;
|
|
6404
6426
|
const age = stamp ? formatAge(stamp) : null;
|
|
6405
|
-
return /* @__PURE__ */
|
|
6406
|
-
/* @__PURE__ */
|
|
6407
|
-
/* @__PURE__ */
|
|
6408
|
-
/* @__PURE__ */
|
|
6409
|
-
(age || markable) && /* @__PURE__ */
|
|
6410
|
-
stamp && age && /* @__PURE__ */
|
|
6427
|
+
return /* @__PURE__ */ jsxs68("article", { className: "group rounded-lg bg-bg-elevated px-4 py-3", children: [
|
|
6428
|
+
/* @__PURE__ */ jsxs68("div", { className: "flex items-center gap-2", children: [
|
|
6429
|
+
/* @__PURE__ */ jsx101("span", { className: "text-xs font-semibold uppercase tracking-[0.09em] text-text-secondary", children: item.source }),
|
|
6430
|
+
/* @__PURE__ */ jsx101(Badge, { variant: severityBadgeVariant(item.severity), children: severityLabels[item.severity] }),
|
|
6431
|
+
(age || markable) && /* @__PURE__ */ jsxs68("div", { className: "ml-auto flex shrink-0 items-center gap-1.5", children: [
|
|
6432
|
+
stamp && age && /* @__PURE__ */ jsx101(
|
|
6411
6433
|
"time",
|
|
6412
6434
|
{
|
|
6413
6435
|
dateTime: toDateTimeAttribute(stamp),
|
|
@@ -6415,10 +6437,10 @@ function CenterRow({
|
|
|
6415
6437
|
children: age
|
|
6416
6438
|
}
|
|
6417
6439
|
),
|
|
6418
|
-
markable && /* @__PURE__ */
|
|
6440
|
+
markable && /* @__PURE__ */ jsx101(MarkReadButton, { title: item.title, onClick: () => onMarkRead(item.id) })
|
|
6419
6441
|
] })
|
|
6420
6442
|
] }),
|
|
6421
|
-
/* @__PURE__ */
|
|
6443
|
+
/* @__PURE__ */ jsx101(
|
|
6422
6444
|
"button",
|
|
6423
6445
|
{
|
|
6424
6446
|
type: "button",
|
|
@@ -6430,13 +6452,13 @@ function CenterRow({
|
|
|
6430
6452
|
children: item.title
|
|
6431
6453
|
}
|
|
6432
6454
|
),
|
|
6433
|
-
item.body && /* @__PURE__ */
|
|
6434
|
-
(item.receipt || item.deepLink) && /* @__PURE__ */
|
|
6435
|
-
item.receipt && /* @__PURE__ */
|
|
6436
|
-
/* @__PURE__ */
|
|
6455
|
+
item.body && /* @__PURE__ */ jsx101("p", { className: "mt-0.5 text-sm leading-snug text-text-secondary", children: item.body }),
|
|
6456
|
+
(item.receipt || item.deepLink) && /* @__PURE__ */ jsxs68("div", { className: "mt-2 flex flex-wrap items-center gap-x-4 gap-y-1.5", children: [
|
|
6457
|
+
item.receipt && /* @__PURE__ */ jsxs68("span", { className: "inline-flex items-center gap-1.5 text-sm text-text-tertiary", children: [
|
|
6458
|
+
/* @__PURE__ */ jsx101(Check11, { className: "size-3 shrink-0 text-text-success", "aria-hidden": "true" }),
|
|
6437
6459
|
item.receipt
|
|
6438
6460
|
] }),
|
|
6439
|
-
item.deepLink && /* @__PURE__ */
|
|
6461
|
+
item.deepLink && /* @__PURE__ */ jsx101(
|
|
6440
6462
|
DeepLinkControl,
|
|
6441
6463
|
{
|
|
6442
6464
|
link: item.deepLink,
|
|
@@ -6451,7 +6473,7 @@ function CenterRow({
|
|
|
6451
6473
|
] })
|
|
6452
6474
|
] });
|
|
6453
6475
|
}
|
|
6454
|
-
var NotificationCenter =
|
|
6476
|
+
var NotificationCenter = React83.forwardRef(
|
|
6455
6477
|
({
|
|
6456
6478
|
items,
|
|
6457
6479
|
header = true,
|
|
@@ -6468,16 +6490,16 @@ var NotificationCenter = React81.forwardRef(
|
|
|
6468
6490
|
formatAge,
|
|
6469
6491
|
className
|
|
6470
6492
|
}, ref) => {
|
|
6471
|
-
const [status, setStatus] =
|
|
6472
|
-
const [source, setSource] =
|
|
6473
|
-
const [product, setProduct] =
|
|
6474
|
-
const [query, setQuery] =
|
|
6475
|
-
const [limit, setLimit] =
|
|
6476
|
-
const age =
|
|
6493
|
+
const [status, setStatus] = React83.useState("all");
|
|
6494
|
+
const [source, setSource] = React83.useState("all");
|
|
6495
|
+
const [product, setProduct] = React83.useState("all");
|
|
6496
|
+
const [query, setQuery] = React83.useState("");
|
|
6497
|
+
const [limit, setLimit] = React83.useState(pageSize);
|
|
6498
|
+
const age = React83.useCallback(
|
|
6477
6499
|
(createdAt) => formatAge ? formatAge(createdAt) : formatRelativeAge(createdAt),
|
|
6478
6500
|
[formatAge]
|
|
6479
6501
|
);
|
|
6480
|
-
const sourceChips =
|
|
6502
|
+
const sourceChips = React83.useMemo(
|
|
6481
6503
|
() => sources ?? Array.from(new Set(items.map((n) => n.source))),
|
|
6482
6504
|
[sources, items]
|
|
6483
6505
|
);
|
|
@@ -6488,13 +6510,13 @@ var NotificationCenter = React81.forwardRef(
|
|
|
6488
6510
|
const shown = matched.slice(0, limit);
|
|
6489
6511
|
const remaining = matched.length - shown.length;
|
|
6490
6512
|
const filtering = q !== "" || status !== "all" || source !== "all" || product !== "all";
|
|
6491
|
-
return /* @__PURE__ */
|
|
6492
|
-
(header || onMarkAllRead) && /* @__PURE__ */
|
|
6493
|
-
header && /* @__PURE__ */
|
|
6494
|
-
/* @__PURE__ */
|
|
6495
|
-
description && /* @__PURE__ */
|
|
6513
|
+
return /* @__PURE__ */ jsxs68("div", { ref, className: cn("mx-auto max-w-[560px]", className), children: [
|
|
6514
|
+
(header || onMarkAllRead) && /* @__PURE__ */ jsxs68("div", { className: cn("mb-4 flex items-start gap-4", !header && "justify-end"), children: [
|
|
6515
|
+
header && /* @__PURE__ */ jsxs68("div", { className: "min-w-0 flex-1", children: [
|
|
6516
|
+
/* @__PURE__ */ jsx101("h1", { className: "mb-1.5 text-2xl font-semibold tracking-tight text-text-primary", children: title }),
|
|
6517
|
+
description && /* @__PURE__ */ jsx101("p", { className: "text-sm text-text-tertiary", children: description })
|
|
6496
6518
|
] }),
|
|
6497
|
-
onMarkAllRead && /* @__PURE__ */
|
|
6519
|
+
onMarkAllRead && /* @__PURE__ */ jsx101(
|
|
6498
6520
|
"button",
|
|
6499
6521
|
{
|
|
6500
6522
|
type: "button",
|
|
@@ -6504,9 +6526,9 @@ var NotificationCenter = React81.forwardRef(
|
|
|
6504
6526
|
}
|
|
6505
6527
|
)
|
|
6506
6528
|
] }),
|
|
6507
|
-
searchable && /* @__PURE__ */
|
|
6508
|
-
/* @__PURE__ */
|
|
6509
|
-
/* @__PURE__ */
|
|
6529
|
+
searchable && /* @__PURE__ */ jsxs68("div", { className: "mb-3 flex items-center gap-2 rounded-lg bg-bg-elevated px-3 py-2", children: [
|
|
6530
|
+
/* @__PURE__ */ jsx101(Search2, { className: "size-4 shrink-0 text-text-tertiary", "aria-hidden": "true" }),
|
|
6531
|
+
/* @__PURE__ */ jsx101(
|
|
6510
6532
|
"input",
|
|
6511
6533
|
{
|
|
6512
6534
|
type: "text",
|
|
@@ -6517,8 +6539,8 @@ var NotificationCenter = React81.forwardRef(
|
|
|
6517
6539
|
}
|
|
6518
6540
|
)
|
|
6519
6541
|
] }),
|
|
6520
|
-
/* @__PURE__ */
|
|
6521
|
-
/* @__PURE__ */
|
|
6542
|
+
/* @__PURE__ */ jsxs68("div", { className: "mb-2 flex flex-wrap gap-1.5", children: [
|
|
6543
|
+
/* @__PURE__ */ jsx101(
|
|
6522
6544
|
"button",
|
|
6523
6545
|
{
|
|
6524
6546
|
type: "button",
|
|
@@ -6527,7 +6549,7 @@ var NotificationCenter = React81.forwardRef(
|
|
|
6527
6549
|
children: "All"
|
|
6528
6550
|
}
|
|
6529
6551
|
),
|
|
6530
|
-
/* @__PURE__ */
|
|
6552
|
+
/* @__PURE__ */ jsx101(
|
|
6531
6553
|
"button",
|
|
6532
6554
|
{
|
|
6533
6555
|
type: "button",
|
|
@@ -6537,8 +6559,8 @@ var NotificationCenter = React81.forwardRef(
|
|
|
6537
6559
|
}
|
|
6538
6560
|
)
|
|
6539
6561
|
] }),
|
|
6540
|
-
/* @__PURE__ */
|
|
6541
|
-
/* @__PURE__ */
|
|
6562
|
+
/* @__PURE__ */ jsxs68("div", { className: "mb-2 flex flex-wrap gap-1.5", children: [
|
|
6563
|
+
/* @__PURE__ */ jsx101(
|
|
6542
6564
|
"button",
|
|
6543
6565
|
{
|
|
6544
6566
|
type: "button",
|
|
@@ -6547,7 +6569,7 @@ var NotificationCenter = React81.forwardRef(
|
|
|
6547
6569
|
children: "All sources"
|
|
6548
6570
|
}
|
|
6549
6571
|
),
|
|
6550
|
-
sourceChips.map((s) => /* @__PURE__ */
|
|
6572
|
+
sourceChips.map((s) => /* @__PURE__ */ jsx101(
|
|
6551
6573
|
"button",
|
|
6552
6574
|
{
|
|
6553
6575
|
type: "button",
|
|
@@ -6558,8 +6580,8 @@ var NotificationCenter = React81.forwardRef(
|
|
|
6558
6580
|
s
|
|
6559
6581
|
))
|
|
6560
6582
|
] }),
|
|
6561
|
-
products && products.length > 0 && /* @__PURE__ */
|
|
6562
|
-
/* @__PURE__ */
|
|
6583
|
+
products && products.length > 0 && /* @__PURE__ */ jsxs68("div", { className: "mb-4 flex flex-wrap gap-1.5", children: [
|
|
6584
|
+
/* @__PURE__ */ jsx101(
|
|
6563
6585
|
"button",
|
|
6564
6586
|
{
|
|
6565
6587
|
type: "button",
|
|
@@ -6568,7 +6590,7 @@ var NotificationCenter = React81.forwardRef(
|
|
|
6568
6590
|
children: "All products"
|
|
6569
6591
|
}
|
|
6570
6592
|
),
|
|
6571
|
-
products.map((p) => /* @__PURE__ */
|
|
6593
|
+
products.map((p) => /* @__PURE__ */ jsx101(
|
|
6572
6594
|
"button",
|
|
6573
6595
|
{
|
|
6574
6596
|
type: "button",
|
|
@@ -6579,8 +6601,8 @@ var NotificationCenter = React81.forwardRef(
|
|
|
6579
6601
|
p.id
|
|
6580
6602
|
))
|
|
6581
6603
|
] }),
|
|
6582
|
-
shown.length === 0 ? /* @__PURE__ */
|
|
6583
|
-
shown.map((item) => /* @__PURE__ */
|
|
6604
|
+
shown.length === 0 ? /* @__PURE__ */ jsx101("p", { className: "rounded-xl bg-bg-elevated px-4 py-10 text-center text-sm leading-relaxed text-text-tertiary", children: filtering ? "Nothing matches." : "Nothing here yet. Everything addressed to you lands here." }) : /* @__PURE__ */ jsxs68("div", { className: "flex flex-col gap-1.5", children: [
|
|
6605
|
+
shown.map((item) => /* @__PURE__ */ jsx101(
|
|
6584
6606
|
CenterRow,
|
|
6585
6607
|
{
|
|
6586
6608
|
item,
|
|
@@ -6591,7 +6613,7 @@ var NotificationCenter = React81.forwardRef(
|
|
|
6591
6613
|
},
|
|
6592
6614
|
item.id
|
|
6593
6615
|
)),
|
|
6594
|
-
remaining > 0 && /* @__PURE__ */
|
|
6616
|
+
remaining > 0 && /* @__PURE__ */ jsxs68(
|
|
6595
6617
|
"button",
|
|
6596
6618
|
{
|
|
6597
6619
|
type: "button",
|
|
@@ -6611,9 +6633,9 @@ var NotificationCenter = React81.forwardRef(
|
|
|
6611
6633
|
NotificationCenter.displayName = "NotificationCenter";
|
|
6612
6634
|
|
|
6613
6635
|
// src/components/notification-settings.tsx
|
|
6614
|
-
import * as
|
|
6636
|
+
import * as React84 from "react";
|
|
6615
6637
|
import { Moon as Moon2, Plus as Plus3, Volume2 } from "lucide-react";
|
|
6616
|
-
import { Fragment as Fragment14, jsx as
|
|
6638
|
+
import { Fragment as Fragment14, jsx as jsx102, jsxs as jsxs69 } from "react/jsx-runtime";
|
|
6617
6639
|
var THRESHOLDS = [
|
|
6618
6640
|
["everything", "Everything"],
|
|
6619
6641
|
["important", "Important"],
|
|
@@ -6625,13 +6647,13 @@ function ThresholdControl({
|
|
|
6625
6647
|
value,
|
|
6626
6648
|
onChange
|
|
6627
6649
|
}) {
|
|
6628
|
-
return /* @__PURE__ */
|
|
6650
|
+
return /* @__PURE__ */ jsx102(
|
|
6629
6651
|
"span",
|
|
6630
6652
|
{
|
|
6631
6653
|
role: "group",
|
|
6632
6654
|
"aria-label": `Interrupt me for ${label}`,
|
|
6633
6655
|
className: "inline-flex shrink-0 rounded-lg border border-border-subtle bg-transparent p-0.5",
|
|
6634
|
-
children: THRESHOLDS.map(([threshold, text]) => /* @__PURE__ */
|
|
6656
|
+
children: THRESHOLDS.map(([threshold, text]) => /* @__PURE__ */ jsx102(
|
|
6635
6657
|
"button",
|
|
6636
6658
|
{
|
|
6637
6659
|
type: "button",
|
|
@@ -6648,7 +6670,7 @@ function ThresholdControl({
|
|
|
6648
6670
|
}
|
|
6649
6671
|
);
|
|
6650
6672
|
}
|
|
6651
|
-
var NotificationSettings =
|
|
6673
|
+
var NotificationSettings = React84.forwardRef(
|
|
6652
6674
|
({
|
|
6653
6675
|
subscriptions,
|
|
6654
6676
|
value,
|
|
@@ -6661,7 +6683,7 @@ var NotificationSettings = React82.forwardRef(
|
|
|
6661
6683
|
pushSlot,
|
|
6662
6684
|
className
|
|
6663
6685
|
}, ref) => {
|
|
6664
|
-
const [tab, setTab] =
|
|
6686
|
+
const [tab, setTab] = React84.useState(DEFAULT_KEY);
|
|
6665
6687
|
const isDefault = tab === DEFAULT_KEY;
|
|
6666
6688
|
const defaults = value[DEFAULT_KEY] ?? { thresholds: {} };
|
|
6667
6689
|
const customized = !isDefault && Object.prototype.hasOwnProperty.call(value, tab);
|
|
@@ -6681,15 +6703,15 @@ var NotificationSettings = React82.forwardRef(
|
|
|
6681
6703
|
const scopeGroup = (scope) => {
|
|
6682
6704
|
const rows = subscriptions.filter((s) => s.scope === scope);
|
|
6683
6705
|
if (rows.length === 0) return null;
|
|
6684
|
-
return /* @__PURE__ */
|
|
6685
|
-
/* @__PURE__ */
|
|
6686
|
-
/* @__PURE__ */
|
|
6706
|
+
return /* @__PURE__ */ jsxs69("div", { children: [
|
|
6707
|
+
/* @__PURE__ */ jsx102("p", { className: "mb-1.5 px-0.5 text-xs font-bold uppercase tracking-wider text-text-tertiary", children: scope === "product" ? "This product" : "Organization" }),
|
|
6708
|
+
/* @__PURE__ */ jsx102("div", { className: "space-y-2", children: rows.map((sub) => /* @__PURE__ */ jsxs69(
|
|
6687
6709
|
"div",
|
|
6688
6710
|
{
|
|
6689
6711
|
className: "flex items-center gap-4 rounded-xl bg-bg-elevated px-4 py-3",
|
|
6690
6712
|
children: [
|
|
6691
|
-
/* @__PURE__ */
|
|
6692
|
-
/* @__PURE__ */
|
|
6713
|
+
/* @__PURE__ */ jsx102("p", { className: "min-w-0 flex-1 text-sm font-semibold text-text-primary", children: sub.name }),
|
|
6714
|
+
/* @__PURE__ */ jsx102(
|
|
6693
6715
|
ThresholdControl,
|
|
6694
6716
|
{
|
|
6695
6717
|
label: sub.name,
|
|
@@ -6703,10 +6725,10 @@ var NotificationSettings = React82.forwardRef(
|
|
|
6703
6725
|
)) })
|
|
6704
6726
|
] }, scope);
|
|
6705
6727
|
};
|
|
6706
|
-
return /* @__PURE__ */
|
|
6707
|
-
products && products.length > 0 && /* @__PURE__ */
|
|
6708
|
-
/* @__PURE__ */
|
|
6709
|
-
/* @__PURE__ */
|
|
6728
|
+
return /* @__PURE__ */ jsxs69("div", { ref, className: cn("space-y-5", className), children: [
|
|
6729
|
+
products && products.length > 0 && /* @__PURE__ */ jsxs69("div", { children: [
|
|
6730
|
+
/* @__PURE__ */ jsx102("p", { className: "mb-2 px-0.5 text-xs font-bold uppercase tracking-wider text-text-tertiary", children: "Preferences for" }),
|
|
6731
|
+
/* @__PURE__ */ jsx102("div", { className: "flex flex-wrap gap-2", children: [{ id: DEFAULT_KEY, label: "Default" }, ...products].map((t) => /* @__PURE__ */ jsx102(
|
|
6710
6732
|
"button",
|
|
6711
6733
|
{
|
|
6712
6734
|
type: "button",
|
|
@@ -6721,26 +6743,26 @@ var NotificationSettings = React82.forwardRef(
|
|
|
6721
6743
|
t.id
|
|
6722
6744
|
)) })
|
|
6723
6745
|
] }),
|
|
6724
|
-
isDefault ? /* @__PURE__ */
|
|
6725
|
-
/* @__PURE__ */
|
|
6726
|
-
/* @__PURE__ */
|
|
6727
|
-
/* @__PURE__ */
|
|
6728
|
-
/* @__PURE__ */
|
|
6729
|
-
pushSlot ?? /* @__PURE__ */
|
|
6746
|
+
isDefault ? /* @__PURE__ */ jsxs69(Fragment14, { children: [
|
|
6747
|
+
/* @__PURE__ */ jsx102("p", { className: "text-sm leading-relaxed text-text-secondary", children: "Your defaults, applied to every product unless you customize one. Everything addressed to you always lands in the in-app record; that cannot be turned off." }),
|
|
6748
|
+
/* @__PURE__ */ jsxs69(Card, { className: "border-none bg-bg-elevated p-5", children: [
|
|
6749
|
+
/* @__PURE__ */ jsx102("p", { className: "mb-1.5 text-xs font-bold uppercase tracking-wide text-text-tertiary", children: "Push to" }),
|
|
6750
|
+
/* @__PURE__ */ jsx102("p", { className: "mb-3 text-sm leading-relaxed text-text-secondary", children: "Forward notifications beyond the in-app record to a connected integration." }),
|
|
6751
|
+
pushSlot ?? /* @__PURE__ */ jsx102("div", { className: "rounded-lg bg-bg-surface px-4 py-6 text-center", children: /* @__PURE__ */ jsx102("p", { className: "text-sm text-text-tertiary", children: "No integrations connected." }) })
|
|
6730
6752
|
] }),
|
|
6731
|
-
mutes.length > 0 && /* @__PURE__ */
|
|
6732
|
-
/* @__PURE__ */
|
|
6733
|
-
/* @__PURE__ */
|
|
6734
|
-
/* @__PURE__ */
|
|
6735
|
-
/* @__PURE__ */
|
|
6736
|
-
/* @__PURE__ */
|
|
6737
|
-
/* @__PURE__ */
|
|
6753
|
+
mutes.length > 0 && /* @__PURE__ */ jsxs69("div", { children: [
|
|
6754
|
+
/* @__PURE__ */ jsx102("p", { className: "mb-1.5 px-0.5 text-xs font-bold uppercase tracking-wider text-text-tertiary", children: "Muted" }),
|
|
6755
|
+
/* @__PURE__ */ jsx102(Card, { className: "border-none bg-bg-elevated p-2", children: mutes.map((m) => /* @__PURE__ */ jsxs69("div", { className: "flex items-center gap-3 rounded-lg px-3 py-2.5", children: [
|
|
6756
|
+
/* @__PURE__ */ jsx102(Moon2, { className: "size-4 shrink-0 text-text-tertiary", "aria-hidden": "true" }),
|
|
6757
|
+
/* @__PURE__ */ jsxs69("div", { className: "min-w-0 flex-1", children: [
|
|
6758
|
+
/* @__PURE__ */ jsx102("p", { className: "text-sm font-medium text-text-primary", children: m.source }),
|
|
6759
|
+
/* @__PURE__ */ jsxs69("p", { className: "text-sm text-text-tertiary", children: [
|
|
6738
6760
|
"Muted \u2014 ",
|
|
6739
6761
|
m.label,
|
|
6740
6762
|
". Critical still comes through."
|
|
6741
6763
|
] })
|
|
6742
6764
|
] }),
|
|
6743
|
-
/* @__PURE__ */
|
|
6765
|
+
/* @__PURE__ */ jsx102(
|
|
6744
6766
|
"button",
|
|
6745
6767
|
{
|
|
6746
6768
|
type: "button",
|
|
@@ -6753,13 +6775,13 @@ var NotificationSettings = React82.forwardRef(
|
|
|
6753
6775
|
] }),
|
|
6754
6776
|
scopeGroup("product"),
|
|
6755
6777
|
scopeGroup("org"),
|
|
6756
|
-
onSoundEnabledChange && /* @__PURE__ */
|
|
6757
|
-
/* @__PURE__ */
|
|
6758
|
-
/* @__PURE__ */
|
|
6759
|
-
/* @__PURE__ */
|
|
6760
|
-
/* @__PURE__ */
|
|
6778
|
+
onSoundEnabledChange && /* @__PURE__ */ jsx102(Card, { className: "border-none bg-bg-elevated p-4", children: /* @__PURE__ */ jsxs69("div", { className: "flex items-center gap-3", children: [
|
|
6779
|
+
/* @__PURE__ */ jsx102(Volume2, { className: "size-4 text-text-tertiary", "aria-hidden": "true" }),
|
|
6780
|
+
/* @__PURE__ */ jsxs69("div", { className: "flex-1", children: [
|
|
6781
|
+
/* @__PURE__ */ jsx102("p", { className: "text-sm font-medium text-text-primary", children: "Notification sound" }),
|
|
6782
|
+
/* @__PURE__ */ jsx102("p", { className: "text-sm text-text-tertiary", children: "Play a tone when a notification arrives. Critical always chimes." })
|
|
6761
6783
|
] }),
|
|
6762
|
-
/* @__PURE__ */
|
|
6784
|
+
/* @__PURE__ */ jsx102(
|
|
6763
6785
|
Switch,
|
|
6764
6786
|
{
|
|
6765
6787
|
checked: soundEnabled ?? false,
|
|
@@ -6768,35 +6790,35 @@ var NotificationSettings = React82.forwardRef(
|
|
|
6768
6790
|
}
|
|
6769
6791
|
)
|
|
6770
6792
|
] }) })
|
|
6771
|
-
] }) : !customized ? /* @__PURE__ */
|
|
6772
|
-
/* @__PURE__ */
|
|
6793
|
+
] }) : !customized ? /* @__PURE__ */ jsxs69(Card, { className: "border-none bg-bg-elevated p-8 text-center", children: [
|
|
6794
|
+
/* @__PURE__ */ jsxs69("p", { className: "text-sm font-semibold text-text-primary", children: [
|
|
6773
6795
|
productLabel,
|
|
6774
6796
|
" follows your Default preferences."
|
|
6775
6797
|
] }),
|
|
6776
|
-
/* @__PURE__ */
|
|
6777
|
-
/* @__PURE__ */
|
|
6798
|
+
/* @__PURE__ */ jsx102("p", { className: "mx-auto mt-1.5 max-w-[360px] text-sm leading-relaxed text-text-tertiary", children: "Interrupt thresholds, sound and forwarding all come from Default. Opt in to give this product its own interrupt thresholds." }),
|
|
6799
|
+
/* @__PURE__ */ jsxs69(
|
|
6778
6800
|
"button",
|
|
6779
6801
|
{
|
|
6780
6802
|
type: "button",
|
|
6781
6803
|
onClick: customize,
|
|
6782
6804
|
className: "mt-5 inline-flex items-center gap-1.5 rounded-lg bg-bg-brand px-3.5 py-2 text-sm font-semibold text-text-on-brand transition-colors hover:bg-bg-brand-hover",
|
|
6783
6805
|
children: [
|
|
6784
|
-
/* @__PURE__ */
|
|
6806
|
+
/* @__PURE__ */ jsx102(Plus3, { className: "size-4", "aria-hidden": "true" }),
|
|
6785
6807
|
" Customize for ",
|
|
6786
6808
|
productLabel
|
|
6787
6809
|
]
|
|
6788
6810
|
}
|
|
6789
6811
|
)
|
|
6790
|
-
] }) : /* @__PURE__ */
|
|
6791
|
-
/* @__PURE__ */
|
|
6792
|
-
/* @__PURE__ */
|
|
6793
|
-
/* @__PURE__ */
|
|
6812
|
+
] }) : /* @__PURE__ */ jsxs69(Fragment14, { children: [
|
|
6813
|
+
/* @__PURE__ */ jsx102(Card, { className: "border-none bg-bg-brand-subtle p-3.5", children: /* @__PURE__ */ jsxs69("div", { className: "flex items-center gap-3", children: [
|
|
6814
|
+
/* @__PURE__ */ jsxs69("div", { className: "min-w-0 flex-1", children: [
|
|
6815
|
+
/* @__PURE__ */ jsxs69("p", { className: "text-sm font-semibold text-text-brand", children: [
|
|
6794
6816
|
"Custom preferences for ",
|
|
6795
6817
|
productLabel
|
|
6796
6818
|
] }),
|
|
6797
|
-
/* @__PURE__ */
|
|
6819
|
+
/* @__PURE__ */ jsx102("p", { className: "text-sm leading-relaxed text-text-secondary", children: "Only the interrupt thresholds below differ. Sound and forwarding follow Default." })
|
|
6798
6820
|
] }),
|
|
6799
|
-
/* @__PURE__ */
|
|
6821
|
+
/* @__PURE__ */ jsx102(
|
|
6800
6822
|
"button",
|
|
6801
6823
|
{
|
|
6802
6824
|
type: "button",
|
|
@@ -6814,14 +6836,14 @@ var NotificationSettings = React82.forwardRef(
|
|
|
6814
6836
|
NotificationSettings.displayName = "NotificationSettings";
|
|
6815
6837
|
|
|
6816
6838
|
// src/components/notification-toast.tsx
|
|
6817
|
-
import * as
|
|
6839
|
+
import * as React85 from "react";
|
|
6818
6840
|
import { X as X5 } from "lucide-react";
|
|
6819
|
-
import { jsx as
|
|
6841
|
+
import { jsx as jsx103, jsxs as jsxs70 } from "react/jsx-runtime";
|
|
6820
6842
|
var chipBase2 = "rounded-lg px-2.5 py-1 text-sm font-medium transition-colors";
|
|
6821
6843
|
var chipPrimary = "bg-bg-brand text-text-on-brand hover:bg-bg-brand-hover";
|
|
6822
6844
|
var chipDestructive = "bg-bg-elevated text-text-danger hover:bg-bg-surface";
|
|
6823
6845
|
var linkAction = "text-sm font-semibold text-text-brand transition-colors hover:text-text-primary";
|
|
6824
|
-
var NotificationToast =
|
|
6846
|
+
var NotificationToast = React85.forwardRef(
|
|
6825
6847
|
({
|
|
6826
6848
|
item,
|
|
6827
6849
|
showSource = true,
|
|
@@ -6838,9 +6860,9 @@ var NotificationToast = React83.forwardRef(
|
|
|
6838
6860
|
const actions = item.actions ?? [];
|
|
6839
6861
|
const percent = progress === void 0 || !Number.isFinite(progress) ? void 0 : Math.min(100, Math.max(0, progress));
|
|
6840
6862
|
const progressLine = progressLabel === void 0 && percent !== void 0 ? `live, ${Math.round(percent)}%` : progressLabel;
|
|
6841
|
-
const barId =
|
|
6863
|
+
const barId = React85.useId();
|
|
6842
6864
|
const hasProgressLine = progressLine !== null && progressLine !== void 0;
|
|
6843
|
-
return /* @__PURE__ */
|
|
6865
|
+
return /* @__PURE__ */ jsxs70(
|
|
6844
6866
|
"div",
|
|
6845
6867
|
{
|
|
6846
6868
|
ref,
|
|
@@ -6851,24 +6873,24 @@ var NotificationToast = React83.forwardRef(
|
|
|
6851
6873
|
className
|
|
6852
6874
|
),
|
|
6853
6875
|
children: [
|
|
6854
|
-
/* @__PURE__ */
|
|
6855
|
-
showSource && /* @__PURE__ */
|
|
6856
|
-
/* @__PURE__ */
|
|
6857
|
-
(overflow || onDismiss) && /* @__PURE__ */
|
|
6876
|
+
/* @__PURE__ */ jsxs70("div", { className: "flex items-center gap-2", children: [
|
|
6877
|
+
showSource && /* @__PURE__ */ jsx103("span", { className: "text-xs font-semibold uppercase tracking-[0.09em] text-text-secondary", children: item.source }),
|
|
6878
|
+
/* @__PURE__ */ jsx103(Badge, { variant: severityBadgeVariant(item.severity), children: severityLabels[item.severity] }),
|
|
6879
|
+
(overflow || onDismiss) && /* @__PURE__ */ jsxs70("span", { className: "-mr-1 ml-auto flex shrink-0 items-center gap-1", children: [
|
|
6858
6880
|
overflow,
|
|
6859
|
-
onDismiss && /* @__PURE__ */
|
|
6881
|
+
onDismiss && /* @__PURE__ */ jsx103(
|
|
6860
6882
|
"button",
|
|
6861
6883
|
{
|
|
6862
6884
|
type: "button",
|
|
6863
6885
|
"aria-label": dismissLabel,
|
|
6864
6886
|
onClick: () => onDismiss(item),
|
|
6865
6887
|
className: "flex size-5 shrink-0 items-center justify-center rounded-md text-text-tertiary transition-colors hover:bg-bg-surface hover:text-text-primary",
|
|
6866
|
-
children: /* @__PURE__ */
|
|
6888
|
+
children: /* @__PURE__ */ jsx103(X5, { className: "size-3.5", "aria-hidden": "true" })
|
|
6867
6889
|
}
|
|
6868
6890
|
)
|
|
6869
6891
|
] })
|
|
6870
6892
|
] }),
|
|
6871
|
-
onItemClick ? /* @__PURE__ */
|
|
6893
|
+
onItemClick ? /* @__PURE__ */ jsx103(
|
|
6872
6894
|
"button",
|
|
6873
6895
|
{
|
|
6874
6896
|
type: "button",
|
|
@@ -6876,15 +6898,15 @@ var NotificationToast = React83.forwardRef(
|
|
|
6876
6898
|
className: "mt-1 block text-left text-sm font-semibold leading-snug text-text-primary underline-offset-2 hover:underline",
|
|
6877
6899
|
children: item.title
|
|
6878
6900
|
}
|
|
6879
|
-
) : /* @__PURE__ */
|
|
6880
|
-
item.body && /* @__PURE__ */
|
|
6881
|
-
note && /* @__PURE__ */
|
|
6901
|
+
) : /* @__PURE__ */ jsx103("p", { className: "mt-1 text-sm font-semibold leading-snug text-text-primary", children: item.title }),
|
|
6902
|
+
item.body && /* @__PURE__ */ jsx103("p", { className: "mt-0.5 text-sm leading-snug text-text-secondary", children: item.body }),
|
|
6903
|
+
note && /* @__PURE__ */ jsx103("p", { className: "mt-1.5 text-xs font-medium text-text-warning", children: note }),
|
|
6882
6904
|
percent !== void 0 && // The card is a `role="status"`, which implies `aria-atomic` — every tick of the bar would
|
|
6883
6905
|
// otherwise re-announce the whole card. `aria-live="off"` on the subtree that moves is the
|
|
6884
6906
|
// one cheap mitigation: the bar stays in the accessibility tree to be read on demand, it
|
|
6885
6907
|
// just stops interrupting.
|
|
6886
|
-
/* @__PURE__ */
|
|
6887
|
-
/* @__PURE__ */
|
|
6908
|
+
/* @__PURE__ */ jsxs70("div", { className: "mt-2", "aria-live": "off", children: [
|
|
6909
|
+
/* @__PURE__ */ jsx103(
|
|
6888
6910
|
Progress,
|
|
6889
6911
|
{
|
|
6890
6912
|
value: percent,
|
|
@@ -6893,11 +6915,11 @@ var NotificationToast = React83.forwardRef(
|
|
|
6893
6915
|
"aria-label": hasProgressLine ? void 0 : "Progress"
|
|
6894
6916
|
}
|
|
6895
6917
|
),
|
|
6896
|
-
hasProgressLine && /* @__PURE__ */
|
|
6918
|
+
hasProgressLine && /* @__PURE__ */ jsx103("p", { id: barId, className: "mt-0.5 text-xs text-text-secondary", children: progressLine })
|
|
6897
6919
|
] }),
|
|
6898
|
-
actions.length > 0 && /* @__PURE__ */
|
|
6920
|
+
actions.length > 0 && /* @__PURE__ */ jsx103("div", { className: "mt-2.5 flex flex-wrap items-center gap-2", children: actions.map((action) => {
|
|
6899
6921
|
const variant = action.variant ?? "link";
|
|
6900
|
-
return /* @__PURE__ */
|
|
6922
|
+
return /* @__PURE__ */ jsx103(
|
|
6901
6923
|
"button",
|
|
6902
6924
|
{
|
|
6903
6925
|
type: "button",
|
|
@@ -6916,15 +6938,15 @@ var NotificationToast = React83.forwardRef(
|
|
|
6916
6938
|
NotificationToast.displayName = "NotificationToast";
|
|
6917
6939
|
|
|
6918
6940
|
// src/components/notification-toaster.tsx
|
|
6919
|
-
import * as
|
|
6920
|
-
import { jsx as
|
|
6941
|
+
import * as React86 from "react";
|
|
6942
|
+
import { jsx as jsx104 } from "react/jsx-runtime";
|
|
6921
6943
|
var positions = {
|
|
6922
6944
|
"bottom-right": "bottom-6 right-6 flex-col",
|
|
6923
6945
|
"bottom-left": "bottom-6 left-6 flex-col",
|
|
6924
6946
|
"top-right": "top-6 right-6 flex-col-reverse",
|
|
6925
6947
|
"top-left": "top-6 left-6 flex-col-reverse"
|
|
6926
6948
|
};
|
|
6927
|
-
var NotificationToaster =
|
|
6949
|
+
var NotificationToaster = React86.forwardRef(
|
|
6928
6950
|
({
|
|
6929
6951
|
items,
|
|
6930
6952
|
dwell,
|
|
@@ -6941,15 +6963,15 @@ var NotificationToaster = React84.forwardRef(
|
|
|
6941
6963
|
className
|
|
6942
6964
|
}, ref) => {
|
|
6943
6965
|
const shown = items.slice(0, max);
|
|
6944
|
-
const [paused, setPaused] =
|
|
6945
|
-
const onDismissRef =
|
|
6966
|
+
const [paused, setPaused] = React86.useState(false);
|
|
6967
|
+
const onDismissRef = React86.useRef(onDismiss);
|
|
6946
6968
|
onDismissRef.current = onDismiss;
|
|
6947
6969
|
const fyiDwell = dwell?.fyi;
|
|
6948
6970
|
const importantDwell = dwell?.important;
|
|
6949
6971
|
const criticalDwell = dwell?.critical;
|
|
6950
|
-
const remaining =
|
|
6972
|
+
const remaining = React86.useRef(/* @__PURE__ */ new Map());
|
|
6951
6973
|
const liveIds = shown.map((item) => `${item.id}:${item.severity}`).join(" ");
|
|
6952
|
-
|
|
6974
|
+
React86.useEffect(() => {
|
|
6953
6975
|
const owedById = remaining.current;
|
|
6954
6976
|
const dwellSeconds = {
|
|
6955
6977
|
fyi: fyiDwell ?? TOAST_DWELL.fyi,
|
|
@@ -6990,7 +7012,7 @@ var NotificationToaster = React84.forwardRef(
|
|
|
6990
7012
|
};
|
|
6991
7013
|
}, [liveIds, paused, fyiDwell, importantDwell, criticalDwell]);
|
|
6992
7014
|
if (shown.length === 0) return null;
|
|
6993
|
-
return /* @__PURE__ */
|
|
7015
|
+
return /* @__PURE__ */ jsx104(
|
|
6994
7016
|
"div",
|
|
6995
7017
|
{
|
|
6996
7018
|
ref,
|
|
@@ -7003,7 +7025,7 @@ var NotificationToaster = React84.forwardRef(
|
|
|
7003
7025
|
positions[position],
|
|
7004
7026
|
className
|
|
7005
7027
|
),
|
|
7006
|
-
children: shown.map((item, i) => /* @__PURE__ */
|
|
7028
|
+
children: shown.map((item, i) => /* @__PURE__ */ jsx104("div", { className: "pointer-events-auto", children: /* @__PURE__ */ jsx104(
|
|
7007
7029
|
NotificationToast,
|
|
7008
7030
|
{
|
|
7009
7031
|
item,
|
|
@@ -7277,7 +7299,7 @@ var COUNTRY_OPTIONS = [
|
|
|
7277
7299
|
];
|
|
7278
7300
|
|
|
7279
7301
|
// src/components/organization-onboarding-form.tsx
|
|
7280
|
-
import * as
|
|
7302
|
+
import * as React87 from "react";
|
|
7281
7303
|
|
|
7282
7304
|
// src/lib/auth-surface.ts
|
|
7283
7305
|
var AUTH_FILLED_BUTTON = "flex h-[46px] w-full items-center justify-center gap-[11px] rounded-[10px] border border-transparent bg-text-primary px-[14px] text-[14.5px] font-semibold tracking-[-0.005em] text-bg-sunken transition-opacity hover:opacity-[0.92] focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-text-brand active:translate-y-px disabled:cursor-not-allowed disabled:opacity-[0.55]";
|
|
@@ -7285,7 +7307,7 @@ var AUTH_QUIET_BUTTON = "flex h-[46px] w-full items-center justify-center gap-[1
|
|
|
7285
7307
|
var AUTH_BUTTON_SHADOW = "var(--auth-btn-shadow)";
|
|
7286
7308
|
|
|
7287
7309
|
// src/components/organization-onboarding-form.tsx
|
|
7288
|
-
import { jsx as
|
|
7310
|
+
import { jsx as jsx105, jsxs as jsxs71 } from "react/jsx-runtime";
|
|
7289
7311
|
var CONTROLLER_SHARE_PCT = 50;
|
|
7290
7312
|
var MAX_BENEFICIAL_OWNERS = 50;
|
|
7291
7313
|
var OWNERSHIP_CONFIRMATION_MESSAGE = "Please confirm the ownership details by ticking the box";
|
|
@@ -7320,22 +7342,22 @@ function OrganizationOnboardingForm({
|
|
|
7320
7342
|
onCancel,
|
|
7321
7343
|
className
|
|
7322
7344
|
}) {
|
|
7323
|
-
const [name, setName] =
|
|
7324
|
-
const [legalName, setLegalName] =
|
|
7325
|
-
const [ownerName, setOwnerName] =
|
|
7326
|
-
const [countryOfIncorporation, setCountryOfIncorporation] =
|
|
7345
|
+
const [name, setName] = React87.useState(defaultValues?.name ?? "");
|
|
7346
|
+
const [legalName, setLegalName] = React87.useState(defaultValues?.legal_name ?? "");
|
|
7347
|
+
const [ownerName, setOwnerName] = React87.useState(defaultValues?.owner_name ?? "");
|
|
7348
|
+
const [countryOfIncorporation, setCountryOfIncorporation] = React87.useState(
|
|
7327
7349
|
defaultValues?.country_of_incorporation ?? ""
|
|
7328
7350
|
);
|
|
7329
|
-
const [residencyCountry, setResidencyCountry] =
|
|
7351
|
+
const [residencyCountry, setResidencyCountry] = React87.useState(
|
|
7330
7352
|
defaultValues?.residency_country ?? ""
|
|
7331
7353
|
);
|
|
7332
|
-
const [owners, setOwners] =
|
|
7354
|
+
const [owners, setOwners] = React87.useState(
|
|
7333
7355
|
() => initialRows(defaultValues?.beneficial_owners)
|
|
7334
7356
|
);
|
|
7335
|
-
const [ownershipConfirmed, setOwnershipConfirmed] =
|
|
7336
|
-
const [confirmationAttempted, setConfirmationAttempted] =
|
|
7337
|
-
const nextKeyRef =
|
|
7338
|
-
const submittingRef =
|
|
7357
|
+
const [ownershipConfirmed, setOwnershipConfirmed] = React87.useState(false);
|
|
7358
|
+
const [confirmationAttempted, setConfirmationAttempted] = React87.useState(false);
|
|
7359
|
+
const nextKeyRef = React87.useRef(owners.length);
|
|
7360
|
+
const submittingRef = React87.useRef(false);
|
|
7339
7361
|
const trimmed = name.trim();
|
|
7340
7362
|
const filledOwners = owners.filter((row) => !isRowBlank(row));
|
|
7341
7363
|
const ownerShares = filledOwners.map((row) => parseShare(row.share));
|
|
@@ -7389,7 +7411,7 @@ function OrganizationOnboardingForm({
|
|
|
7389
7411
|
...needsOwnershipConfirmation ? { ownership_confirmed: ownershipConfirmed } : {}
|
|
7390
7412
|
});
|
|
7391
7413
|
};
|
|
7392
|
-
|
|
7414
|
+
React87.useEffect(() => {
|
|
7393
7415
|
submittingRef.current = false;
|
|
7394
7416
|
}, [
|
|
7395
7417
|
name,
|
|
@@ -7402,12 +7424,12 @@ function OrganizationOnboardingForm({
|
|
|
7402
7424
|
submitting,
|
|
7403
7425
|
serverError
|
|
7404
7426
|
]);
|
|
7405
|
-
const countryField = (params) => /* @__PURE__ */
|
|
7406
|
-
/* @__PURE__ */
|
|
7427
|
+
const countryField = (params) => /* @__PURE__ */ jsxs71("div", { className: "space-y-1.5", children: [
|
|
7428
|
+
/* @__PURE__ */ jsxs71(Label2, { htmlFor: params.id, children: [
|
|
7407
7429
|
params.label,
|
|
7408
|
-
params.required && /* @__PURE__ */
|
|
7430
|
+
params.required && /* @__PURE__ */ jsx105("span", { className: "text-text-danger", children: " *" })
|
|
7409
7431
|
] }),
|
|
7410
|
-
/* @__PURE__ */
|
|
7432
|
+
/* @__PURE__ */ jsx105(
|
|
7411
7433
|
Select,
|
|
7412
7434
|
{
|
|
7413
7435
|
id: params.id,
|
|
@@ -7420,10 +7442,10 @@ function OrganizationOnboardingForm({
|
|
|
7420
7442
|
}
|
|
7421
7443
|
)
|
|
7422
7444
|
] });
|
|
7423
|
-
return /* @__PURE__ */
|
|
7424
|
-
/* @__PURE__ */
|
|
7425
|
-
/* @__PURE__ */
|
|
7426
|
-
/* @__PURE__ */
|
|
7445
|
+
return /* @__PURE__ */ jsxs71("form", { onSubmit: handleSubmit, className: cn("space-y-4", className), children: [
|
|
7446
|
+
/* @__PURE__ */ jsxs71("div", { className: "space-y-1.5", children: [
|
|
7447
|
+
/* @__PURE__ */ jsx105(Label2, { htmlFor: "create-org-name", children: "Organization name" }),
|
|
7448
|
+
/* @__PURE__ */ jsx105(
|
|
7427
7449
|
Input,
|
|
7428
7450
|
{
|
|
7429
7451
|
id: "create-org-name",
|
|
@@ -7434,9 +7456,9 @@ function OrganizationOnboardingForm({
|
|
|
7434
7456
|
}
|
|
7435
7457
|
)
|
|
7436
7458
|
] }),
|
|
7437
|
-
/* @__PURE__ */
|
|
7438
|
-
/* @__PURE__ */
|
|
7439
|
-
/* @__PURE__ */
|
|
7459
|
+
/* @__PURE__ */ jsxs71("div", { className: "space-y-1.5", children: [
|
|
7460
|
+
/* @__PURE__ */ jsx105(Label2, { htmlFor: "create-org-legal-name", children: "Legal name" }),
|
|
7461
|
+
/* @__PURE__ */ jsx105(
|
|
7440
7462
|
Input,
|
|
7441
7463
|
{
|
|
7442
7464
|
id: "create-org-legal-name",
|
|
@@ -7447,9 +7469,9 @@ function OrganizationOnboardingForm({
|
|
|
7447
7469
|
}
|
|
7448
7470
|
)
|
|
7449
7471
|
] }),
|
|
7450
|
-
/* @__PURE__ */
|
|
7451
|
-
/* @__PURE__ */
|
|
7452
|
-
/* @__PURE__ */
|
|
7472
|
+
/* @__PURE__ */ jsxs71("div", { className: "space-y-1.5", children: [
|
|
7473
|
+
/* @__PURE__ */ jsx105(Label2, { htmlFor: "create-org-owner-name", children: "Owner name" }),
|
|
7474
|
+
/* @__PURE__ */ jsx105(
|
|
7453
7475
|
Input,
|
|
7454
7476
|
{
|
|
7455
7477
|
id: "create-org-owner-name",
|
|
@@ -7474,10 +7496,10 @@ function OrganizationOnboardingForm({
|
|
|
7474
7496
|
onChange: setResidencyCountry,
|
|
7475
7497
|
required: false
|
|
7476
7498
|
}),
|
|
7477
|
-
/* @__PURE__ */
|
|
7478
|
-
/* @__PURE__ */
|
|
7479
|
-
/* @__PURE__ */
|
|
7480
|
-
/* @__PURE__ */
|
|
7499
|
+
/* @__PURE__ */ jsxs71("div", { className: "space-y-2", children: [
|
|
7500
|
+
/* @__PURE__ */ jsxs71("div", { className: "flex items-center justify-between", children: [
|
|
7501
|
+
/* @__PURE__ */ jsx105(Label2, { children: "Beneficial owners" }),
|
|
7502
|
+
/* @__PURE__ */ jsx105(
|
|
7481
7503
|
Button,
|
|
7482
7504
|
{
|
|
7483
7505
|
type: "button",
|
|
@@ -7490,16 +7512,16 @@ function OrganizationOnboardingForm({
|
|
|
7490
7512
|
}
|
|
7491
7513
|
)
|
|
7492
7514
|
] }),
|
|
7493
|
-
owners.length === 0 && /* @__PURE__ */
|
|
7494
|
-
owners.map((row) => /* @__PURE__ */
|
|
7515
|
+
owners.length === 0 && /* @__PURE__ */ jsx105("p", { className: "text-xs text-text-tertiary", children: "List the natural persons who ultimately own or control the organization." }),
|
|
7516
|
+
owners.map((row) => /* @__PURE__ */ jsxs71(
|
|
7495
7517
|
"div",
|
|
7496
7518
|
{
|
|
7497
7519
|
"data-testid": `beneficial-owner-row-${row.key}`,
|
|
7498
7520
|
className: "flex items-end gap-2",
|
|
7499
7521
|
children: [
|
|
7500
|
-
/* @__PURE__ */
|
|
7501
|
-
/* @__PURE__ */
|
|
7502
|
-
/* @__PURE__ */
|
|
7522
|
+
/* @__PURE__ */ jsxs71("div", { className: "flex-1 space-y-1", children: [
|
|
7523
|
+
/* @__PURE__ */ jsx105(Label2, { htmlFor: `bo-name-${row.key}`, className: "text-xs", children: "Name" }),
|
|
7524
|
+
/* @__PURE__ */ jsx105(
|
|
7503
7525
|
Input,
|
|
7504
7526
|
{
|
|
7505
7527
|
id: `bo-name-${row.key}`,
|
|
@@ -7509,9 +7531,9 @@ function OrganizationOnboardingForm({
|
|
|
7509
7531
|
}
|
|
7510
7532
|
)
|
|
7511
7533
|
] }),
|
|
7512
|
-
/* @__PURE__ */
|
|
7513
|
-
/* @__PURE__ */
|
|
7514
|
-
/* @__PURE__ */
|
|
7534
|
+
/* @__PURE__ */ jsxs71("div", { className: "w-40 space-y-1", children: [
|
|
7535
|
+
/* @__PURE__ */ jsx105(Label2, { htmlFor: `bo-country-${row.key}`, className: "text-xs", children: "Country" }),
|
|
7536
|
+
/* @__PURE__ */ jsx105(
|
|
7515
7537
|
Select,
|
|
7516
7538
|
{
|
|
7517
7539
|
id: `bo-country-${row.key}`,
|
|
@@ -7524,9 +7546,9 @@ function OrganizationOnboardingForm({
|
|
|
7524
7546
|
}
|
|
7525
7547
|
)
|
|
7526
7548
|
] }),
|
|
7527
|
-
/* @__PURE__ */
|
|
7528
|
-
/* @__PURE__ */
|
|
7529
|
-
/* @__PURE__ */
|
|
7549
|
+
/* @__PURE__ */ jsxs71("div", { className: "w-24 space-y-1", children: [
|
|
7550
|
+
/* @__PURE__ */ jsx105(Label2, { htmlFor: `bo-share-${row.key}`, className: "text-xs", children: "Share %" }),
|
|
7551
|
+
/* @__PURE__ */ jsx105(
|
|
7530
7552
|
Input,
|
|
7531
7553
|
{
|
|
7532
7554
|
id: `bo-share-${row.key}`,
|
|
@@ -7537,7 +7559,7 @@ function OrganizationOnboardingForm({
|
|
|
7537
7559
|
}
|
|
7538
7560
|
)
|
|
7539
7561
|
] }),
|
|
7540
|
-
/* @__PURE__ */
|
|
7562
|
+
/* @__PURE__ */ jsx105(
|
|
7541
7563
|
Button,
|
|
7542
7564
|
{
|
|
7543
7565
|
type: "button",
|
|
@@ -7552,16 +7574,16 @@ function OrganizationOnboardingForm({
|
|
|
7552
7574
|
},
|
|
7553
7575
|
row.key
|
|
7554
7576
|
)),
|
|
7555
|
-
!ownersValid && /* @__PURE__ */
|
|
7556
|
-
shareSum > 100 && /* @__PURE__ */
|
|
7577
|
+
!ownersValid && /* @__PURE__ */ jsx105("p", { "data-testid": "beneficial-owners-error", className: "text-xs text-text-danger", children: "Every owner needs a name, a country and a share between 0 and 100." }),
|
|
7578
|
+
shareSum > 100 && /* @__PURE__ */ jsxs71("p", { "data-testid": "beneficial-owners-sum-warning", className: "text-xs text-text-warning", children: [
|
|
7557
7579
|
"The listed shares add up to ",
|
|
7558
7580
|
shareSum,
|
|
7559
7581
|
"%, which is more than 100%."
|
|
7560
7582
|
] })
|
|
7561
7583
|
] }),
|
|
7562
|
-
needsOwnershipConfirmation && /* @__PURE__ */
|
|
7563
|
-
/* @__PURE__ */
|
|
7564
|
-
/* @__PURE__ */
|
|
7584
|
+
needsOwnershipConfirmation && /* @__PURE__ */ jsxs71("div", { className: "space-y-1", children: [
|
|
7585
|
+
/* @__PURE__ */ jsxs71("div", { className: "flex items-start gap-2", children: [
|
|
7586
|
+
/* @__PURE__ */ jsx105(
|
|
7565
7587
|
Checkbox,
|
|
7566
7588
|
{
|
|
7567
7589
|
id: "create-org-ownership-confirmed",
|
|
@@ -7571,19 +7593,19 @@ function OrganizationOnboardingForm({
|
|
|
7571
7593
|
onCheckedChange: (value) => setOwnershipConfirmed(value === true)
|
|
7572
7594
|
}
|
|
7573
7595
|
),
|
|
7574
|
-
/* @__PURE__ */
|
|
7596
|
+
/* @__PURE__ */ jsxs71(
|
|
7575
7597
|
Label2,
|
|
7576
7598
|
{
|
|
7577
7599
|
htmlFor: "create-org-ownership-confirmed",
|
|
7578
7600
|
className: "text-xs font-regular leading-snug",
|
|
7579
7601
|
children: [
|
|
7580
7602
|
"I confirm the ownership structure above is complete and correct",
|
|
7581
|
-
/* @__PURE__ */
|
|
7603
|
+
/* @__PURE__ */ jsx105("span", { className: "text-text-danger", children: " *" })
|
|
7582
7604
|
]
|
|
7583
7605
|
}
|
|
7584
7606
|
)
|
|
7585
7607
|
] }),
|
|
7586
|
-
showConfirmationError && /* @__PURE__ */
|
|
7608
|
+
showConfirmationError && /* @__PURE__ */ jsx105(
|
|
7587
7609
|
"p",
|
|
7588
7610
|
{
|
|
7589
7611
|
id: "create-org-ownership-error",
|
|
@@ -7593,12 +7615,12 @@ function OrganizationOnboardingForm({
|
|
|
7593
7615
|
}
|
|
7594
7616
|
)
|
|
7595
7617
|
] }),
|
|
7596
|
-
(serverError || otherViolations.length > 0) && /* @__PURE__ */
|
|
7618
|
+
(serverError || otherViolations.length > 0) && /* @__PURE__ */ jsxs71(InlineError, { children: [
|
|
7597
7619
|
serverError,
|
|
7598
|
-
otherViolations.length > 0 && /* @__PURE__ */
|
|
7620
|
+
otherViolations.length > 0 && /* @__PURE__ */ jsx105("ul", { "data-testid": "create-org-violations", className: "mt-1 list-disc pl-4", children: otherViolations.map((violation) => /* @__PURE__ */ jsx105("li", { children: violation }, violation)) })
|
|
7599
7621
|
] }),
|
|
7600
|
-
/* @__PURE__ */
|
|
7601
|
-
/* @__PURE__ */
|
|
7622
|
+
/* @__PURE__ */ jsxs71("div", { className: "space-y-2 pt-1", children: [
|
|
7623
|
+
/* @__PURE__ */ jsx105(
|
|
7602
7624
|
"button",
|
|
7603
7625
|
{
|
|
7604
7626
|
type: "submit",
|
|
@@ -7609,14 +7631,14 @@ function OrganizationOnboardingForm({
|
|
|
7609
7631
|
children: submitting ? "Creating\u2026" : submitLabel
|
|
7610
7632
|
}
|
|
7611
7633
|
),
|
|
7612
|
-
onCancel && /* @__PURE__ */
|
|
7634
|
+
onCancel && /* @__PURE__ */ jsx105("button", { type: "button", onClick: onCancel, className: AUTH_QUIET_BUTTON, children: "Cancel" })
|
|
7613
7635
|
] })
|
|
7614
7636
|
] });
|
|
7615
7637
|
}
|
|
7616
7638
|
|
|
7617
7639
|
// src/components/list-columns.tsx
|
|
7618
|
-
import * as
|
|
7619
|
-
import { jsx as
|
|
7640
|
+
import * as React88 from "react";
|
|
7641
|
+
import { jsx as jsx106, jsxs as jsxs72 } from "react/jsx-runtime";
|
|
7620
7642
|
var CELL_WIDTH = { 20: "w-20", 24: "w-24", 28: "w-28", 32: "w-32" };
|
|
7621
7643
|
var headerClass = "flex items-center gap-3 border-b border-border-subtle bg-bg-secondary px-4 py-1.5 text-xs text-text-tertiary";
|
|
7622
7644
|
var cellsClass = "flex shrink-0 items-center gap-3";
|
|
@@ -7634,13 +7656,13 @@ function warnDuplicateKeys(columns, where) {
|
|
|
7634
7656
|
seen.add(c.key);
|
|
7635
7657
|
}
|
|
7636
7658
|
}
|
|
7637
|
-
var ListHeader =
|
|
7659
|
+
var ListHeader = React88.forwardRef(function ListHeader2({ lead, columns, mark = true, trailing = true, className, ...props }, ref) {
|
|
7638
7660
|
warnDuplicateKeys(columns, "ListHeader");
|
|
7639
|
-
return /* @__PURE__ */
|
|
7640
|
-
mark && /* @__PURE__ */
|
|
7641
|
-
/* @__PURE__ */
|
|
7642
|
-
/* @__PURE__ */
|
|
7643
|
-
trailing && /* @__PURE__ */
|
|
7661
|
+
return /* @__PURE__ */ jsxs72("div", { ref, className: cn(headerClass, className), ...props, children: [
|
|
7662
|
+
mark && /* @__PURE__ */ jsx106("span", { className: "size-8 shrink-0", "aria-hidden": true }),
|
|
7663
|
+
/* @__PURE__ */ jsx106("span", { className: "min-w-0 flex-1 truncate", children: lead }),
|
|
7664
|
+
/* @__PURE__ */ jsx106("span", { className: cellsClass, children: columns.map((c) => /* @__PURE__ */ jsx106("span", { className: cn(CELL_WIDTH[c.width], cellClass), children: c.label }, c.key)) }),
|
|
7665
|
+
trailing && /* @__PURE__ */ jsx106("span", { className: "size-4 shrink-0", "aria-hidden": true })
|
|
7644
7666
|
] });
|
|
7645
7667
|
});
|
|
7646
7668
|
function cellValue(values, column) {
|
|
@@ -7648,9 +7670,9 @@ function cellValue(values, column) {
|
|
|
7648
7670
|
const value = values[column.key];
|
|
7649
7671
|
return value === void 0 || value === null || value === "" ? column.fallback : value;
|
|
7650
7672
|
}
|
|
7651
|
-
var ListCells =
|
|
7673
|
+
var ListCells = React88.forwardRef(function ListCells2({ columns, values, className, ...props }, ref) {
|
|
7652
7674
|
warnDuplicateKeys(columns, "ListCells");
|
|
7653
|
-
return /* @__PURE__ */
|
|
7675
|
+
return /* @__PURE__ */ jsx106("span", { ref, className: cn(cellsClass, className), ...props, children: columns.map((c) => /* @__PURE__ */ jsx106(
|
|
7654
7676
|
"span",
|
|
7655
7677
|
{
|
|
7656
7678
|
className: cn(CELL_WIDTH[c.width], cellClass, c.quiet && "text-text-tertiary"),
|
|
@@ -7663,9 +7685,9 @@ ListHeader.displayName = "ListHeader";
|
|
|
7663
7685
|
ListCells.displayName = "ListCells";
|
|
7664
7686
|
|
|
7665
7687
|
// src/components/theme-picker.tsx
|
|
7666
|
-
import * as
|
|
7688
|
+
import * as React89 from "react";
|
|
7667
7689
|
import { Check as Check12, Monitor as Monitor2 } from "lucide-react";
|
|
7668
|
-
import { jsx as
|
|
7690
|
+
import { jsx as jsx107, jsxs as jsxs73 } from "react/jsx-runtime";
|
|
7669
7691
|
var THEME_SWATCHES = {
|
|
7670
7692
|
// --bg-surface --bg-sunken --bg-overlay --border-default --text-tertiary
|
|
7671
7693
|
light: { canvas: "#f2f3f4", rail: "#e1e2e4", body: "#ffffff", quiet: "#bbbec7", strong: "#535a6e" },
|
|
@@ -7679,13 +7701,13 @@ var OPTIONS = [
|
|
|
7679
7701
|
{ value: "system", label: "Auto", name: "Auto, follows your device theme" }
|
|
7680
7702
|
];
|
|
7681
7703
|
function Panels({ palette }) {
|
|
7682
|
-
return /* @__PURE__ */
|
|
7683
|
-
/* @__PURE__ */
|
|
7704
|
+
return /* @__PURE__ */ jsxs73("span", { className: "flex h-full gap-1.5 p-1.5", style: { background: palette.canvas }, children: [
|
|
7705
|
+
/* @__PURE__ */ jsx107(
|
|
7684
7706
|
"span",
|
|
7685
7707
|
{
|
|
7686
7708
|
className: "flex flex-col gap-1.5 p-1.5",
|
|
7687
7709
|
style: { width: "28%", borderRadius: 5, background: palette.rail },
|
|
7688
|
-
children: RAIL_BARS.map((w, i) => /* @__PURE__ */
|
|
7710
|
+
children: RAIL_BARS.map((w, i) => /* @__PURE__ */ jsx107(
|
|
7689
7711
|
"span",
|
|
7690
7712
|
{
|
|
7691
7713
|
className: "rounded-full",
|
|
@@ -7695,12 +7717,12 @@ function Panels({ palette }) {
|
|
|
7695
7717
|
))
|
|
7696
7718
|
}
|
|
7697
7719
|
),
|
|
7698
|
-
/* @__PURE__ */
|
|
7720
|
+
/* @__PURE__ */ jsx107(
|
|
7699
7721
|
"span",
|
|
7700
7722
|
{
|
|
7701
7723
|
className: "flex flex-1 flex-col gap-1.5 border p-2",
|
|
7702
7724
|
style: { borderRadius: 5, background: palette.body, borderColor: palette.quiet },
|
|
7703
|
-
children: BODY_BARS.map((w, i) => /* @__PURE__ */
|
|
7725
|
+
children: BODY_BARS.map((w, i) => /* @__PURE__ */ jsx107(
|
|
7704
7726
|
"span",
|
|
7705
7727
|
{
|
|
7706
7728
|
className: "rounded-full",
|
|
@@ -7716,13 +7738,13 @@ var autoPlateClass = "flex h-full items-center justify-center bg-bg-secondary";
|
|
|
7716
7738
|
var previewClass = "block h-28 overflow-hidden rounded-lg border border-border-default";
|
|
7717
7739
|
var cardClass = "grid gap-2 rounded-lg p-1.5 text-left transition-colors hover:bg-bg-elevated focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-border-focus";
|
|
7718
7740
|
var TRACK = { gridTemplateColumns: "repeat(auto-fit, minmax(8rem, 1fr))" };
|
|
7719
|
-
var Picker =
|
|
7720
|
-
return /* @__PURE__ */
|
|
7741
|
+
var Picker = React89.forwardRef(function Picker2({ value, onValueChange, className, ...props }, ref) {
|
|
7742
|
+
return /* @__PURE__ */ jsx107("div", { role: "group", "aria-label": "Theme", ...props, ref, className: cn("grid gap-4", className), style: { ...TRACK, ...props.style }, children: OPTIONS.map((o) => {
|
|
7721
7743
|
const selected = o.value === value;
|
|
7722
7744
|
return (
|
|
7723
7745
|
// Not a `Button` (Guidelines/When it isn't a Button): the preview is the control, and
|
|
7724
7746
|
// `aria-pressed` is what says which one is on.
|
|
7725
|
-
/* @__PURE__ */
|
|
7747
|
+
/* @__PURE__ */ jsxs73(
|
|
7726
7748
|
"button",
|
|
7727
7749
|
{
|
|
7728
7750
|
type: "button",
|
|
@@ -7731,8 +7753,8 @@ var Picker = React87.forwardRef(function Picker2({ value, onValueChange, classNa
|
|
|
7731
7753
|
onClick: () => onValueChange(o.value),
|
|
7732
7754
|
className: cardClass,
|
|
7733
7755
|
children: [
|
|
7734
|
-
/* @__PURE__ */
|
|
7735
|
-
/* @__PURE__ */
|
|
7756
|
+
/* @__PURE__ */ jsx107("span", { className: cn(previewClass, selected && "ring-2 ring-border-strong"), "aria-hidden": true, children: o.value === "system" ? /* @__PURE__ */ jsx107("span", { className: autoPlateClass, children: /* @__PURE__ */ jsx107(Monitor2, { className: "size-8 text-text-tertiary" }) }) : /* @__PURE__ */ jsx107(Panels, { palette: THEME_SWATCHES[o.value] }) }),
|
|
7757
|
+
/* @__PURE__ */ jsxs73(
|
|
7736
7758
|
"span",
|
|
7737
7759
|
{
|
|
7738
7760
|
className: cn(
|
|
@@ -7740,7 +7762,7 @@ var Picker = React87.forwardRef(function Picker2({ value, onValueChange, classNa
|
|
|
7740
7762
|
selected ? "font-semibold text-text-primary" : "text-text-secondary"
|
|
7741
7763
|
),
|
|
7742
7764
|
children: [
|
|
7743
|
-
/* @__PURE__ */
|
|
7765
|
+
/* @__PURE__ */ jsx107(Check12, { className: cn("size-4 shrink-0", !selected && "invisible"), "aria-hidden": true }),
|
|
7744
7766
|
o.label
|
|
7745
7767
|
]
|
|
7746
7768
|
}
|
|
@@ -7752,9 +7774,9 @@ var Picker = React87.forwardRef(function Picker2({ value, onValueChange, classNa
|
|
|
7752
7774
|
);
|
|
7753
7775
|
}) });
|
|
7754
7776
|
});
|
|
7755
|
-
var WiredPicker =
|
|
7777
|
+
var WiredPicker = React89.forwardRef(function WiredPicker2({ onValueChange, ...props }, ref) {
|
|
7756
7778
|
const { theme, setTheme } = useTheme();
|
|
7757
|
-
return /* @__PURE__ */
|
|
7779
|
+
return /* @__PURE__ */ jsx107(
|
|
7758
7780
|
Picker,
|
|
7759
7781
|
{
|
|
7760
7782
|
...props,
|
|
@@ -7767,22 +7789,22 @@ var WiredPicker = React87.forwardRef(function WiredPicker2({ onValueChange, ...p
|
|
|
7767
7789
|
}
|
|
7768
7790
|
);
|
|
7769
7791
|
});
|
|
7770
|
-
var ThemePicker =
|
|
7771
|
-
const controlled =
|
|
7792
|
+
var ThemePicker = React89.forwardRef(function ThemePicker2({ value, onValueChange, ...props }, ref) {
|
|
7793
|
+
const controlled = React89.useRef(value !== void 0);
|
|
7772
7794
|
if (process.env.NODE_ENV !== "production" && controlled.current !== (value !== void 0)) {
|
|
7773
7795
|
console.warn(
|
|
7774
7796
|
"[ThemePicker] `value` went from " + (controlled.current ? "set to missing" : "missing to set") + " after mount. The picker stays " + (controlled.current ? "controlled" : "wired to the console theme") + " for its whole life: render it once its value is known, or leave `value` off entirely."
|
|
7775
7797
|
);
|
|
7776
7798
|
}
|
|
7777
|
-
return controlled.current ? /* @__PURE__ */
|
|
7778
|
-
}) }) : /* @__PURE__ */
|
|
7799
|
+
return controlled.current ? /* @__PURE__ */ jsx107(Picker, { ...props, ref, value: value ?? "system", onValueChange: onValueChange ?? (() => {
|
|
7800
|
+
}) }) : /* @__PURE__ */ jsx107(WiredPicker, { ...props, ref, onValueChange });
|
|
7779
7801
|
});
|
|
7780
7802
|
ThemePicker.displayName = "ThemePicker";
|
|
7781
7803
|
|
|
7782
7804
|
// src/components/secret-reveal.tsx
|
|
7783
|
-
import * as
|
|
7805
|
+
import * as React90 from "react";
|
|
7784
7806
|
import { Copy as Copy2, Download } from "lucide-react";
|
|
7785
|
-
import { jsx as
|
|
7807
|
+
import { jsx as jsx108, jsxs as jsxs74 } from "react/jsx-runtime";
|
|
7786
7808
|
var asText = (value) => Array.isArray(value) ? value.join("\n") : value;
|
|
7787
7809
|
var REVEALED = "A secret is on screen and will not be shown again.";
|
|
7788
7810
|
var REFUSED = "The browser refused the clipboard. Select the value to copy it.";
|
|
@@ -7790,15 +7812,15 @@ function SecretValue({ value }) {
|
|
|
7790
7812
|
if (Array.isArray(value)) {
|
|
7791
7813
|
const half = Math.ceil(value.length / 2);
|
|
7792
7814
|
const columns = [value.slice(0, half), value.slice(half)].filter((column) => column.length > 0);
|
|
7793
|
-
return /* @__PURE__ */
|
|
7815
|
+
return /* @__PURE__ */ jsx108("div", { className: "flex w-fit gap-x-12", children: columns.map((column, index) => (
|
|
7794
7816
|
// Neither the columns nor the values inside one are ever reordered, and two identical
|
|
7795
7817
|
// values in a list are legal, so the index is the key and the value is not.
|
|
7796
|
-
/* @__PURE__ */
|
|
7818
|
+
/* @__PURE__ */ jsx108("div", { className: "grid gap-y-1.5", children: column.map((line, row) => /* @__PURE__ */ jsx108("code", { className: "font-mono text-sm font-medium tabular-nums text-text-primary", children: line }, row)) }, index)
|
|
7797
7819
|
)) });
|
|
7798
7820
|
}
|
|
7799
|
-
return /* @__PURE__ */
|
|
7821
|
+
return /* @__PURE__ */ jsx108("code", { className: "block break-all font-mono text-sm font-medium text-text-primary", children: value });
|
|
7800
7822
|
}
|
|
7801
|
-
var SecretReveal =
|
|
7823
|
+
var SecretReveal = React90.forwardRef(
|
|
7802
7824
|
({
|
|
7803
7825
|
value,
|
|
7804
7826
|
caption,
|
|
@@ -7815,18 +7837,18 @@ var SecretReveal = React88.forwardRef(
|
|
|
7815
7837
|
className,
|
|
7816
7838
|
...props
|
|
7817
7839
|
}, ref) => {
|
|
7818
|
-
const [takenText, setTakenText] =
|
|
7819
|
-
const [refusedText, setRefusedText] =
|
|
7820
|
-
const [announcedFor, setAnnouncedFor] =
|
|
7821
|
-
const copyRef =
|
|
7822
|
-
const captionId =
|
|
7840
|
+
const [takenText, setTakenText] = React90.useState(null);
|
|
7841
|
+
const [refusedText, setRefusedText] = React90.useState(null);
|
|
7842
|
+
const [announcedFor, setAnnouncedFor] = React90.useState(null);
|
|
7843
|
+
const copyRef = React90.useRef(null);
|
|
7844
|
+
const captionId = React90.useId();
|
|
7823
7845
|
const text = asText(value);
|
|
7824
7846
|
const empty = text.length === 0;
|
|
7825
7847
|
const taken = takenText === text;
|
|
7826
7848
|
const refused = refusedText === text;
|
|
7827
|
-
|
|
7849
|
+
React90.useEffect(() => setAnnouncedFor(text), [text]);
|
|
7828
7850
|
const announced = announcedFor === text ? REVEALED : "";
|
|
7829
|
-
|
|
7851
|
+
React90.useEffect(() => {
|
|
7830
7852
|
if (autoFocus) copyRef.current?.focus();
|
|
7831
7853
|
}, [autoFocus]);
|
|
7832
7854
|
const reportTaken = () => {
|
|
@@ -7852,12 +7874,12 @@ var SecretReveal = React88.forwardRef(
|
|
|
7852
7874
|
reportTaken();
|
|
7853
7875
|
onDownload?.();
|
|
7854
7876
|
};
|
|
7855
|
-
return /* @__PURE__ */
|
|
7856
|
-
/* @__PURE__ */
|
|
7857
|
-
/* @__PURE__ */
|
|
7858
|
-
/* @__PURE__ */
|
|
7859
|
-
/* @__PURE__ */
|
|
7860
|
-
/* @__PURE__ */
|
|
7877
|
+
return /* @__PURE__ */ jsx108("div", { ref, className: cn("overflow-hidden rounded-lg bg-bg-sunken", className), ...props, children: /* @__PURE__ */ jsx108("div", { className: highlightClassName, ref: highlightRef, children: /* @__PURE__ */ jsxs74("div", { className: "grid gap-3 rounded-lg border border-border-strong px-4 py-3", children: [
|
|
7878
|
+
/* @__PURE__ */ jsx108("span", { role: "status", className: "sr-only", children: announced }),
|
|
7879
|
+
/* @__PURE__ */ jsx108("div", { id: captionId, className: "text-sm text-text-secondary", children: caption }),
|
|
7880
|
+
/* @__PURE__ */ jsx108(SecretValue, { value }),
|
|
7881
|
+
/* @__PURE__ */ jsxs74("div", { className: "flex flex-wrap items-center gap-2", children: [
|
|
7882
|
+
/* @__PURE__ */ jsx108(
|
|
7861
7883
|
Button,
|
|
7862
7884
|
{
|
|
7863
7885
|
ref: copyRef,
|
|
@@ -7865,12 +7887,12 @@ var SecretReveal = React88.forwardRef(
|
|
|
7865
7887
|
"aria-describedby": captionId,
|
|
7866
7888
|
variant: "outline",
|
|
7867
7889
|
size: "sm",
|
|
7868
|
-
icon: /* @__PURE__ */
|
|
7890
|
+
icon: /* @__PURE__ */ jsx108(Copy2, {}),
|
|
7869
7891
|
children: copyLabel ?? (Array.isArray(value) ? "Copy all" : "Copy")
|
|
7870
7892
|
}
|
|
7871
7893
|
),
|
|
7872
|
-
onDownload && /* @__PURE__ */
|
|
7873
|
-
/* @__PURE__ */
|
|
7894
|
+
onDownload && /* @__PURE__ */ jsx108(Button, { onClick: download, "aria-describedby": captionId, variant: "outline", size: "sm", icon: /* @__PURE__ */ jsx108(Download, {}), children: downloadLabel }),
|
|
7895
|
+
/* @__PURE__ */ jsx108(
|
|
7874
7896
|
Button,
|
|
7875
7897
|
{
|
|
7876
7898
|
onClick: onConfirm,
|
|
@@ -7881,7 +7903,7 @@ var SecretReveal = React88.forwardRef(
|
|
|
7881
7903
|
}
|
|
7882
7904
|
)
|
|
7883
7905
|
] }),
|
|
7884
|
-
refused && /* @__PURE__ */
|
|
7906
|
+
refused && /* @__PURE__ */ jsx108("div", { role: "status", className: "text-xs text-text-tertiary", children: REFUSED })
|
|
7885
7907
|
] }) }) });
|
|
7886
7908
|
}
|
|
7887
7909
|
);
|
|
@@ -8157,6 +8179,8 @@ export {
|
|
|
8157
8179
|
TooltipContent,
|
|
8158
8180
|
TooltipProvider,
|
|
8159
8181
|
TooltipTrigger,
|
|
8182
|
+
TopBar,
|
|
8183
|
+
TopBarUtilities,
|
|
8160
8184
|
UserMenu,
|
|
8161
8185
|
WEIGHT_TONE,
|
|
8162
8186
|
alertVariants,
|