@cboxdk/cbox-ui 0.10.2 → 0.10.3
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/README.md +17 -5
- package/dist/charts.d.ts +53 -3
- package/dist/charts.js +142 -4
- package/dist/charts.js.map +1 -1
- package/dist/chunk-QJ4T7RR2.js +113 -0
- package/dist/chunk-QJ4T7RR2.js.map +1 -0
- package/dist/engine-J67R3KY5.js +10 -0
- package/dist/engine-J67R3KY5.js.map +1 -0
- package/dist/index.d.ts +11 -2
- package/dist/index.js +27 -9
- package/dist/index.js.map +1 -1
- package/dist/scale-CYX7qlwJ.d.ts +55 -0
- package/package.json +1 -1
- package/tokens/shell.css +6 -0
- package/dist/chunk-OFTNLF7H.js +0 -55
- package/dist/chunk-OFTNLF7H.js.map +0 -1
- package/dist/engine-4DRZ3POZ.js +0 -10
- package/dist/engine-4DRZ3POZ.js.map +0 -1
- package/dist/scale-BaaY5qJs.d.ts +0 -24
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { cn } from './chunk-
|
|
2
|
-
export { cn, niceTicks, timeTicks } from './chunk-
|
|
1
|
+
import { cn } from './chunk-QJ4T7RR2.js';
|
|
2
|
+
export { cn, niceTicks, timeTicks } from './chunk-QJ4T7RR2.js';
|
|
3
3
|
import { defineCboxAppSwitcher, subscribeKnownAppCatalog, readKnownAppCatalog, secureIconUrl, initials, parseAppCatalog, signInTarget, rememberAppCatalog } from './chunk-AJCYF7SS.js';
|
|
4
4
|
export { authorizeHref, parseAppCatalog, readKnownAppCatalog, rememberAppCatalog, secureIconUrl, signInTarget } from './chunk-AJCYF7SS.js';
|
|
5
5
|
import { createContext, useContext, useMemo, useSyncExternalStore, useState, useEffect, useCallback, useRef, createElement, useId, useLayoutEffect, useImperativeHandle } from 'react';
|
|
@@ -1803,6 +1803,14 @@ function resolveIcon(name, extra = {}) {
|
|
|
1803
1803
|
function navUrl(entry) {
|
|
1804
1804
|
return entry.url ?? entry.href ?? "#";
|
|
1805
1805
|
}
|
|
1806
|
+
function areaLocked(area) {
|
|
1807
|
+
const pages = area.pages ?? [];
|
|
1808
|
+
return pages.length > 0 && pages.every((page) => page.locked === true);
|
|
1809
|
+
}
|
|
1810
|
+
function shellBanners(shell, testData) {
|
|
1811
|
+
const all = shell.banners ?? (shell.banner !== void 0 ? [shell.banner] : []);
|
|
1812
|
+
return all.filter((banner) => banner.kind !== "sandbox" || testData);
|
|
1813
|
+
}
|
|
1806
1814
|
function groupPages(pages) {
|
|
1807
1815
|
const runs = /* @__PURE__ */ new Map();
|
|
1808
1816
|
for (const page of pages) {
|
|
@@ -1898,7 +1906,11 @@ function NavSheet({ onClose }) {
|
|
|
1898
1906
|
return /* @__PURE__ */ jsxs("div", { className: "cbx-sheet-area", children: [
|
|
1899
1907
|
/* @__PURE__ */ jsxs(Link, { href: navUrl(area), className: `cbx-row cbx-row-action ${activeArea ? (area.pages ?? []).length > 1 ? "is-open" : "is-current" : ""}`, "aria-current": activeArea && (area.pages ?? []).length <= 1 ? "page" : void 0, onClick: onClose, children: [
|
|
1900
1908
|
/* @__PURE__ */ jsx(Icon, { size: 16, strokeWidth: 1.8, "aria-hidden": true }),
|
|
1901
|
-
/* @__PURE__ */ jsx("span", { className: "cbx-row-name", children: area.label })
|
|
1909
|
+
/* @__PURE__ */ jsx("span", { className: "cbx-row-name", children: area.label }),
|
|
1910
|
+
areaLocked(area) && /* @__PURE__ */ jsxs("span", { className: "cbx-nav-lock", title: t("Not in your plan"), children: [
|
|
1911
|
+
/* @__PURE__ */ jsx(Lock, { size: 13, strokeWidth: 1.9, "aria-hidden": true }),
|
|
1912
|
+
/* @__PURE__ */ jsx("span", { className: "cbx-sr-only", children: t("(locked)") })
|
|
1913
|
+
] })
|
|
1902
1914
|
] }),
|
|
1903
1915
|
(area.pages ?? []).length > 1 && /* @__PURE__ */ jsx("div", { className: "cbx-sheet-pages", children: /* @__PURE__ */ jsx(
|
|
1904
1916
|
NavPageList,
|
|
@@ -2427,7 +2439,7 @@ function CboxShell({ shell, children, navigate = defaultNavigate, LinkComponent
|
|
|
2427
2439
|
const mobile = useMedia(MOBILE, false);
|
|
2428
2440
|
const testData = levels.some((level) => level.current.testData === true);
|
|
2429
2441
|
const helpOpen = useHelpState(store, (state) => helpVisible(state, docked));
|
|
2430
|
-
const
|
|
2442
|
+
const banners = shellBanners(shell, testData);
|
|
2431
2443
|
return /* @__PURE__ */ jsx(ShellContext.Provider, { value: api, children: /* @__PURE__ */ jsxs("div", { className: "cbx-shell", "data-help-open": helpOpen, children: [
|
|
2432
2444
|
/* @__PURE__ */ jsx(
|
|
2433
2445
|
"a",
|
|
@@ -2447,10 +2459,10 @@ function CboxShell({ shell, children, navigate = defaultNavigate, LinkComponent
|
|
|
2447
2459
|
/* @__PURE__ */ jsx(Rail, { brandAssetBase }),
|
|
2448
2460
|
/* @__PURE__ */ jsxs("div", { className: "cbx-shell-column", children: [
|
|
2449
2461
|
/* @__PURE__ */ jsx(Header, { mobile }),
|
|
2450
|
-
banner
|
|
2462
|
+
banners.map((banner, index) => /* @__PURE__ */ jsxs("div", { className: `cbx-banner cbx-banner-${banner.kind}`, role: "status", children: [
|
|
2451
2463
|
/* @__PURE__ */ jsx("span", { className: "cbx-banner-text", children: banner.text }),
|
|
2452
2464
|
banner.action !== void 0 && /* @__PURE__ */ jsx(LinkComponent, { href: navUrl(banner.action), className: "cbx-banner-action", children: banner.action.label })
|
|
2453
|
-
] }),
|
|
2465
|
+
] }, `${banner.kind}-${index}`)),
|
|
2454
2466
|
/* @__PURE__ */ jsxs("div", { className: "cbx-shell-body", children: [
|
|
2455
2467
|
/* @__PURE__ */ jsx(Subnav, {}),
|
|
2456
2468
|
/* @__PURE__ */ jsx("main", { id: mainId, tabIndex: -1, className: "cbx-shell-main canvas-gradient", children })
|
|
@@ -2510,9 +2522,15 @@ function Rail({ brandAssetBase }) {
|
|
|
2510
2522
|
/* @__PURE__ */ jsx("nav", { className: "cbx-rail-nav", "aria-label": name, children: shell.nav.areas.map((area) => {
|
|
2511
2523
|
const Icon = resolveIcon(area.icon, icons);
|
|
2512
2524
|
const active = area.key === shell.nav.activeArea;
|
|
2513
|
-
|
|
2514
|
-
|
|
2515
|
-
|
|
2525
|
+
const locked = areaLocked(area);
|
|
2526
|
+
const label = locked ? t("{area} (locked)", { area: area.label }) : area.label;
|
|
2527
|
+
return /* @__PURE__ */ jsxs(Link, { href: navUrl(area), className: `cbx-rail-link ${active ? "is-active" : ""} ${locked ? "is-locked" : ""}`, "aria-current": active ? "page" : void 0, title: open ? void 0 : label, "aria-label": label, "data-locked": locked ? "true" : void 0, children: [
|
|
2528
|
+
/* @__PURE__ */ jsxs("span", { className: "cbx-rail-icon", children: [
|
|
2529
|
+
/* @__PURE__ */ jsx(Icon, { size: 18, strokeWidth: 1.7, "aria-hidden": true }),
|
|
2530
|
+
locked && /* @__PURE__ */ jsx("span", { className: "cbx-rail-lock", "aria-hidden": "true", children: /* @__PURE__ */ jsx(Lock, { size: 9, strokeWidth: 2.4 }) })
|
|
2531
|
+
] }),
|
|
2532
|
+
/* @__PURE__ */ jsx("span", { className: "cbx-rail-label", children: area.label }),
|
|
2533
|
+
locked && /* @__PURE__ */ jsx(Lock, { className: "cbx-rail-lock-open", size: 13, strokeWidth: 1.9, "aria-hidden": true })
|
|
2516
2534
|
] }, area.key);
|
|
2517
2535
|
}) }),
|
|
2518
2536
|
/* @__PURE__ */ jsx("div", { className: "cbx-rail-foot", children: /* @__PURE__ */ jsxs(
|