@campminder/components 0.1.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/README.md +198 -0
- package/dist/index.d.ts +16 -0
- package/dist/index.js +11 -0
- package/dist/menu-tree.upstream.test.d.ts +1 -0
- package/dist/property-B5JHHBCF.js +603 -0
- package/dist/side-nav/MegaMenu.d.ts +50 -0
- package/dist/side-nav/MegaMenu.styles.d.ts +33 -0
- package/dist/side-nav/SideNav.d.ts +89 -0
- package/dist/side-nav/SideNav.styles.d.ts +42 -0
- package/dist/side-nav/Utils/helpers.d.ts +57 -0
- package/dist/side-nav/assets/MegaMenuIcons/AccountsGrayIcon.d.ts +2 -0
- package/dist/side-nav/assets/MegaMenuIcons/AdminGrayIcon.d.ts +2 -0
- package/dist/side-nav/assets/MegaMenuIcons/AlumniGrayIcon.d.ts +2 -0
- package/dist/side-nav/assets/MegaMenuIcons/CampInTouchGrayIcon.d.ts +2 -0
- package/dist/side-nav/assets/MegaMenuIcons/CamperGrayIcon.d.ts +2 -0
- package/dist/side-nav/assets/MegaMenuIcons/CommunicationGrayIcon.d.ts +2 -0
- package/dist/side-nav/assets/MegaMenuIcons/DefaultMMIcon.d.ts +2 -0
- package/dist/side-nav/assets/MegaMenuIcons/FinancialGrayIcon.d.ts +2 -0
- package/dist/side-nav/assets/MegaMenuIcons/MedicalGrayIcon.d.ts +2 -0
- package/dist/side-nav/assets/MegaMenuIcons/OpenInNewIcon.d.ts +2 -0
- package/dist/side-nav/assets/MegaMenuIcons/ReportsGrayIcon.d.ts +2 -0
- package/dist/side-nav/assets/MegaMenuIcons/SchedulingGrayIcon.d.ts +2 -0
- package/dist/side-nav/assets/MegaMenuIcons/StaffGrayIcon.d.ts +2 -0
- package/dist/side-nav/assets/MegaMenuIcons/TravelGrayIcon.d.ts +2 -0
- package/dist/side-nav/assets/MegaMenuIcons/index.d.ts +16 -0
- package/dist/side-nav/assets/SideNavIcons/AccountsIcon.d.ts +2 -0
- package/dist/side-nav/assets/SideNavIcons/AdminIcon.d.ts +2 -0
- package/dist/side-nav/assets/SideNavIcons/AlumniIcon.d.ts +2 -0
- package/dist/side-nav/assets/SideNavIcons/CampInTouch.d.ts +2 -0
- package/dist/side-nav/assets/SideNavIcons/CamperIcon.d.ts +2 -0
- package/dist/side-nav/assets/SideNavIcons/ChevronRightIcon.d.ts +2 -0
- package/dist/side-nav/assets/SideNavIcons/CloseIcon.d.ts +2 -0
- package/dist/side-nav/assets/SideNavIcons/CommunicationIcon.d.ts +2 -0
- package/dist/side-nav/assets/SideNavIcons/DefaultNavIcon.d.ts +2 -0
- package/dist/side-nav/assets/SideNavIcons/FinancialIcon.d.ts +2 -0
- package/dist/side-nav/assets/SideNavIcons/HomeIcon.d.ts +2 -0
- package/dist/side-nav/assets/SideNavIcons/MedicalIcon.d.ts +2 -0
- package/dist/side-nav/assets/SideNavIcons/MenuCollapseIcon.d.ts +2 -0
- package/dist/side-nav/assets/SideNavIcons/MenuIcon.d.ts +10 -0
- package/dist/side-nav/assets/SideNavIcons/ReportsIcon.d.ts +2 -0
- package/dist/side-nav/assets/SideNavIcons/SchedulingIcon.d.ts +2 -0
- package/dist/side-nav/assets/SideNavIcons/StaffIcon.d.ts +2 -0
- package/dist/side-nav/assets/SideNavIcons/TravelIcon.d.ts +2 -0
- package/dist/side-nav/assets/SideNavIcons/index.d.ts +20 -0
- package/dist/side-nav/icon-map.d.ts +17 -0
- package/dist/side-nav/index.d.ts +5 -0
- package/dist/side-nav/mega-menu-icon-map.d.ts +20 -0
- package/dist/side-nav/mega-menu-layout.d.ts +9 -0
- package/dist/side-nav/mega-menu.test.d.ts +1 -0
- package/dist/side-nav/side-nav.test.d.ts +1 -0
- package/dist/side-nav.d.ts +1 -0
- package/dist/side-nav.js +1198 -0
- package/dist/state-Ns9O6R8g.js +12 -0
- package/dist/super-user-banner/SuperUserBanner.d.ts +43 -0
- package/dist/super-user-banner/SuperUserBanner.styles.d.ts +21 -0
- package/dist/super-user-banner/index.d.ts +2 -0
- package/dist/super-user-banner/super-user-banner.test.d.ts +1 -0
- package/dist/super-user-banner.d.ts +1 -0
- package/dist/super-user-banner.js +178 -0
- package/dist/top-bar/TopBar.d.ts +39 -0
- package/dist/top-bar/TopBar.styles.d.ts +1 -0
- package/dist/top-bar/Utils/helpers.d.ts +3 -0
- package/dist/top-bar/Utils/safe-url.d.ts +56 -0
- package/dist/top-bar/Utils/safe-url.test.d.ts +1 -0
- package/dist/top-bar/Utils/types.d.ts +50 -0
- package/dist/top-bar/assets/TopBarIcons/CheckIcon.d.ts +2 -0
- package/dist/top-bar/assets/TopBarIcons/CrossIcon.d.ts +2 -0
- package/dist/top-bar/assets/TopBarIcons/DropDownIcon.d.ts +2 -0
- package/dist/top-bar/assets/TopBarIcons/InfoIcon.d.ts +2 -0
- package/dist/top-bar/assets/TopBarIcons/OpenInNewIcon.d.ts +2 -0
- package/dist/top-bar/assets/TopBarIcons/index.d.ts +7 -0
- package/dist/top-bar/index.d.ts +3 -0
- package/dist/top-bar/top-bar.test.d.ts +1 -0
- package/dist/top-bar.d.ts +1 -0
- package/dist/top-bar.js +615 -0
- package/package.json +52 -0
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import { LitElement } from 'lit';
|
|
2
|
+
import { MenuTree } from '@campminder/menu-tree';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* `<cm-side-nav>` — the left navigation.
|
|
6
|
+
*
|
|
7
|
+
* Ported 2026-09-02 from core-js's `SideNav.ts` (`<side-nav>`), core rendering path,
|
|
8
|
+
* with the desktop mega-menu flyout added 2026-09-04 (Floor 5) — mounted inside
|
|
9
|
+
* this component's own shadow root, not slotted; see the render() seam note below.
|
|
10
|
+
* Mobile and the search-bar integration remain out of scope for both floors.
|
|
11
|
+
*/
|
|
12
|
+
export declare class SideNav extends LitElement {
|
|
13
|
+
static readonly styles: import('lit').CSSResult[];
|
|
14
|
+
private hoveredCategory;
|
|
15
|
+
private hoverTimeout;
|
|
16
|
+
/**
|
|
17
|
+
* Collapsed state lives on `<campminder-app-shell>`, keyed per portal — see its
|
|
18
|
+
* doc comment. `cm-side-nav` only renders from it and reports intent to change
|
|
19
|
+
* it; it never reads or writes storage itself. core-js's `SIDENAV_STORAGE_KEY`
|
|
20
|
+
* (`isSideNavCollapsed`) was a single global key shared by every side-nav on one
|
|
21
|
+
* origin, which breaks the moment a second portal exists — dropped, not
|
|
22
|
+
* replaced, because ownership moved rather than the key itself needing a new
|
|
23
|
+
* name.
|
|
24
|
+
*/
|
|
25
|
+
collapsed: boolean;
|
|
26
|
+
/**
|
|
27
|
+
* The current path, passed in rather than read from `window.location` (the plan's
|
|
28
|
+
* renames section). core-js's `getSelectedCategory` read
|
|
29
|
+
* `window.location.pathname + window.location.search` directly when the caller
|
|
30
|
+
* didn't supply one; every caller here always does, so the component never
|
|
31
|
+
* touches the global.
|
|
32
|
+
*/
|
|
33
|
+
currentPath: string;
|
|
34
|
+
/**
|
|
35
|
+
* The menu tree, passed in as a property — not a base64 `data` attribute.
|
|
36
|
+
* core-js's `decodeString()` fused transport decoding, sorting and icon binding
|
|
37
|
+
* into one attribute converter, logged and returned `[]` on failure (a silently
|
|
38
|
+
* empty nav), and depended on `Category`/`Subcategory`/`MenuItem` from
|
|
39
|
+
* `Utils/types.ts`, which are not ported — the tree is typed against this repo's
|
|
40
|
+
* `MenuTree` (`../menu-tree`, generic — see that file's move note) instead. Icon binding is the only
|
|
41
|
+
* piece of that pipeline still intrinsic to rendering; see `icon-map.ts`.
|
|
42
|
+
*
|
|
43
|
+
* Not sorted here. core-js's `sortCategoriesData` sorted by `sort_order` then
|
|
44
|
+
* name at every level because the base64 fixture arrived unsorted; verified
|
|
45
|
+
* 2026-09-02 that the committed `campminder.json` categories are already in
|
|
46
|
+
* `sortOrder` order on disk, and `drift.test.ts` pins that order — so imposing a
|
|
47
|
+
* second sort here would just be a no-op that could silently start doing
|
|
48
|
+
* something the day the JSON stops being pre-sorted. If that's ever untrue, the
|
|
49
|
+
* fix belongs where the JSON is authored, not in a render-time sort this
|
|
50
|
+
* component would then always pay for.
|
|
51
|
+
*/
|
|
52
|
+
tree: MenuTree;
|
|
53
|
+
/**
|
|
54
|
+
* Computed on render rather than cached in `@state` and refreshed from
|
|
55
|
+
* `updated()` — core-js's shape. That pattern writes state from inside the
|
|
56
|
+
* `updated()` lifecycle hook, which schedules a second update on top of the one
|
|
57
|
+
* already in flight (Lit warns: "scheduled an update ... after an update
|
|
58
|
+
* completed"). `selectedCategory` is a pure function of `tree` and
|
|
59
|
+
* `currentPath`, both already reactive properties, so there is nothing this
|
|
60
|
+
* getter needs to cache.
|
|
61
|
+
*/
|
|
62
|
+
private get selectedCategory();
|
|
63
|
+
disconnectedCallback(): void;
|
|
64
|
+
private toggleSidenav;
|
|
65
|
+
private setSelectedCategory;
|
|
66
|
+
private handleMenuItemHover;
|
|
67
|
+
private clearHoverTimeout;
|
|
68
|
+
private handleMouseEnter;
|
|
69
|
+
private handleMouseLeave;
|
|
70
|
+
private get hamburgerIcon();
|
|
71
|
+
/**
|
|
72
|
+
* The category the mega-menu flyout is open for, or `undefined` when none
|
|
73
|
+
* is. Guards on `renderableSubCategories(category).length > 0` (the same
|
|
74
|
+
* predicate `hasSubmenus` uses for the chevron above) rather than on
|
|
75
|
+
* `hoveredCategory` alone — `hoveredCategory` can also be the literal
|
|
76
|
+
* string `'sidebar-toggle'` (see `handleMouseEnter` call sites), and a
|
|
77
|
+
* category with no renderable sub-categories must not open onto nothing.
|
|
78
|
+
*/
|
|
79
|
+
private get openCategory();
|
|
80
|
+
private buildCategoryClass;
|
|
81
|
+
private getCategoryHtml;
|
|
82
|
+
private renderMainMenu;
|
|
83
|
+
render(): import('lit').TemplateResult<1>;
|
|
84
|
+
}
|
|
85
|
+
declare global {
|
|
86
|
+
interface HTMLElementTagNameMap {
|
|
87
|
+
'cm-side-nav': SideNav;
|
|
88
|
+
}
|
|
89
|
+
}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Styles for `<cm-side-nav>`.
|
|
3
|
+
*
|
|
4
|
+
* Ported 2026-09-02 from core-js's `SideNav.styles.ts` + `SideNav.desktop-styles.ts`,
|
|
5
|
+
* folded into one file because mobile never lands here (Floor 5) and the
|
|
6
|
+
* `:host(.is-desktop)` conditional this repo's `desktop-styles.ts` gated on no
|
|
7
|
+
* longer applies — there is no `deviceCSS` to add that class, and there is only one
|
|
8
|
+
* mode. Design tokens and the bulk of the visual rules (buttons, categories, hover
|
|
9
|
+
* / focus / selected states, the gradient, scrollbar hiding, reduced-motion) carry
|
|
10
|
+
* across unchanged. What changed, and why:
|
|
11
|
+
*
|
|
12
|
+
* - `:host` no longer takes itself out of flow. core-js's `position: fixed; top: 0;
|
|
13
|
+
* left: 0` assumed the component places itself on the page; inside
|
|
14
|
+
* `<campminder-app-shell>`'s `[part='nav']` grid area that leaves the shell's
|
|
15
|
+
* `--cm-side-nav-width` column empty and the nav floating over the page. The
|
|
16
|
+
* shell places it now.
|
|
17
|
+
* - `.nav-container` drops `position: fixed` for the same reason.
|
|
18
|
+
* - `.nav-overlay` is gone outright — it only ever backed the mobile slide-in menu
|
|
19
|
+
* (see `SideNavMobileStyles`, not ported), and dies with mobile.
|
|
20
|
+
* - The three `--z-nav*` tokens are gone. They existed to sit above a WebForms
|
|
21
|
+
* page; inside a grid shell stacking is the shell's problem, and a component
|
|
22
|
+
* asserting its own place in a stack it doesn't own is exactly the coupling this
|
|
23
|
+
* port removes.
|
|
24
|
+
* - The `@import url(fonts.googleapis.com/...)` is gone. A network fetch from
|
|
25
|
+
* inside a shadow root for a font the shell should provide has no place in a
|
|
26
|
+
* component that renders itself and nothing else.
|
|
27
|
+
* - `--sidebar-width-expanded` / `--sidebar-width-collapsed` are gone.
|
|
28
|
+
* `packages/campminder/src/layout.ts` is the single source for those dimensions
|
|
29
|
+
* now (it says so in its own header) and already drives `--cm-side-nav-width` off
|
|
30
|
+
* `campminder-app-shell[collapsed]`. `.side-nav` fills whatever width the host is
|
|
31
|
+
* given rather than asserting its own — carrying both would let the two silently
|
|
32
|
+
* disagree, which is the exact drift bug `layout.ts` exists to prevent.
|
|
33
|
+
* - `topOffsetPx`-driven inline styles (`position: fixed; top; height: calc(100vh -
|
|
34
|
+
* Npx)` at several render sites) have no CSS counterpart here because the
|
|
35
|
+
* property itself isn't ported — `--cm-top-bar-height` and a grid row are the
|
|
36
|
+
* shell's answer to "how tall is the bar above me."
|
|
37
|
+
*
|
|
38
|
+
* 2026-09-04, Floor 5 added `position: relative` to `.nav-container` as the
|
|
39
|
+
* mega-menu flyout's positioning context. `.nav-main-content` was deliberately
|
|
40
|
+
* left at `overflow: hidden` — see that rule's own comment below for why.
|
|
41
|
+
*/
|
|
42
|
+
export declare const SideNavStyles: import('lit').CSSResult;
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { MenuCategory, MenuSubCategory, MenuTree } from '@campminder/menu-tree';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Find the category id whose tree contains a given URL — checked at every level a
|
|
5
|
+
* link can live at, because `campminder.json` allows a category or sub-category to
|
|
6
|
+
* be a direct link (`Home` has `href: "/"` and zero children) as well as leaves.
|
|
7
|
+
* core-js's `findCategoryByUrl` only checked leaf `menu_items`; ported here as a
|
|
8
|
+
* strict superset, not a narrower rewrite.
|
|
9
|
+
*/
|
|
10
|
+
export declare function findCategoryByUrl(tree: MenuTree, url: string): string | undefined;
|
|
11
|
+
/**
|
|
12
|
+
* Whether a sub-category has anything for a user to reach.
|
|
13
|
+
*
|
|
14
|
+
* Two sub-categories in the Campminder tree are **permanently empty by design** —
|
|
15
|
+
* `Reporting > Custom Reports` and `Reporting > Phone Reservations`. Their contents are
|
|
16
|
+
* per-client database rows, and `NavigationBuilder.cs:104-111` assigns them with `=`, not
|
|
17
|
+
* `+=`, so the host replaces the section wholesale at request time. This shell has no
|
|
18
|
+
* database (ADR D5 and D7: the tree is committed configuration, filtering is pure), so
|
|
19
|
+
* there is nothing to put in them and a rendered header would lead nowhere.
|
|
20
|
+
*
|
|
21
|
+
* Ruled 2026-09-02: **hide them**, and carry the gap to Phase 2, where the host that
|
|
22
|
+
* consumes the shell has the database anyway.
|
|
23
|
+
*
|
|
24
|
+
* `sub.href` matters because the tree format allows a sub-category to be a direct link
|
|
25
|
+
* with zero children — `findCategoryByUrl` above relies on that. Such a sub-category is
|
|
26
|
+
* reachable and must survive; only one with neither children nor a link of its own is
|
|
27
|
+
* dead weight. (Neither of today's two empty sub-categories has an `href`.)
|
|
28
|
+
*
|
|
29
|
+
* This is a **render-time** rule, not a tree edit, deliberately: Floor 6's visibility
|
|
30
|
+
* filter will produce the same situation dynamically whenever every leaf in a section is
|
|
31
|
+
* gated off for a given user. One predicate covers both, so Floor 6 does not need its own.
|
|
32
|
+
*/
|
|
33
|
+
export declare function isRenderableSubCategory(sub: MenuSubCategory): boolean;
|
|
34
|
+
/** A category's sub-categories minus the ones with nothing to reach. Floor 5's mega menu renders from this, not from `subCategories` directly. */
|
|
35
|
+
export declare function renderableSubCategories(category: MenuCategory): MenuSubCategory[];
|
|
36
|
+
/**
|
|
37
|
+
* Whether a category has sub-categories to show (mega-menu content, once Floor 5 lands).
|
|
38
|
+
*
|
|
39
|
+
* Counts only *renderable* sub-categories, so a category whose every section is empty
|
|
40
|
+
* does not advertise a chevron that opens onto nothing.
|
|
41
|
+
*/
|
|
42
|
+
export declare function hasSubmenus(tree: MenuTree, categoryId: string): boolean;
|
|
43
|
+
/**
|
|
44
|
+
* Get the selected category id for a given path.
|
|
45
|
+
*
|
|
46
|
+
* The component must not read `window.location` (see the plan's renames section),
|
|
47
|
+
* so `currentPath` is a required parameter rather than a default read from the
|
|
48
|
+
* global — core-js's `getSelectedCategory` fell back to
|
|
49
|
+
* `window.location.pathname + window.location.search` when the caller omitted it;
|
|
50
|
+
* every caller here always passes one.
|
|
51
|
+
*
|
|
52
|
+
* The `'/' → Home` special case is preserved from core-js verbatim but keyed on
|
|
53
|
+
* `id === 'home'` rather than a hardcoded display name, since `MenuCategory.label`
|
|
54
|
+
* is not guaranteed to be "Home" (it is a terminology-resolved string elsewhere in
|
|
55
|
+
* the estate) while `id` is stable, committed configuration.
|
|
56
|
+
*/
|
|
57
|
+
export declare function getSelectedCategory(tree: MenuTree, currentPath: string): string;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { default as AccountsGrayIcon } from './AccountsGrayIcon';
|
|
2
|
+
import { default as AdminGrayIcon } from './AdminGrayIcon';
|
|
3
|
+
import { default as AlumniGrayIcon } from './AlumniGrayIcon';
|
|
4
|
+
import { default as CamperGrayIcon } from './CamperGrayIcon';
|
|
5
|
+
import { default as CampInTouchGrayIcon } from './CampInTouchGrayIcon';
|
|
6
|
+
import { default as CommunicationGrayIcon } from './CommunicationGrayIcon';
|
|
7
|
+
import { default as DefaultMMIcon } from './DefaultMMIcon';
|
|
8
|
+
import { default as FinancialGrayIcon } from './FinancialGrayIcon';
|
|
9
|
+
import { default as MedicalGrayIcon } from './MedicalGrayIcon';
|
|
10
|
+
import { default as OpenInNewIcon } from './OpenInNewIcon';
|
|
11
|
+
import { default as ReportsGrayIcon } from './ReportsGrayIcon';
|
|
12
|
+
import { default as SchedulingGrayIcon } from './SchedulingGrayIcon';
|
|
13
|
+
import { default as StaffGrayIcon } from './StaffGrayIcon';
|
|
14
|
+
import { default as TravelGrayIcon } from './TravelGrayIcon';
|
|
15
|
+
|
|
16
|
+
export { AccountsGrayIcon, AdminGrayIcon, AlumniGrayIcon, CamperGrayIcon, CommunicationGrayIcon, CampInTouchGrayIcon, FinancialGrayIcon, MedicalGrayIcon, OpenInNewIcon, ReportsGrayIcon, SchedulingGrayIcon, StaffGrayIcon, TravelGrayIcon, DefaultMMIcon, };
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Hamburger menu icon with three horizontal lines.
|
|
3
|
+
*
|
|
4
|
+
* Normalized 2026-09-02 from core-js's `(color = 'white') => TemplateResult` to a
|
|
5
|
+
* plain value — the only surviving call site (`hamburgerIcon`) always used the
|
|
6
|
+
* default, and `MenuCollapsedSvgIcon` it sits beside in the same ternary was
|
|
7
|
+
* already a value. One form for both branches of that ternary.
|
|
8
|
+
*/
|
|
9
|
+
declare const _default: import('lit').TemplateResult<1>;
|
|
10
|
+
export default _default;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { default as AccountsSvgIcon } from './AccountsIcon';
|
|
2
|
+
import { default as AdminSvgIcon } from './AdminIcon';
|
|
3
|
+
import { default as AlumniSvgIcon } from './AlumniIcon';
|
|
4
|
+
import { default as CamperSvgIcon } from './CamperIcon';
|
|
5
|
+
import { default as CampInTouchSvgIcon } from './CampInTouch';
|
|
6
|
+
import { default as ChevronRightSvgIcon } from './ChevronRightIcon';
|
|
7
|
+
import { default as CloseSvgIcon } from './CloseIcon';
|
|
8
|
+
import { default as CommunicationSvgIcon } from './CommunicationIcon';
|
|
9
|
+
import { default as DefaultNavIcon } from './DefaultNavIcon';
|
|
10
|
+
import { default as FinancialSvgIcon } from './FinancialIcon';
|
|
11
|
+
import { default as HomeSvgIcon } from './HomeIcon';
|
|
12
|
+
import { default as MedicalSvgIcon } from './MedicalIcon';
|
|
13
|
+
import { default as MenuCollapsedSvgIcon } from './MenuCollapseIcon';
|
|
14
|
+
import { default as MenuSvgIcon } from './MenuIcon';
|
|
15
|
+
import { default as ReportsSvgIcon } from './ReportsIcon';
|
|
16
|
+
import { default as SchedulingSvgIcon } from './SchedulingIcon';
|
|
17
|
+
import { default as StaffSvgIcon } from './StaffIcon';
|
|
18
|
+
import { default as TravelSvgIcon } from './TravelIcon';
|
|
19
|
+
|
|
20
|
+
export { AlumniSvgIcon, CamperSvgIcon, CloseSvgIcon, CommunicationSvgIcon, CampInTouchSvgIcon, FinancialSvgIcon, MedicalSvgIcon, MenuSvgIcon, ReportsSvgIcon, SchedulingSvgIcon, StaffSvgIcon, TravelSvgIcon, AccountsSvgIcon, AdminSvgIcon, HomeSvgIcon, MenuCollapsedSvgIcon, DefaultNavIcon, ChevronRightSvgIcon, };
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { TemplateResult } from 'lit';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Resolves a category's icon from its display label, the same way core-js's
|
|
5
|
+
* `mapCategoriesWithIcons` resolved it from `category.name`. An unmapped or
|
|
6
|
+
* missing label renders the fallback — never throws, never blanks the row.
|
|
7
|
+
*/
|
|
8
|
+
export declare function iconFor(label: string | undefined): TemplateResult;
|
|
9
|
+
/**
|
|
10
|
+
* Whether `label` resolves to a real entry rather than the `DefaultNavIcon`
|
|
11
|
+
* fallback. Exists so callers (and tests) can ask the exhaustiveness question
|
|
12
|
+
* without importing `ICON_MAP` itself — some real icon assets happen to be
|
|
13
|
+
* pixel-identical to `DefaultNavIcon` (see `mega-menu-icon-map.ts`'s AB#25851
|
|
14
|
+
* comment for the sibling case), so checking rendered output can never tell a
|
|
15
|
+
* correct resolution apart from a silent fallback. Checking the key can.
|
|
16
|
+
*/
|
|
17
|
+
export declare function hasIconFor(label: string | undefined): boolean;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { TemplateResult } from 'lit';
|
|
2
|
+
import { MenuCategory } from '@campminder/menu-tree';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Same defect and fix as `icon-map.ts`'s `iconFor`, corrected 2026-09-11 (see
|
|
6
|
+
* AB#25851): this had been reading a `category.icon` field that no transport
|
|
7
|
+
* has ever set, misdiagnosed as a tree-data gap rather than the dropped
|
|
8
|
+
* name-keying step it actually was. The Home exception is the one deliberate,
|
|
9
|
+
* named departure from label-keying, and it is inert today too: `home` has no
|
|
10
|
+
* `subCategories`, so it never opens a mega menu in the first place.
|
|
11
|
+
*/
|
|
12
|
+
export declare function megaMenuIconFor(category: MenuCategory | undefined): TemplateResult;
|
|
13
|
+
/**
|
|
14
|
+
* Whether `category` resolves to a real entry rather than the `DefaultMMIcon`
|
|
15
|
+
* fallback. Same reason as `icon-map.ts`'s `hasIconFor`: `AdminGrayIcon` and
|
|
16
|
+
* `DefaultMMIcon` are pixel-identical assets (AB#25851), so a rendered-output
|
|
17
|
+
* check can never distinguish a correct resolution from a silent fallback for
|
|
18
|
+
* that category. Home is always true — it resolves via `id`, not the map.
|
|
19
|
+
*/
|
|
20
|
+
export declare function hasMegaMenuIconFor(category: MenuCategory | undefined): boolean;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared layout constants for `<cm-mega-menu>`'s column packing. Both
|
|
3
|
+
* `MegaMenu.styles.ts` (the `.menu-item` box) and `MegaMenu.ts` (the packing
|
|
4
|
+
* math in `setMenuItemsContainerWidth`) read these — a single source keeps
|
|
5
|
+
* the two from silently disagreeing, which is the exact drift class that
|
|
6
|
+
* bit the collapsed-width literal earlier in this floor.
|
|
7
|
+
*/
|
|
8
|
+
export declare const MENU_ITEM_WIDTH_PX = 248;
|
|
9
|
+
export declare const MENU_ITEM_GUTTER_PX = 16;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './side-nav/index'
|