@tracktor/design-system 4.1.0 → 4.2.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.
@@ -1,8 +1,11 @@
1
- import { ReactNode } from 'react';
1
+ import { MouseEvent, ReactNode } from 'react';
2
2
  import { NavLinkProps, ObjectNavigationItem } from '..';
3
3
  interface NavLinkItemProps extends Omit<ObjectNavigationItem, "label"> {
4
4
  children?: ReactNode;
5
- component?: (props: NavLinkProps) => ReactNode;
5
+ component?: (props: NavLinkProps & {
6
+ onClick?: (event?: MouseEvent) => void;
7
+ }) => ReactNode;
8
+ onClick?: (event?: MouseEvent) => void;
6
9
  }
7
- declare const NavLinkItem: ({ url, end, children, active, state, component, disabled }: NavLinkItemProps) => import("@emotion/react/jsx-runtime").JSX.Element;
10
+ declare const NavLinkItem: ({ url, end, children, active, state, component, disabled, onClick }: NavLinkItemProps) => import("@emotion/react/jsx-runtime").JSX.Element;
8
11
  export default NavLinkItem;
@@ -1,4 +1,4 @@
1
- import { ReactElement, ReactNode } from 'react';
1
+ import { MouseEvent, ReactElement, ReactNode } from 'react';
2
2
  export type ObjectNavigationItem = {
3
3
  url?: string;
4
4
  label?: string;
@@ -11,6 +11,16 @@ export type ObjectNavigationItem = {
11
11
  hideOnMobile?: boolean;
12
12
  hasAccess?: boolean;
13
13
  };
14
+ export interface BottomLinkProps {
15
+ url?: string;
16
+ state?: any;
17
+ end?: boolean;
18
+ label?: ReactNode;
19
+ active?: boolean;
20
+ icon?: ReactNode;
21
+ disabled?: boolean;
22
+ onClick?: (e?: MouseEvent) => void;
23
+ }
14
24
  export interface NavLinkProps {
15
25
  className?: string | ((props: {
16
26
  isActive: boolean;
@@ -54,14 +64,7 @@ export interface NavigationMenuProps {
54
64
  /**
55
65
  * Component to render the bottom link
56
66
  */
57
- bottomLink?: {
58
- url?: string;
59
- state?: any;
60
- end?: boolean;
61
- label?: ReactNode;
62
- active?: boolean;
63
- icon?: ReactNode;
64
- } | null | false;
67
+ bottomLink?: BottomLinkProps | BottomLinkProps[] | null | false;
65
68
  /**
66
69
  * Component to router nav links.
67
70
  * This component is used to render the links in the main menu & mobile bottom navigation
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@tracktor/design-system",
3
3
  "description": "Tracktor Design System",
4
4
  "sideEffects": false,
5
- "version": "4.1.0",
5
+ "version": "4.2.0",
6
6
  "license": "ISC",
7
7
  "type": "module",
8
8
  "types": "./dist/src/main.d.ts",