@wso2/oxygen-ui 0.5.0 → 0.7.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/AGENTS.md +17 -15
- package/.ai/components.md +706 -73
- package/.ai/migration.md +4 -2
- package/.ai/patterns.md +20 -8
- package/.ai/theming.md +15 -2
- package/.claude/components.md +706 -73
- package/.claude/migration.md +4 -2
- package/.claude/patterns.md +20 -8
- package/.claude/skills/oxygen-component/SKILL.md +12 -6
- package/.claude/skills/oxygen-migrate/SKILL.md +5 -2
- package/.claude/skills/oxygen-sync/SKILL.md +157 -0
- package/.claude/theming.md +15 -2
- package/bin/cli.js +32 -19
- package/dist/components/AppShell/AppShell.d.ts +8 -6
- package/dist/components/AppShell/context.d.ts +64 -0
- package/dist/components/AppShell/index.d.ts +1 -0
- package/dist/components/Header/HeaderToggle.d.ts +4 -4
- package/dist/components/NotificationPanel/NotificationPanel.d.ts +4 -4
- package/dist/components/Sidebar/SidebarItem.d.ts +10 -0
- package/dist/hooks/useAppShell/useAppShell.d.ts +43 -8
- package/dist/index.js +544 -409
- package/dist/index.js.map +4 -4
- package/dist/utils/pxToRem.d.ts +1 -1
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -130,7 +130,7 @@ var __objRest = (source, exclude) => {
|
|
|
130
130
|
// package.json
|
|
131
131
|
var package_default = {
|
|
132
132
|
name: "@wso2/oxygen-ui",
|
|
133
|
-
version: "0.
|
|
133
|
+
version: "0.7.0",
|
|
134
134
|
description: "WSO2 Oxygen UI | Design System - Powered with Material-UI component library with TypeScript support",
|
|
135
135
|
type: "module",
|
|
136
136
|
main: "./dist/index.js",
|
|
@@ -274,56 +274,66 @@ function formatRelativeTime(date) {
|
|
|
274
274
|
}
|
|
275
275
|
|
|
276
276
|
// src/utils/pxToRem.ts
|
|
277
|
-
var pxToRem = (size) => `${size /
|
|
277
|
+
var pxToRem = (size) => `${size / 16}rem`;
|
|
278
278
|
|
|
279
279
|
// src/styles/Themes/OxygenThemeBase.ts
|
|
280
|
+
var OxygenUIPrimitives = {
|
|
281
|
+
fontSize: 14,
|
|
282
|
+
primaryColor: "#ff7300",
|
|
283
|
+
secondaryColor: "#757575"
|
|
284
|
+
};
|
|
280
285
|
var OxygenThemeBase = extendTheme({
|
|
281
286
|
cssVarPrefix: "oxygen",
|
|
282
287
|
colorSchemeSelector: "data-color-scheme",
|
|
283
288
|
typography: {
|
|
284
289
|
fontFamily: "'Inter Variable', sans-serif",
|
|
285
290
|
fontWeightRegular: 400,
|
|
286
|
-
fontSize:
|
|
291
|
+
fontSize: OxygenUIPrimitives.fontSize,
|
|
287
292
|
h1: {
|
|
288
|
-
fontSize: pxToRem(
|
|
293
|
+
fontSize: pxToRem(OxygenUIPrimitives.fontSize + 14),
|
|
289
294
|
fontWeight: 400
|
|
290
295
|
},
|
|
291
296
|
h2: {
|
|
292
|
-
fontSize: pxToRem(
|
|
297
|
+
fontSize: pxToRem(OxygenUIPrimitives.fontSize + 10),
|
|
293
298
|
fontWeight: 400
|
|
294
299
|
},
|
|
295
300
|
h3: {
|
|
296
|
-
fontSize: pxToRem(
|
|
301
|
+
fontSize: pxToRem(OxygenUIPrimitives.fontSize + 8),
|
|
297
302
|
fontWeight: 400
|
|
298
303
|
},
|
|
299
304
|
h4: {
|
|
300
|
-
fontSize: pxToRem(
|
|
305
|
+
fontSize: pxToRem(OxygenUIPrimitives.fontSize + 6),
|
|
301
306
|
fontWeight: 400
|
|
302
307
|
},
|
|
303
308
|
h5: {
|
|
304
|
-
fontSize: pxToRem(
|
|
309
|
+
fontSize: pxToRem(OxygenUIPrimitives.fontSize + 2),
|
|
305
310
|
fontWeight: 400
|
|
306
311
|
},
|
|
307
312
|
h6: {
|
|
308
|
-
fontSize: pxToRem(
|
|
313
|
+
fontSize: pxToRem(OxygenUIPrimitives.fontSize),
|
|
309
314
|
fontWeight: 500
|
|
310
315
|
},
|
|
311
316
|
subtitle1: {
|
|
312
|
-
fontSize: pxToRem(
|
|
317
|
+
fontSize: pxToRem(OxygenUIPrimitives.fontSize + 4)
|
|
313
318
|
},
|
|
314
319
|
subtitle2: {
|
|
315
|
-
fontSize: pxToRem(
|
|
320
|
+
fontSize: pxToRem(OxygenUIPrimitives.fontSize),
|
|
316
321
|
fontWeight: 400
|
|
317
322
|
},
|
|
318
323
|
body1: {
|
|
319
|
-
fontSize: pxToRem(
|
|
324
|
+
fontSize: pxToRem(OxygenUIPrimitives.fontSize)
|
|
320
325
|
},
|
|
321
326
|
body2: {
|
|
322
|
-
fontSize: pxToRem(
|
|
327
|
+
fontSize: pxToRem(OxygenUIPrimitives.fontSize - 1),
|
|
328
|
+
// Will use by the labels in the components
|
|
323
329
|
fontWeight: 400
|
|
324
330
|
},
|
|
331
|
+
button: {
|
|
332
|
+
fontSize: pxToRem(OxygenUIPrimitives.fontSize),
|
|
333
|
+
fontWeight: 500
|
|
334
|
+
},
|
|
325
335
|
caption: {
|
|
326
|
-
fontSize: pxToRem(
|
|
336
|
+
fontSize: pxToRem(OxygenUIPrimitives.fontSize - 3),
|
|
327
337
|
fontWeight: 400
|
|
328
338
|
}
|
|
329
339
|
},
|
|
@@ -332,11 +342,11 @@ var OxygenThemeBase = extendTheme({
|
|
|
332
342
|
light: {
|
|
333
343
|
palette: {
|
|
334
344
|
primary: {
|
|
335
|
-
main:
|
|
345
|
+
main: OxygenUIPrimitives.primaryColor,
|
|
336
346
|
contrastText: "#ffffff"
|
|
337
347
|
},
|
|
338
348
|
secondary: {
|
|
339
|
-
main:
|
|
349
|
+
main: OxygenUIPrimitives.secondaryColor,
|
|
340
350
|
contrastText: "#ffffff"
|
|
341
351
|
},
|
|
342
352
|
background: {
|
|
@@ -348,11 +358,11 @@ var OxygenThemeBase = extendTheme({
|
|
|
348
358
|
dark: {
|
|
349
359
|
palette: {
|
|
350
360
|
primary: {
|
|
351
|
-
main:
|
|
361
|
+
main: OxygenUIPrimitives.primaryColor,
|
|
352
362
|
contrastText: "#ffffff"
|
|
353
363
|
},
|
|
354
364
|
secondary: {
|
|
355
|
-
main:
|
|
365
|
+
main: OxygenUIPrimitives.secondaryColor,
|
|
356
366
|
contrastText: "#ffffff"
|
|
357
367
|
},
|
|
358
368
|
background: {
|
|
@@ -369,6 +379,15 @@ var OxygenThemeBase = extendTheme({
|
|
|
369
379
|
clearIcon: React.createElement(X)
|
|
370
380
|
}
|
|
371
381
|
},
|
|
382
|
+
MuiInputLabel: {
|
|
383
|
+
styleOverrides: {
|
|
384
|
+
root: {
|
|
385
|
+
".MuiFormControl-root:has(.MuiSelect-select) &:not(.MuiInputLabel-shrink)": {
|
|
386
|
+
top: "-7px"
|
|
387
|
+
}
|
|
388
|
+
}
|
|
389
|
+
}
|
|
390
|
+
},
|
|
372
391
|
MuiSelect: {
|
|
373
392
|
defaultProps: {
|
|
374
393
|
size: "small",
|
|
@@ -480,7 +499,7 @@ var AcrylicBaseTheme = extendTheme2(OxygenThemeBase_default, {
|
|
|
480
499
|
background: {
|
|
481
500
|
default: "#f5f5f5",
|
|
482
501
|
paper: "#ffffffe1",
|
|
483
|
-
acrylic: "#
|
|
502
|
+
acrylic: "#ffffff4a"
|
|
484
503
|
},
|
|
485
504
|
text: {
|
|
486
505
|
primary: "#40404B",
|
|
@@ -596,6 +615,15 @@ var AcrylicBaseTheme = extendTheme2(OxygenThemeBase_default, {
|
|
|
596
615
|
})
|
|
597
616
|
}
|
|
598
617
|
},
|
|
618
|
+
MuiSidebar: {
|
|
619
|
+
styleOverrides: {
|
|
620
|
+
root: ({ theme }) => ({
|
|
621
|
+
backgroundColor: theme.vars.palette.background.acrylic,
|
|
622
|
+
WebkitBackdropFilter: theme.blur.light,
|
|
623
|
+
backdropFilter: theme.blur.light
|
|
624
|
+
})
|
|
625
|
+
}
|
|
626
|
+
},
|
|
599
627
|
MuiAppBar: {
|
|
600
628
|
styleOverrides: {
|
|
601
629
|
root: ({ theme }) => ({
|
|
@@ -2440,15 +2468,11 @@ var PageTitleHeaderStyled = styled8(Typography, {
|
|
|
2440
2468
|
})(({ theme }) => {
|
|
2441
2469
|
var _a;
|
|
2442
2470
|
return {
|
|
2443
|
-
fontWeight: 500,
|
|
2444
|
-
fontSize: "1.5rem",
|
|
2445
|
-
lineHeight: 1.334,
|
|
2446
|
-
letterSpacing: "0em",
|
|
2447
2471
|
color: ((_a = theme.vars) == null ? void 0 : _a.palette.text.primary) || theme.palette.text.primary
|
|
2448
2472
|
};
|
|
2449
2473
|
});
|
|
2450
2474
|
var PageTitleHeader = (_a) => {
|
|
2451
|
-
var _b = _a, { children, variant = "
|
|
2475
|
+
var _b = _a, { children, variant = "h1" } = _b, props = __objRest(_b, ["children", "variant"]);
|
|
2452
2476
|
return /* @__PURE__ */ jsx13(PageTitleHeaderStyled, __spreadProps(__spreadValues({ variant }, props), { children }));
|
|
2453
2477
|
};
|
|
2454
2478
|
PageTitleHeader.displayName = "PageTitle.Header";
|
|
@@ -3007,7 +3031,7 @@ function SearchBar(_a) {
|
|
|
3007
3031
|
var SearchBar_default = SearchBar;
|
|
3008
3032
|
|
|
3009
3033
|
// src/components/Header/Header.tsx
|
|
3010
|
-
import * as
|
|
3034
|
+
import * as React9 from "react";
|
|
3011
3035
|
import AppBar from "@mui/material/AppBar";
|
|
3012
3036
|
import Toolbar from "@mui/material/Toolbar";
|
|
3013
3037
|
import Box11 from "@mui/material/Box";
|
|
@@ -3025,11 +3049,26 @@ var useHeader = () => {
|
|
|
3025
3049
|
};
|
|
3026
3050
|
|
|
3027
3051
|
// src/components/Header/HeaderToggle.tsx
|
|
3052
|
+
import * as React8 from "react";
|
|
3028
3053
|
import IconButton3 from "@mui/material/IconButton";
|
|
3029
3054
|
import Tooltip2 from "@mui/material/Tooltip";
|
|
3030
3055
|
import { styled as styled15 } from "@mui/material/styles";
|
|
3031
3056
|
import { Menu } from "@wso2/oxygen-ui-icons-react";
|
|
3057
|
+
|
|
3058
|
+
// src/components/AppShell/context.tsx
|
|
3059
|
+
import * as React7 from "react";
|
|
3032
3060
|
import { jsx as jsx25 } from "react/jsx-runtime";
|
|
3061
|
+
var AppShellContext = React7.createContext(void 0);
|
|
3062
|
+
var AppShellProvider = ({
|
|
3063
|
+
children,
|
|
3064
|
+
value
|
|
3065
|
+
}) => {
|
|
3066
|
+
return /* @__PURE__ */ jsx25(AppShellContext.Provider, { value, children });
|
|
3067
|
+
};
|
|
3068
|
+
AppShellProvider.displayName = "AppShellProvider";
|
|
3069
|
+
|
|
3070
|
+
// src/components/Header/HeaderToggle.tsx
|
|
3071
|
+
import { jsx as jsx26 } from "react/jsx-runtime";
|
|
3033
3072
|
var HeaderToggleRoot = styled15(IconButton3, {
|
|
3034
3073
|
name: "MuiHeader",
|
|
3035
3074
|
slot: "Toggle"
|
|
@@ -3037,15 +3076,20 @@ var HeaderToggleRoot = styled15(IconButton3, {
|
|
|
3037
3076
|
color: (theme.vars || theme).palette.text.secondary
|
|
3038
3077
|
}));
|
|
3039
3078
|
var HeaderToggle = ({
|
|
3040
|
-
collapsed,
|
|
3041
|
-
onToggle,
|
|
3079
|
+
collapsed: collapsedProp,
|
|
3080
|
+
onToggle: onToggleProp,
|
|
3042
3081
|
expandLabel = "Expand sidebar",
|
|
3043
3082
|
collapseLabel = "Collapse sidebar",
|
|
3044
3083
|
expandIcon,
|
|
3045
3084
|
collapseIcon,
|
|
3046
3085
|
sx
|
|
3047
3086
|
}) => {
|
|
3048
|
-
|
|
3087
|
+
var _a, _b;
|
|
3088
|
+
const appShellContext = React8.useContext(AppShellContext);
|
|
3089
|
+
const collapsed = (_a = collapsedProp != null ? collapsedProp : appShellContext == null ? void 0 : appShellContext.state.sidebarCollapsed) != null ? _a : false;
|
|
3090
|
+
const onToggle = (_b = onToggleProp != null ? onToggleProp : appShellContext == null ? void 0 : appShellContext.actions.toggleSidebar) != null ? _b : (() => {
|
|
3091
|
+
});
|
|
3092
|
+
return /* @__PURE__ */ jsx26(Tooltip2, { title: collapsed ? expandLabel : collapseLabel, children: /* @__PURE__ */ jsx26(HeaderToggleRoot, { onClick: onToggle, size: "small", sx, children: collapsed ? expandIcon || /* @__PURE__ */ jsx26(Menu, { size: 20 }) : collapseIcon || /* @__PURE__ */ jsx26(Menu, { size: 20 }) }) });
|
|
3049
3093
|
};
|
|
3050
3094
|
|
|
3051
3095
|
// src/components/Header/HeaderBrand.tsx
|
|
@@ -3055,7 +3099,7 @@ import { styled as styled18 } from "@mui/material/styles";
|
|
|
3055
3099
|
// src/components/Header/HeaderBrandLogo.tsx
|
|
3056
3100
|
import Box7 from "@mui/material/Box";
|
|
3057
3101
|
import { styled as styled16 } from "@mui/material/styles";
|
|
3058
|
-
import { jsx as
|
|
3102
|
+
import { jsx as jsx27 } from "react/jsx-runtime";
|
|
3059
3103
|
var HeaderBrandLogoRoot = styled16(Box7, {
|
|
3060
3104
|
name: "MuiHeader",
|
|
3061
3105
|
slot: "BrandLogo"
|
|
@@ -3067,14 +3111,14 @@ var HeaderBrandLogo = ({
|
|
|
3067
3111
|
children,
|
|
3068
3112
|
sx
|
|
3069
3113
|
}) => {
|
|
3070
|
-
return /* @__PURE__ */
|
|
3114
|
+
return /* @__PURE__ */ jsx27(HeaderBrandLogoRoot, { sx, children });
|
|
3071
3115
|
};
|
|
3072
3116
|
HeaderBrandLogo.displayName = "HeaderBrandLogo";
|
|
3073
3117
|
|
|
3074
3118
|
// src/components/Header/HeaderBrandTitle.tsx
|
|
3075
3119
|
import Typography6 from "@mui/material/Typography";
|
|
3076
3120
|
import { styled as styled17 } from "@mui/material/styles";
|
|
3077
|
-
import { jsx as
|
|
3121
|
+
import { jsx as jsx28 } from "react/jsx-runtime";
|
|
3078
3122
|
var HeaderBrandTitleRoot = styled17(Typography6, {
|
|
3079
3123
|
name: "MuiHeader",
|
|
3080
3124
|
slot: "BrandTitle"
|
|
@@ -3092,12 +3136,12 @@ var HeaderBrandTitle = ({
|
|
|
3092
3136
|
children,
|
|
3093
3137
|
sx
|
|
3094
3138
|
}) => {
|
|
3095
|
-
return /* @__PURE__ */
|
|
3139
|
+
return /* @__PURE__ */ jsx28(HeaderBrandTitleRoot, { variant: "h6", component: "div", sx, children });
|
|
3096
3140
|
};
|
|
3097
3141
|
HeaderBrandTitle.displayName = "HeaderBrandTitle";
|
|
3098
3142
|
|
|
3099
3143
|
// src/components/Header/HeaderBrand.tsx
|
|
3100
|
-
import { jsx as
|
|
3144
|
+
import { jsx as jsx29 } from "react/jsx-runtime";
|
|
3101
3145
|
var HeaderBrandRoot = styled18(Box8, {
|
|
3102
3146
|
name: "MuiHeader",
|
|
3103
3147
|
slot: "Brand",
|
|
@@ -3113,7 +3157,7 @@ var HeaderBrand = ({
|
|
|
3113
3157
|
children,
|
|
3114
3158
|
sx
|
|
3115
3159
|
}) => {
|
|
3116
|
-
return /* @__PURE__ */
|
|
3160
|
+
return /* @__PURE__ */ jsx29(HeaderBrandRoot, { onClick, clickable: !!onClick, sx, children });
|
|
3117
3161
|
};
|
|
3118
3162
|
HeaderBrand.displayName = "HeaderBrand";
|
|
3119
3163
|
|
|
@@ -3121,7 +3165,7 @@ HeaderBrand.displayName = "HeaderBrand";
|
|
|
3121
3165
|
import Box9 from "@mui/material/Box";
|
|
3122
3166
|
import Divider2 from "@mui/material/Divider";
|
|
3123
3167
|
import { styled as styled19 } from "@mui/material/styles";
|
|
3124
|
-
import { jsx as
|
|
3168
|
+
import { jsx as jsx30, jsxs as jsxs9 } from "react/jsx-runtime";
|
|
3125
3169
|
var HeaderSwitchersRoot = styled19(Box9, {
|
|
3126
3170
|
name: "MuiHeader",
|
|
3127
3171
|
slot: "Switchers"
|
|
@@ -3151,7 +3195,7 @@ var HeaderSwitchers = ({
|
|
|
3151
3195
|
return null;
|
|
3152
3196
|
}
|
|
3153
3197
|
return /* @__PURE__ */ jsxs9(HeaderSwitchersRoot, { sx, children: [
|
|
3154
|
-
showDivider && /* @__PURE__ */
|
|
3198
|
+
showDivider && /* @__PURE__ */ jsx30(HeaderSwitchersDivider, { orientation: "vertical", flexItem: true }),
|
|
3155
3199
|
children
|
|
3156
3200
|
] });
|
|
3157
3201
|
};
|
|
@@ -3159,7 +3203,7 @@ var HeaderSwitchers = ({
|
|
|
3159
3203
|
// src/components/Header/HeaderActions.tsx
|
|
3160
3204
|
import Box10 from "@mui/material/Box";
|
|
3161
3205
|
import { styled as styled20 } from "@mui/material/styles";
|
|
3162
|
-
import { jsx as
|
|
3206
|
+
import { jsx as jsx31 } from "react/jsx-runtime";
|
|
3163
3207
|
var HeaderActionsRoot = styled20(Box10, {
|
|
3164
3208
|
name: "MuiHeader",
|
|
3165
3209
|
slot: "Actions"
|
|
@@ -3172,11 +3216,11 @@ var HeaderActions = ({
|
|
|
3172
3216
|
children,
|
|
3173
3217
|
sx
|
|
3174
3218
|
}) => {
|
|
3175
|
-
return /* @__PURE__ */
|
|
3219
|
+
return /* @__PURE__ */ jsx31(HeaderActionsRoot, { sx, children });
|
|
3176
3220
|
};
|
|
3177
3221
|
|
|
3178
3222
|
// src/components/Header/Header.tsx
|
|
3179
|
-
import { jsx as
|
|
3223
|
+
import { jsx as jsx32 } from "react/jsx-runtime";
|
|
3180
3224
|
var HeaderRootStyled = styled21(AppBar, {
|
|
3181
3225
|
name: "MuiHeader",
|
|
3182
3226
|
slot: "Root"
|
|
@@ -3209,10 +3253,10 @@ var Header = ({
|
|
|
3209
3253
|
minimal = false,
|
|
3210
3254
|
sx
|
|
3211
3255
|
}) => {
|
|
3212
|
-
const contextValue =
|
|
3213
|
-
return /* @__PURE__ */
|
|
3256
|
+
const contextValue = React9.useMemo(() => ({ minimal }), [minimal]);
|
|
3257
|
+
return /* @__PURE__ */ jsx32(HeaderContext.Provider, { value: contextValue, children: /* @__PURE__ */ jsx32(HeaderRootStyled, { position: "static", color: "default", elevation: 0, sx, children: /* @__PURE__ */ jsx32(HeaderToolbar, { children }) }) });
|
|
3214
3258
|
};
|
|
3215
|
-
var HeaderSpacer = ({ sx }) => /* @__PURE__ */
|
|
3259
|
+
var HeaderSpacer = ({ sx }) => /* @__PURE__ */ jsx32(HeaderSpacerStyled, { sx });
|
|
3216
3260
|
Header.Toggle = HeaderToggle;
|
|
3217
3261
|
Header.Brand = HeaderBrand;
|
|
3218
3262
|
Header.BrandLogo = HeaderBrandLogo;
|
|
@@ -3223,15 +3267,15 @@ Header.Spacer = HeaderSpacer;
|
|
|
3223
3267
|
Header.displayName = "Header";
|
|
3224
3268
|
|
|
3225
3269
|
// src/components/Sidebar/Sidebar.tsx
|
|
3226
|
-
import * as
|
|
3270
|
+
import * as React17 from "react";
|
|
3227
3271
|
import Box17 from "@mui/material/Box";
|
|
3228
3272
|
import { styled as styled34 } from "@mui/material/styles";
|
|
3229
3273
|
|
|
3230
3274
|
// src/components/Sidebar/context.ts
|
|
3231
|
-
import * as
|
|
3232
|
-
var SidebarContext =
|
|
3275
|
+
import * as React10 from "react";
|
|
3276
|
+
var SidebarContext = React10.createContext(null);
|
|
3233
3277
|
var useSidebar = () => {
|
|
3234
|
-
const context =
|
|
3278
|
+
const context = React10.useContext(SidebarContext);
|
|
3235
3279
|
if (!context) {
|
|
3236
3280
|
throw new Error("Sidebar compound components must be used within Sidebar");
|
|
3237
3281
|
}
|
|
@@ -3239,11 +3283,11 @@ var useSidebar = () => {
|
|
|
3239
3283
|
};
|
|
3240
3284
|
|
|
3241
3285
|
// src/components/Sidebar/SidebarNav.tsx
|
|
3242
|
-
import * as
|
|
3286
|
+
import * as React11 from "react";
|
|
3243
3287
|
import Box12 from "@mui/material/Box";
|
|
3244
3288
|
import Divider3 from "@mui/material/Divider";
|
|
3245
3289
|
import { styled as styled22 } from "@mui/material/styles";
|
|
3246
|
-
import { jsx as
|
|
3290
|
+
import { jsx as jsx33, jsxs as jsxs10 } from "react/jsx-runtime";
|
|
3247
3291
|
var SidebarNavRoot = styled22(Box12, {
|
|
3248
3292
|
name: "MuiSidebar",
|
|
3249
3293
|
slot: "Nav"
|
|
@@ -3279,15 +3323,15 @@ var SidebarNav = ({
|
|
|
3279
3323
|
sx
|
|
3280
3324
|
}) => {
|
|
3281
3325
|
const { collapsed } = useSidebar();
|
|
3282
|
-
const childArray =
|
|
3283
|
-
return /* @__PURE__ */
|
|
3284
|
-
index > 0 && showDividers && !collapsed && /* @__PURE__ */
|
|
3326
|
+
const childArray = React11.Children.toArray(children);
|
|
3327
|
+
return /* @__PURE__ */ jsx33(SidebarNavRoot, { component: "nav", sx, children: childArray.map((child, index) => /* @__PURE__ */ jsxs10(React11.Fragment, { children: [
|
|
3328
|
+
index > 0 && showDividers && !collapsed && /* @__PURE__ */ jsx33(SidebarNavDivider, {}),
|
|
3285
3329
|
child
|
|
3286
3330
|
] }, index)) });
|
|
3287
3331
|
};
|
|
3288
3332
|
|
|
3289
3333
|
// src/components/Sidebar/SidebarCategory.tsx
|
|
3290
|
-
import * as
|
|
3334
|
+
import * as React12 from "react";
|
|
3291
3335
|
import Box13 from "@mui/material/Box";
|
|
3292
3336
|
import List from "@mui/material/List";
|
|
3293
3337
|
import { styled as styled24 } from "@mui/material/styles";
|
|
@@ -3295,7 +3339,7 @@ import { styled as styled24 } from "@mui/material/styles";
|
|
|
3295
3339
|
// src/components/Sidebar/SidebarCategoryLabel.tsx
|
|
3296
3340
|
import Typography7 from "@mui/material/Typography";
|
|
3297
3341
|
import { styled as styled23 } from "@mui/material/styles";
|
|
3298
|
-
import { jsx as
|
|
3342
|
+
import { jsx as jsx34 } from "react/jsx-runtime";
|
|
3299
3343
|
var SidebarCategoryLabelRoot = styled23(Typography7, {
|
|
3300
3344
|
name: "MuiSidebar",
|
|
3301
3345
|
slot: "CategoryLabel",
|
|
@@ -3321,12 +3365,12 @@ var SidebarCategoryLabelRoot = styled23(Typography7, {
|
|
|
3321
3365
|
}));
|
|
3322
3366
|
var SidebarCategoryLabel = ({ children, sx }) => {
|
|
3323
3367
|
const { collapsed } = useSidebar();
|
|
3324
|
-
return /* @__PURE__ */
|
|
3368
|
+
return /* @__PURE__ */ jsx34(SidebarCategoryLabelRoot, { variant: "caption", collapsed, sx, children });
|
|
3325
3369
|
};
|
|
3326
3370
|
SidebarCategoryLabel.displayName = "SidebarCategoryLabel";
|
|
3327
3371
|
|
|
3328
3372
|
// src/components/Sidebar/SidebarCategory.tsx
|
|
3329
|
-
import { jsx as
|
|
3373
|
+
import { jsx as jsx35, jsxs as jsxs11 } from "react/jsx-runtime";
|
|
3330
3374
|
var SidebarCategoryRoot = styled24(Box13, {
|
|
3331
3375
|
name: "MuiSidebar",
|
|
3332
3376
|
slot: "Category"
|
|
@@ -3336,9 +3380,9 @@ var SidebarCategoryRoot = styled24(Box13, {
|
|
|
3336
3380
|
var separateChildren = (children) => {
|
|
3337
3381
|
let labelChild = null;
|
|
3338
3382
|
const otherChildren = [];
|
|
3339
|
-
|
|
3383
|
+
React12.Children.forEach(children, (child) => {
|
|
3340
3384
|
var _a;
|
|
3341
|
-
if (
|
|
3385
|
+
if (React12.isValidElement(child)) {
|
|
3342
3386
|
const displayName = (_a = child.type) == null ? void 0 : _a.displayName;
|
|
3343
3387
|
if (displayName === "SidebarCategoryLabel") {
|
|
3344
3388
|
labelChild = child;
|
|
@@ -3358,13 +3402,13 @@ var SidebarCategory = ({
|
|
|
3358
3402
|
const { labelChild, otherChildren } = separateChildren(children);
|
|
3359
3403
|
return /* @__PURE__ */ jsxs11(SidebarCategoryRoot, { sx, children: [
|
|
3360
3404
|
labelChild,
|
|
3361
|
-
/* @__PURE__ */
|
|
3405
|
+
/* @__PURE__ */ jsx35(List, { disablePadding: true, children: otherChildren })
|
|
3362
3406
|
] });
|
|
3363
3407
|
};
|
|
3364
3408
|
SidebarCategory.displayName = "SidebarCategory";
|
|
3365
3409
|
|
|
3366
3410
|
// src/components/Sidebar/SidebarItem.tsx
|
|
3367
|
-
import * as
|
|
3411
|
+
import * as React15 from "react";
|
|
3368
3412
|
import Box14 from "@mui/material/Box";
|
|
3369
3413
|
import List2 from "@mui/material/List";
|
|
3370
3414
|
import ListItem from "@mui/material/ListItem";
|
|
@@ -3378,11 +3422,11 @@ import { styled as styled28 } from "@mui/material/styles";
|
|
|
3378
3422
|
import { ChevronDown as ChevronDown2, ChevronUp } from "@wso2/oxygen-ui-icons-react";
|
|
3379
3423
|
|
|
3380
3424
|
// src/components/Sidebar/SidebarItemContext.tsx
|
|
3381
|
-
import * as
|
|
3382
|
-
import { jsx as
|
|
3383
|
-
var SidebarItemContext =
|
|
3425
|
+
import * as React13 from "react";
|
|
3426
|
+
import { jsx as jsx36 } from "react/jsx-runtime";
|
|
3427
|
+
var SidebarItemContext = React13.createContext(null);
|
|
3384
3428
|
var useSidebarItemContext = () => {
|
|
3385
|
-
const context =
|
|
3429
|
+
const context = React13.useContext(SidebarItemContext);
|
|
3386
3430
|
if (!context) {
|
|
3387
3431
|
throw new Error(
|
|
3388
3432
|
"useSidebarItemContext must be used within a SidebarItem component"
|
|
@@ -3391,13 +3435,14 @@ var useSidebarItemContext = () => {
|
|
|
3391
3435
|
return context;
|
|
3392
3436
|
};
|
|
3393
3437
|
var SidebarItemProvider = ({ value, children }) => {
|
|
3394
|
-
return /* @__PURE__ */
|
|
3438
|
+
return /* @__PURE__ */ jsx36(SidebarItemContext.Provider, { value, children });
|
|
3395
3439
|
};
|
|
3396
3440
|
|
|
3397
3441
|
// src/components/Sidebar/SidebarItemIcon.tsx
|
|
3442
|
+
import * as React14 from "react";
|
|
3398
3443
|
import ListItemIcon from "@mui/material/ListItemIcon";
|
|
3399
3444
|
import { styled as styled25 } from "@mui/material/styles";
|
|
3400
|
-
import { jsx as
|
|
3445
|
+
import { jsx as jsx37 } from "react/jsx-runtime";
|
|
3401
3446
|
var SidebarItemIconRoot = styled25(ListItemIcon, {
|
|
3402
3447
|
name: "MuiSidebar",
|
|
3403
3448
|
slot: "ItemIcon",
|
|
@@ -3412,14 +3457,18 @@ var SidebarItemIcon = ({
|
|
|
3412
3457
|
children,
|
|
3413
3458
|
sx
|
|
3414
3459
|
}) => {
|
|
3460
|
+
var _a;
|
|
3415
3461
|
const { collapsed } = useSidebar();
|
|
3416
3462
|
const { isActive } = useSidebarItemContext();
|
|
3417
|
-
|
|
3463
|
+
const iconWithSize = React14.isValidElement(children) ? React14.cloneElement(children, __spreadProps(__spreadValues({}, children.props), {
|
|
3464
|
+
size: (_a = children.props.size) != null ? _a : 20
|
|
3465
|
+
})) : children;
|
|
3466
|
+
return /* @__PURE__ */ jsx37(
|
|
3418
3467
|
SidebarItemIconRoot,
|
|
3419
3468
|
{
|
|
3420
3469
|
ownerState: { collapsed, isActive },
|
|
3421
3470
|
sx,
|
|
3422
|
-
children
|
|
3471
|
+
children: iconWithSize
|
|
3423
3472
|
}
|
|
3424
3473
|
);
|
|
3425
3474
|
};
|
|
@@ -3428,7 +3477,7 @@ SidebarItemIcon.displayName = "SidebarItemIcon";
|
|
|
3428
3477
|
// src/components/Sidebar/SidebarItemLabel.tsx
|
|
3429
3478
|
import ListItemText from "@mui/material/ListItemText";
|
|
3430
3479
|
import { styled as styled26 } from "@mui/material/styles";
|
|
3431
|
-
import { jsx as
|
|
3480
|
+
import { jsx as jsx38 } from "react/jsx-runtime";
|
|
3432
3481
|
var SidebarItemLabelRoot = styled26(ListItemText, {
|
|
3433
3482
|
name: "MuiSidebar",
|
|
3434
3483
|
slot: "ItemLabel",
|
|
@@ -3454,14 +3503,14 @@ var SidebarItemLabel = ({
|
|
|
3454
3503
|
}) => {
|
|
3455
3504
|
const { collapsed } = useSidebar();
|
|
3456
3505
|
const { isActive } = useSidebarItemContext();
|
|
3457
|
-
return /* @__PURE__ */
|
|
3506
|
+
return /* @__PURE__ */ jsx38(SidebarItemLabelRoot, { primary: children, ownerState: { isActive, collapsed }, sx });
|
|
3458
3507
|
};
|
|
3459
3508
|
SidebarItemLabel.displayName = "SidebarItemLabel";
|
|
3460
3509
|
|
|
3461
3510
|
// src/components/Sidebar/SidebarItemBadge.tsx
|
|
3462
3511
|
import Chip from "@mui/material/Chip";
|
|
3463
3512
|
import { styled as styled27 } from "@mui/material/styles";
|
|
3464
|
-
import { jsx as
|
|
3513
|
+
import { jsx as jsx39 } from "react/jsx-runtime";
|
|
3465
3514
|
var SidebarItemBadgeRoot = styled27(Chip, {
|
|
3466
3515
|
name: "MuiSidebar",
|
|
3467
3516
|
slot: "ItemBadge"
|
|
@@ -3479,12 +3528,12 @@ var SidebarItemBadge = ({
|
|
|
3479
3528
|
if (collapsed) {
|
|
3480
3529
|
return null;
|
|
3481
3530
|
}
|
|
3482
|
-
return /* @__PURE__ */
|
|
3531
|
+
return /* @__PURE__ */ jsx39(SidebarItemBadgeRoot, { label: children, size: "small", color, sx });
|
|
3483
3532
|
};
|
|
3484
3533
|
SidebarItemBadge.displayName = "SidebarItemBadge";
|
|
3485
3534
|
|
|
3486
3535
|
// src/components/Sidebar/SidebarItem.tsx
|
|
3487
|
-
import { Fragment as Fragment5, jsx as
|
|
3536
|
+
import { Fragment as Fragment5, jsx as jsx40, jsxs as jsxs12 } from "react/jsx-runtime";
|
|
3488
3537
|
var SidebarItemRoot = styled28(ListItem, {
|
|
3489
3538
|
name: "MuiSidebar",
|
|
3490
3539
|
slot: "Item"
|
|
@@ -3504,6 +3553,7 @@ var SidebarItemButton = styled28(ListItemButton, {
|
|
|
3504
3553
|
borderRadius: theme.shape.borderRadius,
|
|
3505
3554
|
marginLeft: theme.spacing(1),
|
|
3506
3555
|
marginRight: theme.spacing(1),
|
|
3556
|
+
color: (theme.vars || theme).palette.text.primary,
|
|
3507
3557
|
transition: theme.transitions.create(["padding-left", "padding-right"], {
|
|
3508
3558
|
easing: theme.transitions.easing.sharp,
|
|
3509
3559
|
duration: ownerState.collapsed ? theme.transitions.duration.leavingScreen : theme.transitions.duration.enteringScreen
|
|
@@ -3561,9 +3611,9 @@ var CHILD_DISPLAY_NAMES = [
|
|
|
3561
3611
|
var separateChildren2 = (children) => {
|
|
3562
3612
|
const composableChildren = [];
|
|
3563
3613
|
const nestedItems = [];
|
|
3564
|
-
|
|
3614
|
+
React15.Children.toArray(children).forEach((child) => {
|
|
3565
3615
|
var _a;
|
|
3566
|
-
if (
|
|
3616
|
+
if (React15.isValidElement(child)) {
|
|
3567
3617
|
const displayName = (_a = child.type) == null ? void 0 : _a.displayName;
|
|
3568
3618
|
if (displayName && CHILD_DISPLAY_NAMES.includes(displayName)) {
|
|
3569
3619
|
composableChildren.push(child);
|
|
@@ -3578,9 +3628,9 @@ var separateChildren2 = (children) => {
|
|
|
3578
3628
|
};
|
|
3579
3629
|
var getTooltipLabel = (children) => {
|
|
3580
3630
|
let tooltipLabel = "";
|
|
3581
|
-
|
|
3631
|
+
React15.Children.forEach(children, (child) => {
|
|
3582
3632
|
var _a;
|
|
3583
|
-
if (
|
|
3633
|
+
if (React15.isValidElement(child)) {
|
|
3584
3634
|
const displayName = (_a = child.type) == null ? void 0 : _a.displayName;
|
|
3585
3635
|
const props = child.props;
|
|
3586
3636
|
if (displayName === "SidebarItemLabel" && props.children) {
|
|
@@ -3593,9 +3643,9 @@ var getTooltipLabel = (children) => {
|
|
|
3593
3643
|
var extractItemContent = (itemChildren) => {
|
|
3594
3644
|
let icon = null;
|
|
3595
3645
|
let label = "";
|
|
3596
|
-
|
|
3646
|
+
React15.Children.forEach(itemChildren, (child) => {
|
|
3597
3647
|
var _a;
|
|
3598
|
-
if (
|
|
3648
|
+
if (React15.isValidElement(child)) {
|
|
3599
3649
|
const displayName = (_a = child.type) == null ? void 0 : _a.displayName;
|
|
3600
3650
|
const props = child.props;
|
|
3601
3651
|
if (displayName === "SidebarItemIcon") {
|
|
@@ -3611,23 +3661,24 @@ var SidebarItem = ({
|
|
|
3611
3661
|
id,
|
|
3612
3662
|
children,
|
|
3613
3663
|
depth = 0,
|
|
3614
|
-
sx
|
|
3664
|
+
sx,
|
|
3665
|
+
link
|
|
3615
3666
|
}) => {
|
|
3616
3667
|
const { collapsed, activeItem, expandedMenus, onSelect, onToggleExpand } = useSidebar();
|
|
3617
3668
|
const { composableChildren, nestedItems } = separateChildren2(children);
|
|
3618
3669
|
const hasNestedItems = nestedItems.length > 0;
|
|
3619
3670
|
const isActive = activeItem === id;
|
|
3620
3671
|
const isExpanded = expandedMenus[id] || false;
|
|
3621
|
-
const hasActiveChild =
|
|
3672
|
+
const hasActiveChild = React15.useMemo(() => {
|
|
3622
3673
|
if (!hasNestedItems || !activeItem) return false;
|
|
3623
3674
|
return nestedItems.some((child) => {
|
|
3624
|
-
if (
|
|
3675
|
+
if (React15.isValidElement(child)) {
|
|
3625
3676
|
return child.props.id === activeItem;
|
|
3626
3677
|
}
|
|
3627
3678
|
return false;
|
|
3628
3679
|
});
|
|
3629
3680
|
}, [hasNestedItems, nestedItems, activeItem]);
|
|
3630
|
-
const [popoverAnchor, setPopoverAnchor] =
|
|
3681
|
+
const [popoverAnchor, setPopoverAnchor] = React15.useState(null);
|
|
3631
3682
|
const popoverOpen = Boolean(popoverAnchor);
|
|
3632
3683
|
const contextValue = {
|
|
3633
3684
|
id,
|
|
@@ -3654,7 +3705,7 @@ var SidebarItem = ({
|
|
|
3654
3705
|
const tooltipLabel = getTooltipLabel(children);
|
|
3655
3706
|
const ownerState = { collapsed, depth };
|
|
3656
3707
|
const shouldShowSelected = isActive && !hasNestedItems || collapsed && hasActiveChild;
|
|
3657
|
-
const buttonContent = /* @__PURE__ */
|
|
3708
|
+
const buttonContent = /* @__PURE__ */ jsx40(
|
|
3658
3709
|
SidebarItemButton,
|
|
3659
3710
|
{
|
|
3660
3711
|
selected: shouldShowSelected,
|
|
@@ -3663,18 +3714,19 @@ var SidebarItem = ({
|
|
|
3663
3714
|
sx,
|
|
3664
3715
|
children: /* @__PURE__ */ jsxs12(SidebarItemProvider, { value: contextValue, children: [
|
|
3665
3716
|
composableChildren,
|
|
3666
|
-
!collapsed && hasNestedItems && /* @__PURE__ */
|
|
3667
|
-
!collapsed && !hasNestedItems && /* @__PURE__ */
|
|
3717
|
+
!collapsed && hasNestedItems && /* @__PURE__ */ jsx40(SidebarItemChevron, { children: isExpanded ? /* @__PURE__ */ jsx40(ChevronUp, { size: 16 }) : /* @__PURE__ */ jsx40(ChevronDown2, { size: 16 }) }),
|
|
3718
|
+
!collapsed && !hasNestedItems && /* @__PURE__ */ jsx40(Box14, { sx: { ml: "auto", width: 16, pl: 1 } })
|
|
3668
3719
|
] })
|
|
3669
3720
|
}
|
|
3670
3721
|
);
|
|
3722
|
+
const wrappedContent = link ? /* @__PURE__ */ jsx40(Fragment5, { children: React15.cloneElement(link, {}, buttonContent) }) : buttonContent;
|
|
3671
3723
|
const collapsedWithNested = collapsed && hasNestedItems;
|
|
3672
3724
|
const handlePopoverItemClick = (itemId) => {
|
|
3673
3725
|
onSelect == null ? void 0 : onSelect(itemId);
|
|
3674
3726
|
setPopoverAnchor(null);
|
|
3675
3727
|
};
|
|
3676
3728
|
return /* @__PURE__ */ jsxs12(Fragment5, { children: [
|
|
3677
|
-
/* @__PURE__ */
|
|
3729
|
+
/* @__PURE__ */ jsx40(
|
|
3678
3730
|
SidebarItemRoot,
|
|
3679
3731
|
{
|
|
3680
3732
|
disablePadding: true,
|
|
@@ -3682,11 +3734,11 @@ var SidebarItem = ({
|
|
|
3682
3734
|
onMouseLeave: handleMouseLeave,
|
|
3683
3735
|
children: collapsed ? (
|
|
3684
3736
|
// When collapsed: show tooltip only for items without nested children
|
|
3685
|
-
collapsedWithNested ?
|
|
3686
|
-
) :
|
|
3737
|
+
collapsedWithNested ? wrappedContent : /* @__PURE__ */ jsx40(Tooltip3, { title: tooltipLabel, placement: "right", arrow: true, children: wrappedContent })
|
|
3738
|
+
) : wrappedContent
|
|
3687
3739
|
}
|
|
3688
3740
|
),
|
|
3689
|
-
collapsedWithNested && /* @__PURE__ */
|
|
3741
|
+
collapsedWithNested && /* @__PURE__ */ jsx40(
|
|
3690
3742
|
SidebarItemPopover,
|
|
3691
3743
|
{
|
|
3692
3744
|
open: popoverOpen,
|
|
@@ -3701,8 +3753,8 @@ var SidebarItem = ({
|
|
|
3701
3753
|
onMouseLeave: handleMouseLeave
|
|
3702
3754
|
}
|
|
3703
3755
|
},
|
|
3704
|
-
children: /* @__PURE__ */
|
|
3705
|
-
if (
|
|
3756
|
+
children: /* @__PURE__ */ jsx40(SidebarItemPopoverList, { disablePadding: true, children: nestedItems.map((child, index) => {
|
|
3757
|
+
if (React15.isValidElement(child)) {
|
|
3706
3758
|
const childProps = child.props;
|
|
3707
3759
|
const { icon, label } = extractItemContent(childProps.children);
|
|
3708
3760
|
const isItemActive = activeItem === childProps.id;
|
|
@@ -3712,8 +3764,8 @@ var SidebarItem = ({
|
|
|
3712
3764
|
selected: isItemActive,
|
|
3713
3765
|
onClick: () => handlePopoverItemClick(childProps.id),
|
|
3714
3766
|
children: [
|
|
3715
|
-
icon && /* @__PURE__ */
|
|
3716
|
-
/* @__PURE__ */
|
|
3767
|
+
icon && /* @__PURE__ */ jsx40(ListItemIcon2, { sx: { minWidth: "auto" }, children: icon }),
|
|
3768
|
+
/* @__PURE__ */ jsx40(ListItemText2, { primary: label })
|
|
3717
3769
|
]
|
|
3718
3770
|
},
|
|
3719
3771
|
childProps.id || index
|
|
@@ -3723,9 +3775,9 @@ var SidebarItem = ({
|
|
|
3723
3775
|
}) })
|
|
3724
3776
|
}
|
|
3725
3777
|
),
|
|
3726
|
-
hasNestedItems && !collapsed && /* @__PURE__ */
|
|
3727
|
-
if (
|
|
3728
|
-
return
|
|
3778
|
+
hasNestedItems && !collapsed && /* @__PURE__ */ jsx40(Collapse, { in: isExpanded, timeout: "auto", unmountOnExit: true, children: /* @__PURE__ */ jsx40(List2, { disablePadding: true, children: nestedItems.map((child, index) => {
|
|
3779
|
+
if (React15.isValidElement(child)) {
|
|
3780
|
+
return React15.cloneElement(child, {
|
|
3729
3781
|
key: child.key || index,
|
|
3730
3782
|
depth: depth + 1
|
|
3731
3783
|
});
|
|
@@ -3740,7 +3792,7 @@ SidebarItem.displayName = "SidebarItem";
|
|
|
3740
3792
|
import Box15 from "@mui/material/Box";
|
|
3741
3793
|
import Divider4 from "@mui/material/Divider";
|
|
3742
3794
|
import { styled as styled29 } from "@mui/material/styles";
|
|
3743
|
-
import { Fragment as Fragment6, jsx as
|
|
3795
|
+
import { Fragment as Fragment6, jsx as jsx41, jsxs as jsxs13 } from "react/jsx-runtime";
|
|
3744
3796
|
var SidebarFooterRoot = styled29(Box15, {
|
|
3745
3797
|
name: "MuiSidebar",
|
|
3746
3798
|
slot: "Footer"
|
|
@@ -3754,13 +3806,13 @@ var SidebarFooter = ({
|
|
|
3754
3806
|
sx
|
|
3755
3807
|
}) => {
|
|
3756
3808
|
return /* @__PURE__ */ jsxs13(Fragment6, { children: [
|
|
3757
|
-
showDivider && /* @__PURE__ */
|
|
3758
|
-
/* @__PURE__ */
|
|
3809
|
+
showDivider && /* @__PURE__ */ jsx41(Divider4, {}),
|
|
3810
|
+
/* @__PURE__ */ jsx41(SidebarFooterRoot, { sx, children })
|
|
3759
3811
|
] });
|
|
3760
3812
|
};
|
|
3761
3813
|
|
|
3762
3814
|
// src/components/Sidebar/SidebarUser.tsx
|
|
3763
|
-
import * as
|
|
3815
|
+
import * as React16 from "react";
|
|
3764
3816
|
import Box16 from "@mui/material/Box";
|
|
3765
3817
|
import ListItemButton2 from "@mui/material/ListItemButton";
|
|
3766
3818
|
import Tooltip4 from "@mui/material/Tooltip";
|
|
@@ -3770,7 +3822,7 @@ import { styled as styled33 } from "@mui/material/styles";
|
|
|
3770
3822
|
// src/components/Sidebar/SidebarUserAvatar.tsx
|
|
3771
3823
|
import Avatar2 from "@mui/material/Avatar";
|
|
3772
3824
|
import { styled as styled30 } from "@mui/material/styles";
|
|
3773
|
-
import { jsx as
|
|
3825
|
+
import { jsx as jsx42 } from "react/jsx-runtime";
|
|
3774
3826
|
var SidebarUserAvatarRoot = styled30(Avatar2, {
|
|
3775
3827
|
name: "MuiSidebar",
|
|
3776
3828
|
slot: "UserAvatar"
|
|
@@ -3787,14 +3839,14 @@ var SidebarUserAvatar = ({
|
|
|
3787
3839
|
alt,
|
|
3788
3840
|
sx
|
|
3789
3841
|
}) => {
|
|
3790
|
-
return /* @__PURE__ */
|
|
3842
|
+
return /* @__PURE__ */ jsx42(SidebarUserAvatarRoot, { src, alt, sx, children });
|
|
3791
3843
|
};
|
|
3792
3844
|
SidebarUserAvatar.displayName = "SidebarUserAvatar";
|
|
3793
3845
|
|
|
3794
3846
|
// src/components/Sidebar/SidebarUserName.tsx
|
|
3795
3847
|
import Typography8 from "@mui/material/Typography";
|
|
3796
3848
|
import { styled as styled31 } from "@mui/material/styles";
|
|
3797
|
-
import { jsx as
|
|
3849
|
+
import { jsx as jsx43 } from "react/jsx-runtime";
|
|
3798
3850
|
var SidebarUserNameRoot = styled31(Typography8, {
|
|
3799
3851
|
name: "MuiSidebar",
|
|
3800
3852
|
slot: "UserName"
|
|
@@ -3812,14 +3864,14 @@ var SidebarUserName = ({
|
|
|
3812
3864
|
if (collapsed) {
|
|
3813
3865
|
return null;
|
|
3814
3866
|
}
|
|
3815
|
-
return /* @__PURE__ */
|
|
3867
|
+
return /* @__PURE__ */ jsx43(SidebarUserNameRoot, { variant: "body2", sx, children });
|
|
3816
3868
|
};
|
|
3817
3869
|
SidebarUserName.displayName = "SidebarUserName";
|
|
3818
3870
|
|
|
3819
3871
|
// src/components/Sidebar/SidebarUserEmail.tsx
|
|
3820
3872
|
import Typography9 from "@mui/material/Typography";
|
|
3821
3873
|
import { styled as styled32 } from "@mui/material/styles";
|
|
3822
|
-
import { jsx as
|
|
3874
|
+
import { jsx as jsx44 } from "react/jsx-runtime";
|
|
3823
3875
|
var SidebarUserEmailRoot = styled32(Typography9, {
|
|
3824
3876
|
name: "MuiSidebar",
|
|
3825
3877
|
slot: "UserEmail"
|
|
@@ -3838,12 +3890,12 @@ var SidebarUserEmail = ({
|
|
|
3838
3890
|
if (collapsed) {
|
|
3839
3891
|
return null;
|
|
3840
3892
|
}
|
|
3841
|
-
return /* @__PURE__ */
|
|
3893
|
+
return /* @__PURE__ */ jsx44(SidebarUserEmailRoot, { variant: "caption", sx, children });
|
|
3842
3894
|
};
|
|
3843
3895
|
SidebarUserEmail.displayName = "SidebarUserEmail";
|
|
3844
3896
|
|
|
3845
3897
|
// src/components/Sidebar/SidebarUser.tsx
|
|
3846
|
-
import { Fragment as Fragment7, jsx as
|
|
3898
|
+
import { Fragment as Fragment7, jsx as jsx45, jsxs as jsxs14 } from "react/jsx-runtime";
|
|
3847
3899
|
var SidebarUserRoot = styled33(Box16, {
|
|
3848
3900
|
name: "MuiSidebar",
|
|
3849
3901
|
slot: "User"
|
|
@@ -3885,9 +3937,9 @@ var SidebarUserTextContainer = styled33(Box16, {
|
|
|
3885
3937
|
var separateChildren3 = (children) => {
|
|
3886
3938
|
let avatarChild = null;
|
|
3887
3939
|
const textChildren = [];
|
|
3888
|
-
|
|
3940
|
+
React16.Children.forEach(children, (child) => {
|
|
3889
3941
|
var _a;
|
|
3890
|
-
if (
|
|
3942
|
+
if (React16.isValidElement(child)) {
|
|
3891
3943
|
const displayName = (_a = child.type) == null ? void 0 : _a.displayName;
|
|
3892
3944
|
if (displayName === "SidebarUserAvatar") {
|
|
3893
3945
|
avatarChild = child;
|
|
@@ -3900,9 +3952,9 @@ var separateChildren3 = (children) => {
|
|
|
3900
3952
|
};
|
|
3901
3953
|
var getTooltipText = (children) => {
|
|
3902
3954
|
let tooltipText = "";
|
|
3903
|
-
|
|
3955
|
+
React16.Children.forEach(children, (child) => {
|
|
3904
3956
|
var _a;
|
|
3905
|
-
if (
|
|
3957
|
+
if (React16.isValidElement(child)) {
|
|
3906
3958
|
const displayName = (_a = child.type) == null ? void 0 : _a.displayName;
|
|
3907
3959
|
const props = child.props;
|
|
3908
3960
|
if (displayName === "SidebarUserName" && props.children) {
|
|
@@ -3924,17 +3976,17 @@ var SidebarUser = ({
|
|
|
3924
3976
|
const ownerState = { collapsed };
|
|
3925
3977
|
const content = /* @__PURE__ */ jsxs14(SidebarUserButton, { onClick, ownerState, children: [
|
|
3926
3978
|
avatarChild,
|
|
3927
|
-
/* @__PURE__ */
|
|
3979
|
+
/* @__PURE__ */ jsx45(SidebarUserTextContainer, { collapsed, children: textChildren })
|
|
3928
3980
|
] });
|
|
3929
3981
|
return /* @__PURE__ */ jsxs14(Fragment7, { children: [
|
|
3930
|
-
showDivider && /* @__PURE__ */
|
|
3931
|
-
/* @__PURE__ */
|
|
3982
|
+
showDivider && /* @__PURE__ */ jsx45(Divider5, {}),
|
|
3983
|
+
/* @__PURE__ */ jsx45(SidebarUserRoot, { sx, children: collapsed ? /* @__PURE__ */ jsx45(Tooltip4, { title: tooltipText, placement: "right", arrow: true, children: content }) : content })
|
|
3932
3984
|
] });
|
|
3933
3985
|
};
|
|
3934
3986
|
SidebarUser.displayName = "SidebarUser";
|
|
3935
3987
|
|
|
3936
3988
|
// src/components/Sidebar/Sidebar.tsx
|
|
3937
|
-
import { jsx as
|
|
3989
|
+
import { jsx as jsx46 } from "react/jsx-runtime";
|
|
3938
3990
|
var SIDEBAR_WIDTH = 250;
|
|
3939
3991
|
var COLLAPSED_SIDEBAR_WIDTH = 64;
|
|
3940
3992
|
var SidebarRootStyled = styled34(Box17, {
|
|
@@ -3961,17 +4013,32 @@ var SidebarRootStyled = styled34(Box17, {
|
|
|
3961
4013
|
}
|
|
3962
4014
|
}));
|
|
3963
4015
|
var Sidebar = ({
|
|
3964
|
-
collapsed
|
|
3965
|
-
activeItem,
|
|
3966
|
-
expandedMenus
|
|
3967
|
-
onSelect,
|
|
3968
|
-
onToggleExpand,
|
|
4016
|
+
collapsed: collapsedProp,
|
|
4017
|
+
activeItem: activeItemProp,
|
|
4018
|
+
expandedMenus: expandedMenusProp,
|
|
4019
|
+
onSelect: onSelectProp,
|
|
4020
|
+
onToggleExpand: onToggleExpandProp,
|
|
3969
4021
|
children,
|
|
3970
|
-
width
|
|
3971
|
-
collapsedWidth
|
|
4022
|
+
width: widthProp,
|
|
4023
|
+
collapsedWidth: collapsedWidthProp,
|
|
3972
4024
|
sx
|
|
3973
4025
|
}) => {
|
|
3974
|
-
|
|
4026
|
+
var _a, _b, _c;
|
|
4027
|
+
const appShellContext = React17.useContext(AppShellContext);
|
|
4028
|
+
const collapsed = (_a = collapsedProp != null ? collapsedProp : appShellContext == null ? void 0 : appShellContext.state.sidebarCollapsed) != null ? _a : false;
|
|
4029
|
+
const activeItem = activeItemProp != null ? activeItemProp : appShellContext == null ? void 0 : appShellContext.state.activeMenuItem;
|
|
4030
|
+
const expandedMenus = React17.useMemo(
|
|
4031
|
+
() => {
|
|
4032
|
+
var _a2;
|
|
4033
|
+
return (_a2 = expandedMenusProp != null ? expandedMenusProp : appShellContext == null ? void 0 : appShellContext.state.expandedMenus) != null ? _a2 : {};
|
|
4034
|
+
},
|
|
4035
|
+
[expandedMenusProp, appShellContext == null ? void 0 : appShellContext.state.expandedMenus]
|
|
4036
|
+
);
|
|
4037
|
+
const onSelect = onSelectProp != null ? onSelectProp : appShellContext == null ? void 0 : appShellContext.actions.setActiveMenuItem;
|
|
4038
|
+
const onToggleExpand = onToggleExpandProp != null ? onToggleExpandProp : appShellContext == null ? void 0 : appShellContext.actions.toggleMenu;
|
|
4039
|
+
const width = (_b = widthProp != null ? widthProp : appShellContext == null ? void 0 : appShellContext.state.sidebarWidth) != null ? _b : SIDEBAR_WIDTH;
|
|
4040
|
+
const collapsedWidth = (_c = collapsedWidthProp != null ? collapsedWidthProp : appShellContext == null ? void 0 : appShellContext.state.sidebarCollapsedWidth) != null ? _c : COLLAPSED_SIDEBAR_WIDTH;
|
|
4041
|
+
const contextValue = React17.useMemo(
|
|
3975
4042
|
() => ({
|
|
3976
4043
|
collapsed,
|
|
3977
4044
|
activeItem,
|
|
@@ -3982,7 +4049,7 @@ var Sidebar = ({
|
|
|
3982
4049
|
[collapsed, activeItem, expandedMenus, onSelect, onToggleExpand]
|
|
3983
4050
|
);
|
|
3984
4051
|
const ownerState = { collapsed, width, collapsedWidth };
|
|
3985
|
-
return /* @__PURE__ */
|
|
4052
|
+
return /* @__PURE__ */ jsx46(SidebarContext.Provider, { value: contextValue, children: /* @__PURE__ */ jsx46(SidebarRootStyled, { component: "aside", ownerState, sx, children }) });
|
|
3986
4053
|
};
|
|
3987
4054
|
Sidebar.Nav = SidebarNav;
|
|
3988
4055
|
Sidebar.Category = SidebarCategory;
|
|
@@ -3999,15 +4066,15 @@ Sidebar.UserEmail = SidebarUserEmail;
|
|
|
3999
4066
|
Sidebar.displayName = "Sidebar";
|
|
4000
4067
|
|
|
4001
4068
|
// src/components/NotificationPanel/NotificationPanel.tsx
|
|
4002
|
-
import * as
|
|
4069
|
+
import * as React23 from "react";
|
|
4003
4070
|
import Drawer from "@mui/material/Drawer";
|
|
4004
4071
|
import { styled as styled50 } from "@mui/material/styles";
|
|
4005
4072
|
|
|
4006
4073
|
// src/components/NotificationPanel/context.ts
|
|
4007
|
-
import * as
|
|
4008
|
-
var NotificationPanelContext =
|
|
4074
|
+
import * as React18 from "react";
|
|
4075
|
+
var NotificationPanelContext = React18.createContext(null);
|
|
4009
4076
|
var useNotificationPanel = () => {
|
|
4010
|
-
const context =
|
|
4077
|
+
const context = React18.useContext(NotificationPanelContext);
|
|
4011
4078
|
if (!context) {
|
|
4012
4079
|
throw new Error(
|
|
4013
4080
|
"NotificationPanel compound components must be used within NotificationPanel"
|
|
@@ -4017,10 +4084,10 @@ var useNotificationPanel = () => {
|
|
|
4017
4084
|
};
|
|
4018
4085
|
|
|
4019
4086
|
// src/components/NotificationPanel/NotificationHeader.tsx
|
|
4020
|
-
import * as
|
|
4087
|
+
import * as React19 from "react";
|
|
4021
4088
|
import Box18 from "@mui/material/Box";
|
|
4022
4089
|
import { styled as styled35 } from "@mui/material/styles";
|
|
4023
|
-
import { jsx as
|
|
4090
|
+
import { jsx as jsx47, jsxs as jsxs15 } from "react/jsx-runtime";
|
|
4024
4091
|
var NotificationHeaderRoot = styled35(Box18, {
|
|
4025
4092
|
name: "MuiNotificationPanel",
|
|
4026
4093
|
slot: "Header"
|
|
@@ -4042,9 +4109,9 @@ var NotificationHeaderContent = styled35(Box18, {
|
|
|
4042
4109
|
var separateChildren4 = (children) => {
|
|
4043
4110
|
const leftChildren = [];
|
|
4044
4111
|
let closeChild = null;
|
|
4045
|
-
|
|
4112
|
+
React19.Children.forEach(children, (child) => {
|
|
4046
4113
|
var _a;
|
|
4047
|
-
if (
|
|
4114
|
+
if (React19.isValidElement(child)) {
|
|
4048
4115
|
const displayName = (_a = child.type) == null ? void 0 : _a.displayName;
|
|
4049
4116
|
if (displayName === "NotificationHeaderClose") {
|
|
4050
4117
|
closeChild = child;
|
|
@@ -4063,7 +4130,7 @@ var NotificationHeader = ({
|
|
|
4063
4130
|
}) => {
|
|
4064
4131
|
const { leftChildren, closeChild } = separateChildren4(children);
|
|
4065
4132
|
return /* @__PURE__ */ jsxs15(NotificationHeaderRoot, { sx, children: [
|
|
4066
|
-
/* @__PURE__ */
|
|
4133
|
+
/* @__PURE__ */ jsx47(NotificationHeaderContent, { children: leftChildren }),
|
|
4067
4134
|
closeChild
|
|
4068
4135
|
] });
|
|
4069
4136
|
};
|
|
@@ -4072,7 +4139,7 @@ NotificationHeader.displayName = "NotificationHeader";
|
|
|
4072
4139
|
// src/components/NotificationPanel/NotificationHeaderIcon.tsx
|
|
4073
4140
|
import Box19 from "@mui/material/Box";
|
|
4074
4141
|
import { styled as styled36 } from "@mui/material/styles";
|
|
4075
|
-
import { jsx as
|
|
4142
|
+
import { jsx as jsx48 } from "react/jsx-runtime";
|
|
4076
4143
|
var NotificationHeaderIconRoot = styled36(Box19, {
|
|
4077
4144
|
name: "MuiNotificationPanel",
|
|
4078
4145
|
slot: "HeaderIcon"
|
|
@@ -4084,14 +4151,14 @@ var NotificationHeaderIcon = ({
|
|
|
4084
4151
|
children,
|
|
4085
4152
|
sx
|
|
4086
4153
|
}) => {
|
|
4087
|
-
return /* @__PURE__ */
|
|
4154
|
+
return /* @__PURE__ */ jsx48(NotificationHeaderIconRoot, { sx, children });
|
|
4088
4155
|
};
|
|
4089
4156
|
NotificationHeaderIcon.displayName = "NotificationHeaderIcon";
|
|
4090
4157
|
|
|
4091
4158
|
// src/components/NotificationPanel/NotificationHeaderTitle.tsx
|
|
4092
4159
|
import Typography10 from "@mui/material/Typography";
|
|
4093
4160
|
import { styled as styled37 } from "@mui/material/styles";
|
|
4094
|
-
import { jsx as
|
|
4161
|
+
import { jsx as jsx49 } from "react/jsx-runtime";
|
|
4095
4162
|
var NotificationHeaderTitleRoot = styled37(Typography10, {
|
|
4096
4163
|
name: "MuiNotificationPanel",
|
|
4097
4164
|
slot: "HeaderTitle"
|
|
@@ -4102,14 +4169,14 @@ var NotificationHeaderTitle = ({
|
|
|
4102
4169
|
children,
|
|
4103
4170
|
sx
|
|
4104
4171
|
}) => {
|
|
4105
|
-
return /* @__PURE__ */
|
|
4172
|
+
return /* @__PURE__ */ jsx49(NotificationHeaderTitleRoot, { variant: "h6", sx, children });
|
|
4106
4173
|
};
|
|
4107
4174
|
NotificationHeaderTitle.displayName = "NotificationHeaderTitle";
|
|
4108
4175
|
|
|
4109
4176
|
// src/components/NotificationPanel/NotificationHeaderBadge.tsx
|
|
4110
4177
|
import Chip2 from "@mui/material/Chip";
|
|
4111
4178
|
import { styled as styled38 } from "@mui/material/styles";
|
|
4112
|
-
import { jsx as
|
|
4179
|
+
import { jsx as jsx50 } from "react/jsx-runtime";
|
|
4113
4180
|
var NotificationHeaderBadgeRoot = styled38(Chip2, {
|
|
4114
4181
|
name: "MuiNotificationPanel",
|
|
4115
4182
|
slot: "HeaderBadge"
|
|
@@ -4125,7 +4192,7 @@ var NotificationHeaderBadge = ({
|
|
|
4125
4192
|
if (!children || children === 0 || children === "0") {
|
|
4126
4193
|
return null;
|
|
4127
4194
|
}
|
|
4128
|
-
return /* @__PURE__ */
|
|
4195
|
+
return /* @__PURE__ */ jsx50(NotificationHeaderBadgeRoot, { label: children, size: "small", color, sx });
|
|
4129
4196
|
};
|
|
4130
4197
|
NotificationHeaderBadge.displayName = "NotificationHeaderBadge";
|
|
4131
4198
|
|
|
@@ -4133,7 +4200,7 @@ NotificationHeaderBadge.displayName = "NotificationHeaderBadge";
|
|
|
4133
4200
|
import IconButton4 from "@mui/material/IconButton";
|
|
4134
4201
|
import { styled as styled39 } from "@mui/material/styles";
|
|
4135
4202
|
import { X as X2 } from "@wso2/oxygen-ui-icons-react";
|
|
4136
|
-
import { jsx as
|
|
4203
|
+
import { jsx as jsx51 } from "react/jsx-runtime";
|
|
4137
4204
|
var NotificationHeaderCloseRoot = styled39(IconButton4, {
|
|
4138
4205
|
name: "MuiNotificationPanel",
|
|
4139
4206
|
slot: "HeaderClose"
|
|
@@ -4151,7 +4218,7 @@ var NotificationHeaderClose = ({
|
|
|
4151
4218
|
onClose == null ? void 0 : onClose();
|
|
4152
4219
|
}
|
|
4153
4220
|
};
|
|
4154
|
-
return /* @__PURE__ */
|
|
4221
|
+
return /* @__PURE__ */ jsx51(NotificationHeaderCloseRoot, { onClick: handleClick, size: "small", sx, children: children || /* @__PURE__ */ jsx51(X2, { size: 20 }) });
|
|
4155
4222
|
};
|
|
4156
4223
|
NotificationHeaderClose.displayName = "NotificationHeaderClose";
|
|
4157
4224
|
|
|
@@ -4161,7 +4228,7 @@ import Tabs from "@mui/material/Tabs";
|
|
|
4161
4228
|
import Tab from "@mui/material/Tab";
|
|
4162
4229
|
import Chip3 from "@mui/material/Chip";
|
|
4163
4230
|
import { styled as styled40 } from "@mui/material/styles";
|
|
4164
|
-
import { jsx as
|
|
4231
|
+
import { jsx as jsx52, jsxs as jsxs16 } from "react/jsx-runtime";
|
|
4165
4232
|
var NotificationTabsRoot = styled40(Box20, {
|
|
4166
4233
|
name: "MuiNotificationPanel",
|
|
4167
4234
|
slot: "Tabs"
|
|
@@ -4200,18 +4267,18 @@ var NotificationTabs = ({
|
|
|
4200
4267
|
onChange,
|
|
4201
4268
|
sx
|
|
4202
4269
|
}) => {
|
|
4203
|
-
return /* @__PURE__ */
|
|
4270
|
+
return /* @__PURE__ */ jsx52(NotificationTabsRoot, { sx, children: /* @__PURE__ */ jsx52(
|
|
4204
4271
|
NotificationTabsInner,
|
|
4205
4272
|
{
|
|
4206
4273
|
value,
|
|
4207
4274
|
onChange: (_, newValue) => onChange(newValue),
|
|
4208
4275
|
variant: "fullWidth",
|
|
4209
|
-
children: tabs.map((tab, index) => /* @__PURE__ */
|
|
4276
|
+
children: tabs.map((tab, index) => /* @__PURE__ */ jsx52(
|
|
4210
4277
|
Tab,
|
|
4211
4278
|
{
|
|
4212
4279
|
label: /* @__PURE__ */ jsxs16(NotificationTabLabel, { children: [
|
|
4213
4280
|
tab.label,
|
|
4214
|
-
tab.count !== void 0 && tab.count > 0 && /* @__PURE__ */
|
|
4281
|
+
tab.count !== void 0 && tab.count > 0 && /* @__PURE__ */ jsx52(
|
|
4215
4282
|
NotificationTabCount,
|
|
4216
4283
|
{
|
|
4217
4284
|
label: tab.count,
|
|
@@ -4233,7 +4300,7 @@ import Box21 from "@mui/material/Box";
|
|
|
4233
4300
|
import Button3 from "@mui/material/Button";
|
|
4234
4301
|
import { styled as styled41 } from "@mui/material/styles";
|
|
4235
4302
|
import { CheckCheck, Trash2 } from "@wso2/oxygen-ui-icons-react";
|
|
4236
|
-
import { jsx as
|
|
4303
|
+
import { jsx as jsx53, jsxs as jsxs17 } from "react/jsx-runtime";
|
|
4237
4304
|
var NotificationActionsRoot = styled41(Box21, {
|
|
4238
4305
|
name: "MuiNotificationPanel",
|
|
4239
4306
|
slot: "Actions"
|
|
@@ -4260,20 +4327,20 @@ var NotificationActions = ({
|
|
|
4260
4327
|
sx
|
|
4261
4328
|
}) => {
|
|
4262
4329
|
return /* @__PURE__ */ jsxs17(NotificationActionsRoot, { sx, children: [
|
|
4263
|
-
hasUnread && onMarkAllRead && /* @__PURE__ */
|
|
4330
|
+
hasUnread && onMarkAllRead && /* @__PURE__ */ jsx53(
|
|
4264
4331
|
NotificationActionButton,
|
|
4265
4332
|
{
|
|
4266
4333
|
size: "small",
|
|
4267
|
-
startIcon: /* @__PURE__ */
|
|
4334
|
+
startIcon: /* @__PURE__ */ jsx53(CheckCheck, { size: 14 }),
|
|
4268
4335
|
onClick: onMarkAllRead,
|
|
4269
4336
|
children: "Mark all read"
|
|
4270
4337
|
}
|
|
4271
4338
|
),
|
|
4272
|
-
onClearAll && /* @__PURE__ */
|
|
4339
|
+
onClearAll && /* @__PURE__ */ jsx53(
|
|
4273
4340
|
NotificationActionButton,
|
|
4274
4341
|
{
|
|
4275
4342
|
size: "small",
|
|
4276
|
-
startIcon: /* @__PURE__ */
|
|
4343
|
+
startIcon: /* @__PURE__ */ jsx53(Trash2, { size: 14 }),
|
|
4277
4344
|
onClick: onClearAll,
|
|
4278
4345
|
color: "error",
|
|
4279
4346
|
children: "Clear all"
|
|
@@ -4283,12 +4350,12 @@ var NotificationActions = ({
|
|
|
4283
4350
|
};
|
|
4284
4351
|
|
|
4285
4352
|
// src/components/NotificationPanel/NotificationList.tsx
|
|
4286
|
-
import * as
|
|
4353
|
+
import * as React20 from "react";
|
|
4287
4354
|
import Box22 from "@mui/material/Box";
|
|
4288
4355
|
import List3 from "@mui/material/List";
|
|
4289
4356
|
import Divider6 from "@mui/material/Divider";
|
|
4290
4357
|
import { styled as styled42 } from "@mui/material/styles";
|
|
4291
|
-
import { jsx as
|
|
4358
|
+
import { jsx as jsx54, jsxs as jsxs18 } from "react/jsx-runtime";
|
|
4292
4359
|
var NotificationListRoot = styled42(Box22, {
|
|
4293
4360
|
name: "MuiNotificationPanel",
|
|
4294
4361
|
slot: "List"
|
|
@@ -4301,15 +4368,15 @@ var NotificationList = ({
|
|
|
4301
4368
|
showDividers = true,
|
|
4302
4369
|
sx
|
|
4303
4370
|
}) => {
|
|
4304
|
-
const childArray =
|
|
4305
|
-
return /* @__PURE__ */
|
|
4371
|
+
const childArray = React20.Children.toArray(children);
|
|
4372
|
+
return /* @__PURE__ */ jsx54(NotificationListRoot, { sx, children: /* @__PURE__ */ jsx54(List3, { disablePadding: true, children: childArray.map((child, index) => /* @__PURE__ */ jsxs18(React20.Fragment, { children: [
|
|
4306
4373
|
child,
|
|
4307
|
-
showDividers && index < childArray.length - 1 && /* @__PURE__ */
|
|
4374
|
+
showDividers && index < childArray.length - 1 && /* @__PURE__ */ jsx54(Divider6, {})
|
|
4308
4375
|
] }, index)) }) });
|
|
4309
4376
|
};
|
|
4310
4377
|
|
|
4311
4378
|
// src/components/NotificationPanel/NotificationItem.tsx
|
|
4312
|
-
import * as
|
|
4379
|
+
import * as React22 from "react";
|
|
4313
4380
|
import Box23 from "@mui/material/Box";
|
|
4314
4381
|
import ListItem2 from "@mui/material/ListItem";
|
|
4315
4382
|
import ListItemButton3 from "@mui/material/ListItemButton";
|
|
@@ -4355,11 +4422,11 @@ var getNotificationTypeProps = (type) => {
|
|
|
4355
4422
|
};
|
|
4356
4423
|
|
|
4357
4424
|
// src/components/NotificationPanel/NotificationItemContext.tsx
|
|
4358
|
-
import * as
|
|
4359
|
-
import { jsx as
|
|
4360
|
-
var NotificationItemContext =
|
|
4425
|
+
import * as React21 from "react";
|
|
4426
|
+
import { jsx as jsx55 } from "react/jsx-runtime";
|
|
4427
|
+
var NotificationItemContext = React21.createContext(null);
|
|
4361
4428
|
var useNotificationItemContext = () => {
|
|
4362
|
-
const context =
|
|
4429
|
+
const context = React21.useContext(NotificationItemContext);
|
|
4363
4430
|
if (!context) {
|
|
4364
4431
|
throw new Error(
|
|
4365
4432
|
"useNotificationItemContext must be used within a NotificationItem component"
|
|
@@ -4368,11 +4435,11 @@ var useNotificationItemContext = () => {
|
|
|
4368
4435
|
return context;
|
|
4369
4436
|
};
|
|
4370
4437
|
var NotificationItemProvider = ({ value, children }) => {
|
|
4371
|
-
return /* @__PURE__ */
|
|
4438
|
+
return /* @__PURE__ */ jsx55(NotificationItemContext.Provider, { value, children });
|
|
4372
4439
|
};
|
|
4373
4440
|
|
|
4374
4441
|
// src/components/NotificationPanel/NotificationItem.tsx
|
|
4375
|
-
import { jsx as
|
|
4442
|
+
import { jsx as jsx56, jsxs as jsxs19 } from "react/jsx-runtime";
|
|
4376
4443
|
var NotificationItemRoot = styled43(ListItem2, {
|
|
4377
4444
|
name: "MuiNotificationPanel",
|
|
4378
4445
|
slot: "Item",
|
|
@@ -4413,9 +4480,9 @@ var separateChildren5 = (children) => {
|
|
|
4413
4480
|
let messageChild = null;
|
|
4414
4481
|
let timestampChild = null;
|
|
4415
4482
|
let actionChild = null;
|
|
4416
|
-
|
|
4483
|
+
React22.Children.forEach(children, (child) => {
|
|
4417
4484
|
var _a;
|
|
4418
|
-
if (
|
|
4485
|
+
if (React22.isValidElement(child)) {
|
|
4419
4486
|
const displayName = (_a = child.type) == null ? void 0 : _a.displayName;
|
|
4420
4487
|
switch (displayName) {
|
|
4421
4488
|
case "NotificationItemAvatar":
|
|
@@ -4465,12 +4532,12 @@ var NotificationItem = ({
|
|
|
4465
4532
|
onAction == null ? void 0 : onAction();
|
|
4466
4533
|
};
|
|
4467
4534
|
const ownerState = { read };
|
|
4468
|
-
return /* @__PURE__ */
|
|
4535
|
+
return /* @__PURE__ */ jsx56(NotificationItemProvider, { value: contextValue, children: /* @__PURE__ */ jsx56(
|
|
4469
4536
|
NotificationItemRoot,
|
|
4470
4537
|
{
|
|
4471
4538
|
disablePadding: true,
|
|
4472
4539
|
ownerState,
|
|
4473
|
-
secondaryAction: onDismiss && /* @__PURE__ */
|
|
4540
|
+
secondaryAction: onDismiss && /* @__PURE__ */ jsx56(
|
|
4474
4541
|
NotificationItemDismiss,
|
|
4475
4542
|
{
|
|
4476
4543
|
size: "small",
|
|
@@ -4478,13 +4545,13 @@ var NotificationItem = ({
|
|
|
4478
4545
|
e.stopPropagation();
|
|
4479
4546
|
onDismiss(id);
|
|
4480
4547
|
},
|
|
4481
|
-
children: /* @__PURE__ */
|
|
4548
|
+
children: /* @__PURE__ */ jsx56(X3, { size: 16 })
|
|
4482
4549
|
}
|
|
4483
4550
|
),
|
|
4484
4551
|
sx,
|
|
4485
4552
|
children: /* @__PURE__ */ jsxs19(NotificationItemButton, { onClick: handleClick, children: [
|
|
4486
4553
|
avatarChild,
|
|
4487
|
-
/* @__PURE__ */
|
|
4554
|
+
/* @__PURE__ */ jsx56(
|
|
4488
4555
|
ListItemText3,
|
|
4489
4556
|
{
|
|
4490
4557
|
primary: titleChild,
|
|
@@ -4507,7 +4574,7 @@ NotificationItem.displayName = "NotificationItem";
|
|
|
4507
4574
|
import ListItemAvatar from "@mui/material/ListItemAvatar";
|
|
4508
4575
|
import Avatar3 from "@mui/material/Avatar";
|
|
4509
4576
|
import { styled as styled44 } from "@mui/material/styles";
|
|
4510
|
-
import { jsx as
|
|
4577
|
+
import { jsx as jsx57 } from "react/jsx-runtime";
|
|
4511
4578
|
var NotificationItemAvatarStyled = styled44(Avatar3, {
|
|
4512
4579
|
name: "MuiNotificationPanel",
|
|
4513
4580
|
slot: "ItemAvatar",
|
|
@@ -4531,7 +4598,7 @@ var NotificationItemAvatar = ({
|
|
|
4531
4598
|
color: typeProps.color,
|
|
4532
4599
|
hasChildren: !!children
|
|
4533
4600
|
};
|
|
4534
|
-
return /* @__PURE__ */
|
|
4601
|
+
return /* @__PURE__ */ jsx57(ListItemAvatar, { children: /* @__PURE__ */ jsx57(NotificationItemAvatarStyled, { ownerState, sx, children: children || /* @__PURE__ */ jsx57(Icon, { size: 20 }) }) });
|
|
4535
4602
|
};
|
|
4536
4603
|
NotificationItemAvatar.displayName = "NotificationItemAvatar";
|
|
4537
4604
|
|
|
@@ -4539,7 +4606,7 @@ NotificationItemAvatar.displayName = "NotificationItemAvatar";
|
|
|
4539
4606
|
import Box24 from "@mui/material/Box";
|
|
4540
4607
|
import Typography11 from "@mui/material/Typography";
|
|
4541
4608
|
import { styled as styled45 } from "@mui/material/styles";
|
|
4542
|
-
import { jsx as
|
|
4609
|
+
import { jsx as jsx58, jsxs as jsxs20 } from "react/jsx-runtime";
|
|
4543
4610
|
var NotificationItemTitleRoot = styled45(Box24, {
|
|
4544
4611
|
name: "MuiNotificationPanel",
|
|
4545
4612
|
slot: "ItemTitle"
|
|
@@ -4573,8 +4640,8 @@ var NotificationItemTitle = ({
|
|
|
4573
4640
|
}) => {
|
|
4574
4641
|
const { read } = useNotificationItemContext();
|
|
4575
4642
|
return /* @__PURE__ */ jsxs20(NotificationItemTitleRoot, { sx, children: [
|
|
4576
|
-
/* @__PURE__ */
|
|
4577
|
-
showUnreadIndicator && !read && /* @__PURE__ */
|
|
4643
|
+
/* @__PURE__ */ jsx58(NotificationItemTitleText, { variant: "body2", ownerState: { read }, children }),
|
|
4644
|
+
showUnreadIndicator && !read && /* @__PURE__ */ jsx58(NotificationItemUnreadDot, {})
|
|
4578
4645
|
] });
|
|
4579
4646
|
};
|
|
4580
4647
|
NotificationItemTitle.displayName = "NotificationItemTitle";
|
|
@@ -4582,7 +4649,7 @@ NotificationItemTitle.displayName = "NotificationItemTitle";
|
|
|
4582
4649
|
// src/components/NotificationPanel/NotificationItemMessage.tsx
|
|
4583
4650
|
import Typography12 from "@mui/material/Typography";
|
|
4584
4651
|
import { styled as styled46 } from "@mui/material/styles";
|
|
4585
|
-
import { jsx as
|
|
4652
|
+
import { jsx as jsx59 } from "react/jsx-runtime";
|
|
4586
4653
|
var NotificationItemMessageRoot = styled46(Typography12, {
|
|
4587
4654
|
name: "MuiNotificationPanel",
|
|
4588
4655
|
slot: "ItemMessage"
|
|
@@ -4595,14 +4662,14 @@ var NotificationItemMessage = ({
|
|
|
4595
4662
|
children,
|
|
4596
4663
|
sx
|
|
4597
4664
|
}) => {
|
|
4598
|
-
return /* @__PURE__ */
|
|
4665
|
+
return /* @__PURE__ */ jsx59(NotificationItemMessageRoot, { component: "span", variant: "caption", sx, children });
|
|
4599
4666
|
};
|
|
4600
4667
|
NotificationItemMessage.displayName = "NotificationItemMessage";
|
|
4601
4668
|
|
|
4602
4669
|
// src/components/NotificationPanel/NotificationItemTimestamp.tsx
|
|
4603
4670
|
import Typography13 from "@mui/material/Typography";
|
|
4604
4671
|
import { styled as styled47 } from "@mui/material/styles";
|
|
4605
|
-
import { jsx as
|
|
4672
|
+
import { jsx as jsx60 } from "react/jsx-runtime";
|
|
4606
4673
|
var NotificationItemTimestampRoot = styled47(Typography13, {
|
|
4607
4674
|
name: "MuiNotificationPanel",
|
|
4608
4675
|
slot: "ItemTimestamp"
|
|
@@ -4614,14 +4681,14 @@ var NotificationItemTimestamp = ({
|
|
|
4614
4681
|
children,
|
|
4615
4682
|
sx
|
|
4616
4683
|
}) => {
|
|
4617
|
-
return /* @__PURE__ */
|
|
4684
|
+
return /* @__PURE__ */ jsx60(NotificationItemTimestampRoot, { component: "span", variant: "caption", sx, children });
|
|
4618
4685
|
};
|
|
4619
4686
|
NotificationItemTimestamp.displayName = "NotificationItemTimestamp";
|
|
4620
4687
|
|
|
4621
4688
|
// src/components/NotificationPanel/NotificationItemAction.tsx
|
|
4622
4689
|
import Chip4 from "@mui/material/Chip";
|
|
4623
4690
|
import { styled as styled48 } from "@mui/material/styles";
|
|
4624
|
-
import { jsx as
|
|
4691
|
+
import { jsx as jsx61 } from "react/jsx-runtime";
|
|
4625
4692
|
var NotificationItemActionRoot = styled48(Chip4, {
|
|
4626
4693
|
name: "MuiNotificationPanel",
|
|
4627
4694
|
slot: "ItemAction"
|
|
@@ -4644,7 +4711,7 @@ var NotificationItemAction = ({
|
|
|
4644
4711
|
onAction == null ? void 0 : onAction();
|
|
4645
4712
|
}
|
|
4646
4713
|
};
|
|
4647
|
-
return /* @__PURE__ */
|
|
4714
|
+
return /* @__PURE__ */ jsx61(
|
|
4648
4715
|
NotificationItemActionRoot,
|
|
4649
4716
|
{
|
|
4650
4717
|
label: children,
|
|
@@ -4662,7 +4729,7 @@ import Box25 from "@mui/material/Box";
|
|
|
4662
4729
|
import Typography14 from "@mui/material/Typography";
|
|
4663
4730
|
import { styled as styled49 } from "@mui/material/styles";
|
|
4664
4731
|
import { BellOff } from "@wso2/oxygen-ui-icons-react";
|
|
4665
|
-
import { jsx as
|
|
4732
|
+
import { jsx as jsx62, jsxs as jsxs21 } from "react/jsx-runtime";
|
|
4666
4733
|
var NotificationEmptyStateRoot = styled49(Box25, {
|
|
4667
4734
|
name: "MuiNotificationPanel",
|
|
4668
4735
|
slot: "EmptyState"
|
|
@@ -4689,13 +4756,13 @@ var NotificationEmptyState = ({
|
|
|
4689
4756
|
sx
|
|
4690
4757
|
}) => {
|
|
4691
4758
|
return /* @__PURE__ */ jsxs21(NotificationEmptyStateRoot, { sx, children: [
|
|
4692
|
-
icon || /* @__PURE__ */
|
|
4693
|
-
/* @__PURE__ */
|
|
4759
|
+
icon || /* @__PURE__ */ jsx62(BellOff, { size: 48, style: { opacity: 0.3, marginBottom: 16 } }),
|
|
4760
|
+
/* @__PURE__ */ jsx62(NotificationEmptyStateMessage, { variant: "body2", children: message })
|
|
4694
4761
|
] });
|
|
4695
4762
|
};
|
|
4696
4763
|
|
|
4697
4764
|
// src/components/NotificationPanel/NotificationPanel.tsx
|
|
4698
|
-
import { jsx as
|
|
4765
|
+
import { jsx as jsx63 } from "react/jsx-runtime";
|
|
4699
4766
|
var NotificationPanelRoot = styled50(Drawer, {
|
|
4700
4767
|
name: "MuiNotificationPanel",
|
|
4701
4768
|
slot: "Root",
|
|
@@ -4712,17 +4779,28 @@ var NotificationPanelRoot = styled50(Drawer, {
|
|
|
4712
4779
|
}
|
|
4713
4780
|
}));
|
|
4714
4781
|
var NotificationPanel = ({
|
|
4715
|
-
open,
|
|
4716
|
-
onClose,
|
|
4782
|
+
open: openProp,
|
|
4783
|
+
onClose: onCloseProp,
|
|
4717
4784
|
children,
|
|
4718
4785
|
width = 380,
|
|
4719
4786
|
anchor = "right",
|
|
4720
4787
|
variant = "temporary",
|
|
4721
4788
|
sx
|
|
4722
4789
|
}) => {
|
|
4723
|
-
|
|
4790
|
+
var _a;
|
|
4791
|
+
const appShellContext = React23.useContext(AppShellContext);
|
|
4792
|
+
const open = (_a = openProp != null ? openProp : appShellContext == null ? void 0 : appShellContext.state.notificationPanelOpen) != null ? _a : false;
|
|
4793
|
+
const onClose = React23.useMemo(
|
|
4794
|
+
() => {
|
|
4795
|
+
var _a2;
|
|
4796
|
+
return (_a2 = onCloseProp != null ? onCloseProp : appShellContext == null ? void 0 : appShellContext.actions.toggleNotificationPanel) != null ? _a2 : (() => {
|
|
4797
|
+
});
|
|
4798
|
+
},
|
|
4799
|
+
[onCloseProp, appShellContext == null ? void 0 : appShellContext.actions.toggleNotificationPanel]
|
|
4800
|
+
);
|
|
4801
|
+
const contextValue = React23.useMemo(() => ({ onClose }), [onClose]);
|
|
4724
4802
|
const ownerState = { width };
|
|
4725
|
-
return /* @__PURE__ */
|
|
4803
|
+
return /* @__PURE__ */ jsx63(NotificationPanelContext.Provider, { value: contextValue, children: /* @__PURE__ */ jsx63(
|
|
4726
4804
|
NotificationPanelRoot,
|
|
4727
4805
|
{
|
|
4728
4806
|
anchor,
|
|
@@ -4753,14 +4831,14 @@ NotificationPanel.EmptyState = NotificationEmptyState;
|
|
|
4753
4831
|
NotificationPanel.displayName = "NotificationPanel";
|
|
4754
4832
|
|
|
4755
4833
|
// src/components/Footer/Footer.tsx
|
|
4756
|
-
import * as
|
|
4834
|
+
import * as React24 from "react";
|
|
4757
4835
|
import Box26 from "@mui/material/Box";
|
|
4758
4836
|
import { styled as styled54 } from "@mui/material/styles";
|
|
4759
4837
|
|
|
4760
4838
|
// src/components/Footer/FooterCopyright.tsx
|
|
4761
4839
|
import Typography15 from "@mui/material/Typography";
|
|
4762
4840
|
import { styled as styled51 } from "@mui/material/styles";
|
|
4763
|
-
import { jsx as
|
|
4841
|
+
import { jsx as jsx64 } from "react/jsx-runtime";
|
|
4764
4842
|
var StyledCopyrightText = styled51(Typography15, {
|
|
4765
4843
|
name: "MuiFooter",
|
|
4766
4844
|
slot: "CopyrightText"
|
|
@@ -4768,14 +4846,14 @@ var StyledCopyrightText = styled51(Typography15, {
|
|
|
4768
4846
|
color: (theme.vars || theme).palette.text.secondary
|
|
4769
4847
|
}));
|
|
4770
4848
|
var FooterCopyright = ({ children }) => {
|
|
4771
|
-
return /* @__PURE__ */
|
|
4849
|
+
return /* @__PURE__ */ jsx64(StyledCopyrightText, { variant: "caption", children });
|
|
4772
4850
|
};
|
|
4773
4851
|
FooterCopyright.displayName = "Footer.Copyright";
|
|
4774
4852
|
|
|
4775
4853
|
// src/components/Footer/FooterVersion.tsx
|
|
4776
4854
|
import Typography16 from "@mui/material/Typography";
|
|
4777
4855
|
import { styled as styled52 } from "@mui/material/styles";
|
|
4778
|
-
import { jsx as
|
|
4856
|
+
import { jsx as jsx65 } from "react/jsx-runtime";
|
|
4779
4857
|
var StyledVersion = styled52(Typography16, {
|
|
4780
4858
|
name: "MuiFooter",
|
|
4781
4859
|
slot: "Version"
|
|
@@ -4785,14 +4863,14 @@ var StyledVersion = styled52(Typography16, {
|
|
|
4785
4863
|
fontSize: 11
|
|
4786
4864
|
}));
|
|
4787
4865
|
var FooterVersion = ({ children }) => {
|
|
4788
|
-
return /* @__PURE__ */
|
|
4866
|
+
return /* @__PURE__ */ jsx65(StyledVersion, { variant: "caption", children });
|
|
4789
4867
|
};
|
|
4790
4868
|
FooterVersion.displayName = "Footer.Version";
|
|
4791
4869
|
|
|
4792
4870
|
// src/components/Footer/FooterLink.tsx
|
|
4793
4871
|
import Link2 from "@mui/material/Link";
|
|
4794
4872
|
import { styled as styled53 } from "@mui/material/styles";
|
|
4795
|
-
import { jsx as
|
|
4873
|
+
import { jsx as jsx66 } from "react/jsx-runtime";
|
|
4796
4874
|
var StyledLink = styled53(Link2, {
|
|
4797
4875
|
name: "MuiFooter",
|
|
4798
4876
|
slot: "Link"
|
|
@@ -4805,15 +4883,15 @@ var StyledLink = styled53(Link2, {
|
|
|
4805
4883
|
}));
|
|
4806
4884
|
var FooterLink = (_a) => {
|
|
4807
4885
|
var _b = _a, { children, href } = _b, props = __objRest(_b, ["children", "href"]);
|
|
4808
|
-
return /* @__PURE__ */
|
|
4886
|
+
return /* @__PURE__ */ jsx66(StyledLink, __spreadProps(__spreadValues({ href, underline: "hover" }, props), { children }));
|
|
4809
4887
|
};
|
|
4810
4888
|
FooterLink.displayName = "Footer.Link";
|
|
4811
4889
|
|
|
4812
4890
|
// src/components/Footer/FooterDivider.tsx
|
|
4813
4891
|
import Divider7 from "@mui/material/Divider";
|
|
4814
|
-
import { jsx as
|
|
4892
|
+
import { jsx as jsx67 } from "react/jsx-runtime";
|
|
4815
4893
|
var FooterDivider = () => {
|
|
4816
|
-
return /* @__PURE__ */
|
|
4894
|
+
return /* @__PURE__ */ jsx67(
|
|
4817
4895
|
Divider7,
|
|
4818
4896
|
{
|
|
4819
4897
|
orientation: "vertical",
|
|
@@ -4825,7 +4903,7 @@ var FooterDivider = () => {
|
|
|
4825
4903
|
FooterDivider.displayName = "Footer.Divider";
|
|
4826
4904
|
|
|
4827
4905
|
// src/components/Footer/Footer.tsx
|
|
4828
|
-
import { jsx as
|
|
4906
|
+
import { jsx as jsx68, jsxs as jsxs22 } from "react/jsx-runtime";
|
|
4829
4907
|
var FooterRoot = styled54(Box26, {
|
|
4830
4908
|
name: "MuiFooter",
|
|
4831
4909
|
slot: "Root"
|
|
@@ -4872,11 +4950,11 @@ var FooterRight = styled54(Box26, {
|
|
|
4872
4950
|
flexWrap: "wrap"
|
|
4873
4951
|
}));
|
|
4874
4952
|
var Footer = ({ children, sx }) => {
|
|
4875
|
-
const childrenArray =
|
|
4953
|
+
const childrenArray = React24.Children.toArray(children);
|
|
4876
4954
|
const leftChildren = [];
|
|
4877
4955
|
const rightChildren = [];
|
|
4878
4956
|
childrenArray.forEach((child) => {
|
|
4879
|
-
if (
|
|
4957
|
+
if (React24.isValidElement(child)) {
|
|
4880
4958
|
if (child.type === FooterCopyright || child.type === FooterVersion || child.type === FooterDivider) {
|
|
4881
4959
|
leftChildren.push(child);
|
|
4882
4960
|
} else if (child.type === FooterLink) {
|
|
@@ -4884,9 +4962,9 @@ var Footer = ({ children, sx }) => {
|
|
|
4884
4962
|
}
|
|
4885
4963
|
}
|
|
4886
4964
|
});
|
|
4887
|
-
return /* @__PURE__ */
|
|
4888
|
-
leftChildren.length > 0 && /* @__PURE__ */
|
|
4889
|
-
rightChildren.length > 0 && /* @__PURE__ */
|
|
4965
|
+
return /* @__PURE__ */ jsx68(FooterRoot, { component: "footer", sx, children: /* @__PURE__ */ jsxs22(FooterContent, { children: [
|
|
4966
|
+
leftChildren.length > 0 && /* @__PURE__ */ jsx68(FooterLeft, { children: leftChildren }),
|
|
4967
|
+
rightChildren.length > 0 && /* @__PURE__ */ jsx68(FooterRight, { children: rightChildren })
|
|
4890
4968
|
] }) });
|
|
4891
4969
|
};
|
|
4892
4970
|
Footer.Copyright = FooterCopyright;
|
|
@@ -4896,14 +4974,14 @@ Footer.Divider = FooterDivider;
|
|
|
4896
4974
|
Footer.displayName = "Footer";
|
|
4897
4975
|
|
|
4898
4976
|
// src/components/UserMenu/UserMenu.tsx
|
|
4899
|
-
import * as
|
|
4977
|
+
import * as React28 from "react";
|
|
4900
4978
|
import Menu2 from "@mui/material/Menu";
|
|
4901
4979
|
|
|
4902
4980
|
// src/components/UserMenu/UserMenuContext.tsx
|
|
4903
|
-
import * as
|
|
4904
|
-
var UserMenuContext =
|
|
4981
|
+
import * as React25 from "react";
|
|
4982
|
+
var UserMenuContext = React25.createContext(void 0);
|
|
4905
4983
|
var useUserMenu = () => {
|
|
4906
|
-
const context =
|
|
4984
|
+
const context = React25.useContext(UserMenuContext);
|
|
4907
4985
|
if (!context) {
|
|
4908
4986
|
throw new Error("UserMenu sub-components must be used within a UserMenu component");
|
|
4909
4987
|
}
|
|
@@ -4916,7 +4994,7 @@ import Tooltip5 from "@mui/material/Tooltip";
|
|
|
4916
4994
|
import IconButton6 from "@mui/material/IconButton";
|
|
4917
4995
|
import Avatar4 from "@mui/material/Avatar";
|
|
4918
4996
|
import { styled as styled55 } from "@mui/material/styles";
|
|
4919
|
-
import { jsx as
|
|
4997
|
+
import { jsx as jsx69, jsxs as jsxs23 } from "react/jsx-runtime";
|
|
4920
4998
|
var StyledTrigger = styled55(IconButton6, {
|
|
4921
4999
|
name: "MuiUserMenu",
|
|
4922
5000
|
slot: "Trigger"
|
|
@@ -4952,7 +5030,7 @@ var StyledNameText = styled55("span", {
|
|
|
4952
5030
|
}));
|
|
4953
5031
|
var UserMenuTrigger = ({ name, avatar, showName = false }) => {
|
|
4954
5032
|
const { open, handleOpen } = useUserMenu();
|
|
4955
|
-
return /* @__PURE__ */
|
|
5033
|
+
return /* @__PURE__ */ jsx69(Tooltip5, { title: "Account", children: /* @__PURE__ */ jsxs23(
|
|
4956
5034
|
StyledTrigger,
|
|
4957
5035
|
{
|
|
4958
5036
|
onClick: handleOpen,
|
|
@@ -4963,8 +5041,8 @@ var UserMenuTrigger = ({ name, avatar, showName = false }) => {
|
|
|
4963
5041
|
"aria-haspopup": "true",
|
|
4964
5042
|
"aria-expanded": open ? "true" : void 0,
|
|
4965
5043
|
children: [
|
|
4966
|
-
/* @__PURE__ */
|
|
4967
|
-
showName && /* @__PURE__ */
|
|
5044
|
+
/* @__PURE__ */ jsx69(StyledAvatar2, { src: avatar || void 0, alt: name, children: !avatar && name.charAt(0) }),
|
|
5045
|
+
showName && /* @__PURE__ */ jsx69(StyledNameText, { children: name })
|
|
4968
5046
|
]
|
|
4969
5047
|
}
|
|
4970
5048
|
) });
|
|
@@ -4978,7 +5056,7 @@ import Avatar5 from "@mui/material/Avatar";
|
|
|
4978
5056
|
import Typography17 from "@mui/material/Typography";
|
|
4979
5057
|
import Chip5 from "@mui/material/Chip";
|
|
4980
5058
|
import { styled as styled56 } from "@mui/material/styles";
|
|
4981
|
-
import { Fragment as Fragment9, jsx as
|
|
5059
|
+
import { Fragment as Fragment9, jsx as jsx70, jsxs as jsxs24 } from "react/jsx-runtime";
|
|
4982
5060
|
var StyledHeaderBox = styled56(Box27, {
|
|
4983
5061
|
name: "MuiUserMenu",
|
|
4984
5062
|
slot: "HeaderBox"
|
|
@@ -5052,12 +5130,12 @@ var StyledEmail = styled56(Typography17, {
|
|
|
5052
5130
|
}));
|
|
5053
5131
|
var UserMenuHeader = ({ name, email, avatar, role }) => {
|
|
5054
5132
|
return /* @__PURE__ */ jsxs24(Fragment9, { children: [
|
|
5055
|
-
/* @__PURE__ */
|
|
5056
|
-
/* @__PURE__ */
|
|
5133
|
+
/* @__PURE__ */ jsx70(StyledHeaderBox, { children: /* @__PURE__ */ jsxs24(StyledHeaderContent, { children: [
|
|
5134
|
+
/* @__PURE__ */ jsx70(StyledHeaderAvatar, { src: avatar || void 0, alt: name, children: !avatar && name.charAt(0) }),
|
|
5057
5135
|
/* @__PURE__ */ jsxs24(StyledUserInfo, { children: [
|
|
5058
5136
|
/* @__PURE__ */ jsxs24(StyledNameRow, { children: [
|
|
5059
|
-
/* @__PURE__ */
|
|
5060
|
-
role && /* @__PURE__ */
|
|
5137
|
+
/* @__PURE__ */ jsx70(StyledName, { variant: "subtitle2", children: name }),
|
|
5138
|
+
role && /* @__PURE__ */ jsx70(
|
|
5061
5139
|
StyledRoleChip,
|
|
5062
5140
|
{
|
|
5063
5141
|
label: role,
|
|
@@ -5066,15 +5144,16 @@ var UserMenuHeader = ({ name, email, avatar, role }) => {
|
|
|
5066
5144
|
}
|
|
5067
5145
|
)
|
|
5068
5146
|
] }),
|
|
5069
|
-
/* @__PURE__ */
|
|
5147
|
+
/* @__PURE__ */ jsx70(StyledEmail, { variant: "caption", children: email })
|
|
5070
5148
|
] })
|
|
5071
5149
|
] }) }),
|
|
5072
|
-
/* @__PURE__ */
|
|
5150
|
+
/* @__PURE__ */ jsx70(Divider8, {})
|
|
5073
5151
|
] });
|
|
5074
5152
|
};
|
|
5075
5153
|
UserMenuHeader.displayName = "UserMenu.Header";
|
|
5076
5154
|
|
|
5077
5155
|
// src/components/UserMenu/UserMenuItem.tsx
|
|
5156
|
+
import * as React26 from "react";
|
|
5078
5157
|
import MenuItem3 from "@mui/material/MenuItem";
|
|
5079
5158
|
import ListItemIcon3 from "@mui/material/ListItemIcon";
|
|
5080
5159
|
import ListItemText4 from "@mui/material/ListItemText";
|
|
@@ -5082,7 +5161,7 @@ import Box28 from "@mui/material/Box";
|
|
|
5082
5161
|
import Chip6 from "@mui/material/Chip";
|
|
5083
5162
|
import { styled as styled57 } from "@mui/material/styles";
|
|
5084
5163
|
import { ChevronRight } from "@wso2/oxygen-ui-icons-react";
|
|
5085
|
-
import { jsx as
|
|
5164
|
+
import { jsx as jsx71, jsxs as jsxs25 } from "react/jsx-runtime";
|
|
5086
5165
|
var StyledMenuItem2 = styled57(MenuItem3, {
|
|
5087
5166
|
name: "MuiUserMenu",
|
|
5088
5167
|
slot: "MenuItem"
|
|
@@ -5104,16 +5183,19 @@ var UserMenuItem = ({
|
|
|
5104
5183
|
badge,
|
|
5105
5184
|
onClick
|
|
5106
5185
|
}) => {
|
|
5186
|
+
var _a;
|
|
5107
5187
|
const { handleClose } = useUserMenu();
|
|
5108
5188
|
const handleClick = () => {
|
|
5109
5189
|
handleClose();
|
|
5110
5190
|
onClick == null ? void 0 : onClick();
|
|
5111
5191
|
};
|
|
5112
5192
|
return /* @__PURE__ */ jsxs25(StyledMenuItem2, { onClick: handleClick, children: [
|
|
5113
|
-
icon && /* @__PURE__ */
|
|
5114
|
-
|
|
5193
|
+
icon && /* @__PURE__ */ jsx71(ListItemIcon3, { children: React26.isValidElement(icon) ? React26.cloneElement(icon, __spreadProps(__spreadValues({}, icon.props), {
|
|
5194
|
+
size: (_a = icon.props.size) != null ? _a : 18
|
|
5195
|
+
})) : icon }),
|
|
5196
|
+
/* @__PURE__ */ jsx71(ListItemText4, { primary: label }),
|
|
5115
5197
|
/* @__PURE__ */ jsxs25(Box28, { sx: { display: "flex", alignItems: "center", gap: 0.5 }, children: [
|
|
5116
|
-
badge && /* @__PURE__ */
|
|
5198
|
+
badge && /* @__PURE__ */ jsx71(
|
|
5117
5199
|
StyledBillingChip,
|
|
5118
5200
|
{
|
|
5119
5201
|
label: badge,
|
|
@@ -5121,18 +5203,19 @@ var UserMenuItem = ({
|
|
|
5121
5203
|
variant: "outlined"
|
|
5122
5204
|
}
|
|
5123
5205
|
),
|
|
5124
|
-
/* @__PURE__ */
|
|
5206
|
+
/* @__PURE__ */ jsx71(ChevronRight, { size: 16, style: { color: "var(--mui-palette-text-secondary)" } })
|
|
5125
5207
|
] })
|
|
5126
5208
|
] });
|
|
5127
5209
|
};
|
|
5128
5210
|
UserMenuItem.displayName = "UserMenu.Item";
|
|
5129
5211
|
|
|
5130
5212
|
// src/components/UserMenu/UserMenuLogout.tsx
|
|
5213
|
+
import * as React27 from "react";
|
|
5131
5214
|
import MenuItem4 from "@mui/material/MenuItem";
|
|
5132
5215
|
import ListItemIcon4 from "@mui/material/ListItemIcon";
|
|
5133
5216
|
import ListItemText5 from "@mui/material/ListItemText";
|
|
5134
5217
|
import { styled as styled58 } from "@mui/material/styles";
|
|
5135
|
-
import { jsx as
|
|
5218
|
+
import { jsx as jsx72, jsxs as jsxs26 } from "react/jsx-runtime";
|
|
5136
5219
|
var StyledLogoutItem = styled58(MenuItem4, {
|
|
5137
5220
|
name: "MuiUserMenu",
|
|
5138
5221
|
slot: "LogoutItem"
|
|
@@ -5153,28 +5236,31 @@ var UserMenuLogout = ({
|
|
|
5153
5236
|
label = "Log out",
|
|
5154
5237
|
onClick
|
|
5155
5238
|
}) => {
|
|
5239
|
+
var _a;
|
|
5156
5240
|
const { handleClose } = useUserMenu();
|
|
5157
5241
|
const handleClick = () => {
|
|
5158
5242
|
handleClose();
|
|
5159
5243
|
onClick == null ? void 0 : onClick();
|
|
5160
5244
|
};
|
|
5161
5245
|
return /* @__PURE__ */ jsxs26(StyledLogoutItem, { onClick: handleClick, children: [
|
|
5162
|
-
icon && /* @__PURE__ */
|
|
5163
|
-
|
|
5246
|
+
icon && /* @__PURE__ */ jsx72(ListItemIcon4, { children: React27.isValidElement(icon) ? React27.cloneElement(icon, __spreadProps(__spreadValues({}, icon.props), {
|
|
5247
|
+
size: (_a = icon.props.size) != null ? _a : 18
|
|
5248
|
+
})) : icon }),
|
|
5249
|
+
/* @__PURE__ */ jsx72(ListItemText5, { primary: label })
|
|
5164
5250
|
] });
|
|
5165
5251
|
};
|
|
5166
5252
|
UserMenuLogout.displayName = "UserMenu.Logout";
|
|
5167
5253
|
|
|
5168
5254
|
// src/components/UserMenu/UserMenuDivider.tsx
|
|
5169
5255
|
import Divider9 from "@mui/material/Divider";
|
|
5170
|
-
import { jsx as
|
|
5171
|
-
var UserMenuDivider = () => /* @__PURE__ */
|
|
5256
|
+
import { jsx as jsx73 } from "react/jsx-runtime";
|
|
5257
|
+
var UserMenuDivider = () => /* @__PURE__ */ jsx73(Divider9, {});
|
|
5172
5258
|
UserMenuDivider.displayName = "UserMenu.Divider";
|
|
5173
5259
|
|
|
5174
5260
|
// src/components/UserMenu/UserMenu.tsx
|
|
5175
|
-
import { jsx as
|
|
5261
|
+
import { jsx as jsx74, jsxs as jsxs27 } from "react/jsx-runtime";
|
|
5176
5262
|
var UserMenu = ({ children }) => {
|
|
5177
|
-
const [anchorEl, setAnchorEl] =
|
|
5263
|
+
const [anchorEl, setAnchorEl] = React28.useState(null);
|
|
5178
5264
|
const open = Boolean(anchorEl);
|
|
5179
5265
|
const handleOpen = (event) => {
|
|
5180
5266
|
setAnchorEl(event.currentTarget);
|
|
@@ -5182,16 +5268,16 @@ var UserMenu = ({ children }) => {
|
|
|
5182
5268
|
const handleClose = () => {
|
|
5183
5269
|
setAnchorEl(null);
|
|
5184
5270
|
};
|
|
5185
|
-
const childrenArray =
|
|
5271
|
+
const childrenArray = React28.Children.toArray(children);
|
|
5186
5272
|
const triggerChild = childrenArray.find(
|
|
5187
|
-
(child) =>
|
|
5273
|
+
(child) => React28.isValidElement(child) && child.type === UserMenuTrigger
|
|
5188
5274
|
);
|
|
5189
5275
|
const menuChildren = childrenArray.filter(
|
|
5190
|
-
(child) =>
|
|
5276
|
+
(child) => React28.isValidElement(child) && child.type !== UserMenuTrigger
|
|
5191
5277
|
);
|
|
5192
5278
|
return /* @__PURE__ */ jsxs27(UserMenuContext.Provider, { value: { open, anchorEl, handleOpen, handleClose }, children: [
|
|
5193
5279
|
triggerChild,
|
|
5194
|
-
/* @__PURE__ */
|
|
5280
|
+
/* @__PURE__ */ jsx74(
|
|
5195
5281
|
Menu2,
|
|
5196
5282
|
{
|
|
5197
5283
|
id: "user-menu",
|
|
@@ -5221,14 +5307,14 @@ UserMenu.Divider = UserMenuDivider;
|
|
|
5221
5307
|
UserMenu.displayName = "UserMenu";
|
|
5222
5308
|
|
|
5223
5309
|
// src/components/NotificationBanner/NotificationBanner.tsx
|
|
5224
|
-
import * as
|
|
5310
|
+
import * as React29 from "react";
|
|
5225
5311
|
import Alert from "@mui/material/Alert";
|
|
5226
5312
|
import AlertTitle from "@mui/material/AlertTitle";
|
|
5227
5313
|
import Collapse2 from "@mui/material/Collapse";
|
|
5228
5314
|
import Button4 from "@mui/material/Button";
|
|
5229
5315
|
import Box29 from "@mui/material/Box";
|
|
5230
5316
|
import { styled as styled59 } from "@mui/material/styles";
|
|
5231
|
-
import { jsx as
|
|
5317
|
+
import { jsx as jsx75, jsxs as jsxs28 } from "react/jsx-runtime";
|
|
5232
5318
|
var NotificationBannerAlert = styled59(Alert, {
|
|
5233
5319
|
name: "MuiNotificationBanner",
|
|
5234
5320
|
slot: "Root"
|
|
@@ -5277,22 +5363,22 @@ var NotificationBanner = ({
|
|
|
5277
5363
|
onDismiss,
|
|
5278
5364
|
sx
|
|
5279
5365
|
}) => {
|
|
5280
|
-
const [isVisible, setIsVisible] =
|
|
5281
|
-
|
|
5366
|
+
const [isVisible, setIsVisible] = React29.useState(visible);
|
|
5367
|
+
React29.useEffect(() => {
|
|
5282
5368
|
setIsVisible(visible);
|
|
5283
5369
|
}, [visible]);
|
|
5284
5370
|
const handleDismiss = () => {
|
|
5285
5371
|
setIsVisible(false);
|
|
5286
5372
|
onDismiss == null ? void 0 : onDismiss();
|
|
5287
5373
|
};
|
|
5288
|
-
return /* @__PURE__ */
|
|
5374
|
+
return /* @__PURE__ */ jsx75(Collapse2, { in: isVisible, children: /* @__PURE__ */ jsx75(
|
|
5289
5375
|
NotificationBannerAlert,
|
|
5290
5376
|
{
|
|
5291
5377
|
severity,
|
|
5292
5378
|
variant: "filled",
|
|
5293
5379
|
onClose: handleDismiss,
|
|
5294
5380
|
sx,
|
|
5295
|
-
action: actionLabel && onAction ? /* @__PURE__ */
|
|
5381
|
+
action: actionLabel && onAction ? /* @__PURE__ */ jsx75(
|
|
5296
5382
|
NotificationBannerAction,
|
|
5297
5383
|
{
|
|
5298
5384
|
color: "inherit",
|
|
@@ -5302,8 +5388,8 @@ var NotificationBanner = ({
|
|
|
5302
5388
|
}
|
|
5303
5389
|
) : void 0,
|
|
5304
5390
|
children: /* @__PURE__ */ jsxs28(NotificationBannerContent, { children: [
|
|
5305
|
-
title && /* @__PURE__ */
|
|
5306
|
-
/* @__PURE__ */
|
|
5391
|
+
title && /* @__PURE__ */ jsx75(AlertTitle, { sx: { mb: 0 }, children: title }),
|
|
5392
|
+
/* @__PURE__ */ jsx75(Box29, { component: "span", children: message })
|
|
5307
5393
|
] })
|
|
5308
5394
|
}
|
|
5309
5395
|
) });
|
|
@@ -5312,7 +5398,7 @@ var NotificationBanner = ({
|
|
|
5312
5398
|
// src/components/Form/CardButton.tsx
|
|
5313
5399
|
import { Card as Card2, ButtonBase, Box as Box30, styled as styled60 } from "@mui/material";
|
|
5314
5400
|
import { CardHeader, CardContent as CardContent2, CardActions, CardMedia } from "@mui/material";
|
|
5315
|
-
import { jsx as
|
|
5401
|
+
import { jsx as jsx76 } from "react/jsx-runtime";
|
|
5316
5402
|
var StyledCardButton = styled60(Card2, {
|
|
5317
5403
|
shouldForwardProp: (prop) => prop !== "selected" && prop !== "disabled"
|
|
5318
5404
|
})(({ theme, selected, disabled, alignItems = "flex-start" }) => ({
|
|
@@ -5341,7 +5427,7 @@ var StyledCardButton = styled60(Card2, {
|
|
|
5341
5427
|
}));
|
|
5342
5428
|
var CardButton = (props) => {
|
|
5343
5429
|
const _a = props, { disabled, selected, alignItems = "flex-start" } = _a, rest = __objRest(_a, ["disabled", "selected", "alignItems"]);
|
|
5344
|
-
return /* @__PURE__ */
|
|
5430
|
+
return /* @__PURE__ */ jsx76(
|
|
5345
5431
|
StyledCardButton,
|
|
5346
5432
|
__spreadValues({
|
|
5347
5433
|
alignItems,
|
|
@@ -5351,36 +5437,36 @@ var CardButton = (props) => {
|
|
|
5351
5437
|
}, rest)
|
|
5352
5438
|
);
|
|
5353
5439
|
};
|
|
5354
|
-
var DisappearingCardButtonContent = (props) => /* @__PURE__ */
|
|
5440
|
+
var DisappearingCardButtonContent = (props) => /* @__PURE__ */ jsx76(Box30, __spreadValues({ className: "creation-flow-card-actions" }, props));
|
|
5355
5441
|
|
|
5356
5442
|
// src/components/Form/Stack.tsx
|
|
5357
5443
|
import { Stack as OxygenStack } from "@mui/material";
|
|
5358
|
-
import { jsx as
|
|
5444
|
+
import { jsx as jsx77 } from "react/jsx-runtime";
|
|
5359
5445
|
var Stack2 = (props) => {
|
|
5360
|
-
return /* @__PURE__ */
|
|
5446
|
+
return /* @__PURE__ */ jsx77(OxygenStack, __spreadValues({ spacing: 2 }, props));
|
|
5361
5447
|
};
|
|
5362
5448
|
|
|
5363
5449
|
// src/components/Form/Typography.tsx
|
|
5364
5450
|
import { Typography as Typography18 } from "@mui/material";
|
|
5365
|
-
import { jsx as
|
|
5451
|
+
import { jsx as jsx78 } from "react/jsx-runtime";
|
|
5366
5452
|
var Header2 = (props) => {
|
|
5367
5453
|
const _a = props, { children } = _a, rest = __objRest(_a, ["children"]);
|
|
5368
|
-
return /* @__PURE__ */
|
|
5454
|
+
return /* @__PURE__ */ jsx78(Typography18, __spreadProps(__spreadValues({}, rest), { variant: "h4", children }));
|
|
5369
5455
|
};
|
|
5370
5456
|
var Subheader = (props) => {
|
|
5371
5457
|
const _a = props, { children } = _a, rest = __objRest(_a, ["children"]);
|
|
5372
|
-
return /* @__PURE__ */
|
|
5458
|
+
return /* @__PURE__ */ jsx78(Typography18, __spreadProps(__spreadValues({}, rest), { variant: "h5", children }));
|
|
5373
5459
|
};
|
|
5374
5460
|
var Body = (props) => {
|
|
5375
5461
|
const _a = props, { children } = _a, rest = __objRest(_a, ["children"]);
|
|
5376
|
-
return /* @__PURE__ */
|
|
5462
|
+
return /* @__PURE__ */ jsx78(Typography18, __spreadProps(__spreadValues({}, rest), { variant: "body2", children }));
|
|
5377
5463
|
};
|
|
5378
5464
|
|
|
5379
5465
|
// src/components/Form/Section.tsx
|
|
5380
5466
|
import { Card as Card3, CardContent as CardContent3, Stack as Stack3 } from "@mui/material";
|
|
5381
|
-
import { jsx as
|
|
5467
|
+
import { jsx as jsx79 } from "react/jsx-runtime";
|
|
5382
5468
|
var Section = ({ children }) => {
|
|
5383
|
-
return /* @__PURE__ */
|
|
5469
|
+
return /* @__PURE__ */ jsx79(Card3, { children: /* @__PURE__ */ jsx79(CardContent3, { children: /* @__PURE__ */ jsx79(Stack3, { direction: "column", spacing: 2, children }) }) });
|
|
5384
5470
|
};
|
|
5385
5471
|
|
|
5386
5472
|
// src/components/Form/Wizard.tsx
|
|
@@ -5394,28 +5480,28 @@ import {
|
|
|
5394
5480
|
} from "@mui/material";
|
|
5395
5481
|
import { styled as styled61 } from "@mui/material/styles";
|
|
5396
5482
|
import { useMemo as useMemo5 } from "react";
|
|
5397
|
-
import { jsx as
|
|
5483
|
+
import { jsx as jsx80, jsxs as jsxs29 } from "react/jsx-runtime";
|
|
5398
5484
|
var StyledWizardActionsStack = styled61(Stack2)(() => ({
|
|
5399
5485
|
justifyContent: "space-between",
|
|
5400
5486
|
flexGrow: 1
|
|
5401
5487
|
}));
|
|
5402
5488
|
function Wizard({ steps, activeStep, actions }) {
|
|
5403
5489
|
const step = useMemo5(() => activeStep < steps.length ? steps[activeStep] : null, [steps, activeStep]);
|
|
5404
|
-
return /* @__PURE__ */
|
|
5405
|
-
/* @__PURE__ */
|
|
5406
|
-
/* @__PURE__ */
|
|
5407
|
-
/* @__PURE__ */
|
|
5408
|
-
/* @__PURE__ */
|
|
5490
|
+
return /* @__PURE__ */ jsx80(Card4, { children: /* @__PURE__ */ jsx80(CardContent4, { children: /* @__PURE__ */ jsxs29(Stack2, { children: [
|
|
5491
|
+
/* @__PURE__ */ jsx80(Stepper, { activeStep, children: steps.map((step2) => /* @__PURE__ */ jsx80(Step, { children: /* @__PURE__ */ jsx80(StepLabel, { children: step2.label }) }, step2.label)) }),
|
|
5492
|
+
/* @__PURE__ */ jsx80(Divider10, {}),
|
|
5493
|
+
/* @__PURE__ */ jsx80(Stack2, { direction: "row", children: step == null ? void 0 : step.component }),
|
|
5494
|
+
/* @__PURE__ */ jsx80(StyledWizardActionsStack, { direction: "row", children: actions })
|
|
5409
5495
|
] }) }) });
|
|
5410
5496
|
}
|
|
5411
5497
|
|
|
5412
5498
|
// src/components/Form/ElementWrapper.tsx
|
|
5413
5499
|
import { FormControl as FormControl3, FormLabel } from "@mui/material";
|
|
5414
|
-
import { jsx as
|
|
5500
|
+
import { jsx as jsx81, jsxs as jsxs30 } from "react/jsx-runtime";
|
|
5415
5501
|
var ElementWrapper = (props) => {
|
|
5416
5502
|
const { label, name, children } = props;
|
|
5417
5503
|
return /* @__PURE__ */ jsxs30(FormControl3, { fullWidth: true, children: [
|
|
5418
|
-
/* @__PURE__ */
|
|
5504
|
+
/* @__PURE__ */ jsx81(FormLabel, { htmlFor: name, children: label }),
|
|
5419
5505
|
children
|
|
5420
5506
|
] });
|
|
5421
5507
|
};
|
|
@@ -5439,15 +5525,15 @@ var Form = {
|
|
|
5439
5525
|
};
|
|
5440
5526
|
|
|
5441
5527
|
// src/components/AppShell/AppShell.tsx
|
|
5442
|
-
import * as
|
|
5528
|
+
import * as React31 from "react";
|
|
5443
5529
|
import Box35 from "@mui/material/Box";
|
|
5444
5530
|
|
|
5445
5531
|
// src/layouts/Layout.tsx
|
|
5446
5532
|
import Box31 from "@mui/material/Box";
|
|
5447
|
-
import { jsx as
|
|
5533
|
+
import { jsx as jsx82 } from "react/jsx-runtime";
|
|
5448
5534
|
function Layout(_a) {
|
|
5449
5535
|
var _b = _a, { children = null, sx } = _b, rest = __objRest(_b, ["children", "sx"]);
|
|
5450
|
-
return /* @__PURE__ */
|
|
5536
|
+
return /* @__PURE__ */ jsx82(
|
|
5451
5537
|
Box31,
|
|
5452
5538
|
__spreadProps(__spreadValues({
|
|
5453
5539
|
sx: __spreadValues({
|
|
@@ -5464,10 +5550,10 @@ var Layout_default = Layout;
|
|
|
5464
5550
|
|
|
5465
5551
|
// src/layouts/LayoutSidebar.tsx
|
|
5466
5552
|
import Box32 from "@mui/material/Box";
|
|
5467
|
-
import { jsx as
|
|
5553
|
+
import { jsx as jsx83 } from "react/jsx-runtime";
|
|
5468
5554
|
function LayoutSidebar(_a) {
|
|
5469
5555
|
var _b = _a, { children = null, sx } = _b, rest = __objRest(_b, ["children", "sx"]);
|
|
5470
|
-
return /* @__PURE__ */
|
|
5556
|
+
return /* @__PURE__ */ jsx83(
|
|
5471
5557
|
Box32,
|
|
5472
5558
|
__spreadProps(__spreadValues({
|
|
5473
5559
|
sx: __spreadValues({
|
|
@@ -5491,10 +5577,10 @@ var LayoutNavbar_default = LayoutNavbar;
|
|
|
5491
5577
|
|
|
5492
5578
|
// src/layouts/LayoutContent.tsx
|
|
5493
5579
|
import Box33 from "@mui/material/Box";
|
|
5494
|
-
import { jsx as
|
|
5580
|
+
import { jsx as jsx84 } from "react/jsx-runtime";
|
|
5495
5581
|
function LayoutContent(_a) {
|
|
5496
5582
|
var _b = _a, { children = null } = _b, rest = __objRest(_b, ["children"]);
|
|
5497
|
-
return /* @__PURE__ */
|
|
5583
|
+
return /* @__PURE__ */ jsx84(
|
|
5498
5584
|
Box33,
|
|
5499
5585
|
__spreadProps(__spreadValues({
|
|
5500
5586
|
component: "main",
|
|
@@ -5514,10 +5600,10 @@ var LayoutContent_default = LayoutContent;
|
|
|
5514
5600
|
|
|
5515
5601
|
// src/layouts/LayoutHeader.tsx
|
|
5516
5602
|
import Box34 from "@mui/material/Box";
|
|
5517
|
-
import { jsx as
|
|
5603
|
+
import { jsx as jsx85 } from "react/jsx-runtime";
|
|
5518
5604
|
function LayoutHeader(_a) {
|
|
5519
5605
|
var _b = _a, { children = null, sx } = _b, rest = __objRest(_b, ["children", "sx"]);
|
|
5520
|
-
return /* @__PURE__ */
|
|
5606
|
+
return /* @__PURE__ */ jsx85(
|
|
5521
5607
|
Box34,
|
|
5522
5608
|
__spreadProps(__spreadValues({
|
|
5523
5609
|
sx: __spreadValues({
|
|
@@ -5541,42 +5627,140 @@ var Layout2 = Object.assign(Layout_default, {
|
|
|
5541
5627
|
var layouts_default = Layout2;
|
|
5542
5628
|
|
|
5543
5629
|
// src/components/AppShell/AppShellNavbar.tsx
|
|
5544
|
-
import { Fragment as Fragment10, jsx as
|
|
5630
|
+
import { Fragment as Fragment10, jsx as jsx86 } from "react/jsx-runtime";
|
|
5545
5631
|
var AppShellNavbar = ({ children }) => {
|
|
5546
|
-
return /* @__PURE__ */
|
|
5632
|
+
return /* @__PURE__ */ jsx86(Fragment10, { children });
|
|
5547
5633
|
};
|
|
5548
5634
|
AppShellNavbar.displayName = "AppShellNavbar";
|
|
5549
5635
|
|
|
5550
5636
|
// src/components/AppShell/AppShellSidebar.tsx
|
|
5551
|
-
import { Fragment as Fragment11, jsx as
|
|
5637
|
+
import { Fragment as Fragment11, jsx as jsx87 } from "react/jsx-runtime";
|
|
5552
5638
|
var AppShellSidebar = ({ children }) => {
|
|
5553
|
-
return /* @__PURE__ */
|
|
5639
|
+
return /* @__PURE__ */ jsx87(Fragment11, { children });
|
|
5554
5640
|
};
|
|
5555
5641
|
AppShellSidebar.displayName = "AppShellSidebar";
|
|
5556
5642
|
|
|
5557
5643
|
// src/components/AppShell/AppShellMain.tsx
|
|
5558
|
-
import { Fragment as Fragment12, jsx as
|
|
5644
|
+
import { Fragment as Fragment12, jsx as jsx88 } from "react/jsx-runtime";
|
|
5559
5645
|
var AppShellMain = ({ children }) => {
|
|
5560
|
-
return /* @__PURE__ */
|
|
5646
|
+
return /* @__PURE__ */ jsx88(Fragment12, { children });
|
|
5561
5647
|
};
|
|
5562
5648
|
AppShellMain.displayName = "AppShellMain";
|
|
5563
5649
|
|
|
5564
5650
|
// src/components/AppShell/AppShellFooter.tsx
|
|
5565
|
-
import { Fragment as Fragment13, jsx as
|
|
5651
|
+
import { Fragment as Fragment13, jsx as jsx89 } from "react/jsx-runtime";
|
|
5566
5652
|
var AppShellFooter = ({ children }) => {
|
|
5567
|
-
return /* @__PURE__ */
|
|
5653
|
+
return /* @__PURE__ */ jsx89(Fragment13, { children });
|
|
5568
5654
|
};
|
|
5569
5655
|
AppShellFooter.displayName = "AppShellFooter";
|
|
5570
5656
|
|
|
5571
5657
|
// src/components/AppShell/AppShellNotificationPanel.tsx
|
|
5572
|
-
import { Fragment as Fragment14, jsx as
|
|
5658
|
+
import { Fragment as Fragment14, jsx as jsx90 } from "react/jsx-runtime";
|
|
5573
5659
|
var AppShellNotificationPanel = ({ children }) => {
|
|
5574
|
-
return /* @__PURE__ */
|
|
5660
|
+
return /* @__PURE__ */ jsx90(Fragment14, { children });
|
|
5575
5661
|
};
|
|
5576
5662
|
AppShellNotificationPanel.displayName = "AppShellNotificationPanel";
|
|
5577
5663
|
|
|
5664
|
+
// src/hooks/useAppShell/useAppShell.ts
|
|
5665
|
+
import * as React30 from "react";
|
|
5666
|
+
import useMediaQuery2 from "@mui/material/useMediaQuery";
|
|
5667
|
+
var useAppShell = (options) => {
|
|
5668
|
+
const contextValue = React30.useContext(AppShellContext);
|
|
5669
|
+
const {
|
|
5670
|
+
initialCollapsed = false,
|
|
5671
|
+
initialActiveItem = "dashboard",
|
|
5672
|
+
collapseOnSelectOnMobile = true,
|
|
5673
|
+
collapseOnMobile = true,
|
|
5674
|
+
sidebarWidth = 250,
|
|
5675
|
+
sidebarCollapsedWidth = 64
|
|
5676
|
+
} = options || {};
|
|
5677
|
+
const isMobile = useMediaQuery2((theme) => theme.breakpoints.down("md"));
|
|
5678
|
+
const [state, setState] = React30.useState({
|
|
5679
|
+
sidebarCollapsed: initialCollapsed,
|
|
5680
|
+
notificationPanelOpen: false,
|
|
5681
|
+
activeMenuItem: initialActiveItem,
|
|
5682
|
+
expandedMenus: {},
|
|
5683
|
+
sidebarWidth,
|
|
5684
|
+
sidebarCollapsedWidth
|
|
5685
|
+
});
|
|
5686
|
+
React30.useEffect(() => {
|
|
5687
|
+
if (options && collapseOnMobile && isMobile) {
|
|
5688
|
+
setState((prev) => __spreadProps(__spreadValues({}, prev), { sidebarCollapsed: true }));
|
|
5689
|
+
}
|
|
5690
|
+
}, [options, collapseOnMobile, isMobile]);
|
|
5691
|
+
const toggleSidebar = React30.useCallback(() => {
|
|
5692
|
+
setState((prev) => __spreadProps(__spreadValues({}, prev), { sidebarCollapsed: !prev.sidebarCollapsed }));
|
|
5693
|
+
}, []);
|
|
5694
|
+
const setSidebarCollapsed = React30.useCallback((collapsed) => {
|
|
5695
|
+
setState((prev) => __spreadProps(__spreadValues({}, prev), { sidebarCollapsed: collapsed }));
|
|
5696
|
+
}, []);
|
|
5697
|
+
const collapseSidebar = React30.useCallback(() => {
|
|
5698
|
+
setState((prev) => __spreadProps(__spreadValues({}, prev), { sidebarCollapsed: true }));
|
|
5699
|
+
}, []);
|
|
5700
|
+
const expandSidebar = React30.useCallback(() => {
|
|
5701
|
+
setState((prev) => __spreadProps(__spreadValues({}, prev), { sidebarCollapsed: false }));
|
|
5702
|
+
}, []);
|
|
5703
|
+
const toggleNotificationPanel = React30.useCallback(() => {
|
|
5704
|
+
setState((prev) => __spreadProps(__spreadValues({}, prev), {
|
|
5705
|
+
notificationPanelOpen: !prev.notificationPanelOpen
|
|
5706
|
+
}));
|
|
5707
|
+
}, []);
|
|
5708
|
+
const setActiveMenuItem = React30.useCallback((id) => {
|
|
5709
|
+
setState((prev) => {
|
|
5710
|
+
const newState = __spreadProps(__spreadValues({}, prev), { activeMenuItem: id });
|
|
5711
|
+
if (collapseOnSelectOnMobile && isMobile && !prev.sidebarCollapsed) {
|
|
5712
|
+
newState.sidebarCollapsed = true;
|
|
5713
|
+
}
|
|
5714
|
+
return newState;
|
|
5715
|
+
});
|
|
5716
|
+
}, [collapseOnSelectOnMobile, isMobile]);
|
|
5717
|
+
const toggleMenu = React30.useCallback((id) => {
|
|
5718
|
+
setState((prev) => __spreadProps(__spreadValues({}, prev), {
|
|
5719
|
+
expandedMenus: __spreadProps(__spreadValues({}, prev.expandedMenus), {
|
|
5720
|
+
[id]: !prev.expandedMenus[id]
|
|
5721
|
+
})
|
|
5722
|
+
}));
|
|
5723
|
+
}, []);
|
|
5724
|
+
const actions = React30.useMemo(
|
|
5725
|
+
() => ({
|
|
5726
|
+
toggleSidebar,
|
|
5727
|
+
setSidebarCollapsed,
|
|
5728
|
+
collapseSidebar,
|
|
5729
|
+
expandSidebar,
|
|
5730
|
+
toggleNotificationPanel,
|
|
5731
|
+
setActiveMenuItem,
|
|
5732
|
+
toggleMenu
|
|
5733
|
+
}),
|
|
5734
|
+
[
|
|
5735
|
+
toggleSidebar,
|
|
5736
|
+
setSidebarCollapsed,
|
|
5737
|
+
collapseSidebar,
|
|
5738
|
+
expandSidebar,
|
|
5739
|
+
toggleNotificationPanel,
|
|
5740
|
+
setActiveMenuItem,
|
|
5741
|
+
toggleMenu
|
|
5742
|
+
]
|
|
5743
|
+
);
|
|
5744
|
+
const createdValue = React30.useMemo(
|
|
5745
|
+
() => ({
|
|
5746
|
+
state,
|
|
5747
|
+
actions
|
|
5748
|
+
}),
|
|
5749
|
+
[state, actions]
|
|
5750
|
+
);
|
|
5751
|
+
if (options === void 0) {
|
|
5752
|
+
if (!contextValue) {
|
|
5753
|
+
throw new Error(
|
|
5754
|
+
"useAppShell() must be used within an <AppShell> component. Either wrap your component tree with <AppShell> or pass options to create a new instance.\n\nExample usage:\n// As a child of AppShell (consumes context):\nfunction MyPage() {\n const { state, actions } = useAppShell();\n // ...\n}\n\n// Or create instance with options:\nconst shell = useAppShell({ initialCollapsed: false });"
|
|
5755
|
+
);
|
|
5756
|
+
}
|
|
5757
|
+
return contextValue;
|
|
5758
|
+
}
|
|
5759
|
+
return createdValue;
|
|
5760
|
+
};
|
|
5761
|
+
|
|
5578
5762
|
// src/components/AppShell/AppShell.tsx
|
|
5579
|
-
import { jsx as
|
|
5763
|
+
import { jsx as jsx91, jsxs as jsxs31 } from "react/jsx-runtime";
|
|
5580
5764
|
var SLOT_DISPLAY_NAMES = {
|
|
5581
5765
|
Navbar: "AppShellNavbar",
|
|
5582
5766
|
Sidebar: "AppShellSidebar",
|
|
@@ -5592,9 +5776,9 @@ var extractSlots = (children) => {
|
|
|
5592
5776
|
footer: null,
|
|
5593
5777
|
notificationPanel: null
|
|
5594
5778
|
};
|
|
5595
|
-
|
|
5779
|
+
React31.Children.forEach(children, (child) => {
|
|
5596
5780
|
var _a;
|
|
5597
|
-
if (
|
|
5781
|
+
if (React31.isValidElement(child)) {
|
|
5598
5782
|
const displayName = (_a = child.type) == null ? void 0 : _a.displayName;
|
|
5599
5783
|
const childProps = child.props;
|
|
5600
5784
|
switch (displayName) {
|
|
@@ -5622,19 +5806,21 @@ var extractSlots = (children) => {
|
|
|
5622
5806
|
});
|
|
5623
5807
|
return slots;
|
|
5624
5808
|
};
|
|
5625
|
-
var AppShell = (
|
|
5809
|
+
var AppShell = (_a) => {
|
|
5810
|
+
var _b = _a, { children, sx } = _b, shellOptions = __objRest(_b, ["children", "sx"]);
|
|
5811
|
+
const shell = useAppShell(shellOptions);
|
|
5626
5812
|
const slots = extractSlots(children);
|
|
5627
|
-
return /* @__PURE__ */ jsxs31(layouts_default, { sx: __spreadValues({ height: "100vh", flexDirection: "column" }, sx), children: [
|
|
5628
|
-
slots.navbar && /* @__PURE__ */
|
|
5813
|
+
return /* @__PURE__ */ jsx91(AppShellContext.Provider, { value: shell, children: /* @__PURE__ */ jsxs31(layouts_default, { sx: __spreadValues({ height: "100vh", flexDirection: "column" }, sx), children: [
|
|
5814
|
+
slots.navbar && /* @__PURE__ */ jsx91(layouts_default.Navbar, { children: slots.navbar }),
|
|
5629
5815
|
/* @__PURE__ */ jsxs31(layouts_default, { sx: { flex: 1, overflow: "hidden" }, children: [
|
|
5630
|
-
slots.sidebar && /* @__PURE__ */
|
|
5816
|
+
slots.sidebar && /* @__PURE__ */ jsx91(layouts_default.Sidebar, { children: slots.sidebar }),
|
|
5631
5817
|
/* @__PURE__ */ jsxs31(layouts_default.Content, { sx: { flex: 1, display: "flex", flexDirection: "column" }, children: [
|
|
5632
|
-
/* @__PURE__ */
|
|
5818
|
+
/* @__PURE__ */ jsx91(Box35, { sx: { flex: 1, overflow: "auto", display: "flex" }, children: slots.main }),
|
|
5633
5819
|
slots.footer
|
|
5634
5820
|
] })
|
|
5635
5821
|
] }),
|
|
5636
5822
|
slots.notificationPanel
|
|
5637
|
-
] });
|
|
5823
|
+
] }) });
|
|
5638
5824
|
};
|
|
5639
5825
|
AppShell.Navbar = AppShellNavbar;
|
|
5640
5826
|
AppShell.Sidebar = AppShellSidebar;
|
|
@@ -5657,7 +5843,7 @@ var densityStyles = {
|
|
|
5657
5843
|
// src/components/ListingTable/ListingTable/ListingTableContainer.tsx
|
|
5658
5844
|
import MuiTableContainer from "@mui/material/TableContainer";
|
|
5659
5845
|
import Paper from "@mui/material/Paper";
|
|
5660
|
-
import { jsx as
|
|
5846
|
+
import { jsx as jsx92 } from "react/jsx-runtime";
|
|
5661
5847
|
function ListingTableContainer(_a) {
|
|
5662
5848
|
var _b = _a, {
|
|
5663
5849
|
elevation = 1,
|
|
@@ -5669,16 +5855,16 @@ function ListingTableContainer(_a) {
|
|
|
5669
5855
|
"children"
|
|
5670
5856
|
]);
|
|
5671
5857
|
if (disablePaper) {
|
|
5672
|
-
return /* @__PURE__ */
|
|
5858
|
+
return /* @__PURE__ */ jsx92(MuiTableContainer, __spreadProps(__spreadValues({ sx: __spreadValues({ width: "100%" }, props.sx) }, props), { children }));
|
|
5673
5859
|
}
|
|
5674
|
-
return /* @__PURE__ */
|
|
5860
|
+
return /* @__PURE__ */ jsx92(MuiTableContainer, __spreadProps(__spreadValues({ component: Paper, elevation, sx: __spreadValues({ width: "100%" }, props.sx) }, props), { children }));
|
|
5675
5861
|
}
|
|
5676
5862
|
var ListingTableContainer_default = ListingTableContainer;
|
|
5677
5863
|
|
|
5678
5864
|
// src/components/ListingTable/ListingTable/ListingTableHead.tsx
|
|
5679
5865
|
import MuiTableHead from "@mui/material/TableHead";
|
|
5680
5866
|
import { styled as styled62 } from "@mui/material/styles";
|
|
5681
|
-
import { jsx as
|
|
5867
|
+
import { jsx as jsx93 } from "react/jsx-runtime";
|
|
5682
5868
|
var StyledTableHead = styled62(MuiTableHead)(({ theme }) => ({
|
|
5683
5869
|
"& .MuiTableCell-head": __spreadValues(__spreadValues({
|
|
5684
5870
|
fontWeight: 600
|
|
@@ -5690,32 +5876,32 @@ var StyledTableHead = styled62(MuiTableHead)(({ theme }) => ({
|
|
|
5690
5876
|
}));
|
|
5691
5877
|
function ListingTableHead(_a) {
|
|
5692
5878
|
var _b = _a, { children } = _b, props = __objRest(_b, ["children"]);
|
|
5693
|
-
return /* @__PURE__ */
|
|
5879
|
+
return /* @__PURE__ */ jsx93(StyledTableHead, __spreadProps(__spreadValues({}, props), { children }));
|
|
5694
5880
|
}
|
|
5695
5881
|
var ListingTableHead_default = ListingTableHead;
|
|
5696
5882
|
|
|
5697
5883
|
// src/components/ListingTable/ListingTable/ListingTableBody.tsx
|
|
5698
5884
|
import MuiTableBody from "@mui/material/TableBody";
|
|
5699
|
-
import { jsx as
|
|
5885
|
+
import { jsx as jsx94 } from "react/jsx-runtime";
|
|
5700
5886
|
function ListingTableBody(_a) {
|
|
5701
5887
|
var _b = _a, { children } = _b, props = __objRest(_b, ["children"]);
|
|
5702
|
-
return /* @__PURE__ */
|
|
5888
|
+
return /* @__PURE__ */ jsx94(MuiTableBody, __spreadProps(__spreadValues({}, props), { children }));
|
|
5703
5889
|
}
|
|
5704
5890
|
var ListingTableBody_default = ListingTableBody;
|
|
5705
5891
|
|
|
5706
5892
|
// src/components/ListingTable/ListingTable/ListingTableFooter.tsx
|
|
5707
5893
|
import MuiTableFooter from "@mui/material/TableFooter";
|
|
5708
|
-
import { jsx as
|
|
5894
|
+
import { jsx as jsx95 } from "react/jsx-runtime";
|
|
5709
5895
|
function ListingTableFooter(_a) {
|
|
5710
5896
|
var _b = _a, { children } = _b, props = __objRest(_b, ["children"]);
|
|
5711
|
-
return /* @__PURE__ */
|
|
5897
|
+
return /* @__PURE__ */ jsx95(MuiTableFooter, __spreadProps(__spreadValues({}, props), { children }));
|
|
5712
5898
|
}
|
|
5713
5899
|
var ListingTableFooter_default = ListingTableFooter;
|
|
5714
5900
|
|
|
5715
5901
|
// src/components/ListingTable/ListingTable/ListingTableRow.tsx
|
|
5716
5902
|
import MuiTableRow from "@mui/material/TableRow";
|
|
5717
5903
|
import { styled as styled63, alpha } from "@mui/material/styles";
|
|
5718
|
-
import { jsx as
|
|
5904
|
+
import { jsx as jsx96 } from "react/jsx-runtime";
|
|
5719
5905
|
var StyledTableRow = styled63(MuiTableRow, {
|
|
5720
5906
|
shouldForwardProp: (prop) => !["clickable", "variant"].includes(prop)
|
|
5721
5907
|
})(({ theme: muiTheme, clickable, variant = "table" }) => {
|
|
@@ -5774,14 +5960,14 @@ function ListingTableRow(_a) {
|
|
|
5774
5960
|
"variant",
|
|
5775
5961
|
"children"
|
|
5776
5962
|
]);
|
|
5777
|
-
return /* @__PURE__ */
|
|
5963
|
+
return /* @__PURE__ */ jsx96(StyledTableRow, __spreadProps(__spreadValues({ clickable, variant }, props), { children }));
|
|
5778
5964
|
}
|
|
5779
5965
|
var ListingTableRow_default = ListingTableRow;
|
|
5780
5966
|
|
|
5781
5967
|
// src/components/ListingTable/ListingTable/ListingTableCell.tsx
|
|
5782
5968
|
import MuiTableCell from "@mui/material/TableCell";
|
|
5783
5969
|
import { styled as styled64 } from "@mui/material/styles";
|
|
5784
|
-
import { jsx as
|
|
5970
|
+
import { jsx as jsx97 } from "react/jsx-runtime";
|
|
5785
5971
|
var StyledTableCell = styled64(MuiTableCell, {
|
|
5786
5972
|
shouldForwardProp: (prop) => {
|
|
5787
5973
|
const excludedProps = ["truncate", "maxWidth"];
|
|
@@ -5804,12 +5990,12 @@ function ListingTableCell(_a) {
|
|
|
5804
5990
|
"maxWidth",
|
|
5805
5991
|
"children"
|
|
5806
5992
|
]);
|
|
5807
|
-
return /* @__PURE__ */
|
|
5993
|
+
return /* @__PURE__ */ jsx97(StyledTableCell, __spreadProps(__spreadValues({ truncate, maxWidth }, props), { children }));
|
|
5808
5994
|
}
|
|
5809
5995
|
var ListingTableCell_default = ListingTableCell;
|
|
5810
5996
|
|
|
5811
5997
|
// src/components/ListingTable/shared/ListingTableToolbar.tsx
|
|
5812
|
-
import { useState as
|
|
5998
|
+
import { useState as useState7, useCallback as useCallback2 } from "react";
|
|
5813
5999
|
import Box36 from "@mui/material/Box";
|
|
5814
6000
|
import TextField3 from "@mui/material/TextField";
|
|
5815
6001
|
import InputAdornment3 from "@mui/material/InputAdornment";
|
|
@@ -5817,14 +6003,14 @@ import IconButton7 from "@mui/material/IconButton";
|
|
|
5817
6003
|
import { Search as Search3, X as X4 } from "@wso2/oxygen-ui-icons-react";
|
|
5818
6004
|
|
|
5819
6005
|
// src/components/ListingTable/context.ts
|
|
5820
|
-
import * as
|
|
5821
|
-
var ListingTableContext =
|
|
6006
|
+
import * as React32 from "react";
|
|
6007
|
+
var ListingTableContext = React32.createContext(null);
|
|
5822
6008
|
ListingTableContext.displayName = "ListingTableContext";
|
|
5823
6009
|
var useListingTable = () => {
|
|
5824
|
-
return
|
|
6010
|
+
return React32.useContext(ListingTableContext);
|
|
5825
6011
|
};
|
|
5826
6012
|
var useListingTableRequired = () => {
|
|
5827
|
-
const context =
|
|
6013
|
+
const context = React32.useContext(ListingTableContext);
|
|
5828
6014
|
if (!context) {
|
|
5829
6015
|
throw new Error(
|
|
5830
6016
|
"useListingTableRequired must be used within a ListingTable.Provider. Use useListingTable() for optional context access."
|
|
@@ -5834,7 +6020,7 @@ var useListingTableRequired = () => {
|
|
|
5834
6020
|
};
|
|
5835
6021
|
|
|
5836
6022
|
// src/components/ListingTable/shared/ListingTableToolbar.tsx
|
|
5837
|
-
import { Fragment as Fragment15, jsx as
|
|
6023
|
+
import { Fragment as Fragment15, jsx as jsx98, jsxs as jsxs32 } from "react/jsx-runtime";
|
|
5838
6024
|
function ListingTableToolbar({
|
|
5839
6025
|
showSearch = false,
|
|
5840
6026
|
searchSlot,
|
|
@@ -5848,13 +6034,13 @@ function ListingTableToolbar({
|
|
|
5848
6034
|
sx
|
|
5849
6035
|
}) {
|
|
5850
6036
|
const tableContext = useListingTable();
|
|
5851
|
-
const [internalSearchValue, setInternalSearchValue] =
|
|
6037
|
+
const [internalSearchValue, setInternalSearchValue] = useState7("");
|
|
5852
6038
|
const isControlledByProp = controlledSearchValue !== void 0;
|
|
5853
6039
|
const isControlledByContext = !isControlledByProp && (tableContext == null ? void 0 : tableContext.searchValue) !== void 0;
|
|
5854
6040
|
const isControlled = isControlledByProp || isControlledByContext;
|
|
5855
6041
|
const searchValue = isControlledByProp ? controlledSearchValue : isControlledByContext ? tableContext.searchValue : internalSearchValue;
|
|
5856
6042
|
const effectiveOnSearchChange = onSearchChange != null ? onSearchChange : tableContext == null ? void 0 : tableContext.onSearchChange;
|
|
5857
|
-
const handleSearchChange =
|
|
6043
|
+
const handleSearchChange = useCallback2(
|
|
5858
6044
|
(event) => {
|
|
5859
6045
|
const newValue = event.target.value;
|
|
5860
6046
|
if (!isControlled) {
|
|
@@ -5864,7 +6050,7 @@ function ListingTableToolbar({
|
|
|
5864
6050
|
},
|
|
5865
6051
|
[isControlled, effectiveOnSearchChange]
|
|
5866
6052
|
);
|
|
5867
|
-
const handleClearSearch =
|
|
6053
|
+
const handleClearSearch = useCallback2(() => {
|
|
5868
6054
|
if (!isControlled) {
|
|
5869
6055
|
setInternalSearchValue("");
|
|
5870
6056
|
}
|
|
@@ -5875,7 +6061,7 @@ function ListingTableToolbar({
|
|
|
5875
6061
|
return searchSlot;
|
|
5876
6062
|
}
|
|
5877
6063
|
if (showSearch) {
|
|
5878
|
-
return /* @__PURE__ */
|
|
6064
|
+
return /* @__PURE__ */ jsx98(
|
|
5879
6065
|
TextField3,
|
|
5880
6066
|
{
|
|
5881
6067
|
size: "small",
|
|
@@ -5887,8 +6073,8 @@ function ListingTableToolbar({
|
|
|
5887
6073
|
maxWidth: searchMaxWidth
|
|
5888
6074
|
},
|
|
5889
6075
|
InputProps: {
|
|
5890
|
-
startAdornment: /* @__PURE__ */
|
|
5891
|
-
endAdornment: searchValue ? /* @__PURE__ */
|
|
6076
|
+
startAdornment: /* @__PURE__ */ jsx98(InputAdornment3, { position: "start", children: /* @__PURE__ */ jsx98(Search3, { size: 18 }) }),
|
|
6077
|
+
endAdornment: searchValue ? /* @__PURE__ */ jsx98(InputAdornment3, { position: "end", children: /* @__PURE__ */ jsx98(IconButton7, { size: "small", onClick: handleClearSearch, edge: "end", children: /* @__PURE__ */ jsx98(X4, { size: 16 }) }) }) : null
|
|
5892
6078
|
}
|
|
5893
6079
|
}
|
|
5894
6080
|
);
|
|
@@ -5910,8 +6096,8 @@ function ListingTableToolbar({
|
|
|
5910
6096
|
renderSearch(),
|
|
5911
6097
|
children,
|
|
5912
6098
|
actions && /* @__PURE__ */ jsxs32(Fragment15, { children: [
|
|
5913
|
-
/* @__PURE__ */
|
|
5914
|
-
/* @__PURE__ */
|
|
6099
|
+
/* @__PURE__ */ jsx98(Box36, { sx: { flex: 1 } }),
|
|
6100
|
+
/* @__PURE__ */ jsx98(Box36, { sx: { display: "flex", alignItems: "center", gap: 1 }, children: actions })
|
|
5915
6101
|
] })
|
|
5916
6102
|
]
|
|
5917
6103
|
}
|
|
@@ -5922,7 +6108,7 @@ var ListingTableToolbar_default = ListingTableToolbar;
|
|
|
5922
6108
|
// src/components/ListingTable/shared/ListingTableEmptyState.tsx
|
|
5923
6109
|
import Box37 from "@mui/material/Box";
|
|
5924
6110
|
import Typography19 from "@mui/material/Typography";
|
|
5925
|
-
import { jsx as
|
|
6111
|
+
import { jsx as jsx99, jsxs as jsxs33 } from "react/jsx-runtime";
|
|
5926
6112
|
function ListingTableEmptyState({
|
|
5927
6113
|
title = "No data available",
|
|
5928
6114
|
description,
|
|
@@ -5944,7 +6130,7 @@ function ListingTableEmptyState({
|
|
|
5944
6130
|
textAlign: "center"
|
|
5945
6131
|
}, sx),
|
|
5946
6132
|
children: [
|
|
5947
|
-
illustration && /* @__PURE__ */
|
|
6133
|
+
illustration && /* @__PURE__ */ jsx99(
|
|
5948
6134
|
Box37,
|
|
5949
6135
|
{
|
|
5950
6136
|
sx: {
|
|
@@ -5958,9 +6144,9 @@ function ListingTableEmptyState({
|
|
|
5958
6144
|
children: illustration
|
|
5959
6145
|
}
|
|
5960
6146
|
),
|
|
5961
|
-
/* @__PURE__ */
|
|
5962
|
-
description && /* @__PURE__ */
|
|
5963
|
-
action && /* @__PURE__ */
|
|
6147
|
+
/* @__PURE__ */ jsx99(Typography19, { variant: "h6", component: "div", sx: { mb: description ? 1 : 0, fontWeight: 500 }, children: title }),
|
|
6148
|
+
description && /* @__PURE__ */ jsx99(Typography19, { variant: "body2", color: "text.secondary", sx: { mb: action ? 2 : 0, maxWidth: 400 }, children: description }),
|
|
6149
|
+
action && /* @__PURE__ */ jsx99(Box37, { children: action })
|
|
5964
6150
|
]
|
|
5965
6151
|
}
|
|
5966
6152
|
);
|
|
@@ -5968,16 +6154,16 @@ function ListingTableEmptyState({
|
|
|
5968
6154
|
var ListingTableEmptyState_default = ListingTableEmptyState;
|
|
5969
6155
|
|
|
5970
6156
|
// src/components/ListingTable/shared/ListingTableDensityControl.tsx
|
|
5971
|
-
import { useCallback as
|
|
6157
|
+
import { useCallback as useCallback3 } from "react";
|
|
5972
6158
|
import ToggleButton from "@mui/material/ToggleButton";
|
|
5973
6159
|
import ToggleButtonGroup from "@mui/material/ToggleButtonGroup";
|
|
5974
6160
|
import Tooltip6 from "@mui/material/Tooltip";
|
|
5975
6161
|
import { AlignJustify, Menu as Menu3, List as List4 } from "@wso2/oxygen-ui-icons-react";
|
|
5976
|
-
import { jsx as
|
|
6162
|
+
import { jsx as jsx100 } from "react/jsx-runtime";
|
|
5977
6163
|
var densityOptions = [
|
|
5978
|
-
{ value: "compact", label: "Compact", icon: /* @__PURE__ */
|
|
5979
|
-
{ value: "standard", label: "Standard", icon: /* @__PURE__ */
|
|
5980
|
-
{ value: "comfortable", label: "Comfortable", icon: /* @__PURE__ */
|
|
6164
|
+
{ value: "compact", label: "Compact", icon: /* @__PURE__ */ jsx100(AlignJustify, { size: 18 }) },
|
|
6165
|
+
{ value: "standard", label: "Standard", icon: /* @__PURE__ */ jsx100(Menu3, { size: 18 }) },
|
|
6166
|
+
{ value: "comfortable", label: "Comfortable", icon: /* @__PURE__ */ jsx100(List4, { size: 18 }) }
|
|
5981
6167
|
];
|
|
5982
6168
|
function ListingTableDensityControl({
|
|
5983
6169
|
value: valueProp,
|
|
@@ -5989,7 +6175,7 @@ function ListingTableDensityControl({
|
|
|
5989
6175
|
const tableContext = useListingTable();
|
|
5990
6176
|
const value = (_a = valueProp != null ? valueProp : tableContext == null ? void 0 : tableContext.density) != null ? _a : "standard";
|
|
5991
6177
|
const effectiveOnChange = onChangeProp != null ? onChangeProp : tableContext == null ? void 0 : tableContext.onDensityChange;
|
|
5992
|
-
const handleChange =
|
|
6178
|
+
const handleChange = useCallback3(
|
|
5993
6179
|
(_event, newDensity) => {
|
|
5994
6180
|
if (newDensity !== null) {
|
|
5995
6181
|
effectiveOnChange == null ? void 0 : effectiveOnChange(newDensity);
|
|
@@ -5997,15 +6183,15 @@ function ListingTableDensityControl({
|
|
|
5997
6183
|
},
|
|
5998
6184
|
[effectiveOnChange]
|
|
5999
6185
|
);
|
|
6000
|
-
return /* @__PURE__ */
|
|
6186
|
+
return /* @__PURE__ */ jsx100(ToggleButtonGroup, { value, exclusive: true, onChange: handleChange, size, sx, children: densityOptions.map((option) => /* @__PURE__ */ jsx100(ToggleButton, { value: option.value, children: /* @__PURE__ */ jsx100(Tooltip6, { title: option.label, children: /* @__PURE__ */ jsx100("span", { style: { display: "flex", alignItems: "center" }, children: option.icon }) }) }, option.value)) });
|
|
6001
6187
|
}
|
|
6002
6188
|
var ListingTableDensityControl_default = ListingTableDensityControl;
|
|
6003
6189
|
|
|
6004
6190
|
// src/components/ListingTable/shared/ListingTableSortLabel.tsx
|
|
6005
|
-
import { useCallback as
|
|
6191
|
+
import { useCallback as useCallback4 } from "react";
|
|
6006
6192
|
import MuiTableSortLabel from "@mui/material/TableSortLabel";
|
|
6007
6193
|
import { styled as styled65 } from "@mui/material/styles";
|
|
6008
|
-
import { jsx as
|
|
6194
|
+
import { jsx as jsx101 } from "react/jsx-runtime";
|
|
6009
6195
|
var StyledTableSortLabel = styled65(MuiTableSortLabel)(({ theme }) => ({
|
|
6010
6196
|
color: "inherit !important",
|
|
6011
6197
|
"&.Mui-active": {
|
|
@@ -6036,7 +6222,7 @@ function ListingTableSortLabel(_a) {
|
|
|
6036
6222
|
const isActiveFromContext = field !== void 0 && (tableContext == null ? void 0 : tableContext.sortField) === field;
|
|
6037
6223
|
const active = activeProp != null ? activeProp : isActiveFromContext;
|
|
6038
6224
|
const direction = (_a2 = directionProp != null ? directionProp : isActiveFromContext ? tableContext == null ? void 0 : tableContext.sortDirection : void 0) != null ? _a2 : "asc";
|
|
6039
|
-
const handleClick =
|
|
6225
|
+
const handleClick = useCallback4(
|
|
6040
6226
|
(event) => {
|
|
6041
6227
|
if (onClickProp) {
|
|
6042
6228
|
onClickProp(event);
|
|
@@ -6049,13 +6235,13 @@ function ListingTableSortLabel(_a) {
|
|
|
6049
6235
|
},
|
|
6050
6236
|
[onClickProp, field, tableContext, active, direction]
|
|
6051
6237
|
);
|
|
6052
|
-
return /* @__PURE__ */
|
|
6238
|
+
return /* @__PURE__ */ jsx101(StyledTableSortLabel, __spreadProps(__spreadValues({ active, direction, onClick: handleClick, hideSortIcon }, props), { children }));
|
|
6053
6239
|
}
|
|
6054
6240
|
var ListingTableSortLabel_default = ListingTableSortLabel;
|
|
6055
6241
|
|
|
6056
6242
|
// src/components/ListingTable/shared/ListingTableRowActions.tsx
|
|
6057
6243
|
import Box38 from "@mui/material/Box";
|
|
6058
|
-
import { jsx as
|
|
6244
|
+
import { jsx as jsx102 } from "react/jsx-runtime";
|
|
6059
6245
|
var alignmentMap = {
|
|
6060
6246
|
left: "flex-start",
|
|
6061
6247
|
center: "center",
|
|
@@ -6067,7 +6253,7 @@ function ListingTableRowActions({
|
|
|
6067
6253
|
align = "right",
|
|
6068
6254
|
sx
|
|
6069
6255
|
}) {
|
|
6070
|
-
return /* @__PURE__ */
|
|
6256
|
+
return /* @__PURE__ */ jsx102(
|
|
6071
6257
|
Box38,
|
|
6072
6258
|
{
|
|
6073
6259
|
className: "table-row-actions",
|
|
@@ -6093,7 +6279,7 @@ var ListingTableRowActions_default = ListingTableRowActions;
|
|
|
6093
6279
|
// src/components/ListingTable/shared/ListingTableCellIcon.tsx
|
|
6094
6280
|
import Box39 from "@mui/material/Box";
|
|
6095
6281
|
import Typography20 from "@mui/material/Typography";
|
|
6096
|
-
import { Fragment as Fragment16, jsx as
|
|
6282
|
+
import { Fragment as Fragment16, jsx as jsx103, jsxs as jsxs34 } from "react/jsx-runtime";
|
|
6097
6283
|
function ListingTableCellIcon({
|
|
6098
6284
|
icon,
|
|
6099
6285
|
primary,
|
|
@@ -6102,7 +6288,7 @@ function ListingTableCellIcon({
|
|
|
6102
6288
|
iconSx,
|
|
6103
6289
|
sx
|
|
6104
6290
|
}) {
|
|
6105
|
-
const iconElement = /* @__PURE__ */
|
|
6291
|
+
const iconElement = /* @__PURE__ */ jsx103(
|
|
6106
6292
|
Box39,
|
|
6107
6293
|
{
|
|
6108
6294
|
sx: __spreadValues({
|
|
@@ -6116,7 +6302,7 @@ function ListingTableCellIcon({
|
|
|
6116
6302
|
}
|
|
6117
6303
|
);
|
|
6118
6304
|
const textContent = /* @__PURE__ */ jsxs34(Box39, { sx: { minWidth: 0, flex: 1 }, children: [
|
|
6119
|
-
/* @__PURE__ */
|
|
6305
|
+
/* @__PURE__ */ jsx103(
|
|
6120
6306
|
Typography20,
|
|
6121
6307
|
{
|
|
6122
6308
|
variant: "body2",
|
|
@@ -6130,7 +6316,7 @@ function ListingTableCellIcon({
|
|
|
6130
6316
|
children: primary
|
|
6131
6317
|
}
|
|
6132
6318
|
),
|
|
6133
|
-
secondary && /* @__PURE__ */
|
|
6319
|
+
secondary && /* @__PURE__ */ jsx103(
|
|
6134
6320
|
Typography20,
|
|
6135
6321
|
{
|
|
6136
6322
|
variant: "caption",
|
|
@@ -6145,7 +6331,7 @@ function ListingTableCellIcon({
|
|
|
6145
6331
|
}
|
|
6146
6332
|
)
|
|
6147
6333
|
] });
|
|
6148
|
-
return /* @__PURE__ */
|
|
6334
|
+
return /* @__PURE__ */ jsx103(
|
|
6149
6335
|
Box39,
|
|
6150
6336
|
{
|
|
6151
6337
|
sx: __spreadValues({
|
|
@@ -6167,8 +6353,8 @@ function ListingTableCellIcon({
|
|
|
6167
6353
|
var ListingTableCellIcon_default = ListingTableCellIcon;
|
|
6168
6354
|
|
|
6169
6355
|
// src/components/ListingTable/ListingTableProvider.tsx
|
|
6170
|
-
import { useMemo as
|
|
6171
|
-
import { jsx as
|
|
6356
|
+
import { useMemo as useMemo7 } from "react";
|
|
6357
|
+
import { jsx as jsx104 } from "react/jsx-runtime";
|
|
6172
6358
|
function ListingTableProvider({
|
|
6173
6359
|
children,
|
|
6174
6360
|
// Search
|
|
@@ -6206,7 +6392,7 @@ function ListingTableProvider({
|
|
|
6206
6392
|
// Loading
|
|
6207
6393
|
loading
|
|
6208
6394
|
}) {
|
|
6209
|
-
const contextValue =
|
|
6395
|
+
const contextValue = useMemo7(
|
|
6210
6396
|
() => ({
|
|
6211
6397
|
// Search
|
|
6212
6398
|
searchValue,
|
|
@@ -6271,11 +6457,11 @@ function ListingTableProvider({
|
|
|
6271
6457
|
loading
|
|
6272
6458
|
]
|
|
6273
6459
|
);
|
|
6274
|
-
return /* @__PURE__ */
|
|
6460
|
+
return /* @__PURE__ */ jsx104(ListingTableContext.Provider, { value: contextValue, children });
|
|
6275
6461
|
}
|
|
6276
6462
|
|
|
6277
6463
|
// src/components/ListingTable/ListingTable/ListingTable.tsx
|
|
6278
|
-
import { jsx as
|
|
6464
|
+
import { jsx as jsx105 } from "react/jsx-runtime";
|
|
6279
6465
|
var StyledTable = styled66(MuiTable, {
|
|
6280
6466
|
shouldForwardProp: (prop) => {
|
|
6281
6467
|
const excludedProps = ["variant", "density", "striped", "bordered"];
|
|
@@ -6329,7 +6515,7 @@ function ListingTable(_a) {
|
|
|
6329
6515
|
"children",
|
|
6330
6516
|
"sx"
|
|
6331
6517
|
]);
|
|
6332
|
-
return /* @__PURE__ */
|
|
6518
|
+
return /* @__PURE__ */ jsx105(
|
|
6333
6519
|
StyledTable,
|
|
6334
6520
|
__spreadProps(__spreadValues({
|
|
6335
6521
|
variant,
|
|
@@ -6360,9 +6546,9 @@ var ListingTableCompound = Object.assign(ListingTable, {
|
|
|
6360
6546
|
var ListingTable_default = ListingTableCompound;
|
|
6361
6547
|
|
|
6362
6548
|
// src/animations/ParticleBackground/ParticleBackground.tsx
|
|
6363
|
-
import { useEffect as
|
|
6549
|
+
import { useEffect as useEffect5, useRef } from "react";
|
|
6364
6550
|
import { useColorScheme as useColorScheme3 } from "@mui/material/styles";
|
|
6365
|
-
import { jsx as
|
|
6551
|
+
import { jsx as jsx106 } from "react/jsx-runtime";
|
|
6366
6552
|
var ParticleBackground = ({
|
|
6367
6553
|
opacity = 0.5,
|
|
6368
6554
|
baseDensity = 0.12,
|
|
@@ -6376,7 +6562,7 @@ var ParticleBackground = ({
|
|
|
6376
6562
|
}) => {
|
|
6377
6563
|
const canvasRef = useRef(null);
|
|
6378
6564
|
const { mode } = useColorScheme3();
|
|
6379
|
-
|
|
6565
|
+
useEffect5(() => {
|
|
6380
6566
|
const canvas = canvasRef.current;
|
|
6381
6567
|
if (!canvas) return;
|
|
6382
6568
|
const ctx = canvas.getContext("2d", { alpha: true });
|
|
@@ -6547,7 +6733,7 @@ var ParticleBackground = ({
|
|
|
6547
6733
|
cancelAnimationFrame(animationFrameId);
|
|
6548
6734
|
};
|
|
6549
6735
|
}, [baseDensity, maxSpeed, radius, linkDist, linkAlpha, mouseInfluence, repelStrength, clickBurst, mode]);
|
|
6550
|
-
return /* @__PURE__ */
|
|
6736
|
+
return /* @__PURE__ */ jsx106(
|
|
6551
6737
|
"canvas",
|
|
6552
6738
|
{
|
|
6553
6739
|
ref: canvasRef,
|
|
@@ -6574,96 +6760,45 @@ function useThemeContent(contentMap, fallback) {
|
|
|
6574
6760
|
}
|
|
6575
6761
|
var useThemeContent_default = useThemeContent;
|
|
6576
6762
|
|
|
6577
|
-
// src/hooks/useAppShell/useAppShell.ts
|
|
6578
|
-
import * as React27 from "react";
|
|
6579
|
-
var useAppShell = (options = {}) => {
|
|
6580
|
-
const {
|
|
6581
|
-
initialCollapsed = false,
|
|
6582
|
-
initialActiveItem = "dashboard"
|
|
6583
|
-
} = options;
|
|
6584
|
-
const [state, setState] = React27.useState({
|
|
6585
|
-
sidebarCollapsed: initialCollapsed,
|
|
6586
|
-
notificationPanelOpen: false,
|
|
6587
|
-
activeMenuItem: initialActiveItem,
|
|
6588
|
-
expandedMenus: {}
|
|
6589
|
-
});
|
|
6590
|
-
const toggleSidebar = React27.useCallback(() => {
|
|
6591
|
-
setState((prev) => __spreadProps(__spreadValues({}, prev), { sidebarCollapsed: !prev.sidebarCollapsed }));
|
|
6592
|
-
}, []);
|
|
6593
|
-
const toggleNotificationPanel = React27.useCallback(() => {
|
|
6594
|
-
setState((prev) => __spreadProps(__spreadValues({}, prev), {
|
|
6595
|
-
notificationPanelOpen: !prev.notificationPanelOpen
|
|
6596
|
-
}));
|
|
6597
|
-
}, []);
|
|
6598
|
-
const setActiveMenuItem = React27.useCallback((id) => {
|
|
6599
|
-
setState((prev) => __spreadProps(__spreadValues({}, prev), { activeMenuItem: id }));
|
|
6600
|
-
}, []);
|
|
6601
|
-
const toggleMenu = React27.useCallback((id) => {
|
|
6602
|
-
setState((prev) => __spreadProps(__spreadValues({}, prev), {
|
|
6603
|
-
expandedMenus: __spreadProps(__spreadValues({}, prev.expandedMenus), {
|
|
6604
|
-
[id]: !prev.expandedMenus[id]
|
|
6605
|
-
})
|
|
6606
|
-
}));
|
|
6607
|
-
}, []);
|
|
6608
|
-
const actions = React27.useMemo(
|
|
6609
|
-
() => ({
|
|
6610
|
-
toggleSidebar,
|
|
6611
|
-
toggleNotificationPanel,
|
|
6612
|
-
setActiveMenuItem,
|
|
6613
|
-
toggleMenu
|
|
6614
|
-
}),
|
|
6615
|
-
[
|
|
6616
|
-
toggleSidebar,
|
|
6617
|
-
toggleNotificationPanel,
|
|
6618
|
-
setActiveMenuItem,
|
|
6619
|
-
toggleMenu
|
|
6620
|
-
]
|
|
6621
|
-
);
|
|
6622
|
-
return {
|
|
6623
|
-
state,
|
|
6624
|
-
actions
|
|
6625
|
-
};
|
|
6626
|
-
};
|
|
6627
|
-
|
|
6628
6763
|
// src/hooks/useNotifications/useNotifications.ts
|
|
6629
|
-
import * as
|
|
6764
|
+
import * as React33 from "react";
|
|
6630
6765
|
var generateId = () => {
|
|
6631
6766
|
return `notif-${Date.now()}-${Math.random().toString(36).slice(2, 9)}`;
|
|
6632
6767
|
};
|
|
6633
6768
|
var useNotifications = (options = {}) => {
|
|
6634
6769
|
const { initialNotifications = [] } = options;
|
|
6635
|
-
const [notifications, setNotifications] =
|
|
6770
|
+
const [notifications, setNotifications] = React33.useState(
|
|
6636
6771
|
initialNotifications
|
|
6637
6772
|
);
|
|
6638
|
-
const markRead =
|
|
6773
|
+
const markRead = React33.useCallback((id) => {
|
|
6639
6774
|
setNotifications(
|
|
6640
6775
|
(prev) => prev.map((n) => n.id === id ? __spreadProps(__spreadValues({}, n), { read: true }) : n)
|
|
6641
6776
|
);
|
|
6642
6777
|
}, []);
|
|
6643
|
-
const dismiss =
|
|
6778
|
+
const dismiss = React33.useCallback((id) => {
|
|
6644
6779
|
setNotifications((prev) => prev.filter((n) => n.id !== id));
|
|
6645
6780
|
}, []);
|
|
6646
|
-
const markAllRead =
|
|
6781
|
+
const markAllRead = React33.useCallback(() => {
|
|
6647
6782
|
setNotifications((prev) => prev.map((n) => __spreadProps(__spreadValues({}, n), { read: true })));
|
|
6648
6783
|
}, []);
|
|
6649
|
-
const clearAll =
|
|
6784
|
+
const clearAll = React33.useCallback(() => {
|
|
6650
6785
|
setNotifications([]);
|
|
6651
6786
|
}, []);
|
|
6652
|
-
const add =
|
|
6787
|
+
const add = React33.useCallback((notification) => {
|
|
6653
6788
|
const newNotification = __spreadProps(__spreadValues({}, notification), {
|
|
6654
6789
|
id: generateId()
|
|
6655
6790
|
});
|
|
6656
6791
|
setNotifications((prev) => [newNotification, ...prev]);
|
|
6657
6792
|
}, []);
|
|
6658
|
-
const unreadCount =
|
|
6793
|
+
const unreadCount = React33.useMemo(
|
|
6659
6794
|
() => notifications.filter((n) => !n.read).length,
|
|
6660
6795
|
[notifications]
|
|
6661
6796
|
);
|
|
6662
|
-
const unreadNotifications =
|
|
6797
|
+
const unreadNotifications = React33.useMemo(
|
|
6663
6798
|
() => notifications.filter((n) => !n.read),
|
|
6664
6799
|
[notifications]
|
|
6665
6800
|
);
|
|
6666
|
-
const actions =
|
|
6801
|
+
const actions = React33.useMemo(
|
|
6667
6802
|
() => ({
|
|
6668
6803
|
markRead,
|
|
6669
6804
|
dismiss,
|