@cere/cere-design-system 0.1.0 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (165) hide show
  1. package/README.md +76 -0
  2. package/dist/buttons.d.mts +27 -22
  3. package/dist/buttons.d.ts +27 -22
  4. package/dist/buttons.js +5 -5
  5. package/dist/buttons.mjs +4 -4
  6. package/dist/charts.d.mts +1 -23
  7. package/dist/charts.d.ts +1 -23
  8. package/dist/charts.js +2 -9
  9. package/dist/charts.js.map +1 -1
  10. package/dist/charts.mjs +1 -8
  11. package/dist/{chunk-THQKYTQE.js → chunk-2KDN37PQ.js} +28 -32
  12. package/dist/chunk-2KDN37PQ.js.map +1 -0
  13. package/dist/{chunk-3WCMINE5.mjs → chunk-34LFXT6C.mjs} +25 -29
  14. package/dist/chunk-34LFXT6C.mjs.map +1 -0
  15. package/dist/chunk-3KCXCVOX.mjs +411 -0
  16. package/dist/chunk-3KCXCVOX.mjs.map +1 -0
  17. package/dist/{chunk-NXTVJ6PY.js → chunk-4OKTICU5.js} +10 -10
  18. package/dist/chunk-4OKTICU5.js.map +1 -0
  19. package/dist/{chunk-FN5YL4BK.js → chunk-72TQ56EP.js} +47 -45
  20. package/dist/chunk-72TQ56EP.js.map +1 -0
  21. package/dist/{chunk-QYYQYZHV.js → chunk-7KXKK2RE.js} +3 -5
  22. package/dist/chunk-7KXKK2RE.js.map +1 -0
  23. package/dist/{chunk-CCN6M4LI.js → chunk-ARSCL4ZZ.js} +18 -10
  24. package/dist/chunk-ARSCL4ZZ.js.map +1 -0
  25. package/dist/chunk-AWVNEU6R.mjs +1478 -0
  26. package/dist/chunk-AWVNEU6R.mjs.map +1 -0
  27. package/dist/{chunk-CUCKULYC.mjs → chunk-BH4FNZKK.mjs} +74 -1260
  28. package/dist/chunk-BH4FNZKK.mjs.map +1 -0
  29. package/dist/{chunk-FFZ5S7PQ.mjs → chunk-BOQPWZIB.mjs} +6 -5
  30. package/dist/chunk-BOQPWZIB.mjs.map +1 -0
  31. package/dist/chunk-BT7XUTT5.mjs +392 -0
  32. package/dist/chunk-BT7XUTT5.mjs.map +1 -0
  33. package/dist/{chunk-ATIFLPH6.mjs → chunk-D7D25O6E.mjs} +4 -2
  34. package/dist/{chunk-ATIFLPH6.mjs.map → chunk-D7D25O6E.mjs.map} +1 -1
  35. package/dist/{chunk-JS4IB5IU.mjs → chunk-DRGMEIPT.mjs} +2 -2
  36. package/dist/chunk-DRGMEIPT.mjs.map +1 -0
  37. package/dist/{chunk-KF2Y7HO3.js → chunk-DZXNYLVG.js} +43 -246
  38. package/dist/chunk-DZXNYLVG.js.map +1 -0
  39. package/dist/{chunk-IE6GCHDI.mjs → chunk-GR52ENYI.mjs} +26 -29
  40. package/dist/chunk-GR52ENYI.mjs.map +1 -0
  41. package/dist/chunk-GTBKQXXI.js +1472 -0
  42. package/dist/chunk-GTBKQXXI.js.map +1 -0
  43. package/dist/{chunk-463SRKKD.js → chunk-HJ24WKU4.js} +14 -5
  44. package/dist/chunk-HJ24WKU4.js.map +1 -0
  45. package/dist/{chunk-EOF3QNPF.js → chunk-KKIKOIMP.js} +140 -1028
  46. package/dist/chunk-KKIKOIMP.js.map +1 -0
  47. package/dist/{chunk-MNM6HE72.js → chunk-LVJSKRX3.js} +16 -15
  48. package/dist/chunk-LVJSKRX3.js.map +1 -0
  49. package/dist/{chunk-KPDYKK3V.js → chunk-PFZZJZ64.js} +8 -8
  50. package/dist/{chunk-KPDYKK3V.js.map → chunk-PFZZJZ64.js.map} +1 -1
  51. package/dist/{chunk-KVBMZNWT.mjs → chunk-POCAW2G4.mjs} +18 -10
  52. package/dist/chunk-POCAW2G4.mjs.map +1 -0
  53. package/dist/{chunk-L2TIGA7I.js → chunk-QCFLZ7X3.js} +39 -42
  54. package/dist/chunk-QCFLZ7X3.js.map +1 -0
  55. package/dist/{chunk-6EUAU67C.mjs → chunk-SG2TD7FQ.mjs} +8 -8
  56. package/dist/chunk-SG2TD7FQ.mjs.map +1 -0
  57. package/dist/{chunk-QY65OUAC.mjs → chunk-SSFALO6S.mjs} +13 -4
  58. package/dist/chunk-SSFALO6S.mjs.map +1 -0
  59. package/dist/{chunk-PWF2NJDB.mjs → chunk-WC2TCWXK.mjs} +82 -14
  60. package/dist/chunk-WC2TCWXK.mjs.map +1 -0
  61. package/dist/{chunk-ZGCN5WCG.js → chunk-XZZZ4MZV.js} +83 -15
  62. package/dist/chunk-XZZZ4MZV.js.map +1 -0
  63. package/dist/chunk-YCDCQSYH.js +411 -0
  64. package/dist/chunk-YCDCQSYH.js.map +1 -0
  65. package/dist/{chunk-CWJ4OU6W.mjs → chunk-ZDAZYIXB.mjs} +2 -4
  66. package/dist/chunk-ZDAZYIXB.mjs.map +1 -0
  67. package/dist/feedback.d.mts +20 -8
  68. package/dist/feedback.d.ts +20 -8
  69. package/dist/feedback.js +5 -5
  70. package/dist/feedback.mjs +4 -4
  71. package/dist/fonts/HumanSans-BlackOblique.otf +0 -0
  72. package/dist/fonts/HumanSans-Thin.otf +0 -0
  73. package/dist/fonts/HumanSans-ThinOblique.otf +0 -0
  74. package/dist/fonts/human-sans-font.css +88 -0
  75. package/dist/fonts/human-sans.css +3 -0
  76. package/dist/fonts/inter.css +3 -0
  77. package/dist/icons.d.mts +2 -3
  78. package/dist/icons.d.ts +2 -3
  79. package/dist/icons.js +2 -2
  80. package/dist/icons.mjs +1 -1
  81. package/dist/index.d.mts +37 -8
  82. package/dist/index.d.ts +37 -8
  83. package/dist/index.js +23 -90
  84. package/dist/index.js.map +1 -1
  85. package/dist/index.mjs +46 -113
  86. package/dist/index.mjs.map +1 -1
  87. package/dist/inputs.d.mts +23 -3
  88. package/dist/inputs.d.ts +23 -3
  89. package/dist/inputs.js +5 -5
  90. package/dist/inputs.js.map +1 -1
  91. package/dist/inputs.mjs +15 -15
  92. package/dist/layout.d.mts +37 -283
  93. package/dist/layout.d.ts +37 -283
  94. package/dist/layout.js +8 -32
  95. package/dist/layout.js.map +1 -1
  96. package/dist/layout.mjs +16 -40
  97. package/dist/navigation.d.mts +9 -114
  98. package/dist/navigation.d.ts +9 -114
  99. package/dist/navigation.js +5 -9
  100. package/dist/navigation.js.map +1 -1
  101. package/dist/navigation.mjs +6 -10
  102. package/dist/third-party.d.mts +3 -527
  103. package/dist/third-party.d.ts +3 -527
  104. package/dist/third-party.js +2 -40
  105. package/dist/third-party.js.map +1 -1
  106. package/dist/third-party.mjs +3 -41
  107. package/dist/tokens.css +45 -71
  108. package/dist/utilities.js +2 -4
  109. package/dist/utilities.js.map +1 -1
  110. package/dist/utilities.mjs +2 -4
  111. package/package.json +23 -9
  112. package/dist/WorkflowNode-BnxXO6t_.d.mts +0 -46
  113. package/dist/WorkflowNode-BnxXO6t_.d.ts +0 -46
  114. package/dist/chunk-27JEWSWA.mjs +0 -233
  115. package/dist/chunk-27JEWSWA.mjs.map +0 -1
  116. package/dist/chunk-3WCMINE5.mjs.map +0 -1
  117. package/dist/chunk-463SRKKD.js.map +0 -1
  118. package/dist/chunk-6EUAU67C.mjs.map +0 -1
  119. package/dist/chunk-AIY6222Q.js +0 -11
  120. package/dist/chunk-AIY6222Q.js.map +0 -1
  121. package/dist/chunk-AJBM7IE6.mjs +0 -2366
  122. package/dist/chunk-AJBM7IE6.mjs.map +0 -1
  123. package/dist/chunk-CCN6M4LI.js.map +0 -1
  124. package/dist/chunk-CUCKULYC.mjs.map +0 -1
  125. package/dist/chunk-CWJ4OU6W.mjs.map +0 -1
  126. package/dist/chunk-EOF3QNPF.js.map +0 -1
  127. package/dist/chunk-FFZ5S7PQ.mjs.map +0 -1
  128. package/dist/chunk-FN5YL4BK.js.map +0 -1
  129. package/dist/chunk-HLH2VWXL.js +0 -2658
  130. package/dist/chunk-HLH2VWXL.js.map +0 -1
  131. package/dist/chunk-IE6GCHDI.mjs.map +0 -1
  132. package/dist/chunk-JS4IB5IU.mjs.map +0 -1
  133. package/dist/chunk-KF2Y7HO3.js.map +0 -1
  134. package/dist/chunk-KVBMZNWT.mjs.map +0 -1
  135. package/dist/chunk-L2TIGA7I.js.map +0 -1
  136. package/dist/chunk-MNM6HE72.js.map +0 -1
  137. package/dist/chunk-NXTVJ6PY.js.map +0 -1
  138. package/dist/chunk-PWF2NJDB.mjs.map +0 -1
  139. package/dist/chunk-QD6RLAO2.mjs +0 -11
  140. package/dist/chunk-QD6RLAO2.mjs.map +0 -1
  141. package/dist/chunk-QY65OUAC.mjs.map +0 -1
  142. package/dist/chunk-QYYQYZHV.js.map +0 -1
  143. package/dist/chunk-T7LPABOL.mjs +0 -595
  144. package/dist/chunk-T7LPABOL.mjs.map +0 -1
  145. package/dist/chunk-THQKYTQE.js.map +0 -1
  146. package/dist/chunk-X7E6GMFL.js +0 -233
  147. package/dist/chunk-X7E6GMFL.js.map +0 -1
  148. package/dist/chunk-XF66WQZE.mjs +0 -1535
  149. package/dist/chunk-XF66WQZE.mjs.map +0 -1
  150. package/dist/chunk-YQOZPLTY.js +0 -1535
  151. package/dist/chunk-YQOZPLTY.js.map +0 -1
  152. package/dist/chunk-ZGCN5WCG.js.map +0 -1
  153. package/dist/index.css +0 -79
  154. package/dist/index.css.map +0 -1
  155. /package/dist/{HumanSans-Black-C4YJONK7.otf → fonts/HumanSans-Black.otf} +0 -0
  156. /package/dist/{HumanSans-Bold-4EAJ3L3T.otf → fonts/HumanSans-Bold.otf} +0 -0
  157. /package/dist/{HumanSans-BoldOblique-4D325T4F.otf → fonts/HumanSans-BoldOblique.otf} +0 -0
  158. /package/dist/{HumanSans-ExtraLight-VL7DEKQ4.otf → fonts/HumanSans-ExtraLight.otf} +0 -0
  159. /package/dist/{HumanSans-ExtraLightOblique-VK2JTUXF.otf → fonts/HumanSans-ExtraLightOblique.otf} +0 -0
  160. /package/dist/{HumanSans-Light-YV7AFKRB.otf → fonts/HumanSans-Light.otf} +0 -0
  161. /package/dist/{HumanSans-LightOblique-VIXV7QA6.otf → fonts/HumanSans-LightOblique.otf} +0 -0
  162. /package/dist/{HumanSans-Medium-UULJ3PIR.otf → fonts/HumanSans-Medium.otf} +0 -0
  163. /package/dist/{HumanSans-MediumOblique-M7FHDZRS.otf → fonts/HumanSans-MediumOblique.otf} +0 -0
  164. /package/dist/{HumanSans-Regular-QMFEP3F6.otf → fonts/HumanSans-Regular.otf} +0 -0
  165. /package/dist/{HumanSans-RegularOblique-YPKQJAAM.otf → fonts/HumanSans-RegularOblique.otf} +0 -0
@@ -1,2366 +0,0 @@
1
- import {
2
- IconButton
3
- } from "./chunk-5ASG6G6U.mjs";
4
- import {
5
- TextField
6
- } from "./chunk-ZP26PGMS.mjs";
7
- import {
8
- Link
9
- } from "./chunk-PHMNZK2R.mjs";
10
- import {
11
- Button
12
- } from "./chunk-FFZ5S7PQ.mjs";
13
- import {
14
- Badge
15
- } from "./chunk-QBCRH7YF.mjs";
16
- import {
17
- webSurfaceTokens
18
- } from "./chunk-PWF2NJDB.mjs";
19
-
20
- // src/components/navigation/Dropdown/Dropdown.tsx
21
- import { Popover } from "@mui/material";
22
- import { useCallback, useRef } from "react";
23
-
24
- // src/components/navigation/Dropdown/DropdownAnchor.tsx
25
- import { forwardRef } from "react";
26
- import { Stack, styled, avatarClasses, Typography, Button as Button2 } from "@mui/material";
27
- import { ArrowDropUp, ArrowDropDown } from "@mui/icons-material";
28
- import { jsx, jsxs } from "react/jsx-runtime";
29
- var Clickable = styled(Button2)({
30
- padding: 0
31
- });
32
- var Anchor = styled(Stack)(({ theme, variant }) => ({
33
- height: 40,
34
- borderRadius: 25,
35
- padding: theme.spacing(1),
36
- color: theme.palette.text.secondary,
37
- backgroundColor: variant !== "header" ? theme.palette.grey[200] : "transparent",
38
- cursor: "pointer"
39
- }));
40
- var Left = styled("div")(({ theme }) => ({
41
- [`& .${avatarClasses.root}`]: {
42
- width: 30,
43
- height: 30,
44
- borderWidth: 2,
45
- borderStyle: "solid",
46
- borderColor: theme.palette.background.paper
47
- }
48
- }));
49
- var Center = styled(Typography)(({ theme }) => ({
50
- fontWeight: theme.typography.fontWeightBold,
51
- color: theme.palette.text.primary
52
- }));
53
- var DropdownAnchor = forwardRef(
54
- ({ open, label, leftElement, onOpen, variant, ...props }, ref) => /* @__PURE__ */ jsx(Clickable, { ref, ...props, color: "inherit", variant: "text", onClick: onOpen, children: /* @__PURE__ */ jsxs(Anchor, { variant, spacing: 1, direction: "row", alignItems: "stretch", children: [
55
- /* @__PURE__ */ jsx(Left, { children: leftElement }),
56
- /* @__PURE__ */ jsx(Center, { variant: "body1", children: label }),
57
- variant !== "header" && (open ? /* @__PURE__ */ jsx(ArrowDropUp, {}) : /* @__PURE__ */ jsx(ArrowDropDown, {}))
58
- ] }) })
59
- );
60
- DropdownAnchor.displayName = "DropdownAnchor";
61
-
62
- // src/components/navigation/Dropdown/Dropdown.tsx
63
- import { Fragment, jsx as jsx2, jsxs as jsxs2 } from "react/jsx-runtime";
64
- var Dropdown = ({
65
- open,
66
- label,
67
- leftElement,
68
- direction = "left",
69
- children,
70
- onToggle,
71
- dense = false,
72
- disableGutters = false,
73
- disablePaddings = false,
74
- variant,
75
- renderAnchor = ({ ref, open: open2, onOpen }) => /* @__PURE__ */ jsx2(DropdownAnchor, { ref, open: open2, label, leftElement, onOpen, variant })
76
- }) => {
77
- const anchorRef = useRef(null);
78
- const horizontal = direction === "left" ? "right" : "left";
79
- const onOpen = useCallback(() => onToggle?.(true), [onToggle]);
80
- const padding = dense ? 1 : 2;
81
- return /* @__PURE__ */ jsxs2(Fragment, { children: [
82
- renderAnchor({ ref: anchorRef, onOpen, open }),
83
- /* @__PURE__ */ jsx2(
84
- Popover,
85
- {
86
- "aria-label": "Overlay",
87
- open,
88
- onClose: () => onToggle?.(false),
89
- anchorEl: anchorRef.current,
90
- anchorOrigin: {
91
- horizontal,
92
- vertical: "bottom"
93
- },
94
- transformOrigin: {
95
- horizontal,
96
- vertical: -8
97
- },
98
- slotProps: {
99
- paper: {
100
- elevation: 0,
101
- sx: {
102
- padding: disablePaddings ? 0 : padding,
103
- paddingX: !disablePaddings && disableGutters ? 0 : padding,
104
- borderRadius: 3,
105
- border: "1px solid",
106
- borderColor: "divider",
107
- boxShadow: 2
108
- }
109
- }
110
- },
111
- children
112
- }
113
- )
114
- ] });
115
- };
116
-
117
- // src/components/navigation/Sidebar.tsx
118
- import {
119
- Drawer,
120
- List,
121
- styled as styled3,
122
- Box
123
- } from "@mui/material";
124
-
125
- // src/components/navigation/SidebarItem.tsx
126
- import {
127
- ListItemButton,
128
- ListItemIcon,
129
- ListItemText,
130
- styled as styled2
131
- } from "@mui/material";
132
- import { jsx as jsx3, jsxs as jsxs3 } from "react/jsx-runtime";
133
- var StyledListItemButton = styled2(ListItemButton, {
134
- shouldForwardProp: (prop) => prop !== "selected" && prop !== "size"
135
- })(({ theme, selected, size = "medium" }) => {
136
- const heightMap = {
137
- small: "40px",
138
- medium: "56px",
139
- large: "64px"
140
- };
141
- return {
142
- height: heightMap[size],
143
- paddingLeft: "16px",
144
- paddingRight: "16px",
145
- borderRadius: "8px",
146
- margin: "4px 8px",
147
- color: selected ? theme.palette.primary.main : theme.palette.text.primary,
148
- backgroundColor: selected ? theme.palette.background.selected : "transparent",
149
- "&:hover": {
150
- backgroundColor: selected ? theme.palette.background.selected : theme.palette.grey[50]
151
- },
152
- "& .MuiListItemIcon-root": {
153
- color: selected ? theme.palette.primary.main : theme.palette.text.secondary,
154
- minWidth: "40px"
155
- },
156
- "& .MuiListItemText-primary": {
157
- fontWeight: selected ? 600 : 400,
158
- color: selected ? theme.palette.primary.main : theme.palette.text.primary
159
- }
160
- };
161
- });
162
- var SidebarItem = ({
163
- label,
164
- icon,
165
- selected = false,
166
- onClick,
167
- size = "medium",
168
- endIcon,
169
- children
170
- }) => {
171
- return /* @__PURE__ */ jsxs3(StyledListItemButton, { selected, size, onClick, children: [
172
- icon && /* @__PURE__ */ jsx3(ListItemIcon, { children: icon }),
173
- /* @__PURE__ */ jsx3(ListItemText, { primary: label }),
174
- endIcon && /* @__PURE__ */ jsx3("div", { style: { marginLeft: "auto" }, children: endIcon }),
175
- children
176
- ] });
177
- };
178
-
179
- // src/components/navigation/Sidebar.tsx
180
- import { jsx as jsx4 } from "react/jsx-runtime";
181
- var StyledDrawer = styled3(Drawer)(({ theme }) => ({
182
- "& .MuiDrawer-paper": {
183
- backgroundColor: theme.palette.background.paper,
184
- borderRight: `1px solid ${theme.palette.grey[200]}`,
185
- boxShadow: "none"
186
- }
187
- }));
188
- var Sidebar = ({
189
- open = true,
190
- width = 280,
191
- items,
192
- onClose,
193
- variant = "permanent"
194
- }) => {
195
- return /* @__PURE__ */ jsx4(
196
- StyledDrawer,
197
- {
198
- variant,
199
- open,
200
- onClose,
201
- sx: {
202
- width,
203
- flexShrink: 0,
204
- "& .MuiDrawer-paper": {
205
- width,
206
- boxSizing: "border-box"
207
- }
208
- },
209
- children: /* @__PURE__ */ jsx4(Box, { sx: { overflow: "auto", padding: "8px 0" }, children: /* @__PURE__ */ jsx4(List, { children: items.map((item, index) => /* @__PURE__ */ jsx4(SidebarItem, { ...item }, index)) }) })
210
- }
211
- );
212
- };
213
-
214
- // src/components/navigation/ServiceSelector.tsx
215
- import { useState, useCallback as useCallback2 } from "react";
216
- import {
217
- Box as Box2,
218
- Typography as Typography2,
219
- Avatar,
220
- Tooltip,
221
- IconButton as IconButton2,
222
- Link as Link2,
223
- Chip,
224
- TextField as TextField2,
225
- InputAdornment,
226
- List as List2,
227
- ListItem,
228
- ListItemAvatar,
229
- ListItemText as ListItemText2,
230
- Button as Button3,
231
- Menu
232
- } from "@mui/material";
233
- import KeyboardArrowDownIcon from "@mui/icons-material/KeyboardArrowDown";
234
- import ArchiveIcon from "@mui/icons-material/Archive";
235
- import UnarchiveIcon from "@mui/icons-material/Unarchive";
236
- import SearchIcon from "@mui/icons-material/Search";
237
- import AddIcon from "@mui/icons-material/Add";
238
- import CheckIcon from "@mui/icons-material/Check";
239
- import SettingsIcon from "@mui/icons-material/Settings";
240
- import PersonAddAltIcon from "@mui/icons-material/PersonAddAlt";
241
- import { Fragment as Fragment2, jsx as jsx5, jsxs as jsxs4 } from "react/jsx-runtime";
242
- var ServiceSelectorButton = ({
243
- services,
244
- selectedServiceId,
245
- loading = false,
246
- compact = false,
247
- onSelectService,
248
- onServiceClick,
249
- onCreateService,
250
- onServiceCreated,
251
- isManager = false,
252
- sx = {},
253
- panelWidth = 350,
254
- onOpenSettings,
255
- onOpenAddMember
256
- }) => {
257
- const [anchorEl, setAnchorEl] = useState(null);
258
- const [searchTerm, setSearchTerm] = useState("");
259
- const [showArchived, setShowArchived] = useState(false);
260
- const handleOpenSelector = (event) => {
261
- event.stopPropagation();
262
- setAnchorEl(event.currentTarget);
263
- };
264
- const handleClose = () => {
265
- setAnchorEl(null);
266
- setSearchTerm("");
267
- setShowArchived(false);
268
- };
269
- const handleServiceClick = (e) => {
270
- e.stopPropagation();
271
- if (selectedServiceId && onServiceClick) {
272
- onServiceClick(selectedServiceId);
273
- }
274
- };
275
- const handleSelectService = useCallback2(
276
- (serviceId) => {
277
- handleClose();
278
- if (onSelectService) {
279
- onSelectService(serviceId);
280
- }
281
- },
282
- [onSelectService]
283
- );
284
- const handleCreateClick = () => {
285
- handleClose();
286
- if (onCreateService) {
287
- onCreateService();
288
- }
289
- };
290
- const selectedService = Array.isArray(services) ? services.find((s) => s.id === selectedServiceId) : null;
291
- const filteredServices = services.filter((service) => {
292
- const matchesSearch = searchTerm === "" || service.name.toLowerCase().includes(searchTerm.toLowerCase());
293
- const isArchived = service.archived === true;
294
- const matchesArchivedFilter = showArchived ? isArchived : !isArchived;
295
- return matchesSearch && matchesArchivedFilter;
296
- });
297
- if (compact) {
298
- return /* @__PURE__ */ jsxs4(Fragment2, { children: [
299
- /* @__PURE__ */ jsx5(Box2, { sx: { position: "relative" }, children: /* @__PURE__ */ jsx5(Tooltip, { title: "Select service", placement: "right", children: /* @__PURE__ */ jsx5(
300
- IconButton2,
301
- {
302
- onClick: handleOpenSelector,
303
- sx: {
304
- p: 1,
305
- "&:hover": {
306
- bgcolor: "rgba(0, 0, 0, 0.04)"
307
- },
308
- ...sx
309
- },
310
- children: /* @__PURE__ */ jsx5(
311
- Avatar,
312
- {
313
- sx: {
314
- width: 32,
315
- height: 32,
316
- bgcolor: selectedServiceId ? "primary.main" : "grey.400",
317
- fontSize: "0.9rem"
318
- },
319
- children: selectedService ? selectedService.name.charAt(0) : "D"
320
- }
321
- )
322
- }
323
- ) }) }),
324
- /* @__PURE__ */ jsx5(
325
- ServiceSelectorPanel,
326
- {
327
- open: Boolean(anchorEl),
328
- anchorEl,
329
- onClose: handleClose,
330
- services,
331
- selectedServiceId,
332
- onSelectService: handleSelectService,
333
- onCreateService: handleCreateClick,
334
- onServiceCreated,
335
- loading,
336
- width: panelWidth,
337
- isManager,
338
- selectedService,
339
- searchTerm,
340
- onSearchChange: setSearchTerm,
341
- showArchived,
342
- onToggleArchived: () => setShowArchived(!showArchived),
343
- filteredServices,
344
- onOpenSettings,
345
- onOpenAddMember
346
- }
347
- )
348
- ] });
349
- }
350
- return /* @__PURE__ */ jsxs4(Fragment2, { children: [
351
- /* @__PURE__ */ jsxs4(Box2, { sx: { display: "flex", alignItems: "center", ...sx }, children: [
352
- selectedService ? /* @__PURE__ */ jsxs4(Fragment2, { children: [
353
- isManager ? /* @__PURE__ */ jsxs4(
354
- Link2,
355
- {
356
- underline: "hover",
357
- color: "inherit",
358
- onClick: handleServiceClick,
359
- sx: {
360
- display: "flex",
361
- alignItems: "center",
362
- fontSize: "0.875rem",
363
- cursor: "pointer",
364
- mr: 0.5
365
- },
366
- children: [
367
- /* @__PURE__ */ jsx5(
368
- Avatar,
369
- {
370
- sx: {
371
- width: 20,
372
- height: 20,
373
- bgcolor: "primary.main",
374
- fontSize: "0.7rem",
375
- mr: 0.5
376
- },
377
- children: selectedService.name.charAt(0)
378
- }
379
- ),
380
- selectedService.name
381
- ]
382
- }
383
- ) : /* @__PURE__ */ jsxs4(
384
- Box2,
385
- {
386
- sx: {
387
- display: "flex",
388
- alignItems: "center",
389
- fontSize: "0.875rem",
390
- mr: 0.5,
391
- color: "text.primary"
392
- },
393
- children: [
394
- /* @__PURE__ */ jsx5(
395
- Avatar,
396
- {
397
- sx: {
398
- width: 20,
399
- height: 20,
400
- bgcolor: "primary.main",
401
- fontSize: "0.7rem",
402
- mr: 0.5
403
- },
404
- children: selectedService.name.charAt(0)
405
- }
406
- ),
407
- selectedService.name
408
- ]
409
- }
410
- ),
411
- selectedService.archived && /* @__PURE__ */ jsx5(
412
- Chip,
413
- {
414
- size: "small",
415
- label: "Archived",
416
- color: "error",
417
- variant: "outlined",
418
- sx: {
419
- ml: 0.5,
420
- height: 20,
421
- fontSize: "0.8rem",
422
- "& .MuiChip-label": { px: 1 },
423
- "& .MuiChip-icon": { fontSize: "0.7rem", ml: 0.5 }
424
- }
425
- }
426
- )
427
- ] }) : /* @__PURE__ */ jsx5(
428
- Typography2,
429
- {
430
- variant: "body2",
431
- color: "text.secondary",
432
- sx: {
433
- fontSize: "0.875rem"
434
- },
435
- children: "Select Service"
436
- }
437
- ),
438
- /* @__PURE__ */ jsx5(
439
- IconButton2,
440
- {
441
- onClick: handleOpenSelector,
442
- size: "small",
443
- sx: {
444
- p: 0.2,
445
- ml: 0.5,
446
- color: "text.secondary"
447
- },
448
- children: /* @__PURE__ */ jsx5(KeyboardArrowDownIcon, { fontSize: "small" })
449
- }
450
- )
451
- ] }),
452
- /* @__PURE__ */ jsx5(
453
- ServiceSelectorPanel,
454
- {
455
- open: Boolean(anchorEl),
456
- anchorEl,
457
- onClose: handleClose,
458
- services,
459
- selectedServiceId,
460
- onSelectService: handleSelectService,
461
- onCreateService: handleCreateClick,
462
- onServiceCreated,
463
- loading,
464
- width: panelWidth,
465
- isManager,
466
- selectedService,
467
- searchTerm,
468
- onSearchChange: setSearchTerm,
469
- showArchived,
470
- onToggleArchived: () => setShowArchived(!showArchived),
471
- filteredServices,
472
- onOpenSettings,
473
- onOpenAddMember
474
- }
475
- )
476
- ] });
477
- };
478
- var ServiceSelectorPanel = ({
479
- open,
480
- anchorEl,
481
- onClose,
482
- services,
483
- selectedServiceId,
484
- onSelectService,
485
- onCreateService,
486
- onServiceCreated,
487
- loading = false,
488
- width = 350,
489
- isManager = false,
490
- selectedService,
491
- searchTerm: externalSearchTerm,
492
- onSearchChange: externalOnSearchChange,
493
- showArchived: externalShowArchived,
494
- onToggleArchived: externalOnToggleArchived,
495
- filteredServices: externalFilteredServices,
496
- onOpenSettings,
497
- onOpenAddMember
498
- }) => {
499
- const [internalSearchTerm, setInternalSearchTerm] = useState("");
500
- const [internalShowArchived, setInternalShowArchived] = useState(false);
501
- const searchTerm = externalSearchTerm !== void 0 ? externalSearchTerm : internalSearchTerm;
502
- const setSearchTerm = externalOnSearchChange || setInternalSearchTerm;
503
- const showArchived = externalShowArchived !== void 0 ? externalShowArchived : internalShowArchived;
504
- const toggleArchived = externalOnToggleArchived || (() => setInternalShowArchived(!internalShowArchived));
505
- const filteredServices = externalFilteredServices || services.filter((service) => {
506
- const matchesSearch = searchTerm === "" || service.name.toLowerCase().includes(searchTerm.toLowerCase());
507
- const isArchived = service.archived === true;
508
- const matchesArchivedFilter = showArchived ? isArchived : !isArchived;
509
- return matchesSearch && matchesArchivedFilter;
510
- });
511
- const handleCreateClick = () => {
512
- if (onCreateService) {
513
- onCreateService();
514
- } else {
515
- onClose();
516
- if (onServiceCreated) {
517
- onServiceCreated();
518
- }
519
- }
520
- };
521
- return /* @__PURE__ */ jsxs4(
522
- Menu,
523
- {
524
- anchorEl,
525
- open,
526
- onClose,
527
- anchorOrigin: {
528
- vertical: "bottom",
529
- horizontal: "left"
530
- },
531
- transformOrigin: {
532
- vertical: "top",
533
- horizontal: "left"
534
- },
535
- PaperProps: {
536
- sx: {
537
- width,
538
- maxHeight: "80vh",
539
- borderRadius: 1,
540
- boxShadow: "0 2px 10px rgba(0, 0, 0, 0.12)",
541
- overflow: "hidden",
542
- mt: 1
543
- }
544
- },
545
- children: [
546
- selectedService && /* @__PURE__ */ jsxs4(
547
- Box2,
548
- {
549
- sx: {
550
- paddingLeft: 2,
551
- paddingRight: 2,
552
- paddingTop: 1.5,
553
- paddingBottom: 1.5,
554
- borderBottom: 1,
555
- borderColor: "divider"
556
- },
557
- children: [
558
- /* @__PURE__ */ jsxs4(Box2, { sx: {
559
- display: "flex",
560
- alignItems: "center",
561
- mb: 1.5
562
- }, children: [
563
- /* @__PURE__ */ jsx5(
564
- Avatar,
565
- {
566
- sx: {
567
- width: 32,
568
- height: 32,
569
- bgcolor: "primary.main",
570
- fontSize: "0.9rem",
571
- mr: 1.5
572
- },
573
- children: selectedService.name.charAt(0)
574
- }
575
- ),
576
- /* @__PURE__ */ jsx5(Box2, { sx: { flex: 1 }, children: /* @__PURE__ */ jsxs4(Box2, { sx: { display: "flex", alignItems: "center", gap: 1 }, children: [
577
- /* @__PURE__ */ jsx5(Typography2, { variant: "subtitle1", sx: { fontWeight: 600, fontSize: "1rem" }, children: selectedService.name }),
578
- /* @__PURE__ */ jsx5(
579
- Box2,
580
- {
581
- sx: {
582
- display: "inline-block",
583
- bgcolor: "rgba(0, 0, 0, 0.04)",
584
- color: "text.secondary",
585
- px: 1,
586
- py: 0.3,
587
- borderRadius: "12px",
588
- fontSize: "0.7rem",
589
- fontWeight: 500,
590
- lineHeight: 1
591
- },
592
- children: isManager ? "Manager" : "Viewer"
593
- }
594
- )
595
- ] }) })
596
- ] }),
597
- (onOpenSettings || onOpenAddMember) && /* @__PURE__ */ jsxs4(Box2, { sx: { display: "flex", gap: 1 }, children: [
598
- onOpenAddMember && /* @__PURE__ */ jsx5(
599
- Button3,
600
- {
601
- startIcon: /* @__PURE__ */ jsx5(PersonAddAltIcon, {}),
602
- variant: "outlined",
603
- size: "small",
604
- onClick: (e) => {
605
- e.stopPropagation();
606
- onClose();
607
- onOpenAddMember(selectedServiceId || "");
608
- },
609
- disabled: !isManager,
610
- sx: {
611
- flex: 1,
612
- textTransform: "none",
613
- color: "text.secondary",
614
- fontSize: "0.8rem",
615
- py: 0.75,
616
- justifyContent: "flex-start",
617
- borderColor: "rgba(0, 0, 0, 0.12)",
618
- borderRadius: "6px",
619
- "&:hover": {
620
- borderColor: "rgba(0, 0, 0, 0.23)",
621
- backgroundColor: "rgba(0, 0, 0, 0.03)"
622
- },
623
- "&:disabled": {
624
- opacity: 0.5,
625
- cursor: "not-allowed"
626
- }
627
- },
628
- children: "Add member"
629
- }
630
- ),
631
- onOpenSettings && /* @__PURE__ */ jsx5(
632
- Button3,
633
- {
634
- startIcon: /* @__PURE__ */ jsx5(SettingsIcon, {}),
635
- variant: "outlined",
636
- size: "small",
637
- onClick: (e) => {
638
- e.stopPropagation();
639
- onClose();
640
- onOpenSettings(selectedServiceId || "");
641
- },
642
- disabled: !isManager,
643
- sx: {
644
- flex: 1,
645
- textTransform: "none",
646
- color: "text.secondary",
647
- fontSize: "0.8rem",
648
- py: 0.75,
649
- justifyContent: "flex-start",
650
- borderColor: "rgba(0, 0, 0, 0.12)",
651
- borderRadius: "6px",
652
- "&:hover": {
653
- borderColor: "rgba(0, 0, 0, 0.23)",
654
- backgroundColor: "rgba(0, 0, 0, 0.03)"
655
- },
656
- "&:disabled": {
657
- opacity: 0.5,
658
- cursor: "not-allowed"
659
- }
660
- },
661
- children: "Settings"
662
- }
663
- )
664
- ] })
665
- ]
666
- }
667
- ),
668
- /* @__PURE__ */ jsxs4(Box2, { sx: { px: 2, pt: 2, pb: 1.5 }, children: [
669
- /* @__PURE__ */ jsxs4(Box2, { sx: { display: "flex", alignItems: "center", mb: 1.5 }, children: [
670
- /* @__PURE__ */ jsx5(
671
- TextField2,
672
- {
673
- size: "small",
674
- placeholder: "Search services...",
675
- value: searchTerm,
676
- onChange: (e) => setSearchTerm(e.target.value),
677
- sx: { flex: 1 },
678
- InputProps: {
679
- startAdornment: /* @__PURE__ */ jsx5(InputAdornment, { position: "start", children: /* @__PURE__ */ jsx5(SearchIcon, { fontSize: "small", color: "action" }) }),
680
- sx: {
681
- borderRadius: 1.5,
682
- backgroundColor: "rgba(0, 0, 0, 0.04)",
683
- "& fieldset": { border: "none" },
684
- py: 0.5
685
- }
686
- }
687
- }
688
- ),
689
- /* @__PURE__ */ jsx5(Tooltip, { title: showArchived ? "Show active" : "Show archived", children: /* @__PURE__ */ jsx5(
690
- IconButton2,
691
- {
692
- size: "small",
693
- onClick: toggleArchived,
694
- color: showArchived ? "primary" : "default",
695
- sx: { ml: 1 },
696
- children: showArchived ? /* @__PURE__ */ jsx5(UnarchiveIcon, { fontSize: "small" }) : /* @__PURE__ */ jsx5(ArchiveIcon, { fontSize: "small" })
697
- }
698
- ) })
699
- ] }),
700
- /* @__PURE__ */ jsx5(
701
- Box2,
702
- {
703
- sx: {
704
- maxHeight: 400,
705
- overflow: "auto",
706
- py: 1
707
- },
708
- children: loading ? /* @__PURE__ */ jsx5(Box2, { sx: { p: 2, textAlign: "center" }, children: /* @__PURE__ */ jsx5(Typography2, { variant: "body2", color: "text.secondary", children: "Loading services..." }) }) : filteredServices.length === 0 ? /* @__PURE__ */ jsx5(Box2, { sx: { p: 2, textAlign: "center" }, children: /* @__PURE__ */ jsx5(Typography2, { variant: "body2", color: "text.secondary", children: searchTerm ? `No ${showArchived ? "archived " : ""}services matching "${searchTerm}"` : showArchived ? "No archived services found" : "No active services found" }) }) : /* @__PURE__ */ jsxs4(Fragment2, { children: [
709
- /* @__PURE__ */ jsxs4(
710
- Typography2,
711
- {
712
- variant: "caption",
713
- sx: {
714
- display: "block",
715
- px: 2.5,
716
- py: 0.5,
717
- color: "text.secondary",
718
- fontWeight: 600,
719
- textTransform: "uppercase",
720
- fontSize: "0.65rem",
721
- letterSpacing: 0.5
722
- },
723
- children: [
724
- "Services",
725
- showArchived && /* @__PURE__ */ jsx5(
726
- Chip,
727
- {
728
- size: "small",
729
- label: "Archived",
730
- color: "error",
731
- variant: "outlined",
732
- sx: {
733
- ml: 1,
734
- height: 20,
735
- fontSize: "0.6rem",
736
- "& .MuiChip-label": { px: 0.5 },
737
- "& .MuiChip-icon": { fontSize: "0.7rem", ml: 0.5 }
738
- }
739
- }
740
- )
741
- ]
742
- }
743
- ),
744
- /* @__PURE__ */ jsx5(List2, { disablePadding: true, children: filteredServices.map((service) => /* @__PURE__ */ jsxs4(
745
- ListItem,
746
- {
747
- sx: {
748
- py: 0.75,
749
- px: 2,
750
- cursor: "pointer",
751
- "&:hover": {
752
- backgroundColor: "rgba(0, 0, 0, 0.04)"
753
- },
754
- backgroundColor: service.id === selectedServiceId ? "rgba(25, 118, 210, 0.08)" : "transparent",
755
- position: "relative"
756
- },
757
- onClick: () => onSelectService(service.id),
758
- secondaryAction: service.id === selectedServiceId ? /* @__PURE__ */ jsx5(
759
- CheckIcon,
760
- {
761
- sx: {
762
- color: "primary.main",
763
- fontSize: "1.2rem"
764
- }
765
- }
766
- ) : null,
767
- children: [
768
- /* @__PURE__ */ jsx5(ListItemAvatar, { sx: { minWidth: 40 }, children: /* @__PURE__ */ jsx5(
769
- Avatar,
770
- {
771
- sx: {
772
- width: 26,
773
- height: 26,
774
- bgcolor: service.id === selectedServiceId ? "primary.main" : "grey.400",
775
- fontSize: "0.8rem"
776
- },
777
- src: service.avatar,
778
- children: service.name.charAt(0)
779
- }
780
- ) }),
781
- /* @__PURE__ */ jsx5(
782
- ListItemText2,
783
- {
784
- primary: /* @__PURE__ */ jsx5(Box2, { sx: { display: "flex", alignItems: "center", gap: 0.5 }, children: /* @__PURE__ */ jsx5(
785
- Typography2,
786
- {
787
- variant: "body2",
788
- sx: {
789
- fontWeight: service.id === selectedServiceId ? 600 : 400,
790
- color: service.id === selectedServiceId ? "primary.main" : "text.primary"
791
- },
792
- children: service.name
793
- }
794
- ) }),
795
- primaryTypographyProps: { sx: { fontWeight: 500 } },
796
- sx: { my: 0 }
797
- }
798
- )
799
- ]
800
- },
801
- service.id
802
- )) })
803
- ] })
804
- }
805
- ),
806
- /* @__PURE__ */ jsx5(
807
- Box2,
808
- {
809
- sx: {
810
- paddingTop: 2,
811
- paddingLeft: 2,
812
- paddingRight: 2,
813
- borderTop: 1,
814
- borderColor: "divider"
815
- },
816
- children: /* @__PURE__ */ jsx5(
817
- Button3,
818
- {
819
- fullWidth: true,
820
- variant: "text",
821
- startIcon: /* @__PURE__ */ jsx5(AddIcon, {}),
822
- onClick: handleCreateClick,
823
- sx: {
824
- textTransform: "none",
825
- fontWeight: 500,
826
- justifyContent: "flex-start",
827
- color: "primary.main",
828
- py: 1,
829
- px: 1.5,
830
- "&:hover": {
831
- backgroundColor: "rgba(25, 118, 210, 0.08)"
832
- }
833
- },
834
- children: "New Service"
835
- }
836
- )
837
- }
838
- )
839
- ] })
840
- ]
841
- }
842
- );
843
- };
844
-
845
- // src/components/navigation/WorkspaceSelector.tsx
846
- import React2, { useState as useState2, useCallback as useCallback3 } from "react";
847
- import {
848
- Box as Box3,
849
- Typography as Typography3,
850
- Avatar as Avatar2,
851
- IconButton as IconButton3,
852
- Link as Link3,
853
- TextField as TextField3,
854
- InputAdornment as InputAdornment2,
855
- List as List3,
856
- ListItem as ListItem2,
857
- ListItemAvatar as ListItemAvatar2,
858
- ListItemText as ListItemText3,
859
- Button as Button4,
860
- Menu as Menu2
861
- } from "@mui/material";
862
- import KeyboardArrowDownIcon2 from "@mui/icons-material/KeyboardArrowDown";
863
- import SearchIcon2 from "@mui/icons-material/Search";
864
- import AddIcon2 from "@mui/icons-material/Add";
865
- import CheckIcon2 from "@mui/icons-material/Check";
866
- import { Fragment as Fragment3, jsx as jsx6, jsxs as jsxs5 } from "react/jsx-runtime";
867
- var WorkspaceSelectorButton = ({
868
- workspaces,
869
- selectedWorkspaceId,
870
- loading = false,
871
- onSelectWorkspace,
872
- onWorkspaceClick,
873
- onCreateWorkspace,
874
- sx = {},
875
- panelWidth = 350
876
- }) => {
877
- const [anchorEl, setAnchorEl] = useState2(null);
878
- const handleOpenSelector = (event) => {
879
- event.stopPropagation();
880
- setAnchorEl(event.currentTarget);
881
- };
882
- const handleClose = () => {
883
- setAnchorEl(null);
884
- };
885
- const handleSelectWorkspace = useCallback3(
886
- (workspaceId) => {
887
- handleClose();
888
- if (onSelectWorkspace) {
889
- onSelectWorkspace(workspaceId);
890
- }
891
- },
892
- [onSelectWorkspace]
893
- );
894
- const selectedWorkspace = Array.isArray(workspaces) ? workspaces.find((w) => w.id === selectedWorkspaceId) : null;
895
- if (!workspaces || workspaces.length === 0) {
896
- return null;
897
- }
898
- return /* @__PURE__ */ jsxs5(Fragment3, { children: [
899
- /* @__PURE__ */ jsxs5(Box3, { sx: { display: "flex", alignItems: "center", ...sx }, children: [
900
- selectedWorkspace ? /* @__PURE__ */ jsx6(Fragment3, { children: /* @__PURE__ */ jsxs5(
901
- Link3,
902
- {
903
- underline: "hover",
904
- color: "inherit",
905
- onClick: (e) => {
906
- e.stopPropagation();
907
- if (onWorkspaceClick) {
908
- onWorkspaceClick(selectedWorkspace.id);
909
- }
910
- },
911
- sx: {
912
- display: "flex",
913
- alignItems: "center",
914
- fontSize: "0.875rem",
915
- cursor: "pointer",
916
- mr: 0.5
917
- },
918
- children: [
919
- /* @__PURE__ */ jsx6(
920
- Avatar2,
921
- {
922
- sx: {
923
- width: 20,
924
- height: 20,
925
- bgcolor: "secondary.main",
926
- fontSize: "0.7rem",
927
- mr: 0.5
928
- },
929
- children: selectedWorkspace.name.charAt(0)
930
- }
931
- ),
932
- selectedWorkspace.name
933
- ]
934
- }
935
- ) }) : /* @__PURE__ */ jsx6(
936
- Typography3,
937
- {
938
- variant: "body2",
939
- color: "text.secondary",
940
- sx: {
941
- fontSize: "0.875rem"
942
- },
943
- children: "Select Workspace"
944
- }
945
- ),
946
- /* @__PURE__ */ jsx6(
947
- IconButton3,
948
- {
949
- onClick: handleOpenSelector,
950
- size: "small",
951
- sx: {
952
- p: 0.2,
953
- ml: 0.5,
954
- color: "text.secondary"
955
- },
956
- children: /* @__PURE__ */ jsx6(KeyboardArrowDownIcon2, { fontSize: "small" })
957
- }
958
- )
959
- ] }),
960
- /* @__PURE__ */ jsx6(
961
- WorkspaceSelectorPanel,
962
- {
963
- open: Boolean(anchorEl),
964
- anchorEl,
965
- onClose: handleClose,
966
- workspaces,
967
- selectedWorkspaceId,
968
- onSelectWorkspace: handleSelectWorkspace,
969
- onCreateWorkspace,
970
- loading,
971
- width: panelWidth
972
- }
973
- )
974
- ] });
975
- };
976
- var WorkspaceSelectorPanel = ({
977
- open,
978
- anchorEl,
979
- onClose,
980
- workspaces,
981
- selectedWorkspaceId,
982
- onSelectWorkspace,
983
- onCreateWorkspace,
984
- loading = false,
985
- width = 350
986
- }) => {
987
- const [searchTerm, setSearchTerm] = useState2("");
988
- React2.useEffect(() => {
989
- if (open) {
990
- setSearchTerm("");
991
- }
992
- }, [open]);
993
- const filteredWorkspaces = workspaces.filter(
994
- (w) => w.name.toLowerCase().includes(searchTerm.toLowerCase())
995
- );
996
- const handleCreateClick = () => {
997
- onClose();
998
- if (onCreateWorkspace) {
999
- onCreateWorkspace();
1000
- }
1001
- };
1002
- const handleSelect = (workspaceId) => {
1003
- onSelectWorkspace(workspaceId);
1004
- onClose();
1005
- };
1006
- return /* @__PURE__ */ jsx6(
1007
- Menu2,
1008
- {
1009
- open,
1010
- anchorEl,
1011
- onClose,
1012
- anchorOrigin: { vertical: "bottom", horizontal: "left" },
1013
- transformOrigin: { vertical: "top", horizontal: "left" },
1014
- PaperProps: {
1015
- sx: {
1016
- width,
1017
- maxHeight: 600,
1018
- mt: 1,
1019
- borderRadius: 2
1020
- }
1021
- },
1022
- children: /* @__PURE__ */ jsxs5(Box3, { children: [
1023
- /* @__PURE__ */ jsx6(Box3, { sx: { px: 2, pt: 2, pb: 1.5 }, children: /* @__PURE__ */ jsx6(
1024
- TextField3,
1025
- {
1026
- fullWidth: true,
1027
- size: "small",
1028
- placeholder: "Search workspaces...",
1029
- value: searchTerm,
1030
- onChange: (e) => setSearchTerm(e.target.value),
1031
- InputProps: {
1032
- startAdornment: /* @__PURE__ */ jsx6(InputAdornment2, { position: "start", children: /* @__PURE__ */ jsx6(SearchIcon2, { fontSize: "small" }) })
1033
- }
1034
- }
1035
- ) }),
1036
- /* @__PURE__ */ jsx6(Box3, { sx: { maxHeight: 400, overflowY: "auto" }, children: loading ? /* @__PURE__ */ jsx6(Box3, { sx: { p: 2, textAlign: "center" }, children: /* @__PURE__ */ jsx6(Typography3, { variant: "body2", color: "text.secondary", children: "Loading..." }) }) : filteredWorkspaces.length === 0 ? /* @__PURE__ */ jsx6(Box3, { sx: { p: 2, textAlign: "center" }, children: /* @__PURE__ */ jsx6(Typography3, { variant: "body2", color: "text.secondary", children: "No workspaces found" }) }) : /* @__PURE__ */ jsx6(List3, { dense: true, children: filteredWorkspaces.map((workspace) => /* @__PURE__ */ jsxs5(
1037
- ListItem2,
1038
- {
1039
- onClick: () => handleSelect(workspace.id),
1040
- sx: {
1041
- py: 0.5,
1042
- cursor: "pointer",
1043
- bgcolor: workspace.id === selectedWorkspaceId ? "action.selected" : "transparent",
1044
- "&:hover": {
1045
- bgcolor: "action.hover"
1046
- }
1047
- },
1048
- children: [
1049
- /* @__PURE__ */ jsx6(ListItemAvatar2, { children: /* @__PURE__ */ jsx6(
1050
- Avatar2,
1051
- {
1052
- sx: { width: 32, height: 32, bgcolor: "secondary.main" },
1053
- children: workspace.name.charAt(0)
1054
- }
1055
- ) }),
1056
- /* @__PURE__ */ jsx6(
1057
- ListItemText3,
1058
- {
1059
- primary: /* @__PURE__ */ jsxs5(Box3, { sx: { display: "flex", alignItems: "center", gap: 1 }, children: [
1060
- /* @__PURE__ */ jsx6(Typography3, { variant: "body2", fontWeight: 500, children: workspace.name }),
1061
- workspace.id === selectedWorkspaceId && /* @__PURE__ */ jsx6(CheckIcon2, { fontSize: "small", color: "primary" })
1062
- ] }),
1063
- secondary: workspace.description
1064
- }
1065
- )
1066
- ]
1067
- },
1068
- workspace.id
1069
- )) }) }),
1070
- /* @__PURE__ */ jsx6(
1071
- Box3,
1072
- {
1073
- sx: {
1074
- paddingTop: 2,
1075
- paddingLeft: 2,
1076
- paddingRight: 2,
1077
- borderTop: 1,
1078
- borderColor: "divider"
1079
- },
1080
- children: /* @__PURE__ */ jsx6(
1081
- Button4,
1082
- {
1083
- fullWidth: true,
1084
- variant: "text",
1085
- startIcon: /* @__PURE__ */ jsx6(AddIcon2, {}),
1086
- onClick: handleCreateClick,
1087
- sx: {
1088
- textTransform: "none",
1089
- fontWeight: 500,
1090
- justifyContent: "flex-start",
1091
- color: "primary.main",
1092
- py: 1,
1093
- px: 1.5,
1094
- "&:hover": {
1095
- backgroundColor: "rgba(25, 118, 210, 0.08)"
1096
- }
1097
- },
1098
- children: "New Workspace"
1099
- }
1100
- )
1101
- }
1102
- )
1103
- ] })
1104
- }
1105
- );
1106
- };
1107
-
1108
- // src/components/navigation/Stepper.tsx
1109
- import {
1110
- Stepper as MuiStepper,
1111
- Step as MuiStep,
1112
- StepLabel as MuiStepLabel,
1113
- StepContent as MuiStepContent,
1114
- StepButton as MuiStepButton
1115
- } from "@mui/material";
1116
- import { jsx as jsx7 } from "react/jsx-runtime";
1117
- var Stepper = (props) => {
1118
- return /* @__PURE__ */ jsx7(MuiStepper, { ...props });
1119
- };
1120
- var Step = (props) => {
1121
- return /* @__PURE__ */ jsx7(MuiStep, { ...props });
1122
- };
1123
- var StepLabel = (props) => {
1124
- return /* @__PURE__ */ jsx7(MuiStepLabel, { ...props });
1125
- };
1126
- var StepContent = (props) => {
1127
- return /* @__PURE__ */ jsx7(MuiStepContent, { ...props });
1128
- };
1129
- var StepButton = (props) => {
1130
- return /* @__PURE__ */ jsx7(MuiStepButton, { ...props });
1131
- };
1132
-
1133
- // src/components/navigation/NumberedStepper.tsx
1134
- import React3 from "react";
1135
- import { styled as styled4 } from "@mui/material/styles";
1136
- import { jsx as jsx8, jsxs as jsxs6 } from "react/jsx-runtime";
1137
- var Root = styled4("ol")({
1138
- listStyle: "none",
1139
- padding: 0,
1140
- margin: 0,
1141
- display: "flex",
1142
- flexDirection: "column",
1143
- gap: 8
1144
- });
1145
- var Row = styled4("li")({
1146
- display: "flex",
1147
- gap: 10,
1148
- alignItems: "center"
1149
- });
1150
- var Num = styled4("span", {
1151
- shouldForwardProp: (p) => p !== "state"
1152
- })(({ state }) => ({
1153
- width: 24,
1154
- height: 24,
1155
- flexShrink: 0,
1156
- borderRadius: "50%",
1157
- display: "flex",
1158
- alignItems: "center",
1159
- justifyContent: "center",
1160
- fontSize: 12,
1161
- fontWeight: 600,
1162
- border: `1px solid ${webSurfaceTokens.strokeOnMed}`,
1163
- background: webSurfaceTokens.surfaceContrast,
1164
- color: webSurfaceTokens.textSecondary,
1165
- ...state === "active" && {
1166
- background: webSurfaceTokens.cVioletLight,
1167
- borderColor: webSurfaceTokens.cViolet,
1168
- color: webSurfaceTokens.cVioletDark
1169
- },
1170
- ...state === "done" && {
1171
- background: webSurfaceTokens.cViolet,
1172
- borderColor: webSurfaceTokens.cViolet,
1173
- color: "white"
1174
- }
1175
- }));
1176
- var Label = styled4("span", {
1177
- shouldForwardProp: (p) => p !== "active"
1178
- })(({ active }) => ({
1179
- fontSize: 13,
1180
- color: active ? webSurfaceTokens.textPrimary : webSurfaceTokens.textSecondary,
1181
- fontWeight: active ? 500 : 400
1182
- }));
1183
- var NumberedStepper = React3.forwardRef(
1184
- function NumberedStepper2({ steps, current, className }, ref) {
1185
- return /* @__PURE__ */ jsx8(Root, { ref, className, children: steps.map((s, i) => {
1186
- const state = i < current ? "done" : i === current ? "active" : "pending";
1187
- return /* @__PURE__ */ jsxs6(Row, { ...state === "active" ? { "aria-current": "step" } : {}, children: [
1188
- /* @__PURE__ */ jsx8(Num, { state, children: state === "done" ? "\u2713" : i + 1 }),
1189
- /* @__PURE__ */ jsx8(Label, { active: state === "active", children: s.label })
1190
- ] }, s.key);
1191
- }) });
1192
- }
1193
- );
1194
-
1195
- // src/components/navigation/SideNav/SideNav.tsx
1196
- import React4, { useState as useState3, useCallback as useCallback4 } from "react";
1197
- import { Box as Box4 } from "@mui/material";
1198
- import { styled as styled5 } from "@mui/material/styles";
1199
-
1200
- // src/components/navigation/SideNav/styles.ts
1201
- var scrollbarStyles = {
1202
- "&::-webkit-scrollbar": {
1203
- width: "8px"
1204
- },
1205
- "&::-webkit-scrollbar-track": {
1206
- backgroundColor: "transparent"
1207
- },
1208
- "&::-webkit-scrollbar-thumb": {
1209
- backgroundColor: "rgba(0, 0, 0, 0.2)",
1210
- borderRadius: "4px",
1211
- "&:hover": {
1212
- backgroundColor: "rgba(0, 0, 0, 0.3)"
1213
- }
1214
- }
1215
- };
1216
-
1217
- // src/components/navigation/SideNav/SideNav.tsx
1218
- import { jsx as jsx9 } from "react/jsx-runtime";
1219
- var SideNavContext = React4.createContext({
1220
- collapsed: false,
1221
- showTooltips: true
1222
- });
1223
- var SideNavContainer = styled5(Box4, {
1224
- shouldForwardProp: (prop) => !["navWidth", "navPosition", "showBorder", "backgroundColor", "isCollapsed", "collapsedWidth", "transitionDuration"].includes(prop)
1225
- })(({ theme, navWidth = 280, navPosition = "left", showBorder = true, backgroundColor, isCollapsed = false, collapsedWidth = 68, transitionDuration = 300 }) => ({
1226
- width: isCollapsed ? collapsedWidth : navWidth,
1227
- height: "100%",
1228
- display: "flex",
1229
- flexDirection: "column",
1230
- backgroundColor: backgroundColor || theme.palette.background.paper,
1231
- overflow: "hidden",
1232
- transition: `width ${transitionDuration}ms ${theme.transitions.easing.easeInOut}`,
1233
- // Disable transition for reduced motion preference
1234
- "@media (prefers-reduced-motion: reduce)": {
1235
- transition: "none"
1236
- },
1237
- // Border on the appropriate side
1238
- ...showBorder && {
1239
- borderRight: navPosition === "left" ? `1px solid ${theme.palette.divider}` : "none",
1240
- borderLeft: navPosition === "right" ? `1px solid ${theme.palette.divider}` : "none"
1241
- }
1242
- }));
1243
- var HeaderSection = styled5(Box4)(({ theme }) => ({
1244
- flexShrink: 0,
1245
- backgroundColor: theme.palette.background.paper
1246
- }));
1247
- var NavigationSection = styled5(Box4)(() => ({
1248
- flexGrow: 1,
1249
- overflowY: "auto",
1250
- overflowX: "hidden",
1251
- ...scrollbarStyles
1252
- }));
1253
- var FooterSection = styled5(Box4)(({ theme }) => ({
1254
- flexShrink: 0,
1255
- backgroundColor: theme.palette.background.paper
1256
- }));
1257
- var Header = React4.memo(({ children, className }) => {
1258
- const { collapsed, onToggleCollapse } = React4.useContext(SideNavContext);
1259
- const enhancedChildren = React4.Children.map(children, (child) => {
1260
- if (React4.isValidElement(child)) {
1261
- return React4.cloneElement(child, {
1262
- collapsed,
1263
- onCollapse: onToggleCollapse
1264
- });
1265
- }
1266
- return child;
1267
- });
1268
- return /* @__PURE__ */ jsx9(HeaderSection, { className, "data-testid": "sidenav-header", children: enhancedChildren });
1269
- });
1270
- Header.displayName = "SideNav.Header";
1271
- var Navigation = React4.memo(({ children, className }) => {
1272
- const { collapsed, showTooltips } = React4.useContext(SideNavContext);
1273
- const enhancedChildren = React4.Children.map(children, (child) => {
1274
- if (React4.isValidElement(child)) {
1275
- return React4.cloneElement(child, {
1276
- collapsed,
1277
- showTooltips
1278
- });
1279
- }
1280
- return child;
1281
- });
1282
- return /* @__PURE__ */ jsx9(NavigationSection, { className, "data-testid": "sidenav-navigation", children: enhancedChildren });
1283
- });
1284
- Navigation.displayName = "SideNav.Navigation";
1285
- var Footer = React4.memo(({ children, className }) => {
1286
- const { collapsed } = React4.useContext(SideNavContext);
1287
- const enhancedChildren = React4.Children.map(children, (child) => {
1288
- if (React4.isValidElement(child)) {
1289
- return React4.cloneElement(child, {
1290
- compact: collapsed
1291
- });
1292
- }
1293
- return child;
1294
- });
1295
- return /* @__PURE__ */ jsx9(FooterSection, { className, "data-testid": "sidenav-footer", children: enhancedChildren });
1296
- });
1297
- Footer.displayName = "SideNav.Footer";
1298
- var SideNav = Object.assign(
1299
- React4.memo(({
1300
- width = 280,
1301
- collapsedWidth = 68,
1302
- collapsed: controlledCollapsed,
1303
- defaultCollapsed = false,
1304
- onCollapseChange,
1305
- transitionDuration = 300,
1306
- showTooltips = true,
1307
- position = "left",
1308
- showBorder = true,
1309
- backgroundColor,
1310
- children,
1311
- className,
1312
- ariaLabel = "Main navigation"
1313
- }) => {
1314
- const [internalCollapsed, setInternalCollapsed] = useState3(defaultCollapsed);
1315
- const isControlled = controlledCollapsed !== void 0;
1316
- const collapsed = isControlled ? controlledCollapsed : internalCollapsed;
1317
- const handleToggleCollapse = useCallback4(() => {
1318
- const newCollapsed = !collapsed;
1319
- if (!isControlled) {
1320
- setInternalCollapsed(newCollapsed);
1321
- }
1322
- if (onCollapseChange) {
1323
- onCollapseChange(newCollapsed);
1324
- }
1325
- }, [collapsed, isControlled, onCollapseChange]);
1326
- const contextValue = {
1327
- collapsed,
1328
- showTooltips,
1329
- onToggleCollapse: handleToggleCollapse
1330
- };
1331
- return /* @__PURE__ */ jsx9(SideNavContext.Provider, { value: contextValue, children: /* @__PURE__ */ jsx9(
1332
- SideNavContainer,
1333
- {
1334
- role: "navigation",
1335
- "aria-label": ariaLabel,
1336
- navWidth: width,
1337
- collapsedWidth,
1338
- isCollapsed: collapsed,
1339
- transitionDuration,
1340
- navPosition: position,
1341
- showBorder,
1342
- backgroundColor,
1343
- className,
1344
- children
1345
- }
1346
- ) });
1347
- }),
1348
- {
1349
- Header,
1350
- Navigation,
1351
- Footer
1352
- }
1353
- );
1354
- SideNav.displayName = "SideNav";
1355
-
1356
- // src/components/navigation/SideNav/SideNavHeader.tsx
1357
- import React5 from "react";
1358
- import { Box as Box5, Typography as Typography4, IconButton as IconButton4, Tooltip as Tooltip2, ButtonBase } from "@mui/material";
1359
- import { styled as styled6 } from "@mui/material/styles";
1360
- import ChevronLeftIcon from "@mui/icons-material/ChevronLeft";
1361
- import ChevronRightIcon from "@mui/icons-material/ChevronRight";
1362
- import { Fragment as Fragment4, jsx as jsx10, jsxs as jsxs7 } from "react/jsx-runtime";
1363
- var HeaderContainer = styled6(Box5, {
1364
- shouldForwardProp: (prop) => prop !== "isCollapsed"
1365
- })(({ theme, isCollapsed }) => ({
1366
- display: "flex",
1367
- flexDirection: isCollapsed ? "column" : "row",
1368
- alignItems: "center",
1369
- justifyContent: isCollapsed ? "center" : "flex-start",
1370
- gap: isCollapsed ? theme.spacing(1) : theme.spacing(1.5),
1371
- padding: theme.spacing(2),
1372
- borderBottom: `1px solid ${theme.palette.divider}`,
1373
- transition: theme.transitions.create(["gap", "justify-content", "flex-direction"], {
1374
- duration: theme.transitions.duration.shorter
1375
- })
1376
- }));
1377
- var BrandingButton = styled6(ButtonBase)(({ theme }) => ({
1378
- display: "flex",
1379
- alignItems: "center",
1380
- gap: theme.spacing(1.5),
1381
- minWidth: 0,
1382
- padding: 0,
1383
- borderRadius: theme.shape.borderRadius,
1384
- // Subtle hover feedback only when clickable
1385
- "&:hover": {
1386
- opacity: 0.8
1387
- },
1388
- "&:focus-visible": {
1389
- outline: `2px solid ${theme.palette.primary.main}`,
1390
- outlineOffset: 2
1391
- }
1392
- }));
1393
- var SideNavHeader = React5.memo(({
1394
- logo,
1395
- title,
1396
- showCollapseButton = true,
1397
- onCollapse,
1398
- onLogoClick,
1399
- ariaLabel,
1400
- collapsed = false
1401
- }) => {
1402
- const headerAriaLabel = ariaLabel || `${title} navigation header`;
1403
- const brandingContent = /* @__PURE__ */ jsxs7(Fragment4, { children: [
1404
- logo && /* @__PURE__ */ jsx10(
1405
- Box5,
1406
- {
1407
- sx: {
1408
- display: "flex",
1409
- alignItems: "center",
1410
- justifyContent: "center",
1411
- flexShrink: 0
1412
- },
1413
- children: logo
1414
- }
1415
- ),
1416
- !collapsed && /* @__PURE__ */ jsx10(
1417
- Typography4,
1418
- {
1419
- variant: "subtitle1",
1420
- sx: {
1421
- fontWeight: 700,
1422
- overflow: "hidden",
1423
- textOverflow: "ellipsis",
1424
- whiteSpace: "nowrap",
1425
- minWidth: 0
1426
- },
1427
- children: title
1428
- }
1429
- )
1430
- ] });
1431
- return /* @__PURE__ */ jsxs7(
1432
- HeaderContainer,
1433
- {
1434
- "data-testid": "sidenav-header-content",
1435
- "aria-label": headerAriaLabel,
1436
- isCollapsed: collapsed,
1437
- children: [
1438
- onLogoClick ? /* @__PURE__ */ jsx10(
1439
- BrandingButton,
1440
- {
1441
- onClick: onLogoClick,
1442
- "aria-label": `Go to ${title} home`,
1443
- "data-testid": "sidenav-home-link",
1444
- children: brandingContent
1445
- }
1446
- ) : /* @__PURE__ */ jsx10(
1447
- Box5,
1448
- {
1449
- sx: {
1450
- display: "flex",
1451
- alignItems: "center",
1452
- gap: 1.5,
1453
- minWidth: 0
1454
- },
1455
- children: brandingContent
1456
- }
1457
- ),
1458
- showCollapseButton && /* @__PURE__ */ jsx10(
1459
- Tooltip2,
1460
- {
1461
- title: collapsed ? "Expand navigation" : "Collapse navigation",
1462
- placement: "right",
1463
- arrow: true,
1464
- children: /* @__PURE__ */ jsx10(
1465
- IconButton4,
1466
- {
1467
- onClick: onCollapse,
1468
- "aria-label": collapsed ? "Expand navigation" : "Collapse navigation",
1469
- "aria-expanded": !collapsed,
1470
- size: "small",
1471
- sx: {
1472
- flexShrink: 0,
1473
- marginLeft: collapsed ? 0 : "auto",
1474
- color: "text.secondary",
1475
- "&:hover": {
1476
- backgroundColor: "action.hover",
1477
- color: "text.primary"
1478
- }
1479
- },
1480
- children: collapsed ? /* @__PURE__ */ jsx10(ChevronRightIcon, {}) : /* @__PURE__ */ jsx10(ChevronLeftIcon, {})
1481
- }
1482
- )
1483
- }
1484
- )
1485
- ]
1486
- }
1487
- );
1488
- });
1489
- SideNavHeader.displayName = "SideNavHeader";
1490
-
1491
- // src/components/navigation/SideNav/NavigationList.tsx
1492
- import React7, { useState as useState4 } from "react";
1493
- import { List as List4, ListItem as ListItem3 } from "@mui/material";
1494
-
1495
- // src/components/navigation/SideNav/NavigationItem.tsx
1496
- import React6 from "react";
1497
- import {
1498
- ListItemButton as ListItemButton2,
1499
- ListItemIcon as ListItemIcon2,
1500
- ListItemText as ListItemText4,
1501
- Box as Box6,
1502
- Tooltip as Tooltip3
1503
- } from "@mui/material";
1504
- import { styled as styled7 } from "@mui/material/styles";
1505
- import { jsx as jsx11, jsxs as jsxs8 } from "react/jsx-runtime";
1506
- var StyledListItemButton2 = styled7(ListItemButton2, {
1507
- shouldForwardProp: (prop) => !["selected", "size", "iconPosition", "isCollapsed"].includes(prop)
1508
- })(({ theme, selected, size, isCollapsed }) => {
1509
- const heights = {
1510
- small: 40,
1511
- medium: 48,
1512
- large: 56
1513
- };
1514
- return {
1515
- minHeight: heights[size] || heights.medium,
1516
- padding: theme.spacing(1, 1.5),
1517
- // 8px 12px
1518
- margin: theme.spacing(0.5, 1),
1519
- // 4px 8px
1520
- borderRadius: theme.shape.borderRadius,
1521
- gap: isCollapsed ? 0 : theme.spacing(1),
1522
- // No gap in collapsed mode
1523
- justifyContent: isCollapsed ? "center" : "flex-start",
1524
- transition: theme.transitions.create(
1525
- ["background-color", "color", "justify-content"],
1526
- { duration: theme.transitions.duration.shortest }
1527
- ),
1528
- // Default state
1529
- color: theme.palette.text.primary,
1530
- backgroundColor: "transparent",
1531
- "& .MuiListItemIcon-root": {
1532
- minWidth: "auto",
1533
- color: theme.palette.text.secondary
1534
- },
1535
- // Hover state
1536
- "&:hover": {
1537
- backgroundColor: theme.palette.action.hover,
1538
- "& .MuiListItemIcon-root": {
1539
- color: theme.palette.text.primary
1540
- }
1541
- },
1542
- // Selected state
1543
- ...selected && {
1544
- color: theme.palette.primary.main,
1545
- backgroundColor: theme.palette.action.selected,
1546
- "& .MuiListItemIcon-root": {
1547
- minWidth: "auto",
1548
- color: theme.palette.primary.main
1549
- },
1550
- "&:hover": {
1551
- backgroundColor: theme.palette.action.selected,
1552
- "& .MuiListItemIcon-root": {
1553
- color: theme.palette.primary.main
1554
- }
1555
- }
1556
- },
1557
- // Disabled state
1558
- "&.Mui-disabled": {
1559
- opacity: 1,
1560
- color: theme.palette.text.disabled,
1561
- "& .MuiListItemIcon-root": {
1562
- color: theme.palette.action.disabled
1563
- }
1564
- }
1565
- };
1566
- });
1567
- var NavigationItem = React6.memo(
1568
- React6.forwardRef(function NavigationItem2({
1569
- id,
1570
- label,
1571
- icon,
1572
- iconPosition = "left",
1573
- selected = false,
1574
- disabled = false,
1575
- onClick,
1576
- endContent,
1577
- href,
1578
- ariaLabel,
1579
- size = "medium",
1580
- collapsed = false,
1581
- showTooltip = true,
1582
- tooltipPlacement = "right",
1583
- ...rest
1584
- }, ref) {
1585
- const handleClick = () => {
1586
- if (!disabled && onClick) {
1587
- onClick(id);
1588
- }
1589
- };
1590
- const iconElement = icon && /* @__PURE__ */ jsx11(
1591
- ListItemIcon2,
1592
- {
1593
- sx: {
1594
- fontSize: 24,
1595
- width: 24,
1596
- height: 24,
1597
- display: "flex",
1598
- alignItems: "center",
1599
- justifyContent: "center"
1600
- },
1601
- children: icon
1602
- }
1603
- );
1604
- const labelElement = /* @__PURE__ */ jsx11(
1605
- ListItemText4,
1606
- {
1607
- primary: label,
1608
- primaryTypographyProps: {
1609
- sx: {
1610
- fontWeight: 400,
1611
- fontSize: 16,
1612
- lineHeight: 1.5,
1613
- letterSpacing: "0.0168em",
1614
- display: collapsed ? "none" : "block",
1615
- opacity: collapsed ? 0 : 1,
1616
- transition: (theme) => theme.transitions.create(["opacity"], {
1617
- duration: theme.transitions.duration.shorter
1618
- })
1619
- }
1620
- }
1621
- }
1622
- );
1623
- const buttonContent = /* @__PURE__ */ jsxs8(
1624
- StyledListItemButton2,
1625
- {
1626
- ref,
1627
- selected,
1628
- disabled,
1629
- onClick: handleClick,
1630
- ...href && { component: "a", href },
1631
- "aria-label": ariaLabel || label,
1632
- "aria-current": selected ? "page" : void 0,
1633
- "aria-disabled": disabled,
1634
- size,
1635
- isCollapsed: collapsed,
1636
- ...rest,
1637
- children: [
1638
- icon && iconPosition === "left" && iconElement,
1639
- labelElement,
1640
- icon && iconPosition === "right" && iconElement,
1641
- endContent && !collapsed && /* @__PURE__ */ jsx11(
1642
- Box6,
1643
- {
1644
- sx: {
1645
- marginLeft: "auto",
1646
- display: "flex",
1647
- alignItems: "center"
1648
- },
1649
- children: endContent
1650
- }
1651
- )
1652
- ]
1653
- }
1654
- );
1655
- if (collapsed && showTooltip) {
1656
- return /* @__PURE__ */ jsx11(
1657
- Tooltip3,
1658
- {
1659
- title: label,
1660
- placement: tooltipPlacement,
1661
- enterDelay: 200,
1662
- leaveDelay: 0,
1663
- arrow: true,
1664
- children: buttonContent
1665
- }
1666
- );
1667
- }
1668
- return buttonContent;
1669
- })
1670
- );
1671
- NavigationItem.displayName = "NavigationItem";
1672
-
1673
- // src/components/navigation/SideNav/NavigationList.tsx
1674
- import { jsx as jsx12 } from "react/jsx-runtime";
1675
- var NavigationList = React7.memo(({
1676
- items,
1677
- selectedId,
1678
- onSelectionChange,
1679
- maxHeight = "auto",
1680
- ariaLabel = "Navigation menu",
1681
- collapsed = false,
1682
- showTooltips = true
1683
- }) => {
1684
- const [internalSelectedId, setInternalSelectedId] = useState4(
1685
- selectedId
1686
- );
1687
- const isControlled = selectedId !== void 0;
1688
- const currentSelectedId = isControlled ? selectedId : internalSelectedId;
1689
- const handleItemClick = (id) => {
1690
- if (!isControlled) {
1691
- setInternalSelectedId(id);
1692
- }
1693
- if (onSelectionChange) {
1694
- onSelectionChange(id);
1695
- }
1696
- };
1697
- return /* @__PURE__ */ jsx12(
1698
- List4,
1699
- {
1700
- role: "list",
1701
- "aria-label": ariaLabel,
1702
- sx: {
1703
- padding: 0,
1704
- maxHeight,
1705
- overflowY: maxHeight !== "auto" ? "auto" : "visible",
1706
- overflowX: "hidden",
1707
- ...maxHeight !== "auto" ? scrollbarStyles : {}
1708
- },
1709
- children: items.map((item, index) => {
1710
- const isSelected = currentSelectedId === item.id;
1711
- return /* @__PURE__ */ jsx12(
1712
- ListItem3,
1713
- {
1714
- role: "listitem",
1715
- sx: {
1716
- padding: 0,
1717
- display: "block"
1718
- },
1719
- children: /* @__PURE__ */ jsx12(
1720
- NavigationItem,
1721
- {
1722
- ...item,
1723
- selected: isSelected,
1724
- collapsed,
1725
- showTooltip: showTooltips,
1726
- onClick: (id) => {
1727
- if (item.disabled) {
1728
- return;
1729
- }
1730
- if (item.onClick) {
1731
- item.onClick(id);
1732
- }
1733
- handleItemClick(id);
1734
- }
1735
- }
1736
- )
1737
- },
1738
- `${item.id}-${index}`
1739
- );
1740
- })
1741
- }
1742
- );
1743
- });
1744
- NavigationList.displayName = "NavigationList";
1745
-
1746
- // src/components/navigation/SideNav/ConnectionStatus.tsx
1747
- import React8 from "react";
1748
- import { Box as Box7, Typography as Typography5, Tooltip as Tooltip4 } from "@mui/material";
1749
- import { styled as styled8 } from "@mui/material/styles";
1750
- import PowerIcon from "@mui/icons-material/Power";
1751
- import { jsx as jsx13, jsxs as jsxs9 } from "react/jsx-runtime";
1752
- var StatusPill = styled8(Box7, {
1753
- shouldForwardProp: (prop) => !["variant", "interactive"].includes(prop)
1754
- })(({ theme, variant = "info", interactive }) => {
1755
- const variantColors = {
1756
- success: {
1757
- background: theme.palette.success.light + "20",
1758
- text: theme.palette.success.dark
1759
- },
1760
- warning: {
1761
- background: theme.palette.warning.light + "20",
1762
- text: theme.palette.warning.dark
1763
- },
1764
- error: {
1765
- background: theme.palette.error.light + "20",
1766
- text: theme.palette.error.dark
1767
- },
1768
- info: {
1769
- background: theme.palette.grey[100],
1770
- text: theme.palette.text.primary
1771
- }
1772
- };
1773
- const colors = variantColors[variant] || variantColors.info;
1774
- return {
1775
- display: "inline-flex",
1776
- alignItems: "center",
1777
- justifyContent: "center",
1778
- gap: theme.spacing(1),
1779
- padding: theme.spacing(0.75, 1.5),
1780
- // 6px 12px
1781
- borderRadius: 16,
1782
- // Always pill-shaped
1783
- backgroundColor: colors.background,
1784
- cursor: interactive ? "pointer" : "default",
1785
- transition: theme.transitions.create(["background-color", "transform"], {
1786
- duration: theme.transitions.duration.shortest
1787
- }),
1788
- maxWidth: "100%",
1789
- ...interactive && {
1790
- "&:hover": {
1791
- backgroundColor: colors.background + "40",
1792
- // Slightly darker on hover
1793
- transform: "scale(1.02)"
1794
- },
1795
- "&:active": {
1796
- transform: "scale(0.98)"
1797
- }
1798
- },
1799
- "& .status-text": {
1800
- color: colors.text,
1801
- fontWeight: 500,
1802
- fontSize: 14,
1803
- lineHeight: 1.5,
1804
- whiteSpace: "nowrap",
1805
- overflow: "hidden",
1806
- textOverflow: "ellipsis",
1807
- minWidth: 0
1808
- // Allow text to shrink and truncate in flex container
1809
- }
1810
- };
1811
- });
1812
- var ConnectionStatus = React8.memo(({
1813
- status,
1814
- variant = "info",
1815
- icon,
1816
- onClick,
1817
- compact = false,
1818
- compactText
1819
- }) => {
1820
- const interactive = !!onClick;
1821
- const handleClick = () => {
1822
- if (onClick) {
1823
- onClick();
1824
- }
1825
- };
1826
- const statusContent = /* @__PURE__ */ jsxs9(
1827
- StatusPill,
1828
- {
1829
- role: "status",
1830
- "aria-live": "polite",
1831
- "aria-atomic": "true",
1832
- "aria-label": compact ? status : void 0,
1833
- variant,
1834
- interactive,
1835
- onClick: handleClick,
1836
- children: [
1837
- /* @__PURE__ */ jsx13(
1838
- Box7,
1839
- {
1840
- sx: {
1841
- display: "flex",
1842
- alignItems: "center",
1843
- fontSize: 16,
1844
- color: "inherit"
1845
- },
1846
- children: icon || /* @__PURE__ */ jsx13(PowerIcon, { fontSize: "small" })
1847
- }
1848
- ),
1849
- /* @__PURE__ */ jsx13(Typography5, { className: "status-text", variant: "body2", children: compact ? compactText ?? status : status })
1850
- ]
1851
- }
1852
- );
1853
- if (compact) {
1854
- return /* @__PURE__ */ jsx13(
1855
- Box7,
1856
- {
1857
- sx: {
1858
- display: "flex",
1859
- justifyContent: "center",
1860
- padding: 1
1861
- },
1862
- children: /* @__PURE__ */ jsx13(Tooltip4, { title: status, placement: "right", arrow: true, children: statusContent })
1863
- }
1864
- );
1865
- }
1866
- return /* @__PURE__ */ jsx13(
1867
- Box7,
1868
- {
1869
- sx: {
1870
- display: "flex",
1871
- justifyContent: "center",
1872
- padding: 1
1873
- },
1874
- children: statusContent
1875
- }
1876
- );
1877
- });
1878
- ConnectionStatus.displayName = "ConnectionStatus";
1879
-
1880
- // src/components/navigation/SideNav/AccountSection.tsx
1881
- import React9 from "react";
1882
- import { Box as Box8, Avatar as Avatar3, Typography as Typography6, Button as Button5, IconButton as IconButton5, Tooltip as Tooltip5 } from "@mui/material";
1883
- import { styled as styled9 } from "@mui/material/styles";
1884
- import LogoutIcon from "@mui/icons-material/Logout";
1885
- import { jsx as jsx14, jsxs as jsxs10 } from "react/jsx-runtime";
1886
- var AccountContainer = styled9(Box8, {
1887
- shouldForwardProp: (prop) => !["layout", "isCompact"].includes(prop)
1888
- })(({ theme, layout = "horizontal", isCompact }) => ({
1889
- display: "flex",
1890
- flexDirection: isCompact ? "column" : "row",
1891
- alignItems: "center",
1892
- justifyContent: isCompact ? "center" : "flex-start",
1893
- gap: isCompact ? theme.spacing(1) : theme.spacing(1.5),
1894
- padding: theme.spacing(2),
1895
- borderTop: `1px solid ${theme.palette.divider}`,
1896
- transition: theme.transitions.create(["gap", "justify-content"], {
1897
- duration: theme.transitions.duration.shorter
1898
- }),
1899
- ...layout === "vertical" && !isCompact && {
1900
- flexDirection: "column",
1901
- textAlign: "center"
1902
- }
1903
- }));
1904
- var deriveInitials = (name) => {
1905
- if (!name || name.trim() === "") {
1906
- return "?";
1907
- }
1908
- const words = name.trim().split(/\s+/);
1909
- if (words.length === 1) {
1910
- return words[0][0].toUpperCase();
1911
- }
1912
- if (words.length === 2) {
1913
- return (words[0][0] + words[1][0]).toUpperCase();
1914
- }
1915
- return (words[0][0] + words[words.length - 1][0]).toUpperCase();
1916
- };
1917
- var AccountSection = React9.memo(({
1918
- user,
1919
- onLogout,
1920
- showEmail = false,
1921
- layout = "horizontal",
1922
- compact = false
1923
- }) => {
1924
- const initials = user.initials || deriveInitials(user.name);
1925
- const avatarSrc = user.avatarUrl;
1926
- if (compact) {
1927
- return /* @__PURE__ */ jsxs10(AccountContainer, { layout, isCompact: true, "aria-label": "Account section", children: [
1928
- /* @__PURE__ */ jsx14(
1929
- Tooltip5,
1930
- {
1931
- title: `${user.name}${user.email ? ` (${user.email})` : ""}`,
1932
- placement: "right",
1933
- arrow: true,
1934
- children: /* @__PURE__ */ jsx14(
1935
- Avatar3,
1936
- {
1937
- src: avatarSrc,
1938
- alt: user.name,
1939
- sx: {
1940
- width: 40,
1941
- height: 40,
1942
- backgroundColor: "primary.main",
1943
- fontSize: 16,
1944
- fontWeight: 600,
1945
- flexShrink: 0,
1946
- cursor: "default"
1947
- },
1948
- children: initials
1949
- }
1950
- )
1951
- }
1952
- ),
1953
- /* @__PURE__ */ jsx14(Tooltip5, { title: "Logout", placement: "right", arrow: true, children: /* @__PURE__ */ jsx14(
1954
- IconButton5,
1955
- {
1956
- onClick: onLogout,
1957
- "aria-label": "Logout",
1958
- size: "small",
1959
- sx: {
1960
- color: "text.secondary",
1961
- "&:hover": {
1962
- backgroundColor: "action.hover",
1963
- color: "text.primary"
1964
- }
1965
- },
1966
- children: /* @__PURE__ */ jsx14(LogoutIcon, { fontSize: "small" })
1967
- }
1968
- ) })
1969
- ] });
1970
- }
1971
- return /* @__PURE__ */ jsxs10(AccountContainer, { layout, isCompact: false, "aria-label": "Account section", children: [
1972
- /* @__PURE__ */ jsx14(
1973
- Avatar3,
1974
- {
1975
- src: avatarSrc,
1976
- alt: user.name,
1977
- sx: {
1978
- width: 40,
1979
- height: 40,
1980
- backgroundColor: "primary.main",
1981
- fontSize: 16,
1982
- fontWeight: 600,
1983
- flexShrink: 0
1984
- },
1985
- children: initials
1986
- }
1987
- ),
1988
- /* @__PURE__ */ jsxs10(
1989
- Box8,
1990
- {
1991
- sx: {
1992
- display: "flex",
1993
- flexDirection: "column",
1994
- gap: 0.5,
1995
- flexGrow: 1,
1996
- minWidth: 0
1997
- // Allow text truncation
1998
- },
1999
- children: [
2000
- /* @__PURE__ */ jsx14(
2001
- Typography6,
2002
- {
2003
- variant: "body2",
2004
- sx: {
2005
- fontWeight: 600,
2006
- lineHeight: 1.5,
2007
- overflow: "hidden",
2008
- textOverflow: "ellipsis",
2009
- whiteSpace: "nowrap"
2010
- },
2011
- children: user.name
2012
- }
2013
- ),
2014
- showEmail && user.email && /* @__PURE__ */ jsx14(
2015
- Typography6,
2016
- {
2017
- variant: "caption",
2018
- sx: {
2019
- color: "text.secondary",
2020
- lineHeight: 1.5,
2021
- overflow: "hidden",
2022
- textOverflow: "ellipsis",
2023
- whiteSpace: "nowrap",
2024
- display: "block"
2025
- },
2026
- children: user.email
2027
- }
2028
- ),
2029
- /* @__PURE__ */ jsx14(
2030
- Button5,
2031
- {
2032
- onClick: onLogout,
2033
- "aria-label": "Logout",
2034
- startIcon: /* @__PURE__ */ jsx14(LogoutIcon, { fontSize: "small" }),
2035
- sx: {
2036
- color: "text.secondary",
2037
- textTransform: "none",
2038
- fontSize: "14px",
2039
- fontWeight: 400,
2040
- padding: "4px 8px",
2041
- justifyContent: "flex-start",
2042
- alignSelf: "flex-start",
2043
- minWidth: "auto",
2044
- "&:hover": {
2045
- backgroundColor: "action.hover",
2046
- color: "text.primary"
2047
- }
2048
- },
2049
- children: "Logout"
2050
- }
2051
- )
2052
- ]
2053
- }
2054
- )
2055
- ] });
2056
- });
2057
- AccountSection.displayName = "AccountSection";
2058
-
2059
- // src/components/navigation/Tab.tsx
2060
- import MuiTab from "@mui/material/Tab";
2061
- import { styled as styled10 } from "@mui/material/styles";
2062
- import { jsx as jsx15 } from "react/jsx-runtime";
2063
- var StyledTab = styled10(MuiTab)(({ theme }) => ({
2064
- textTransform: "none",
2065
- minHeight: "48px",
2066
- fontWeight: 400,
2067
- color: theme.palette.text.primary,
2068
- borderBottom: "2px solid transparent",
2069
- "&:hover": {
2070
- color: theme.palette.primary.main
2071
- },
2072
- "&.Mui-selected": {
2073
- fontWeight: 600,
2074
- color: theme.palette.primary.main,
2075
- borderBottom: `2px solid ${theme.palette.primary.main}`
2076
- }
2077
- }));
2078
- var Tab = ({
2079
- badge,
2080
- badgeVariant = "primary",
2081
- label,
2082
- ...props
2083
- }) => {
2084
- const tabLabel = badge !== void 0 ? /* @__PURE__ */ jsx15(Badge, { variant: badgeVariant, badgeContent: badge, children: label }) : label;
2085
- return /* @__PURE__ */ jsx15(StyledTab, { label: tabLabel, ...props });
2086
- };
2087
-
2088
- // src/components/navigation/Menu.tsx
2089
- import React10 from "react";
2090
- import {
2091
- Menu as MuiMenu,
2092
- MenuItem as MuiMenuItem,
2093
- ListItemIcon as ListItemIcon3,
2094
- ListItemText as ListItemText5,
2095
- Divider
2096
- } from "@mui/material";
2097
- import { styled as styled11 } from "@mui/material/styles";
2098
- import { Fragment as Fragment5, jsx as jsx16, jsxs as jsxs11 } from "react/jsx-runtime";
2099
- var StyledMenu = styled11(MuiMenu)(({ theme }) => ({
2100
- "& .MuiPaper-root": {
2101
- borderRadius: 8,
2102
- boxShadow: "0px 4px 12px rgba(0, 0, 0, 0.15)",
2103
- minWidth: 200
2104
- },
2105
- "& .MuiMenuItem-root": {
2106
- padding: "8px 16px",
2107
- "&:hover": {
2108
- backgroundColor: theme.palette.background.selected
2109
- }
2110
- }
2111
- }));
2112
- var Menu3 = React10.forwardRef(function Menu4({ anchorEl, onClose, children, ...props }, ref) {
2113
- return /* @__PURE__ */ jsx16(
2114
- StyledMenu,
2115
- {
2116
- ref,
2117
- anchorEl,
2118
- open: Boolean(anchorEl),
2119
- onClose,
2120
- anchorOrigin: {
2121
- vertical: "bottom",
2122
- horizontal: "left"
2123
- },
2124
- transformOrigin: {
2125
- vertical: "top",
2126
- horizontal: "left"
2127
- },
2128
- ...props,
2129
- children
2130
- }
2131
- );
2132
- });
2133
- var MenuItem = React10.forwardRef(function MenuItem2({ icon, label, onClick, disabled = false, divider = false }, ref) {
2134
- return /* @__PURE__ */ jsxs11(Fragment5, { children: [
2135
- /* @__PURE__ */ jsxs11(MuiMenuItem, { ref, onClick, disabled, children: [
2136
- icon && /* @__PURE__ */ jsx16(ListItemIcon3, { children: icon }),
2137
- /* @__PURE__ */ jsx16(ListItemText5, { children: label })
2138
- ] }),
2139
- divider && /* @__PURE__ */ jsx16(Divider, {})
2140
- ] });
2141
- });
2142
-
2143
- // src/components/navigation/Pagination.tsx
2144
- import MuiPagination from "@mui/material/Pagination";
2145
- import { styled as styled12 } from "@mui/material/styles";
2146
- import { jsx as jsx17 } from "react/jsx-runtime";
2147
- var StyledPagination = styled12(MuiPagination)(({ theme }) => ({
2148
- "& .MuiPaginationItem-root": {
2149
- "&.Mui-selected": {
2150
- backgroundColor: theme.palette.primary.main,
2151
- color: theme.palette.primary.contrastText,
2152
- "&:hover": {
2153
- backgroundColor: theme.palette.primary.light
2154
- }
2155
- },
2156
- "&:hover": {
2157
- backgroundColor: theme.palette.background.selected
2158
- }
2159
- }
2160
- }));
2161
- var Pagination = ({ color = "primary", ...props }) => {
2162
- return /* @__PURE__ */ jsx17(StyledPagination, { color, ...props });
2163
- };
2164
-
2165
- // src/components/navigation/Selector.tsx
2166
- import { useState as useState5 } from "react";
2167
- import {
2168
- Box as Box9,
2169
- Typography as Typography7,
2170
- Avatar as Avatar4,
2171
- Menu as Menu5,
2172
- InputAdornment as InputAdornment3,
2173
- List as List5,
2174
- ListItemButton as ListItemButton3,
2175
- ListItemAvatar as ListItemAvatar3,
2176
- ListItemText as ListItemText6,
2177
- CircularProgress
2178
- } from "@mui/material";
2179
- import KeyboardArrowDownIcon3 from "@mui/icons-material/KeyboardArrowDown";
2180
- import SearchIcon3 from "@mui/icons-material/Search";
2181
- import AddIcon3 from "@mui/icons-material/Add";
2182
- import { useTheme } from "@mui/material/styles";
2183
- import { Fragment as Fragment6, jsx as jsx18, jsxs as jsxs12 } from "react/jsx-runtime";
2184
- var Selector = ({
2185
- options,
2186
- selectedId,
2187
- onSelect,
2188
- onCreate,
2189
- loading = false,
2190
- placeholder = "Select...",
2191
- emptyMessage = "No items found",
2192
- compact = false,
2193
- renderSelected,
2194
- width = 350
2195
- }) => {
2196
- const theme = useTheme();
2197
- const [anchorEl, setAnchorEl] = useState5(null);
2198
- const [searchTerm, setSearchTerm] = useState5("");
2199
- const open = Boolean(anchorEl);
2200
- const selectedOption = options.find((opt) => opt.id === selectedId);
2201
- const filteredOptions = options.filter(
2202
- (opt) => opt.name.toLowerCase().includes(searchTerm.toLowerCase())
2203
- );
2204
- const handleOpen = (event) => {
2205
- event.stopPropagation();
2206
- setAnchorEl(event.currentTarget);
2207
- };
2208
- const handleClose = () => {
2209
- setAnchorEl(null);
2210
- setSearchTerm("");
2211
- };
2212
- const handleSelect = (id) => {
2213
- onSelect(id);
2214
- handleClose();
2215
- };
2216
- const defaultRenderSelected = (option) => /* @__PURE__ */ jsxs12(Box9, { sx: { display: "flex", alignItems: "center", gap: 1 }, children: [
2217
- option.avatar ? /* @__PURE__ */ jsx18(Avatar4, { src: option.avatar, sx: { width: 20, height: 20 } }) : option.icon ? option.icon : /* @__PURE__ */ jsx18(Avatar4, { sx: { width: 20, height: 20, bgcolor: theme.palette.primary.main, fontSize: "0.7rem" }, children: option.name.charAt(0) }),
2218
- /* @__PURE__ */ jsx18(Typography7, { variant: "body2", children: option.name })
2219
- ] });
2220
- if (compact) {
2221
- return /* @__PURE__ */ jsxs12(Fragment6, { children: [
2222
- /* @__PURE__ */ jsx18(IconButton, { onClick: handleOpen, size: "small", children: selectedOption ? selectedOption.avatar ? /* @__PURE__ */ jsx18(Avatar4, { src: selectedOption.avatar, sx: { width: 32, height: 32 } }) : /* @__PURE__ */ jsx18(Avatar4, { sx: { width: 32, height: 32, bgcolor: theme.palette.primary.main }, children: selectedOption.name.charAt(0) }) : /* @__PURE__ */ jsx18(Avatar4, { sx: { width: 32, height: 32, bgcolor: theme.palette.grey[400] }, children: "?" }) }),
2223
- /* @__PURE__ */ jsx18(
2224
- Menu5,
2225
- {
2226
- anchorEl,
2227
- open,
2228
- onClose: handleClose,
2229
- PaperProps: {
2230
- sx: { width, maxHeight: 600, mt: 1 }
2231
- },
2232
- children: loading ? /* @__PURE__ */ jsx18(Box9, { sx: { display: "flex", justifyContent: "center", p: 2 }, children: /* @__PURE__ */ jsx18(CircularProgress, { size: 24 }) }) : /* @__PURE__ */ jsxs12(Fragment6, { children: [
2233
- options.length > 5 && /* @__PURE__ */ jsx18(Box9, { sx: { p: 1, borderBottom: `1px solid ${theme.palette.grey[200]}` }, children: /* @__PURE__ */ jsx18(
2234
- TextField,
2235
- {
2236
- size: "small",
2237
- fullWidth: true,
2238
- placeholder: "Search...",
2239
- value: searchTerm,
2240
- onChange: (e) => setSearchTerm(e.target.value),
2241
- InputProps: {
2242
- startAdornment: /* @__PURE__ */ jsx18(InputAdornment3, { position: "start", children: /* @__PURE__ */ jsx18(SearchIcon3, { fontSize: "small" }) })
2243
- }
2244
- }
2245
- ) }),
2246
- /* @__PURE__ */ jsxs12(List5, { sx: { maxHeight: 400, overflow: "auto" }, children: [
2247
- filteredOptions.map((option) => /* @__PURE__ */ jsxs12(
2248
- ListItemButton3,
2249
- {
2250
- selected: option.id === selectedId,
2251
- onClick: () => handleSelect(option.id),
2252
- disabled: option.disabled,
2253
- children: [
2254
- option.avatar ? /* @__PURE__ */ jsx18(ListItemAvatar3, { children: /* @__PURE__ */ jsx18(Avatar4, { src: option.avatar }) }) : option.icon ? /* @__PURE__ */ jsx18(ListItemAvatar3, { children: option.icon }) : /* @__PURE__ */ jsx18(ListItemAvatar3, { children: /* @__PURE__ */ jsx18(Avatar4, { sx: { bgcolor: theme.palette.primary.main }, children: option.name.charAt(0) }) }),
2255
- /* @__PURE__ */ jsx18(ListItemText6, { primary: option.name, secondary: option.description })
2256
- ]
2257
- },
2258
- option.id
2259
- )),
2260
- filteredOptions.length === 0 && /* @__PURE__ */ jsx18(Box9, { sx: { p: 2, textAlign: "center" }, children: /* @__PURE__ */ jsx18(Typography7, { variant: "body2", color: "text.secondary", children: emptyMessage }) })
2261
- ] }),
2262
- onCreate && /* @__PURE__ */ jsx18(Box9, { sx: { p: 1, borderTop: `1px solid ${theme.palette.grey[200]}` }, children: /* @__PURE__ */ jsx18(
2263
- Button,
2264
- {
2265
- fullWidth: true,
2266
- startIcon: /* @__PURE__ */ jsx18(AddIcon3, {}),
2267
- onClick: () => {
2268
- onCreate();
2269
- handleClose();
2270
- },
2271
- children: "Create New"
2272
- }
2273
- ) })
2274
- ] })
2275
- }
2276
- )
2277
- ] });
2278
- }
2279
- return /* @__PURE__ */ jsxs12(Fragment6, { children: [
2280
- /* @__PURE__ */ jsxs12(Box9, { sx: { display: "flex", alignItems: "center", gap: 0.5 }, children: [
2281
- selectedOption ? renderSelected ? /* @__PURE__ */ jsx18(Link, { onClick: handleOpen, underline: "hover", children: renderSelected(selectedOption) }) : /* @__PURE__ */ jsx18(Link, { onClick: handleOpen, underline: "hover", children: defaultRenderSelected(selectedOption) }) : /* @__PURE__ */ jsx18(Typography7, { variant: "body2", color: "text.secondary", children: placeholder }),
2282
- /* @__PURE__ */ jsx18(IconButton, { onClick: handleOpen, size: "small", sx: { p: 0.2, ml: 0.5 }, children: /* @__PURE__ */ jsx18(KeyboardArrowDownIcon3, { fontSize: "small" }) })
2283
- ] }),
2284
- /* @__PURE__ */ jsx18(
2285
- Menu5,
2286
- {
2287
- anchorEl,
2288
- open,
2289
- onClose: handleClose,
2290
- PaperProps: {
2291
- sx: { width, maxHeight: 600, mt: 1 }
2292
- },
2293
- children: loading ? /* @__PURE__ */ jsx18(Box9, { sx: { display: "flex", justifyContent: "center", p: 2 }, children: /* @__PURE__ */ jsx18(CircularProgress, { size: 24 }) }) : /* @__PURE__ */ jsxs12(Fragment6, { children: [
2294
- options.length > 5 && /* @__PURE__ */ jsx18(Box9, { sx: { p: 1, borderBottom: `1px solid ${theme.palette.grey[200]}` }, children: /* @__PURE__ */ jsx18(
2295
- TextField,
2296
- {
2297
- size: "small",
2298
- fullWidth: true,
2299
- placeholder: "Search...",
2300
- value: searchTerm,
2301
- onChange: (e) => setSearchTerm(e.target.value),
2302
- InputProps: {
2303
- startAdornment: /* @__PURE__ */ jsx18(InputAdornment3, { position: "start", children: /* @__PURE__ */ jsx18(SearchIcon3, { fontSize: "small" }) })
2304
- }
2305
- }
2306
- ) }),
2307
- /* @__PURE__ */ jsxs12(List5, { sx: { maxHeight: 400, overflow: "auto" }, children: [
2308
- filteredOptions.map((option) => /* @__PURE__ */ jsxs12(
2309
- ListItemButton3,
2310
- {
2311
- selected: option.id === selectedId,
2312
- onClick: () => handleSelect(option.id),
2313
- disabled: option.disabled,
2314
- children: [
2315
- option.avatar ? /* @__PURE__ */ jsx18(ListItemAvatar3, { children: /* @__PURE__ */ jsx18(Avatar4, { src: option.avatar }) }) : option.icon ? /* @__PURE__ */ jsx18(ListItemAvatar3, { children: option.icon }) : /* @__PURE__ */ jsx18(ListItemAvatar3, { children: /* @__PURE__ */ jsx18(Avatar4, { sx: { bgcolor: theme.palette.primary.main }, children: option.name.charAt(0) }) }),
2316
- /* @__PURE__ */ jsx18(ListItemText6, { primary: option.name, secondary: option.description })
2317
- ]
2318
- },
2319
- option.id
2320
- )),
2321
- filteredOptions.length === 0 && /* @__PURE__ */ jsx18(Box9, { sx: { p: 2, textAlign: "center" }, children: /* @__PURE__ */ jsx18(Typography7, { variant: "body2", color: "text.secondary", children: emptyMessage }) })
2322
- ] }),
2323
- onCreate && /* @__PURE__ */ jsx18(Box9, { sx: { p: 1, borderTop: `1px solid ${theme.palette.grey[200]}` }, children: /* @__PURE__ */ jsx18(
2324
- Button,
2325
- {
2326
- fullWidth: true,
2327
- startIcon: /* @__PURE__ */ jsx18(AddIcon3, {}),
2328
- onClick: () => {
2329
- onCreate();
2330
- handleClose();
2331
- },
2332
- children: "Create New"
2333
- }
2334
- ) })
2335
- ] })
2336
- }
2337
- )
2338
- ] });
2339
- };
2340
-
2341
- export {
2342
- DropdownAnchor,
2343
- Dropdown,
2344
- SidebarItem,
2345
- Sidebar,
2346
- ServiceSelectorButton,
2347
- WorkspaceSelectorButton,
2348
- Stepper,
2349
- Step,
2350
- StepLabel,
2351
- StepContent,
2352
- StepButton,
2353
- NumberedStepper,
2354
- SideNav,
2355
- SideNavHeader,
2356
- NavigationItem,
2357
- NavigationList,
2358
- ConnectionStatus,
2359
- AccountSection,
2360
- Tab,
2361
- Menu3 as Menu,
2362
- MenuItem,
2363
- Pagination,
2364
- Selector
2365
- };
2366
- //# sourceMappingURL=chunk-AJBM7IE6.mjs.map