@burdenoff/fe-libs 2026.1119.7 → 2026.1119.9
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/chrome/shell/ShellSidebar.js +159 -157
- package/dist/chrome/shell/SidebarProfileMenu.js +193 -190
- package/dist/chrome/shell/WorkspaceAccountCard.js +45 -40
- package/dist/chrome/shell/WorkspaceMenu.js +140 -136
- package/dist/chrome/shell/shellSidebarAppearance.d.ts +4 -0
- package/dist/chrome/shell/shellSidebarAppearance.js +7 -0
- package/dist/chrome/shell/sidebarPopupPlacement.d.ts +21 -0
- package/dist/chrome/shell/sidebarPopupPlacement.js +28 -0
- package/dist/connections/ConnectionDialogPanel.js +222 -203
- package/dist/connections/ConnectionFormTab.d.ts +6 -0
- package/dist/connections/ConnectionFormTab.js +2 -2
- package/dist/connections/api.d.ts +28 -0
- package/dist/connections/api.js +107 -71
- package/dist/connections/connectionFlow.d.ts +63 -1
- package/dist/connections/connectionFlow.js +139 -47
- package/dist/connections/index.d.ts +2 -2
- package/dist/connections/oauthPopup.d.ts +16 -1
- package/dist/connections/oauthPopup.js +45 -37
- package/dist/connections/useConnectionSubmit.d.ts +7 -2
- package/dist/connections/useConnectionSubmit.js +69 -55
- package/dist/connections.js +6 -6
- package/dist/ui/dropdown-menu.d.ts +12 -2
- package/dist/ui/dropdown-menu.js +53 -50
- package/dist/ui/glass-surface.d.ts +7 -0
- package/dist/ui/glass-surface.js +14 -0
- package/dist/ui/popover.d.ts +1 -1
- package/dist/ui/popover.js +17 -15
- package/dist/ui/select.js +69 -68
- package/dist/ui/tooltip.d.ts +6 -0
- package/dist/ui/tooltip.js +18 -14
- package/package.json +1 -1
- package/src/shared/tokens/display-settings.css +3 -0
|
@@ -2,94 +2,99 @@ import { DropdownMenu as e, DropdownMenuContent as t, DropdownMenuItem as n, Dro
|
|
|
2
2
|
import { Tooltip as i, TooltipContent as a, TooltipTrigger as o } from "../../ui/tooltip.js";
|
|
3
3
|
import { MENU_SURFACE as s } from "./profileMenuClasses.js";
|
|
4
4
|
import { ShellRailTooltipLabel as c } from "./ShellSidebar.js";
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
5
|
+
import { useSidebarPopupPlacement as l } from "./sidebarPopupPlacement.js";
|
|
6
|
+
import { useRef as u } from "react";
|
|
7
|
+
import { ChevronRight as d, LayoutGrid as f } from "lucide-react";
|
|
8
|
+
import { clsx as p } from "clsx";
|
|
9
|
+
import { jsx as m, jsxs as h } from "react/jsx-runtime";
|
|
8
10
|
// src/chrome/shell/WorkspaceAccountCard.tsx
|
|
9
|
-
var
|
|
10
|
-
function
|
|
11
|
-
let
|
|
12
|
-
|
|
13
|
-
},
|
|
11
|
+
var g = "outline-none focus-visible:ring-2 focus-visible:ring-focus-ring";
|
|
12
|
+
function _({ label: _, branches: v, collapsed: y = !1, onExpandSidebar: b, className: x }) {
|
|
13
|
+
let S = (e) => {
|
|
14
|
+
y && b?.(), e.onSelect();
|
|
15
|
+
}, C = u(null), { beside: w, contentRef: T } = l(C, "end"), E = y ? /* @__PURE__ */ h(i, {
|
|
14
16
|
delayDuration: 200,
|
|
15
|
-
children: [/* @__PURE__ */
|
|
17
|
+
children: [/* @__PURE__ */ m(o, {
|
|
16
18
|
asChild: !0,
|
|
17
|
-
children: /* @__PURE__ */
|
|
19
|
+
children: /* @__PURE__ */ m(r, {
|
|
18
20
|
asChild: !0,
|
|
19
|
-
|
|
21
|
+
ref: C,
|
|
22
|
+
children: /* @__PURE__ */ m("button", {
|
|
20
23
|
type: "button",
|
|
21
|
-
"aria-label":
|
|
24
|
+
"aria-label": _,
|
|
22
25
|
"data-testid": "rail-all-tools-trigger",
|
|
23
|
-
className:
|
|
24
|
-
children: /* @__PURE__ */ f
|
|
26
|
+
className: p("flex size-10 items-center justify-center rounded-button text-text-secondary transition-colors hover:bg-bg-sunken hover:text-text-primary data-[state=open]:bg-bg-sunken", g, x),
|
|
27
|
+
children: /* @__PURE__ */ m(f, {
|
|
25
28
|
"aria-hidden": "true",
|
|
26
29
|
className: "size-4"
|
|
27
30
|
})
|
|
28
31
|
})
|
|
29
32
|
})
|
|
30
|
-
}), /* @__PURE__ */
|
|
33
|
+
}), /* @__PURE__ */ m(a, {
|
|
31
34
|
side: "right",
|
|
32
35
|
sideOffset: 10,
|
|
33
36
|
className: "flex items-center gap-2 rounded-md border border-border-subtle bg-popover px-2 py-1 text-text-primary shadow-overlay",
|
|
34
|
-
children: /* @__PURE__ */
|
|
37
|
+
children: /* @__PURE__ */ m(c, { label: _ })
|
|
35
38
|
})]
|
|
36
|
-
}) : /* @__PURE__ */
|
|
39
|
+
}) : /* @__PURE__ */ m(r, {
|
|
37
40
|
asChild: !0,
|
|
38
|
-
|
|
41
|
+
ref: C,
|
|
42
|
+
children: /* @__PURE__ */ h("button", {
|
|
39
43
|
type: "button",
|
|
40
44
|
"data-testid": "sidebar-all-tools-trigger",
|
|
41
|
-
className:
|
|
45
|
+
className: p("flex w-full min-w-0 items-center gap-2.5 rounded-card border border-border-default bg-text-primary/6 py-1.75 ps-1.75 pe-2 text-start text-text-primary transition-colors hover:border-border-strong hover:bg-text-primary/8 data-[state=open]:border-border-strong data-[state=open]:bg-text-primary/8", g, x),
|
|
42
46
|
children: [
|
|
43
|
-
/* @__PURE__ */
|
|
47
|
+
/* @__PURE__ */ m("span", {
|
|
44
48
|
"aria-hidden": "true",
|
|
45
49
|
"data-testid": "sidebar-all-tools-icon",
|
|
46
50
|
className: "flex size-7 shrink-0 items-center justify-center rounded-button bg-accent-soft text-accent-primary",
|
|
47
|
-
children: /* @__PURE__ */ f
|
|
51
|
+
children: /* @__PURE__ */ m(f, { className: "size-4" })
|
|
48
52
|
}),
|
|
49
|
-
/* @__PURE__ */
|
|
53
|
+
/* @__PURE__ */ m("span", {
|
|
50
54
|
className: "line-clamp-2 min-w-0 flex-1 text-body-sm leading-tight",
|
|
51
|
-
children:
|
|
55
|
+
children: _
|
|
52
56
|
}),
|
|
53
|
-
/* @__PURE__ */
|
|
57
|
+
/* @__PURE__ */ m(d, {
|
|
54
58
|
"aria-hidden": "true",
|
|
55
59
|
className: "size-3.5 shrink-0 text-text-muted rtl:rotate-180"
|
|
56
60
|
})
|
|
57
61
|
]
|
|
58
62
|
})
|
|
59
63
|
});
|
|
60
|
-
return /* @__PURE__ */
|
|
64
|
+
return /* @__PURE__ */ h(e, {
|
|
61
65
|
modal: !1,
|
|
62
|
-
children: [
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
+
children: [E, /* @__PURE__ */ m(t, {
|
|
67
|
+
ref: T,
|
|
68
|
+
side: w?.side ?? (y ? "right" : "top"),
|
|
69
|
+
align: w?.align ?? (y ? "end" : "start"),
|
|
70
|
+
sideOffset: w?.sideOffset ?? (y ? 6 : 8),
|
|
66
71
|
collisionPadding: 8,
|
|
67
|
-
"aria-label":
|
|
72
|
+
"aria-label": _,
|
|
68
73
|
"data-testid": "all-tools-menu",
|
|
69
74
|
className: `${s} w-[290px]`,
|
|
70
|
-
children:
|
|
75
|
+
children: v.map((e) => {
|
|
71
76
|
let t = e.icon;
|
|
72
|
-
return /* @__PURE__ */
|
|
73
|
-
onSelect: () =>
|
|
77
|
+
return /* @__PURE__ */ h(n, {
|
|
78
|
+
onSelect: () => S(e),
|
|
74
79
|
"data-testid": `all-tools-branch-${e.id}`,
|
|
75
80
|
className: "items-start gap-3 rounded-button px-2.5 py-2 focus:bg-bg-sunken",
|
|
76
81
|
children: [
|
|
77
|
-
/* @__PURE__ */
|
|
82
|
+
/* @__PURE__ */ m("span", {
|
|
78
83
|
"aria-hidden": "true",
|
|
79
84
|
className: "flex size-7 shrink-0 items-center justify-center rounded-button bg-accent-soft text-accent-primary",
|
|
80
|
-
children: /* @__PURE__ */
|
|
85
|
+
children: /* @__PURE__ */ m(t, { className: "size-4" })
|
|
81
86
|
}),
|
|
82
|
-
/* @__PURE__ */
|
|
87
|
+
/* @__PURE__ */ h("span", {
|
|
83
88
|
className: "flex min-w-0 flex-1 flex-col gap-0.5",
|
|
84
|
-
children: [/* @__PURE__ */
|
|
89
|
+
children: [/* @__PURE__ */ m("span", {
|
|
85
90
|
className: "text-body-sm font-semibold text-text-primary",
|
|
86
91
|
children: e.title
|
|
87
|
-
}), e.description ? /* @__PURE__ */
|
|
92
|
+
}), e.description ? /* @__PURE__ */ m("span", {
|
|
88
93
|
className: "text-xs text-text-muted",
|
|
89
94
|
children: e.description
|
|
90
95
|
}) : null]
|
|
91
96
|
}),
|
|
92
|
-
/* @__PURE__ */
|
|
97
|
+
/* @__PURE__ */ m(d, {
|
|
93
98
|
"aria-hidden": "true",
|
|
94
99
|
className: "mt-1.5 size-4 shrink-0 text-text-muted rtl:rotate-180"
|
|
95
100
|
})
|
|
@@ -99,4 +104,4 @@ function h({ label: h, branches: g, collapsed: _ = !1, onExpandSidebar: v, class
|
|
|
99
104
|
})]
|
|
100
105
|
});
|
|
101
106
|
}
|
|
102
|
-
export {
|
|
107
|
+
export { _ as WorkspaceAccountCard };
|
|
@@ -5,16 +5,17 @@ import { Input as u } from "../../ui/input.js";
|
|
|
5
5
|
import { ScrollBar as d } from "../../ui/scroll-area.js";
|
|
6
6
|
import { WORKSPACE_MENU_LIST_ATTR as f, onWorkspaceMenuSearchKeyDown as p } from "./workspaceMenuLists.js";
|
|
7
7
|
import { useWorkspaceMenuLists as m } from "./useWorkspaceMenuLists.js";
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import
|
|
8
|
+
import { useSidebarPopupPlacement as h } from "./sidebarPopupPlacement.js";
|
|
9
|
+
import { useWorkspaceMenuControls as g } from "./useWorkspaceMenuControls.js";
|
|
10
|
+
import { useId as _, useRef as v, useState as y } from "react";
|
|
11
|
+
import { Check as b, ChevronDown as x, ChevronsUpDown as S, Folders as C, Landmark as w, LayoutGrid as T, Plus as E, Search as D } from "lucide-react";
|
|
12
|
+
import { Fragment as O, jsx as k, jsxs as A } from "react/jsx-runtime";
|
|
13
|
+
import * as j from "@radix-ui/react-scroll-area";
|
|
13
14
|
// src/chrome/shell/WorkspaceMenu.tsx
|
|
14
|
-
var
|
|
15
|
+
var M = "rounded-card border border-border-subtle bg-popover p-1.5 shadow-overlay", N = {
|
|
15
16
|
default: "group flex min-w-0 items-center gap-2.5 rounded-button p-1 text-start outline-none transition-colors hover:bg-bg-sunken focus-visible:ring-2 focus-visible:ring-focus-ring data-[state=open]:bg-bg-elevated",
|
|
16
17
|
card: "group flex min-w-0 items-center gap-2.5 rounded-card border border-border-default bg-text-primary/6 p-1.25 pe-2 text-start outline-none transition-colors hover:border-border-strong hover:bg-text-primary/8 focus-visible:ring-2 focus-visible:ring-focus-ring data-[state=open]:border-border-strong data-[state=open]:bg-text-primary/8"
|
|
17
|
-
},
|
|
18
|
+
}, P = {
|
|
18
19
|
default: {
|
|
19
20
|
name: "block truncate text-body-sm font-semibold text-text-primary",
|
|
20
21
|
org: "block truncate text-xs text-text-muted"
|
|
@@ -23,75 +24,75 @@ var A = "rounded-card border border-border-subtle bg-popover p-1.5 shadow-overla
|
|
|
23
24
|
name: "block truncate text-body-sm font-semibold leading-tight text-text-primary",
|
|
24
25
|
org: "block truncate text-xs leading-tight text-text-secondary"
|
|
25
26
|
}
|
|
26
|
-
},
|
|
27
|
-
function
|
|
27
|
+
}, F = "h-control-sm gap-2.5 rounded-button px-2.5 focus:bg-bg-sunken", I = "px-2.5 pb-1 pt-2 text-caption font-semibold uppercase tracking-wider text-text-muted", L = "max-h-80 overflow-y-auto rounded-card border border-border-subtle bg-popover p-1.5 shadow-overlay";
|
|
28
|
+
function R(e) {
|
|
28
29
|
let t = e.trim().charAt(0).toUpperCase() || "?";
|
|
29
|
-
return /* @__PURE__ */
|
|
30
|
+
return /* @__PURE__ */ k("span", {
|
|
30
31
|
"aria-hidden": "true",
|
|
31
32
|
className: "flex size-5 flex-shrink-0 items-center justify-center rounded-button bg-accent-soft text-caption font-semibold text-accent-primary",
|
|
32
33
|
children: t
|
|
33
34
|
});
|
|
34
35
|
}
|
|
35
|
-
var
|
|
36
|
-
function
|
|
37
|
-
return e ? /* @__PURE__ */
|
|
36
|
+
var z = [];
|
|
37
|
+
function B(e) {
|
|
38
|
+
return e ? /* @__PURE__ */ k(b, {
|
|
38
39
|
className: "ms-auto size-4 flex-shrink-0 text-accent-primary",
|
|
39
40
|
"aria-hidden": "true"
|
|
40
41
|
}) : null;
|
|
41
42
|
}
|
|
42
|
-
function
|
|
43
|
-
return /* @__PURE__ */
|
|
44
|
-
className:
|
|
43
|
+
function V({ id: e, testId: t, current: n, onPick: r, icon: a, label: o, rowProps: s }) {
|
|
44
|
+
return /* @__PURE__ */ A(i, {
|
|
45
|
+
className: F,
|
|
45
46
|
onSelect: () => r(),
|
|
46
47
|
"data-testid": t,
|
|
47
48
|
"aria-current": n ? "true" : void 0,
|
|
48
49
|
...s,
|
|
49
50
|
children: [
|
|
50
51
|
a,
|
|
51
|
-
/* @__PURE__ */
|
|
52
|
+
/* @__PURE__ */ k("span", {
|
|
52
53
|
className: "min-w-0 flex-1 truncate",
|
|
53
54
|
children: o
|
|
54
55
|
}),
|
|
55
|
-
|
|
56
|
+
B(n)
|
|
56
57
|
]
|
|
57
58
|
}, e);
|
|
58
59
|
}
|
|
59
|
-
function
|
|
60
|
-
return /* @__PURE__ */
|
|
61
|
-
className:
|
|
60
|
+
function H(e, t, n) {
|
|
61
|
+
return /* @__PURE__ */ A(i, {
|
|
62
|
+
className: F,
|
|
62
63
|
onSelect: () => n(),
|
|
63
64
|
"data-testid": e,
|
|
64
|
-
children: [/* @__PURE__ */
|
|
65
|
+
children: [/* @__PURE__ */ k(E, {
|
|
65
66
|
className: "size-4 flex-shrink-0 text-text-secondary",
|
|
66
67
|
"aria-hidden": "true"
|
|
67
|
-
}), /* @__PURE__ */
|
|
68
|
+
}), /* @__PURE__ */ k("span", {
|
|
68
69
|
className: "truncate",
|
|
69
70
|
children: t
|
|
70
71
|
})]
|
|
71
72
|
});
|
|
72
73
|
}
|
|
73
|
-
function
|
|
74
|
-
return /* @__PURE__ */
|
|
74
|
+
function U(e, t) {
|
|
75
|
+
return /* @__PURE__ */ k("div", {
|
|
75
76
|
role: "presentation",
|
|
76
|
-
className:
|
|
77
|
+
className: I,
|
|
77
78
|
...t ? { id: t } : {},
|
|
78
79
|
children: e
|
|
79
80
|
});
|
|
80
81
|
}
|
|
81
|
-
var
|
|
82
|
-
function
|
|
83
|
-
return /* @__PURE__ */
|
|
82
|
+
var W = "max-h-[calc(var(--size-controlHeight-sm)*6.5)] pe-2.5 [&>div]:block! focus-visible:outline-none", G = "pointer-events-none absolute start-3 top-1/2 size-4 -translate-y-1/2 text-text-muted", K = "px-2.5 py-2 text-body-sm text-text-muted", q = "max-h-[var(--radix-dropdown-menu-content-available-height)] overflow-auto";
|
|
83
|
+
function J({ labelledBy: e, testId: t, rows: n, search: r }) {
|
|
84
|
+
return /* @__PURE__ */ A("div", {
|
|
84
85
|
role: "group",
|
|
85
86
|
"aria-labelledby": e,
|
|
86
87
|
"data-testid": `${t}-list`,
|
|
87
88
|
[f]: "",
|
|
88
89
|
children: [
|
|
89
|
-
r && /* @__PURE__ */
|
|
90
|
+
r && /* @__PURE__ */ A("div", {
|
|
90
91
|
className: "relative px-1 pb-1",
|
|
91
|
-
children: [/* @__PURE__ */ D
|
|
92
|
-
className:
|
|
92
|
+
children: [/* @__PURE__ */ k(D, {
|
|
93
|
+
className: G,
|
|
93
94
|
"aria-hidden": "true"
|
|
94
|
-
}), /* @__PURE__ */
|
|
95
|
+
}), /* @__PURE__ */ k(u, {
|
|
95
96
|
type: "search",
|
|
96
97
|
value: r.query,
|
|
97
98
|
onChange: (e) => r.onQueryChange(e.target.value),
|
|
@@ -104,193 +105,193 @@ function K({ labelledBy: e, testId: t, rows: n, search: r }) {
|
|
|
104
105
|
className: "h-control-sm ps-8 text-body-sm"
|
|
105
106
|
})]
|
|
106
107
|
}),
|
|
107
|
-
/* @__PURE__ */
|
|
108
|
+
/* @__PURE__ */ A(j.Root, {
|
|
108
109
|
type: "auto",
|
|
109
110
|
className: "relative overflow-hidden",
|
|
110
|
-
children: [/* @__PURE__ */
|
|
111
|
-
className:
|
|
111
|
+
children: [/* @__PURE__ */ k(j.Viewport, {
|
|
112
|
+
className: W,
|
|
112
113
|
"data-testid": t,
|
|
113
114
|
children: n
|
|
114
|
-
}), /* @__PURE__ */
|
|
115
|
+
}), /* @__PURE__ */ k(d, {})]
|
|
115
116
|
}),
|
|
116
|
-
r && /* @__PURE__ */
|
|
117
|
+
r && /* @__PURE__ */ k("div", {
|
|
117
118
|
role: "status",
|
|
118
119
|
"data-testid": `shell-workspace-nomatch-${r.name}`,
|
|
119
|
-
children: r.noMatch ? /* @__PURE__ */
|
|
120
|
-
className:
|
|
120
|
+
children: r.noMatch ? /* @__PURE__ */ k("p", {
|
|
121
|
+
className: K,
|
|
121
122
|
children: r.noMatch
|
|
122
123
|
}) : null
|
|
123
124
|
})
|
|
124
125
|
]
|
|
125
126
|
});
|
|
126
127
|
}
|
|
127
|
-
function
|
|
128
|
-
return e.searchable ?
|
|
128
|
+
function Y(e, { name: t, testId: n, plainTestId: r, rows: i }) {
|
|
129
|
+
return e.searchable ? J({
|
|
129
130
|
labelledBy: `${e.labelIds}-${t}`,
|
|
130
131
|
testId: n,
|
|
131
132
|
rows: i,
|
|
132
133
|
search: e.lists[t].search
|
|
133
|
-
}) : /* @__PURE__ */
|
|
134
|
+
}) : /* @__PURE__ */ k("div", {
|
|
134
135
|
className: "max-h-60 overflow-y-auto",
|
|
135
136
|
...r ? { "data-testid": r } : {},
|
|
136
137
|
children: i
|
|
137
138
|
});
|
|
138
139
|
}
|
|
139
|
-
function
|
|
140
|
-
let { props: t, lists: n, shellLabel: r, labelIds: i, orgLabel: a, searchable: o } = e, { activeWorkspaceId: s, onSelectWorkspace: c, onNewWorkspace: l } = t, u = n.workspaces, d = u.shown.map((e) =>
|
|
140
|
+
function X(e) {
|
|
141
|
+
let { props: t, lists: n, shellLabel: r, labelIds: i, orgLabel: a, searchable: o } = e, { activeWorkspaceId: s, onSelectWorkspace: c, onNewWorkspace: l } = t, u = n.workspaces, d = u.shown.map((e) => V({
|
|
141
142
|
id: e.id,
|
|
142
143
|
testId: `shell-workspace-item-${e.id}`,
|
|
143
144
|
current: e.id === s,
|
|
144
145
|
onPick: () => {
|
|
145
146
|
e.id !== s && c(e.id);
|
|
146
147
|
},
|
|
147
|
-
icon:
|
|
148
|
+
icon: R(e.name),
|
|
148
149
|
label: e.name,
|
|
149
150
|
rowProps: u.rowProps
|
|
150
151
|
}));
|
|
151
|
-
return /* @__PURE__ */ O
|
|
152
|
-
|
|
153
|
-
|
|
152
|
+
return /* @__PURE__ */ A(O, { children: [
|
|
153
|
+
U(r("shell.workspaceMenu.workspacesIn", "Workspaces in {{org}}", { org: a }), o ? `${i}-workspaces` : void 0),
|
|
154
|
+
Y(e, {
|
|
154
155
|
name: "workspaces",
|
|
155
156
|
testId: "shell-workspace-workspaces",
|
|
156
157
|
rows: d
|
|
157
158
|
}),
|
|
158
|
-
l &&
|
|
159
|
+
l && H("shell-workspace-new", r("shell.workspaceMenu.newWorkspace", "New workspace"), () => l())
|
|
159
160
|
] });
|
|
160
161
|
}
|
|
161
|
-
function
|
|
162
|
+
function Z(e) {
|
|
162
163
|
let { props: t, projects: n, lists: r, shellLabel: i, labelIds: o, searchable: s } = e, { activeWorkspaceId: c, activeProjectId: l, onSelectProject: u, onSelectWorkspaceWide: d } = t, { onNewProject: f } = t, p = n.length > 0 && u !== void 0, m = f !== void 0 && !!c;
|
|
163
164
|
if (!p && !m) return null;
|
|
164
|
-
let h = r.projects, g = !!c && d !== void 0 && !h.filtering, _ = /* @__PURE__ */ O
|
|
165
|
+
let h = r.projects, g = !!c && d !== void 0 && !h.filtering, _ = /* @__PURE__ */ A(O, { children: [g && V({
|
|
165
166
|
id: "workspace-wide",
|
|
166
167
|
testId: "shell-workspace-all-projects",
|
|
167
168
|
current: !l,
|
|
168
169
|
onPick: () => d?.(),
|
|
169
|
-
icon: /* @__PURE__ */
|
|
170
|
+
icon: /* @__PURE__ */ k("span", {
|
|
170
171
|
className: "flex size-5 flex-shrink-0 items-center justify-center",
|
|
171
|
-
children: /* @__PURE__ */
|
|
172
|
+
children: /* @__PURE__ */ k(C, {
|
|
172
173
|
className: "size-4 text-text-secondary",
|
|
173
174
|
"aria-hidden": "true"
|
|
174
175
|
})
|
|
175
176
|
}),
|
|
176
177
|
label: i("contextSwitcher.allProjectsWorkspaceWide", "All projects (workspace-wide)"),
|
|
177
178
|
rowProps: h.rowProps
|
|
178
|
-
}), h.shown.map((e) =>
|
|
179
|
+
}), h.shown.map((e) => V({
|
|
179
180
|
id: e.id,
|
|
180
181
|
testId: `shell-workspace-project-${e.id}`,
|
|
181
182
|
current: e.id === l,
|
|
182
183
|
onPick: () => {
|
|
183
184
|
e.id !== l && u?.(e.id);
|
|
184
185
|
},
|
|
185
|
-
icon:
|
|
186
|
+
icon: R(e.name),
|
|
186
187
|
label: e.name,
|
|
187
188
|
rowProps: h.rowProps
|
|
188
189
|
}))] });
|
|
189
|
-
return /* @__PURE__ */ O
|
|
190
|
-
/* @__PURE__ */
|
|
191
|
-
|
|
192
|
-
p &&
|
|
190
|
+
return /* @__PURE__ */ A(O, { children: [
|
|
191
|
+
/* @__PURE__ */ k(a, { className: "my-1.5" }),
|
|
192
|
+
U(i("contextSwitcher.project", "Project"), s ? `${o}-projects` : void 0),
|
|
193
|
+
p && Y(e, {
|
|
193
194
|
name: "projects",
|
|
194
195
|
testId: "shell-workspace-projects",
|
|
195
196
|
plainTestId: "shell-workspace-projects",
|
|
196
197
|
rows: _
|
|
197
198
|
}),
|
|
198
|
-
m &&
|
|
199
|
+
m && H("shell-workspace-new-project", i("shell.workspaceMenu.newProject", "New project"), () => f?.())
|
|
199
200
|
] });
|
|
200
201
|
}
|
|
201
|
-
function
|
|
202
|
-
return /* @__PURE__ */
|
|
203
|
-
className:
|
|
202
|
+
function Q(t, n) {
|
|
203
|
+
return /* @__PURE__ */ A(o, { children: [/* @__PURE__ */ A(c, {
|
|
204
|
+
className: F,
|
|
204
205
|
"data-testid": "shell-workspace-org-trigger",
|
|
205
|
-
indicator: /* @__PURE__ */
|
|
206
|
+
indicator: /* @__PURE__ */ k(S, {
|
|
206
207
|
className: "size-4 flex-shrink-0 text-text-muted",
|
|
207
208
|
"aria-hidden": "true"
|
|
208
209
|
}),
|
|
209
|
-
children: [/* @__PURE__ */
|
|
210
|
+
children: [/* @__PURE__ */ k(w, {
|
|
210
211
|
className: "size-4 flex-shrink-0 text-text-secondary",
|
|
211
212
|
"aria-hidden": "true"
|
|
212
|
-
}), /* @__PURE__ */
|
|
213
|
+
}), /* @__PURE__ */ k("span", {
|
|
213
214
|
className: "min-w-0 flex-1 truncate",
|
|
214
215
|
children: t
|
|
215
216
|
})]
|
|
216
|
-
}), /* @__PURE__ */
|
|
217
|
+
}), /* @__PURE__ */ k(s, {
|
|
217
218
|
sideOffset: 6,
|
|
218
219
|
"data-testid": "shell-workspace-org-menu",
|
|
219
|
-
className: e(
|
|
220
|
+
className: e(L, "w-64"),
|
|
220
221
|
children: n
|
|
221
222
|
})] });
|
|
222
223
|
}
|
|
223
|
-
function
|
|
224
|
+
function $(e) {
|
|
224
225
|
let { props: t, lists: n, shellLabel: r, labelIds: i, orgLabel: o, searchable: s } = e, { organizations: c, activeOrganizationId: l, onSelectOrganization: u } = t;
|
|
225
226
|
if (c.length === 0) return null;
|
|
226
|
-
let d = n.organizations, f = d.shown.map((e) =>
|
|
227
|
+
let d = n.organizations, f = d.shown.map((e) => V({
|
|
227
228
|
id: e.id,
|
|
228
229
|
testId: `shell-workspace-org-${e.id}`,
|
|
229
230
|
current: e.id === l,
|
|
230
231
|
onPick: () => {
|
|
231
232
|
e.id !== l && u(e.id);
|
|
232
233
|
},
|
|
233
|
-
icon: /* @__PURE__ */
|
|
234
|
+
icon: /* @__PURE__ */ k(w, {
|
|
234
235
|
className: "size-4 flex-shrink-0 text-text-secondary",
|
|
235
236
|
"aria-hidden": "true"
|
|
236
237
|
}),
|
|
237
238
|
label: e.name,
|
|
238
239
|
rowProps: d.rowProps
|
|
239
240
|
}));
|
|
240
|
-
return /* @__PURE__ */ O
|
|
241
|
-
/* @__PURE__ */
|
|
242
|
-
|
|
243
|
-
s ?
|
|
241
|
+
return /* @__PURE__ */ A(O, { children: [
|
|
242
|
+
/* @__PURE__ */ k(a, { className: "my-1.5" }),
|
|
243
|
+
U(r("shell.workspaceMenu.organization", "Organization"), s ? `${i}-organizations` : void 0),
|
|
244
|
+
s ? J({
|
|
244
245
|
labelledBy: `${i}-organizations`,
|
|
245
246
|
testId: "shell-workspace-orgs",
|
|
246
247
|
rows: f,
|
|
247
248
|
search: d.search
|
|
248
|
-
}) :
|
|
249
|
+
}) : Q(o, f)
|
|
249
250
|
] });
|
|
250
251
|
}
|
|
251
|
-
function
|
|
252
|
+
function ee({ props: t, shellLabel: n }) {
|
|
252
253
|
let { currentProduct: r, products: l, onSelectProduct: u } = t, d = l.filter((e) => e.id !== r.id);
|
|
253
|
-
return /* @__PURE__ */ O
|
|
254
|
-
/* @__PURE__ */
|
|
255
|
-
|
|
256
|
-
/* @__PURE__ */
|
|
257
|
-
className:
|
|
254
|
+
return /* @__PURE__ */ A(O, { children: [
|
|
255
|
+
/* @__PURE__ */ k(a, { className: "my-1.5" }),
|
|
256
|
+
U(n("shell.workspaceMenu.product", "Product")),
|
|
257
|
+
/* @__PURE__ */ A(i, {
|
|
258
|
+
className: F,
|
|
258
259
|
"aria-current": "true",
|
|
259
260
|
"data-testid": `shell-workspace-product-${r.id}`,
|
|
260
261
|
children: [
|
|
261
|
-
/* @__PURE__ */
|
|
262
|
+
/* @__PURE__ */ k("span", {
|
|
262
263
|
className: "flex size-5 flex-shrink-0 items-center justify-center",
|
|
263
|
-
children: r.logo ??
|
|
264
|
+
children: r.logo ?? R(r.name)
|
|
264
265
|
}),
|
|
265
|
-
/* @__PURE__ */
|
|
266
|
+
/* @__PURE__ */ k("span", {
|
|
266
267
|
className: "min-w-0 flex-1 truncate",
|
|
267
268
|
children: r.name
|
|
268
269
|
}),
|
|
269
|
-
|
|
270
|
+
B(!0)
|
|
270
271
|
]
|
|
271
272
|
}),
|
|
272
|
-
d.length > 0 && /* @__PURE__ */
|
|
273
|
-
className:
|
|
273
|
+
d.length > 0 && /* @__PURE__ */ A(o, { children: [/* @__PURE__ */ A(c, {
|
|
274
|
+
className: F,
|
|
274
275
|
"data-testid": "shell-workspace-switch-product",
|
|
275
|
-
children: [/* @__PURE__ */
|
|
276
|
+
children: [/* @__PURE__ */ k(T, {
|
|
276
277
|
className: "size-4 flex-shrink-0 text-text-secondary",
|
|
277
278
|
"aria-hidden": "true"
|
|
278
|
-
}), /* @__PURE__ */
|
|
279
|
+
}), /* @__PURE__ */ k("span", {
|
|
279
280
|
className: "min-w-0 flex-1 truncate",
|
|
280
281
|
children: n("productSwitcher.title", "Switch product")
|
|
281
282
|
})]
|
|
282
|
-
}), /* @__PURE__ */
|
|
283
|
+
}), /* @__PURE__ */ k(s, {
|
|
283
284
|
sideOffset: 6,
|
|
284
285
|
"data-testid": "shell-workspace-product-menu",
|
|
285
|
-
className: e(
|
|
286
|
-
children: d.map((e) => /* @__PURE__ */
|
|
287
|
-
className:
|
|
286
|
+
className: e(L, "w-64"),
|
|
287
|
+
children: d.map((e) => /* @__PURE__ */ A(i, {
|
|
288
|
+
className: F,
|
|
288
289
|
onSelect: () => u(e.id),
|
|
289
290
|
"data-testid": `shell-workspace-product-${e.id}`,
|
|
290
|
-
children: [/* @__PURE__ */
|
|
291
|
+
children: [/* @__PURE__ */ k("span", {
|
|
291
292
|
className: "flex size-5 flex-shrink-0 items-center justify-center",
|
|
292
|
-
children: e.icon ??
|
|
293
|
-
}), /* @__PURE__ */
|
|
293
|
+
children: e.icon ?? R(e.name)
|
|
294
|
+
}), /* @__PURE__ */ k("span", {
|
|
294
295
|
className: "min-w-0 flex-1 truncate",
|
|
295
296
|
children: e.name
|
|
296
297
|
})]
|
|
@@ -298,75 +299,78 @@ function Q({ props: t, shellLabel: n }) {
|
|
|
298
299
|
})] })
|
|
299
300
|
] });
|
|
300
301
|
}
|
|
301
|
-
function
|
|
302
|
-
let { logo: a, workspaceName: o, orgName: s, workspaces: c, organizations: u } = i, { activeWorkspaceId: d, onSelectWorkspace: f, activeOrganizationId: p } = i,
|
|
302
|
+
function te(i) {
|
|
303
|
+
let { logo: a, workspaceName: o, orgName: s, workspaces: c, organizations: u } = i, { activeWorkspaceId: d, onSelectWorkspace: f, activeOrganizationId: p } = i, b = i.compact ?? !1, S = i.searchableLists ?? !1, C = i.appearance ?? "default", w = i.projects ?? z, T = t(), [E, D] = y(!1), O = v(null), { beside: j, contentRef: F } = h(O, "start"), I = _(), L = m(S, {
|
|
303
304
|
workspaces: c,
|
|
304
|
-
projects:
|
|
305
|
+
projects: w,
|
|
305
306
|
organizations: u
|
|
306
307
|
});
|
|
307
|
-
|
|
308
|
-
open:
|
|
309
|
-
setOpen:
|
|
308
|
+
g({
|
|
309
|
+
open: E,
|
|
310
|
+
setOpen: D,
|
|
310
311
|
workspaces: c,
|
|
311
312
|
activeWorkspaceId: d,
|
|
312
313
|
onSelectWorkspace: f
|
|
313
314
|
});
|
|
314
|
-
let
|
|
315
|
+
let R = u.find((e) => e.id === p)?.name ?? s, B = {
|
|
315
316
|
props: i,
|
|
316
|
-
projects:
|
|
317
|
-
lists:
|
|
318
|
-
shellLabel:
|
|
319
|
-
labelIds:
|
|
320
|
-
orgLabel:
|
|
321
|
-
searchable:
|
|
317
|
+
projects: w,
|
|
318
|
+
lists: L,
|
|
319
|
+
shellLabel: T,
|
|
320
|
+
labelIds: I,
|
|
321
|
+
orgLabel: R,
|
|
322
|
+
searchable: S
|
|
322
323
|
};
|
|
323
|
-
return /* @__PURE__ */
|
|
324
|
-
open:
|
|
324
|
+
return /* @__PURE__ */ A(n, {
|
|
325
|
+
open: E,
|
|
325
326
|
onOpenChange: (e) => {
|
|
326
|
-
|
|
327
|
+
D(e), e || L.clear();
|
|
327
328
|
},
|
|
328
329
|
modal: !1,
|
|
329
|
-
children: [/* @__PURE__ */
|
|
330
|
+
children: [/* @__PURE__ */ k(l, {
|
|
330
331
|
asChild: !0,
|
|
331
|
-
|
|
332
|
+
ref: O,
|
|
333
|
+
children: /* @__PURE__ */ A("button", {
|
|
332
334
|
type: "button",
|
|
333
|
-
"aria-label":
|
|
335
|
+
"aria-label": T("shell.workspaceMenu.trigger", "Switch workspace: {{name}}", { name: o }),
|
|
334
336
|
"data-testid": "shell-workspace-trigger",
|
|
335
|
-
className: e(
|
|
337
|
+
className: e(N[C], b ? "w-full" : "flex-1"),
|
|
336
338
|
children: [
|
|
337
|
-
/* @__PURE__ */
|
|
339
|
+
/* @__PURE__ */ k("span", {
|
|
338
340
|
className: "flex size-8 flex-shrink-0 items-center justify-center",
|
|
339
341
|
children: a
|
|
340
342
|
}),
|
|
341
|
-
/* @__PURE__ */
|
|
343
|
+
/* @__PURE__ */ A("span", {
|
|
342
344
|
className: "min-w-0 flex-1",
|
|
343
|
-
children: [/* @__PURE__ */
|
|
344
|
-
className:
|
|
345
|
+
children: [/* @__PURE__ */ k("span", {
|
|
346
|
+
className: P[C].name,
|
|
345
347
|
children: o
|
|
346
|
-
}), /* @__PURE__ */
|
|
347
|
-
className:
|
|
348
|
-
children:
|
|
348
|
+
}), /* @__PURE__ */ k("span", {
|
|
349
|
+
className: P[C].org,
|
|
350
|
+
children: R
|
|
349
351
|
})]
|
|
350
352
|
}),
|
|
351
|
-
/* @__PURE__ */
|
|
353
|
+
/* @__PURE__ */ k(x, {
|
|
352
354
|
className: "size-3.5 flex-shrink-0 text-text-muted",
|
|
353
355
|
"aria-hidden": "true"
|
|
354
356
|
})
|
|
355
357
|
]
|
|
356
358
|
})
|
|
357
|
-
}), /* @__PURE__ */
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
359
|
+
}), /* @__PURE__ */ A(r, {
|
|
360
|
+
ref: F,
|
|
361
|
+
side: j?.side ?? "bottom",
|
|
362
|
+
align: j?.align ?? "start",
|
|
363
|
+
sideOffset: j?.sideOffset ?? 6,
|
|
364
|
+
...j ? { collisionPadding: 8 } : {},
|
|
361
365
|
"data-testid": "shell-workspace-menu",
|
|
362
|
-
className: e(
|
|
366
|
+
className: e(M, "w-[300px]", S && q),
|
|
363
367
|
children: [
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
+
X(B),
|
|
369
|
+
Z(B),
|
|
370
|
+
$(B),
|
|
371
|
+
ee(B)
|
|
368
372
|
]
|
|
369
373
|
})]
|
|
370
374
|
});
|
|
371
375
|
}
|
|
372
|
-
export {
|
|
376
|
+
export { te as WorkspaceMenu };
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { ShellSidebarAppearance } from './types';
|
|
2
|
+
export declare const ShellSidebarAppearanceContext: import('react').Context<ShellSidebarAppearance>;
|
|
3
|
+
/** The appearance of the sidebar the caller is rendered in; `default` outside one. */
|
|
4
|
+
export declare function useShellSidebarAppearance(): ShellSidebarAppearance;
|