Skip to content

Commit

Permalink
Merge pull request #30 from selemondev/feat/components
Browse files Browse the repository at this point in the history
feat: add new components' snippets
  • Loading branch information
selemondev authored Mar 9, 2024
2 parents bb8577b + 0bdefc7 commit f70bc94
Show file tree
Hide file tree
Showing 2 changed files with 125 additions and 1 deletion.
51 changes: 51 additions & 0 deletions src/snippets/imports.code-snippets
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,24 @@
],
"description": "https://shadcn-vue.com/docs/components/dialog.html"
},

"Drawer": {
"prefix": ["shadcn-i-drawer", "cni-drawer"],
"body": [
"import {",
" Drawer,",
" DrawerClose,",
" DrawerContent,",
" DrawerDescription,",
" DrawerFooter,",
" DrawerHeader,",
" DrawerTitle,",
" DrawerTrigger,",
"} from '@/components/ui/drawer'"
],
"description": "https://shadcn-vue.com/docs/components/drawer.html"
},


"Dropdown Menu": {
"prefix": ["shadcn-i-dropdown-menu", "cni-dropdown-menu"],
Expand Down Expand Up @@ -259,6 +277,18 @@
],
"description": "https://shadcn-vue.com/docs/components/pagination.html"
},

"Pin Input": {
"prefix": ["shadcn-i-pin-input", "cni-i-input"],
"body": [
"import {",
" PinInput,",
" PinInputInput,",
"} from '@/components/ui/pin-input'"
""
],
"description": "https://shadcn-vue.com/docs/components/pin-input.html"
},

"Popover": {
"prefix": ["shadcn-i-popover", "cni-popover"],
Expand Down Expand Up @@ -288,6 +318,18 @@
],
"description": "https://shadcn-vue.com/docs/components/radio-group.html"
},

"Resizable": {
"prefix": ["shadcn-i-resizable", "cni-resizable"],
"body": [
"import {",
" ResizableHandle,",
" ResizablePanel,",
" ResizablePanelGroup,",
"} from '@/components/ui/resizable'"
],
"description": "https://shadcn-vue.com/docs/components/resizable.html"
},

"Scroll Area": {
"prefix": ["shadcn-i-scroll-area", "cni-scroll-area"],
Expand Down Expand Up @@ -383,6 +425,15 @@
],
"description": "https://shadcn-vue.com/docs/components/tabs.html"
},

"Tags Input": {
"prefix": ["shadcn-i-tags-input", "cni-tags-input"],
"body": [
"import { TagsInput, TagsInputInput, TagsInputItem, TagsInputItemDelete, TagsInputItemText } from '@/components/ui/tags-input'"
""
],
"description": "https://shadcn-vue.com/docs/components/tags-input.html"
},

"Textarea": {
"prefix": ["shadcn-i-textarea", "cni-textarea"],
Expand Down
75 changes: 74 additions & 1 deletion src/snippets/usage.code-snippets
Original file line number Diff line number Diff line change
Expand Up @@ -294,6 +294,30 @@
],
"description": "https://shadcn-vue.com/docs/components/dialog.html"
},

"Drawer": {
"prefix": ["shadcn-x-drawer", "cnx-drawer"],
"body": [
" <Drawer>",
" <DrawerTrigger>Open</DrawerTrigger>",
" <DrawerContent>",
" <DrawerHeader>",
" <DrawerTitle>Are you absolutely sure?</DrawerTitle>",
" <DrawerDescription>This action cannot be undone.</DrawerDescription>",
" </DrawerHeader>",
" <DrawerFooter>",
" <Button>Submit</Button>",
" <DrawerClose>",
" <Button variant=\"outline\">",
" Cancel",
" </Button>",
" </DrawerClose>",
" </DrawerFooter>",
" </DrawerContent>",
" </Drawer>"
],
"description": "https://shadcn-vue.com/docs/components/drawer.html"
},

"Dropdown Menu": {
"prefix": ["shadcn-x-dropdown-menu", "cnx-dropdown-menu"],
Expand Down Expand Up @@ -405,6 +429,26 @@
],
"description": "https://shadcn-vue.com/docs/components/pagination.html"
},

"Pin Input": {
"prefix": ["shadcn-x-pin-input", "cnx-pin-input"],
"body": [
" <PinInput",
" id=\"pin-input\"",
" placeholder=\"○\"",
" class=\"flex gap-2 items-center mt-1\"",
" otp",
" type=\"number\"",
" >",
" <PinInputInput",
" v-for=\"(id, index) in 5\"",
" :key=\"id\"",
" :index=\"index\"",
" />",
" </PinInput>"
],
"description": "https://shadcn-vue.com/docs/components/pin-input.html"
},

"Popover": {
"prefix": ["shadcn-x-popover", "cnx-popover"],
Expand All @@ -425,7 +469,7 @@
},

"Radio Group": {
"prefix": "shadcn-x-radio-group",
"prefix": ["shadcn-x-radio-group", "cnx-radio-group"],
"body": [
" <RadioGroup default-value=\"comfortable\">",
" <div class=\"flex items-center space-x-2\">",
Expand All @@ -444,6 +488,19 @@
],
"description": "https://shadcn-vue.com/docs/components/radio-group.html"
},


"Resizable": {
"prefix": ["shadcn-x-resizable", "cnx-resizable"],
"body": [
" <ResizablePanelGroup direction=\"horizontal\">",
" <ResizablePanel>One</ResizablePanel>",
" <ResizableHandle />",
" <ResizablePanel>Two</ResizablePanel>",
" </ResizablePanelGroup>"
],
"description": "https://shadcn-vue.com/docs/components/resizable.html"
},

"Scroll Area": {
"prefix": ["shadcn-x-scroll-area", "cnx-scroll-area"],
Expand Down Expand Up @@ -603,6 +660,22 @@
],
"description": "https://shadcn-vue.com/docs/components/tabs.html"
},

"Tags Input": {
"prefix": ["shadcn-x-tags-input", "cnx-tags-input"],
"body": [
" <TagsInput v-model=\"\">",
" <TagsInputItem v-for=\"item in modelValue\" :key=\"item\" :value=\"item\">",
" <TagsInputItemText />",
" <TagsInputItemDelete />",
" </TagsInputItem>",
"",
" <TagsInputInput placeholder=\"Fruits...\" />",
" </TagsInput>"
""
],
"description": "https://shadcn-vue.com/docs/components/tags-input.html"
},

"Textarea": {
"prefix": ["shadcn-x-textarea", "cnx-textarea"],
Expand Down

0 comments on commit f70bc94

Please sign in to comment.