@cere/cere-design-system 0.0.44 → 0.1.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 (154) hide show
  1. package/dist/WorkflowNode-BnxXO6t_.d.mts +46 -0
  2. package/dist/WorkflowNode-BnxXO6t_.d.ts +46 -0
  3. package/dist/buttons.d.mts +114 -0
  4. package/dist/buttons.d.ts +114 -0
  5. package/dist/buttons.js +19 -0
  6. package/dist/buttons.js.map +1 -0
  7. package/dist/buttons.mjs +19 -0
  8. package/dist/buttons.mjs.map +1 -0
  9. package/dist/carousel.d.mts +51 -0
  10. package/dist/carousel.d.ts +51 -0
  11. package/dist/carousel.js +185 -0
  12. package/dist/carousel.js.map +1 -0
  13. package/dist/carousel.mjs +185 -0
  14. package/dist/carousel.mjs.map +1 -0
  15. package/dist/charts.d.mts +209 -0
  16. package/dist/charts.d.ts +209 -0
  17. package/dist/charts.js +20 -0
  18. package/dist/charts.js.map +1 -0
  19. package/dist/charts.mjs +20 -0
  20. package/dist/charts.mjs.map +1 -0
  21. package/dist/chunk-27JEWSWA.mjs +233 -0
  22. package/dist/chunk-27JEWSWA.mjs.map +1 -0
  23. package/dist/chunk-2EBCST6X.js +25 -0
  24. package/dist/chunk-2EBCST6X.js.map +1 -0
  25. package/dist/chunk-3WCMINE5.mjs +490 -0
  26. package/dist/chunk-3WCMINE5.mjs.map +1 -0
  27. package/dist/chunk-463SRKKD.js +111 -0
  28. package/dist/chunk-463SRKKD.js.map +1 -0
  29. package/dist/chunk-5ASG6G6U.mjs +40 -0
  30. package/dist/chunk-5ASG6G6U.mjs.map +1 -0
  31. package/dist/chunk-6EUAU67C.mjs +374 -0
  32. package/dist/chunk-6EUAU67C.mjs.map +1 -0
  33. package/dist/chunk-AIY6222Q.js +11 -0
  34. package/dist/chunk-AIY6222Q.js.map +1 -0
  35. package/dist/chunk-AJBM7IE6.mjs +2366 -0
  36. package/dist/chunk-AJBM7IE6.mjs.map +1 -0
  37. package/dist/chunk-ATIFLPH6.mjs +278 -0
  38. package/dist/chunk-ATIFLPH6.mjs.map +1 -0
  39. package/dist/chunk-BIZK6FUD.js +37 -0
  40. package/dist/chunk-BIZK6FUD.js.map +1 -0
  41. package/dist/chunk-CCN6M4LI.js +103 -0
  42. package/dist/chunk-CCN6M4LI.js.map +1 -0
  43. package/dist/chunk-CUCKULYC.mjs +2658 -0
  44. package/dist/chunk-CUCKULYC.mjs.map +1 -0
  45. package/dist/chunk-CWJ4OU6W.mjs +45 -0
  46. package/dist/chunk-CWJ4OU6W.mjs.map +1 -0
  47. package/dist/chunk-EOF3QNPF.js +2366 -0
  48. package/dist/chunk-EOF3QNPF.js.map +1 -0
  49. package/dist/chunk-FFZ5S7PQ.mjs +146 -0
  50. package/dist/chunk-FFZ5S7PQ.mjs.map +1 -0
  51. package/dist/chunk-FN5YL4BK.js +278 -0
  52. package/dist/chunk-FN5YL4BK.js.map +1 -0
  53. package/dist/chunk-HLH2VWXL.js +2658 -0
  54. package/dist/chunk-HLH2VWXL.js.map +1 -0
  55. package/dist/chunk-IE6GCHDI.mjs +530 -0
  56. package/dist/chunk-IE6GCHDI.mjs.map +1 -0
  57. package/dist/chunk-JBHRAAN3.js +31 -0
  58. package/dist/chunk-JBHRAAN3.js.map +1 -0
  59. package/dist/chunk-JS4IB5IU.mjs +162 -0
  60. package/dist/chunk-JS4IB5IU.mjs.map +1 -0
  61. package/dist/chunk-KF2Y7HO3.js +595 -0
  62. package/dist/chunk-KF2Y7HO3.js.map +1 -0
  63. package/dist/chunk-KPDYKK3V.js +162 -0
  64. package/dist/chunk-KPDYKK3V.js.map +1 -0
  65. package/dist/chunk-KVBMZNWT.mjs +103 -0
  66. package/dist/chunk-KVBMZNWT.mjs.map +1 -0
  67. package/dist/chunk-L2TIGA7I.js +530 -0
  68. package/dist/chunk-L2TIGA7I.js.map +1 -0
  69. package/dist/chunk-MNM6HE72.js +146 -0
  70. package/dist/chunk-MNM6HE72.js.map +1 -0
  71. package/dist/chunk-NXTVJ6PY.js +374 -0
  72. package/dist/chunk-NXTVJ6PY.js.map +1 -0
  73. package/dist/chunk-OWWDNDF4.js +40 -0
  74. package/dist/chunk-OWWDNDF4.js.map +1 -0
  75. package/dist/chunk-PHMNZK2R.mjs +18 -0
  76. package/dist/chunk-PHMNZK2R.mjs.map +1 -0
  77. package/dist/chunk-PWF2NJDB.mjs +377 -0
  78. package/dist/chunk-PWF2NJDB.mjs.map +1 -0
  79. package/dist/chunk-QBCRH7YF.mjs +37 -0
  80. package/dist/chunk-QBCRH7YF.mjs.map +1 -0
  81. package/dist/chunk-QD6RLAO2.mjs +11 -0
  82. package/dist/chunk-QD6RLAO2.mjs.map +1 -0
  83. package/dist/chunk-QY65OUAC.mjs +111 -0
  84. package/dist/chunk-QY65OUAC.mjs.map +1 -0
  85. package/dist/chunk-QYYQYZHV.js +45 -0
  86. package/dist/chunk-QYYQYZHV.js.map +1 -0
  87. package/dist/chunk-T7LPABOL.mjs +595 -0
  88. package/dist/chunk-T7LPABOL.mjs.map +1 -0
  89. package/dist/chunk-THQKYTQE.js +490 -0
  90. package/dist/chunk-THQKYTQE.js.map +1 -0
  91. package/dist/chunk-U2QHFISG.js +18 -0
  92. package/dist/chunk-U2QHFISG.js.map +1 -0
  93. package/dist/chunk-UPGFBPFX.mjs +25 -0
  94. package/dist/chunk-UPGFBPFX.mjs.map +1 -0
  95. package/dist/chunk-X7E6GMFL.js +233 -0
  96. package/dist/chunk-X7E6GMFL.js.map +1 -0
  97. package/dist/chunk-XF66WQZE.mjs +1535 -0
  98. package/dist/chunk-XF66WQZE.mjs.map +1 -0
  99. package/dist/chunk-YQOZPLTY.js +1535 -0
  100. package/dist/chunk-YQOZPLTY.js.map +1 -0
  101. package/dist/chunk-ZGCN5WCG.js +377 -0
  102. package/dist/chunk-ZGCN5WCG.js.map +1 -0
  103. package/dist/chunk-ZP26PGMS.mjs +31 -0
  104. package/dist/chunk-ZP26PGMS.mjs.map +1 -0
  105. package/dist/feedback.d.mts +356 -0
  106. package/dist/feedback.d.ts +356 -0
  107. package/dist/feedback.js +43 -0
  108. package/dist/feedback.js.map +1 -0
  109. package/dist/feedback.mjs +43 -0
  110. package/dist/feedback.mjs.map +1 -0
  111. package/dist/icons.d.mts +22 -0
  112. package/dist/icons.d.ts +22 -0
  113. package/dist/icons.js +23 -0
  114. package/dist/icons.js.map +1 -0
  115. package/dist/icons.mjs +23 -0
  116. package/dist/icons.mjs.map +1 -0
  117. package/dist/index.d.mts +171 -3069
  118. package/dist/index.d.ts +171 -3069
  119. package/dist/index.js +320 -10077
  120. package/dist/index.js.map +1 -1
  121. package/dist/index.mjs +262 -9978
  122. package/dist/index.mjs.map +1 -1
  123. package/dist/inputs.d.mts +109 -0
  124. package/dist/inputs.d.ts +109 -0
  125. package/dist/inputs.js +43 -0
  126. package/dist/inputs.js.map +1 -0
  127. package/dist/inputs.mjs +43 -0
  128. package/dist/inputs.mjs.map +1 -0
  129. package/dist/layout.d.mts +927 -0
  130. package/dist/layout.d.ts +927 -0
  131. package/dist/layout.js +122 -0
  132. package/dist/layout.js.map +1 -0
  133. package/dist/layout.mjs +122 -0
  134. package/dist/layout.mjs.map +1 -0
  135. package/dist/navigation.d.mts +716 -0
  136. package/dist/navigation.d.ts +716 -0
  137. package/dist/navigation.js +58 -0
  138. package/dist/navigation.js.map +1 -0
  139. package/dist/navigation.mjs +58 -0
  140. package/dist/navigation.mjs.map +1 -0
  141. package/dist/third-party.d.mts +637 -0
  142. package/dist/third-party.d.ts +637 -0
  143. package/dist/third-party.js +45 -0
  144. package/dist/third-party.js.map +1 -0
  145. package/dist/third-party.mjs +45 -0
  146. package/dist/third-party.mjs.map +1 -0
  147. package/dist/tokens.css +2 -1
  148. package/dist/utilities.d.mts +39 -0
  149. package/dist/utilities.d.ts +39 -0
  150. package/dist/utilities.js +19 -0
  151. package/dist/utilities.js.map +1 -0
  152. package/dist/utilities.mjs +19 -0
  153. package/dist/utilities.mjs.map +1 -0
  154. package/package.json +55 -1
@@ -0,0 +1,2366 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }
2
+
3
+ var _chunkOWWDNDF4js = require('./chunk-OWWDNDF4.js');
4
+
5
+
6
+ var _chunkJBHRAAN3js = require('./chunk-JBHRAAN3.js');
7
+
8
+
9
+ var _chunkU2QHFISGjs = require('./chunk-U2QHFISG.js');
10
+
11
+
12
+ var _chunkMNM6HE72js = require('./chunk-MNM6HE72.js');
13
+
14
+
15
+ var _chunkBIZK6FUDjs = require('./chunk-BIZK6FUD.js');
16
+
17
+
18
+ var _chunkZGCN5WCGjs = require('./chunk-ZGCN5WCG.js');
19
+
20
+ // src/components/navigation/Dropdown/Dropdown.tsx
21
+ var _material = require('@mui/material');
22
+ var _react = require('react'); var _react2 = _interopRequireDefault(_react);
23
+
24
+ // src/components/navigation/Dropdown/DropdownAnchor.tsx
25
+
26
+
27
+ var _iconsmaterial = require('@mui/icons-material');
28
+ var _jsxruntime = require('react/jsx-runtime');
29
+ var Clickable = _material.styled.call(void 0, (0, _material.Button))({
30
+ padding: 0
31
+ });
32
+ var Anchor = _material.styled.call(void 0, (0, _material.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 = _material.styled.call(void 0, "div")(({ theme }) => ({
41
+ [`& .${_material.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 = _material.styled.call(void 0, (0, _material.Typography))(({ theme }) => ({
50
+ fontWeight: theme.typography.fontWeightBold,
51
+ color: theme.palette.text.primary
52
+ }));
53
+ var DropdownAnchor = _react.forwardRef.call(void 0,
54
+ ({ open, label, leftElement, onOpen, variant, ...props }, ref) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0, Clickable, { ref, ...props, color: "inherit", variant: "text", onClick: onOpen, children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, Anchor, { variant, spacing: 1, direction: "row", alignItems: "stretch", children: [
55
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, Left, { children: leftElement }),
56
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, Center, { variant: "body1", children: label }),
57
+ variant !== "header" && (open ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _iconsmaterial.ArrowDropUp, {}) : /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _iconsmaterial.ArrowDropDown, {}))
58
+ ] }) })
59
+ );
60
+ DropdownAnchor.displayName = "DropdownAnchor";
61
+
62
+ // src/components/navigation/Dropdown/Dropdown.tsx
63
+
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__ */ _jsxruntime.jsx.call(void 0, DropdownAnchor, { ref, open: open2, label, leftElement, onOpen, variant })
76
+ }) => {
77
+ const anchorRef = _react.useRef.call(void 0, null);
78
+ const horizontal = direction === "left" ? "right" : "left";
79
+ const onOpen = _react.useCallback.call(void 0, () => _optionalChain([onToggle, 'optionalCall', _ => _(true)]), [onToggle]);
80
+ const padding = dense ? 1 : 2;
81
+ return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, { children: [
82
+ renderAnchor({ ref: anchorRef, onOpen, open }),
83
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
84
+ _material.Popover,
85
+ {
86
+ "aria-label": "Overlay",
87
+ open,
88
+ onClose: () => _optionalChain([onToggle, 'optionalCall', _2 => _2(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
+
119
+
120
+
121
+
122
+
123
+
124
+
125
+ // src/components/navigation/SidebarItem.tsx
126
+
127
+
128
+
129
+
130
+
131
+
132
+
133
+ var StyledListItemButton = _material.styled.call(void 0, _material.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__ */ _jsxruntime.jsxs.call(void 0, StyledListItemButton, { selected, size, onClick, children: [
172
+ icon && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _material.ListItemIcon, { children: icon }),
173
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _material.ListItemText, { primary: label }),
174
+ endIcon && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { style: { marginLeft: "auto" }, children: endIcon }),
175
+ children
176
+ ] });
177
+ };
178
+
179
+ // src/components/navigation/Sidebar.tsx
180
+
181
+ var StyledDrawer = _material.styled.call(void 0, (0, _material.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__ */ _jsxruntime.jsx.call(void 0,
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__ */ _jsxruntime.jsx.call(void 0, _material.Box, { sx: { overflow: "auto", padding: "8px 0" }, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _material.List, { children: items.map((item, index) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0, SidebarItem, { ...item }, index)) }) })
210
+ }
211
+ );
212
+ };
213
+
214
+ // src/components/navigation/ServiceSelector.tsx
215
+
216
+
217
+
218
+
219
+
220
+
221
+
222
+
223
+
224
+
225
+
226
+
227
+
228
+
229
+
230
+
231
+
232
+
233
+ var _KeyboardArrowDown = require('@mui/icons-material/KeyboardArrowDown'); var _KeyboardArrowDown2 = _interopRequireDefault(_KeyboardArrowDown);
234
+ var _Archive = require('@mui/icons-material/Archive'); var _Archive2 = _interopRequireDefault(_Archive);
235
+ var _Unarchive = require('@mui/icons-material/Unarchive'); var _Unarchive2 = _interopRequireDefault(_Unarchive);
236
+ var _Search = require('@mui/icons-material/Search'); var _Search2 = _interopRequireDefault(_Search);
237
+ var _Add = require('@mui/icons-material/Add'); var _Add2 = _interopRequireDefault(_Add);
238
+ var _Check = require('@mui/icons-material/Check'); var _Check2 = _interopRequireDefault(_Check);
239
+ var _Settings = require('@mui/icons-material/Settings'); var _Settings2 = _interopRequireDefault(_Settings);
240
+ var _PersonAddAlt = require('@mui/icons-material/PersonAddAlt'); var _PersonAddAlt2 = _interopRequireDefault(_PersonAddAlt);
241
+
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] = _react.useState.call(void 0, null);
258
+ const [searchTerm, setSearchTerm] = _react.useState.call(void 0, "");
259
+ const [showArchived, setShowArchived] = _react.useState.call(void 0, 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 = _react.useCallback.call(void 0,
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__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, { children: [
299
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _material.Box, { sx: { position: "relative" }, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _material.Tooltip, { title: "Select service", placement: "right", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
300
+ _material.IconButton,
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__ */ _jsxruntime.jsx.call(void 0,
311
+ _material.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__ */ _jsxruntime.jsx.call(void 0,
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__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, { children: [
351
+ /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _material.Box, { sx: { display: "flex", alignItems: "center", ...sx }, children: [
352
+ selectedService ? /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, { children: [
353
+ isManager ? /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
354
+ _material.Link,
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__ */ _jsxruntime.jsx.call(void 0,
368
+ _material.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__ */ _jsxruntime.jsxs.call(void 0,
384
+ _material.Box,
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__ */ _jsxruntime.jsx.call(void 0,
395
+ _material.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__ */ _jsxruntime.jsx.call(void 0,
412
+ _material.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__ */ _jsxruntime.jsx.call(void 0,
428
+ _material.Typography,
429
+ {
430
+ variant: "body2",
431
+ color: "text.secondary",
432
+ sx: {
433
+ fontSize: "0.875rem"
434
+ },
435
+ children: "Select Service"
436
+ }
437
+ ),
438
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
439
+ _material.IconButton,
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__ */ _jsxruntime.jsx.call(void 0, _KeyboardArrowDown2.default, { fontSize: "small" })
449
+ }
450
+ )
451
+ ] }),
452
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
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] = _react.useState.call(void 0, "");
500
+ const [internalShowArchived, setInternalShowArchived] = _react.useState.call(void 0, 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__ */ _jsxruntime.jsxs.call(void 0,
522
+ _material.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__ */ _jsxruntime.jsxs.call(void 0,
547
+ _material.Box,
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__ */ _jsxruntime.jsxs.call(void 0, _material.Box, { sx: {
559
+ display: "flex",
560
+ alignItems: "center",
561
+ mb: 1.5
562
+ }, children: [
563
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
564
+ _material.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__ */ _jsxruntime.jsx.call(void 0, _material.Box, { sx: { flex: 1 }, children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _material.Box, { sx: { display: "flex", alignItems: "center", gap: 1 }, children: [
577
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _material.Typography, { variant: "subtitle1", sx: { fontWeight: 600, fontSize: "1rem" }, children: selectedService.name }),
578
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
579
+ _material.Box,
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__ */ _jsxruntime.jsxs.call(void 0, _material.Box, { sx: { display: "flex", gap: 1 }, children: [
598
+ onOpenAddMember && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
599
+ _material.Button,
600
+ {
601
+ startIcon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _PersonAddAlt2.default, {}),
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__ */ _jsxruntime.jsx.call(void 0,
632
+ _material.Button,
633
+ {
634
+ startIcon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _Settings2.default, {}),
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__ */ _jsxruntime.jsxs.call(void 0, _material.Box, { sx: { px: 2, pt: 2, pb: 1.5 }, children: [
669
+ /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _material.Box, { sx: { display: "flex", alignItems: "center", mb: 1.5 }, children: [
670
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
671
+ _material.TextField,
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__ */ _jsxruntime.jsx.call(void 0, _material.InputAdornment, { position: "start", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _Search2.default, { 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__ */ _jsxruntime.jsx.call(void 0, _material.Tooltip, { title: showArchived ? "Show active" : "Show archived", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
690
+ _material.IconButton,
691
+ {
692
+ size: "small",
693
+ onClick: toggleArchived,
694
+ color: showArchived ? "primary" : "default",
695
+ sx: { ml: 1 },
696
+ children: showArchived ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _Unarchive2.default, { fontSize: "small" }) : /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _Archive2.default, { fontSize: "small" })
697
+ }
698
+ ) })
699
+ ] }),
700
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
701
+ _material.Box,
702
+ {
703
+ sx: {
704
+ maxHeight: 400,
705
+ overflow: "auto",
706
+ py: 1
707
+ },
708
+ children: loading ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _material.Box, { sx: { p: 2, textAlign: "center" }, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _material.Typography, { variant: "body2", color: "text.secondary", children: "Loading services..." }) }) : filteredServices.length === 0 ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _material.Box, { sx: { p: 2, textAlign: "center" }, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _material.Typography, { variant: "body2", color: "text.secondary", children: searchTerm ? `No ${showArchived ? "archived " : ""}services matching "${searchTerm}"` : showArchived ? "No archived services found" : "No active services found" }) }) : /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, { children: [
709
+ /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
710
+ _material.Typography,
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__ */ _jsxruntime.jsx.call(void 0,
726
+ _material.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__ */ _jsxruntime.jsx.call(void 0, _material.List, { disablePadding: true, children: filteredServices.map((service) => /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
745
+ _material.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__ */ _jsxruntime.jsx.call(void 0,
759
+ _Check2.default,
760
+ {
761
+ sx: {
762
+ color: "primary.main",
763
+ fontSize: "1.2rem"
764
+ }
765
+ }
766
+ ) : null,
767
+ children: [
768
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _material.ListItemAvatar, { sx: { minWidth: 40 }, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
769
+ _material.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__ */ _jsxruntime.jsx.call(void 0,
782
+ _material.ListItemText,
783
+ {
784
+ primary: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _material.Box, { sx: { display: "flex", alignItems: "center", gap: 0.5 }, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
785
+ _material.Typography,
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__ */ _jsxruntime.jsx.call(void 0,
807
+ _material.Box,
808
+ {
809
+ sx: {
810
+ paddingTop: 2,
811
+ paddingLeft: 2,
812
+ paddingRight: 2,
813
+ borderTop: 1,
814
+ borderColor: "divider"
815
+ },
816
+ children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
817
+ _material.Button,
818
+ {
819
+ fullWidth: true,
820
+ variant: "text",
821
+ startIcon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _Add2.default, {}),
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
+
847
+
848
+
849
+
850
+
851
+
852
+
853
+
854
+
855
+
856
+
857
+
858
+
859
+
860
+
861
+
862
+
863
+
864
+
865
+
866
+
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] = _react.useState.call(void 0, null);
878
+ const handleOpenSelector = (event) => {
879
+ event.stopPropagation();
880
+ setAnchorEl(event.currentTarget);
881
+ };
882
+ const handleClose = () => {
883
+ setAnchorEl(null);
884
+ };
885
+ const handleSelectWorkspace = _react.useCallback.call(void 0,
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__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, { children: [
899
+ /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _material.Box, { sx: { display: "flex", alignItems: "center", ...sx }, children: [
900
+ selectedWorkspace ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _jsxruntime.Fragment, { children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
901
+ _material.Link,
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__ */ _jsxruntime.jsx.call(void 0,
920
+ _material.Avatar,
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__ */ _jsxruntime.jsx.call(void 0,
936
+ _material.Typography,
937
+ {
938
+ variant: "body2",
939
+ color: "text.secondary",
940
+ sx: {
941
+ fontSize: "0.875rem"
942
+ },
943
+ children: "Select Workspace"
944
+ }
945
+ ),
946
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
947
+ _material.IconButton,
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__ */ _jsxruntime.jsx.call(void 0, _KeyboardArrowDown2.default, { fontSize: "small" })
957
+ }
958
+ )
959
+ ] }),
960
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
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] = _react.useState.call(void 0, "");
988
+ _react2.default.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__ */ _jsxruntime.jsx.call(void 0,
1007
+ _material.Menu,
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__ */ _jsxruntime.jsxs.call(void 0, _material.Box, { children: [
1023
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _material.Box, { sx: { px: 2, pt: 2, pb: 1.5 }, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
1024
+ _material.TextField,
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__ */ _jsxruntime.jsx.call(void 0, _material.InputAdornment, { position: "start", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _Search2.default, { fontSize: "small" }) })
1033
+ }
1034
+ }
1035
+ ) }),
1036
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _material.Box, { sx: { maxHeight: 400, overflowY: "auto" }, children: loading ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _material.Box, { sx: { p: 2, textAlign: "center" }, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _material.Typography, { variant: "body2", color: "text.secondary", children: "Loading..." }) }) : filteredWorkspaces.length === 0 ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _material.Box, { sx: { p: 2, textAlign: "center" }, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _material.Typography, { variant: "body2", color: "text.secondary", children: "No workspaces found" }) }) : /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _material.List, { dense: true, children: filteredWorkspaces.map((workspace) => /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
1037
+ _material.ListItem,
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__ */ _jsxruntime.jsx.call(void 0, _material.ListItemAvatar, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
1050
+ _material.Avatar,
1051
+ {
1052
+ sx: { width: 32, height: 32, bgcolor: "secondary.main" },
1053
+ children: workspace.name.charAt(0)
1054
+ }
1055
+ ) }),
1056
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
1057
+ _material.ListItemText,
1058
+ {
1059
+ primary: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _material.Box, { sx: { display: "flex", alignItems: "center", gap: 1 }, children: [
1060
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _material.Typography, { variant: "body2", fontWeight: 500, children: workspace.name }),
1061
+ workspace.id === selectedWorkspaceId && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _Check2.default, { fontSize: "small", color: "primary" })
1062
+ ] }),
1063
+ secondary: workspace.description
1064
+ }
1065
+ )
1066
+ ]
1067
+ },
1068
+ workspace.id
1069
+ )) }) }),
1070
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
1071
+ _material.Box,
1072
+ {
1073
+ sx: {
1074
+ paddingTop: 2,
1075
+ paddingLeft: 2,
1076
+ paddingRight: 2,
1077
+ borderTop: 1,
1078
+ borderColor: "divider"
1079
+ },
1080
+ children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
1081
+ _material.Button,
1082
+ {
1083
+ fullWidth: true,
1084
+ variant: "text",
1085
+ startIcon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _Add2.default, {}),
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
+
1110
+
1111
+
1112
+
1113
+
1114
+
1115
+
1116
+
1117
+ var Stepper = (props) => {
1118
+ return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _material.Stepper, { ...props });
1119
+ };
1120
+ var Step = (props) => {
1121
+ return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _material.Step, { ...props });
1122
+ };
1123
+ var StepLabel = (props) => {
1124
+ return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _material.StepLabel, { ...props });
1125
+ };
1126
+ var StepContent = (props) => {
1127
+ return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _material.StepContent, { ...props });
1128
+ };
1129
+ var StepButton = (props) => {
1130
+ return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _material.StepButton, { ...props });
1131
+ };
1132
+
1133
+ // src/components/navigation/NumberedStepper.tsx
1134
+
1135
+ var _styles = require('@mui/material/styles');
1136
+
1137
+ var Root = _styles.styled.call(void 0, "ol")({
1138
+ listStyle: "none",
1139
+ padding: 0,
1140
+ margin: 0,
1141
+ display: "flex",
1142
+ flexDirection: "column",
1143
+ gap: 8
1144
+ });
1145
+ var Row = _styles.styled.call(void 0, "li")({
1146
+ display: "flex",
1147
+ gap: 10,
1148
+ alignItems: "center"
1149
+ });
1150
+ var Num = _styles.styled.call(void 0, "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 ${_chunkZGCN5WCGjs.webSurfaceTokens.strokeOnMed}`,
1163
+ background: _chunkZGCN5WCGjs.webSurfaceTokens.surfaceContrast,
1164
+ color: _chunkZGCN5WCGjs.webSurfaceTokens.textSecondary,
1165
+ ...state === "active" && {
1166
+ background: _chunkZGCN5WCGjs.webSurfaceTokens.cVioletLight,
1167
+ borderColor: _chunkZGCN5WCGjs.webSurfaceTokens.cViolet,
1168
+ color: _chunkZGCN5WCGjs.webSurfaceTokens.cVioletDark
1169
+ },
1170
+ ...state === "done" && {
1171
+ background: _chunkZGCN5WCGjs.webSurfaceTokens.cViolet,
1172
+ borderColor: _chunkZGCN5WCGjs.webSurfaceTokens.cViolet,
1173
+ color: "white"
1174
+ }
1175
+ }));
1176
+ var Label = _styles.styled.call(void 0, "span", {
1177
+ shouldForwardProp: (p) => p !== "active"
1178
+ })(({ active }) => ({
1179
+ fontSize: 13,
1180
+ color: active ? _chunkZGCN5WCGjs.webSurfaceTokens.textPrimary : _chunkZGCN5WCGjs.webSurfaceTokens.textSecondary,
1181
+ fontWeight: active ? 500 : 400
1182
+ }));
1183
+ var NumberedStepper = _react2.default.forwardRef(
1184
+ function NumberedStepper2({ steps, current, className }, ref) {
1185
+ return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, Root, { ref, className, children: steps.map((s, i) => {
1186
+ const state = i < current ? "done" : i === current ? "active" : "pending";
1187
+ return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, Row, { ...state === "active" ? { "aria-current": "step" } : {}, children: [
1188
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, Num, { state, children: state === "done" ? "\u2713" : i + 1 }),
1189
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, Label, { active: state === "active", children: s.label })
1190
+ ] }, s.key);
1191
+ }) });
1192
+ }
1193
+ );
1194
+
1195
+ // src/components/navigation/SideNav/SideNav.tsx
1196
+
1197
+
1198
+
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
+
1219
+ var SideNavContext = _react2.default.createContext({
1220
+ collapsed: false,
1221
+ showTooltips: true
1222
+ });
1223
+ var SideNavContainer = _styles.styled.call(void 0, _material.Box, {
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 = _styles.styled.call(void 0, (0, _material.Box))(({ theme }) => ({
1244
+ flexShrink: 0,
1245
+ backgroundColor: theme.palette.background.paper
1246
+ }));
1247
+ var NavigationSection = _styles.styled.call(void 0, (0, _material.Box))(() => ({
1248
+ flexGrow: 1,
1249
+ overflowY: "auto",
1250
+ overflowX: "hidden",
1251
+ ...scrollbarStyles
1252
+ }));
1253
+ var FooterSection = _styles.styled.call(void 0, (0, _material.Box))(({ theme }) => ({
1254
+ flexShrink: 0,
1255
+ backgroundColor: theme.palette.background.paper
1256
+ }));
1257
+ var Header = _react2.default.memo(({ children, className }) => {
1258
+ const { collapsed, onToggleCollapse } = _react2.default.useContext(SideNavContext);
1259
+ const enhancedChildren = _react2.default.Children.map(children, (child) => {
1260
+ if (_react2.default.isValidElement(child)) {
1261
+ return _react2.default.cloneElement(child, {
1262
+ collapsed,
1263
+ onCollapse: onToggleCollapse
1264
+ });
1265
+ }
1266
+ return child;
1267
+ });
1268
+ return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, HeaderSection, { className, "data-testid": "sidenav-header", children: enhancedChildren });
1269
+ });
1270
+ Header.displayName = "SideNav.Header";
1271
+ var Navigation = _react2.default.memo(({ children, className }) => {
1272
+ const { collapsed, showTooltips } = _react2.default.useContext(SideNavContext);
1273
+ const enhancedChildren = _react2.default.Children.map(children, (child) => {
1274
+ if (_react2.default.isValidElement(child)) {
1275
+ return _react2.default.cloneElement(child, {
1276
+ collapsed,
1277
+ showTooltips
1278
+ });
1279
+ }
1280
+ return child;
1281
+ });
1282
+ return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, NavigationSection, { className, "data-testid": "sidenav-navigation", children: enhancedChildren });
1283
+ });
1284
+ Navigation.displayName = "SideNav.Navigation";
1285
+ var Footer = _react2.default.memo(({ children, className }) => {
1286
+ const { collapsed } = _react2.default.useContext(SideNavContext);
1287
+ const enhancedChildren = _react2.default.Children.map(children, (child) => {
1288
+ if (_react2.default.isValidElement(child)) {
1289
+ return _react2.default.cloneElement(child, {
1290
+ compact: collapsed
1291
+ });
1292
+ }
1293
+ return child;
1294
+ });
1295
+ return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, FooterSection, { className, "data-testid": "sidenav-footer", children: enhancedChildren });
1296
+ });
1297
+ Footer.displayName = "SideNav.Footer";
1298
+ var SideNav = Object.assign(
1299
+ _react2.default.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] = _react.useState.call(void 0, defaultCollapsed);
1315
+ const isControlled = controlledCollapsed !== void 0;
1316
+ const collapsed = isControlled ? controlledCollapsed : internalCollapsed;
1317
+ const handleToggleCollapse = _react.useCallback.call(void 0, () => {
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__ */ _jsxruntime.jsx.call(void 0, SideNavContext.Provider, { value: contextValue, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
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
+
1358
+
1359
+
1360
+ var _ChevronLeft = require('@mui/icons-material/ChevronLeft'); var _ChevronLeft2 = _interopRequireDefault(_ChevronLeft);
1361
+ var _ChevronRight = require('@mui/icons-material/ChevronRight'); var _ChevronRight2 = _interopRequireDefault(_ChevronRight);
1362
+
1363
+ var HeaderContainer = _styles.styled.call(void 0, _material.Box, {
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 = _styles.styled.call(void 0, (0, _material.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 = _react2.default.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__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, { children: [
1404
+ logo && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
1405
+ _material.Box,
1406
+ {
1407
+ sx: {
1408
+ display: "flex",
1409
+ alignItems: "center",
1410
+ justifyContent: "center",
1411
+ flexShrink: 0
1412
+ },
1413
+ children: logo
1414
+ }
1415
+ ),
1416
+ !collapsed && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
1417
+ _material.Typography,
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__ */ _jsxruntime.jsxs.call(void 0,
1432
+ HeaderContainer,
1433
+ {
1434
+ "data-testid": "sidenav-header-content",
1435
+ "aria-label": headerAriaLabel,
1436
+ isCollapsed: collapsed,
1437
+ children: [
1438
+ onLogoClick ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
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__ */ _jsxruntime.jsx.call(void 0,
1447
+ _material.Box,
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__ */ _jsxruntime.jsx.call(void 0,
1459
+ _material.Tooltip,
1460
+ {
1461
+ title: collapsed ? "Expand navigation" : "Collapse navigation",
1462
+ placement: "right",
1463
+ arrow: true,
1464
+ children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
1465
+ _material.IconButton,
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__ */ _jsxruntime.jsx.call(void 0, _ChevronRight2.default, {}) : /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _ChevronLeft2.default, {})
1481
+ }
1482
+ )
1483
+ }
1484
+ )
1485
+ ]
1486
+ }
1487
+ );
1488
+ });
1489
+ SideNavHeader.displayName = "SideNavHeader";
1490
+
1491
+ // src/components/navigation/SideNav/NavigationList.tsx
1492
+
1493
+
1494
+
1495
+ // src/components/navigation/SideNav/NavigationItem.tsx
1496
+
1497
+
1498
+
1499
+
1500
+
1501
+
1502
+
1503
+
1504
+
1505
+
1506
+ var StyledListItemButton2 = _styles.styled.call(void 0, _material.ListItemButton, {
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 = _react2.default.memo(
1568
+ _react2.default.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__ */ _jsxruntime.jsx.call(void 0,
1591
+ _material.ListItemIcon,
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__ */ _jsxruntime.jsx.call(void 0,
1605
+ _material.ListItemText,
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__ */ _jsxruntime.jsxs.call(void 0,
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__ */ _jsxruntime.jsx.call(void 0,
1642
+ _material.Box,
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__ */ _jsxruntime.jsx.call(void 0,
1657
+ _material.Tooltip,
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
+
1675
+ var NavigationList = _react2.default.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] = _react.useState.call(void 0,
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__ */ _jsxruntime.jsx.call(void 0,
1698
+ _material.List,
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__ */ _jsxruntime.jsx.call(void 0,
1712
+ _material.ListItem,
1713
+ {
1714
+ role: "listitem",
1715
+ sx: {
1716
+ padding: 0,
1717
+ display: "block"
1718
+ },
1719
+ children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
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
+
1748
+
1749
+
1750
+ var _Power = require('@mui/icons-material/Power'); var _Power2 = _interopRequireDefault(_Power);
1751
+
1752
+ var StatusPill = _styles.styled.call(void 0, _material.Box, {
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 = _react2.default.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__ */ _jsxruntime.jsxs.call(void 0,
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__ */ _jsxruntime.jsx.call(void 0,
1838
+ _material.Box,
1839
+ {
1840
+ sx: {
1841
+ display: "flex",
1842
+ alignItems: "center",
1843
+ fontSize: 16,
1844
+ color: "inherit"
1845
+ },
1846
+ children: icon || /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _Power2.default, { fontSize: "small" })
1847
+ }
1848
+ ),
1849
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _material.Typography, { className: "status-text", variant: "body2", children: compact ? _nullishCoalesce(compactText, () => ( status)) : status })
1850
+ ]
1851
+ }
1852
+ );
1853
+ if (compact) {
1854
+ return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
1855
+ _material.Box,
1856
+ {
1857
+ sx: {
1858
+ display: "flex",
1859
+ justifyContent: "center",
1860
+ padding: 1
1861
+ },
1862
+ children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _material.Tooltip, { title: status, placement: "right", arrow: true, children: statusContent })
1863
+ }
1864
+ );
1865
+ }
1866
+ return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
1867
+ _material.Box,
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
+
1882
+
1883
+
1884
+ var _Logout = require('@mui/icons-material/Logout'); var _Logout2 = _interopRequireDefault(_Logout);
1885
+
1886
+ var AccountContainer = _styles.styled.call(void 0, _material.Box, {
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 = _react2.default.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__ */ _jsxruntime.jsxs.call(void 0, AccountContainer, { layout, isCompact: true, "aria-label": "Account section", children: [
1928
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
1929
+ _material.Tooltip,
1930
+ {
1931
+ title: `${user.name}${user.email ? ` (${user.email})` : ""}`,
1932
+ placement: "right",
1933
+ arrow: true,
1934
+ children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
1935
+ _material.Avatar,
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__ */ _jsxruntime.jsx.call(void 0, _material.Tooltip, { title: "Logout", placement: "right", arrow: true, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
1954
+ _material.IconButton,
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__ */ _jsxruntime.jsx.call(void 0, _Logout2.default, { fontSize: "small" })
1967
+ }
1968
+ ) })
1969
+ ] });
1970
+ }
1971
+ return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, AccountContainer, { layout, isCompact: false, "aria-label": "Account section", children: [
1972
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
1973
+ _material.Avatar,
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__ */ _jsxruntime.jsxs.call(void 0,
1989
+ _material.Box,
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__ */ _jsxruntime.jsx.call(void 0,
2001
+ _material.Typography,
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__ */ _jsxruntime.jsx.call(void 0,
2015
+ _material.Typography,
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__ */ _jsxruntime.jsx.call(void 0,
2030
+ _material.Button,
2031
+ {
2032
+ onClick: onLogout,
2033
+ "aria-label": "Logout",
2034
+ startIcon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _Logout2.default, { 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
+ var _Tab = require('@mui/material/Tab'); var _Tab2 = _interopRequireDefault(_Tab);
2061
+
2062
+
2063
+ var StyledTab = _styles.styled.call(void 0, (0, _Tab2.default))(({ 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__ */ _jsxruntime.jsx.call(void 0, _chunkBIZK6FUDjs.Badge, { variant: badgeVariant, badgeContent: badge, children: label }) : label;
2085
+ return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, StyledTab, { label: tabLabel, ...props });
2086
+ };
2087
+
2088
+ // src/components/navigation/Menu.tsx
2089
+
2090
+
2091
+
2092
+
2093
+
2094
+
2095
+
2096
+
2097
+
2098
+
2099
+ var StyledMenu = _styles.styled.call(void 0, (0, _material.Menu))(({ 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 = _react2.default.forwardRef(function Menu4({ anchorEl, onClose, children, ...props }, ref) {
2113
+ return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
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 = _react2.default.forwardRef(function MenuItem2({ icon, label, onClick, disabled = false, divider = false }, ref) {
2134
+ return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, { children: [
2135
+ /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _material.MenuItem, { ref, onClick, disabled, children: [
2136
+ icon && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _material.ListItemIcon, { children: icon }),
2137
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _material.ListItemText, { children: label })
2138
+ ] }),
2139
+ divider && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _material.Divider, {})
2140
+ ] });
2141
+ });
2142
+
2143
+ // src/components/navigation/Pagination.tsx
2144
+ var _Pagination = require('@mui/material/Pagination'); var _Pagination2 = _interopRequireDefault(_Pagination);
2145
+
2146
+
2147
+ var StyledPagination = _styles.styled.call(void 0, (0, _Pagination2.default))(({ 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__ */ _jsxruntime.jsx.call(void 0, StyledPagination, { color, ...props });
2163
+ };
2164
+
2165
+ // src/components/navigation/Selector.tsx
2166
+
2167
+
2168
+
2169
+
2170
+
2171
+
2172
+
2173
+
2174
+
2175
+
2176
+
2177
+
2178
+
2179
+
2180
+
2181
+
2182
+
2183
+
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 = _styles.useTheme.call(void 0, );
2197
+ const [anchorEl, setAnchorEl] = _react.useState.call(void 0, null);
2198
+ const [searchTerm, setSearchTerm] = _react.useState.call(void 0, "");
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__ */ _jsxruntime.jsxs.call(void 0, _material.Box, { sx: { display: "flex", alignItems: "center", gap: 1 }, children: [
2217
+ option.avatar ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _material.Avatar, { src: option.avatar, sx: { width: 20, height: 20 } }) : option.icon ? option.icon : /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _material.Avatar, { sx: { width: 20, height: 20, bgcolor: theme.palette.primary.main, fontSize: "0.7rem" }, children: option.name.charAt(0) }),
2218
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _material.Typography, { variant: "body2", children: option.name })
2219
+ ] });
2220
+ if (compact) {
2221
+ return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, { children: [
2222
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkOWWDNDF4js.IconButton, { onClick: handleOpen, size: "small", children: selectedOption ? selectedOption.avatar ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _material.Avatar, { src: selectedOption.avatar, sx: { width: 32, height: 32 } }) : /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _material.Avatar, { sx: { width: 32, height: 32, bgcolor: theme.palette.primary.main }, children: selectedOption.name.charAt(0) }) : /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _material.Avatar, { sx: { width: 32, height: 32, bgcolor: theme.palette.grey[400] }, children: "?" }) }),
2223
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
2224
+ _material.Menu,
2225
+ {
2226
+ anchorEl,
2227
+ open,
2228
+ onClose: handleClose,
2229
+ PaperProps: {
2230
+ sx: { width, maxHeight: 600, mt: 1 }
2231
+ },
2232
+ children: loading ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _material.Box, { sx: { display: "flex", justifyContent: "center", p: 2 }, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _material.CircularProgress, { size: 24 }) }) : /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, { children: [
2233
+ options.length > 5 && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _material.Box, { sx: { p: 1, borderBottom: `1px solid ${theme.palette.grey[200]}` }, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
2234
+ _chunkJBHRAAN3js.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__ */ _jsxruntime.jsx.call(void 0, _material.InputAdornment, { position: "start", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _Search2.default, { fontSize: "small" }) })
2243
+ }
2244
+ }
2245
+ ) }),
2246
+ /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _material.List, { sx: { maxHeight: 400, overflow: "auto" }, children: [
2247
+ filteredOptions.map((option) => /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
2248
+ _material.ListItemButton,
2249
+ {
2250
+ selected: option.id === selectedId,
2251
+ onClick: () => handleSelect(option.id),
2252
+ disabled: option.disabled,
2253
+ children: [
2254
+ option.avatar ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _material.ListItemAvatar, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _material.Avatar, { src: option.avatar }) }) : option.icon ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _material.ListItemAvatar, { children: option.icon }) : /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _material.ListItemAvatar, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _material.Avatar, { sx: { bgcolor: theme.palette.primary.main }, children: option.name.charAt(0) }) }),
2255
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _material.ListItemText, { primary: option.name, secondary: option.description })
2256
+ ]
2257
+ },
2258
+ option.id
2259
+ )),
2260
+ filteredOptions.length === 0 && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _material.Box, { sx: { p: 2, textAlign: "center" }, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _material.Typography, { variant: "body2", color: "text.secondary", children: emptyMessage }) })
2261
+ ] }),
2262
+ onCreate && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _material.Box, { sx: { p: 1, borderTop: `1px solid ${theme.palette.grey[200]}` }, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
2263
+ _chunkMNM6HE72js.Button,
2264
+ {
2265
+ fullWidth: true,
2266
+ startIcon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _Add2.default, {}),
2267
+ onClick: () => {
2268
+ onCreate();
2269
+ handleClose();
2270
+ },
2271
+ children: "Create New"
2272
+ }
2273
+ ) })
2274
+ ] })
2275
+ }
2276
+ )
2277
+ ] });
2278
+ }
2279
+ return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, { children: [
2280
+ /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _material.Box, { sx: { display: "flex", alignItems: "center", gap: 0.5 }, children: [
2281
+ selectedOption ? renderSelected ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkU2QHFISGjs.Link, { onClick: handleOpen, underline: "hover", children: renderSelected(selectedOption) }) : /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkU2QHFISGjs.Link, { onClick: handleOpen, underline: "hover", children: defaultRenderSelected(selectedOption) }) : /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _material.Typography, { variant: "body2", color: "text.secondary", children: placeholder }),
2282
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkOWWDNDF4js.IconButton, { onClick: handleOpen, size: "small", sx: { p: 0.2, ml: 0.5 }, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _KeyboardArrowDown2.default, { fontSize: "small" }) })
2283
+ ] }),
2284
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
2285
+ _material.Menu,
2286
+ {
2287
+ anchorEl,
2288
+ open,
2289
+ onClose: handleClose,
2290
+ PaperProps: {
2291
+ sx: { width, maxHeight: 600, mt: 1 }
2292
+ },
2293
+ children: loading ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _material.Box, { sx: { display: "flex", justifyContent: "center", p: 2 }, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _material.CircularProgress, { size: 24 }) }) : /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, { children: [
2294
+ options.length > 5 && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _material.Box, { sx: { p: 1, borderBottom: `1px solid ${theme.palette.grey[200]}` }, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
2295
+ _chunkJBHRAAN3js.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__ */ _jsxruntime.jsx.call(void 0, _material.InputAdornment, { position: "start", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _Search2.default, { fontSize: "small" }) })
2304
+ }
2305
+ }
2306
+ ) }),
2307
+ /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _material.List, { sx: { maxHeight: 400, overflow: "auto" }, children: [
2308
+ filteredOptions.map((option) => /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
2309
+ _material.ListItemButton,
2310
+ {
2311
+ selected: option.id === selectedId,
2312
+ onClick: () => handleSelect(option.id),
2313
+ disabled: option.disabled,
2314
+ children: [
2315
+ option.avatar ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _material.ListItemAvatar, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _material.Avatar, { src: option.avatar }) }) : option.icon ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _material.ListItemAvatar, { children: option.icon }) : /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _material.ListItemAvatar, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _material.Avatar, { sx: { bgcolor: theme.palette.primary.main }, children: option.name.charAt(0) }) }),
2316
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _material.ListItemText, { primary: option.name, secondary: option.description })
2317
+ ]
2318
+ },
2319
+ option.id
2320
+ )),
2321
+ filteredOptions.length === 0 && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _material.Box, { sx: { p: 2, textAlign: "center" }, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _material.Typography, { variant: "body2", color: "text.secondary", children: emptyMessage }) })
2322
+ ] }),
2323
+ onCreate && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _material.Box, { sx: { p: 1, borderTop: `1px solid ${theme.palette.grey[200]}` }, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
2324
+ _chunkMNM6HE72js.Button,
2325
+ {
2326
+ fullWidth: true,
2327
+ startIcon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _Add2.default, {}),
2328
+ onClick: () => {
2329
+ onCreate();
2330
+ handleClose();
2331
+ },
2332
+ children: "Create New"
2333
+ }
2334
+ ) })
2335
+ ] })
2336
+ }
2337
+ )
2338
+ ] });
2339
+ };
2340
+
2341
+
2342
+
2343
+
2344
+
2345
+
2346
+
2347
+
2348
+
2349
+
2350
+
2351
+
2352
+
2353
+
2354
+
2355
+
2356
+
2357
+
2358
+
2359
+
2360
+
2361
+
2362
+
2363
+
2364
+
2365
+ exports.DropdownAnchor = DropdownAnchor; exports.Dropdown = Dropdown; exports.SidebarItem = SidebarItem; exports.Sidebar = Sidebar; exports.ServiceSelectorButton = ServiceSelectorButton; exports.WorkspaceSelectorButton = WorkspaceSelectorButton; exports.Stepper = Stepper; exports.Step = Step; exports.StepLabel = StepLabel; exports.StepContent = StepContent; exports.StepButton = StepButton; exports.NumberedStepper = NumberedStepper; exports.SideNav = SideNav; exports.SideNavHeader = SideNavHeader; exports.NavigationItem = NavigationItem; exports.NavigationList = NavigationList; exports.ConnectionStatus = ConnectionStatus; exports.AccountSection = AccountSection; exports.Tab = Tab; exports.Menu = Menu3; exports.MenuItem = MenuItem; exports.Pagination = Pagination; exports.Selector = Selector;
2366
+ //# sourceMappingURL=chunk-EOF3QNPF.js.map