Skip to content

Commit 51a148b

Browse files
committed
components from figma
1 parent 1feca18 commit 51a148b

File tree

774 files changed

+16683
-6275
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

774 files changed

+16683
-6275
lines changed
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
import React from 'react';
2+
import { Decorator } from '@storybook/react';
3+
4+
import { LinkProvider } from '../../src/providers/NextLinkProvider';
5+
6+
const withNextLink: Decorator = (StoryFn) => {
7+
// consumers of the library pass in actual React/Next.js links
8+
const FakeLink = function ({ children }) {
9+
return (
10+
<a className="peer/menu-button cursor-pointer flex w-full items-center gap-2 overflow-hidden rounded-md p-2 text-left outline-hidden ring-sidebar-ring transition-[width,height,padding] focus-visible:ring-2 active:bg-sidebar-accent active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 group-has-data-[sidebar=menu-action]/menu-item:pr-8 aria-disabled:pointer-events-none aria-disabled:opacity-50 data-[active=true]:bg-sidebar-accent data-[active=true]:font-medium data-[active=true]:text-sidebar-accent-foreground data-[state=open]:hover:bg-sidebar-accent data-[state=open]:hover:text-sidebar-accent-foreground group-data-[collapsible=icon]:size-8! group-data-[collapsible=icon]:p-2! [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0 hover:bg-sidebar-accent hover:text-sidebar-accent-foreground h-8 text-sm data-[active=true]:bg-sidebar-accent data-[active=true]:font-medium data-[active=true]:text-sidebar-accent-foreground">
11+
{children}
12+
</a>
13+
);
14+
};
15+
return (
16+
<LinkProvider linkComponent={FakeLink as any}>
17+
<StoryFn />
18+
</LinkProvider>
19+
);
20+
};
21+
export default withNextLink;

0 commit comments

Comments
 (0)