From 3f45f99b04302bf9de1e7460ca8840735e382397 Mon Sep 17 00:00:00 2001 From: Arghya Das Date: Fri, 20 Dec 2024 19:46:46 +0530 Subject: [PATCH] feat: adding the android mockup --- __registry__/index.tsx | 52 ++++++++++ config/docs.ts | 6 ++ content/docs/components/android.mdx | 60 ++++++++++++ public/r/index.json | 10 ++ public/r/styles/default/android.json | 12 +++ registry/default/example/android-demo-2.tsx | 12 +++ registry/default/example/android-demo-3.tsx | 12 +++ registry/default/example/android-demo.tsx | 9 ++ registry/default/magicui/android.tsx | 102 ++++++++++++++++++++ registry/registry-examples.ts | 18 ++++ registry/registry-ui.ts | 5 + 11 files changed, 298 insertions(+) create mode 100644 content/docs/components/android.mdx create mode 100644 public/r/styles/default/android.json create mode 100644 registry/default/example/android-demo-2.tsx create mode 100644 registry/default/example/android-demo-3.tsx create mode 100644 registry/default/example/android-demo.tsx create mode 100644 registry/default/magicui/android.tsx diff --git a/__registry__/index.tsx b/__registry__/index.tsx index 2678aabd1..361feaf35 100644 --- a/__registry__/index.tsx +++ b/__registry__/index.tsx @@ -18,6 +18,19 @@ export const Index: Record = { subcategory: "undefined", chunks: [], }, + android: { + name: "android", + type: "registry:ui", + registryDependencies: undefined, + files: ["registry/default/magicui/android.tsx"], + component: React.lazy( + () => import("@/registry/default/magicui/android.tsx"), + ), + source: "", + category: "undefined", + subcategory: "undefined", + chunks: [], + }, "morphing-text": { name: "morphing-text", type: "registry:ui", @@ -789,6 +802,45 @@ export const Index: Record = { subcategory: "undefined", chunks: [], }, + "android-demo": { + name: "android-demo", + type: "registry:example", + registryDependencies: ["android"], + files: ["registry/default/example/android-demo.tsx"], + component: React.lazy( + () => import("@/registry/default/example/android-demo.tsx"), + ), + source: "", + category: "undefined", + subcategory: "undefined", + chunks: [], + }, + "android-demo-2": { + name: "android-demo-2", + type: "registry:example", + registryDependencies: ["android"], + files: ["registry/default/example/android-demo-2.tsx"], + component: React.lazy( + () => import("@/registry/default/example/android-demo-2.tsx"), + ), + source: "", + category: "undefined", + subcategory: "undefined", + chunks: [], + }, + "android-demo-3": { + name: "android-demo-3", + type: "registry:example", + registryDependencies: ["android"], + files: ["registry/default/example/android-demo-3.tsx"], + component: React.lazy( + () => import("@/registry/default/example/android-demo-3.tsx"), + ), + source: "", + category: "undefined", + subcategory: "undefined", + chunks: [], + }, "morphing-text-demo": { name: "morphing-text-demo", type: "registry:example", diff --git a/config/docs.ts b/config/docs.ts index a67bb4f83..3aef71bfc 100644 --- a/config/docs.ts +++ b/config/docs.ts @@ -224,6 +224,12 @@ export const docsConfig: DocsConfig = { items: [], label: "", }, + { + title: "Android", + href: `/docs/components/android`, + items: [], + label: "", + }, ], }, { diff --git a/content/docs/components/android.mdx b/content/docs/components/android.mdx new file mode 100644 index 000000000..825e037d1 --- /dev/null +++ b/content/docs/components/android.mdx @@ -0,0 +1,60 @@ +--- +title: Android +date: 2024-12-20 +description: A mockup of the Android +author: dillionverma +published: true +--- + + + +## Installation + + + + + CLI + Manual + + + +```bash +npx shadcn@latest add "https://magicui.design/r/android" +``` + + + + + + + +Copy and paste the following code into your project. + + + + + + + + + +## Examples + +### With Image + + + +### With Video + + + +## Props + +| Prop | Type | Description | Default | +| -------- | ------ | ---------------------------------- | ------- | +| width | number | The width of the Android window | 433 | +| height | number | The height of the Android window | 882 | +| src | string | The source of the image to display | | +| videoSrc | string | The source of the video to display | | + +The `Android` component also accepts all properties of the `SVGElement` type. diff --git a/public/r/index.json b/public/r/index.json index ad4ee21a7..832eb7455 100644 --- a/public/r/index.json +++ b/public/r/index.json @@ -12,6 +12,16 @@ } ] }, + { + "name": "android", + "type": "registry:ui", + "files": [ + { + "path": "magicui/android.tsx", + "type": "registry:ui" + } + ] + }, { "name": "morphing-text", "type": "registry:ui", diff --git a/public/r/styles/default/android.json b/public/r/styles/default/android.json new file mode 100644 index 000000000..43e4d9c23 --- /dev/null +++ b/public/r/styles/default/android.json @@ -0,0 +1,12 @@ +{ + "name": "android", + "type": "registry:ui", + "files": [ + { + "path": "magicui/android.tsx", + "content": "import { SVGProps } from \"react\";\n\nexport interface AndroidProps extends SVGProps {\n width?: number;\n height?: number;\n src?: string;\n videoSrc?: string;\n}\n\nexport default function Android({\n width = 433,\n height = 882,\n src,\n videoSrc,\n ...props\n}: AndroidProps) {\n return (\n \n \n \n \n \n\n \n \n \n \n \n {src && (\n \n )}\n {videoSrc && (\n \n \n \n )}\n \n \n \n \n \n \n );\n}\n", + "type": "registry:ui", + "target": "" + } + ] +} \ No newline at end of file diff --git a/registry/default/example/android-demo-2.tsx b/registry/default/example/android-demo-2.tsx new file mode 100644 index 000000000..609ae2f4c --- /dev/null +++ b/registry/default/example/android-demo-2.tsx @@ -0,0 +1,12 @@ +import Android from "@/registry/default/magicui/android"; + +export default function AndroidDemo() { + return ( +
+ +
+ ); +} diff --git a/registry/default/example/android-demo-3.tsx b/registry/default/example/android-demo-3.tsx new file mode 100644 index 000000000..d37922d20 --- /dev/null +++ b/registry/default/example/android-demo-3.tsx @@ -0,0 +1,12 @@ +import Android from "@/registry/default/magicui/android"; + +export default function AndroidDemo() { + return ( +
+ +
+ ); +} diff --git a/registry/default/example/android-demo.tsx b/registry/default/example/android-demo.tsx new file mode 100644 index 000000000..c211df940 --- /dev/null +++ b/registry/default/example/android-demo.tsx @@ -0,0 +1,9 @@ +import Android from "@/registry/default/magicui/android"; + +export default function AndroidDemo() { + return ( +
+ +
+ ); +} diff --git a/registry/default/magicui/android.tsx b/registry/default/magicui/android.tsx new file mode 100644 index 000000000..7f6ebbb0d --- /dev/null +++ b/registry/default/magicui/android.tsx @@ -0,0 +1,102 @@ +import { SVGProps } from "react"; + +export interface AndroidProps extends SVGProps { + width?: number; + height?: number; + src?: string; + videoSrc?: string; +} + +export default function Android({ + width = 433, + height = 882, + src, + videoSrc, + ...props +}: AndroidProps) { + return ( + + + + + + + + + + + + {src && ( + + )} + {videoSrc && ( + +