astrogators-shared-ui 0.16.1 → 0.16.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.
@@ -1,11 +1,11 @@
1
1
  import { default as React } from 'react';
2
- import { SuiteAppId, SuiteNavSection } from '../../navigation/suiteNav';
2
+ import { SuiteAppId, SuiteNavLink } from '../../navigation/suiteNav';
3
3
  export interface MobileNavPanelProps {
4
4
  isOpen: boolean;
5
5
  onClose: () => void;
6
6
  currentApp: SuiteAppId;
7
7
  activeSectionId?: string;
8
- onSectionClick?: (section: SuiteNavSection, event: React.MouseEvent<HTMLAnchorElement>) => void;
8
+ onSectionClick?: (section: SuiteNavLink, event: React.MouseEvent<HTMLAnchorElement>) => void;
9
9
  rightExtras?: React.ReactNode;
10
10
  showAuth?: boolean;
11
11
  panelId: string;
@@ -1,5 +1,5 @@
1
1
  import { default as React } from 'react';
2
- import { SuiteAppId, SuiteNavSection } from '../../navigation/suiteNav';
2
+ import { SuiteAppId, SuiteNavLink } from '../../navigation/suiteNav';
3
3
  export interface NavBarProps {
4
4
  /** Which app is rendering the bar — drives which trigger is highlighted
5
5
  * and which app's sections `onNavigate` fires for. */
@@ -12,7 +12,7 @@ export interface NavBarProps {
12
12
  * always real `<a href>` full page loads, never intercepted. Call
13
13
  * `event.preventDefault()` to soft-navigate instead; the menu closes
14
14
  * either way, since no page load will unmount it for you. */
15
- onNavigate?: (section: SuiteNavSection, event: React.MouseEvent<HTMLAnchorElement>) => void;
15
+ onNavigate?: (section: SuiteNavLink, event: React.MouseEvent<HTMLAnchorElement>) => void;
16
16
  /** The one per-app element allowed in the bar: RosterRefresh. Always in
17
17
  * the same slot, just left of the ally-code dropdown on desktop, and
18
18
  * moves into the mobile panel on small screens. Its position never
@@ -1,17 +1,19 @@
1
1
  import { default as React } from 'react';
2
- import { SuiteNavApp, SuiteNavSection } from '../../navigation/suiteNav';
2
+ import { SuiteNavApp, SuiteNavLink } from '../../navigation/suiteNav';
3
3
  export interface NavMenuProps {
4
4
  app: SuiteNavApp;
5
5
  isCurrentApp: boolean;
6
6
  activeSectionId?: string;
7
7
  isOpen: boolean;
8
8
  onOpenChange: (isOpen: boolean) => void;
9
- onSectionClick?: (section: SuiteNavSection, event: React.MouseEvent<HTMLAnchorElement>) => void;
9
+ onSectionClick?: (section: SuiteNavLink, event: React.MouseEvent<HTMLAnchorElement>) => void;
10
10
  }
11
11
  /**
12
12
  * One trigger + dropdown panel per SUITE_NAV app. Disclosure pattern, not
13
13
  * `role="menu"` — these are page links, so Tab moves through them like any
14
14
  * other link list; arrow keys are an additive convenience, not a
15
- * replacement for Tab.
15
+ * replacement for Tab. A group entry (e.g. "Evaluations") renders its own
16
+ * link plus its `items` nested and indented underneath — still all flat
17
+ * `<a>`s in Tab order, just visually grouped.
16
18
  */
17
19
  export declare const NavMenu: React.FC<NavMenuProps>;
@@ -1,7 +1,7 @@
1
1
  export { Container, TopBar, NavBar, Footer } from './components/layout';
2
2
  export type { ContainerProps, TopBarProps, NavBarProps, FooterProps } from './components/layout';
3
- export { SUITE_NAV } from './navigation/suiteNav';
4
- export type { SuiteAppId, SuiteNavApp, SuiteNavSection } from './navigation/suiteNav';
3
+ export { SUITE_NAV, isSuiteNavGroup } from './navigation/suiteNav';
4
+ export type { SuiteAppId, SuiteNavApp, SuiteNavEntry, SuiteNavSection, SuiteNavGroup, SuiteNavLink } from './navigation/suiteNav';
5
5
  export { Button, Input, Select, AllyCodeDropdown, RosterRefresh } from './components/forms';
6
6
  export type { ButtonProps, InputProps, SelectProps, SelectOption, AllyCodeDropdownProps, RosterRefreshProps } from './components/forms';
7
7
  export { Card, Badge, Modal } from './components/display';
@@ -8,7 +8,8 @@
8
8
  * `../../CLAUDE.md`'s NavBar note for the full rationale.
9
9
  */
10
10
  export type SuiteAppId = 'hub' | 'mod-ledger' | 'navicharts' | 'nightwatcher';
11
- export interface SuiteNavSection {
11
+ /** Fields shared by a flat section and a group's own entry. */
12
+ export interface SuiteNavLink {
12
13
  id: string;
13
14
  label: string;
14
15
  /** Absolute, same-origin path, e.g. '/mod-ledger/evaluations'. */
@@ -18,11 +19,22 @@ export interface SuiteNavSection {
18
19
  /** Hidden unless the current user's role is in this list. */
19
20
  roles?: string[];
20
21
  }
22
+ export interface SuiteNavSection extends SuiteNavLink {
23
+ }
24
+ /** A labelled group of related sections shown nested under one heading in
25
+ * the dropdown/accordion, e.g. "Evaluations" with My Evaluations/Official/
26
+ * Moderation as its `items`. The group's own `href` is its primary
27
+ * destination (clicking the heading itself, not just an item). */
28
+ export interface SuiteNavGroup extends SuiteNavLink {
29
+ items: SuiteNavSection[];
30
+ }
31
+ export type SuiteNavEntry = SuiteNavSection | SuiteNavGroup;
32
+ export declare function isSuiteNavGroup(entry: SuiteNavEntry): entry is SuiteNavGroup;
21
33
  export interface SuiteNavApp {
22
34
  id: Exclude<SuiteAppId, 'hub'>;
23
35
  label: string;
24
36
  href: string;
25
37
  status: 'available' | 'coming-soon';
26
- sections: SuiteNavSection[];
38
+ sections: SuiteNavEntry[];
27
39
  }
28
40
  export declare const SUITE_NAV: SuiteNavApp[];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "astrogators-shared-ui",
3
- "version": "0.16.1",
3
+ "version": "0.16.3",
4
4
  "description": "Shared UI components and utilities for Astrogator's Table applications",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",