@foris/avocado-suite 1.8.15 → 1.8.16
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/avocado-suite.es.js +7875 -7726
- package/dist/avocado-suite.umd.js +128 -128
- package/dist/components/nav-list/NavList.d.ts +17 -0
- package/dist/components/nav-list/NavList.test.d.ts +0 -0
- package/dist/components/nav-list/NavListContext.d.ts +9 -0
- package/dist/components/nav-list/index.d.ts +3 -0
- package/dist/components/nav-list/nav-list-item/NavListItem.d.ts +9 -0
- package/dist/components/nav-list/nav-list-item/NavListItem.test.d.ts +0 -0
- package/dist/components/nav-list/types.d.ts +19 -0
- package/dist/index.d.ts +4 -1
- package/dist/style.css +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { FC, MouseEvent } from 'react';
|
|
2
|
+
import type { NavListItemData, NavListLeaf } from './types';
|
|
3
|
+
export type NavListProps = {
|
|
4
|
+
/** Navigation entries. Top-level items may show an icon and may branch via `items`. */
|
|
5
|
+
items: NavListItemData[];
|
|
6
|
+
/** Extra class for the root `ul`. */
|
|
7
|
+
className?: string;
|
|
8
|
+
/** Names the `nav` landmark — important when the page has more than one nav region. */
|
|
9
|
+
'aria-label'?: string;
|
|
10
|
+
/**
|
|
11
|
+
* Called when a navigable item is clicked, before its native `href` navigation.
|
|
12
|
+
* Call `event.preventDefault()` to take over navigation (e.g. client-side routing).
|
|
13
|
+
*/
|
|
14
|
+
onItemClick?: (item: NavListLeaf, event: MouseEvent<HTMLAnchorElement>) => void;
|
|
15
|
+
};
|
|
16
|
+
declare const NavList: FC<NavListProps>;
|
|
17
|
+
export default NavList;
|
|
File without changes
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { MouseEvent } from 'react';
|
|
2
|
+
import type { NavListLeaf } from './types';
|
|
3
|
+
export type NavListContextValue = {
|
|
4
|
+
toggleBranch: (code: string) => void;
|
|
5
|
+
closeAll: () => void;
|
|
6
|
+
onItemClick?: (item: NavListLeaf, event: MouseEvent<HTMLAnchorElement>) => void;
|
|
7
|
+
};
|
|
8
|
+
export declare const NavListContext: import("react").Context<NavListContextValue | null>;
|
|
9
|
+
export declare const useNavListContext: () => NavListContextValue;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import type { NavListItemData } from '../types';
|
|
3
|
+
export type NavListItemProps = NavListItemData & {
|
|
4
|
+
depth?: number;
|
|
5
|
+
className?: string;
|
|
6
|
+
isOpen?: boolean;
|
|
7
|
+
};
|
|
8
|
+
declare const MemoNavListItem: import("react").NamedExoticComponent<NavListItemProps>;
|
|
9
|
+
export default MemoNavListItem;
|
|
File without changes
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { IconTypes } from '../../../../avocado-icons';
|
|
2
|
+
export type NavListLeaf = {
|
|
3
|
+
/** Unique id; also the key used to track which branch is open. */
|
|
4
|
+
code: string;
|
|
5
|
+
/** Visible label. */
|
|
6
|
+
name: string;
|
|
7
|
+
/** Destination URL. When set (and `canNavigate` isn't `false`) the item renders as a link. */
|
|
8
|
+
href?: string;
|
|
9
|
+
/** Render a static, non-clickable item even when `href` is present. Defaults to navigable. */
|
|
10
|
+
canNavigate?: boolean;
|
|
11
|
+
};
|
|
12
|
+
export type NavListItemData = NavListLeaf & {
|
|
13
|
+
/** Leading icon, shown only at the top level. */
|
|
14
|
+
icon?: IconTypes;
|
|
15
|
+
/** Children turn this entry into an expandable branch. */
|
|
16
|
+
items?: NavListLeaf[];
|
|
17
|
+
/** Expand this branch on mount. Only the first defaulted branch opens. */
|
|
18
|
+
defaultOpen?: boolean;
|
|
19
|
+
};
|
package/dist/index.d.ts
CHANGED
|
@@ -55,12 +55,13 @@ import SidebarMenu from './components/sidebar-menu/SidebarMenu';
|
|
|
55
55
|
import AccessPanel from './components/access-panel/AccessPanel';
|
|
56
56
|
import AccountMenu from './components/account-menu/AccountMenu';
|
|
57
57
|
import Header from './components/header/Header';
|
|
58
|
+
import NavList from './components/nav-list';
|
|
58
59
|
import { toast } from 'react-toastify';
|
|
59
60
|
/**
|
|
60
61
|
* Hooks
|
|
61
62
|
*/
|
|
62
63
|
export { useFloatingPortal } from './hooks/useFloatingPortal';
|
|
63
|
-
export { Banner, Header, Drawer, AccessPanel, AccountMenu, SidebarMenu, Weekly, WeeklyGroup, Accordion, Box, Breadcrumbs, Button, Card, CardAccordion, CardNotification, Checkbox, DataCard, DataTable, DatePicker, Divider, Donut, DonutLabels, DonutLegend, DropdownButton, Heading, Link, Loading, Menu, Modal, Pager, Pill, PreviewerMarkdown, Processing, ProgressBar, RadioButton, RoundButton, Select, SelectPagination, SkeletonBase, SkeletonCircle, Stepper, Switch, Tabs, Tag, Text, TextField, Textarea, ThemeProvider, ThemeStore, LocaleStore, Timer, Toaster, Tooltip, Table, toast, };
|
|
64
|
+
export { Banner, Header, NavList, Drawer, AccessPanel, AccountMenu, SidebarMenu, Weekly, WeeklyGroup, Accordion, Box, Breadcrumbs, Button, Card, CardAccordion, CardNotification, Checkbox, DataCard, DataTable, DatePicker, Divider, Donut, DonutLabels, DonutLegend, DropdownButton, Heading, Link, Loading, Menu, Modal, Pager, Pill, PreviewerMarkdown, Processing, ProgressBar, RadioButton, RoundButton, Select, SelectPagination, SkeletonBase, SkeletonCircle, Stepper, Switch, Tabs, Tag, Text, TextField, Textarea, ThemeProvider, ThemeStore, LocaleStore, Timer, Toaster, Tooltip, Table, toast, };
|
|
64
65
|
/**
|
|
65
66
|
* Types
|
|
66
67
|
*/
|
|
@@ -82,6 +83,8 @@ export type { TimerTime } from './components/timer/Timer';
|
|
|
82
83
|
export type { ModalProps } from './components/modal/Modal';
|
|
83
84
|
export type { AccountMenuFooterAction, AccountMenuProps, } from './components/account-menu/AccountMenu';
|
|
84
85
|
export type { DrawerProps } from './components/drawer/Drawer';
|
|
86
|
+
export type { NavListProps } from './components/nav-list';
|
|
87
|
+
export type { NavListItemData, NavListLeaf } from './components/nav-list/types';
|
|
85
88
|
export type { PillProps } from './components/Pill/Pill';
|
|
86
89
|
export type { PreviewerMarkdownProps } from './components/previewer-markdown/PreviewerMarkdown';
|
|
87
90
|
export type { ThemeMode, Theme } from './types/theme.types';
|