@epam/ai-dial-navigation-panel 1.0.0-rc.5
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/components/NavigationPanel/NavigationPanel.d.ts +8 -0
- package/components/NavigationPanel/NavigationPanel.d.ts.map +1 -0
- package/components/NavigationSheet/NavigableBottomSheet.d.ts +27 -0
- package/components/NavigationSheet/NavigableBottomSheet.d.ts.map +1 -0
- package/components/NavigationSheet/NavigationMenuPage.d.ts +28 -0
- package/components/NavigationSheet/NavigationMenuPage.d.ts.map +1 -0
- package/components/NavigationSheet/NavigationSheet.d.ts +8 -0
- package/components/NavigationSheet/NavigationSheet.d.ts.map +1 -0
- package/components/NavigationSheet/OptionListPage.d.ts +12 -0
- package/components/NavigationSheet/OptionListPage.d.ts.map +1 -0
- package/components/NavigationSheet/ProfilePage.d.ts +22 -0
- package/components/NavigationSheet/ProfilePage.d.ts.map +1 -0
- package/components/NavigationSheet/SheetRow.d.ts +17 -0
- package/components/NavigationSheet/SheetRow.d.ts.map +1 -0
- package/components/UserMenu/UserMenu.d.ts +8 -0
- package/components/UserMenu/UserMenu.d.ts.map +1 -0
- package/components/common/AvatarInitials.d.ts +13 -0
- package/components/common/AvatarInitials.d.ts.map +1 -0
- package/components/common/MenuItemLabel.d.ts +15 -0
- package/components/common/MenuItemLabel.d.ts.map +1 -0
- package/components/common/UserAvatar.d.ts +12 -0
- package/components/common/UserAvatar.d.ts.map +1 -0
- package/context/SheetNavigationContext.d.ts +4 -0
- package/context/SheetNavigationContext.d.ts.map +1 -0
- package/hooks/useSheetNavigation.d.ts +4 -0
- package/hooks/useSheetNavigation.d.ts.map +1 -0
- package/index.css +2 -0
- package/index.d.ts +28 -0
- package/index.d.ts.map +1 -0
- package/index.js +383 -0
- package/models/navigation-item.d.ts +28 -0
- package/models/navigation-item.d.ts.map +1 -0
- package/models/navigation-menu.d.ts +29 -0
- package/models/navigation-menu.d.ts.map +1 -0
- package/models/navigation-panel-props.d.ts +63 -0
- package/models/navigation-panel-props.d.ts.map +1 -0
- package/models/navigation-sheet-props.d.ts +78 -0
- package/models/navigation-sheet-props.d.ts.map +1 -0
- package/models/sheet-navigation.d.ts +18 -0
- package/models/sheet-navigation.d.ts.map +1 -0
- package/models/user-menu-props.d.ts +59 -0
- package/models/user-menu-props.d.ts.map +1 -0
- package/models/user-profile.d.ts +16 -0
- package/models/user-profile.d.ts.map +1 -0
- package/package.json +31 -0
- package/test-setup.d.ts +1 -0
- package/test-setup.d.ts.map +1 -0
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { FC } from 'react';
|
|
2
|
+
import { NavigationPanelProps } from '../../models/navigation-panel-props';
|
|
3
|
+
/**
|
|
4
|
+
* Vertical primary-navigation rail: brand mark, one icon button per
|
|
5
|
+
* destination, and a pinned footer slot for the user menu.
|
|
6
|
+
*/
|
|
7
|
+
export declare const NavigationPanel: FC<NavigationPanelProps>;
|
|
8
|
+
//# sourceMappingURL=NavigationPanel.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"NavigationPanel.d.ts","sourceRoot":"","sources":["../../../src/components/NavigationPanel/NavigationPanel.tsx"],"names":[],"mappings":"AAEA,OAAO,EAA2B,KAAK,EAAE,EAAkB,MAAM,OAAO,CAAC;AAKzE,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,qCAAqC,CAAC;AAYhF;;;GAGG;AACH,eAAO,MAAM,eAAe,EAAE,EAAE,CAAC,oBAAoB,CA0EpD,CAAC"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { CSSProperties, FC, ReactNode } from 'react';
|
|
2
|
+
/** Props for `NavigableBottomSheet`. */
|
|
3
|
+
export interface NavigableBottomSheetProps {
|
|
4
|
+
/** Controls sheet visibility; closing resets the page stack. */
|
|
5
|
+
isOpen: boolean;
|
|
6
|
+
/** Called when the sheet should close (backdrop tap, close button, or Escape). */
|
|
7
|
+
onClose: () => void;
|
|
8
|
+
/** Root-page body, shown whenever the stack is empty. */
|
|
9
|
+
children: ReactNode;
|
|
10
|
+
/** Root-page header title. Required for accessibility. */
|
|
11
|
+
title: string;
|
|
12
|
+
/** Accessible name for the close (×) button. */
|
|
13
|
+
closeLabel: string;
|
|
14
|
+
/** Accessible name for the back button shown on pushed pages. */
|
|
15
|
+
backLabel: string;
|
|
16
|
+
/** Extra class name(s) merged onto the sheet container. */
|
|
17
|
+
className?: string;
|
|
18
|
+
/** CSS custom properties forwarded to the sheet root for theming. */
|
|
19
|
+
style?: CSSProperties;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Bottom sheet with an in-sheet page stack: content pushes and pops pages
|
|
23
|
+
* through `useSheetNavigation`, and the header swaps its title and back button
|
|
24
|
+
* to match the top page.
|
|
25
|
+
*/
|
|
26
|
+
export declare const NavigableBottomSheet: FC<NavigableBottomSheetProps>;
|
|
27
|
+
//# sourceMappingURL=NavigableBottomSheet.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"NavigableBottomSheet.d.ts","sourceRoot":"","sources":["../../../src/components/NavigationSheet/NavigableBottomSheet.tsx"],"names":[],"mappings":"AACA,OAAO,EAML,KAAK,aAAa,EAClB,KAAK,EAAE,EACP,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AAIf,wCAAwC;AACxC,MAAM,WAAW,yBAAyB;IACxC,gEAAgE;IAChE,MAAM,EAAE,OAAO,CAAC;IAChB,kFAAkF;IAClF,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,yDAAyD;IACzD,QAAQ,EAAE,SAAS,CAAC;IACpB,0DAA0D;IAC1D,KAAK,EAAE,MAAM,CAAC;IACd,gDAAgD;IAChD,UAAU,EAAE,MAAM,CAAC;IACnB,iEAAiE;IACjE,SAAS,EAAE,MAAM,CAAC;IAClB,2DAA2D;IAC3D,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,qEAAqE;IACrE,KAAK,CAAC,EAAE,aAAa,CAAC;CACvB;AAED;;;;GAIG;AACH,eAAO,MAAM,oBAAoB,EAAE,EAAE,CAAC,yBAAyB,CAsD9D,CAAC"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { FC, ReactNode } from 'react';
|
|
2
|
+
import { NavigationPanelItem } from '../../models/navigation-item';
|
|
3
|
+
import { NavigationMenuGroup } from '../../models/navigation-menu';
|
|
4
|
+
import { NavigationUserProfile } from '../../models/user-profile';
|
|
5
|
+
/** Props for `NavigationMenuPage`. */
|
|
6
|
+
export interface NavigationMenuPageProps {
|
|
7
|
+
/** Destinations rendered as rows, in display order. */
|
|
8
|
+
items: NavigationPanelItem[];
|
|
9
|
+
/** Called with the picked destination after the sheet closes. */
|
|
10
|
+
onSelectItem: (item: NavigationPanelItem) => void;
|
|
11
|
+
/** Label of the row opening the profile page, also that page's title. */
|
|
12
|
+
profileLabel: string;
|
|
13
|
+
/** Label of the log-out row on the profile page. */
|
|
14
|
+
logOutLabel: string;
|
|
15
|
+
/** Called when the user taps "Log out" on the profile page. */
|
|
16
|
+
onLogout: () => void;
|
|
17
|
+
/** Signed-in user details; omit to hide the profile row entirely. */
|
|
18
|
+
profile?: NavigationUserProfile;
|
|
19
|
+
/** Settings groups listed on the profile page; empty groups are skipped. */
|
|
20
|
+
groups?: NavigationMenuGroup[];
|
|
21
|
+
/** Rendered below the row list — typically a footer message. */
|
|
22
|
+
footer?: ReactNode;
|
|
23
|
+
/** CSS class controlling the row labels' type scale. Defaults to `'dial-small-text'`. */
|
|
24
|
+
textClassName?: string;
|
|
25
|
+
}
|
|
26
|
+
/** Root page of the navigation bottom sheet: destinations plus a profile entry. */
|
|
27
|
+
export declare const NavigationMenuPage: FC<NavigationMenuPageProps>;
|
|
28
|
+
//# sourceMappingURL=NavigationMenuPage.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"NavigationMenuPage.d.ts","sourceRoot":"","sources":["../../../src/components/NavigationSheet/NavigationMenuPage.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAQ,KAAK,EAAE,EAAE,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAEtD,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,8BAA8B,CAAC;AACxE,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,8BAA8B,CAAC;AACxE,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,2BAA2B,CAAC;AAIvE,sCAAsC;AACtC,MAAM,WAAW,uBAAuB;IACtC,uDAAuD;IACvD,KAAK,EAAE,mBAAmB,EAAE,CAAC;IAC7B,iEAAiE;IACjE,YAAY,EAAE,CAAC,IAAI,EAAE,mBAAmB,KAAK,IAAI,CAAC;IAClD,yEAAyE;IACzE,YAAY,EAAE,MAAM,CAAC;IACrB,oDAAoD;IACpD,WAAW,EAAE,MAAM,CAAC;IACpB,+DAA+D;IAC/D,QAAQ,EAAE,MAAM,IAAI,CAAC;IACrB,qEAAqE;IACrE,OAAO,CAAC,EAAE,qBAAqB,CAAC;IAChC,4EAA4E;IAC5E,MAAM,CAAC,EAAE,mBAAmB,EAAE,CAAC;IAC/B,gEAAgE;IAChE,MAAM,CAAC,EAAE,SAAS,CAAC;IACnB,yFAAyF;IACzF,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED,mFAAmF;AACnF,eAAO,MAAM,kBAAkB,EAAE,EAAE,CAAC,uBAAuB,CA4D1D,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { FC } from 'react';
|
|
2
|
+
import { NavigationSheetProps } from '../../models/navigation-sheet-props';
|
|
3
|
+
/**
|
|
4
|
+
* Mobile primary navigation: a bottom sheet whose root page lists the
|
|
5
|
+
* destinations and a profile entry, with settings drilled into nested pages.
|
|
6
|
+
*/
|
|
7
|
+
export declare const NavigationSheet: FC<NavigationSheetProps>;
|
|
8
|
+
//# sourceMappingURL=NavigationSheet.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"NavigationSheet.d.ts","sourceRoot":"","sources":["../../../src/components/NavigationSheet/NavigationSheet.tsx"],"names":[],"mappings":"AACA,OAAO,EAAiB,KAAK,EAAE,EAAE,MAAM,OAAO,CAAC;AAC/C,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,qCAAqC,CAAC;AAKhF;;;GAGG;AACH,eAAO,MAAM,eAAe,EAAE,EAAE,CAAC,oBAAoB,CAuDpD,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { FC } from 'react';
|
|
2
|
+
import { NavigationMenuOption } from '../../models/navigation-menu';
|
|
3
|
+
/** Props for `OptionListPage`. */
|
|
4
|
+
export interface OptionListPageProps {
|
|
5
|
+
/** Single-select options; picking one applies it and pops back one page. */
|
|
6
|
+
options: NavigationMenuOption[];
|
|
7
|
+
/** CSS class controlling the row labels' type scale. */
|
|
8
|
+
textClassName?: string;
|
|
9
|
+
}
|
|
10
|
+
/** Sheet page listing the values of one settings group, with the applied one checked. */
|
|
11
|
+
export declare const OptionListPage: FC<OptionListPageProps>;
|
|
12
|
+
//# sourceMappingURL=OptionListPage.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"OptionListPage.d.ts","sourceRoot":"","sources":["../../../src/components/NavigationSheet/OptionListPage.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAQ,KAAK,EAAE,EAAE,MAAM,OAAO,CAAC;AAEtC,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,8BAA8B,CAAC;AAIzE,kCAAkC;AAClC,MAAM,WAAW,mBAAmB;IAClC,4EAA4E;IAC5E,OAAO,EAAE,oBAAoB,EAAE,CAAC;IAChC,wDAAwD;IACxD,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED,yFAAyF;AACzF,eAAO,MAAM,cAAc,EAAE,EAAE,CAAC,mBAAmB,CA+BlD,CAAC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { FC } from 'react';
|
|
2
|
+
import { NavigationMenuGroup } from '../../models/navigation-menu';
|
|
3
|
+
import { NavigationUserProfile } from '../../models/user-profile';
|
|
4
|
+
/** Props for `ProfilePage`. */
|
|
5
|
+
export interface ProfilePageProps {
|
|
6
|
+
/** Signed-in user details shown in the identity row. */
|
|
7
|
+
profile: NavigationUserProfile;
|
|
8
|
+
/** Label of the log-out row. */
|
|
9
|
+
logOutLabel: string;
|
|
10
|
+
/** Called when the user taps "Log out"; the sheet closes first. */
|
|
11
|
+
onLogout: () => void;
|
|
12
|
+
/** Settings groups listed above the log-out row; empty groups are skipped. */
|
|
13
|
+
groups?: NavigationMenuGroup[];
|
|
14
|
+
/** CSS class controlling the row labels' type scale. Defaults to `'dial-small-text'`. */
|
|
15
|
+
textClassName?: string;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Sheet page showing the signed-in user, their settings groups (each pushing an
|
|
19
|
+
* `OptionListPage`), and a log-out row.
|
|
20
|
+
*/
|
|
21
|
+
export declare const ProfilePage: FC<ProfilePageProps>;
|
|
22
|
+
//# sourceMappingURL=ProfilePage.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ProfilePage.d.ts","sourceRoot":"","sources":["../../../src/components/NavigationSheet/ProfilePage.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAQ,KAAK,EAAE,EAAE,MAAM,OAAO,CAAC;AAEtC,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,8BAA8B,CAAC;AACxE,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,2BAA2B,CAAC;AAMvE,+BAA+B;AAC/B,MAAM,WAAW,gBAAgB;IAC/B,wDAAwD;IACxD,OAAO,EAAE,qBAAqB,CAAC;IAC/B,gCAAgC;IAChC,WAAW,EAAE,MAAM,CAAC;IACpB,mEAAmE;IACnE,QAAQ,EAAE,MAAM,IAAI,CAAC;IACrB,8EAA8E;IAC9E,MAAM,CAAC,EAAE,mBAAmB,EAAE,CAAC;IAC/B,yFAAyF;IACzF,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED;;;GAGG;AACH,eAAO,MAAM,WAAW,EAAE,EAAE,CAAC,gBAAgB,CAmF5C,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { FC, ReactNode } from 'react';
|
|
2
|
+
/** Props for `SheetRow`. */
|
|
3
|
+
export interface SheetRowProps {
|
|
4
|
+
/** Translated row label. */
|
|
5
|
+
label: string;
|
|
6
|
+
/** Activates the row. */
|
|
7
|
+
onClick: () => void;
|
|
8
|
+
/** Leading icon, rendered in the muted icon color. */
|
|
9
|
+
icon?: ReactNode;
|
|
10
|
+
/** Trailing content such as a chevron or a check mark. */
|
|
11
|
+
trailing?: ReactNode;
|
|
12
|
+
/** CSS class controlling the label's type scale. Defaults to `'dial-small-text'`. */
|
|
13
|
+
textClassName?: string;
|
|
14
|
+
}
|
|
15
|
+
/** Full-width tappable row used by every page of the navigation bottom sheet. */
|
|
16
|
+
export declare const SheetRow: FC<SheetRowProps>;
|
|
17
|
+
//# sourceMappingURL=SheetRow.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SheetRow.d.ts","sourceRoot":"","sources":["../../../src/components/NavigationSheet/SheetRow.tsx"],"names":[],"mappings":"AACA,OAAO,EAAQ,KAAK,EAAE,EAAE,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAGtD,4BAA4B;AAC5B,MAAM,WAAW,aAAa;IAC5B,4BAA4B;IAC5B,KAAK,EAAE,MAAM,CAAC;IACd,yBAAyB;IACzB,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,sDAAsD;IACtD,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB,0DAA0D;IAC1D,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB,qFAAqF;IACrF,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED,iFAAiF;AACjF,eAAO,MAAM,QAAQ,EAAE,EAAE,CAAC,aAAa,CAiBtC,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { FC } from 'react';
|
|
2
|
+
import { UserMenuProps } from '../../models/user-menu-props';
|
|
3
|
+
/**
|
|
4
|
+
* Avatar trigger pinned to the bottom of the nav rail, opening a dropdown with
|
|
5
|
+
* the user's identity, single-select settings submenus, and a log-out entry.
|
|
6
|
+
*/
|
|
7
|
+
export declare const UserMenu: FC<UserMenuProps>;
|
|
8
|
+
//# sourceMappingURL=UserMenu.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"UserMenu.d.ts","sourceRoot":"","sources":["../../../src/components/UserMenu/UserMenu.tsx"],"names":[],"mappings":"AAUA,OAAO,EAAiB,KAAK,EAAE,EAAE,MAAM,OAAO,CAAC;AAC/C,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAC;AAMlE;;;GAGG;AACH,eAAO,MAAM,QAAQ,EAAE,EAAE,CAAC,aAAa,CA4GtC,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { FC } from 'react';
|
|
2
|
+
/** Props for `AvatarInitials`. */
|
|
3
|
+
export interface AvatarInitialsProps {
|
|
4
|
+
/** One-or-two-letter initials; renders an empty badge when omitted. */
|
|
5
|
+
shortName?: string;
|
|
6
|
+
/** Extra class name(s) merged onto the badge. */
|
|
7
|
+
className?: string;
|
|
8
|
+
/** CSS class controlling the initials' type scale. Defaults to `'dial-tiny-text'`. */
|
|
9
|
+
textClassName?: string;
|
|
10
|
+
}
|
|
11
|
+
/** Circular 28 px badge showing a signed-in user's initials. */
|
|
12
|
+
export declare const AvatarInitials: FC<AvatarInitialsProps>;
|
|
13
|
+
//# sourceMappingURL=AvatarInitials.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AvatarInitials.d.ts","sourceRoot":"","sources":["../../../src/components/common/AvatarInitials.tsx"],"names":[],"mappings":"AACA,OAAO,EAAQ,KAAK,EAAE,EAAE,MAAM,OAAO,CAAC;AAGtC,kCAAkC;AAClC,MAAM,WAAW,mBAAmB;IAClC,uEAAuE;IACvE,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,iDAAiD;IACjD,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,sFAAsF;IACtF,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED,gEAAgE;AAChE,eAAO,MAAM,cAAc,EAAE,EAAE,CAAC,mBAAmB,CAalD,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { FC, ReactNode } from 'react';
|
|
2
|
+
/** Props for `MenuItemLabel`. */
|
|
3
|
+
export interface MenuItemLabelProps {
|
|
4
|
+
/** Translated option label. */
|
|
5
|
+
label: string;
|
|
6
|
+
/** Whether the option is the applied value; renders a trailing check mark. */
|
|
7
|
+
isActive: boolean;
|
|
8
|
+
/** Optional leading icon. */
|
|
9
|
+
icon?: ReactNode;
|
|
10
|
+
/** CSS class controlling the label's type scale. Defaults to `'dial-small-text'`. */
|
|
11
|
+
textClassName?: string;
|
|
12
|
+
}
|
|
13
|
+
/** Dropdown row label with an optional leading icon and an active check mark. */
|
|
14
|
+
export declare const MenuItemLabel: FC<MenuItemLabelProps>;
|
|
15
|
+
//# sourceMappingURL=MenuItemLabel.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MenuItemLabel.d.ts","sourceRoot":"","sources":["../../../src/components/common/MenuItemLabel.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAQ,KAAK,EAAE,EAAE,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAGtD,iCAAiC;AACjC,MAAM,WAAW,kBAAkB;IACjC,+BAA+B;IAC/B,KAAK,EAAE,MAAM,CAAC;IACd,8EAA8E;IAC9E,QAAQ,EAAE,OAAO,CAAC;IAClB,6BAA6B;IAC7B,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB,qFAAqF;IACrF,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED,iFAAiF;AACjF,eAAO,MAAM,aAAa,EAAE,EAAE,CAAC,kBAAkB,CA4BhD,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { FC } from 'react';
|
|
2
|
+
import { NavigationUserProfile } from '../../models/user-profile';
|
|
3
|
+
/** Props for `UserAvatar`. */
|
|
4
|
+
export interface UserAvatarProps {
|
|
5
|
+
/** Signed-in user details supplying the image URL and initials. */
|
|
6
|
+
profile: NavigationUserProfile;
|
|
7
|
+
/** Alternative text for the image. Pass `''` when a sibling already names the row. */
|
|
8
|
+
alt: string;
|
|
9
|
+
}
|
|
10
|
+
/** Avatar image with an initials badge fallback for a missing or broken image. */
|
|
11
|
+
export declare const UserAvatar: FC<UserAvatarProps>;
|
|
12
|
+
//# sourceMappingURL=UserAvatar.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"UserAvatar.d.ts","sourceRoot":"","sources":["../../../src/components/common/UserAvatar.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAQ,KAAK,EAAE,EAAE,MAAM,OAAO,CAAC;AACtC,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,2BAA2B,CAAC;AAGvE,8BAA8B;AAC9B,MAAM,WAAW,eAAe;IAC9B,mEAAmE;IACnE,OAAO,EAAE,qBAAqB,CAAC;IAC/B,sFAAsF;IACtF,GAAG,EAAE,MAAM,CAAC;CACb;AAED,kFAAkF;AAClF,eAAO,MAAM,UAAU,EAAE,EAAE,CAAC,eAAe,CAc1C,CAAC"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { SheetNavigation } from '../models/sheet-navigation';
|
|
2
|
+
/** Provided by `NavigableBottomSheet`; consumed through `useSheetNavigation`. */
|
|
3
|
+
export declare const SheetNavigationContext: import('react').Context<SheetNavigation | undefined>;
|
|
4
|
+
//# sourceMappingURL=SheetNavigationContext.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SheetNavigationContext.d.ts","sourceRoot":"","sources":["../../src/context/SheetNavigationContext.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAElE,iFAAiF;AACjF,eAAO,MAAM,sBAAsB,sDAEvB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useSheetNavigation.d.ts","sourceRoot":"","sources":["../../src/hooks/useSheetNavigation.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAElE,2EAA2E;AAC3E,eAAO,MAAM,kBAAkB,QAAO,eAQrC,CAAC"}
|
package/index.css
ADDED
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
._rail_ns7b4_2{background:var(--np-bg,var(--bg-layer-raised,#fcfcfc));font-family:var(--np-font-family,inherit)}._item_ns7b4_7{color:var(--np-item-text,var(--text-secondary,#57647a))}._item_ns7b4_7:hover{background:var(--np-item-hover-bg,var(--bg-control-accent-alpha-hover,#2764d924))}._item_ns7b4_7:active{background:var(--np-item-active-bg,var(--bg-control-accent-alpha-active,#2764d933))}a:focus-visible>._item_ns7b4_7{background:var(--np-item-hover-bg,var(--bg-control-accent-alpha-hover,#2764d924))}._itemActive_ns7b4_24{color:var(--np-item-active-text,var(--text-accent,#1d4ed8))}._avatar_179i5_1{background:var(--np-avatar-bg,#60d239);color:var(--np-avatar-text,#000)}._label_179i5_8{color:var(--np-menu-text,var(--text-primary,#161b2d))}._activeIcon_179i5_12{color:var(--np-menu-active-icon,var(--text-accent,#1d4ed8))}._wrapper_1nw3p_1{font-family:var(--np-font-family,inherit)}._trigger_1nw3p_5:hover{background:var(--np-trigger-hover-bg,var(--bg-control-accent-alpha-hover,#2764d924))}._trigger_1nw3p_5:focus-visible{background:var(--np-trigger-hover-bg,var(--bg-control-accent-alpha-hover,#2764d924));outline:1px solid var(--np-focus-outline,var(--stroke-focus-black,#161b2d));outline-offset:-1px}._identityText_1nw3p_14{color:var(--np-menu-text,var(--text-primary,#161b2d))}._sheet_18nve_1{font-family:var(--np-font-family,inherit)}._row_18nve_5{color:var(--np-sheet-text,var(--text-primary,#161b2d))}._row_18nve_5:hover,._row_18nve_5:focus-visible{background:var(--np-sheet-item-hover,var(--bg-accent-primary-alpha,#7da4ff2e))}._row_18nve_5:active{background:var(--np-sheet-item-active,var(--bg-layer-4,#d1dbea))}._rowIcon_18nve_15{color:var(--np-sheet-icon,var(--text-secondary,#57647a))}._divider_18nve_19{border-color:var(--np-sheet-divider,var(--stroke-secondary,#d1dbea))}._mutedText_18nve_23{color:var(--np-sheet-muted-text,var(--text-secondary,#57647a))}._activeIcon_18nve_27{color:var(--np-menu-active-icon,var(--text-accent,#1d4ed8))}
|
|
2
|
+
/*$vite$:1*/
|
package/index.d.ts
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
export { NavigationPanel } from './components/NavigationPanel/NavigationPanel';
|
|
2
|
+
export { UserMenu } from './components/UserMenu/UserMenu';
|
|
3
|
+
export { NavigationSheet } from './components/NavigationSheet/NavigationSheet';
|
|
4
|
+
export { NavigableBottomSheet } from './components/NavigationSheet/NavigableBottomSheet';
|
|
5
|
+
export { NavigationMenuPage } from './components/NavigationSheet/NavigationMenuPage';
|
|
6
|
+
export { ProfilePage } from './components/NavigationSheet/ProfilePage';
|
|
7
|
+
export { OptionListPage } from './components/NavigationSheet/OptionListPage';
|
|
8
|
+
export { SheetRow } from './components/NavigationSheet/SheetRow';
|
|
9
|
+
export { AvatarInitials } from './components/common/AvatarInitials';
|
|
10
|
+
export { MenuItemLabel } from './components/common/MenuItemLabel';
|
|
11
|
+
export { UserAvatar } from './components/common/UserAvatar';
|
|
12
|
+
export { useSheetNavigation } from './hooks/useSheetNavigation';
|
|
13
|
+
export type { NavigationItemIcon, NavigationLinkRenderer, NavigationPanelItem, } from './models/navigation-item';
|
|
14
|
+
export type { NavigationMenuGroup, NavigationMenuOption, } from './models/navigation-menu';
|
|
15
|
+
export type { NavigationPanelColors, NavigationPanelLabels, NavigationPanelLogo, NavigationPanelProps, NavigationPanelStyles, NavigationPanelTypography, } from './models/navigation-panel-props';
|
|
16
|
+
export type { NavigationSheetColors, NavigationSheetLabels, NavigationSheetProps, NavigationSheetStyles, NavigationSheetTypography, } from './models/navigation-sheet-props';
|
|
17
|
+
export type { SheetNavigation, SheetPage } from './models/sheet-navigation';
|
|
18
|
+
export type { UserMenuColors, UserMenuLabels, UserMenuProps, UserMenuStyles, UserMenuTypography, } from './models/user-menu-props';
|
|
19
|
+
export type { NavigationUserProfile } from './models/user-profile';
|
|
20
|
+
export type { AvatarInitialsProps } from './components/common/AvatarInitials';
|
|
21
|
+
export type { MenuItemLabelProps } from './components/common/MenuItemLabel';
|
|
22
|
+
export type { UserAvatarProps } from './components/common/UserAvatar';
|
|
23
|
+
export type { NavigableBottomSheetProps } from './components/NavigationSheet/NavigableBottomSheet';
|
|
24
|
+
export type { NavigationMenuPageProps } from './components/NavigationSheet/NavigationMenuPage';
|
|
25
|
+
export type { OptionListPageProps } from './components/NavigationSheet/OptionListPage';
|
|
26
|
+
export type { ProfilePageProps } from './components/NavigationSheet/ProfilePage';
|
|
27
|
+
export type { SheetRowProps } from './components/NavigationSheet/SheetRow';
|
|
28
|
+
//# sourceMappingURL=index.d.ts.map
|
package/index.d.ts.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,8CAA8C,CAAC;AAC/E,OAAO,EAAE,QAAQ,EAAE,MAAM,gCAAgC,CAAC;AAC1D,OAAO,EAAE,eAAe,EAAE,MAAM,8CAA8C,CAAC;AAC/E,OAAO,EAAE,oBAAoB,EAAE,MAAM,mDAAmD,CAAC;AACzF,OAAO,EAAE,kBAAkB,EAAE,MAAM,iDAAiD,CAAC;AACrF,OAAO,EAAE,WAAW,EAAE,MAAM,0CAA0C,CAAC;AACvE,OAAO,EAAE,cAAc,EAAE,MAAM,6CAA6C,CAAC;AAC7E,OAAO,EAAE,QAAQ,EAAE,MAAM,uCAAuC,CAAC;AACjE,OAAO,EAAE,cAAc,EAAE,MAAM,oCAAoC,CAAC;AACpE,OAAO,EAAE,aAAa,EAAE,MAAM,mCAAmC,CAAC;AAClE,OAAO,EAAE,UAAU,EAAE,MAAM,gCAAgC,CAAC;AAE5D,OAAO,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AAEhE,YAAY,EACV,kBAAkB,EAClB,sBAAsB,EACtB,mBAAmB,GACpB,MAAM,0BAA0B,CAAC;AAClC,YAAY,EACV,mBAAmB,EACnB,oBAAoB,GACrB,MAAM,0BAA0B,CAAC;AAClC,YAAY,EACV,qBAAqB,EACrB,qBAAqB,EACrB,mBAAmB,EACnB,oBAAoB,EACpB,qBAAqB,EACrB,yBAAyB,GAC1B,MAAM,iCAAiC,CAAC;AACzC,YAAY,EACV,qBAAqB,EACrB,qBAAqB,EACrB,oBAAoB,EACpB,qBAAqB,EACrB,yBAAyB,GAC1B,MAAM,iCAAiC,CAAC;AACzC,YAAY,EAAE,eAAe,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAC;AAC5E,YAAY,EACV,cAAc,EACd,cAAc,EACd,aAAa,EACb,cAAc,EACd,kBAAkB,GACnB,MAAM,0BAA0B,CAAC;AAClC,YAAY,EAAE,qBAAqB,EAAE,MAAM,uBAAuB,CAAC;AACnE,YAAY,EAAE,mBAAmB,EAAE,MAAM,oCAAoC,CAAC;AAC9E,YAAY,EAAE,kBAAkB,EAAE,MAAM,mCAAmC,CAAC;AAC5E,YAAY,EAAE,eAAe,EAAE,MAAM,gCAAgC,CAAC;AACtE,YAAY,EAAE,yBAAyB,EAAE,MAAM,mDAAmD,CAAC;AACnG,YAAY,EAAE,uBAAuB,EAAE,MAAM,iDAAiD,CAAC;AAC/F,YAAY,EAAE,mBAAmB,EAAE,MAAM,6CAA6C,CAAC;AACvF,YAAY,EAAE,gBAAgB,EAAE,MAAM,0CAA0C,CAAC;AACjF,YAAY,EAAE,aAAa,EAAE,MAAM,uCAAuC,CAAC"}
|
package/index.js
ADDED
|
@@ -0,0 +1,383 @@
|
|
|
1
|
+
import { buildCssVars as e, mergeClasses as t } from "@epam/ai-dial-chat-shared";
|
|
2
|
+
import { BASE_ICON_SIZE as n, DIAL_ICON_SIZE as r, DialEllipsisTooltip as i, DialTooltip as a, Dropdown as o, DropdownItemType as s, IconButton as c } from "@epam/ai-dial-ui-kit";
|
|
3
|
+
import { Fragment as l, createContext as u, memo as d, useCallback as f, useContext as p, useEffect as m, useMemo as h, useState as g } from "react";
|
|
4
|
+
import { Fragment as _, jsx as v, jsxs as y } from "react/jsx-runtime";
|
|
5
|
+
import { IconCheck as b, IconChevronRight as x, IconLogout as S, IconUser as C } from "@tabler/icons-react";
|
|
6
|
+
import { BottomSheetShell as w } from "@epam/ai-dial-conversation-input";
|
|
7
|
+
var T = {
|
|
8
|
+
rail: "_rail_ns7b4_2",
|
|
9
|
+
item: "_item_ns7b4_7",
|
|
10
|
+
itemActive: "_itemActive_ns7b4_24"
|
|
11
|
+
}, E = (e, t) => /* @__PURE__ */ v("a", {
|
|
12
|
+
href: e.href,
|
|
13
|
+
className: "contents",
|
|
14
|
+
children: t
|
|
15
|
+
}), D = d(({ items: n, labels: i, logo: a, footer: o, renderLink: s = E, styles: u }) => {
|
|
16
|
+
let { colors: d, typography: f, className: p, cssVars: m } = u ?? {}, g = h(() => e({
|
|
17
|
+
"--np-bg": d?.background,
|
|
18
|
+
"--np-item-text": d?.itemText,
|
|
19
|
+
"--np-item-active-text": d?.itemActiveText,
|
|
20
|
+
"--np-item-hover-bg": d?.itemHoverBackground,
|
|
21
|
+
"--np-item-active-bg": d?.itemActiveBackground,
|
|
22
|
+
"--np-font-family": f?.fontFamily
|
|
23
|
+
}), [d, f?.fontFamily]);
|
|
24
|
+
return /* @__PURE__ */ y("nav", {
|
|
25
|
+
"aria-label": i.ariaLabel,
|
|
26
|
+
style: {
|
|
27
|
+
...m,
|
|
28
|
+
...g
|
|
29
|
+
},
|
|
30
|
+
className: t(T.rail, "relative z-10 flex h-full w-[60px] flex-col justify-between shadow-sm", f?.fontClassName, p),
|
|
31
|
+
children: [/* @__PURE__ */ y("div", {
|
|
32
|
+
className: "flex flex-col items-center",
|
|
33
|
+
children: [a && /* @__PURE__ */ v("a", {
|
|
34
|
+
href: a.href ?? "/",
|
|
35
|
+
"aria-label": a.ariaLabel,
|
|
36
|
+
className: "flex h-16 w-full shrink-0 items-center justify-center",
|
|
37
|
+
children: /* @__PURE__ */ v("span", {
|
|
38
|
+
style: { backgroundImage: `url(${a.iconUrl})` },
|
|
39
|
+
className: "h-6 w-6 bg-contain bg-center bg-no-repeat"
|
|
40
|
+
})
|
|
41
|
+
}), /* @__PURE__ */ v("div", {
|
|
42
|
+
className: "flex flex-col items-center gap-2 p-2",
|
|
43
|
+
children: n.map((e) => /* @__PURE__ */ v(l, { children: s(e, /* @__PURE__ */ v(c, {
|
|
44
|
+
icon: /* @__PURE__ */ v(e.icon, {
|
|
45
|
+
size: r.LG,
|
|
46
|
+
stroke: 1.5
|
|
47
|
+
}),
|
|
48
|
+
"aria-label": e.label,
|
|
49
|
+
"aria-current": e.isActive ? "page" : void 0,
|
|
50
|
+
tooltipProps: { tooltip: e.label },
|
|
51
|
+
tabIndex: -1,
|
|
52
|
+
className: t(T.item, "rounded", e.isActive && T.itemActive)
|
|
53
|
+
})) }, e.id))
|
|
54
|
+
})]
|
|
55
|
+
}), o]
|
|
56
|
+
});
|
|
57
|
+
}), O = {
|
|
58
|
+
avatar: "_avatar_179i5_1",
|
|
59
|
+
label: "_label_179i5_8",
|
|
60
|
+
activeIcon: "_activeIcon_179i5_12"
|
|
61
|
+
}, k = d(({ shortName: e, className: n, textClassName: r = "dial-tiny-text" }) => /* @__PURE__ */ v("div", {
|
|
62
|
+
className: t(O.avatar, "flex size-[28px] flex-shrink-0 items-center justify-center rounded-full", r, n),
|
|
63
|
+
children: e
|
|
64
|
+
})), A = d(({ label: e, isActive: n, icon: i, textClassName: a = "dial-small-text" }) => {
|
|
65
|
+
let o = /* @__PURE__ */ v("span", {
|
|
66
|
+
className: t(O.label, "truncate", a),
|
|
67
|
+
children: e
|
|
68
|
+
});
|
|
69
|
+
return /* @__PURE__ */ y("span", {
|
|
70
|
+
className: "flex items-center justify-between gap-4",
|
|
71
|
+
children: [i ? /* @__PURE__ */ y("span", {
|
|
72
|
+
className: "flex items-center gap-2",
|
|
73
|
+
children: [i, o]
|
|
74
|
+
}) : o, n && /* @__PURE__ */ v(b, {
|
|
75
|
+
size: r.SM,
|
|
76
|
+
"aria-hidden": !0,
|
|
77
|
+
className: O.activeIcon
|
|
78
|
+
})]
|
|
79
|
+
});
|
|
80
|
+
}), j = d(({ profile: e, alt: t }) => e.isFallbackShown || !e.imageUrl ? /* @__PURE__ */ v(k, { shortName: e.shortName }) : /* @__PURE__ */ v("img", {
|
|
81
|
+
className: "rounded-full",
|
|
82
|
+
src: e.imageUrl,
|
|
83
|
+
width: 28,
|
|
84
|
+
height: 28,
|
|
85
|
+
alt: t,
|
|
86
|
+
onError: e.onImageError
|
|
87
|
+
})), M = {
|
|
88
|
+
wrapper: "_wrapper_1nw3p_1",
|
|
89
|
+
trigger: "_trigger_1nw3p_5",
|
|
90
|
+
identityText: "_identityText_1nw3p_14"
|
|
91
|
+
}, N = d(({ profile: n, labels: c, groups: l, onLogout: u, isTooltipHidden: d, styles: f }) => {
|
|
92
|
+
let { colors: p, typography: m, className: g, cssVars: _ } = f ?? {}, b = m?.fontClassName ?? "dial-small-text", x = h(() => e({
|
|
93
|
+
"--np-avatar-bg": p?.avatarBackground,
|
|
94
|
+
"--np-avatar-text": p?.avatarText,
|
|
95
|
+
"--np-menu-text": p?.text,
|
|
96
|
+
"--np-menu-active-icon": p?.activeIcon,
|
|
97
|
+
"--np-trigger-hover-bg": p?.triggerHoverBackground,
|
|
98
|
+
"--np-font-family": m?.fontFamily
|
|
99
|
+
}), [p, m?.fontFamily]), C = h(() => {
|
|
100
|
+
let e = (l ?? []).filter(({ options: e }) => e.length > 0).map(({ id: e, label: t, icon: n, options: r }) => ({
|
|
101
|
+
key: e,
|
|
102
|
+
label: /* @__PURE__ */ v("span", {
|
|
103
|
+
className: b,
|
|
104
|
+
children: t
|
|
105
|
+
}),
|
|
106
|
+
icon: n,
|
|
107
|
+
children: r.map((e) => ({
|
|
108
|
+
key: e.id,
|
|
109
|
+
label: /* @__PURE__ */ v(A, {
|
|
110
|
+
label: e.label,
|
|
111
|
+
isActive: e.isActive,
|
|
112
|
+
icon: e.icon,
|
|
113
|
+
textClassName: b
|
|
114
|
+
}),
|
|
115
|
+
onClick: e.onSelect
|
|
116
|
+
}))
|
|
117
|
+
}));
|
|
118
|
+
return [
|
|
119
|
+
{
|
|
120
|
+
key: "identity",
|
|
121
|
+
type: s.PlainText,
|
|
122
|
+
label: /* @__PURE__ */ y("div", {
|
|
123
|
+
className: "flex h-[40px] min-w-0 items-center gap-3",
|
|
124
|
+
children: [/* @__PURE__ */ v(k, { shortName: n.shortName }), /* @__PURE__ */ v(i, {
|
|
125
|
+
text: n.displayName,
|
|
126
|
+
className: t(M.identityText, b, "min-w-0 flex-1 truncate")
|
|
127
|
+
})]
|
|
128
|
+
})
|
|
129
|
+
},
|
|
130
|
+
...e,
|
|
131
|
+
{
|
|
132
|
+
key: "divider-1",
|
|
133
|
+
type: s.Divider
|
|
134
|
+
},
|
|
135
|
+
{
|
|
136
|
+
key: "logout",
|
|
137
|
+
label: /* @__PURE__ */ v("span", {
|
|
138
|
+
className: b,
|
|
139
|
+
children: c.logOut
|
|
140
|
+
}),
|
|
141
|
+
icon: /* @__PURE__ */ v(S, {
|
|
142
|
+
size: r.SM,
|
|
143
|
+
"aria-hidden": !0
|
|
144
|
+
}),
|
|
145
|
+
onClick: u
|
|
146
|
+
}
|
|
147
|
+
];
|
|
148
|
+
}, [
|
|
149
|
+
l,
|
|
150
|
+
b,
|
|
151
|
+
c.logOut,
|
|
152
|
+
u,
|
|
153
|
+
n.displayName,
|
|
154
|
+
n.shortName
|
|
155
|
+
]);
|
|
156
|
+
return /* @__PURE__ */ v("div", {
|
|
157
|
+
style: {
|
|
158
|
+
..._,
|
|
159
|
+
...x
|
|
160
|
+
},
|
|
161
|
+
className: t(M.wrapper, "flex size-[60px] items-center justify-center", g),
|
|
162
|
+
children: /* @__PURE__ */ v(o, {
|
|
163
|
+
placement: "top-end",
|
|
164
|
+
matchReferenceWidth: !1,
|
|
165
|
+
items: C,
|
|
166
|
+
children: /* @__PURE__ */ v("button", {
|
|
167
|
+
type: "button",
|
|
168
|
+
className: t(M.trigger, "flex size-[44px] items-center justify-center rounded-full border border-transparent"),
|
|
169
|
+
"aria-label": c.trigger,
|
|
170
|
+
children: /* @__PURE__ */ v(a, {
|
|
171
|
+
tooltip: n.email,
|
|
172
|
+
hideTooltip: d,
|
|
173
|
+
children: /* @__PURE__ */ v(j, {
|
|
174
|
+
profile: n,
|
|
175
|
+
alt: c.avatarAlt
|
|
176
|
+
})
|
|
177
|
+
})
|
|
178
|
+
})
|
|
179
|
+
})
|
|
180
|
+
});
|
|
181
|
+
}), P = u(void 0), F = d(({ isOpen: e, onClose: t, children: n, title: r, closeLabel: i, backLabel: a, className: o, style: s }) => {
|
|
182
|
+
let [c, l] = g([]);
|
|
183
|
+
m(() => {
|
|
184
|
+
e || l([]);
|
|
185
|
+
}, [e]);
|
|
186
|
+
let u = f((e) => {
|
|
187
|
+
l((t) => [...t, e]);
|
|
188
|
+
}, []), d = f(() => {
|
|
189
|
+
l((e) => e.slice(0, -1));
|
|
190
|
+
}, []), p = f(() => {
|
|
191
|
+
l([]), t();
|
|
192
|
+
}, [t]), _ = h(() => ({
|
|
193
|
+
push: u,
|
|
194
|
+
pop: d,
|
|
195
|
+
close: p
|
|
196
|
+
}), [
|
|
197
|
+
u,
|
|
198
|
+
d,
|
|
199
|
+
p
|
|
200
|
+
]), y = c[c.length - 1];
|
|
201
|
+
return /* @__PURE__ */ v(P.Provider, {
|
|
202
|
+
value: _,
|
|
203
|
+
children: /* @__PURE__ */ v(w, {
|
|
204
|
+
isOpen: e,
|
|
205
|
+
onClose: p,
|
|
206
|
+
title: y?.title ?? r,
|
|
207
|
+
closeLabel: i,
|
|
208
|
+
onBack: y ? d : void 0,
|
|
209
|
+
backLabel: y ? a : void 0,
|
|
210
|
+
className: o,
|
|
211
|
+
style: s,
|
|
212
|
+
children: y ? y.content : n
|
|
213
|
+
})
|
|
214
|
+
});
|
|
215
|
+
}), I = () => {
|
|
216
|
+
let e = p(P);
|
|
217
|
+
if (!e) throw Error("useSheetNavigation must be used within a NavigableBottomSheet");
|
|
218
|
+
return e;
|
|
219
|
+
}, L = {
|
|
220
|
+
sheet: "_sheet_18nve_1",
|
|
221
|
+
row: "_row_18nve_5",
|
|
222
|
+
rowIcon: "_rowIcon_18nve_15",
|
|
223
|
+
divider: "_divider_18nve_19",
|
|
224
|
+
mutedText: "_mutedText_18nve_23",
|
|
225
|
+
activeIcon: "_activeIcon_18nve_27"
|
|
226
|
+
}, R = d(({ label: e, onClick: n, icon: r, trailing: i, textClassName: a = "dial-small-text" }) => /* @__PURE__ */ v("li", { children: /* @__PURE__ */ y("button", {
|
|
227
|
+
type: "button",
|
|
228
|
+
className: t(L.row, "flex w-full items-center gap-3 px-4 py-[10px] text-start"),
|
|
229
|
+
onClick: n,
|
|
230
|
+
children: [
|
|
231
|
+
r && /* @__PURE__ */ v("span", {
|
|
232
|
+
className: L.rowIcon,
|
|
233
|
+
children: r
|
|
234
|
+
}),
|
|
235
|
+
/* @__PURE__ */ v("span", {
|
|
236
|
+
className: t(a, "flex-1"),
|
|
237
|
+
children: e
|
|
238
|
+
}),
|
|
239
|
+
i
|
|
240
|
+
]
|
|
241
|
+
}) })), z = d(({ options: e, textClassName: t }) => {
|
|
242
|
+
let { pop: n } = I();
|
|
243
|
+
return /* @__PURE__ */ v("ul", {
|
|
244
|
+
className: "flex flex-col pb-4",
|
|
245
|
+
children: e.map((e) => /* @__PURE__ */ v(R, {
|
|
246
|
+
label: e.label,
|
|
247
|
+
icon: e.icon,
|
|
248
|
+
textClassName: t,
|
|
249
|
+
trailing: e.isActive ? /* @__PURE__ */ v(b, {
|
|
250
|
+
size: r.SM,
|
|
251
|
+
stroke: 2,
|
|
252
|
+
"aria-hidden": !0,
|
|
253
|
+
className: L.activeIcon
|
|
254
|
+
}) : void 0,
|
|
255
|
+
onClick: () => {
|
|
256
|
+
e.onSelect(), n();
|
|
257
|
+
}
|
|
258
|
+
}, e.id))
|
|
259
|
+
});
|
|
260
|
+
}), B = d(({ profile: e, logOutLabel: r, onLogout: a, groups: o, textClassName: s = "dial-small-text" }) => {
|
|
261
|
+
let { push: c, close: l } = I(), u = (o ?? []).filter(({ options: e }) => e.length > 0);
|
|
262
|
+
return /* @__PURE__ */ y(_, { children: [
|
|
263
|
+
/* @__PURE__ */ y("div", {
|
|
264
|
+
className: "flex h-[56px] items-center gap-3 px-4 py-2",
|
|
265
|
+
children: [/* @__PURE__ */ v(j, {
|
|
266
|
+
profile: e,
|
|
267
|
+
alt: ""
|
|
268
|
+
}), /* @__PURE__ */ v(i, {
|
|
269
|
+
text: e.displayName,
|
|
270
|
+
className: t(L.mutedText, s, "min-w-0 flex-1 truncate")
|
|
271
|
+
})]
|
|
272
|
+
}),
|
|
273
|
+
u.length > 0 && /* @__PURE__ */ y(_, { children: [/* @__PURE__ */ v("ul", {
|
|
274
|
+
className: "flex flex-col",
|
|
275
|
+
children: u.map((e) => /* @__PURE__ */ v(R, {
|
|
276
|
+
label: e.label,
|
|
277
|
+
icon: e.icon,
|
|
278
|
+
textClassName: s,
|
|
279
|
+
trailing: /* @__PURE__ */ v(x, {
|
|
280
|
+
size: n,
|
|
281
|
+
stroke: 1.5,
|
|
282
|
+
"aria-hidden": !0,
|
|
283
|
+
className: t(L.rowIcon, "rtl:scale-x-[-1]")
|
|
284
|
+
}),
|
|
285
|
+
onClick: () => c({
|
|
286
|
+
title: e.label,
|
|
287
|
+
content: /* @__PURE__ */ v(z, {
|
|
288
|
+
options: e.options,
|
|
289
|
+
textClassName: s
|
|
290
|
+
})
|
|
291
|
+
})
|
|
292
|
+
}, e.id))
|
|
293
|
+
}), /* @__PURE__ */ v("hr", { className: L.divider })] }),
|
|
294
|
+
/* @__PURE__ */ v("ul", {
|
|
295
|
+
className: "flex flex-col pb-4",
|
|
296
|
+
children: /* @__PURE__ */ v(R, {
|
|
297
|
+
label: r,
|
|
298
|
+
textClassName: s,
|
|
299
|
+
icon: /* @__PURE__ */ v(S, {
|
|
300
|
+
size: n,
|
|
301
|
+
stroke: 1.5,
|
|
302
|
+
"aria-hidden": !0
|
|
303
|
+
}),
|
|
304
|
+
onClick: () => {
|
|
305
|
+
l(), a();
|
|
306
|
+
}
|
|
307
|
+
})
|
|
308
|
+
})
|
|
309
|
+
] });
|
|
310
|
+
}), V = d(({ items: e, onSelectItem: t, profileLabel: r, logOutLabel: i, onLogout: a, profile: o, groups: s, footer: c, textClassName: l }) => {
|
|
311
|
+
let { push: u, close: d } = I(), f = (e) => {
|
|
312
|
+
d(), t(e);
|
|
313
|
+
};
|
|
314
|
+
return /* @__PURE__ */ y(_, { children: [/* @__PURE__ */ y("ul", {
|
|
315
|
+
className: "flex flex-col pb-4",
|
|
316
|
+
children: [e.map((e) => /* @__PURE__ */ v(R, {
|
|
317
|
+
label: e.label,
|
|
318
|
+
textClassName: l,
|
|
319
|
+
icon: /* @__PURE__ */ v(e.icon, {
|
|
320
|
+
size: n,
|
|
321
|
+
stroke: 1.5
|
|
322
|
+
}),
|
|
323
|
+
onClick: () => f(e)
|
|
324
|
+
}, e.id)), o && /* @__PURE__ */ v(R, {
|
|
325
|
+
label: r,
|
|
326
|
+
textClassName: l,
|
|
327
|
+
icon: /* @__PURE__ */ v(C, {
|
|
328
|
+
size: n,
|
|
329
|
+
stroke: 1.5,
|
|
330
|
+
"aria-hidden": !0
|
|
331
|
+
}),
|
|
332
|
+
onClick: () => {
|
|
333
|
+
o && u({
|
|
334
|
+
title: r,
|
|
335
|
+
content: /* @__PURE__ */ v(B, {
|
|
336
|
+
profile: o,
|
|
337
|
+
groups: s,
|
|
338
|
+
logOutLabel: i,
|
|
339
|
+
onLogout: a,
|
|
340
|
+
textClassName: l
|
|
341
|
+
})
|
|
342
|
+
});
|
|
343
|
+
}
|
|
344
|
+
})]
|
|
345
|
+
}), c] });
|
|
346
|
+
}), H = d(({ isOpen: n, onClose: r, items: i, onSelectItem: a, labels: o, profile: s, groups: c, onLogout: l, footer: u, styles: d }) => {
|
|
347
|
+
let { colors: f, typography: p, className: m, cssVars: g } = d ?? {}, _ = h(() => e({
|
|
348
|
+
"--np-sheet-text": f?.text,
|
|
349
|
+
"--np-sheet-item-hover": f?.itemHoverBackground,
|
|
350
|
+
"--np-sheet-item-active": f?.itemActiveBackground,
|
|
351
|
+
"--np-sheet-icon": f?.icon,
|
|
352
|
+
"--np-sheet-divider": f?.divider,
|
|
353
|
+
"--np-avatar-bg": f?.avatarBackground,
|
|
354
|
+
"--np-avatar-text": f?.avatarText,
|
|
355
|
+
"--np-menu-active-icon": f?.activeIcon,
|
|
356
|
+
"--np-font-family": p?.fontFamily
|
|
357
|
+
}), [f, p?.fontFamily]);
|
|
358
|
+
return /* @__PURE__ */ v(F, {
|
|
359
|
+
isOpen: n,
|
|
360
|
+
onClose: r,
|
|
361
|
+
title: o.title,
|
|
362
|
+
closeLabel: o.close,
|
|
363
|
+
backLabel: o.back,
|
|
364
|
+
className: t(L.sheet, m),
|
|
365
|
+
style: {
|
|
366
|
+
...g,
|
|
367
|
+
..._
|
|
368
|
+
},
|
|
369
|
+
children: /* @__PURE__ */ v(V, {
|
|
370
|
+
items: i,
|
|
371
|
+
onSelectItem: a,
|
|
372
|
+
profileLabel: o.profile,
|
|
373
|
+
logOutLabel: o.logOut,
|
|
374
|
+
onLogout: l,
|
|
375
|
+
profile: s,
|
|
376
|
+
groups: c,
|
|
377
|
+
footer: u,
|
|
378
|
+
textClassName: p?.fontClassName
|
|
379
|
+
})
|
|
380
|
+
});
|
|
381
|
+
});
|
|
382
|
+
//#endregion
|
|
383
|
+
export { k as AvatarInitials, A as MenuItemLabel, F as NavigableBottomSheet, V as NavigationMenuPage, D as NavigationPanel, H as NavigationSheet, z as OptionListPage, B as ProfilePage, R as SheetRow, j as UserAvatar, N as UserMenu, I as useSheetNavigation };
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { FC, ReactNode } from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* Icon component contract shared by the nav rail and the mobile sheet rows.
|
|
4
|
+
* Matches the `@tabler/icons-react` signature so host icons drop in directly.
|
|
5
|
+
*/
|
|
6
|
+
export type NavigationItemIcon = FC<{
|
|
7
|
+
size?: number;
|
|
8
|
+
stroke?: number;
|
|
9
|
+
}>;
|
|
10
|
+
/** A single primary-navigation destination, already resolved by the host. */
|
|
11
|
+
export interface NavigationPanelItem {
|
|
12
|
+
/** Stable identity used as the React key and as the `onSelect` discriminator. */
|
|
13
|
+
id: string;
|
|
14
|
+
/** Translated label used as the accessible name, tooltip, and sheet row text. */
|
|
15
|
+
label: string;
|
|
16
|
+
/** Icon component rendered inside the rail button and the sheet row. */
|
|
17
|
+
icon: NavigationItemIcon;
|
|
18
|
+
/** Whether this entry points at the page currently on screen. */
|
|
19
|
+
isActive?: boolean;
|
|
20
|
+
/** Target URL placed on the rail anchor. The host owns route matching and navigation. */
|
|
21
|
+
href?: string;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Wraps a rail item in a host-owned link element (e.g. a router `Link`) so the
|
|
25
|
+
* lib never imports a routing library. Defaults to a plain `<a href>`.
|
|
26
|
+
*/
|
|
27
|
+
export type NavigationLinkRenderer = (item: NavigationPanelItem, children: ReactNode) => ReactNode;
|
|
28
|
+
//# sourceMappingURL=navigation-item.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"navigation-item.d.ts","sourceRoot":"","sources":["../../src/models/navigation-item.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAE3C;;;GAGG;AACH,MAAM,MAAM,kBAAkB,GAAG,EAAE,CAAC;IAAE,IAAI,CAAC,EAAE,MAAM,CAAC;IAAC,MAAM,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC,CAAC;AAExE,6EAA6E;AAC7E,MAAM,WAAW,mBAAmB;IAClC,iFAAiF;IACjF,EAAE,EAAE,MAAM,CAAC;IACX,iFAAiF;IACjF,KAAK,EAAE,MAAM,CAAC;IACd,wEAAwE;IACxE,IAAI,EAAE,kBAAkB,CAAC;IACzB,iEAAiE;IACjE,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,yFAAyF;IACzF,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED;;;GAGG;AACH,MAAM,MAAM,sBAAsB,GAAG,CACnC,IAAI,EAAE,mBAAmB,EACzB,QAAQ,EAAE,SAAS,KAChB,SAAS,CAAC"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
/** One selectable value inside a settings group (a language, a theme, a shortcut). */
|
|
3
|
+
export interface NavigationMenuOption {
|
|
4
|
+
/** Stable identity used as the React key. */
|
|
5
|
+
id: string;
|
|
6
|
+
/** Translated option label. */
|
|
7
|
+
label: string;
|
|
8
|
+
/** Whether this option is the currently applied value; renders a check mark. */
|
|
9
|
+
isActive: boolean;
|
|
10
|
+
/** Optional leading icon. */
|
|
11
|
+
icon?: ReactNode;
|
|
12
|
+
/** Applies the option. */
|
|
13
|
+
onSelect: () => void;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* A single-select settings group rendered as a submenu on desktop and as a
|
|
17
|
+
* pushed sheet page on mobile.
|
|
18
|
+
*/
|
|
19
|
+
export interface NavigationMenuGroup {
|
|
20
|
+
/** Stable identity used as the React key. */
|
|
21
|
+
id: string;
|
|
22
|
+
/** Translated group label shown on the parent row and as the sheet page title. */
|
|
23
|
+
label: string;
|
|
24
|
+
/** Optional leading icon for the parent row. */
|
|
25
|
+
icon?: ReactNode;
|
|
26
|
+
/** Options belonging to the group; a group with no options is skipped. */
|
|
27
|
+
options: NavigationMenuOption[];
|
|
28
|
+
}
|
|
29
|
+
//# sourceMappingURL=navigation-menu.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"navigation-menu.d.ts","sourceRoot":"","sources":["../../src/models/navigation-menu.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEvC,sFAAsF;AACtF,MAAM,WAAW,oBAAoB;IACnC,6CAA6C;IAC7C,EAAE,EAAE,MAAM,CAAC;IACX,+BAA+B;IAC/B,KAAK,EAAE,MAAM,CAAC;IACd,gFAAgF;IAChF,QAAQ,EAAE,OAAO,CAAC;IAClB,6BAA6B;IAC7B,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB,0BAA0B;IAC1B,QAAQ,EAAE,MAAM,IAAI,CAAC;CACtB;AAED;;;GAGG;AACH,MAAM,WAAW,mBAAmB;IAClC,6CAA6C;IAC7C,EAAE,EAAE,MAAM,CAAC;IACX,kFAAkF;IAClF,KAAK,EAAE,MAAM,CAAC;IACd,gDAAgD;IAChD,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB,0EAA0E;IAC1E,OAAO,EAAE,oBAAoB,EAAE,CAAC;CACjC"}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { CSSProperties, ReactNode } from 'react';
|
|
2
|
+
import { NavigationLinkRenderer, NavigationPanelItem } from './navigation-item';
|
|
3
|
+
/** Brand mark rendered above the nav items, already resolved by the host. */
|
|
4
|
+
export interface NavigationPanelLogo {
|
|
5
|
+
/** Image URL used as the mark's `background-image`. */
|
|
6
|
+
iconUrl: string;
|
|
7
|
+
/** Link target for the mark. Defaults to `'/'`. */
|
|
8
|
+
href?: string;
|
|
9
|
+
/** Translated accessible name for the logo link. */
|
|
10
|
+
ariaLabel: string;
|
|
11
|
+
}
|
|
12
|
+
/** CSS custom-property overrides for `NavigationPanel`. */
|
|
13
|
+
export interface NavigationPanelColors {
|
|
14
|
+
/** Rail background color. */
|
|
15
|
+
background?: string;
|
|
16
|
+
/** Icon color of an inactive item. */
|
|
17
|
+
itemText?: string;
|
|
18
|
+
/** Icon color of the active item. */
|
|
19
|
+
itemActiveText?: string;
|
|
20
|
+
/** Item background on hover. */
|
|
21
|
+
itemHoverBackground?: string;
|
|
22
|
+
/** Item background while pressed. */
|
|
23
|
+
itemActiveBackground?: string;
|
|
24
|
+
}
|
|
25
|
+
/** Typography overrides for `NavigationPanel`. */
|
|
26
|
+
export interface NavigationPanelTypography {
|
|
27
|
+
/** CSS class applied to the rail root, inherited by all rail content. */
|
|
28
|
+
fontClassName?: string;
|
|
29
|
+
/** `font-family` applied to the rail root. */
|
|
30
|
+
fontFamily?: string;
|
|
31
|
+
}
|
|
32
|
+
/** Combined style overrides for `NavigationPanel`. */
|
|
33
|
+
export interface NavigationPanelStyles {
|
|
34
|
+
/** Color overrides applied as CSS custom properties. */
|
|
35
|
+
colors?: NavigationPanelColors;
|
|
36
|
+
/** Typography overrides applied to the rail root. */
|
|
37
|
+
typography?: NavigationPanelTypography;
|
|
38
|
+
/** Extra class name(s) merged onto the `<nav>` element. */
|
|
39
|
+
className?: string;
|
|
40
|
+
/** CSS custom properties applied to the `<nav>` element. */
|
|
41
|
+
cssVars?: CSSProperties;
|
|
42
|
+
}
|
|
43
|
+
/** Translated labels required by `NavigationPanel`. */
|
|
44
|
+
export interface NavigationPanelLabels {
|
|
45
|
+
/** Accessible name for the `<nav>` landmark. */
|
|
46
|
+
ariaLabel: string;
|
|
47
|
+
}
|
|
48
|
+
/** Props accepted by `NavigationPanel`. */
|
|
49
|
+
export interface NavigationPanelProps {
|
|
50
|
+
/** Destinations rendered as icon buttons, in display order. */
|
|
51
|
+
items: NavigationPanelItem[];
|
|
52
|
+
/** Translated labels for the landmark. */
|
|
53
|
+
labels: NavigationPanelLabels;
|
|
54
|
+
/** Brand mark shown above the items; omit to render no logo. */
|
|
55
|
+
logo?: NavigationPanelLogo;
|
|
56
|
+
/** Pinned to the bottom of the rail — typically `UserMenu`. */
|
|
57
|
+
footer?: ReactNode;
|
|
58
|
+
/** Wraps each item in a host-owned link element. Defaults to a plain `<a href>`. */
|
|
59
|
+
renderLink?: NavigationLinkRenderer;
|
|
60
|
+
/** Style overrides for colors, typography, and class names. */
|
|
61
|
+
styles?: NavigationPanelStyles;
|
|
62
|
+
}
|
|
63
|
+
//# sourceMappingURL=navigation-panel-props.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"navigation-panel-props.d.ts","sourceRoot":"","sources":["../../src/models/navigation-panel-props.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACtD,OAAO,KAAK,EACV,sBAAsB,EACtB,mBAAmB,EACpB,MAAM,mBAAmB,CAAC;AAE3B,6EAA6E;AAC7E,MAAM,WAAW,mBAAmB;IAClC,uDAAuD;IACvD,OAAO,EAAE,MAAM,CAAC;IAChB,mDAAmD;IACnD,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,oDAAoD;IACpD,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,2DAA2D;AAC3D,MAAM,WAAW,qBAAqB;IACpC,6BAA6B;IAC7B,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,sCAAsC;IACtC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,qCAAqC;IACrC,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,gCAAgC;IAChC,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,qCAAqC;IACrC,oBAAoB,CAAC,EAAE,MAAM,CAAC;CAC/B;AAED,kDAAkD;AAClD,MAAM,WAAW,yBAAyB;IACxC,yEAAyE;IACzE,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,8CAA8C;IAC9C,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,sDAAsD;AACtD,MAAM,WAAW,qBAAqB;IACpC,wDAAwD;IACxD,MAAM,CAAC,EAAE,qBAAqB,CAAC;IAC/B,qDAAqD;IACrD,UAAU,CAAC,EAAE,yBAAyB,CAAC;IACvC,2DAA2D;IAC3D,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,4DAA4D;IAC5D,OAAO,CAAC,EAAE,aAAa,CAAC;CACzB;AAED,uDAAuD;AACvD,MAAM,WAAW,qBAAqB;IACpC,gDAAgD;IAChD,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,2CAA2C;AAC3C,MAAM,WAAW,oBAAoB;IACnC,+DAA+D;IAC/D,KAAK,EAAE,mBAAmB,EAAE,CAAC;IAC7B,0CAA0C;IAC1C,MAAM,EAAE,qBAAqB,CAAC;IAC9B,gEAAgE;IAChE,IAAI,CAAC,EAAE,mBAAmB,CAAC;IAC3B,+DAA+D;IAC/D,MAAM,CAAC,EAAE,SAAS,CAAC;IACnB,oFAAoF;IACpF,UAAU,CAAC,EAAE,sBAAsB,CAAC;IACpC,+DAA+D;IAC/D,MAAM,CAAC,EAAE,qBAAqB,CAAC;CAChC"}
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import { CSSProperties, ReactNode } from 'react';
|
|
2
|
+
import { NavigationPanelItem } from './navigation-item';
|
|
3
|
+
import { NavigationMenuGroup } from './navigation-menu';
|
|
4
|
+
import { NavigationUserProfile } from './user-profile';
|
|
5
|
+
/** CSS custom-property overrides for the mobile navigation sheet. */
|
|
6
|
+
export interface NavigationSheetColors {
|
|
7
|
+
/** Row label text color. */
|
|
8
|
+
text?: string;
|
|
9
|
+
/** Row background on hover. */
|
|
10
|
+
itemHoverBackground?: string;
|
|
11
|
+
/** Row background while pressed. */
|
|
12
|
+
itemActiveBackground?: string;
|
|
13
|
+
/** Row leading-icon color. */
|
|
14
|
+
icon?: string;
|
|
15
|
+
/** Divider color between row groups. */
|
|
16
|
+
divider?: string;
|
|
17
|
+
/** Avatar initials-badge background. */
|
|
18
|
+
avatarBackground?: string;
|
|
19
|
+
/** Avatar initials text color. */
|
|
20
|
+
avatarText?: string;
|
|
21
|
+
/** Check-mark color marking the active option. */
|
|
22
|
+
activeIcon?: string;
|
|
23
|
+
}
|
|
24
|
+
/** Typography overrides for the mobile navigation sheet. */
|
|
25
|
+
export interface NavigationSheetTypography {
|
|
26
|
+
/** CSS class applied to row labels. Defaults to `'dial-small-text'`. */
|
|
27
|
+
fontClassName?: string;
|
|
28
|
+
/** `font-family` applied to the sheet content. */
|
|
29
|
+
fontFamily?: string;
|
|
30
|
+
}
|
|
31
|
+
/** Combined style overrides for the mobile navigation sheet. */
|
|
32
|
+
export interface NavigationSheetStyles {
|
|
33
|
+
/** Color overrides applied as CSS custom properties. */
|
|
34
|
+
colors?: NavigationSheetColors;
|
|
35
|
+
/** Typography overrides applied to row labels. */
|
|
36
|
+
typography?: NavigationSheetTypography;
|
|
37
|
+
/** Extra class name(s) merged onto the sheet container. */
|
|
38
|
+
className?: string;
|
|
39
|
+
/** CSS custom properties applied to the sheet container. */
|
|
40
|
+
cssVars?: CSSProperties;
|
|
41
|
+
}
|
|
42
|
+
/** Translated labels required by `NavigationSheet`. */
|
|
43
|
+
export interface NavigationSheetLabels {
|
|
44
|
+
/** Root-page header title, e.g. `"Menu"`. */
|
|
45
|
+
title: string;
|
|
46
|
+
/** Accessible name for the close (×) button. */
|
|
47
|
+
close: string;
|
|
48
|
+
/** Accessible name for the back button shown on pushed pages. */
|
|
49
|
+
back: string;
|
|
50
|
+
/** Label of the row that opens the profile page, also its page title. */
|
|
51
|
+
profile: string;
|
|
52
|
+
/** Label of the log-out row. */
|
|
53
|
+
logOut: string;
|
|
54
|
+
}
|
|
55
|
+
/** Props accepted by `NavigationSheet`. */
|
|
56
|
+
export interface NavigationSheetProps {
|
|
57
|
+
/** Controls sheet visibility. */
|
|
58
|
+
isOpen: boolean;
|
|
59
|
+
/** Called when the sheet should close (backdrop tap, close button, or Escape). */
|
|
60
|
+
onClose: () => void;
|
|
61
|
+
/** Destinations rendered as rows on the root page, in display order. */
|
|
62
|
+
items: NavigationPanelItem[];
|
|
63
|
+
/** Called with the picked destination; the host performs the navigation. */
|
|
64
|
+
onSelectItem: (item: NavigationPanelItem) => void;
|
|
65
|
+
/** Translated labels for the header, profile row, and log-out row. */
|
|
66
|
+
labels: NavigationSheetLabels;
|
|
67
|
+
/** Signed-in user details shown on the profile page; omit to hide the profile row. */
|
|
68
|
+
profile?: NavigationUserProfile;
|
|
69
|
+
/** Single-select settings groups listed on the profile page; empty groups are skipped. */
|
|
70
|
+
groups?: NavigationMenuGroup[];
|
|
71
|
+
/** Called when the user taps "Log out"; the host owns the confirmation flow. */
|
|
72
|
+
onLogout: () => void;
|
|
73
|
+
/** Rendered at the end of the root page — typically a footer message. */
|
|
74
|
+
footer?: ReactNode;
|
|
75
|
+
/** Style overrides for colors, typography, and class names. */
|
|
76
|
+
styles?: NavigationSheetStyles;
|
|
77
|
+
}
|
|
78
|
+
//# sourceMappingURL=navigation-sheet-props.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"navigation-sheet-props.d.ts","sourceRoot":"","sources":["../../src/models/navigation-sheet-props.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACtD,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AAC7D,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AAC7D,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,gBAAgB,CAAC;AAE5D,qEAAqE;AACrE,MAAM,WAAW,qBAAqB;IACpC,4BAA4B;IAC5B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,+BAA+B;IAC/B,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,oCAAoC;IACpC,oBAAoB,CAAC,EAAE,MAAM,CAAC;IAC9B,8BAA8B;IAC9B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,wCAAwC;IACxC,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,wCAAwC;IACxC,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,kCAAkC;IAClC,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,kDAAkD;IAClD,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,4DAA4D;AAC5D,MAAM,WAAW,yBAAyB;IACxC,wEAAwE;IACxE,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,kDAAkD;IAClD,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,gEAAgE;AAChE,MAAM,WAAW,qBAAqB;IACpC,wDAAwD;IACxD,MAAM,CAAC,EAAE,qBAAqB,CAAC;IAC/B,kDAAkD;IAClD,UAAU,CAAC,EAAE,yBAAyB,CAAC;IACvC,2DAA2D;IAC3D,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,4DAA4D;IAC5D,OAAO,CAAC,EAAE,aAAa,CAAC;CACzB;AAED,uDAAuD;AACvD,MAAM,WAAW,qBAAqB;IACpC,6CAA6C;IAC7C,KAAK,EAAE,MAAM,CAAC;IACd,gDAAgD;IAChD,KAAK,EAAE,MAAM,CAAC;IACd,iEAAiE;IACjE,IAAI,EAAE,MAAM,CAAC;IACb,yEAAyE;IACzE,OAAO,EAAE,MAAM,CAAC;IAChB,gCAAgC;IAChC,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,2CAA2C;AAC3C,MAAM,WAAW,oBAAoB;IACnC,iCAAiC;IACjC,MAAM,EAAE,OAAO,CAAC;IAChB,kFAAkF;IAClF,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,wEAAwE;IACxE,KAAK,EAAE,mBAAmB,EAAE,CAAC;IAC7B,4EAA4E;IAC5E,YAAY,EAAE,CAAC,IAAI,EAAE,mBAAmB,KAAK,IAAI,CAAC;IAClD,sEAAsE;IACtE,MAAM,EAAE,qBAAqB,CAAC;IAC9B,sFAAsF;IACtF,OAAO,CAAC,EAAE,qBAAqB,CAAC;IAChC,0FAA0F;IAC1F,MAAM,CAAC,EAAE,mBAAmB,EAAE,CAAC;IAC/B,gFAAgF;IAChF,QAAQ,EAAE,MAAM,IAAI,CAAC;IACrB,yEAAyE;IACzE,MAAM,CAAC,EAAE,SAAS,CAAC;IACnB,+DAA+D;IAC/D,MAAM,CAAC,EAAE,qBAAqB,CAAC;CAChC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
/** A page pushed onto the bottom sheet's navigation stack. */
|
|
3
|
+
export interface SheetPage {
|
|
4
|
+
/** Header title shown while the page is on top of the stack. */
|
|
5
|
+
title: string;
|
|
6
|
+
/** Page body. */
|
|
7
|
+
content: ReactNode;
|
|
8
|
+
}
|
|
9
|
+
/** Stack controls exposed to sheet page content via `useSheetNavigation`. */
|
|
10
|
+
export interface SheetNavigation {
|
|
11
|
+
/** Pushes a page on top of the stack. */
|
|
12
|
+
push: (page: SheetPage) => void;
|
|
13
|
+
/** Pops the top page, revealing the one beneath it. */
|
|
14
|
+
pop: () => void;
|
|
15
|
+
/** Clears the stack and closes the sheet. */
|
|
16
|
+
close: () => void;
|
|
17
|
+
}
|
|
18
|
+
//# sourceMappingURL=sheet-navigation.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sheet-navigation.d.ts","sourceRoot":"","sources":["../../src/models/sheet-navigation.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEvC,8DAA8D;AAC9D,MAAM,WAAW,SAAS;IACxB,gEAAgE;IAChE,KAAK,EAAE,MAAM,CAAC;IACd,iBAAiB;IACjB,OAAO,EAAE,SAAS,CAAC;CACpB;AAED,6EAA6E;AAC7E,MAAM,WAAW,eAAe;IAC9B,yCAAyC;IACzC,IAAI,EAAE,CAAC,IAAI,EAAE,SAAS,KAAK,IAAI,CAAC;IAChC,uDAAuD;IACvD,GAAG,EAAE,MAAM,IAAI,CAAC;IAChB,6CAA6C;IAC7C,KAAK,EAAE,MAAM,IAAI,CAAC;CACnB"}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { CSSProperties } from 'react';
|
|
2
|
+
import { NavigationMenuGroup } from './navigation-menu';
|
|
3
|
+
import { NavigationUserProfile } from './user-profile';
|
|
4
|
+
/** CSS custom-property overrides for `UserMenu`. */
|
|
5
|
+
export interface UserMenuColors {
|
|
6
|
+
/** Avatar initials-badge background. */
|
|
7
|
+
avatarBackground?: string;
|
|
8
|
+
/** Avatar initials text color. */
|
|
9
|
+
avatarText?: string;
|
|
10
|
+
/** Menu label text color. */
|
|
11
|
+
text?: string;
|
|
12
|
+
/** Check-mark color marking the active option. */
|
|
13
|
+
activeIcon?: string;
|
|
14
|
+
/** Trigger background on hover. */
|
|
15
|
+
triggerHoverBackground?: string;
|
|
16
|
+
}
|
|
17
|
+
/** Typography overrides for `UserMenu`. */
|
|
18
|
+
export interface UserMenuTypography {
|
|
19
|
+
/** CSS class applied to menu labels. Defaults to `'dial-small-text'`. */
|
|
20
|
+
fontClassName?: string;
|
|
21
|
+
/** `font-family` applied to the menu trigger and overlay content. */
|
|
22
|
+
fontFamily?: string;
|
|
23
|
+
}
|
|
24
|
+
/** Combined style overrides for `UserMenu`. */
|
|
25
|
+
export interface UserMenuStyles {
|
|
26
|
+
/** Color overrides applied as CSS custom properties. */
|
|
27
|
+
colors?: UserMenuColors;
|
|
28
|
+
/** Typography overrides applied to menu labels. */
|
|
29
|
+
typography?: UserMenuTypography;
|
|
30
|
+
/** Extra class name(s) merged onto the trigger wrapper. */
|
|
31
|
+
className?: string;
|
|
32
|
+
/** CSS custom properties applied to the trigger wrapper. */
|
|
33
|
+
cssVars?: CSSProperties;
|
|
34
|
+
}
|
|
35
|
+
/** Translated labels required by `UserMenu`. */
|
|
36
|
+
export interface UserMenuLabels {
|
|
37
|
+
/** Accessible name for the avatar trigger, e.g. `"Signed in as a@b.c"`. */
|
|
38
|
+
trigger: string;
|
|
39
|
+
/** Alternative text for the avatar image. */
|
|
40
|
+
avatarAlt: string;
|
|
41
|
+
/** Label of the log-out entry. */
|
|
42
|
+
logOut: string;
|
|
43
|
+
}
|
|
44
|
+
/** Props accepted by `UserMenu`. */
|
|
45
|
+
export interface UserMenuProps {
|
|
46
|
+
/** Signed-in user details used for the identity row and avatar. */
|
|
47
|
+
profile: NavigationUserProfile;
|
|
48
|
+
/** Translated labels for the trigger, avatar, and log-out entry. */
|
|
49
|
+
labels: UserMenuLabels;
|
|
50
|
+
/** Single-select settings groups rendered as submenus; empty groups are skipped. */
|
|
51
|
+
groups?: NavigationMenuGroup[];
|
|
52
|
+
/** Called when the user picks "Log out"; the host owns the confirmation flow. */
|
|
53
|
+
onLogout: () => void;
|
|
54
|
+
/** Hides the avatar tooltip — set on touch layouts where hover never fires. */
|
|
55
|
+
isTooltipHidden?: boolean;
|
|
56
|
+
/** Style overrides for colors, typography, and class names. */
|
|
57
|
+
styles?: UserMenuStyles;
|
|
58
|
+
}
|
|
59
|
+
//# sourceMappingURL=user-menu-props.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"user-menu-props.d.ts","sourceRoot":"","sources":["../../src/models/user-menu-props.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAC3C,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AAC7D,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,gBAAgB,CAAC;AAE5D,oDAAoD;AACpD,MAAM,WAAW,cAAc;IAC7B,wCAAwC;IACxC,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,kCAAkC;IAClC,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,6BAA6B;IAC7B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,kDAAkD;IAClD,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,mCAAmC;IACnC,sBAAsB,CAAC,EAAE,MAAM,CAAC;CACjC;AAED,2CAA2C;AAC3C,MAAM,WAAW,kBAAkB;IACjC,yEAAyE;IACzE,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,qEAAqE;IACrE,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,+CAA+C;AAC/C,MAAM,WAAW,cAAc;IAC7B,wDAAwD;IACxD,MAAM,CAAC,EAAE,cAAc,CAAC;IACxB,mDAAmD;IACnD,UAAU,CAAC,EAAE,kBAAkB,CAAC;IAChC,2DAA2D;IAC3D,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,4DAA4D;IAC5D,OAAO,CAAC,EAAE,aAAa,CAAC;CACzB;AAED,gDAAgD;AAChD,MAAM,WAAW,cAAc;IAC7B,2EAA2E;IAC3E,OAAO,EAAE,MAAM,CAAC;IAChB,6CAA6C;IAC7C,SAAS,EAAE,MAAM,CAAC;IAClB,kCAAkC;IAClC,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,oCAAoC;AACpC,MAAM,WAAW,aAAa;IAC5B,mEAAmE;IACnE,OAAO,EAAE,qBAAqB,CAAC;IAC/B,oEAAoE;IACpE,MAAM,EAAE,cAAc,CAAC;IACvB,oFAAoF;IACpF,MAAM,CAAC,EAAE,mBAAmB,EAAE,CAAC;IAC/B,iFAAiF;IACjF,QAAQ,EAAE,MAAM,IAAI,CAAC;IACrB,+EAA+E;IAC/E,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,+DAA+D;IAC/D,MAAM,CAAC,EAAE,cAAc,CAAC;CACzB"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/** Signed-in user details needed to render the identity row and avatar. */
|
|
2
|
+
export interface NavigationUserProfile {
|
|
3
|
+
/** Address shown in the avatar tooltip and the "signed in as" label. */
|
|
4
|
+
email: string;
|
|
5
|
+
/** Full name, falling back to the email when no name claim exists. */
|
|
6
|
+
displayName: string;
|
|
7
|
+
/** One-or-two-letter initials rendered when no avatar image is available. */
|
|
8
|
+
shortName?: string;
|
|
9
|
+
/** Avatar image URL, already resolved to something usable as an `<img src>`. */
|
|
10
|
+
imageUrl?: string;
|
|
11
|
+
/** Whether the initials badge replaces the image (no image, or it failed to load). */
|
|
12
|
+
isFallbackShown?: boolean;
|
|
13
|
+
/** Called when the avatar image fails to load so the host can flip to initials. */
|
|
14
|
+
onImageError?: () => void;
|
|
15
|
+
}
|
|
16
|
+
//# sourceMappingURL=user-profile.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"user-profile.d.ts","sourceRoot":"","sources":["../../src/models/user-profile.ts"],"names":[],"mappings":"AAAA,2EAA2E;AAC3E,MAAM,WAAW,qBAAqB;IACpC,wEAAwE;IACxE,KAAK,EAAE,MAAM,CAAC;IACd,sEAAsE;IACtE,WAAW,EAAE,MAAM,CAAC;IACpB,6EAA6E;IAC7E,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,gFAAgF;IAChF,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,sFAAsF;IACtF,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,mFAAmF;IACnF,YAAY,CAAC,EAAE,MAAM,IAAI,CAAC;CAC3B"}
|
package/package.json
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@epam/ai-dial-navigation-panel",
|
|
3
|
+
"description": "Primary application navigation — desktop nav rail, user menu, and mobile navigation bottom sheet",
|
|
4
|
+
"version": "1.0.0-rc.5",
|
|
5
|
+
"license": "Apache-2.0",
|
|
6
|
+
"type": "module",
|
|
7
|
+
"main": "./index.js",
|
|
8
|
+
"module": "./index.js",
|
|
9
|
+
"types": "./index.d.ts",
|
|
10
|
+
"exports": {
|
|
11
|
+
"./package.json": "./package.json",
|
|
12
|
+
"./styles.css": "./style.css",
|
|
13
|
+
".": {
|
|
14
|
+
"types": "./index.d.ts",
|
|
15
|
+
"import": "./index.js",
|
|
16
|
+
"default": "./index.js"
|
|
17
|
+
}
|
|
18
|
+
},
|
|
19
|
+
"peerDependencies": {
|
|
20
|
+
"react": "^19.0.0",
|
|
21
|
+
"@tabler/icons-react": "^3.44.0",
|
|
22
|
+
"@epam/ai-dial-chat-shared": "1.0.0-rc.5",
|
|
23
|
+
"@epam/ai-dial-conversation-input": "1.0.0-rc.5",
|
|
24
|
+
"@epam/ai-dial-ui-kit": "^0.13.0-dev.26"
|
|
25
|
+
},
|
|
26
|
+
"repository": {
|
|
27
|
+
"type": "git",
|
|
28
|
+
"url": "git+https://github.com/epam/ai-dial-chat.git",
|
|
29
|
+
"directory": "libs/navigation-panel"
|
|
30
|
+
}
|
|
31
|
+
}
|
package/test-setup.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
//# sourceMappingURL=test-setup.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"test-setup.d.ts","sourceRoot":"","sources":["../src/test-setup.ts"],"names":[],"mappings":""}
|