diff --git a/README.md b/README.md index e7a72e4..b8c852e 100644 --- a/README.md +++ b/README.md @@ -22,6 +22,13 @@ Reviewer Submitter - 領取稿費 +## Frontend + +- For icon, use [lucide-vue-next](https://lucide.dev/icons) +- For Component, use [shadcn-vue](https://www.shadcn-vue.com/docs/components/accordion.html) +- Vue 3 + Vite + TypeScript + TailwindCSS + + ## Reference - https://github.com/consenlabs/ethtaipei2023-aa-workshop diff --git a/frontend/README.md b/frontend/README.md deleted file mode 100644 index 2068aae..0000000 --- a/frontend/README.md +++ /dev/null @@ -1,8 +0,0 @@ -# RoyaltyAutoClaim Frontend - -## Tech stack - -- Component library is using [shadcn-vue](https://www.shadcn-vue.com/docs/components/accordion.html) -- TailwindCSS -- Vue 3 + Vite + TypeScript - diff --git a/frontend/package.json b/frontend/package.json index 5a3ced7..76ecc18 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -9,6 +9,7 @@ "preview": "vite preview" }, "dependencies": { + "@vueuse/core": "^12.4.0", "class-variance-authority": "^0.7.1", "clsx": "^2.1.1", "lucide-vue-next": "^0.473.0", diff --git a/frontend/pnpm-lock.yaml b/frontend/pnpm-lock.yaml index 0460ec2..cabf37b 100644 --- a/frontend/pnpm-lock.yaml +++ b/frontend/pnpm-lock.yaml @@ -8,6 +8,9 @@ importers: .: dependencies: + '@vueuse/core': + specifier: ^12.4.0 + version: 12.4.0(typescript@5.6.3) class-variance-authority: specifier: ^0.7.1 version: 0.7.1 @@ -478,12 +481,21 @@ packages: '@vueuse/core@10.11.1': resolution: {integrity: sha512-guoy26JQktXPcz+0n3GukWIy/JDNKti9v6VEMu6kV2sYBsWuGiTU8OWdg+ADfUbHg3/3DlqySDe7JmdHrktiww==} + '@vueuse/core@12.4.0': + resolution: {integrity: sha512-XnjQYcJwCsyXyIafyA6SvyN/OBtfPnjvJmbxNxQjCcyWD198urwm5TYvIUUyAxEAN0K7HJggOgT15cOlWFyLeA==} + '@vueuse/metadata@10.11.1': resolution: {integrity: sha512-IGa5FXd003Ug1qAZmyE8wF3sJ81xGLSqTqtQ6jaVfkeZ4i5kS2mwQF61yhVqojRnenVew5PldLyRgvdl4YYuSw==} + '@vueuse/metadata@12.4.0': + resolution: {integrity: sha512-AhPuHs/qtYrKHUlEoNO6zCXufu8OgbR8S/n2oMw1OQuBQJ3+HOLQ+EpvXs+feOlZMa0p8QVvDWNlmcJJY8rW2g==} + '@vueuse/shared@10.11.1': resolution: {integrity: sha512-LHpC8711VFZlDaYUXEBbFBCQ7GS3dVU9mjOhhMhXP6txTV4EhYQg/KGnQuvt/sPAtoUKq7VVUnL6mVtFoL42sA==} + '@vueuse/shared@12.4.0': + resolution: {integrity: sha512-9yLgbHVIF12OSCojnjTIoZL1+UA10+O4E1aD6Hpfo/DKVm5o3SZIwz6CupqGy3+IcKI8d6Jnl26EQj/YucnW0Q==} + alien-signals@0.4.14: resolution: {integrity: sha512-itUAVzhczTmP2U5yX67xVpsbbOiquusbWVyA9N+sy6+r6YVbFkahXvNCeEPWEOMhwDYwbVbGHFkVL03N9I5g+Q==} @@ -1412,8 +1424,19 @@ snapshots: - '@vue/composition-api' - vue + '@vueuse/core@12.4.0(typescript@5.6.3)': + dependencies: + '@types/web-bluetooth': 0.0.20 + '@vueuse/metadata': 12.4.0 + '@vueuse/shared': 12.4.0(typescript@5.6.3) + vue: 3.5.13(typescript@5.6.3) + transitivePeerDependencies: + - typescript + '@vueuse/metadata@10.11.1': {} + '@vueuse/metadata@12.4.0': {} + '@vueuse/shared@10.11.1(vue@3.5.13(typescript@5.6.3))': dependencies: vue-demi: 0.14.10(vue@3.5.13(typescript@5.6.3)) @@ -1421,6 +1444,12 @@ snapshots: - '@vue/composition-api' - vue + '@vueuse/shared@12.4.0(typescript@5.6.3)': + dependencies: + vue: 3.5.13(typescript@5.6.3) + transitivePeerDependencies: + - typescript + alien-signals@0.4.14: {} ansi-regex@5.0.1: {} diff --git a/frontend/src/App.vue b/frontend/src/App.vue index aabc540..fb8c7be 100644 --- a/frontend/src/App.vue +++ b/frontend/src/App.vue @@ -1,7 +1,42 @@ - + diff --git a/frontend/src/components/ui/badge/Badge.vue b/frontend/src/components/ui/badge/Badge.vue new file mode 100644 index 0000000..9ed8039 --- /dev/null +++ b/frontend/src/components/ui/badge/Badge.vue @@ -0,0 +1,16 @@ + + + diff --git a/frontend/src/components/ui/badge/index.ts b/frontend/src/components/ui/badge/index.ts new file mode 100644 index 0000000..35e7a1a --- /dev/null +++ b/frontend/src/components/ui/badge/index.ts @@ -0,0 +1,25 @@ +import { cva, type VariantProps } from 'class-variance-authority' + +export { default as Badge } from './Badge.vue' + +export const badgeVariants = cva( + 'inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2', + { + variants: { + variant: { + default: + 'border-transparent bg-primary text-primary-foreground hover:bg-primary/80', + secondary: + 'border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80', + destructive: + 'border-transparent bg-destructive text-destructive-foreground hover:bg-destructive/80', + outline: 'text-foreground', + }, + }, + defaultVariants: { + variant: 'default', + }, + }, +) + +export type BadgeVariants = VariantProps diff --git a/frontend/src/components/ui/button/Button.vue b/frontend/src/components/ui/button/Button.vue new file mode 100644 index 0000000..d3e3786 --- /dev/null +++ b/frontend/src/components/ui/button/Button.vue @@ -0,0 +1,26 @@ + + + diff --git a/frontend/src/components/ui/button/index.ts b/frontend/src/components/ui/button/index.ts new file mode 100644 index 0000000..18a065a --- /dev/null +++ b/frontend/src/components/ui/button/index.ts @@ -0,0 +1,35 @@ +import { cva, type VariantProps } from 'class-variance-authority' + +export { default as Button } from './Button.vue' + +export const buttonVariants = cva( + 'inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0', + { + variants: { + variant: { + default: + 'bg-primary text-primary-foreground shadow hover:bg-primary/90', + destructive: + 'bg-destructive text-destructive-foreground shadow-sm hover:bg-destructive/90', + outline: + 'border border-input bg-background shadow-sm hover:bg-accent hover:text-accent-foreground', + secondary: + 'bg-secondary text-secondary-foreground shadow-sm hover:bg-secondary/80', + ghost: 'hover:bg-accent hover:text-accent-foreground', + link: 'text-primary underline-offset-4 hover:underline', + }, + size: { + default: 'h-9 px-4 py-2', + sm: 'h-8 rounded-md px-3 text-xs', + lg: 'h-10 rounded-md px-8', + icon: 'h-9 w-9', + }, + }, + defaultVariants: { + variant: 'default', + size: 'default', + }, + }, +) + +export type ButtonVariants = VariantProps diff --git a/frontend/src/components/ui/card/Card.vue b/frontend/src/components/ui/card/Card.vue new file mode 100644 index 0000000..12dd5ec --- /dev/null +++ b/frontend/src/components/ui/card/Card.vue @@ -0,0 +1,21 @@ + + + diff --git a/frontend/src/components/ui/card/CardContent.vue b/frontend/src/components/ui/card/CardContent.vue new file mode 100644 index 0000000..785913a --- /dev/null +++ b/frontend/src/components/ui/card/CardContent.vue @@ -0,0 +1,14 @@ + + + diff --git a/frontend/src/components/ui/card/CardDescription.vue b/frontend/src/components/ui/card/CardDescription.vue new file mode 100644 index 0000000..d5faedd --- /dev/null +++ b/frontend/src/components/ui/card/CardDescription.vue @@ -0,0 +1,14 @@ + + + diff --git a/frontend/src/components/ui/card/CardFooter.vue b/frontend/src/components/ui/card/CardFooter.vue new file mode 100644 index 0000000..1ed2efe --- /dev/null +++ b/frontend/src/components/ui/card/CardFooter.vue @@ -0,0 +1,14 @@ + + + diff --git a/frontend/src/components/ui/card/CardHeader.vue b/frontend/src/components/ui/card/CardHeader.vue new file mode 100644 index 0000000..951d227 --- /dev/null +++ b/frontend/src/components/ui/card/CardHeader.vue @@ -0,0 +1,14 @@ + + + diff --git a/frontend/src/components/ui/card/CardTitle.vue b/frontend/src/components/ui/card/CardTitle.vue new file mode 100644 index 0000000..842e168 --- /dev/null +++ b/frontend/src/components/ui/card/CardTitle.vue @@ -0,0 +1,18 @@ + + + diff --git a/frontend/src/components/ui/card/index.ts b/frontend/src/components/ui/card/index.ts new file mode 100644 index 0000000..9ff6d5e --- /dev/null +++ b/frontend/src/components/ui/card/index.ts @@ -0,0 +1,6 @@ +export { default as Card } from './Card.vue' +export { default as CardContent } from './CardContent.vue' +export { default as CardDescription } from './CardDescription.vue' +export { default as CardFooter } from './CardFooter.vue' +export { default as CardHeader } from './CardHeader.vue' +export { default as CardTitle } from './CardTitle.vue' diff --git a/frontend/src/components/ui/input/Input.vue b/frontend/src/components/ui/input/Input.vue new file mode 100644 index 0000000..81140b4 --- /dev/null +++ b/frontend/src/components/ui/input/Input.vue @@ -0,0 +1,24 @@ + + + diff --git a/frontend/src/components/ui/input/index.ts b/frontend/src/components/ui/input/index.ts new file mode 100644 index 0000000..a691dd6 --- /dev/null +++ b/frontend/src/components/ui/input/index.ts @@ -0,0 +1 @@ +export { default as Input } from './Input.vue' diff --git a/frontend/src/components/ui/label/Label.vue b/frontend/src/components/ui/label/Label.vue new file mode 100644 index 0000000..5ad1568 --- /dev/null +++ b/frontend/src/components/ui/label/Label.vue @@ -0,0 +1,27 @@ + + + diff --git a/frontend/src/components/ui/label/index.ts b/frontend/src/components/ui/label/index.ts new file mode 100644 index 0000000..572c2f0 --- /dev/null +++ b/frontend/src/components/ui/label/index.ts @@ -0,0 +1 @@ +export { default as Label } from './Label.vue' diff --git a/frontend/src/components/ui/select/Select.vue b/frontend/src/components/ui/select/Select.vue new file mode 100644 index 0000000..adc42fd --- /dev/null +++ b/frontend/src/components/ui/select/Select.vue @@ -0,0 +1,15 @@ + + + diff --git a/frontend/src/components/ui/select/SelectContent.vue b/frontend/src/components/ui/select/SelectContent.vue new file mode 100644 index 0000000..f597885 --- /dev/null +++ b/frontend/src/components/ui/select/SelectContent.vue @@ -0,0 +1,53 @@ + + + diff --git a/frontend/src/components/ui/select/SelectGroup.vue b/frontend/src/components/ui/select/SelectGroup.vue new file mode 100644 index 0000000..b0803e1 --- /dev/null +++ b/frontend/src/components/ui/select/SelectGroup.vue @@ -0,0 +1,19 @@ + + + diff --git a/frontend/src/components/ui/select/SelectItem.vue b/frontend/src/components/ui/select/SelectItem.vue new file mode 100644 index 0000000..9a41027 --- /dev/null +++ b/frontend/src/components/ui/select/SelectItem.vue @@ -0,0 +1,44 @@ + + + diff --git a/frontend/src/components/ui/select/SelectItemText.vue b/frontend/src/components/ui/select/SelectItemText.vue new file mode 100644 index 0000000..a0bb5c2 --- /dev/null +++ b/frontend/src/components/ui/select/SelectItemText.vue @@ -0,0 +1,11 @@ + + + diff --git a/frontend/src/components/ui/select/SelectLabel.vue b/frontend/src/components/ui/select/SelectLabel.vue new file mode 100644 index 0000000..503e890 --- /dev/null +++ b/frontend/src/components/ui/select/SelectLabel.vue @@ -0,0 +1,13 @@ + + + diff --git a/frontend/src/components/ui/select/SelectScrollDownButton.vue b/frontend/src/components/ui/select/SelectScrollDownButton.vue new file mode 100644 index 0000000..8854334 --- /dev/null +++ b/frontend/src/components/ui/select/SelectScrollDownButton.vue @@ -0,0 +1,24 @@ + + + diff --git a/frontend/src/components/ui/select/SelectScrollUpButton.vue b/frontend/src/components/ui/select/SelectScrollUpButton.vue new file mode 100644 index 0000000..6c3711f --- /dev/null +++ b/frontend/src/components/ui/select/SelectScrollUpButton.vue @@ -0,0 +1,24 @@ + + + diff --git a/frontend/src/components/ui/select/SelectSeparator.vue b/frontend/src/components/ui/select/SelectSeparator.vue new file mode 100644 index 0000000..cb06b8d --- /dev/null +++ b/frontend/src/components/ui/select/SelectSeparator.vue @@ -0,0 +1,17 @@ + + + diff --git a/frontend/src/components/ui/select/SelectTrigger.vue b/frontend/src/components/ui/select/SelectTrigger.vue new file mode 100644 index 0000000..6b35be4 --- /dev/null +++ b/frontend/src/components/ui/select/SelectTrigger.vue @@ -0,0 +1,31 @@ + + + diff --git a/frontend/src/components/ui/select/SelectValue.vue b/frontend/src/components/ui/select/SelectValue.vue new file mode 100644 index 0000000..4bc37dd --- /dev/null +++ b/frontend/src/components/ui/select/SelectValue.vue @@ -0,0 +1,11 @@ + + + diff --git a/frontend/src/components/ui/select/index.ts b/frontend/src/components/ui/select/index.ts new file mode 100644 index 0000000..31b9294 --- /dev/null +++ b/frontend/src/components/ui/select/index.ts @@ -0,0 +1,11 @@ +export { default as Select } from './Select.vue' +export { default as SelectContent } from './SelectContent.vue' +export { default as SelectGroup } from './SelectGroup.vue' +export { default as SelectItem } from './SelectItem.vue' +export { default as SelectItemText } from './SelectItemText.vue' +export { default as SelectLabel } from './SelectLabel.vue' +export { default as SelectScrollDownButton } from './SelectScrollDownButton.vue' +export { default as SelectScrollUpButton } from './SelectScrollUpButton.vue' +export { default as SelectSeparator } from './SelectSeparator.vue' +export { default as SelectTrigger } from './SelectTrigger.vue' +export { default as SelectValue } from './SelectValue.vue' diff --git a/frontend/src/views/Config.vue b/frontend/src/views/Config.vue index a92b125..daebf84 100644 --- a/frontend/src/views/Config.vue +++ b/frontend/src/views/Config.vue @@ -1,7 +1,114 @@ - + - + diff --git a/frontend/src/views/Home.vue b/frontend/src/views/Home.vue index 8b3716e..65dc916 100644 --- a/frontend/src/views/Home.vue +++ b/frontend/src/views/Home.vue @@ -1,7 +1,101 @@ - + diff --git a/index.html b/index.html deleted file mode 100644 index a57fa0b..0000000 --- a/index.html +++ /dev/null @@ -1,243 +0,0 @@ - - - - - - Royalty Auto Claim Dashboard - - - -
- -
-
-

Royalty Auto Claim

- -
-
- - -
-

Owner Controls

-
- - - -
-
- - - -
-
- - -
-

Admin Controls

-
- - - - -
-
- - - - -
-
- - -
-

Reviewer

-
- - - - -
-
- - -
-

Submissions

-
-
-

Title A

-

Recipient: 0x1234...5678

-

Reviews: 1

-

Total Royalty Level: 20

- Registered -
- - -
-
-
-

Title B

-

Recipient: 0x1234...5678

-

Reviews: 2

-

Total Royalty Level: 60

- Registered -
- - -
- -
-
-

Title C

-

Recipient: 0x8765...4321

-

Reviews: 3

-

Total Royalty Level: 80

- Claimed -
-
-
- - -