@xyo-network/react-appbar 4.1.9 → 4.1.11
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/browser/components/AppBar/Application.d.ts +3 -3
- package/dist/browser/components/AppBar/Application.d.ts.map +1 -1
- package/dist/browser/components/CollapsibleDrawer/CollapseToggle.d.ts.map +1 -1
- package/dist/browser/components/CollapsibleDrawer/CollapsibleDrawer.d.ts.map +1 -1
- package/dist/browser/components/CollapsibleDrawer/storyExampleMenuData.d.ts +1 -1
- package/dist/browser/components/CollapsibleDrawer/storyExampleMenuData.d.ts.map +1 -1
- package/dist/browser/components/Toolbar/Context/ContextToolbar.d.ts +5 -6
- package/dist/browser/components/Toolbar/Context/ContextToolbar.d.ts.map +1 -1
- package/dist/browser/components/Toolbar/Context/LogoLinkEx.d.ts +1 -0
- package/dist/browser/components/Toolbar/Context/LogoLinkEx.d.ts.map +1 -1
- package/dist/browser/components/Toolbar/System/SystemToolbar.d.ts +3 -4
- package/dist/browser/components/Toolbar/System/SystemToolbar.d.ts.map +1 -1
- package/dist/browser/components/index.d.ts +0 -1
- package/dist/browser/components/index.d.ts.map +1 -1
- package/dist/browser/index.d.ts +0 -1
- package/dist/browser/index.d.ts.map +1 -1
- package/dist/browser/index.mjs +70 -349
- package/dist/browser/index.mjs.map +1 -1
- package/package.json +9 -10
- package/src/components/AppBar/Application.stories.tsx +11 -11
- package/src/components/AppBar/Application.tsx +8 -8
- package/src/components/CollapsibleDrawer/CollapseDrawer.stories.tsx +2 -2
- package/src/components/CollapsibleDrawer/CollapseToggle.tsx +1 -2
- package/src/components/CollapsibleDrawer/CollapsibleDrawer.tsx +1 -2
- package/src/components/CollapsibleDrawer/storyExampleMenuData.tsx +1 -2
- package/src/components/Toolbar/Context/ContextToolbar.stories.tsx +6 -6
- package/src/components/Toolbar/Context/ContextToolbar.tsx +8 -8
- package/src/components/Toolbar/Context/LogoLinkEx.tsx +4 -3
- package/src/components/Toolbar/System/SystemToolbar.stories.tsx +8 -9
- package/src/components/Toolbar/System/SystemToolbar.tsx +8 -19
- package/src/components/index.ts +0 -1
- package/src/index.ts +0 -1
- package/dist/browser/components/SiteMenu/Menu.d.ts +0 -9
- package/dist/browser/components/SiteMenu/Menu.d.ts.map +0 -1
- package/dist/browser/components/SiteMenu/MenuListItem/MenuListItemContainer.d.ts +0 -11
- package/dist/browser/components/SiteMenu/MenuListItem/MenuListItemContainer.d.ts.map +0 -1
- package/dist/browser/components/SiteMenu/MenuListItem/index.d.ts +0 -2
- package/dist/browser/components/SiteMenu/MenuListItem/index.d.ts.map +0 -1
- package/dist/browser/components/SiteMenu/MenuListItem/list-item-components/ListItemTooltip.d.ts +0 -7
- package/dist/browser/components/SiteMenu/MenuListItem/list-item-components/ListItemTooltip.d.ts.map +0 -1
- package/dist/browser/components/SiteMenu/MenuListItem/list-item-components/MenuIcon.d.ts +0 -8
- package/dist/browser/components/SiteMenu/MenuListItem/list-item-components/MenuIcon.d.ts.map +0 -1
- package/dist/browser/components/SiteMenu/MenuListItem/list-item-components/MenuListItem.d.ts +0 -7
- package/dist/browser/components/SiteMenu/MenuListItem/list-item-components/MenuListItem.d.ts.map +0 -1
- package/dist/browser/components/SiteMenu/MenuListItem/list-item-components/index.d.ts +0 -4
- package/dist/browser/components/SiteMenu/MenuListItem/list-item-components/index.d.ts.map +0 -1
- package/dist/browser/components/SiteMenu/MenuListItem/sub-nav/SubNavListItemCollapse.d.ts +0 -11
- package/dist/browser/components/SiteMenu/MenuListItem/sub-nav/SubNavListItemCollapse.d.ts.map +0 -1
- package/dist/browser/components/SiteMenu/MenuListItem/sub-nav/SubNavToggleIconButton.d.ts +0 -9
- package/dist/browser/components/SiteMenu/MenuListItem/sub-nav/SubNavToggleIconButton.d.ts.map +0 -1
- package/dist/browser/components/SiteMenu/MenuListItem/sub-nav/index.d.ts +0 -3
- package/dist/browser/components/SiteMenu/MenuListItem/sub-nav/index.d.ts.map +0 -1
- package/dist/browser/components/SiteMenu/MenuSection.d.ts +0 -11
- package/dist/browser/components/SiteMenu/MenuSection.d.ts.map +0 -1
- package/dist/browser/components/SiteMenu/hooks/index.d.ts +0 -2
- package/dist/browser/components/SiteMenu/hooks/index.d.ts.map +0 -1
- package/dist/browser/components/SiteMenu/hooks/useMenuItemsShared.d.ts +0 -7
- package/dist/browser/components/SiteMenu/hooks/useMenuItemsShared.d.ts.map +0 -1
- package/dist/browser/components/SiteMenu/index.d.ts +0 -6
- package/dist/browser/components/SiteMenu/index.d.ts.map +0 -1
- package/dist/browser/components/SiteMenu/lib/MenuListItemBase.d.ts +0 -5
- package/dist/browser/components/SiteMenu/lib/MenuListItemBase.d.ts.map +0 -1
- package/dist/browser/components/SiteMenu/lib/NavListItemProps.d.ts +0 -12
- package/dist/browser/components/SiteMenu/lib/NavListItemProps.d.ts.map +0 -1
- package/dist/browser/components/SiteMenu/lib/index.d.ts +0 -3
- package/dist/browser/components/SiteMenu/lib/index.d.ts.map +0 -1
- package/dist/browser/contexts/Collapsible/State.d.ts +0 -9
- package/dist/browser/contexts/Collapsible/State.d.ts.map +0 -1
- package/dist/browser/contexts/Collapsible/context.d.ts +0 -3
- package/dist/browser/contexts/Collapsible/context.d.ts.map +0 -1
- package/dist/browser/contexts/Collapsible/index.d.ts +0 -4
- package/dist/browser/contexts/Collapsible/index.d.ts.map +0 -1
- package/dist/browser/contexts/Collapsible/provider.d.ts +0 -8
- package/dist/browser/contexts/Collapsible/provider.d.ts.map +0 -1
- package/dist/browser/contexts/Collapsible/use.d.ts +0 -2
- package/dist/browser/contexts/Collapsible/use.d.ts.map +0 -1
- package/dist/browser/contexts/index.d.ts +0 -2
- package/dist/browser/contexts/index.d.ts.map +0 -1
- package/src/components/SiteMenu/Menu.tsx +0 -53
- package/src/components/SiteMenu/MenuListItem/MenuListItemContainer.stories.tsx +0 -54
- package/src/components/SiteMenu/MenuListItem/MenuListItemContainer.tsx +0 -87
- package/src/components/SiteMenu/MenuListItem/index.ts +0 -1
- package/src/components/SiteMenu/MenuListItem/list-item-components/ListItemTooltip.tsx +0 -23
- package/src/components/SiteMenu/MenuListItem/list-item-components/MenuIcon.tsx +0 -16
- package/src/components/SiteMenu/MenuListItem/list-item-components/MenuListItem.tsx +0 -31
- package/src/components/SiteMenu/MenuListItem/list-item-components/index.ts +0 -3
- package/src/components/SiteMenu/MenuListItem/sub-nav/SubNavListItemCollapse.tsx +0 -22
- package/src/components/SiteMenu/MenuListItem/sub-nav/SubNavToggleIconButton.tsx +0 -27
- package/src/components/SiteMenu/MenuListItem/sub-nav/index.ts +0 -2
- package/src/components/SiteMenu/MenuSection.tsx +0 -30
- package/src/components/SiteMenu/hooks/index.ts +0 -1
- package/src/components/SiteMenu/hooks/useMenuItemsShared.tsx +0 -29
- package/src/components/SiteMenu/index.ts +0 -5
- package/src/components/SiteMenu/lib/MenuListItemBase.tsx +0 -4
- package/src/components/SiteMenu/lib/NavListItemProps.ts +0 -12
- package/src/components/SiteMenu/lib/index.ts +0 -2
- package/src/contexts/Collapsible/State.ts +0 -9
- package/src/contexts/Collapsible/context.ts +0 -5
- package/src/contexts/Collapsible/index.ts +0 -3
- package/src/contexts/Collapsible/provider.tsx +0 -26
- package/src/contexts/Collapsible/use.ts +0 -5
- package/src/contexts/index.ts +0 -1
package/dist/browser/index.mjs
CHANGED
@@ -2,8 +2,8 @@ var __defProp = Object.defineProperty;
|
|
2
2
|
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
3
3
|
|
4
4
|
// src/components/AppBar/Application.tsx
|
5
|
-
import {
|
6
|
-
import
|
5
|
+
import { ApplicationAppBar } from "@xylabs/react-appbar";
|
6
|
+
import React5 from "react";
|
7
7
|
|
8
8
|
// src/components/Toolbar/Context/ContextToolbar.tsx
|
9
9
|
import { Toolbar } from "@mui/material";
|
@@ -29,15 +29,15 @@ var Logo = /* @__PURE__ */ __name((props) => {
|
|
29
29
|
}, "Logo");
|
30
30
|
|
31
31
|
// src/components/Toolbar/Context/LogoLinkEx.tsx
|
32
|
-
var LogoLinkEx = /* @__PURE__ */ __name(({ to = "/", href, version = false, ...props }) => {
|
32
|
+
var LogoLinkEx = /* @__PURE__ */ __name(({ logo, to = "/", href, version = false, ...props }) => {
|
33
33
|
const theme = useTheme2();
|
34
|
-
assertEx(href === void 0, "href is not supported");
|
34
|
+
assertEx(href === void 0, () => "href is not supported");
|
35
35
|
return /* @__PURE__ */ React2.createElement(LinkEx, {
|
36
36
|
to,
|
37
37
|
...props
|
38
38
|
}, /* @__PURE__ */ React2.createElement(FlexRow, {
|
39
39
|
paddingX: "4px"
|
40
|
-
}, /* @__PURE__ */ React2.createElement(Logo, {
|
40
|
+
}, logo ?? /* @__PURE__ */ React2.createElement(Logo, {
|
41
41
|
height: "40",
|
42
42
|
width: "43"
|
43
43
|
}), version ? /* @__PURE__ */ React2.createElement(Typography, {
|
@@ -55,336 +55,62 @@ var LogoLinkEx = /* @__PURE__ */ __name(({ to = "/", href, version = false, ...p
|
|
55
55
|
}, "LogoLinkEx");
|
56
56
|
|
57
57
|
// src/components/Toolbar/Context/ContextToolbar.tsx
|
58
|
-
var
|
58
|
+
var XyoContextToolbar = /* @__PURE__ */ __name(({ children, logo, logoTo = "/", version = false, ...props }) => {
|
59
59
|
return /* @__PURE__ */ React3.createElement(Toolbar, props, /* @__PURE__ */ React3.createElement(LogoLinkEx, {
|
60
|
+
logo,
|
60
61
|
version,
|
61
62
|
to: logoTo
|
62
|
-
}));
|
63
|
-
}, "
|
63
|
+
}), children);
|
64
|
+
}, "XyoContextToolbar");
|
64
65
|
|
65
66
|
// src/components/Toolbar/System/SystemToolbar.tsx
|
66
|
-
import { Paper
|
67
|
-
import {
|
68
|
-
import { FlexRow as FlexRow4 } from "@xylabs/react-flexbox";
|
69
|
-
import { NetworkSelectEx } from "@xyo-network/react-network";
|
70
|
-
import React13 from "react";
|
71
|
-
|
72
|
-
// src/components/SiteMenu/hooks/useMenuItemsShared.tsx
|
73
|
-
import { useMemo } from "react";
|
74
|
-
|
75
|
-
// src/contexts/Collapsible/provider.tsx
|
76
|
-
import React4, { useState } from "react";
|
77
|
-
|
78
|
-
// src/contexts/Collapsible/context.ts
|
79
|
-
import { createContextEx } from "@xyo-network/react-shared";
|
80
|
-
var CollapsibleContext = createContextEx();
|
81
|
-
|
82
|
-
// src/contexts/Collapsible/provider.tsx
|
83
|
-
var CollapsibleProvider = /* @__PURE__ */ __name(({ defaultCollapse = false, defaultCollapseEnd = false, children }) => {
|
84
|
-
const [collapse, setCollapse] = useState(() => defaultCollapse);
|
85
|
-
const [collapseEnd, setCollapseEnd] = useState(() => defaultCollapseEnd);
|
86
|
-
return (
|
87
|
-
// eslint-disable-next-line @eslint-react/no-unstable-context-value
|
88
|
-
/* @__PURE__ */ React4.createElement(CollapsibleContext.Provider, {
|
89
|
-
value: {
|
90
|
-
collapse,
|
91
|
-
collapseEnd,
|
92
|
-
provided: true,
|
93
|
-
setCollapse,
|
94
|
-
setCollapseEnd
|
95
|
-
}
|
96
|
-
}, children)
|
97
|
-
);
|
98
|
-
}, "CollapsibleProvider");
|
99
|
-
|
100
|
-
// src/contexts/Collapsible/use.ts
|
101
|
-
import { useContextEx } from "@xyo-network/react-shared";
|
102
|
-
var useCollapsible = /* @__PURE__ */ __name(() => useContextEx(CollapsibleContext, "Collapsible", false), "useCollapsible");
|
103
|
-
|
104
|
-
// src/components/SiteMenu/hooks/useMenuItemsShared.tsx
|
105
|
-
var useMenuItemsShared = /* @__PURE__ */ __name(() => {
|
106
|
-
const { collapse, collapseEnd, setCollapse, setCollapseEnd } = useCollapsible();
|
107
|
-
const onMenuItemToggle = /* @__PURE__ */ __name((open) => {
|
108
|
-
setCollapse?.((previous) => open ? false : previous);
|
109
|
-
setCollapseEnd?.((previous) => open ? false : previous);
|
110
|
-
}, "onMenuItemToggle");
|
111
|
-
const defaultSiteMenuListItemProps = useMemo(() => ({
|
112
|
-
collapseEnd,
|
113
|
-
dense: true,
|
114
|
-
iconOnly: collapse,
|
115
|
-
sx: {
|
116
|
-
px: "8px"
|
117
|
-
}
|
118
|
-
}), [
|
119
|
-
collapse,
|
120
|
-
collapseEnd
|
121
|
-
]);
|
122
|
-
return {
|
123
|
-
defaultSiteMenuListItemProps,
|
124
|
-
onMenuItemToggle
|
125
|
-
};
|
126
|
-
}, "useMenuItemsShared");
|
127
|
-
|
128
|
-
// src/components/SiteMenu/Menu.tsx
|
129
|
-
import { Menu as MenuIcon2, Settings as SettingsIcon } from "@mui/icons-material";
|
130
|
-
import { IconButton as IconButton2, List as List2, SwipeableDrawer } from "@mui/material";
|
131
|
-
import { FlexRow as FlexRow3 } from "@xylabs/react-flexbox";
|
132
|
-
import React11, { useEffect, useState as useState3 } from "react";
|
133
|
-
|
134
|
-
// src/components/SiteMenu/MenuListItem/MenuListItemContainer.tsx
|
135
|
-
import { ListItemText, useTheme as useTheme4 } from "@mui/material";
|
67
|
+
import { Paper } from "@mui/material";
|
68
|
+
import { SystemToolbar } from "@xylabs/react-appbar";
|
136
69
|
import { FlexRow as FlexRow2 } from "@xylabs/react-flexbox";
|
137
|
-
import {
|
138
|
-
import
|
139
|
-
|
140
|
-
|
141
|
-
import { Tooltip } from "@mui/material";
|
142
|
-
import { FlexCol } from "@xylabs/react-flexbox";
|
143
|
-
import React5 from "react";
|
144
|
-
import { VscInfo } from "react-icons/vsc";
|
145
|
-
var ListItemTooltip = /* @__PURE__ */ __name(({ title, ...props }) => {
|
146
|
-
return /* @__PURE__ */ React5.createElement(Tooltip, {
|
147
|
-
title,
|
148
|
-
placement: "right",
|
149
|
-
...props
|
150
|
-
}, /* @__PURE__ */ React5.createElement("div", null, /* @__PURE__ */ React5.createElement(FlexCol, {
|
151
|
-
justifyContent: "center"
|
152
|
-
}, /* @__PURE__ */ React5.createElement(VscInfo, {
|
153
|
-
color: "grey"
|
154
|
-
}))));
|
155
|
-
}, "ListItemTooltip");
|
156
|
-
|
157
|
-
// src/components/SiteMenu/MenuListItem/list-item-components/MenuIcon.tsx
|
158
|
-
import { Typography as Typography2 } from "@mui/material";
|
159
|
-
import React6 from "react";
|
160
|
-
var MenuIcon = /* @__PURE__ */ __name(({ icon, ...props }) => {
|
161
|
-
return /* @__PURE__ */ React6.createElement(Typography2, {
|
162
|
-
display: "flex",
|
163
|
-
...props
|
164
|
-
}, icon);
|
165
|
-
}, "MenuIcon");
|
166
|
-
|
167
|
-
// src/components/SiteMenu/MenuListItem/list-item-components/MenuListItem.tsx
|
168
|
-
import { ListItem } from "@mui/material";
|
169
|
-
import React7 from "react";
|
170
|
-
var MenuListItem = /* @__PURE__ */ __name(({ iconOnly, collapseEnd, sx, children, dense, ...props }) => {
|
171
|
-
const listItemSx = iconOnly ? {
|
172
|
-
borderRadius: "50%",
|
173
|
-
display: "inline-flex",
|
174
|
-
flexGrow: 0,
|
175
|
-
width: "auto"
|
176
|
-
} : {
|
177
|
-
width: "100%"
|
178
|
-
};
|
179
|
-
const spacingSx = collapseEnd ? {
|
180
|
-
columnGap: 0
|
181
|
-
} : {
|
182
|
-
columnGap: 1.5
|
183
|
-
};
|
184
|
-
const paddingSx = dense ? {
|
185
|
-
px: "8px"
|
186
|
-
} : {
|
187
|
-
px: "12px"
|
188
|
-
};
|
189
|
-
return /* @__PURE__ */ React7.createElement(ListItem, {
|
190
|
-
sx: {
|
191
|
-
...listItemSx,
|
192
|
-
...spacingSx,
|
193
|
-
...paddingSx,
|
194
|
-
...sx
|
195
|
-
},
|
196
|
-
...props
|
197
|
-
}, children);
|
198
|
-
}, "MenuListItem");
|
199
|
-
|
200
|
-
// src/components/SiteMenu/MenuListItem/sub-nav/SubNavListItemCollapse.tsx
|
201
|
-
import { Collapse, List } from "@mui/material";
|
202
|
-
import React8 from "react";
|
203
|
-
var SubNavListItemsCollapse = /* @__PURE__ */ __name(({ collapse, openSubNav, children, ...props }) => {
|
204
|
-
return /* @__PURE__ */ React8.createElement(Collapse, {
|
205
|
-
in: collapse == true ? false : openSubNav,
|
206
|
-
...props
|
207
|
-
}, /* @__PURE__ */ React8.createElement(List, null, children));
|
208
|
-
}, "SubNavListItemsCollapse");
|
209
|
-
|
210
|
-
// src/components/SiteMenu/MenuListItem/sub-nav/SubNavToggleIconButton.tsx
|
211
|
-
import { IconButton, useTheme as useTheme3 } from "@mui/material";
|
212
|
-
import React9 from "react";
|
213
|
-
import { VscChevronDown } from "react-icons/vsc";
|
214
|
-
var SubNavToggleIconButton = /* @__PURE__ */ __name(({ setOpenSubNav, openSubNav }) => {
|
215
|
-
const theme = useTheme3();
|
216
|
-
return /* @__PURE__ */ React9.createElement(IconButton, {
|
217
|
-
onClick: /* @__PURE__ */ __name((event) => {
|
218
|
-
event.stopPropagation();
|
219
|
-
setOpenSubNav?.(!openSubNav);
|
220
|
-
}, "onClick"),
|
221
|
-
sx: {
|
222
|
-
marginRight: theme.spacing(0.5)
|
223
|
-
}
|
224
|
-
}, /* @__PURE__ */ React9.createElement(VscChevronDown, {
|
225
|
-
fontSize: "16px"
|
226
|
-
}));
|
227
|
-
}, "SubNavToggleIconButton");
|
228
|
-
|
229
|
-
// src/components/SiteMenu/MenuListItem/MenuListItemContainer.tsx
|
230
|
-
var MenuListItemContainer = /* @__PURE__ */ __name(({ style, icon, iconMenuTextSpacing, iconOnly, onButtonClick, primary, subNavListItems, sx, tooltip, to, ...props }) => {
|
231
|
-
const { dense } = props;
|
232
|
-
const theme = useTheme4();
|
233
|
-
const { collapse } = useCollapsible();
|
234
|
-
const [openSubNav, setOpenSubNav] = useState2(false);
|
235
|
-
const [hovered, setHovered] = useState2(false);
|
236
|
-
const resolvedIconMenuTextSpacing = iconMenuTextSpacing ?? theme.spacing(1);
|
237
|
-
return /* @__PURE__ */ React10.createElement(React10.Fragment, null, /* @__PURE__ */ React10.createElement(MenuListItem, {
|
238
|
-
disableGutters: true,
|
239
|
-
iconOnly,
|
240
|
-
onClick: onButtonClick,
|
241
|
-
dense,
|
242
|
-
sx: {
|
243
|
-
justifyContent: "space-between",
|
244
|
-
...sx
|
245
|
-
},
|
246
|
-
style: {
|
247
|
-
whiteSpace: "nowrap",
|
248
|
-
...style
|
249
|
-
},
|
250
|
-
...props
|
251
|
-
}, /* @__PURE__ */ React10.createElement(LinkEx2, {
|
252
|
-
onMouseEnter: /* @__PURE__ */ __name(() => setHovered(true), "onMouseEnter"),
|
253
|
-
onMouseLeave: /* @__PURE__ */ __name(() => setHovered(false), "onMouseLeave"),
|
254
|
-
color: "inherit",
|
255
|
-
to,
|
256
|
-
sx: {
|
257
|
-
"& :hover": {
|
258
|
-
cursor: "pointer",
|
259
|
-
textDecoration: "underline"
|
260
|
-
}
|
261
|
-
}
|
262
|
-
}, /* @__PURE__ */ React10.createElement(FlexRow2, null, /* @__PURE__ */ React10.createElement(MenuIcon, {
|
263
|
-
icon,
|
264
|
-
paddingRight: resolvedIconMenuTextSpacing,
|
265
|
-
color: hovered ? "secondary" : "inherit"
|
266
|
-
}), /* @__PURE__ */ React10.createElement(ListItemText, {
|
267
|
-
primary
|
268
|
-
}))), /* @__PURE__ */ React10.createElement(FlexRow2, {
|
269
|
-
style: {
|
270
|
-
marginLeft: theme.spacing(1)
|
271
|
-
}
|
272
|
-
}, subNavListItems ? /* @__PURE__ */ React10.createElement(SubNavToggleIconButton, {
|
273
|
-
setOpenSubNav,
|
274
|
-
openSubNav
|
275
|
-
}) : null, tooltip ? /* @__PURE__ */ React10.createElement(ListItemTooltip, {
|
276
|
-
title: tooltip
|
277
|
-
}) : null)), subNavListItems ? /* @__PURE__ */ React10.createElement(SubNavListItemsCollapse, {
|
278
|
-
openSubNav,
|
279
|
-
collapse
|
280
|
-
}, subNavListItems?.map((item, index) => /* @__PURE__ */ React10.createElement(MenuListItemContainer, {
|
281
|
-
dense,
|
282
|
-
sx: {
|
283
|
-
pl: theme.spacing(1)
|
284
|
-
},
|
285
|
-
key: index,
|
286
|
-
...item
|
287
|
-
}))) : null);
|
288
|
-
}, "MenuListItemContainer");
|
289
|
-
|
290
|
-
// src/components/SiteMenu/Menu.tsx
|
291
|
-
var SiteMenu = /* @__PURE__ */ __name(({ children, onMenuToggle, side = "right", ...props }) => {
|
292
|
-
const [open, setOpen] = useState3(false);
|
293
|
-
useEffect(() => {
|
294
|
-
onMenuToggle?.(open);
|
295
|
-
}, [
|
296
|
-
onMenuToggle,
|
297
|
-
open
|
298
|
-
]);
|
299
|
-
return /* @__PURE__ */ React11.createElement(FlexRow3, {
|
300
|
-
alignItems: "stretch",
|
301
|
-
...props
|
302
|
-
}, /* @__PURE__ */ React11.createElement(IconButton2, {
|
303
|
-
size: "small",
|
304
|
-
color: "inherit",
|
305
|
-
onClick: /* @__PURE__ */ __name(() => {
|
306
|
-
setOpen(!open);
|
307
|
-
}, "onClick")
|
308
|
-
}, /* @__PURE__ */ React11.createElement(MenuIcon2, {
|
309
|
-
fontSize: "large"
|
310
|
-
})), /* @__PURE__ */ React11.createElement(SwipeableDrawer, {
|
311
|
-
anchor: side,
|
312
|
-
open,
|
313
|
-
onClick: /* @__PURE__ */ __name(() => setOpen(false), "onClick"),
|
314
|
-
onKeyDown: /* @__PURE__ */ __name(() => setOpen(false), "onKeyDown"),
|
315
|
-
onClose: /* @__PURE__ */ __name(() => setOpen(false), "onClose"),
|
316
|
-
onOpen: /* @__PURE__ */ __name(() => setOpen(true), "onOpen")
|
317
|
-
}, children ?? /* @__PURE__ */ React11.createElement(List2, null, /* @__PURE__ */ React11.createElement(MenuListItemContainer, {
|
318
|
-
primary: "Settings",
|
319
|
-
icon: /* @__PURE__ */ React11.createElement(SettingsIcon, null),
|
320
|
-
to: "/settings"
|
321
|
-
}))));
|
322
|
-
}, "SiteMenu");
|
323
|
-
|
324
|
-
// src/components/SiteMenu/MenuSection.tsx
|
325
|
-
import { Collapse as Collapse2, ListSubheader } from "@mui/material";
|
326
|
-
import { FlexCol as FlexCol2 } from "@xylabs/react-flexbox";
|
327
|
-
import React12 from "react";
|
328
|
-
var MenuSection = /* @__PURE__ */ __name(({ iconMenuTextSpacing, listItems, showTitle = true, title, ...props }) => {
|
329
|
-
return /* @__PURE__ */ React12.createElement(FlexCol2, {
|
330
|
-
alignItems: "stretch",
|
331
|
-
...props
|
332
|
-
}, /* @__PURE__ */ React12.createElement(Collapse2, {
|
333
|
-
in: showTitle,
|
334
|
-
timeout: 700
|
335
|
-
}, /* @__PURE__ */ React12.createElement(ListSubheader, null, title)), listItems.map((item, index) => /* @__PURE__ */ React12.createElement(MenuListItemContainer, {
|
336
|
-
key: index,
|
337
|
-
iconMenuTextSpacing,
|
338
|
-
...item
|
339
|
-
})));
|
340
|
-
}, "MenuSection");
|
341
|
-
|
342
|
-
// src/components/Toolbar/System/SystemToolbar.tsx
|
343
|
-
var SystemToolbar = /* @__PURE__ */ __name(({ children, darkModeButton = false, hideNetworkSelect, menuItems, networkSelectProps, onMenuToggle, precedingChildren, ...props }) => {
|
344
|
-
return /* @__PURE__ */ React13.createElement(Toolbar2, props, precedingChildren, hideNetworkSelect ? null : /* @__PURE__ */ React13.createElement(FlexRow4, {
|
70
|
+
import { NetworkSelectEx } from "@xyo-network/react-network";
|
71
|
+
import React4 from "react";
|
72
|
+
var XyoSystemToolbar = /* @__PURE__ */ __name(({ children, hideNetworkSelect, networkSelectProps, precedingChildren, ...props }) => {
|
73
|
+
return /* @__PURE__ */ React4.createElement(SystemToolbar, props, precedingChildren, hideNetworkSelect ? null : /* @__PURE__ */ React4.createElement(FlexRow2, {
|
345
74
|
marginX: 0.5
|
346
|
-
}, /* @__PURE__ */
|
75
|
+
}, /* @__PURE__ */ React4.createElement(Paper, {
|
347
76
|
variant: "elevation"
|
348
|
-
}, /* @__PURE__ */
|
77
|
+
}, /* @__PURE__ */ React4.createElement(NetworkSelectEx, {
|
349
78
|
fullWidth: true,
|
350
79
|
...networkSelectProps
|
351
|
-
}))), children
|
352
|
-
|
353
|
-
}) : null, menuItems ? /* @__PURE__ */ React13.createElement(SiteMenu, {
|
354
|
-
onMenuToggle
|
355
|
-
}, menuItems) : null);
|
356
|
-
}, "SystemToolbar");
|
80
|
+
}))), children);
|
81
|
+
}, "XyoSystemToolbar");
|
357
82
|
|
358
83
|
// src/components/AppBar/Application.tsx
|
359
|
-
var
|
360
|
-
return /* @__PURE__ */
|
361
|
-
systemToolbar: systemToolbar ?? /* @__PURE__ */
|
362
|
-
contextToolbar: contextToolbar ?? /* @__PURE__ */
|
84
|
+
var XyoApplicationAppBar = /* @__PURE__ */ __name(({ systemToolbar, contextToolbar, responsive = true, ...props }) => {
|
85
|
+
return /* @__PURE__ */ React5.createElement(ApplicationAppBar, {
|
86
|
+
systemToolbar: systemToolbar ?? /* @__PURE__ */ React5.createElement(XyoSystemToolbar, null),
|
87
|
+
contextToolbar: contextToolbar ?? /* @__PURE__ */ React5.createElement(XyoContextToolbar, null),
|
363
88
|
position: "sticky",
|
364
89
|
responsive,
|
365
90
|
...props
|
366
91
|
});
|
367
|
-
}, "
|
92
|
+
}, "XyoApplicationAppBar");
|
368
93
|
|
369
94
|
// src/components/CollapsibleDrawer/CollapseToggle.tsx
|
370
|
-
import { Icon, useTheme as
|
371
|
-
import { FlexRow as
|
372
|
-
import
|
95
|
+
import { Icon, useTheme as useTheme3 } from "@mui/material";
|
96
|
+
import { FlexRow as FlexRow3 } from "@xylabs/react-flexbox";
|
97
|
+
import { useCollapsible } from "@xylabs/react-shared";
|
98
|
+
import React6, { useState } from "react";
|
373
99
|
import { VscArrowSmallLeft, VscArrowSmallRight } from "react-icons/vsc";
|
374
100
|
var CollapseToggleFlex = /* @__PURE__ */ __name((props) => {
|
375
101
|
const { collapse, setCollapse, setCollapseEnd } = useCollapsible();
|
376
|
-
const [hover, setHover] =
|
377
|
-
const theme =
|
102
|
+
const [hover, setHover] = useState(false);
|
103
|
+
const theme = useTheme3();
|
378
104
|
const handleCollapseToggle = /* @__PURE__ */ __name(() => {
|
379
105
|
setCollapse?.(!collapse);
|
380
106
|
setCollapseEnd?.((previous) => previous ? false : previous);
|
381
107
|
}, "handleCollapseToggle");
|
382
|
-
return /* @__PURE__ */
|
108
|
+
return /* @__PURE__ */ React6.createElement(FlexRow3, {
|
383
109
|
mt: 2,
|
384
110
|
py: 2,
|
385
111
|
justifyContent: collapse ? "start" : "center",
|
386
112
|
...props
|
387
|
-
}, /* @__PURE__ */
|
113
|
+
}, /* @__PURE__ */ React6.createElement(Icon, {
|
388
114
|
onClick: handleCollapseToggle,
|
389
115
|
onMouseEnter: /* @__PURE__ */ __name(() => setHover(true), "onMouseEnter"),
|
390
116
|
onMouseLeave: /* @__PURE__ */ __name(() => setHover(false), "onMouseLeave"),
|
@@ -393,17 +119,18 @@ var CollapseToggleFlex = /* @__PURE__ */ __name((props) => {
|
|
393
119
|
color: hover ? theme.palette.secondary.main : "inherit",
|
394
120
|
cursor: "pointer"
|
395
121
|
}
|
396
|
-
}, collapse ? /* @__PURE__ */
|
122
|
+
}, collapse ? /* @__PURE__ */ React6.createElement(VscArrowSmallRight, null) : /* @__PURE__ */ React6.createElement(VscArrowSmallLeft, null)));
|
397
123
|
}, "CollapseToggleFlex");
|
398
124
|
|
399
125
|
// src/components/CollapsibleDrawer/CollapsibleDrawer.tsx
|
400
|
-
import { Collapse
|
401
|
-
import
|
126
|
+
import { Collapse, styled, useTheme as useTheme4 } from "@mui/material";
|
127
|
+
import { useCollapsible as useCollapsible2 } from "@xylabs/react-shared";
|
128
|
+
import React7 from "react";
|
402
129
|
var CollapsibleDrawer = /* @__PURE__ */ __name(({ children, sx, ...props }) => {
|
403
|
-
const { collapse, setCollapseEnd } =
|
404
|
-
const theme =
|
130
|
+
const { collapse, setCollapseEnd } = useCollapsible2();
|
131
|
+
const theme = useTheme4();
|
405
132
|
const collapsedSize = props.collapsedSize ?? theme.spacing(5);
|
406
|
-
return /* @__PURE__ */
|
133
|
+
return /* @__PURE__ */ React7.createElement(CollapsibleFlexInner, {
|
407
134
|
in: !collapse,
|
408
135
|
orientation: "horizontal",
|
409
136
|
collapsedSize,
|
@@ -417,7 +144,7 @@ var CollapsibleDrawer = /* @__PURE__ */ __name(({ children, sx, ...props }) => {
|
|
417
144
|
...props
|
418
145
|
}, children);
|
419
146
|
}, "CollapsibleDrawer");
|
420
|
-
var CollapsibleFlexInner = styled(
|
147
|
+
var CollapsibleFlexInner = styled(Collapse)(() => ({
|
421
148
|
"& .MuiCollapse-wrapperInner": {
|
422
149
|
display: "flex",
|
423
150
|
flexDirection: "column"
|
@@ -425,8 +152,8 @@ var CollapsibleFlexInner = styled(Collapse3)(() => ({
|
|
425
152
|
}));
|
426
153
|
|
427
154
|
// src/components/MobileSystemControls/SystemControls.tsx
|
428
|
-
import { FlexCol as
|
429
|
-
import
|
155
|
+
import { FlexCol as FlexCol3 } from "@xylabs/react-flexbox";
|
156
|
+
import React10 from "react";
|
430
157
|
|
431
158
|
// src/components/MobileSystemControls/SystemControlsRoot.tsx
|
432
159
|
import { styled as styled2 } from "@mui/material";
|
@@ -441,16 +168,16 @@ var SystemControlsType = /* @__PURE__ */ function(SystemControlsType2) {
|
|
441
168
|
|
442
169
|
// src/components/MobileSystemControls/SystemControlsUnstyled.tsx
|
443
170
|
import { Paper as Paper2, useMediaQuery } from "@mui/material";
|
444
|
-
import { FlexCol as
|
171
|
+
import { FlexCol as FlexCol2, FlexRow as FlexRow5 } from "@xylabs/react-flexbox";
|
445
172
|
import { NetworkSelectEx as NetworkSelectEx2 } from "@xyo-network/react-network";
|
446
|
-
import
|
173
|
+
import React9 from "react";
|
447
174
|
|
448
175
|
// src/components/MobileSystemControls/controls/SystemControl.tsx
|
449
|
-
import { Collapse as
|
450
|
-
import { FlexCol
|
451
|
-
import
|
176
|
+
import { Collapse as Collapse2 } from "@mui/material";
|
177
|
+
import { FlexCol, FlexRow as FlexRow4 } from "@xylabs/react-flexbox";
|
178
|
+
import React8, { useState as useState2 } from "react";
|
452
179
|
var SystemControl = /* @__PURE__ */ __name(({ children, controlElement, systemControlsType = SystemControlsType.WindowShade, ...props }) => {
|
453
|
-
const [toggleControls, setToggleControls] =
|
180
|
+
const [toggleControls, setToggleControls] = useState2(false);
|
454
181
|
let orientation = "vertical";
|
455
182
|
switch (systemControlsType) {
|
456
183
|
case SystemControlsType.Left: {
|
@@ -458,17 +185,17 @@ var SystemControl = /* @__PURE__ */ __name(({ children, controlElement, systemCo
|
|
458
185
|
break;
|
459
186
|
}
|
460
187
|
}
|
461
|
-
return /* @__PURE__ */
|
188
|
+
return /* @__PURE__ */ React8.createElement(FlexRow4, {
|
462
189
|
className: "controls",
|
463
190
|
...props
|
464
|
-
}, /* @__PURE__ */
|
191
|
+
}, /* @__PURE__ */ React8.createElement(Collapse2, {
|
465
192
|
in: toggleControls,
|
466
193
|
orientation,
|
467
194
|
timeout: 500
|
468
|
-
}, /* @__PURE__ */
|
195
|
+
}, /* @__PURE__ */ React8.createElement(FlexRow4, {
|
469
196
|
bgcolor: "primary.main",
|
470
197
|
className: "control"
|
471
|
-
}, controlElement)), /* @__PURE__ */
|
198
|
+
}, controlElement)), /* @__PURE__ */ React8.createElement(FlexCol, {
|
472
199
|
style: {
|
473
200
|
cursor: "pointer"
|
474
201
|
},
|
@@ -479,21 +206,21 @@ var SystemControl = /* @__PURE__ */ __name(({ children, controlElement, systemCo
|
|
479
206
|
// src/components/MobileSystemControls/SystemControlsUnstyled.tsx
|
480
207
|
var SystemControlsUnstyled = /* @__PURE__ */ __name(({ visible, systemControlsType = SystemControlsType.WindowShade, ...props }) => {
|
481
208
|
const isSmall = useMediaQuery((theme) => theme.breakpoints.down("sm"));
|
482
|
-
return visible || isSmall ? /* @__PURE__ */
|
209
|
+
return visible || isSmall ? /* @__PURE__ */ React9.createElement(FlexCol2, {
|
483
210
|
...props,
|
484
211
|
className: `${props.className} system-controls-type-${systemControlsType}`
|
485
|
-
}, /* @__PURE__ */
|
212
|
+
}, /* @__PURE__ */ React9.createElement(SystemControl, {
|
486
213
|
systemControlsType,
|
487
|
-
controlElement: /* @__PURE__ */
|
214
|
+
controlElement: /* @__PURE__ */ React9.createElement(React9.Fragment, null, /* @__PURE__ */ React9.createElement(FlexRow5, {
|
488
215
|
className: "control-wrap"
|
489
|
-
}, /* @__PURE__ */
|
216
|
+
}, /* @__PURE__ */ React9.createElement(Paper2, {
|
490
217
|
variant: "elevation",
|
491
218
|
elevation: 0
|
492
|
-
}, /* @__PURE__ */
|
219
|
+
}, /* @__PURE__ */ React9.createElement(NetworkSelectEx2, {
|
493
220
|
responsive: false,
|
494
221
|
className: "network-ex"
|
495
222
|
}))))
|
496
|
-
})) : /* @__PURE__ */
|
223
|
+
})) : /* @__PURE__ */ React9.createElement(FlexCol2, null);
|
497
224
|
}, "SystemControlsUnstyled");
|
498
225
|
|
499
226
|
// src/components/MobileSystemControls/SystemControlsRoot.tsx
|
@@ -557,21 +284,21 @@ var SystemControlsRoot = styled2(SystemControlsUnstyled, {
|
|
557
284
|
|
558
285
|
// src/components/MobileSystemControls/SystemControls.tsx
|
559
286
|
var SystemControls = /* @__PURE__ */ __name((props) => {
|
560
|
-
return /* @__PURE__ */
|
287
|
+
return /* @__PURE__ */ React10.createElement(FlexCol3, null, /* @__PURE__ */ React10.createElement(SystemControlsRoot, props));
|
561
288
|
}, "SystemControls");
|
562
289
|
|
563
290
|
// src/components/SearchBar/SearchBar.tsx
|
564
291
|
import { Search as SearchIcon } from "@mui/icons-material";
|
565
292
|
import { Paper as Paper3, TextField } from "@mui/material";
|
566
293
|
import { ButtonEx } from "@xylabs/react-button";
|
567
|
-
import { FlexRow as
|
568
|
-
import
|
294
|
+
import { FlexRow as FlexRow6 } from "@xylabs/react-flexbox";
|
295
|
+
import React11, { useState as useState3 } from "react";
|
569
296
|
var SearchBar = /* @__PURE__ */ __name(({ defaultValue, onSearch, ...props }) => {
|
570
|
-
const [term, setTerm] =
|
571
|
-
return /* @__PURE__ */
|
297
|
+
const [term, setTerm] = useState3();
|
298
|
+
return /* @__PURE__ */ React11.createElement(FlexRow6, {
|
572
299
|
alignItems: "stretch",
|
573
300
|
...props
|
574
|
-
}, /* @__PURE__ */
|
301
|
+
}, /* @__PURE__ */ React11.createElement(Paper3, {
|
575
302
|
variant: "elevation",
|
576
303
|
elevation: 0,
|
577
304
|
style: {
|
@@ -579,7 +306,7 @@ var SearchBar = /* @__PURE__ */ __name(({ defaultValue, onSearch, ...props }) =>
|
|
579
306
|
overflow: "hidden",
|
580
307
|
width: "100%"
|
581
308
|
}
|
582
|
-
}, /* @__PURE__ */
|
309
|
+
}, /* @__PURE__ */ React11.createElement(TextField, {
|
583
310
|
variant: "outlined",
|
584
311
|
size: "small",
|
585
312
|
defaultValue,
|
@@ -598,7 +325,7 @@ var SearchBar = /* @__PURE__ */ __name(({ defaultValue, onSearch, ...props }) =>
|
|
598
325
|
}
|
599
326
|
}
|
600
327
|
}
|
601
|
-
}), /* @__PURE__ */
|
328
|
+
}), /* @__PURE__ */ React11.createElement(ButtonEx, {
|
602
329
|
variant: "contained",
|
603
330
|
style: {
|
604
331
|
borderRadius: 0,
|
@@ -606,23 +333,17 @@ var SearchBar = /* @__PURE__ */ __name(({ defaultValue, onSearch, ...props }) =>
|
|
606
333
|
},
|
607
334
|
color: "secondary",
|
608
335
|
onClick: /* @__PURE__ */ __name(() => onSearch?.(term), "onClick")
|
609
|
-
}, /* @__PURE__ */
|
336
|
+
}, /* @__PURE__ */ React11.createElement(SearchIcon, null))));
|
610
337
|
}, "SearchBar");
|
611
338
|
export {
|
612
|
-
ApplicationAppBar,
|
613
339
|
CollapseToggleFlex,
|
614
340
|
CollapsibleDrawer,
|
615
|
-
CollapsibleProvider,
|
616
|
-
ContextToolbar,
|
617
|
-
MenuListItemContainer,
|
618
|
-
MenuSection,
|
619
341
|
SearchBar,
|
620
|
-
SiteMenu,
|
621
342
|
SystemControls,
|
622
343
|
SystemControlsType,
|
623
344
|
SystemControlsUnstyled,
|
624
|
-
|
625
|
-
|
626
|
-
|
345
|
+
XyoApplicationAppBar,
|
346
|
+
XyoContextToolbar,
|
347
|
+
XyoSystemToolbar
|
627
348
|
};
|
628
349
|
//# sourceMappingURL=index.mjs.map
|