diff --git a/front/package.json b/front/package.json index 6ac6f18..48a1295 100644 --- a/front/package.json +++ b/front/package.json @@ -28,10 +28,19 @@ "@radix-ui/react-context-menu": "^2.2.2", "@radix-ui/react-dialog": "^1.1.2", "@radix-ui/react-dropdown-menu": "^2.1.2", + "@radix-ui/react-hover-card": "^1.1.2", "@radix-ui/react-icons": "^1.3.0", "@radix-ui/react-label": "^2.1.0", + "@radix-ui/react-popover": "^1.1.2", + "@radix-ui/react-progress": "^1.1.0", + "@radix-ui/react-radio-group": "^1.2.1", + "@radix-ui/react-scroll-area": "^1.2.0", + "@radix-ui/react-select": "^2.1.2", "@radix-ui/react-separator": "^1.1.0", + "@radix-ui/react-slider": "^1.2.1", "@radix-ui/react-slot": "^1.1.0", + "@radix-ui/react-switch": "^1.1.1", + "@radix-ui/react-tabs": "^1.1.1", "@radix-ui/react-tooltip": "^1.1.3", "@solana/web3.js": "^1.95.4", "@tanstack/query-core": "^5.59.0", @@ -43,6 +52,7 @@ "next": "14.2.15", "react": "^18.3.1", "react-dom": "^18.3.1", + "sonner": "^1.7.0", "tailwind-merge": "^2.5.3", "tailwindcss-animate": "^1.0.7", "viem": "2.21.19", diff --git a/front/src/components/ui/checkbox.stories.tsx b/front/src/components/ui/checkbox.stories.tsx index 1b1f2fa..e0c1111 100644 --- a/front/src/components/ui/checkbox.stories.tsx +++ b/front/src/components/ui/checkbox.stories.tsx @@ -1,12 +1,13 @@ import { Meta, StoryObj } from "@storybook/react"; import { Checkbox, CheckboxProps } from "@/components/ui/checkbox"; +import { Label } from "@/components/ui/label"; const meta: Meta = { component: Checkbox, title: "Checkbox", args: { - children: "Enable checkbox", + disabled: false, className: "", }, argTypes: { @@ -22,7 +23,12 @@ const meta: Meta = { }; type Story = StoryObj; -const Render = (args: CheckboxProps) => ; +const Render = (args: CheckboxProps) => ( +
+ + +
+); export const LightMode: Story = { args: { diff --git a/front/src/components/ui/command.stories.tsx b/front/src/components/ui/command.stories.tsx index bd32361..72e0d2e 100644 --- a/front/src/components/ui/command.stories.tsx +++ b/front/src/components/ui/command.stories.tsx @@ -37,7 +37,7 @@ const meta: Meta = { }, }; type Story = StoryObj; -type DarkModeMeta = CommandProps & { dark?: boolean }; +type DarkModeMeta = CommandProps & { dark?: boolean; className?: string }; const Render = (args: DarkModeMeta) => { const [open, setOpen] = React.useState(false); diff --git a/front/src/components/ui/context-menu.stories.tsx b/front/src/components/ui/context-menu.stories.tsx index 7e1b060..e29cf9e 100644 --- a/front/src/components/ui/context-menu.stories.tsx +++ b/front/src/components/ui/context-menu.stories.tsx @@ -30,7 +30,7 @@ const meta: Meta = { }, }; type Story = StoryObj; -type DarkModeMeta = { dark?: boolean }; +type DarkModeMeta = { dark?: boolean; className?: string }; const Render = (args: DarkModeMeta) => ( diff --git a/front/src/components/ui/dialog.stories.tsx b/front/src/components/ui/dialog.stories.tsx index a653155..7814f28 100644 --- a/front/src/components/ui/dialog.stories.tsx +++ b/front/src/components/ui/dialog.stories.tsx @@ -26,7 +26,7 @@ const meta: Meta = { }, }; type Story = StoryObj; -type DarkModeMeta = { dark?: boolean }; +type DarkModeMeta = { dark?: boolean; className?: string }; const Render = (args: DarkModeMeta) => ( diff --git a/front/src/components/ui/dropdown-menu.stories.tsx b/front/src/components/ui/dropdown-menu.stories.tsx index 4d916c9..7c1c027 100644 --- a/front/src/components/ui/dropdown-menu.stories.tsx +++ b/front/src/components/ui/dropdown-menu.stories.tsx @@ -24,7 +24,7 @@ const meta: Meta = { }, }; type Story = StoryObj; -type DarkModeMeta = { dark?: boolean }; +type DarkModeMeta = { dark?: boolean; className?: string }; const Render = (args: DarkModeMeta) => ( diff --git a/front/src/components/ui/hover-card.stories.tsx b/front/src/components/ui/hover-card.stories.tsx new file mode 100644 index 0000000..544006b --- /dev/null +++ b/front/src/components/ui/hover-card.stories.tsx @@ -0,0 +1,71 @@ +import { Meta, StoryObj } from "@storybook/react"; +import { CalendarDays } from "lucide-react"; + +import { Button } from "@/components/ui/button"; +import { HoverCard, HoverCardContent, HoverCardTrigger } from "@/components/ui/hover-card"; + +const meta: Meta = { + component: HoverCard, + title: "Hover Card", + args: { + className: "", + }, + argTypes: { + className: { + type: "string", + control: "text", + }, + }, +}; +type Story = StoryObj; +type DarkModeMeta = { dark?: boolean; className?: string }; + +const Render = (args: DarkModeMeta) => ( + + + + + +
+
+

Bedrock

+

Your decentralized workspace by design, not by promise.

+
+ {" "} + Since June 2024 +
+
+
+
+
+); + +export const LightMode: Story = { + args: { + className: "", + }, + parameters: { + backgrounds: { + default: "light", + }, + }, + render: Render, +}; + +export const DarkMode: Story = { + args: { + className: "", + }, + parameters: { + backgrounds: { + default: "dark", + }, + }, + render: (args) => ( +
+ +
+ ), +}; + +export default meta; diff --git a/front/src/components/ui/hover-card.tsx b/front/src/components/ui/hover-card.tsx new file mode 100644 index 0000000..575d870 --- /dev/null +++ b/front/src/components/ui/hover-card.tsx @@ -0,0 +1,28 @@ +"use client"; + +import { Root, Trigger, Content } from "@radix-ui/react-hover-card"; +import React from "react"; + +import { cn } from "@/lib/utils"; + +const HoverCard = Root; +const HoverCardTrigger = Trigger; + +const HoverCardContent = React.forwardRef< + React.ElementRef, + React.ComponentPropsWithoutRef +>(({ className, align = "center", sideOffset = 4, ...props }, ref) => ( + +)); +HoverCardContent.displayName = Content.displayName; + +export { HoverCard, HoverCardTrigger, HoverCardContent }; diff --git a/front/src/components/ui/input.stories.tsx b/front/src/components/ui/input.stories.tsx index 1a41a6e..2c92063 100644 --- a/front/src/components/ui/input.stories.tsx +++ b/front/src/components/ui/input.stories.tsx @@ -6,15 +6,10 @@ const meta: Meta = { component: Input, title: "Input", args: { - value: "Text input", disabled: false, className: "", }, argTypes: { - value: { - type: "string", - control: "text", - }, disabled: { type: "boolean", control: "boolean", @@ -27,11 +22,10 @@ const meta: Meta = { }; type Story = StoryObj; -const Render = (args: InputProps) => ; +const Render = (args: InputProps) => ; export const LightMode: Story = { args: { - value: "Text input", disabled: false, className: "", }, @@ -45,7 +39,6 @@ export const LightMode: Story = { export const DarkMode: Story = { args: { - value: "Text input", disabled: false, className: "", }, diff --git a/front/src/components/ui/popover.stories.tsx b/front/src/components/ui/popover.stories.tsx new file mode 100644 index 0000000..5d6f4a6 --- /dev/null +++ b/front/src/components/ui/popover.stories.tsx @@ -0,0 +1,74 @@ +import { Meta, StoryObj } from "@storybook/react"; + +import { Button } from "@/components/ui/button"; +import { Input } from "@/components/ui/input"; +import { Label } from "@/components/ui/label"; +import { Popover, PopoverContent, PopoverTrigger } from "@/components/ui/popover"; + +const meta: Meta = { + component: Popover, + title: "Popover", + args: { + className: "", + }, + argTypes: { + className: { + type: "string", + control: "text", + }, + }, +}; +type Story = StoryObj; +type DarkModeMeta = { dark?: boolean; className?: string }; + +const Render = (args: DarkModeMeta) => ( + + + + + +
+
+

File

+

Change file parameters

+
+
+
+ + +
+
+
+
+
+); + +export const LightMode: Story = { + args: { + className: "", + }, + parameters: { + backgrounds: { + default: "light", + }, + }, + render: Render, +}; + +export const DarkMode: Story = { + args: { + className: "", + }, + parameters: { + backgrounds: { + default: "dark", + }, + }, + render: (args) => ( +
+ +
+ ), +}; + +export default meta; diff --git a/front/src/components/ui/popover.tsx b/front/src/components/ui/popover.tsx new file mode 100644 index 0000000..e18f1ca --- /dev/null +++ b/front/src/components/ui/popover.tsx @@ -0,0 +1,31 @@ +"use client"; + +import { Root, Trigger, Anchor, Content, Portal } from "@radix-ui/react-popover"; +import React from "react"; + +import { cn } from "@/lib/utils"; + +const Popover = Root; +const PopoverTrigger = Trigger; +const PopoverAnchor = Anchor; + +const PopoverContent = React.forwardRef< + React.ElementRef, + React.ComponentPropsWithoutRef +>(({ className, align = "center", sideOffset = 4, ...props }, ref) => ( + + + +)); +PopoverContent.displayName = Content.displayName; + +export { Popover, PopoverTrigger, PopoverContent, PopoverAnchor }; diff --git a/front/src/components/ui/progress.stories.tsx b/front/src/components/ui/progress.stories.tsx new file mode 100644 index 0000000..fe3517b --- /dev/null +++ b/front/src/components/ui/progress.stories.tsx @@ -0,0 +1,57 @@ +import { Meta, StoryObj } from "@storybook/react"; + +import { Progress, ProgressProps } from "@/components/ui/progress"; + +const meta: Meta = { + component: Progress, + title: "Progress", + args: { + value: 20, + className: "", + }, + argTypes: { + value: { + type: "string", + control: "number", + }, + className: { + type: "string", + control: "text", + }, + }, +}; +type Story = StoryObj; + +const Render = (args: ProgressProps) => ; + +export const LightMode: Story = { + args: { + value: 20, + className: "", + }, + parameters: { + backgrounds: { + default: "light", + }, + }, + render: Render, +}; + +export const DarkMode: Story = { + args: { + value: 20, + className: "", + }, + parameters: { + backgrounds: { + default: "dark", + }, + }, + render: (args) => ( +
+ +
+ ), +}; + +export default meta; diff --git a/front/src/components/ui/progress.tsx b/front/src/components/ui/progress.tsx new file mode 100644 index 0000000..862f28e --- /dev/null +++ b/front/src/components/ui/progress.tsx @@ -0,0 +1,26 @@ +"use client"; + +import { Indicator, Root } from "@radix-ui/react-progress"; +import React from "react"; + +import { cn } from "@/lib/utils"; + +export type ProgressProps = React.ComponentPropsWithoutRef; + +const Progress = React.forwardRef, ProgressProps>( + ({ className, value, ...props }, ref) => ( + + + + ), +); +Progress.displayName = Root.displayName; + +export { Progress }; diff --git a/front/src/components/ui/radio-group.stories.tsx b/front/src/components/ui/radio-group.stories.tsx new file mode 100644 index 0000000..7cd4b44 --- /dev/null +++ b/front/src/components/ui/radio-group.stories.tsx @@ -0,0 +1,66 @@ +import { Meta, StoryObj } from "@storybook/react"; + +import { Label } from "@/components/ui/label"; +import { RadioGroup, RadioGroupItem } from "@/components/ui/radio-group"; + +const meta: Meta = { + component: RadioGroup, + title: "Radio Group", + args: { + className: "", + }, + argTypes: { + className: { + type: "string", + control: "text", + }, + }, +}; +type Story = StoryObj; + +const Render = (args: object) => ( + +
+ + +
+
+ + +
+
+ + +
+
+); + +export const LightMode: Story = { + args: { + className: "", + }, + parameters: { + backgrounds: { + default: "light", + }, + }, + render: Render, +}; + +export const DarkMode: Story = { + args: { + className: "", + }, + parameters: { + backgrounds: { + default: "dark", + }, + }, + render: (args) => ( +
+ +
+ ), +}; + +export default meta; diff --git a/front/src/components/ui/radio-group.tsx b/front/src/components/ui/radio-group.tsx new file mode 100644 index 0000000..5573bbb --- /dev/null +++ b/front/src/components/ui/radio-group.tsx @@ -0,0 +1,36 @@ +"use client"; + +import { CheckIcon } from "@radix-ui/react-icons"; +import { Indicator, Item, Root } from "@radix-ui/react-radio-group"; +import React from "react"; + +import { cn } from "@/lib/utils"; + +const RadioGroup = React.forwardRef, React.ComponentPropsWithoutRef>( + ({ className, ...props }, ref) => { + return ; + }, +); +RadioGroup.displayName = Root.displayName; + +const RadioGroupItem = React.forwardRef, React.ComponentPropsWithoutRef>( + ({ className, ...props }, ref) => { + return ( + + + + + + ); + }, +); +RadioGroupItem.displayName = Item.displayName; + +export { RadioGroup, RadioGroupItem }; diff --git a/front/src/components/ui/scroll-area.stories.tsx b/front/src/components/ui/scroll-area.stories.tsx new file mode 100644 index 0000000..2ba43c3 --- /dev/null +++ b/front/src/components/ui/scroll-area.stories.tsx @@ -0,0 +1,69 @@ +import { Meta, StoryObj } from "@storybook/react"; + +import { ScrollArea } from "@/components/ui/scroll-area"; +import { Separator } from "@/components/ui/separator"; +import { cn } from "@/lib/utils"; + +const meta: Meta = { + component: ScrollArea, + title: "Scroll Area", + args: { + className: "", + }, + argTypes: { + className: { + type: "string", + control: "text", + }, + }, +}; +type Story = StoryObj; +type DarkModeMeta = { dark?: boolean; className?: string }; + +const versions = Array.from({ length: 22 }).map((_, i, a) => `v1.${a.length - i - 1}`); + +const Render = (args: DarkModeMeta) => ( + +
+

Versions

+ {versions.map((version) => ( + <> +
+ {version} +
+ + + ))} +
+
+); + +export const LightMode: Story = { + args: { + className: "", + }, + parameters: { + backgrounds: { + default: "light", + }, + }, + render: Render, +}; + +export const DarkMode: Story = { + args: { + className: "", + }, + parameters: { + backgrounds: { + default: "dark", + }, + }, + render: (args) => ( +
+ +
+ ), +}; + +export default meta; diff --git a/front/src/components/ui/scroll-area.tsx b/front/src/components/ui/scroll-area.tsx new file mode 100644 index 0000000..6d3977d --- /dev/null +++ b/front/src/components/ui/scroll-area.tsx @@ -0,0 +1,39 @@ +"use client"; + +import { Root, Viewport, ScrollAreaScrollbar, ScrollAreaThumb, Corner } from "@radix-ui/react-scroll-area"; +import React from "react"; + +import { cn } from "@/lib/utils"; + +const ScrollArea = React.forwardRef, React.ComponentPropsWithoutRef>( + ({ className, children, ...props }, ref) => ( + + {children} + + + + ), +); +ScrollArea.displayName = Root.displayName; + +const ScrollBar = React.forwardRef< + React.ElementRef, + React.ComponentPropsWithoutRef +>(({ className, orientation = "vertical", ...props }, ref) => ( + + + +)); +ScrollBar.displayName = ScrollAreaScrollbar.displayName; + +export { ScrollArea, ScrollBar }; diff --git a/front/src/components/ui/select.stories.tsx b/front/src/components/ui/select.stories.tsx new file mode 100644 index 0000000..cd70199 --- /dev/null +++ b/front/src/components/ui/select.stories.tsx @@ -0,0 +1,62 @@ +import { Meta, StoryObj } from "@storybook/react"; + +import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from "@/components/ui/select"; + +const meta: Meta = { + component: Select, + title: "Select", + args: { + className: "", + }, + argTypes: { + className: { + type: "string", + control: "text", + }, + }, +}; +type Story = StoryObj; +type DarkModeMeta = { dark?: boolean; className?: string }; + +const Render = (args: DarkModeMeta) => ( + +); + +export const LightMode: Story = { + args: { + className: "", + }, + parameters: { + backgrounds: { + default: "light", + }, + }, + render: Render, +}; + +export const DarkMode: Story = { + args: { + className: "", + }, + parameters: { + backgrounds: { + default: "dark", + }, + }, + render: (args) => ( +
+ +
+ ), +}; + +export default meta; diff --git a/front/src/components/ui/select.tsx b/front/src/components/ui/select.tsx new file mode 100644 index 0000000..341ddfb --- /dev/null +++ b/front/src/components/ui/select.tsx @@ -0,0 +1,156 @@ +"use client"; + +import { CaretSortIcon, CheckIcon, ChevronDownIcon, ChevronUpIcon } from "@radix-ui/react-icons"; +import { + Root, + Group, + Value, + Trigger, + ScrollUpButton, + ScrollDownButton, + Icon, + Portal, + Content, + Label, + Viewport, + Item, + Separator, + ItemIndicator, + ItemText, +} from "@radix-ui/react-select"; +import React from "react"; + +import { cn } from "@/lib/utils"; + +const Select = Root; +const SelectGroup = Group; +const SelectValue = Value; + +const SelectTrigger = React.forwardRef< + React.ElementRef, + React.ComponentPropsWithoutRef +>(({ className, children, ...props }, ref) => ( + span]:line-clamp-1 text-primary", + className, + )} + {...props} + > + {children} + + + + +)); +SelectTrigger.displayName = Trigger.displayName; + +const SelectScrollUpButton = React.forwardRef< + React.ElementRef, + React.ComponentPropsWithoutRef +>(({ className, ...props }, ref) => ( + + + +)); +SelectScrollUpButton.displayName = ScrollUpButton.displayName; + +const SelectScrollDownButton = React.forwardRef< + React.ElementRef, + React.ComponentPropsWithoutRef +>(({ className, ...props }, ref) => ( + + + +)); +SelectScrollDownButton.displayName = ScrollDownButton.displayName; + +const SelectContent = React.forwardRef< + React.ElementRef, + React.ComponentPropsWithoutRef +>(({ className, children, position = "popper", ...props }, ref) => ( + + + + + {children} + + + + +)); +SelectContent.displayName = Content.displayName; + +const SelectLabel = React.forwardRef, React.ComponentPropsWithoutRef>( + ({ className, ...props }, ref) => ( +