File tree Expand file tree Collapse file tree 4 files changed +87
-24
lines changed 
src/components/common/badge 
stories/components/common Expand file tree Collapse file tree 4 files changed +87
-24
lines changed Original file line number Diff line number Diff line change 11<script  setup lang="ts">
22import  { computed  } from  " vue" 
3- import  type  { UiBadgeProps  } from  " @/types/badge " 
3+ import  type  { Component  } from  " vue " 
44import  { badgeVariants  } from  " ./badge.variants" 
55
6- const =  withDefaults (defineProps <UiBadgeProps >(), {
6+ export  interface  BadgeProps  {
7+   variant? :  " red" |  " yellow" |  " green" |  " blue" |  " indigo" |  " purple" |   
8+     " pink" |  " orange" |  " black" |  " white" |  " transparent" |  " current" |  " gray"  
9+   size? :  " xs" |  " sm" |  " md" |  " lg" |  " xl" |  " 2xl"  
10+   icon? :  Component ; 
11+   iconRight? :  Component ; 
12+   iconStyles? :  string ; 
13+ } 
14+ 
15+ const =  withDefaults (defineProps <BadgeProps >(), {
716  variant: " gray"  
17+   size: " md"  
818  icon: undefined , 
919  iconRight: undefined , 
1020  iconStyles: " "  
11-   size: " md"  
1221}); 
1322
1423const =  computed (() =>  {
Original file line number Diff line number Diff line change 1+ import  type  {  Meta ,  StoryObj  }  from  "@storybook/vue3" ; 
2+ import  BadgeComponent  from  "../../../src/components/common/badge/Badge.vue" ; 
3+ 
4+ const  meta  =  { 
5+   title : "Components/Common" , 
6+   component : BadgeComponent , 
7+ }  satisfies  Meta < typeof  BadgeComponent > ; 
8+ 
9+ export  default  meta ; 
10+ 
11+ type  Story  =  StoryObj < typeof  meta > ; 
12+ 
13+ export  const  Badge : Story  =  { 
14+   args : { 
15+     variant : "gray" , 
16+     size : "md" , 
17+     default : "Badge" , 
18+   } , 
19+   render : ( args )  =>  ( { 
20+     components : {  BadgeComponent } , 
21+     setup ( )  { 
22+       return  {  args } ; 
23+     } , 
24+     template : ` 
25+       <BadgeComponent :variant="args.variant" :size="args.size"> 
26+         {{ args.default }} 
27+       </BadgeComponent> 
28+     ` , 
29+   } ) , 
30+ } ;  
Original file line number Diff line number Diff line change @@ -4,27 +4,6 @@ import ButtonComponent from "../../../src/components/common/button/Button.vue";
44const  meta  =  { 
55  title : "Components/Common" , 
66  component : ButtonComponent , 
7-   tags : [ "autodocs" ] , 
8-   argTypes : { 
9-     variant : { 
10-       description : "Style variant of the button" , 
11-       control : "select" , 
12-       defaultValue : "primary" , 
13-     } , 
14-     size : { 
15-       description : "Size of the button" , 
16-       control : "select" , 
17-       defaultValue : "md" , 
18-     } , 
19-     class : { 
20-       description : "Additional CSS classes" , 
21-       control : "text" , 
22-     } , 
23-     default : { 
24-       description : "Button content (slot)" , 
25-       control : "text" , 
26-     } , 
27-   } , 
287}  satisfies  Meta < typeof  ButtonComponent > ; 
298
309export  default  meta ; 
Original file line number Diff line number Diff line change 1+ import  type  {  Meta ,  StoryObj  }  from  "@storybook/vue3" ; 
2+ import  DropdownMenu  from  "../../../src/components/common/dropdown-menu/DropdownMenu.vue" ; 
3+ import  DropdownMenuTrigger  from  "../../../src/components/common/dropdown-menu/DropdownMenuTrigger.vue" ; 
4+ import  DropdownMenuContent  from  "../../../src/components/common/dropdown-menu/DropdownMenuContent.vue" ; 
5+ import  DropdownMenuItem  from  "../../../src/components/common/dropdown-menu/DropdownMenuItem.vue" ; 
6+ import  DropdownMenuLabel  from  "../../../src/components/common/dropdown-menu/DropdownMenuLabel.vue" ; 
7+ import  DropdownMenuSeparator  from  "../../../src/components/common/dropdown-menu/DropdownMenuSeparator.vue" ; 
8+ import  Button  from  "../../../src/components/common/button/Button.vue" ; 
9+ 
10+ const  meta  =  { 
11+   title : "Components/Common" , 
12+   component : DropdownMenu , 
13+ }  satisfies  Meta < typeof  DropdownMenu > ; 
14+ 
15+ export  default  meta ; 
16+ 
17+ type  Story  =  StoryObj < typeof  meta > ; 
18+ 
19+ export  const  Dropdown : Story  =  { 
20+   render : ( )  =>  ( { 
21+     components : { 
22+       DropdownMenu, 
23+       DropdownMenuTrigger, 
24+       DropdownMenuContent, 
25+       DropdownMenuItem, 
26+       DropdownMenuLabel, 
27+       DropdownMenuSeparator, 
28+       Button, 
29+     } , 
30+     template : ` 
31+       <DropdownMenu> 
32+         <DropdownMenuTrigger> 
33+           <Button variant="secondary">Open Menu</Button> 
34+         </DropdownMenuTrigger> 
35+         <DropdownMenuContent> 
36+           <DropdownMenuLabel>My Account</DropdownMenuLabel> 
37+           <DropdownMenuSeparator /> 
38+           <DropdownMenuItem>Profile</DropdownMenuItem> 
39+           <DropdownMenuItem>Settings</DropdownMenuItem> 
40+           <DropdownMenuItem>Logout</DropdownMenuItem> 
41+         </DropdownMenuContent> 
42+       </DropdownMenu> 
43+     ` , 
44+   } ) , 
45+ } ;  
 
 
   
 
     
   
   
          
    
    
     
    
      
     
     
    You can’t perform that action at this time.
  
 
    
  
    
      
        
     
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments