@bikdotai/bik-component-library 0.0.871 → 0.0.872

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 (104) hide show
  1. package/dist/cjs/components/agent-builder/components/ConfigToolPanel.js +5 -5
  2. package/dist/cjs/components/agent-builder/components/ConfigToolPanel.js.map +1 -1
  3. package/dist/cjs/components/agent-builder/components/CreateSubAgentPanel.js +5 -5
  4. package/dist/cjs/components/agent-builder/components/CreateSubAgentPanel.js.map +1 -1
  5. package/dist/cjs/components/agent-builder/components/MentionPicker.js +27 -27
  6. package/dist/cjs/components/agent-builder/components/MentionPicker.js.map +1 -1
  7. package/dist/cjs/components/agent-builder/components/SelectableListSection.js +6 -6
  8. package/dist/cjs/components/agent-builder/components/SelectableListSection.js.map +1 -1
  9. package/dist/cjs/components/agent-builder/constants/tools.js +1 -1
  10. package/dist/cjs/components/agent-builder/constants/tools.js.map +1 -1
  11. package/dist/cjs/components/agent-builder/steps/Step3HowItResponds.js +1 -1
  12. package/dist/cjs/components/agent-builder/steps/Step3HowItResponds.js.map +1 -1
  13. package/dist/cjs/components/agent-builder/utils/sourceGrouping.js +2 -0
  14. package/dist/cjs/components/agent-builder/utils/sourceGrouping.js.map +1 -0
  15. package/dist/cjs/components/agent-builder/utils/sourceIcons.js +1 -1
  16. package/dist/cjs/components/agent-builder/utils/sourceIcons.js.map +1 -1
  17. package/dist/cjs/components/agent-builder/utils/toolActions.js +1 -1
  18. package/dist/cjs/components/agent-builder/utils/toolActions.js.map +1 -1
  19. package/dist/cjs/icons/Social/Channels/Aftership.js +2 -0
  20. package/dist/cjs/icons/Social/Channels/Aftership.js.map +1 -0
  21. package/dist/cjs/icons/Social/Channels/Attentive.js +2 -0
  22. package/dist/cjs/icons/Social/Channels/Attentive.js.map +1 -0
  23. package/dist/cjs/icons/Social/Channels/Freshdesk.js +2 -0
  24. package/dist/cjs/icons/Social/Channels/Freshdesk.js.map +1 -0
  25. package/dist/cjs/icons/Social/Channels/GoogleSheets.js +2 -0
  26. package/dist/cjs/icons/Social/Channels/GoogleSheets.js.map +1 -0
  27. package/dist/cjs/icons/Social/Channels/Klavyio.js +2 -0
  28. package/dist/cjs/icons/Social/Channels/Klavyio.js.map +1 -0
  29. package/dist/cjs/icons/Social/Channels/Kustomer.js +2 -0
  30. package/dist/cjs/icons/Social/Channels/Kustomer.js.map +1 -0
  31. package/dist/cjs/icons/Social/Channels/Mailchimp.js +2 -0
  32. package/dist/cjs/icons/Social/Channels/Mailchimp.js.map +1 -0
  33. package/dist/cjs/icons/Social/Channels/OmniSend.js +2 -0
  34. package/dist/cjs/icons/Social/Channels/OmniSend.js.map +1 -0
  35. package/dist/cjs/icons/Social/Channels/Segment.js +2 -0
  36. package/dist/cjs/icons/Social/Channels/Segment.js.map +1 -0
  37. package/dist/cjs/icons/Social/Channels/ShipBob.js +2 -0
  38. package/dist/cjs/icons/Social/Channels/ShipBob.js.map +1 -0
  39. package/dist/cjs/icons/Social/Channels/Skio.js +1 -1
  40. package/dist/cjs/icons/Social/Channels/Skio.js.map +1 -1
  41. package/dist/cjs/icons/index.js +1 -1
  42. package/dist/esm/components/agent-builder/__fixtures__/integrationCatalog.d.ts +17 -0
  43. package/dist/esm/components/agent-builder/components/ConfigToolPanel.js +104 -96
  44. package/dist/esm/components/agent-builder/components/ConfigToolPanel.js.map +1 -1
  45. package/dist/esm/components/agent-builder/components/CreateSubAgentPanel.js +256 -242
  46. package/dist/esm/components/agent-builder/components/CreateSubAgentPanel.js.map +1 -1
  47. package/dist/esm/components/agent-builder/components/MentionPicker.d.ts +0 -10
  48. package/dist/esm/components/agent-builder/components/MentionPicker.js +201 -199
  49. package/dist/esm/components/agent-builder/components/MentionPicker.js.map +1 -1
  50. package/dist/esm/components/agent-builder/components/SelectableListSection.d.ts +9 -0
  51. package/dist/esm/components/agent-builder/components/SelectableListSection.js +213 -188
  52. package/dist/esm/components/agent-builder/components/SelectableListSection.js.map +1 -1
  53. package/dist/esm/components/agent-builder/constants/tools.d.ts +46 -22
  54. package/dist/esm/components/agent-builder/constants/tools.js +86 -35
  55. package/dist/esm/components/agent-builder/constants/tools.js.map +1 -1
  56. package/dist/esm/components/agent-builder/steps/Step3HowItResponds.js +289 -279
  57. package/dist/esm/components/agent-builder/steps/Step3HowItResponds.js.map +1 -1
  58. package/dist/esm/components/agent-builder/utils/sourceGrouping.d.ts +39 -0
  59. package/dist/esm/components/agent-builder/utils/sourceGrouping.js +14 -0
  60. package/dist/esm/components/agent-builder/utils/sourceGrouping.js.map +1 -0
  61. package/dist/esm/components/agent-builder/utils/sourceIcons.d.ts +6 -4
  62. package/dist/esm/components/agent-builder/utils/sourceIcons.js +64 -33
  63. package/dist/esm/components/agent-builder/utils/sourceIcons.js.map +1 -1
  64. package/dist/esm/components/agent-builder/utils/toolActions.d.ts +11 -6
  65. package/dist/esm/components/agent-builder/utils/toolActions.js +23 -16
  66. package/dist/esm/components/agent-builder/utils/toolActions.js.map +1 -1
  67. package/dist/esm/icons/Social/Channels/Aftership.d.ts +6 -0
  68. package/dist/esm/icons/Social/Channels/Aftership.js +47 -0
  69. package/dist/esm/icons/Social/Channels/Aftership.js.map +1 -0
  70. package/dist/esm/icons/Social/Channels/Attentive.d.ts +6 -0
  71. package/dist/esm/icons/Social/Channels/Attentive.js +54 -0
  72. package/dist/esm/icons/Social/Channels/Attentive.js.map +1 -0
  73. package/dist/esm/icons/Social/Channels/Freshdesk.d.ts +6 -0
  74. package/dist/esm/icons/Social/Channels/Freshdesk.js +47 -0
  75. package/dist/esm/icons/Social/Channels/Freshdesk.js.map +1 -0
  76. package/dist/esm/icons/Social/Channels/GoogleSheets.d.ts +6 -0
  77. package/dist/esm/icons/Social/Channels/GoogleSheets.js +53 -0
  78. package/dist/esm/icons/Social/Channels/GoogleSheets.js.map +1 -0
  79. package/dist/esm/icons/Social/Channels/Klavyio.d.ts +6 -0
  80. package/dist/esm/icons/Social/Channels/Klavyio.js +47 -0
  81. package/dist/esm/icons/Social/Channels/Klavyio.js.map +1 -0
  82. package/dist/esm/icons/Social/Channels/Kustomer.d.ts +6 -0
  83. package/dist/esm/icons/Social/Channels/Kustomer.js +68 -0
  84. package/dist/esm/icons/Social/Channels/Kustomer.js.map +1 -0
  85. package/dist/esm/icons/Social/Channels/Mailchimp.d.ts +6 -0
  86. package/dist/esm/icons/Social/Channels/Mailchimp.js +31 -0
  87. package/dist/esm/icons/Social/Channels/Mailchimp.js.map +1 -0
  88. package/dist/esm/icons/Social/Channels/OmniSend.d.ts +6 -0
  89. package/dist/esm/icons/Social/Channels/OmniSend.js +47 -0
  90. package/dist/esm/icons/Social/Channels/OmniSend.js.map +1 -0
  91. package/dist/esm/icons/Social/Channels/Segment.d.ts +6 -0
  92. package/dist/esm/icons/Social/Channels/Segment.js +53 -0
  93. package/dist/esm/icons/Social/Channels/Segment.js.map +1 -0
  94. package/dist/esm/icons/Social/Channels/ShipBob.d.ts +6 -0
  95. package/dist/esm/icons/Social/Channels/ShipBob.js +28 -0
  96. package/dist/esm/icons/Social/Channels/ShipBob.js.map +1 -0
  97. package/dist/esm/icons/Social/Channels/Skio.js +41 -19
  98. package/dist/esm/icons/Social/Channels/Skio.js.map +1 -1
  99. package/dist/esm/icons/Social/Channels/Zendesk.d.ts +6 -0
  100. package/dist/esm/icons/Social/Channels/index.d.ts +10 -0
  101. package/dist/esm/icons/index.d.ts +26 -25
  102. package/dist/esm/icons/index.js +658 -638
  103. package/dist/esm/icons/index.js.map +1 -1
  104. package/package.json +1 -1
@@ -1,130 +1,148 @@
1
- import { jsx as n, jsxs as i, Fragment as J } from "react/jsx-runtime";
2
- import de from "../../../assets/icons/delete.svg.js";
3
- import se from "../../../assets/icons/edit.svg.js";
4
- import Q from "../../../assets/icons/plus.svg.js";
5
- import { useState as m, useRef as U, useEffect as ae } from "react";
1
+ import { jsx as o, jsxs as d, Fragment as Q } from "react/jsx-runtime";
2
+ import ue from "../../../assets/icons/delete.svg.js";
3
+ import he from "../../../assets/icons/edit.svg.js";
4
+ import U from "../../../assets/icons/plus.svg.js";
5
+ import { useState as S, useRef as X, useEffect as fe } from "react";
6
6
  import D from "styled-components";
7
- import { TitleSmall as ue, BodyCaption as $, BodySecondary as A } from "../../TypographyStyle.js";
8
- import { COLORS as d } from "../../../constants/Theme.js";
9
- import { SideSection as he, SideSectionHeader as fe, AddIconButton as pe, SourceButtonRow as me, SourceButton as X, SelectableRow as Se, RowLabel as be, RowText as ve, RowActions as ye, RowMenuButton as Y, RowActionDivider as we } from "../AgentBuilder.styled.js";
10
- import { isIntegrationSource as $e } from "../constants/tools.js";
11
- import { renderSourceIcon as I, sourceIcon as ge } from "../utils/sourceIcons.js";
12
- import { MentionPicker as Ce } from "./MentionPicker.js";
13
- import { Dropdown as Z } from "../../dropdown/Dropdown.js";
14
- import { unwrapDropdownValue as P } from "../../dropdown/utils.js";
15
- import { Button as ke } from "../../button/Button.js";
16
- import { DeleteConfirmationModal as Ee } from "../../states-modal/DeleteConfirmationModal.js";
17
- import { Tooltip as g } from "../../tooltips/Tooltip.js";
18
- import Re from "../../../icons/Informational/Common UI/Shield.js";
19
- const G = "__bik_create_new__", Xe = ({
20
- title: s,
7
+ import { TitleSmall as pe, BodyCaption as w, BodySecondary as Y } from "../../TypographyStyle.js";
8
+ import { COLORS as s } from "../../../constants/Theme.js";
9
+ import { SideSection as me, SideSectionHeader as Se, AddIconButton as be, SourceButtonRow as ge, SourceButton as Z, SelectableRow as ve, RowLabel as ye, RowText as we, RowActions as $e, RowMenuButton as P, RowActionDivider as Ce } from "../AgentBuilder.styled.js";
10
+ import { isIntegrationSource as ke } from "../constants/tools.js";
11
+ import { toolSourceLabel as Ee } from "../utils/mentionSerialization.js";
12
+ import { renderSourceIcon as I, sourceIcon as Re } from "../utils/sourceIcons.js";
13
+ import { MentionPicker as Ae } from "./MentionPicker.js";
14
+ import { Dropdown as G } from "../../dropdown/Dropdown.js";
15
+ import { unwrapDropdownValue as T } from "../../dropdown/utils.js";
16
+ import { Button as Ie } from "../../button/Button.js";
17
+ import { DeleteConfirmationModal as De } from "../../states-modal/DeleteConfirmationModal.js";
18
+ import { Tooltip as $ } from "../../tooltips/Tooltip.js";
19
+ import _e from "../../../icons/Informational/Common UI/Shield.js";
20
+ const O = "__bik_create_new__", Te = ({
21
+ title: u,
21
22
  helper: _,
22
- items: u,
23
- addableOptions: S,
24
- onAdd: b,
25
- onRemove: L,
26
- dataTestPrefix: r,
27
- emptyText: O,
28
- createOption: t,
29
- onConfigure: B,
30
- sourceGroups: h,
23
+ items: h,
24
+ addableOptions: b,
25
+ onAdd: g,
26
+ onRemove: B,
27
+ dataTestPrefix: c,
28
+ emptyText: ne,
29
+ createOption: l,
30
+ onConfigure: L,
31
+ sourceGroups: f,
31
32
  mentionItems: C,
32
- actionSources: v,
33
- confirmDelete: p,
34
- pickerOpensUp: z,
35
- appLabel: ee
33
+ actionSources: z,
34
+ confirmDelete: m,
35
+ pickerOpensUp: x,
36
+ appLabel: M,
37
+ integrationStatus: oe,
38
+ onConnectIntegration: te
36
39
  }) => {
37
- const [f, l] = m(!1), [x, k] = m(null), [H, M] = m(null), [ne, E] = m(null), y = !!h && h.length > 0, R = h?.find((e) => e.source === ne), c = C !== void 0, j = U(null), q = U(null), [w, W] = m(null);
38
- ae(() => {
39
- if (!c || !f)
40
+ const [p, r] = S(!1), [H, k] = S(null), [j, q] = S(null), [le, E] = S(null), v = !!f && f.length > 0, W = (() => {
41
+ const e = [], n = /* @__PURE__ */ new Map();
42
+ return (z ?? []).filter((t) => t.connected !== !1).forEach((t) => {
43
+ n.has(t.source) || (n.set(t.source, []), e.push(t.source)), n.get(t.source)?.push(t);
44
+ }), e.map((t) => {
45
+ const a = n.get(t) ?? [];
46
+ return {
47
+ source: t,
48
+ actions: a,
49
+ icon: a[0].icon,
50
+ // One capability reads as itself ("Send email"); several read as the
51
+ // brand that holds them ("Google Sheets").
52
+ label: a.length > 1 ? Ee(t, M) : a[0].label
53
+ };
54
+ });
55
+ })(), R = f?.find((e) => e.source === le), i = C !== void 0, F = X(null), K = X(null), [y, A] = S(null);
56
+ fe(() => {
57
+ if (!i || !p)
40
58
  return;
41
- const e = (a) => {
42
- const V = a.target;
43
- !j.current?.contains(V) && !q.current?.contains(V) && l(!1);
44
- }, o = (a) => {
45
- a.key === "Escape" && l(!1);
59
+ const e = (t) => {
60
+ const a = t.target;
61
+ !F.current?.contains(a) && !K.current?.contains(a) && r(!1);
62
+ }, n = (t) => {
63
+ t.key === "Escape" && r(!1);
46
64
  };
47
- return document.addEventListener("mousedown", e), document.addEventListener("keydown", o), () => {
48
- document.removeEventListener("mousedown", e), document.removeEventListener("keydown", o);
65
+ return document.addEventListener("mousedown", e), document.addEventListener("keydown", n), () => {
66
+ document.removeEventListener("mousedown", e), document.removeEventListener("keydown", n);
49
67
  };
50
- }, [c, f]);
51
- const oe = y ? c || u.length > 0 : c || S.length > 0 || !!t && u.length > 0, te = u.length === 0 && !!t && !y && !c, F = !!v && v.length > 0, le = (y || F) && u.length === 0, re = () => {
52
- if (c) {
53
- if ((C?.length ?? 0) === 0 && t) {
54
- t.onSelect();
68
+ }, [i, p]);
69
+ const re = v ? i || h.length > 0 : i || b.length > 0 || !!l && h.length > 0, ce = h.length === 0 && !!l && !v && !i, N = W.length > 0, ie = (v || N) && h.length === 0, de = () => {
70
+ if (i) {
71
+ if ((C?.length ?? 0) === 0 && l) {
72
+ l.onSelect();
55
73
  return;
56
74
  }
57
- W(null), l((e) => !e);
75
+ A(null), r((e) => !e);
58
76
  return;
59
77
  }
60
- if (y) {
61
- E(null), l((e) => !e);
78
+ if (v) {
79
+ E(null), r((e) => !e);
62
80
  return;
63
81
  }
64
- if (S.length === 0 && t) {
65
- t.onSelect();
82
+ if (b.length === 0 && l) {
83
+ l.onSelect();
66
84
  return;
67
85
  }
68
- l((e) => !e);
69
- }, ce = (e, o) => {
70
- if (H)
86
+ r((e) => !e);
87
+ }, se = (e, n) => {
88
+ if (j)
71
89
  return;
72
- const a = o();
73
- a && typeof a.then == "function" && (M(e), a.finally(() => M(null)));
74
- }, ie = () => u.map((e) => {
75
- const o = e.onConfigure ?? (B ? () => B(e.id) : void 0);
76
- return /* @__PURE__ */ i(
77
- Se,
90
+ const t = n();
91
+ t && typeof t.then == "function" && (q(e), t.finally(() => q(null)));
92
+ }, ae = () => h.map((e) => {
93
+ const n = e.onConfigure ?? (L ? () => L(e.id) : void 0);
94
+ return /* @__PURE__ */ d(
95
+ ve,
78
96
  {
79
- "data-test": `${r}-row-${e.id}`,
97
+ "data-test": `${c}-row-${e.id}`,
80
98
  children: [
81
99
  I(e.icon),
82
- /* @__PURE__ */ i(be, { children: [
83
- /* @__PURE__ */ n(g, { body: e.label, placement: "top", children: /* @__PURE__ */ n(ve, { children: /* @__PURE__ */ n(A, { numberOfLines: 1, color: d.content.primary, children: e.label }) }) }),
100
+ /* @__PURE__ */ d(ye, { children: [
101
+ /* @__PURE__ */ o($, { body: e.label, placement: "top", children: /* @__PURE__ */ o(we, { children: /* @__PURE__ */ o(Y, { numberOfLines: 1, color: s.content.primary, children: e.label }) }) }),
84
102
  e.authRequired && // Order tools touch customer-private data — the shield flags that
85
103
  // this agent must verify the customer before the tool can run.
86
- /* @__PURE__ */ n(g, { body: "Requires customer verification", placement: "top", children: /* @__PURE__ */ n(
104
+ /* @__PURE__ */ o($, { body: "Requires customer verification", placement: "top", children: /* @__PURE__ */ o(
87
105
  "span",
88
106
  {
89
- "data-test": `${r}-auth-${e.id}`,
107
+ "data-test": `${c}-auth-${e.id}`,
90
108
  style: { display: "inline-flex", flexShrink: 0 },
91
- children: /* @__PURE__ */ n(Re, { size: 16 })
109
+ children: /* @__PURE__ */ o(_e, { size: 16 })
92
110
  }
93
111
  ) })
94
112
  ] }),
95
- /* @__PURE__ */ i(ye, { children: [
96
- o && // Configurable rows (sub-agents, Rest API / email tools) get an
113
+ /* @__PURE__ */ d($e, { children: [
114
+ n && // Configurable rows (sub-agents, Rest API / email tools) get an
97
115
  // always-visible edit icon.
98
- /* @__PURE__ */ n(g, { body: "Edit", placement: "top", children: /* @__PURE__ */ n(
99
- Y,
116
+ /* @__PURE__ */ o($, { body: "Edit", placement: "top", children: /* @__PURE__ */ o(
117
+ P,
100
118
  {
101
- "data-test": `${r}-edit-${e.id}`,
119
+ "data-test": `${c}-edit-${e.id}`,
102
120
  "aria-label": `Edit ${e.label}`,
103
- disabled: H !== null,
104
- onClick: () => ce(e.id, o),
105
- children: /* @__PURE__ */ n(
106
- se,
121
+ disabled: j !== null,
122
+ onClick: () => se(e.id, n),
123
+ children: /* @__PURE__ */ o(
124
+ he,
107
125
  {
108
126
  width: 16,
109
127
  height: 16,
110
- color: d.content.secondary
128
+ color: s.content.secondary
111
129
  }
112
130
  )
113
131
  }
114
132
  ) }),
115
- o && /* @__PURE__ */ n(we, { "aria-hidden": !0 }),
116
- /* @__PURE__ */ n(g, { body: "Delete", placement: "top", children: /* @__PURE__ */ n(
117
- Y,
133
+ n && /* @__PURE__ */ o(Ce, { "aria-hidden": !0 }),
134
+ /* @__PURE__ */ o($, { body: "Delete", placement: "top", children: /* @__PURE__ */ o(
135
+ P,
118
136
  {
119
- "data-test": `${r}-delete-${e.id}`,
137
+ "data-test": `${c}-delete-${e.id}`,
120
138
  "aria-label": `Delete ${e.label}`,
121
- onClick: () => p ? k(e.id) : L(e.id),
122
- children: /* @__PURE__ */ n(
123
- de,
139
+ onClick: () => m ? k(e.id) : B(e.id),
140
+ children: /* @__PURE__ */ o(
141
+ ue,
124
142
  {
125
143
  width: 16,
126
144
  height: 16,
127
- color: d.content.secondary
145
+ color: s.content.secondary
128
146
  }
129
147
  )
130
148
  }
@@ -134,221 +152,228 @@ const G = "__bik_create_new__", Xe = ({
134
152
  },
135
153
  e.id
136
154
  );
137
- }), K = t ? [
138
- ...S,
155
+ }), V = l ? [
156
+ ...b,
139
157
  {
140
- label: t.label,
141
- value: G,
142
- searchKey: t.label,
143
- customComponent: /* @__PURE__ */ n(
158
+ label: l.label,
159
+ value: O,
160
+ searchKey: l.label,
161
+ customComponent: /* @__PURE__ */ o(
144
162
  "div",
145
163
  {
146
164
  style: {
147
165
  width: "100%",
148
166
  textAlign: "center",
149
- color: d.content.brand,
167
+ color: s.content.brand,
150
168
  fontFamily: "Inter",
151
169
  fontSize: 14,
152
170
  fontWeight: 600
153
171
  },
154
- children: t.label
172
+ children: l.label
155
173
  }
156
174
  )
157
175
  }
158
- ] : S, N = c ? /* @__PURE__ */ n(
159
- Ce,
176
+ ] : b, J = i ? /* @__PURE__ */ o(
177
+ Ae,
160
178
  {
161
179
  items: C ?? [],
162
180
  query: "",
163
181
  activeIndex: 0,
164
- initialSource: w ?? void 0,
182
+ initialSource: y ?? void 0,
165
183
  onSelect: (e) => {
166
- l(!1), b(String(e.id));
184
+ r(!1), g(String(e.id));
167
185
  },
168
- onClose: () => l(!1),
169
- onCreateSubAgent: t ? () => {
170
- l(!1), t.onSelect();
186
+ onClose: () => r(!1),
187
+ onCreateSubAgent: l ? () => {
188
+ r(!1), l.onSelect();
171
189
  } : void 0,
172
- toolActions: F ? v?.map((e) => ({
190
+ toolActions: N ? z?.map((e) => ({
173
191
  ...e,
174
192
  onSelect: () => {
175
- l(!1), e.onSelect();
193
+ r(!1), e.onSelect();
176
194
  }
177
195
  })) : void 0,
178
- integrationStatus: Object.fromEntries(
179
- (h ?? []).filter((e) => e.connected !== void 0).map((e) => [e.source, e.connected])
196
+ integrationStatus: oe ?? Object.fromEntries(
197
+ (f ?? []).filter((e) => e.connected !== void 0).map((e) => [e.source, e.connected])
180
198
  ),
181
199
  onConnectIntegration: (e) => {
182
- l(!1), h?.find((o) => o.source === e)?.onConnect?.();
200
+ r(!1);
201
+ const n = f?.find((t) => t.source === e);
202
+ if (n?.onConnect) {
203
+ n.onConnect();
204
+ return;
205
+ }
206
+ te?.(e);
183
207
  },
184
- appLabel: ee
208
+ appLabel: M
185
209
  },
186
- w ?? "__root__"
210
+ y ?? "__root__"
187
211
  ) : null;
188
- return /* @__PURE__ */ i(he, { children: [
189
- /* @__PURE__ */ i(fe, { children: [
190
- /* @__PURE__ */ n(ue, { color: d.content.primary, children: s }),
191
- oe && /* @__PURE__ */ i(Ae, { ref: j, children: [
192
- /* @__PURE__ */ n(
193
- pe,
212
+ return /* @__PURE__ */ d(me, { children: [
213
+ /* @__PURE__ */ d(Se, { children: [
214
+ /* @__PURE__ */ o(pe, { color: s.content.primary, children: u }),
215
+ re && /* @__PURE__ */ d(Be, { ref: F, children: [
216
+ /* @__PURE__ */ o(
217
+ be,
194
218
  {
195
- "data-test": `${r}-add`,
196
- onClick: re,
197
- "aria-label": `Add ${s}`,
198
- children: /* @__PURE__ */ n(Q, { width: 16, height: 16, color: d.content.primary })
219
+ "data-test": `${c}-add`,
220
+ onClick: de,
221
+ "aria-label": `Add ${u}`,
222
+ children: /* @__PURE__ */ o(U, { width: 16, height: 16, color: s.content.primary })
199
223
  }
200
224
  ),
201
- c && f && w === null && /* @__PURE__ */ n(
202
- T,
225
+ i && p && y === null && /* @__PURE__ */ o(
226
+ ee,
203
227
  {
204
- $up: z,
205
- "data-test": `${r}-picker`,
206
- children: N
228
+ $up: x,
229
+ "data-test": `${c}-picker`,
230
+ children: J
207
231
  }
208
232
  )
209
233
  ] })
210
234
  ] }),
211
- _ && /* @__PURE__ */ n($, { color: d.content.secondary, children: _ }),
212
- le ? /* @__PURE__ */ i(Ie, { ref: c ? q : void 0, children: [
213
- /* @__PURE__ */ i(me, { "data-test": `${r}-sources`, children: [
214
- h?.map((e) => {
215
- const o = e.connected !== !1 && e.options.length === 1 && !$e(e.source) ? e.options[0] : void 0;
216
- return /* @__PURE__ */ i(
217
- X,
235
+ _ && /* @__PURE__ */ o(w, { color: s.content.secondary, children: _ }),
236
+ ie ? /* @__PURE__ */ d(Le, { ref: i ? K : void 0, children: [
237
+ /* @__PURE__ */ d(ge, { "data-test": `${c}-sources`, children: [
238
+ f?.map((e) => {
239
+ const n = e.connected !== !1 && e.options.length === 1 && !ke(e.source) ? e.options[0] : void 0;
240
+ return /* @__PURE__ */ d(
241
+ Z,
218
242
  {
219
243
  type: "button",
220
- "data-test": `${r}-source-${e.source}`,
244
+ "data-test": `${c}-source-${e.source}`,
221
245
  onClick: () => {
222
246
  if (e.connected === !1) {
223
247
  e.onConnect?.();
224
248
  return;
225
249
  }
226
- if (o) {
227
- l(!1), b(o.value);
250
+ if (n) {
251
+ r(!1), g(n.value);
228
252
  return;
229
253
  }
230
- if (c) {
231
- W(e.source), l(!0);
254
+ if (i) {
255
+ A(e.source), r(!0);
232
256
  return;
233
257
  }
234
258
  E(e.source);
235
259
  },
236
260
  children: [
237
- I(ge(e.source), -4),
238
- /* @__PURE__ */ n($, { color: d.content.primary, children: o ? o.label : e.label }),
261
+ I(Re(e.source), -4),
262
+ /* @__PURE__ */ o(w, { color: s.content.primary, children: n ? n.label : e.label }),
239
263
  e.connected === !1 && // Not connected → show "Connect" upfront (consistent with
240
264
  // the `@` picker); clicking runs the connect flow.
241
- /* @__PURE__ */ n(A, { color: d.content.brand, children: "Connect" })
265
+ /* @__PURE__ */ o(Y, { color: s.content.brand, children: "Connect" })
242
266
  ]
243
267
  },
244
268
  e.source
245
269
  );
246
270
  }),
247
- v?.map((e) => /* @__PURE__ */ i(
248
- X,
271
+ W.map(({ source: e, label: n, icon: t, actions: a }) => /* @__PURE__ */ d(
272
+ Z,
249
273
  {
250
274
  type: "button",
251
- "data-test": `${r}-action-${e.source}`,
252
- onClick: e.connected === !1 ? () => e.onConnect?.() : () => {
253
- l(!1), e.onSelect();
275
+ "data-test": `${c}-action-${e}`,
276
+ onClick: () => {
277
+ if (a.length > 1 && i) {
278
+ A(e), r(!0);
279
+ return;
280
+ }
281
+ r(!1), a[0].onSelect();
254
282
  },
255
283
  children: [
256
- I(e.icon, -4),
257
- /* @__PURE__ */ n($, { color: d.content.primary, children: e.label }),
258
- e.connected === !1 && // Not connected → "Connect" upfront (consistent with the
259
- // source buttons and the `@` picker).
260
- /* @__PURE__ */ n(A, { color: d.content.brand, children: "Connect" })
284
+ I(t, -4),
285
+ /* @__PURE__ */ o(w, { color: s.content.primary, children: n })
261
286
  ]
262
287
  },
263
- e.source
288
+ e
264
289
  ))
265
290
  ] }),
266
- c && f && w !== null && /* @__PURE__ */ n(
267
- T,
291
+ i && p && y !== null && /* @__PURE__ */ o(
292
+ ee,
268
293
  {
269
294
  $align: "left",
270
- $up: z,
271
- "data-test": `${r}-picker`,
272
- children: N
295
+ $up: x,
296
+ "data-test": `${c}-picker`,
297
+ children: J
273
298
  }
274
299
  ),
275
- !c && R && /* @__PURE__ */ n(
276
- Z,
300
+ !i && R && /* @__PURE__ */ o(
301
+ G,
277
302
  {
278
- "data-test": `${r}-dropdown`,
303
+ "data-test": `${c}-dropdown`,
279
304
  size: "small",
280
305
  width: "100%",
281
306
  isSearchable: !0,
282
307
  placeHolder: `Search ${R.label} tools`,
283
308
  options: R.options,
284
309
  onSelect: (e) => {
285
- const o = P(e);
286
- E(null), l(!1), o && b(o);
310
+ const n = T(e);
311
+ E(null), r(!1), n && g(n);
287
312
  }
288
313
  }
289
314
  )
290
- ] }) : /* @__PURE__ */ i(J, { children: [
291
- !c && f && K.length > 0 && /* @__PURE__ */ n(
292
- Z,
315
+ ] }) : /* @__PURE__ */ d(Q, { children: [
316
+ !i && p && V.length > 0 && /* @__PURE__ */ o(
317
+ G,
293
318
  {
294
- "data-test": `${r}-dropdown`,
319
+ "data-test": `${c}-dropdown`,
295
320
  size: "small",
296
321
  width: "100%",
297
322
  isSearchable: !0,
298
- placeHolder: `Select ${s.toLowerCase()}`,
299
- options: K,
323
+ placeHolder: `Select ${u.toLowerCase()}`,
324
+ options: V,
300
325
  onSelect: (e) => {
301
- const o = P(e);
302
- l(!1), o && (o === G ? t?.onSelect() : b(o));
326
+ const n = T(e);
327
+ r(!1), n && (n === O ? l?.onSelect() : g(n));
303
328
  }
304
329
  }
305
330
  ),
306
- u.length === 0 && !f ? /* @__PURE__ */ i(J, { children: [
307
- /* @__PURE__ */ n($, { color: d.content.placeholder, children: O }),
308
- te && t && /* @__PURE__ */ n(
309
- ke,
331
+ h.length === 0 && !p ? /* @__PURE__ */ d(Q, { children: [
332
+ /* @__PURE__ */ o(w, { color: s.content.placeholder, children: ne }),
333
+ ce && l && /* @__PURE__ */ o(
334
+ Ie,
310
335
  {
311
- "data-test": `${r}-create`,
336
+ "data-test": `${c}-create`,
312
337
  buttonType: "secondary",
313
338
  size: "small",
314
339
  matchParentWidth: !0,
315
- LeadingIcon: Q,
316
- buttonText: t.label,
317
- onClick: t.onSelect
340
+ LeadingIcon: U,
341
+ buttonText: l.label,
342
+ onClick: l.onSelect
318
343
  }
319
344
  )
320
- ] }) : ie()
345
+ ] }) : ae()
321
346
  ] }),
322
- p && x && /* @__PURE__ */ n(
323
- Ee,
347
+ m && H && /* @__PURE__ */ o(
348
+ De,
324
349
  {
325
- "data-test": `${r}-delete-confirm`,
326
- header: `Delete this ${p.noun}?`,
327
- subHeader: `Deleting this ${p.noun} will also remove it from your instructions, wherever it's referenced.`,
350
+ "data-test": `${c}-delete-confirm`,
351
+ header: `Delete this ${m.noun}?`,
352
+ subHeader: `Deleting this ${m.noun} will also remove it from your instructions, wherever it's referenced.`,
328
353
  confirmationText: "Delete",
329
- zIndex: p.zIndex,
354
+ zIndex: m.zIndex,
330
355
  onDeleteConfirmed: () => {
331
- L(x), k(null);
356
+ B(H), k(null);
332
357
  },
333
358
  onCancelClicked: () => k(null)
334
359
  }
335
360
  )
336
361
  ] });
337
- }, Ae = D.div`
362
+ }, Be = D.div`
338
363
  position: relative;
339
364
  display: flex;
340
- `, Ie = D.div`
365
+ `, Le = D.div`
341
366
  position: relative;
342
367
  display: flex;
343
368
  flex-direction: column;
344
369
  gap: 8px;
345
- `, T = D.div`
370
+ `, ee = D.div`
346
371
  position: absolute;
347
- ${(s) => s.$up ? "bottom: calc(100% + 4px);" : "top: calc(100% + 4px);"}
348
- ${(s) => s.$align === "left" ? "left: 0;" : "right: 0;"}
372
+ ${(u) => u.$up ? "bottom: calc(100% + 4px);" : "top: calc(100% + 4px);"}
373
+ ${(u) => u.$align === "left" ? "left: 0;" : "right: 0;"}
349
374
  z-index: 30;
350
375
  `;
351
376
  export {
352
- Xe as SelectableListSection
377
+ Te as SelectableListSection
353
378
  };
354
379
  //# sourceMappingURL=SelectableListSection.js.map