Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit8659694

Browse files
chore: add Collapsible component (#15961)
This component is needed to complete the mobile menu for the [navbarrefactoring task](#15617). You cancheck out the Figma design[here](https://www.figma.com/design/WfqIgsTFXN2BscBSSyXWF8/Coder-kit?node-id=656-2354&t=jm6tERwCzB1TBeds-0).
1 parent03edd60 commit8659694

File tree

4 files changed

+100
-0
lines changed

4 files changed

+100
-0
lines changed

‎site/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@
5151
"@mui/utils":"5.16.6",
5252
"@mui/x-tree-view":"7.18.0",
5353
"@radix-ui/react-avatar":"1.1.2",
54+
"@radix-ui/react-collapsible":"1.1.2",
5455
"@radix-ui/react-dialog":"1.1.2",
5556
"@radix-ui/react-dropdown-menu":"2.1.4",
5657
"@radix-ui/react-label":"2.1.0",

‎site/pnpm-lock.yaml

Lines changed: 32 additions & 0 deletions
Some generated files are not rendered by default. Learn more aboutcustomizing how changed files appear on GitHub.
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
importtype{Meta,StoryObj}from"@storybook/react";
2+
import{Button}from"components/Button/Button";
3+
import{ChevronsUpDown}from"lucide-react";
4+
import{
5+
Collapsible,
6+
CollapsibleContent,
7+
CollapsibleTrigger,
8+
}from"./Collapsible";
9+
10+
constmeta:Meta<typeofCollapsible>={
11+
title:"components/Collapsible",
12+
component:Collapsible,
13+
args:{
14+
className:"w-[350px] space-y-2",
15+
children:(
16+
<>
17+
<divclassName="flex items-center justify-between space-x-4 px-4">
18+
<h4className="text-sm font-semibold">
19+
@peduarte starred 3 repositories
20+
</h4>
21+
<CollapsibleTriggerasChild>
22+
<Buttonsize="sm">
23+
<ChevronsUpDownclassName="h-4 w-4"/>
24+
<spanclassName="sr-only">Toggle</span>
25+
</Button>
26+
</CollapsibleTrigger>
27+
</div>
28+
<divclassName="rounded-md border px-4 py-2 font-mono text-sm shadow-sm">
29+
@radix-ui/primitives
30+
</div>
31+
<CollapsibleContentclassName="space-y-2">
32+
<divclassName="rounded-md border px-4 py-2 font-mono text-sm shadow-sm">
33+
@radix-ui/colors
34+
</div>
35+
<divclassName="rounded-md border px-4 py-2 font-mono text-sm shadow-sm">
36+
@stitches/react
37+
</div>
38+
</CollapsibleContent>
39+
</>
40+
),
41+
},
42+
};
43+
44+
exportdefaultmeta;
45+
typeStory=StoryObj<typeofCollapsible>;
46+
47+
exportconstClose:Story={};
48+
49+
exportconstOpen:Story={
50+
args:{
51+
open:true,
52+
},
53+
};
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
/**
2+
* Copied from shadc/ui on 12/26/2024
3+
*@see {@link https://ui.shadcn.com/docs/components/collapsible}
4+
*/
5+
6+
import*asCollapsiblePrimitivefrom"@radix-ui/react-collapsible";
7+
8+
constCollapsible=CollapsiblePrimitive.Root;
9+
10+
constCollapsibleTrigger=CollapsiblePrimitive.CollapsibleTrigger;
11+
12+
constCollapsibleContent=CollapsiblePrimitive.CollapsibleContent;
13+
14+
export{Collapsible,CollapsibleTrigger,CollapsibleContent};

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp