@xeonr/console-shell 0.4.0 → 0.4.1
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/dist/TopBar.d.ts.map +1 -1
- package/dist/TopBar.js +21 -5
- package/dist/TopBar.js.map +1 -1
- package/package.json +1 -1
package/dist/TopBar.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TopBar.d.ts","sourceRoot":"","sources":["../src/TopBar.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"TopBar.d.ts","sourceRoot":"","sources":["../src/TopBar.tsx"],"names":[],"mappings":"AAuEA,MAAM,WAAW,KAAK;IACpB,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;CAC3B;AAED,wBAAgB,MAAM,CAAC,EACrB,MAAM,EACN,iBAAiB,EACjB,QAAQ,EACR,QAAQ,EACR,aAAiB,EACjB,eAAe,GAChB,EAAE;IACD,MAAM,EAAE,KAAK,EAAE,CAAC;IAChB,iBAAiB,EAAE,MAAM,CAAC;IAC1B,QAAQ,EAAE,MAAM,IAAI,CAAC;IACrB,QAAQ,EAAE,MAAM,IAAI,CAAC;IACrB,aAAa,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IACnC,eAAe,CAAC,EAAE,CAAC,MAAM,IAAI,CAAC,GAAG,SAAS,CAAC;CAC5C,+BA8BA"}
|
package/dist/TopBar.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import styled from "styled-components";
|
|
2
|
+
import styled, { css } from "styled-components";
|
|
3
3
|
import { Icon, IconButton, v } from "@xeonr/platform-ui";
|
|
4
|
+
import { ShellLink } from "./links.js";
|
|
4
5
|
// Breadcrumb whose first crumb is always the team, then the product, then
|
|
5
6
|
// whatever the screen adds; ⌘K trigger; notifications.
|
|
6
7
|
const Bar = styled.header `
|
|
@@ -15,14 +16,29 @@ const Bar = styled.header `
|
|
|
15
16
|
position: sticky; top: 0;
|
|
16
17
|
z-index: calc(${v.zNav} - 2);
|
|
17
18
|
`;
|
|
18
|
-
const
|
|
19
|
+
const crumbText = css `
|
|
19
20
|
font-size: 13px;
|
|
20
|
-
color: ${(p) => (p.$last ? v.text : v.muted)};
|
|
21
|
-
font-weight: ${(p) => (p.$last ? 600 : 500)};
|
|
22
21
|
white-space: nowrap;
|
|
23
22
|
overflow: hidden; text-overflow: ellipsis;
|
|
24
23
|
max-width: 260px;
|
|
25
24
|
`;
|
|
25
|
+
const Crumb = styled.span `
|
|
26
|
+
${crumbText}
|
|
27
|
+
color: ${(p) => (p.$last ? v.text : v.muted)};
|
|
28
|
+
font-weight: ${(p) => (p.$last ? 600 : 500)};
|
|
29
|
+
`;
|
|
30
|
+
// A crumb with somewhere to go. It was a bare <a>, so every crumb click was a
|
|
31
|
+
// document load: the whole console reloaded, the shell fell back to its
|
|
32
|
+
// skeleton and re-read identity, teams, context and products before the page
|
|
33
|
+
// came back. ShellLink makes it a router link on this origin — exactly what
|
|
34
|
+
// the sidebar's links already are — and an <a> only when it leaves.
|
|
35
|
+
const CrumbLink = styled(ShellLink) `
|
|
36
|
+
${crumbText}
|
|
37
|
+
color: ${v.muted};
|
|
38
|
+
font-weight: 500;
|
|
39
|
+
text-decoration: none;
|
|
40
|
+
&:hover { color: ${v.text}; }
|
|
41
|
+
`;
|
|
26
42
|
const Sep = styled.span `color: ${v.faint}; display: grid; svg { font-size: 11px; }`;
|
|
27
43
|
const Search = styled.button `
|
|
28
44
|
height: 34px;
|
|
@@ -45,6 +61,6 @@ const Burger = styled(IconButton) `
|
|
|
45
61
|
@media (min-width: 901px) { display: none; }
|
|
46
62
|
`;
|
|
47
63
|
export function TopBar({ crumbs, searchPlaceholder, onBurger, onSearch, notifications = 0, onNotifications, }) {
|
|
48
|
-
return (_jsxs(Bar, { children: [_jsx(Burger, { type: "button", "aria-label": "Menu", onClick: onBurger, children: _jsx(Icon, { name: "menu" }) }), crumbs.map((c, i) => (_jsxs("span", { style: { display: "contents" }, children: [i > 0 ? _jsx(Sep, { children: _jsx(Icon, { name: "chevron-right" }) }) : null, c.href && i < crumbs.length - 1 ? (_jsx(
|
|
64
|
+
return (_jsxs(Bar, { children: [_jsx(Burger, { type: "button", "aria-label": "Menu", onClick: onBurger, children: _jsx(Icon, { name: "menu" }) }), crumbs.map((c, i) => (_jsxs("span", { style: { display: "contents" }, children: [i > 0 ? _jsx(Sep, { children: _jsx(Icon, { name: "chevron-right" }) }) : null, c.href && i < crumbs.length - 1 ? (_jsx(CrumbLink, { href: c.href, children: c.label })) : (_jsx(Crumb, { "$last": i === crumbs.length - 1, children: c.label }))] }, `${c.label}-${i}`))), _jsx(Spacer, {}), _jsxs(Search, { type: "button", onClick: onSearch, "aria-label": "Search and commands", children: [_jsx(Icon, { name: "search" }), _jsx("span", { children: searchPlaceholder }), _jsx("kbd", { children: "\u2318K" })] }), onNotifications ? (_jsxs(IconButton, { type: "button", "$size": 34, "aria-label": notifications ? `${notifications} notifications` : "Notifications", onClick: onNotifications, style: { position: "relative" }, children: [_jsx(Icon, { name: "bell" }), notifications > 0 ? (_jsx("span", { style: { position: "absolute", top: 6, right: 7, width: 8, height: 8, borderRadius: 999, background: v.danger } })) : null] })) : null] }));
|
|
49
65
|
}
|
|
50
66
|
//# sourceMappingURL=TopBar.js.map
|
package/dist/TopBar.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TopBar.js","sourceRoot":"","sources":["../src/TopBar.tsx"],"names":[],"mappings":";AAAA,OAAO,MAAM,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"TopBar.js","sourceRoot":"","sources":["../src/TopBar.tsx"],"names":[],"mappings":";AAAA,OAAO,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,IAAI,EAAE,UAAU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AAI,EAAC,QAAQ,WAAQ,EAAE,gBAAc,aAAa,CAAC,CAAC,CAAC,GAAG,aAAa,gBAAgB,CAAC,CAAC,CAAC,eAAe,EAAE,OAAO,EAAE,eAAe,EAAE,KAAK,EAAE,EAAE,QAAQ,EAAE,UAAU,EAAE,aAC5K,KAAC,IAAI,IAAC,IAAI,EAAC,MAAM,GAAG,EACnB,aAAa,GAAG,CAAC,CAAC,CAAC,CAAC,CACnB,eAAM,KAAK,EAAE,EAAE,QAAQ,EAAE,UAAU,EAAE,GAAG,EAAE,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,YAAY,EAAE,GAAG,EAAE,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE,GAAI,CAC1H,CAAC,CAAC,CAAC,IAAI,IACG,CACd,CAAC,CAAC,CAAC,IAAI,IACJ,CACP,CAAC;AACJ,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@xeonr/console-shell",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.1",
|
|
4
4
|
"description": "The Xeonr Cloud Console chrome: product rail, team switcher, section sidebar, top bar, ⌘K and the All-products launcher, plus the console context hooks every product console mounts.",
|
|
5
5
|
"license": "UNLICENSED",
|
|
6
6
|
"type": "module",
|