@midas-ds/layout 0.0.19 → 0.0.20
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/CHANGELOG.md
CHANGED
|
@@ -1,13 +1,17 @@
|
|
|
1
|
-
import { ReactNode, ElementType } from 'react';
|
|
1
|
+
import { ReactNode, ElementType, ComponentProps } from 'react';
|
|
2
2
|
import { Link } from 'react-aria-components';
|
|
3
|
-
|
|
4
|
-
export interface NavigationLinkComponentProps<C extends ElementType> extends Pick<LinkComponentProps<C>, 'className' | 'as'> {
|
|
3
|
+
export interface NavigationLinkComponentProps<C extends ElementType> {
|
|
5
4
|
/** The icon to display. */
|
|
6
5
|
children: ReactNode;
|
|
7
6
|
/** The visible label text and tooltip content. */
|
|
8
7
|
title: string;
|
|
9
8
|
isActive?: boolean;
|
|
10
9
|
variant?: 'sidebar' | 'navbar';
|
|
10
|
+
className?: string;
|
|
11
|
+
/** Replace base component with any Client Side Routing link instead.
|
|
12
|
+
* @see {@link https://designsystem.migrationsverket.se/dev/client-side-routing/|Client side routing}
|
|
13
|
+
*/
|
|
14
|
+
as?: C;
|
|
11
15
|
}
|
|
12
|
-
export type NavigationLinkProps<C extends
|
|
13
|
-
export declare const NavigationLink: <C extends
|
|
16
|
+
export type NavigationLinkProps<C extends ElementType> = NavigationLinkComponentProps<C> & Omit<ComponentProps<C>, keyof NavigationLinkComponentProps<C>>;
|
|
17
|
+
export declare const NavigationLink: <C extends ElementType = typeof Link>({ as, children, className, isActive, title, "aria-label": ariaLabel, ...rest }: NavigationLinkProps<C>) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -2,7 +2,7 @@ import { StoryObj } from '@storybook/react-vite';
|
|
|
2
2
|
import { NavigationLink } from '.';
|
|
3
3
|
type Story = StoryObj<typeof NavigationLink>;
|
|
4
4
|
declare const _default: {
|
|
5
|
-
component: <C extends
|
|
5
|
+
component: <C extends import('react').ElementType = (props: import('react-aria-components').LinkProps & React.RefAttributes<HTMLAnchorElement>) => React.ReactElement | null>({ as, children, className, isActive, title, "aria-label": ariaLabel, ...rest }: import('./NavigationLink').NavigationLinkProps<C>) => import("react/jsx-runtime").JSX.Element;
|
|
6
6
|
title: string;
|
|
7
7
|
tags: string[];
|
|
8
8
|
args: {
|
package/package.json
CHANGED