@burdenoff/fe-libs 2026.1113.6 → 2026.1113.7

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.
Files changed (35) hide show
  1. package/dist/connections/ConnectionDialog.d.ts +13 -1
  2. package/dist/connections/ConnectionDialog.js +13 -11
  3. package/dist/connections/ConnectionDialogPanel.d.ts +5 -1
  4. package/dist/connections/ConnectionDialogPanel.js +230 -150
  5. package/dist/connections/ConnectionFormTab.d.ts +15 -0
  6. package/dist/connections/ConnectionFormTab.js +192 -189
  7. package/dist/connections/CredentialStorageSelector.d.ts +9 -0
  8. package/dist/connections/CredentialStorageSelector.js +145 -137
  9. package/dist/connections/OneScreenConnectionForm.d.ts +22 -0
  10. package/dist/connections/OneScreenConnectionForm.js +231 -0
  11. package/dist/connections/ProviderPickerPanel.d.ts +6 -0
  12. package/dist/connections/ProviderPickerPanel.js +98 -45
  13. package/dist/connections/api.d.ts +3 -0
  14. package/dist/connections/api.js +4 -2
  15. package/dist/connections/connectionFlow.d.ts +18 -0
  16. package/dist/connections/connectionFlow.js +3 -3
  17. package/dist/connections/index.d.ts +4 -3
  18. package/dist/connections/picker.d.ts +18 -0
  19. package/dist/connections/picker.js +35 -6
  20. package/dist/connections/scopes.d.ts +8 -0
  21. package/dist/connections/scopes.js +9 -1
  22. package/dist/connections/storage.d.ts +9 -1
  23. package/dist/connections/storage.js +13 -1
  24. package/dist/connections/types.d.ts +16 -0
  25. package/dist/connections/useConnectionSubmit.d.ts +38 -2
  26. package/dist/connections/useConnectionSubmit.js +115 -71
  27. package/dist/connections.js +11 -10
  28. package/dist/credentials/SchemaForm.d.ts +7 -1
  29. package/dist/credentials/SchemaForm.js +64 -64
  30. package/dist/credentials/index.d.ts +2 -2
  31. package/dist/credentials/schema.d.ts +11 -1
  32. package/dist/credentials/schema.js +13 -5
  33. package/dist/credentials/types.d.ts +9 -0
  34. package/dist/credentials.js +5 -5
  35. package/package.json +1 -1
@@ -3,7 +3,7 @@ import { ApolloClient } from '@apollo/client';
3
3
  import { Translator } from '../credentials/translate';
4
4
  import { ConnectionsApi } from './api';
5
5
  import { ConnectionDialogPresentation } from './frame';
6
- import { ConnectionDialogEvent, ConnectionVisibility, CreatedConnection } from './types';
6
+ import { ConnectionDialogEvent, ConnectionReconnectTarget, ConnectionVisibility, CreatedConnection } from './types';
7
7
  export interface ConnectionDialogProps {
8
8
  open: boolean;
9
9
  onClose: () => void;
@@ -56,6 +56,18 @@ export interface ConnectionDialogProps {
56
56
  presentation?: ConnectionDialogPresentation;
57
57
  /** Heading while the provider picker shows. Defaults to "Add new credential". */
58
58
  pickerTitle?: string;
59
+ /**
60
+ * Navigation v2's one-screen form (BOFF-11875), opted into by FluidGrids:
61
+ * popular apps first in the picker, the required fields and one button at
62
+ * level 1, everything else under one "More options", no tab rail. Off (the
63
+ * default), the dialog is exactly the classic tabbed form.
64
+ */
65
+ navigationV2?: boolean;
66
+ /**
67
+ * Sign in again on this existing connection (Reconnect) instead of creating
68
+ * one. The record keeps its id, name and storage.
69
+ */
70
+ reconnect?: ConnectionReconnectTarget | null;
59
71
  /** Test seam: supply the service directly instead of via `client`. */
60
72
  api?: ConnectionsApi;
61
73
  }
@@ -29,12 +29,12 @@ var v = ({ onClose: e, translate: t }) => /* @__PURE__ */ g(m, { children: [
29
29
  className: "rounded-md border border-border-subtle px-4 py-2 text-sm font-medium transition-colors hover:bg-accent",
30
30
  children: t("integrations.common.close", "Close")
31
31
  })
32
- ] }), y = ({ open: i, onClose: p, client: m, callbackUrl: y, translate: b = e, providerId: x, providerKey: S, providerSource: C = "installed", requireVault: w = !0, canCreate: T = !0, canCreateVault: E = !1, defaultName: D, extraConfig: O, showSharingTab: k = !1, defaultVisibility: A, refetchQueriesOnCreate: j, onConnectionCreated: M, onError: N, onEvent: P, renderSuccessAction: F, presentation: I = "dialog", pickerTitle: L, api: R }) => {
33
- let z = j?.join("|") ?? "", B = d(() => R ?? n(m, { refetchQueriesOnCreate: z ? z.split("|") : void 0 }), [
34
- R,
32
+ ] }), y = ({ open: i, onClose: p, client: m, callbackUrl: y, translate: b = e, providerId: x, providerKey: S, providerSource: C = "installed", requireVault: w = !0, canCreate: T = !0, canCreateVault: E = !1, defaultName: D, extraConfig: O, showSharingTab: k = !1, defaultVisibility: A, refetchQueriesOnCreate: j, onConnectionCreated: M, onError: N, onEvent: P, renderSuccessAction: F, presentation: I = "dialog", pickerTitle: L, navigationV2: R = !1, reconnect: z = null, api: B }) => {
33
+ let V = j?.join("|") ?? "", H = d(() => B ?? n(m, { refetchQueriesOnCreate: V ? V.split("|") : void 0 }), [
34
+ B,
35
35
  m,
36
- z
37
- ]), V = f(null), H = f(null), U = f(null);
36
+ V
37
+ ]), U = f(null), W = f(null), G = f(null);
38
38
  return /* @__PURE__ */ h(_.Root, {
39
39
  open: i,
40
40
  onOpenChange: (e) => !e && p(),
@@ -43,7 +43,7 @@ var v = ({ onClose: e, translate: t }) => /* @__PURE__ */ g(m, { children: [
43
43
  style: { zIndex: c },
44
44
  className: "fixed inset-0 bg-bg-overlay animate-in fade-in-0 duration-200"
45
45
  }), /* @__PURE__ */ h(_.Content, {
46
- ref: H,
46
+ ref: W,
47
47
  "aria-modal": "true",
48
48
  "aria-labelledby": T ? u : o,
49
49
  "data-testid": "add-connection-dialog",
@@ -51,15 +51,15 @@ var v = ({ onClose: e, translate: t }) => /* @__PURE__ */ g(m, { children: [
51
51
  style: { zIndex: s },
52
52
  className: t(l, a[I][T ? "form" : "notice"]),
53
53
  onOpenAutoFocus: (e) => {
54
- V.current = document.activeElement instanceof HTMLElement ? document.activeElement : null, e.preventDefault(), (U.current ?? H.current)?.focus({ preventScroll: !0 });
54
+ U.current = document.activeElement instanceof HTMLElement ? document.activeElement : null, e.preventDefault(), (G.current ?? W.current)?.focus({ preventScroll: !0 });
55
55
  },
56
56
  onCloseAutoFocus: (e) => {
57
57
  e.preventDefault();
58
- let t = V.current;
58
+ let t = U.current;
59
59
  t && t.isConnected && t !== document.body && t.focus({ preventScroll: !0 });
60
60
  },
61
61
  children: T ? /* @__PURE__ */ h(r, {
62
- api: B,
62
+ api: H,
63
63
  onClose: p,
64
64
  callbackUrl: y,
65
65
  translate: b,
@@ -73,11 +73,13 @@ var v = ({ onClose: e, translate: t }) => /* @__PURE__ */ g(m, { children: [
73
73
  showSharingTab: k,
74
74
  defaultVisibility: A,
75
75
  pickerTitle: L,
76
- searchInputRef: U,
76
+ searchInputRef: G,
77
77
  onConnectionCreated: M,
78
78
  onError: N,
79
79
  onEvent: P,
80
- renderSuccessAction: F
80
+ renderSuccessAction: F,
81
+ navigationV2: R,
82
+ reconnect: z
81
83
  }) : /* @__PURE__ */ h(v, {
82
84
  onClose: p,
83
85
  translate: b
@@ -1,7 +1,7 @@
1
1
  import { FC, ReactNode, RefObject } from 'react';
2
2
  import { Translator } from '../credentials/translate';
3
3
  import { ConnectionsApi } from './api';
4
- import { ConnectionDialogEvent, CreatedConnection, ConnectionVisibility } from './types';
4
+ import { ConnectionDialogEvent, CreatedConnection, ConnectionReconnectTarget, ConnectionVisibility } from './types';
5
5
  export interface ConnectionDialogPanelProps {
6
6
  api: ConnectionsApi;
7
7
  onClose: () => void;
@@ -23,5 +23,9 @@ export interface ConnectionDialogPanelProps {
23
23
  onError?: (error: Error) => void;
24
24
  onEvent?: (event: ConnectionDialogEvent) => void;
25
25
  renderSuccessAction?: (connection: CreatedConnection) => ReactNode;
26
+ /** Navigation v2's one-screen form (BOFF-11875). Off: the classic tabbed form. */
27
+ navigationV2?: boolean;
28
+ /** Sign in again on this existing connection instead of creating one. */
29
+ reconnect?: ConnectionReconnectTarget | null;
26
30
  }
27
31
  export declare const ConnectionDialogPanel: FC<ConnectionDialogPanelProps>;
@@ -1,93 +1,107 @@
1
1
  import { initialValuesFromSchema as e } from "../credentials/schema.js";
2
2
  import { cn as t } from "../lib/utils.js";
3
- import { normalizeStorageMode as n, resolveFlow as r, resolveMethod as i, resolveSchema as a, selectableMethods as ee, supportedStorageModes as o } from "./connectionFlow.js";
4
- import { ConnectionDetailsTab as te, ConnectionSharingTab as ne } from "./ConnectionDetailsTab.js";
5
- import { ConnectionFormTab as re } from "./ConnectionFormTab.js";
3
+ import { normalizeStorageMode as n, resolveFlow as r, resolveMethod as i, resolveSchema as a, selectableMethods as o, supportedStorageModes as s } from "./connectionFlow.js";
4
+ import { ConnectionDetailsTab as ee, ConnectionSharingTab as te } from "./ConnectionDetailsTab.js";
5
+ import { ConnectionFormTab as ne } from "./ConnectionFormTab.js";
6
+ import { OneScreenConnectionForm as re } from "./OneScreenConnectionForm.js";
6
7
  import { DialogHeading as ie } from "./DialogHeading.js";
7
8
  import { TITLE_ID as ae } from "./frame.js";
8
9
  import { authTypeLabel as oe } from "./labels.js";
9
10
  import { ProviderIcon as se } from "./ProviderIcon.js";
10
11
  import { ProviderPickerPanel as ce } from "./ProviderPickerPanel.js";
11
12
  import { parseScopeOptions as le, requestedScopes as ue } from "./scopes.js";
12
- import { EMPTY_STORAGE as s } from "./storage.js";
13
+ import { EMPTY_STORAGE as c } from "./storage.js";
13
14
  import { useConnectionSubmit as de } from "./useConnectionSubmit.js";
14
- import { useCallback as c, useEffect as fe, useId as pe, useMemo as l, useState as u } from "react";
15
- import { AlertCircle as me, Check as he, CheckCircle2 as ge, Info as _e, Link2 as ve, Loader2 as d, Share2 as ye, X as be } from "lucide-react";
16
- import { Fragment as f, jsx as p, jsxs as m } from "react/jsx-runtime";
17
- import * as h from "@radix-ui/react-dialog";
15
+ import { useCallback as l, useEffect as fe, useId as pe, useMemo as u, useState as d } from "react";
16
+ import { AlertCircle as me, Check as he, CheckCircle2 as ge, ExternalLink as _e, Info as ve, Link2 as ye, Loader2 as be, Share2 as xe, X as Se } from "lucide-react";
17
+ import { Fragment as Ce, jsx as f, jsxs as p } from "react/jsx-runtime";
18
+ import * as we from "@radix-ui/react-dialog";
18
19
  // src/connections/ConnectionDialogPanel.tsx
19
- function g(t, n) {
20
+ function Te(t, n) {
20
21
  return e(a(t, i(t, n)));
21
22
  }
22
- var _ = ({ api: e, onClose: _, callbackUrl: v, translate: y, providerId: b, providerKey: x, providerSource: xe, requireVault: S, canCreateVault: Se, defaultName: C, extraConfig: Ce, showSharingTab: we, defaultVisibility: Te, pickerTitle: Ee, searchInputRef: De, onConnectionCreated: Oe, onError: ke, onEvent: Ae, renderSuccessAction: w }) => {
23
- let T = !!(b || x), [E, je] = u(null), [D, Me] = u(T), [O, k] = u("connection"), [A, j] = u(C ?? ""), [M, Ne] = u(""), [Pe, N] = u(null), [P, F] = u({}), [I, L] = u(null), [R, z] = u(s), [B, Fe] = u(Te), V = pe(), H = c((e) => `${V}-${e}`, [V]), { submit: Ie, busy: U, oauthWaiting: Le, errorMessage: Re, setErrorMessage: W, created: G } = de({
23
+ var m = ({ api: e, onClose: m, callbackUrl: h, translate: g, providerId: Ee, providerKey: _, providerSource: De, requireVault: v, canCreateVault: y, defaultName: b, extraConfig: Oe, showSharingTab: x, defaultVisibility: ke, pickerTitle: Ae, searchInputRef: je, onConnectionCreated: Me, onError: Ne, onEvent: Pe, renderSuccessAction: S, navigationV2: C = !1, reconnect: w = null }) => {
24
+ let T = w?.providerId ?? Ee, E = !!(T || _), [D, Fe] = d(null), [O, Ie] = d(E), [k, A] = d("connection"), [j, M] = d(w?.name ?? b ?? ""), [N, Le] = d(""), [Re, ze] = d(null), [P, F] = d({}), [I, L] = d(null), [R, z] = d(c), [B, Be] = d(ke), [Ve, He] = d(null), V = pe(), H = l((e) => `${V}-${e}`, [V]), Ue = u(() => w ? {
25
+ id: w.connectionId,
26
+ name: w.name,
27
+ status: "",
28
+ errorMessage: null
29
+ } : null, [w]), { submit: We, busy: U, oauthWaiting: W, errorMessage: Ge, setErrorMessage: G, created: K, signInBlocked: Ke, openBlockedSignIn: qe, cancelSignIn: Je } = de({
24
30
  api: e,
25
- callbackUrl: v,
26
- translate: y,
27
- onConnectionCreated: Oe,
28
- onError: ke,
29
- onEvent: Ae
30
- }), K = c((e) => {
31
- je(e), j(C ?? `${e.name} Connection`), N(null), F(g(e, null)), z(n(s, o(e, i(e, null)))), L(null), W("");
32
- }, [C, W]), ze = c((e) => {
33
- if (!E) return;
34
- N(e), F(g(E, e));
35
- let t = o(E, i(E, e));
31
+ callbackUrl: h,
32
+ translate: g,
33
+ onConnectionCreated: Me,
34
+ onError: Ne,
35
+ onEvent: Pe,
36
+ reconnectConnection: Ue
37
+ }), Ye = w?.name, Xe = w?.authMethodKey ?? null, q = l((e) => {
38
+ let t = Xe;
39
+ Fe(e), M(Ye ?? b ?? `${e.name} Connection`), ze(t), F(Te(e, t)), z(n(c, s(e, i(e, t)))), L(null), G("");
40
+ }, [
41
+ b,
42
+ Ye,
43
+ Xe,
44
+ G
45
+ ]), Ze = l((e) => {
46
+ if (!D) return;
47
+ ze(e), F(Te(D, e));
48
+ let t = s(D, i(D, e));
36
49
  z((e) => ({
37
50
  ...n(e, t),
38
51
  secretId: ""
39
- })), L(null), W("");
40
- }, [E, W]);
52
+ })), L(null), G("");
53
+ }, [D, G]);
41
54
  fe(() => {
42
- if (!T) return;
55
+ if (!E) return;
43
56
  let t = !1;
44
57
  return e.getProvider({
45
- id: b ?? void 0,
46
- key: x ?? void 0
58
+ id: T ?? void 0,
59
+ key: _ ?? void 0
47
60
  }).then((e) => {
48
- !t && e && K(e);
61
+ !t && e && q(e);
49
62
  }).catch(() => void 0).finally(() => {
50
- t || Me(!1);
63
+ t || Ie(!1);
51
64
  }), () => {
52
65
  t = !0;
53
66
  };
54
67
  }, [
68
+ E,
55
69
  T,
56
- b,
57
- x,
70
+ _,
58
71
  e,
59
- K
72
+ q
60
73
  ]);
61
- let q = E ? i(E, Pe) : null, Be = E ? r(E, q) : "fields", Ve = l(() => E ? a(E, q) : null, [E, q]), J = l(() => le(q?.availableScopes ?? E?.availableScopes), [q, E]), Y = q && q.defaultScopes.length > 0 ? q.defaultScopes : E?.defaultScopes ?? [], He = () => {
62
- E && Ie({
63
- provider: E,
64
- method: q,
65
- name: A,
66
- description: M,
74
+ let J = D ? i(D, Re) : null, Y = D ? r(D, J) : "fields", X = u(() => D ? a(D, J) : null, [D, J]), Z = u(() => le(J?.availableScopes ?? D?.availableScopes), [J, D]), Qe = J && J.defaultScopes.length > 0 ? J.defaultScopes : D?.defaultScopes ?? [], $e = () => {
75
+ D && We({
76
+ provider: D,
77
+ method: J,
78
+ name: j,
79
+ description: N,
67
80
  values: P,
68
81
  storage: R,
69
- requireVault: S,
70
- extraConfig: Ce,
71
- visibility: B
72
- }, ue(I, J));
73
- }, X = [
82
+ requireVault: v,
83
+ extraConfig: Oe,
84
+ visibility: B,
85
+ reconnect: !!w
86
+ }, ue(I, Z));
87
+ }, et = [
74
88
  {
75
89
  key: "connection",
76
- label: y("integrations.addConnection.tabs.connection", "Connection"),
77
- icon: ve
90
+ label: g("integrations.addConnection.tabs.connection", "Connection"),
91
+ icon: ye
78
92
  },
79
- ...we ? [{
93
+ ...x ? [{
80
94
  key: "sharing",
81
- label: y("integrations.addConnection.tabs.sharing", "Sharing"),
82
- icon: ye
95
+ label: g("integrations.addConnection.tabs.sharing", "Sharing"),
96
+ icon: xe
83
97
  }] : [],
84
98
  {
85
99
  key: "details",
86
- label: y("integrations.addConnection.tabs.details", "Details"),
87
- icon: _e
100
+ label: g("integrations.addConnection.tabs.details", "Details"),
101
+ icon: ve
88
102
  }
89
- ], Z = (e) => H(`tab-${e}`), Q = H("tabpanel"), Ue = (e) => {
90
- let t = X.map((e) => e.key), n = t.indexOf(O), r = {
103
+ ], Q = (e) => H(`tab-${e}`), tt = H("tabpanel"), nt = (e) => {
104
+ let t = et.map((e) => e.key), n = t.indexOf(k), r = {
91
105
  ArrowRight: n + 1,
92
106
  ArrowDown: n + 1,
93
107
  ArrowLeft: n - 1,
@@ -97,188 +111,254 @@ var _ = ({ api: e, onClose: _, callbackUrl: v, translate: y, providerId: b, prov
97
111
  }[e.key];
98
112
  if (r === void 0) return;
99
113
  let i = t[(r + t.length) % t.length];
100
- e.preventDefault(), k(i), document.getElementById(Z(i))?.focus();
101
- }, $ = !!E && !G;
102
- return /* @__PURE__ */ m(f, { children: [
103
- /* @__PURE__ */ m("div", {
114
+ e.preventDefault(), A(i), document.getElementById(Q(i))?.focus();
115
+ }, $ = !!D && !K, rt = K?.externalAccountEmail || K?.externalAccountName || "";
116
+ return /* @__PURE__ */ p(Ce, { children: [
117
+ /* @__PURE__ */ p("div", {
104
118
  className: "flex flex-shrink-0 items-center justify-between border-b border-border-subtle px-5 py-4",
105
- children: [/* @__PURE__ */ m("div", {
119
+ children: [/* @__PURE__ */ p("div", {
106
120
  className: "flex min-w-0 items-center gap-3",
107
- children: [E && /* @__PURE__ */ p(se, {
108
- provider: E,
121
+ children: [D && /* @__PURE__ */ f(se, {
122
+ provider: D,
109
123
  size: 32
110
- }), /* @__PURE__ */ m("div", {
124
+ }), /* @__PURE__ */ p("div", {
111
125
  className: "min-w-0",
112
- children: [/* @__PURE__ */ p(ie, {
126
+ children: [/* @__PURE__ */ f(ie, {
113
127
  id: ae,
114
- className: t("text-base font-semibold text-text-primary", E && "truncate"),
115
- children: E ? y("integrations.addConnection.dialog.accountTitle", "{{provider}} account", { provider: E.name }) : Ee ?? y("integrations.addConnection.dialog.title", "Add new credential")
116
- }), /* @__PURE__ */ p(h.Description, {
128
+ className: t("text-base font-semibold text-text-primary", D && "truncate"),
129
+ children: D ? C ? w ? g("integrations.addConnection.oneScreen.reconnectTitle", "Reconnect {{provider}}", { provider: D.name }) : g("integrations.addConnection.oneScreen.title", "Connect {{provider}}", { provider: D.name }) : g("integrations.addConnection.dialog.accountTitle", "{{provider}} account", { provider: D.name }) : Ae ?? (C ? g("integrations.addConnection.oneScreen.pickerTitle", "Connect an app") : g("integrations.addConnection.dialog.title", "Add new credential"))
130
+ }), /* @__PURE__ */ f(we.Description, {
117
131
  className: "text-xs text-text-secondary",
118
- children: E ? oe(q?.authType ?? E.authType, y) : y("integrations.addConnection.dialog.subtitle", "Select an app or service to connect to")
132
+ children: D ? C ? g("integrations.addConnection.oneScreen.subtitle", "Your workflows can use this account once it is connected.", { provider: D.name }) : oe(J?.authType ?? D.authType, g) : g("integrations.addConnection.dialog.subtitle", "Select an app or service to connect to")
119
133
  })]
120
134
  })]
121
- }), /* @__PURE__ */ p(h.Close, {
135
+ }), /* @__PURE__ */ f(we.Close, {
122
136
  asChild: !0,
123
- children: /* @__PURE__ */ p("button", {
137
+ children: /* @__PURE__ */ f("button", {
124
138
  type: "button",
125
139
  className: "flex-shrink-0 rounded-md p-1.5 text-text-secondary transition-colors hover:bg-accent hover:text-text-primary",
126
- "aria-label": y("integrations.addConnection.actions.close", "Close dialog"),
127
- children: /* @__PURE__ */ p(be, { size: 20 })
140
+ "aria-label": g("integrations.addConnection.actions.close", "Close dialog"),
141
+ children: /* @__PURE__ */ f(Se, { size: 20 })
128
142
  })
129
143
  })]
130
144
  }),
131
- /* @__PURE__ */ m("div", {
145
+ /* @__PURE__ */ p("div", {
132
146
  "data-testid": "add-connection-body",
133
147
  className: "flex min-h-0 flex-1 flex-col overflow-hidden sm:flex-row",
134
148
  children: [
135
- !T && !E && /* @__PURE__ */ p(ce, {
149
+ !E && !D && /* @__PURE__ */ f(ce, {
136
150
  api: e,
137
- source: xe,
138
- translate: y,
139
- searchInputRef: De,
140
- onSelect: K
151
+ source: De,
152
+ translate: g,
153
+ searchInputRef: je,
154
+ onSelect: q,
155
+ navigationV2: C
141
156
  }),
142
- T && !E && D && /* @__PURE__ */ p("div", {
157
+ E && !D && O && /* @__PURE__ */ f("div", {
143
158
  className: "flex flex-1 items-center justify-center p-8",
144
- children: /* @__PURE__ */ p(d, {
159
+ children: /* @__PURE__ */ f(be, {
145
160
  size: 32,
146
161
  className: "animate-spin text-text-secondary"
147
162
  })
148
163
  }),
149
- T && !E && !D && /* @__PURE__ */ m("div", {
164
+ E && !D && !O && /* @__PURE__ */ p("div", {
150
165
  className: "flex flex-1 flex-col items-center justify-center p-8 text-center",
151
- children: [/* @__PURE__ */ p(me, {
166
+ children: [/* @__PURE__ */ f(me, {
152
167
  size: 32,
153
168
  className: "mb-3 text-text-secondary"
154
- }), /* @__PURE__ */ p("p", {
169
+ }), /* @__PURE__ */ f("p", {
155
170
  className: "text-sm text-text-secondary",
156
- children: y("integrations.addConnection.providerUnavailable", "This provider isn't available.")
171
+ children: g("integrations.addConnection.providerUnavailable", "This provider isn't available.")
157
172
  })]
158
173
  }),
159
- E && G && /* @__PURE__ */ m("div", {
174
+ D && K && /* @__PURE__ */ p("div", {
160
175
  className: "flex flex-1 flex-col items-center justify-center p-8 text-center",
161
176
  children: [
162
- /* @__PURE__ */ p("div", {
177
+ /* @__PURE__ */ f("div", {
163
178
  className: "mb-4 rounded-full bg-status-success-bg-subtle p-3",
164
- children: /* @__PURE__ */ p(ge, {
179
+ children: /* @__PURE__ */ f(ge, {
165
180
  size: 48,
166
181
  className: "text-status-success-text"
167
182
  })
168
183
  }),
169
- /* @__PURE__ */ p("h3", {
184
+ /* @__PURE__ */ f("h3", {
170
185
  className: "mb-1 text-lg font-semibold text-text-primary",
171
- children: y("integrations.addConnection.success.title", "Connection Created!")
186
+ children: C ? rt ? g("integrations.addConnection.oneScreen.successAs", "{{provider}} connected as {{account}}", {
187
+ provider: D.name,
188
+ account: rt
189
+ }) : g("integrations.addConnection.oneScreen.success", "{{provider}} connected", { provider: D.name }) : g("integrations.addConnection.success.title", "Connection Created!")
172
190
  }),
173
- /* @__PURE__ */ p("p", {
191
+ /* @__PURE__ */ f("p", {
174
192
  className: "mb-6 text-sm text-text-secondary",
175
- children: y("integrations.addConnection.success.description", "Your {{provider}} connection has been set up successfully.", { provider: E.name })
193
+ children: g("integrations.addConnection.success.description", "Your {{provider}} connection has been set up successfully.", { provider: D.name })
176
194
  }),
177
- w ? w(G) : /* @__PURE__ */ p("button", {
195
+ S ? S(K) : /* @__PURE__ */ f("button", {
178
196
  type: "button",
179
- onClick: _,
197
+ onClick: m,
180
198
  className: "rounded-md bg-action-primary-bg px-4 py-2 text-sm font-medium text-action-primary-text transition-colors hover:bg-action-primary-bg/90",
181
- children: y("integrations.addConnection.actions.done", "Done")
199
+ children: g("integrations.addConnection.actions.done", "Done")
182
200
  })
183
201
  ]
184
202
  }),
185
- E && $ && /* @__PURE__ */ m(f, { children: [/* @__PURE__ */ p("div", {
203
+ D && $ && C && /* @__PURE__ */ f("div", {
204
+ "data-testid": "add-connection-pane",
205
+ className: "min-h-0 min-w-0 flex-1 overflow-y-auto p-5",
206
+ children: /* @__PURE__ */ f(re, {
207
+ api: e,
208
+ provider: D,
209
+ methods: o(D),
210
+ method: J,
211
+ flow: Y,
212
+ schema: X,
213
+ name: j,
214
+ onNameChange: M,
215
+ description: N,
216
+ onDescriptionChange: Le,
217
+ values: P,
218
+ setValues: F,
219
+ onMethodChange: Ze,
220
+ storage: R,
221
+ setStorage: z,
222
+ supportedStorageModes: s(D, J),
223
+ scopeOptions: Z,
224
+ defaultScopes: Qe,
225
+ scopeSelection: I,
226
+ setScopeSelection: L,
227
+ callbackUrl: h,
228
+ requireVault: v,
229
+ canCreateVault: y,
230
+ errorMessage: Ge,
231
+ busy: U,
232
+ translate: g,
233
+ fieldId: H,
234
+ reconnect: !!w,
235
+ storageAtTop: v && Ve === 0,
236
+ onVaultsLoaded: He,
237
+ sharing: x ? /* @__PURE__ */ f(te, {
238
+ translate: g,
239
+ visibility: B ?? "WORKSPACE",
240
+ onVisibilityChange: Be,
241
+ idPrefix: V
242
+ }) : void 0,
243
+ about: /* @__PURE__ */ f(ee, {
244
+ provider: D,
245
+ translate: g
246
+ }),
247
+ signInBlocked: Ke,
248
+ onOpenSignIn: qe
249
+ })
250
+ }),
251
+ D && $ && !C && /* @__PURE__ */ p(Ce, { children: [/* @__PURE__ */ f("div", {
186
252
  role: "tablist",
187
253
  "aria-labelledby": "add-connection-dialog-title",
188
254
  "data-testid": "add-connection-tabs",
189
255
  className: "flex flex-shrink-0 overflow-x-auto border-b border-border-subtle sm:block sm:w-40 sm:overflow-x-visible sm:border-b-0 sm:border-e sm:py-3",
190
- children: X.map((e) => {
191
- let n = e.icon, r = O === e.key;
192
- return /* @__PURE__ */ m("button", {
193
- id: Z(e.key),
256
+ children: et.map((e) => {
257
+ let n = e.icon, r = k === e.key;
258
+ return /* @__PURE__ */ p("button", {
259
+ id: Q(e.key),
194
260
  type: "button",
195
261
  role: "tab",
196
262
  "aria-selected": r,
197
- "aria-controls": Q,
263
+ "aria-controls": tt,
198
264
  tabIndex: r ? 0 : -1,
199
- onClick: () => k(e.key),
200
- onKeyDown: Ue,
265
+ onClick: () => A(e.key),
266
+ onKeyDown: nt,
201
267
  className: t("flex min-w-max items-center gap-2 border-b-2 px-4 py-2 text-sm font-medium transition-colors sm:w-full sm:border-b-0 sm:border-s-2", r ? "border-primary bg-accent/50 text-text-primary" : "border-transparent text-text-secondary hover:bg-accent/30 hover:text-text-primary"),
202
- children: [/* @__PURE__ */ p(n, {
268
+ children: [/* @__PURE__ */ f(n, {
203
269
  size: 16,
204
270
  "aria-hidden": "true"
205
271
  }), e.label]
206
272
  }, e.key);
207
273
  })
208
- }), /* @__PURE__ */ m("div", {
209
- id: Q,
274
+ }), /* @__PURE__ */ p("div", {
275
+ id: tt,
210
276
  role: "tabpanel",
211
- "aria-labelledby": Z(O),
277
+ "aria-labelledby": Q(k),
212
278
  "data-testid": "add-connection-pane",
213
279
  className: "min-h-0 min-w-0 flex-1 overflow-y-auto p-5",
214
280
  children: [
215
- O === "connection" && /* @__PURE__ */ p(re, {
281
+ k === "connection" && /* @__PURE__ */ f(ne, {
216
282
  api: e,
217
- provider: E,
218
- methods: ee(E),
219
- method: q,
220
- flow: Be,
221
- schema: Ve,
222
- name: A,
223
- onNameChange: j,
224
- description: M,
225
- onDescriptionChange: Ne,
283
+ provider: D,
284
+ methods: o(D),
285
+ method: J,
286
+ flow: Y,
287
+ schema: X,
288
+ name: j,
289
+ onNameChange: M,
290
+ description: N,
291
+ onDescriptionChange: Le,
226
292
  values: P,
227
293
  setValues: F,
228
- onMethodChange: ze,
294
+ onMethodChange: Ze,
229
295
  storage: R,
230
296
  setStorage: z,
231
- supportedStorageModes: o(E, q),
232
- scopeOptions: J,
233
- defaultScopes: Y,
297
+ supportedStorageModes: s(D, J),
298
+ scopeOptions: Z,
299
+ defaultScopes: Qe,
234
300
  scopeSelection: I,
235
301
  setScopeSelection: L,
236
- callbackUrl: v,
237
- requireVault: S,
238
- canCreateVault: Se,
239
- errorMessage: Re,
302
+ callbackUrl: h,
303
+ requireVault: v,
304
+ canCreateVault: y,
305
+ errorMessage: Ge,
240
306
  busy: U,
241
- translate: y,
307
+ translate: g,
242
308
  fieldId: H
243
309
  }),
244
- O === "sharing" && /* @__PURE__ */ p(ne, {
245
- translate: y,
310
+ k === "sharing" && /* @__PURE__ */ f(te, {
311
+ translate: g,
246
312
  visibility: B ?? "WORKSPACE",
247
- onVisibilityChange: Fe,
313
+ onVisibilityChange: Be,
248
314
  idPrefix: V
249
315
  }),
250
- O === "details" && /* @__PURE__ */ p(te, {
251
- provider: E,
252
- translate: y
316
+ k === "details" && /* @__PURE__ */ f(ee, {
317
+ provider: D,
318
+ translate: g
253
319
  })
254
320
  ]
255
321
  })] })
256
322
  ]
257
323
  }),
258
- E && $ && /* @__PURE__ */ m("div", {
324
+ D && $ && /* @__PURE__ */ p("div", {
259
325
  "data-testid": "add-connection-footer",
260
326
  className: "flex flex-shrink-0 items-center justify-end gap-2 border-t border-border-subtle px-5 py-3",
261
- children: [/* @__PURE__ */ p("button", {
262
- type: "button",
263
- onClick: _,
264
- className: "rounded-md border border-border-subtle px-4 py-2 text-sm font-medium text-text-primary transition-colors hover:bg-accent",
265
- children: y("integrations.addConnection.actions.cancel", "Cancel")
266
- }), /* @__PURE__ */ m("button", {
267
- type: "button",
268
- "data-testid": "add-connection-submit",
269
- onClick: He,
270
- disabled: U || !A.trim(),
271
- className: "inline-flex items-center gap-1.5 rounded-md bg-action-primary-bg px-4 py-2 text-sm font-medium text-action-primary-text transition-colors hover:bg-action-primary-bg/90 disabled:opacity-50",
272
- children: [U ? /* @__PURE__ */ p(d, {
273
- size: 14,
274
- className: "animate-spin",
275
- "aria-hidden": "true"
276
- }) : /* @__PURE__ */ p(he, {
277
- size: 14,
278
- "aria-hidden": "true"
279
- }), Le ? y("integrations.addConnection.actions.waiting", "Waiting...") : y("integrations.addConnection.actions.connect", "Connect")]
280
- })]
327
+ children: [
328
+ Ke && !C && /* @__PURE__ */ p("button", {
329
+ type: "button",
330
+ "data-testid": "open-sign-in-window",
331
+ onClick: qe,
332
+ className: "me-auto inline-flex items-center gap-1.5 rounded-md border border-border-subtle px-3 py-2 text-sm font-medium text-text-primary transition-colors hover:bg-accent",
333
+ children: [/* @__PURE__ */ f(_e, {
334
+ size: 14,
335
+ "aria-hidden": "true"
336
+ }), g("integrations.addConnection.actions.openSignInWindow", "Open sign-in window")]
337
+ }),
338
+ /* @__PURE__ */ f("button", {
339
+ type: "button",
340
+ onClick: C && W ? Je : m,
341
+ "data-testid": "add-connection-cancel",
342
+ className: "rounded-md border border-border-subtle px-4 py-2 text-sm font-medium text-text-primary transition-colors hover:bg-accent",
343
+ children: g("integrations.addConnection.actions.cancel", "Cancel")
344
+ }),
345
+ /* @__PURE__ */ p("button", {
346
+ type: "button",
347
+ "data-testid": "add-connection-submit",
348
+ onClick: $e,
349
+ disabled: U || !j.trim(),
350
+ className: "inline-flex items-center gap-1.5 rounded-md bg-action-primary-bg px-4 py-2 text-sm font-medium text-action-primary-text transition-colors hover:bg-action-primary-bg/90 disabled:opacity-50",
351
+ children: [U ? /* @__PURE__ */ f(be, {
352
+ size: 14,
353
+ className: "animate-spin",
354
+ "aria-hidden": "true"
355
+ }) : /* @__PURE__ */ f(he, {
356
+ size: 14,
357
+ "aria-hidden": "true"
358
+ }), C ? W ? g("integrations.addConnection.oneScreen.waiting", "Waiting for {{provider}}…", { provider: D.name }) : Y === "oauth2" ? g("integrations.addConnection.oneScreen.signIn", "Sign in with {{provider}}", { provider: D.name }) : g("integrations.addConnection.actions.connect", "Connect") : W ? g("integrations.addConnection.actions.waiting", "Waiting...") : g("integrations.addConnection.actions.connect", "Connect")]
359
+ })
360
+ ]
281
361
  })
282
362
  ] });
283
363
  };
284
- export { _ as ConnectionDialogPanel };
364
+ export { m as ConnectionDialogPanel };