Skip to content

Commit 98b51a6

Browse files
authored
Merge branch 'main' into page/ITNews
2 parents e9049e0 + 5253993 commit 98b51a6

File tree

28 files changed

+1157
-180
lines changed

28 files changed

+1157
-180
lines changed

.github/workflows/build-check.yml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
name: build-check
2+
3+
on:
4+
push:
5+
6+
jobs:
7+
build-check:
8+
runs-on: ubuntu-latest
9+
steps:
10+
- uses: actions/checkout@v4
11+
- uses: actions/setup-node@v4
12+
with:
13+
node-version: 20
14+
- name: Install Dependencies
15+
working-directory: ./frontend
16+
run: yarn
17+
- name: Build Check
18+
working-directory: ./frontend
19+
run: |
20+
yarn workspace @zicdding-web/zicdding-class-com run build

frontend/packages/ui/package.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
"./Calendar": "./src/components/Calendar/index.ts",
2121
"./Typography": "./src/components/Typography/index.ts",
2222
"./Card": "./src/components/Card/index.ts",
23+
"./Dialog": "./src/components/Dialog/index.ts",
2324
"./package.json": "./package.json"
2425
},
2526
"devDependencies": {
@@ -42,17 +43,20 @@
4243
"vite-plugin-singlefile": "^2.0.2"
4344
},
4445
"dependencies": {
46+
"@radix-ui/react-dialog": "^1.1.2",
4547
"@radix-ui/react-icons": "^1.3.0",
4648
"@radix-ui/react-slot": "^1.1.0",
4749
"@radix-ui/react-tabs": "^1.1.0",
4850
"@radix-ui/themes": "^3.1.0",
4951
"class-variance-authority": "^0.7.0",
5052
"clsx": "^2.1.1",
5153
"date-fns": "^3.6.0",
54+
"lucide-react": "^0.454.0",
5255
"postcss": "^8.4.38",
5356
"react": "^18.3.1",
5457
"react-day-picker": "^8.10.1",
5558
"react-dom": "^18",
59+
"rollup": "^4.27.3",
5660
"tailwind-merge": "^2.3.0",
5761
"tailwindcss": "^3.4.4",
5862
"tailwindcss-animate": "^1.0.7"
Lines changed: 97 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,97 @@
1+
'use client';
2+
3+
import * as React from 'react';
4+
import * as DialogPrimitive from '@radix-ui/react-dialog';
5+
import { X } from 'lucide-react';
6+
7+
import { cn } from '@ui/lib/utils';
8+
9+
const Dialog = DialogPrimitive.Root;
10+
11+
const DialogTrigger = DialogPrimitive.Trigger;
12+
13+
const DialogPortal = DialogPrimitive.Portal;
14+
15+
const DialogClose = DialogPrimitive.Close;
16+
17+
const DialogOverlay = React.forwardRef<
18+
React.ElementRef<typeof DialogPrimitive.Overlay>,
19+
React.ComponentPropsWithoutRef<typeof DialogPrimitive.Overlay>
20+
>(({ className, ...props }, ref) => (
21+
<DialogPrimitive.Overlay
22+
ref={ref}
23+
className={cn(
24+
'fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0',
25+
className,
26+
)}
27+
{...props}
28+
/>
29+
));
30+
DialogOverlay.displayName = DialogPrimitive.Overlay.displayName;
31+
32+
const DialogContent = React.forwardRef<
33+
React.ElementRef<typeof DialogPrimitive.Content>,
34+
React.ComponentPropsWithoutRef<typeof DialogPrimitive.Content>
35+
>(({ className, children, ...props }, ref) => (
36+
<DialogPortal>
37+
<DialogOverlay />
38+
<DialogPrimitive.Content
39+
ref={ref}
40+
className={cn(
41+
'fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg',
42+
className,
43+
)}
44+
{...props}
45+
>
46+
{children}
47+
<DialogPrimitive.Close className="absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground">
48+
<X className="h-4 w-4" />
49+
<span className="sr-only">Close</span>
50+
</DialogPrimitive.Close>
51+
</DialogPrimitive.Content>
52+
</DialogPortal>
53+
));
54+
DialogContent.displayName = DialogPrimitive.Content.displayName;
55+
56+
const DialogHeader = ({ className, ...props }: React.HTMLAttributes<HTMLDivElement>) => (
57+
<div className={cn('flex flex-col space-y-1.5 text-center sm:text-left', className)} {...props} />
58+
);
59+
DialogHeader.displayName = 'DialogHeader';
60+
61+
const DialogFooter = ({ className, ...props }: React.HTMLAttributes<HTMLDivElement>) => (
62+
<div className={cn('flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2', className)} {...props} />
63+
);
64+
DialogFooter.displayName = 'DialogFooter';
65+
66+
const DialogTitle = React.forwardRef<
67+
React.ElementRef<typeof DialogPrimitive.Title>,
68+
React.ComponentPropsWithoutRef<typeof DialogPrimitive.Title>
69+
>(({ className, ...props }, ref) => (
70+
<DialogPrimitive.Title
71+
ref={ref}
72+
className={cn('text-lg font-semibold leading-none tracking-tight', className)}
73+
{...props}
74+
/>
75+
));
76+
DialogTitle.displayName = DialogPrimitive.Title.displayName;
77+
78+
const DialogDescription = React.forwardRef<
79+
React.ElementRef<typeof DialogPrimitive.Description>,
80+
React.ComponentPropsWithoutRef<typeof DialogPrimitive.Description>
81+
>(({ className, ...props }, ref) => (
82+
<DialogPrimitive.Description ref={ref} className={cn('text-sm text-muted-foreground', className)} {...props} />
83+
));
84+
DialogDescription.displayName = DialogPrimitive.Description.displayName;
85+
86+
export {
87+
Dialog,
88+
DialogPortal,
89+
DialogOverlay,
90+
DialogClose,
91+
DialogTrigger,
92+
DialogContent,
93+
DialogHeader,
94+
DialogFooter,
95+
DialogTitle,
96+
DialogDescription,
97+
};
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
import {
2+
Dialog as _Dialog,
3+
DialogPortal,
4+
DialogOverlay,
5+
DialogClose,
6+
DialogTrigger,
7+
DialogContent,
8+
DialogHeader,
9+
DialogFooter,
10+
DialogTitle,
11+
DialogDescription,
12+
} from './Dialog';
13+
14+
export const Dialog = Object.assign(_Dialog, {
15+
Portal: DialogPortal,
16+
Overlay: DialogOverlay,
17+
Close: DialogClose,
18+
Trigger: DialogTrigger,
19+
Content: DialogContent,
20+
Header: DialogHeader,
21+
Footer: DialogFooter,
22+
Title: DialogTitle,
23+
Description: DialogDescription,
24+
});
25+
26+
export type DialogType = typeof Dialog;

0 commit comments

Comments
 (0)