@lessly/ui 3.0.0 → 4.1.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/{chunk-CEXND5YW.js → chunk-LTHOLX7I.js} +223 -28
- package/dist/index.d.ts +359 -57
- package/dist/index.js +886 -752
- package/dist/router.d.ts +27 -17
- package/dist/router.js +72 -98
- package/dist/styles-federated.css +63 -10
- package/dist/styles.css +63 -16
- package/package.json +14 -14
package/dist/index.js
CHANGED
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
2
|
Button,
|
|
3
|
+
EntityRow,
|
|
3
4
|
NavRow,
|
|
5
|
+
RailToggle,
|
|
6
|
+
ScrollArea,
|
|
7
|
+
ScrollBar,
|
|
4
8
|
Sheet,
|
|
5
9
|
SheetClose,
|
|
6
10
|
SheetContent,
|
|
@@ -19,7 +23,7 @@ import {
|
|
|
19
23
|
cn,
|
|
20
24
|
useIsMobile,
|
|
21
25
|
useSidebar
|
|
22
|
-
} from "./chunk-
|
|
26
|
+
} from "./chunk-LTHOLX7I.js";
|
|
23
27
|
|
|
24
28
|
// src/components/auto-height.tsx
|
|
25
29
|
import * as React from "react";
|
|
@@ -82,9 +86,10 @@ var Card = React2.forwardRef(
|
|
|
82
86
|
"div",
|
|
83
87
|
{
|
|
84
88
|
ref,
|
|
89
|
+
"data-slot": "card",
|
|
85
90
|
title: tooltip,
|
|
86
91
|
className: cn(
|
|
87
|
-
"rounded-xl border border-border-subtle bg-bg-
|
|
92
|
+
"rounded-xl border border-border-subtle bg-bg-overlay text-text-primary shadow-sm",
|
|
88
93
|
variant === "list" && "overflow-hidden",
|
|
89
94
|
variant === "nested" && "rounded-md bg-bg-secondary p-3 shadow-none",
|
|
90
95
|
className
|
|
@@ -170,7 +175,7 @@ var DialogContent = React3.forwardRef(({ className, children, showClose = true,
|
|
|
170
175
|
...props,
|
|
171
176
|
children: [
|
|
172
177
|
children,
|
|
173
|
-
showClose && /* @__PURE__ */ jsxs2(DialogPrimitive.Close, { className: "absolute right-4 top-4 rounded-sm text-text-tertiary opacity-70 transition-opacity duration-fast hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-border-focus disabled:pointer-events-none", children: [
|
|
178
|
+
showClose && /* @__PURE__ */ jsxs2(DialogPrimitive.Close, { className: "absolute right-4 top-4 cursor-pointer rounded-sm text-text-tertiary opacity-70 transition-opacity duration-fast hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-border-focus disabled:pointer-events-none", children: [
|
|
174
179
|
/* @__PURE__ */ jsx3(X, { className: "h-4 w-4" }),
|
|
175
180
|
/* @__PURE__ */ jsx3("span", { className: "sr-only", children: "Close" })
|
|
176
181
|
] })
|
|
@@ -231,10 +236,17 @@ var DropdownMenuTrigger = React4.forwardRef(({ variant = "bare", chevron = true,
|
|
|
231
236
|
...props,
|
|
232
237
|
...variant === "quiet" ? {
|
|
233
238
|
className: cn(
|
|
234
|
-
"inline-flex min-h-9 items-center gap-1.5 rounded-md px-2 py-1.5 text-sm hover:bg-bg-secondary focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-border-focus",
|
|
239
|
+
"inline-flex min-h-9 cursor-pointer items-center gap-1.5 rounded-md px-2 py-1.5 text-sm hover:bg-bg-secondary focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-border-focus",
|
|
235
240
|
props.className
|
|
236
241
|
)
|
|
237
|
-
} :
|
|
242
|
+
} : (
|
|
243
|
+
// A trigger the call site styles is a control the call site drew, so the cursor its own
|
|
244
|
+
// guideline asks for comes with the class list rather than from four call sites remembering
|
|
245
|
+
// it (Guidelines/Controls/What the cursor says). A trigger given no className still renders
|
|
246
|
+
// with no `class` attribute at all, which is what `bare` promises and what the test below
|
|
247
|
+
// pins — and whatever it wraps through `asChild` carries its own.
|
|
248
|
+
props.className !== void 0 ? { className: cn("cursor-pointer", props.className) } : null
|
|
249
|
+
),
|
|
238
250
|
children: variant === "quiet" ? /* @__PURE__ */ jsxs3(Fragment, { children: [
|
|
239
251
|
children,
|
|
240
252
|
chevron && /* @__PURE__ */ jsx4(ChevronDown, { className: "size-3.5 shrink-0 text-text-tertiary", "aria-hidden": true })
|
|
@@ -293,9 +305,10 @@ var DropdownMenuItem = React4.forwardRef(({ className, inset, variant = "default
|
|
|
293
305
|
className: cn(
|
|
294
306
|
"relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none transition-colors duration-fast focus:bg-bg-secondary focus:text-text-primary focus:ring-1 focus:ring-inset data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
|
|
295
307
|
inset && "pl-8",
|
|
296
|
-
// Destructive reddens — wash and label — under the pointer or the keyboard, and
|
|
297
|
-
// frame a destructive Button rests on, because a row repeated
|
|
298
|
-
// feel dangerous (Guidelines/Controls/Destructive actions).
|
|
308
|
+
// Destructive reddens — wash and label — under the pointer or the keyboard, and carries nothing
|
|
309
|
+
// at rest: it drops the frame and the wash a destructive Button rests on, because a row repeated
|
|
310
|
+
// down a menu makes the whole menu feel dangerous (Guidelines/Controls/Destructive actions).
|
|
311
|
+
// The opaque plate is a dialog's confirm alone.
|
|
299
312
|
variant === "destructive" ? "focus:bg-bg-danger-subtle focus:text-text-danger focus:ring-border-danger" : "focus:ring-border-selected",
|
|
300
313
|
className
|
|
301
314
|
),
|
|
@@ -479,7 +492,7 @@ import { cva as cva2 } from "class-variance-authority";
|
|
|
479
492
|
import { Check as Check2 } from "lucide-react";
|
|
480
493
|
import { jsx as jsx8, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
481
494
|
var optionCardVariants = cva2(
|
|
482
|
-
"flex w-full items-center gap-3 rounded-lg border border-border-default p-3 text-left transition-colors duration-fast hover:bg-bg
|
|
495
|
+
"flex w-full cursor-pointer items-center gap-3 rounded-lg border border-border-default p-3 text-left transition-colors duration-fast hover:bg-[var(--hov-bg)] focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-border-focus",
|
|
483
496
|
{
|
|
484
497
|
variants: {
|
|
485
498
|
selected: {
|
|
@@ -523,7 +536,7 @@ var Medallion = React9.forwardRef(
|
|
|
523
536
|
"aria-hidden": true,
|
|
524
537
|
className: cn(
|
|
525
538
|
"inline-flex size-12 shrink-0 items-center justify-center rounded-full border border-border-subtle",
|
|
526
|
-
filled ? "border-transparent bg-text-primary text-text-inverse" : "bg-bg-
|
|
539
|
+
filled ? "border-transparent bg-text-primary text-text-inverse" : "bg-bg-overlay text-text-secondary",
|
|
527
540
|
className
|
|
528
541
|
),
|
|
529
542
|
...props,
|
|
@@ -535,11 +548,12 @@ Medallion.displayName = "Medallion";
|
|
|
535
548
|
|
|
536
549
|
// src/components/page-header.tsx
|
|
537
550
|
import { jsx as jsx10, jsxs as jsxs6 } from "react/jsx-runtime";
|
|
538
|
-
function PageHeader({ title, subtitle, icon: Icon, media, badge, actions, id }) {
|
|
539
|
-
|
|
551
|
+
function PageHeader({ title, subtitle, icon: Icon, media, badge, actions, size = "page", id }) {
|
|
552
|
+
const compact = size === "compact";
|
|
553
|
+
if (Icon && !subtitle && !media && !compact && process.env.NODE_ENV !== "production") {
|
|
540
554
|
console.warn("PageHeader: `icon` needs a `subtitle` to render the medallion; medallion dropped.");
|
|
541
555
|
}
|
|
542
|
-
const leading = media ?? (Icon && subtitle ? /* @__PURE__ */ jsx10(Medallion, { icon: Icon, "data-slot": "page-header-medallion" }) : null);
|
|
556
|
+
const leading = media ?? (Icon && subtitle && !compact ? /* @__PURE__ */ jsx10(Medallion, { icon: Icon, "data-slot": "page-header-medallion" }) : null);
|
|
543
557
|
const heading = /* @__PURE__ */ jsx10("h2", { id, className: "text-lg font-semibold text-text-primary", children: title });
|
|
544
558
|
return /* @__PURE__ */ jsxs6("div", { className: "flex min-h-9 items-center gap-3", children: [
|
|
545
559
|
leading,
|
|
@@ -548,7 +562,7 @@ function PageHeader({ title, subtitle, icon: Icon, media, badge, actions, id })
|
|
|
548
562
|
heading,
|
|
549
563
|
badge
|
|
550
564
|
] }),
|
|
551
|
-
subtitle && /* @__PURE__ */ jsx10("p", { className: "text-sm text-text-secondary", children: subtitle })
|
|
565
|
+
subtitle && !compact && /* @__PURE__ */ jsx10("p", { className: "text-sm text-text-secondary", children: subtitle })
|
|
552
566
|
] }),
|
|
553
567
|
actions && /* @__PURE__ */ jsx10("div", { className: "ml-auto shrink-0", children: actions })
|
|
554
568
|
] });
|
|
@@ -653,8 +667,9 @@ function Select({
|
|
|
653
667
|
|
|
654
668
|
// src/components/setting-row.tsx
|
|
655
669
|
import * as React10 from "react";
|
|
670
|
+
import { Lock } from "lucide-react";
|
|
656
671
|
import { jsx as jsx13, jsxs as jsxs9 } from "react/jsx-runtime";
|
|
657
|
-
var SettingRow = React10.forwardRef(function SettingRow2({ icon: Icon, label, description, labelTone = "primary", htmlFor, children, className, ...props }, ref) {
|
|
672
|
+
var SettingRow = React10.forwardRef(function SettingRow2({ icon: Icon, label, description, labelTone = "primary", locked, htmlFor, children, className, ...props }, ref) {
|
|
658
673
|
const Label5 = htmlFor ? "label" : "span";
|
|
659
674
|
const quiet = labelTone === "secondary";
|
|
660
675
|
return /* @__PURE__ */ jsxs9(
|
|
@@ -694,7 +709,10 @@ var SettingRow = React10.forwardRef(function SettingRow2({ icon: Icon, label, de
|
|
|
694
709
|
description && /* @__PURE__ */ jsx13("span", { className: "block text-xs text-text-tertiary", children: description })
|
|
695
710
|
] })
|
|
696
711
|
] }),
|
|
697
|
-
/* @__PURE__ */
|
|
712
|
+
/* @__PURE__ */ jsxs9("span", { className: "flex shrink-0 items-center gap-2", children: [
|
|
713
|
+
locked && /* @__PURE__ */ jsx13(Lock, { className: "size-3.5 text-text-tertiary", "aria-hidden": "true" }),
|
|
714
|
+
children
|
|
715
|
+
] })
|
|
698
716
|
]
|
|
699
717
|
}
|
|
700
718
|
);
|
|
@@ -724,7 +742,7 @@ function Switch({
|
|
|
724
742
|
"data-testid": testId,
|
|
725
743
|
disabled,
|
|
726
744
|
onClick: () => onCheckedChange(!checked),
|
|
727
|
-
className: `relative inline-flex h-6 w-10 shrink-0
|
|
745
|
+
className: `relative inline-flex h-6 w-10 shrink-0 rounded-full transition-colors duration-fast outline-none focus-visible:ring-2 focus-visible:ring-border-focus focus-visible:ring-offset-2 focus-visible:ring-offset-bg-surface ${checked ? "bg-text-brand" : "bg-bg-surface"} ${disabled ? "cursor-not-allowed opacity-50" : "cursor-pointer"} ${className}`,
|
|
728
746
|
children: [
|
|
729
747
|
/* @__PURE__ */ jsx14(
|
|
730
748
|
"span",
|
|
@@ -764,7 +782,7 @@ var Checkbox = React11.forwardRef(({ className, ...props }, ref) => /* @__PURE__
|
|
|
764
782
|
// A field takes the field border (`Guidelines/Look/Borders`, #417). No hover step and no
|
|
765
783
|
// filled step: a 16px box's hover reading is the label beside it, and "answered" is already
|
|
766
784
|
// the checked mark, which paints the whole box.
|
|
767
|
-
"peer size-4 shrink-0 rounded-sm border border-field-border focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-border-focus disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-blue-400 data-[state=checked]:text-text-on-brand data-[state=checked]:border-blue-400",
|
|
785
|
+
"peer size-4 shrink-0 cursor-pointer rounded-sm border border-field-border focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-border-focus disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-blue-400 data-[state=checked]:text-text-on-brand data-[state=checked]:border-blue-400",
|
|
768
786
|
className
|
|
769
787
|
),
|
|
770
788
|
...props,
|
|
@@ -786,7 +804,7 @@ var RadioGroupItem = React12.forwardRef(({ className, ...props }, ref) => /* @__
|
|
|
786
804
|
ref,
|
|
787
805
|
className: cn(
|
|
788
806
|
// The same field edge a `Checkbox` takes, and for the same reasons (#417).
|
|
789
|
-
"aspect-square size-4 rounded-full border border-field-border text-blue-400 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-border-focus disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:border-blue-400",
|
|
807
|
+
"aspect-square size-4 cursor-pointer rounded-full border border-field-border text-blue-400 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-border-focus disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:border-blue-400",
|
|
790
808
|
className
|
|
791
809
|
),
|
|
792
810
|
...props,
|
|
@@ -825,7 +843,7 @@ var Slider = React14.forwardRef(({ className, ...props }, ref) => {
|
|
|
825
843
|
SliderPrimitive.Root,
|
|
826
844
|
{
|
|
827
845
|
ref,
|
|
828
|
-
className: cn("relative flex w-full touch-none select-none items-center", className),
|
|
846
|
+
className: cn("relative flex w-full cursor-pointer touch-none select-none items-center", className),
|
|
829
847
|
...props,
|
|
830
848
|
children: [
|
|
831
849
|
/* @__PURE__ */ jsx18(SliderPrimitive.Track, { className: "relative h-1.5 w-full grow overflow-hidden rounded-full bg-bg-secondary", children: /* @__PURE__ */ jsx18(SliderPrimitive.Range, { className: "absolute h-full bg-blue-400" }) }),
|
|
@@ -848,7 +866,7 @@ import * as TogglePrimitive from "@radix-ui/react-toggle";
|
|
|
848
866
|
import { cva as cva3 } from "class-variance-authority";
|
|
849
867
|
import { jsx as jsx19 } from "react/jsx-runtime";
|
|
850
868
|
var toggleVariants = cva3(
|
|
851
|
-
"inline-flex items-center justify-center gap-2 rounded-md text-sm font-medium data-[state=on]:font-semibold text-text-secondary transition-colors duration-fast focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-border-focus disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",
|
|
869
|
+
"inline-flex cursor-pointer items-center justify-center gap-2 rounded-md text-sm font-medium data-[state=on]:font-semibold text-text-secondary transition-colors duration-fast focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-border-focus disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",
|
|
852
870
|
{
|
|
853
871
|
variants: {
|
|
854
872
|
/**
|
|
@@ -1518,11 +1536,11 @@ var badgeVariants = cva4(
|
|
|
1518
1536
|
default: "border-transparent bg-blue-400 text-text-on-brand",
|
|
1519
1537
|
secondary: "border-transparent bg-bg-secondary text-text-primary",
|
|
1520
1538
|
outline: "border-border-default text-text-primary",
|
|
1521
|
-
status: "border-
|
|
1539
|
+
status: "border-border-subtle bg-bg-overlay text-text-primary",
|
|
1522
1540
|
destructive: "border-transparent bg-bg-danger text-text-on-danger",
|
|
1523
1541
|
"danger-subtle": "border-transparent bg-bg-danger-subtle text-text-danger",
|
|
1524
1542
|
"warning-subtle": "border-transparent bg-bg-warning-subtle text-text-warning",
|
|
1525
|
-
"neutral-subtle": "border-
|
|
1543
|
+
"neutral-subtle": "border-border-subtle bg-bg-overlay text-text-tertiary",
|
|
1526
1544
|
success: "border-transparent bg-bg-success text-text-on-success",
|
|
1527
1545
|
warning: "border-transparent bg-bg-warning text-text-on-warning"
|
|
1528
1546
|
}
|
|
@@ -1662,7 +1680,7 @@ var GLYPH_SIZE = {
|
|
|
1662
1680
|
lg: "size-6"
|
|
1663
1681
|
};
|
|
1664
1682
|
var TONE = {
|
|
1665
|
-
neutral: "bg-bg-
|
|
1683
|
+
neutral: "bg-bg-overlay text-text-secondary",
|
|
1666
1684
|
teal: "bg-bg-teal-subtle text-text-teal",
|
|
1667
1685
|
violet: "bg-bg-violet-subtle text-text-violet",
|
|
1668
1686
|
rose: "bg-bg-rose-subtle text-text-rose"
|
|
@@ -1728,12 +1746,12 @@ function GlyphAvatar({ kind, size = "sm", label }) {
|
|
|
1728
1746
|
// src/components/entity-tile.tsx
|
|
1729
1747
|
import * as React28 from "react";
|
|
1730
1748
|
import { jsx as jsx35 } from "react/jsx-runtime";
|
|
1731
|
-
function EntityTile({ name, glyph, src, size = "sm", label }) {
|
|
1732
|
-
const
|
|
1749
|
+
function EntityTile({ name, glyph, tone = "auto", src, size = "sm", label }) {
|
|
1750
|
+
const painted = tone === "auto" && !glyph && name ? tintFor(name) : "neutral";
|
|
1733
1751
|
const sizedGlyph = React28.isValidElement(glyph) ? React28.cloneElement(glyph, {
|
|
1734
1752
|
className: cn(GLYPH_SIZE[size], glyph.props.className)
|
|
1735
1753
|
}) : glyph;
|
|
1736
|
-
return /* @__PURE__ */ jsx35(Mark, { shape: "square", size, tone, src, label, children: sizedGlyph ?? (name ? initialOf(name) : null) });
|
|
1754
|
+
return /* @__PURE__ */ jsx35(Mark, { shape: "square", size, tone: painted, src, label, children: sizedGlyph ?? (name ? initialOf(name) : null) });
|
|
1737
1755
|
}
|
|
1738
1756
|
|
|
1739
1757
|
// src/components/separator.tsx
|
|
@@ -1804,7 +1822,7 @@ var TabsTrigger = React31.forwardRef(({ className, ...props }, ref) => /* @__PUR
|
|
|
1804
1822
|
{
|
|
1805
1823
|
ref,
|
|
1806
1824
|
className: cn(
|
|
1807
|
-
"inline-flex items-center justify-center whitespace-nowrap rounded-sm px-3 py-1.5 text-sm font-medium transition-all duration-fast focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-border-focus disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-bg-sunken data-[state=active]:font-semibold data-[state=active]:text-text-primary",
|
|
1825
|
+
"inline-flex cursor-pointer items-center justify-center whitespace-nowrap rounded-sm px-3 py-1.5 text-sm font-medium transition-all duration-fast focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-border-focus disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-bg-sunken data-[state=active]:font-semibold data-[state=active]:text-text-primary",
|
|
1808
1826
|
className
|
|
1809
1827
|
),
|
|
1810
1828
|
...props
|
|
@@ -1844,7 +1862,7 @@ var AccordionTrigger = React32.forwardRef(({ className, children, ...props }, re
|
|
|
1844
1862
|
{
|
|
1845
1863
|
ref,
|
|
1846
1864
|
className: cn(
|
|
1847
|
-
"flex flex-1 items-center justify-between py-4 text-sm font-medium transition-all duration-fast hover:underline [&[data-state=open]>svg]:rotate-180",
|
|
1865
|
+
"flex flex-1 cursor-pointer items-center justify-between py-4 text-sm font-medium transition-all duration-fast hover:underline [&[data-state=open]>svg]:rotate-180",
|
|
1848
1866
|
className
|
|
1849
1867
|
),
|
|
1850
1868
|
...props,
|
|
@@ -1887,61 +1905,26 @@ var CollapsibleContent2 = React33.forwardRef(({ className, ...props }, ref) => /
|
|
|
1887
1905
|
));
|
|
1888
1906
|
CollapsibleContent2.displayName = CollapsiblePrimitive.CollapsibleContent.displayName;
|
|
1889
1907
|
|
|
1890
|
-
// src/components/scroll-area.tsx
|
|
1891
|
-
import * as React34 from "react";
|
|
1892
|
-
import * as ScrollAreaPrimitive from "@radix-ui/react-scroll-area";
|
|
1893
|
-
import { jsx as jsx41, jsxs as jsxs20 } from "react/jsx-runtime";
|
|
1894
|
-
var ScrollArea = React34.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsxs20(
|
|
1895
|
-
ScrollAreaPrimitive.Root,
|
|
1896
|
-
{
|
|
1897
|
-
ref,
|
|
1898
|
-
className: cn("relative overflow-hidden", className),
|
|
1899
|
-
...props,
|
|
1900
|
-
children: [
|
|
1901
|
-
/* @__PURE__ */ jsx41(ScrollAreaPrimitive.Viewport, { className: "h-full w-full rounded-[inherit]", children }),
|
|
1902
|
-
/* @__PURE__ */ jsx41(ScrollBar, {}),
|
|
1903
|
-
/* @__PURE__ */ jsx41(ScrollAreaPrimitive.Corner, {})
|
|
1904
|
-
]
|
|
1905
|
-
}
|
|
1906
|
-
));
|
|
1907
|
-
ScrollArea.displayName = ScrollAreaPrimitive.Root.displayName;
|
|
1908
|
-
var ScrollBar = React34.forwardRef(({ className, orientation = "vertical", ...props }, ref) => /* @__PURE__ */ jsx41(
|
|
1909
|
-
ScrollAreaPrimitive.ScrollAreaScrollbar,
|
|
1910
|
-
{
|
|
1911
|
-
ref,
|
|
1912
|
-
orientation,
|
|
1913
|
-
className: cn(
|
|
1914
|
-
"flex touch-none select-none transition-colors duration-fast",
|
|
1915
|
-
orientation === "vertical" && "h-full w-2.5 border-l border-l-transparent p-[1px]",
|
|
1916
|
-
orientation === "horizontal" && "h-2.5 flex-col border-t border-t-transparent p-[1px]",
|
|
1917
|
-
className
|
|
1918
|
-
),
|
|
1919
|
-
...props,
|
|
1920
|
-
children: /* @__PURE__ */ jsx41(ScrollAreaPrimitive.ScrollAreaThumb, { className: "relative flex-1 rounded-full bg-border-selected" })
|
|
1921
|
-
}
|
|
1922
|
-
));
|
|
1923
|
-
ScrollBar.displayName = ScrollAreaPrimitive.ScrollAreaScrollbar.displayName;
|
|
1924
|
-
|
|
1925
1908
|
// src/components/alert.tsx
|
|
1926
|
-
import * as
|
|
1909
|
+
import * as React34 from "react";
|
|
1927
1910
|
import { cva as cva5 } from "class-variance-authority";
|
|
1928
|
-
import { jsx as
|
|
1911
|
+
import { jsx as jsx41, jsxs as jsxs20 } from "react/jsx-runtime";
|
|
1929
1912
|
var alertVariants = cva5(
|
|
1930
|
-
"relative w-full rounded-lg border p-4 [&>svg~*]:pl-7 [&>svg+div]:translate-y-[-3px] [&>svg]:absolute [&>svg]:left-4 [&>svg]:top-4",
|
|
1913
|
+
"relative w-full rounded-lg border p-4 [&>svg~*]:pl-7 [&>svg+div]:translate-y-[-3px] [&>svg]:absolute [&>svg]:left-4 [&>svg]:top-4 [&>svg]:size-4",
|
|
1931
1914
|
{
|
|
1932
1915
|
variants: {
|
|
1933
1916
|
variant: {
|
|
1934
|
-
default: "bg-bg-elevated border-border-
|
|
1935
|
-
destructive: "bg-bg-danger border-border-danger text-text-
|
|
1936
|
-
success: "bg-bg-success border-border-success text-text-
|
|
1937
|
-
warning: "bg-bg-warning border-border-warning text-text-
|
|
1917
|
+
default: "bg-bg-elevated border-border-default text-text-primary [&>svg]:text-text-secondary",
|
|
1918
|
+
destructive: "bg-bg-danger-subtle border-border-danger text-text-primary [&>svg]:text-text-danger",
|
|
1919
|
+
success: "bg-bg-success-subtle border-border-success text-text-primary [&>svg]:text-text-success",
|
|
1920
|
+
warning: "bg-bg-warning-subtle border-border-warning text-text-primary [&>svg]:text-text-warning"
|
|
1938
1921
|
}
|
|
1939
1922
|
},
|
|
1940
1923
|
defaultVariants: { variant: "default" }
|
|
1941
1924
|
}
|
|
1942
1925
|
);
|
|
1943
|
-
var Alert =
|
|
1944
|
-
({ className, variant, value, action, children, ...props }, ref) => /* @__PURE__ */
|
|
1926
|
+
var Alert = React34.forwardRef(
|
|
1927
|
+
({ className, variant, value, action, children, ...props }, ref) => /* @__PURE__ */ jsxs20(
|
|
1945
1928
|
"div",
|
|
1946
1929
|
{
|
|
1947
1930
|
ref,
|
|
@@ -1950,43 +1933,43 @@ var Alert = React35.forwardRef(
|
|
|
1950
1933
|
...props,
|
|
1951
1934
|
children: [
|
|
1952
1935
|
children,
|
|
1953
|
-
(value !== void 0 || action !== void 0) && /* @__PURE__ */
|
|
1954
|
-
value !== void 0 && /* @__PURE__ */
|
|
1955
|
-
action !== void 0 && /* @__PURE__ */
|
|
1936
|
+
(value !== void 0 || action !== void 0) && /* @__PURE__ */ jsxs20("div", { className: "mt-2 flex items-center gap-2", children: [
|
|
1937
|
+
value !== void 0 && /* @__PURE__ */ jsx41("code", { className: "min-w-0 flex-1 truncate font-mono text-sm font-medium", children: value }),
|
|
1938
|
+
action !== void 0 && /* @__PURE__ */ jsx41("span", { className: "flex shrink-0 items-center gap-2", children: action })
|
|
1956
1939
|
] })
|
|
1957
1940
|
]
|
|
1958
1941
|
}
|
|
1959
1942
|
)
|
|
1960
1943
|
);
|
|
1961
1944
|
Alert.displayName = "Alert";
|
|
1962
|
-
var AlertTitle =
|
|
1945
|
+
var AlertTitle = React34.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx41(
|
|
1963
1946
|
"h5",
|
|
1964
1947
|
{
|
|
1965
1948
|
ref,
|
|
1966
|
-
className: cn("mb-1 font-
|
|
1949
|
+
className: cn("mb-1 text-sm font-semibold leading-none tracking-tight", className),
|
|
1967
1950
|
...props
|
|
1968
1951
|
}
|
|
1969
1952
|
));
|
|
1970
1953
|
AlertTitle.displayName = "AlertTitle";
|
|
1971
|
-
var AlertDescription =
|
|
1954
|
+
var AlertDescription = React34.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx41(
|
|
1972
1955
|
"div",
|
|
1973
1956
|
{
|
|
1974
1957
|
ref,
|
|
1975
|
-
className: cn("text-sm [&_p]:leading-relaxed", className),
|
|
1958
|
+
className: cn("text-sm text-text-secondary [&_p]:leading-relaxed", className),
|
|
1976
1959
|
...props
|
|
1977
1960
|
}
|
|
1978
1961
|
));
|
|
1979
1962
|
AlertDescription.displayName = "AlertDescription";
|
|
1980
1963
|
|
|
1981
1964
|
// src/components/breadcrumb.tsx
|
|
1982
|
-
import * as
|
|
1965
|
+
import * as React35 from "react";
|
|
1983
1966
|
import { Slot } from "@radix-ui/react-slot";
|
|
1984
1967
|
import { ChevronRight as ChevronRight4, MoreHorizontal } from "lucide-react";
|
|
1985
|
-
import { jsx as
|
|
1986
|
-
var Breadcrumb =
|
|
1968
|
+
import { jsx as jsx42, jsxs as jsxs21 } from "react/jsx-runtime";
|
|
1969
|
+
var Breadcrumb = React35.forwardRef(({ ...props }, ref) => /* @__PURE__ */ jsx42("nav", { ref, "aria-label": "breadcrumb", ...props }));
|
|
1987
1970
|
Breadcrumb.displayName = "Breadcrumb";
|
|
1988
|
-
var BreadcrumbList =
|
|
1989
|
-
({ className, ...props }, ref) => /* @__PURE__ */
|
|
1971
|
+
var BreadcrumbList = React35.forwardRef(
|
|
1972
|
+
({ className, ...props }, ref) => /* @__PURE__ */ jsx42(
|
|
1990
1973
|
"ol",
|
|
1991
1974
|
{
|
|
1992
1975
|
ref,
|
|
@@ -1999,13 +1982,13 @@ var BreadcrumbList = React36.forwardRef(
|
|
|
1999
1982
|
)
|
|
2000
1983
|
);
|
|
2001
1984
|
BreadcrumbList.displayName = "BreadcrumbList";
|
|
2002
|
-
var BreadcrumbItem =
|
|
2003
|
-
({ className, ...props }, ref) => /* @__PURE__ */
|
|
1985
|
+
var BreadcrumbItem = React35.forwardRef(
|
|
1986
|
+
({ className, ...props }, ref) => /* @__PURE__ */ jsx42("li", { ref, className: cn("inline-flex items-center gap-1.5", className), ...props })
|
|
2004
1987
|
);
|
|
2005
1988
|
BreadcrumbItem.displayName = "BreadcrumbItem";
|
|
2006
|
-
var BreadcrumbLink =
|
|
1989
|
+
var BreadcrumbLink = React35.forwardRef(({ asChild, className, ...props }, ref) => {
|
|
2007
1990
|
const Comp = asChild ? Slot : "a";
|
|
2008
|
-
return /* @__PURE__ */
|
|
1991
|
+
return /* @__PURE__ */ jsx42(
|
|
2009
1992
|
Comp,
|
|
2010
1993
|
{
|
|
2011
1994
|
ref,
|
|
@@ -2015,8 +1998,8 @@ var BreadcrumbLink = React36.forwardRef(({ asChild, className, ...props }, ref)
|
|
|
2015
1998
|
);
|
|
2016
1999
|
});
|
|
2017
2000
|
BreadcrumbLink.displayName = "BreadcrumbLink";
|
|
2018
|
-
var BreadcrumbPage =
|
|
2019
|
-
({ className, ...props }, ref) => /* @__PURE__ */
|
|
2001
|
+
var BreadcrumbPage = React35.forwardRef(
|
|
2002
|
+
({ className, ...props }, ref) => /* @__PURE__ */ jsx42(
|
|
2020
2003
|
"span",
|
|
2021
2004
|
{
|
|
2022
2005
|
ref,
|
|
@@ -2033,18 +2016,18 @@ var BreadcrumbSeparator = ({
|
|
|
2033
2016
|
children,
|
|
2034
2017
|
className,
|
|
2035
2018
|
...props
|
|
2036
|
-
}) => /* @__PURE__ */
|
|
2019
|
+
}) => /* @__PURE__ */ jsx42(
|
|
2037
2020
|
"li",
|
|
2038
2021
|
{
|
|
2039
2022
|
role: "presentation",
|
|
2040
2023
|
"aria-hidden": "true",
|
|
2041
2024
|
className: cn("[&>svg]:h-4 [&>svg]:w-4", className),
|
|
2042
2025
|
...props,
|
|
2043
|
-
children: children ?? /* @__PURE__ */
|
|
2026
|
+
children: children ?? /* @__PURE__ */ jsx42(ChevronRight4, {})
|
|
2044
2027
|
}
|
|
2045
2028
|
);
|
|
2046
2029
|
BreadcrumbSeparator.displayName = "BreadcrumbSeparator";
|
|
2047
|
-
var BreadcrumbEllipsis = ({ className, ...props }) => /* @__PURE__ */
|
|
2030
|
+
var BreadcrumbEllipsis = ({ className, ...props }) => /* @__PURE__ */ jsxs21(
|
|
2048
2031
|
"span",
|
|
2049
2032
|
{
|
|
2050
2033
|
role: "presentation",
|
|
@@ -2052,18 +2035,18 @@ var BreadcrumbEllipsis = ({ className, ...props }) => /* @__PURE__ */ jsxs22(
|
|
|
2052
2035
|
className: cn("flex h-9 w-9 items-center justify-center", className),
|
|
2053
2036
|
...props,
|
|
2054
2037
|
children: [
|
|
2055
|
-
/* @__PURE__ */
|
|
2056
|
-
/* @__PURE__ */
|
|
2038
|
+
/* @__PURE__ */ jsx42(MoreHorizontal, { className: "h-4 w-4" }),
|
|
2039
|
+
/* @__PURE__ */ jsx42("span", { className: "sr-only", children: "More" })
|
|
2057
2040
|
]
|
|
2058
2041
|
}
|
|
2059
2042
|
);
|
|
2060
2043
|
BreadcrumbEllipsis.displayName = "BreadcrumbEllipsis";
|
|
2061
2044
|
|
|
2062
2045
|
// src/components/pagination.tsx
|
|
2063
|
-
import * as
|
|
2046
|
+
import * as React36 from "react";
|
|
2064
2047
|
import { ChevronLeft, ChevronRight as ChevronRight5, MoreHorizontal as MoreHorizontal2 } from "lucide-react";
|
|
2065
|
-
import { jsx as
|
|
2066
|
-
var Pagination = ({ className, ...props }) => /* @__PURE__ */
|
|
2048
|
+
import { jsx as jsx43, jsxs as jsxs22 } from "react/jsx-runtime";
|
|
2049
|
+
var Pagination = ({ className, ...props }) => /* @__PURE__ */ jsx43(
|
|
2067
2050
|
"nav",
|
|
2068
2051
|
{
|
|
2069
2052
|
role: "navigation",
|
|
@@ -2073,15 +2056,15 @@ var Pagination = ({ className, ...props }) => /* @__PURE__ */ jsx44(
|
|
|
2073
2056
|
}
|
|
2074
2057
|
);
|
|
2075
2058
|
Pagination.displayName = "Pagination";
|
|
2076
|
-
var PaginationContent =
|
|
2077
|
-
({ className, ...props }, ref) => /* @__PURE__ */
|
|
2059
|
+
var PaginationContent = React36.forwardRef(
|
|
2060
|
+
({ className, ...props }, ref) => /* @__PURE__ */ jsx43("ul", { ref, className: cn("flex flex-row items-center gap-1", className), ...props })
|
|
2078
2061
|
);
|
|
2079
2062
|
PaginationContent.displayName = "PaginationContent";
|
|
2080
|
-
var PaginationItem =
|
|
2081
|
-
({ className, ...props }, ref) => /* @__PURE__ */
|
|
2063
|
+
var PaginationItem = React36.forwardRef(
|
|
2064
|
+
({ className, ...props }, ref) => /* @__PURE__ */ jsx43("li", { ref, className: cn("", className), ...props })
|
|
2082
2065
|
);
|
|
2083
2066
|
PaginationItem.displayName = "PaginationItem";
|
|
2084
|
-
var PaginationLink = ({ className, isActive, size = "icon", ...props }) => /* @__PURE__ */
|
|
2067
|
+
var PaginationLink = ({ className, isActive, size = "icon", ...props }) => /* @__PURE__ */ jsx43(
|
|
2085
2068
|
"a",
|
|
2086
2069
|
{
|
|
2087
2070
|
"aria-current": isActive ? "page" : void 0,
|
|
@@ -2093,7 +2076,7 @@ var PaginationLink = ({ className, isActive, size = "icon", ...props }) => /* @_
|
|
|
2093
2076
|
}
|
|
2094
2077
|
);
|
|
2095
2078
|
PaginationLink.displayName = "PaginationLink";
|
|
2096
|
-
var PaginationPrevious = ({ className, ...props }) => /* @__PURE__ */
|
|
2079
|
+
var PaginationPrevious = ({ className, ...props }) => /* @__PURE__ */ jsxs22(
|
|
2097
2080
|
PaginationLink,
|
|
2098
2081
|
{
|
|
2099
2082
|
"aria-label": "Go to previous page",
|
|
@@ -2101,13 +2084,13 @@ var PaginationPrevious = ({ className, ...props }) => /* @__PURE__ */ jsxs23(
|
|
|
2101
2084
|
className: cn("gap-1 pl-2.5", className),
|
|
2102
2085
|
...props,
|
|
2103
2086
|
children: [
|
|
2104
|
-
/* @__PURE__ */
|
|
2105
|
-
/* @__PURE__ */
|
|
2087
|
+
/* @__PURE__ */ jsx43(ChevronLeft, { className: "h-4 w-4" }),
|
|
2088
|
+
/* @__PURE__ */ jsx43("span", { children: "Previous" })
|
|
2106
2089
|
]
|
|
2107
2090
|
}
|
|
2108
2091
|
);
|
|
2109
2092
|
PaginationPrevious.displayName = "PaginationPrevious";
|
|
2110
|
-
var PaginationNext = ({ className, ...props }) => /* @__PURE__ */
|
|
2093
|
+
var PaginationNext = ({ className, ...props }) => /* @__PURE__ */ jsxs22(
|
|
2111
2094
|
PaginationLink,
|
|
2112
2095
|
{
|
|
2113
2096
|
"aria-label": "Go to next page",
|
|
@@ -2115,32 +2098,32 @@ var PaginationNext = ({ className, ...props }) => /* @__PURE__ */ jsxs23(
|
|
|
2115
2098
|
className: cn("gap-1 pr-2.5", className),
|
|
2116
2099
|
...props,
|
|
2117
2100
|
children: [
|
|
2118
|
-
/* @__PURE__ */
|
|
2119
|
-
/* @__PURE__ */
|
|
2101
|
+
/* @__PURE__ */ jsx43("span", { children: "Next" }),
|
|
2102
|
+
/* @__PURE__ */ jsx43(ChevronRight5, { className: "h-4 w-4" })
|
|
2120
2103
|
]
|
|
2121
2104
|
}
|
|
2122
2105
|
);
|
|
2123
2106
|
PaginationNext.displayName = "PaginationNext";
|
|
2124
|
-
var PaginationEllipsis = ({ className, ...props }) => /* @__PURE__ */
|
|
2107
|
+
var PaginationEllipsis = ({ className, ...props }) => /* @__PURE__ */ jsxs22(
|
|
2125
2108
|
"span",
|
|
2126
2109
|
{
|
|
2127
2110
|
"aria-hidden": true,
|
|
2128
2111
|
className: cn("flex h-9 w-9 items-center justify-center", className),
|
|
2129
2112
|
...props,
|
|
2130
2113
|
children: [
|
|
2131
|
-
/* @__PURE__ */
|
|
2132
|
-
/* @__PURE__ */
|
|
2114
|
+
/* @__PURE__ */ jsx43(MoreHorizontal2, { className: "h-4 w-4" }),
|
|
2115
|
+
/* @__PURE__ */ jsx43("span", { className: "sr-only", children: "More pages" })
|
|
2133
2116
|
]
|
|
2134
2117
|
}
|
|
2135
2118
|
);
|
|
2136
2119
|
PaginationEllipsis.displayName = "PaginationEllipsis";
|
|
2137
2120
|
|
|
2138
2121
|
// src/components/command.tsx
|
|
2139
|
-
import * as
|
|
2140
|
-
import { Command as CommandPrimitive } from "cmdk";
|
|
2122
|
+
import * as React37 from "react";
|
|
2123
|
+
import { Command as CommandPrimitive, useCommandState } from "cmdk";
|
|
2141
2124
|
import { Search } from "lucide-react";
|
|
2142
|
-
import { jsx as
|
|
2143
|
-
var Command =
|
|
2125
|
+
import { Fragment as Fragment2, jsx as jsx44, jsxs as jsxs23 } from "react/jsx-runtime";
|
|
2126
|
+
var Command = React37.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx44(
|
|
2144
2127
|
CommandPrimitive,
|
|
2145
2128
|
{
|
|
2146
2129
|
ref,
|
|
@@ -2152,10 +2135,61 @@ var Command = React38.forwardRef(({ className, ...props }, ref) => /* @__PURE__
|
|
|
2152
2135
|
}
|
|
2153
2136
|
));
|
|
2154
2137
|
Command.displayName = CommandPrimitive.displayName;
|
|
2155
|
-
var
|
|
2156
|
-
var
|
|
2157
|
-
/* @__PURE__ */
|
|
2158
|
-
|
|
2138
|
+
var KeyCap = ({ children }) => /* @__PURE__ */ jsx44("kbd", { className: "inline-flex h-5 min-w-5 items-center justify-center rounded-sm border border-border-default bg-bg-elevated px-1 font-sans text-xs text-text-secondary", children });
|
|
2139
|
+
var CommandKeyHints = () => /* @__PURE__ */ jsx44("div", { className: "flex items-center gap-4 border-t border-border-subtle bg-bg-sunken px-3 py-2 text-xs text-text-tertiary", children: [[["\u2191", "\u2193"], "to navigate"], [["\u21B5"], "to select"]].map(([keys, verb]) => /* @__PURE__ */ jsxs23("span", { className: "flex items-center gap-1.5", children: [
|
|
2140
|
+
/* @__PURE__ */ jsx44("span", { className: "flex items-center gap-1", children: keys.map((key) => /* @__PURE__ */ jsx44(KeyCap, { children: key }, key)) }),
|
|
2141
|
+
" ",
|
|
2142
|
+
verb
|
|
2143
|
+
] }, verb)) });
|
|
2144
|
+
var CommandKeyHintsSlot = ({ children }) => {
|
|
2145
|
+
const count = useCommandState((state) => state.filtered.count);
|
|
2146
|
+
return count > 0 ? /* @__PURE__ */ jsx44(Fragment2, { children }) : null;
|
|
2147
|
+
};
|
|
2148
|
+
var CommandDialog = ({
|
|
2149
|
+
children,
|
|
2150
|
+
groups,
|
|
2151
|
+
placeholder,
|
|
2152
|
+
empty,
|
|
2153
|
+
keyHints = /* @__PURE__ */ jsx44(CommandKeyHints, {}),
|
|
2154
|
+
shortcut = false,
|
|
2155
|
+
open,
|
|
2156
|
+
onOpenChange,
|
|
2157
|
+
...props
|
|
2158
|
+
}) => {
|
|
2159
|
+
React37.useEffect(() => {
|
|
2160
|
+
if (!shortcut || !onOpenChange) return;
|
|
2161
|
+
const onKey = (e) => {
|
|
2162
|
+
if (e.key === "k" && (e.metaKey || e.ctrlKey)) {
|
|
2163
|
+
e.preventDefault();
|
|
2164
|
+
onOpenChange(!open);
|
|
2165
|
+
}
|
|
2166
|
+
};
|
|
2167
|
+
document.addEventListener("keydown", onKey);
|
|
2168
|
+
return () => document.removeEventListener("keydown", onKey);
|
|
2169
|
+
}, [shortcut, open, onOpenChange]);
|
|
2170
|
+
return /* @__PURE__ */ jsx44(Dialog, { open, onOpenChange, ...props, children: /* @__PURE__ */ jsx44(DialogContent, { className: "overflow-hidden p-0", children: /* @__PURE__ */ jsx44(Command, { className: "[&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-text-tertiary [&_[cmdk-group]]:px-2 [&_[cmdk-input-wrapper]_svg]:h-5 [&_[cmdk-input-wrapper]_svg]:w-5 [&_[cmdk-item]]:px-2 [&_[cmdk-item]]:py-3 [&_[cmdk-item]_svg]:h-5 [&_[cmdk-item]_svg]:w-5", children: groups ? /* @__PURE__ */ jsxs23(Fragment2, { children: [
|
|
2171
|
+
/* @__PURE__ */ jsx44(CommandInput, { placeholder }),
|
|
2172
|
+
/* @__PURE__ */ jsxs23(CommandList, { className: "max-h-[420px]", children: [
|
|
2173
|
+
/* @__PURE__ */ jsx44(CommandEmpty, { children: empty }),
|
|
2174
|
+
groups.map((group) => /* @__PURE__ */ jsx44(CommandGroup, { heading: group.heading, children: group.items.map((item) => /* @__PURE__ */ jsx44(
|
|
2175
|
+
CommandItem,
|
|
2176
|
+
{
|
|
2177
|
+
value: item.value ?? [group.heading, item.sub, item.label].filter(Boolean).join(" "),
|
|
2178
|
+
mark: item.mark,
|
|
2179
|
+
sub: item.sub,
|
|
2180
|
+
className: item.sub ? void 0 : "items-center",
|
|
2181
|
+
onSelect: item.onSelect,
|
|
2182
|
+
children: item.label
|
|
2183
|
+
},
|
|
2184
|
+
item.id ?? `${group.heading}:${String(item.label)}`
|
|
2185
|
+
)) }, group.heading))
|
|
2186
|
+
] }),
|
|
2187
|
+
/* @__PURE__ */ jsx44(CommandKeyHintsSlot, { children: keyHints })
|
|
2188
|
+
] }) : children }) }) });
|
|
2189
|
+
};
|
|
2190
|
+
var CommandInput = React37.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxs23("div", { className: "flex items-center border-b border-border-subtle px-3", "cmdk-input-wrapper": "", children: [
|
|
2191
|
+
/* @__PURE__ */ jsx44(Search, { className: "mr-2 h-4 w-4 shrink-0 opacity-50" }),
|
|
2192
|
+
/* @__PURE__ */ jsx44(
|
|
2159
2193
|
CommandPrimitive.Input,
|
|
2160
2194
|
{
|
|
2161
2195
|
ref,
|
|
@@ -2168,16 +2202,16 @@ var CommandInput = React38.forwardRef(({ className, ...props }, ref) => /* @__PU
|
|
|
2168
2202
|
)
|
|
2169
2203
|
] }));
|
|
2170
2204
|
CommandInput.displayName = CommandPrimitive.Input.displayName;
|
|
2171
|
-
var CommandList =
|
|
2205
|
+
var CommandList = React37.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx44(
|
|
2172
2206
|
CommandPrimitive.List,
|
|
2173
2207
|
{
|
|
2174
2208
|
ref,
|
|
2175
|
-
className: cn("max-h-[300px] overflow-y-auto overflow-x-hidden", className),
|
|
2209
|
+
className: cn("max-h-[300px] overflow-y-auto overflow-x-hidden pb-2", className),
|
|
2176
2210
|
...props
|
|
2177
2211
|
}
|
|
2178
2212
|
));
|
|
2179
2213
|
CommandList.displayName = CommandPrimitive.List.displayName;
|
|
2180
|
-
var CommandEmpty =
|
|
2214
|
+
var CommandEmpty = React37.forwardRef((props, ref) => /* @__PURE__ */ jsx44(
|
|
2181
2215
|
CommandPrimitive.Empty,
|
|
2182
2216
|
{
|
|
2183
2217
|
ref,
|
|
@@ -2186,7 +2220,7 @@ var CommandEmpty = React38.forwardRef((props, ref) => /* @__PURE__ */ jsx45(
|
|
|
2186
2220
|
}
|
|
2187
2221
|
));
|
|
2188
2222
|
CommandEmpty.displayName = CommandPrimitive.Empty.displayName;
|
|
2189
|
-
var CommandGroup =
|
|
2223
|
+
var CommandGroup = React37.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx44(
|
|
2190
2224
|
CommandPrimitive.Group,
|
|
2191
2225
|
{
|
|
2192
2226
|
ref,
|
|
@@ -2198,7 +2232,7 @@ var CommandGroup = React38.forwardRef(({ className, ...props }, ref) => /* @__PU
|
|
|
2198
2232
|
}
|
|
2199
2233
|
));
|
|
2200
2234
|
CommandGroup.displayName = CommandPrimitive.Group.displayName;
|
|
2201
|
-
var CommandSeparator =
|
|
2235
|
+
var CommandSeparator = React37.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx44(
|
|
2202
2236
|
CommandPrimitive.Separator,
|
|
2203
2237
|
{
|
|
2204
2238
|
ref,
|
|
@@ -2207,29 +2241,29 @@ var CommandSeparator = React38.forwardRef(({ className, ...props }, ref) => /* @
|
|
|
2207
2241
|
}
|
|
2208
2242
|
));
|
|
2209
2243
|
CommandSeparator.displayName = CommandPrimitive.Separator.displayName;
|
|
2210
|
-
var CommandItem =
|
|
2211
|
-
({ className, mark, sub, children, ...props }, ref) => /* @__PURE__ */
|
|
2244
|
+
var CommandItem = React37.forwardRef(
|
|
2245
|
+
({ className, mark, sub, children, ...props }, ref) => /* @__PURE__ */ jsxs23(
|
|
2212
2246
|
CommandPrimitive.Item,
|
|
2213
2247
|
{
|
|
2214
2248
|
ref,
|
|
2215
2249
|
className: cn(
|
|
2216
|
-
"relative flex cursor-default select-none gap-2 rounded-sm px-2 py-1.5 text-sm outline-none data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50 data-[selected=true]:bg-bg
|
|
2250
|
+
"relative flex cursor-default select-none gap-2 rounded-sm px-2 py-1.5 text-sm outline-none data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50 data-[selected=true]:bg-[var(--hov-bg)] data-[selected=true]:text-text-primary",
|
|
2217
2251
|
mark ? "items-start" : "items-center",
|
|
2218
2252
|
className
|
|
2219
2253
|
),
|
|
2220
2254
|
...props,
|
|
2221
2255
|
children: [
|
|
2222
|
-
mark ? /* @__PURE__ */
|
|
2223
|
-
sub ? /* @__PURE__ */
|
|
2224
|
-
/* @__PURE__ */
|
|
2225
|
-
/* @__PURE__ */
|
|
2256
|
+
mark ? /* @__PURE__ */ jsx44("span", { className: "shrink-0", children: mark }) : null,
|
|
2257
|
+
sub ? /* @__PURE__ */ jsxs23("span", { className: "flex min-w-0 flex-col", children: [
|
|
2258
|
+
/* @__PURE__ */ jsx44("span", { className: "truncate", children }),
|
|
2259
|
+
/* @__PURE__ */ jsx44("span", { className: "truncate text-xs text-text-tertiary", children: sub })
|
|
2226
2260
|
] }) : children
|
|
2227
2261
|
]
|
|
2228
2262
|
}
|
|
2229
2263
|
)
|
|
2230
2264
|
);
|
|
2231
2265
|
CommandItem.displayName = CommandPrimitive.Item.displayName;
|
|
2232
|
-
var CommandShortcut = ({ className, ...props }) => /* @__PURE__ */
|
|
2266
|
+
var CommandShortcut = ({ className, ...props }) => /* @__PURE__ */ jsx44(
|
|
2233
2267
|
"span",
|
|
2234
2268
|
{
|
|
2235
2269
|
className: cn("ml-auto text-xs tracking-widest text-text-tertiary", className),
|
|
@@ -2239,12 +2273,12 @@ var CommandShortcut = ({ className, ...props }) => /* @__PURE__ */ jsx45(
|
|
|
2239
2273
|
CommandShortcut.displayName = "CommandShortcut";
|
|
2240
2274
|
|
|
2241
2275
|
// src/components/navigation-menu.tsx
|
|
2242
|
-
import * as
|
|
2276
|
+
import * as React38 from "react";
|
|
2243
2277
|
import * as NavigationMenuPrimitive from "@radix-ui/react-navigation-menu";
|
|
2244
2278
|
import { cva as cva6 } from "class-variance-authority";
|
|
2245
2279
|
import { ChevronDown as ChevronDown4 } from "lucide-react";
|
|
2246
|
-
import { jsx as
|
|
2247
|
-
var NavigationMenu =
|
|
2280
|
+
import { jsx as jsx45, jsxs as jsxs24 } from "react/jsx-runtime";
|
|
2281
|
+
var NavigationMenu = React38.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsxs24(
|
|
2248
2282
|
NavigationMenuPrimitive.Root,
|
|
2249
2283
|
{
|
|
2250
2284
|
ref,
|
|
@@ -2252,12 +2286,12 @@ var NavigationMenu = React39.forwardRef(({ className, children, ...props }, ref)
|
|
|
2252
2286
|
...props,
|
|
2253
2287
|
children: [
|
|
2254
2288
|
children,
|
|
2255
|
-
/* @__PURE__ */
|
|
2289
|
+
/* @__PURE__ */ jsx45(NavigationMenuViewport, {})
|
|
2256
2290
|
]
|
|
2257
2291
|
}
|
|
2258
2292
|
));
|
|
2259
2293
|
NavigationMenu.displayName = NavigationMenuPrimitive.Root.displayName;
|
|
2260
|
-
var NavigationMenuList =
|
|
2294
|
+
var NavigationMenuList = React38.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx45(
|
|
2261
2295
|
NavigationMenuPrimitive.List,
|
|
2262
2296
|
{
|
|
2263
2297
|
ref,
|
|
@@ -2268,9 +2302,9 @@ var NavigationMenuList = React39.forwardRef(({ className, ...props }, ref) => /*
|
|
|
2268
2302
|
NavigationMenuList.displayName = NavigationMenuPrimitive.List.displayName;
|
|
2269
2303
|
var NavigationMenuItem = NavigationMenuPrimitive.Item;
|
|
2270
2304
|
var navigationMenuTriggerStyle = cva6(
|
|
2271
|
-
"group inline-flex h-10 w-max items-center justify-center rounded-md bg-bg-elevated px-4 py-2 text-sm font-medium transition-colors duration-fast hover:bg-bg-secondary hover:text-text-primary focus:bg-bg-secondary focus:outline-none disabled:pointer-events-none disabled:opacity-50 data-[state=open]:bg-bg-secondary"
|
|
2305
|
+
"group inline-flex h-10 w-max cursor-pointer items-center justify-center rounded-md bg-bg-elevated px-4 py-2 text-sm font-medium transition-colors duration-fast hover:bg-bg-secondary hover:text-text-primary focus:bg-bg-secondary focus:outline-none disabled:pointer-events-none disabled:opacity-50 data-[state=open]:bg-bg-secondary"
|
|
2272
2306
|
);
|
|
2273
|
-
var NavigationMenuTrigger =
|
|
2307
|
+
var NavigationMenuTrigger = React38.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsxs24(
|
|
2274
2308
|
NavigationMenuPrimitive.Trigger,
|
|
2275
2309
|
{
|
|
2276
2310
|
ref,
|
|
@@ -2279,7 +2313,7 @@ var NavigationMenuTrigger = React39.forwardRef(({ className, children, ...props
|
|
|
2279
2313
|
children: [
|
|
2280
2314
|
children,
|
|
2281
2315
|
" ",
|
|
2282
|
-
/* @__PURE__ */
|
|
2316
|
+
/* @__PURE__ */ jsx45(
|
|
2283
2317
|
ChevronDown4,
|
|
2284
2318
|
{
|
|
2285
2319
|
className: "relative top-[1px] ml-1 h-4 w-4 transition duration-200 group-data-[state=open]:rotate-180",
|
|
@@ -2290,7 +2324,7 @@ var NavigationMenuTrigger = React39.forwardRef(({ className, children, ...props
|
|
|
2290
2324
|
}
|
|
2291
2325
|
));
|
|
2292
2326
|
NavigationMenuTrigger.displayName = NavigationMenuPrimitive.Trigger.displayName;
|
|
2293
|
-
var NavigationMenuContent =
|
|
2327
|
+
var NavigationMenuContent = React38.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx45(
|
|
2294
2328
|
NavigationMenuPrimitive.Content,
|
|
2295
2329
|
{
|
|
2296
2330
|
ref,
|
|
@@ -2303,7 +2337,7 @@ var NavigationMenuContent = React39.forwardRef(({ className, ...props }, ref) =>
|
|
|
2303
2337
|
));
|
|
2304
2338
|
NavigationMenuContent.displayName = NavigationMenuPrimitive.Content.displayName;
|
|
2305
2339
|
var NavigationMenuLink = NavigationMenuPrimitive.Link;
|
|
2306
|
-
var NavigationMenuViewport =
|
|
2340
|
+
var NavigationMenuViewport = React38.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx45("div", { className: cn("absolute left-0 top-full flex justify-center"), children: /* @__PURE__ */ jsx45(
|
|
2307
2341
|
NavigationMenuPrimitive.Viewport,
|
|
2308
2342
|
{
|
|
2309
2343
|
ref,
|
|
@@ -2315,7 +2349,7 @@ var NavigationMenuViewport = React39.forwardRef(({ className, ...props }, ref) =
|
|
|
2315
2349
|
}
|
|
2316
2350
|
) }));
|
|
2317
2351
|
NavigationMenuViewport.displayName = NavigationMenuPrimitive.Viewport.displayName;
|
|
2318
|
-
var NavigationMenuIndicator =
|
|
2352
|
+
var NavigationMenuIndicator = React38.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx45(
|
|
2319
2353
|
NavigationMenuPrimitive.Indicator,
|
|
2320
2354
|
{
|
|
2321
2355
|
ref,
|
|
@@ -2324,13 +2358,13 @@ var NavigationMenuIndicator = React39.forwardRef(({ className, ...props }, ref)
|
|
|
2324
2358
|
className
|
|
2325
2359
|
),
|
|
2326
2360
|
...props,
|
|
2327
|
-
children: /* @__PURE__ */
|
|
2361
|
+
children: /* @__PURE__ */ jsx45("div", { className: "relative top-[60%] h-2 w-2 rotate-45 rounded-tl-sm bg-border-subtle shadow-md" })
|
|
2328
2362
|
}
|
|
2329
2363
|
));
|
|
2330
2364
|
NavigationMenuIndicator.displayName = NavigationMenuPrimitive.Indicator.displayName;
|
|
2331
2365
|
|
|
2332
2366
|
// src/hooks/useTheme.ts
|
|
2333
|
-
import { useEffect as
|
|
2367
|
+
import { useEffect as useEffect3, useState as useState2, useCallback } from "react";
|
|
2334
2368
|
var STORAGE_KEY = "lessly_theme";
|
|
2335
2369
|
var THEMES = ["light", "dark", "system"];
|
|
2336
2370
|
function parseStoredTheme(stored) {
|
|
@@ -2364,10 +2398,10 @@ function useTheme() {
|
|
|
2364
2398
|
applyTheme(resolveTheme(newTheme));
|
|
2365
2399
|
window.dispatchEvent(new CustomEvent("lessly-theme-change", { detail: newTheme }));
|
|
2366
2400
|
}, []);
|
|
2367
|
-
|
|
2401
|
+
useEffect3(() => {
|
|
2368
2402
|
applyTheme(resolvedTheme);
|
|
2369
2403
|
}, [resolvedTheme]);
|
|
2370
|
-
|
|
2404
|
+
useEffect3(() => {
|
|
2371
2405
|
const handler = (e) => {
|
|
2372
2406
|
const newTheme = e.detail;
|
|
2373
2407
|
setThemeState(newTheme);
|
|
@@ -2375,7 +2409,7 @@ function useTheme() {
|
|
|
2375
2409
|
window.addEventListener("lessly-theme-change", handler);
|
|
2376
2410
|
return () => window.removeEventListener("lessly-theme-change", handler);
|
|
2377
2411
|
}, []);
|
|
2378
|
-
|
|
2412
|
+
useEffect3(() => {
|
|
2379
2413
|
if (theme !== "system") return;
|
|
2380
2414
|
const mql = window.matchMedia("(prefers-color-scheme: light)");
|
|
2381
2415
|
const handler = () => applyTheme(getSystemTheme());
|
|
@@ -2387,10 +2421,10 @@ function useTheme() {
|
|
|
2387
2421
|
|
|
2388
2422
|
// src/components/sonner.tsx
|
|
2389
2423
|
import { Toaster as SonnerToaster, toast } from "sonner";
|
|
2390
|
-
import { jsx as
|
|
2424
|
+
import { jsx as jsx46 } from "react/jsx-runtime";
|
|
2391
2425
|
var Toaster = ({ ...props }) => {
|
|
2392
2426
|
const { resolvedTheme } = useTheme();
|
|
2393
|
-
return /* @__PURE__ */
|
|
2427
|
+
return /* @__PURE__ */ jsx46(
|
|
2394
2428
|
SonnerToaster,
|
|
2395
2429
|
{
|
|
2396
2430
|
theme: resolvedTheme,
|
|
@@ -2410,6 +2444,20 @@ var Toaster = ({ ...props }) => {
|
|
|
2410
2444
|
|
|
2411
2445
|
// src/components/theme-toggle.tsx
|
|
2412
2446
|
import { Sun, Moon } from "lucide-react";
|
|
2447
|
+
|
|
2448
|
+
// src/components/top-bar-utilities.tsx
|
|
2449
|
+
import * as React39 from "react";
|
|
2450
|
+
import { jsx as jsx47, jsxs as jsxs25 } from "react/jsx-runtime";
|
|
2451
|
+
var topBarMarkClass = "relative flex size-8 shrink-0 cursor-pointer items-center justify-center rounded-lg text-text-secondary transition-colors duration-fast hover:bg-[var(--hov-bg)] hover:text-text-primary focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-border-focus [&>svg]:size-[18px]";
|
|
2452
|
+
var TopBarUtilities = React39.forwardRef(
|
|
2453
|
+
({ items, className, ...props }, ref) => /* @__PURE__ */ jsx47("div", { ref, className: cn("flex items-center gap-1", className), ...props, children: items.map(({ name, icon, onClick }) => /* @__PURE__ */ jsxs25(Tooltip, { children: [
|
|
2454
|
+
/* @__PURE__ */ jsx47(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsx47("button", { type: "button", className: topBarMarkClass, "aria-label": name, onClick, children: icon }) }),
|
|
2455
|
+
/* @__PURE__ */ jsx47(TooltipContent, { children: name })
|
|
2456
|
+
] }, name)) })
|
|
2457
|
+
);
|
|
2458
|
+
TopBarUtilities.displayName = "TopBarUtilities";
|
|
2459
|
+
|
|
2460
|
+
// src/components/theme-toggle.tsx
|
|
2413
2461
|
import { jsx as jsx48 } from "react/jsx-runtime";
|
|
2414
2462
|
var icons = {
|
|
2415
2463
|
light: Sun,
|
|
@@ -2423,11 +2471,12 @@ function ThemeToggle() {
|
|
|
2423
2471
|
return /* @__PURE__ */ jsx48(
|
|
2424
2472
|
"button",
|
|
2425
2473
|
{
|
|
2474
|
+
type: "button",
|
|
2426
2475
|
onClick: () => setTheme(next),
|
|
2427
|
-
className:
|
|
2476
|
+
className: topBarMarkClass,
|
|
2428
2477
|
"aria-label": label,
|
|
2429
2478
|
title: label,
|
|
2430
|
-
children: /* @__PURE__ */ jsx48(Icon, {
|
|
2479
|
+
children: /* @__PURE__ */ jsx48(Icon, {})
|
|
2431
2480
|
}
|
|
2432
2481
|
);
|
|
2433
2482
|
}
|
|
@@ -3016,7 +3065,7 @@ var toneFromDirection = {
|
|
|
3016
3065
|
neutral: "neutral"
|
|
3017
3066
|
};
|
|
3018
3067
|
var StatCard = React48.forwardRef(
|
|
3019
|
-
({ label, value, delta, hint, sub, icon: Icon, className, ...props }, ref) => {
|
|
3068
|
+
({ label, value, delta, hint, sub, icon: Icon, trend, className, ...props }, ref) => {
|
|
3020
3069
|
const direction = delta?.direction ?? "neutral";
|
|
3021
3070
|
const tone = delta?.tone ?? toneFromDirection[direction];
|
|
3022
3071
|
const DeltaIcon = directionIcons[direction];
|
|
@@ -3025,14 +3074,15 @@ var StatCard = React48.forwardRef(
|
|
|
3025
3074
|
"div",
|
|
3026
3075
|
{
|
|
3027
3076
|
ref,
|
|
3028
|
-
|
|
3077
|
+
"data-slot": "stat-card",
|
|
3078
|
+
className: cn("rounded-xl border border-border-subtle bg-bg-overlay p-5", className),
|
|
3029
3079
|
...props,
|
|
3030
3080
|
children: [
|
|
3031
3081
|
/* @__PURE__ */ jsxs33("div", { className: "flex items-center justify-between gap-2", children: [
|
|
3032
3082
|
/* @__PURE__ */ jsxs33("div", { className: "flex items-center gap-1.5", children: [
|
|
3033
3083
|
/* @__PURE__ */ jsx58("span", { className: "text-xs font-medium text-text-tertiary", children: label }),
|
|
3034
3084
|
hint && /* @__PURE__ */ jsx58(TooltipProvider, { children: /* @__PURE__ */ jsxs33(Tooltip, { children: [
|
|
3035
|
-
/* @__PURE__ */ jsx58(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsx58("button", { type: "button", "aria-label": "More info", className: "inline-flex cursor-
|
|
3085
|
+
/* @__PURE__ */ jsx58(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsx58("button", { type: "button", "aria-label": "More info", className: "inline-flex cursor-pointer text-icon-secondary focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-border-focus rounded-sm", children: /* @__PURE__ */ jsx58(Info2, { className: "size-3.5", "aria-hidden": "true" }) }) }),
|
|
3036
3086
|
/* @__PURE__ */ jsx58(TooltipContent, { children: hint })
|
|
3037
3087
|
] }) })
|
|
3038
3088
|
] }),
|
|
@@ -3045,7 +3095,8 @@ var StatCard = React48.forwardRef(
|
|
|
3045
3095
|
delta.value
|
|
3046
3096
|
] }),
|
|
3047
3097
|
sub && /* @__PURE__ */ jsx58("span", { className: "text-text-tertiary", children: sub })
|
|
3048
|
-
] })
|
|
3098
|
+
] }),
|
|
3099
|
+
trend !== void 0 && /* @__PURE__ */ jsx58("div", { "data-slot": "stat-card-trend", className: "mt-3 min-h-10", children: trend })
|
|
3049
3100
|
]
|
|
3050
3101
|
}
|
|
3051
3102
|
);
|
|
@@ -3063,7 +3114,7 @@ import { Fingerprint, Loader2 } from "lucide-react";
|
|
|
3063
3114
|
import { jsx as jsx59, jsxs as jsxs34 } from "react/jsx-runtime";
|
|
3064
3115
|
var DEFAULT_METHODS = ["passkey", "code"];
|
|
3065
3116
|
var ATTEMPT_GAP_MS = 500;
|
|
3066
|
-
var FACTOR_SWITCH = "w-fit rounded-sm text-sm text-text-secondary underline-offset-2 hover:text-text-primary hover:underline focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-border-focus disabled:pointer-events-none disabled:opacity-50";
|
|
3117
|
+
var FACTOR_SWITCH = "w-fit cursor-pointer rounded-sm text-sm text-text-secondary underline-offset-2 hover:text-text-primary hover:underline focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-border-focus disabled:pointer-events-none disabled:opacity-50";
|
|
3067
3118
|
var StepUpChallenge = React49.forwardRef((props, ref) => {
|
|
3068
3119
|
const {
|
|
3069
3120
|
methods,
|
|
@@ -3359,24 +3410,31 @@ function ConfirmDialog({
|
|
|
3359
3410
|
}
|
|
3360
3411
|
|
|
3361
3412
|
// src/components/user-menu.tsx
|
|
3413
|
+
import * as React51 from "react";
|
|
3362
3414
|
import { ChevronsUpDown } from "lucide-react";
|
|
3363
|
-
import { Fragment as
|
|
3364
|
-
function UserMenu({ user, items, collapsed = false, align = "start" }) {
|
|
3415
|
+
import { Fragment as Fragment3, jsx as jsx61, jsxs as jsxs36 } from "react/jsx-runtime";
|
|
3416
|
+
function UserMenu({ user, items, collapsed = false, tooltip = true, align = "start" }) {
|
|
3417
|
+
const openedByPointer = React51.useRef(false);
|
|
3365
3418
|
const secondLine = user.subtitle ?? user.email;
|
|
3366
3419
|
const avatar = /* @__PURE__ */ jsx61(PersonAvatar, { name: user.name, id: user.id, src: user.avatarUrl, size: "sm" });
|
|
3367
|
-
const trigger = collapsed ?
|
|
3368
|
-
|
|
3369
|
-
|
|
3370
|
-
|
|
3371
|
-
|
|
3372
|
-
|
|
3373
|
-
|
|
3374
|
-
|
|
3420
|
+
const trigger = collapsed ? (
|
|
3421
|
+
// The plate every other mark in a top bar gets, drawn outside the avatar instead of behind it:
|
|
3422
|
+
// a round mark fills its own box, so a background under one is a background nobody sees, and
|
|
3423
|
+
// this trigger rested with no hover at all beside four icon buttons that all had one.
|
|
3424
|
+
/* @__PURE__ */ jsx61(
|
|
3425
|
+
"button",
|
|
3426
|
+
{
|
|
3427
|
+
type: "button",
|
|
3428
|
+
"aria-label": user.name,
|
|
3429
|
+
className: "cursor-pointer rounded-full ring-0 ring-bg-secondary transition-[box-shadow] duration-fast hover:ring-4 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-border-focus",
|
|
3430
|
+
children: avatar
|
|
3431
|
+
}
|
|
3432
|
+
)
|
|
3375
3433
|
) : /* @__PURE__ */ jsxs36(
|
|
3376
3434
|
"button",
|
|
3377
3435
|
{
|
|
3378
3436
|
type: "button",
|
|
3379
|
-
className: "flex w-full items-center gap-2.5 rounded-xl px-1.5 py-[5px] text-left transition-colors duration-fast hover:bg-[var(--hov-bg)] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-border-focus",
|
|
3437
|
+
className: "flex w-full cursor-pointer items-center gap-2.5 rounded-xl px-1.5 py-[5px] text-left transition-colors duration-fast hover:bg-[var(--hov-bg)] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-border-focus",
|
|
3380
3438
|
children: [
|
|
3381
3439
|
avatar,
|
|
3382
3440
|
/* @__PURE__ */ jsxs36("span", { className: "flex min-w-0 flex-1 flex-col gap-0.5", children: [
|
|
@@ -3387,9 +3445,21 @@ function UserMenu({ user, items, collapsed = false, align = "start" }) {
|
|
|
3387
3445
|
]
|
|
3388
3446
|
}
|
|
3389
3447
|
);
|
|
3390
|
-
const menuTrigger = /* @__PURE__ */ jsx61(
|
|
3448
|
+
const menuTrigger = /* @__PURE__ */ jsx61(
|
|
3449
|
+
DropdownMenuTrigger,
|
|
3450
|
+
{
|
|
3451
|
+
asChild: true,
|
|
3452
|
+
onPointerDown: () => {
|
|
3453
|
+
openedByPointer.current = true;
|
|
3454
|
+
},
|
|
3455
|
+
onKeyDown: () => {
|
|
3456
|
+
openedByPointer.current = false;
|
|
3457
|
+
},
|
|
3458
|
+
children: trigger
|
|
3459
|
+
}
|
|
3460
|
+
);
|
|
3391
3461
|
const menu = /* @__PURE__ */ jsxs36(DropdownMenu, { children: [
|
|
3392
|
-
collapsed ? /* @__PURE__ */ jsx61(TooltipProvider, { children: /* @__PURE__ */ jsxs36(Tooltip, { children: [
|
|
3462
|
+
collapsed && tooltip ? /* @__PURE__ */ jsx61(TooltipProvider, { children: /* @__PURE__ */ jsxs36(Tooltip, { children: [
|
|
3393
3463
|
/* @__PURE__ */ jsx61(TooltipTrigger, { asChild: true, children: menuTrigger }),
|
|
3394
3464
|
/* @__PURE__ */ jsx61(TooltipContent, { side: "right", children: user.name })
|
|
3395
3465
|
] }) }) : menuTrigger,
|
|
@@ -3398,6 +3468,9 @@ function UserMenu({ user, items, collapsed = false, align = "start" }) {
|
|
|
3398
3468
|
{
|
|
3399
3469
|
align,
|
|
3400
3470
|
sideOffset: 6,
|
|
3471
|
+
onCloseAutoFocus: (e) => {
|
|
3472
|
+
if (openedByPointer.current) e.preventDefault();
|
|
3473
|
+
},
|
|
3401
3474
|
className: "flex w-[var(--radix-dropdown-menu-trigger-width)] min-w-56 flex-col gap-px rounded-xl border-border-subtle bg-[var(--menu-bg)] p-1 shadow-(--menu-shadow)",
|
|
3402
3475
|
children: [
|
|
3403
3476
|
/* @__PURE__ */ jsxs36(DropdownMenuLabel, { className: "px-2 pt-1.5 pb-1 text-xs font-medium text-text-tertiary", children: [
|
|
@@ -3407,7 +3480,7 @@ function UserMenu({ user, items, collapsed = false, align = "start" }) {
|
|
|
3407
3480
|
/* @__PURE__ */ jsx61(DropdownMenuSeparator, { className: "mx-0 shrink-0" }),
|
|
3408
3481
|
items.map((item, i) => {
|
|
3409
3482
|
const Icon = item.icon;
|
|
3410
|
-
const content = /* @__PURE__ */ jsxs36(
|
|
3483
|
+
const content = /* @__PURE__ */ jsxs36(Fragment3, { children: [
|
|
3411
3484
|
Icon && /* @__PURE__ */ jsx61(Icon, { className: "size-4", "aria-hidden": "true" }),
|
|
3412
3485
|
item.label
|
|
3413
3486
|
] });
|
|
@@ -3433,7 +3506,7 @@ function UserMenu({ user, items, collapsed = false, align = "start" }) {
|
|
|
3433
3506
|
}
|
|
3434
3507
|
|
|
3435
3508
|
// src/components/extension-icon.tsx
|
|
3436
|
-
import * as
|
|
3509
|
+
import * as React52 from "react";
|
|
3437
3510
|
import * as LucideIcons from "lucide-react";
|
|
3438
3511
|
import { Puzzle } from "lucide-react";
|
|
3439
3512
|
import { jsx as jsx62 } from "react/jsx-runtime";
|
|
@@ -3461,7 +3534,7 @@ function warnUnknownIconOnce(name) {
|
|
|
3461
3534
|
warnedUnknownIcons.add(name);
|
|
3462
3535
|
console.warn(`[@lessly/ui] ExtensionIcon: unknown icon "${name}" \u2014 falling back to Puzzle.`);
|
|
3463
3536
|
}
|
|
3464
|
-
var ExtensionIcon =
|
|
3537
|
+
var ExtensionIcon = React52.forwardRef(
|
|
3465
3538
|
({ name, ...props }, ref) => {
|
|
3466
3539
|
const Icon = resolveIcon(name);
|
|
3467
3540
|
if (!Icon) {
|
|
@@ -3474,9 +3547,9 @@ var ExtensionIcon = React51.forwardRef(
|
|
|
3474
3547
|
ExtensionIcon.displayName = "ExtensionIcon";
|
|
3475
3548
|
|
|
3476
3549
|
// src/components/icon-hint.tsx
|
|
3477
|
-
import * as
|
|
3550
|
+
import * as React53 from "react";
|
|
3478
3551
|
import { jsx as jsx63, jsxs as jsxs37 } from "react/jsx-runtime";
|
|
3479
|
-
var IconHint =
|
|
3552
|
+
var IconHint = React53.forwardRef(
|
|
3480
3553
|
({ children, label, side = "top", align = "center", className, ...props }, ref) => {
|
|
3481
3554
|
if (label.trim().length === 0) {
|
|
3482
3555
|
if (process.env.NODE_ENV !== "production") {
|
|
@@ -3523,9 +3596,9 @@ var IconHint = React52.forwardRef(
|
|
|
3523
3596
|
IconHint.displayName = "IconHint";
|
|
3524
3597
|
|
|
3525
3598
|
// src/components/decorative-icon.tsx
|
|
3526
|
-
import * as
|
|
3599
|
+
import * as React54 from "react";
|
|
3527
3600
|
import { jsx as jsx64, jsxs as jsxs38 } from "react/jsx-runtime";
|
|
3528
|
-
var DecorativeIcon =
|
|
3601
|
+
var DecorativeIcon = React54.forwardRef(
|
|
3529
3602
|
({ children, label, side = "top", align = "center", className, ...props }, ref) => {
|
|
3530
3603
|
if (label.trim().length === 0) {
|
|
3531
3604
|
if (process.env.NODE_ENV !== "production") {
|
|
@@ -3571,8 +3644,8 @@ var DecorativeIcon = React53.forwardRef(
|
|
|
3571
3644
|
DecorativeIcon.displayName = "DecorativeIcon";
|
|
3572
3645
|
|
|
3573
3646
|
// src/components/image-cropper.tsx
|
|
3574
|
-
import * as
|
|
3575
|
-
import { Fragment as
|
|
3647
|
+
import * as React55 from "react";
|
|
3648
|
+
import { Fragment as Fragment4, jsx as jsx65, jsxs as jsxs39 } from "react/jsx-runtime";
|
|
3576
3649
|
var FALLBACK_STAGE_W = 360;
|
|
3577
3650
|
var FALLBACK_STAGE_H = 270;
|
|
3578
3651
|
var STEP = 8;
|
|
@@ -3605,7 +3678,7 @@ var MASK_CLASS = {
|
|
|
3605
3678
|
circle: "rounded-full"
|
|
3606
3679
|
};
|
|
3607
3680
|
var clampTo = (value, min, max) => Math.min(Math.max(value, min), max);
|
|
3608
|
-
var ImageCropper =
|
|
3681
|
+
var ImageCropper = React55.forwardRef(
|
|
3609
3682
|
({
|
|
3610
3683
|
src,
|
|
3611
3684
|
shape = "square",
|
|
@@ -3625,21 +3698,21 @@ var ImageCropper = React54.forwardRef(
|
|
|
3625
3698
|
className,
|
|
3626
3699
|
...props
|
|
3627
3700
|
}, ref) => {
|
|
3628
|
-
const [nat, setNat] =
|
|
3629
|
-
const [error, setError] =
|
|
3630
|
-
const [focused, setFocused] =
|
|
3631
|
-
const [stage, setStage] =
|
|
3632
|
-
const [crop, setCrop] =
|
|
3633
|
-
const imgRef =
|
|
3634
|
-
const stageRef =
|
|
3635
|
-
const framed =
|
|
3636
|
-
const inset =
|
|
3637
|
-
|
|
3701
|
+
const [nat, setNat] = React55.useState(null);
|
|
3702
|
+
const [error, setError] = React55.useState(null);
|
|
3703
|
+
const [focused, setFocused] = React55.useState(false);
|
|
3704
|
+
const [stage, setStage] = React55.useState({ w: FALLBACK_STAGE_W, h: FALLBACK_STAGE_H });
|
|
3705
|
+
const [crop, setCrop] = React55.useState({ x: 0, y: 0, size: 0 });
|
|
3706
|
+
const imgRef = React55.useRef(null);
|
|
3707
|
+
const stageRef = React55.useRef(null);
|
|
3708
|
+
const framed = React55.useRef(false);
|
|
3709
|
+
const inset = React55.useRef({ left: 0, top: 0 });
|
|
3710
|
+
React55.useEffect(() => {
|
|
3638
3711
|
framed.current = false;
|
|
3639
3712
|
setNat(null);
|
|
3640
3713
|
setError(null);
|
|
3641
3714
|
}, [src]);
|
|
3642
|
-
|
|
3715
|
+
React55.useLayoutEffect(() => {
|
|
3643
3716
|
const el = stageRef.current;
|
|
3644
3717
|
if (!el) return void 0;
|
|
3645
3718
|
const read = (entry) => {
|
|
@@ -3665,13 +3738,13 @@ var ImageCropper = React54.forwardRef(
|
|
|
3665
3738
|
const drawH = nat ? nat.h * fit : stage.h;
|
|
3666
3739
|
const padX = (stage.w - drawW) / 2;
|
|
3667
3740
|
const padY = (stage.h - drawH) / 2;
|
|
3668
|
-
|
|
3741
|
+
React55.useEffect(() => {
|
|
3669
3742
|
if (!nat || framed.current) return;
|
|
3670
3743
|
framed.current = true;
|
|
3671
3744
|
const size = Math.min(nat.w, nat.h);
|
|
3672
3745
|
setCrop({ x: (nat.w - size) / 2, y: (nat.h - size) / 2, size });
|
|
3673
3746
|
}, [nat]);
|
|
3674
|
-
const clampCrop =
|
|
3747
|
+
const clampCrop = React55.useCallback(
|
|
3675
3748
|
(x, y, size) => {
|
|
3676
3749
|
if (!nat) return { x, y, size };
|
|
3677
3750
|
const max = Math.min(nat.w, nat.h);
|
|
@@ -3681,8 +3754,8 @@ var ImageCropper = React54.forwardRef(
|
|
|
3681
3754
|
},
|
|
3682
3755
|
[nat, fit, minCropSize]
|
|
3683
3756
|
);
|
|
3684
|
-
const moving =
|
|
3685
|
-
const resizing =
|
|
3757
|
+
const moving = React55.useRef(null);
|
|
3758
|
+
const resizing = React55.useRef(null);
|
|
3686
3759
|
const onMoveDown = (e) => {
|
|
3687
3760
|
e.target.setPointerCapture(e.pointerId);
|
|
3688
3761
|
moving.current = { px: e.clientX, py: e.clientY, cx: crop.x, cy: crop.y };
|
|
@@ -3831,7 +3904,7 @@ var ImageCropper = React54.forwardRef(
|
|
|
3831
3904
|
children: errorMessage
|
|
3832
3905
|
}
|
|
3833
3906
|
),
|
|
3834
|
-
nat && error !== "load" && /* @__PURE__ */ jsxs39(
|
|
3907
|
+
nat && error !== "load" && /* @__PURE__ */ jsxs39(Fragment4, { children: [
|
|
3835
3908
|
/* @__PURE__ */ jsx65(
|
|
3836
3909
|
"div",
|
|
3837
3910
|
{
|
|
@@ -3948,7 +4021,7 @@ function ImageCropDialog({
|
|
|
3948
4021
|
ImageCropDialog.displayName = "ImageCropDialog";
|
|
3949
4022
|
|
|
3950
4023
|
// src/components/image-upload.tsx
|
|
3951
|
-
import * as
|
|
4024
|
+
import * as React56 from "react";
|
|
3952
4025
|
import { Image as ImageIcon } from "lucide-react";
|
|
3953
4026
|
import { jsx as jsx67, jsxs as jsxs41 } from "react/jsx-runtime";
|
|
3954
4027
|
var PREVIEW_BOX = {
|
|
@@ -3965,7 +4038,7 @@ function formatSize(bytes) {
|
|
|
3965
4038
|
if (bytes >= 1024) return `${Math.floor(bytes / 1024)} KB`;
|
|
3966
4039
|
return `${bytes} B`;
|
|
3967
4040
|
}
|
|
3968
|
-
var ImageUpload =
|
|
4041
|
+
var ImageUpload = React56.forwardRef(
|
|
3969
4042
|
({
|
|
3970
4043
|
value,
|
|
3971
4044
|
onChange,
|
|
@@ -3988,11 +4061,11 @@ var ImageUpload = React55.forwardRef(
|
|
|
3988
4061
|
className,
|
|
3989
4062
|
...props
|
|
3990
4063
|
}, ref) => {
|
|
3991
|
-
const inputRef =
|
|
3992
|
-
const [picked, setPicked] =
|
|
3993
|
-
const [cropOpen, setCropOpen] =
|
|
3994
|
-
const [error, setError] =
|
|
3995
|
-
const pickSeq =
|
|
4064
|
+
const inputRef = React56.useRef(null);
|
|
4065
|
+
const [picked, setPicked] = React56.useState(null);
|
|
4066
|
+
const [cropOpen, setCropOpen] = React56.useState(false);
|
|
4067
|
+
const [error, setError] = React56.useState(null);
|
|
4068
|
+
const pickSeq = React56.useRef(0);
|
|
3996
4069
|
const refuse = (message) => {
|
|
3997
4070
|
setError(message);
|
|
3998
4071
|
onError?.(message);
|
|
@@ -4116,71 +4189,11 @@ var ImageUpload = React55.forwardRef(
|
|
|
4116
4189
|
);
|
|
4117
4190
|
ImageUpload.displayName = "ImageUpload";
|
|
4118
4191
|
|
|
4119
|
-
// src/components/entity-row.tsx
|
|
4120
|
-
import * as React56 from "react";
|
|
4121
|
-
import { Slot as Slot3 } from "@radix-ui/react-slot";
|
|
4122
|
-
import { ChevronDown as ChevronDown5, ChevronRight as ChevronRight7 } from "lucide-react";
|
|
4123
|
-
import { Fragment as Fragment4, jsx as jsx68, jsxs as jsxs42 } from "react/jsx-runtime";
|
|
4124
|
-
var rowClass = "flex w-full items-center gap-3 px-4 py-2.5 text-left";
|
|
4125
|
-
var plateClass = "relative isolate after:pointer-events-none after:absolute after:inset-x-1.5 after:inset-y-1 after:-z-10 after:rounded-lg hover:after:bg-bg-elevated disabled:hover:after:bg-transparent focus-visible:outline-none focus-visible:after:ring-2 focus-visible:after:ring-inset focus-visible:after:ring-border-focus";
|
|
4126
|
-
var stackClass = "flex-col items-stretch gap-1";
|
|
4127
|
-
var caretMotion = {
|
|
4128
|
-
transitionDuration: "var(--motion-duration-normal)",
|
|
4129
|
-
transitionTimingFunction: "var(--motion-easing-standard)"
|
|
4130
|
-
};
|
|
4131
|
-
var EntityRow = React56.forwardRef(function EntityRow2({ mark, title, badge, sub, meta, summary, opens = "page", expanded, asChild = false, className, children, ...props }, ref) {
|
|
4132
|
-
if (process.env.NODE_ENV !== "production" && opens === "disclosure" && expanded === void 0) {
|
|
4133
|
-
console.warn(
|
|
4134
|
-
'[EntityRow] `opens="disclosure"` needs `expanded`: it draws the caret AND sets `aria-expanded`, and without it the row renders a caret that never turns and states no state at all. Pass `expanded={open}`, or use `opens="page"` / `opens="modal"`.'
|
|
4135
|
-
);
|
|
4136
|
-
}
|
|
4137
|
-
const line = /* @__PURE__ */ jsxs42(Fragment4, { children: [
|
|
4138
|
-
mark,
|
|
4139
|
-
/* @__PURE__ */ jsxs42("span", { className: "min-w-0 flex-1", children: [
|
|
4140
|
-
/* @__PURE__ */ jsxs42("span", { className: "flex min-h-5 items-center gap-2", children: [
|
|
4141
|
-
/* @__PURE__ */ jsx68("span", { className: cn("truncate text-sm text-text-primary", opens !== "none" && "font-medium"), children: title }),
|
|
4142
|
-
badge != null && /* @__PURE__ */ jsx68("span", { className: "flex h-5 shrink-0 items-center", children: badge })
|
|
4143
|
-
] }),
|
|
4144
|
-
sub != null && /* @__PURE__ */ jsx68("span", { className: "block truncate text-xs text-text-secondary", children: sub })
|
|
4145
|
-
] }),
|
|
4146
|
-
meta != null && /* @__PURE__ */ jsx68("span", { className: "shrink-0 text-sm text-text-secondary", children: meta }),
|
|
4147
|
-
opens !== "none" && /* @__PURE__ */ jsxs42("span", { className: "flex size-4 shrink-0 items-center justify-center", children: [
|
|
4148
|
-
opens === "page" && /* @__PURE__ */ jsx68(ChevronRight7, { className: "size-4 text-text-tertiary", "aria-hidden": true }),
|
|
4149
|
-
opens === "disclosure" && /* @__PURE__ */ jsx68(
|
|
4150
|
-
ChevronDown5,
|
|
4151
|
-
{
|
|
4152
|
-
className: cn(
|
|
4153
|
-
"size-4 shrink-0 text-text-tertiary transition-transform",
|
|
4154
|
-
expanded ? "rotate-180" : "rotate-0"
|
|
4155
|
-
),
|
|
4156
|
-
style: caretMotion,
|
|
4157
|
-
"aria-hidden": true
|
|
4158
|
-
}
|
|
4159
|
-
)
|
|
4160
|
-
] })
|
|
4161
|
-
] });
|
|
4162
|
-
const content = summary == null ? line : /* @__PURE__ */ jsxs42(Fragment4, { children: [
|
|
4163
|
-
/* @__PURE__ */ jsx68("span", { className: "flex w-full items-center gap-3", children: line }),
|
|
4164
|
-
/* @__PURE__ */ jsx68("span", { className: "block w-full text-xs text-text-secondary", children: summary })
|
|
4165
|
-
] });
|
|
4166
|
-
const classes = cn(rowClass, opens !== "none" && plateClass, summary != null && stackClass, className);
|
|
4167
|
-
const stateProps = opens === "disclosure" ? { "aria-expanded": expanded } : void 0;
|
|
4168
|
-
if (opens === "none") {
|
|
4169
|
-
return /* @__PURE__ */ jsx68("div", { ...props, ref, className: classes, children: content });
|
|
4170
|
-
}
|
|
4171
|
-
if (asChild) {
|
|
4172
|
-
const child = React56.Children.only(children);
|
|
4173
|
-
return /* @__PURE__ */ jsx68(Slot3, { ...props, ref, className: classes, ...stateProps, children: React56.cloneElement(child, stateProps, content) });
|
|
4174
|
-
}
|
|
4175
|
-
return /* @__PURE__ */ jsx68("button", { ...props, ref, type: "button", className: classes, ...stateProps, children: content });
|
|
4176
|
-
});
|
|
4177
|
-
EntityRow.displayName = "EntityRow";
|
|
4178
|
-
|
|
4179
4192
|
// src/components/back-link.tsx
|
|
4180
4193
|
import * as React57 from "react";
|
|
4181
4194
|
import { ArrowLeft as ArrowLeft2 } from "lucide-react";
|
|
4182
4195
|
import { Slottable } from "@radix-ui/react-slot";
|
|
4183
|
-
import { jsx as
|
|
4196
|
+
import { jsx as jsx68, jsxs as jsxs42 } from "react/jsx-runtime";
|
|
4184
4197
|
var SLOTTED_GLYPH = "inline-flex shrink-0 items-center justify-center [&>svg]:size-3.5";
|
|
4185
4198
|
var BackLink = React57.forwardRef(
|
|
4186
4199
|
({ parent, asChild = false, children, className, onClick, ...props }, ref) => {
|
|
@@ -4192,23 +4205,23 @@ var BackLink = React57.forwardRef(
|
|
|
4192
4205
|
className: cn("w-fit -ml-2", className)
|
|
4193
4206
|
};
|
|
4194
4207
|
if (slotted) {
|
|
4195
|
-
return /* @__PURE__ */
|
|
4196
|
-
/* @__PURE__ */
|
|
4197
|
-
/* @__PURE__ */
|
|
4208
|
+
return /* @__PURE__ */ jsxs42(Button, { ...props, ...shell, onClick, ref, asChild: true, children: [
|
|
4209
|
+
/* @__PURE__ */ jsx68(Slottable, { children }),
|
|
4210
|
+
/* @__PURE__ */ jsx68("span", { className: SLOTTED_GLYPH, "aria-hidden": true, children: /* @__PURE__ */ jsx68(ArrowLeft2, {}) }),
|
|
4198
4211
|
parent
|
|
4199
4212
|
] });
|
|
4200
4213
|
}
|
|
4201
|
-
return /* @__PURE__ */
|
|
4214
|
+
return /* @__PURE__ */ jsx68(Button, { ...props, ...shell, onClick, ref, icon: /* @__PURE__ */ jsx68(ArrowLeft2, {}), children: parent });
|
|
4202
4215
|
}
|
|
4203
4216
|
);
|
|
4204
4217
|
BackLink.displayName = "BackLink";
|
|
4205
4218
|
|
|
4206
4219
|
// src/components/card-note.tsx
|
|
4207
4220
|
import * as React58 from "react";
|
|
4208
|
-
import { Lock } from "lucide-react";
|
|
4209
|
-
import { jsx as
|
|
4221
|
+
import { Lock as Lock2 } from "lucide-react";
|
|
4222
|
+
import { jsx as jsx69, jsxs as jsxs43 } from "react/jsx-runtime";
|
|
4210
4223
|
var CardNote = React58.forwardRef(
|
|
4211
|
-
({ className, children, ...props }, ref) => /* @__PURE__ */
|
|
4224
|
+
({ className, children, ...props }, ref) => /* @__PURE__ */ jsxs43(
|
|
4212
4225
|
"p",
|
|
4213
4226
|
{
|
|
4214
4227
|
...props,
|
|
@@ -4218,7 +4231,7 @@ var CardNote = React58.forwardRef(
|
|
|
4218
4231
|
className
|
|
4219
4232
|
),
|
|
4220
4233
|
children: [
|
|
4221
|
-
/* @__PURE__ */
|
|
4234
|
+
/* @__PURE__ */ jsx69(Lock2, { className: "mt-0.5 size-3 shrink-0", "aria-hidden": true }),
|
|
4222
4235
|
children
|
|
4223
4236
|
]
|
|
4224
4237
|
}
|
|
@@ -4229,10 +4242,10 @@ CardNote.displayName = "CardNote";
|
|
|
4229
4242
|
// src/components/remove-button.tsx
|
|
4230
4243
|
import * as React59 from "react";
|
|
4231
4244
|
import { X as X2 } from "lucide-react";
|
|
4232
|
-
import { jsx as
|
|
4245
|
+
import { jsx as jsx70, jsxs as jsxs44 } from "react/jsx-runtime";
|
|
4233
4246
|
var RemoveButton = React59.forwardRef(
|
|
4234
4247
|
({ label, size = "sm", side = "top", className, ...props }, ref) => {
|
|
4235
|
-
const button = /* @__PURE__ */
|
|
4248
|
+
const button = /* @__PURE__ */ jsx70(
|
|
4236
4249
|
Button,
|
|
4237
4250
|
{
|
|
4238
4251
|
...props,
|
|
@@ -4242,13 +4255,13 @@ var RemoveButton = React59.forwardRef(
|
|
|
4242
4255
|
"aria-describedby": void 0,
|
|
4243
4256
|
variant: "destructive-ghost",
|
|
4244
4257
|
size,
|
|
4245
|
-
icon: /* @__PURE__ */
|
|
4258
|
+
icon: /* @__PURE__ */ jsx70(X2, {}),
|
|
4246
4259
|
className: cn("shrink-0", className)
|
|
4247
4260
|
}
|
|
4248
4261
|
);
|
|
4249
|
-
return /* @__PURE__ */
|
|
4250
|
-
/* @__PURE__ */
|
|
4251
|
-
/* @__PURE__ */
|
|
4262
|
+
return /* @__PURE__ */ jsxs44(Tooltip, { children: [
|
|
4263
|
+
/* @__PURE__ */ jsx70(TooltipTrigger, { asChild: true, children: props.disabled ? /* @__PURE__ */ jsx70("span", { className: "inline-flex shrink-0", children: button }) : button }),
|
|
4264
|
+
/* @__PURE__ */ jsx70(TooltipContent, { side, "aria-hidden": true, children: label })
|
|
4252
4265
|
] });
|
|
4253
4266
|
}
|
|
4254
4267
|
);
|
|
@@ -4257,7 +4270,7 @@ RemoveButton.displayName = "RemoveButton";
|
|
|
4257
4270
|
// src/components/grant-role-picker.tsx
|
|
4258
4271
|
import * as React60 from "react";
|
|
4259
4272
|
import { Check as Check8 } from "lucide-react";
|
|
4260
|
-
import { Fragment as Fragment6, jsx as
|
|
4273
|
+
import { Fragment as Fragment6, jsx as jsx71, jsxs as jsxs45 } from "react/jsx-runtime";
|
|
4261
4274
|
var WEIGHT_TONE = {
|
|
4262
4275
|
faint: "text-text-secondary",
|
|
4263
4276
|
normal: "text-text-primary",
|
|
@@ -4294,15 +4307,15 @@ var GrantRolePicker = React60.forwardRef(
|
|
|
4294
4307
|
const rungs = !readOnly && !carried && pickable.length > 0;
|
|
4295
4308
|
const removeWords = grantRemoveLabel(void 0, notInForce !== void 0);
|
|
4296
4309
|
const valueNote = !current ? notes?.missing : rungs && !pickable.some((r) => r.id === value) ? notes?.aboveCap : void 0;
|
|
4297
|
-
const item = (r) => /* @__PURE__ */
|
|
4298
|
-
/* @__PURE__ */
|
|
4299
|
-
/* @__PURE__ */
|
|
4300
|
-
/* @__PURE__ */
|
|
4301
|
-
r.hint && /* @__PURE__ */
|
|
4310
|
+
const item = (r) => /* @__PURE__ */ jsxs45(DropdownMenuItem, { onSelect: () => onChange(r.id), className: "items-start gap-2 py-1.5", children: [
|
|
4311
|
+
/* @__PURE__ */ jsx71(Check8, { className: cn("mt-0.5 size-3.5 shrink-0 text-text-primary", r.id !== value && "invisible") }),
|
|
4312
|
+
/* @__PURE__ */ jsxs45("span", { className: "flex flex-col", children: [
|
|
4313
|
+
/* @__PURE__ */ jsx71("span", { className: cn("text-sm", WEIGHT_TONE[r.weight ?? "normal"]), children: r.name }),
|
|
4314
|
+
r.hint && /* @__PURE__ */ jsx71("span", { className: "text-xs text-text-tertiary", children: r.hint })
|
|
4302
4315
|
] })
|
|
4303
4316
|
] }, r.id);
|
|
4304
|
-
return /* @__PURE__ */
|
|
4305
|
-
/* @__PURE__ */
|
|
4317
|
+
return /* @__PURE__ */ jsxs45(DropdownMenu, { children: [
|
|
4318
|
+
/* @__PURE__ */ jsx71(
|
|
4306
4319
|
DropdownMenuTrigger,
|
|
4307
4320
|
{
|
|
4308
4321
|
ref,
|
|
@@ -4311,27 +4324,27 @@ var GrantRolePicker = React60.forwardRef(
|
|
|
4311
4324
|
type: "button",
|
|
4312
4325
|
"aria-label": ariaLabel ? `${ariaLabel}: ${nameOf2(value)}` : void 0,
|
|
4313
4326
|
className,
|
|
4314
|
-
children: /* @__PURE__ */
|
|
4327
|
+
children: /* @__PURE__ */ jsx71("span", { className: cn("max-w-[10rem] truncate", current ? WEIGHT_TONE[current.weight ?? "normal"] : MISSING_TONE), children: nameOf2(value) })
|
|
4315
4328
|
}
|
|
4316
4329
|
),
|
|
4317
|
-
/* @__PURE__ */
|
|
4318
|
-
carried && /* @__PURE__ */
|
|
4319
|
-
valueNote !== void 0 && /* @__PURE__ */
|
|
4330
|
+
/* @__PURE__ */ jsxs45(DropdownMenuContent, { align, className: "w-64", children: [
|
|
4331
|
+
carried && /* @__PURE__ */ jsx71("div", { className: MENU_STATEMENT, children: `${via} grants this role.` }),
|
|
4332
|
+
valueNote !== void 0 && /* @__PURE__ */ jsx71("div", { className: MENU_STATEMENT, children: valueNote }),
|
|
4320
4333
|
rungs && pickable.filter((r) => !r.group).map(item),
|
|
4321
4334
|
rungs && // Bands in the order the roles list states them, so a caller decides the order once.
|
|
4322
|
-
[...new Set(pickable.map((r) => r.group).filter((g) => !!g))].map((band) => /* @__PURE__ */
|
|
4323
|
-
/* @__PURE__ */
|
|
4324
|
-
/* @__PURE__ */
|
|
4335
|
+
[...new Set(pickable.map((r) => r.group).filter((g) => !!g))].map((band) => /* @__PURE__ */ jsxs45(React60.Fragment, { children: [
|
|
4336
|
+
/* @__PURE__ */ jsx71(DropdownMenuSeparator, {}),
|
|
4337
|
+
/* @__PURE__ */ jsx71(DropdownMenuLabel, { className: "px-2 py-1 text-xs font-medium text-text-tertiary", children: band }),
|
|
4325
4338
|
pickable.filter((r) => r.group === band).map(item)
|
|
4326
4339
|
] }, band)),
|
|
4327
|
-
notInForce && /* @__PURE__ */
|
|
4328
|
-
/* @__PURE__ */
|
|
4340
|
+
notInForce && /* @__PURE__ */ jsxs45("div", { className: "px-2 py-1.5 text-xs text-text-tertiary", children: [
|
|
4341
|
+
/* @__PURE__ */ jsx71("span", { className: "line-through", children: nameOf2(notInForce.role) }),
|
|
4329
4342
|
" ",
|
|
4330
4343
|
notInForce.why
|
|
4331
4344
|
] }),
|
|
4332
|
-
onRemove && /* @__PURE__ */
|
|
4333
|
-
rungs && /* @__PURE__ */
|
|
4334
|
-
/* @__PURE__ */
|
|
4345
|
+
onRemove && /* @__PURE__ */ jsxs45(Fragment6, { children: [
|
|
4346
|
+
rungs && /* @__PURE__ */ jsx71(DropdownMenuSeparator, {}),
|
|
4347
|
+
/* @__PURE__ */ jsxs45(
|
|
4335
4348
|
DropdownMenuItem,
|
|
4336
4349
|
{
|
|
4337
4350
|
variant: "destructive",
|
|
@@ -4339,13 +4352,13 @@ var GrantRolePicker = React60.forwardRef(
|
|
|
4339
4352
|
"aria-label": removeDetail ? grantRemoveLabel(removeDetail, notInForce !== void 0) : void 0,
|
|
4340
4353
|
className: "gap-2 py-1.5",
|
|
4341
4354
|
children: [
|
|
4342
|
-
rungs && /* @__PURE__ */
|
|
4355
|
+
rungs && /* @__PURE__ */ jsx71(Check8, { className: "invisible size-3.5 shrink-0" }),
|
|
4343
4356
|
removeWords
|
|
4344
4357
|
]
|
|
4345
4358
|
}
|
|
4346
4359
|
)
|
|
4347
4360
|
] }),
|
|
4348
|
-
!carried && !rungs && valueNote === void 0 && !notInForce && !onRemove && notes?.empty !== void 0 && /* @__PURE__ */
|
|
4361
|
+
!carried && !rungs && valueNote === void 0 && !notInForce && !onRemove && notes?.empty !== void 0 && /* @__PURE__ */ jsx71("div", { className: MENU_STATEMENT, children: notes.empty })
|
|
4349
4362
|
] })
|
|
4350
4363
|
] });
|
|
4351
4364
|
}
|
|
@@ -4354,7 +4367,7 @@ GrantRolePicker.displayName = "GrantRolePicker";
|
|
|
4354
4367
|
|
|
4355
4368
|
// src/components/grant-row.tsx
|
|
4356
4369
|
import * as React61 from "react";
|
|
4357
|
-
import { jsx as
|
|
4370
|
+
import { jsx as jsx72, jsxs as jsxs46 } from "react/jsx-runtime";
|
|
4358
4371
|
var GrantRow = React61.forwardRef((props, ref) => {
|
|
4359
4372
|
const {
|
|
4360
4373
|
name,
|
|
@@ -4378,12 +4391,12 @@ var GrantRow = React61.forwardRef((props, ref) => {
|
|
|
4378
4391
|
const nameOf2 = (id) => roles.find((r) => r.id === id)?.name ?? missingLabel;
|
|
4379
4392
|
const picks = stated || readOnly ? void 0 : props.onChange;
|
|
4380
4393
|
const removes = grantRemoveLabel(removeDetail ?? name, notInForce !== void 0);
|
|
4381
|
-
return /* @__PURE__ */
|
|
4382
|
-
/* @__PURE__ */
|
|
4394
|
+
return /* @__PURE__ */ jsxs46("div", { ref, className: cn("flex items-center justify-between gap-2 px-4 py-2.5", className), children: [
|
|
4395
|
+
/* @__PURE__ */ jsx72("span", { className: "min-w-0 text-sm text-text-primary", children: name }),
|
|
4383
4396
|
props.actionsInMenu ? (
|
|
4384
4397
|
// One control, and the row ends at it. The carried case is derived from `via`: the group
|
|
4385
4398
|
// is what makes the role not this row's to change.
|
|
4386
|
-
/* @__PURE__ */
|
|
4399
|
+
/* @__PURE__ */ jsx72(
|
|
4387
4400
|
GrantRolePicker,
|
|
4388
4401
|
{
|
|
4389
4402
|
value: role,
|
|
@@ -4407,8 +4420,8 @@ var GrantRow = React61.forwardRef((props, ref) => {
|
|
|
4407
4420
|
// picker at all; an overtaken grant only exists under a group's, so it is the same fact
|
|
4408
4421
|
// arriving by the other route. A row that picked and also said either would be offering
|
|
4409
4422
|
// rungs that change nothing.
|
|
4410
|
-
/* @__PURE__ */
|
|
4411
|
-
/* @__PURE__ */
|
|
4423
|
+
/* @__PURE__ */ jsxs46("div", { className: "flex items-center gap-1", children: [
|
|
4424
|
+
/* @__PURE__ */ jsx72(
|
|
4412
4425
|
GrantRolePicker,
|
|
4413
4426
|
{
|
|
4414
4427
|
value: role,
|
|
@@ -4420,29 +4433,29 @@ var GrantRow = React61.forwardRef((props, ref) => {
|
|
|
4420
4433
|
missingLabel
|
|
4421
4434
|
}
|
|
4422
4435
|
),
|
|
4423
|
-
onRemove ? /* @__PURE__ */
|
|
4436
|
+
onRemove ? /* @__PURE__ */ jsx72(RemoveButton, { label: removes, onClick: onRemove }) : reserveRemove ? (
|
|
4424
4437
|
// Spacing, not a control: `RemoveButton`'s list-row box is 36px, so a row with nothing
|
|
4425
4438
|
// to remove holds the same 36px and the card keeps one right edge.
|
|
4426
|
-
/* @__PURE__ */
|
|
4439
|
+
/* @__PURE__ */ jsx72("span", { "aria-hidden": true, className: "w-9 shrink-0" })
|
|
4427
4440
|
) : null
|
|
4428
4441
|
] })
|
|
4429
|
-
) : /* @__PURE__ */
|
|
4430
|
-
/* @__PURE__ */
|
|
4431
|
-
/* @__PURE__ */
|
|
4432
|
-
/* @__PURE__ */
|
|
4433
|
-
via && /* @__PURE__ */
|
|
4442
|
+
) : /* @__PURE__ */ jsxs46("div", { className: "flex items-center gap-1", children: [
|
|
4443
|
+
/* @__PURE__ */ jsxs46("div", { className: "flex items-center gap-1.5 pr-2", children: [
|
|
4444
|
+
/* @__PURE__ */ jsxs46("div", { className: "flex shrink-0 flex-col items-end", children: [
|
|
4445
|
+
/* @__PURE__ */ jsx72("span", { className: cn("text-sm", held ? WEIGHT_TONE[held.weight ?? "normal"] : MISSING_TONE), children: nameOf2(role) }),
|
|
4446
|
+
via && /* @__PURE__ */ jsxs46("span", { className: "text-xs text-text-tertiary", children: [
|
|
4434
4447
|
"via ",
|
|
4435
4448
|
via
|
|
4436
4449
|
] }),
|
|
4437
|
-
notInForce && /* @__PURE__ */
|
|
4438
|
-
/* @__PURE__ */
|
|
4450
|
+
notInForce && /* @__PURE__ */ jsxs46("span", { className: "text-right text-xs text-text-tertiary", children: [
|
|
4451
|
+
/* @__PURE__ */ jsx72("span", { className: "line-through", children: nameOf2(notInForce.role) }),
|
|
4439
4452
|
" ",
|
|
4440
4453
|
notInForce.why
|
|
4441
4454
|
] })
|
|
4442
4455
|
] }),
|
|
4443
|
-
reserveChevron && /* @__PURE__ */
|
|
4456
|
+
reserveChevron && /* @__PURE__ */ jsx72("span", { "aria-hidden": true, className: "w-3.5 shrink-0" })
|
|
4444
4457
|
] }),
|
|
4445
|
-
!readOnly && onRemove ? /* @__PURE__ */
|
|
4458
|
+
!readOnly && onRemove ? /* @__PURE__ */ jsx72(RemoveButton, { label: removes, onClick: onRemove }) : reserveRemove ? /* @__PURE__ */ jsx72("span", { "aria-hidden": true, className: "w-9 shrink-0" }) : null
|
|
4446
4459
|
] })
|
|
4447
4460
|
] });
|
|
4448
4461
|
});
|
|
@@ -4451,9 +4464,9 @@ GrantRow.displayName = "GrantRow";
|
|
|
4451
4464
|
// src/components/removable-chip.tsx
|
|
4452
4465
|
import * as React62 from "react";
|
|
4453
4466
|
import { X as X3 } from "lucide-react";
|
|
4454
|
-
import { jsx as
|
|
4467
|
+
import { jsx as jsx73, jsxs as jsxs47 } from "react/jsx-runtime";
|
|
4455
4468
|
var RemovableChip = React62.forwardRef(
|
|
4456
|
-
({ label, onRemove, leading, removeLabel, className, ...props }, ref) => /* @__PURE__ */
|
|
4469
|
+
({ label, onRemove, leading, removeLabel, className, ...props }, ref) => /* @__PURE__ */ jsxs47(
|
|
4457
4470
|
"span",
|
|
4458
4471
|
{
|
|
4459
4472
|
ref,
|
|
@@ -4466,8 +4479,8 @@ var RemovableChip = React62.forwardRef(
|
|
|
4466
4479
|
),
|
|
4467
4480
|
children: [
|
|
4468
4481
|
leading,
|
|
4469
|
-
/* @__PURE__ */
|
|
4470
|
-
/* @__PURE__ */
|
|
4482
|
+
/* @__PURE__ */ jsx73("span", { className: "truncate", children: label }),
|
|
4483
|
+
/* @__PURE__ */ jsx73(
|
|
4471
4484
|
Button,
|
|
4472
4485
|
{
|
|
4473
4486
|
type: "button",
|
|
@@ -4475,7 +4488,7 @@ var RemovableChip = React62.forwardRef(
|
|
|
4475
4488
|
"aria-label": removeLabel ?? `Remove ${label}`,
|
|
4476
4489
|
variant: "ghost",
|
|
4477
4490
|
size: "xs",
|
|
4478
|
-
icon: /* @__PURE__ */
|
|
4491
|
+
icon: /* @__PURE__ */ jsx73(X3, {}),
|
|
4479
4492
|
className: "shrink-0 hover:bg-bg-overlay"
|
|
4480
4493
|
}
|
|
4481
4494
|
)
|
|
@@ -4518,6 +4531,58 @@ function useFreshHighlight() {
|
|
|
4518
4531
|
return { isFresh, markFresh, freshRef, announcer };
|
|
4519
4532
|
}
|
|
4520
4533
|
|
|
4534
|
+
// src/components/quick-search-row.tsx
|
|
4535
|
+
import { Search as Search2 } from "lucide-react";
|
|
4536
|
+
import { jsx as jsx74, jsxs as jsxs48 } from "react/jsx-runtime";
|
|
4537
|
+
function QuickSearchRow({
|
|
4538
|
+
onOpen,
|
|
4539
|
+
label = "Quick search",
|
|
4540
|
+
shortcut = "\u2318K",
|
|
4541
|
+
collapsed = false,
|
|
4542
|
+
icon
|
|
4543
|
+
}) {
|
|
4544
|
+
const name = shortcut ? `${label} ${shortcut}` : label;
|
|
4545
|
+
if (!collapsed) {
|
|
4546
|
+
return /* @__PURE__ */ jsxs48(
|
|
4547
|
+
"button",
|
|
4548
|
+
{
|
|
4549
|
+
type: "button",
|
|
4550
|
+
onClick: onOpen,
|
|
4551
|
+
"aria-label": name,
|
|
4552
|
+
className: cn(
|
|
4553
|
+
// `bg-bg-overlay` where every other field in the kit takes `bg-bg-primary`, because every
|
|
4554
|
+
// other field sits on a card or a page and this one sits on the rail — which IS
|
|
4555
|
+
// `bg-bg-primary`, so the field's own fill would be its ground and only the border would
|
|
4556
|
+
// say it is there. Lifted, it is 1.073:1 above the rail in light and 1.184:1 in dark
|
|
4557
|
+
// (`Guidelines/Look/Surface tone`), and the field edge still reads at 2.348 and 2.611.
|
|
4558
|
+
"flex h-9 w-full cursor-pointer items-center gap-2 rounded-md border border-field-border bg-bg-overlay px-2.5",
|
|
4559
|
+
"text-left text-sm text-text-tertiary transition-colors duration-fast",
|
|
4560
|
+
"hover:border-field-border-hover hover:text-text-secondary",
|
|
4561
|
+
"focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-border-focus"
|
|
4562
|
+
),
|
|
4563
|
+
children: [
|
|
4564
|
+
/* @__PURE__ */ jsx74("span", { className: "flex size-4 shrink-0 items-center justify-center [&_svg]:size-4", "aria-hidden": "true", children: icon ?? /* @__PURE__ */ jsx74(Search2, {}) }),
|
|
4565
|
+
/* @__PURE__ */ jsx74("span", { className: "min-w-0 flex-1 truncate", children: label }),
|
|
4566
|
+
shortcut && /* @__PURE__ */ jsx74("span", { className: "shrink-0 text-xs font-medium text-text-tertiary", children: shortcut })
|
|
4567
|
+
]
|
|
4568
|
+
}
|
|
4569
|
+
);
|
|
4570
|
+
}
|
|
4571
|
+
return /* @__PURE__ */ jsxs48(Tooltip, { children: [
|
|
4572
|
+
/* @__PURE__ */ jsx74(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsx74(
|
|
4573
|
+
NavRow,
|
|
4574
|
+
{
|
|
4575
|
+
variant: "rail",
|
|
4576
|
+
icon: icon ?? /* @__PURE__ */ jsx74(Search2, { "aria-hidden": "true" }),
|
|
4577
|
+
label,
|
|
4578
|
+
onClick: onOpen
|
|
4579
|
+
}
|
|
4580
|
+
) }),
|
|
4581
|
+
/* @__PURE__ */ jsx74(TooltipContent, { side: "right", children: name })
|
|
4582
|
+
] });
|
|
4583
|
+
}
|
|
4584
|
+
QuickSearchRow.displayName = "QuickSearchRow";
|
|
4585
|
+
|
|
4521
4586
|
// src/components/nav-section-label.tsx
|
|
4522
4587
|
import * as React64 from "react";
|
|
4523
4588
|
import { jsx as jsx75 } from "react/jsx-runtime";
|
|
@@ -4583,7 +4648,7 @@ MenuDivider.displayName = "MenuDivider";
|
|
|
4583
4648
|
|
|
4584
4649
|
// src/components/sidebar-product-header.tsx
|
|
4585
4650
|
import * as React66 from "react";
|
|
4586
|
-
import { Slot as
|
|
4651
|
+
import { Slot as Slot3 } from "@radix-ui/react-slot";
|
|
4587
4652
|
import { ChevronsUpDown as ChevronsUpDown2 } from "lucide-react";
|
|
4588
4653
|
import { Fragment as Fragment7, jsx as jsx77, jsxs as jsxs50 } from "react/jsx-runtime";
|
|
4589
4654
|
var SidebarProductHeader = React66.forwardRef(
|
|
@@ -4594,10 +4659,10 @@ var SidebarProductHeader = React66.forwardRef(
|
|
|
4594
4659
|
/* @__PURE__ */ jsx77("span", { className: "min-w-0 flex-1 truncate text-sm font-semibold text-text-primary", children: name }),
|
|
4595
4660
|
adornment && /* @__PURE__ */ jsx77("span", { className: "flex shrink-0 items-center", children: adornment })
|
|
4596
4661
|
] });
|
|
4597
|
-
const classes = cn("flex w-full items-center gap-2.5 rounded-xl px-1.5 py-0 text-left", className);
|
|
4662
|
+
const classes = cn("flex w-full cursor-pointer items-center gap-2.5 rounded-xl px-1.5 py-0 text-left", className);
|
|
4598
4663
|
if (asChild) {
|
|
4599
4664
|
const child = React66.Children.only(children);
|
|
4600
|
-
return /* @__PURE__ */ jsx77(
|
|
4665
|
+
return /* @__PURE__ */ jsx77(Slot3, { ref, className: classes, ...props, children: React66.cloneElement(child, void 0, content) });
|
|
4601
4666
|
}
|
|
4602
4667
|
return /* @__PURE__ */ jsx77("button", { ref, type: "button", className: classes, ...props, children: content });
|
|
4603
4668
|
}
|
|
@@ -4605,49 +4670,63 @@ var SidebarProductHeader = React66.forwardRef(
|
|
|
4605
4670
|
SidebarProductHeader.displayName = "SidebarProductHeader";
|
|
4606
4671
|
|
|
4607
4672
|
// src/components/org-product-switcher.tsx
|
|
4608
|
-
import
|
|
4673
|
+
import * as React67 from "react";
|
|
4674
|
+
import { ChevronsUpDown as ChevronsUpDown3, Check as Check9, Search as Search3 } from "lucide-react";
|
|
4609
4675
|
import { Fragment as Fragment8, jsx as jsx78, jsxs as jsxs51 } from "react/jsx-runtime";
|
|
4610
|
-
var
|
|
4676
|
+
var PRODUCT_STATUS_LABEL = {
|
|
4677
|
+
blocked: "Blocked",
|
|
4678
|
+
archived: "Archived"
|
|
4679
|
+
};
|
|
4680
|
+
function productStatusBadge(status) {
|
|
4681
|
+
if (status === "active") return void 0;
|
|
4682
|
+
return /* @__PURE__ */ jsx78(Badge, { variant: "status", children: PRODUCT_STATUS_LABEL[status] });
|
|
4683
|
+
}
|
|
4684
|
+
var triggerBox = "flex min-h-[40px] w-full items-center gap-2.5 rounded-xl px-1.5 py-1 text-left transition-colors duration-fast hover:bg-[var(--hov-bg)] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-border-focus";
|
|
4685
|
+
var inlineTriggerBox = "flex items-center gap-1.5 rounded-lg px-2 py-1 text-sm font-semibold text-text-primary transition-colors duration-fast hover:bg-[var(--hov-bg)] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-border-focus";
|
|
4611
4686
|
var menuItem = "gap-2 rounded-md px-2 py-1.5 text-sm font-medium text-text-secondary focus:bg-[var(--menu-hov)] focus:text-text-primary";
|
|
4612
4687
|
var sectionLabel = "px-2 pt-1.5 pb-1 text-xs font-medium text-text-tertiary";
|
|
4688
|
+
var searchBox = "mx-1 mb-1 flex h-8 shrink-0 items-center gap-2 rounded-md border border-field-border bg-bg-primary px-2 focus-within:ring-2 focus-within:ring-border-focus";
|
|
4689
|
+
var rowScroller = "flex max-h-[18rem] min-h-0 flex-col gap-px overflow-y-auto overscroll-contain";
|
|
4613
4690
|
var NO_ORG_LABEL = "Select an organization\u2026";
|
|
4614
4691
|
var nameOf = (item) => item?.name.trim() ? item.name : void 0;
|
|
4615
4692
|
var UNNAMED = { organization: "Unnamed organization", product: "Unnamed product" };
|
|
4693
|
+
function NameLine({ className, children }) {
|
|
4694
|
+
return /* @__PURE__ */ jsxs51("span", { className: "flex min-w-0 items-center gap-1", children: [
|
|
4695
|
+
/* @__PURE__ */ jsx78("span", { className: cn("min-w-0 truncate text-sm leading-[normal]", className), children }),
|
|
4696
|
+
/* @__PURE__ */ jsx78(ChevronsUpDown3, { size: 14, "aria-hidden": "true", className: "shrink-0 text-text-tertiary" })
|
|
4697
|
+
] });
|
|
4698
|
+
}
|
|
4699
|
+
var SEARCH_NOUN = { organization: "organizations", product: "products" };
|
|
4616
4700
|
function ItemLabel({ item, kind }) {
|
|
4617
4701
|
const name = nameOf(item);
|
|
4618
4702
|
return /* @__PURE__ */ jsx78("span", { className: cn("min-w-0 flex-1 truncate", !name && "text-text-tertiary"), children: name ?? UNNAMED[kind] });
|
|
4619
4703
|
}
|
|
4620
|
-
|
|
4621
|
-
|
|
4704
|
+
var MARK_SIZE = { md: "sm", sm: "xs" };
|
|
4705
|
+
var ICON_BOX = { md: "size-8 rounded-md", sm: "size-6 rounded-sm" };
|
|
4706
|
+
function Mark2({ item, kind, size, reserve }) {
|
|
4622
4707
|
if (item.icon) {
|
|
4623
|
-
return /* @__PURE__ */ jsx78("span", { className: cn("flex shrink-0 items-center justify-center overflow-hidden
|
|
4708
|
+
return /* @__PURE__ */ jsx78("span", { className: cn("flex shrink-0 items-center justify-center overflow-hidden", ICON_BOX[size]), "aria-hidden": "true", children: item.icon });
|
|
4624
4709
|
}
|
|
4625
|
-
const
|
|
4626
|
-
if (!
|
|
4627
|
-
return /* @__PURE__ */ jsx78(
|
|
4628
|
-
"span",
|
|
4629
|
-
{
|
|
4630
|
-
"aria-hidden": "true",
|
|
4631
|
-
className: cn(
|
|
4632
|
-
"flex shrink-0 items-center justify-center rounded-md bg-[var(--menu-hov)] font-semibold text-text-secondary",
|
|
4633
|
-
box,
|
|
4634
|
-
size === "md" ? "text-sm" : "text-xs"
|
|
4635
|
-
),
|
|
4636
|
-
children: initial
|
|
4637
|
-
}
|
|
4638
|
-
);
|
|
4710
|
+
const name = nameOf(item);
|
|
4711
|
+
if (!name) return reserve ? /* @__PURE__ */ jsx78("span", { "aria-hidden": "true", className: cn("shrink-0", ICON_BOX[size]) }) : null;
|
|
4712
|
+
return /* @__PURE__ */ jsx78(EntityTile, { name, tone: kind === "product" ? "auto" : "neutral", size: MARK_SIZE[size] });
|
|
4639
4713
|
}
|
|
4640
4714
|
function OrgProductSwitcher({
|
|
4641
|
-
organizations,
|
|
4715
|
+
organizations = [],
|
|
4642
4716
|
activeOrgId,
|
|
4643
4717
|
onOrgSelect,
|
|
4644
4718
|
products = [],
|
|
4645
4719
|
activeProductId,
|
|
4646
4720
|
onProductSelect,
|
|
4647
4721
|
actions,
|
|
4722
|
+
trigger = "stacked",
|
|
4648
4723
|
className,
|
|
4649
4724
|
...props
|
|
4650
4725
|
}) {
|
|
4726
|
+
const [open, setOpen] = React67.useState(false);
|
|
4727
|
+
const [query, setQuery] = React67.useState("");
|
|
4728
|
+
const contentRef = React67.useRef(null);
|
|
4729
|
+
const searchRef = React67.useRef(null);
|
|
4651
4730
|
const activeOrg = organizations.find((o) => o.id === activeOrgId);
|
|
4652
4731
|
const activeProduct = products.find((p) => p.id === activeProductId);
|
|
4653
4732
|
const orgName = nameOf(activeOrg);
|
|
@@ -4655,59 +4734,108 @@ function OrgProductSwitcher({
|
|
|
4655
4734
|
const orgLevel = !activeProduct;
|
|
4656
4735
|
const productLabel = activeProduct && (productName ?? UNNAMED.product);
|
|
4657
4736
|
const markItem = activeProduct?.icon || productName ? activeProduct : activeOrg;
|
|
4737
|
+
const markKind = markItem === activeProduct ? "product" : "organization";
|
|
4658
4738
|
const trail = [orgName, productLabel].filter(Boolean).join(" / ");
|
|
4659
4739
|
const ariaLabel = props["aria-label"] ?? (trail || NO_ORG_LABEL);
|
|
4660
|
-
|
|
4661
|
-
|
|
4662
|
-
|
|
4663
|
-
|
|
4664
|
-
|
|
4665
|
-
|
|
4666
|
-
|
|
4667
|
-
|
|
4668
|
-
|
|
4669
|
-
|
|
4670
|
-
|
|
4671
|
-
|
|
4672
|
-
|
|
4740
|
+
const inlineName = productLabel ?? orgName;
|
|
4741
|
+
const menuKind = organizations.length > 0 ? "organization" : "product";
|
|
4742
|
+
const items = menuKind === "organization" ? organizations : products;
|
|
4743
|
+
const activeItemId = menuKind === "organization" ? activeOrgId : activeProductId;
|
|
4744
|
+
const triggerMark = menuKind === "organization" && markItem;
|
|
4745
|
+
const noun = SEARCH_NOUN[menuKind];
|
|
4746
|
+
const searchLabel = items.length > 1 ? `Search ${items.length} ${noun}` : `Search ${noun}`;
|
|
4747
|
+
const needle = query.trim().toLowerCase();
|
|
4748
|
+
const matches = needle ? items.filter((i) => (nameOf(i) ?? UNNAMED[menuKind]).toLowerCase().includes(needle)) : items;
|
|
4749
|
+
const hasList = items.length > 0;
|
|
4750
|
+
React67.useEffect(() => {
|
|
4751
|
+
if (!open || !hasList) return;
|
|
4752
|
+
const id = window.setTimeout(() => searchRef.current?.focus());
|
|
4753
|
+
return () => window.clearTimeout(id);
|
|
4754
|
+
}, [open, hasList]);
|
|
4755
|
+
const setMenuOpen = (next) => {
|
|
4756
|
+
setOpen(next);
|
|
4757
|
+
if (!next) setQuery("");
|
|
4758
|
+
};
|
|
4759
|
+
const pick = (id) => {
|
|
4760
|
+
setMenuOpen(false);
|
|
4761
|
+
if (menuKind === "organization") onOrgSelect?.(id);
|
|
4762
|
+
else onProductSelect?.(id);
|
|
4763
|
+
};
|
|
4764
|
+
const onSearchKeyDown = (e) => {
|
|
4765
|
+
if (e.key === "ArrowDown") {
|
|
4766
|
+
e.preventDefault();
|
|
4767
|
+
contentRef.current?.querySelector("[data-menu-row]")?.focus();
|
|
4768
|
+
return;
|
|
4769
|
+
}
|
|
4770
|
+
if (e.key === "Enter") {
|
|
4771
|
+
const first = matches[0];
|
|
4772
|
+
if (first) {
|
|
4773
|
+
e.preventDefault();
|
|
4774
|
+
pick(first.id);
|
|
4775
|
+
}
|
|
4776
|
+
return;
|
|
4777
|
+
}
|
|
4778
|
+
if (e.key.length === 1) e.stopPropagation();
|
|
4779
|
+
};
|
|
4780
|
+
return /* @__PURE__ */ jsxs51(DropdownMenu, { open, onOpenChange: setMenuOpen, children: [
|
|
4781
|
+
trigger === "inline" ? (
|
|
4782
|
+
// One line, and the words are the whole trigger: the product where one has resolved, the
|
|
4783
|
+
// org where it has not, and the same tertiary placeholder as the stacked form where neither
|
|
4784
|
+
// has. Nothing is truncated — a bar sizes to its contents, and a name cut short in a bar is
|
|
4785
|
+
// a name nowhere else on the page repeats.
|
|
4786
|
+
/* @__PURE__ */ jsxs51(DropdownMenuTrigger, { "aria-label": ariaLabel, className: cn(inlineTriggerBox, className), children: [
|
|
4787
|
+
/* @__PURE__ */ jsx78("span", { className: cn(!inlineName && "font-medium text-text-tertiary"), children: inlineName ?? NO_ORG_LABEL }),
|
|
4788
|
+
/* @__PURE__ */ jsx78(ChevronsUpDown3, { size: 14, "aria-hidden": "true", className: "shrink-0 text-text-tertiary" })
|
|
4789
|
+
] })
|
|
4790
|
+
) : /* @__PURE__ */ jsxs51(DropdownMenuTrigger, { "aria-label": ariaLabel, className: cn(triggerBox, className), children: [
|
|
4791
|
+
triggerMark && /* @__PURE__ */ jsx78(Mark2, { item: triggerMark, kind: markKind, size: "md" }),
|
|
4792
|
+
orgLevel ? /* @__PURE__ */ jsx78("span", { className: "flex min-w-0 flex-1 flex-col", children: /* @__PURE__ */ jsx78(NameLine, { className: orgName ? "font-semibold text-text-primary" : "text-text-tertiary", children: orgName ?? NO_ORG_LABEL }) }) : /* @__PURE__ */ jsxs51("span", { className: "flex min-w-0 flex-1 flex-col gap-0.5", children: [
|
|
4673
4793
|
orgName && /* @__PURE__ */ jsx78("span", { className: "truncate text-xs leading-[normal] text-text-tertiary", children: orgName }),
|
|
4674
|
-
/* @__PURE__ */ jsx78(
|
|
4675
|
-
|
|
4676
|
-
{
|
|
4677
|
-
className: cn(
|
|
4678
|
-
"truncate text-sm leading-[normal]",
|
|
4679
|
-
productName ? "font-semibold text-text-primary" : "text-text-tertiary"
|
|
4680
|
-
),
|
|
4681
|
-
children: productLabel
|
|
4682
|
-
}
|
|
4683
|
-
)
|
|
4684
|
-
] }),
|
|
4685
|
-
/* @__PURE__ */ jsx78(ChevronsUpDown3, { size: 14, "aria-hidden": "true", className: "shrink-0 text-text-tertiary" })
|
|
4794
|
+
/* @__PURE__ */ jsx78(NameLine, { className: productName ? "font-semibold text-text-primary" : "text-text-tertiary", children: productLabel })
|
|
4795
|
+
] })
|
|
4686
4796
|
] }),
|
|
4687
4797
|
/* @__PURE__ */ jsxs51(
|
|
4688
4798
|
DropdownMenuContent,
|
|
4689
4799
|
{
|
|
4800
|
+
ref: contentRef,
|
|
4690
4801
|
align: "start",
|
|
4691
4802
|
sideOffset: 6,
|
|
4692
|
-
className: "flex w-[var(--radix-dropdown-menu-trigger-width)] min-w-
|
|
4803
|
+
className: "flex w-[var(--radix-dropdown-menu-trigger-width)] min-w-64 flex-col gap-px rounded-xl border-border-subtle bg-[var(--menu-bg)] p-1 shadow-(--menu-shadow)",
|
|
4693
4804
|
children: [
|
|
4694
|
-
/* @__PURE__ */
|
|
4695
|
-
|
|
4696
|
-
/* @__PURE__ */
|
|
4697
|
-
|
|
4698
|
-
|
|
4699
|
-
|
|
4700
|
-
|
|
4701
|
-
|
|
4702
|
-
|
|
4703
|
-
|
|
4704
|
-
|
|
4705
|
-
|
|
4706
|
-
|
|
4707
|
-
|
|
4805
|
+
items.length > 0 && /* @__PURE__ */ jsxs51(Fragment8, { children: [
|
|
4806
|
+
/* @__PURE__ */ jsx78(DropdownMenuLabel, { className: sectionLabel, children: menuKind === "organization" ? "Organizations" : "Products" }),
|
|
4807
|
+
/* @__PURE__ */ jsxs51("div", { className: searchBox, onKeyDown: onSearchKeyDown, children: [
|
|
4808
|
+
/* @__PURE__ */ jsx78(Search3, { size: 14, "aria-hidden": "true", className: "shrink-0 text-text-tertiary" }),
|
|
4809
|
+
/* @__PURE__ */ jsx78(
|
|
4810
|
+
"input",
|
|
4811
|
+
{
|
|
4812
|
+
ref: searchRef,
|
|
4813
|
+
type: "text",
|
|
4814
|
+
value: query,
|
|
4815
|
+
onChange: (e) => setQuery(e.target.value),
|
|
4816
|
+
placeholder: searchLabel,
|
|
4817
|
+
"aria-label": searchLabel,
|
|
4818
|
+
className: "min-w-0 flex-1 bg-transparent text-sm text-text-primary placeholder:text-text-tertiary focus:outline-none"
|
|
4819
|
+
}
|
|
4820
|
+
)
|
|
4821
|
+
] }),
|
|
4822
|
+
/* @__PURE__ */ jsx78("div", { role: "group", className: rowScroller, children: matches.map((item) => {
|
|
4823
|
+
const status = menuKind === "product" && productStatusBadge(item.status ?? "active");
|
|
4824
|
+
return /* @__PURE__ */ jsxs51(DropdownMenuItem, { "data-menu-row": "", className: menuItem, onSelect: () => pick(item.id), children: [
|
|
4825
|
+
/* @__PURE__ */ jsx78(Mark2, { item, kind: menuKind, size: "sm", reserve: true }),
|
|
4826
|
+
/* @__PURE__ */ jsx78(ItemLabel, { item, kind: menuKind }),
|
|
4827
|
+
status && /* @__PURE__ */ jsx78("span", { className: "shrink-0", children: status }),
|
|
4828
|
+
item.id === activeItemId && /* @__PURE__ */ jsx78(Check9, { className: "size-4 shrink-0 text-text-secondary", "aria-hidden": "true" })
|
|
4829
|
+
] }, item.id);
|
|
4830
|
+
}) }),
|
|
4831
|
+
matches.length === 0 && /* @__PURE__ */ jsxs51("div", { className: "px-2 py-1.5 text-sm text-text-tertiary", children: [
|
|
4832
|
+
"No ",
|
|
4833
|
+
noun,
|
|
4834
|
+
" match."
|
|
4835
|
+
] })
|
|
4708
4836
|
] }),
|
|
4709
4837
|
actions && actions.length > 0 && /* @__PURE__ */ jsxs51(Fragment8, { children: [
|
|
4710
|
-
/* @__PURE__ */ jsx78(DropdownMenuSeparator, { className: "mx-0 shrink-0" }),
|
|
4838
|
+
items.length > 0 && /* @__PURE__ */ jsx78(DropdownMenuSeparator, { className: "mx-0 shrink-0" }),
|
|
4711
4839
|
actions.map((a) => /* @__PURE__ */ jsx78(DropdownMenuItem, { className: menuItem, onSelect: a.onSelect, asChild: Boolean(a.href), children: a.href ? /* @__PURE__ */ jsxs51("a", { href: a.href, children: [
|
|
4712
4840
|
a.icon,
|
|
4713
4841
|
a.label
|
|
@@ -4728,6 +4856,7 @@ import { ArrowLeft as ArrowLeft3 } from "lucide-react";
|
|
|
4728
4856
|
import { jsx as jsx79, jsxs as jsxs52 } from "react/jsx-runtime";
|
|
4729
4857
|
var focusRing = "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-border-focus";
|
|
4730
4858
|
var arrowPlate = "flex size-5 items-center justify-center rounded-md transition-colors duration-fast hover:bg-[color-mix(in_srgb,var(--text-primary)_12%,transparent)] hover:text-text-primary";
|
|
4859
|
+
var rowPlate = "transition-colors duration-fast hover:bg-[color-mix(in_srgb,var(--text-primary)_7%,transparent)]";
|
|
4731
4860
|
var arrowBox = "flex shrink-0 cursor-pointer items-center rounded-xl py-2 pr-0 pl-2.5 text-text-secondary";
|
|
4732
4861
|
var titleBox = "min-w-0 flex-1 cursor-pointer truncate rounded-xl py-2 pr-2.5 pl-[14px] text-left text-sm font-semibold text-text-primary";
|
|
4733
4862
|
var Arrow = () => /* @__PURE__ */ jsx79(ArrowLeft3, { size: 16, "aria-hidden": "true" });
|
|
@@ -4749,7 +4878,7 @@ function SidebarBackHeader({
|
|
|
4749
4878
|
{
|
|
4750
4879
|
type: "button",
|
|
4751
4880
|
onClick: onBack,
|
|
4752
|
-
className: cn("flex items-center rounded-xl", focusRing, className),
|
|
4881
|
+
className: cn("flex cursor-pointer items-center rounded-xl", rowPlate, focusRing, className),
|
|
4753
4882
|
...rowProps,
|
|
4754
4883
|
children: [
|
|
4755
4884
|
/* @__PURE__ */ jsx79("span", { className: arrowBox, children: /* @__PURE__ */ jsx79("span", { className: cn(arrowPlate, arrowClassName), ...arrowRest, children: /* @__PURE__ */ jsx79(Arrow, {}) }) }),
|
|
@@ -4758,7 +4887,7 @@ function SidebarBackHeader({
|
|
|
4758
4887
|
}
|
|
4759
4888
|
);
|
|
4760
4889
|
}
|
|
4761
|
-
return /* @__PURE__ */ jsxs52("div", { className: cn("flex items-center", className), ...rowProps, children: [
|
|
4890
|
+
return /* @__PURE__ */ jsxs52("div", { className: cn("flex items-center rounded-xl", rowPlate, className), ...rowProps, children: [
|
|
4762
4891
|
/* @__PURE__ */ jsx79(
|
|
4763
4892
|
"button",
|
|
4764
4893
|
{
|
|
@@ -4785,9 +4914,9 @@ function SidebarBackHeader({
|
|
|
4785
4914
|
SidebarBackHeader.displayName = "SidebarBackHeader";
|
|
4786
4915
|
|
|
4787
4916
|
// src/components/top-bar.tsx
|
|
4788
|
-
import * as
|
|
4917
|
+
import * as React68 from "react";
|
|
4789
4918
|
import { jsx as jsx80, jsxs as jsxs53 } from "react/jsx-runtime";
|
|
4790
|
-
var TopBar =
|
|
4919
|
+
var TopBar = React68.forwardRef(
|
|
4791
4920
|
({ left, right, className, ...props }, ref) => /* @__PURE__ */ jsxs53("div", { ref, className: cn("flex w-full items-center gap-1", className), ...props, children: [
|
|
4792
4921
|
left,
|
|
4793
4922
|
right && /* @__PURE__ */ jsx80("div", { className: "ml-auto flex items-center gap-2", children: right })
|
|
@@ -4795,25 +4924,14 @@ var TopBar = React67.forwardRef(
|
|
|
4795
4924
|
);
|
|
4796
4925
|
TopBar.displayName = "TopBar";
|
|
4797
4926
|
|
|
4798
|
-
// src/components/top-bar-utilities.tsx
|
|
4799
|
-
import * as React68 from "react";
|
|
4800
|
-
import { jsx as jsx81, jsxs as jsxs54 } from "react/jsx-runtime";
|
|
4801
|
-
var TopBarUtilities = React68.forwardRef(
|
|
4802
|
-
({ items, className, ...props }, ref) => /* @__PURE__ */ jsx81("div", { ref, className: cn("flex items-center gap-1", className), ...props, children: items.map(({ name, icon, onClick }) => /* @__PURE__ */ jsxs54(Tooltip, { children: [
|
|
4803
|
-
/* @__PURE__ */ jsx81(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsx81(Button, { variant: "ghost", size: "sm", icon, "aria-label": name, onClick }) }),
|
|
4804
|
-
/* @__PURE__ */ jsx81(TooltipContent, { children: name })
|
|
4805
|
-
] }, name)) })
|
|
4806
|
-
);
|
|
4807
|
-
TopBarUtilities.displayName = "TopBarUtilities";
|
|
4808
|
-
|
|
4809
4927
|
// src/components/grid.tsx
|
|
4810
4928
|
import * as React69 from "react";
|
|
4811
|
-
import { Slot as
|
|
4812
|
-
import { jsx as
|
|
4929
|
+
import { Slot as Slot4 } from "@radix-ui/react-slot";
|
|
4930
|
+
import { jsx as jsx81 } from "react/jsx-runtime";
|
|
4813
4931
|
var Grid = React69.forwardRef(
|
|
4814
4932
|
({ fluid = false, asChild = false, className, ...props }, ref) => {
|
|
4815
|
-
const Comp = asChild ?
|
|
4816
|
-
return /* @__PURE__ */
|
|
4933
|
+
const Comp = asChild ? Slot4 : "div";
|
|
4934
|
+
return /* @__PURE__ */ jsx81(
|
|
4817
4935
|
Comp,
|
|
4818
4936
|
{
|
|
4819
4937
|
ref,
|
|
@@ -4832,8 +4950,8 @@ Grid.displayName = "Grid";
|
|
|
4832
4950
|
|
|
4833
4951
|
// src/components/col.tsx
|
|
4834
4952
|
import * as React70 from "react";
|
|
4835
|
-
import { Slot as
|
|
4836
|
-
import { jsx as
|
|
4953
|
+
import { Slot as Slot5 } from "@radix-ui/react-slot";
|
|
4954
|
+
import { jsx as jsx82 } from "react/jsx-runtime";
|
|
4837
4955
|
var TIER_MAX = { base: 4, md: 8, xl: 12 };
|
|
4838
4956
|
var SPAN = {
|
|
4839
4957
|
base: { 1: "col-span-1", 2: "col-span-2", 3: "col-span-3", 4: "col-span-4" },
|
|
@@ -4955,25 +5073,25 @@ function responsiveClasses(span, offset) {
|
|
|
4955
5073
|
}
|
|
4956
5074
|
var Col = React70.forwardRef(
|
|
4957
5075
|
({ span, offset, asChild = false, className, ...props }, ref) => {
|
|
4958
|
-
const Comp = asChild ?
|
|
4959
|
-
return /* @__PURE__ */
|
|
5076
|
+
const Comp = asChild ? Slot5 : "div";
|
|
5077
|
+
return /* @__PURE__ */ jsx82(Comp, { ref, className: cn(responsiveClasses(span, offset), className), ...props });
|
|
4960
5078
|
}
|
|
4961
5079
|
);
|
|
4962
5080
|
Col.displayName = "Col";
|
|
4963
5081
|
|
|
4964
5082
|
// src/components/page-column.tsx
|
|
4965
|
-
import { jsx as
|
|
5083
|
+
import { jsx as jsx83 } from "react/jsx-runtime";
|
|
4966
5084
|
var WIDTH = {
|
|
4967
5085
|
reading: "grid gap-5 page-column",
|
|
4968
5086
|
full: "grid gap-5"
|
|
4969
5087
|
};
|
|
4970
5088
|
function PageColumn({ className, width = "reading", ...props }) {
|
|
4971
|
-
return /* @__PURE__ */
|
|
5089
|
+
return /* @__PURE__ */ jsx83("div", { "data-slot": "page-column", className: cn(WIDTH[width], className), ...props });
|
|
4972
5090
|
}
|
|
4973
5091
|
|
|
4974
5092
|
// src/components/code-block.tsx
|
|
4975
5093
|
import * as React71 from "react";
|
|
4976
|
-
import { jsx as
|
|
5094
|
+
import { jsx as jsx84, jsxs as jsxs54 } from "react/jsx-runtime";
|
|
4977
5095
|
var TOKEN_CLASS = {
|
|
4978
5096
|
comment: "text-text-tertiary italic",
|
|
4979
5097
|
string: "text-text-success",
|
|
@@ -5154,20 +5272,20 @@ var CodeBlock = React71.forwardRef(
|
|
|
5154
5272
|
const showCopy = copy && !isTerminal;
|
|
5155
5273
|
const overlayCopy = showCopy && !filename;
|
|
5156
5274
|
const contentWhitespace = scroll ? "whitespace-pre" : "whitespace-pre-wrap break-words";
|
|
5157
|
-
const pre = /* @__PURE__ */
|
|
5275
|
+
const pre = /* @__PURE__ */ jsx84(
|
|
5158
5276
|
"pre",
|
|
5159
5277
|
{
|
|
5160
5278
|
ref,
|
|
5161
5279
|
className: cn("py-4 font-mono text-xs leading-6 text-text-secondary", scroll && "overflow-x-auto", className),
|
|
5162
5280
|
...props,
|
|
5163
|
-
children: /* @__PURE__ */
|
|
5281
|
+
children: /* @__PURE__ */ jsx84("code", { className: "block min-w-full", children: lines.map((tokens, i) => {
|
|
5164
5282
|
const n = i + 1;
|
|
5165
5283
|
const raw = rawLines[i] ?? "";
|
|
5166
5284
|
const diffKind = isDiff ? raw[0] === "+" ? "add" : raw[0] === "-" ? "remove" : null : null;
|
|
5167
5285
|
const promptLen = isTerminal && raw[0] === "$" ? 1 : 0;
|
|
5168
5286
|
const markerDrop = diffKind ? 1 : promptLen;
|
|
5169
5287
|
const body = markerDrop ? dropLeading(tokens, markerDrop) : tokens;
|
|
5170
|
-
return /* @__PURE__ */
|
|
5288
|
+
return /* @__PURE__ */ jsxs54(
|
|
5171
5289
|
"span",
|
|
5172
5290
|
{
|
|
5173
5291
|
"data-line": n,
|
|
@@ -5180,8 +5298,8 @@ var CodeBlock = React71.forwardRef(
|
|
|
5180
5298
|
!diffKind && highlighted.has(n) && "bg-bg-brand-subtle"
|
|
5181
5299
|
),
|
|
5182
5300
|
children: [
|
|
5183
|
-
showLineNumbers && /* @__PURE__ */
|
|
5184
|
-
(isDiff || isTerminal) && /* @__PURE__ */
|
|
5301
|
+
showLineNumbers && /* @__PURE__ */ jsx84("span", { "aria-hidden": true, className: "mr-3 w-8 shrink-0 select-none text-right text-text-tertiary", children: n }),
|
|
5302
|
+
(isDiff || isTerminal) && /* @__PURE__ */ jsx84(
|
|
5185
5303
|
"span",
|
|
5186
5304
|
{
|
|
5187
5305
|
"aria-hidden": true,
|
|
@@ -5194,7 +5312,7 @@ var CodeBlock = React71.forwardRef(
|
|
|
5194
5312
|
children: diffKind === "add" ? "+" : diffKind === "remove" ? "-" : promptLen > 0 ? "$" : ""
|
|
5195
5313
|
}
|
|
5196
5314
|
),
|
|
5197
|
-
/* @__PURE__ */
|
|
5315
|
+
/* @__PURE__ */ jsx84("span", { className: cn("min-w-0 flex-1", contentWhitespace), children: body.length ? body.map((token, j) => /* @__PURE__ */ jsx84("span", { className: TOKEN_CLASS[token.kind], children: token.text }, j)) : "\xA0" })
|
|
5198
5316
|
]
|
|
5199
5317
|
},
|
|
5200
5318
|
i
|
|
@@ -5202,16 +5320,16 @@ var CodeBlock = React71.forwardRef(
|
|
|
5202
5320
|
}) })
|
|
5203
5321
|
}
|
|
5204
5322
|
);
|
|
5205
|
-
return /* @__PURE__ */
|
|
5206
|
-
filename && /* @__PURE__ */
|
|
5207
|
-
/* @__PURE__ */
|
|
5208
|
-
showCopy && /* @__PURE__ */
|
|
5323
|
+
return /* @__PURE__ */ jsxs54("div", { className: "relative overflow-hidden rounded-lg border border-border-subtle bg-bg-primary", children: [
|
|
5324
|
+
filename && /* @__PURE__ */ jsxs54("div", { className: "flex items-center justify-between gap-3 border-b border-border-subtle px-4 py-2", children: [
|
|
5325
|
+
/* @__PURE__ */ jsx84("span", { className: "font-mono text-xs text-text-tertiary", children: filename }),
|
|
5326
|
+
showCopy && /* @__PURE__ */ jsx84(CopyButton, { value: code, label: "Copy code", className: "size-7" })
|
|
5209
5327
|
] }),
|
|
5210
5328
|
pre,
|
|
5211
5329
|
overlayCopy && // Always visible, on every device: a copy control you have to hover to discover is a
|
|
5212
5330
|
// control most people never find. Opaque (`bg-bg-primary`, the block's own surface) so it
|
|
5213
5331
|
// reads cleanly where a long first line runs under it.
|
|
5214
|
-
/* @__PURE__ */
|
|
5332
|
+
/* @__PURE__ */ jsx84(
|
|
5215
5333
|
CopyButton,
|
|
5216
5334
|
{
|
|
5217
5335
|
value: code,
|
|
@@ -5223,7 +5341,7 @@ var CodeBlock = React71.forwardRef(
|
|
|
5223
5341
|
}
|
|
5224
5342
|
);
|
|
5225
5343
|
CodeBlock.displayName = "CodeBlock";
|
|
5226
|
-
var Code = React71.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */
|
|
5344
|
+
var Code = React71.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx84(
|
|
5227
5345
|
"code",
|
|
5228
5346
|
{
|
|
5229
5347
|
ref,
|
|
@@ -5238,12 +5356,12 @@ Code.displayName = "Code";
|
|
|
5238
5356
|
|
|
5239
5357
|
// src/components/grid-overlay.tsx
|
|
5240
5358
|
import * as React72 from "react";
|
|
5241
|
-
import { jsx as
|
|
5359
|
+
import { jsx as jsx85 } from "react/jsx-runtime";
|
|
5242
5360
|
var BASELINE = "var(--grid-gutter) / 2";
|
|
5243
5361
|
var GridOverlay = React72.forwardRef(
|
|
5244
5362
|
({ columns, baseline = false, className, style, ...props }, ref) => {
|
|
5245
5363
|
const count = Number.isFinite(columns) ? Math.max(1, Math.floor(columns)) : 1;
|
|
5246
|
-
return /* @__PURE__ */
|
|
5364
|
+
return /* @__PURE__ */ jsx85(
|
|
5247
5365
|
"div",
|
|
5248
5366
|
{
|
|
5249
5367
|
ref,
|
|
@@ -5260,7 +5378,7 @@ var GridOverlay = React72.forwardRef(
|
|
|
5260
5378
|
...style
|
|
5261
5379
|
},
|
|
5262
5380
|
...props,
|
|
5263
|
-
children: Array.from({ length: count }).map((_, i) => /* @__PURE__ */
|
|
5381
|
+
children: Array.from({ length: count }).map((_, i) => /* @__PURE__ */ jsx85("span", { style: { backgroundColor: "var(--bg-brand)", opacity: 0.1 } }, i))
|
|
5264
5382
|
}
|
|
5265
5383
|
);
|
|
5266
5384
|
}
|
|
@@ -5271,7 +5389,7 @@ GridOverlay.displayName = "GridOverlay";
|
|
|
5271
5389
|
import * as React73 from "react";
|
|
5272
5390
|
import { cva as cva8 } from "class-variance-authority";
|
|
5273
5391
|
import { Link2, Clock, Plus as Plus2 } from "lucide-react";
|
|
5274
|
-
import { jsx as
|
|
5392
|
+
import { jsx as jsx86, jsxs as jsxs55 } from "react/jsx-runtime";
|
|
5275
5393
|
var attachmentChipVariants = cva8(
|
|
5276
5394
|
"inline-flex items-center gap-1.5 rounded-lg border px-2.5 py-1 text-sm font-medium leading-tight",
|
|
5277
5395
|
{
|
|
@@ -5293,8 +5411,8 @@ var stateIcons = {
|
|
|
5293
5411
|
var AttachmentChip = React73.forwardRef(
|
|
5294
5412
|
({ state, account, icon, hideIcon = false, className, ...props }, ref) => {
|
|
5295
5413
|
const Icon = icon ?? stateIcons[state ?? "attached"];
|
|
5296
|
-
return /* @__PURE__ */
|
|
5297
|
-
!hideIcon && /* @__PURE__ */
|
|
5414
|
+
return /* @__PURE__ */ jsxs55("span", { ref, className: cn(attachmentChipVariants({ state }), className), ...props, children: [
|
|
5415
|
+
!hideIcon && /* @__PURE__ */ jsx86(Icon, { className: "size-3.5 shrink-0 opacity-90", "aria-hidden": "true" }),
|
|
5298
5416
|
account
|
|
5299
5417
|
] });
|
|
5300
5418
|
}
|
|
@@ -5303,8 +5421,8 @@ AttachmentChip.displayName = "AttachmentChip";
|
|
|
5303
5421
|
|
|
5304
5422
|
// src/components/connector-card.tsx
|
|
5305
5423
|
import * as React74 from "react";
|
|
5306
|
-
import { AlertTriangle, ChevronDown as
|
|
5307
|
-
import { Fragment as Fragment9, jsx as
|
|
5424
|
+
import { AlertTriangle, ChevronDown as ChevronDown5 } from "lucide-react";
|
|
5425
|
+
import { Fragment as Fragment9, jsx as jsx87, jsxs as jsxs56 } from "react/jsx-runtime";
|
|
5308
5426
|
var originLabels = {
|
|
5309
5427
|
org: "Attached by the organization",
|
|
5310
5428
|
product: "Attached by this product"
|
|
@@ -5338,56 +5456,56 @@ var ConnectorCard = React74.forwardRef(
|
|
|
5338
5456
|
}, ref) => {
|
|
5339
5457
|
const connected = status !== "not-connected";
|
|
5340
5458
|
const label = statusLabel ?? statusLabels[status];
|
|
5341
|
-
const glyphBox = /* @__PURE__ */
|
|
5459
|
+
const glyphBox = /* @__PURE__ */ jsx87(
|
|
5342
5460
|
"div",
|
|
5343
5461
|
{
|
|
5344
5462
|
"aria-hidden": "true",
|
|
5345
|
-
className: "flex size-8 shrink-0 items-center justify-center rounded-lg border border-border-subtle bg-bg-
|
|
5463
|
+
className: "flex size-8 shrink-0 items-center justify-center rounded-lg border border-border-subtle bg-bg-secondary text-sm font-bold text-text-secondary",
|
|
5346
5464
|
children: glyph ?? monogram(name)
|
|
5347
5465
|
}
|
|
5348
5466
|
);
|
|
5349
|
-
const identity = /* @__PURE__ */
|
|
5350
|
-
/* @__PURE__ */
|
|
5351
|
-
(kind || origin) && /* @__PURE__ */
|
|
5352
|
-
kind && /* @__PURE__ */
|
|
5353
|
-
origin && /* @__PURE__ */
|
|
5467
|
+
const identity = /* @__PURE__ */ jsxs56("div", { className: "min-w-0", children: [
|
|
5468
|
+
/* @__PURE__ */ jsx87("p", { className: "truncate text-sm font-semibold text-text-primary", children: name }),
|
|
5469
|
+
(kind || origin) && /* @__PURE__ */ jsxs56("div", { className: "mt-0.5 flex flex-wrap gap-1", children: [
|
|
5470
|
+
kind && /* @__PURE__ */ jsx87(Badge, { variant: "secondary", children: kind }),
|
|
5471
|
+
origin && /* @__PURE__ */ jsx87(Badge, { variant: "outline", children: originLabels[origin] })
|
|
5354
5472
|
] })
|
|
5355
5473
|
] });
|
|
5356
|
-
const statusBadge = label ? /* @__PURE__ */
|
|
5357
|
-
const accessNote = access ? /* @__PURE__ */
|
|
5474
|
+
const statusBadge = label ? /* @__PURE__ */ jsx87(Badge, { variant: "status", children: label }) : null;
|
|
5475
|
+
const accessNote = access ? /* @__PURE__ */ jsxs56(
|
|
5358
5476
|
"div",
|
|
5359
5477
|
{
|
|
5360
5478
|
role: "note",
|
|
5361
5479
|
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",
|
|
5362
5480
|
children: [
|
|
5363
|
-
/* @__PURE__ */
|
|
5364
|
-
/* @__PURE__ */
|
|
5481
|
+
/* @__PURE__ */ jsx87(AlertTriangle, { className: "mt-0.5 size-3.5 shrink-0", "aria-hidden": "true" }),
|
|
5482
|
+
/* @__PURE__ */ jsx87("span", { children: access })
|
|
5365
5483
|
]
|
|
5366
5484
|
}
|
|
5367
5485
|
) : null;
|
|
5368
5486
|
const footerAction = collapsible ? action : connected && action;
|
|
5369
|
-
const footer = attachedCount !== void 0 || footerAction ? /* @__PURE__ */
|
|
5370
|
-
/* @__PURE__ */
|
|
5487
|
+
const footer = attachedCount !== void 0 || footerAction ? /* @__PURE__ */ jsxs56("div", { className: "flex items-center justify-between border-t border-border-subtle px-4 py-3", children: [
|
|
5488
|
+
/* @__PURE__ */ jsx87("span", { className: "text-sm text-text-secondary", children: attachedCount !== void 0 ? /* @__PURE__ */ jsxs56(Fragment9, { children: [
|
|
5371
5489
|
"Attached to ",
|
|
5372
|
-
/* @__PURE__ */
|
|
5490
|
+
/* @__PURE__ */ jsx87("span", { className: "font-semibold text-text-primary", children: attachedCount }),
|
|
5373
5491
|
" ",
|
|
5374
5492
|
attachedCount === 1 ? "product" : "products"
|
|
5375
|
-
] }) : /* @__PURE__ */
|
|
5493
|
+
] }) : /* @__PURE__ */ jsx87("span", { className: "text-text-tertiary", children: "Not attached to any product yet" }) }),
|
|
5376
5494
|
footerAction
|
|
5377
5495
|
] }) : null;
|
|
5378
|
-
const drawer = children ? /* @__PURE__ */
|
|
5496
|
+
const drawer = children ? /* @__PURE__ */ jsx87("div", { "data-slot": "drawer", className: "border-t border-border-subtle", children }) : null;
|
|
5379
5497
|
if (!collapsible) {
|
|
5380
|
-
return /* @__PURE__ */
|
|
5498
|
+
return /* @__PURE__ */ jsxs56(
|
|
5381
5499
|
Card,
|
|
5382
5500
|
{
|
|
5383
5501
|
ref,
|
|
5384
5502
|
className: cn(status === "not-connected" && "border-dashed border-border-default", className),
|
|
5385
5503
|
...props,
|
|
5386
5504
|
children: [
|
|
5387
|
-
/* @__PURE__ */
|
|
5505
|
+
/* @__PURE__ */ jsxs56("div", { className: "flex items-center gap-3 p-4", children: [
|
|
5388
5506
|
glyphBox,
|
|
5389
5507
|
identity,
|
|
5390
|
-
/* @__PURE__ */
|
|
5508
|
+
/* @__PURE__ */ jsx87("div", { className: "ml-auto shrink-0", children: connected ? statusBadge : action ?? statusBadge })
|
|
5391
5509
|
] }),
|
|
5392
5510
|
accessNote,
|
|
5393
5511
|
footer,
|
|
@@ -5396,7 +5514,7 @@ var ConnectorCard = React74.forwardRef(
|
|
|
5396
5514
|
}
|
|
5397
5515
|
);
|
|
5398
5516
|
}
|
|
5399
|
-
return /* @__PURE__ */
|
|
5517
|
+
return /* @__PURE__ */ jsx87(Collapsible, { defaultOpen, open, onOpenChange, children: /* @__PURE__ */ jsxs56(
|
|
5400
5518
|
Card,
|
|
5401
5519
|
{
|
|
5402
5520
|
ref,
|
|
@@ -5407,7 +5525,7 @@ var ConnectorCard = React74.forwardRef(
|
|
|
5407
5525
|
),
|
|
5408
5526
|
...props,
|
|
5409
5527
|
children: [
|
|
5410
|
-
/* @__PURE__ */
|
|
5528
|
+
/* @__PURE__ */ jsx87(CollapsibleTrigger2, { asChild: true, children: /* @__PURE__ */ jsxs56(
|
|
5411
5529
|
"button",
|
|
5412
5530
|
{
|
|
5413
5531
|
type: "button",
|
|
@@ -5415,10 +5533,10 @@ var ConnectorCard = React74.forwardRef(
|
|
|
5415
5533
|
children: [
|
|
5416
5534
|
glyphBox,
|
|
5417
5535
|
identity,
|
|
5418
|
-
/* @__PURE__ */
|
|
5536
|
+
/* @__PURE__ */ jsxs56("div", { className: "ml-auto flex shrink-0 items-center gap-2", children: [
|
|
5419
5537
|
statusBadge,
|
|
5420
|
-
/* @__PURE__ */
|
|
5421
|
-
|
|
5538
|
+
/* @__PURE__ */ jsx87(
|
|
5539
|
+
ChevronDown5,
|
|
5422
5540
|
{
|
|
5423
5541
|
"aria-hidden": "true",
|
|
5424
5542
|
className: "size-4 shrink-0 text-text-tertiary transition-transform duration-fast group-data-[state=open]:rotate-180"
|
|
@@ -5428,7 +5546,7 @@ var ConnectorCard = React74.forwardRef(
|
|
|
5428
5546
|
]
|
|
5429
5547
|
}
|
|
5430
5548
|
) }),
|
|
5431
|
-
/* @__PURE__ */
|
|
5549
|
+
/* @__PURE__ */ jsxs56(CollapsibleContent2, { children: [
|
|
5432
5550
|
accessNote,
|
|
5433
5551
|
footer,
|
|
5434
5552
|
drawer
|
|
@@ -5442,7 +5560,7 @@ ConnectorCard.displayName = "ConnectorCard";
|
|
|
5442
5560
|
|
|
5443
5561
|
// src/components/request-row.tsx
|
|
5444
5562
|
import * as React75 from "react";
|
|
5445
|
-
import { Fragment as Fragment10, jsx as
|
|
5563
|
+
import { Fragment as Fragment10, jsx as jsx88, jsxs as jsxs57 } from "react/jsx-runtime";
|
|
5446
5564
|
function monogram2(name) {
|
|
5447
5565
|
return name.replace(/[^a-zA-Z0-9 ]/g, " ").split(/\s+/).filter(Boolean).slice(0, 2).map((w) => w[0].toUpperCase()).join("");
|
|
5448
5566
|
}
|
|
@@ -5451,23 +5569,23 @@ var RequestRow = React75.forwardRef(
|
|
|
5451
5569
|
let controls = action;
|
|
5452
5570
|
if (controls === void 0) {
|
|
5453
5571
|
if (surface === "org" && state === "pending") {
|
|
5454
|
-
controls = /* @__PURE__ */
|
|
5455
|
-
/* @__PURE__ */
|
|
5456
|
-
/* @__PURE__ */
|
|
5572
|
+
controls = /* @__PURE__ */ jsxs57(Fragment10, { children: [
|
|
5573
|
+
/* @__PURE__ */ jsx88(Button, { variant: "ghost", size: "sm", onClick: onDeny, children: "Deny" }),
|
|
5574
|
+
/* @__PURE__ */ jsx88(Button, { variant: "outline", size: "sm", onClick: onApprove, children: "Approve" })
|
|
5457
5575
|
] });
|
|
5458
5576
|
} else if (state === "sent") {
|
|
5459
|
-
controls = /* @__PURE__ */
|
|
5577
|
+
controls = /* @__PURE__ */ jsx88(Button, { variant: "destructive-ghost", size: "sm", onClick: onRevoke, children: "Revoke" });
|
|
5460
5578
|
} else if (state === "available") {
|
|
5461
|
-
controls = /* @__PURE__ */
|
|
5579
|
+
controls = /* @__PURE__ */ jsx88(Button, { variant: "outline", size: "sm", onClick: onRequest, children: "Request" });
|
|
5462
5580
|
} else if (state === "pending") {
|
|
5463
|
-
controls = /* @__PURE__ */
|
|
5581
|
+
controls = /* @__PURE__ */ jsx88(Badge, { variant: "status", children: "Requested" });
|
|
5464
5582
|
} else if (state === "denied") {
|
|
5465
|
-
controls = /* @__PURE__ */
|
|
5583
|
+
controls = /* @__PURE__ */ jsx88(Badge, { variant: "status", children: "Denied" });
|
|
5466
5584
|
} else if (state === "attached") {
|
|
5467
|
-
controls = account ? /* @__PURE__ */
|
|
5585
|
+
controls = account ? /* @__PURE__ */ jsx88(AttachmentChip, { state: "attached", account }) : /* @__PURE__ */ jsx88(Badge, { variant: "status", children: "In use" });
|
|
5468
5586
|
}
|
|
5469
5587
|
}
|
|
5470
|
-
return /* @__PURE__ */
|
|
5588
|
+
return /* @__PURE__ */ jsxs57(
|
|
5471
5589
|
"div",
|
|
5472
5590
|
{
|
|
5473
5591
|
ref,
|
|
@@ -5477,19 +5595,19 @@ var RequestRow = React75.forwardRef(
|
|
|
5477
5595
|
),
|
|
5478
5596
|
...props,
|
|
5479
5597
|
children: [
|
|
5480
|
-
/* @__PURE__ */
|
|
5598
|
+
/* @__PURE__ */ jsx88(
|
|
5481
5599
|
"div",
|
|
5482
5600
|
{
|
|
5483
5601
|
"aria-hidden": "true",
|
|
5484
|
-
className: "flex size-8 shrink-0 items-center justify-center rounded-lg border border-border-subtle bg-bg-
|
|
5602
|
+
className: "flex size-8 shrink-0 items-center justify-center rounded-lg border border-border-subtle bg-bg-secondary text-sm font-bold text-text-secondary",
|
|
5485
5603
|
children: glyph ?? monogram2(name)
|
|
5486
5604
|
}
|
|
5487
5605
|
),
|
|
5488
|
-
/* @__PURE__ */
|
|
5489
|
-
/* @__PURE__ */
|
|
5490
|
-
subtitle && /* @__PURE__ */
|
|
5606
|
+
/* @__PURE__ */ jsxs57("div", { className: "min-w-0", children: [
|
|
5607
|
+
/* @__PURE__ */ jsx88("p", { className: "truncate text-sm font-semibold text-text-primary", children: name }),
|
|
5608
|
+
subtitle && /* @__PURE__ */ jsx88("p", { className: "truncate text-xs text-text-tertiary", children: subtitle })
|
|
5491
5609
|
] }),
|
|
5492
|
-
/* @__PURE__ */
|
|
5610
|
+
/* @__PURE__ */ jsx88("div", { className: "ml-auto flex shrink-0 items-center gap-2", children: controls })
|
|
5493
5611
|
]
|
|
5494
5612
|
}
|
|
5495
5613
|
);
|
|
@@ -5500,7 +5618,7 @@ RequestRow.displayName = "RequestRow";
|
|
|
5500
5618
|
// src/components/feedback-button.tsx
|
|
5501
5619
|
import * as React76 from "react";
|
|
5502
5620
|
import { MessageSquare, Loader2 as Loader23, CheckCircle2 } from "lucide-react";
|
|
5503
|
-
import { jsx as
|
|
5621
|
+
import { jsx as jsx89, jsxs as jsxs58 } from "react/jsx-runtime";
|
|
5504
5622
|
var TITLE_MAX = 256;
|
|
5505
5623
|
var DETAILS_MAX = 65536;
|
|
5506
5624
|
var DEFAULT_LABELS = {
|
|
@@ -5547,20 +5665,20 @@ function FeedbackButton({ onSubmit, labels, className }) {
|
|
|
5547
5665
|
setStatus("error");
|
|
5548
5666
|
}
|
|
5549
5667
|
};
|
|
5550
|
-
return /* @__PURE__ */
|
|
5551
|
-
/* @__PURE__ */
|
|
5552
|
-
/* @__PURE__ */
|
|
5668
|
+
return /* @__PURE__ */ jsxs58(Popover, { open, onOpenChange: changeOpen, children: [
|
|
5669
|
+
/* @__PURE__ */ jsx89(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ jsxs58(Button, { variant: "ghost", size: "sm", "aria-label": l.trigger, className, children: [
|
|
5670
|
+
/* @__PURE__ */ jsx89(MessageSquare, { className: "size-4", "aria-hidden": "true" }),
|
|
5553
5671
|
l.trigger
|
|
5554
5672
|
] }) }),
|
|
5555
|
-
/* @__PURE__ */
|
|
5556
|
-
/* @__PURE__ */
|
|
5557
|
-
/* @__PURE__ */
|
|
5558
|
-
/* @__PURE__ */
|
|
5559
|
-
] }) : /* @__PURE__ */
|
|
5560
|
-
/* @__PURE__ */
|
|
5561
|
-
/* @__PURE__ */
|
|
5562
|
-
/* @__PURE__ */
|
|
5563
|
-
/* @__PURE__ */
|
|
5673
|
+
/* @__PURE__ */ jsx89(PopoverContent, { align: "end", side: "bottom", className: "w-80", children: status === "success" ? /* @__PURE__ */ jsxs58("div", { className: "flex flex-col items-center gap-3 py-2 text-center", children: [
|
|
5674
|
+
/* @__PURE__ */ jsx89(CheckCircle2, { className: "size-8 text-text-success", "aria-hidden": "true" }),
|
|
5675
|
+
/* @__PURE__ */ jsx89("p", { role: "status", className: "text-sm text-text-primary", children: l.success }),
|
|
5676
|
+
/* @__PURE__ */ jsx89(Button, { variant: "outline", size: "sm", onClick: () => changeOpen(false), children: "Close" })
|
|
5677
|
+
] }) : /* @__PURE__ */ jsxs58("form", { onSubmit: handleSubmit, className: "flex flex-col gap-3", children: [
|
|
5678
|
+
/* @__PURE__ */ jsx89("p", { className: "text-sm font-medium text-text-primary", children: l.title }),
|
|
5679
|
+
/* @__PURE__ */ jsxs58("div", { className: "flex flex-col gap-1.5", children: [
|
|
5680
|
+
/* @__PURE__ */ jsx89(Label2, { htmlFor: titleId, children: l.titleField }),
|
|
5681
|
+
/* @__PURE__ */ jsx89(
|
|
5564
5682
|
Input,
|
|
5565
5683
|
{
|
|
5566
5684
|
id: titleId,
|
|
@@ -5571,16 +5689,16 @@ function FeedbackButton({ onSubmit, labels, className }) {
|
|
|
5571
5689
|
"aria-describedby": titleTooLong ? titleErrId : void 0
|
|
5572
5690
|
}
|
|
5573
5691
|
),
|
|
5574
|
-
titleTooLong && /* @__PURE__ */
|
|
5692
|
+
titleTooLong && /* @__PURE__ */ jsxs58("p", { id: titleErrId, className: "text-xs text-text-danger", children: [
|
|
5575
5693
|
l.titleField,
|
|
5576
5694
|
" must be ",
|
|
5577
5695
|
TITLE_MAX,
|
|
5578
5696
|
" characters or fewer."
|
|
5579
5697
|
] })
|
|
5580
5698
|
] }),
|
|
5581
|
-
/* @__PURE__ */
|
|
5582
|
-
/* @__PURE__ */
|
|
5583
|
-
/* @__PURE__ */
|
|
5699
|
+
/* @__PURE__ */ jsxs58("div", { className: "flex flex-col gap-1.5", children: [
|
|
5700
|
+
/* @__PURE__ */ jsx89(Label2, { htmlFor: detailsId, children: l.detailsField }),
|
|
5701
|
+
/* @__PURE__ */ jsx89(
|
|
5584
5702
|
Textarea,
|
|
5585
5703
|
{
|
|
5586
5704
|
id: detailsId,
|
|
@@ -5591,16 +5709,16 @@ function FeedbackButton({ onSubmit, labels, className }) {
|
|
|
5591
5709
|
"aria-describedby": detailsTooLong ? detailsErrId : void 0
|
|
5592
5710
|
}
|
|
5593
5711
|
),
|
|
5594
|
-
detailsTooLong && /* @__PURE__ */
|
|
5712
|
+
detailsTooLong && /* @__PURE__ */ jsxs58("p", { id: detailsErrId, className: "text-xs text-text-danger", children: [
|
|
5595
5713
|
l.detailsField,
|
|
5596
5714
|
" must be ",
|
|
5597
5715
|
DETAILS_MAX,
|
|
5598
5716
|
" characters or fewer."
|
|
5599
5717
|
] })
|
|
5600
5718
|
] }),
|
|
5601
|
-
status === "error" && /* @__PURE__ */
|
|
5602
|
-
/* @__PURE__ */
|
|
5603
|
-
submitting && /* @__PURE__ */
|
|
5719
|
+
status === "error" && /* @__PURE__ */ jsx89(InlineError, { children: l.error }),
|
|
5720
|
+
/* @__PURE__ */ jsxs58(Button, { type: "submit", disabled: !valid || submitting, children: [
|
|
5721
|
+
submitting && /* @__PURE__ */ jsx89(Loader23, { className: "size-4 animate-spin", "aria-hidden": "true" }),
|
|
5604
5722
|
l.submit
|
|
5605
5723
|
] })
|
|
5606
5724
|
] }) })
|
|
@@ -5664,19 +5782,19 @@ import * as React77 from "react";
|
|
|
5664
5782
|
|
|
5665
5783
|
// src/components/notification-parts.tsx
|
|
5666
5784
|
import { Check as Check10 } from "lucide-react";
|
|
5667
|
-
import { jsx as
|
|
5785
|
+
import { jsx as jsx90 } from "react/jsx-runtime";
|
|
5668
5786
|
var rowControlHitArea = "relative after:absolute after:-inset-x-2 after:-top-1.5 after:-bottom-2.5";
|
|
5669
5787
|
function rowControlName(label, title) {
|
|
5670
5788
|
return `${label} "${title}"`;
|
|
5671
5789
|
}
|
|
5672
5790
|
function MarkReadButton({ title, onClick }) {
|
|
5673
5791
|
const label = `Mark "${title}" as read`;
|
|
5674
|
-
return /* @__PURE__ */
|
|
5792
|
+
return /* @__PURE__ */ jsx90(
|
|
5675
5793
|
Button,
|
|
5676
5794
|
{
|
|
5677
5795
|
variant: "ghost",
|
|
5678
5796
|
size: "xs",
|
|
5679
|
-
icon: /* @__PURE__ */
|
|
5797
|
+
icon: /* @__PURE__ */ jsx90(Check10, {}),
|
|
5680
5798
|
"aria-label": label,
|
|
5681
5799
|
onClick,
|
|
5682
5800
|
className: "relative text-text-secondary after:absolute after:-inset-3 hover:text-text-primary"
|
|
@@ -5690,11 +5808,11 @@ function DeepLinkControl({
|
|
|
5690
5808
|
onClick
|
|
5691
5809
|
}) {
|
|
5692
5810
|
const name = rowControlName(link.label, title);
|
|
5693
|
-
return link.href ? /* @__PURE__ */
|
|
5811
|
+
return link.href ? /* @__PURE__ */ jsx90("a", { href: link.href, "aria-label": name, onClick, className, children: link.label }) : /* @__PURE__ */ jsx90("button", { type: "button", "aria-label": name, onClick, className: cn("cursor-pointer", className), children: link.label });
|
|
5694
5812
|
}
|
|
5695
5813
|
|
|
5696
5814
|
// src/components/notification-row.tsx
|
|
5697
|
-
import { jsx as
|
|
5815
|
+
import { jsx as jsx91, jsxs as jsxs59 } from "react/jsx-runtime";
|
|
5698
5816
|
var NotificationRow = React77.forwardRef(
|
|
5699
5817
|
({ item, onItemClick, onActionClick, onMarkRead, formatAge, className, ...props }, ref) => {
|
|
5700
5818
|
const settled = isNotificationSettled(item);
|
|
@@ -5707,32 +5825,32 @@ var NotificationRow = React77.forwardRef(
|
|
|
5707
5825
|
// Three steps of one ladder, and every one of them a token a reader can read:
|
|
5708
5826
|
// unread is the loudest, read is quieter, settled is quietest. An opacity is
|
|
5709
5827
|
// not a step — it drags the text under the contrast floor with the row.
|
|
5710
|
-
/* @__PURE__ */
|
|
5828
|
+
/* @__PURE__ */ jsxs59(
|
|
5711
5829
|
"div",
|
|
5712
5830
|
{
|
|
5713
5831
|
ref,
|
|
5714
5832
|
className: cn("group rounded-lg bg-bg-surface px-3 py-2.5", className),
|
|
5715
5833
|
...props,
|
|
5716
5834
|
children: [
|
|
5717
|
-
/* @__PURE__ */
|
|
5718
|
-
/* @__PURE__ */
|
|
5719
|
-
/* @__PURE__ */
|
|
5720
|
-
/* @__PURE__ */
|
|
5835
|
+
/* @__PURE__ */ jsxs59("div", { className: "flex items-start gap-2.5", children: [
|
|
5836
|
+
/* @__PURE__ */ jsxs59("div", { className: "min-w-0 flex-1", children: [
|
|
5837
|
+
/* @__PURE__ */ jsxs59("p", { className: "truncate text-xs text-text-tertiary", children: [
|
|
5838
|
+
/* @__PURE__ */ jsx91("span", { className: "font-semibold", children: item.source }),
|
|
5721
5839
|
item.receipt ? `, ${item.receipt}` : ""
|
|
5722
5840
|
] }),
|
|
5723
|
-
/* @__PURE__ */
|
|
5841
|
+
/* @__PURE__ */ jsx91(
|
|
5724
5842
|
"button",
|
|
5725
5843
|
{
|
|
5726
5844
|
type: "button",
|
|
5727
5845
|
onClick: () => onItemClick?.(item),
|
|
5728
5846
|
className: cn(
|
|
5729
|
-
"mt-0.5 block text-left text-sm leading-tight underline-offset-2 hover:underline",
|
|
5847
|
+
"mt-0.5 block cursor-pointer text-left text-sm leading-tight underline-offset-2 hover:underline",
|
|
5730
5848
|
settled ? "text-text-tertiary" : unread ? "font-semibold text-text-primary" : "text-text-secondary"
|
|
5731
5849
|
),
|
|
5732
5850
|
children: item.title
|
|
5733
5851
|
}
|
|
5734
5852
|
),
|
|
5735
|
-
item.body && /* @__PURE__ */
|
|
5853
|
+
item.body && /* @__PURE__ */ jsx91(
|
|
5736
5854
|
"p",
|
|
5737
5855
|
{
|
|
5738
5856
|
className: cn(
|
|
@@ -5743,15 +5861,15 @@ var NotificationRow = React77.forwardRef(
|
|
|
5743
5861
|
}
|
|
5744
5862
|
)
|
|
5745
5863
|
] }),
|
|
5746
|
-
(age || markable) && /* @__PURE__ */
|
|
5747
|
-
stamp && age && /* @__PURE__ */
|
|
5748
|
-
markable && /* @__PURE__ */
|
|
5864
|
+
(age || markable) && /* @__PURE__ */ jsxs59("div", { className: "mt-px flex shrink-0 items-center gap-1", children: [
|
|
5865
|
+
stamp && age && /* @__PURE__ */ jsx91("time", { dateTime: toDateTimeAttribute(stamp), className: "text-xs text-text-tertiary", children: age }),
|
|
5866
|
+
markable && /* @__PURE__ */ jsx91(MarkReadButton, { title: item.title, onClick: () => onMarkRead(item.id) })
|
|
5749
5867
|
] })
|
|
5750
5868
|
] }),
|
|
5751
|
-
(actions.length > 0 || item.deepLink) && /* @__PURE__ */
|
|
5869
|
+
(actions.length > 0 || item.deepLink) && /* @__PURE__ */ jsxs59("div", { className: "mt-2 flex flex-wrap items-center gap-x-4 gap-y-2", children: [
|
|
5752
5870
|
actions.map((action) => {
|
|
5753
5871
|
const chip = action.variant === "primary" || action.variant === "destructive";
|
|
5754
|
-
return /* @__PURE__ */
|
|
5872
|
+
return /* @__PURE__ */ jsx91(
|
|
5755
5873
|
"button",
|
|
5756
5874
|
{
|
|
5757
5875
|
type: "button",
|
|
@@ -5759,6 +5877,7 @@ var NotificationRow = React77.forwardRef(
|
|
|
5759
5877
|
onClick: () => onActionClick?.(item, action),
|
|
5760
5878
|
className: cn(
|
|
5761
5879
|
rowControlHitArea,
|
|
5880
|
+
"cursor-pointer",
|
|
5762
5881
|
chip ? "rounded-md px-2.5 py-1 text-xs font-medium transition-colors duration-fast" : "text-xs font-semibold text-text-secondary transition-opacity duration-fast hover:opacity-80",
|
|
5763
5882
|
action.variant === "primary" && "bg-bg-brand text-text-on-brand hover:bg-bg-brand-hover",
|
|
5764
5883
|
action.variant === "destructive" && "bg-bg-elevated text-text-danger hover:bg-bg-sunken"
|
|
@@ -5768,7 +5887,7 @@ var NotificationRow = React77.forwardRef(
|
|
|
5768
5887
|
action.id
|
|
5769
5888
|
);
|
|
5770
5889
|
}),
|
|
5771
|
-
item.deepLink && /* @__PURE__ */
|
|
5890
|
+
item.deepLink && /* @__PURE__ */ jsx91(
|
|
5772
5891
|
DeepLinkControl,
|
|
5773
5892
|
{
|
|
5774
5893
|
link: item.deepLink,
|
|
@@ -5790,7 +5909,7 @@ var NotificationRow = React77.forwardRef(
|
|
|
5790
5909
|
NotificationRow.displayName = "NotificationRow";
|
|
5791
5910
|
|
|
5792
5911
|
// src/components/notification-bell.tsx
|
|
5793
|
-
import { jsx as
|
|
5912
|
+
import { jsx as jsx92, jsxs as jsxs60 } from "react/jsx-runtime";
|
|
5794
5913
|
var NotificationBell = React78.forwardRef(
|
|
5795
5914
|
({
|
|
5796
5915
|
items,
|
|
@@ -5811,56 +5930,60 @@ var NotificationBell = React78.forwardRef(
|
|
|
5811
5930
|
const unread = unreadCount ?? items.filter((n) => !n.read && n.cls !== "ephemeral").length;
|
|
5812
5931
|
const rows = items.slice(0, maxItems);
|
|
5813
5932
|
const hidden = items.length - rows.length;
|
|
5814
|
-
return /* @__PURE__ */
|
|
5815
|
-
/* @__PURE__ */
|
|
5933
|
+
return /* @__PURE__ */ jsxs60(Popover, { open, onOpenChange, children: [
|
|
5934
|
+
/* @__PURE__ */ jsx92(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ jsxs60(
|
|
5816
5935
|
"button",
|
|
5817
5936
|
{
|
|
5818
5937
|
ref,
|
|
5819
5938
|
type: "button",
|
|
5820
5939
|
"aria-label": "Notifications",
|
|
5821
5940
|
className: cn(
|
|
5822
|
-
|
|
5941
|
+
topBarMarkClass,
|
|
5942
|
+
"data-[state=open]:bg-[var(--hov-bg)] data-[state=open]:text-text-primary",
|
|
5823
5943
|
className
|
|
5824
5944
|
),
|
|
5825
5945
|
children: [
|
|
5826
|
-
/* @__PURE__ */
|
|
5827
|
-
unread > 0 && /* @__PURE__ */
|
|
5946
|
+
/* @__PURE__ */ jsx92(BellRing, { "aria-hidden": "true" }),
|
|
5947
|
+
unread > 0 && /* @__PURE__ */ jsx92("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 })
|
|
5828
5948
|
]
|
|
5829
5949
|
}
|
|
5830
5950
|
) }),
|
|
5831
|
-
/* @__PURE__ */
|
|
5951
|
+
/* @__PURE__ */ jsxs60(
|
|
5832
5952
|
PopoverContent,
|
|
5833
5953
|
{
|
|
5834
5954
|
align: "end",
|
|
5835
5955
|
collisionPadding: 12,
|
|
5836
|
-
style: {
|
|
5956
|
+
style: {
|
|
5957
|
+
maxHeight: "var(--radix-popover-content-available-height, 32rem)",
|
|
5958
|
+
maxWidth: "var(--radix-popover-content-available-width, 380px)"
|
|
5959
|
+
},
|
|
5837
5960
|
className: "flex w-[380px] flex-col overflow-hidden p-0",
|
|
5838
5961
|
children: [
|
|
5839
|
-
/* @__PURE__ */
|
|
5840
|
-
/* @__PURE__ */
|
|
5841
|
-
/* @__PURE__ */
|
|
5842
|
-
unread === 0 ? /* @__PURE__ */
|
|
5962
|
+
/* @__PURE__ */ jsxs60("div", { className: "flex shrink-0 items-center justify-between px-5 py-3", children: [
|
|
5963
|
+
/* @__PURE__ */ jsx92("span", { className: "text-sm font-bold text-text-primary", children: "Notification center" }),
|
|
5964
|
+
/* @__PURE__ */ jsxs60("div", { className: "flex items-center gap-3", children: [
|
|
5965
|
+
unread === 0 ? /* @__PURE__ */ jsx92("span", { className: "text-sm font-medium text-text-tertiary", children: "All read" }) : /* @__PURE__ */ jsx92(
|
|
5843
5966
|
"button",
|
|
5844
5967
|
{
|
|
5845
5968
|
type: "button",
|
|
5846
5969
|
onClick: () => onMarkAllRead?.(),
|
|
5847
|
-
className: "text-sm font-medium text-text-tertiary transition-colors duration-fast hover:text-text-primary",
|
|
5970
|
+
className: "cursor-pointer text-sm font-medium text-text-tertiary transition-colors duration-fast hover:text-text-primary",
|
|
5848
5971
|
children: "Mark all read"
|
|
5849
5972
|
}
|
|
5850
5973
|
),
|
|
5851
|
-
onOpenSettings && /* @__PURE__ */
|
|
5974
|
+
onOpenSettings && /* @__PURE__ */ jsx92(
|
|
5852
5975
|
"button",
|
|
5853
5976
|
{
|
|
5854
5977
|
type: "button",
|
|
5855
5978
|
"aria-label": "Notification settings",
|
|
5856
5979
|
onClick: () => onOpenSettings(),
|
|
5857
|
-
className: "flex size-6 items-center justify-center rounded-md text-text-tertiary transition-colors duration-fast hover:bg-bg-surface hover:text-text-primary",
|
|
5858
|
-
children: /* @__PURE__ */
|
|
5980
|
+
className: "flex size-6 cursor-pointer items-center justify-center rounded-md text-text-tertiary transition-colors duration-fast hover:bg-bg-surface hover:text-text-primary",
|
|
5981
|
+
children: /* @__PURE__ */ jsx92(Settings, { className: "size-[15px]", "aria-hidden": "true" })
|
|
5859
5982
|
}
|
|
5860
5983
|
)
|
|
5861
5984
|
] })
|
|
5862
5985
|
] }),
|
|
5863
|
-
/* @__PURE__ */
|
|
5986
|
+
/* @__PURE__ */ jsx92("div", { className: "min-h-0 flex-1 space-y-1.5 overflow-y-auto px-2 pb-2", children: rows.length === 0 ? /* @__PURE__ */ jsx92("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__ */ jsx92(
|
|
5864
5987
|
NotificationRow,
|
|
5865
5988
|
{
|
|
5866
5989
|
item,
|
|
@@ -5871,13 +5994,13 @@ var NotificationBell = React78.forwardRef(
|
|
|
5871
5994
|
},
|
|
5872
5995
|
item.id
|
|
5873
5996
|
)) }),
|
|
5874
|
-
footer != null && /* @__PURE__ */
|
|
5875
|
-
items.length > 0 && onOpenArchive && /* @__PURE__ */
|
|
5997
|
+
footer != null && /* @__PURE__ */ jsx92("div", { className: "shrink-0 px-5 py-2.5 text-xs text-text-tertiary", children: footer }),
|
|
5998
|
+
items.length > 0 && onOpenArchive && /* @__PURE__ */ jsx92(
|
|
5876
5999
|
"button",
|
|
5877
6000
|
{
|
|
5878
6001
|
type: "button",
|
|
5879
6002
|
onClick: () => onOpenArchive(),
|
|
5880
|
-
className: "flex w-full shrink-0 items-center justify-center px-5 py-2.5 text-sm font-medium text-text-brand transition-colors duration-fast hover:bg-bg-surface",
|
|
6003
|
+
className: "flex w-full shrink-0 cursor-pointer items-center justify-center px-5 py-2.5 text-sm font-medium text-text-brand transition-colors duration-fast hover:bg-bg-surface",
|
|
5881
6004
|
children: hidden > 0 ? `Open notifications archive, ${hidden} more` : "Open notifications archive"
|
|
5882
6005
|
}
|
|
5883
6006
|
)
|
|
@@ -5891,9 +6014,9 @@ NotificationBell.displayName = "NotificationBell";
|
|
|
5891
6014
|
|
|
5892
6015
|
// src/components/notification-center.tsx
|
|
5893
6016
|
import * as React79 from "react";
|
|
5894
|
-
import { Check as Check11, Search as
|
|
5895
|
-
import { jsx as
|
|
5896
|
-
var chipBase = "rounded-md px-3 py-1.5 text-sm font-medium transition-colors duration-fast";
|
|
6017
|
+
import { Check as Check11, Search as Search4 } from "lucide-react";
|
|
6018
|
+
import { jsx as jsx93, jsxs as jsxs61 } from "react/jsx-runtime";
|
|
6019
|
+
var chipBase = "cursor-pointer rounded-md px-3 py-1.5 text-sm font-medium transition-colors duration-fast";
|
|
5897
6020
|
var chipOn = "bg-bg-sunken font-semibold text-text-primary";
|
|
5898
6021
|
var chipOff = "bg-bg-elevated text-text-secondary hover:text-text-primary";
|
|
5899
6022
|
function CenterRow({
|
|
@@ -5907,12 +6030,12 @@ function CenterRow({
|
|
|
5907
6030
|
const markable = Boolean(onMarkRead) && unread && item.cls !== "ephemeral";
|
|
5908
6031
|
const stamp = item.createdAt ? item.createdAt instanceof Date ? item.createdAt : new Date(item.createdAt) : null;
|
|
5909
6032
|
const age = stamp ? formatAge(stamp) : null;
|
|
5910
|
-
return /* @__PURE__ */
|
|
5911
|
-
/* @__PURE__ */
|
|
5912
|
-
/* @__PURE__ */
|
|
5913
|
-
/* @__PURE__ */
|
|
5914
|
-
(age || markable) && /* @__PURE__ */
|
|
5915
|
-
stamp && age && /* @__PURE__ */
|
|
6033
|
+
return /* @__PURE__ */ jsxs61("article", { className: "group rounded-lg bg-bg-elevated px-4 py-3", children: [
|
|
6034
|
+
/* @__PURE__ */ jsxs61("div", { className: "flex items-center gap-2", children: [
|
|
6035
|
+
/* @__PURE__ */ jsx93("span", { className: "text-xs font-semibold text-text-tertiary", children: item.source }),
|
|
6036
|
+
/* @__PURE__ */ jsx93(Badge, { variant: severityBadgeVariant(item.severity), children: severityLabels[item.severity] }),
|
|
6037
|
+
(age || markable) && /* @__PURE__ */ jsxs61("div", { className: "ml-auto flex shrink-0 items-center gap-1.5", children: [
|
|
6038
|
+
stamp && age && /* @__PURE__ */ jsx93(
|
|
5916
6039
|
"time",
|
|
5917
6040
|
{
|
|
5918
6041
|
dateTime: toDateTimeAttribute(stamp),
|
|
@@ -5920,28 +6043,28 @@ function CenterRow({
|
|
|
5920
6043
|
children: age
|
|
5921
6044
|
}
|
|
5922
6045
|
),
|
|
5923
|
-
markable && /* @__PURE__ */
|
|
6046
|
+
markable && /* @__PURE__ */ jsx93(MarkReadButton, { title: item.title, onClick: () => onMarkRead(item.id) })
|
|
5924
6047
|
] })
|
|
5925
6048
|
] }),
|
|
5926
|
-
/* @__PURE__ */
|
|
6049
|
+
/* @__PURE__ */ jsx93(
|
|
5927
6050
|
"button",
|
|
5928
6051
|
{
|
|
5929
6052
|
type: "button",
|
|
5930
6053
|
onClick: () => onItemClick?.(item),
|
|
5931
6054
|
className: cn(
|
|
5932
|
-
"mt-1 block text-left text-sm leading-snug underline-offset-2 hover:underline",
|
|
6055
|
+
"mt-1 block cursor-pointer text-left text-sm leading-snug underline-offset-2 hover:underline",
|
|
5933
6056
|
unread ? "font-semibold text-text-primary" : "font-medium text-text-secondary"
|
|
5934
6057
|
),
|
|
5935
6058
|
children: item.title
|
|
5936
6059
|
}
|
|
5937
6060
|
),
|
|
5938
|
-
item.body && /* @__PURE__ */
|
|
5939
|
-
(item.receipt || item.deepLink) && /* @__PURE__ */
|
|
5940
|
-
item.receipt && /* @__PURE__ */
|
|
5941
|
-
/* @__PURE__ */
|
|
6061
|
+
item.body && /* @__PURE__ */ jsx93("p", { className: "mt-0.5 text-sm leading-snug text-text-secondary", children: item.body }),
|
|
6062
|
+
(item.receipt || item.deepLink) && /* @__PURE__ */ jsxs61("div", { className: "mt-2 flex flex-wrap items-center gap-x-4 gap-y-1.5", children: [
|
|
6063
|
+
item.receipt && /* @__PURE__ */ jsxs61("span", { className: "inline-flex items-center gap-1.5 text-sm text-text-tertiary", children: [
|
|
6064
|
+
/* @__PURE__ */ jsx93(Check11, { className: "size-3 shrink-0 text-text-success", "aria-hidden": "true" }),
|
|
5942
6065
|
item.receipt
|
|
5943
6066
|
] }),
|
|
5944
|
-
item.deepLink && /* @__PURE__ */
|
|
6067
|
+
item.deepLink && /* @__PURE__ */ jsx93(
|
|
5945
6068
|
DeepLinkControl,
|
|
5946
6069
|
{
|
|
5947
6070
|
link: item.deepLink,
|
|
@@ -5993,25 +6116,25 @@ var NotificationCenter = React79.forwardRef(
|
|
|
5993
6116
|
const shown = matched.slice(0, limit);
|
|
5994
6117
|
const remaining = matched.length - shown.length;
|
|
5995
6118
|
const filtering = q !== "" || status !== "all" || source !== "all" || product !== "all";
|
|
5996
|
-
return /* @__PURE__ */
|
|
5997
|
-
(header || onMarkAllRead) && /* @__PURE__ */
|
|
5998
|
-
header && /* @__PURE__ */
|
|
5999
|
-
/* @__PURE__ */
|
|
6000
|
-
description && /* @__PURE__ */
|
|
6119
|
+
return /* @__PURE__ */ jsxs61("div", { ref, className: cn("mx-auto max-w-[560px]", className), children: [
|
|
6120
|
+
(header || onMarkAllRead) && /* @__PURE__ */ jsxs61("div", { className: cn("mb-4 flex items-start gap-4", !header && "justify-end"), children: [
|
|
6121
|
+
header && /* @__PURE__ */ jsxs61("div", { className: "min-w-0 flex-1", children: [
|
|
6122
|
+
/* @__PURE__ */ jsx93("h1", { className: "mb-1.5 text-2xl font-semibold tracking-tight text-text-primary", children: title }),
|
|
6123
|
+
description && /* @__PURE__ */ jsx93("p", { className: "text-sm text-text-tertiary", children: description })
|
|
6001
6124
|
] }),
|
|
6002
|
-
onMarkAllRead && /* @__PURE__ */
|
|
6125
|
+
onMarkAllRead && /* @__PURE__ */ jsx93(
|
|
6003
6126
|
"button",
|
|
6004
6127
|
{
|
|
6005
6128
|
type: "button",
|
|
6006
6129
|
onClick: () => onMarkAllRead(),
|
|
6007
|
-
className: "shrink-0 rounded-md px-2.5 py-1 text-sm font-medium text-text-tertiary transition-colors duration-fast hover:text-text-primary",
|
|
6130
|
+
className: "shrink-0 cursor-pointer rounded-md px-2.5 py-1 text-sm font-medium text-text-tertiary transition-colors duration-fast hover:text-text-primary",
|
|
6008
6131
|
children: "Read all"
|
|
6009
6132
|
}
|
|
6010
6133
|
)
|
|
6011
6134
|
] }),
|
|
6012
|
-
searchable && /* @__PURE__ */
|
|
6013
|
-
/* @__PURE__ */
|
|
6014
|
-
/* @__PURE__ */
|
|
6135
|
+
searchable && /* @__PURE__ */ jsxs61("div", { className: "mb-3 flex items-center gap-2 rounded-lg bg-bg-elevated px-3 py-2", children: [
|
|
6136
|
+
/* @__PURE__ */ jsx93(Search4, { className: "size-4 shrink-0 text-text-tertiary", "aria-hidden": "true" }),
|
|
6137
|
+
/* @__PURE__ */ jsx93(
|
|
6015
6138
|
"input",
|
|
6016
6139
|
{
|
|
6017
6140
|
type: "text",
|
|
@@ -6022,8 +6145,8 @@ var NotificationCenter = React79.forwardRef(
|
|
|
6022
6145
|
}
|
|
6023
6146
|
)
|
|
6024
6147
|
] }),
|
|
6025
|
-
/* @__PURE__ */
|
|
6026
|
-
/* @__PURE__ */
|
|
6148
|
+
/* @__PURE__ */ jsxs61("div", { className: "mb-2 flex flex-wrap gap-1.5", children: [
|
|
6149
|
+
/* @__PURE__ */ jsx93(
|
|
6027
6150
|
"button",
|
|
6028
6151
|
{
|
|
6029
6152
|
type: "button",
|
|
@@ -6032,7 +6155,7 @@ var NotificationCenter = React79.forwardRef(
|
|
|
6032
6155
|
children: "All"
|
|
6033
6156
|
}
|
|
6034
6157
|
),
|
|
6035
|
-
/* @__PURE__ */
|
|
6158
|
+
/* @__PURE__ */ jsx93(
|
|
6036
6159
|
"button",
|
|
6037
6160
|
{
|
|
6038
6161
|
type: "button",
|
|
@@ -6042,8 +6165,8 @@ var NotificationCenter = React79.forwardRef(
|
|
|
6042
6165
|
}
|
|
6043
6166
|
)
|
|
6044
6167
|
] }),
|
|
6045
|
-
/* @__PURE__ */
|
|
6046
|
-
/* @__PURE__ */
|
|
6168
|
+
/* @__PURE__ */ jsxs61("div", { className: "mb-2 flex flex-wrap gap-1.5", children: [
|
|
6169
|
+
/* @__PURE__ */ jsx93(
|
|
6047
6170
|
"button",
|
|
6048
6171
|
{
|
|
6049
6172
|
type: "button",
|
|
@@ -6052,7 +6175,7 @@ var NotificationCenter = React79.forwardRef(
|
|
|
6052
6175
|
children: "All sources"
|
|
6053
6176
|
}
|
|
6054
6177
|
),
|
|
6055
|
-
sourceChips.map((s) => /* @__PURE__ */
|
|
6178
|
+
sourceChips.map((s) => /* @__PURE__ */ jsx93(
|
|
6056
6179
|
"button",
|
|
6057
6180
|
{
|
|
6058
6181
|
type: "button",
|
|
@@ -6063,8 +6186,8 @@ var NotificationCenter = React79.forwardRef(
|
|
|
6063
6186
|
s
|
|
6064
6187
|
))
|
|
6065
6188
|
] }),
|
|
6066
|
-
products && products.length > 0 && /* @__PURE__ */
|
|
6067
|
-
/* @__PURE__ */
|
|
6189
|
+
products && products.length > 0 && /* @__PURE__ */ jsxs61("div", { className: "mb-4 flex flex-wrap gap-1.5", children: [
|
|
6190
|
+
/* @__PURE__ */ jsx93(
|
|
6068
6191
|
"button",
|
|
6069
6192
|
{
|
|
6070
6193
|
type: "button",
|
|
@@ -6073,7 +6196,7 @@ var NotificationCenter = React79.forwardRef(
|
|
|
6073
6196
|
children: "All products"
|
|
6074
6197
|
}
|
|
6075
6198
|
),
|
|
6076
|
-
products.map((p) => /* @__PURE__ */
|
|
6199
|
+
products.map((p) => /* @__PURE__ */ jsx93(
|
|
6077
6200
|
"button",
|
|
6078
6201
|
{
|
|
6079
6202
|
type: "button",
|
|
@@ -6084,8 +6207,8 @@ var NotificationCenter = React79.forwardRef(
|
|
|
6084
6207
|
p.id
|
|
6085
6208
|
))
|
|
6086
6209
|
] }),
|
|
6087
|
-
shown.length === 0 ? /* @__PURE__ */
|
|
6088
|
-
shown.map((item) => /* @__PURE__ */
|
|
6210
|
+
shown.length === 0 ? /* @__PURE__ */ jsx93("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__ */ jsxs61("div", { className: "flex flex-col gap-1.5", children: [
|
|
6211
|
+
shown.map((item) => /* @__PURE__ */ jsx93(
|
|
6089
6212
|
CenterRow,
|
|
6090
6213
|
{
|
|
6091
6214
|
item,
|
|
@@ -6096,12 +6219,12 @@ var NotificationCenter = React79.forwardRef(
|
|
|
6096
6219
|
},
|
|
6097
6220
|
item.id
|
|
6098
6221
|
)),
|
|
6099
|
-
remaining > 0 && /* @__PURE__ */
|
|
6222
|
+
remaining > 0 && /* @__PURE__ */ jsxs61(
|
|
6100
6223
|
"button",
|
|
6101
6224
|
{
|
|
6102
6225
|
type: "button",
|
|
6103
6226
|
onClick: () => setLimit((l) => l + pageSize),
|
|
6104
|
-
className: "mt-1 rounded-lg bg-bg-elevated px-4 py-2.5 text-sm font-medium text-text-secondary transition-colors duration-fast hover:bg-bg-surface hover:text-text-primary",
|
|
6227
|
+
className: "mt-1 cursor-pointer rounded-lg bg-bg-elevated px-4 py-2.5 text-sm font-medium text-text-secondary transition-colors duration-fast hover:bg-bg-surface hover:text-text-primary",
|
|
6105
6228
|
children: [
|
|
6106
6229
|
"Load ",
|
|
6107
6230
|
remaining,
|
|
@@ -6118,7 +6241,7 @@ NotificationCenter.displayName = "NotificationCenter";
|
|
|
6118
6241
|
// src/components/notification-settings.tsx
|
|
6119
6242
|
import * as React80 from "react";
|
|
6120
6243
|
import { Moon as Moon2, Plus as Plus3, Volume2 } from "lucide-react";
|
|
6121
|
-
import { Fragment as Fragment11, jsx as
|
|
6244
|
+
import { Fragment as Fragment11, jsx as jsx94, jsxs as jsxs62 } from "react/jsx-runtime";
|
|
6122
6245
|
var THRESHOLDS = [
|
|
6123
6246
|
["everything", "Everything"],
|
|
6124
6247
|
["important", "Important"],
|
|
@@ -6130,7 +6253,7 @@ function ThresholdControl({
|
|
|
6130
6253
|
value,
|
|
6131
6254
|
onChange
|
|
6132
6255
|
}) {
|
|
6133
|
-
return /* @__PURE__ */
|
|
6256
|
+
return /* @__PURE__ */ jsx94(
|
|
6134
6257
|
ToggleGroup,
|
|
6135
6258
|
{
|
|
6136
6259
|
type: "single",
|
|
@@ -6139,7 +6262,7 @@ function ThresholdControl({
|
|
|
6139
6262
|
value,
|
|
6140
6263
|
onValueChange: (next) => next && onChange(next),
|
|
6141
6264
|
className: "shrink-0",
|
|
6142
|
-
children: THRESHOLDS.map(([threshold, text]) => /* @__PURE__ */
|
|
6265
|
+
children: THRESHOLDS.map(([threshold, text]) => /* @__PURE__ */ jsx94(ToggleGroupItem, { value: threshold, children: text }, threshold))
|
|
6143
6266
|
}
|
|
6144
6267
|
);
|
|
6145
6268
|
}
|
|
@@ -6176,15 +6299,15 @@ var NotificationSettings = React80.forwardRef(
|
|
|
6176
6299
|
const scopeGroup = (scope) => {
|
|
6177
6300
|
const rows = subscriptions.filter((s) => s.scope === scope);
|
|
6178
6301
|
if (rows.length === 0) return null;
|
|
6179
|
-
return /* @__PURE__ */
|
|
6180
|
-
/* @__PURE__ */
|
|
6181
|
-
/* @__PURE__ */
|
|
6302
|
+
return /* @__PURE__ */ jsxs62("div", { children: [
|
|
6303
|
+
/* @__PURE__ */ jsx94("p", { className: "mb-1.5 px-0.5 text-xs font-medium text-text-tertiary", children: scope === "product" ? "This product" : "Organization" }),
|
|
6304
|
+
/* @__PURE__ */ jsx94("div", { className: "space-y-2", children: rows.map((sub) => /* @__PURE__ */ jsxs62(
|
|
6182
6305
|
"div",
|
|
6183
6306
|
{
|
|
6184
6307
|
className: "flex items-center gap-4 rounded-xl bg-bg-elevated px-4 py-3",
|
|
6185
6308
|
children: [
|
|
6186
|
-
/* @__PURE__ */
|
|
6187
|
-
/* @__PURE__ */
|
|
6309
|
+
/* @__PURE__ */ jsx94("p", { className: "min-w-0 flex-1 text-sm font-semibold text-text-primary", children: sub.name }),
|
|
6310
|
+
/* @__PURE__ */ jsx94(
|
|
6188
6311
|
ThresholdControl,
|
|
6189
6312
|
{
|
|
6190
6313
|
label: sub.name,
|
|
@@ -6198,10 +6321,10 @@ var NotificationSettings = React80.forwardRef(
|
|
|
6198
6321
|
)) })
|
|
6199
6322
|
] }, scope);
|
|
6200
6323
|
};
|
|
6201
|
-
return /* @__PURE__ */
|
|
6202
|
-
products && products.length > 0 && /* @__PURE__ */
|
|
6203
|
-
/* @__PURE__ */
|
|
6204
|
-
/* @__PURE__ */
|
|
6324
|
+
return /* @__PURE__ */ jsxs62("div", { ref, className: cn("space-y-5", className), children: [
|
|
6325
|
+
products && products.length > 0 && /* @__PURE__ */ jsxs62("div", { children: [
|
|
6326
|
+
/* @__PURE__ */ jsx94("p", { className: "mb-2 px-0.5 text-xs font-medium text-text-tertiary", children: "Preferences for" }),
|
|
6327
|
+
/* @__PURE__ */ jsx94(
|
|
6205
6328
|
ToggleGroup,
|
|
6206
6329
|
{
|
|
6207
6330
|
type: "single",
|
|
@@ -6210,35 +6333,35 @@ var NotificationSettings = React80.forwardRef(
|
|
|
6210
6333
|
value: tab,
|
|
6211
6334
|
onValueChange: (next) => next && setTab(next),
|
|
6212
6335
|
className: "flex-wrap",
|
|
6213
|
-
children: [{ id: DEFAULT_KEY, label: "Default" }, ...products].map((t) => /* @__PURE__ */
|
|
6336
|
+
children: [{ id: DEFAULT_KEY, label: "Default" }, ...products].map((t) => /* @__PURE__ */ jsx94(ToggleGroupItem, { value: t.id, children: t.label }, t.id))
|
|
6214
6337
|
}
|
|
6215
6338
|
)
|
|
6216
6339
|
] }),
|
|
6217
|
-
isDefault ? /* @__PURE__ */
|
|
6218
|
-
/* @__PURE__ */
|
|
6219
|
-
/* @__PURE__ */
|
|
6220
|
-
/* @__PURE__ */
|
|
6221
|
-
/* @__PURE__ */
|
|
6222
|
-
pushSlot ?? /* @__PURE__ */
|
|
6340
|
+
isDefault ? /* @__PURE__ */ jsxs62(Fragment11, { children: [
|
|
6341
|
+
/* @__PURE__ */ jsx94("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." }),
|
|
6342
|
+
/* @__PURE__ */ jsxs62(Card, { className: "border-none bg-bg-elevated p-5", children: [
|
|
6343
|
+
/* @__PURE__ */ jsx94(CardTitle, { as: "p", className: "mb-1.5", children: "Push to" }),
|
|
6344
|
+
/* @__PURE__ */ jsx94("p", { className: "mb-3 text-sm leading-relaxed text-text-secondary", children: "Forward notifications beyond the in-app record to a connected integration." }),
|
|
6345
|
+
pushSlot ?? /* @__PURE__ */ jsx94("div", { className: "rounded-lg bg-bg-surface px-4 py-6 text-center", children: /* @__PURE__ */ jsx94("p", { className: "text-sm text-text-tertiary", children: "No integrations connected." }) })
|
|
6223
6346
|
] }),
|
|
6224
|
-
mutes.length > 0 && /* @__PURE__ */
|
|
6225
|
-
/* @__PURE__ */
|
|
6226
|
-
/* @__PURE__ */
|
|
6227
|
-
/* @__PURE__ */
|
|
6228
|
-
/* @__PURE__ */
|
|
6229
|
-
/* @__PURE__ */
|
|
6230
|
-
/* @__PURE__ */
|
|
6231
|
-
"Muted
|
|
6347
|
+
mutes.length > 0 && /* @__PURE__ */ jsxs62("div", { children: [
|
|
6348
|
+
/* @__PURE__ */ jsx94("p", { className: "mb-1.5 px-0.5 text-xs font-medium text-text-tertiary", children: "Muted" }),
|
|
6349
|
+
/* @__PURE__ */ jsx94(Card, { className: "border-none bg-bg-elevated p-2", children: mutes.map((m) => /* @__PURE__ */ jsxs62("div", { className: "flex items-center gap-3 rounded-lg px-3 py-2.5", children: [
|
|
6350
|
+
/* @__PURE__ */ jsx94(Moon2, { className: "size-4 shrink-0 text-text-tertiary", "aria-hidden": "true" }),
|
|
6351
|
+
/* @__PURE__ */ jsxs62("div", { className: "min-w-0 flex-1", children: [
|
|
6352
|
+
/* @__PURE__ */ jsx94("p", { className: "text-sm font-medium text-text-primary", children: m.source }),
|
|
6353
|
+
/* @__PURE__ */ jsxs62("p", { className: "text-sm text-text-tertiary", children: [
|
|
6354
|
+
"Muted, ",
|
|
6232
6355
|
m.label,
|
|
6233
6356
|
". Critical still comes through."
|
|
6234
6357
|
] })
|
|
6235
6358
|
] }),
|
|
6236
|
-
/* @__PURE__ */
|
|
6359
|
+
/* @__PURE__ */ jsx94(
|
|
6237
6360
|
"button",
|
|
6238
6361
|
{
|
|
6239
6362
|
type: "button",
|
|
6240
6363
|
onClick: () => onUnmute?.(m.source),
|
|
6241
|
-
className: "rounded-md px-2.5 py-1 text-sm font-medium text-text-brand transition-colors duration-fast hover:bg-bg-surface",
|
|
6364
|
+
className: "cursor-pointer rounded-md px-2.5 py-1 text-sm font-medium text-text-brand transition-colors duration-fast hover:bg-bg-surface",
|
|
6242
6365
|
children: "Unmute"
|
|
6243
6366
|
}
|
|
6244
6367
|
)
|
|
@@ -6246,13 +6369,13 @@ var NotificationSettings = React80.forwardRef(
|
|
|
6246
6369
|
] }),
|
|
6247
6370
|
scopeGroup("product"),
|
|
6248
6371
|
scopeGroup("org"),
|
|
6249
|
-
onSoundEnabledChange && /* @__PURE__ */
|
|
6250
|
-
/* @__PURE__ */
|
|
6251
|
-
/* @__PURE__ */
|
|
6252
|
-
/* @__PURE__ */
|
|
6253
|
-
/* @__PURE__ */
|
|
6372
|
+
onSoundEnabledChange && /* @__PURE__ */ jsx94(Card, { className: "border-none bg-bg-elevated p-4", children: /* @__PURE__ */ jsxs62("div", { className: "flex items-center gap-3", children: [
|
|
6373
|
+
/* @__PURE__ */ jsx94(Volume2, { className: "size-4 text-text-tertiary", "aria-hidden": "true" }),
|
|
6374
|
+
/* @__PURE__ */ jsxs62("div", { className: "flex-1", children: [
|
|
6375
|
+
/* @__PURE__ */ jsx94("p", { className: "text-sm font-medium text-text-primary", children: "Notification sound" }),
|
|
6376
|
+
/* @__PURE__ */ jsx94("p", { className: "text-sm text-text-tertiary", children: "Play a tone when a notification arrives. Critical always chimes." })
|
|
6254
6377
|
] }),
|
|
6255
|
-
/* @__PURE__ */
|
|
6378
|
+
/* @__PURE__ */ jsx94(
|
|
6256
6379
|
Switch,
|
|
6257
6380
|
{
|
|
6258
6381
|
checked: soundEnabled ?? false,
|
|
@@ -6261,40 +6384,40 @@ var NotificationSettings = React80.forwardRef(
|
|
|
6261
6384
|
}
|
|
6262
6385
|
)
|
|
6263
6386
|
] }) })
|
|
6264
|
-
] }) : !customized ? /* @__PURE__ */
|
|
6265
|
-
/* @__PURE__ */
|
|
6387
|
+
] }) : !customized ? /* @__PURE__ */ jsxs62(Card, { className: "border-none bg-bg-elevated p-8 text-center", children: [
|
|
6388
|
+
/* @__PURE__ */ jsxs62("p", { className: "text-sm font-semibold text-text-primary", children: [
|
|
6266
6389
|
productLabel,
|
|
6267
6390
|
" follows your Default preferences."
|
|
6268
6391
|
] }),
|
|
6269
|
-
/* @__PURE__ */
|
|
6270
|
-
/* @__PURE__ */
|
|
6392
|
+
/* @__PURE__ */ jsx94("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." }),
|
|
6393
|
+
/* @__PURE__ */ jsxs62(
|
|
6271
6394
|
"button",
|
|
6272
6395
|
{
|
|
6273
6396
|
type: "button",
|
|
6274
6397
|
onClick: customize,
|
|
6275
|
-
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 duration-fast hover:bg-bg-brand-hover",
|
|
6398
|
+
className: "mt-5 inline-flex cursor-pointer 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 duration-fast hover:bg-bg-brand-hover",
|
|
6276
6399
|
children: [
|
|
6277
|
-
/* @__PURE__ */
|
|
6400
|
+
/* @__PURE__ */ jsx94(Plus3, { className: "size-4", "aria-hidden": "true" }),
|
|
6278
6401
|
" Customize for ",
|
|
6279
6402
|
productLabel
|
|
6280
6403
|
]
|
|
6281
6404
|
}
|
|
6282
6405
|
)
|
|
6283
|
-
] }) : /* @__PURE__ */
|
|
6284
|
-
/* @__PURE__ */
|
|
6285
|
-
/* @__PURE__ */
|
|
6286
|
-
/* @__PURE__ */
|
|
6406
|
+
] }) : /* @__PURE__ */ jsxs62(Fragment11, { children: [
|
|
6407
|
+
/* @__PURE__ */ jsx94(Card, { className: "border-none bg-bg-brand-subtle p-3.5", children: /* @__PURE__ */ jsxs62("div", { className: "flex items-center gap-3", children: [
|
|
6408
|
+
/* @__PURE__ */ jsxs62("div", { className: "min-w-0 flex-1", children: [
|
|
6409
|
+
/* @__PURE__ */ jsxs62("p", { className: "text-sm font-semibold text-text-brand", children: [
|
|
6287
6410
|
"Custom preferences for ",
|
|
6288
6411
|
productLabel
|
|
6289
6412
|
] }),
|
|
6290
|
-
/* @__PURE__ */
|
|
6413
|
+
/* @__PURE__ */ jsx94("p", { className: "text-sm leading-relaxed text-text-secondary", children: "Only the interrupt thresholds below differ. Sound and forwarding follow Default." })
|
|
6291
6414
|
] }),
|
|
6292
|
-
/* @__PURE__ */
|
|
6415
|
+
/* @__PURE__ */ jsx94(
|
|
6293
6416
|
"button",
|
|
6294
6417
|
{
|
|
6295
6418
|
type: "button",
|
|
6296
6419
|
onClick: resetToDefault,
|
|
6297
|
-
className: "shrink-0 rounded-md px-2.5 py-1 text-sm font-medium text-text-tertiary transition-colors duration-fast hover:text-text-danger",
|
|
6420
|
+
className: "shrink-0 cursor-pointer rounded-md px-2.5 py-1 text-sm font-medium text-text-tertiary transition-colors duration-fast hover:text-text-danger",
|
|
6298
6421
|
children: "Reset to Default"
|
|
6299
6422
|
}
|
|
6300
6423
|
)
|
|
@@ -6309,11 +6432,11 @@ NotificationSettings.displayName = "NotificationSettings";
|
|
|
6309
6432
|
// src/components/notification-toast.tsx
|
|
6310
6433
|
import * as React81 from "react";
|
|
6311
6434
|
import { X as X4 } from "lucide-react";
|
|
6312
|
-
import { jsx as
|
|
6313
|
-
var chipBase2 = "rounded-lg px-2.5 py-1 text-sm font-medium transition-colors duration-fast";
|
|
6435
|
+
import { jsx as jsx95, jsxs as jsxs63 } from "react/jsx-runtime";
|
|
6436
|
+
var chipBase2 = "cursor-pointer rounded-lg px-2.5 py-1 text-sm font-medium transition-colors duration-fast";
|
|
6314
6437
|
var chipPrimary = "bg-bg-brand text-text-on-brand hover:bg-bg-brand-hover";
|
|
6315
6438
|
var chipDestructive = "bg-bg-elevated text-text-danger hover:bg-bg-surface";
|
|
6316
|
-
var linkAction = "text-sm font-semibold text-text-brand transition-colors duration-fast hover:text-text-primary";
|
|
6439
|
+
var linkAction = "cursor-pointer text-sm font-semibold text-text-brand transition-colors duration-fast hover:text-text-primary";
|
|
6317
6440
|
var NotificationToast = React81.forwardRef(
|
|
6318
6441
|
({
|
|
6319
6442
|
item,
|
|
@@ -6333,7 +6456,7 @@ var NotificationToast = React81.forwardRef(
|
|
|
6333
6456
|
const progressLine = progressLabel === void 0 && percent !== void 0 ? `live, ${Math.round(percent)}%` : progressLabel;
|
|
6334
6457
|
const barId = React81.useId();
|
|
6335
6458
|
const hasProgressLine = progressLine !== null && progressLine !== void 0;
|
|
6336
|
-
return /* @__PURE__ */
|
|
6459
|
+
return /* @__PURE__ */ jsxs63(
|
|
6337
6460
|
"div",
|
|
6338
6461
|
{
|
|
6339
6462
|
ref,
|
|
@@ -6344,40 +6467,40 @@ var NotificationToast = React81.forwardRef(
|
|
|
6344
6467
|
className
|
|
6345
6468
|
),
|
|
6346
6469
|
children: [
|
|
6347
|
-
/* @__PURE__ */
|
|
6348
|
-
showSource && /* @__PURE__ */
|
|
6349
|
-
/* @__PURE__ */
|
|
6350
|
-
(overflow || onDismiss) && /* @__PURE__ */
|
|
6470
|
+
/* @__PURE__ */ jsxs63("div", { className: "flex items-center gap-2", children: [
|
|
6471
|
+
showSource && /* @__PURE__ */ jsx95("span", { className: "text-xs font-semibold text-text-tertiary", children: item.source }),
|
|
6472
|
+
/* @__PURE__ */ jsx95(Badge, { variant: severityBadgeVariant(item.severity), children: severityLabels[item.severity] }),
|
|
6473
|
+
(overflow || onDismiss) && /* @__PURE__ */ jsxs63("span", { className: "-mr-1 ml-auto flex shrink-0 items-center gap-1", children: [
|
|
6351
6474
|
overflow,
|
|
6352
|
-
onDismiss && /* @__PURE__ */
|
|
6475
|
+
onDismiss && /* @__PURE__ */ jsx95(
|
|
6353
6476
|
"button",
|
|
6354
6477
|
{
|
|
6355
6478
|
type: "button",
|
|
6356
6479
|
"aria-label": dismissLabel,
|
|
6357
6480
|
onClick: () => onDismiss(item),
|
|
6358
|
-
className: "flex size-5 shrink-0 items-center justify-center rounded-md text-text-tertiary transition-colors duration-fast hover:bg-bg-surface hover:text-text-primary",
|
|
6359
|
-
children: /* @__PURE__ */
|
|
6481
|
+
className: "flex size-5 shrink-0 cursor-pointer items-center justify-center rounded-md text-text-tertiary transition-colors duration-fast hover:bg-bg-surface hover:text-text-primary",
|
|
6482
|
+
children: /* @__PURE__ */ jsx95(X4, { className: "size-3.5", "aria-hidden": "true" })
|
|
6360
6483
|
}
|
|
6361
6484
|
)
|
|
6362
6485
|
] })
|
|
6363
6486
|
] }),
|
|
6364
|
-
onItemClick ? /* @__PURE__ */
|
|
6487
|
+
onItemClick ? /* @__PURE__ */ jsx95(
|
|
6365
6488
|
"button",
|
|
6366
6489
|
{
|
|
6367
6490
|
type: "button",
|
|
6368
6491
|
onClick: () => onItemClick(item),
|
|
6369
|
-
className: "mt-1 block text-left text-sm font-semibold leading-snug text-text-primary underline-offset-2 hover:underline",
|
|
6492
|
+
className: "mt-1 block cursor-pointer text-left text-sm font-semibold leading-snug text-text-primary underline-offset-2 hover:underline",
|
|
6370
6493
|
children: item.title
|
|
6371
6494
|
}
|
|
6372
|
-
) : /* @__PURE__ */
|
|
6373
|
-
item.body && /* @__PURE__ */
|
|
6374
|
-
note && /* @__PURE__ */
|
|
6495
|
+
) : /* @__PURE__ */ jsx95("p", { className: "mt-1 text-sm font-semibold leading-snug text-text-primary", children: item.title }),
|
|
6496
|
+
item.body && /* @__PURE__ */ jsx95("p", { className: "mt-0.5 text-sm leading-snug text-text-secondary", children: item.body }),
|
|
6497
|
+
note && /* @__PURE__ */ jsx95("p", { className: "mt-1.5 text-xs font-medium text-text-warning", children: note }),
|
|
6375
6498
|
percent !== void 0 && // The card is a `role="status"`, which implies `aria-atomic` — every tick of the bar would
|
|
6376
6499
|
// otherwise re-announce the whole card. `aria-live="off"` on the subtree that moves is the
|
|
6377
6500
|
// one cheap mitigation: the bar stays in the accessibility tree to be read on demand, it
|
|
6378
6501
|
// just stops interrupting.
|
|
6379
|
-
/* @__PURE__ */
|
|
6380
|
-
/* @__PURE__ */
|
|
6502
|
+
/* @__PURE__ */ jsxs63("div", { className: "mt-2", "aria-live": "off", children: [
|
|
6503
|
+
/* @__PURE__ */ jsx95(
|
|
6381
6504
|
Progress,
|
|
6382
6505
|
{
|
|
6383
6506
|
value: percent,
|
|
@@ -6386,11 +6509,11 @@ var NotificationToast = React81.forwardRef(
|
|
|
6386
6509
|
"aria-label": hasProgressLine ? void 0 : "Progress"
|
|
6387
6510
|
}
|
|
6388
6511
|
),
|
|
6389
|
-
hasProgressLine && /* @__PURE__ */
|
|
6512
|
+
hasProgressLine && /* @__PURE__ */ jsx95("p", { id: barId, className: "mt-0.5 text-xs text-text-secondary", children: progressLine })
|
|
6390
6513
|
] }),
|
|
6391
|
-
actions.length > 0 && /* @__PURE__ */
|
|
6514
|
+
actions.length > 0 && /* @__PURE__ */ jsx95("div", { className: "mt-2.5 flex flex-wrap items-center gap-2", children: actions.map((action) => {
|
|
6392
6515
|
const variant = action.variant ?? "link";
|
|
6393
|
-
return /* @__PURE__ */
|
|
6516
|
+
return /* @__PURE__ */ jsx95(
|
|
6394
6517
|
"button",
|
|
6395
6518
|
{
|
|
6396
6519
|
type: "button",
|
|
@@ -6410,7 +6533,7 @@ NotificationToast.displayName = "NotificationToast";
|
|
|
6410
6533
|
|
|
6411
6534
|
// src/components/notification-toaster.tsx
|
|
6412
6535
|
import * as React82 from "react";
|
|
6413
|
-
import { jsx as
|
|
6536
|
+
import { jsx as jsx96 } from "react/jsx-runtime";
|
|
6414
6537
|
var positions = {
|
|
6415
6538
|
"bottom-right": "bottom-6 right-6 flex-col",
|
|
6416
6539
|
"bottom-left": "bottom-6 left-6 flex-col",
|
|
@@ -6483,7 +6606,7 @@ var NotificationToaster = React82.forwardRef(
|
|
|
6483
6606
|
};
|
|
6484
6607
|
}, [liveIds, paused, fyiDwell, importantDwell, criticalDwell]);
|
|
6485
6608
|
if (shown.length === 0) return null;
|
|
6486
|
-
return /* @__PURE__ */
|
|
6609
|
+
return /* @__PURE__ */ jsx96(
|
|
6487
6610
|
"div",
|
|
6488
6611
|
{
|
|
6489
6612
|
ref,
|
|
@@ -6496,7 +6619,7 @@ var NotificationToaster = React82.forwardRef(
|
|
|
6496
6619
|
positions[position],
|
|
6497
6620
|
className
|
|
6498
6621
|
),
|
|
6499
|
-
children: shown.map((item, i) => /* @__PURE__ */
|
|
6622
|
+
children: shown.map((item, i) => /* @__PURE__ */ jsx96("div", { className: "pointer-events-auto", children: /* @__PURE__ */ jsx96(
|
|
6500
6623
|
NotificationToast,
|
|
6501
6624
|
{
|
|
6502
6625
|
item,
|
|
@@ -6778,7 +6901,7 @@ var AUTH_QUIET_BUTTON = "flex h-[46px] w-full items-center justify-center gap-[1
|
|
|
6778
6901
|
var AUTH_BUTTON_SHADOW = "var(--auth-btn-shadow)";
|
|
6779
6902
|
|
|
6780
6903
|
// src/components/organization-onboarding-form.tsx
|
|
6781
|
-
import { jsx as
|
|
6904
|
+
import { jsx as jsx97, jsxs as jsxs64 } from "react/jsx-runtime";
|
|
6782
6905
|
var CONTROLLER_SHARE_PCT = 50;
|
|
6783
6906
|
var MAX_BENEFICIAL_OWNERS = 50;
|
|
6784
6907
|
var REQUIRED_FIELD_LABELS = {
|
|
@@ -6793,7 +6916,7 @@ function isOwnershipViolation(violation) {
|
|
|
6793
6916
|
return /ownership[_\s-]?confirmed/i.test(violation);
|
|
6794
6917
|
}
|
|
6795
6918
|
function RequiredMark() {
|
|
6796
|
-
return /* @__PURE__ */
|
|
6919
|
+
return /* @__PURE__ */ jsx97("span", { className: "text-text-danger", children: " *" });
|
|
6797
6920
|
}
|
|
6798
6921
|
function parseShare(raw) {
|
|
6799
6922
|
if (!/^\d{1,3}$/.test(raw.trim())) return null;
|
|
@@ -6913,12 +7036,12 @@ function OrganizationOnboardingForm({
|
|
|
6913
7036
|
submitting,
|
|
6914
7037
|
serverError
|
|
6915
7038
|
]);
|
|
6916
|
-
const countryField = (params) => /* @__PURE__ */
|
|
6917
|
-
/* @__PURE__ */
|
|
7039
|
+
const countryField = (params) => /* @__PURE__ */ jsxs64("div", { className: "space-y-1.5", children: [
|
|
7040
|
+
/* @__PURE__ */ jsxs64(Label2, { htmlFor: params.id, children: [
|
|
6918
7041
|
params.label,
|
|
6919
|
-
/* @__PURE__ */
|
|
7042
|
+
/* @__PURE__ */ jsx97(RequiredMark, {})
|
|
6920
7043
|
] }),
|
|
6921
|
-
/* @__PURE__ */
|
|
7044
|
+
/* @__PURE__ */ jsx97(
|
|
6922
7045
|
Select,
|
|
6923
7046
|
{
|
|
6924
7047
|
id: params.id,
|
|
@@ -6931,13 +7054,13 @@ function OrganizationOnboardingForm({
|
|
|
6931
7054
|
}
|
|
6932
7055
|
)
|
|
6933
7056
|
] });
|
|
6934
|
-
return /* @__PURE__ */
|
|
6935
|
-
/* @__PURE__ */
|
|
6936
|
-
/* @__PURE__ */
|
|
7057
|
+
return /* @__PURE__ */ jsxs64("form", { onSubmit: handleSubmit, className: cn("space-y-4", className), children: [
|
|
7058
|
+
/* @__PURE__ */ jsxs64("div", { className: "space-y-1.5", children: [
|
|
7059
|
+
/* @__PURE__ */ jsxs64(Label2, { htmlFor: "create-org-name", children: [
|
|
6937
7060
|
REQUIRED_FIELD_LABELS.name,
|
|
6938
|
-
/* @__PURE__ */
|
|
7061
|
+
/* @__PURE__ */ jsx97(RequiredMark, {})
|
|
6939
7062
|
] }),
|
|
6940
|
-
/* @__PURE__ */
|
|
7063
|
+
/* @__PURE__ */ jsx97(
|
|
6941
7064
|
Input,
|
|
6942
7065
|
{
|
|
6943
7066
|
id: "create-org-name",
|
|
@@ -6948,12 +7071,12 @@ function OrganizationOnboardingForm({
|
|
|
6948
7071
|
}
|
|
6949
7072
|
)
|
|
6950
7073
|
] }),
|
|
6951
|
-
/* @__PURE__ */
|
|
6952
|
-
/* @__PURE__ */
|
|
7074
|
+
/* @__PURE__ */ jsxs64("div", { className: "space-y-1.5", children: [
|
|
7075
|
+
/* @__PURE__ */ jsxs64(Label2, { htmlFor: "create-org-legal-name", children: [
|
|
6953
7076
|
REQUIRED_FIELD_LABELS.legalName,
|
|
6954
|
-
/* @__PURE__ */
|
|
7077
|
+
/* @__PURE__ */ jsx97(RequiredMark, {})
|
|
6955
7078
|
] }),
|
|
6956
|
-
/* @__PURE__ */
|
|
7079
|
+
/* @__PURE__ */ jsx97(
|
|
6957
7080
|
Input,
|
|
6958
7081
|
{
|
|
6959
7082
|
id: "create-org-legal-name",
|
|
@@ -6964,12 +7087,12 @@ function OrganizationOnboardingForm({
|
|
|
6964
7087
|
}
|
|
6965
7088
|
)
|
|
6966
7089
|
] }),
|
|
6967
|
-
/* @__PURE__ */
|
|
6968
|
-
/* @__PURE__ */
|
|
7090
|
+
/* @__PURE__ */ jsxs64("div", { className: "space-y-1.5", children: [
|
|
7091
|
+
/* @__PURE__ */ jsxs64(Label2, { htmlFor: "create-org-owner-name", children: [
|
|
6969
7092
|
REQUIRED_FIELD_LABELS.ownerName,
|
|
6970
|
-
/* @__PURE__ */
|
|
7093
|
+
/* @__PURE__ */ jsx97(RequiredMark, {})
|
|
6971
7094
|
] }),
|
|
6972
|
-
/* @__PURE__ */
|
|
7095
|
+
/* @__PURE__ */ jsx97(
|
|
6973
7096
|
Input,
|
|
6974
7097
|
{
|
|
6975
7098
|
id: "create-org-owner-name",
|
|
@@ -6992,10 +7115,10 @@ function OrganizationOnboardingForm({
|
|
|
6992
7115
|
value: residencyCountry,
|
|
6993
7116
|
onChange: setResidencyCountry
|
|
6994
7117
|
}),
|
|
6995
|
-
/* @__PURE__ */
|
|
6996
|
-
/* @__PURE__ */
|
|
6997
|
-
/* @__PURE__ */
|
|
6998
|
-
/* @__PURE__ */
|
|
7118
|
+
/* @__PURE__ */ jsxs64("div", { className: "space-y-2", children: [
|
|
7119
|
+
/* @__PURE__ */ jsxs64("div", { className: "flex items-center justify-between", children: [
|
|
7120
|
+
/* @__PURE__ */ jsx97(Label2, { children: "Beneficial owners" }),
|
|
7121
|
+
/* @__PURE__ */ jsx97(
|
|
6999
7122
|
Button,
|
|
7000
7123
|
{
|
|
7001
7124
|
type: "button",
|
|
@@ -7008,16 +7131,16 @@ function OrganizationOnboardingForm({
|
|
|
7008
7131
|
}
|
|
7009
7132
|
)
|
|
7010
7133
|
] }),
|
|
7011
|
-
owners.length === 0 && /* @__PURE__ */
|
|
7012
|
-
owners.map((row) => /* @__PURE__ */
|
|
7134
|
+
owners.length === 0 && /* @__PURE__ */ jsx97("p", { className: "text-xs text-text-tertiary", children: "List the natural persons who ultimately own or control the organization." }),
|
|
7135
|
+
owners.map((row) => /* @__PURE__ */ jsxs64(
|
|
7013
7136
|
"div",
|
|
7014
7137
|
{
|
|
7015
7138
|
"data-testid": `beneficial-owner-row-${row.key}`,
|
|
7016
7139
|
className: "flex items-end gap-2",
|
|
7017
7140
|
children: [
|
|
7018
|
-
/* @__PURE__ */
|
|
7019
|
-
/* @__PURE__ */
|
|
7020
|
-
/* @__PURE__ */
|
|
7141
|
+
/* @__PURE__ */ jsxs64("div", { className: "flex-1 space-y-1", children: [
|
|
7142
|
+
/* @__PURE__ */ jsx97(Label2, { htmlFor: `bo-name-${row.key}`, className: "text-xs", children: "Name" }),
|
|
7143
|
+
/* @__PURE__ */ jsx97(
|
|
7021
7144
|
Input,
|
|
7022
7145
|
{
|
|
7023
7146
|
id: `bo-name-${row.key}`,
|
|
@@ -7027,9 +7150,9 @@ function OrganizationOnboardingForm({
|
|
|
7027
7150
|
}
|
|
7028
7151
|
)
|
|
7029
7152
|
] }),
|
|
7030
|
-
/* @__PURE__ */
|
|
7031
|
-
/* @__PURE__ */
|
|
7032
|
-
/* @__PURE__ */
|
|
7153
|
+
/* @__PURE__ */ jsxs64("div", { className: "w-40 space-y-1", children: [
|
|
7154
|
+
/* @__PURE__ */ jsx97(Label2, { htmlFor: `bo-country-${row.key}`, className: "text-xs", children: "Country" }),
|
|
7155
|
+
/* @__PURE__ */ jsx97(
|
|
7033
7156
|
Select,
|
|
7034
7157
|
{
|
|
7035
7158
|
id: `bo-country-${row.key}`,
|
|
@@ -7042,9 +7165,9 @@ function OrganizationOnboardingForm({
|
|
|
7042
7165
|
}
|
|
7043
7166
|
)
|
|
7044
7167
|
] }),
|
|
7045
|
-
/* @__PURE__ */
|
|
7046
|
-
/* @__PURE__ */
|
|
7047
|
-
/* @__PURE__ */
|
|
7168
|
+
/* @__PURE__ */ jsxs64("div", { className: "w-24 space-y-1", children: [
|
|
7169
|
+
/* @__PURE__ */ jsx97(Label2, { htmlFor: `bo-share-${row.key}`, className: "text-xs", children: "Share %" }),
|
|
7170
|
+
/* @__PURE__ */ jsx97(
|
|
7048
7171
|
Input,
|
|
7049
7172
|
{
|
|
7050
7173
|
id: `bo-share-${row.key}`,
|
|
@@ -7055,7 +7178,7 @@ function OrganizationOnboardingForm({
|
|
|
7055
7178
|
}
|
|
7056
7179
|
)
|
|
7057
7180
|
] }),
|
|
7058
|
-
/* @__PURE__ */
|
|
7181
|
+
/* @__PURE__ */ jsx97(
|
|
7059
7182
|
Button,
|
|
7060
7183
|
{
|
|
7061
7184
|
type: "button",
|
|
@@ -7070,16 +7193,16 @@ function OrganizationOnboardingForm({
|
|
|
7070
7193
|
},
|
|
7071
7194
|
row.key
|
|
7072
7195
|
)),
|
|
7073
|
-
!ownersValid && /* @__PURE__ */
|
|
7074
|
-
shareSum > 100 && /* @__PURE__ */
|
|
7196
|
+
!ownersValid && /* @__PURE__ */ jsx97("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." }),
|
|
7197
|
+
shareSum > 100 && /* @__PURE__ */ jsxs64("p", { "data-testid": "beneficial-owners-sum-warning", className: "text-xs text-text-warning", children: [
|
|
7075
7198
|
"The listed shares add up to ",
|
|
7076
7199
|
shareSum,
|
|
7077
7200
|
"%, which is more than 100%."
|
|
7078
7201
|
] })
|
|
7079
7202
|
] }),
|
|
7080
|
-
needsOwnershipConfirmation && /* @__PURE__ */
|
|
7081
|
-
/* @__PURE__ */
|
|
7082
|
-
/* @__PURE__ */
|
|
7203
|
+
needsOwnershipConfirmation && /* @__PURE__ */ jsxs64("div", { className: "space-y-1", children: [
|
|
7204
|
+
/* @__PURE__ */ jsxs64("div", { className: "flex items-start gap-2", children: [
|
|
7205
|
+
/* @__PURE__ */ jsx97(
|
|
7083
7206
|
Checkbox,
|
|
7084
7207
|
{
|
|
7085
7208
|
id: "create-org-ownership-confirmed",
|
|
@@ -7089,19 +7212,19 @@ function OrganizationOnboardingForm({
|
|
|
7089
7212
|
onCheckedChange: (value) => setOwnershipConfirmed(value === true)
|
|
7090
7213
|
}
|
|
7091
7214
|
),
|
|
7092
|
-
/* @__PURE__ */
|
|
7215
|
+
/* @__PURE__ */ jsxs64(
|
|
7093
7216
|
Label2,
|
|
7094
7217
|
{
|
|
7095
7218
|
htmlFor: "create-org-ownership-confirmed",
|
|
7096
7219
|
className: "text-xs font-regular leading-snug",
|
|
7097
7220
|
children: [
|
|
7098
7221
|
"I confirm the ownership structure above is complete and correct",
|
|
7099
|
-
/* @__PURE__ */
|
|
7222
|
+
/* @__PURE__ */ jsx97(RequiredMark, {})
|
|
7100
7223
|
]
|
|
7101
7224
|
}
|
|
7102
7225
|
)
|
|
7103
7226
|
] }),
|
|
7104
|
-
showConfirmationError && /* @__PURE__ */
|
|
7227
|
+
showConfirmationError && /* @__PURE__ */ jsx97(
|
|
7105
7228
|
"p",
|
|
7106
7229
|
{
|
|
7107
7230
|
id: "create-org-ownership-error",
|
|
@@ -7111,31 +7234,31 @@ function OrganizationOnboardingForm({
|
|
|
7111
7234
|
}
|
|
7112
7235
|
)
|
|
7113
7236
|
] }),
|
|
7114
|
-
showRequiredError && /* @__PURE__ */
|
|
7115
|
-
(serverError || otherViolations.length > 0) && /* @__PURE__ */
|
|
7237
|
+
showRequiredError && /* @__PURE__ */ jsx97(InlineError, { "data-testid": "create-org-required-error", children: missingRequired.length === 1 ? `${missingRequired[0]} is required` : `These fields are required: ${missingRequired.join(", ")}` }),
|
|
7238
|
+
(serverError || otherViolations.length > 0) && /* @__PURE__ */ jsxs64(InlineError, { "data-testid": "create-org-server-error", children: [
|
|
7116
7239
|
serverError,
|
|
7117
|
-
otherViolations.length > 0 && /* @__PURE__ */
|
|
7240
|
+
otherViolations.length > 0 && /* @__PURE__ */ jsx97("ul", { "data-testid": "create-org-violations", className: "mt-1 list-disc pl-4", children: otherViolations.map((violation) => /* @__PURE__ */ jsx97("li", { children: violation }, violation)) })
|
|
7118
7241
|
] }),
|
|
7119
|
-
/* @__PURE__ */
|
|
7120
|
-
/* @__PURE__ */
|
|
7242
|
+
/* @__PURE__ */ jsxs64("div", { className: "space-y-2 pt-1", children: [
|
|
7243
|
+
/* @__PURE__ */ jsx97(
|
|
7121
7244
|
"button",
|
|
7122
7245
|
{
|
|
7123
7246
|
type: "submit",
|
|
7124
7247
|
"data-testid": "submit-create-org",
|
|
7125
7248
|
disabled: !canSubmit,
|
|
7126
|
-
className: AUTH_FILLED_BUTTON,
|
|
7249
|
+
className: cn("cursor-pointer", AUTH_FILLED_BUTTON),
|
|
7127
7250
|
style: { boxShadow: AUTH_BUTTON_SHADOW },
|
|
7128
7251
|
children: submitting ? "Creating\u2026" : submitLabel
|
|
7129
7252
|
}
|
|
7130
7253
|
),
|
|
7131
|
-
onCancel && /* @__PURE__ */
|
|
7254
|
+
onCancel && /* @__PURE__ */ jsx97("button", { type: "button", onClick: onCancel, className: cn("cursor-pointer", AUTH_QUIET_BUTTON), children: "Cancel" })
|
|
7132
7255
|
] })
|
|
7133
7256
|
] });
|
|
7134
7257
|
}
|
|
7135
7258
|
|
|
7136
7259
|
// src/components/list-columns.tsx
|
|
7137
7260
|
import * as React84 from "react";
|
|
7138
|
-
import { jsx as
|
|
7261
|
+
import { jsx as jsx98, jsxs as jsxs65 } from "react/jsx-runtime";
|
|
7139
7262
|
var CELL_WIDTH = { 20: "w-20", 24: "w-24", 28: "w-28", 32: "w-32" };
|
|
7140
7263
|
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";
|
|
7141
7264
|
var cellsClass = "flex shrink-0 items-center gap-3";
|
|
@@ -7155,11 +7278,11 @@ function warnDuplicateKeys(columns, where) {
|
|
|
7155
7278
|
}
|
|
7156
7279
|
var ListHeader = React84.forwardRef(function ListHeader2({ lead, columns, mark = true, trailing = true, className, ...props }, ref) {
|
|
7157
7280
|
warnDuplicateKeys(columns, "ListHeader");
|
|
7158
|
-
return /* @__PURE__ */
|
|
7159
|
-
mark && /* @__PURE__ */
|
|
7160
|
-
/* @__PURE__ */
|
|
7161
|
-
/* @__PURE__ */
|
|
7162
|
-
trailing && /* @__PURE__ */
|
|
7281
|
+
return /* @__PURE__ */ jsxs65("div", { ref, className: cn(headerClass, className), ...props, children: [
|
|
7282
|
+
mark && /* @__PURE__ */ jsx98("span", { className: "size-8 shrink-0", "aria-hidden": true }),
|
|
7283
|
+
/* @__PURE__ */ jsx98("span", { className: "min-w-0 flex-1 truncate", children: lead }),
|
|
7284
|
+
/* @__PURE__ */ jsx98("span", { className: cellsClass, children: columns.map((c) => /* @__PURE__ */ jsx98("span", { className: cn(CELL_WIDTH[c.width], cellClass), children: c.label }, c.key)) }),
|
|
7285
|
+
trailing && /* @__PURE__ */ jsx98("span", { className: "size-4 shrink-0", "aria-hidden": true })
|
|
7163
7286
|
] });
|
|
7164
7287
|
});
|
|
7165
7288
|
function cellValue(values, column) {
|
|
@@ -7169,7 +7292,7 @@ function cellValue(values, column) {
|
|
|
7169
7292
|
}
|
|
7170
7293
|
var ListCells = React84.forwardRef(function ListCells2({ columns, values, className, ...props }, ref) {
|
|
7171
7294
|
warnDuplicateKeys(columns, "ListCells");
|
|
7172
|
-
return /* @__PURE__ */
|
|
7295
|
+
return /* @__PURE__ */ jsx98("span", { ref, className: cn(cellsClass, className), ...props, children: columns.map((c) => /* @__PURE__ */ jsx98(
|
|
7173
7296
|
"span",
|
|
7174
7297
|
{
|
|
7175
7298
|
className: cn(CELL_WIDTH[c.width], cellClass, c.quiet && "text-text-tertiary"),
|
|
@@ -7183,8 +7306,8 @@ ListCells.displayName = "ListCells";
|
|
|
7183
7306
|
|
|
7184
7307
|
// src/components/theme-picker.tsx
|
|
7185
7308
|
import * as React85 from "react";
|
|
7186
|
-
import { Check as Check12
|
|
7187
|
-
import { jsx as
|
|
7309
|
+
import { Check as Check12 } from "lucide-react";
|
|
7310
|
+
import { jsx as jsx99, jsxs as jsxs66 } from "react/jsx-runtime";
|
|
7188
7311
|
var THEME_SWATCHES = {
|
|
7189
7312
|
// --bg-surface --bg-sunken --bg-overlay --border-default --text-tertiary
|
|
7190
7313
|
light: { canvas: "#f2f3f4", rail: "#e1e2e4", body: "#ffffff", quiet: "#bbbec7", strong: "#535a6e" },
|
|
@@ -7198,13 +7321,13 @@ var OPTIONS = [
|
|
|
7198
7321
|
{ value: "system", label: "Auto", name: "Auto, follows your device theme" }
|
|
7199
7322
|
];
|
|
7200
7323
|
function Panels({ palette }) {
|
|
7201
|
-
return /* @__PURE__ */
|
|
7202
|
-
/* @__PURE__ */
|
|
7324
|
+
return /* @__PURE__ */ jsxs66("span", { className: "flex h-full gap-1.5 p-1.5", style: { background: palette.canvas }, children: [
|
|
7325
|
+
/* @__PURE__ */ jsx99(
|
|
7203
7326
|
"span",
|
|
7204
7327
|
{
|
|
7205
7328
|
className: "flex flex-col gap-1.5 p-1.5",
|
|
7206
7329
|
style: { width: "28%", borderRadius: 5, background: palette.rail },
|
|
7207
|
-
children: RAIL_BARS.map((w, i) => /* @__PURE__ */
|
|
7330
|
+
children: RAIL_BARS.map((w, i) => /* @__PURE__ */ jsx99(
|
|
7208
7331
|
"span",
|
|
7209
7332
|
{
|
|
7210
7333
|
className: "rounded-full",
|
|
@@ -7214,12 +7337,12 @@ function Panels({ palette }) {
|
|
|
7214
7337
|
))
|
|
7215
7338
|
}
|
|
7216
7339
|
),
|
|
7217
|
-
/* @__PURE__ */
|
|
7340
|
+
/* @__PURE__ */ jsx99(
|
|
7218
7341
|
"span",
|
|
7219
7342
|
{
|
|
7220
7343
|
className: "flex flex-1 flex-col gap-1.5 border p-2",
|
|
7221
7344
|
style: { borderRadius: 5, background: palette.body, borderColor: palette.quiet },
|
|
7222
|
-
children: BODY_BARS.map((w, i) => /* @__PURE__ */
|
|
7345
|
+
children: BODY_BARS.map((w, i) => /* @__PURE__ */ jsx99(
|
|
7223
7346
|
"span",
|
|
7224
7347
|
{
|
|
7225
7348
|
className: "rounded-full",
|
|
@@ -7231,17 +7354,23 @@ function Panels({ palette }) {
|
|
|
7231
7354
|
)
|
|
7232
7355
|
] });
|
|
7233
7356
|
}
|
|
7234
|
-
var
|
|
7357
|
+
var CUT = "polygon(0 0, -8px 0, -8px calc(100% + 8px), calc(100% + 8px) calc(100% + 8px), calc(100% + 8px) calc(100% - 16px), 100% calc(100% - 16px))";
|
|
7358
|
+
function AutoPanels() {
|
|
7359
|
+
return /* @__PURE__ */ jsxs66("span", { className: "relative block h-full", children: [
|
|
7360
|
+
/* @__PURE__ */ jsx99("span", { className: "absolute inset-0", children: /* @__PURE__ */ jsx99(Panels, { palette: THEME_SWATCHES.light }) }),
|
|
7361
|
+
/* @__PURE__ */ jsx99("span", { className: "absolute inset-0", style: { clipPath: CUT }, children: /* @__PURE__ */ jsx99(Panels, { palette: THEME_SWATCHES.dark }) })
|
|
7362
|
+
] });
|
|
7363
|
+
}
|
|
7235
7364
|
var previewClass = "block h-28 overflow-hidden rounded-lg border border-border-default";
|
|
7236
|
-
var cardClass = "grid gap-2 rounded-lg p-1.5 text-left transition-colors duration-fast hover:bg-bg
|
|
7365
|
+
var cardClass = "grid cursor-pointer gap-2 rounded-lg p-1.5 text-left transition-colors duration-fast hover:bg-[var(--hov-bg)] focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-border-focus";
|
|
7237
7366
|
var TRACK = { gridTemplateColumns: "repeat(auto-fit, minmax(8rem, 1fr))" };
|
|
7238
7367
|
var Picker = React85.forwardRef(function Picker2({ value, onValueChange, className, ...props }, ref) {
|
|
7239
|
-
return /* @__PURE__ */
|
|
7368
|
+
return /* @__PURE__ */ jsx99("div", { role: "group", "aria-label": "Theme", ...props, ref, className: cn("grid gap-4", className), style: { ...TRACK, ...props.style }, children: OPTIONS.map((o) => {
|
|
7240
7369
|
const selected = o.value === value;
|
|
7241
7370
|
return (
|
|
7242
7371
|
// Not a `Button` (Guidelines/When it isn't a Button): the preview is the control, and
|
|
7243
7372
|
// `aria-pressed` is what says which one is on.
|
|
7244
|
-
/* @__PURE__ */
|
|
7373
|
+
/* @__PURE__ */ jsxs66(
|
|
7245
7374
|
"button",
|
|
7246
7375
|
{
|
|
7247
7376
|
type: "button",
|
|
@@ -7250,8 +7379,8 @@ var Picker = React85.forwardRef(function Picker2({ value, onValueChange, classNa
|
|
|
7250
7379
|
onClick: () => onValueChange(o.value),
|
|
7251
7380
|
className: cardClass,
|
|
7252
7381
|
children: [
|
|
7253
|
-
/* @__PURE__ */
|
|
7254
|
-
/* @__PURE__ */
|
|
7382
|
+
/* @__PURE__ */ jsx99("span", { className: cn(previewClass, selected && "border-border-strong"), "aria-hidden": true, children: o.value === "system" ? /* @__PURE__ */ jsx99(AutoPanels, {}) : /* @__PURE__ */ jsx99(Panels, { palette: THEME_SWATCHES[o.value] }) }),
|
|
7383
|
+
/* @__PURE__ */ jsxs66(
|
|
7255
7384
|
"span",
|
|
7256
7385
|
{
|
|
7257
7386
|
className: cn(
|
|
@@ -7259,7 +7388,7 @@ var Picker = React85.forwardRef(function Picker2({ value, onValueChange, classNa
|
|
|
7259
7388
|
selected ? "font-semibold text-text-primary" : "text-text-secondary"
|
|
7260
7389
|
),
|
|
7261
7390
|
children: [
|
|
7262
|
-
/* @__PURE__ */
|
|
7391
|
+
/* @__PURE__ */ jsx99(Check12, { className: cn("size-4 shrink-0", !selected && "invisible"), "aria-hidden": true }),
|
|
7263
7392
|
o.label
|
|
7264
7393
|
]
|
|
7265
7394
|
}
|
|
@@ -7273,7 +7402,7 @@ var Picker = React85.forwardRef(function Picker2({ value, onValueChange, classNa
|
|
|
7273
7402
|
});
|
|
7274
7403
|
var WiredPicker = React85.forwardRef(function WiredPicker2({ onValueChange, ...props }, ref) {
|
|
7275
7404
|
const { theme, setTheme } = useTheme();
|
|
7276
|
-
return /* @__PURE__ */
|
|
7405
|
+
return /* @__PURE__ */ jsx99(
|
|
7277
7406
|
Picker,
|
|
7278
7407
|
{
|
|
7279
7408
|
...props,
|
|
@@ -7293,15 +7422,15 @@ var ThemePicker = React85.forwardRef(function ThemePicker2({ value, onValueChang
|
|
|
7293
7422
|
"[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."
|
|
7294
7423
|
);
|
|
7295
7424
|
}
|
|
7296
|
-
return controlled.current ? /* @__PURE__ */
|
|
7297
|
-
}) }) : /* @__PURE__ */
|
|
7425
|
+
return controlled.current ? /* @__PURE__ */ jsx99(Picker, { ...props, ref, value: value ?? "system", onValueChange: onValueChange ?? (() => {
|
|
7426
|
+
}) }) : /* @__PURE__ */ jsx99(WiredPicker, { ...props, ref, onValueChange });
|
|
7298
7427
|
});
|
|
7299
7428
|
ThemePicker.displayName = "ThemePicker";
|
|
7300
7429
|
|
|
7301
7430
|
// src/components/secret-reveal.tsx
|
|
7302
7431
|
import * as React86 from "react";
|
|
7303
7432
|
import { Copy as Copy2, Download } from "lucide-react";
|
|
7304
|
-
import { jsx as
|
|
7433
|
+
import { jsx as jsx100, jsxs as jsxs67 } from "react/jsx-runtime";
|
|
7305
7434
|
var asText = (value) => Array.isArray(value) ? value.join("\n") : value;
|
|
7306
7435
|
var REVEALED = "A secret is on screen and will not be shown again.";
|
|
7307
7436
|
var REFUSED = "The browser refused the clipboard. Select the value to copy it.";
|
|
@@ -7309,13 +7438,13 @@ function SecretValue({ value }) {
|
|
|
7309
7438
|
if (Array.isArray(value)) {
|
|
7310
7439
|
const half = Math.ceil(value.length / 2);
|
|
7311
7440
|
const columns = [value.slice(0, half), value.slice(half)].filter((column) => column.length > 0);
|
|
7312
|
-
return /* @__PURE__ */
|
|
7441
|
+
return /* @__PURE__ */ jsx100("div", { className: "flex w-fit gap-x-12", children: columns.map((column, index) => (
|
|
7313
7442
|
// Neither the columns nor the values inside one are ever reordered, and two identical
|
|
7314
7443
|
// values in a list are legal, so the index is the key and the value is not.
|
|
7315
|
-
/* @__PURE__ */
|
|
7444
|
+
/* @__PURE__ */ jsx100("div", { className: "grid gap-y-1.5", children: column.map((line, row) => /* @__PURE__ */ jsx100("code", { className: "font-mono text-sm font-medium tabular-nums text-text-primary", children: line }, row)) }, index)
|
|
7316
7445
|
)) });
|
|
7317
7446
|
}
|
|
7318
|
-
return /* @__PURE__ */
|
|
7447
|
+
return /* @__PURE__ */ jsx100("code", { className: "block break-all font-mono text-sm font-medium text-text-primary", children: value });
|
|
7319
7448
|
}
|
|
7320
7449
|
var SecretReveal = React86.forwardRef(
|
|
7321
7450
|
({
|
|
@@ -7371,12 +7500,12 @@ var SecretReveal = React86.forwardRef(
|
|
|
7371
7500
|
reportTaken();
|
|
7372
7501
|
onDownload?.();
|
|
7373
7502
|
};
|
|
7374
|
-
return /* @__PURE__ */
|
|
7375
|
-
/* @__PURE__ */
|
|
7376
|
-
/* @__PURE__ */
|
|
7377
|
-
/* @__PURE__ */
|
|
7378
|
-
/* @__PURE__ */
|
|
7379
|
-
/* @__PURE__ */
|
|
7503
|
+
return /* @__PURE__ */ jsx100("div", { ref, className: cn("overflow-hidden rounded-lg bg-bg-sunken", className), ...props, children: /* @__PURE__ */ jsx100("div", { className: highlightClassName, ref: highlightRef, children: /* @__PURE__ */ jsxs67("div", { className: "grid gap-3 rounded-lg border border-border-strong px-4 py-3", children: [
|
|
7504
|
+
/* @__PURE__ */ jsx100("span", { role: "status", className: "sr-only", children: announced }),
|
|
7505
|
+
/* @__PURE__ */ jsx100("div", { id: captionId, className: "text-sm text-text-secondary", children: caption }),
|
|
7506
|
+
/* @__PURE__ */ jsx100(SecretValue, { value }),
|
|
7507
|
+
/* @__PURE__ */ jsxs67("div", { className: "flex flex-wrap items-center gap-2", children: [
|
|
7508
|
+
/* @__PURE__ */ jsx100(
|
|
7380
7509
|
Button,
|
|
7381
7510
|
{
|
|
7382
7511
|
ref: copyRef,
|
|
@@ -7384,12 +7513,12 @@ var SecretReveal = React86.forwardRef(
|
|
|
7384
7513
|
"aria-describedby": captionId,
|
|
7385
7514
|
variant: "outline",
|
|
7386
7515
|
size: "sm",
|
|
7387
|
-
icon: /* @__PURE__ */
|
|
7516
|
+
icon: /* @__PURE__ */ jsx100(Copy2, {}),
|
|
7388
7517
|
children: copyLabel ?? (Array.isArray(value) ? "Copy all" : "Copy")
|
|
7389
7518
|
}
|
|
7390
7519
|
),
|
|
7391
|
-
onDownload && /* @__PURE__ */
|
|
7392
|
-
/* @__PURE__ */
|
|
7520
|
+
onDownload && /* @__PURE__ */ jsx100(Button, { onClick: download, "aria-describedby": captionId, variant: "outline", size: "sm", icon: /* @__PURE__ */ jsx100(Download, {}), children: downloadLabel }),
|
|
7521
|
+
/* @__PURE__ */ jsx100(
|
|
7393
7522
|
Button,
|
|
7394
7523
|
{
|
|
7395
7524
|
onClick: onConfirm,
|
|
@@ -7400,7 +7529,7 @@ var SecretReveal = React86.forwardRef(
|
|
|
7400
7529
|
}
|
|
7401
7530
|
)
|
|
7402
7531
|
] }),
|
|
7403
|
-
refused && /* @__PURE__ */
|
|
7532
|
+
refused && /* @__PURE__ */ jsx100("div", { role: "status", className: "text-xs text-text-tertiary", children: REFUSED })
|
|
7404
7533
|
] }) }) });
|
|
7405
7534
|
}
|
|
7406
7535
|
);
|
|
@@ -7410,7 +7539,7 @@ SecretReveal.displayName = "SecretReveal";
|
|
|
7410
7539
|
import * as React87 from "react";
|
|
7411
7540
|
import * as RadioGroupPrimitive2 from "@radix-ui/react-radio-group";
|
|
7412
7541
|
import { Star } from "lucide-react";
|
|
7413
|
-
import { jsx as
|
|
7542
|
+
import { jsx as jsx101 } from "react/jsx-runtime";
|
|
7414
7543
|
var STAR_BOX = {
|
|
7415
7544
|
sm: "size-4",
|
|
7416
7545
|
md: "size-5",
|
|
@@ -7422,7 +7551,7 @@ var ROW_GAP = {
|
|
|
7422
7551
|
lg: "gap-1.5"
|
|
7423
7552
|
};
|
|
7424
7553
|
var defaultItemLabel = (value, max) => `${value} out of ${max} stars`;
|
|
7425
|
-
var StarGlyph = ({ filled, size }) => /* @__PURE__ */
|
|
7554
|
+
var StarGlyph = ({ filled, size }) => /* @__PURE__ */ jsx101(
|
|
7426
7555
|
Star,
|
|
7427
7556
|
{
|
|
7428
7557
|
"aria-hidden": "true",
|
|
@@ -7457,18 +7586,18 @@ var StarRating = React87.forwardRef(
|
|
|
7457
7586
|
onValueChange?.(next);
|
|
7458
7587
|
};
|
|
7459
7588
|
if (readOnly) {
|
|
7460
|
-
return /* @__PURE__ */
|
|
7589
|
+
return /* @__PURE__ */ jsx101(
|
|
7461
7590
|
"div",
|
|
7462
7591
|
{
|
|
7463
7592
|
ref,
|
|
7464
7593
|
role: "img",
|
|
7465
7594
|
"aria-label": props["aria-label"] ?? itemLabel(selected, max),
|
|
7466
7595
|
className: cn("inline-flex items-center", ROW_GAP[size], className),
|
|
7467
|
-
children: stars.map((star) => /* @__PURE__ */
|
|
7596
|
+
children: stars.map((star) => /* @__PURE__ */ jsx101(StarGlyph, { filled: star <= selected, size }, star))
|
|
7468
7597
|
}
|
|
7469
7598
|
);
|
|
7470
7599
|
}
|
|
7471
|
-
return /* @__PURE__ */
|
|
7600
|
+
return /* @__PURE__ */ jsx101(
|
|
7472
7601
|
RadioGroupPrimitive2.Root,
|
|
7473
7602
|
{
|
|
7474
7603
|
ref,
|
|
@@ -7485,7 +7614,7 @@ var StarRating = React87.forwardRef(
|
|
|
7485
7614
|
orientation: "horizontal",
|
|
7486
7615
|
loop: false,
|
|
7487
7616
|
className: cn("inline-flex items-center", ROW_GAP[size], className),
|
|
7488
|
-
children: stars.map((star) => /* @__PURE__ */
|
|
7617
|
+
children: stars.map((star) => /* @__PURE__ */ jsx101(
|
|
7489
7618
|
RadioGroupPrimitive2.Item,
|
|
7490
7619
|
{
|
|
7491
7620
|
value: String(star),
|
|
@@ -7496,11 +7625,12 @@ var StarRating = React87.forwardRef(
|
|
|
7496
7625
|
if (min === 0 && star === selected) commit(0);
|
|
7497
7626
|
},
|
|
7498
7627
|
className: cn(
|
|
7628
|
+
"cursor-pointer",
|
|
7499
7629
|
// Focus is an outline held off the box, never a flush ring (`Guidelines/Look/Borders`).
|
|
7500
7630
|
"rounded-md p-0.5 focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-border-focus",
|
|
7501
7631
|
"disabled:pointer-events-none disabled:opacity-50"
|
|
7502
7632
|
),
|
|
7503
|
-
children: /* @__PURE__ */
|
|
7633
|
+
children: /* @__PURE__ */ jsx101(StarGlyph, { filled: star <= shown, size })
|
|
7504
7634
|
},
|
|
7505
7635
|
star
|
|
7506
7636
|
))
|
|
@@ -7513,7 +7643,7 @@ StarRating.displayName = "StarRating";
|
|
|
7513
7643
|
// src/components/rating-scale.tsx
|
|
7514
7644
|
import * as React88 from "react";
|
|
7515
7645
|
import * as RadioGroupPrimitive3 from "@radix-ui/react-radio-group";
|
|
7516
|
-
import { jsx as
|
|
7646
|
+
import { jsx as jsx102, jsxs as jsxs68 } from "react/jsx-runtime";
|
|
7517
7647
|
var SLOT_BOX = {
|
|
7518
7648
|
sm: "h-8 min-w-8 px-2 text-xs",
|
|
7519
7649
|
md: "h-9 min-w-9 px-2 text-sm",
|
|
@@ -7538,7 +7668,7 @@ var RatingScale = React88.forwardRef(
|
|
|
7538
7668
|
const slots = Array.from({ length: Math.max(0, max - min + 1) }, (_, index) => min + index);
|
|
7539
7669
|
const [mirror, setMirror] = React88.useState(defaultValue);
|
|
7540
7670
|
const selected = value ?? mirror;
|
|
7541
|
-
const row = /* @__PURE__ */
|
|
7671
|
+
const row = /* @__PURE__ */ jsx102("div", { className: cn("flex flex-wrap items-center gap-1.5", !endLabels && className), children: slots.map((slot) => {
|
|
7542
7672
|
const isSelected = slot === selected;
|
|
7543
7673
|
const box = cn(
|
|
7544
7674
|
"inline-flex items-center justify-center rounded-md border tabular-nums transition-colors duration-fast",
|
|
@@ -7546,15 +7676,16 @@ var RatingScale = React88.forwardRef(
|
|
|
7546
7676
|
isSelected ? "border-border-strong font-semibold text-text-primary" : "border-field-border font-medium text-text-secondary"
|
|
7547
7677
|
);
|
|
7548
7678
|
if (readOnly) {
|
|
7549
|
-
return /* @__PURE__ */
|
|
7679
|
+
return /* @__PURE__ */ jsx102("span", { className: box, "aria-hidden": "true", children: slot }, slot);
|
|
7550
7680
|
}
|
|
7551
|
-
return /* @__PURE__ */
|
|
7681
|
+
return /* @__PURE__ */ jsx102(
|
|
7552
7682
|
RadioGroupPrimitive3.Item,
|
|
7553
7683
|
{
|
|
7554
7684
|
value: String(slot),
|
|
7555
7685
|
"aria-label": itemLabel(slot, min, max),
|
|
7556
7686
|
className: cn(
|
|
7557
7687
|
box,
|
|
7688
|
+
"cursor-pointer",
|
|
7558
7689
|
// The hover step is the same channel the mark uses, one rung short of it, so the
|
|
7559
7690
|
// pointer never promises a mark it is not making.
|
|
7560
7691
|
"hover:border-field-border-hover hover:text-text-primary",
|
|
@@ -7566,12 +7697,12 @@ var RatingScale = React88.forwardRef(
|
|
|
7566
7697
|
slot
|
|
7567
7698
|
);
|
|
7568
7699
|
}) });
|
|
7569
|
-
const ends = endLabels ? /* @__PURE__ */
|
|
7570
|
-
/* @__PURE__ */
|
|
7571
|
-
/* @__PURE__ */
|
|
7700
|
+
const ends = endLabels ? /* @__PURE__ */ jsxs68("div", { className: "flex items-center justify-between text-xs text-text-tertiary", children: [
|
|
7701
|
+
/* @__PURE__ */ jsx102("span", { children: endLabels.low }),
|
|
7702
|
+
/* @__PURE__ */ jsx102("span", { children: endLabels.high })
|
|
7572
7703
|
] }) : null;
|
|
7573
7704
|
if (readOnly) {
|
|
7574
|
-
return /* @__PURE__ */
|
|
7705
|
+
return /* @__PURE__ */ jsxs68(
|
|
7575
7706
|
"div",
|
|
7576
7707
|
{
|
|
7577
7708
|
ref,
|
|
@@ -7585,7 +7716,7 @@ var RatingScale = React88.forwardRef(
|
|
|
7585
7716
|
}
|
|
7586
7717
|
);
|
|
7587
7718
|
}
|
|
7588
|
-
const group = /* @__PURE__ */
|
|
7719
|
+
const group = /* @__PURE__ */ jsx102(
|
|
7589
7720
|
RadioGroupPrimitive3.Root,
|
|
7590
7721
|
{
|
|
7591
7722
|
ref,
|
|
@@ -7604,7 +7735,7 @@ var RatingScale = React88.forwardRef(
|
|
|
7604
7735
|
}
|
|
7605
7736
|
);
|
|
7606
7737
|
if (!endLabels) return group;
|
|
7607
|
-
return /* @__PURE__ */
|
|
7738
|
+
return /* @__PURE__ */ jsxs68("div", { className: cn("flex flex-col gap-1.5", className), children: [
|
|
7608
7739
|
group,
|
|
7609
7740
|
ends
|
|
7610
7741
|
] });
|
|
@@ -7823,8 +7954,10 @@ export {
|
|
|
7823
7954
|
PopoverContent,
|
|
7824
7955
|
PopoverTrigger,
|
|
7825
7956
|
Progress,
|
|
7957
|
+
QuickSearchRow,
|
|
7826
7958
|
RadioGroup2 as RadioGroup,
|
|
7827
7959
|
RadioGroupItem,
|
|
7960
|
+
RailToggle,
|
|
7828
7961
|
RatingScale,
|
|
7829
7962
|
RemovableChip,
|
|
7830
7963
|
RemoveButton,
|
|
@@ -7893,6 +8026,7 @@ export {
|
|
|
7893
8026
|
isKnownExtensionIcon,
|
|
7894
8027
|
isNotificationSettled,
|
|
7895
8028
|
navigationMenuTriggerStyle,
|
|
8029
|
+
productStatusBadge,
|
|
7896
8030
|
severityBadgeVariant,
|
|
7897
8031
|
severityLabels,
|
|
7898
8032
|
statusDotVariants,
|