@wso2/oxygen-ui 0.13.0 → 0.14.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.
- package/.ai/components.md +235 -0
- package/.claude/components.md +235 -0
- package/dist/components/AppSwitcher/AppSwitcher.d.ts +79 -0
- package/dist/components/AppSwitcher/AppSwitcherApp.d.ts +101 -0
- package/dist/components/AppSwitcher/AppSwitcherFooter.d.ts +88 -0
- package/dist/components/AppSwitcher/AppSwitcherSection.d.ts +46 -0
- package/dist/components/AppSwitcher/AppSwitcherTrigger.d.ts +44 -0
- package/dist/components/AppSwitcher/brand.d.ts +48 -0
- package/dist/components/AppSwitcher/context.d.ts +49 -0
- package/dist/components/AppSwitcher/index.d.ts +29 -0
- package/dist/components/ColorSchemeToggle/ColorSchemeToggle.d.ts +2 -1
- package/dist/components/Header/HeaderBrand.d.ts +2 -0
- package/dist/components/NotificationPanel/NotificationList.d.ts +3 -0
- package/dist/components/NotificationPanel/NotificationPanel.d.ts +11 -0
- package/dist/components/NotificationPanel/context.d.ts +7 -0
- package/dist/components/SearchBar/SearchBar.d.ts +2 -1
- package/dist/components/SearchBar/SearchBarBase.d.ts +1 -1
- package/dist/components/UserMenu/UserMenu.d.ts +6 -2
- package/dist/components/UserMenu/UserMenuHeader.d.ts +5 -1
- package/dist/components/UserMenu/UserMenuLogout.d.ts +1 -1
- package/dist/components/UserMenu/UserMenuTrigger.d.ts +8 -3
- package/dist/components/UserMenu/getUserMenuAvatarProps.d.ts +39 -0
- package/dist/components/index.d.ts +2 -0
- package/dist/index.js +1650 -840
- package/dist/index.js.map +4 -4
- package/package.json +4 -4
package/dist/index.js
CHANGED
|
@@ -188,6 +188,37 @@ var init_OxygenThemeBase = __esm({
|
|
|
188
188
|
}
|
|
189
189
|
},
|
|
190
190
|
components: {
|
|
191
|
+
MuiAccordionSummary: {
|
|
192
|
+
defaultProps: {
|
|
193
|
+
expandIcon: React.createElement(ChevronDown)
|
|
194
|
+
},
|
|
195
|
+
styleOverrides: {
|
|
196
|
+
root: ({ theme }) => ({
|
|
197
|
+
fontWeight: theme.typography.fontWeightMedium,
|
|
198
|
+
"& .MuiTypography-root": {
|
|
199
|
+
fontWeight: theme.typography.fontWeightMedium
|
|
200
|
+
},
|
|
201
|
+
"&:hover:not(.Mui-disabled)": {
|
|
202
|
+
backgroundColor: (theme.vars || theme).palette.action.hover,
|
|
203
|
+
cursor: "pointer"
|
|
204
|
+
}
|
|
205
|
+
})
|
|
206
|
+
}
|
|
207
|
+
},
|
|
208
|
+
MuiCssBaseline: {
|
|
209
|
+
styleOverrides: {
|
|
210
|
+
// Honor the user's OS-level reduced-motion preference (WCAG 2.3.3):
|
|
211
|
+
// collapse all CSS animations/transitions to near-instant.
|
|
212
|
+
"@media (prefers-reduced-motion: reduce)": {
|
|
213
|
+
"*, *::before, *::after": {
|
|
214
|
+
animationDuration: "0.01ms !important",
|
|
215
|
+
animationIterationCount: "1 !important",
|
|
216
|
+
transitionDuration: "0.01ms !important",
|
|
217
|
+
scrollBehavior: "auto !important"
|
|
218
|
+
}
|
|
219
|
+
}
|
|
220
|
+
}
|
|
221
|
+
},
|
|
191
222
|
MuiAutocomplete: {
|
|
192
223
|
defaultProps: {
|
|
193
224
|
popupIcon: React.createElement(ChevronDown),
|
|
@@ -274,12 +305,13 @@ var init_OxygenThemeBase = __esm({
|
|
|
274
305
|
light: {
|
|
275
306
|
background: "#f5f5f5",
|
|
276
307
|
text: "#24292e",
|
|
277
|
-
|
|
278
|
-
|
|
308
|
+
// Darkened from GitHub-light defaults to meet WCAG AA 4.5:1 contrast on #f5f5f5
|
|
309
|
+
comment: "#57606a",
|
|
310
|
+
keyword: "#cf222e",
|
|
279
311
|
string: "#032f62",
|
|
280
312
|
function: "#6f42c1",
|
|
281
313
|
number: "#005cc5",
|
|
282
|
-
operator: "#
|
|
314
|
+
operator: "#cf222e"
|
|
283
315
|
},
|
|
284
316
|
dark: {
|
|
285
317
|
background: "#1e1e1e",
|
|
@@ -440,7 +472,7 @@ var init_createOxygenTheme = __esm({
|
|
|
440
472
|
// package.json
|
|
441
473
|
var package_default = {
|
|
442
474
|
name: "@wso2/oxygen-ui",
|
|
443
|
-
version: "0.
|
|
475
|
+
version: "0.14.0",
|
|
444
476
|
description: "WSO2 Oxygen UI | Design System - Powered with Material-UI component library with TypeScript support",
|
|
445
477
|
type: "module",
|
|
446
478
|
main: "./dist/index.js",
|
|
@@ -2103,14 +2135,12 @@ import { default as default2 } from "@emotion/cache";
|
|
|
2103
2135
|
|
|
2104
2136
|
// src/components/AppBreadcrumbs/AppBreadcrumbs.tsx
|
|
2105
2137
|
import Breadcrumbs from "@mui/material/Breadcrumbs";
|
|
2138
|
+
import Menu from "@mui/material/Menu";
|
|
2106
2139
|
import MenuItem from "@mui/material/MenuItem";
|
|
2107
|
-
import MenuList from "@mui/material/MenuList";
|
|
2108
|
-
import Paper from "@mui/material/Paper";
|
|
2109
|
-
import Popper from "@mui/material/Popper";
|
|
2110
2140
|
import Typography from "@mui/material/Typography";
|
|
2111
2141
|
import { styled } from "@mui/material/styles";
|
|
2112
2142
|
import { ChevronRight } from "@wso2/oxygen-ui-icons-react";
|
|
2113
|
-
import {
|
|
2143
|
+
import { useId, useState as useState2 } from "react";
|
|
2114
2144
|
import { jsx as jsx2, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
2115
2145
|
var AppBreadcrumbsRoot = styled("div", {
|
|
2116
2146
|
name: "MuiAppBreadcrumbs",
|
|
@@ -2122,63 +2152,68 @@ var AppBreadcrumbsRoot = styled("div", {
|
|
|
2122
2152
|
var AppBreadcrumbsItem = styled(Typography, {
|
|
2123
2153
|
name: "MuiAppBreadcrumbs",
|
|
2124
2154
|
slot: "Item"
|
|
2125
|
-
})(
|
|
2126
|
-
|
|
2127
|
-
|
|
2128
|
-
return
|
|
2155
|
+
})(({ theme, ownerState }) => {
|
|
2156
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l;
|
|
2157
|
+
if (ownerState.isLast) {
|
|
2158
|
+
return {
|
|
2129
2159
|
whiteSpace: "nowrap",
|
|
2130
|
-
|
|
2131
|
-
|
|
2132
|
-
|
|
2160
|
+
textDecoration: "none",
|
|
2161
|
+
color: (_b = (_a = theme.vars) == null ? void 0 : _a.palette.text.primary) != null ? _b : theme.palette.text.primary,
|
|
2162
|
+
"&:hover": {
|
|
2163
|
+
textDecoration: "none",
|
|
2164
|
+
color: (_d = (_c = theme.vars) == null ? void 0 : _c.palette.text.primary) != null ? _d : theme.palette.text.primary
|
|
2165
|
+
}
|
|
2166
|
+
};
|
|
2167
|
+
}
|
|
2168
|
+
if (!ownerState.isClickable) {
|
|
2169
|
+
return {
|
|
2133
2170
|
whiteSpace: "nowrap",
|
|
2134
|
-
|
|
2171
|
+
textDecoration: "none",
|
|
2172
|
+
color: (_f = (_e = theme.vars) == null ? void 0 : _e.palette.text.disabled) != null ? _f : theme.palette.text.disabled,
|
|
2173
|
+
fontStyle: "italic",
|
|
2174
|
+
opacity: 0.7,
|
|
2135
2175
|
"&:hover": {
|
|
2136
|
-
textDecoration: "
|
|
2137
|
-
color: (
|
|
2176
|
+
textDecoration: "none",
|
|
2177
|
+
color: (_h = (_g = theme.vars) == null ? void 0 : _g.palette.text.disabled) != null ? _h : theme.palette.text.disabled
|
|
2138
2178
|
}
|
|
2139
2179
|
};
|
|
2140
2180
|
}
|
|
2141
|
-
|
|
2142
|
-
|
|
2181
|
+
return {
|
|
2182
|
+
cursor: "pointer",
|
|
2183
|
+
whiteSpace: "nowrap",
|
|
2184
|
+
color: (_j = (_i = theme.vars) == null ? void 0 : _i.palette.text.secondary) != null ? _j : theme.palette.text.secondary,
|
|
2185
|
+
"&:hover": {
|
|
2186
|
+
textDecoration: "underline",
|
|
2187
|
+
color: (_l = (_k = theme.vars) == null ? void 0 : _k.palette.text.primary) != null ? _l : theme.palette.text.primary
|
|
2188
|
+
}
|
|
2189
|
+
};
|
|
2190
|
+
});
|
|
2191
|
+
var AppBreadcrumbsEllipsis = styled("button", {
|
|
2143
2192
|
name: "MuiAppBreadcrumbs",
|
|
2144
2193
|
slot: "Ellipsis"
|
|
2145
2194
|
})(({ theme, ownerState }) => {
|
|
2146
2195
|
var _a, _b, _c, _d, _e, _f;
|
|
2147
|
-
return {
|
|
2196
|
+
return __spreadProps(__spreadValues({}, theme.typography.h5), {
|
|
2197
|
+
border: 0,
|
|
2198
|
+
padding: theme.spacing(0, 0.5),
|
|
2148
2199
|
cursor: "pointer",
|
|
2149
2200
|
whiteSpace: "nowrap",
|
|
2150
2201
|
userSelect: "none",
|
|
2151
|
-
px: 0.5,
|
|
2152
2202
|
borderRadius: theme.shape.borderRadius,
|
|
2153
2203
|
color: (_b = (_a = theme.vars) == null ? void 0 : _a.palette.text.secondary) != null ? _b : theme.palette.text.secondary,
|
|
2154
2204
|
backgroundColor: ownerState.active ? (_d = (_c = theme.vars) == null ? void 0 : _c.palette.action.hover) != null ? _d : theme.palette.action.hover : "transparent",
|
|
2155
2205
|
"&:hover": {
|
|
2156
2206
|
backgroundColor: (_f = (_e = theme.vars) == null ? void 0 : _e.palette.action.hover) != null ? _f : theme.palette.action.hover
|
|
2157
2207
|
}
|
|
2158
|
-
};
|
|
2208
|
+
});
|
|
2159
2209
|
});
|
|
2160
2210
|
function AppBreadcrumbs(_a) {
|
|
2161
2211
|
var _b = _a, { items, maxItems = 4, sx } = _b, props = __objRest(_b, ["items", "maxItems", "sx"]);
|
|
2162
2212
|
const [anchorEl, setAnchorEl] = useState2(null);
|
|
2163
2213
|
const [ellipsisHovered, setEllipsisHovered] = useState2(false);
|
|
2164
|
-
const
|
|
2165
|
-
const popperRef = useRef(null);
|
|
2214
|
+
const menuId = useId();
|
|
2166
2215
|
const open = Boolean(anchorEl);
|
|
2167
|
-
useEffect2(() => {
|
|
2168
|
-
if (!open) return void 0;
|
|
2169
|
-
const handleDocumentClick = (e) => {
|
|
2170
|
-
var _a2, _b2;
|
|
2171
|
-
const target = e.target;
|
|
2172
|
-
if (((_a2 = ellipsisRef.current) == null ? void 0 : _a2.contains(target)) || ((_b2 = popperRef.current) == null ? void 0 : _b2.contains(target))) {
|
|
2173
|
-
return;
|
|
2174
|
-
}
|
|
2175
|
-
setAnchorEl(null);
|
|
2176
|
-
};
|
|
2177
|
-
document.addEventListener("click", handleDocumentClick);
|
|
2178
|
-
return () => document.removeEventListener("click", handleDocumentClick);
|
|
2179
|
-
}, [open]);
|
|
2180
2216
|
const handleEllipsisClick = (e) => {
|
|
2181
|
-
ellipsisRef.current = e.currentTarget;
|
|
2182
2217
|
setAnchorEl(open ? null : e.currentTarget);
|
|
2183
2218
|
};
|
|
2184
2219
|
const handleMenuItemClick = (item) => {
|
|
@@ -2187,46 +2222,56 @@ function AppBreadcrumbs(_a) {
|
|
|
2187
2222
|
(_a2 = item.onClick) == null ? void 0 : _a2.call(item);
|
|
2188
2223
|
};
|
|
2189
2224
|
const shouldTruncate = items.length > maxItems;
|
|
2190
|
-
const visibleItems = shouldTruncate ? [
|
|
2191
|
-
const hiddenItems = shouldTruncate ? items.slice(1, items.length -
|
|
2192
|
-
const renderItem = (item, isLast) =>
|
|
2193
|
-
|
|
2194
|
-
|
|
2195
|
-
|
|
2196
|
-
|
|
2197
|
-
|
|
2198
|
-
|
|
2199
|
-
|
|
2200
|
-
|
|
2201
|
-
|
|
2202
|
-
|
|
2203
|
-
|
|
2204
|
-
|
|
2225
|
+
const visibleItems = shouldTruncate ? [...items.slice(0, maxItems - 1), items[items.length - 1]] : items;
|
|
2226
|
+
const hiddenItems = shouldTruncate ? items.slice(maxItems - 1, items.length - 1) : [];
|
|
2227
|
+
const renderItem = (item, isLast) => {
|
|
2228
|
+
const isClickable = !isLast && !!item.onClick;
|
|
2229
|
+
return /* @__PURE__ */ jsx2(
|
|
2230
|
+
AppBreadcrumbsItem,
|
|
2231
|
+
__spreadProps(__spreadValues({
|
|
2232
|
+
variant: "h5",
|
|
2233
|
+
ownerState: { isLast, isClickable }
|
|
2234
|
+
}, isClickable && {
|
|
2235
|
+
role: "button",
|
|
2236
|
+
tabIndex: 0,
|
|
2237
|
+
onClick: item.onClick,
|
|
2238
|
+
onKeyDown: (e) => {
|
|
2239
|
+
var _a2;
|
|
2240
|
+
if (e.key === "Enter" || e.key === " ") {
|
|
2241
|
+
e.preventDefault();
|
|
2242
|
+
(_a2 = item.onClick) == null ? void 0 : _a2.call(item);
|
|
2243
|
+
}
|
|
2205
2244
|
}
|
|
2206
|
-
},
|
|
2207
|
-
|
|
2208
|
-
|
|
2209
|
-
|
|
2210
|
-
|
|
2245
|
+
}), {
|
|
2246
|
+
children: item.label
|
|
2247
|
+
}),
|
|
2248
|
+
item.key
|
|
2249
|
+
);
|
|
2250
|
+
};
|
|
2211
2251
|
const breadcrumbChildren = [];
|
|
2212
2252
|
if (shouldTruncate) {
|
|
2213
|
-
|
|
2253
|
+
visibleItems.slice(0, -1).forEach((item, index) => {
|
|
2254
|
+
breadcrumbChildren.push(renderItem(item, false));
|
|
2255
|
+
});
|
|
2214
2256
|
breadcrumbChildren.push(
|
|
2215
2257
|
/* @__PURE__ */ jsx2(
|
|
2216
2258
|
AppBreadcrumbsEllipsis,
|
|
2217
2259
|
{
|
|
2218
|
-
|
|
2260
|
+
type: "button",
|
|
2219
2261
|
ownerState: { active: ellipsisHovered || open },
|
|
2220
2262
|
onClick: handleEllipsisClick,
|
|
2221
2263
|
onMouseEnter: () => setEllipsisHovered(true),
|
|
2222
2264
|
onMouseLeave: () => setEllipsisHovered(false),
|
|
2265
|
+
"aria-label": "Show hidden breadcrumbs",
|
|
2266
|
+
"aria-haspopup": "menu",
|
|
2267
|
+
"aria-expanded": open || void 0,
|
|
2268
|
+
"aria-controls": open ? menuId : void 0,
|
|
2223
2269
|
children: "..."
|
|
2224
2270
|
},
|
|
2225
2271
|
"__ellipsis__"
|
|
2226
2272
|
)
|
|
2227
2273
|
);
|
|
2228
|
-
breadcrumbChildren.push(renderItem(visibleItems[1],
|
|
2229
|
-
breadcrumbChildren.push(renderItem(visibleItems[2], true));
|
|
2274
|
+
breadcrumbChildren.push(renderItem(visibleItems[visibleItems.length - 1], true));
|
|
2230
2275
|
} else {
|
|
2231
2276
|
items.forEach((item, index) => {
|
|
2232
2277
|
breadcrumbChildren.push(renderItem(item, index === items.length - 1));
|
|
@@ -2236,19 +2281,30 @@ function AppBreadcrumbs(_a) {
|
|
|
2236
2281
|
/* @__PURE__ */ jsx2(
|
|
2237
2282
|
Breadcrumbs,
|
|
2238
2283
|
{
|
|
2239
|
-
separator: /* @__PURE__ */ jsx2(ChevronRight, { size: 16 }),
|
|
2284
|
+
separator: /* @__PURE__ */ jsx2(ChevronRight, { size: 16, "aria-hidden": "true" }),
|
|
2240
2285
|
"aria-label": "breadcrumb",
|
|
2241
2286
|
sx: { "& ol": { flexWrap: "nowrap", alignItems: "center" } },
|
|
2242
2287
|
children: breadcrumbChildren
|
|
2243
2288
|
}
|
|
2244
2289
|
),
|
|
2245
|
-
/* @__PURE__ */ jsx2(
|
|
2290
|
+
/* @__PURE__ */ jsx2(
|
|
2291
|
+
Menu,
|
|
2292
|
+
{
|
|
2293
|
+
id: menuId,
|
|
2294
|
+
open,
|
|
2295
|
+
anchorEl,
|
|
2296
|
+
onClose: () => setAnchorEl(null),
|
|
2297
|
+
anchorOrigin: { vertical: "bottom", horizontal: "left" },
|
|
2298
|
+
slotProps: { paper: { elevation: 3, sx: { minWidth: 160, mt: 0.5 } }, list: { dense: true } },
|
|
2299
|
+
children: hiddenItems.map((item) => /* @__PURE__ */ jsx2(MenuItem, { onClick: () => handleMenuItemClick(item), children: /* @__PURE__ */ jsx2(Typography, { variant: "body2", children: item.label }) }, item.key))
|
|
2300
|
+
}
|
|
2301
|
+
)
|
|
2246
2302
|
] }));
|
|
2247
2303
|
}
|
|
2248
2304
|
AppBreadcrumbs.displayName = "AppBreadcrumbs";
|
|
2249
2305
|
|
|
2250
2306
|
// src/components/CodeBlock/CodeBlock.tsx
|
|
2251
|
-
import React2, { useEffect as
|
|
2307
|
+
import React2, { useEffect as useEffect2 } from "react";
|
|
2252
2308
|
import { Box, useTheme } from "@mui/material";
|
|
2253
2309
|
import Prism from "prismjs";
|
|
2254
2310
|
import "prismjs/components/prism-javascript";
|
|
@@ -2282,18 +2338,19 @@ var CodeBlock = ({
|
|
|
2282
2338
|
});
|
|
2283
2339
|
return () => observer.disconnect();
|
|
2284
2340
|
}, [theme.palette.mode]);
|
|
2285
|
-
|
|
2341
|
+
useEffect2(() => {
|
|
2286
2342
|
Prism.highlightAll();
|
|
2287
2343
|
}, [code, language]);
|
|
2288
2344
|
const defaultColors = {
|
|
2289
2345
|
background: isDark ? "#1e1e1e" : "#f5f5f5",
|
|
2290
2346
|
text: isDark ? "#d4d4d4" : "#24292e",
|
|
2291
|
-
|
|
2292
|
-
|
|
2347
|
+
// Light-mode values darkened to meet WCAG AA 4.5:1 contrast on #f5f5f5
|
|
2348
|
+
comment: isDark ? "#6a9955" : "#57606a",
|
|
2349
|
+
keyword: isDark ? "#569cd6" : "#cf222e",
|
|
2293
2350
|
string: isDark ? "#ce9178" : "#032f62",
|
|
2294
2351
|
function: isDark ? "#dcdcaa" : "#6f42c1",
|
|
2295
2352
|
number: isDark ? "#b5cea8" : "#005cc5",
|
|
2296
|
-
operator: isDark ? "#d4d4d4" : "#
|
|
2353
|
+
operator: isDark ? "#d4d4d4" : "#cf222e"
|
|
2297
2354
|
};
|
|
2298
2355
|
const colors2 = (isDark ? (_b = (_a = theme.vars) == null ? void 0 : _a.syntax) == null ? void 0 : _b.dark : (_d = (_c = theme.vars) == null ? void 0 : _c.syntax) == null ? void 0 : _d.light) || defaultColors;
|
|
2299
2356
|
return /* @__PURE__ */ jsx3(
|
|
@@ -2514,52 +2571,62 @@ function ColorSchemeSVG(_a) {
|
|
|
2514
2571
|
}
|
|
2515
2572
|
|
|
2516
2573
|
// src/components/ColorSchemeToggle/ColorSchemeToggle.tsx
|
|
2574
|
+
import * as React3 from "react";
|
|
2517
2575
|
import { useColorScheme as useColorScheme3 } from "@mui/material/styles";
|
|
2518
2576
|
import IconButton from "@mui/material/IconButton";
|
|
2519
2577
|
import { Moon, Monitor, Sun } from "@wso2/oxygen-ui-icons-react";
|
|
2520
2578
|
import { Tooltip } from "@mui/material";
|
|
2521
2579
|
import { jsx as jsx6 } from "react/jsx-runtime";
|
|
2522
|
-
var ColorSchemeToggle = (
|
|
2523
|
-
|
|
2524
|
-
darkModeIcon,
|
|
2525
|
-
|
|
2526
|
-
|
|
2527
|
-
|
|
2528
|
-
"darkModeIcon",
|
|
2529
|
-
"lightModeIcon",
|
|
2530
|
-
"systemModeIcon"
|
|
2531
|
-
]);
|
|
2532
|
-
const { mode, setMode } = useColorScheme3();
|
|
2533
|
-
if (!mode) {
|
|
2534
|
-
return null;
|
|
2535
|
-
}
|
|
2536
|
-
const nextMode = (currentMode2) => {
|
|
2537
|
-
if (currentMode2 === "light") return "dark";
|
|
2538
|
-
if (currentMode2 === "dark") return "system";
|
|
2539
|
-
return "light";
|
|
2540
|
-
};
|
|
2541
|
-
const currentMode = mode != null ? mode : "system";
|
|
2542
|
-
const ColorSchemeIcon = () => {
|
|
2543
|
-
switch (currentMode) {
|
|
2544
|
-
case "light":
|
|
2545
|
-
return lightModeIcon != null ? lightModeIcon : /* @__PURE__ */ jsx6(Sun, {});
|
|
2546
|
-
case "dark":
|
|
2547
|
-
return darkModeIcon != null ? darkModeIcon : /* @__PURE__ */ jsx6(Moon, {});
|
|
2548
|
-
default:
|
|
2549
|
-
return systemModeIcon != null ? systemModeIcon : /* @__PURE__ */ jsx6(Monitor, {});
|
|
2580
|
+
var ColorSchemeToggle = React3.forwardRef(
|
|
2581
|
+
function ColorSchemeToggle2(_a, ref) {
|
|
2582
|
+
var _b = _a, { darkModeIcon, lightModeIcon, systemModeIcon, onClick, "aria-label": ariaLabel } = _b, buttonProps = __objRest(_b, ["darkModeIcon", "lightModeIcon", "systemModeIcon", "onClick", "aria-label"]);
|
|
2583
|
+
const { mode, setMode } = useColorScheme3();
|
|
2584
|
+
if (!mode) {
|
|
2585
|
+
return null;
|
|
2550
2586
|
}
|
|
2551
|
-
|
|
2552
|
-
|
|
2553
|
-
|
|
2587
|
+
const nextMode = (currentMode2) => {
|
|
2588
|
+
if (currentMode2 === "light") return "dark";
|
|
2589
|
+
if (currentMode2 === "dark") return "system";
|
|
2590
|
+
return "light";
|
|
2591
|
+
};
|
|
2592
|
+
const currentMode = mode != null ? mode : "system";
|
|
2593
|
+
const defaultAriaLabel = `Switch to ${nextMode(currentMode)} mode`;
|
|
2594
|
+
const resolvedAriaLabel = typeof ariaLabel === "string" && ariaLabel.trim().length > 0 ? ariaLabel : defaultAriaLabel;
|
|
2595
|
+
const ColorSchemeIcon = () => {
|
|
2596
|
+
switch (currentMode) {
|
|
2597
|
+
case "light":
|
|
2598
|
+
return lightModeIcon != null ? lightModeIcon : /* @__PURE__ */ jsx6(Sun, {});
|
|
2599
|
+
case "dark":
|
|
2600
|
+
return darkModeIcon != null ? darkModeIcon : /* @__PURE__ */ jsx6(Moon, {});
|
|
2601
|
+
default:
|
|
2602
|
+
return systemModeIcon != null ? systemModeIcon : /* @__PURE__ */ jsx6(Monitor, {});
|
|
2603
|
+
}
|
|
2604
|
+
};
|
|
2605
|
+
return /* @__PURE__ */ jsx6(Tooltip, { title: `${currentMode.charAt(0).toUpperCase()}${currentMode.slice(1)} Mode`, children: /* @__PURE__ */ jsx6(
|
|
2606
|
+
IconButton,
|
|
2607
|
+
__spreadProps(__spreadValues({
|
|
2608
|
+
ref
|
|
2609
|
+
}, buttonProps), {
|
|
2610
|
+
"aria-label": resolvedAriaLabel,
|
|
2611
|
+
onClick: (event) => {
|
|
2612
|
+
setMode(nextMode(currentMode));
|
|
2613
|
+
onClick == null ? void 0 : onClick(event);
|
|
2614
|
+
},
|
|
2615
|
+
children: /* @__PURE__ */ jsx6(ColorSchemeIcon, {})
|
|
2616
|
+
})
|
|
2617
|
+
) });
|
|
2618
|
+
}
|
|
2619
|
+
);
|
|
2554
2620
|
var ColorSchemeToggle_default = ColorSchemeToggle;
|
|
2555
2621
|
|
|
2556
2622
|
// src/components/ComplexSelect/ComplexSelect.tsx
|
|
2557
|
-
import { Children, isValidElement } from "react";
|
|
2623
|
+
import { Children, isValidElement, useId as useId2 } from "react";
|
|
2558
2624
|
import MuiSelect, { selectClasses } from "@mui/material/Select";
|
|
2559
2625
|
import MuiFormControl from "@mui/material/FormControl";
|
|
2560
2626
|
import MuiInputLabel from "@mui/material/InputLabel";
|
|
2561
2627
|
import MuiTypography from "@mui/material/Typography";
|
|
2562
2628
|
import { styled as styled7 } from "@mui/material/styles";
|
|
2629
|
+
import { visuallyHidden } from "@mui/utils";
|
|
2563
2630
|
|
|
2564
2631
|
// src/components/ComplexSelect/ComplexSelectListHeader.tsx
|
|
2565
2632
|
import MuiListSubheader from "@mui/material/ListSubheader";
|
|
@@ -2755,6 +2822,7 @@ var StyledInputLabel = styled7(MuiInputLabel, {
|
|
|
2755
2822
|
});
|
|
2756
2823
|
function ComplexSelect(_a) {
|
|
2757
2824
|
var _b = _a, { children, sx, label, labelId, labelAnchor = "inside" } = _b, props = __objRest(_b, ["children", "sx", "label", "labelId", "labelAnchor"]);
|
|
2825
|
+
const autoLabelId = useId2();
|
|
2758
2826
|
const injectLabelIntoContent = (content) => {
|
|
2759
2827
|
if (!label || labelAnchor !== "inside") return content;
|
|
2760
2828
|
const processChildren = (node) => {
|
|
@@ -2827,9 +2895,9 @@ function ComplexSelect(_a) {
|
|
|
2827
2895
|
})
|
|
2828
2896
|
);
|
|
2829
2897
|
if (label) {
|
|
2830
|
-
const generatedLabelId = labelId ||
|
|
2898
|
+
const generatedLabelId = labelId || autoLabelId;
|
|
2831
2899
|
return /* @__PURE__ */ jsxs3(StyledFormControl, { fullWidth: props.fullWidth, children: [
|
|
2832
|
-
labelAnchor
|
|
2900
|
+
labelAnchor === "inside" ? /* @__PURE__ */ jsx13(StyledInputLabel, { id: generatedLabelId, labelAnchor, sx: visuallyHidden, children: label }) : /* @__PURE__ */ jsx13(
|
|
2833
2901
|
StyledInputLabel,
|
|
2834
2902
|
{
|
|
2835
2903
|
id: generatedLabelId,
|
|
@@ -2911,7 +2979,7 @@ PageContent.displayName = "PageContent";
|
|
|
2911
2979
|
var PageContent_default = PageContent;
|
|
2912
2980
|
|
|
2913
2981
|
// src/components/PageTitle/PageTitle.tsx
|
|
2914
|
-
import
|
|
2982
|
+
import React5 from "react";
|
|
2915
2983
|
import { styled as styled15 } from "@mui/material/styles";
|
|
2916
2984
|
|
|
2917
2985
|
// src/components/PageTitle/PageTitleHeader.tsx
|
|
@@ -3026,7 +3094,7 @@ PageTitleActions.displayName = "PageTitle.Actions";
|
|
|
3026
3094
|
var PageTitleActions_default = PageTitleActions;
|
|
3027
3095
|
|
|
3028
3096
|
// src/components/PageTitle/PageTitleBackButton.tsx
|
|
3029
|
-
import
|
|
3097
|
+
import React4 from "react";
|
|
3030
3098
|
import { styled as styled14 } from "@mui/material/styles";
|
|
3031
3099
|
import Button from "@mui/material/Button";
|
|
3032
3100
|
import Typography4 from "@mui/material/Typography";
|
|
@@ -3056,13 +3124,13 @@ var PageTitleBackButton = (_a) => {
|
|
|
3056
3124
|
}
|
|
3057
3125
|
}, props), {
|
|
3058
3126
|
children: [
|
|
3059
|
-
/* @__PURE__ */ jsx20(ArrowLeft, { size: 20 }),
|
|
3127
|
+
/* @__PURE__ */ jsx20(ArrowLeft, { size: 20, "aria-hidden": "true" }),
|
|
3060
3128
|
/* @__PURE__ */ jsx20(Typography4, { variant: "body2", children })
|
|
3061
3129
|
]
|
|
3062
3130
|
})
|
|
3063
3131
|
);
|
|
3064
|
-
if (
|
|
3065
|
-
return /* @__PURE__ */ jsx20(PageTitleBackButtonRoot, { children:
|
|
3132
|
+
if (React4.isValidElement(Component)) {
|
|
3133
|
+
return /* @__PURE__ */ jsx20(PageTitleBackButtonRoot, { children: React4.cloneElement(
|
|
3066
3134
|
Component,
|
|
3067
3135
|
{ style: { textDecoration: "none" } },
|
|
3068
3136
|
button
|
|
@@ -3132,20 +3200,20 @@ var PageTitleColumnRight = styled15("div", {
|
|
|
3132
3200
|
})();
|
|
3133
3201
|
var PageTitle = (_a) => {
|
|
3134
3202
|
var _b = _a, { children, sx } = _b, props = __objRest(_b, ["children", "sx"]);
|
|
3135
|
-
const childrenArray =
|
|
3203
|
+
const childrenArray = React5.Children.toArray(children);
|
|
3136
3204
|
const avatar = childrenArray.find(
|
|
3137
|
-
(child) =>
|
|
3205
|
+
(child) => React5.isValidElement(child) && child.type === PageTitleAvatar_default
|
|
3138
3206
|
);
|
|
3139
3207
|
const actions = childrenArray.find(
|
|
3140
|
-
(child) =>
|
|
3208
|
+
(child) => React5.isValidElement(child) && child.type === PageTitleActions_default
|
|
3141
3209
|
);
|
|
3142
3210
|
let backButtonElement = null;
|
|
3143
3211
|
childrenArray.forEach((child) => {
|
|
3144
|
-
if (
|
|
3212
|
+
if (React5.isValidElement(child)) {
|
|
3145
3213
|
if (child.type === PageTitleBackButton_default) {
|
|
3146
3214
|
backButtonElement = child;
|
|
3147
3215
|
}
|
|
3148
|
-
if (child.props && typeof child.props === "object" && "children" in child.props &&
|
|
3216
|
+
if (child.props && typeof child.props === "object" && "children" in child.props && React5.isValidElement(child.props.children)) {
|
|
3149
3217
|
if (child.props.children.type === PageTitleBackButton_default) {
|
|
3150
3218
|
backButtonElement = child;
|
|
3151
3219
|
}
|
|
@@ -3154,15 +3222,15 @@ var PageTitle = (_a) => {
|
|
|
3154
3222
|
});
|
|
3155
3223
|
const otherChildren = childrenArray.filter(
|
|
3156
3224
|
(child) => {
|
|
3157
|
-
if (!
|
|
3225
|
+
if (!React5.isValidElement(child)) {
|
|
3158
3226
|
return true;
|
|
3159
3227
|
}
|
|
3160
3228
|
if (child.type === PageTitleAvatar_default || child.type === PageTitleActions_default || child.type === PageTitleBackButton_default) {
|
|
3161
3229
|
return false;
|
|
3162
3230
|
}
|
|
3163
|
-
if (child.props && typeof child.props === "object" && "children" in child.props &&
|
|
3231
|
+
if (child.props && typeof child.props === "object" && "children" in child.props && React5.isValidElement(child.props.children)) {
|
|
3164
3232
|
const childrenProp = child.props.children;
|
|
3165
|
-
if (
|
|
3233
|
+
if (React5.isValidElement(childrenProp) && childrenProp.type === PageTitleBackButton_default) {
|
|
3166
3234
|
return false;
|
|
3167
3235
|
}
|
|
3168
3236
|
}
|
|
@@ -3206,7 +3274,14 @@ var StatCard = (_a) => {
|
|
|
3206
3274
|
"iconColor"
|
|
3207
3275
|
]);
|
|
3208
3276
|
return /* @__PURE__ */ jsx22(Card, __spreadProps(__spreadValues({ variant: "outlined" }, props), { children: /* @__PURE__ */ jsx22(CardContent, { children: /* @__PURE__ */ jsxs7(Box6, { sx: { display: "flex", alignItems: "center", gap: 2 }, children: [
|
|
3209
|
-
icon && /* @__PURE__ */ jsx22(
|
|
3277
|
+
icon && /* @__PURE__ */ jsx22(
|
|
3278
|
+
Box6,
|
|
3279
|
+
{
|
|
3280
|
+
"aria-hidden": "true",
|
|
3281
|
+
sx: { color: (theme) => theme.palette[iconColor].main, display: "flex", alignItems: "center" },
|
|
3282
|
+
children: icon
|
|
3283
|
+
}
|
|
3284
|
+
),
|
|
3210
3285
|
/* @__PURE__ */ jsxs7(Box6, { children: [
|
|
3211
3286
|
/* @__PURE__ */ jsx22(Typography5, { variant: "h5", children: value }),
|
|
3212
3287
|
/* @__PURE__ */ jsx22(Typography5, { variant: "body2", color: "text.secondary", children: label })
|
|
@@ -3217,7 +3292,9 @@ StatCard.displayName = "StatCard";
|
|
|
3217
3292
|
var StatCard_default = StatCard;
|
|
3218
3293
|
|
|
3219
3294
|
// src/components/ThemeSwitcher/ThemeSelect.tsx
|
|
3295
|
+
import { useId as useId3 } from "react";
|
|
3220
3296
|
import { Select, MenuItem as MenuItem2, FormControl, InputLabel } from "@mui/material";
|
|
3297
|
+
import { visuallyHidden as visuallyHidden2 } from "@mui/utils";
|
|
3221
3298
|
import { jsx as jsx23, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
3222
3299
|
function ThemeSelect({
|
|
3223
3300
|
size = "small",
|
|
@@ -3227,18 +3304,19 @@ function ThemeSelect({
|
|
|
3227
3304
|
sx
|
|
3228
3305
|
}) {
|
|
3229
3306
|
const { currentTheme, themes, setTheme } = useThemeSwitcher();
|
|
3307
|
+
const labelId = useId3();
|
|
3230
3308
|
const handleChange = (event) => {
|
|
3231
3309
|
setTheme(event.target.value);
|
|
3232
3310
|
};
|
|
3233
3311
|
return /* @__PURE__ */ jsxs8(FormControl, { size, variant, sx: __spreadValues({ minWidth: 120 }, sx), children: [
|
|
3234
|
-
|
|
3312
|
+
/* @__PURE__ */ jsx23(InputLabel, { id: labelId, sx: showLabel ? void 0 : visuallyHidden2, children: label }),
|
|
3235
3313
|
/* @__PURE__ */ jsx23(
|
|
3236
3314
|
Select,
|
|
3237
3315
|
{
|
|
3238
|
-
labelId
|
|
3316
|
+
labelId,
|
|
3239
3317
|
value: currentTheme,
|
|
3240
3318
|
onChange: handleChange,
|
|
3241
|
-
label
|
|
3319
|
+
label,
|
|
3242
3320
|
children: themes.map((themeOption) => /* @__PURE__ */ jsx23(MenuItem2, { value: themeOption.key, children: themeOption.label }, themeOption.key))
|
|
3243
3321
|
}
|
|
3244
3322
|
)
|
|
@@ -3272,7 +3350,7 @@ function ThemeSwitcher({
|
|
|
3272
3350
|
}
|
|
3273
3351
|
|
|
3274
3352
|
// src/components/SearchBar/SearchBarWithAdvancedFilter.tsx
|
|
3275
|
-
import * as
|
|
3353
|
+
import * as React7 from "react";
|
|
3276
3354
|
import TextField2 from "@mui/material/TextField";
|
|
3277
3355
|
import InputAdornment2 from "@mui/material/InputAdornment";
|
|
3278
3356
|
import Box7 from "@mui/material/Box";
|
|
@@ -3289,31 +3367,46 @@ import MenuItem3 from "@mui/material/MenuItem";
|
|
|
3289
3367
|
import { ListFilter } from "@wso2/oxygen-ui-icons-react";
|
|
3290
3368
|
|
|
3291
3369
|
// src/components/SearchBar/SearchBarBase.tsx
|
|
3370
|
+
import * as React6 from "react";
|
|
3292
3371
|
import TextField from "@mui/material/TextField";
|
|
3293
3372
|
import InputAdornment from "@mui/material/InputAdornment";
|
|
3294
3373
|
import { Search } from "@wso2/oxygen-ui-icons-react";
|
|
3295
3374
|
import { jsx as jsx25 } from "react/jsx-runtime";
|
|
3296
|
-
|
|
3375
|
+
var hasMeaningfulAriaValue = (value) => typeof value === "string" && value.trim().length > 0;
|
|
3376
|
+
var SearchBarBase = React6.forwardRef(function SearchBarBase2(_a, ref) {
|
|
3297
3377
|
var _b = _a, {
|
|
3298
3378
|
placeholder = "Search",
|
|
3299
3379
|
endAdornment,
|
|
3300
3380
|
slotProps,
|
|
3301
|
-
sx
|
|
3381
|
+
sx,
|
|
3382
|
+
label,
|
|
3383
|
+
"aria-label": ariaLabel,
|
|
3384
|
+
"aria-labelledby": ariaLabelledBy
|
|
3302
3385
|
} = _b, props = __objRest(_b, [
|
|
3303
3386
|
"placeholder",
|
|
3304
3387
|
"endAdornment",
|
|
3305
3388
|
"slotProps",
|
|
3306
|
-
"sx"
|
|
3389
|
+
"sx",
|
|
3390
|
+
"label",
|
|
3391
|
+
"aria-label",
|
|
3392
|
+
"aria-labelledby"
|
|
3307
3393
|
]);
|
|
3394
|
+
const htmlInputSlotProps = slotProps == null ? void 0 : slotProps.htmlInput;
|
|
3395
|
+
const hasMeaningfulLabel = typeof label === "string" ? hasMeaningfulAriaValue(label) : Boolean(label);
|
|
3396
|
+
const hasAccessibleName = hasMeaningfulLabel || hasMeaningfulAriaValue(ariaLabel) || hasMeaningfulAriaValue(ariaLabelledBy) || hasMeaningfulAriaValue(htmlInputSlotProps == null ? void 0 : htmlInputSlotProps["aria-label"]) || hasMeaningfulAriaValue(htmlInputSlotProps == null ? void 0 : htmlInputSlotProps["aria-labelledby"]);
|
|
3397
|
+
const shouldInjectPlaceholderLabel = !hasAccessibleName && hasMeaningfulAriaValue(placeholder);
|
|
3398
|
+
const htmlInput = shouldInjectPlaceholderLabel || (slotProps == null ? void 0 : slotProps.htmlInput) || hasMeaningfulAriaValue(ariaLabel) || hasMeaningfulAriaValue(ariaLabelledBy) ? __spreadValues(__spreadValues(__spreadValues(__spreadValues({}, slotProps == null ? void 0 : slotProps.htmlInput), hasMeaningfulAriaValue(ariaLabelledBy) ? { "aria-labelledby": ariaLabelledBy } : null), hasMeaningfulAriaValue(ariaLabel) ? { "aria-label": ariaLabel } : null), shouldInjectPlaceholderLabel ? { "aria-label": placeholder } : null) : void 0;
|
|
3308
3399
|
return /* @__PURE__ */ jsx25(
|
|
3309
3400
|
TextField,
|
|
3310
3401
|
__spreadProps(__spreadValues({}, props), {
|
|
3402
|
+
ref,
|
|
3403
|
+
label,
|
|
3311
3404
|
placeholder,
|
|
3312
3405
|
variant: "outlined",
|
|
3313
3406
|
size: "small",
|
|
3314
|
-
slotProps: __spreadProps(__spreadValues({}, slotProps), {
|
|
3407
|
+
slotProps: __spreadProps(__spreadValues(__spreadValues({}, slotProps), htmlInput ? { htmlInput } : null), {
|
|
3315
3408
|
input: __spreadProps(__spreadValues({}, slotProps == null ? void 0 : slotProps.input), {
|
|
3316
|
-
startAdornment: /* @__PURE__ */ jsx25(InputAdornment, { position: "start", children: /* @__PURE__ */ jsx25(Search, { fontSize: "small" }) }),
|
|
3409
|
+
startAdornment: /* @__PURE__ */ jsx25(InputAdornment, { position: "start", children: /* @__PURE__ */ jsx25(Search, { fontSize: "small", "aria-hidden": "true" }) }),
|
|
3317
3410
|
endAdornment
|
|
3318
3411
|
})
|
|
3319
3412
|
}),
|
|
@@ -3327,7 +3420,7 @@ function SearchBarBase(_a) {
|
|
|
3327
3420
|
}, sx)
|
|
3328
3421
|
})
|
|
3329
3422
|
);
|
|
3330
|
-
}
|
|
3423
|
+
});
|
|
3331
3424
|
|
|
3332
3425
|
// src/components/SearchBar/SearchBarWithAdvancedFilter.tsx
|
|
3333
3426
|
import { Fragment as Fragment3, jsx as jsx26, jsxs as jsxs9 } from "react/jsx-runtime";
|
|
@@ -3357,7 +3450,7 @@ function SearchBarWithAdvancedFilter(_a) {
|
|
|
3357
3450
|
"popoverWidth",
|
|
3358
3451
|
"sx"
|
|
3359
3452
|
]);
|
|
3360
|
-
const [anchorEl, setAnchorEl] =
|
|
3453
|
+
const [anchorEl, setAnchorEl] = React7.useState(null);
|
|
3361
3454
|
const open = Boolean(anchorEl);
|
|
3362
3455
|
const handleInputChange = (e) => {
|
|
3363
3456
|
onChange(e.target.value);
|
|
@@ -3493,34 +3586,32 @@ function SearchBarWithAdvancedFilter(_a) {
|
|
|
3493
3586
|
var SearchBarWithAdvancedFilter_default = SearchBarWithAdvancedFilter;
|
|
3494
3587
|
|
|
3495
3588
|
// src/components/SearchBar/SearchBar.tsx
|
|
3589
|
+
import * as React8 from "react";
|
|
3496
3590
|
import { jsx as jsx27 } from "react/jsx-runtime";
|
|
3497
|
-
|
|
3498
|
-
var _b = _a, {
|
|
3499
|
-
placeholder = "Search"
|
|
3500
|
-
} = _b, props = __objRest(_b, [
|
|
3501
|
-
"placeholder"
|
|
3502
|
-
]);
|
|
3591
|
+
var SearchBar = React8.forwardRef(function SearchBar2(_a, ref) {
|
|
3592
|
+
var _b = _a, { placeholder = "Search" } = _b, props = __objRest(_b, ["placeholder"]);
|
|
3503
3593
|
return /* @__PURE__ */ jsx27(
|
|
3504
3594
|
SearchBarBase,
|
|
3505
3595
|
__spreadProps(__spreadValues({}, props), {
|
|
3596
|
+
ref,
|
|
3506
3597
|
placeholder
|
|
3507
3598
|
})
|
|
3508
3599
|
);
|
|
3509
|
-
}
|
|
3600
|
+
});
|
|
3510
3601
|
var SearchBar_default = SearchBar;
|
|
3511
3602
|
|
|
3512
3603
|
// src/components/Header/Header.tsx
|
|
3513
|
-
import * as
|
|
3604
|
+
import * as React12 from "react";
|
|
3514
3605
|
import AppBar from "@mui/material/AppBar";
|
|
3515
3606
|
import Toolbar from "@mui/material/Toolbar";
|
|
3516
3607
|
import Box12 from "@mui/material/Box";
|
|
3517
3608
|
import { styled as styled22 } from "@mui/material/styles";
|
|
3518
3609
|
|
|
3519
3610
|
// src/components/Header/context.ts
|
|
3520
|
-
import * as
|
|
3521
|
-
var HeaderContext =
|
|
3611
|
+
import * as React9 from "react";
|
|
3612
|
+
var HeaderContext = React9.createContext(null);
|
|
3522
3613
|
var useHeader = () => {
|
|
3523
|
-
const context =
|
|
3614
|
+
const context = React9.useContext(HeaderContext);
|
|
3524
3615
|
if (!context) {
|
|
3525
3616
|
throw new Error("Header compound components must be used within Header");
|
|
3526
3617
|
}
|
|
@@ -3528,16 +3619,16 @@ var useHeader = () => {
|
|
|
3528
3619
|
};
|
|
3529
3620
|
|
|
3530
3621
|
// src/components/Header/HeaderToggle.tsx
|
|
3531
|
-
import * as
|
|
3622
|
+
import * as React11 from "react";
|
|
3532
3623
|
import IconButton3 from "@mui/material/IconButton";
|
|
3533
3624
|
import Tooltip2 from "@mui/material/Tooltip";
|
|
3534
3625
|
import { styled as styled16 } from "@mui/material/styles";
|
|
3535
|
-
import { Menu,
|
|
3626
|
+
import { Menu as Menu2, ChevronLeft } from "@wso2/oxygen-ui-icons-react";
|
|
3536
3627
|
|
|
3537
3628
|
// src/components/AppShell/context.tsx
|
|
3538
|
-
import * as
|
|
3629
|
+
import * as React10 from "react";
|
|
3539
3630
|
import { jsx as jsx28 } from "react/jsx-runtime";
|
|
3540
|
-
var AppShellContext =
|
|
3631
|
+
var AppShellContext = React10.createContext(void 0);
|
|
3541
3632
|
var AppShellProvider = ({
|
|
3542
3633
|
children,
|
|
3543
3634
|
value
|
|
@@ -3564,15 +3655,26 @@ var HeaderToggle = ({
|
|
|
3564
3655
|
sx
|
|
3565
3656
|
}) => {
|
|
3566
3657
|
var _a, _b;
|
|
3567
|
-
const appShellContext =
|
|
3658
|
+
const appShellContext = React11.useContext(AppShellContext);
|
|
3568
3659
|
const collapsed = (_a = collapsedProp != null ? collapsedProp : appShellContext == null ? void 0 : appShellContext.state.sidebarCollapsed) != null ? _a : false;
|
|
3569
3660
|
const onToggle = (_b = onToggleProp != null ? onToggleProp : appShellContext == null ? void 0 : appShellContext.actions.toggleSidebar) != null ? _b : (() => {
|
|
3570
3661
|
});
|
|
3571
|
-
return /* @__PURE__ */ jsx29(Tooltip2, { title: collapsed ? expandLabel : collapseLabel, children: /* @__PURE__ */ jsx29(
|
|
3662
|
+
return /* @__PURE__ */ jsx29(Tooltip2, { title: collapsed ? expandLabel : collapseLabel, children: /* @__PURE__ */ jsx29(
|
|
3663
|
+
HeaderToggleRoot,
|
|
3664
|
+
{
|
|
3665
|
+
onClick: onToggle,
|
|
3666
|
+
size: "small",
|
|
3667
|
+
sx,
|
|
3668
|
+
"aria-label": collapsed ? expandLabel : collapseLabel,
|
|
3669
|
+
"aria-expanded": !collapsed,
|
|
3670
|
+
children: /* @__PURE__ */ jsx29("span", { "aria-hidden": "true", style: { display: "inline-flex" }, children: collapsed ? expandIcon || /* @__PURE__ */ jsx29(Menu2, { size: 20 }) : collapseIcon || /* @__PURE__ */ jsx29(ChevronLeft, { size: 20 }) })
|
|
3671
|
+
}
|
|
3672
|
+
) });
|
|
3572
3673
|
};
|
|
3573
3674
|
|
|
3574
3675
|
// src/components/Header/HeaderBrand.tsx
|
|
3575
3676
|
import Box9 from "@mui/material/Box";
|
|
3677
|
+
import ButtonBase from "@mui/material/ButtonBase";
|
|
3576
3678
|
import { styled as styled19 } from "@mui/material/styles";
|
|
3577
3679
|
|
|
3578
3680
|
// src/components/Header/HeaderBrandLogo.tsx
|
|
@@ -3631,12 +3733,25 @@ var HeaderBrandRoot = styled19(Box9, {
|
|
|
3631
3733
|
marginLeft: theme.spacing(1),
|
|
3632
3734
|
cursor: clickable ? "pointer" : "default"
|
|
3633
3735
|
}));
|
|
3736
|
+
var HeaderBrandButtonRoot = styled19(ButtonBase, {
|
|
3737
|
+
name: "MuiHeader",
|
|
3738
|
+
slot: "BrandButton"
|
|
3739
|
+
})(({ theme }) => ({
|
|
3740
|
+
display: "flex",
|
|
3741
|
+
alignItems: "center",
|
|
3742
|
+
marginLeft: theme.spacing(1),
|
|
3743
|
+
borderRadius: theme.shape.borderRadius
|
|
3744
|
+
}));
|
|
3634
3745
|
var HeaderBrand = ({
|
|
3635
3746
|
onClick,
|
|
3747
|
+
"aria-label": ariaLabel,
|
|
3636
3748
|
children,
|
|
3637
3749
|
sx
|
|
3638
3750
|
}) => {
|
|
3639
|
-
|
|
3751
|
+
if (onClick) {
|
|
3752
|
+
return /* @__PURE__ */ jsx32(HeaderBrandButtonRoot, { onClick, "aria-label": ariaLabel, sx, children });
|
|
3753
|
+
}
|
|
3754
|
+
return /* @__PURE__ */ jsx32(HeaderBrandRoot, { clickable: false, sx, children });
|
|
3640
3755
|
};
|
|
3641
3756
|
HeaderBrand.displayName = "HeaderBrand";
|
|
3642
3757
|
|
|
@@ -3731,7 +3846,7 @@ var Header = ({
|
|
|
3731
3846
|
minimal = false,
|
|
3732
3847
|
sx
|
|
3733
3848
|
}) => {
|
|
3734
|
-
const contextValue =
|
|
3849
|
+
const contextValue = React12.useMemo(() => ({ minimal }), [minimal]);
|
|
3735
3850
|
return /* @__PURE__ */ jsx35(HeaderContext.Provider, { value: contextValue, children: /* @__PURE__ */ jsx35(HeaderRootStyled, { position: "static", color: "default", elevation: 0, sx, children: /* @__PURE__ */ jsx35(HeaderToolbar, { children }) }) });
|
|
3736
3851
|
};
|
|
3737
3852
|
var HeaderSpacer = ({ sx }) => /* @__PURE__ */ jsx35(HeaderSpacerStyled, { sx });
|
|
@@ -3744,128 +3859,603 @@ Header.Actions = HeaderActions;
|
|
|
3744
3859
|
Header.Spacer = HeaderSpacer;
|
|
3745
3860
|
Header.displayName = "Header";
|
|
3746
3861
|
|
|
3747
|
-
// src/components/
|
|
3748
|
-
import * as
|
|
3749
|
-
import
|
|
3750
|
-
import { styled as
|
|
3862
|
+
// src/components/AppSwitcher/AppSwitcher.tsx
|
|
3863
|
+
import * as React18 from "react";
|
|
3864
|
+
import Popover2 from "@mui/material/Popover";
|
|
3865
|
+
import { styled as styled27 } from "@mui/material/styles";
|
|
3751
3866
|
|
|
3752
|
-
// src/components/
|
|
3753
|
-
import * as
|
|
3754
|
-
var
|
|
3755
|
-
var
|
|
3756
|
-
const context =
|
|
3867
|
+
// src/components/AppSwitcher/context.ts
|
|
3868
|
+
import * as React13 from "react";
|
|
3869
|
+
var AppSwitcherContext = React13.createContext(null);
|
|
3870
|
+
var useAppSwitcher = () => {
|
|
3871
|
+
const context = React13.useContext(AppSwitcherContext);
|
|
3757
3872
|
if (!context) {
|
|
3758
|
-
throw new Error("
|
|
3873
|
+
throw new Error("AppSwitcher sub-components must be used within an AppSwitcher component");
|
|
3759
3874
|
}
|
|
3760
3875
|
return context;
|
|
3761
3876
|
};
|
|
3877
|
+
AppSwitcherContext.displayName = "AppSwitcher.Context";
|
|
3878
|
+
var AppSwitcherFooterContext = React13.createContext(false);
|
|
3879
|
+
AppSwitcherFooterContext.displayName = "AppSwitcher.FooterContext";
|
|
3762
3880
|
|
|
3763
|
-
// src/components/
|
|
3764
|
-
import * as
|
|
3765
|
-
import
|
|
3766
|
-
import
|
|
3881
|
+
// src/components/AppSwitcher/AppSwitcherTrigger.tsx
|
|
3882
|
+
import * as React14 from "react";
|
|
3883
|
+
import IconButton4 from "@mui/material/IconButton";
|
|
3884
|
+
import Tooltip3 from "@mui/material/Tooltip";
|
|
3767
3885
|
import { styled as styled23 } from "@mui/material/styles";
|
|
3768
|
-
import {
|
|
3769
|
-
|
|
3770
|
-
|
|
3771
|
-
|
|
3886
|
+
import { Grip } from "@wso2/oxygen-ui-icons-react";
|
|
3887
|
+
import { jsx as jsx36 } from "react/jsx-runtime";
|
|
3888
|
+
var DEFAULT_LABEL = "Switch Platforms";
|
|
3889
|
+
var AppSwitcherTriggerRoot = styled23(IconButton4, {
|
|
3890
|
+
name: "MuiAppSwitcher",
|
|
3891
|
+
slot: "Trigger"
|
|
3772
3892
|
})(({ theme }) => ({
|
|
3773
|
-
|
|
3774
|
-
|
|
3775
|
-
|
|
3776
|
-
|
|
3777
|
-
|
|
3778
|
-
|
|
3779
|
-
|
|
3780
|
-
|
|
3781
|
-
"&::-webkit-scrollbar-thumb": {
|
|
3782
|
-
backgroundColor: (theme.vars || theme).palette.action.disabled,
|
|
3783
|
-
borderRadius: 3
|
|
3784
|
-
},
|
|
3785
|
-
"&::-webkit-scrollbar-thumb:hover": {
|
|
3786
|
-
backgroundColor: (theme.vars || theme).palette.action.active
|
|
3893
|
+
// The trigger stays a pointer once the popover is open: it is still a live
|
|
3894
|
+
// control, and a second click dismisses the switcher. Stated explicitly so a
|
|
3895
|
+
// future `aria-expanded` style cannot drop it back to the default arrow.
|
|
3896
|
+
cursor: "pointer",
|
|
3897
|
+
'&[aria-expanded="true"]': {
|
|
3898
|
+
backgroundColor: (theme.vars || theme).palette.action.selected,
|
|
3899
|
+
color: (theme.vars || theme).palette.text.primary,
|
|
3900
|
+
cursor: "pointer"
|
|
3787
3901
|
}
|
|
3788
3902
|
}));
|
|
3789
|
-
var
|
|
3790
|
-
|
|
3791
|
-
|
|
3903
|
+
var AppSwitcherTrigger = React14.forwardRef(
|
|
3904
|
+
function AppSwitcherTrigger2(_a, ref) {
|
|
3905
|
+
var _b = _a, { label = DEFAULT_LABEL, icon, onClick, "aria-label": ariaLabel } = _b, props = __objRest(_b, ["label", "icon", "onClick", "aria-label"]);
|
|
3906
|
+
const { open, popoverId, handleOpen } = useAppSwitcher();
|
|
3907
|
+
const resolvedLabel = label.trim().length > 0 ? label : DEFAULT_LABEL;
|
|
3908
|
+
const resolvedAriaLabel = typeof ariaLabel === "string" && ariaLabel.trim().length > 0 ? ariaLabel : resolvedLabel;
|
|
3909
|
+
return /* @__PURE__ */ jsx36(Tooltip3, { title: resolvedLabel, children: /* @__PURE__ */ jsx36(
|
|
3910
|
+
AppSwitcherTriggerRoot,
|
|
3911
|
+
__spreadProps(__spreadValues({}, props), {
|
|
3912
|
+
ref,
|
|
3913
|
+
onClick: (event) => {
|
|
3914
|
+
handleOpen(event);
|
|
3915
|
+
onClick == null ? void 0 : onClick(event);
|
|
3916
|
+
},
|
|
3917
|
+
"aria-label": resolvedAriaLabel,
|
|
3918
|
+
"aria-controls": open ? popoverId : void 0,
|
|
3919
|
+
"aria-haspopup": "true",
|
|
3920
|
+
"aria-expanded": open,
|
|
3921
|
+
children: /* @__PURE__ */ jsx36("span", { "aria-hidden": "true", style: { display: "inline-flex" }, children: icon || /* @__PURE__ */ jsx36(Grip, { size: 24 }) })
|
|
3922
|
+
})
|
|
3923
|
+
) });
|
|
3924
|
+
}
|
|
3925
|
+
);
|
|
3926
|
+
AppSwitcherTrigger.displayName = "AppSwitcher.Trigger";
|
|
3927
|
+
|
|
3928
|
+
// src/components/AppSwitcher/AppSwitcherSection.tsx
|
|
3929
|
+
import * as React15 from "react";
|
|
3930
|
+
import Box13 from "@mui/material/Box";
|
|
3931
|
+
import Typography8 from "@mui/material/Typography";
|
|
3932
|
+
import { styled as styled24 } from "@mui/material/styles";
|
|
3933
|
+
import { jsx as jsx37, jsxs as jsxs11 } from "react/jsx-runtime";
|
|
3934
|
+
var AppSwitcherSectionRoot = styled24(Box13, {
|
|
3935
|
+
name: "MuiAppSwitcher",
|
|
3936
|
+
slot: "Section"
|
|
3792
3937
|
})(({ theme }) => ({
|
|
3793
|
-
|
|
3794
|
-
marginBottom: theme.spacing(1),
|
|
3795
|
-
marginLeft: theme.spacing(2),
|
|
3796
|
-
marginRight: theme.spacing(2)
|
|
3938
|
+
padding: theme.spacing(2)
|
|
3797
3939
|
}));
|
|
3798
|
-
var
|
|
3940
|
+
var AppSwitcherSectionLabel = styled24(Typography8, {
|
|
3941
|
+
name: "MuiAppSwitcher",
|
|
3942
|
+
slot: "SectionLabel"
|
|
3943
|
+
})(({ theme }) => ({
|
|
3944
|
+
color: (theme.vars || theme).palette.text.secondary,
|
|
3945
|
+
fontSize: theme.typography.caption.fontSize,
|
|
3946
|
+
fontWeight: theme.typography.fontWeightBold,
|
|
3947
|
+
// Wide tracking so the headings read as quiet labels rather than as titles.
|
|
3948
|
+
letterSpacing: "0.1em",
|
|
3949
|
+
textTransform: "uppercase",
|
|
3950
|
+
marginBottom: theme.spacing(1.5)
|
|
3951
|
+
}));
|
|
3952
|
+
var AppSwitcherSectionGrid = styled24("ul", {
|
|
3953
|
+
name: "MuiAppSwitcher",
|
|
3954
|
+
slot: "SectionGrid",
|
|
3955
|
+
shouldForwardProp: (prop) => prop !== "ownerState"
|
|
3956
|
+
})(({ theme, ownerState }) => ({
|
|
3957
|
+
display: "grid",
|
|
3958
|
+
gap: theme.spacing(1.5),
|
|
3959
|
+
gridTemplateColumns: "1fr",
|
|
3960
|
+
listStyle: "none",
|
|
3961
|
+
margin: 0,
|
|
3962
|
+
padding: 0,
|
|
3963
|
+
[theme.breakpoints.up("sm")]: {
|
|
3964
|
+
gridTemplateColumns: `repeat(${ownerState.columns}, minmax(0, 1fr))`
|
|
3965
|
+
},
|
|
3966
|
+
"& > li": {
|
|
3967
|
+
display: "contents"
|
|
3968
|
+
}
|
|
3969
|
+
}));
|
|
3970
|
+
var AppSwitcherSection = ({
|
|
3799
3971
|
children,
|
|
3800
|
-
|
|
3801
|
-
|
|
3972
|
+
label,
|
|
3973
|
+
columns = 3
|
|
3802
3974
|
}) => {
|
|
3803
|
-
const
|
|
3804
|
-
const
|
|
3805
|
-
|
|
3806
|
-
|
|
3807
|
-
|
|
3808
|
-
|
|
3975
|
+
const labelId = React15.useId();
|
|
3976
|
+
const gridRef = React15.useRef(null);
|
|
3977
|
+
const handleKeyDown = (event) => {
|
|
3978
|
+
var _a, _b;
|
|
3979
|
+
const keys = ["ArrowRight", "ArrowLeft", "ArrowDown", "ArrowUp", "Home", "End"];
|
|
3980
|
+
if (!keys.includes(event.key)) {
|
|
3981
|
+
return;
|
|
3982
|
+
}
|
|
3983
|
+
const cards = Array.from(
|
|
3984
|
+
(_b = (_a = gridRef.current) == null ? void 0 : _a.querySelectorAll("[data-app-switcher-app]")) != null ? _b : []
|
|
3985
|
+
);
|
|
3986
|
+
if (cards.length === 0) {
|
|
3987
|
+
return;
|
|
3988
|
+
}
|
|
3989
|
+
const currentIndex = cards.indexOf(document.activeElement);
|
|
3990
|
+
if (currentIndex === -1) {
|
|
3991
|
+
return;
|
|
3992
|
+
}
|
|
3993
|
+
const firstTop = cards[0].getBoundingClientRect().top;
|
|
3994
|
+
const perRow = Math.max(
|
|
3995
|
+
1,
|
|
3996
|
+
cards.filter((card) => card.getBoundingClientRect().top === firstTop).length
|
|
3997
|
+
);
|
|
3998
|
+
let nextIndex = currentIndex;
|
|
3999
|
+
switch (event.key) {
|
|
4000
|
+
case "ArrowRight":
|
|
4001
|
+
nextIndex = currentIndex + 1;
|
|
4002
|
+
break;
|
|
4003
|
+
case "ArrowLeft":
|
|
4004
|
+
nextIndex = currentIndex - 1;
|
|
4005
|
+
break;
|
|
4006
|
+
case "ArrowDown":
|
|
4007
|
+
nextIndex = currentIndex + perRow;
|
|
4008
|
+
break;
|
|
4009
|
+
case "ArrowUp":
|
|
4010
|
+
nextIndex = currentIndex - perRow;
|
|
4011
|
+
break;
|
|
4012
|
+
case "Home":
|
|
4013
|
+
nextIndex = 0;
|
|
4014
|
+
break;
|
|
4015
|
+
case "End":
|
|
4016
|
+
nextIndex = cards.length - 1;
|
|
4017
|
+
break;
|
|
4018
|
+
default:
|
|
4019
|
+
break;
|
|
4020
|
+
}
|
|
4021
|
+
if (nextIndex < 0 || nextIndex >= cards.length) {
|
|
4022
|
+
return;
|
|
4023
|
+
}
|
|
4024
|
+
event.preventDefault();
|
|
4025
|
+
cards[nextIndex].focus();
|
|
4026
|
+
};
|
|
4027
|
+
return /* @__PURE__ */ jsxs11(AppSwitcherSectionRoot, { children: [
|
|
4028
|
+
label && /* @__PURE__ */ jsx37(AppSwitcherSectionLabel, { id: labelId, children: label }),
|
|
4029
|
+
/* @__PURE__ */ jsx37(
|
|
4030
|
+
AppSwitcherSectionGrid,
|
|
4031
|
+
{
|
|
4032
|
+
ref: gridRef,
|
|
4033
|
+
ownerState: { columns },
|
|
4034
|
+
role: "list",
|
|
4035
|
+
"aria-labelledby": label ? labelId : void 0,
|
|
4036
|
+
onKeyDown: handleKeyDown,
|
|
4037
|
+
children: React15.Children.map(
|
|
4038
|
+
children,
|
|
4039
|
+
(child) => React15.isValidElement(child) ? /* @__PURE__ */ jsx37("li", { children: child }) : child
|
|
4040
|
+
)
|
|
4041
|
+
}
|
|
4042
|
+
)
|
|
4043
|
+
] });
|
|
3809
4044
|
};
|
|
4045
|
+
AppSwitcherSection.displayName = "AppSwitcher.Section";
|
|
3810
4046
|
|
|
3811
|
-
// src/components/
|
|
3812
|
-
import * as
|
|
4047
|
+
// src/components/AppSwitcher/AppSwitcherApp.tsx
|
|
4048
|
+
import * as React16 from "react";
|
|
3813
4049
|
import Box14 from "@mui/material/Box";
|
|
3814
|
-
import
|
|
4050
|
+
import Card2 from "@mui/material/Card";
|
|
4051
|
+
import ButtonBase2 from "@mui/material/ButtonBase";
|
|
4052
|
+
import Tooltip4 from "@mui/material/Tooltip";
|
|
4053
|
+
import Typography9 from "@mui/material/Typography";
|
|
3815
4054
|
import { styled as styled25 } from "@mui/material/styles";
|
|
3816
4055
|
|
|
3817
|
-
// src/components/
|
|
3818
|
-
|
|
3819
|
-
|
|
3820
|
-
|
|
3821
|
-
|
|
3822
|
-
|
|
3823
|
-
|
|
3824
|
-
|
|
3825
|
-
|
|
3826
|
-
|
|
3827
|
-
|
|
3828
|
-
paddingTop: collapsed ? 0 : theme.spacing(1),
|
|
3829
|
-
paddingBottom: collapsed ? 0 : theme.spacing(1),
|
|
3830
|
-
height: collapsed ? 0 : "auto",
|
|
3831
|
-
opacity: collapsed ? 0 : 1,
|
|
3832
|
-
overflow: "hidden",
|
|
3833
|
-
transition: theme.transitions.create(["padding", "height", "opacity"], {
|
|
3834
|
-
easing: theme.transitions.easing.sharp,
|
|
3835
|
-
duration: collapsed ? theme.transitions.duration.leavingScreen : theme.transitions.duration.enteringScreen
|
|
3836
|
-
}),
|
|
3837
|
-
display: "block",
|
|
3838
|
-
color: (theme.vars || theme).palette.text.secondary,
|
|
3839
|
-
fontWeight: 600,
|
|
3840
|
-
textTransform: "uppercase",
|
|
3841
|
-
letterSpacing: "0.5px",
|
|
3842
|
-
fontSize: 11
|
|
3843
|
-
}));
|
|
3844
|
-
var SidebarCategoryLabel = ({ children, sx }) => {
|
|
3845
|
-
const { collapsed } = useSidebar();
|
|
3846
|
-
return /* @__PURE__ */ jsx37(SidebarCategoryLabelRoot, { variant: "caption", collapsed, sx, children });
|
|
4056
|
+
// src/components/AppSwitcher/brand.ts
|
|
4057
|
+
var APP_SWITCHER_BRAND = {
|
|
4058
|
+
/** Full-strength WSO2 orange. Decorative surfaces only. */
|
|
4059
|
+
main: "#FF7300",
|
|
4060
|
+
/**
|
|
4061
|
+
* Darker orange reserved for the focus ring, where 3:1 against the card
|
|
4062
|
+
* surface is required. Do not swap it back to `main`.
|
|
4063
|
+
*/
|
|
4064
|
+
focus: "#E56800",
|
|
4065
|
+
/** Faded orange for the mark of a platform that is not yet available. */
|
|
4066
|
+
surfaceMark: "#FFC199"
|
|
3847
4067
|
};
|
|
3848
|
-
SidebarCategoryLabel.displayName = "SidebarCategoryLabel";
|
|
3849
4068
|
|
|
3850
|
-
// src/components/
|
|
4069
|
+
// src/components/AppSwitcher/AppSwitcherApp.tsx
|
|
4070
|
+
import { WSO2 } from "@wso2/oxygen-ui-icons-react";
|
|
3851
4071
|
import { jsx as jsx38, jsxs as jsxs12 } from "react/jsx-runtime";
|
|
3852
|
-
var
|
|
3853
|
-
name: "
|
|
3854
|
-
slot: "
|
|
3855
|
-
|
|
3856
|
-
|
|
3857
|
-
|
|
3858
|
-
|
|
3859
|
-
|
|
3860
|
-
|
|
3861
|
-
|
|
3862
|
-
|
|
3863
|
-
|
|
3864
|
-
|
|
3865
|
-
|
|
3866
|
-
|
|
3867
|
-
|
|
3868
|
-
|
|
4072
|
+
var AppSwitcherAppRoot = styled25(Card2, {
|
|
4073
|
+
name: "MuiAppSwitcher",
|
|
4074
|
+
slot: "App",
|
|
4075
|
+
shouldForwardProp: (prop) => prop !== "ownerState"
|
|
4076
|
+
})(({ theme, ownerState }) => {
|
|
4077
|
+
const accent = APP_SWITCHER_BRAND.main;
|
|
4078
|
+
const manage = ownerState.tone === "manage";
|
|
4079
|
+
return __spreadProps(__spreadValues({
|
|
4080
|
+
display: "flex",
|
|
4081
|
+
flexDirection: "column",
|
|
4082
|
+
alignItems: "center",
|
|
4083
|
+
justifyContent: "center",
|
|
4084
|
+
// The manage row is a denser, secondary version of the same card: a smaller
|
|
4085
|
+
// mark, tighter gap and less height, so it reads as settings rather than as
|
|
4086
|
+
// another row of products.
|
|
4087
|
+
gap: theme.spacing(manage ? 0.75 : 1.25),
|
|
4088
|
+
width: "100%",
|
|
4089
|
+
// A fixed height rather than a floor, so every card in the switcher is the
|
|
4090
|
+
// same size whether its name runs to one line or two. The name itself is
|
|
4091
|
+
// clamped to two lines, so nothing can outgrow the box.
|
|
4092
|
+
height: theme.spacing(manage ? 9 : 13),
|
|
4093
|
+
padding: manage ? theme.spacing(1, 1) : theme.spacing(1.25, 1),
|
|
4094
|
+
textAlign: "center",
|
|
4095
|
+
// A navigable card renders as an `<a>`, which underlines its text by
|
|
4096
|
+
// default. The card is the link target, not the words, so the underline is
|
|
4097
|
+
// cleared here rather than on the name alone.
|
|
4098
|
+
textDecoration: "none",
|
|
4099
|
+
transition: theme.transitions.create(
|
|
4100
|
+
["border-color", "box-shadow", "background-color", "transform"],
|
|
4101
|
+
{ duration: theme.transitions.duration.shorter }
|
|
4102
|
+
),
|
|
4103
|
+
"&.MuiCard-root": {
|
|
4104
|
+
borderColor: (theme.vars || theme).palette.divider,
|
|
4105
|
+
backgroundColor: (theme.vars || theme).palette.background.paper
|
|
4106
|
+
}
|
|
4107
|
+
}, ownerState.disabled && {
|
|
4108
|
+
cursor: "not-allowed",
|
|
4109
|
+
"&.MuiCard-root": {
|
|
4110
|
+
borderColor: (theme.vars || theme).palette.divider,
|
|
4111
|
+
backgroundColor: (theme.vars || theme).palette.action.hover
|
|
4112
|
+
}
|
|
4113
|
+
}), {
|
|
4114
|
+
"&:hover": __spreadValues({}, !ownerState.disabled && {
|
|
4115
|
+
borderColor: accent,
|
|
4116
|
+
boxShadow: theme.shadows[2],
|
|
4117
|
+
transform: "translateY(-2px)"
|
|
4118
|
+
}),
|
|
4119
|
+
// MUI only adds `.Mui-focusVisible` on ButtonBase; anchors and consumer
|
|
4120
|
+
// components need the native selector to get the same ring.
|
|
4121
|
+
"&.Mui-focusVisible, &:focus-visible": {
|
|
4122
|
+
// The focus ring uses the darker brand token so it clears the 3:1 that
|
|
4123
|
+
// WCAG 2.1 SC 1.4.11 asks of an author-defined focus indicator.
|
|
4124
|
+
outline: `2px solid ${APP_SWITCHER_BRAND.focus}`,
|
|
4125
|
+
outlineOffset: 2
|
|
4126
|
+
},
|
|
4127
|
+
// Motion is decoration here; the border and shadow still carry the state.
|
|
4128
|
+
"@media (prefers-reduced-motion: reduce)": {
|
|
4129
|
+
transition: "none",
|
|
4130
|
+
"&:hover": {
|
|
4131
|
+
transform: "none"
|
|
4132
|
+
}
|
|
4133
|
+
}
|
|
4134
|
+
});
|
|
4135
|
+
});
|
|
4136
|
+
var AppSwitcherAppIcon = styled25(Box14, {
|
|
4137
|
+
name: "MuiAppSwitcher",
|
|
4138
|
+
slot: "AppIcon",
|
|
4139
|
+
shouldForwardProp: (prop) => prop !== "ownerState"
|
|
4140
|
+
})(({ theme, ownerState }) => {
|
|
4141
|
+
const manage = ownerState.tone === "manage";
|
|
4142
|
+
return __spreadProps(__spreadValues(__spreadProps(__spreadValues({
|
|
4143
|
+
display: "inline-flex",
|
|
4144
|
+
alignItems: "center",
|
|
4145
|
+
justifyContent: "center",
|
|
4146
|
+
flexShrink: 0
|
|
4147
|
+
}, manage && {
|
|
4148
|
+
width: theme.spacing(3.5),
|
|
4149
|
+
height: theme.spacing(3.5)
|
|
4150
|
+
}), {
|
|
4151
|
+
borderRadius: "50%",
|
|
4152
|
+
backgroundColor: manage ? (theme.vars || theme).palette.action.hover : "transparent",
|
|
4153
|
+
// The WSO2 mark is brand artwork rather than a themed accent, so it stays
|
|
4154
|
+
// orange; manage glyphs are neutral so they read as settings.
|
|
4155
|
+
color: manage ? (theme.vars || theme).palette.text.secondary : APP_SWITCHER_BRAND.main
|
|
4156
|
+
}), ownerState.disabled && {
|
|
4157
|
+
color: manage ? (theme.vars || theme).palette.text.disabled : APP_SWITCHER_BRAND.surfaceMark
|
|
4158
|
+
}), {
|
|
4159
|
+
"& svg": {
|
|
4160
|
+
display: "block"
|
|
4161
|
+
}
|
|
4162
|
+
});
|
|
4163
|
+
});
|
|
4164
|
+
var AppSwitcherAppName = styled25(Typography9, {
|
|
4165
|
+
name: "MuiAppSwitcher",
|
|
4166
|
+
slot: "AppName",
|
|
4167
|
+
shouldForwardProp: (prop) => prop !== "ownerState"
|
|
4168
|
+
})(({ theme, ownerState }) => ({
|
|
4169
|
+
// Both rows take the same size; the manage row stays secondary through its
|
|
4170
|
+
// lighter weight and smaller mark rather than through a smaller label.
|
|
4171
|
+
fontSize: theme.typography.body2.fontSize,
|
|
4172
|
+
fontWeight: ownerState.tone === "manage" ? theme.typography.fontWeightRegular : theme.typography.fontWeightMedium,
|
|
4173
|
+
lineHeight: 1.35,
|
|
4174
|
+
// Grey rather than full-strength text: the mark carries the card, and the
|
|
4175
|
+
// names sit a step back from it.
|
|
4176
|
+
color: ownerState.disabled ? (theme.vars || theme).palette.text.disabled : (theme.vars || theme).palette.text.secondary,
|
|
4177
|
+
// `minmax(0, 1fr)` grid tracks still let a long unbroken name push the card
|
|
4178
|
+
// wider, so wrap rather than overflow.
|
|
4179
|
+
overflowWrap: "anywhere",
|
|
4180
|
+
// The card is a fixed height, so a long name is clamped instead of spilling
|
|
4181
|
+
// past the border. The manage row is sized for a single line, the platform
|
|
4182
|
+
// row for two.
|
|
4183
|
+
display: "-webkit-box",
|
|
4184
|
+
WebkitBoxOrient: "vertical",
|
|
4185
|
+
WebkitLineClamp: ownerState.tone === "manage" ? 1 : 2,
|
|
4186
|
+
overflow: "hidden"
|
|
4187
|
+
}));
|
|
4188
|
+
var AppSwitcherApp = React16.forwardRef(
|
|
4189
|
+
function AppSwitcherApp2({
|
|
4190
|
+
name,
|
|
4191
|
+
url,
|
|
4192
|
+
icon,
|
|
4193
|
+
tone: toneProp,
|
|
4194
|
+
disabled = false,
|
|
4195
|
+
tooltip,
|
|
4196
|
+
component,
|
|
4197
|
+
componentProps,
|
|
4198
|
+
target = "_blank",
|
|
4199
|
+
onClick
|
|
4200
|
+
}, ref) {
|
|
4201
|
+
const inFooter = React16.useContext(AppSwitcherFooterContext);
|
|
4202
|
+
const tone = toneProp != null ? toneProp : inFooter ? "manage" : "platform";
|
|
4203
|
+
const handleClick = (event) => {
|
|
4204
|
+
if (disabled) {
|
|
4205
|
+
event.preventDefault();
|
|
4206
|
+
return;
|
|
4207
|
+
}
|
|
4208
|
+
onClick == null ? void 0 : onClick(event);
|
|
4209
|
+
};
|
|
4210
|
+
const ownerState = { disabled, tone };
|
|
4211
|
+
const renderAsLink = Boolean(url) && !disabled;
|
|
4212
|
+
const effectiveTarget = typeof (componentProps == null ? void 0 : componentProps.target) === "string" ? componentProps.target : target;
|
|
4213
|
+
const linkProps = __spreadValues(__spreadValues({}, url && { href: url }), effectiveTarget && { target: effectiveTarget });
|
|
4214
|
+
const relProps = effectiveTarget === "_blank" ? { rel: "noopener noreferrer" } : {};
|
|
4215
|
+
const anchorProps = component && !disabled ? __spreadValues(__spreadValues(__spreadValues({ component }, componentProps), linkProps), relProps) : renderAsLink ? __spreadValues(__spreadValues({ component: "a" }, linkProps), relProps) : { component: ButtonBase2 };
|
|
4216
|
+
const handleKeyDown = (event) => {
|
|
4217
|
+
if (disabled && (event.key === "Enter" || event.key === " ")) {
|
|
4218
|
+
event.preventDefault();
|
|
4219
|
+
}
|
|
4220
|
+
};
|
|
4221
|
+
const card = /* @__PURE__ */ jsxs12(
|
|
4222
|
+
AppSwitcherAppRoot,
|
|
4223
|
+
__spreadProps(__spreadValues({}, anchorProps), {
|
|
4224
|
+
ref,
|
|
4225
|
+
ownerState,
|
|
4226
|
+
variant: "outlined",
|
|
4227
|
+
onClick: handleClick,
|
|
4228
|
+
onKeyDown: handleKeyDown,
|
|
4229
|
+
"data-app-switcher-app": "",
|
|
4230
|
+
"aria-disabled": disabled ? "true" : void 0,
|
|
4231
|
+
children: [
|
|
4232
|
+
/* @__PURE__ */ jsx38(AppSwitcherAppIcon, { ownerState, "aria-hidden": "true", children: icon != null ? icon : /* @__PURE__ */ jsx38(WSO2, { size: tone === "manage" ? 16 : 32 }) }),
|
|
4233
|
+
/* @__PURE__ */ jsx38(AppSwitcherAppName, { ownerState, children: name })
|
|
4234
|
+
]
|
|
4235
|
+
})
|
|
4236
|
+
);
|
|
4237
|
+
return tooltip ? /* @__PURE__ */ jsx38(Tooltip4, { title: tooltip, describeChild: true, children: card }) : card;
|
|
4238
|
+
}
|
|
4239
|
+
);
|
|
4240
|
+
AppSwitcherApp.displayName = "AppSwitcher.App";
|
|
4241
|
+
|
|
4242
|
+
// src/components/AppSwitcher/AppSwitcherFooter.tsx
|
|
4243
|
+
import * as React17 from "react";
|
|
4244
|
+
import Box15 from "@mui/material/Box";
|
|
4245
|
+
import { alpha, styled as styled26 } from "@mui/material/styles";
|
|
4246
|
+
import { jsx as jsx39 } from "react/jsx-runtime";
|
|
4247
|
+
var AppSwitcherFooterRoot = styled26(Box15, {
|
|
4248
|
+
name: "MuiAppSwitcher",
|
|
4249
|
+
slot: "Footer"
|
|
4250
|
+
})(({ theme }) => ({
|
|
4251
|
+
borderTop: `1px solid ${(theme.vars || theme).palette.divider}`,
|
|
4252
|
+
// A wash rather than a fill: the divider already separates the manage row, so
|
|
4253
|
+
// the tint only needs to hint that it is a different kind of destination.
|
|
4254
|
+
// `action.hover` at full strength reads as a grey block behind the cards.
|
|
4255
|
+
backgroundColor: theme.vars ? `rgba(${theme.vars.palette.common.onBackgroundChannel} / 0.02)` : alpha(theme.palette.text.primary, 0.02)
|
|
4256
|
+
}));
|
|
4257
|
+
var AppSwitcherFooter = ({
|
|
4258
|
+
children,
|
|
4259
|
+
links,
|
|
4260
|
+
label = "Manage",
|
|
4261
|
+
columns = 3
|
|
4262
|
+
}) => {
|
|
4263
|
+
const cards = children != null ? children : links == null ? void 0 : links.map((_a) => {
|
|
4264
|
+
var _b = _a, { key } = _b, link = __objRest(_b, ["key"]);
|
|
4265
|
+
return /* @__PURE__ */ jsx39(AppSwitcherApp, __spreadValues({}, link), key);
|
|
4266
|
+
});
|
|
4267
|
+
if (React17.Children.toArray(cards).length === 0) {
|
|
4268
|
+
return null;
|
|
4269
|
+
}
|
|
4270
|
+
return /* @__PURE__ */ jsx39(AppSwitcherFooterRoot, { children: /* @__PURE__ */ jsx39(AppSwitcherFooterContext.Provider, { value: true, children: /* @__PURE__ */ jsx39(AppSwitcherSection, { label, columns, children: cards }) }) });
|
|
4271
|
+
};
|
|
4272
|
+
AppSwitcherFooter.displayName = "AppSwitcher.Footer";
|
|
4273
|
+
|
|
4274
|
+
// src/components/AppSwitcher/AppSwitcher.tsx
|
|
4275
|
+
import { jsx as jsx40, jsxs as jsxs13 } from "react/jsx-runtime";
|
|
4276
|
+
var AppSwitcherRoot = styled27(Popover2, {
|
|
4277
|
+
name: "MuiAppSwitcher",
|
|
4278
|
+
slot: "Root",
|
|
4279
|
+
shouldForwardProp: (prop) => prop !== "ownerState"
|
|
4280
|
+
})(({ theme, ownerState }) => ({
|
|
4281
|
+
"& .MuiPopover-paper": {
|
|
4282
|
+
width: `calc(100vw - ${theme.spacing(4)})`,
|
|
4283
|
+
maxWidth: "100%",
|
|
4284
|
+
marginTop: theme.spacing(1),
|
|
4285
|
+
overflow: "hidden",
|
|
4286
|
+
[theme.breakpoints.up("sm")]: {
|
|
4287
|
+
width: ownerState.width
|
|
4288
|
+
}
|
|
4289
|
+
}
|
|
4290
|
+
}));
|
|
4291
|
+
var AppSwitcher = ({ children, width = 460, "aria-label": ariaLabelProp, sx }) => {
|
|
4292
|
+
const [anchorEl, setAnchorEl] = React18.useState(null);
|
|
4293
|
+
const open = Boolean(anchorEl);
|
|
4294
|
+
const popoverId = React18.useId();
|
|
4295
|
+
const handleOpen = React18.useCallback((event) => {
|
|
4296
|
+
const target = event.currentTarget;
|
|
4297
|
+
setAnchorEl((current) => current ? null : target);
|
|
4298
|
+
}, []);
|
|
4299
|
+
const handleClose = React18.useCallback(() => {
|
|
4300
|
+
setAnchorEl(null);
|
|
4301
|
+
}, []);
|
|
4302
|
+
const ariaLabel = typeof ariaLabelProp === "string" && ariaLabelProp.trim().length > 0 ? ariaLabelProp : "Applications";
|
|
4303
|
+
const contextValue = React18.useMemo(
|
|
4304
|
+
() => ({ open, anchorEl, popoverId, handleOpen, handleClose }),
|
|
4305
|
+
[open, anchorEl, popoverId, handleOpen, handleClose]
|
|
4306
|
+
);
|
|
4307
|
+
const childrenArray = React18.Children.toArray(children);
|
|
4308
|
+
const triggerChild = childrenArray.find(
|
|
4309
|
+
(child) => React18.isValidElement(child) && child.type === AppSwitcherTrigger
|
|
4310
|
+
);
|
|
4311
|
+
const popoverChildren = childrenArray.filter((child) => child !== triggerChild);
|
|
4312
|
+
return /* @__PURE__ */ jsxs13(AppSwitcherContext.Provider, { value: contextValue, children: [
|
|
4313
|
+
triggerChild,
|
|
4314
|
+
/* @__PURE__ */ jsx40(
|
|
4315
|
+
AppSwitcherRoot,
|
|
4316
|
+
{
|
|
4317
|
+
id: popoverId,
|
|
4318
|
+
ownerState: { width },
|
|
4319
|
+
anchorEl,
|
|
4320
|
+
open,
|
|
4321
|
+
onClose: handleClose,
|
|
4322
|
+
anchorOrigin: { vertical: "bottom", horizontal: "right" },
|
|
4323
|
+
transformOrigin: { vertical: "top", horizontal: "right" },
|
|
4324
|
+
slotProps: { paper: { role: "dialog", "aria-label": ariaLabel } },
|
|
4325
|
+
sx,
|
|
4326
|
+
children: popoverChildren
|
|
4327
|
+
}
|
|
4328
|
+
)
|
|
4329
|
+
] });
|
|
4330
|
+
};
|
|
4331
|
+
AppSwitcher.Trigger = AppSwitcherTrigger;
|
|
4332
|
+
AppSwitcher.Section = AppSwitcherSection;
|
|
4333
|
+
AppSwitcher.App = AppSwitcherApp;
|
|
4334
|
+
AppSwitcher.Footer = AppSwitcherFooter;
|
|
4335
|
+
AppSwitcher.displayName = "AppSwitcher";
|
|
4336
|
+
|
|
4337
|
+
// src/components/Sidebar/Sidebar.tsx
|
|
4338
|
+
import * as React26 from "react";
|
|
4339
|
+
import Box21 from "@mui/material/Box";
|
|
4340
|
+
import { styled as styled40 } from "@mui/material/styles";
|
|
4341
|
+
|
|
4342
|
+
// src/components/Sidebar/context.ts
|
|
4343
|
+
import * as React19 from "react";
|
|
4344
|
+
var SidebarContext = React19.createContext(null);
|
|
4345
|
+
var useSidebar = () => {
|
|
4346
|
+
const context = React19.useContext(SidebarContext);
|
|
4347
|
+
if (!context) {
|
|
4348
|
+
throw new Error("Sidebar compound components must be used within Sidebar");
|
|
4349
|
+
}
|
|
4350
|
+
return context;
|
|
4351
|
+
};
|
|
4352
|
+
|
|
4353
|
+
// src/components/Sidebar/SidebarNav.tsx
|
|
4354
|
+
import * as React20 from "react";
|
|
4355
|
+
import Box16 from "@mui/material/Box";
|
|
4356
|
+
import Divider3 from "@mui/material/Divider";
|
|
4357
|
+
import { styled as styled28 } from "@mui/material/styles";
|
|
4358
|
+
import { jsx as jsx41, jsxs as jsxs14 } from "react/jsx-runtime";
|
|
4359
|
+
var SidebarNavRoot = styled28(Box16, {
|
|
4360
|
+
name: "MuiSidebar",
|
|
4361
|
+
slot: "Nav"
|
|
4362
|
+
})(({ theme }) => ({
|
|
4363
|
+
flex: 1,
|
|
4364
|
+
overflowY: "auto",
|
|
4365
|
+
overflowX: "hidden",
|
|
4366
|
+
paddingTop: theme.spacing(1),
|
|
4367
|
+
paddingBottom: theme.spacing(1),
|
|
4368
|
+
"&::-webkit-scrollbar": {
|
|
4369
|
+
width: 6
|
|
4370
|
+
},
|
|
4371
|
+
"&::-webkit-scrollbar-thumb": {
|
|
4372
|
+
backgroundColor: (theme.vars || theme).palette.action.disabled,
|
|
4373
|
+
borderRadius: 3
|
|
4374
|
+
},
|
|
4375
|
+
"&::-webkit-scrollbar-thumb:hover": {
|
|
4376
|
+
backgroundColor: (theme.vars || theme).palette.action.active
|
|
4377
|
+
}
|
|
4378
|
+
}));
|
|
4379
|
+
var SidebarNavDivider = styled28(Divider3, {
|
|
4380
|
+
name: "MuiSidebar",
|
|
4381
|
+
slot: "NavDivider"
|
|
4382
|
+
})(({ theme }) => ({
|
|
4383
|
+
marginTop: theme.spacing(1),
|
|
4384
|
+
marginBottom: theme.spacing(1),
|
|
4385
|
+
marginLeft: theme.spacing(2),
|
|
4386
|
+
marginRight: theme.spacing(2)
|
|
4387
|
+
}));
|
|
4388
|
+
var SidebarNav = ({
|
|
4389
|
+
children,
|
|
4390
|
+
showDividers = true,
|
|
4391
|
+
sx
|
|
4392
|
+
}) => {
|
|
4393
|
+
const { collapsed } = useSidebar();
|
|
4394
|
+
const childArray = React20.Children.toArray(children);
|
|
4395
|
+
return /* @__PURE__ */ jsx41(SidebarNavRoot, { component: "nav", sx, children: childArray.map((child, index) => /* @__PURE__ */ jsxs14(React20.Fragment, { children: [
|
|
4396
|
+
index > 0 && showDividers && !collapsed && /* @__PURE__ */ jsx41(SidebarNavDivider, {}),
|
|
4397
|
+
child
|
|
4398
|
+
] }, index)) });
|
|
4399
|
+
};
|
|
4400
|
+
|
|
4401
|
+
// src/components/Sidebar/SidebarCategory.tsx
|
|
4402
|
+
import * as React21 from "react";
|
|
4403
|
+
import Box17 from "@mui/material/Box";
|
|
4404
|
+
import List from "@mui/material/List";
|
|
4405
|
+
import { styled as styled30 } from "@mui/material/styles";
|
|
4406
|
+
|
|
4407
|
+
// src/components/Sidebar/SidebarCategoryLabel.tsx
|
|
4408
|
+
import Typography10 from "@mui/material/Typography";
|
|
4409
|
+
import { styled as styled29 } from "@mui/material/styles";
|
|
4410
|
+
import { jsx as jsx42 } from "react/jsx-runtime";
|
|
4411
|
+
var SidebarCategoryLabelRoot = styled29(Typography10, {
|
|
4412
|
+
name: "MuiSidebar",
|
|
4413
|
+
slot: "CategoryLabel",
|
|
4414
|
+
shouldForwardProp: (prop) => prop !== "collapsed"
|
|
4415
|
+
})(({ theme, collapsed }) => ({
|
|
4416
|
+
paddingLeft: theme.spacing(3),
|
|
4417
|
+
paddingRight: theme.spacing(3),
|
|
4418
|
+
paddingTop: collapsed ? 0 : theme.spacing(1),
|
|
4419
|
+
paddingBottom: collapsed ? 0 : theme.spacing(1),
|
|
4420
|
+
height: collapsed ? 0 : "auto",
|
|
4421
|
+
opacity: collapsed ? 0 : 1,
|
|
4422
|
+
overflow: "hidden",
|
|
4423
|
+
transition: theme.transitions.create(["padding", "height", "opacity"], {
|
|
4424
|
+
easing: theme.transitions.easing.sharp,
|
|
4425
|
+
duration: collapsed ? theme.transitions.duration.leavingScreen : theme.transitions.duration.enteringScreen
|
|
4426
|
+
}),
|
|
4427
|
+
display: "block",
|
|
4428
|
+
color: (theme.vars || theme).palette.text.secondary,
|
|
4429
|
+
fontWeight: 600,
|
|
4430
|
+
textTransform: "uppercase",
|
|
4431
|
+
letterSpacing: "0.5px",
|
|
4432
|
+
fontSize: 11
|
|
4433
|
+
}));
|
|
4434
|
+
var SidebarCategoryLabel = ({ children, sx }) => {
|
|
4435
|
+
const { collapsed } = useSidebar();
|
|
4436
|
+
return /* @__PURE__ */ jsx42(SidebarCategoryLabelRoot, { variant: "caption", collapsed, sx, children });
|
|
4437
|
+
};
|
|
4438
|
+
SidebarCategoryLabel.displayName = "SidebarCategoryLabel";
|
|
4439
|
+
|
|
4440
|
+
// src/components/Sidebar/SidebarCategory.tsx
|
|
4441
|
+
import { jsx as jsx43, jsxs as jsxs15 } from "react/jsx-runtime";
|
|
4442
|
+
var SidebarCategoryRoot = styled30(Box17, {
|
|
4443
|
+
name: "MuiSidebar",
|
|
4444
|
+
slot: "Category"
|
|
4445
|
+
})(({ theme }) => ({
|
|
4446
|
+
marginBottom: theme.spacing(1)
|
|
4447
|
+
}));
|
|
4448
|
+
var separateChildren = (children) => {
|
|
4449
|
+
let labelChild = null;
|
|
4450
|
+
const otherChildren = [];
|
|
4451
|
+
React21.Children.forEach(children, (child) => {
|
|
4452
|
+
var _a;
|
|
4453
|
+
if (React21.isValidElement(child)) {
|
|
4454
|
+
const displayName = (_a = child.type) == null ? void 0 : _a.displayName;
|
|
4455
|
+
if (displayName === "SidebarCategoryLabel") {
|
|
4456
|
+
labelChild = child;
|
|
4457
|
+
} else {
|
|
4458
|
+
otherChildren.push(child);
|
|
3869
4459
|
}
|
|
3870
4460
|
} else {
|
|
3871
4461
|
otherChildren.push(child);
|
|
@@ -3878,33 +4468,35 @@ var SidebarCategory = ({
|
|
|
3878
4468
|
sx
|
|
3879
4469
|
}) => {
|
|
3880
4470
|
const { labelChild, otherChildren } = separateChildren(children);
|
|
3881
|
-
return /* @__PURE__ */
|
|
4471
|
+
return /* @__PURE__ */ jsxs15(SidebarCategoryRoot, { sx, children: [
|
|
3882
4472
|
labelChild,
|
|
3883
|
-
/* @__PURE__ */
|
|
4473
|
+
/* @__PURE__ */ jsx43(List, { disablePadding: true, children: otherChildren })
|
|
3884
4474
|
] });
|
|
3885
4475
|
};
|
|
3886
4476
|
SidebarCategory.displayName = "SidebarCategory";
|
|
3887
4477
|
|
|
3888
4478
|
// src/components/Sidebar/SidebarItem.tsx
|
|
3889
|
-
import * as
|
|
3890
|
-
import
|
|
4479
|
+
import * as React24 from "react";
|
|
4480
|
+
import Box18 from "@mui/material/Box";
|
|
3891
4481
|
import List2 from "@mui/material/List";
|
|
3892
4482
|
import ListItem from "@mui/material/ListItem";
|
|
3893
4483
|
import ListItemButton from "@mui/material/ListItemButton";
|
|
3894
4484
|
import ListItemIcon2 from "@mui/material/ListItemIcon";
|
|
3895
4485
|
import ListItemText2 from "@mui/material/ListItemText";
|
|
4486
|
+
import MenuItem4 from "@mui/material/MenuItem";
|
|
4487
|
+
import MenuList from "@mui/material/MenuList";
|
|
3896
4488
|
import Collapse from "@mui/material/Collapse";
|
|
3897
|
-
import
|
|
3898
|
-
import
|
|
3899
|
-
import { styled as
|
|
4489
|
+
import Tooltip5 from "@mui/material/Tooltip";
|
|
4490
|
+
import Popover3 from "@mui/material/Popover";
|
|
4491
|
+
import { styled as styled34 } from "@mui/material/styles";
|
|
3900
4492
|
import { ChevronDown as ChevronDown2, ChevronUp } from "@wso2/oxygen-ui-icons-react";
|
|
3901
4493
|
|
|
3902
4494
|
// src/components/Sidebar/SidebarItemContext.tsx
|
|
3903
|
-
import * as
|
|
3904
|
-
import { jsx as
|
|
3905
|
-
var SidebarItemContext =
|
|
4495
|
+
import * as React22 from "react";
|
|
4496
|
+
import { jsx as jsx44 } from "react/jsx-runtime";
|
|
4497
|
+
var SidebarItemContext = React22.createContext(null);
|
|
3906
4498
|
var useSidebarItemContext = () => {
|
|
3907
|
-
const context =
|
|
4499
|
+
const context = React22.useContext(SidebarItemContext);
|
|
3908
4500
|
if (!context) {
|
|
3909
4501
|
throw new Error(
|
|
3910
4502
|
"useSidebarItemContext must be used within a SidebarItem component"
|
|
@@ -3913,15 +4505,15 @@ var useSidebarItemContext = () => {
|
|
|
3913
4505
|
return context;
|
|
3914
4506
|
};
|
|
3915
4507
|
var SidebarItemProvider = ({ value, children }) => {
|
|
3916
|
-
return /* @__PURE__ */
|
|
4508
|
+
return /* @__PURE__ */ jsx44(SidebarItemContext.Provider, { value, children });
|
|
3917
4509
|
};
|
|
3918
4510
|
|
|
3919
4511
|
// src/components/Sidebar/SidebarItemIcon.tsx
|
|
3920
|
-
import * as
|
|
4512
|
+
import * as React23 from "react";
|
|
3921
4513
|
import ListItemIcon from "@mui/material/ListItemIcon";
|
|
3922
|
-
import { styled as
|
|
3923
|
-
import { jsx as
|
|
3924
|
-
var SidebarItemIconRoot =
|
|
4514
|
+
import { styled as styled31 } from "@mui/material/styles";
|
|
4515
|
+
import { jsx as jsx45 } from "react/jsx-runtime";
|
|
4516
|
+
var SidebarItemIconRoot = styled31(ListItemIcon, {
|
|
3925
4517
|
name: "MuiSidebar",
|
|
3926
4518
|
slot: "ItemIcon",
|
|
3927
4519
|
shouldForwardProp: (prop) => prop !== "ownerState"
|
|
@@ -3938,10 +4530,10 @@ var SidebarItemIcon = ({
|
|
|
3938
4530
|
var _a;
|
|
3939
4531
|
const { collapsed } = useSidebar();
|
|
3940
4532
|
const { isActive } = useSidebarItemContext();
|
|
3941
|
-
const iconWithSize =
|
|
4533
|
+
const iconWithSize = React23.isValidElement(children) ? React23.cloneElement(children, __spreadProps(__spreadValues({}, children.props), {
|
|
3942
4534
|
size: (_a = children.props.size) != null ? _a : 20
|
|
3943
4535
|
})) : children;
|
|
3944
|
-
return /* @__PURE__ */
|
|
4536
|
+
return /* @__PURE__ */ jsx45(
|
|
3945
4537
|
SidebarItemIconRoot,
|
|
3946
4538
|
{
|
|
3947
4539
|
ownerState: { collapsed, isActive },
|
|
@@ -3954,9 +4546,9 @@ SidebarItemIcon.displayName = "SidebarItemIcon";
|
|
|
3954
4546
|
|
|
3955
4547
|
// src/components/Sidebar/SidebarItemLabel.tsx
|
|
3956
4548
|
import ListItemText from "@mui/material/ListItemText";
|
|
3957
|
-
import { styled as
|
|
3958
|
-
import { jsx as
|
|
3959
|
-
var SidebarItemLabelRoot =
|
|
4549
|
+
import { styled as styled32 } from "@mui/material/styles";
|
|
4550
|
+
import { jsx as jsx46 } from "react/jsx-runtime";
|
|
4551
|
+
var SidebarItemLabelRoot = styled32(ListItemText, {
|
|
3960
4552
|
name: "MuiSidebar",
|
|
3961
4553
|
slot: "ItemLabel",
|
|
3962
4554
|
shouldForwardProp: (prop) => prop !== "ownerState"
|
|
@@ -3981,15 +4573,15 @@ var SidebarItemLabel = ({
|
|
|
3981
4573
|
}) => {
|
|
3982
4574
|
const { collapsed } = useSidebar();
|
|
3983
4575
|
const { isActive } = useSidebarItemContext();
|
|
3984
|
-
return /* @__PURE__ */
|
|
4576
|
+
return /* @__PURE__ */ jsx46(SidebarItemLabelRoot, { primary: children, ownerState: { isActive, collapsed }, sx });
|
|
3985
4577
|
};
|
|
3986
4578
|
SidebarItemLabel.displayName = "SidebarItemLabel";
|
|
3987
4579
|
|
|
3988
4580
|
// src/components/Sidebar/SidebarItemBadge.tsx
|
|
3989
4581
|
import Chip from "@mui/material/Chip";
|
|
3990
|
-
import { styled as
|
|
3991
|
-
import { jsx as
|
|
3992
|
-
var SidebarItemBadgeRoot =
|
|
4582
|
+
import { styled as styled33 } from "@mui/material/styles";
|
|
4583
|
+
import { jsx as jsx47 } from "react/jsx-runtime";
|
|
4584
|
+
var SidebarItemBadgeRoot = styled33(Chip, {
|
|
3993
4585
|
name: "MuiSidebar",
|
|
3994
4586
|
slot: "ItemBadge"
|
|
3995
4587
|
})({
|
|
@@ -4006,20 +4598,20 @@ var SidebarItemBadge = ({
|
|
|
4006
4598
|
if (collapsed) {
|
|
4007
4599
|
return null;
|
|
4008
4600
|
}
|
|
4009
|
-
return /* @__PURE__ */
|
|
4601
|
+
return /* @__PURE__ */ jsx47(SidebarItemBadgeRoot, { label: children, size: "small", color, sx });
|
|
4010
4602
|
};
|
|
4011
4603
|
SidebarItemBadge.displayName = "SidebarItemBadge";
|
|
4012
4604
|
|
|
4013
4605
|
// src/components/Sidebar/SidebarItem.tsx
|
|
4014
|
-
import { Fragment as Fragment5, jsx as
|
|
4015
|
-
var SidebarItemRoot =
|
|
4606
|
+
import { Fragment as Fragment5, jsx as jsx48, jsxs as jsxs16 } from "react/jsx-runtime";
|
|
4607
|
+
var SidebarItemRoot = styled34(ListItem, {
|
|
4016
4608
|
name: "MuiSidebar",
|
|
4017
4609
|
slot: "Item"
|
|
4018
4610
|
})({
|
|
4019
4611
|
display: "block",
|
|
4020
4612
|
padding: 0
|
|
4021
4613
|
});
|
|
4022
|
-
var SidebarItemButton =
|
|
4614
|
+
var SidebarItemButton = styled34(ListItemButton, {
|
|
4023
4615
|
name: "MuiSidebar",
|
|
4024
4616
|
slot: "ItemButton",
|
|
4025
4617
|
shouldForwardProp: (prop) => prop !== "ownerState"
|
|
@@ -4043,7 +4635,7 @@ var SidebarItemButton = styled29(ListItemButton, {
|
|
|
4043
4635
|
}
|
|
4044
4636
|
}
|
|
4045
4637
|
}));
|
|
4046
|
-
var SidebarItemChevron =
|
|
4638
|
+
var SidebarItemChevron = styled34(Box18, {
|
|
4047
4639
|
name: "MuiSidebar",
|
|
4048
4640
|
slot: "ItemChevron"
|
|
4049
4641
|
})({
|
|
@@ -4052,20 +4644,20 @@ var SidebarItemChevron = styled29(Box15, {
|
|
|
4052
4644
|
display: "flex",
|
|
4053
4645
|
alignItems: "center"
|
|
4054
4646
|
});
|
|
4055
|
-
var SidebarItemPopover =
|
|
4647
|
+
var SidebarItemPopover = styled34(Popover3, {
|
|
4056
4648
|
name: "MuiSidebar",
|
|
4057
4649
|
slot: "ItemPopover"
|
|
4058
4650
|
})({
|
|
4059
4651
|
pointerEvents: "none"
|
|
4060
4652
|
});
|
|
4061
|
-
var SidebarItemPopoverList =
|
|
4653
|
+
var SidebarItemPopoverList = styled34(MenuList, {
|
|
4062
4654
|
name: "MuiSidebar",
|
|
4063
4655
|
slot: "ItemPopoverList"
|
|
4064
4656
|
})(({ theme }) => ({
|
|
4065
4657
|
padding: theme.spacing(0.5),
|
|
4066
4658
|
pointerEvents: "auto"
|
|
4067
4659
|
}));
|
|
4068
|
-
var SidebarItemPopoverButton =
|
|
4660
|
+
var SidebarItemPopoverButton = styled34(MenuItem4, {
|
|
4069
4661
|
name: "MuiSidebar",
|
|
4070
4662
|
slot: "ItemPopoverButton"
|
|
4071
4663
|
})(({ theme }) => ({
|
|
@@ -4089,9 +4681,9 @@ var CHILD_DISPLAY_NAMES = [
|
|
|
4089
4681
|
var separateChildren2 = (children) => {
|
|
4090
4682
|
const composableChildren = [];
|
|
4091
4683
|
const nestedItems = [];
|
|
4092
|
-
|
|
4684
|
+
React24.Children.toArray(children).forEach((child) => {
|
|
4093
4685
|
var _a;
|
|
4094
|
-
if (
|
|
4686
|
+
if (React24.isValidElement(child)) {
|
|
4095
4687
|
const displayName = (_a = child.type) == null ? void 0 : _a.displayName;
|
|
4096
4688
|
if (displayName && CHILD_DISPLAY_NAMES.includes(displayName)) {
|
|
4097
4689
|
composableChildren.push(child);
|
|
@@ -4106,9 +4698,9 @@ var separateChildren2 = (children) => {
|
|
|
4106
4698
|
};
|
|
4107
4699
|
var getTooltipLabel = (children) => {
|
|
4108
4700
|
let tooltipLabel = "";
|
|
4109
|
-
|
|
4701
|
+
React24.Children.forEach(children, (child) => {
|
|
4110
4702
|
var _a;
|
|
4111
|
-
if (
|
|
4703
|
+
if (React24.isValidElement(child)) {
|
|
4112
4704
|
const displayName = (_a = child.type) == null ? void 0 : _a.displayName;
|
|
4113
4705
|
const props = child.props;
|
|
4114
4706
|
if (displayName === "SidebarItemLabel" && props.children) {
|
|
@@ -4121,9 +4713,9 @@ var getTooltipLabel = (children) => {
|
|
|
4121
4713
|
var extractItemContent = (itemChildren) => {
|
|
4122
4714
|
let icon = null;
|
|
4123
4715
|
let label = "";
|
|
4124
|
-
|
|
4716
|
+
React24.Children.forEach(itemChildren, (child) => {
|
|
4125
4717
|
var _a;
|
|
4126
|
-
if (
|
|
4718
|
+
if (React24.isValidElement(child)) {
|
|
4127
4719
|
const displayName = (_a = child.type) == null ? void 0 : _a.displayName;
|
|
4128
4720
|
const props = child.props;
|
|
4129
4721
|
if (displayName === "SidebarItemIcon") {
|
|
@@ -4147,17 +4739,37 @@ var SidebarItem = ({
|
|
|
4147
4739
|
const hasNestedItems = nestedItems.length > 0;
|
|
4148
4740
|
const isActive = activeItem === id;
|
|
4149
4741
|
const isExpanded = expandedMenus[id] || false;
|
|
4150
|
-
const hasActiveChild =
|
|
4742
|
+
const hasActiveChild = React24.useMemo(() => {
|
|
4151
4743
|
if (!hasNestedItems || !activeItem) return false;
|
|
4152
4744
|
return nestedItems.some((child) => {
|
|
4153
|
-
if (
|
|
4745
|
+
if (React24.isValidElement(child)) {
|
|
4154
4746
|
return child.props.id === activeItem;
|
|
4155
4747
|
}
|
|
4156
4748
|
return false;
|
|
4157
4749
|
});
|
|
4158
4750
|
}, [hasNestedItems, nestedItems, activeItem]);
|
|
4159
|
-
const [popoverAnchor, setPopoverAnchor] =
|
|
4751
|
+
const [popoverAnchor, setPopoverAnchor] = React24.useState(null);
|
|
4752
|
+
const [popoverOpenedByClick, setPopoverOpenedByClick] = React24.useState(false);
|
|
4753
|
+
const closeTimeoutRef = React24.useRef(null);
|
|
4160
4754
|
const popoverOpen = Boolean(popoverAnchor);
|
|
4755
|
+
const popoverId = React24.useId();
|
|
4756
|
+
const clearCloseTimeout = React24.useCallback(() => {
|
|
4757
|
+
if (closeTimeoutRef.current != null) {
|
|
4758
|
+
clearTimeout(closeTimeoutRef.current);
|
|
4759
|
+
closeTimeoutRef.current = null;
|
|
4760
|
+
}
|
|
4761
|
+
}, []);
|
|
4762
|
+
const closePopover = React24.useCallback(() => {
|
|
4763
|
+
clearCloseTimeout();
|
|
4764
|
+
setPopoverAnchor(null);
|
|
4765
|
+
setPopoverOpenedByClick(false);
|
|
4766
|
+
}, [clearCloseTimeout]);
|
|
4767
|
+
React24.useEffect(() => () => clearCloseTimeout(), [clearCloseTimeout]);
|
|
4768
|
+
React24.useEffect(() => {
|
|
4769
|
+
if (!collapsed) {
|
|
4770
|
+
closePopover();
|
|
4771
|
+
}
|
|
4772
|
+
}, [collapsed, closePopover]);
|
|
4161
4773
|
const contextValue = {
|
|
4162
4774
|
id,
|
|
4163
4775
|
isActive,
|
|
@@ -4165,8 +4777,17 @@ var SidebarItem = ({
|
|
|
4165
4777
|
hasChildren: hasNestedItems,
|
|
4166
4778
|
depth
|
|
4167
4779
|
};
|
|
4168
|
-
const handleClick = () => {
|
|
4169
|
-
if (hasNestedItems) {
|
|
4780
|
+
const handleClick = (event) => {
|
|
4781
|
+
if (collapsed && hasNestedItems) {
|
|
4782
|
+
const nextAnchor = popoverAnchor ? null : event.currentTarget;
|
|
4783
|
+
clearCloseTimeout();
|
|
4784
|
+
setPopoverAnchor(nextAnchor);
|
|
4785
|
+
setPopoverOpenedByClick(Boolean(nextAnchor));
|
|
4786
|
+
const shouldBeExpanded = Boolean(nextAnchor);
|
|
4787
|
+
if (isExpanded !== shouldBeExpanded) {
|
|
4788
|
+
onToggleExpand == null ? void 0 : onToggleExpand(id);
|
|
4789
|
+
}
|
|
4790
|
+
} else if (hasNestedItems) {
|
|
4170
4791
|
onToggleExpand == null ? void 0 : onToggleExpand(id);
|
|
4171
4792
|
} else {
|
|
4172
4793
|
onSelect == null ? void 0 : onSelect(id);
|
|
@@ -4174,37 +4795,52 @@ var SidebarItem = ({
|
|
|
4174
4795
|
};
|
|
4175
4796
|
const handleMouseEnter = (event) => {
|
|
4176
4797
|
if (collapsed && hasNestedItems) {
|
|
4798
|
+
clearCloseTimeout();
|
|
4177
4799
|
setPopoverAnchor(event.currentTarget);
|
|
4800
|
+
setPopoverOpenedByClick(false);
|
|
4801
|
+
if (!isExpanded) {
|
|
4802
|
+
onToggleExpand == null ? void 0 : onToggleExpand(id);
|
|
4803
|
+
}
|
|
4178
4804
|
}
|
|
4179
4805
|
};
|
|
4180
4806
|
const handleMouseLeave = () => {
|
|
4181
|
-
|
|
4807
|
+
if (popoverOpenedByClick) {
|
|
4808
|
+
return;
|
|
4809
|
+
}
|
|
4810
|
+
clearCloseTimeout();
|
|
4811
|
+
closeTimeoutRef.current = setTimeout(() => {
|
|
4812
|
+
closePopover();
|
|
4813
|
+
}, 100);
|
|
4182
4814
|
};
|
|
4183
4815
|
const tooltipLabel = getTooltipLabel(children);
|
|
4184
4816
|
const ownerState = { collapsed, depth };
|
|
4185
4817
|
const shouldShowSelected = isActive && !hasNestedItems || collapsed && hasActiveChild;
|
|
4186
|
-
const buttonContent = /* @__PURE__ */
|
|
4818
|
+
const buttonContent = /* @__PURE__ */ jsx48(
|
|
4187
4819
|
SidebarItemButton,
|
|
4188
4820
|
{
|
|
4189
4821
|
selected: shouldShowSelected,
|
|
4190
4822
|
onClick: handleClick,
|
|
4191
4823
|
ownerState,
|
|
4192
4824
|
sx,
|
|
4193
|
-
|
|
4825
|
+
"aria-label": collapsed && tooltipLabel ? tooltipLabel : void 0,
|
|
4826
|
+
"aria-expanded": hasNestedItems ? collapsed ? popoverOpen : isExpanded : void 0,
|
|
4827
|
+
"aria-haspopup": collapsed && hasNestedItems ? "menu" : void 0,
|
|
4828
|
+
"aria-controls": popoverOpen ? popoverId : void 0,
|
|
4829
|
+
children: /* @__PURE__ */ jsxs16(SidebarItemProvider, { value: contextValue, children: [
|
|
4194
4830
|
composableChildren,
|
|
4195
|
-
!collapsed && hasNestedItems && /* @__PURE__ */
|
|
4196
|
-
!collapsed && !hasNestedItems && /* @__PURE__ */
|
|
4831
|
+
!collapsed && hasNestedItems && /* @__PURE__ */ jsx48(SidebarItemChevron, { "aria-hidden": "true", children: isExpanded ? /* @__PURE__ */ jsx48(ChevronUp, { size: 16 }) : /* @__PURE__ */ jsx48(ChevronDown2, { size: 16 }) }),
|
|
4832
|
+
!collapsed && !hasNestedItems && /* @__PURE__ */ jsx48(Box18, { sx: { ml: "auto", width: 16, pl: 1 } })
|
|
4197
4833
|
] })
|
|
4198
4834
|
}
|
|
4199
4835
|
);
|
|
4200
|
-
const wrappedContent = link ? /* @__PURE__ */
|
|
4836
|
+
const wrappedContent = link ? /* @__PURE__ */ jsx48(Fragment5, { children: React24.cloneElement(link, {}, buttonContent) }) : buttonContent;
|
|
4201
4837
|
const collapsedWithNested = collapsed && hasNestedItems;
|
|
4202
4838
|
const handlePopoverItemClick = (itemId) => {
|
|
4203
4839
|
onSelect == null ? void 0 : onSelect(itemId);
|
|
4204
|
-
|
|
4840
|
+
closePopover();
|
|
4205
4841
|
};
|
|
4206
|
-
return /* @__PURE__ */
|
|
4207
|
-
/* @__PURE__ */
|
|
4842
|
+
return /* @__PURE__ */ jsxs16(Fragment5, { children: [
|
|
4843
|
+
/* @__PURE__ */ jsx48(
|
|
4208
4844
|
SidebarItemRoot,
|
|
4209
4845
|
{
|
|
4210
4846
|
disablePadding: true,
|
|
@@ -4212,50 +4848,60 @@ var SidebarItem = ({
|
|
|
4212
4848
|
onMouseLeave: handleMouseLeave,
|
|
4213
4849
|
children: collapsed ? (
|
|
4214
4850
|
// When collapsed: show tooltip only for items without nested children
|
|
4215
|
-
collapsedWithNested ? wrappedContent : /* @__PURE__ */
|
|
4851
|
+
collapsedWithNested ? wrappedContent : /* @__PURE__ */ jsx48(Tooltip5, { title: tooltipLabel, placement: "right", arrow: true, children: wrappedContent })
|
|
4216
4852
|
) : wrappedContent
|
|
4217
4853
|
}
|
|
4218
4854
|
),
|
|
4219
|
-
collapsedWithNested && /* @__PURE__ */
|
|
4855
|
+
collapsedWithNested && /* @__PURE__ */ jsx48(
|
|
4220
4856
|
SidebarItemPopover,
|
|
4221
4857
|
{
|
|
4222
4858
|
open: popoverOpen,
|
|
4223
4859
|
anchorEl: popoverAnchor,
|
|
4224
4860
|
anchorOrigin: { vertical: "center", horizontal: "right" },
|
|
4225
4861
|
transformOrigin: { vertical: "center", horizontal: "left" },
|
|
4226
|
-
onClose:
|
|
4227
|
-
|
|
4862
|
+
onClose: closePopover,
|
|
4863
|
+
disableAutoFocus: !popoverOpenedByClick,
|
|
4864
|
+
disableEnforceFocus: !popoverOpenedByClick,
|
|
4865
|
+
disableRestoreFocus: !popoverOpenedByClick,
|
|
4228
4866
|
slotProps: {
|
|
4229
4867
|
paper: {
|
|
4230
|
-
onMouseEnter:
|
|
4868
|
+
onMouseEnter: clearCloseTimeout,
|
|
4231
4869
|
onMouseLeave: handleMouseLeave
|
|
4232
4870
|
}
|
|
4233
4871
|
},
|
|
4234
|
-
children: /* @__PURE__ */
|
|
4235
|
-
|
|
4236
|
-
|
|
4237
|
-
|
|
4238
|
-
|
|
4239
|
-
|
|
4240
|
-
|
|
4241
|
-
{
|
|
4242
|
-
|
|
4243
|
-
|
|
4244
|
-
|
|
4245
|
-
|
|
4246
|
-
|
|
4247
|
-
|
|
4248
|
-
|
|
4249
|
-
|
|
4250
|
-
|
|
4872
|
+
children: /* @__PURE__ */ jsx48(
|
|
4873
|
+
SidebarItemPopoverList,
|
|
4874
|
+
{
|
|
4875
|
+
id: popoverId,
|
|
4876
|
+
autoFocusItem: popoverOpen && popoverOpenedByClick,
|
|
4877
|
+
disablePadding: true,
|
|
4878
|
+
children: nestedItems.map((child, index) => {
|
|
4879
|
+
if (React24.isValidElement(child)) {
|
|
4880
|
+
const childProps = child.props;
|
|
4881
|
+
const { icon, label } = extractItemContent(childProps.children);
|
|
4882
|
+
const isItemActive = activeItem === childProps.id;
|
|
4883
|
+
return /* @__PURE__ */ jsxs16(
|
|
4884
|
+
SidebarItemPopoverButton,
|
|
4885
|
+
{
|
|
4886
|
+
selected: isItemActive,
|
|
4887
|
+
onClick: () => handlePopoverItemClick(childProps.id),
|
|
4888
|
+
children: [
|
|
4889
|
+
icon && /* @__PURE__ */ jsx48(ListItemIcon2, { sx: { minWidth: "auto" }, children: icon }),
|
|
4890
|
+
/* @__PURE__ */ jsx48(ListItemText2, { primary: label })
|
|
4891
|
+
]
|
|
4892
|
+
},
|
|
4893
|
+
childProps.id || index
|
|
4894
|
+
);
|
|
4895
|
+
}
|
|
4896
|
+
return child;
|
|
4897
|
+
})
|
|
4251
4898
|
}
|
|
4252
|
-
|
|
4253
|
-
}) })
|
|
4899
|
+
)
|
|
4254
4900
|
}
|
|
4255
4901
|
),
|
|
4256
|
-
hasNestedItems && !collapsed && /* @__PURE__ */
|
|
4257
|
-
if (
|
|
4258
|
-
return
|
|
4902
|
+
hasNestedItems && !collapsed && /* @__PURE__ */ jsx48(Collapse, { in: isExpanded, timeout: "auto", unmountOnExit: true, children: /* @__PURE__ */ jsx48(List2, { disablePadding: true, children: nestedItems.map((child, index) => {
|
|
4903
|
+
if (React24.isValidElement(child)) {
|
|
4904
|
+
return React24.cloneElement(child, {
|
|
4259
4905
|
key: child.key || index,
|
|
4260
4906
|
depth: depth + 1
|
|
4261
4907
|
});
|
|
@@ -4267,11 +4913,11 @@ var SidebarItem = ({
|
|
|
4267
4913
|
SidebarItem.displayName = "SidebarItem";
|
|
4268
4914
|
|
|
4269
4915
|
// src/components/Sidebar/SidebarFooter.tsx
|
|
4270
|
-
import
|
|
4916
|
+
import Box19 from "@mui/material/Box";
|
|
4271
4917
|
import Divider4 from "@mui/material/Divider";
|
|
4272
|
-
import { styled as
|
|
4273
|
-
import { Fragment as Fragment6, jsx as
|
|
4274
|
-
var SidebarFooterRoot =
|
|
4918
|
+
import { styled as styled35 } from "@mui/material/styles";
|
|
4919
|
+
import { Fragment as Fragment6, jsx as jsx49, jsxs as jsxs17 } from "react/jsx-runtime";
|
|
4920
|
+
var SidebarFooterRoot = styled35(Box19, {
|
|
4275
4921
|
name: "MuiSidebar",
|
|
4276
4922
|
slot: "Footer"
|
|
4277
4923
|
})(({ theme }) => ({
|
|
@@ -4283,25 +4929,25 @@ var SidebarFooter = ({
|
|
|
4283
4929
|
showDivider = true,
|
|
4284
4930
|
sx
|
|
4285
4931
|
}) => {
|
|
4286
|
-
return /* @__PURE__ */
|
|
4287
|
-
showDivider && /* @__PURE__ */
|
|
4288
|
-
/* @__PURE__ */
|
|
4932
|
+
return /* @__PURE__ */ jsxs17(Fragment6, { children: [
|
|
4933
|
+
showDivider && /* @__PURE__ */ jsx49(Divider4, {}),
|
|
4934
|
+
/* @__PURE__ */ jsx49(SidebarFooterRoot, { sx, children })
|
|
4289
4935
|
] });
|
|
4290
4936
|
};
|
|
4291
4937
|
|
|
4292
4938
|
// src/components/Sidebar/SidebarUser.tsx
|
|
4293
|
-
import * as
|
|
4294
|
-
import
|
|
4939
|
+
import * as React25 from "react";
|
|
4940
|
+
import Box20 from "@mui/material/Box";
|
|
4295
4941
|
import ListItemButton2 from "@mui/material/ListItemButton";
|
|
4296
|
-
import
|
|
4942
|
+
import Tooltip6 from "@mui/material/Tooltip";
|
|
4297
4943
|
import Divider5 from "@mui/material/Divider";
|
|
4298
|
-
import { styled as
|
|
4944
|
+
import { styled as styled39 } from "@mui/material/styles";
|
|
4299
4945
|
|
|
4300
4946
|
// src/components/Sidebar/SidebarUserAvatar.tsx
|
|
4301
4947
|
import Avatar2 from "@mui/material/Avatar";
|
|
4302
|
-
import { styled as
|
|
4303
|
-
import { jsx as
|
|
4304
|
-
var SidebarUserAvatarRoot =
|
|
4948
|
+
import { styled as styled36 } from "@mui/material/styles";
|
|
4949
|
+
import { jsx as jsx50 } from "react/jsx-runtime";
|
|
4950
|
+
var SidebarUserAvatarRoot = styled36(Avatar2, {
|
|
4305
4951
|
name: "MuiSidebar",
|
|
4306
4952
|
slot: "UserAvatar"
|
|
4307
4953
|
})(({ theme }) => ({
|
|
@@ -4317,15 +4963,15 @@ var SidebarUserAvatar = ({
|
|
|
4317
4963
|
alt,
|
|
4318
4964
|
sx
|
|
4319
4965
|
}) => {
|
|
4320
|
-
return /* @__PURE__ */
|
|
4966
|
+
return /* @__PURE__ */ jsx50(SidebarUserAvatarRoot, { src, alt, sx, children });
|
|
4321
4967
|
};
|
|
4322
4968
|
SidebarUserAvatar.displayName = "SidebarUserAvatar";
|
|
4323
4969
|
|
|
4324
4970
|
// src/components/Sidebar/SidebarUserName.tsx
|
|
4325
|
-
import
|
|
4326
|
-
import { styled as
|
|
4327
|
-
import { jsx as
|
|
4328
|
-
var SidebarUserNameRoot =
|
|
4971
|
+
import Typography11 from "@mui/material/Typography";
|
|
4972
|
+
import { styled as styled37 } from "@mui/material/styles";
|
|
4973
|
+
import { jsx as jsx51 } from "react/jsx-runtime";
|
|
4974
|
+
var SidebarUserNameRoot = styled37(Typography11, {
|
|
4329
4975
|
name: "MuiSidebar",
|
|
4330
4976
|
slot: "UserName"
|
|
4331
4977
|
})({
|
|
@@ -4342,15 +4988,15 @@ var SidebarUserName = ({
|
|
|
4342
4988
|
if (collapsed) {
|
|
4343
4989
|
return null;
|
|
4344
4990
|
}
|
|
4345
|
-
return /* @__PURE__ */
|
|
4991
|
+
return /* @__PURE__ */ jsx51(SidebarUserNameRoot, { variant: "body2", sx, children });
|
|
4346
4992
|
};
|
|
4347
4993
|
SidebarUserName.displayName = "SidebarUserName";
|
|
4348
4994
|
|
|
4349
4995
|
// src/components/Sidebar/SidebarUserEmail.tsx
|
|
4350
|
-
import
|
|
4351
|
-
import { styled as
|
|
4352
|
-
import { jsx as
|
|
4353
|
-
var SidebarUserEmailRoot =
|
|
4996
|
+
import Typography12 from "@mui/material/Typography";
|
|
4997
|
+
import { styled as styled38 } from "@mui/material/styles";
|
|
4998
|
+
import { jsx as jsx52 } from "react/jsx-runtime";
|
|
4999
|
+
var SidebarUserEmailRoot = styled38(Typography12, {
|
|
4354
5000
|
name: "MuiSidebar",
|
|
4355
5001
|
slot: "UserEmail"
|
|
4356
5002
|
})(({ theme }) => ({
|
|
@@ -4368,19 +5014,19 @@ var SidebarUserEmail = ({
|
|
|
4368
5014
|
if (collapsed) {
|
|
4369
5015
|
return null;
|
|
4370
5016
|
}
|
|
4371
|
-
return /* @__PURE__ */
|
|
5017
|
+
return /* @__PURE__ */ jsx52(SidebarUserEmailRoot, { variant: "caption", sx, children });
|
|
4372
5018
|
};
|
|
4373
5019
|
SidebarUserEmail.displayName = "SidebarUserEmail";
|
|
4374
5020
|
|
|
4375
5021
|
// src/components/Sidebar/SidebarUser.tsx
|
|
4376
|
-
import { Fragment as Fragment7, jsx as
|
|
4377
|
-
var SidebarUserRoot =
|
|
5022
|
+
import { Fragment as Fragment7, jsx as jsx53, jsxs as jsxs18 } from "react/jsx-runtime";
|
|
5023
|
+
var SidebarUserRoot = styled39(Box20, {
|
|
4378
5024
|
name: "MuiSidebar",
|
|
4379
5025
|
slot: "User"
|
|
4380
5026
|
})(({ theme }) => ({
|
|
4381
5027
|
padding: theme.spacing(2)
|
|
4382
5028
|
}));
|
|
4383
|
-
var SidebarUserButton =
|
|
5029
|
+
var SidebarUserButton = styled39(ListItemButton2, {
|
|
4384
5030
|
name: "MuiSidebar",
|
|
4385
5031
|
slot: "UserButton",
|
|
4386
5032
|
shouldForwardProp: (prop) => prop !== "ownerState"
|
|
@@ -4397,7 +5043,7 @@ var SidebarUserButton = styled34(ListItemButton2, {
|
|
|
4397
5043
|
duration: ownerState.collapsed ? theme.transitions.duration.leavingScreen : theme.transitions.duration.enteringScreen
|
|
4398
5044
|
})
|
|
4399
5045
|
}));
|
|
4400
|
-
var SidebarUserTextContainer =
|
|
5046
|
+
var SidebarUserTextContainer = styled39(Box20, {
|
|
4401
5047
|
name: "MuiSidebar",
|
|
4402
5048
|
slot: "UserTextContainer",
|
|
4403
5049
|
shouldForwardProp: (prop) => prop !== "collapsed"
|
|
@@ -4415,9 +5061,9 @@ var SidebarUserTextContainer = styled34(Box17, {
|
|
|
4415
5061
|
var separateChildren3 = (children) => {
|
|
4416
5062
|
let avatarChild = null;
|
|
4417
5063
|
const textChildren = [];
|
|
4418
|
-
|
|
5064
|
+
React25.Children.forEach(children, (child) => {
|
|
4419
5065
|
var _a;
|
|
4420
|
-
if (
|
|
5066
|
+
if (React25.isValidElement(child)) {
|
|
4421
5067
|
const displayName = (_a = child.type) == null ? void 0 : _a.displayName;
|
|
4422
5068
|
if (displayName === "SidebarUserAvatar") {
|
|
4423
5069
|
avatarChild = child;
|
|
@@ -4430,9 +5076,9 @@ var separateChildren3 = (children) => {
|
|
|
4430
5076
|
};
|
|
4431
5077
|
var getTooltipText = (children) => {
|
|
4432
5078
|
let tooltipText = "";
|
|
4433
|
-
|
|
5079
|
+
React25.Children.forEach(children, (child) => {
|
|
4434
5080
|
var _a;
|
|
4435
|
-
if (
|
|
5081
|
+
if (React25.isValidElement(child)) {
|
|
4436
5082
|
const displayName = (_a = child.type) == null ? void 0 : _a.displayName;
|
|
4437
5083
|
const props = child.props;
|
|
4438
5084
|
if (displayName === "SidebarUserName" && props.children) {
|
|
@@ -4452,22 +5098,22 @@ var SidebarUser = ({
|
|
|
4452
5098
|
const { avatarChild, textChildren } = separateChildren3(children);
|
|
4453
5099
|
const tooltipText = getTooltipText(children);
|
|
4454
5100
|
const ownerState = { collapsed };
|
|
4455
|
-
const content = /* @__PURE__ */
|
|
5101
|
+
const content = /* @__PURE__ */ jsxs18(SidebarUserButton, { onClick, ownerState, children: [
|
|
4456
5102
|
avatarChild,
|
|
4457
|
-
/* @__PURE__ */
|
|
5103
|
+
/* @__PURE__ */ jsx53(SidebarUserTextContainer, { collapsed, children: textChildren })
|
|
4458
5104
|
] });
|
|
4459
|
-
return /* @__PURE__ */
|
|
4460
|
-
showDivider && /* @__PURE__ */
|
|
4461
|
-
/* @__PURE__ */
|
|
5105
|
+
return /* @__PURE__ */ jsxs18(Fragment7, { children: [
|
|
5106
|
+
showDivider && /* @__PURE__ */ jsx53(Divider5, {}),
|
|
5107
|
+
/* @__PURE__ */ jsx53(SidebarUserRoot, { sx, children: collapsed ? /* @__PURE__ */ jsx53(Tooltip6, { title: tooltipText, placement: "right", arrow: true, children: content }) : content })
|
|
4462
5108
|
] });
|
|
4463
5109
|
};
|
|
4464
5110
|
SidebarUser.displayName = "SidebarUser";
|
|
4465
5111
|
|
|
4466
5112
|
// src/components/Sidebar/Sidebar.tsx
|
|
4467
|
-
import { jsx as
|
|
5113
|
+
import { jsx as jsx54 } from "react/jsx-runtime";
|
|
4468
5114
|
var SIDEBAR_WIDTH = 250;
|
|
4469
5115
|
var COLLAPSED_SIDEBAR_WIDTH = 64;
|
|
4470
|
-
var SidebarRootStyled =
|
|
5116
|
+
var SidebarRootStyled = styled40(Box21, {
|
|
4471
5117
|
name: "MuiSidebar",
|
|
4472
5118
|
slot: "Root",
|
|
4473
5119
|
shouldForwardProp: (prop) => prop !== "ownerState"
|
|
@@ -4502,10 +5148,10 @@ var Sidebar = ({
|
|
|
4502
5148
|
sx
|
|
4503
5149
|
}) => {
|
|
4504
5150
|
var _a, _b, _c;
|
|
4505
|
-
const appShellContext =
|
|
5151
|
+
const appShellContext = React26.useContext(AppShellContext);
|
|
4506
5152
|
const collapsed = (_a = collapsedProp != null ? collapsedProp : appShellContext == null ? void 0 : appShellContext.state.sidebarCollapsed) != null ? _a : false;
|
|
4507
5153
|
const activeItem = activeItemProp != null ? activeItemProp : appShellContext == null ? void 0 : appShellContext.state.activeMenuItem;
|
|
4508
|
-
const expandedMenus =
|
|
5154
|
+
const expandedMenus = React26.useMemo(
|
|
4509
5155
|
() => {
|
|
4510
5156
|
var _a2;
|
|
4511
5157
|
return (_a2 = expandedMenusProp != null ? expandedMenusProp : appShellContext == null ? void 0 : appShellContext.state.expandedMenus) != null ? _a2 : {};
|
|
@@ -4516,7 +5162,7 @@ var Sidebar = ({
|
|
|
4516
5162
|
const onToggleExpand = onToggleExpandProp != null ? onToggleExpandProp : appShellContext == null ? void 0 : appShellContext.actions.toggleMenu;
|
|
4517
5163
|
const width = (_b = widthProp != null ? widthProp : appShellContext == null ? void 0 : appShellContext.state.sidebarWidth) != null ? _b : SIDEBAR_WIDTH;
|
|
4518
5164
|
const collapsedWidth = (_c = collapsedWidthProp != null ? collapsedWidthProp : appShellContext == null ? void 0 : appShellContext.state.sidebarCollapsedWidth) != null ? _c : COLLAPSED_SIDEBAR_WIDTH;
|
|
4519
|
-
const contextValue =
|
|
5165
|
+
const contextValue = React26.useMemo(
|
|
4520
5166
|
() => ({
|
|
4521
5167
|
collapsed,
|
|
4522
5168
|
activeItem,
|
|
@@ -4527,7 +5173,7 @@ var Sidebar = ({
|
|
|
4527
5173
|
[collapsed, activeItem, expandedMenus, onSelect, onToggleExpand]
|
|
4528
5174
|
);
|
|
4529
5175
|
const ownerState = { collapsed, width, collapsedWidth };
|
|
4530
|
-
return /* @__PURE__ */
|
|
5176
|
+
return /* @__PURE__ */ jsx54(SidebarContext.Provider, { value: contextValue, children: /* @__PURE__ */ jsx54(SidebarRootStyled, { component: "aside", ownerState, sx, children }) });
|
|
4531
5177
|
};
|
|
4532
5178
|
Sidebar.Nav = SidebarNav;
|
|
4533
5179
|
Sidebar.Category = SidebarCategory;
|
|
@@ -4544,15 +5190,17 @@ Sidebar.UserEmail = SidebarUserEmail;
|
|
|
4544
5190
|
Sidebar.displayName = "Sidebar";
|
|
4545
5191
|
|
|
4546
5192
|
// src/components/NotificationPanel/NotificationPanel.tsx
|
|
4547
|
-
import * as
|
|
5193
|
+
import * as React32 from "react";
|
|
5194
|
+
import Box30 from "@mui/material/Box";
|
|
4548
5195
|
import Drawer from "@mui/material/Drawer";
|
|
4549
|
-
import { styled as
|
|
5196
|
+
import { styled as styled56 } from "@mui/material/styles";
|
|
5197
|
+
import { visuallyHidden as visuallyHidden3 } from "@mui/utils";
|
|
4550
5198
|
|
|
4551
5199
|
// src/components/NotificationPanel/context.ts
|
|
4552
|
-
import * as
|
|
4553
|
-
var NotificationPanelContext =
|
|
5200
|
+
import * as React27 from "react";
|
|
5201
|
+
var NotificationPanelContext = React27.createContext(null);
|
|
4554
5202
|
var useNotificationPanel = () => {
|
|
4555
|
-
const context =
|
|
5203
|
+
const context = React27.useContext(NotificationPanelContext);
|
|
4556
5204
|
if (!context) {
|
|
4557
5205
|
throw new Error(
|
|
4558
5206
|
"NotificationPanel compound components must be used within NotificationPanel"
|
|
@@ -4562,11 +5210,11 @@ var useNotificationPanel = () => {
|
|
|
4562
5210
|
};
|
|
4563
5211
|
|
|
4564
5212
|
// src/components/NotificationPanel/NotificationHeader.tsx
|
|
4565
|
-
import * as
|
|
4566
|
-
import
|
|
4567
|
-
import { styled as
|
|
4568
|
-
import { jsx as
|
|
4569
|
-
var NotificationHeaderRoot =
|
|
5213
|
+
import * as React28 from "react";
|
|
5214
|
+
import Box22 from "@mui/material/Box";
|
|
5215
|
+
import { styled as styled41 } from "@mui/material/styles";
|
|
5216
|
+
import { jsx as jsx55, jsxs as jsxs19 } from "react/jsx-runtime";
|
|
5217
|
+
var NotificationHeaderRoot = styled41(Box22, {
|
|
4570
5218
|
name: "MuiNotificationPanel",
|
|
4571
5219
|
slot: "Header"
|
|
4572
5220
|
})(({ theme }) => ({
|
|
@@ -4576,7 +5224,7 @@ var NotificationHeaderRoot = styled36(Box19, {
|
|
|
4576
5224
|
padding: theme.spacing(2),
|
|
4577
5225
|
borderBottom: `1px solid ${(theme.vars || theme).palette.divider}`
|
|
4578
5226
|
}));
|
|
4579
|
-
var NotificationHeaderContent =
|
|
5227
|
+
var NotificationHeaderContent = styled41(Box22, {
|
|
4580
5228
|
name: "MuiNotificationPanel",
|
|
4581
5229
|
slot: "HeaderContent"
|
|
4582
5230
|
})(({ theme }) => ({
|
|
@@ -4587,9 +5235,9 @@ var NotificationHeaderContent = styled36(Box19, {
|
|
|
4587
5235
|
var separateChildren4 = (children) => {
|
|
4588
5236
|
const leftChildren = [];
|
|
4589
5237
|
let closeChild = null;
|
|
4590
|
-
|
|
5238
|
+
React28.Children.forEach(children, (child) => {
|
|
4591
5239
|
var _a;
|
|
4592
|
-
if (
|
|
5240
|
+
if (React28.isValidElement(child)) {
|
|
4593
5241
|
const displayName = (_a = child.type) == null ? void 0 : _a.displayName;
|
|
4594
5242
|
if (displayName === "NotificationHeaderClose") {
|
|
4595
5243
|
closeChild = child;
|
|
@@ -4607,18 +5255,18 @@ var NotificationHeader = ({
|
|
|
4607
5255
|
sx
|
|
4608
5256
|
}) => {
|
|
4609
5257
|
const { leftChildren, closeChild } = separateChildren4(children);
|
|
4610
|
-
return /* @__PURE__ */
|
|
4611
|
-
/* @__PURE__ */
|
|
5258
|
+
return /* @__PURE__ */ jsxs19(NotificationHeaderRoot, { sx, children: [
|
|
5259
|
+
/* @__PURE__ */ jsx55(NotificationHeaderContent, { children: leftChildren }),
|
|
4612
5260
|
closeChild
|
|
4613
5261
|
] });
|
|
4614
5262
|
};
|
|
4615
5263
|
NotificationHeader.displayName = "NotificationHeader";
|
|
4616
5264
|
|
|
4617
5265
|
// src/components/NotificationPanel/NotificationHeaderIcon.tsx
|
|
4618
|
-
import
|
|
4619
|
-
import { styled as
|
|
4620
|
-
import { jsx as
|
|
4621
|
-
var NotificationHeaderIconRoot =
|
|
5266
|
+
import Box23 from "@mui/material/Box";
|
|
5267
|
+
import { styled as styled42 } from "@mui/material/styles";
|
|
5268
|
+
import { jsx as jsx56 } from "react/jsx-runtime";
|
|
5269
|
+
var NotificationHeaderIconRoot = styled42(Box23, {
|
|
4622
5270
|
name: "MuiNotificationPanel",
|
|
4623
5271
|
slot: "HeaderIcon"
|
|
4624
5272
|
})({
|
|
@@ -4629,15 +5277,15 @@ var NotificationHeaderIcon = ({
|
|
|
4629
5277
|
children,
|
|
4630
5278
|
sx
|
|
4631
5279
|
}) => {
|
|
4632
|
-
return /* @__PURE__ */
|
|
5280
|
+
return /* @__PURE__ */ jsx56(NotificationHeaderIconRoot, { sx, children });
|
|
4633
5281
|
};
|
|
4634
5282
|
NotificationHeaderIcon.displayName = "NotificationHeaderIcon";
|
|
4635
5283
|
|
|
4636
5284
|
// src/components/NotificationPanel/NotificationHeaderTitle.tsx
|
|
4637
|
-
import
|
|
4638
|
-
import { styled as
|
|
4639
|
-
import { jsx as
|
|
4640
|
-
var NotificationHeaderTitleRoot =
|
|
5285
|
+
import Typography13 from "@mui/material/Typography";
|
|
5286
|
+
import { styled as styled43 } from "@mui/material/styles";
|
|
5287
|
+
import { jsx as jsx57 } from "react/jsx-runtime";
|
|
5288
|
+
var NotificationHeaderTitleRoot = styled43(Typography13, {
|
|
4641
5289
|
name: "MuiNotificationPanel",
|
|
4642
5290
|
slot: "HeaderTitle"
|
|
4643
5291
|
})({
|
|
@@ -4647,15 +5295,15 @@ var NotificationHeaderTitle = ({
|
|
|
4647
5295
|
children,
|
|
4648
5296
|
sx
|
|
4649
5297
|
}) => {
|
|
4650
|
-
return /* @__PURE__ */
|
|
5298
|
+
return /* @__PURE__ */ jsx57(NotificationHeaderTitleRoot, { variant: "h6", sx, children });
|
|
4651
5299
|
};
|
|
4652
5300
|
NotificationHeaderTitle.displayName = "NotificationHeaderTitle";
|
|
4653
5301
|
|
|
4654
5302
|
// src/components/NotificationPanel/NotificationHeaderBadge.tsx
|
|
4655
5303
|
import Chip2 from "@mui/material/Chip";
|
|
4656
|
-
import { styled as
|
|
4657
|
-
import { jsx as
|
|
4658
|
-
var NotificationHeaderBadgeRoot =
|
|
5304
|
+
import { styled as styled44 } from "@mui/material/styles";
|
|
5305
|
+
import { jsx as jsx58 } from "react/jsx-runtime";
|
|
5306
|
+
var NotificationHeaderBadgeRoot = styled44(Chip2, {
|
|
4659
5307
|
name: "MuiNotificationPanel",
|
|
4660
5308
|
slot: "HeaderBadge"
|
|
4661
5309
|
})({
|
|
@@ -4670,16 +5318,16 @@ var NotificationHeaderBadge = ({
|
|
|
4670
5318
|
if (!children || children === 0 || children === "0") {
|
|
4671
5319
|
return null;
|
|
4672
5320
|
}
|
|
4673
|
-
return /* @__PURE__ */
|
|
5321
|
+
return /* @__PURE__ */ jsx58(NotificationHeaderBadgeRoot, { label: children, size: "small", color, sx });
|
|
4674
5322
|
};
|
|
4675
5323
|
NotificationHeaderBadge.displayName = "NotificationHeaderBadge";
|
|
4676
5324
|
|
|
4677
5325
|
// src/components/NotificationPanel/NotificationHeaderClose.tsx
|
|
4678
|
-
import
|
|
4679
|
-
import { styled as
|
|
5326
|
+
import IconButton5 from "@mui/material/IconButton";
|
|
5327
|
+
import { styled as styled45 } from "@mui/material/styles";
|
|
4680
5328
|
import { X as X2 } from "@wso2/oxygen-ui-icons-react";
|
|
4681
|
-
import { jsx as
|
|
4682
|
-
var NotificationHeaderCloseRoot =
|
|
5329
|
+
import { jsx as jsx59 } from "react/jsx-runtime";
|
|
5330
|
+
var NotificationHeaderCloseRoot = styled45(IconButton5, {
|
|
4683
5331
|
name: "MuiNotificationPanel",
|
|
4684
5332
|
slot: "HeaderClose"
|
|
4685
5333
|
})({});
|
|
@@ -4696,24 +5344,33 @@ var NotificationHeaderClose = ({
|
|
|
4696
5344
|
onClose == null ? void 0 : onClose();
|
|
4697
5345
|
}
|
|
4698
5346
|
};
|
|
4699
|
-
return /* @__PURE__ */
|
|
5347
|
+
return /* @__PURE__ */ jsx59(
|
|
5348
|
+
NotificationHeaderCloseRoot,
|
|
5349
|
+
{
|
|
5350
|
+
onClick: handleClick,
|
|
5351
|
+
size: "small",
|
|
5352
|
+
sx,
|
|
5353
|
+
"aria-label": "Close notifications",
|
|
5354
|
+
children: children || /* @__PURE__ */ jsx59(X2, { size: 20, "aria-hidden": "true" })
|
|
5355
|
+
}
|
|
5356
|
+
);
|
|
4700
5357
|
};
|
|
4701
5358
|
NotificationHeaderClose.displayName = "NotificationHeaderClose";
|
|
4702
5359
|
|
|
4703
5360
|
// src/components/NotificationPanel/NotificationTabs.tsx
|
|
4704
|
-
import
|
|
5361
|
+
import Box24 from "@mui/material/Box";
|
|
4705
5362
|
import Tabs from "@mui/material/Tabs";
|
|
4706
5363
|
import Tab from "@mui/material/Tab";
|
|
4707
5364
|
import Chip3 from "@mui/material/Chip";
|
|
4708
|
-
import { styled as
|
|
4709
|
-
import { jsx as
|
|
4710
|
-
var NotificationTabsRoot =
|
|
5365
|
+
import { styled as styled46 } from "@mui/material/styles";
|
|
5366
|
+
import { jsx as jsx60, jsxs as jsxs20 } from "react/jsx-runtime";
|
|
5367
|
+
var NotificationTabsRoot = styled46(Box24, {
|
|
4711
5368
|
name: "MuiNotificationPanel",
|
|
4712
5369
|
slot: "Tabs"
|
|
4713
5370
|
})(({ theme }) => ({
|
|
4714
5371
|
borderBottom: `1px solid ${(theme.vars || theme).palette.divider}`
|
|
4715
5372
|
}));
|
|
4716
|
-
var NotificationTabsInner =
|
|
5373
|
+
var NotificationTabsInner = styled46(Tabs, {
|
|
4717
5374
|
name: "MuiNotificationPanel",
|
|
4718
5375
|
slot: "TabsInner"
|
|
4719
5376
|
})({
|
|
@@ -4724,7 +5381,7 @@ var NotificationTabsInner = styled41(Tabs, {
|
|
|
4724
5381
|
fontWeight: 500
|
|
4725
5382
|
}
|
|
4726
5383
|
});
|
|
4727
|
-
var NotificationTabLabel =
|
|
5384
|
+
var NotificationTabLabel = styled46(Box24, {
|
|
4728
5385
|
name: "MuiNotificationPanel",
|
|
4729
5386
|
slot: "TabLabel"
|
|
4730
5387
|
})(({ theme }) => ({
|
|
@@ -4732,7 +5389,7 @@ var NotificationTabLabel = styled41(Box21, {
|
|
|
4732
5389
|
alignItems: "center",
|
|
4733
5390
|
gap: theme.spacing(1)
|
|
4734
5391
|
}));
|
|
4735
|
-
var NotificationTabCount =
|
|
5392
|
+
var NotificationTabCount = styled46(Chip3, {
|
|
4736
5393
|
name: "MuiNotificationPanel",
|
|
4737
5394
|
slot: "TabCount"
|
|
4738
5395
|
})({
|
|
@@ -4745,18 +5402,18 @@ var NotificationTabs = ({
|
|
|
4745
5402
|
onChange,
|
|
4746
5403
|
sx
|
|
4747
5404
|
}) => {
|
|
4748
|
-
return /* @__PURE__ */
|
|
5405
|
+
return /* @__PURE__ */ jsx60(NotificationTabsRoot, { sx, children: /* @__PURE__ */ jsx60(
|
|
4749
5406
|
NotificationTabsInner,
|
|
4750
5407
|
{
|
|
4751
5408
|
value,
|
|
4752
5409
|
onChange: (_, newValue) => onChange(newValue),
|
|
4753
5410
|
variant: "fullWidth",
|
|
4754
|
-
children: tabs.map((tab, index) => /* @__PURE__ */
|
|
5411
|
+
children: tabs.map((tab, index) => /* @__PURE__ */ jsx60(
|
|
4755
5412
|
Tab,
|
|
4756
5413
|
{
|
|
4757
|
-
label: /* @__PURE__ */
|
|
5414
|
+
label: /* @__PURE__ */ jsxs20(NotificationTabLabel, { children: [
|
|
4758
5415
|
tab.label,
|
|
4759
|
-
tab.count !== void 0 && tab.count > 0 && /* @__PURE__ */
|
|
5416
|
+
tab.count !== void 0 && tab.count > 0 && /* @__PURE__ */ jsx60(
|
|
4760
5417
|
NotificationTabCount,
|
|
4761
5418
|
{
|
|
4762
5419
|
label: tab.count,
|
|
@@ -4774,12 +5431,12 @@ var NotificationTabs = ({
|
|
|
4774
5431
|
};
|
|
4775
5432
|
|
|
4776
5433
|
// src/components/NotificationPanel/NotificationActions.tsx
|
|
4777
|
-
import
|
|
5434
|
+
import Box25 from "@mui/material/Box";
|
|
4778
5435
|
import Button3 from "@mui/material/Button";
|
|
4779
|
-
import { styled as
|
|
5436
|
+
import { styled as styled47 } from "@mui/material/styles";
|
|
4780
5437
|
import { CheckCheck, Trash2 } from "@wso2/oxygen-ui-icons-react";
|
|
4781
|
-
import { jsx as
|
|
4782
|
-
var NotificationActionsRoot =
|
|
5438
|
+
import { jsx as jsx61, jsxs as jsxs21 } from "react/jsx-runtime";
|
|
5439
|
+
var NotificationActionsRoot = styled47(Box25, {
|
|
4783
5440
|
name: "MuiNotificationPanel",
|
|
4784
5441
|
slot: "Actions"
|
|
4785
5442
|
})(({ theme }) => ({
|
|
@@ -4791,7 +5448,7 @@ var NotificationActionsRoot = styled42(Box22, {
|
|
|
4791
5448
|
borderBottom: `1px solid ${(theme.vars || theme).palette.divider}`,
|
|
4792
5449
|
backgroundColor: (theme.vars || theme).palette.action.hover
|
|
4793
5450
|
}));
|
|
4794
|
-
var NotificationActionButton =
|
|
5451
|
+
var NotificationActionButton = styled47(Button3, {
|
|
4795
5452
|
name: "MuiNotificationPanel",
|
|
4796
5453
|
slot: "ActionButton"
|
|
4797
5454
|
})({
|
|
@@ -4804,21 +5461,21 @@ var NotificationActions = ({
|
|
|
4804
5461
|
onClearAll,
|
|
4805
5462
|
sx
|
|
4806
5463
|
}) => {
|
|
4807
|
-
return /* @__PURE__ */
|
|
4808
|
-
hasUnread && onMarkAllRead && /* @__PURE__ */
|
|
5464
|
+
return /* @__PURE__ */ jsxs21(NotificationActionsRoot, { sx, children: [
|
|
5465
|
+
hasUnread && onMarkAllRead && /* @__PURE__ */ jsx61(
|
|
4809
5466
|
NotificationActionButton,
|
|
4810
5467
|
{
|
|
4811
5468
|
size: "small",
|
|
4812
|
-
startIcon: /* @__PURE__ */
|
|
5469
|
+
startIcon: /* @__PURE__ */ jsx61(CheckCheck, { size: 14 }),
|
|
4813
5470
|
onClick: onMarkAllRead,
|
|
4814
5471
|
children: "Mark all read"
|
|
4815
5472
|
}
|
|
4816
5473
|
),
|
|
4817
|
-
onClearAll && /* @__PURE__ */
|
|
5474
|
+
onClearAll && /* @__PURE__ */ jsx61(
|
|
4818
5475
|
NotificationActionButton,
|
|
4819
5476
|
{
|
|
4820
5477
|
size: "small",
|
|
4821
|
-
startIcon: /* @__PURE__ */
|
|
5478
|
+
startIcon: /* @__PURE__ */ jsx61(Trash2, { size: 14 }),
|
|
4822
5479
|
onClick: onClearAll,
|
|
4823
5480
|
color: "error",
|
|
4824
5481
|
children: "Clear all"
|
|
@@ -4828,13 +5485,13 @@ var NotificationActions = ({
|
|
|
4828
5485
|
};
|
|
4829
5486
|
|
|
4830
5487
|
// src/components/NotificationPanel/NotificationList.tsx
|
|
4831
|
-
import * as
|
|
4832
|
-
import
|
|
5488
|
+
import * as React29 from "react";
|
|
5489
|
+
import Box26 from "@mui/material/Box";
|
|
4833
5490
|
import List3 from "@mui/material/List";
|
|
4834
5491
|
import Divider6 from "@mui/material/Divider";
|
|
4835
|
-
import { styled as
|
|
4836
|
-
import { jsx as
|
|
4837
|
-
var NotificationListRoot =
|
|
5492
|
+
import { styled as styled48 } from "@mui/material/styles";
|
|
5493
|
+
import { jsx as jsx62, jsxs as jsxs22 } from "react/jsx-runtime";
|
|
5494
|
+
var NotificationListRoot = styled48(Box26, {
|
|
4838
5495
|
name: "MuiNotificationPanel",
|
|
4839
5496
|
slot: "List"
|
|
4840
5497
|
})({
|
|
@@ -4846,21 +5503,21 @@ var NotificationList = ({
|
|
|
4846
5503
|
showDividers = true,
|
|
4847
5504
|
sx
|
|
4848
5505
|
}) => {
|
|
4849
|
-
const childArray =
|
|
4850
|
-
return /* @__PURE__ */
|
|
5506
|
+
const childArray = React29.Children.toArray(children);
|
|
5507
|
+
return /* @__PURE__ */ jsx62(NotificationListRoot, { sx, children: /* @__PURE__ */ jsx62(List3, { disablePadding: true, children: childArray.map((child, index) => /* @__PURE__ */ jsxs22(React29.Fragment, { children: [
|
|
4851
5508
|
child,
|
|
4852
|
-
showDividers && index < childArray.length - 1 && /* @__PURE__ */
|
|
5509
|
+
showDividers && index < childArray.length - 1 && /* @__PURE__ */ jsx62(Divider6, {})
|
|
4853
5510
|
] }, index)) }) });
|
|
4854
5511
|
};
|
|
4855
5512
|
|
|
4856
5513
|
// src/components/NotificationPanel/NotificationItem.tsx
|
|
4857
|
-
import * as
|
|
4858
|
-
import
|
|
5514
|
+
import * as React31 from "react";
|
|
5515
|
+
import Box27 from "@mui/material/Box";
|
|
4859
5516
|
import ListItem2 from "@mui/material/ListItem";
|
|
4860
5517
|
import ListItemButton3 from "@mui/material/ListItemButton";
|
|
4861
5518
|
import ListItemText3 from "@mui/material/ListItemText";
|
|
4862
|
-
import
|
|
4863
|
-
import { styled as
|
|
5519
|
+
import IconButton6 from "@mui/material/IconButton";
|
|
5520
|
+
import { styled as styled49 } from "@mui/material/styles";
|
|
4864
5521
|
import { X as X3 } from "@wso2/oxygen-ui-icons-react";
|
|
4865
5522
|
|
|
4866
5523
|
// src/components/NotificationPanel/utils.ts
|
|
@@ -4900,11 +5557,11 @@ var getNotificationTypeProps = (type) => {
|
|
|
4900
5557
|
};
|
|
4901
5558
|
|
|
4902
5559
|
// src/components/NotificationPanel/NotificationItemContext.tsx
|
|
4903
|
-
import * as
|
|
4904
|
-
import { jsx as
|
|
4905
|
-
var NotificationItemContext =
|
|
5560
|
+
import * as React30 from "react";
|
|
5561
|
+
import { jsx as jsx63 } from "react/jsx-runtime";
|
|
5562
|
+
var NotificationItemContext = React30.createContext(null);
|
|
4906
5563
|
var useNotificationItemContext = () => {
|
|
4907
|
-
const context =
|
|
5564
|
+
const context = React30.useContext(NotificationItemContext);
|
|
4908
5565
|
if (!context) {
|
|
4909
5566
|
throw new Error(
|
|
4910
5567
|
"useNotificationItemContext must be used within a NotificationItem component"
|
|
@@ -4913,12 +5570,12 @@ var useNotificationItemContext = () => {
|
|
|
4913
5570
|
return context;
|
|
4914
5571
|
};
|
|
4915
5572
|
var NotificationItemProvider = ({ value, children }) => {
|
|
4916
|
-
return /* @__PURE__ */
|
|
5573
|
+
return /* @__PURE__ */ jsx63(NotificationItemContext.Provider, { value, children });
|
|
4917
5574
|
};
|
|
4918
5575
|
|
|
4919
5576
|
// src/components/NotificationPanel/NotificationItem.tsx
|
|
4920
|
-
import { jsx as
|
|
4921
|
-
var NotificationItemRoot =
|
|
5577
|
+
import { jsx as jsx64, jsxs as jsxs23 } from "react/jsx-runtime";
|
|
5578
|
+
var NotificationItemRoot = styled49(ListItem2, {
|
|
4922
5579
|
name: "MuiNotificationPanel",
|
|
4923
5580
|
slot: "Item",
|
|
4924
5581
|
shouldForwardProp: (prop) => prop !== "ownerState"
|
|
@@ -4928,13 +5585,13 @@ var NotificationItemRoot = styled44(ListItem2, {
|
|
|
4928
5585
|
backgroundColor: (theme.vars || theme).palette.action.selected
|
|
4929
5586
|
}
|
|
4930
5587
|
}));
|
|
4931
|
-
var NotificationItemButton =
|
|
5588
|
+
var NotificationItemButton = styled49(ListItemButton3, {
|
|
4932
5589
|
name: "MuiNotificationPanel",
|
|
4933
5590
|
slot: "ItemButton"
|
|
4934
5591
|
})(({ theme }) => ({
|
|
4935
5592
|
paddingRight: theme.spacing(6)
|
|
4936
5593
|
}));
|
|
4937
|
-
var NotificationItemDismiss =
|
|
5594
|
+
var NotificationItemDismiss = styled49(IconButton6, {
|
|
4938
5595
|
name: "MuiNotificationPanel",
|
|
4939
5596
|
slot: "ItemDismiss"
|
|
4940
5597
|
})({
|
|
@@ -4943,7 +5600,7 @@ var NotificationItemDismiss = styled44(IconButton5, {
|
|
|
4943
5600
|
opacity: 1
|
|
4944
5601
|
}
|
|
4945
5602
|
});
|
|
4946
|
-
var NotificationItemFooter =
|
|
5603
|
+
var NotificationItemFooter = styled49(Box27, {
|
|
4947
5604
|
name: "MuiNotificationPanel",
|
|
4948
5605
|
slot: "ItemFooter"
|
|
4949
5606
|
})(({ theme }) => ({
|
|
@@ -4958,9 +5615,9 @@ var separateChildren5 = (children) => {
|
|
|
4958
5615
|
let messageChild = null;
|
|
4959
5616
|
let timestampChild = null;
|
|
4960
5617
|
let actionChild = null;
|
|
4961
|
-
|
|
5618
|
+
React31.Children.forEach(children, (child) => {
|
|
4962
5619
|
var _a;
|
|
4963
|
-
if (
|
|
5620
|
+
if (React31.isValidElement(child)) {
|
|
4964
5621
|
const displayName = (_a = child.type) == null ? void 0 : _a.displayName;
|
|
4965
5622
|
switch (displayName) {
|
|
4966
5623
|
case "NotificationItemAvatar":
|
|
@@ -5010,32 +5667,33 @@ var NotificationItem = ({
|
|
|
5010
5667
|
onAction == null ? void 0 : onAction();
|
|
5011
5668
|
};
|
|
5012
5669
|
const ownerState = { read };
|
|
5013
|
-
return /* @__PURE__ */
|
|
5670
|
+
return /* @__PURE__ */ jsx64(NotificationItemProvider, { value: contextValue, children: /* @__PURE__ */ jsx64(
|
|
5014
5671
|
NotificationItemRoot,
|
|
5015
5672
|
{
|
|
5016
5673
|
disablePadding: true,
|
|
5017
5674
|
ownerState,
|
|
5018
|
-
secondaryAction: onDismiss && /* @__PURE__ */
|
|
5675
|
+
secondaryAction: onDismiss && /* @__PURE__ */ jsx64(
|
|
5019
5676
|
NotificationItemDismiss,
|
|
5020
5677
|
{
|
|
5021
5678
|
size: "small",
|
|
5679
|
+
"aria-label": "Dismiss notification",
|
|
5022
5680
|
onClick: (e) => {
|
|
5023
5681
|
e.stopPropagation();
|
|
5024
5682
|
onDismiss(id);
|
|
5025
5683
|
},
|
|
5026
|
-
children: /* @__PURE__ */
|
|
5684
|
+
children: /* @__PURE__ */ jsx64(X3, { size: 16, "aria-hidden": "true" })
|
|
5027
5685
|
}
|
|
5028
5686
|
),
|
|
5029
5687
|
sx,
|
|
5030
|
-
children: /* @__PURE__ */
|
|
5688
|
+
children: /* @__PURE__ */ jsxs23(NotificationItemButton, { onClick: handleClick, children: [
|
|
5031
5689
|
avatarChild,
|
|
5032
|
-
/* @__PURE__ */
|
|
5690
|
+
/* @__PURE__ */ jsx64(
|
|
5033
5691
|
ListItemText3,
|
|
5034
5692
|
{
|
|
5035
5693
|
primary: titleChild,
|
|
5036
|
-
secondary: /* @__PURE__ */
|
|
5694
|
+
secondary: /* @__PURE__ */ jsxs23(Box27, { component: "span", children: [
|
|
5037
5695
|
messageChild,
|
|
5038
|
-
/* @__PURE__ */
|
|
5696
|
+
/* @__PURE__ */ jsxs23(NotificationItemFooter, { children: [
|
|
5039
5697
|
timestampChild,
|
|
5040
5698
|
actionChild
|
|
5041
5699
|
] })
|
|
@@ -5051,9 +5709,9 @@ NotificationItem.displayName = "NotificationItem";
|
|
|
5051
5709
|
// src/components/NotificationPanel/NotificationItemAvatar.tsx
|
|
5052
5710
|
import ListItemAvatar from "@mui/material/ListItemAvatar";
|
|
5053
5711
|
import Avatar3 from "@mui/material/Avatar";
|
|
5054
|
-
import { styled as
|
|
5055
|
-
import { jsx as
|
|
5056
|
-
var NotificationItemAvatarStyled =
|
|
5712
|
+
import { styled as styled50 } from "@mui/material/styles";
|
|
5713
|
+
import { jsx as jsx65 } from "react/jsx-runtime";
|
|
5714
|
+
var NotificationItemAvatarStyled = styled50(Avatar3, {
|
|
5057
5715
|
name: "MuiNotificationPanel",
|
|
5058
5716
|
slot: "ItemAvatar",
|
|
5059
5717
|
shouldForwardProp: (prop) => prop !== "ownerState"
|
|
@@ -5076,16 +5734,16 @@ var NotificationItemAvatar = ({
|
|
|
5076
5734
|
color: typeProps.color,
|
|
5077
5735
|
hasChildren: !!children
|
|
5078
5736
|
};
|
|
5079
|
-
return /* @__PURE__ */
|
|
5737
|
+
return /* @__PURE__ */ jsx65(ListItemAvatar, { children: /* @__PURE__ */ jsx65(NotificationItemAvatarStyled, { ownerState, sx, children: children || /* @__PURE__ */ jsx65(Icon, { size: 20 }) }) });
|
|
5080
5738
|
};
|
|
5081
5739
|
NotificationItemAvatar.displayName = "NotificationItemAvatar";
|
|
5082
5740
|
|
|
5083
5741
|
// src/components/NotificationPanel/NotificationItemTitle.tsx
|
|
5084
|
-
import
|
|
5085
|
-
import
|
|
5086
|
-
import { styled as
|
|
5087
|
-
import { jsx as
|
|
5088
|
-
var NotificationItemTitleRoot =
|
|
5742
|
+
import Box28 from "@mui/material/Box";
|
|
5743
|
+
import Typography14 from "@mui/material/Typography";
|
|
5744
|
+
import { styled as styled51 } from "@mui/material/styles";
|
|
5745
|
+
import { jsx as jsx66, jsxs as jsxs24 } from "react/jsx-runtime";
|
|
5746
|
+
var NotificationItemTitleRoot = styled51(Box28, {
|
|
5089
5747
|
name: "MuiNotificationPanel",
|
|
5090
5748
|
slot: "ItemTitle"
|
|
5091
5749
|
})(({ theme }) => ({
|
|
@@ -5093,7 +5751,7 @@ var NotificationItemTitleRoot = styled46(Box25, {
|
|
|
5093
5751
|
alignItems: "center",
|
|
5094
5752
|
gap: theme.spacing(1)
|
|
5095
5753
|
}));
|
|
5096
|
-
var NotificationItemTitleText =
|
|
5754
|
+
var NotificationItemTitleText = styled51(Typography14, {
|
|
5097
5755
|
name: "MuiNotificationPanel",
|
|
5098
5756
|
slot: "ItemTitleText",
|
|
5099
5757
|
shouldForwardProp: (prop) => prop !== "ownerState"
|
|
@@ -5101,7 +5759,7 @@ var NotificationItemTitleText = styled46(Typography12, {
|
|
|
5101
5759
|
fontWeight: ownerState.read ? 400 : 600,
|
|
5102
5760
|
flex: 1
|
|
5103
5761
|
}));
|
|
5104
|
-
var NotificationItemUnreadDot =
|
|
5762
|
+
var NotificationItemUnreadDot = styled51(Box28, {
|
|
5105
5763
|
name: "MuiNotificationPanel",
|
|
5106
5764
|
slot: "ItemUnreadDot"
|
|
5107
5765
|
})(({ theme }) => ({
|
|
@@ -5117,18 +5775,18 @@ var NotificationItemTitle = ({
|
|
|
5117
5775
|
sx
|
|
5118
5776
|
}) => {
|
|
5119
5777
|
const { read } = useNotificationItemContext();
|
|
5120
|
-
return /* @__PURE__ */
|
|
5121
|
-
/* @__PURE__ */
|
|
5122
|
-
showUnreadIndicator && !read && /* @__PURE__ */
|
|
5778
|
+
return /* @__PURE__ */ jsxs24(NotificationItemTitleRoot, { sx, children: [
|
|
5779
|
+
/* @__PURE__ */ jsx66(NotificationItemTitleText, { variant: "body2", ownerState: { read }, children }),
|
|
5780
|
+
showUnreadIndicator && !read && /* @__PURE__ */ jsx66(NotificationItemUnreadDot, {})
|
|
5123
5781
|
] });
|
|
5124
5782
|
};
|
|
5125
5783
|
NotificationItemTitle.displayName = "NotificationItemTitle";
|
|
5126
5784
|
|
|
5127
5785
|
// src/components/NotificationPanel/NotificationItemMessage.tsx
|
|
5128
|
-
import
|
|
5129
|
-
import { styled as
|
|
5130
|
-
import { jsx as
|
|
5131
|
-
var NotificationItemMessageRoot =
|
|
5786
|
+
import Typography15 from "@mui/material/Typography";
|
|
5787
|
+
import { styled as styled52 } from "@mui/material/styles";
|
|
5788
|
+
import { jsx as jsx67 } from "react/jsx-runtime";
|
|
5789
|
+
var NotificationItemMessageRoot = styled52(Typography15, {
|
|
5132
5790
|
name: "MuiNotificationPanel",
|
|
5133
5791
|
slot: "ItemMessage"
|
|
5134
5792
|
})(({ theme }) => ({
|
|
@@ -5140,15 +5798,15 @@ var NotificationItemMessage = ({
|
|
|
5140
5798
|
children,
|
|
5141
5799
|
sx
|
|
5142
5800
|
}) => {
|
|
5143
|
-
return /* @__PURE__ */
|
|
5801
|
+
return /* @__PURE__ */ jsx67(NotificationItemMessageRoot, { component: "span", variant: "caption", sx, children });
|
|
5144
5802
|
};
|
|
5145
5803
|
NotificationItemMessage.displayName = "NotificationItemMessage";
|
|
5146
5804
|
|
|
5147
5805
|
// src/components/NotificationPanel/NotificationItemTimestamp.tsx
|
|
5148
|
-
import
|
|
5149
|
-
import { styled as
|
|
5150
|
-
import { jsx as
|
|
5151
|
-
var NotificationItemTimestampRoot =
|
|
5806
|
+
import Typography16 from "@mui/material/Typography";
|
|
5807
|
+
import { styled as styled53 } from "@mui/material/styles";
|
|
5808
|
+
import { jsx as jsx68 } from "react/jsx-runtime";
|
|
5809
|
+
var NotificationItemTimestampRoot = styled53(Typography16, {
|
|
5152
5810
|
name: "MuiNotificationPanel",
|
|
5153
5811
|
slot: "ItemTimestamp"
|
|
5154
5812
|
})(({ theme }) => ({
|
|
@@ -5159,15 +5817,15 @@ var NotificationItemTimestamp = ({
|
|
|
5159
5817
|
children,
|
|
5160
5818
|
sx
|
|
5161
5819
|
}) => {
|
|
5162
|
-
return /* @__PURE__ */
|
|
5820
|
+
return /* @__PURE__ */ jsx68(NotificationItemTimestampRoot, { component: "span", variant: "caption", sx, children });
|
|
5163
5821
|
};
|
|
5164
5822
|
NotificationItemTimestamp.displayName = "NotificationItemTimestamp";
|
|
5165
5823
|
|
|
5166
5824
|
// src/components/NotificationPanel/NotificationItemAction.tsx
|
|
5167
5825
|
import Chip4 from "@mui/material/Chip";
|
|
5168
|
-
import { styled as
|
|
5169
|
-
import { jsx as
|
|
5170
|
-
var NotificationItemActionRoot =
|
|
5826
|
+
import { styled as styled54 } from "@mui/material/styles";
|
|
5827
|
+
import { jsx as jsx69 } from "react/jsx-runtime";
|
|
5828
|
+
var NotificationItemActionRoot = styled54(Chip4, {
|
|
5171
5829
|
name: "MuiNotificationPanel",
|
|
5172
5830
|
slot: "ItemAction"
|
|
5173
5831
|
})({
|
|
@@ -5189,7 +5847,7 @@ var NotificationItemAction = ({
|
|
|
5189
5847
|
onAction == null ? void 0 : onAction();
|
|
5190
5848
|
}
|
|
5191
5849
|
};
|
|
5192
|
-
return /* @__PURE__ */
|
|
5850
|
+
return /* @__PURE__ */ jsx69(
|
|
5193
5851
|
NotificationItemActionRoot,
|
|
5194
5852
|
{
|
|
5195
5853
|
label: children,
|
|
@@ -5203,12 +5861,12 @@ var NotificationItemAction = ({
|
|
|
5203
5861
|
NotificationItemAction.displayName = "NotificationItemAction";
|
|
5204
5862
|
|
|
5205
5863
|
// src/components/NotificationPanel/NotificationEmptyState.tsx
|
|
5206
|
-
import
|
|
5207
|
-
import
|
|
5208
|
-
import { styled as
|
|
5864
|
+
import Box29 from "@mui/material/Box";
|
|
5865
|
+
import Typography17 from "@mui/material/Typography";
|
|
5866
|
+
import { styled as styled55 } from "@mui/material/styles";
|
|
5209
5867
|
import { BellOff } from "@wso2/oxygen-ui-icons-react";
|
|
5210
|
-
import { jsx as
|
|
5211
|
-
var NotificationEmptyStateRoot =
|
|
5868
|
+
import { jsx as jsx70, jsxs as jsxs25 } from "react/jsx-runtime";
|
|
5869
|
+
var NotificationEmptyStateRoot = styled55(Box29, {
|
|
5212
5870
|
name: "MuiNotificationPanel",
|
|
5213
5871
|
slot: "EmptyState"
|
|
5214
5872
|
})(({ theme }) => ({
|
|
@@ -5222,7 +5880,7 @@ var NotificationEmptyStateRoot = styled50(Box26, {
|
|
|
5222
5880
|
paddingRight: theme.spacing(3),
|
|
5223
5881
|
textAlign: "center"
|
|
5224
5882
|
}));
|
|
5225
|
-
var NotificationEmptyStateMessage =
|
|
5883
|
+
var NotificationEmptyStateMessage = styled55(Typography17, {
|
|
5226
5884
|
name: "MuiNotificationPanel",
|
|
5227
5885
|
slot: "EmptyStateMessage"
|
|
5228
5886
|
})(({ theme }) => ({
|
|
@@ -5233,15 +5891,15 @@ var NotificationEmptyState = ({
|
|
|
5233
5891
|
icon,
|
|
5234
5892
|
sx
|
|
5235
5893
|
}) => {
|
|
5236
|
-
return /* @__PURE__ */
|
|
5237
|
-
icon || /* @__PURE__ */
|
|
5238
|
-
/* @__PURE__ */
|
|
5894
|
+
return /* @__PURE__ */ jsxs25(NotificationEmptyStateRoot, { sx, children: [
|
|
5895
|
+
icon || /* @__PURE__ */ jsx70(BellOff, { size: 48, style: { opacity: 0.3, marginBottom: 16 } }),
|
|
5896
|
+
/* @__PURE__ */ jsx70(NotificationEmptyStateMessage, { variant: "body2", children: message })
|
|
5239
5897
|
] });
|
|
5240
5898
|
};
|
|
5241
5899
|
|
|
5242
5900
|
// src/components/NotificationPanel/NotificationPanel.tsx
|
|
5243
|
-
import { jsx as
|
|
5244
|
-
var NotificationPanelRoot =
|
|
5901
|
+
import { jsx as jsx71, jsxs as jsxs26 } from "react/jsx-runtime";
|
|
5902
|
+
var NotificationPanelRoot = styled56(Drawer, {
|
|
5245
5903
|
name: "MuiNotificationPanel",
|
|
5246
5904
|
slot: "Root",
|
|
5247
5905
|
shouldForwardProp: (prop) => prop !== "ownerState"
|
|
@@ -5263,12 +5921,14 @@ var NotificationPanel = ({
|
|
|
5263
5921
|
width = 380,
|
|
5264
5922
|
anchor = "right",
|
|
5265
5923
|
variant = "temporary",
|
|
5924
|
+
"aria-label": ariaLabelProp,
|
|
5925
|
+
liveAnnouncement: liveAnnouncementProp,
|
|
5266
5926
|
sx
|
|
5267
5927
|
}) => {
|
|
5268
5928
|
var _a;
|
|
5269
|
-
const appShellContext =
|
|
5929
|
+
const appShellContext = React32.useContext(AppShellContext);
|
|
5270
5930
|
const open = (_a = openProp != null ? openProp : appShellContext == null ? void 0 : appShellContext.state.notificationPanelOpen) != null ? _a : false;
|
|
5271
|
-
const onClose =
|
|
5931
|
+
const onClose = React32.useMemo(
|
|
5272
5932
|
() => {
|
|
5273
5933
|
var _a2;
|
|
5274
5934
|
return (_a2 = onCloseProp != null ? onCloseProp : appShellContext == null ? void 0 : appShellContext.actions.toggleNotificationPanel) != null ? _a2 : (() => {
|
|
@@ -5276,9 +5936,42 @@ var NotificationPanel = ({
|
|
|
5276
5936
|
},
|
|
5277
5937
|
[onCloseProp, appShellContext == null ? void 0 : appShellContext.actions.toggleNotificationPanel]
|
|
5278
5938
|
);
|
|
5279
|
-
const
|
|
5939
|
+
const ariaLabel = typeof ariaLabelProp === "string" && ariaLabelProp.trim().length > 0 ? ariaLabelProp.trim() : "Notifications";
|
|
5940
|
+
const [liveAnnouncement, setLiveAnnouncementState] = React32.useState("");
|
|
5941
|
+
const [liveAnnouncementNonce, setLiveAnnouncementNonce] = React32.useState(0);
|
|
5942
|
+
const prevLiveAnnouncementPropRef = React32.useRef(void 0);
|
|
5943
|
+
const publishLiveAnnouncement = React32.useCallback(
|
|
5944
|
+
(message) => {
|
|
5945
|
+
if (!open) return;
|
|
5946
|
+
setLiveAnnouncementState(message);
|
|
5947
|
+
setLiveAnnouncementNonce((n) => n + 1);
|
|
5948
|
+
},
|
|
5949
|
+
[open]
|
|
5950
|
+
);
|
|
5951
|
+
React32.useEffect(() => {
|
|
5952
|
+
if (!open) {
|
|
5953
|
+
setLiveAnnouncementState("");
|
|
5954
|
+
prevLiveAnnouncementPropRef.current = liveAnnouncementProp;
|
|
5955
|
+
return;
|
|
5956
|
+
}
|
|
5957
|
+
const prev = prevLiveAnnouncementPropRef.current;
|
|
5958
|
+
prevLiveAnnouncementPropRef.current = liveAnnouncementProp;
|
|
5959
|
+
if (liveAnnouncementProp === void 0) {
|
|
5960
|
+
if (prev !== void 0) {
|
|
5961
|
+
setLiveAnnouncementState("");
|
|
5962
|
+
}
|
|
5963
|
+
return;
|
|
5964
|
+
}
|
|
5965
|
+
if (liveAnnouncementProp !== prev) {
|
|
5966
|
+
publishLiveAnnouncement(liveAnnouncementProp);
|
|
5967
|
+
}
|
|
5968
|
+
}, [open, liveAnnouncementProp, publishLiveAnnouncement]);
|
|
5969
|
+
const contextValue = React32.useMemo(
|
|
5970
|
+
() => ({ onClose, open, setLiveAnnouncement: publishLiveAnnouncement }),
|
|
5971
|
+
[onClose, open, publishLiveAnnouncement]
|
|
5972
|
+
);
|
|
5280
5973
|
const ownerState = { width };
|
|
5281
|
-
return /* @__PURE__ */
|
|
5974
|
+
return /* @__PURE__ */ jsx71(NotificationPanelContext.Provider, { value: contextValue, children: /* @__PURE__ */ jsxs26(
|
|
5282
5975
|
NotificationPanelRoot,
|
|
5283
5976
|
{
|
|
5284
5977
|
anchor,
|
|
@@ -5287,7 +5980,27 @@ var NotificationPanel = ({
|
|
|
5287
5980
|
ownerState,
|
|
5288
5981
|
sx,
|
|
5289
5982
|
variant,
|
|
5290
|
-
|
|
5983
|
+
slotProps: {
|
|
5984
|
+
paper: {
|
|
5985
|
+
"aria-label": ariaLabel
|
|
5986
|
+
}
|
|
5987
|
+
},
|
|
5988
|
+
children: [
|
|
5989
|
+
/* @__PURE__ */ jsx71(
|
|
5990
|
+
Box30,
|
|
5991
|
+
{
|
|
5992
|
+
component: "div",
|
|
5993
|
+
role: "status",
|
|
5994
|
+
"aria-live": "polite",
|
|
5995
|
+
"aria-atomic": "true",
|
|
5996
|
+
sx: visuallyHidden3,
|
|
5997
|
+
"data-testid": "notification-panel-live-region",
|
|
5998
|
+
children: liveAnnouncement
|
|
5999
|
+
},
|
|
6000
|
+
liveAnnouncementNonce
|
|
6001
|
+
),
|
|
6002
|
+
children
|
|
6003
|
+
]
|
|
5291
6004
|
}
|
|
5292
6005
|
) });
|
|
5293
6006
|
};
|
|
@@ -5309,47 +6022,49 @@ NotificationPanel.EmptyState = NotificationEmptyState;
|
|
|
5309
6022
|
NotificationPanel.displayName = "NotificationPanel";
|
|
5310
6023
|
|
|
5311
6024
|
// src/components/Footer/Footer.tsx
|
|
5312
|
-
import * as
|
|
5313
|
-
import
|
|
5314
|
-
import { styled as
|
|
6025
|
+
import * as React33 from "react";
|
|
6026
|
+
import Box31 from "@mui/material/Box";
|
|
6027
|
+
import { styled as styled60 } from "@mui/material/styles";
|
|
5315
6028
|
|
|
5316
6029
|
// src/components/Footer/FooterCopyright.tsx
|
|
5317
|
-
import
|
|
5318
|
-
import { styled as
|
|
5319
|
-
import { jsx as
|
|
5320
|
-
var StyledCopyrightText =
|
|
6030
|
+
import Typography18 from "@mui/material/Typography";
|
|
6031
|
+
import { styled as styled57 } from "@mui/material/styles";
|
|
6032
|
+
import { jsx as jsx72 } from "react/jsx-runtime";
|
|
6033
|
+
var StyledCopyrightText = styled57(Typography18, {
|
|
5321
6034
|
name: "MuiFooter",
|
|
5322
6035
|
slot: "CopyrightText"
|
|
5323
6036
|
})(({ theme }) => ({
|
|
5324
6037
|
color: (theme.vars || theme).palette.text.secondary
|
|
5325
6038
|
}));
|
|
5326
6039
|
var FooterCopyright = ({ children }) => {
|
|
5327
|
-
return /* @__PURE__ */
|
|
6040
|
+
return /* @__PURE__ */ jsx72(StyledCopyrightText, { variant: "caption", children });
|
|
5328
6041
|
};
|
|
5329
6042
|
FooterCopyright.displayName = "Footer.Copyright";
|
|
5330
6043
|
|
|
5331
6044
|
// src/components/Footer/FooterVersion.tsx
|
|
5332
|
-
import
|
|
5333
|
-
import { styled as
|
|
5334
|
-
import { jsx as
|
|
5335
|
-
var StyledVersion =
|
|
6045
|
+
import Typography19 from "@mui/material/Typography";
|
|
6046
|
+
import { styled as styled58 } from "@mui/material/styles";
|
|
6047
|
+
import { jsx as jsx73 } from "react/jsx-runtime";
|
|
6048
|
+
var StyledVersion = styled58(Typography19, {
|
|
5336
6049
|
name: "MuiFooter",
|
|
5337
6050
|
slot: "Version"
|
|
5338
6051
|
})(({ theme }) => ({
|
|
5339
|
-
|
|
6052
|
+
// text.secondary (not text.disabled) so the version text keeps a
|
|
6053
|
+
// WCAG AA compliant 4.5:1 contrast ratio at this small size.
|
|
6054
|
+
color: (theme.vars || theme).palette.text.secondary,
|
|
5340
6055
|
fontFamily: "monospace",
|
|
5341
6056
|
fontSize: 11
|
|
5342
6057
|
}));
|
|
5343
6058
|
var FooterVersion = ({ children }) => {
|
|
5344
|
-
return /* @__PURE__ */
|
|
6059
|
+
return /* @__PURE__ */ jsx73(StyledVersion, { variant: "caption", children });
|
|
5345
6060
|
};
|
|
5346
6061
|
FooterVersion.displayName = "Footer.Version";
|
|
5347
6062
|
|
|
5348
6063
|
// src/components/Footer/FooterLink.tsx
|
|
5349
6064
|
import Link2 from "@mui/material/Link";
|
|
5350
|
-
import { styled as
|
|
5351
|
-
import { jsx as
|
|
5352
|
-
var StyledLink =
|
|
6065
|
+
import { styled as styled59 } from "@mui/material/styles";
|
|
6066
|
+
import { jsx as jsx74 } from "react/jsx-runtime";
|
|
6067
|
+
var StyledLink = styled59(Link2, {
|
|
5353
6068
|
name: "MuiFooter",
|
|
5354
6069
|
slot: "Link"
|
|
5355
6070
|
})(({ theme }) => ({
|
|
@@ -5361,15 +6076,15 @@ var StyledLink = styled54(Link2, {
|
|
|
5361
6076
|
}));
|
|
5362
6077
|
var FooterLink = (_a) => {
|
|
5363
6078
|
var _b = _a, { children, href } = _b, props = __objRest(_b, ["children", "href"]);
|
|
5364
|
-
return /* @__PURE__ */
|
|
6079
|
+
return /* @__PURE__ */ jsx74(StyledLink, __spreadProps(__spreadValues({ href, underline: "hover" }, props), { children }));
|
|
5365
6080
|
};
|
|
5366
6081
|
FooterLink.displayName = "Footer.Link";
|
|
5367
6082
|
|
|
5368
6083
|
// src/components/Footer/FooterDivider.tsx
|
|
5369
6084
|
import Divider7 from "@mui/material/Divider";
|
|
5370
|
-
import { jsx as
|
|
6085
|
+
import { jsx as jsx75 } from "react/jsx-runtime";
|
|
5371
6086
|
var FooterDivider = () => {
|
|
5372
|
-
return /* @__PURE__ */
|
|
6087
|
+
return /* @__PURE__ */ jsx75(
|
|
5373
6088
|
Divider7,
|
|
5374
6089
|
{
|
|
5375
6090
|
orientation: "vertical",
|
|
@@ -5381,8 +6096,8 @@ var FooterDivider = () => {
|
|
|
5381
6096
|
FooterDivider.displayName = "Footer.Divider";
|
|
5382
6097
|
|
|
5383
6098
|
// src/components/Footer/Footer.tsx
|
|
5384
|
-
import { jsx as
|
|
5385
|
-
var FooterRoot =
|
|
6099
|
+
import { jsx as jsx76, jsxs as jsxs27 } from "react/jsx-runtime";
|
|
6100
|
+
var FooterRoot = styled60(Box31, {
|
|
5386
6101
|
name: "MuiFooter",
|
|
5387
6102
|
slot: "Root"
|
|
5388
6103
|
})(({ theme }) => ({
|
|
@@ -5395,7 +6110,7 @@ var FooterRoot = styled55(Box27, {
|
|
|
5395
6110
|
borderTop: `1px solid ${(theme.vars || theme).palette.divider}`,
|
|
5396
6111
|
backgroundColor: (theme.vars || theme).palette.background.paper
|
|
5397
6112
|
}));
|
|
5398
|
-
var FooterContent =
|
|
6113
|
+
var FooterContent = styled60(Box31, {
|
|
5399
6114
|
name: "MuiFooter",
|
|
5400
6115
|
slot: "Content"
|
|
5401
6116
|
})(({ theme }) => ({
|
|
@@ -5409,7 +6124,7 @@ var FooterContent = styled55(Box27, {
|
|
|
5409
6124
|
alignItems: "center"
|
|
5410
6125
|
}
|
|
5411
6126
|
}));
|
|
5412
|
-
var FooterLeft =
|
|
6127
|
+
var FooterLeft = styled60(Box31, {
|
|
5413
6128
|
name: "MuiFooter",
|
|
5414
6129
|
slot: "Left"
|
|
5415
6130
|
})(({ theme }) => ({
|
|
@@ -5418,7 +6133,7 @@ var FooterLeft = styled55(Box27, {
|
|
|
5418
6133
|
gap: theme.spacing(2),
|
|
5419
6134
|
flexWrap: "wrap"
|
|
5420
6135
|
}));
|
|
5421
|
-
var FooterRight =
|
|
6136
|
+
var FooterRight = styled60(Box31, {
|
|
5422
6137
|
name: "MuiFooter",
|
|
5423
6138
|
slot: "Right"
|
|
5424
6139
|
})(({ theme }) => ({
|
|
@@ -5428,11 +6143,11 @@ var FooterRight = styled55(Box27, {
|
|
|
5428
6143
|
flexWrap: "wrap"
|
|
5429
6144
|
}));
|
|
5430
6145
|
var Footer = ({ children, sx }) => {
|
|
5431
|
-
const childrenArray =
|
|
6146
|
+
const childrenArray = React33.Children.toArray(children);
|
|
5432
6147
|
const leftChildren = [];
|
|
5433
6148
|
const rightChildren = [];
|
|
5434
6149
|
childrenArray.forEach((child) => {
|
|
5435
|
-
if (
|
|
6150
|
+
if (React33.isValidElement(child)) {
|
|
5436
6151
|
if (child.type === FooterCopyright || child.type === FooterVersion || child.type === FooterDivider) {
|
|
5437
6152
|
leftChildren.push(child);
|
|
5438
6153
|
} else if (child.type === FooterLink) {
|
|
@@ -5440,9 +6155,9 @@ var Footer = ({ children, sx }) => {
|
|
|
5440
6155
|
}
|
|
5441
6156
|
}
|
|
5442
6157
|
});
|
|
5443
|
-
return /* @__PURE__ */
|
|
5444
|
-
leftChildren.length > 0 && /* @__PURE__ */
|
|
5445
|
-
rightChildren.length > 0 && /* @__PURE__ */
|
|
6158
|
+
return /* @__PURE__ */ jsx76(FooterRoot, { component: "footer", sx, children: /* @__PURE__ */ jsxs27(FooterContent, { children: [
|
|
6159
|
+
leftChildren.length > 0 && /* @__PURE__ */ jsx76(FooterLeft, { children: leftChildren }),
|
|
6160
|
+
rightChildren.length > 0 && /* @__PURE__ */ jsx76(FooterRight, { children: rightChildren })
|
|
5446
6161
|
] }) });
|
|
5447
6162
|
};
|
|
5448
6163
|
Footer.Copyright = FooterCopyright;
|
|
@@ -5452,14 +6167,14 @@ Footer.Divider = FooterDivider;
|
|
|
5452
6167
|
Footer.displayName = "Footer";
|
|
5453
6168
|
|
|
5454
6169
|
// src/components/UserMenu/UserMenu.tsx
|
|
5455
|
-
import * as
|
|
5456
|
-
import
|
|
6170
|
+
import * as React38 from "react";
|
|
6171
|
+
import Menu3 from "@mui/material/Menu";
|
|
5457
6172
|
|
|
5458
6173
|
// src/components/UserMenu/UserMenuContext.tsx
|
|
5459
|
-
import * as
|
|
5460
|
-
var UserMenuContext =
|
|
6174
|
+
import * as React34 from "react";
|
|
6175
|
+
var UserMenuContext = React34.createContext(void 0);
|
|
5461
6176
|
var useUserMenu = () => {
|
|
5462
|
-
const context =
|
|
6177
|
+
const context = React34.useContext(UserMenuContext);
|
|
5463
6178
|
if (!context) {
|
|
5464
6179
|
throw new Error("UserMenu sub-components must be used within a UserMenu component");
|
|
5465
6180
|
}
|
|
@@ -5468,12 +6183,34 @@ var useUserMenu = () => {
|
|
|
5468
6183
|
UserMenuContext.displayName = "UserMenu.Context";
|
|
5469
6184
|
|
|
5470
6185
|
// src/components/UserMenu/UserMenuTrigger.tsx
|
|
5471
|
-
import
|
|
5472
|
-
import
|
|
6186
|
+
import * as React35 from "react";
|
|
6187
|
+
import Tooltip7 from "@mui/material/Tooltip";
|
|
6188
|
+
import IconButton7 from "@mui/material/IconButton";
|
|
5473
6189
|
import Avatar4 from "@mui/material/Avatar";
|
|
5474
|
-
import { styled as
|
|
5475
|
-
|
|
5476
|
-
|
|
6190
|
+
import { styled as styled61 } from "@mui/material/styles";
|
|
6191
|
+
|
|
6192
|
+
// src/components/UserMenu/getUserMenuAvatarProps.ts
|
|
6193
|
+
var IMAGE_URL_PATTERN = /^(https?:|\/|data:|blob:)/i;
|
|
6194
|
+
function isUserMenuAvatarImageUrl(value) {
|
|
6195
|
+
return IMAGE_URL_PATTERN.test(value);
|
|
6196
|
+
}
|
|
6197
|
+
function getUserMenuAvatarProps(name, avatar) {
|
|
6198
|
+
const nameInitial = name.charAt(0);
|
|
6199
|
+
if (!avatar) {
|
|
6200
|
+
return { children: nameInitial };
|
|
6201
|
+
}
|
|
6202
|
+
if (isUserMenuAvatarImageUrl(avatar)) {
|
|
6203
|
+
return {
|
|
6204
|
+
src: avatar,
|
|
6205
|
+
children: nameInitial
|
|
6206
|
+
};
|
|
6207
|
+
}
|
|
6208
|
+
return { children: avatar };
|
|
6209
|
+
}
|
|
6210
|
+
|
|
6211
|
+
// src/components/UserMenu/UserMenuTrigger.tsx
|
|
6212
|
+
import { jsx as jsx77, jsxs as jsxs28 } from "react/jsx-runtime";
|
|
6213
|
+
var StyledTrigger = styled61(IconButton7, {
|
|
5477
6214
|
name: "MuiUserMenu",
|
|
5478
6215
|
slot: "Trigger",
|
|
5479
6216
|
shouldForwardProp: (prop) => prop !== "showName"
|
|
@@ -5484,7 +6221,7 @@ var StyledTrigger = styled56(IconButton6, {
|
|
|
5484
6221
|
paddingRight: theme.spacing(1.5),
|
|
5485
6222
|
borderRadius: typeof theme.shape.borderRadius === "number" ? theme.shape.borderRadius * 2 : theme.spacing(2)
|
|
5486
6223
|
}));
|
|
5487
|
-
var StyledAvatar2 =
|
|
6224
|
+
var StyledAvatar2 = styled61(Avatar4, {
|
|
5488
6225
|
name: "MuiUserMenu",
|
|
5489
6226
|
slot: "Avatar"
|
|
5490
6227
|
})(({ theme }) => ({
|
|
@@ -5495,7 +6232,7 @@ var StyledAvatar2 = styled56(Avatar4, {
|
|
|
5495
6232
|
fontSize: 14,
|
|
5496
6233
|
fontWeight: 600
|
|
5497
6234
|
}));
|
|
5498
|
-
var StyledNameText =
|
|
6235
|
+
var StyledNameText = styled61("span", {
|
|
5499
6236
|
name: "MuiUserMenu",
|
|
5500
6237
|
slot: "NameText"
|
|
5501
6238
|
})(({ theme }) => ({
|
|
@@ -5507,43 +6244,53 @@ var StyledNameText = styled56("span", {
|
|
|
5507
6244
|
display: "block"
|
|
5508
6245
|
}
|
|
5509
6246
|
}));
|
|
5510
|
-
var UserMenuTrigger = (
|
|
5511
|
-
|
|
5512
|
-
|
|
5513
|
-
|
|
5514
|
-
|
|
5515
|
-
|
|
5516
|
-
|
|
5517
|
-
|
|
5518
|
-
|
|
5519
|
-
|
|
5520
|
-
|
|
5521
|
-
|
|
5522
|
-
|
|
5523
|
-
|
|
5524
|
-
|
|
5525
|
-
|
|
5526
|
-
|
|
5527
|
-
|
|
5528
|
-
|
|
6247
|
+
var UserMenuTrigger = React35.forwardRef(
|
|
6248
|
+
function UserMenuTrigger2(_a, ref) {
|
|
6249
|
+
var _b = _a, { name, avatar, showName = false, onClick, "aria-label": ariaLabel } = _b, props = __objRest(_b, ["name", "avatar", "showName", "onClick", "aria-label"]);
|
|
6250
|
+
const { open, handleOpen } = useUserMenu();
|
|
6251
|
+
const avatarProps = getUserMenuAvatarProps(name, avatar);
|
|
6252
|
+
const defaultAriaLabel = showName ? name : "Account";
|
|
6253
|
+
const resolvedAriaLabel = typeof ariaLabel === "string" && ariaLabel.trim().length > 0 ? ariaLabel : defaultAriaLabel;
|
|
6254
|
+
return /* @__PURE__ */ jsx77(Tooltip7, { title: "Account", children: /* @__PURE__ */ jsxs28(
|
|
6255
|
+
StyledTrigger,
|
|
6256
|
+
__spreadProps(__spreadValues({}, props), {
|
|
6257
|
+
ref,
|
|
6258
|
+
onClick: (event) => {
|
|
6259
|
+
handleOpen(event);
|
|
6260
|
+
onClick == null ? void 0 : onClick(event);
|
|
6261
|
+
},
|
|
6262
|
+
size: "small",
|
|
6263
|
+
showName,
|
|
6264
|
+
"aria-label": resolvedAriaLabel,
|
|
6265
|
+
"aria-controls": open ? "user-menu" : void 0,
|
|
6266
|
+
"aria-haspopup": "true",
|
|
6267
|
+
"aria-expanded": open ? "true" : void 0,
|
|
6268
|
+
children: [
|
|
6269
|
+
/* @__PURE__ */ jsx77(StyledAvatar2, { src: avatarProps.src, alt: name, children: avatarProps.children }),
|
|
6270
|
+
showName && /* @__PURE__ */ jsx77(StyledNameText, { children: name })
|
|
6271
|
+
]
|
|
6272
|
+
})
|
|
6273
|
+
) });
|
|
6274
|
+
}
|
|
6275
|
+
);
|
|
5529
6276
|
UserMenuTrigger.displayName = "UserMenu.Trigger";
|
|
5530
6277
|
|
|
5531
6278
|
// src/components/UserMenu/UserMenuHeader.tsx
|
|
5532
6279
|
import Divider8 from "@mui/material/Divider";
|
|
5533
|
-
import
|
|
6280
|
+
import Box32 from "@mui/material/Box";
|
|
5534
6281
|
import Avatar5 from "@mui/material/Avatar";
|
|
5535
|
-
import
|
|
6282
|
+
import Typography20 from "@mui/material/Typography";
|
|
5536
6283
|
import Chip5 from "@mui/material/Chip";
|
|
5537
|
-
import { styled as
|
|
5538
|
-
import { Fragment as Fragment9, jsx as
|
|
5539
|
-
var StyledHeaderBox =
|
|
6284
|
+
import { styled as styled62 } from "@mui/material/styles";
|
|
6285
|
+
import { Fragment as Fragment9, jsx as jsx78, jsxs as jsxs29 } from "react/jsx-runtime";
|
|
6286
|
+
var StyledHeaderBox = styled62(Box32, {
|
|
5540
6287
|
name: "MuiUserMenu",
|
|
5541
6288
|
slot: "HeaderBox"
|
|
5542
6289
|
})(({ theme }) => ({
|
|
5543
6290
|
padding: theme.spacing(2),
|
|
5544
6291
|
paddingBottom: theme.spacing(1.5)
|
|
5545
6292
|
}));
|
|
5546
|
-
var StyledHeaderContent =
|
|
6293
|
+
var StyledHeaderContent = styled62(Box32, {
|
|
5547
6294
|
name: "MuiUserMenu",
|
|
5548
6295
|
slot: "HeaderContent"
|
|
5549
6296
|
})(({ theme }) => ({
|
|
@@ -5551,7 +6298,7 @@ var StyledHeaderContent = styled57(Box28, {
|
|
|
5551
6298
|
alignItems: "center",
|
|
5552
6299
|
gap: theme.spacing(2)
|
|
5553
6300
|
}));
|
|
5554
|
-
var StyledHeaderAvatar =
|
|
6301
|
+
var StyledHeaderAvatar = styled62(Avatar5, {
|
|
5555
6302
|
name: "MuiUserMenu",
|
|
5556
6303
|
slot: "HeaderAvatar"
|
|
5557
6304
|
})(({ theme }) => ({
|
|
@@ -5562,7 +6309,7 @@ var StyledHeaderAvatar = styled57(Avatar5, {
|
|
|
5562
6309
|
fontSize: 16,
|
|
5563
6310
|
fontWeight: 600
|
|
5564
6311
|
}));
|
|
5565
|
-
var StyledUserInfo =
|
|
6312
|
+
var StyledUserInfo = styled62(Box32, {
|
|
5566
6313
|
name: "MuiUserMenu",
|
|
5567
6314
|
slot: "UserInfo"
|
|
5568
6315
|
})(({ theme }) => ({
|
|
@@ -5572,7 +6319,7 @@ var StyledUserInfo = styled57(Box28, {
|
|
|
5572
6319
|
flex: 1,
|
|
5573
6320
|
minWidth: 0
|
|
5574
6321
|
}));
|
|
5575
|
-
var StyledNameRow =
|
|
6322
|
+
var StyledNameRow = styled62(Box32, {
|
|
5576
6323
|
name: "MuiUserMenu",
|
|
5577
6324
|
slot: "NameRow"
|
|
5578
6325
|
})(({ theme }) => ({
|
|
@@ -5580,7 +6327,7 @@ var StyledNameRow = styled57(Box28, {
|
|
|
5580
6327
|
alignItems: "center",
|
|
5581
6328
|
gap: theme.spacing(1)
|
|
5582
6329
|
}));
|
|
5583
|
-
var StyledName =
|
|
6330
|
+
var StyledName = styled62(Typography20, {
|
|
5584
6331
|
name: "MuiUserMenu",
|
|
5585
6332
|
slot: "Name"
|
|
5586
6333
|
})({
|
|
@@ -5589,7 +6336,7 @@ var StyledName = styled57(Typography18, {
|
|
|
5589
6336
|
overflow: "hidden",
|
|
5590
6337
|
textOverflow: "ellipsis"
|
|
5591
6338
|
});
|
|
5592
|
-
var StyledRoleChip =
|
|
6339
|
+
var StyledRoleChip = styled62(Chip5, {
|
|
5593
6340
|
name: "MuiUserMenu",
|
|
5594
6341
|
slot: "RoleChip"
|
|
5595
6342
|
})({
|
|
@@ -5597,7 +6344,7 @@ var StyledRoleChip = styled57(Chip5, {
|
|
|
5597
6344
|
fontSize: 11,
|
|
5598
6345
|
fontWeight: 600
|
|
5599
6346
|
});
|
|
5600
|
-
var StyledEmail =
|
|
6347
|
+
var StyledEmail = styled62(Typography20, {
|
|
5601
6348
|
name: "MuiUserMenu",
|
|
5602
6349
|
slot: "Email"
|
|
5603
6350
|
})(({ theme }) => ({
|
|
@@ -5608,13 +6355,14 @@ var StyledEmail = styled57(Typography18, {
|
|
|
5608
6355
|
textOverflow: "ellipsis"
|
|
5609
6356
|
}));
|
|
5610
6357
|
var UserMenuHeader = ({ name, email, avatar, role }) => {
|
|
5611
|
-
|
|
5612
|
-
|
|
5613
|
-
|
|
5614
|
-
/* @__PURE__ */
|
|
5615
|
-
|
|
5616
|
-
|
|
5617
|
-
|
|
6358
|
+
const avatarProps = getUserMenuAvatarProps(name, avatar);
|
|
6359
|
+
return /* @__PURE__ */ jsxs29(Fragment9, { children: [
|
|
6360
|
+
/* @__PURE__ */ jsx78(StyledHeaderBox, { children: /* @__PURE__ */ jsxs29(StyledHeaderContent, { children: [
|
|
6361
|
+
/* @__PURE__ */ jsx78(StyledHeaderAvatar, { src: avatarProps.src, alt: name, children: avatarProps.children }),
|
|
6362
|
+
/* @__PURE__ */ jsxs29(StyledUserInfo, { children: [
|
|
6363
|
+
/* @__PURE__ */ jsxs29(StyledNameRow, { children: [
|
|
6364
|
+
/* @__PURE__ */ jsx78(StyledName, { variant: "subtitle2", children: name }),
|
|
6365
|
+
role && /* @__PURE__ */ jsx78(
|
|
5618
6366
|
StyledRoleChip,
|
|
5619
6367
|
{
|
|
5620
6368
|
label: role,
|
|
@@ -5623,32 +6371,32 @@ var UserMenuHeader = ({ name, email, avatar, role }) => {
|
|
|
5623
6371
|
}
|
|
5624
6372
|
)
|
|
5625
6373
|
] }),
|
|
5626
|
-
/* @__PURE__ */
|
|
6374
|
+
/* @__PURE__ */ jsx78(StyledEmail, { variant: "caption", children: email })
|
|
5627
6375
|
] })
|
|
5628
6376
|
] }) }),
|
|
5629
|
-
/* @__PURE__ */
|
|
6377
|
+
/* @__PURE__ */ jsx78(Divider8, {})
|
|
5630
6378
|
] });
|
|
5631
6379
|
};
|
|
5632
6380
|
UserMenuHeader.displayName = "UserMenu.Header";
|
|
5633
6381
|
|
|
5634
6382
|
// src/components/UserMenu/UserMenuItem.tsx
|
|
5635
|
-
import * as
|
|
5636
|
-
import
|
|
6383
|
+
import * as React36 from "react";
|
|
6384
|
+
import MenuItem5 from "@mui/material/MenuItem";
|
|
5637
6385
|
import ListItemIcon3 from "@mui/material/ListItemIcon";
|
|
5638
6386
|
import ListItemText4 from "@mui/material/ListItemText";
|
|
5639
|
-
import
|
|
6387
|
+
import Box33 from "@mui/material/Box";
|
|
5640
6388
|
import Chip6 from "@mui/material/Chip";
|
|
5641
|
-
import { styled as
|
|
6389
|
+
import { styled as styled63 } from "@mui/material/styles";
|
|
5642
6390
|
import { ChevronRight as ChevronRight2 } from "@wso2/oxygen-ui-icons-react";
|
|
5643
|
-
import { jsx as
|
|
5644
|
-
var StyledMenuItem2 =
|
|
6391
|
+
import { jsx as jsx79, jsxs as jsxs30 } from "react/jsx-runtime";
|
|
6392
|
+
var StyledMenuItem2 = styled63(MenuItem5, {
|
|
5645
6393
|
name: "MuiUserMenu",
|
|
5646
6394
|
slot: "MenuItem"
|
|
5647
6395
|
})(({ theme }) => ({
|
|
5648
6396
|
paddingTop: theme.spacing(1.5),
|
|
5649
6397
|
paddingBottom: theme.spacing(1.5)
|
|
5650
6398
|
}));
|
|
5651
|
-
var StyledBillingChip =
|
|
6399
|
+
var StyledBillingChip = styled63(Chip6, {
|
|
5652
6400
|
name: "MuiUserMenu",
|
|
5653
6401
|
slot: "BillingChip"
|
|
5654
6402
|
})(() => ({
|
|
@@ -5668,13 +6416,13 @@ var UserMenuItem = ({
|
|
|
5668
6416
|
handleClose();
|
|
5669
6417
|
onClick == null ? void 0 : onClick();
|
|
5670
6418
|
};
|
|
5671
|
-
return /* @__PURE__ */
|
|
5672
|
-
icon && /* @__PURE__ */
|
|
6419
|
+
return /* @__PURE__ */ jsxs30(StyledMenuItem2, { onClick: handleClick, children: [
|
|
6420
|
+
icon && /* @__PURE__ */ jsx79(ListItemIcon3, { children: React36.isValidElement(icon) ? React36.cloneElement(icon, __spreadProps(__spreadValues({}, icon.props), {
|
|
5673
6421
|
size: (_a = icon.props.size) != null ? _a : 18
|
|
5674
6422
|
})) : icon }),
|
|
5675
|
-
/* @__PURE__ */
|
|
5676
|
-
/* @__PURE__ */
|
|
5677
|
-
badge && /* @__PURE__ */
|
|
6423
|
+
/* @__PURE__ */ jsx79(ListItemText4, { primary: label }),
|
|
6424
|
+
/* @__PURE__ */ jsxs30(Box33, { sx: { display: "flex", alignItems: "center", gap: 0.5 }, children: [
|
|
6425
|
+
badge && /* @__PURE__ */ jsx79(
|
|
5678
6426
|
StyledBillingChip,
|
|
5679
6427
|
{
|
|
5680
6428
|
label: badge,
|
|
@@ -5682,33 +6430,25 @@ var UserMenuItem = ({
|
|
|
5682
6430
|
variant: "outlined"
|
|
5683
6431
|
}
|
|
5684
6432
|
),
|
|
5685
|
-
/* @__PURE__ */
|
|
6433
|
+
/* @__PURE__ */ jsx79(ChevronRight2, { size: 16, style: { color: "var(--mui-palette-text-secondary)" } })
|
|
5686
6434
|
] })
|
|
5687
6435
|
] });
|
|
5688
6436
|
};
|
|
5689
6437
|
UserMenuItem.displayName = "UserMenu.Item";
|
|
5690
6438
|
|
|
5691
6439
|
// src/components/UserMenu/UserMenuLogout.tsx
|
|
5692
|
-
import * as
|
|
5693
|
-
import
|
|
6440
|
+
import * as React37 from "react";
|
|
6441
|
+
import MenuItem6 from "@mui/material/MenuItem";
|
|
5694
6442
|
import ListItemIcon4 from "@mui/material/ListItemIcon";
|
|
5695
6443
|
import ListItemText5 from "@mui/material/ListItemText";
|
|
5696
|
-
import { styled as
|
|
5697
|
-
import { jsx as
|
|
5698
|
-
var StyledLogoutItem =
|
|
6444
|
+
import { styled as styled64 } from "@mui/material/styles";
|
|
6445
|
+
import { jsx as jsx80, jsxs as jsxs31 } from "react/jsx-runtime";
|
|
6446
|
+
var StyledLogoutItem = styled64(MenuItem6, {
|
|
5699
6447
|
name: "MuiUserMenu",
|
|
5700
6448
|
slot: "LogoutItem"
|
|
5701
6449
|
})(({ theme }) => ({
|
|
5702
6450
|
paddingTop: theme.spacing(1.5),
|
|
5703
|
-
paddingBottom: theme.spacing(1.5)
|
|
5704
|
-
color: (theme.vars || theme).palette.error.main,
|
|
5705
|
-
"&:hover": {
|
|
5706
|
-
backgroundColor: (theme.vars || theme).palette.error.main,
|
|
5707
|
-
color: (theme.vars || theme).palette.error.contrastText,
|
|
5708
|
-
"& .MuiListItemIcon-root": {
|
|
5709
|
-
color: (theme.vars || theme).palette.error.contrastText
|
|
5710
|
-
}
|
|
5711
|
-
}
|
|
6451
|
+
paddingBottom: theme.spacing(1.5)
|
|
5712
6452
|
}));
|
|
5713
6453
|
var UserMenuLogout = ({
|
|
5714
6454
|
icon,
|
|
@@ -5721,25 +6461,25 @@ var UserMenuLogout = ({
|
|
|
5721
6461
|
handleClose();
|
|
5722
6462
|
onClick == null ? void 0 : onClick();
|
|
5723
6463
|
};
|
|
5724
|
-
return /* @__PURE__ */
|
|
5725
|
-
icon && /* @__PURE__ */
|
|
6464
|
+
return /* @__PURE__ */ jsxs31(StyledLogoutItem, { onClick: handleClick, children: [
|
|
6465
|
+
icon && /* @__PURE__ */ jsx80(ListItemIcon4, { children: React37.isValidElement(icon) ? React37.cloneElement(icon, __spreadProps(__spreadValues({}, icon.props), {
|
|
5726
6466
|
size: (_a = icon.props.size) != null ? _a : 18
|
|
5727
6467
|
})) : icon }),
|
|
5728
|
-
/* @__PURE__ */
|
|
6468
|
+
/* @__PURE__ */ jsx80(ListItemText5, { primary: label })
|
|
5729
6469
|
] });
|
|
5730
6470
|
};
|
|
5731
6471
|
UserMenuLogout.displayName = "UserMenu.Logout";
|
|
5732
6472
|
|
|
5733
6473
|
// src/components/UserMenu/UserMenuDivider.tsx
|
|
5734
6474
|
import Divider9 from "@mui/material/Divider";
|
|
5735
|
-
import { jsx as
|
|
5736
|
-
var UserMenuDivider = () => /* @__PURE__ */
|
|
6475
|
+
import { jsx as jsx81 } from "react/jsx-runtime";
|
|
6476
|
+
var UserMenuDivider = () => /* @__PURE__ */ jsx81(Divider9, {});
|
|
5737
6477
|
UserMenuDivider.displayName = "UserMenu.Divider";
|
|
5738
6478
|
|
|
5739
6479
|
// src/components/UserMenu/UserMenu.tsx
|
|
5740
|
-
import { jsx as
|
|
6480
|
+
import { jsx as jsx82, jsxs as jsxs32 } from "react/jsx-runtime";
|
|
5741
6481
|
var UserMenu = ({ children }) => {
|
|
5742
|
-
const [anchorEl, setAnchorEl] =
|
|
6482
|
+
const [anchorEl, setAnchorEl] = React38.useState(null);
|
|
5743
6483
|
const open = Boolean(anchorEl);
|
|
5744
6484
|
const handleOpen = (event) => {
|
|
5745
6485
|
setAnchorEl(event.currentTarget);
|
|
@@ -5747,17 +6487,17 @@ var UserMenu = ({ children }) => {
|
|
|
5747
6487
|
const handleClose = () => {
|
|
5748
6488
|
setAnchorEl(null);
|
|
5749
6489
|
};
|
|
5750
|
-
const childrenArray =
|
|
6490
|
+
const childrenArray = React38.Children.toArray(children);
|
|
5751
6491
|
const triggerChild = childrenArray.find(
|
|
5752
|
-
(child) =>
|
|
6492
|
+
(child) => React38.isValidElement(child) && child.type === UserMenuTrigger
|
|
5753
6493
|
);
|
|
5754
6494
|
const menuChildren = childrenArray.filter(
|
|
5755
|
-
(child) =>
|
|
6495
|
+
(child) => React38.isValidElement(child) && child.type !== UserMenuTrigger
|
|
5756
6496
|
);
|
|
5757
|
-
return /* @__PURE__ */
|
|
6497
|
+
return /* @__PURE__ */ jsxs32(UserMenuContext.Provider, { value: { open, anchorEl, handleOpen, handleClose }, children: [
|
|
5758
6498
|
triggerChild,
|
|
5759
|
-
/* @__PURE__ */
|
|
5760
|
-
|
|
6499
|
+
/* @__PURE__ */ jsx82(
|
|
6500
|
+
Menu3,
|
|
5761
6501
|
{
|
|
5762
6502
|
id: "user-menu",
|
|
5763
6503
|
anchorEl,
|
|
@@ -5786,18 +6526,18 @@ UserMenu.Divider = UserMenuDivider;
|
|
|
5786
6526
|
UserMenu.displayName = "UserMenu";
|
|
5787
6527
|
|
|
5788
6528
|
// src/components/NotificationBanner/NotificationBanner.tsx
|
|
5789
|
-
import * as
|
|
6529
|
+
import * as React39 from "react";
|
|
5790
6530
|
import Alert from "@mui/material/Alert";
|
|
5791
6531
|
import AlertTitle from "@mui/material/AlertTitle";
|
|
5792
6532
|
import Collapse2 from "@mui/material/Collapse";
|
|
5793
6533
|
import Button4 from "@mui/material/Button";
|
|
5794
|
-
import
|
|
5795
|
-
import { styled as
|
|
5796
|
-
import { jsx as
|
|
5797
|
-
var NotificationBannerAlert =
|
|
6534
|
+
import Box34 from "@mui/material/Box";
|
|
6535
|
+
import { styled as styled65 } from "@mui/material/styles";
|
|
6536
|
+
import { jsx as jsx83, jsxs as jsxs33 } from "react/jsx-runtime";
|
|
6537
|
+
var NotificationBannerAlert = styled65(Alert, {
|
|
5798
6538
|
name: "MuiNotificationBanner",
|
|
5799
6539
|
slot: "Root"
|
|
5800
|
-
})({
|
|
6540
|
+
})(({ theme }) => __spreadValues({
|
|
5801
6541
|
borderRadius: 0,
|
|
5802
6542
|
"& .MuiAlert-message": {
|
|
5803
6543
|
width: "100%",
|
|
@@ -5811,8 +6551,18 @@ var NotificationBannerAlert = styled60(Alert, {
|
|
|
5811
6551
|
paddingTop: 0,
|
|
5812
6552
|
alignItems: "center"
|
|
5813
6553
|
}
|
|
5814
|
-
}
|
|
5815
|
-
|
|
6554
|
+
}, theme.applyStyles("light", {
|
|
6555
|
+
"&.MuiAlert-filledInfo": {
|
|
6556
|
+
backgroundColor: (theme.vars || theme).palette.info.dark
|
|
6557
|
+
},
|
|
6558
|
+
"&.MuiAlert-filledWarning": {
|
|
6559
|
+
color: "#000",
|
|
6560
|
+
"& .MuiAlert-icon, & .MuiAlert-action": {
|
|
6561
|
+
color: "#000"
|
|
6562
|
+
}
|
|
6563
|
+
}
|
|
6564
|
+
})));
|
|
6565
|
+
var NotificationBannerContent = styled65(Box34, {
|
|
5816
6566
|
name: "MuiNotificationBanner",
|
|
5817
6567
|
slot: "Content"
|
|
5818
6568
|
})({
|
|
@@ -5821,7 +6571,7 @@ var NotificationBannerContent = styled60(Box30, {
|
|
|
5821
6571
|
gap: 2,
|
|
5822
6572
|
flex: 1
|
|
5823
6573
|
});
|
|
5824
|
-
var NotificationBannerAction =
|
|
6574
|
+
var NotificationBannerAction = styled65(Button4, {
|
|
5825
6575
|
name: "MuiNotificationBanner",
|
|
5826
6576
|
slot: "Action"
|
|
5827
6577
|
})({
|
|
@@ -5842,22 +6592,22 @@ var NotificationBanner = ({
|
|
|
5842
6592
|
onDismiss,
|
|
5843
6593
|
sx
|
|
5844
6594
|
}) => {
|
|
5845
|
-
const [isVisible, setIsVisible] =
|
|
5846
|
-
|
|
6595
|
+
const [isVisible, setIsVisible] = React39.useState(visible);
|
|
6596
|
+
React39.useEffect(() => {
|
|
5847
6597
|
setIsVisible(visible);
|
|
5848
6598
|
}, [visible]);
|
|
5849
6599
|
const handleDismiss = () => {
|
|
5850
6600
|
setIsVisible(false);
|
|
5851
6601
|
onDismiss == null ? void 0 : onDismiss();
|
|
5852
6602
|
};
|
|
5853
|
-
return /* @__PURE__ */
|
|
6603
|
+
return /* @__PURE__ */ jsx83(Collapse2, { in: isVisible, children: /* @__PURE__ */ jsx83(
|
|
5854
6604
|
NotificationBannerAlert,
|
|
5855
6605
|
{
|
|
5856
6606
|
severity,
|
|
5857
6607
|
variant: "filled",
|
|
5858
6608
|
onClose: handleDismiss,
|
|
5859
6609
|
sx,
|
|
5860
|
-
action: actionLabel && onAction ? /* @__PURE__ */
|
|
6610
|
+
action: actionLabel && onAction ? /* @__PURE__ */ jsx83(
|
|
5861
6611
|
NotificationBannerAction,
|
|
5862
6612
|
{
|
|
5863
6613
|
color: "inherit",
|
|
@@ -5866,19 +6616,19 @@ var NotificationBanner = ({
|
|
|
5866
6616
|
children: actionLabel
|
|
5867
6617
|
}
|
|
5868
6618
|
) : void 0,
|
|
5869
|
-
children: /* @__PURE__ */
|
|
5870
|
-
title && /* @__PURE__ */
|
|
5871
|
-
/* @__PURE__ */
|
|
6619
|
+
children: /* @__PURE__ */ jsxs33(NotificationBannerContent, { children: [
|
|
6620
|
+
title && /* @__PURE__ */ jsx83(AlertTitle, { sx: { mb: 0 }, children: title }),
|
|
6621
|
+
/* @__PURE__ */ jsx83(Box34, { component: "span", children: message })
|
|
5872
6622
|
] })
|
|
5873
6623
|
}
|
|
5874
6624
|
) });
|
|
5875
6625
|
};
|
|
5876
6626
|
|
|
5877
6627
|
// src/components/Form/CardButton.tsx
|
|
5878
|
-
import { Card as
|
|
6628
|
+
import { Card as Card3, ButtonBase as ButtonBase3, Box as Box35, styled as styled66 } from "@mui/material";
|
|
5879
6629
|
import { CardHeader, CardContent as CardContent2, CardActions, CardMedia } from "@mui/material";
|
|
5880
|
-
import { jsx as
|
|
5881
|
-
var StyledCardButton =
|
|
6630
|
+
import { jsx as jsx84 } from "react/jsx-runtime";
|
|
6631
|
+
var StyledCardButton = styled66(Card3, {
|
|
5882
6632
|
shouldForwardProp: (prop) => prop !== "selected" && prop !== "disabled"
|
|
5883
6633
|
})(({ theme, selected, disabled, alignItems = "flex-start" }) => ({
|
|
5884
6634
|
flexDirection: "column",
|
|
@@ -5906,82 +6656,91 @@ var StyledCardButton = styled61(Card2, {
|
|
|
5906
6656
|
}));
|
|
5907
6657
|
var CardButton = (props) => {
|
|
5908
6658
|
const _a = props, { disabled, selected, alignItems = "flex-start" } = _a, rest = __objRest(_a, ["disabled", "selected", "alignItems"]);
|
|
5909
|
-
return /* @__PURE__ */
|
|
6659
|
+
return /* @__PURE__ */ jsx84(
|
|
5910
6660
|
StyledCardButton,
|
|
5911
6661
|
__spreadValues({
|
|
5912
6662
|
alignItems,
|
|
5913
|
-
component:
|
|
6663
|
+
component: ButtonBase3,
|
|
5914
6664
|
selected,
|
|
5915
6665
|
disabled
|
|
5916
6666
|
}, rest)
|
|
5917
6667
|
);
|
|
5918
6668
|
};
|
|
5919
|
-
var DisappearingCardButtonContent = (props) => /* @__PURE__ */
|
|
6669
|
+
var DisappearingCardButtonContent = (props) => /* @__PURE__ */ jsx84(Box35, __spreadValues({ className: "creation-flow-card-actions" }, props));
|
|
5920
6670
|
|
|
5921
6671
|
// src/components/Form/Stack.tsx
|
|
5922
6672
|
import { Stack as OxygenStack } from "@mui/material";
|
|
5923
|
-
import { jsx as
|
|
6673
|
+
import { jsx as jsx85 } from "react/jsx-runtime";
|
|
5924
6674
|
var Stack2 = (props) => {
|
|
5925
|
-
return /* @__PURE__ */
|
|
6675
|
+
return /* @__PURE__ */ jsx85(OxygenStack, __spreadValues({ spacing: 2 }, props));
|
|
5926
6676
|
};
|
|
5927
6677
|
|
|
5928
6678
|
// src/components/Form/Typography.tsx
|
|
5929
|
-
import { Typography as
|
|
5930
|
-
import { jsx as
|
|
6679
|
+
import { Typography as Typography21 } from "@mui/material";
|
|
6680
|
+
import { jsx as jsx86 } from "react/jsx-runtime";
|
|
5931
6681
|
var Header2 = (props) => {
|
|
5932
6682
|
const _a = props, { children } = _a, rest = __objRest(_a, ["children"]);
|
|
5933
|
-
return /* @__PURE__ */
|
|
6683
|
+
return /* @__PURE__ */ jsx86(Typography21, __spreadProps(__spreadValues({}, rest), { variant: "h4", children }));
|
|
5934
6684
|
};
|
|
5935
6685
|
var Subheader = (props) => {
|
|
5936
6686
|
const _a = props, { children } = _a, rest = __objRest(_a, ["children"]);
|
|
5937
|
-
return /* @__PURE__ */
|
|
6687
|
+
return /* @__PURE__ */ jsx86(Typography21, __spreadProps(__spreadValues({}, rest), { variant: "h5", children }));
|
|
5938
6688
|
};
|
|
5939
6689
|
var Body = (props) => {
|
|
5940
6690
|
const _a = props, { children } = _a, rest = __objRest(_a, ["children"]);
|
|
5941
|
-
return /* @__PURE__ */
|
|
6691
|
+
return /* @__PURE__ */ jsx86(Typography21, __spreadProps(__spreadValues({}, rest), { variant: "body2", children }));
|
|
5942
6692
|
};
|
|
5943
6693
|
|
|
5944
6694
|
// src/components/Form/Section.tsx
|
|
5945
|
-
import { Card as
|
|
5946
|
-
import { jsx as
|
|
6695
|
+
import { Card as Card4, CardContent as CardContent3, Stack as Stack3 } from "@mui/material";
|
|
6696
|
+
import { jsx as jsx87 } from "react/jsx-runtime";
|
|
5947
6697
|
var Section = ({ children }) => {
|
|
5948
|
-
return /* @__PURE__ */
|
|
6698
|
+
return /* @__PURE__ */ jsx87(Card4, { children: /* @__PURE__ */ jsx87(CardContent3, { children: /* @__PURE__ */ jsx87(Stack3, { direction: "column", spacing: 2, children }) }) });
|
|
5949
6699
|
};
|
|
5950
6700
|
|
|
5951
6701
|
// src/components/Form/Wizard.tsx
|
|
5952
6702
|
import {
|
|
5953
|
-
Card as
|
|
6703
|
+
Card as Card5,
|
|
5954
6704
|
CardContent as CardContent4,
|
|
5955
6705
|
StepLabel,
|
|
5956
6706
|
Step,
|
|
5957
6707
|
Stepper,
|
|
5958
6708
|
Divider as Divider10
|
|
5959
6709
|
} from "@mui/material";
|
|
5960
|
-
import { styled as
|
|
5961
|
-
import { useMemo as
|
|
5962
|
-
import { jsx as
|
|
5963
|
-
var StyledWizardActionsStack =
|
|
6710
|
+
import { styled as styled67 } from "@mui/material/styles";
|
|
6711
|
+
import { useMemo as useMemo7 } from "react";
|
|
6712
|
+
import { jsx as jsx88, jsxs as jsxs34 } from "react/jsx-runtime";
|
|
6713
|
+
var StyledWizardActionsStack = styled67(Stack2)(() => ({
|
|
5964
6714
|
justifyContent: "space-between",
|
|
5965
6715
|
flexGrow: 1
|
|
5966
6716
|
}));
|
|
5967
6717
|
function Wizard({ steps, activeStep, actions }) {
|
|
5968
|
-
const step =
|
|
5969
|
-
return /* @__PURE__ */
|
|
5970
|
-
/* @__PURE__ */
|
|
5971
|
-
/* @__PURE__ */
|
|
5972
|
-
/* @__PURE__ */
|
|
5973
|
-
/* @__PURE__ */
|
|
6718
|
+
const step = useMemo7(() => activeStep < steps.length ? steps[activeStep] : null, [steps, activeStep]);
|
|
6719
|
+
return /* @__PURE__ */ jsx88(Card5, { children: /* @__PURE__ */ jsx88(CardContent4, { children: /* @__PURE__ */ jsxs34(Stack2, { children: [
|
|
6720
|
+
/* @__PURE__ */ jsx88(Stepper, { activeStep, children: steps.map((step2) => /* @__PURE__ */ jsx88(Step, { children: /* @__PURE__ */ jsx88(StepLabel, { children: step2.label }) }, step2.label)) }),
|
|
6721
|
+
/* @__PURE__ */ jsx88(Divider10, {}),
|
|
6722
|
+
/* @__PURE__ */ jsx88(Stack2, { direction: "row", children: step == null ? void 0 : step.component }),
|
|
6723
|
+
/* @__PURE__ */ jsx88(StyledWizardActionsStack, { direction: "row", children: actions })
|
|
5974
6724
|
] }) }) });
|
|
5975
6725
|
}
|
|
5976
6726
|
|
|
5977
6727
|
// src/components/Form/ElementWrapper.tsx
|
|
5978
6728
|
import { FormControl as FormControl3, FormLabel } from "@mui/material";
|
|
5979
|
-
import
|
|
6729
|
+
import React40 from "react";
|
|
6730
|
+
import { jsx as jsx89, jsxs as jsxs35 } from "react/jsx-runtime";
|
|
5980
6731
|
var ElementWrapper = (props) => {
|
|
5981
6732
|
const { label, name, children } = props;
|
|
5982
|
-
|
|
5983
|
-
|
|
5984
|
-
|
|
6733
|
+
const labelId = `${name}-label`;
|
|
6734
|
+
const enhancedChildren = React40.Children.map(children, (child) => {
|
|
6735
|
+
var _a;
|
|
6736
|
+
if (React40.isValidElement(child) && ((_a = child.type) == null ? void 0 : _a.muiName) === "Select" && !child.props.labelId) {
|
|
6737
|
+
return React40.cloneElement(child, { labelId });
|
|
6738
|
+
}
|
|
6739
|
+
return child;
|
|
6740
|
+
});
|
|
6741
|
+
return /* @__PURE__ */ jsxs35(FormControl3, { fullWidth: true, children: [
|
|
6742
|
+
/* @__PURE__ */ jsx89(FormLabel, { id: labelId, htmlFor: name, children: label }),
|
|
6743
|
+
enhancedChildren
|
|
5985
6744
|
] });
|
|
5986
6745
|
};
|
|
5987
6746
|
|
|
@@ -6004,16 +6763,16 @@ var Form = {
|
|
|
6004
6763
|
};
|
|
6005
6764
|
|
|
6006
6765
|
// src/components/AppShell/AppShell.tsx
|
|
6007
|
-
import * as
|
|
6008
|
-
import
|
|
6766
|
+
import * as React42 from "react";
|
|
6767
|
+
import Box40 from "@mui/material/Box";
|
|
6009
6768
|
|
|
6010
6769
|
// src/layouts/Layout.tsx
|
|
6011
|
-
import
|
|
6012
|
-
import { jsx as
|
|
6770
|
+
import Box36 from "@mui/material/Box";
|
|
6771
|
+
import { jsx as jsx90 } from "react/jsx-runtime";
|
|
6013
6772
|
function Layout(_a) {
|
|
6014
6773
|
var _b = _a, { children = null, sx } = _b, rest = __objRest(_b, ["children", "sx"]);
|
|
6015
|
-
return /* @__PURE__ */
|
|
6016
|
-
|
|
6774
|
+
return /* @__PURE__ */ jsx90(
|
|
6775
|
+
Box36,
|
|
6017
6776
|
__spreadProps(__spreadValues({
|
|
6018
6777
|
sx: __spreadValues({
|
|
6019
6778
|
display: "flex",
|
|
@@ -6028,12 +6787,12 @@ Layout.displayName = "Layout";
|
|
|
6028
6787
|
var Layout_default = Layout;
|
|
6029
6788
|
|
|
6030
6789
|
// src/layouts/LayoutSidebar.tsx
|
|
6031
|
-
import
|
|
6032
|
-
import { jsx as
|
|
6790
|
+
import Box37 from "@mui/material/Box";
|
|
6791
|
+
import { jsx as jsx91 } from "react/jsx-runtime";
|
|
6033
6792
|
function LayoutSidebar(_a) {
|
|
6034
6793
|
var _b = _a, { children = null, sx } = _b, rest = __objRest(_b, ["children", "sx"]);
|
|
6035
|
-
return /* @__PURE__ */
|
|
6036
|
-
|
|
6794
|
+
return /* @__PURE__ */ jsx91(
|
|
6795
|
+
Box37,
|
|
6037
6796
|
__spreadProps(__spreadValues({
|
|
6038
6797
|
sx: __spreadValues({
|
|
6039
6798
|
display: "flex",
|
|
@@ -6055,12 +6814,12 @@ LayoutNavbar.displayName = "Layout.Navbar";
|
|
|
6055
6814
|
var LayoutNavbar_default = LayoutNavbar;
|
|
6056
6815
|
|
|
6057
6816
|
// src/layouts/LayoutContent.tsx
|
|
6058
|
-
import
|
|
6059
|
-
import { jsx as
|
|
6817
|
+
import Box38 from "@mui/material/Box";
|
|
6818
|
+
import { jsx as jsx92 } from "react/jsx-runtime";
|
|
6060
6819
|
function LayoutContent(_a) {
|
|
6061
6820
|
var _b = _a, { children = null } = _b, rest = __objRest(_b, ["children"]);
|
|
6062
|
-
return /* @__PURE__ */
|
|
6063
|
-
|
|
6821
|
+
return /* @__PURE__ */ jsx92(
|
|
6822
|
+
Box38,
|
|
6064
6823
|
__spreadProps(__spreadValues({
|
|
6065
6824
|
component: "main",
|
|
6066
6825
|
sx: {
|
|
@@ -6078,12 +6837,12 @@ LayoutContent.displayName = "Layout.Content";
|
|
|
6078
6837
|
var LayoutContent_default = LayoutContent;
|
|
6079
6838
|
|
|
6080
6839
|
// src/layouts/LayoutHeader.tsx
|
|
6081
|
-
import
|
|
6082
|
-
import { jsx as
|
|
6840
|
+
import Box39 from "@mui/material/Box";
|
|
6841
|
+
import { jsx as jsx93 } from "react/jsx-runtime";
|
|
6083
6842
|
function LayoutHeader(_a) {
|
|
6084
6843
|
var _b = _a, { children = null, sx } = _b, rest = __objRest(_b, ["children", "sx"]);
|
|
6085
|
-
return /* @__PURE__ */
|
|
6086
|
-
|
|
6844
|
+
return /* @__PURE__ */ jsx93(
|
|
6845
|
+
Box39,
|
|
6087
6846
|
__spreadProps(__spreadValues({
|
|
6088
6847
|
sx: __spreadValues({
|
|
6089
6848
|
display: "flex"
|
|
@@ -6106,45 +6865,45 @@ var Layout2 = Object.assign(Layout_default, {
|
|
|
6106
6865
|
var layouts_default = Layout2;
|
|
6107
6866
|
|
|
6108
6867
|
// src/components/AppShell/AppShellNavbar.tsx
|
|
6109
|
-
import { Fragment as Fragment10, jsx as
|
|
6868
|
+
import { Fragment as Fragment10, jsx as jsx94 } from "react/jsx-runtime";
|
|
6110
6869
|
var AppShellNavbar = ({ children }) => {
|
|
6111
|
-
return /* @__PURE__ */
|
|
6870
|
+
return /* @__PURE__ */ jsx94(Fragment10, { children });
|
|
6112
6871
|
};
|
|
6113
6872
|
AppShellNavbar.displayName = "AppShellNavbar";
|
|
6114
6873
|
|
|
6115
6874
|
// src/components/AppShell/AppShellSidebar.tsx
|
|
6116
|
-
import { Fragment as Fragment11, jsx as
|
|
6875
|
+
import { Fragment as Fragment11, jsx as jsx95 } from "react/jsx-runtime";
|
|
6117
6876
|
var AppShellSidebar = ({ children }) => {
|
|
6118
|
-
return /* @__PURE__ */
|
|
6877
|
+
return /* @__PURE__ */ jsx95(Fragment11, { children });
|
|
6119
6878
|
};
|
|
6120
6879
|
AppShellSidebar.displayName = "AppShellSidebar";
|
|
6121
6880
|
|
|
6122
6881
|
// src/components/AppShell/AppShellMain.tsx
|
|
6123
|
-
import { Fragment as Fragment12, jsx as
|
|
6882
|
+
import { Fragment as Fragment12, jsx as jsx96 } from "react/jsx-runtime";
|
|
6124
6883
|
var AppShellMain = ({ children }) => {
|
|
6125
|
-
return /* @__PURE__ */
|
|
6884
|
+
return /* @__PURE__ */ jsx96(Fragment12, { children });
|
|
6126
6885
|
};
|
|
6127
6886
|
AppShellMain.displayName = "AppShellMain";
|
|
6128
6887
|
|
|
6129
6888
|
// src/components/AppShell/AppShellFooter.tsx
|
|
6130
|
-
import { Fragment as Fragment13, jsx as
|
|
6889
|
+
import { Fragment as Fragment13, jsx as jsx97 } from "react/jsx-runtime";
|
|
6131
6890
|
var AppShellFooter = ({ children }) => {
|
|
6132
|
-
return /* @__PURE__ */
|
|
6891
|
+
return /* @__PURE__ */ jsx97(Fragment13, { children });
|
|
6133
6892
|
};
|
|
6134
6893
|
AppShellFooter.displayName = "AppShellFooter";
|
|
6135
6894
|
|
|
6136
6895
|
// src/components/AppShell/AppShellNotificationPanel.tsx
|
|
6137
|
-
import { Fragment as Fragment14, jsx as
|
|
6896
|
+
import { Fragment as Fragment14, jsx as jsx98 } from "react/jsx-runtime";
|
|
6138
6897
|
var AppShellNotificationPanel = ({ children }) => {
|
|
6139
|
-
return /* @__PURE__ */
|
|
6898
|
+
return /* @__PURE__ */ jsx98(Fragment14, { children });
|
|
6140
6899
|
};
|
|
6141
6900
|
AppShellNotificationPanel.displayName = "AppShellNotificationPanel";
|
|
6142
6901
|
|
|
6143
6902
|
// src/hooks/useAppShell/useAppShell.ts
|
|
6144
|
-
import * as
|
|
6903
|
+
import * as React41 from "react";
|
|
6145
6904
|
import useMediaQuery3 from "@mui/material/useMediaQuery";
|
|
6146
6905
|
var useAppShell = (options) => {
|
|
6147
|
-
const contextValue =
|
|
6906
|
+
const contextValue = React41.useContext(AppShellContext);
|
|
6148
6907
|
const {
|
|
6149
6908
|
initialCollapsed = false,
|
|
6150
6909
|
initialActiveItem = "dashboard",
|
|
@@ -6155,7 +6914,7 @@ var useAppShell = (options) => {
|
|
|
6155
6914
|
} = options || {};
|
|
6156
6915
|
const isMobile = useMediaQuery3((theme) => theme.breakpoints.down("md"));
|
|
6157
6916
|
const isCreateMode = options !== void 0;
|
|
6158
|
-
const [state, setState] =
|
|
6917
|
+
const [state, setState] = React41.useState({
|
|
6159
6918
|
sidebarCollapsed: initialCollapsed,
|
|
6160
6919
|
notificationPanelOpen: false,
|
|
6161
6920
|
activeMenuItem: initialActiveItem,
|
|
@@ -6163,29 +6922,29 @@ var useAppShell = (options) => {
|
|
|
6163
6922
|
sidebarWidth,
|
|
6164
6923
|
sidebarCollapsedWidth
|
|
6165
6924
|
});
|
|
6166
|
-
|
|
6925
|
+
React41.useEffect(() => {
|
|
6167
6926
|
if (isCreateMode && collapseOnMobile && isMobile) {
|
|
6168
6927
|
setState((prev) => __spreadProps(__spreadValues({}, prev), { sidebarCollapsed: true }));
|
|
6169
6928
|
}
|
|
6170
6929
|
}, [isCreateMode, collapseOnMobile, isMobile]);
|
|
6171
|
-
const toggleSidebar =
|
|
6930
|
+
const toggleSidebar = React41.useCallback(() => {
|
|
6172
6931
|
setState((prev) => __spreadProps(__spreadValues({}, prev), { sidebarCollapsed: !prev.sidebarCollapsed }));
|
|
6173
6932
|
}, []);
|
|
6174
|
-
const setSidebarCollapsed =
|
|
6933
|
+
const setSidebarCollapsed = React41.useCallback((collapsed) => {
|
|
6175
6934
|
setState((prev) => __spreadProps(__spreadValues({}, prev), { sidebarCollapsed: collapsed }));
|
|
6176
6935
|
}, []);
|
|
6177
|
-
const collapseSidebar =
|
|
6936
|
+
const collapseSidebar = React41.useCallback(() => {
|
|
6178
6937
|
setState((prev) => __spreadProps(__spreadValues({}, prev), { sidebarCollapsed: true }));
|
|
6179
6938
|
}, []);
|
|
6180
|
-
const expandSidebar =
|
|
6939
|
+
const expandSidebar = React41.useCallback(() => {
|
|
6181
6940
|
setState((prev) => __spreadProps(__spreadValues({}, prev), { sidebarCollapsed: false }));
|
|
6182
6941
|
}, []);
|
|
6183
|
-
const toggleNotificationPanel =
|
|
6942
|
+
const toggleNotificationPanel = React41.useCallback(() => {
|
|
6184
6943
|
setState((prev) => __spreadProps(__spreadValues({}, prev), {
|
|
6185
6944
|
notificationPanelOpen: !prev.notificationPanelOpen
|
|
6186
6945
|
}));
|
|
6187
6946
|
}, []);
|
|
6188
|
-
const setActiveMenuItem =
|
|
6947
|
+
const setActiveMenuItem = React41.useCallback((id) => {
|
|
6189
6948
|
setState((prev) => {
|
|
6190
6949
|
const newState = __spreadProps(__spreadValues({}, prev), { activeMenuItem: id });
|
|
6191
6950
|
if (collapseOnSelectOnMobile && isMobile && !prev.sidebarCollapsed) {
|
|
@@ -6194,14 +6953,14 @@ var useAppShell = (options) => {
|
|
|
6194
6953
|
return newState;
|
|
6195
6954
|
});
|
|
6196
6955
|
}, [collapseOnSelectOnMobile, isMobile]);
|
|
6197
|
-
const toggleMenu =
|
|
6956
|
+
const toggleMenu = React41.useCallback((id) => {
|
|
6198
6957
|
setState((prev) => __spreadProps(__spreadValues({}, prev), {
|
|
6199
6958
|
expandedMenus: __spreadProps(__spreadValues({}, prev.expandedMenus), {
|
|
6200
6959
|
[id]: !prev.expandedMenus[id]
|
|
6201
6960
|
})
|
|
6202
6961
|
}));
|
|
6203
6962
|
}, []);
|
|
6204
|
-
const actions =
|
|
6963
|
+
const actions = React41.useMemo(
|
|
6205
6964
|
() => ({
|
|
6206
6965
|
toggleSidebar,
|
|
6207
6966
|
setSidebarCollapsed,
|
|
@@ -6221,7 +6980,7 @@ var useAppShell = (options) => {
|
|
|
6221
6980
|
toggleMenu
|
|
6222
6981
|
]
|
|
6223
6982
|
);
|
|
6224
|
-
const createdValue =
|
|
6983
|
+
const createdValue = React41.useMemo(
|
|
6225
6984
|
() => ({
|
|
6226
6985
|
state,
|
|
6227
6986
|
actions
|
|
@@ -6240,7 +6999,7 @@ var useAppShell = (options) => {
|
|
|
6240
6999
|
};
|
|
6241
7000
|
|
|
6242
7001
|
// src/components/AppShell/AppShell.tsx
|
|
6243
|
-
import { jsx as
|
|
7002
|
+
import { jsx as jsx99, jsxs as jsxs36 } from "react/jsx-runtime";
|
|
6244
7003
|
var SLOT_DISPLAY_NAMES = {
|
|
6245
7004
|
Navbar: "AppShellNavbar",
|
|
6246
7005
|
Sidebar: "AppShellSidebar",
|
|
@@ -6256,9 +7015,9 @@ var extractSlots = (children) => {
|
|
|
6256
7015
|
footer: null,
|
|
6257
7016
|
notificationPanel: null
|
|
6258
7017
|
};
|
|
6259
|
-
|
|
7018
|
+
React42.Children.forEach(children, (child) => {
|
|
6260
7019
|
var _a;
|
|
6261
|
-
if (
|
|
7020
|
+
if (React42.isValidElement(child)) {
|
|
6262
7021
|
const displayName = (_a = child.type) == null ? void 0 : _a.displayName;
|
|
6263
7022
|
const childProps = child.props;
|
|
6264
7023
|
switch (displayName) {
|
|
@@ -6290,12 +7049,12 @@ var AppShell = (_a) => {
|
|
|
6290
7049
|
var _b = _a, { children, sx } = _b, shellOptions = __objRest(_b, ["children", "sx"]);
|
|
6291
7050
|
const shell = useAppShell(shellOptions);
|
|
6292
7051
|
const slots = extractSlots(children);
|
|
6293
|
-
return /* @__PURE__ */
|
|
6294
|
-
slots.navbar && /* @__PURE__ */
|
|
6295
|
-
/* @__PURE__ */
|
|
6296
|
-
slots.sidebar && /* @__PURE__ */
|
|
6297
|
-
/* @__PURE__ */
|
|
6298
|
-
/* @__PURE__ */
|
|
7052
|
+
return /* @__PURE__ */ jsx99(AppShellContext.Provider, { value: shell, children: /* @__PURE__ */ jsxs36(layouts_default, { sx: __spreadValues({ height: "100vh", flexDirection: "column" }, sx), children: [
|
|
7053
|
+
slots.navbar && /* @__PURE__ */ jsx99(layouts_default.Navbar, { children: slots.navbar }),
|
|
7054
|
+
/* @__PURE__ */ jsxs36(layouts_default, { sx: { flex: 1, overflow: "hidden" }, children: [
|
|
7055
|
+
slots.sidebar && /* @__PURE__ */ jsx99(layouts_default.Sidebar, { children: slots.sidebar }),
|
|
7056
|
+
/* @__PURE__ */ jsxs36(layouts_default.Content, { sx: { flex: 1, display: "flex", flexDirection: "column", overflow: "auto" }, children: [
|
|
7057
|
+
/* @__PURE__ */ jsx99(Box40, { sx: { flex: 1, overflow: "auto", display: "flex" }, children: slots.main }),
|
|
6299
7058
|
slots.footer
|
|
6300
7059
|
] })
|
|
6301
7060
|
] }),
|
|
@@ -6311,7 +7070,7 @@ AppShell.displayName = "AppShell";
|
|
|
6311
7070
|
|
|
6312
7071
|
// src/components/ListingTable/ListingTable/ListingTable.tsx
|
|
6313
7072
|
import MuiTable from "@mui/material/Table";
|
|
6314
|
-
import { styled as
|
|
7073
|
+
import { styled as styled73 } from "@mui/material/styles";
|
|
6315
7074
|
|
|
6316
7075
|
// src/components/ListingTable/shared/types.ts
|
|
6317
7076
|
var densityStyles = {
|
|
@@ -6322,8 +7081,8 @@ var densityStyles = {
|
|
|
6322
7081
|
|
|
6323
7082
|
// src/components/ListingTable/ListingTable/ListingTableContainer.tsx
|
|
6324
7083
|
import MuiTableContainer from "@mui/material/TableContainer";
|
|
6325
|
-
import
|
|
6326
|
-
import { jsx as
|
|
7084
|
+
import Paper from "@mui/material/Paper";
|
|
7085
|
+
import { jsx as jsx100 } from "react/jsx-runtime";
|
|
6327
7086
|
function ListingTableContainer(_a) {
|
|
6328
7087
|
var _b = _a, {
|
|
6329
7088
|
elevation = 1,
|
|
@@ -6335,17 +7094,17 @@ function ListingTableContainer(_a) {
|
|
|
6335
7094
|
"children"
|
|
6336
7095
|
]);
|
|
6337
7096
|
if (disablePaper) {
|
|
6338
|
-
return /* @__PURE__ */
|
|
7097
|
+
return /* @__PURE__ */ jsx100(MuiTableContainer, __spreadProps(__spreadValues({ sx: __spreadValues({ width: "100%" }, props.sx) }, props), { children }));
|
|
6339
7098
|
}
|
|
6340
|
-
return /* @__PURE__ */
|
|
7099
|
+
return /* @__PURE__ */ jsx100(MuiTableContainer, __spreadProps(__spreadValues({ component: Paper, elevation, sx: __spreadValues({ width: "100%" }, props.sx) }, props), { children }));
|
|
6341
7100
|
}
|
|
6342
7101
|
var ListingTableContainer_default = ListingTableContainer;
|
|
6343
7102
|
|
|
6344
7103
|
// src/components/ListingTable/ListingTable/ListingTableHead.tsx
|
|
6345
7104
|
import MuiTableHead from "@mui/material/TableHead";
|
|
6346
|
-
import { styled as
|
|
6347
|
-
import { jsx as
|
|
6348
|
-
var StyledTableHead =
|
|
7105
|
+
import { styled as styled68 } from "@mui/material/styles";
|
|
7106
|
+
import { jsx as jsx101 } from "react/jsx-runtime";
|
|
7107
|
+
var StyledTableHead = styled68(MuiTableHead)(({ theme }) => ({
|
|
6349
7108
|
"& .MuiTableCell-head": __spreadValues(__spreadValues({
|
|
6350
7109
|
fontWeight: 600
|
|
6351
7110
|
}, theme.applyStyles("light", {
|
|
@@ -6356,33 +7115,33 @@ var StyledTableHead = styled63(MuiTableHead)(({ theme }) => ({
|
|
|
6356
7115
|
}));
|
|
6357
7116
|
function ListingTableHead(_a) {
|
|
6358
7117
|
var _b = _a, { children } = _b, props = __objRest(_b, ["children"]);
|
|
6359
|
-
return /* @__PURE__ */
|
|
7118
|
+
return /* @__PURE__ */ jsx101(StyledTableHead, __spreadProps(__spreadValues({}, props), { children }));
|
|
6360
7119
|
}
|
|
6361
7120
|
var ListingTableHead_default = ListingTableHead;
|
|
6362
7121
|
|
|
6363
7122
|
// src/components/ListingTable/ListingTable/ListingTableBody.tsx
|
|
6364
7123
|
import MuiTableBody from "@mui/material/TableBody";
|
|
6365
|
-
import { jsx as
|
|
7124
|
+
import { jsx as jsx102 } from "react/jsx-runtime";
|
|
6366
7125
|
function ListingTableBody(_a) {
|
|
6367
7126
|
var _b = _a, { children } = _b, props = __objRest(_b, ["children"]);
|
|
6368
|
-
return /* @__PURE__ */
|
|
7127
|
+
return /* @__PURE__ */ jsx102(MuiTableBody, __spreadProps(__spreadValues({}, props), { children }));
|
|
6369
7128
|
}
|
|
6370
7129
|
var ListingTableBody_default = ListingTableBody;
|
|
6371
7130
|
|
|
6372
7131
|
// src/components/ListingTable/ListingTable/ListingTableFooter.tsx
|
|
6373
7132
|
import MuiTableFooter from "@mui/material/TableFooter";
|
|
6374
|
-
import { jsx as
|
|
7133
|
+
import { jsx as jsx103 } from "react/jsx-runtime";
|
|
6375
7134
|
function ListingTableFooter(_a) {
|
|
6376
7135
|
var _b = _a, { children } = _b, props = __objRest(_b, ["children"]);
|
|
6377
|
-
return /* @__PURE__ */
|
|
7136
|
+
return /* @__PURE__ */ jsx103(MuiTableFooter, __spreadProps(__spreadValues({}, props), { children }));
|
|
6378
7137
|
}
|
|
6379
7138
|
var ListingTableFooter_default = ListingTableFooter;
|
|
6380
7139
|
|
|
6381
7140
|
// src/components/ListingTable/ListingTable/ListingTableRow.tsx
|
|
6382
7141
|
import MuiTableRow from "@mui/material/TableRow";
|
|
6383
|
-
import { styled as
|
|
6384
|
-
import { jsx as
|
|
6385
|
-
var StyledTableRow =
|
|
7142
|
+
import { styled as styled69, alpha as alpha2 } from "@mui/material/styles";
|
|
7143
|
+
import { jsx as jsx104 } from "react/jsx-runtime";
|
|
7144
|
+
var StyledTableRow = styled69(MuiTableRow, {
|
|
6386
7145
|
shouldForwardProp: (prop) => !["clickable", "variant"].includes(prop)
|
|
6387
7146
|
})(({ theme: muiTheme, clickable, variant = "table" }) => {
|
|
6388
7147
|
const theme = muiTheme;
|
|
@@ -6392,7 +7151,7 @@ var StyledTableRow = styled64(MuiTableRow, {
|
|
|
6392
7151
|
cursor: "pointer"
|
|
6393
7152
|
}), variant === "card" && (() => {
|
|
6394
7153
|
var _a, _b, _c, _d;
|
|
6395
|
-
const borderColor =
|
|
7154
|
+
const borderColor = alpha2(
|
|
6396
7155
|
isDarkMode ? theme.palette.common.white : theme.palette.common.black,
|
|
6397
7156
|
isDarkMode ? 0.3 : 0.12
|
|
6398
7157
|
);
|
|
@@ -6440,15 +7199,15 @@ function ListingTableRow(_a) {
|
|
|
6440
7199
|
"variant",
|
|
6441
7200
|
"children"
|
|
6442
7201
|
]);
|
|
6443
|
-
return /* @__PURE__ */
|
|
7202
|
+
return /* @__PURE__ */ jsx104(StyledTableRow, __spreadProps(__spreadValues({ clickable, variant }, props), { children }));
|
|
6444
7203
|
}
|
|
6445
7204
|
var ListingTableRow_default = ListingTableRow;
|
|
6446
7205
|
|
|
6447
7206
|
// src/components/ListingTable/ListingTable/ListingTableCell.tsx
|
|
6448
7207
|
import MuiTableCell from "@mui/material/TableCell";
|
|
6449
|
-
import { styled as
|
|
6450
|
-
import { jsx as
|
|
6451
|
-
var StyledTableCell =
|
|
7208
|
+
import { styled as styled70 } from "@mui/material/styles";
|
|
7209
|
+
import { jsx as jsx105 } from "react/jsx-runtime";
|
|
7210
|
+
var StyledTableCell = styled70(MuiTableCell, {
|
|
6452
7211
|
shouldForwardProp: (prop) => {
|
|
6453
7212
|
const excludedProps = ["truncate", "maxWidth"];
|
|
6454
7213
|
return !excludedProps.some((excluded) => excluded === prop);
|
|
@@ -6470,24 +7229,24 @@ function ListingTableCell(_a) {
|
|
|
6470
7229
|
"maxWidth",
|
|
6471
7230
|
"children"
|
|
6472
7231
|
]);
|
|
6473
|
-
return /* @__PURE__ */
|
|
7232
|
+
return /* @__PURE__ */ jsx105(StyledTableCell, __spreadProps(__spreadValues({ truncate, maxWidth }, props), { children }));
|
|
6474
7233
|
}
|
|
6475
7234
|
var ListingTableCell_default = ListingTableCell;
|
|
6476
7235
|
|
|
6477
7236
|
// src/components/ListingTable/ListingTable/ListingTableDataGrid.tsx
|
|
6478
|
-
import { useCallback as
|
|
7237
|
+
import { useCallback as useCallback5 } from "react";
|
|
6479
7238
|
import { DataGrid } from "@mui/x-data-grid";
|
|
6480
|
-
import { styled as
|
|
7239
|
+
import { styled as styled71, alpha as alpha3 } from "@mui/material/styles";
|
|
6481
7240
|
|
|
6482
7241
|
// src/components/ListingTable/context.ts
|
|
6483
|
-
import * as
|
|
6484
|
-
var ListingTableContext =
|
|
7242
|
+
import * as React43 from "react";
|
|
7243
|
+
var ListingTableContext = React43.createContext(null);
|
|
6485
7244
|
ListingTableContext.displayName = "ListingTableContext";
|
|
6486
7245
|
var useListingTable = () => {
|
|
6487
|
-
return
|
|
7246
|
+
return React43.useContext(ListingTableContext);
|
|
6488
7247
|
};
|
|
6489
7248
|
var useListingTableRequired = () => {
|
|
6490
|
-
const context =
|
|
7249
|
+
const context = React43.useContext(ListingTableContext);
|
|
6491
7250
|
if (!context) {
|
|
6492
7251
|
throw new Error(
|
|
6493
7252
|
"useListingTableRequired must be used within a ListingTable.Provider. Use useListingTable() for optional context access."
|
|
@@ -6497,8 +7256,8 @@ var useListingTableRequired = () => {
|
|
|
6497
7256
|
};
|
|
6498
7257
|
|
|
6499
7258
|
// src/components/ListingTable/ListingTable/ListingTableDataGrid.tsx
|
|
6500
|
-
import { jsx as
|
|
6501
|
-
var StyledDataGrid =
|
|
7259
|
+
import { jsx as jsx106 } from "react/jsx-runtime";
|
|
7260
|
+
var StyledDataGrid = styled71(DataGrid)(({ theme }) => ({
|
|
6502
7261
|
// Remove outer border for seamless integration within ListingTable.Container
|
|
6503
7262
|
border: "none",
|
|
6504
7263
|
// Ensure the grid fills its container
|
|
@@ -6529,22 +7288,27 @@ var StyledDataGrid = styled66(DataGrid)(({ theme }) => ({
|
|
|
6529
7288
|
"& .MuiDataGrid-row.Mui-selected": {
|
|
6530
7289
|
backgroundColor: theme.palette.action.selected,
|
|
6531
7290
|
"&:hover": {
|
|
6532
|
-
backgroundColor:
|
|
7291
|
+
backgroundColor: alpha3(
|
|
6533
7292
|
theme.palette.primary.main,
|
|
6534
7293
|
theme.palette.action.selectedOpacity + theme.palette.action.hoverOpacity
|
|
6535
7294
|
)
|
|
6536
7295
|
}
|
|
6537
7296
|
},
|
|
6538
|
-
// Remove default cell focus outline, rely on theme focus ring
|
|
6539
7297
|
"& .MuiDataGrid-cell": {
|
|
6540
7298
|
display: "flex",
|
|
6541
7299
|
alignItems: "center"
|
|
6542
7300
|
},
|
|
7301
|
+
// Hide the default outline for mouse interactions but keep a clearly
|
|
7302
|
+
// visible focus indicator for keyboard navigation (WCAG 2.4.7).
|
|
6543
7303
|
"& .MuiDataGrid-cell:focus, & .MuiDataGrid-cell:focus-within": {
|
|
6544
7304
|
outline: "none"
|
|
6545
7305
|
},
|
|
6546
7306
|
"& .MuiDataGrid-columnHeader:focus, & .MuiDataGrid-columnHeader:focus-within": {
|
|
6547
7307
|
outline: "none"
|
|
7308
|
+
},
|
|
7309
|
+
"& .MuiDataGrid-cell:focus-visible, & .MuiDataGrid-columnHeader:focus-visible": {
|
|
7310
|
+
outline: `2px solid ${(theme.vars || theme).palette.primary.main}`,
|
|
7311
|
+
outlineOffset: -2
|
|
6548
7312
|
}
|
|
6549
7313
|
}));
|
|
6550
7314
|
function ListingTableDataGrid(_a) {
|
|
@@ -6573,7 +7337,7 @@ function ListingTableDataGrid(_a) {
|
|
|
6573
7337
|
items: [],
|
|
6574
7338
|
quickFilterValues: searchValue ? [searchValue] : []
|
|
6575
7339
|
};
|
|
6576
|
-
const defaultCardRowSpacing =
|
|
7340
|
+
const defaultCardRowSpacing = useCallback5(
|
|
6577
7341
|
(params) => ({ top: params.isFirstVisible ? 0 : 12, bottom: 0 }),
|
|
6578
7342
|
[]
|
|
6579
7343
|
);
|
|
@@ -6619,7 +7383,7 @@ function ListingTableDataGrid(_a) {
|
|
|
6619
7383
|
border: "none",
|
|
6620
7384
|
backgroundColor: (muiTheme.vars || muiTheme).palette.action.selected,
|
|
6621
7385
|
"&:hover": {
|
|
6622
|
-
backgroundColor:
|
|
7386
|
+
backgroundColor: alpha3(
|
|
6623
7387
|
muiTheme.palette.primary.main,
|
|
6624
7388
|
muiTheme.palette.action.selectedOpacity + muiTheme.palette.action.hoverOpacity
|
|
6625
7389
|
)
|
|
@@ -6650,7 +7414,7 @@ function ListingTableDataGrid(_a) {
|
|
|
6650
7414
|
"& .MuiDataGrid-cell": { padding: cellPadding }
|
|
6651
7415
|
};
|
|
6652
7416
|
const mergedSx = variant === "card" ? [cardSx, densitySx, ...Array.isArray(sx) ? sx : [sx]] : [densitySx, ...Array.isArray(sx) ? sx : [sx]];
|
|
6653
|
-
return /* @__PURE__ */
|
|
7417
|
+
return /* @__PURE__ */ jsx106(
|
|
6654
7418
|
StyledDataGrid,
|
|
6655
7419
|
__spreadValues({
|
|
6656
7420
|
density,
|
|
@@ -6665,13 +7429,13 @@ function ListingTableDataGrid(_a) {
|
|
|
6665
7429
|
var ListingTableDataGrid_default = ListingTableDataGrid;
|
|
6666
7430
|
|
|
6667
7431
|
// src/components/ListingTable/shared/ListingTableToolbar.tsx
|
|
6668
|
-
import { useState as
|
|
6669
|
-
import
|
|
7432
|
+
import { useState as useState10, useCallback as useCallback6 } from "react";
|
|
7433
|
+
import Box41 from "@mui/material/Box";
|
|
6670
7434
|
import TextField3 from "@mui/material/TextField";
|
|
6671
7435
|
import InputAdornment3 from "@mui/material/InputAdornment";
|
|
6672
|
-
import
|
|
7436
|
+
import IconButton8 from "@mui/material/IconButton";
|
|
6673
7437
|
import { Search as Search2, X as X4 } from "@wso2/oxygen-ui-icons-react";
|
|
6674
|
-
import { Fragment as Fragment15, jsx as
|
|
7438
|
+
import { Fragment as Fragment15, jsx as jsx107, jsxs as jsxs37 } from "react/jsx-runtime";
|
|
6675
7439
|
function ListingTableToolbar({
|
|
6676
7440
|
showSearch = false,
|
|
6677
7441
|
searchSlot,
|
|
@@ -6685,13 +7449,13 @@ function ListingTableToolbar({
|
|
|
6685
7449
|
sx
|
|
6686
7450
|
}) {
|
|
6687
7451
|
const tableContext = useListingTable();
|
|
6688
|
-
const [internalSearchValue, setInternalSearchValue] =
|
|
7452
|
+
const [internalSearchValue, setInternalSearchValue] = useState10("");
|
|
6689
7453
|
const isControlledByProp = controlledSearchValue !== void 0;
|
|
6690
7454
|
const isControlledByContext = !isControlledByProp && (tableContext == null ? void 0 : tableContext.searchValue) !== void 0;
|
|
6691
7455
|
const isControlled = isControlledByProp || isControlledByContext;
|
|
6692
7456
|
const searchValue = isControlledByProp ? controlledSearchValue : isControlledByContext ? tableContext.searchValue : internalSearchValue;
|
|
6693
7457
|
const effectiveOnSearchChange = onSearchChange != null ? onSearchChange : tableContext == null ? void 0 : tableContext.onSearchChange;
|
|
6694
|
-
const handleSearchChange =
|
|
7458
|
+
const handleSearchChange = useCallback6(
|
|
6695
7459
|
(event) => {
|
|
6696
7460
|
const newValue = event.target.value;
|
|
6697
7461
|
if (!isControlled) {
|
|
@@ -6701,7 +7465,7 @@ function ListingTableToolbar({
|
|
|
6701
7465
|
},
|
|
6702
7466
|
[isControlled, effectiveOnSearchChange]
|
|
6703
7467
|
);
|
|
6704
|
-
const handleClearSearch =
|
|
7468
|
+
const handleClearSearch = useCallback6(() => {
|
|
6705
7469
|
if (!isControlled) {
|
|
6706
7470
|
setInternalSearchValue("");
|
|
6707
7471
|
}
|
|
@@ -6712,7 +7476,7 @@ function ListingTableToolbar({
|
|
|
6712
7476
|
return searchSlot;
|
|
6713
7477
|
}
|
|
6714
7478
|
if (showSearch) {
|
|
6715
|
-
return /* @__PURE__ */
|
|
7479
|
+
return /* @__PURE__ */ jsx107(
|
|
6716
7480
|
TextField3,
|
|
6717
7481
|
{
|
|
6718
7482
|
size: "small",
|
|
@@ -6723,18 +7487,25 @@ function ListingTableToolbar({
|
|
|
6723
7487
|
minWidth: searchMinWidth,
|
|
6724
7488
|
maxWidth: searchMaxWidth
|
|
6725
7489
|
},
|
|
6726
|
-
|
|
6727
|
-
|
|
6728
|
-
|
|
7490
|
+
slotProps: {
|
|
7491
|
+
htmlInput: {
|
|
7492
|
+
"aria-label": searchPlaceholder || "Search"
|
|
7493
|
+
},
|
|
7494
|
+
input: {
|
|
7495
|
+
startAdornment: /* @__PURE__ */ jsx107(InputAdornment3, { position: "start", children: /* @__PURE__ */ jsx107(Search2, { size: 18, "aria-hidden": "true" }) }),
|
|
7496
|
+
endAdornment: searchValue ? /* @__PURE__ */ jsx107(InputAdornment3, { position: "end", children: /* @__PURE__ */ jsx107(IconButton8, { size: "small", onClick: handleClearSearch, edge: "end", "aria-label": "Clear search", children: /* @__PURE__ */ jsx107(X4, { size: 16, "aria-hidden": "true" }) }) }) : null
|
|
7497
|
+
}
|
|
6729
7498
|
}
|
|
6730
7499
|
}
|
|
6731
7500
|
);
|
|
6732
7501
|
}
|
|
6733
7502
|
return null;
|
|
6734
7503
|
};
|
|
6735
|
-
return /* @__PURE__ */
|
|
6736
|
-
|
|
7504
|
+
return /* @__PURE__ */ jsxs37(
|
|
7505
|
+
Box41,
|
|
6737
7506
|
{
|
|
7507
|
+
role: "toolbar",
|
|
7508
|
+
"aria-label": "Table toolbar",
|
|
6738
7509
|
sx: __spreadValues({
|
|
6739
7510
|
display: "flex",
|
|
6740
7511
|
alignItems: "center",
|
|
@@ -6746,9 +7517,9 @@ function ListingTableToolbar({
|
|
|
6746
7517
|
children: [
|
|
6747
7518
|
renderSearch(),
|
|
6748
7519
|
children,
|
|
6749
|
-
actions && /* @__PURE__ */
|
|
6750
|
-
/* @__PURE__ */
|
|
6751
|
-
/* @__PURE__ */
|
|
7520
|
+
actions && /* @__PURE__ */ jsxs37(Fragment15, { children: [
|
|
7521
|
+
/* @__PURE__ */ jsx107(Box41, { sx: { flex: 1 } }),
|
|
7522
|
+
/* @__PURE__ */ jsx107(Box41, { sx: { display: "flex", alignItems: "center", gap: 1 }, children: actions })
|
|
6752
7523
|
] })
|
|
6753
7524
|
]
|
|
6754
7525
|
}
|
|
@@ -6757,9 +7528,9 @@ function ListingTableToolbar({
|
|
|
6757
7528
|
var ListingTableToolbar_default = ListingTableToolbar;
|
|
6758
7529
|
|
|
6759
7530
|
// src/components/ListingTable/shared/ListingTableEmptyState.tsx
|
|
6760
|
-
import
|
|
6761
|
-
import
|
|
6762
|
-
import { jsx as
|
|
7531
|
+
import Box42 from "@mui/material/Box";
|
|
7532
|
+
import Typography22 from "@mui/material/Typography";
|
|
7533
|
+
import { jsx as jsx108, jsxs as jsxs38 } from "react/jsx-runtime";
|
|
6763
7534
|
function ListingTableEmptyState({
|
|
6764
7535
|
title = "No data available",
|
|
6765
7536
|
description,
|
|
@@ -6768,8 +7539,8 @@ function ListingTableEmptyState({
|
|
|
6768
7539
|
minHeight = 300,
|
|
6769
7540
|
sx
|
|
6770
7541
|
}) {
|
|
6771
|
-
return /* @__PURE__ */
|
|
6772
|
-
|
|
7542
|
+
return /* @__PURE__ */ jsxs38(
|
|
7543
|
+
Box42,
|
|
6773
7544
|
{
|
|
6774
7545
|
sx: __spreadValues({
|
|
6775
7546
|
display: "flex",
|
|
@@ -6781,8 +7552,8 @@ function ListingTableEmptyState({
|
|
|
6781
7552
|
textAlign: "center"
|
|
6782
7553
|
}, sx),
|
|
6783
7554
|
children: [
|
|
6784
|
-
illustration && /* @__PURE__ */
|
|
6785
|
-
|
|
7555
|
+
illustration && /* @__PURE__ */ jsx108(
|
|
7556
|
+
Box42,
|
|
6786
7557
|
{
|
|
6787
7558
|
sx: {
|
|
6788
7559
|
mb: 2,
|
|
@@ -6795,9 +7566,9 @@ function ListingTableEmptyState({
|
|
|
6795
7566
|
children: illustration
|
|
6796
7567
|
}
|
|
6797
7568
|
),
|
|
6798
|
-
/* @__PURE__ */
|
|
6799
|
-
description && /* @__PURE__ */
|
|
6800
|
-
action && /* @__PURE__ */
|
|
7569
|
+
/* @__PURE__ */ jsx108(Typography22, { variant: "h6", component: "div", sx: { mb: description ? 1 : 0, fontWeight: 500 }, children: title }),
|
|
7570
|
+
description && /* @__PURE__ */ jsx108(Typography22, { variant: "body2", color: "text.secondary", sx: { mb: action ? 2 : 0, maxWidth: 400 }, children: description }),
|
|
7571
|
+
action && /* @__PURE__ */ jsx108(Box42, { children: action })
|
|
6801
7572
|
]
|
|
6802
7573
|
}
|
|
6803
7574
|
);
|
|
@@ -6805,16 +7576,16 @@ function ListingTableEmptyState({
|
|
|
6805
7576
|
var ListingTableEmptyState_default = ListingTableEmptyState;
|
|
6806
7577
|
|
|
6807
7578
|
// src/components/ListingTable/shared/ListingTableDensityControl.tsx
|
|
6808
|
-
import { useCallback as
|
|
7579
|
+
import { useCallback as useCallback7 } from "react";
|
|
6809
7580
|
import ToggleButton from "@mui/material/ToggleButton";
|
|
6810
7581
|
import ToggleButtonGroup from "@mui/material/ToggleButtonGroup";
|
|
6811
|
-
import
|
|
6812
|
-
import { AlignJustify, Menu as
|
|
6813
|
-
import { jsx as
|
|
7582
|
+
import Tooltip8 from "@mui/material/Tooltip";
|
|
7583
|
+
import { AlignJustify, Menu as Menu4, List as List4 } from "@wso2/oxygen-ui-icons-react";
|
|
7584
|
+
import { jsx as jsx109 } from "react/jsx-runtime";
|
|
6814
7585
|
var densityOptions = [
|
|
6815
|
-
{ value: "compact", label: "Compact", icon: /* @__PURE__ */
|
|
6816
|
-
{ value: "standard", label: "Standard", icon: /* @__PURE__ */
|
|
6817
|
-
{ value: "comfortable", label: "Comfortable", icon: /* @__PURE__ */
|
|
7586
|
+
{ value: "compact", label: "Compact", icon: /* @__PURE__ */ jsx109(AlignJustify, { size: 18 }) },
|
|
7587
|
+
{ value: "standard", label: "Standard", icon: /* @__PURE__ */ jsx109(Menu4, { size: 18 }) },
|
|
7588
|
+
{ value: "comfortable", label: "Comfortable", icon: /* @__PURE__ */ jsx109(List4, { size: 18 }) }
|
|
6818
7589
|
];
|
|
6819
7590
|
function ListingTableDensityControl({
|
|
6820
7591
|
value: valueProp,
|
|
@@ -6826,7 +7597,7 @@ function ListingTableDensityControl({
|
|
|
6826
7597
|
const tableContext = useListingTable();
|
|
6827
7598
|
const value = (_a = valueProp != null ? valueProp : tableContext == null ? void 0 : tableContext.density) != null ? _a : "standard";
|
|
6828
7599
|
const effectiveOnChange = onChangeProp != null ? onChangeProp : tableContext == null ? void 0 : tableContext.onDensityChange;
|
|
6829
|
-
const handleChange =
|
|
7600
|
+
const handleChange = useCallback7(
|
|
6830
7601
|
(_event, newDensity) => {
|
|
6831
7602
|
if (newDensity !== null) {
|
|
6832
7603
|
effectiveOnChange == null ? void 0 : effectiveOnChange(newDensity);
|
|
@@ -6834,16 +7605,27 @@ function ListingTableDensityControl({
|
|
|
6834
7605
|
},
|
|
6835
7606
|
[effectiveOnChange]
|
|
6836
7607
|
);
|
|
6837
|
-
return /* @__PURE__ */
|
|
7608
|
+
return /* @__PURE__ */ jsx109(
|
|
7609
|
+
ToggleButtonGroup,
|
|
7610
|
+
{
|
|
7611
|
+
value,
|
|
7612
|
+
exclusive: true,
|
|
7613
|
+
onChange: handleChange,
|
|
7614
|
+
size,
|
|
7615
|
+
sx,
|
|
7616
|
+
"aria-label": "Table density",
|
|
7617
|
+
children: densityOptions.map((option) => /* @__PURE__ */ jsx109(ToggleButton, { value: option.value, "aria-label": option.label, children: /* @__PURE__ */ jsx109(Tooltip8, { title: option.label, children: /* @__PURE__ */ jsx109("span", { style: { display: "flex", alignItems: "center" }, "aria-hidden": "true", children: option.icon }) }) }, option.value))
|
|
7618
|
+
}
|
|
7619
|
+
);
|
|
6838
7620
|
}
|
|
6839
7621
|
var ListingTableDensityControl_default = ListingTableDensityControl;
|
|
6840
7622
|
|
|
6841
7623
|
// src/components/ListingTable/shared/ListingTableSortLabel.tsx
|
|
6842
|
-
import { useCallback as
|
|
7624
|
+
import { useCallback as useCallback8 } from "react";
|
|
6843
7625
|
import MuiTableSortLabel from "@mui/material/TableSortLabel";
|
|
6844
|
-
import { styled as
|
|
6845
|
-
import { jsx as
|
|
6846
|
-
var StyledTableSortLabel =
|
|
7626
|
+
import { styled as styled72 } from "@mui/material/styles";
|
|
7627
|
+
import { jsx as jsx110 } from "react/jsx-runtime";
|
|
7628
|
+
var StyledTableSortLabel = styled72(MuiTableSortLabel)(({ theme }) => ({
|
|
6847
7629
|
color: "inherit !important",
|
|
6848
7630
|
"&.Mui-active": {
|
|
6849
7631
|
color: "inherit !important",
|
|
@@ -6873,7 +7655,7 @@ function ListingTableSortLabel(_a) {
|
|
|
6873
7655
|
const isActiveFromContext = field !== void 0 && (tableContext == null ? void 0 : tableContext.sortField) === field;
|
|
6874
7656
|
const active = activeProp != null ? activeProp : isActiveFromContext;
|
|
6875
7657
|
const direction = (_a2 = directionProp != null ? directionProp : isActiveFromContext ? tableContext == null ? void 0 : tableContext.sortDirection : void 0) != null ? _a2 : "asc";
|
|
6876
|
-
const handleClick =
|
|
7658
|
+
const handleClick = useCallback8(
|
|
6877
7659
|
(event) => {
|
|
6878
7660
|
if (onClickProp) {
|
|
6879
7661
|
onClickProp(event);
|
|
@@ -6886,13 +7668,13 @@ function ListingTableSortLabel(_a) {
|
|
|
6886
7668
|
},
|
|
6887
7669
|
[onClickProp, field, tableContext, active, direction]
|
|
6888
7670
|
);
|
|
6889
|
-
return /* @__PURE__ */
|
|
7671
|
+
return /* @__PURE__ */ jsx110(StyledTableSortLabel, __spreadProps(__spreadValues({ active, direction, onClick: handleClick, hideSortIcon }, props), { children }));
|
|
6890
7672
|
}
|
|
6891
7673
|
var ListingTableSortLabel_default = ListingTableSortLabel;
|
|
6892
7674
|
|
|
6893
7675
|
// src/components/ListingTable/shared/ListingTableRowActions.tsx
|
|
6894
|
-
import
|
|
6895
|
-
import { jsx as
|
|
7676
|
+
import Box43 from "@mui/material/Box";
|
|
7677
|
+
import { jsx as jsx111 } from "react/jsx-runtime";
|
|
6896
7678
|
var alignmentMap = {
|
|
6897
7679
|
left: "flex-start",
|
|
6898
7680
|
center: "center",
|
|
@@ -6904,8 +7686,8 @@ function ListingTableRowActions({
|
|
|
6904
7686
|
align = "right",
|
|
6905
7687
|
sx
|
|
6906
7688
|
}) {
|
|
6907
|
-
return /* @__PURE__ */
|
|
6908
|
-
|
|
7689
|
+
return /* @__PURE__ */ jsx111(
|
|
7690
|
+
Box43,
|
|
6909
7691
|
{
|
|
6910
7692
|
className: "table-row-actions",
|
|
6911
7693
|
sx: __spreadValues(__spreadValues({
|
|
@@ -6928,9 +7710,9 @@ function ListingTableRowActions({
|
|
|
6928
7710
|
var ListingTableRowActions_default = ListingTableRowActions;
|
|
6929
7711
|
|
|
6930
7712
|
// src/components/ListingTable/shared/ListingTableCellIcon.tsx
|
|
6931
|
-
import
|
|
6932
|
-
import
|
|
6933
|
-
import { Fragment as Fragment16, jsx as
|
|
7713
|
+
import Box44 from "@mui/material/Box";
|
|
7714
|
+
import Typography23 from "@mui/material/Typography";
|
|
7715
|
+
import { Fragment as Fragment16, jsx as jsx112, jsxs as jsxs39 } from "react/jsx-runtime";
|
|
6934
7716
|
function ListingTableCellIcon({
|
|
6935
7717
|
icon,
|
|
6936
7718
|
primary,
|
|
@@ -6939,8 +7721,8 @@ function ListingTableCellIcon({
|
|
|
6939
7721
|
iconSx,
|
|
6940
7722
|
sx
|
|
6941
7723
|
}) {
|
|
6942
|
-
const iconElement = /* @__PURE__ */
|
|
6943
|
-
|
|
7724
|
+
const iconElement = /* @__PURE__ */ jsx112(
|
|
7725
|
+
Box44,
|
|
6944
7726
|
{
|
|
6945
7727
|
sx: __spreadValues({
|
|
6946
7728
|
display: "flex",
|
|
@@ -6952,9 +7734,9 @@ function ListingTableCellIcon({
|
|
|
6952
7734
|
children: icon
|
|
6953
7735
|
}
|
|
6954
7736
|
);
|
|
6955
|
-
const textContent = /* @__PURE__ */
|
|
6956
|
-
/* @__PURE__ */
|
|
6957
|
-
|
|
7737
|
+
const textContent = /* @__PURE__ */ jsxs39(Box44, { sx: { minWidth: 0, flex: 1 }, children: [
|
|
7738
|
+
/* @__PURE__ */ jsx112(
|
|
7739
|
+
Typography23,
|
|
6958
7740
|
{
|
|
6959
7741
|
variant: "body2",
|
|
6960
7742
|
component: "div",
|
|
@@ -6967,8 +7749,8 @@ function ListingTableCellIcon({
|
|
|
6967
7749
|
children: primary
|
|
6968
7750
|
}
|
|
6969
7751
|
),
|
|
6970
|
-
secondary && /* @__PURE__ */
|
|
6971
|
-
|
|
7752
|
+
secondary && /* @__PURE__ */ jsx112(
|
|
7753
|
+
Typography23,
|
|
6972
7754
|
{
|
|
6973
7755
|
variant: "caption",
|
|
6974
7756
|
component: "div",
|
|
@@ -6982,8 +7764,8 @@ function ListingTableCellIcon({
|
|
|
6982
7764
|
}
|
|
6983
7765
|
)
|
|
6984
7766
|
] });
|
|
6985
|
-
return /* @__PURE__ */
|
|
6986
|
-
|
|
7767
|
+
return /* @__PURE__ */ jsx112(
|
|
7768
|
+
Box44,
|
|
6987
7769
|
{
|
|
6988
7770
|
sx: __spreadValues({
|
|
6989
7771
|
display: "flex",
|
|
@@ -6991,10 +7773,10 @@ function ListingTableCellIcon({
|
|
|
6991
7773
|
gap: 1.5,
|
|
6992
7774
|
minWidth: 0
|
|
6993
7775
|
}, sx),
|
|
6994
|
-
children: iconPosition === "left" ? /* @__PURE__ */
|
|
7776
|
+
children: iconPosition === "left" ? /* @__PURE__ */ jsxs39(Fragment16, { children: [
|
|
6995
7777
|
iconElement,
|
|
6996
7778
|
textContent
|
|
6997
|
-
] }) : /* @__PURE__ */
|
|
7779
|
+
] }) : /* @__PURE__ */ jsxs39(Fragment16, { children: [
|
|
6998
7780
|
textContent,
|
|
6999
7781
|
iconElement
|
|
7000
7782
|
] })
|
|
@@ -7004,8 +7786,8 @@ function ListingTableCellIcon({
|
|
|
7004
7786
|
var ListingTableCellIcon_default = ListingTableCellIcon;
|
|
7005
7787
|
|
|
7006
7788
|
// src/components/ListingTable/ListingTableProvider.tsx
|
|
7007
|
-
import { useMemo as
|
|
7008
|
-
import { jsx as
|
|
7789
|
+
import { useMemo as useMemo9 } from "react";
|
|
7790
|
+
import { jsx as jsx113 } from "react/jsx-runtime";
|
|
7009
7791
|
function ListingTableProvider({
|
|
7010
7792
|
children,
|
|
7011
7793
|
// Search
|
|
@@ -7043,7 +7825,7 @@ function ListingTableProvider({
|
|
|
7043
7825
|
// Loading
|
|
7044
7826
|
loading
|
|
7045
7827
|
}) {
|
|
7046
|
-
const contextValue =
|
|
7828
|
+
const contextValue = useMemo9(
|
|
7047
7829
|
() => ({
|
|
7048
7830
|
// Search
|
|
7049
7831
|
searchValue,
|
|
@@ -7108,12 +7890,12 @@ function ListingTableProvider({
|
|
|
7108
7890
|
loading
|
|
7109
7891
|
]
|
|
7110
7892
|
);
|
|
7111
|
-
return /* @__PURE__ */
|
|
7893
|
+
return /* @__PURE__ */ jsx113(ListingTableContext.Provider, { value: contextValue, children });
|
|
7112
7894
|
}
|
|
7113
7895
|
|
|
7114
7896
|
// src/components/ListingTable/ListingTable/ListingTable.tsx
|
|
7115
|
-
import { jsx as
|
|
7116
|
-
var StyledTable =
|
|
7897
|
+
import { jsx as jsx114 } from "react/jsx-runtime";
|
|
7898
|
+
var StyledTable = styled73(MuiTable, {
|
|
7117
7899
|
shouldForwardProp: (prop) => {
|
|
7118
7900
|
const excludedProps = ["variant", "density", "striped", "bordered"];
|
|
7119
7901
|
return !excludedProps.some((excluded) => excluded === prop);
|
|
@@ -7166,7 +7948,7 @@ function ListingTable(_a) {
|
|
|
7166
7948
|
"children",
|
|
7167
7949
|
"sx"
|
|
7168
7950
|
]);
|
|
7169
|
-
return /* @__PURE__ */
|
|
7951
|
+
return /* @__PURE__ */ jsx114(
|
|
7170
7952
|
StyledTable,
|
|
7171
7953
|
__spreadProps(__spreadValues({
|
|
7172
7954
|
variant,
|
|
@@ -7198,9 +7980,9 @@ var ListingTableCompound = Object.assign(ListingTable, {
|
|
|
7198
7980
|
var ListingTable_default = ListingTableCompound;
|
|
7199
7981
|
|
|
7200
7982
|
// src/animations/ParticleBackground/ParticleBackground.tsx
|
|
7201
|
-
import { useEffect as
|
|
7983
|
+
import { useEffect as useEffect7, useRef as useRef4 } from "react";
|
|
7202
7984
|
import { useColorScheme as useColorScheme4 } from "@mui/material/styles";
|
|
7203
|
-
import { jsx as
|
|
7985
|
+
import { jsx as jsx115 } from "react/jsx-runtime";
|
|
7204
7986
|
var ParticleBackground = ({
|
|
7205
7987
|
opacity = 0.5,
|
|
7206
7988
|
baseDensity = 0.12,
|
|
@@ -7212,9 +7994,9 @@ var ParticleBackground = ({
|
|
|
7212
7994
|
repelStrength = 0.35,
|
|
7213
7995
|
clickBurst = 120
|
|
7214
7996
|
}) => {
|
|
7215
|
-
const canvasRef =
|
|
7997
|
+
const canvasRef = useRef4(null);
|
|
7216
7998
|
const { mode } = useColorScheme4();
|
|
7217
|
-
|
|
7999
|
+
useEffect7(() => {
|
|
7218
8000
|
const canvas = canvasRef.current;
|
|
7219
8001
|
if (!canvas) return;
|
|
7220
8002
|
const ctx = canvas.getContext("2d", { alpha: true });
|
|
@@ -7291,6 +8073,7 @@ var ParticleBackground = ({
|
|
|
7291
8073
|
context.fill();
|
|
7292
8074
|
}
|
|
7293
8075
|
}
|
|
8076
|
+
const reducedMotionQuery = window.matchMedia("(prefers-reduced-motion: reduce)");
|
|
7294
8077
|
function resize() {
|
|
7295
8078
|
DPR = Math.max(1, Math.min(2, window.devicePixelRatio || 1));
|
|
7296
8079
|
W = canvasEl.width = Math.floor(window.innerWidth * DPR);
|
|
@@ -7298,6 +8081,9 @@ var ParticleBackground = ({
|
|
|
7298
8081
|
canvasEl.style.width = window.innerWidth + "px";
|
|
7299
8082
|
canvasEl.style.height = window.innerHeight + "px";
|
|
7300
8083
|
computeParticlesCount();
|
|
8084
|
+
if (reducedMotionQuery.matches) {
|
|
8085
|
+
drawStaticFrame();
|
|
8086
|
+
}
|
|
7301
8087
|
}
|
|
7302
8088
|
function computeParticlesCount() {
|
|
7303
8089
|
const area = W * H / (DPR * DPR);
|
|
@@ -7312,6 +8098,7 @@ var ParticleBackground = ({
|
|
|
7312
8098
|
}
|
|
7313
8099
|
const mouse = { x: null, y: null };
|
|
7314
8100
|
const handleMouseMove = (e) => {
|
|
8101
|
+
if (reducedMotionQuery.matches) return;
|
|
7315
8102
|
mouse.x = e.clientX * DPR;
|
|
7316
8103
|
mouse.y = e.clientY * DPR;
|
|
7317
8104
|
};
|
|
@@ -7319,6 +8106,7 @@ var ParticleBackground = ({
|
|
|
7319
8106
|
mouse.x = mouse.y = null;
|
|
7320
8107
|
};
|
|
7321
8108
|
const handleClick = (e) => {
|
|
8109
|
+
if (reducedMotionQuery.matches) return;
|
|
7322
8110
|
const mx = e.clientX * DPR;
|
|
7323
8111
|
const my = e.clientY * DPR;
|
|
7324
8112
|
for (let i = 0; i < particles.length; i++) {
|
|
@@ -7347,8 +8135,8 @@ var ParticleBackground = ({
|
|
|
7347
8135
|
const dy = a.y - b.y;
|
|
7348
8136
|
const dist = Math.hypot(dx, dy);
|
|
7349
8137
|
if (dist < linkDist * DPR) {
|
|
7350
|
-
const
|
|
7351
|
-
context.globalAlpha =
|
|
8138
|
+
const alpha4 = linkAlpha * (1 - dist / (linkDist * DPR));
|
|
8139
|
+
context.globalAlpha = alpha4;
|
|
7352
8140
|
context.beginPath();
|
|
7353
8141
|
context.moveTo(a.x, a.y);
|
|
7354
8142
|
context.lineTo(b.x, b.y);
|
|
@@ -7358,6 +8146,13 @@ var ParticleBackground = ({
|
|
|
7358
8146
|
}
|
|
7359
8147
|
context.globalAlpha = 1;
|
|
7360
8148
|
}
|
|
8149
|
+
function drawStaticFrame() {
|
|
8150
|
+
context.clearRect(0, 0, W, H);
|
|
8151
|
+
drawLinks();
|
|
8152
|
+
for (let i = 0; i < particles.length; i++) {
|
|
8153
|
+
particles[i].draw();
|
|
8154
|
+
}
|
|
8155
|
+
}
|
|
7361
8156
|
function loop() {
|
|
7362
8157
|
context.clearRect(0, 0, W, H);
|
|
7363
8158
|
for (let i = 0; i < particles.length; i++) {
|
|
@@ -7369,6 +8164,17 @@ var ParticleBackground = ({
|
|
|
7369
8164
|
}
|
|
7370
8165
|
animationFrameId = requestAnimationFrame(loop);
|
|
7371
8166
|
}
|
|
8167
|
+
function startRendering() {
|
|
8168
|
+
cancelAnimationFrame(animationFrameId);
|
|
8169
|
+
if (reducedMotionQuery.matches) {
|
|
8170
|
+
drawStaticFrame();
|
|
8171
|
+
} else {
|
|
8172
|
+
loop();
|
|
8173
|
+
}
|
|
8174
|
+
}
|
|
8175
|
+
const handleReducedMotionChange = () => {
|
|
8176
|
+
startRendering();
|
|
8177
|
+
};
|
|
7372
8178
|
resize();
|
|
7373
8179
|
for (let i = 0; i < 120; i++) particles.push(new Particle());
|
|
7374
8180
|
computeParticlesCount();
|
|
@@ -7376,20 +8182,23 @@ var ParticleBackground = ({
|
|
|
7376
8182
|
window.addEventListener("mousemove", handleMouseMove, { passive: true });
|
|
7377
8183
|
window.addEventListener("mouseleave", handleMouseLeave);
|
|
7378
8184
|
window.addEventListener("click", handleClick);
|
|
7379
|
-
|
|
8185
|
+
reducedMotionQuery.addEventListener("change", handleReducedMotionChange);
|
|
8186
|
+
startRendering();
|
|
7380
8187
|
return () => {
|
|
7381
8188
|
window.removeEventListener("resize", resize);
|
|
7382
8189
|
window.removeEventListener("mousemove", handleMouseMove);
|
|
7383
8190
|
window.removeEventListener("mouseleave", handleMouseLeave);
|
|
7384
8191
|
window.removeEventListener("click", handleClick);
|
|
8192
|
+
reducedMotionQuery.removeEventListener("change", handleReducedMotionChange);
|
|
7385
8193
|
cancelAnimationFrame(animationFrameId);
|
|
7386
8194
|
};
|
|
7387
8195
|
}, [baseDensity, maxSpeed, radius, linkDist, linkAlpha, mouseInfluence, repelStrength, clickBurst, mode]);
|
|
7388
|
-
return /* @__PURE__ */
|
|
8196
|
+
return /* @__PURE__ */ jsx115(
|
|
7389
8197
|
"canvas",
|
|
7390
8198
|
{
|
|
7391
8199
|
ref: canvasRef,
|
|
7392
8200
|
id: "particle-bg",
|
|
8201
|
+
"aria-hidden": "true",
|
|
7393
8202
|
style: {
|
|
7394
8203
|
position: "fixed",
|
|
7395
8204
|
top: 0,
|
|
@@ -7413,44 +8222,44 @@ function useThemeContent(contentMap, fallback) {
|
|
|
7413
8222
|
var useThemeContent_default = useThemeContent;
|
|
7414
8223
|
|
|
7415
8224
|
// src/hooks/useNotifications/useNotifications.ts
|
|
7416
|
-
import * as
|
|
8225
|
+
import * as React44 from "react";
|
|
7417
8226
|
var generateId = () => {
|
|
7418
8227
|
return `notif-${Date.now()}-${Math.random().toString(36).slice(2, 9)}`;
|
|
7419
8228
|
};
|
|
7420
8229
|
var useNotifications = (options = {}) => {
|
|
7421
8230
|
const { initialNotifications = [] } = options;
|
|
7422
|
-
const [notifications, setNotifications] =
|
|
8231
|
+
const [notifications, setNotifications] = React44.useState(
|
|
7423
8232
|
initialNotifications
|
|
7424
8233
|
);
|
|
7425
|
-
const markRead =
|
|
8234
|
+
const markRead = React44.useCallback((id) => {
|
|
7426
8235
|
setNotifications(
|
|
7427
8236
|
(prev) => prev.map((n) => n.id === id ? __spreadProps(__spreadValues({}, n), { read: true }) : n)
|
|
7428
8237
|
);
|
|
7429
8238
|
}, []);
|
|
7430
|
-
const dismiss =
|
|
8239
|
+
const dismiss = React44.useCallback((id) => {
|
|
7431
8240
|
setNotifications((prev) => prev.filter((n) => n.id !== id));
|
|
7432
8241
|
}, []);
|
|
7433
|
-
const markAllRead =
|
|
8242
|
+
const markAllRead = React44.useCallback(() => {
|
|
7434
8243
|
setNotifications((prev) => prev.map((n) => __spreadProps(__spreadValues({}, n), { read: true })));
|
|
7435
8244
|
}, []);
|
|
7436
|
-
const clearAll =
|
|
8245
|
+
const clearAll = React44.useCallback(() => {
|
|
7437
8246
|
setNotifications([]);
|
|
7438
8247
|
}, []);
|
|
7439
|
-
const add =
|
|
8248
|
+
const add = React44.useCallback((notification) => {
|
|
7440
8249
|
const newNotification = __spreadProps(__spreadValues({}, notification), {
|
|
7441
8250
|
id: generateId()
|
|
7442
8251
|
});
|
|
7443
8252
|
setNotifications((prev) => [newNotification, ...prev]);
|
|
7444
8253
|
}, []);
|
|
7445
|
-
const unreadCount =
|
|
8254
|
+
const unreadCount = React44.useMemo(
|
|
7446
8255
|
() => notifications.filter((n) => !n.read).length,
|
|
7447
8256
|
[notifications]
|
|
7448
8257
|
);
|
|
7449
|
-
const unreadNotifications =
|
|
8258
|
+
const unreadNotifications = React44.useMemo(
|
|
7450
8259
|
() => notifications.filter((n) => !n.read),
|
|
7451
8260
|
[notifications]
|
|
7452
8261
|
);
|
|
7453
|
-
const actions =
|
|
8262
|
+
const actions = React44.useMemo(
|
|
7454
8263
|
() => ({
|
|
7455
8264
|
markRead,
|
|
7456
8265
|
dismiss,
|
|
@@ -7483,6 +8292,7 @@ export {
|
|
|
7483
8292
|
AdapterDateFns,
|
|
7484
8293
|
AppBreadcrumbs,
|
|
7485
8294
|
AppShell,
|
|
8295
|
+
AppSwitcher,
|
|
7486
8296
|
ClassicTheme_default as ClassicTheme,
|
|
7487
8297
|
CodeBlock_default as CodeBlock,
|
|
7488
8298
|
ColorSchemeImage,
|