From 6ab704a6fb0bbab93d092c9faa52b04e5a523b15 Mon Sep 17 00:00:00 2001 From: Sadegh Barati Date: Tue, 6 Feb 2024 05:36:59 +0330 Subject: [PATCH] feat: pin input (#325) * feat: pin input * chore: build registry * chore: build registry, add form example * chore: update demo abit --------- Co-authored-by: zernonia --- apps/www/.vitepress/theme/config/docs.ts | 6 ++ apps/www/__registry__/index.ts | 28 +++++++ .../src/content/docs/components/pin-input.md | 21 +++++ .../registry/default/example/PinInputDemo.vue | 28 +++++++ .../default/example/PinInputFormDemo.vue | 78 +++++++++++++++++++ .../default/ui/pin-input/PinInput.vue | 21 +++++ .../default/ui/pin-input/PinInputInput.vue | 18 +++++ .../registry/default/ui/pin-input/index.ts | 2 + .../new-york/example/PinInputDemo.vue | 28 +++++++ .../new-york/example/PinInputFormDemo.vue | 78 +++++++++++++++++++ .../new-york/ui/pin-input/PinInput.vue | 21 +++++ .../new-york/ui/pin-input/PinInputInput.vue | 18 +++++ .../registry/new-york/ui/pin-input/index.ts | 2 + apps/www/src/public/registry/index.json | 13 ++++ .../registry/styles/default/pin-input.json | 22 ++++++ .../registry/styles/new-york/pin-input.json | 22 ++++++ 16 files changed, 406 insertions(+) create mode 100644 apps/www/src/content/docs/components/pin-input.md create mode 100644 apps/www/src/lib/registry/default/example/PinInputDemo.vue create mode 100644 apps/www/src/lib/registry/default/example/PinInputFormDemo.vue create mode 100644 apps/www/src/lib/registry/default/ui/pin-input/PinInput.vue create mode 100644 apps/www/src/lib/registry/default/ui/pin-input/PinInputInput.vue create mode 100644 apps/www/src/lib/registry/default/ui/pin-input/index.ts create mode 100644 apps/www/src/lib/registry/new-york/example/PinInputDemo.vue create mode 100644 apps/www/src/lib/registry/new-york/example/PinInputFormDemo.vue create mode 100644 apps/www/src/lib/registry/new-york/ui/pin-input/PinInput.vue create mode 100644 apps/www/src/lib/registry/new-york/ui/pin-input/PinInputInput.vue create mode 100644 apps/www/src/lib/registry/new-york/ui/pin-input/index.ts create mode 100644 apps/www/src/public/registry/styles/default/pin-input.json create mode 100644 apps/www/src/public/registry/styles/new-york/pin-input.json diff --git a/apps/www/.vitepress/theme/config/docs.ts b/apps/www/.vitepress/theme/config/docs.ts index 4f69dc39..7432c50a 100644 --- a/apps/www/.vitepress/theme/config/docs.ts +++ b/apps/www/.vitepress/theme/config/docs.ts @@ -254,6 +254,12 @@ export const docsConfig: DocsConfig = { href: '/docs/components/pagination', items: [], }, + { + title: 'Pin Input', + href: '/docs/components/pin-input', + label: 'New', + items: [], + }, { title: 'Popover', href: '/docs/components/popover', diff --git a/apps/www/__registry__/index.ts b/apps/www/__registry__/index.ts index c8ca92f4..3bee58c3 100644 --- a/apps/www/__registry__/index.ts +++ b/apps/www/__registry__/index.ts @@ -485,6 +485,20 @@ export const Index = { component: () => import('../src/lib/registry/default/example/PaginationDemo.vue').then(m => m.default), files: ['../src/lib/registry/default/example/PaginationDemo.vue'], }, + PinInputDemo: { + name: 'PinInputDemo', + type: 'components:example', + registryDependencies: ['pin-input'], + component: () => import('../src/lib/registry/default/example/PinInputDemo.vue').then(m => m.default), + files: ['../src/lib/registry/default/example/PinInputDemo.vue'], + }, + PinInputFormDemo: { + name: 'PinInputFormDemo', + type: 'components:example', + registryDependencies: ['pin-input', 'button', 'form', 'toast'], + component: () => import('../src/lib/registry/default/example/PinInputFormDemo.vue').then(m => m.default), + files: ['../src/lib/registry/default/example/PinInputFormDemo.vue'], + }, PopoverDemo: { name: 'PopoverDemo', type: 'components:example', @@ -1390,6 +1404,20 @@ export const Index = { component: () => import('../src/lib/registry/new-york/example/PaginationDemo.vue').then(m => m.default), files: ['../src/lib/registry/new-york/example/PaginationDemo.vue'], }, + PinInputDemo: { + name: 'PinInputDemo', + type: 'components:example', + registryDependencies: ['pin-input'], + component: () => import('../src/lib/registry/new-york/example/PinInputDemo.vue').then(m => m.default), + files: ['../src/lib/registry/new-york/example/PinInputDemo.vue'], + }, + PinInputFormDemo: { + name: 'PinInputFormDemo', + type: 'components:example', + registryDependencies: ['pin-input', 'button', 'form', 'toast'], + component: () => import('../src/lib/registry/new-york/example/PinInputFormDemo.vue').then(m => m.default), + files: ['../src/lib/registry/new-york/example/PinInputFormDemo.vue'], + }, PopoverDemo: { name: 'PopoverDemo', type: 'components:example', diff --git a/apps/www/src/content/docs/components/pin-input.md b/apps/www/src/content/docs/components/pin-input.md new file mode 100644 index 00000000..207e11c4 --- /dev/null +++ b/apps/www/src/content/docs/components/pin-input.md @@ -0,0 +1,21 @@ +--- +title: PIN Input +description: Allows users to input a sequence of one-character alphanumeric inputs. +source: apps/www/src/lib/registry/default/ui/pin-input +primitive: https://www.radix-vue.com/components/pin-input.html +--- + + + + +## Installation + +```bash +npx shadcn-vue@latest add pin-input +``` + +## Usage + +### Form + + diff --git a/apps/www/src/lib/registry/default/example/PinInputDemo.vue b/apps/www/src/lib/registry/default/example/PinInputDemo.vue new file mode 100644 index 00000000..fb5d5c93 --- /dev/null +++ b/apps/www/src/lib/registry/default/example/PinInputDemo.vue @@ -0,0 +1,28 @@ + + + diff --git a/apps/www/src/lib/registry/default/example/PinInputFormDemo.vue b/apps/www/src/lib/registry/default/example/PinInputFormDemo.vue new file mode 100644 index 00000000..0f909a95 --- /dev/null +++ b/apps/www/src/lib/registry/default/example/PinInputFormDemo.vue @@ -0,0 +1,78 @@ + + + diff --git a/apps/www/src/lib/registry/default/ui/pin-input/PinInput.vue b/apps/www/src/lib/registry/default/ui/pin-input/PinInput.vue new file mode 100644 index 00000000..9a5edb97 --- /dev/null +++ b/apps/www/src/lib/registry/default/ui/pin-input/PinInput.vue @@ -0,0 +1,21 @@ + + + diff --git a/apps/www/src/lib/registry/default/ui/pin-input/PinInputInput.vue b/apps/www/src/lib/registry/default/ui/pin-input/PinInputInput.vue new file mode 100644 index 00000000..47eaccbe --- /dev/null +++ b/apps/www/src/lib/registry/default/ui/pin-input/PinInputInput.vue @@ -0,0 +1,18 @@ + + + diff --git a/apps/www/src/lib/registry/default/ui/pin-input/index.ts b/apps/www/src/lib/registry/default/ui/pin-input/index.ts new file mode 100644 index 00000000..ee290cc8 --- /dev/null +++ b/apps/www/src/lib/registry/default/ui/pin-input/index.ts @@ -0,0 +1,2 @@ +export { default as PinInput } from './PinInput.vue' +export { default as PinInputInput } from './PinInputInput.vue' diff --git a/apps/www/src/lib/registry/new-york/example/PinInputDemo.vue b/apps/www/src/lib/registry/new-york/example/PinInputDemo.vue new file mode 100644 index 00000000..0d8bacf2 --- /dev/null +++ b/apps/www/src/lib/registry/new-york/example/PinInputDemo.vue @@ -0,0 +1,28 @@ + + + diff --git a/apps/www/src/lib/registry/new-york/example/PinInputFormDemo.vue b/apps/www/src/lib/registry/new-york/example/PinInputFormDemo.vue new file mode 100644 index 00000000..50b3345b --- /dev/null +++ b/apps/www/src/lib/registry/new-york/example/PinInputFormDemo.vue @@ -0,0 +1,78 @@ + + + diff --git a/apps/www/src/lib/registry/new-york/ui/pin-input/PinInput.vue b/apps/www/src/lib/registry/new-york/ui/pin-input/PinInput.vue new file mode 100644 index 00000000..9a5edb97 --- /dev/null +++ b/apps/www/src/lib/registry/new-york/ui/pin-input/PinInput.vue @@ -0,0 +1,21 @@ + + + diff --git a/apps/www/src/lib/registry/new-york/ui/pin-input/PinInputInput.vue b/apps/www/src/lib/registry/new-york/ui/pin-input/PinInputInput.vue new file mode 100644 index 00000000..47eaccbe --- /dev/null +++ b/apps/www/src/lib/registry/new-york/ui/pin-input/PinInputInput.vue @@ -0,0 +1,18 @@ + + + diff --git a/apps/www/src/lib/registry/new-york/ui/pin-input/index.ts b/apps/www/src/lib/registry/new-york/ui/pin-input/index.ts new file mode 100644 index 00000000..ee290cc8 --- /dev/null +++ b/apps/www/src/lib/registry/new-york/ui/pin-input/index.ts @@ -0,0 +1,2 @@ +export { default as PinInput } from './PinInput.vue' +export { default as PinInputInput } from './PinInputInput.vue' diff --git a/apps/www/src/public/registry/index.json b/apps/www/src/public/registry/index.json index 9589b3b6..de3369a8 100644 --- a/apps/www/src/public/registry/index.json +++ b/apps/www/src/public/registry/index.json @@ -392,6 +392,19 @@ ], "type": "components:ui" }, + { + "name": "pin-input", + "dependencies": [], + "registryDependencies": [ + "utils" + ], + "files": [ + "ui/pin-input/PinInput.vue", + "ui/pin-input/PinInputInput.vue", + "ui/pin-input/index.ts" + ], + "type": "components:ui" + }, { "name": "popover", "dependencies": [], diff --git a/apps/www/src/public/registry/styles/default/pin-input.json b/apps/www/src/public/registry/styles/default/pin-input.json new file mode 100644 index 00000000..ee35d2bf --- /dev/null +++ b/apps/www/src/public/registry/styles/default/pin-input.json @@ -0,0 +1,22 @@ +{ + "name": "pin-input", + "dependencies": [], + "registryDependencies": [ + "utils" + ], + "files": [ + { + "name": "PinInput.vue", + "content": "\n\n\n" + }, + { + "name": "PinInputInput.vue", + "content": "\n\n\n" + }, + { + "name": "index.ts", + "content": "export { default as PinInput } from './PinInput.vue'\nexport { default as PinInputInput } from './PinInputInput.vue'\n" + } + ], + "type": "components:ui" +} \ No newline at end of file diff --git a/apps/www/src/public/registry/styles/new-york/pin-input.json b/apps/www/src/public/registry/styles/new-york/pin-input.json new file mode 100644 index 00000000..ee35d2bf --- /dev/null +++ b/apps/www/src/public/registry/styles/new-york/pin-input.json @@ -0,0 +1,22 @@ +{ + "name": "pin-input", + "dependencies": [], + "registryDependencies": [ + "utils" + ], + "files": [ + { + "name": "PinInput.vue", + "content": "\n\n\n" + }, + { + "name": "PinInputInput.vue", + "content": "\n\n\n" + }, + { + "name": "index.ts", + "content": "export { default as PinInput } from './PinInput.vue'\nexport { default as PinInputInput } from './PinInputInput.vue'\n" + } + ], + "type": "components:ui" +} \ No newline at end of file