From 6757908fe1580d05ddd2f9741c9f95042c2370e4 Mon Sep 17 00:00:00 2001 From: Eduard Predescu Date: Mon, 22 Jul 2024 08:13:10 +0300 Subject: [PATCH] feat(Stepper): implement stepper (#669) --- .editorconfig | 12 ++++ apps/www/.vitepress/theme/config/docs.ts | 5 ++ apps/www/__registry__/index.ts | 14 +++++ .../src/content/docs/components/stepper.md | 50 +++++++++++++++++ .../registry/default/example/StepperDemo.vue | 55 +++++++++++++++++++ .../registry/default/ui/stepper/Stepper.vue | 30 ++++++++++ .../default/ui/stepper/StepperDescription.vue | 23 ++++++++ .../default/ui/stepper/StepperIndicator.vue | 35 ++++++++++++ .../default/ui/stepper/StepperItem.vue | 26 +++++++++ .../default/ui/stepper/StepperSeparator.vue | 31 +++++++++++ .../default/ui/stepper/StepperTitle.vue | 23 ++++++++ .../default/ui/stepper/StepperTrigger.vue | 26 +++++++++ .../lib/registry/default/ui/stepper/index.ts | 7 +++ .../registry/new-york/example/StepperDemo.vue | 55 +++++++++++++++++++ .../registry/new-york/ui/stepper/Stepper.vue | 30 ++++++++++ .../ui/stepper/StepperDescription.vue | 23 ++++++++ .../new-york/ui/stepper/StepperIndicator.vue | 35 ++++++++++++ .../new-york/ui/stepper/StepperItem.vue | 26 +++++++++ .../new-york/ui/stepper/StepperSeparator.vue | 31 +++++++++++ .../new-york/ui/stepper/StepperTitle.vue | 23 ++++++++ .../new-york/ui/stepper/StepperTrigger.vue | 26 +++++++++ .../lib/registry/new-york/ui/stepper/index.ts | 7 +++ apps/www/src/public/registry/index.json | 18 ++++++ .../registry/styles/default/stepper.json | 42 ++++++++++++++ .../registry/styles/new-york/stepper.json | 42 ++++++++++++++ 25 files changed, 695 insertions(+) create mode 100644 .editorconfig create mode 100644 apps/www/src/content/docs/components/stepper.md create mode 100644 apps/www/src/lib/registry/default/example/StepperDemo.vue create mode 100644 apps/www/src/lib/registry/default/ui/stepper/Stepper.vue create mode 100644 apps/www/src/lib/registry/default/ui/stepper/StepperDescription.vue create mode 100644 apps/www/src/lib/registry/default/ui/stepper/StepperIndicator.vue create mode 100644 apps/www/src/lib/registry/default/ui/stepper/StepperItem.vue create mode 100644 apps/www/src/lib/registry/default/ui/stepper/StepperSeparator.vue create mode 100644 apps/www/src/lib/registry/default/ui/stepper/StepperTitle.vue create mode 100644 apps/www/src/lib/registry/default/ui/stepper/StepperTrigger.vue create mode 100644 apps/www/src/lib/registry/default/ui/stepper/index.ts create mode 100644 apps/www/src/lib/registry/new-york/example/StepperDemo.vue create mode 100644 apps/www/src/lib/registry/new-york/ui/stepper/Stepper.vue create mode 100644 apps/www/src/lib/registry/new-york/ui/stepper/StepperDescription.vue create mode 100644 apps/www/src/lib/registry/new-york/ui/stepper/StepperIndicator.vue create mode 100644 apps/www/src/lib/registry/new-york/ui/stepper/StepperItem.vue create mode 100644 apps/www/src/lib/registry/new-york/ui/stepper/StepperSeparator.vue create mode 100644 apps/www/src/lib/registry/new-york/ui/stepper/StepperTitle.vue create mode 100644 apps/www/src/lib/registry/new-york/ui/stepper/StepperTrigger.vue create mode 100644 apps/www/src/lib/registry/new-york/ui/stepper/index.ts create mode 100644 apps/www/src/public/registry/styles/default/stepper.json create mode 100644 apps/www/src/public/registry/styles/new-york/stepper.json diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 00000000..64d3d6a0 --- /dev/null +++ b/.editorconfig @@ -0,0 +1,12 @@ +# EditorConfig is awesome: https://EditorConfig.org + +# top-most EditorConfig file +root = true + +[*] +indent_style = space +indent_size = 2 +end_of_line = lf +charset = utf-8 +trim_trailing_whitespace = true +insert_final_newline = true \ No newline at end of file diff --git a/apps/www/.vitepress/theme/config/docs.ts b/apps/www/.vitepress/theme/config/docs.ts index 698dcc4b..b18a57d6 100644 --- a/apps/www/.vitepress/theme/config/docs.ts +++ b/apps/www/.vitepress/theme/config/docs.ts @@ -321,6 +321,11 @@ export const docsConfig: DocsConfig = { href: '/docs/components/sonner', items: [], }, + { + title: 'Stepper', + href: '/docs/components/stepper', + label: 'New', + }, { title: 'Switch', href: '/docs/components/switch', diff --git a/apps/www/__registry__/index.ts b/apps/www/__registry__/index.ts index 3475d2ce..41a34aa4 100644 --- a/apps/www/__registry__/index.ts +++ b/apps/www/__registry__/index.ts @@ -990,6 +990,13 @@ export const Index = { component: () => import("../src/lib/registry/default/example/SonnerWithDialog.vue").then((m) => m.default), files: ["../src/lib/registry/default/example/SonnerWithDialog.vue"], }, + "StepperDemo": { + name: "StepperDemo", + type: "components:example", + registryDependencies: ["stepper"], + component: () => import("../src/lib/registry/default/example/StepperDemo.vue").then((m) => m.default), + files: ["../src/lib/registry/default/example/StepperDemo.vue"], + }, "SwitchDemo": { name: "SwitchDemo", type: "components:example", @@ -2433,6 +2440,13 @@ export const Index = { component: () => import("../src/lib/registry/new-york/example/SonnerWithDialog.vue").then((m) => m.default), files: ["../src/lib/registry/new-york/example/SonnerWithDialog.vue"], }, + "StepperDemo": { + name: "StepperDemo", + type: "components:example", + registryDependencies: ["stepper"], + component: () => import("../src/lib/registry/new-york/example/StepperDemo.vue").then((m) => m.default), + files: ["../src/lib/registry/new-york/example/StepperDemo.vue"], + }, "SwitchDemo": { name: "SwitchDemo", type: "components:example", diff --git a/apps/www/src/content/docs/components/stepper.md b/apps/www/src/content/docs/components/stepper.md new file mode 100644 index 00000000..e0c75a8b --- /dev/null +++ b/apps/www/src/content/docs/components/stepper.md @@ -0,0 +1,50 @@ +--- +title: Stepper +description: A set of steps that are used to indicate progress through a multi-step process. +source: apps/www/src/lib/registry/default/ui/stepper +primitive: https://www.radix-vue.com/components/stepper.html +--- + + + +## Installation + +```bash +npx shadcn-vue@latest add stepper +``` + +## Usage + +```vue + + + +``` diff --git a/apps/www/src/lib/registry/default/example/StepperDemo.vue b/apps/www/src/lib/registry/default/example/StepperDemo.vue new file mode 100644 index 00000000..fcfb2116 --- /dev/null +++ b/apps/www/src/lib/registry/default/example/StepperDemo.vue @@ -0,0 +1,55 @@ + + + diff --git a/apps/www/src/lib/registry/default/ui/stepper/Stepper.vue b/apps/www/src/lib/registry/default/ui/stepper/Stepper.vue new file mode 100644 index 00000000..6287623a --- /dev/null +++ b/apps/www/src/lib/registry/default/ui/stepper/Stepper.vue @@ -0,0 +1,30 @@ + + + diff --git a/apps/www/src/lib/registry/default/ui/stepper/StepperDescription.vue b/apps/www/src/lib/registry/default/ui/stepper/StepperDescription.vue new file mode 100644 index 00000000..af9133eb --- /dev/null +++ b/apps/www/src/lib/registry/default/ui/stepper/StepperDescription.vue @@ -0,0 +1,23 @@ + + + diff --git a/apps/www/src/lib/registry/default/ui/stepper/StepperIndicator.vue b/apps/www/src/lib/registry/default/ui/stepper/StepperIndicator.vue new file mode 100644 index 00000000..d7ca7e5f --- /dev/null +++ b/apps/www/src/lib/registry/default/ui/stepper/StepperIndicator.vue @@ -0,0 +1,35 @@ + + + diff --git a/apps/www/src/lib/registry/default/ui/stepper/StepperItem.vue b/apps/www/src/lib/registry/default/ui/stepper/StepperItem.vue new file mode 100644 index 00000000..aebdb294 --- /dev/null +++ b/apps/www/src/lib/registry/default/ui/stepper/StepperItem.vue @@ -0,0 +1,26 @@ + + + diff --git a/apps/www/src/lib/registry/default/ui/stepper/StepperSeparator.vue b/apps/www/src/lib/registry/default/ui/stepper/StepperSeparator.vue new file mode 100644 index 00000000..6246b026 --- /dev/null +++ b/apps/www/src/lib/registry/default/ui/stepper/StepperSeparator.vue @@ -0,0 +1,31 @@ + + + diff --git a/apps/www/src/lib/registry/default/ui/stepper/StepperTitle.vue b/apps/www/src/lib/registry/default/ui/stepper/StepperTitle.vue new file mode 100644 index 00000000..5ba5f7e1 --- /dev/null +++ b/apps/www/src/lib/registry/default/ui/stepper/StepperTitle.vue @@ -0,0 +1,23 @@ + + + diff --git a/apps/www/src/lib/registry/default/ui/stepper/StepperTrigger.vue b/apps/www/src/lib/registry/default/ui/stepper/StepperTrigger.vue new file mode 100644 index 00000000..46f920b5 --- /dev/null +++ b/apps/www/src/lib/registry/default/ui/stepper/StepperTrigger.vue @@ -0,0 +1,26 @@ + + + diff --git a/apps/www/src/lib/registry/default/ui/stepper/index.ts b/apps/www/src/lib/registry/default/ui/stepper/index.ts new file mode 100644 index 00000000..6bb2d607 --- /dev/null +++ b/apps/www/src/lib/registry/default/ui/stepper/index.ts @@ -0,0 +1,7 @@ +export { default as Stepper } from './Stepper.vue' +export { default as StepperItem } from './StepperItem.vue' +export { default as StepperIndicator } from './StepperIndicator.vue' +export { default as StepperTrigger } from './StepperTrigger.vue' +export { default as StepperTitle } from './StepperTitle.vue' +export { default as StepperDescription } from './StepperDescription.vue' +export { default as StepperSeparator } from './StepperSeparator.vue' diff --git a/apps/www/src/lib/registry/new-york/example/StepperDemo.vue b/apps/www/src/lib/registry/new-york/example/StepperDemo.vue new file mode 100644 index 00000000..32012a44 --- /dev/null +++ b/apps/www/src/lib/registry/new-york/example/StepperDemo.vue @@ -0,0 +1,55 @@ + + + diff --git a/apps/www/src/lib/registry/new-york/ui/stepper/Stepper.vue b/apps/www/src/lib/registry/new-york/ui/stepper/Stepper.vue new file mode 100644 index 00000000..fcd120e6 --- /dev/null +++ b/apps/www/src/lib/registry/new-york/ui/stepper/Stepper.vue @@ -0,0 +1,30 @@ + + + diff --git a/apps/www/src/lib/registry/new-york/ui/stepper/StepperDescription.vue b/apps/www/src/lib/registry/new-york/ui/stepper/StepperDescription.vue new file mode 100644 index 00000000..af9133eb --- /dev/null +++ b/apps/www/src/lib/registry/new-york/ui/stepper/StepperDescription.vue @@ -0,0 +1,23 @@ + + + diff --git a/apps/www/src/lib/registry/new-york/ui/stepper/StepperIndicator.vue b/apps/www/src/lib/registry/new-york/ui/stepper/StepperIndicator.vue new file mode 100644 index 00000000..b60ed6ed --- /dev/null +++ b/apps/www/src/lib/registry/new-york/ui/stepper/StepperIndicator.vue @@ -0,0 +1,35 @@ + + + diff --git a/apps/www/src/lib/registry/new-york/ui/stepper/StepperItem.vue b/apps/www/src/lib/registry/new-york/ui/stepper/StepperItem.vue new file mode 100644 index 00000000..b5a49c07 --- /dev/null +++ b/apps/www/src/lib/registry/new-york/ui/stepper/StepperItem.vue @@ -0,0 +1,26 @@ + + + diff --git a/apps/www/src/lib/registry/new-york/ui/stepper/StepperSeparator.vue b/apps/www/src/lib/registry/new-york/ui/stepper/StepperSeparator.vue new file mode 100644 index 00000000..8391ceae --- /dev/null +++ b/apps/www/src/lib/registry/new-york/ui/stepper/StepperSeparator.vue @@ -0,0 +1,31 @@ + + + diff --git a/apps/www/src/lib/registry/new-york/ui/stepper/StepperTitle.vue b/apps/www/src/lib/registry/new-york/ui/stepper/StepperTitle.vue new file mode 100644 index 00000000..5ba5f7e1 --- /dev/null +++ b/apps/www/src/lib/registry/new-york/ui/stepper/StepperTitle.vue @@ -0,0 +1,23 @@ + + + diff --git a/apps/www/src/lib/registry/new-york/ui/stepper/StepperTrigger.vue b/apps/www/src/lib/registry/new-york/ui/stepper/StepperTrigger.vue new file mode 100644 index 00000000..04b6a5b8 --- /dev/null +++ b/apps/www/src/lib/registry/new-york/ui/stepper/StepperTrigger.vue @@ -0,0 +1,26 @@ + + + diff --git a/apps/www/src/lib/registry/new-york/ui/stepper/index.ts b/apps/www/src/lib/registry/new-york/ui/stepper/index.ts new file mode 100644 index 00000000..6bb2d607 --- /dev/null +++ b/apps/www/src/lib/registry/new-york/ui/stepper/index.ts @@ -0,0 +1,7 @@ +export { default as Stepper } from './Stepper.vue' +export { default as StepperItem } from './StepperItem.vue' +export { default as StepperIndicator } from './StepperIndicator.vue' +export { default as StepperTrigger } from './StepperTrigger.vue' +export { default as StepperTitle } from './StepperTitle.vue' +export { default as StepperDescription } from './StepperDescription.vue' +export { default as StepperSeparator } from './StepperSeparator.vue' diff --git a/apps/www/src/public/registry/index.json b/apps/www/src/public/registry/index.json index 91874765..dea4cc2c 100644 --- a/apps/www/src/public/registry/index.json +++ b/apps/www/src/public/registry/index.json @@ -779,6 +779,24 @@ ], "type": "components:ui" }, + { + "name": "stepper", + "dependencies": [], + "registryDependencies": [ + "utils" + ], + "files": [ + "ui/stepper/Stepper.vue", + "ui/stepper/StepperDescription.vue", + "ui/stepper/StepperIndicator.vue", + "ui/stepper/StepperItem.vue", + "ui/stepper/StepperSeparator.vue", + "ui/stepper/StepperTitle.vue", + "ui/stepper/StepperTrigger.vue", + "ui/stepper/index.ts" + ], + "type": "components:ui" + }, { "name": "switch", "dependencies": [], diff --git a/apps/www/src/public/registry/styles/default/stepper.json b/apps/www/src/public/registry/styles/default/stepper.json new file mode 100644 index 00000000..890847a9 --- /dev/null +++ b/apps/www/src/public/registry/styles/default/stepper.json @@ -0,0 +1,42 @@ +{ + "name": "stepper", + "dependencies": [], + "registryDependencies": [ + "utils" + ], + "files": [ + { + "name": "Stepper.vue", + "content": "\n\n\n" + }, + { + "name": "StepperDescription.vue", + "content": "\n\n\n" + }, + { + "name": "StepperIndicator.vue", + "content": "\n\n\n" + }, + { + "name": "StepperItem.vue", + "content": "\n\n\n" + }, + { + "name": "StepperSeparator.vue", + "content": "\n\n\n" + }, + { + "name": "StepperTitle.vue", + "content": "\n\n\n" + }, + { + "name": "StepperTrigger.vue", + "content": "\n\n\n" + }, + { + "name": "index.ts", + "content": "export { default as Stepper } from './Stepper.vue'\nexport { default as StepperItem } from './StepperItem.vue'\nexport { default as StepperIndicator } from './StepperIndicator.vue'\nexport { default as StepperTrigger } from './StepperTrigger.vue'\nexport { default as StepperTitle } from './StepperTitle.vue'\nexport { default as StepperDescription } from './StepperDescription.vue'\nexport { default as StepperSeparator } from './StepperSeparator.vue'\n" + } + ], + "type": "components:ui" +} diff --git a/apps/www/src/public/registry/styles/new-york/stepper.json b/apps/www/src/public/registry/styles/new-york/stepper.json new file mode 100644 index 00000000..36468484 --- /dev/null +++ b/apps/www/src/public/registry/styles/new-york/stepper.json @@ -0,0 +1,42 @@ +{ + "name": "stepper", + "dependencies": [], + "registryDependencies": [ + "utils" + ], + "files": [ + { + "name": "Stepper.vue", + "content": "\n\n\n" + }, + { + "name": "StepperDescription.vue", + "content": "\n\n\n" + }, + { + "name": "StepperIndicator.vue", + "content": "\n\n\n" + }, + { + "name": "StepperItem.vue", + "content": "\n\n\n" + }, + { + "name": "StepperSeparator.vue", + "content": "\n\n\n" + }, + { + "name": "StepperTitle.vue", + "content": "\n\n\n" + }, + { + "name": "StepperTrigger.vue", + "content": "\n\n\n" + }, + { + "name": "index.ts", + "content": "export { default as Stepper } from './Stepper.vue'\nexport { default as StepperItem } from './StepperItem.vue'\nexport { default as StepperIndicator } from './StepperIndicator.vue'\nexport { default as StepperTrigger } from './StepperTrigger.vue'\nexport { default as StepperTitle } from './StepperTitle.vue'\nexport { default as StepperDescription } from './StepperDescription.vue'\nexport { default as StepperSeparator } from './StepperSeparator.vue'\n" + } + ], + "type": "components:ui" +}