@burdenoff/microfe-integrations 2026.1117.3 → 2026.1118.1
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/generated/global-types.d.ts +398 -121
- package/dist/generated/wspace-operations.d.ts +727 -0
- package/dist/generated/wspace-operations.js +453 -174
- package/dist/generated/wspace-operations.js.map +1 -1
- package/dist/generated/wspace-types.d.ts +3838 -130
- package/dist/generated/wspace-types.js +28 -10
- package/dist/generated/wspace-types.js.map +1 -1
- package/dist/integrations/ConnectSourceDialog.js +30 -21
- package/dist/integrations/ConnectSourceDialog.js.map +1 -1
- package/dist/integrations/IntegrationsUserRoutes.js +32 -27
- package/dist/integrations/IntegrationsUserRoutes.js.map +1 -1
- package/dist/integrations/connected-apps/components/ActivitySections.d.ts +31 -0
- package/dist/integrations/connected-apps/components/ActivitySections.js +147 -0
- package/dist/integrations/connected-apps/components/ActivitySections.js.map +1 -0
- package/dist/integrations/connected-apps/components/AppItems.d.ts +26 -0
- package/dist/integrations/connected-apps/components/AppItems.js +171 -0
- package/dist/integrations/connected-apps/components/AppItems.js.map +1 -0
- package/dist/integrations/connected-apps/components/AppPanels.d.ts +48 -0
- package/dist/integrations/connected-apps/components/AppPanels.js +244 -0
- package/dist/integrations/connected-apps/components/AppPanels.js.map +1 -0
- package/dist/integrations/connected-apps/components/AppsSections.d.ts +30 -0
- package/dist/integrations/connected-apps/components/AppsSections.js +133 -0
- package/dist/integrations/connected-apps/components/AppsSections.js.map +1 -0
- package/dist/integrations/connected-apps/components/ConnectionActionDialogs.d.ts +30 -0
- package/dist/integrations/connected-apps/components/ConnectionActionDialogs.js +200 -0
- package/dist/integrations/connected-apps/components/ConnectionActionDialogs.js.map +1 -0
- package/dist/integrations/connected-apps/components/ConnectionActions.d.ts +38 -0
- package/dist/integrations/connected-apps/components/ConnectionActions.js +162 -0
- package/dist/integrations/connected-apps/components/ConnectionActions.js.map +1 -0
- package/dist/integrations/connected-apps/components/ConnectionHealth.d.ts +19 -0
- package/dist/integrations/connected-apps/components/ConnectionHealth.js +136 -0
- package/dist/integrations/connected-apps/components/ConnectionHealth.js.map +1 -0
- package/dist/integrations/connected-apps/components/ConnectionItems.d.ts +38 -0
- package/dist/integrations/connected-apps/components/ConnectionItems.js +358 -0
- package/dist/integrations/connected-apps/components/ConnectionItems.js.map +1 -0
- package/dist/integrations/connected-apps/components/ConnectionPanels.d.ts +37 -0
- package/dist/integrations/connected-apps/components/ConnectionPanels.js +248 -0
- package/dist/integrations/connected-apps/components/ConnectionPanels.js.map +1 -0
- package/dist/integrations/connected-apps/components/ConnectionsSections.d.ts +44 -0
- package/dist/integrations/connected-apps/components/ConnectionsSections.js +222 -0
- package/dist/integrations/connected-apps/components/ConnectionsSections.js.map +1 -0
- package/dist/integrations/connected-apps/components/Explainer.d.ts +3 -0
- package/dist/integrations/connected-apps/components/Explainer.js +56 -0
- package/dist/integrations/connected-apps/components/Explainer.js.map +1 -0
- package/dist/integrations/connected-apps/components/ListOrigin.d.ts +21 -0
- package/dist/integrations/connected-apps/components/ListOrigin.js +35 -0
- package/dist/integrations/connected-apps/components/ListOrigin.js.map +1 -0
- package/dist/integrations/connected-apps/components/Notices.d.ts +9 -0
- package/dist/integrations/connected-apps/components/Notices.js +71 -0
- package/dist/integrations/connected-apps/components/Notices.js.map +1 -0
- package/dist/integrations/connected-apps/components/PageFrame.d.ts +27 -0
- package/dist/integrations/connected-apps/components/PageFrame.js +55 -0
- package/dist/integrations/connected-apps/components/PageFrame.js.map +1 -0
- package/dist/integrations/connected-apps/components/Panels.d.ts +28 -0
- package/dist/integrations/connected-apps/components/Panels.js +50 -0
- package/dist/integrations/connected-apps/components/Panels.js.map +1 -0
- package/dist/integrations/connected-apps/components/Results.d.ts +50 -0
- package/dist/integrations/connected-apps/components/Results.js +129 -0
- package/dist/integrations/connected-apps/components/Results.js.map +1 -0
- package/dist/integrations/connected-apps/components/SearchPicker.d.ts +20 -0
- package/dist/integrations/connected-apps/components/SearchPicker.js +139 -0
- package/dist/integrations/connected-apps/components/SearchPicker.js.map +1 -0
- package/dist/integrations/connected-apps/components/StatusChip.d.ts +11 -0
- package/dist/integrations/connected-apps/components/StatusChip.js +40 -0
- package/dist/integrations/connected-apps/components/StatusChip.js.map +1 -0
- package/dist/integrations/connected-apps/components/Toolbar.d.ts +74 -0
- package/dist/integrations/connected-apps/components/Toolbar.js +216 -0
- package/dist/integrations/connected-apps/components/Toolbar.js.map +1 -0
- package/dist/integrations/connected-apps/components/styles.d.ts +12 -0
- package/dist/integrations/connected-apps/components/styles.js +15 -0
- package/dist/integrations/connected-apps/components/styles.js.map +1 -0
- package/dist/integrations/connected-apps/connect/AppPicker.d.ts +7 -0
- package/dist/integrations/connected-apps/connect/AppPicker.js +257 -0
- package/dist/integrations/connected-apps/connect/AppPicker.js.map +1 -0
- package/dist/integrations/connected-apps/connect/ConnectAppDialog.d.ts +18 -0
- package/dist/integrations/connected-apps/connect/ConnectAppDialog.js +224 -0
- package/dist/integrations/connected-apps/connect/ConnectAppDialog.js.map +1 -0
- package/dist/integrations/connected-apps/hooks/useCanCreateConnection.d.ts +1 -0
- package/dist/integrations/connected-apps/hooks/useCanCreateConnection.js +10 -0
- package/dist/integrations/connected-apps/hooks/useCanCreateConnection.js.map +1 -0
- package/dist/integrations/connected-apps/hooks/useConnectedAppsData.d.ts +372 -0
- package/dist/integrations/connected-apps/hooks/useConnectedAppsData.js +311 -0
- package/dist/integrations/connected-apps/hooks/useConnectedAppsData.js.map +1 -0
- package/dist/integrations/connected-apps/hooks/useListState.d.ts +21 -0
- package/dist/integrations/connected-apps/hooks/useListState.js +43 -0
- package/dist/integrations/connected-apps/hooks/useListState.js.map +1 -0
- package/dist/integrations/connected-apps/hooks/usePageChrome.d.ts +12 -0
- package/dist/integrations/connected-apps/hooks/usePageChrome.js +46 -0
- package/dist/integrations/connected-apps/hooks/usePageChrome.js.map +1 -0
- package/dist/integrations/connected-apps/model/activity.d.ts +26 -0
- package/dist/integrations/connected-apps/model/activity.js +79 -0
- package/dist/integrations/connected-apps/model/activity.js.map +1 -0
- package/dist/integrations/connected-apps/model/apps.d.ts +68 -0
- package/dist/integrations/connected-apps/model/apps.js +101 -0
- package/dist/integrations/connected-apps/model/apps.js.map +1 -0
- package/dist/integrations/connected-apps/model/connections.d.ts +58 -0
- package/dist/integrations/connected-apps/model/connections.js +55 -0
- package/dist/integrations/connected-apps/model/connections.js.map +1 -0
- package/dist/integrations/connected-apps/model/health.d.ts +30 -0
- package/dist/integrations/connected-apps/model/health.js +54 -0
- package/dist/integrations/connected-apps/model/health.js.map +1 -0
- package/dist/integrations/connected-apps/model/queries.d.ts +56 -0
- package/dist/integrations/connected-apps/model/queries.js +117 -0
- package/dist/integrations/connected-apps/model/queries.js.map +1 -0
- package/dist/integrations/connected-apps/model/status.d.ts +36 -0
- package/dist/integrations/connected-apps/model/status.js +73 -0
- package/dist/integrations/connected-apps/model/status.js.map +1 -0
- package/dist/integrations/connected-apps/model/translate.d.ts +2 -0
- package/dist/integrations/connected-apps/model/urlState.d.ts +52 -0
- package/dist/integrations/connected-apps/model/urlState.js +87 -0
- package/dist/integrations/connected-apps/model/urlState.js.map +1 -0
- package/dist/integrations/connected-apps/pages/ActivityPage.d.ts +1 -0
- package/dist/integrations/connected-apps/pages/ActivityPage.js +261 -0
- package/dist/integrations/connected-apps/pages/ActivityPage.js.map +1 -0
- package/dist/integrations/connected-apps/pages/AppDetailsPage.d.ts +1 -0
- package/dist/integrations/connected-apps/pages/AppDetailsPage.js +163 -0
- package/dist/integrations/connected-apps/pages/AppDetailsPage.js.map +1 -0
- package/dist/integrations/connected-apps/pages/AppsPage.d.ts +1 -0
- package/dist/integrations/connected-apps/pages/AppsPage.js +209 -0
- package/dist/integrations/connected-apps/pages/AppsPage.js.map +1 -0
- package/dist/integrations/connected-apps/pages/ConnectionDetailsPage.d.ts +1 -0
- package/dist/integrations/connected-apps/pages/ConnectionDetailsPage.js +240 -0
- package/dist/integrations/connected-apps/pages/ConnectionDetailsPage.js.map +1 -0
- package/dist/integrations/connected-apps/pages/ConnectionsPage.d.ts +1 -0
- package/dist/integrations/connected-apps/pages/ConnectionsPage.js +254 -0
- package/dist/integrations/connected-apps/pages/ConnectionsPage.js.map +1 -0
- package/dist/integrations/providers/IntegrationsProvider.js +22 -21
- package/dist/integrations/providers/IntegrationsProvider.js.map +1 -1
- package/dist/integrations/translations/en.d.ts +426 -0
- package/dist/integrations/types/index.d.ts +9 -0
- package/package.json +2 -2
|
@@ -0,0 +1,222 @@
|
|
|
1
|
+
import { cn as e } from "../../utils/cn.js";
|
|
2
|
+
import { useTr as t } from "../../hooks/useTr.js";
|
|
3
|
+
import { STATUS_GROUP_ORDER as n, statusGroupLabel as r } from "../model/status.js";
|
|
4
|
+
import { ConnectionCard as i, ConnectionRow as a, ConnectionRowsHeader as o } from "./ConnectionItems.js";
|
|
5
|
+
import { ConnectionExplainer as s } from "./Explainer.js";
|
|
6
|
+
import { Dot as c, PageHeader as l } from "./PageFrame.js";
|
|
7
|
+
import { CARD_GRID_COLUMNS as u } from "./styles.js";
|
|
8
|
+
import { AlertTriangle as d, LayoutGrid as f, MoreHorizontal as p, Plug as m, Plus as h, ScrollText as g, Store as _ } from "lucide-react";
|
|
9
|
+
import { Link as v } from "react-router";
|
|
10
|
+
import { Fragment as y, jsx as b, jsxs as x } from "react/jsx-runtime";
|
|
11
|
+
import { ProviderIcon as S } from "@burdenoff/fe-libs/connections";
|
|
12
|
+
import { Button as C, DropdownMenu as w, DropdownMenuContent as T, DropdownMenuItem as E, DropdownMenuTrigger as D, GalleryChip as O, GalleryPanel as k } from "@burdenoff/fe-libs/ui";
|
|
13
|
+
// src/integrations/connected-apps/components/ConnectionsSections.tsx
|
|
14
|
+
function A(e, t) {
|
|
15
|
+
if (e) return t === "all" ? e.all : e[t];
|
|
16
|
+
}
|
|
17
|
+
function j({ counts: n, onShowAttention: r, docsUrl: i, appsPath: a, logsPath: o, onConnect: u }) {
|
|
18
|
+
let d = t(), f = n?.attention ?? 0, p = n ? /* @__PURE__ */ b("span", {
|
|
19
|
+
className: "tabular-nums",
|
|
20
|
+
"data-testid": "connections-count-line",
|
|
21
|
+
children: n.all === 1 ? d("integrations.connectedApps.list.countLineOne", "1 connection in this workspace") : d("integrations.connectedApps.list.countLine", "{{count}} connections in this workspace", { count: n.all })
|
|
22
|
+
}) : /* @__PURE__ */ b("span", {
|
|
23
|
+
className: "h-4 w-52 rounded bg-bg-sunken motion-safe:animate-pulse",
|
|
24
|
+
"aria-hidden": "true"
|
|
25
|
+
});
|
|
26
|
+
return /* @__PURE__ */ b(l, {
|
|
27
|
+
title: d("integrations.connectedApps.list.title", "Connected apps"),
|
|
28
|
+
subtitle: /* @__PURE__ */ x(y, { children: [
|
|
29
|
+
p,
|
|
30
|
+
f > 0 && /* @__PURE__ */ x(y, { children: [/* @__PURE__ */ b(c, {}), /* @__PURE__ */ b("button", {
|
|
31
|
+
type: "button",
|
|
32
|
+
onClick: r,
|
|
33
|
+
className: e("rounded-md font-semibold text-status-warning-text hover:underline", "outline-none focus-visible:ring-2 focus-visible:ring-accent-glow"),
|
|
34
|
+
"data-testid": "connections-attention-link",
|
|
35
|
+
children: f === 1 ? d("integrations.connectedApps.list.needAttentionOne", "1 needs attention") : d("integrations.connectedApps.list.needAttention", "{{count}} need attention", { count: f })
|
|
36
|
+
})] }),
|
|
37
|
+
/* @__PURE__ */ b(c, {}),
|
|
38
|
+
/* @__PURE__ */ b(s, { docsUrl: i })
|
|
39
|
+
] }),
|
|
40
|
+
actions: /* @__PURE__ */ b(M, {
|
|
41
|
+
appsPath: a,
|
|
42
|
+
logsPath: o,
|
|
43
|
+
onConnect: u
|
|
44
|
+
})
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
function M({ appsPath: e, logsPath: n, onConnect: r }) {
|
|
48
|
+
let i = t(), a = (e, t, n) => /* @__PURE__ */ x(v, {
|
|
49
|
+
to: e,
|
|
50
|
+
children: [t, n]
|
|
51
|
+
}), o = i("integrations.connectedApps.allApps", "All apps"), s = i("integrations.connectedApps.activityLogs", "Activity logs"), c = /* @__PURE__ */ b(_, {
|
|
52
|
+
className: "size-4",
|
|
53
|
+
"aria-hidden": "true"
|
|
54
|
+
}), l = /* @__PURE__ */ b(g, {
|
|
55
|
+
className: "size-4",
|
|
56
|
+
"aria-hidden": "true"
|
|
57
|
+
});
|
|
58
|
+
return /* @__PURE__ */ x(y, { children: [
|
|
59
|
+
/* @__PURE__ */ b(C, {
|
|
60
|
+
variant: "ghost",
|
|
61
|
+
asChild: !0,
|
|
62
|
+
className: "max-sm:hidden",
|
|
63
|
+
children: a(n, l, s)
|
|
64
|
+
}),
|
|
65
|
+
/* @__PURE__ */ b(C, {
|
|
66
|
+
variant: "outline",
|
|
67
|
+
asChild: !0,
|
|
68
|
+
className: "max-sm:hidden",
|
|
69
|
+
children: a(e, c, o)
|
|
70
|
+
}),
|
|
71
|
+
/* @__PURE__ */ x(w, { children: [/* @__PURE__ */ b(D, {
|
|
72
|
+
asChild: !0,
|
|
73
|
+
children: /* @__PURE__ */ b(C, {
|
|
74
|
+
variant: "outline",
|
|
75
|
+
size: "icon",
|
|
76
|
+
className: "sm:hidden",
|
|
77
|
+
"aria-label": i("integrations.connectedApps.list.morePages", "More pages"),
|
|
78
|
+
children: /* @__PURE__ */ b(p, {
|
|
79
|
+
className: "size-4",
|
|
80
|
+
"aria-hidden": "true"
|
|
81
|
+
})
|
|
82
|
+
})
|
|
83
|
+
}), /* @__PURE__ */ x(T, {
|
|
84
|
+
align: "end",
|
|
85
|
+
children: [/* @__PURE__ */ b(E, {
|
|
86
|
+
asChild: !0,
|
|
87
|
+
className: "gap-2",
|
|
88
|
+
children: a(e, c, o)
|
|
89
|
+
}), /* @__PURE__ */ b(E, {
|
|
90
|
+
asChild: !0,
|
|
91
|
+
className: "gap-2",
|
|
92
|
+
children: a(n, l, s)
|
|
93
|
+
})]
|
|
94
|
+
})] }),
|
|
95
|
+
r && /* @__PURE__ */ x(C, {
|
|
96
|
+
onClick: r,
|
|
97
|
+
"data-testid": "connections-connect",
|
|
98
|
+
children: [/* @__PURE__ */ b(h, {
|
|
99
|
+
className: "size-4",
|
|
100
|
+
"aria-hidden": "true"
|
|
101
|
+
}), i("integrations.connectedApps.list.connect", "Connect an app")]
|
|
102
|
+
})
|
|
103
|
+
] });
|
|
104
|
+
}
|
|
105
|
+
function N({ count: e, onReview: n }) {
|
|
106
|
+
let r = t();
|
|
107
|
+
return /* @__PURE__ */ x("div", {
|
|
108
|
+
role: "status",
|
|
109
|
+
className: "mb-4 flex flex-col gap-3 rounded-xl border border-status-warning-border bg-status-warning-bg-subtle p-4 sm:flex-row sm:items-center",
|
|
110
|
+
"data-testid": "connections-attention-banner",
|
|
111
|
+
children: [/* @__PURE__ */ x("div", {
|
|
112
|
+
className: "flex min-w-0 flex-1 items-start gap-3",
|
|
113
|
+
children: [/* @__PURE__ */ b(d, {
|
|
114
|
+
className: "mt-0.5 size-5 shrink-0 text-status-warning-text",
|
|
115
|
+
"aria-hidden": "true"
|
|
116
|
+
}), /* @__PURE__ */ x("div", {
|
|
117
|
+
className: "min-w-0 flex-1",
|
|
118
|
+
children: [/* @__PURE__ */ b("p", {
|
|
119
|
+
className: "font-semibold text-status-warning-text",
|
|
120
|
+
children: e === 1 ? r("integrations.connectedApps.banner.titleOne", "1 connection stopped working") : r("integrations.connectedApps.banner.title", "{{count}} connections stopped working", { count: e })
|
|
121
|
+
}), /* @__PURE__ */ b("p", {
|
|
122
|
+
className: "text-sm text-text-secondary",
|
|
123
|
+
children: r("integrations.connectedApps.needsAttentionHint", "These apps stopped working. Reconnect them so your workflows keep running.")
|
|
124
|
+
})]
|
|
125
|
+
})]
|
|
126
|
+
}), /* @__PURE__ */ b(C, {
|
|
127
|
+
variant: "outline",
|
|
128
|
+
size: "sm",
|
|
129
|
+
onClick: n,
|
|
130
|
+
className: "border-status-warning-border text-status-warning-text hover:bg-bg-elevated hover:text-status-warning-text",
|
|
131
|
+
children: r("integrations.connectedApps.banner.review", "Review {{count}}", { count: e })
|
|
132
|
+
})]
|
|
133
|
+
});
|
|
134
|
+
}
|
|
135
|
+
function P({ counts: e, status: i, onSelect: a }) {
|
|
136
|
+
let o = t(), s = ["all", ...n].filter((t) => t === "all" || t === "working" || i === t || (A(e, t) ?? 0) > 0);
|
|
137
|
+
return /* @__PURE__ */ b("div", {
|
|
138
|
+
role: "group",
|
|
139
|
+
"aria-label": o("integrations.connectedApps.list.statusFilter", "Filter by status"),
|
|
140
|
+
className: "mb-[18px] flex flex-nowrap gap-2 overflow-x-auto pb-0.5 [scrollbar-width:none] [&::-webkit-scrollbar]:hidden",
|
|
141
|
+
"data-testid": "connections-status-chips",
|
|
142
|
+
children: s.map((t) => /* @__PURE__ */ b(O, {
|
|
143
|
+
label: r(o, t),
|
|
144
|
+
icon: t === "attention" ? /* @__PURE__ */ b(d, {
|
|
145
|
+
className: "size-4 text-status-warning-text",
|
|
146
|
+
"aria-hidden": "true"
|
|
147
|
+
}) : t === "all" ? /* @__PURE__ */ b(f, {
|
|
148
|
+
className: "size-4",
|
|
149
|
+
"aria-hidden": "true"
|
|
150
|
+
}) : void 0,
|
|
151
|
+
count: A(e, t),
|
|
152
|
+
active: i === t,
|
|
153
|
+
onSelect: () => a(t)
|
|
154
|
+
}, t))
|
|
155
|
+
});
|
|
156
|
+
}
|
|
157
|
+
function F({ popular: n, appsPath: r, onConnect: i }) {
|
|
158
|
+
let a = t();
|
|
159
|
+
return /* @__PURE__ */ b(k, {
|
|
160
|
+
icon: /* @__PURE__ */ b(m, {
|
|
161
|
+
className: "size-5 text-text-secondary",
|
|
162
|
+
"aria-hidden": "true"
|
|
163
|
+
}),
|
|
164
|
+
title: a("integrations.connectedApps.empty.title", "No connected apps yet"),
|
|
165
|
+
text: a("integrations.connectedApps.empty.text", "Connect an app once and every workflow in this workspace can use it. Start with a popular one, or browse them all."),
|
|
166
|
+
children: /* @__PURE__ */ x("div", {
|
|
167
|
+
className: "flex w-full max-w-xl flex-col items-center gap-3",
|
|
168
|
+
children: [i && n.length > 0 && /* @__PURE__ */ b("ul", {
|
|
169
|
+
className: "grid w-full grid-cols-2 gap-2 sm:grid-cols-3",
|
|
170
|
+
"aria-label": a("integrations.connectedApps.popularTitle", "Popular apps"),
|
|
171
|
+
"data-testid": "popular-app-tiles",
|
|
172
|
+
children: n.map((t) => /* @__PURE__ */ b("li", { children: /* @__PURE__ */ x("button", {
|
|
173
|
+
type: "button",
|
|
174
|
+
onClick: () => i(t.id),
|
|
175
|
+
className: e("flex w-full items-center gap-2 rounded-lg border border-border-subtle bg-bg-elevated px-3 py-2 text-start text-sm font-medium text-text-primary hover:border-accent-glow/45", "outline-none focus-visible:ring-2 focus-visible:ring-accent-glow"),
|
|
176
|
+
children: [/* @__PURE__ */ b(S, {
|
|
177
|
+
provider: t,
|
|
178
|
+
size: 24
|
|
179
|
+
}), /* @__PURE__ */ b("span", {
|
|
180
|
+
className: "truncate",
|
|
181
|
+
children: t.name
|
|
182
|
+
})]
|
|
183
|
+
}) }, t.id))
|
|
184
|
+
}), /* @__PURE__ */ b(C, {
|
|
185
|
+
variant: "outline",
|
|
186
|
+
asChild: !0,
|
|
187
|
+
children: /* @__PURE__ */ x(v, {
|
|
188
|
+
to: r,
|
|
189
|
+
children: [/* @__PURE__ */ b(_, {
|
|
190
|
+
className: "size-4",
|
|
191
|
+
"aria-hidden": "true"
|
|
192
|
+
}), a("integrations.connectedApps.empty.browse", "Browse all apps")]
|
|
193
|
+
})
|
|
194
|
+
})]
|
|
195
|
+
})
|
|
196
|
+
});
|
|
197
|
+
}
|
|
198
|
+
function I({ view: t, items: n, label: r, pathOf: s, onOpen: c }) {
|
|
199
|
+
return t === "grid" ? /* @__PURE__ */ b("div", {
|
|
200
|
+
className: e("grid gap-3.5", u),
|
|
201
|
+
"data-testid": "connections-grid",
|
|
202
|
+
children: n.map((e) => /* @__PURE__ */ b(i, {
|
|
203
|
+
connection: e,
|
|
204
|
+
to: s(e.id),
|
|
205
|
+
onOpen: () => c(e)
|
|
206
|
+
}, e.id))
|
|
207
|
+
}) : /* @__PURE__ */ x("div", {
|
|
208
|
+
className: "@container overflow-hidden rounded-xl border border-border-subtle bg-bg-elevated",
|
|
209
|
+
children: [/* @__PURE__ */ b(o, {}), /* @__PURE__ */ b("ul", {
|
|
210
|
+
"aria-label": r,
|
|
211
|
+
"data-testid": "connections-rows",
|
|
212
|
+
children: n.map((e) => /* @__PURE__ */ b(a, {
|
|
213
|
+
connection: e,
|
|
214
|
+
to: s(e.id),
|
|
215
|
+
onOpen: () => c(e)
|
|
216
|
+
}, e.id))
|
|
217
|
+
})]
|
|
218
|
+
});
|
|
219
|
+
}
|
|
220
|
+
export { N as AttentionBanner, j as ConnectionsHeader, I as ConnectionsList, F as EmptyWorkspace, P as StatusChips };
|
|
221
|
+
|
|
222
|
+
//# sourceMappingURL=ConnectionsSections.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ConnectionsSections.js","names":["_Fragment","Link","Link$1","countOf","counts","group","ConnectionsHeader","tr","useTr","attention","countLine","PageHeader","Fragment","Dot","onShowAttention","cn","ConnectionExplainer","HeaderActions","link","icon","label","appsLabel","logsLabel","appsIcon","Store","logsIcon","ScrollText","Button","logsPath","appsPath","DropdownMenu","DropdownMenuTrigger","MoreHorizontal","DropdownMenuContent","DropdownMenuItem","onConnect","Plus","AttentionBanner","AlertTriangle","count","onReview","StatusChips","groups","STATUS_GROUP_ORDER","status","GalleryChip","statusGroupLabel","LayoutGrid","onSelect","EmptyWorkspace","GalleryPanel","Plug","popular","app","ProviderIcon","ConnectionsList","view","CARD_GRID_COLUMNS","items","ConnectionCard","pathOf","connection","onOpen","ConnectionRowsHeader","ConnectionRow"],"sources":["../../../../src/integrations/connected-apps/components/ConnectionsSections.tsx"],"sourcesContent":["/**\n * The parts of Your connections (BOFF-15373): the header with its counts,\n * the yellow \"stopped working\" banner, the status chips, the empty\n * workspace, and the rows or cards.\n */\nimport type { ReactNode } from 'react';\nimport { Link } from 'react-router';\nimport {\n AlertTriangle,\n LayoutGrid,\n MoreHorizontal,\n Plug,\n Plus,\n ScrollText,\n Store,\n} from 'lucide-react';\nimport { ProviderIcon } from '@burdenoff/fe-libs/connections';\nimport {\n Button,\n DropdownMenu,\n DropdownMenuContent,\n DropdownMenuItem,\n DropdownMenuTrigger,\n GalleryChip,\n GalleryPanel,\n} from '@burdenoff/fe-libs/ui';\n\nimport type { ConnectedAppProviderFieldsFragment } from '../../../generated/wspace-operations';\nimport { cn } from '../../utils/cn';\nimport { useTr } from '../../hooks/useTr';\nimport type { StatusCounts } from '../hooks/useConnectedAppsData';\nimport type { ListView } from '../hooks/usePageChrome';\nimport type { ConnectionItem } from '../model/connections';\nimport { STATUS_GROUP_ORDER, statusGroupLabel, type StatusGroup } from '../model/status';\nimport { ConnectionCard, ConnectionRow, ConnectionRowsHeader } from './ConnectionItems';\nimport { ConnectionExplainer } from './Explainer';\nimport { Dot, PageHeader } from './PageFrame';\nimport { CARD_GRID_COLUMNS, CONTROL_RING } from './styles';\n\nfunction countOf(counts: StatusCounts | null, group: StatusGroup | 'all'): number | undefined {\n if (!counts) return undefined;\n return group === 'all' ? counts.all : counts[group];\n}\n\ninterface ConnectionsHeaderProps {\n counts: StatusCounts | null;\n onShowAttention: () => void;\n docsUrl?: string;\n appsPath: string;\n logsPath: string;\n /** Null when the person may not create connections. */\n onConnect: (() => void) | null;\n}\n\n/** \"Connected apps\", how many there are and how many need attention, and the actions. */\nexport function ConnectionsHeader({\n counts,\n onShowAttention,\n docsUrl,\n appsPath,\n logsPath,\n onConnect,\n}: ConnectionsHeaderProps) {\n const tr = useTr();\n const attention = counts?.attention ?? 0;\n const countLine = !counts ? (\n <span className=\"h-4 w-52 rounded bg-bg-sunken motion-safe:animate-pulse\" aria-hidden=\"true\" />\n ) : (\n <span className=\"tabular-nums\" data-testid=\"connections-count-line\">\n {counts.all === 1\n ? tr('integrations.connectedApps.list.countLineOne', '1 connection in this workspace')\n : tr(\n 'integrations.connectedApps.list.countLine',\n '{{count}} connections in this workspace',\n {\n count: counts.all,\n }\n )}\n </span>\n );\n return (\n <PageHeader\n title={tr('integrations.connectedApps.list.title', 'Connected apps')}\n subtitle={\n <>\n {countLine}\n {attention > 0 && (\n <>\n <Dot />\n <button\n type=\"button\"\n onClick={onShowAttention}\n className={cn(\n 'rounded-md font-semibold text-status-warning-text hover:underline',\n CONTROL_RING\n )}\n data-testid=\"connections-attention-link\"\n >\n {attention === 1\n ? tr('integrations.connectedApps.list.needAttentionOne', '1 needs attention')\n : tr(\n 'integrations.connectedApps.list.needAttention',\n '{{count}} need attention',\n {\n count: attention,\n }\n )}\n </button>\n </>\n )}\n <Dot />\n <ConnectionExplainer docsUrl={docsUrl} />\n </>\n }\n actions={<HeaderActions appsPath={appsPath} logsPath={logsPath} onConnect={onConnect} />}\n />\n );\n}\n\nfunction HeaderActions({\n appsPath,\n logsPath,\n onConnect,\n}: Pick<ConnectionsHeaderProps, 'appsPath' | 'logsPath' | 'onConnect'>) {\n const tr = useTr();\n const link = (to: string, icon: ReactNode, label: string) => (\n <Link to={to}>\n {icon}\n {label}\n </Link>\n );\n const appsLabel = tr('integrations.connectedApps.allApps', 'All apps');\n const logsLabel = tr('integrations.connectedApps.activityLogs', 'Activity logs');\n const appsIcon = <Store className=\"size-4\" aria-hidden=\"true\" />;\n const logsIcon = <ScrollText className=\"size-4\" aria-hidden=\"true\" />;\n return (\n <>\n <Button variant=\"ghost\" asChild className=\"max-sm:hidden\">\n {link(logsPath, logsIcon, logsLabel)}\n </Button>\n <Button variant=\"outline\" asChild className=\"max-sm:hidden\">\n {link(appsPath, appsIcon, appsLabel)}\n </Button>\n {/* Phones: All apps and Activity logs one tap away. */}\n <DropdownMenu>\n <DropdownMenuTrigger asChild>\n <Button\n variant=\"outline\"\n size=\"icon\"\n className=\"sm:hidden\"\n aria-label={tr('integrations.connectedApps.list.morePages', 'More pages')}\n >\n <MoreHorizontal className=\"size-4\" aria-hidden=\"true\" />\n </Button>\n </DropdownMenuTrigger>\n <DropdownMenuContent align=\"end\">\n <DropdownMenuItem asChild className=\"gap-2\">\n {link(appsPath, appsIcon, appsLabel)}\n </DropdownMenuItem>\n <DropdownMenuItem asChild className=\"gap-2\">\n {link(logsPath, logsIcon, logsLabel)}\n </DropdownMenuItem>\n </DropdownMenuContent>\n </DropdownMenu>\n {onConnect && (\n <Button onClick={onConnect} data-testid=\"connections-connect\">\n <Plus className=\"size-4\" aria-hidden=\"true\" />\n {tr('integrations.connectedApps.list.connect', 'Connect an app')}\n </Button>\n )}\n </>\n );\n}\n\n/** The yellow banner: how many stopped working, and one button to see them. */\nexport function AttentionBanner({ count, onReview }: { count: number; onReview: () => void }) {\n const tr = useTr();\n return (\n <div\n role=\"status\"\n className=\"mb-4 flex flex-col gap-3 rounded-xl border border-status-warning-border bg-status-warning-bg-subtle p-4 sm:flex-row sm:items-center\"\n data-testid=\"connections-attention-banner\"\n >\n <div className=\"flex min-w-0 flex-1 items-start gap-3\">\n <AlertTriangle\n className=\"mt-0.5 size-5 shrink-0 text-status-warning-text\"\n aria-hidden=\"true\"\n />\n <div className=\"min-w-0 flex-1\">\n <p className=\"font-semibold text-status-warning-text\">\n {count === 1\n ? tr('integrations.connectedApps.banner.titleOne', '1 connection stopped working')\n : tr(\n 'integrations.connectedApps.banner.title',\n '{{count}} connections stopped working',\n {\n count,\n }\n )}\n </p>\n <p className=\"text-sm text-text-secondary\">\n {tr(\n 'integrations.connectedApps.needsAttentionHint',\n 'These apps stopped working. Reconnect them so your workflows keep running.'\n )}\n </p>\n </div>\n </div>\n <Button\n variant=\"outline\"\n size=\"sm\"\n onClick={onReview}\n className=\"border-status-warning-border text-status-warning-text hover:bg-bg-elevated hover:text-status-warning-text\"\n >\n {tr('integrations.connectedApps.banner.review', 'Review {{count}}', { count })}\n </Button>\n </div>\n );\n}\n\n/** All, then each status group that has connections (Working always). */\nexport function StatusChips({\n counts,\n status,\n onSelect,\n}: {\n counts: StatusCounts | null;\n status: StatusGroup | 'all';\n onSelect: (status: StatusGroup | 'all') => void;\n}) {\n const tr = useTr();\n const groups = (['all', ...STATUS_GROUP_ORDER] as Array<StatusGroup | 'all'>).filter(\n (group) =>\n group === 'all' ||\n group === 'working' ||\n status === group ||\n (countOf(counts, group) ?? 0) > 0\n );\n return (\n <div\n role=\"group\"\n aria-label={tr('integrations.connectedApps.list.statusFilter', 'Filter by status')}\n className=\"mb-[18px] flex flex-nowrap gap-2 overflow-x-auto pb-0.5 [scrollbar-width:none] [&::-webkit-scrollbar]:hidden\"\n data-testid=\"connections-status-chips\"\n >\n {groups.map((group) => (\n <GalleryChip\n key={group}\n label={statusGroupLabel(tr, group)}\n icon={\n group === 'attention' ? (\n <AlertTriangle className=\"size-4 text-status-warning-text\" aria-hidden=\"true\" />\n ) : group === 'all' ? (\n <LayoutGrid className=\"size-4\" aria-hidden=\"true\" />\n ) : undefined\n }\n count={countOf(counts, group)}\n active={status === group}\n onSelect={() => onSelect(group)}\n />\n ))}\n </div>\n );\n}\n\n/** No connection at all yet: popular apps to start with, and the catalog. */\nexport function EmptyWorkspace({\n popular,\n appsPath,\n onConnect,\n}: {\n popular: ConnectedAppProviderFieldsFragment[];\n appsPath: string;\n /** Null when the person may not create connections. */\n onConnect: ((providerId: string) => void) | null;\n}) {\n const tr = useTr();\n return (\n <GalleryPanel\n icon={<Plug className=\"size-5 text-text-secondary\" aria-hidden=\"true\" />}\n title={tr('integrations.connectedApps.empty.title', 'No connected apps yet')}\n text={tr(\n 'integrations.connectedApps.empty.text',\n 'Connect an app once and every workflow in this workspace can use it. Start with a popular one, or browse them all.'\n )}\n >\n <div className=\"flex w-full max-w-xl flex-col items-center gap-3\">\n {onConnect && popular.length > 0 && (\n <ul\n className=\"grid w-full grid-cols-2 gap-2 sm:grid-cols-3\"\n aria-label={tr('integrations.connectedApps.popularTitle', 'Popular apps')}\n data-testid=\"popular-app-tiles\"\n >\n {popular.map((app) => (\n <li key={app.id}>\n <button\n type=\"button\"\n onClick={() => onConnect(app.id)}\n className={cn(\n 'flex w-full items-center gap-2 rounded-lg border border-border-subtle bg-bg-elevated px-3 py-2 text-start text-sm font-medium text-text-primary hover:border-accent-glow/45',\n CONTROL_RING\n )}\n >\n <ProviderIcon provider={app} size={24} />\n <span className=\"truncate\">{app.name}</span>\n </button>\n </li>\n ))}\n </ul>\n )}\n <Button variant=\"outline\" asChild>\n <Link to={appsPath}>\n <Store className=\"size-4\" aria-hidden=\"true\" />\n {tr('integrations.connectedApps.empty.browse', 'Browse all apps')}\n </Link>\n </Button>\n </div>\n </GalleryPanel>\n );\n}\n\n/** One page of connections, as compact rows or as cards. */\nexport function ConnectionsList({\n view,\n items,\n label,\n pathOf,\n onOpen,\n}: {\n view: ListView;\n items: ConnectionItem[];\n /** Names the list for assistive tech (the results heading). */\n label: string;\n pathOf: (id: string) => string;\n onOpen: (connection: ConnectionItem) => void;\n}) {\n if (view === 'grid') {\n return (\n <div className={cn('grid gap-3.5', CARD_GRID_COLUMNS)} data-testid=\"connections-grid\">\n {items.map((connection) => (\n <ConnectionCard\n key={connection.id}\n connection={connection}\n to={pathOf(connection.id)}\n onOpen={() => onOpen(connection)}\n />\n ))}\n </div>\n );\n }\n return (\n <div className=\"@container overflow-hidden rounded-xl border border-border-subtle bg-bg-elevated\">\n <ConnectionRowsHeader />\n <ul aria-label={label} data-testid=\"connections-rows\">\n {items.map((connection) => (\n <ConnectionRow\n key={connection.id}\n connection={connection}\n to={pathOf(connection.id)}\n onOpen={() => onOpen(connection)}\n />\n ))}\n </ul>\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;;;;AAuCA,SAASG,EAAQ,GAA6B,GAAgD;CAC5F,IAAKC,GACL,OAAOC,MAAU,QAAQD,EAAO,MAAMA,EAAOC;AAC/C;AAaA,SAAgBC,EAAkB,EAChC,WACA,oBACA,YACA,aACA,aACA,gBACyB;CACzB,IAAMC,IAAKC,EAAM,GACXC,IAAYL,GAAQ,aAAa,GACjCM,IAAaN,IAGjB,kBA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CAAA,CACD;;AAET"}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { cn as e } from "../../utils/cn.js";
|
|
2
|
+
import { useTr as t } from "../../hooks/useTr.js";
|
|
3
|
+
import { CONTROL_RING as n } from "./styles.js";
|
|
4
|
+
import { ExternalLink as r, Info as i } from "lucide-react";
|
|
5
|
+
import { jsx as a, jsxs as o } from "react/jsx-runtime";
|
|
6
|
+
import { Popover as s, PopoverContent as c, PopoverTrigger as l } from "@burdenoff/fe-libs/ui";
|
|
7
|
+
// src/integrations/connected-apps/components/Explainer.tsx
|
|
8
|
+
function u({ docsUrl: u }) {
|
|
9
|
+
let d = t();
|
|
10
|
+
return /* @__PURE__ */ o(s, { children: [/* @__PURE__ */ a(l, {
|
|
11
|
+
asChild: !0,
|
|
12
|
+
children: /* @__PURE__ */ o("button", {
|
|
13
|
+
type: "button",
|
|
14
|
+
className: e("inline-flex items-center gap-1 rounded-md text-sm text-text-secondary hover:text-text-primary", n),
|
|
15
|
+
"data-testid": "connection-explainer",
|
|
16
|
+
children: [/* @__PURE__ */ a(i, {
|
|
17
|
+
className: "size-3.5",
|
|
18
|
+
"aria-hidden": "true"
|
|
19
|
+
}), d("integrations.connectedApps.explainer.trigger", "What is a connection?")]
|
|
20
|
+
})
|
|
21
|
+
}), /* @__PURE__ */ o(c, {
|
|
22
|
+
align: "start",
|
|
23
|
+
className: "w-[min(24rem,calc(100vw-2rem))] space-y-2 text-sm",
|
|
24
|
+
children: [
|
|
25
|
+
/* @__PURE__ */ a("p", {
|
|
26
|
+
className: "font-semibold text-text-primary",
|
|
27
|
+
children: d("integrations.connectedApps.explainer.title", "Apps, connections and workflows")
|
|
28
|
+
}),
|
|
29
|
+
/* @__PURE__ */ a("p", {
|
|
30
|
+
className: "text-text-secondary",
|
|
31
|
+
children: d("integrations.connectedApps.explainer.app", "An app is a service your workspace can talk to, such as Slack or Stripe.")
|
|
32
|
+
}),
|
|
33
|
+
/* @__PURE__ */ a("p", {
|
|
34
|
+
className: "text-text-secondary",
|
|
35
|
+
children: d("integrations.connectedApps.explainer.connection", "A connection is one signed-in account or key for an app, for example “Marketing Slack”. An app can have many connections.")
|
|
36
|
+
}),
|
|
37
|
+
/* @__PURE__ */ a("p", {
|
|
38
|
+
className: "text-text-secondary",
|
|
39
|
+
children: d("integrations.connectedApps.explainer.workflows", "Workflows pick a connection for each step. When a connection stops working, those steps fail until you reconnect it. Reconnecting keeps the same connection, so no workflow needs editing.")
|
|
40
|
+
}),
|
|
41
|
+
u && /* @__PURE__ */ o("a", {
|
|
42
|
+
href: u,
|
|
43
|
+
target: "_blank",
|
|
44
|
+
rel: "noopener noreferrer",
|
|
45
|
+
className: e("inline-flex items-center gap-1 font-medium text-text-link hover:underline", "outline-none focus-visible:ring-2 focus-visible:ring-accent-glow"),
|
|
46
|
+
children: [d("integrations.connections.learnMore", "Learn more"), /* @__PURE__ */ a(r, {
|
|
47
|
+
className: "size-3.5",
|
|
48
|
+
"aria-hidden": "true"
|
|
49
|
+
})]
|
|
50
|
+
})
|
|
51
|
+
]
|
|
52
|
+
})] });
|
|
53
|
+
}
|
|
54
|
+
export { u as ConnectionExplainer };
|
|
55
|
+
|
|
56
|
+
//# sourceMappingURL=Explainer.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Explainer.js","names":["ConnectionExplainer","tr","useTr","Popover","PopoverTrigger","cn","CONTROL_RING","Info","PopoverContent","docsUrl","ExternalLink"],"sources":["../../../../src/integrations/connected-apps/components/Explainer.tsx"],"sourcesContent":["/**\n * \"What is a connection?\": the short explanation that replaces the long\n * purpose paragraph the old page opened with (BOFF-15373), one click away\n * instead of pushing the list down.\n */\nimport { ExternalLink, Info } from 'lucide-react';\nimport { Popover, PopoverContent, PopoverTrigger } from '@burdenoff/fe-libs/ui';\n\nimport { cn } from '../../utils/cn';\nimport { useTr } from '../../hooks/useTr';\nimport { CONTROL_RING } from './styles';\n\nexport function ConnectionExplainer({ docsUrl }: { docsUrl?: string }) {\n const tr = useTr();\n return (\n <Popover>\n <PopoverTrigger asChild>\n <button\n type=\"button\"\n className={cn(\n 'inline-flex items-center gap-1 rounded-md text-sm text-text-secondary hover:text-text-primary',\n CONTROL_RING\n )}\n data-testid=\"connection-explainer\"\n >\n <Info className=\"size-3.5\" aria-hidden=\"true\" />\n {tr('integrations.connectedApps.explainer.trigger', 'What is a connection?')}\n </button>\n </PopoverTrigger>\n <PopoverContent align=\"start\" className=\"w-[min(24rem,calc(100vw-2rem))] space-y-2 text-sm\">\n <p className=\"font-semibold text-text-primary\">\n {tr('integrations.connectedApps.explainer.title', 'Apps, connections and workflows')}\n </p>\n <p className=\"text-text-secondary\">\n {tr(\n 'integrations.connectedApps.explainer.app',\n 'An app is a service your workspace can talk to, such as Slack or Stripe.'\n )}\n </p>\n <p className=\"text-text-secondary\">\n {tr(\n 'integrations.connectedApps.explainer.connection',\n 'A connection is one signed-in account or key for an app, for example “Marketing Slack”. An app can have many connections.'\n )}\n </p>\n <p className=\"text-text-secondary\">\n {tr(\n 'integrations.connectedApps.explainer.workflows',\n 'Workflows pick a connection for each step. When a connection stops working, those steps fail until you reconnect it. Reconnecting keeps the same connection, so no workflow needs editing.'\n )}\n </p>\n {docsUrl && (\n <a\n href={docsUrl}\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n className={cn(\n 'inline-flex items-center gap-1 font-medium text-text-link hover:underline',\n CONTROL_RING\n )}\n >\n {tr('integrations.connections.learnMore', 'Learn more')}\n <ExternalLink className=\"size-3.5\" aria-hidden=\"true\" />\n </a>\n )}\n </PopoverContent>\n </Popover>\n );\n}\n"],"mappings":";;;;;;;AAYA,SAAgBA,EAAoB,EAAE,cAAiC;CACrE,IAAMC,IAAKC,EAAM;CACjB,OACE,kBAACC,GAAD,EAAA,UAAA,CACE,kBAACC,GAAD;EAAgB,SAAA;EACd,UAAA,kBAAC,UAAD;GACE,MAAK;GACL,WAAWC,EACT,iGACAC,CACF;GACA,eAAY;GANd,UAAA,CAQE,kBAACC,GAAD;IAAM,WAAU;IAAW,eAAY;GAAQ,CAAA,GAC9CN,EAAG,gDAAgD,uBAAuB,CACrE;;CACM,CAAA,GAChB,kBAACO,GAAD;EAAgB,OAAM;EAAQ,WAAU;EAAxC,UAAA;GACE,kBAAC,KAAD;IAAG,WAAU;IACV,UAAAP,EAAG,8CAA8C,iCAAiC;GAClF,CAAA;GACH,kBAAC,KAAD;IAAG,WAAU;IACV,UAAAA,EACC,4CACA,0EACF;GACC,CAAA;GACH,kBAAC,KAAD;IAAG,WAAU;IACV,UAAAA,EACC,mDACA,2HACF;GACC,CAAA;GACH,kBAAC,KAAD;IAAG,WAAU;IACV,UAAAA,EACC,kDACA,4LACF;GACC,CAAA;GACFQ,KACC,kBAAC,KAAD;IACE,MAAMA;IACN,QAAO;IACP,KAAI;IACJ,WAAWJ,EACT,6EAAA,kEAEF;IAPF,UAAA,CASGJ,EAAG,sCAAsC,YAAY,GACtD,kBAACS,GAAD;KAAc,WAAU;KAAW,eAAY;IAAQ,CAAA,CACtD;;EAES;CACT,CAAA,CAAA,EAAA,CAAA;AAEb"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
interface Origin {
|
|
3
|
+
/** The list's address, query included. */
|
|
4
|
+
url: string;
|
|
5
|
+
/** What the back link says, e.g. "Your connections". */
|
|
6
|
+
label: string;
|
|
7
|
+
}
|
|
8
|
+
export declare function ListOrigin({ url, label, children }: Origin & {
|
|
9
|
+
children: ReactNode;
|
|
10
|
+
}): import('react').JSX.Element;
|
|
11
|
+
/** The history state a link into a detail page carries. */
|
|
12
|
+
export declare function useOriginState(): {
|
|
13
|
+
from: string;
|
|
14
|
+
fromLabel: string;
|
|
15
|
+
} | undefined;
|
|
16
|
+
/** The back link's target and words: the list it came from, else the default. */
|
|
17
|
+
export declare function useBackTarget(fallbackUrl: string, fallbackLabel: string): {
|
|
18
|
+
url: string;
|
|
19
|
+
label: string;
|
|
20
|
+
};
|
|
21
|
+
export {};
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { createContext as e, use as t, useMemo as n } from "react";
|
|
2
|
+
import { useLocation as r } from "react-router";
|
|
3
|
+
import { jsx as i } from "react/jsx-runtime";
|
|
4
|
+
// src/integrations/connected-apps/components/ListOrigin.tsx
|
|
5
|
+
var a = e(null);
|
|
6
|
+
function o({ url: e, label: t, children: r }) {
|
|
7
|
+
let o = n(() => ({
|
|
8
|
+
url: e,
|
|
9
|
+
label: t
|
|
10
|
+
}), [e, t]);
|
|
11
|
+
return /* @__PURE__ */ i(a.Provider, {
|
|
12
|
+
value: o,
|
|
13
|
+
children: r
|
|
14
|
+
});
|
|
15
|
+
}
|
|
16
|
+
function s() {
|
|
17
|
+
let e = t(a);
|
|
18
|
+
return e ? {
|
|
19
|
+
from: e.url,
|
|
20
|
+
fromLabel: e.label
|
|
21
|
+
} : void 0;
|
|
22
|
+
}
|
|
23
|
+
function c(e, t) {
|
|
24
|
+
let n = r().state, i = typeof n?.from == "string" ? n.from : null, a = typeof n?.fromLabel == "string" ? n.fromLabel : null;
|
|
25
|
+
return i ? {
|
|
26
|
+
url: i,
|
|
27
|
+
label: a ?? t
|
|
28
|
+
} : {
|
|
29
|
+
url: e,
|
|
30
|
+
label: t
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
export { o as ListOrigin, c as useBackTarget, s as useOriginState };
|
|
34
|
+
|
|
35
|
+
//# sourceMappingURL=ListOrigin.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ListOrigin.js","names":["ListOriginContext","createContext","ListOrigin","value","useMemo","url","label","useOriginState","origin","use","useBackTarget","state","useLocation","from","fallbackLabel","fallbackUrl"],"sources":["../../../../src/integrations/connected-apps/components/ListOrigin.tsx"],"sourcesContent":["/**\n * Where a detail page was opened from (BOFF-15373), so its back link returns\n * to that list at the same page and filters (\"‹ Your connections\" to page 3,\n * \"‹ Activity logs\", \"‹ Slack\"). The browser's Back already does this through\n * the address; the in-page link reads the same origin from history state.\n */\nimport { createContext, use, useMemo, type ReactNode } from 'react';\nimport { useLocation } from 'react-router';\n\ninterface Origin {\n /** The list's address, query included. */\n url: string;\n /** What the back link says, e.g. \"Your connections\". */\n label: string;\n}\n\nconst ListOriginContext = createContext<Origin | null>(null);\n\nexport function ListOrigin({ url, label, children }: Origin & { children: ReactNode }) {\n const value = useMemo(() => ({ url, label }), [url, label]);\n return <ListOriginContext.Provider value={value}>{children}</ListOriginContext.Provider>;\n}\n\n/** The history state a link into a detail page carries. */\nexport function useOriginState(): { from: string; fromLabel: string } | undefined {\n const origin = use(ListOriginContext);\n return origin ? { from: origin.url, fromLabel: origin.label } : undefined;\n}\n\n/** The back link's target and words: the list it came from, else the default. */\nexport function useBackTarget(fallbackUrl: string, fallbackLabel: string) {\n const location = useLocation();\n const state = location.state as { from?: unknown; fromLabel?: unknown } | null;\n const from = typeof state?.from === 'string' ? state.from : null;\n const label = typeof state?.fromLabel === 'string' ? state.fromLabel : null;\n return from\n ? { url: from, label: label ?? fallbackLabel }\n : { url: fallbackUrl, label: fallbackLabel };\n}\n"],"mappings":";;;;AAgBA,IAAMA,IAAoBC,EAA6B,IAAI;AAE3D,SAAgBC,EAAW,EAAE,QAAK,UAAO,eAA8C;CACrF,IAAMC,IAAQC,SAAe;EAAE;EAAK;CAAM,IAAI,CAACC,GAAKC,CAAK,CAAC;CAC1D,OAAO,kBAACN,EAAkB,UAAnB;EAAmC;EAAQ;CAAqC,CAAA;AACzF;AAGA,SAAgBO,IAAkE;CAChF,IAAMC,IAASC,EAAIT,CAAiB;CACpC,OAAOQ,IAAS;EAAE,MAAMA,EAAO;EAAK,WAAWA,EAAO;CAAM,IAAI,KAAA;AAClE;AAGA,SAAgBE,EAAc,GAAqB,GAAuB;CAExE,IAAMC,IADWC,EACH,CAAA,CAAS,OACjBC,IAAO,OAAOF,GAAO,QAAS,WAAWA,EAAM,OAAO,MACtDL,IAAQ,OAAOK,GAAO,aAAc,WAAWA,EAAM,YAAY;CACvE,OAAOE,IACH;EAAE,KAAKA;EAAM,OAAOP,KAASQ;CAAc,IAC3C;EAAE,KAAKC;EAAa,OAAOD;CAAc;AAC/C"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
type NoticeKind = 'success' | 'error';
|
|
3
|
+
type Notify = (kind: NoticeKind, message: string) => void;
|
|
4
|
+
export declare function NoticeProvider({ children }: {
|
|
5
|
+
children: ReactNode;
|
|
6
|
+
}): import('react').JSX.Element;
|
|
7
|
+
/** Show a notice; a no-op outside a `NoticeProvider`. */
|
|
8
|
+
export declare function useNotify(): Notify;
|
|
9
|
+
export {};
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import { cn as e } from "../../utils/cn.js";
|
|
2
|
+
import { useTr as t } from "../../hooks/useTr.js";
|
|
3
|
+
import { createContext as n, use as r, useCallback as i, useEffect as a, useMemo as o, useRef as s, useState as c } from "react";
|
|
4
|
+
import { CheckCircle2 as l, X as u, XCircle as d } from "lucide-react";
|
|
5
|
+
import { jsx as f, jsxs as p } from "react/jsx-runtime";
|
|
6
|
+
// src/integrations/connected-apps/components/Notices.tsx
|
|
7
|
+
var m = n(null), h = 5e3;
|
|
8
|
+
function g({ children: n }) {
|
|
9
|
+
let r = t(), [g, _] = c([]), v = s(1), y = s(/* @__PURE__ */ new Map()), b = i((e) => {
|
|
10
|
+
_((t) => t.filter((t) => t.id !== e));
|
|
11
|
+
let t = y.current.get(e);
|
|
12
|
+
t && clearTimeout(t), y.current.delete(e);
|
|
13
|
+
}, []), x = i((e, t) => {
|
|
14
|
+
let n = v.current++;
|
|
15
|
+
_((r) => [...r.slice(-2), {
|
|
16
|
+
id: n,
|
|
17
|
+
kind: e,
|
|
18
|
+
message: t
|
|
19
|
+
}]), e === "success" && y.current.set(n, setTimeout(() => b(n), h));
|
|
20
|
+
}, [b]);
|
|
21
|
+
a(() => {
|
|
22
|
+
let e = y.current;
|
|
23
|
+
return () => {
|
|
24
|
+
for (let t of e.values()) clearTimeout(t);
|
|
25
|
+
e.clear();
|
|
26
|
+
};
|
|
27
|
+
}, []);
|
|
28
|
+
let S = o(() => x, [x]);
|
|
29
|
+
return /* @__PURE__ */ p(m.Provider, {
|
|
30
|
+
value: S,
|
|
31
|
+
children: [n, /* @__PURE__ */ f("div", {
|
|
32
|
+
className: "pointer-events-none fixed inset-x-4 bottom-4 z-[1200] flex flex-col items-center gap-2 sm:inset-x-auto sm:end-6",
|
|
33
|
+
"aria-live": "polite",
|
|
34
|
+
"data-testid": "connected-apps-notices",
|
|
35
|
+
children: g.map((t) => /* @__PURE__ */ p("div", {
|
|
36
|
+
role: t.kind === "error" ? "alert" : "status",
|
|
37
|
+
className: e("pointer-events-auto flex w-full max-w-md items-start gap-3 rounded-xl border px-4 py-3 text-sm shadow-pop", t.kind === "success" ? "border-status-success-border bg-status-success-bg-subtle text-status-success-text" : "border-status-error-border bg-status-error-bg-subtle text-status-error-text"),
|
|
38
|
+
children: [
|
|
39
|
+
t.kind === "success" ? /* @__PURE__ */ f(l, {
|
|
40
|
+
className: "mt-0.5 size-4 shrink-0",
|
|
41
|
+
"aria-hidden": "true"
|
|
42
|
+
}) : /* @__PURE__ */ f(d, {
|
|
43
|
+
className: "mt-0.5 size-4 shrink-0",
|
|
44
|
+
"aria-hidden": "true"
|
|
45
|
+
}),
|
|
46
|
+
/* @__PURE__ */ f("span", {
|
|
47
|
+
className: "min-w-0 flex-1 break-words font-medium",
|
|
48
|
+
children: t.message
|
|
49
|
+
}),
|
|
50
|
+
/* @__PURE__ */ f("button", {
|
|
51
|
+
type: "button",
|
|
52
|
+
onClick: () => b(t.id),
|
|
53
|
+
"aria-label": r("integrations.connectedApps.actions.close", "Close"),
|
|
54
|
+
className: "-m-1 inline-flex size-6 shrink-0 items-center justify-center rounded-md outline-none hover:bg-bg-elevated/60 focus-visible:ring-2 focus-visible:ring-accent-glow",
|
|
55
|
+
children: /* @__PURE__ */ f(u, {
|
|
56
|
+
className: "size-3.5",
|
|
57
|
+
"aria-hidden": "true"
|
|
58
|
+
})
|
|
59
|
+
})
|
|
60
|
+
]
|
|
61
|
+
}, t.id))
|
|
62
|
+
})]
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
function _() {
|
|
66
|
+
return r(m) ?? v;
|
|
67
|
+
}
|
|
68
|
+
function v() {}
|
|
69
|
+
export { g as NoticeProvider, _ as useNotify };
|
|
70
|
+
|
|
71
|
+
//# sourceMappingURL=Notices.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Notices.js","names":["NoticeContext","createContext","SUCCESS_MS","NoticeProvider","tr","useTr","notices","setNotices","useState","nextId","useRef","timers","dismiss","useCallback","current","notice","id","timer","notify","kind","pending","value","useMemo","children","cn","CheckCircle2","XCircle","X","useNotify","use","noop"],"sources":["../../../../src/integrations/connected-apps/components/Notices.tsx"],"sourcesContent":["/**\n * Short confirmations after an action (\"Sharing updated\", \"Test passed\"),\n * shown at the bottom of the page and read out politely (BOFF-15373). An\n * error stays until dismissed; a success fades after a few seconds.\n */\nimport {\n createContext,\n use,\n useCallback,\n useEffect,\n useMemo,\n useRef,\n useState,\n type ReactNode,\n} from 'react';\nimport { CheckCircle2, X, XCircle } from 'lucide-react';\n\nimport { cn } from '../../utils/cn';\nimport { useTr } from '../../hooks/useTr';\n\ntype NoticeKind = 'success' | 'error';\ninterface Notice {\n id: number;\n kind: NoticeKind;\n message: string;\n}\n\ntype Notify = (kind: NoticeKind, message: string) => void;\n\nconst NoticeContext = createContext<Notify | null>(null);\n\n/** How long a success notice stays. */\nconst SUCCESS_MS = 5000;\n\nexport function NoticeProvider({ children }: { children: ReactNode }) {\n const tr = useTr();\n const [notices, setNotices] = useState<Notice[]>([]);\n const nextId = useRef(1);\n const timers = useRef(new Map<number, ReturnType<typeof setTimeout>>());\n\n const dismiss = useCallback((id: number) => {\n setNotices((current) => current.filter((notice) => notice.id !== id));\n const timer = timers.current.get(id);\n if (timer) clearTimeout(timer);\n timers.current.delete(id);\n }, []);\n\n const notify = useCallback<Notify>(\n (kind, message) => {\n const id = nextId.current++;\n setNotices((current) => [...current.slice(-2), { id, kind, message }]);\n if (kind === 'success') {\n timers.current.set(\n id,\n setTimeout(() => dismiss(id), SUCCESS_MS)\n );\n }\n },\n [dismiss]\n );\n\n useEffect(() => {\n const pending = timers.current;\n return () => {\n for (const timer of pending.values()) clearTimeout(timer);\n pending.clear();\n };\n }, []);\n\n const value = useMemo(() => notify, [notify]);\n\n return (\n <NoticeContext.Provider value={value}>\n {children}\n <div\n className=\"pointer-events-none fixed inset-x-4 bottom-4 z-[1200] flex flex-col items-center gap-2 sm:inset-x-auto sm:end-6\"\n aria-live=\"polite\"\n data-testid=\"connected-apps-notices\"\n >\n {notices.map((notice) => (\n <div\n key={notice.id}\n role={notice.kind === 'error' ? 'alert' : 'status'}\n className={cn(\n 'pointer-events-auto flex w-full max-w-md items-start gap-3 rounded-xl border px-4 py-3 text-sm shadow-pop',\n notice.kind === 'success'\n ? 'border-status-success-border bg-status-success-bg-subtle text-status-success-text'\n : 'border-status-error-border bg-status-error-bg-subtle text-status-error-text'\n )}\n >\n {notice.kind === 'success' ? (\n <CheckCircle2 className=\"mt-0.5 size-4 shrink-0\" aria-hidden=\"true\" />\n ) : (\n <XCircle className=\"mt-0.5 size-4 shrink-0\" aria-hidden=\"true\" />\n )}\n <span className=\"min-w-0 flex-1 break-words font-medium\">{notice.message}</span>\n <button\n type=\"button\"\n onClick={() => dismiss(notice.id)}\n aria-label={tr('integrations.connectedApps.actions.close', 'Close')}\n className=\"-m-1 inline-flex size-6 shrink-0 items-center justify-center rounded-md outline-none hover:bg-bg-elevated/60 focus-visible:ring-2 focus-visible:ring-accent-glow\"\n >\n <X className=\"size-3.5\" aria-hidden=\"true\" />\n </button>\n </div>\n ))}\n </div>\n </NoticeContext.Provider>\n );\n}\n\n/** Show a notice; a no-op outside a `NoticeProvider`. */\nexport function useNotify(): Notify {\n const notify = use(Notic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ACAT,EAAO,SAAS,YACZ,sFACA,6EACN;IARF,UAAA;KAUGA,EAAO,SAAS,YACf,kBAACU,GAAD;MAAc,WAAU;MAAyB,eAAY;KAAQ,CAAA,IAErE,kBAACC,GAAD;MAAS,WAAU;MAAyB,eAAY;KAAQ,CAAA;KAElE,kBAAC,QAAD;MAAM,WAAU;MAA0C,UAAAX,EAAO;KAAc,CAAA;KAC/E,kBAAC,UAAD;MACE,MAAK;MACL,eAAeH,EAAQG,EAAO,EAAE;MAChC,cAAYX,EAAG,4CAA4C,OAAO;MAClE,WAAU;MAEV,UAAA,kBAACuB,GAAD;OAAG,WAAU;OAAW,eAAY;MAAQ,CAAA;KACtC,CAAA;IACL;GAvBE,GAAAZ,EAAO,EAuBT,CACN;EACE,CAAA,CACiB;;AAE5B;AAGA,SAAgBa,IAAoB;CAElC,OADeC,EAAI7B,CACZ,KAAU8B;AACnB;AAEA,SAASA,IAAO,CAEhB"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
interface PageFrameProps {
|
|
3
|
+
testId: string;
|
|
4
|
+
children: ReactNode;
|
|
5
|
+
className?: string;
|
|
6
|
+
}
|
|
7
|
+
export declare function PageFrame({ testId, children, className }: PageFrameProps): import('react').JSX.Element;
|
|
8
|
+
interface PageHeaderProps {
|
|
9
|
+
title: ReactNode;
|
|
10
|
+
/** One line under the title: counts, a short explanation, links. */
|
|
11
|
+
subtitle?: ReactNode;
|
|
12
|
+
/** Buttons on the right (they wrap under the title on phones). */
|
|
13
|
+
actions?: ReactNode;
|
|
14
|
+
/** A leading element before the title, e.g. an app's logo. */
|
|
15
|
+
leading?: ReactNode;
|
|
16
|
+
/** Ties the title to an anchor (a proactive suggestion pins here). */
|
|
17
|
+
titleProps?: Record<string, string>;
|
|
18
|
+
}
|
|
19
|
+
export declare function PageHeader({ title, subtitle, actions, leading, titleProps }: PageHeaderProps): import('react').JSX.Element;
|
|
20
|
+
/** "‹ All apps": back to the list the person came from, at the page they were on. */
|
|
21
|
+
export declare function BackLink({ to, label }: {
|
|
22
|
+
to: string;
|
|
23
|
+
label: string;
|
|
24
|
+
}): import('react').JSX.Element;
|
|
25
|
+
/** A middle dot between items of a subtitle line; phones wrap the items instead. */
|
|
26
|
+
export declare function Dot(): import('react').JSX.Element;
|
|
27
|
+
export {};
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { cn as e } from "../../utils/cn.js";
|
|
2
|
+
import { ArrowLeft as t } from "lucide-react";
|
|
3
|
+
import { Link as n } from "react-router";
|
|
4
|
+
import { jsx as r, jsxs as i } from "react/jsx-runtime";
|
|
5
|
+
// src/integrations/connected-apps/components/PageFrame.tsx
|
|
6
|
+
function a({ testId: t, children: n, className: i }) {
|
|
7
|
+
return /* @__PURE__ */ r("div", {
|
|
8
|
+
className: e("min-h-full bg-surface-canvas p-4 sm:p-6", i),
|
|
9
|
+
"data-testid": t,
|
|
10
|
+
"data-connected-apps-redesign": "",
|
|
11
|
+
children: n
|
|
12
|
+
});
|
|
13
|
+
}
|
|
14
|
+
function o({ title: e, subtitle: t, actions: n, leading: a, titleProps: o }) {
|
|
15
|
+
return /* @__PURE__ */ i("div", {
|
|
16
|
+
className: "mb-6 flex flex-col gap-4 sm:flex-row sm:items-start sm:justify-between",
|
|
17
|
+
children: [/* @__PURE__ */ i("div", {
|
|
18
|
+
className: "flex min-w-0 items-start gap-4",
|
|
19
|
+
children: [a, /* @__PURE__ */ i("div", {
|
|
20
|
+
className: "min-w-0",
|
|
21
|
+
...o,
|
|
22
|
+
children: [/* @__PURE__ */ r("h1", {
|
|
23
|
+
className: "break-words text-2xl font-bold text-text-primary sm:text-3xl",
|
|
24
|
+
children: e
|
|
25
|
+
}), t && /* @__PURE__ */ r("div", {
|
|
26
|
+
className: "mt-1 flex flex-wrap items-center gap-x-2.5 gap-y-1 text-text-secondary",
|
|
27
|
+
children: t
|
|
28
|
+
})]
|
|
29
|
+
})]
|
|
30
|
+
}), n && /* @__PURE__ */ r("div", {
|
|
31
|
+
className: "flex flex-shrink-0 flex-wrap items-center gap-2",
|
|
32
|
+
children: n
|
|
33
|
+
})]
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
function s({ to: e, label: a }) {
|
|
37
|
+
return /* @__PURE__ */ i(n, {
|
|
38
|
+
to: e,
|
|
39
|
+
className: "mb-3 inline-flex items-center gap-1.5 rounded-md text-sm font-medium text-text-secondary outline-none hover:text-text-primary focus-visible:ring-2 focus-visible:ring-accent-glow",
|
|
40
|
+
children: [/* @__PURE__ */ r(t, {
|
|
41
|
+
className: "size-4 rtl:rotate-180",
|
|
42
|
+
"aria-hidden": "true"
|
|
43
|
+
}), a]
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
function c() {
|
|
47
|
+
return /* @__PURE__ */ r("span", {
|
|
48
|
+
"aria-hidden": "true",
|
|
49
|
+
className: "max-sm:hidden",
|
|
50
|
+
children: "·"
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
export { s as BackLink, c as Dot, a as PageFrame, o as PageHeader };
|
|
54
|
+
|
|
55
|
+
//# sourceMappingURL=PageFrame.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PageFrame.js","names":["Link","Link$1","PageFrame","cn","className","testId","PageHeader","leading","titleProps","title","subtitle","actions","BackLink","ArrowLeft","label","Dot"],"sources":["../../../../src/integrations/connected-apps/components/PageFrame.tsx"],"sourcesContent":["/**\n * The page frame every redesigned Connected apps page shares with FluidGrids'\n * Templates page (BOFF-15373): the canvas, the padding, and a header with the\n * title, one line under it, and the page's actions on the right.\n */\nimport type { ReactNode } from 'react';\nimport { ArrowLeft } from 'lucide-react';\nimport { Link } from 'react-router';\n\nimport { cn } from '../../utils/cn';\n\ninterface PageFrameProps {\n testId: string;\n children: ReactNode;\n className?: string;\n}\n\nexport function PageFrame({ testId, children, className }: PageFrameProps) {\n return (\n <div\n className={cn('min-h-full bg-surface-canvas p-4 sm:p-6', className)}\n data-testid={testId}\n data-connected-apps-redesign=\"\"\n >\n {children}\n </div>\n );\n}\n\ninterface PageHeaderProps {\n title: ReactNode;\n /** One line under the title: counts, a short explanation, links. */\n subtitle?: ReactNode;\n /** Buttons on the right (they wrap under the title on phones). */\n actions?: ReactNode;\n /** A leading element before the title, e.g. an app's logo. */\n leading?: ReactNode;\n /** Ties the title to an anchor (a proactive suggestion pins here). */\n titleProps?: Record<string, string>;\n}\n\nexport function PageHeader({ title, subtitle, actions, leading, titleProps }: PageHeaderProps) {\n return (\n <div className=\"mb-6 flex flex-col gap-4 sm:flex-row sm:items-start sm:justify-between\">\n <div className=\"flex min-w-0 items-start gap-4\">\n {leading}\n <div className=\"min-w-0\" {...titleProps}>\n <h1 className=\"break-words text-2xl font-bold text-text-primary sm:text-3xl\">{title}</h1>\n {subtitle && (\n <div className=\"mt-1 flex flex-wrap items-center gap-x-2.5 gap-y-1 text-text-secondary\">\n {subtitle}\n </div>\n )}\n </div>\n </div>\n {actions && <div className=\"flex flex-shrink-0 flex-wrap items-center gap-2\">{actions}</div>}\n </div>\n );\n}\n\n/** \"‹ All apps\": back to the list the person came from, at the page they were on. */\nexport function BackLink({ to, label }: { to: string; label: string }) {\n return (\n <Link\n to={to}\n className=\"mb-3 inline-flex items-center gap-1.5 rounded-md text-sm font-medium text-text-secondary outline-none hover:text-text-primary focus-visible:ring-2 focus-visible:ring-accent-glow\"\n >\n <ArrowLeft className=\"size-4 rtl:rotate-180\" aria-hidden=\"true\" />\n {label}\n </Link>\n );\n}\n\n/** A middle dot between items of a subtitle line; phones wrap the items instead. */\nexport function Dot() {\n return (\n <span aria-hidden=\"true\" className=\"max-sm:hidden\">\n ·\n </span>\n );\n}\n"],"mappings":";;;;;AAiBA,SAAgBE,EAAU,EAAE,WAAQ,aAAU,gBAA6B;CACzE,OACE,kBAAC,OAAD;EACE,WAAWC,EAAG,2CAA2CC,CAAS;EAClE,eAAaC;EACb,gCAA6B;EAE5B;CACE,CAAA;AAET;AAcA,SAAgBC,EAAW,EAAE,UAAO,aAAU,YAAS,YAAS,iBAA+B;CAC7F,OACE,kBAAC,OAAD;EAAK,WAAU;EAAf,UAAA,CACE,kBAAC,OAAD;GAAK,WAAU;GAAf,UAAA,CACGC,GACD,kBAAC,OAAD;IAAK,WAAU;IAAU,GAAIC;IAA7B,UAAA,CACE,kBAAC,MAAD;KAAI,WAAU;KAAgE,UAAAC;IAAU,CAAA,GACvFC,KACC,kBAAC,OAAD;KAAK,WAAU;KACZ,UAAAA;IACE,CAAA,CAEJ;GACF,CAAA,CAAA;EACJ,CAAA,GAAAC,KAAW,kBAAC,OAAD;GAAK,WAAU;GAAmD,UAAAA;EAAa,CAAA,CACxF;;AAET;AAGA,SAAgBC,EAAS,EAAE,OAAI,YAAwC;CACrE,OACE,kBAACZ,GAAD;EACM;EACJ,WAAU;EAFZ,UAAA,CAIE,kBAACa,GAAD;GAAW,WAAU;GAAwB,eAAY;EAAQ,CAAA,GAChEC,CACG;;AAEV;AAGA,SAAgBC,IAAM;CACpB,OACE,kBAAC,QAAD;EAAM,eAAY;EAAO,WAAU;EAAgB,UAAA;CAE7C,CAAA;AAEV"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
interface SectionPanelProps {
|
|
3
|
+
title: string;
|
|
4
|
+
icon?: ReactNode;
|
|
5
|
+
/** Controls on the right of the title (e.g. "All activity", "Share"). */
|
|
6
|
+
actions?: ReactNode;
|
|
7
|
+
children: ReactNode;
|
|
8
|
+
className?: string;
|
|
9
|
+
/** Rows that run edge to edge (lists), instead of padded content. */
|
|
10
|
+
flush?: boolean;
|
|
11
|
+
testId?: string;
|
|
12
|
+
}
|
|
13
|
+
export declare function SectionPanel({ title, icon, actions, children, className, flush, testId, }: SectionPanelProps): import('react').JSX.Element;
|
|
14
|
+
export interface KeyValue {
|
|
15
|
+
id: string;
|
|
16
|
+
label: string;
|
|
17
|
+
value: ReactNode;
|
|
18
|
+
}
|
|
19
|
+
/** Label on the left, value on the right; stacked on narrow panels. */
|
|
20
|
+
export declare function KeyValueList({ rows }: {
|
|
21
|
+
rows: KeyValue[];
|
|
22
|
+
}): import('react').JSX.Element;
|
|
23
|
+
/** A small rounded label: "Required", "Recommended", "Owner". */
|
|
24
|
+
export declare function Pill({ children, tone, }: {
|
|
25
|
+
children: ReactNode;
|
|
26
|
+
tone?: 'neutral' | 'warning' | 'accent';
|
|
27
|
+
}): import('react').JSX.Element;
|
|
28
|
+
export {};
|