Skip to content

Commit a1622ef

Browse files
authored
Merge pull request #496 from Leo-Corporation/vNext
Version 2.0.0
2 parents 1bf071e + 6f7da94 commit a1622ef

20 files changed

+934
-515
lines changed

.github/images/banner.png

-571 KB
Loading

app/globals.css

+6
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,12 @@
8888
font-weight: bold;
8989
}
9090

91+
@font-face {
92+
font-family: "Hauora";
93+
src: url(../public/fonts/Hauora-SemiBold.ttf);
94+
font-weight: 600;
95+
}
96+
9197
@font-face {
9298
font-family: "FluentSystemIcons-Regular";
9399
src: url(../public/fonts/FluentSystemIcons-Regular.ttf);

components/card.tsx

-26
This file was deleted.

components/history-card.tsx

+81-66
Original file line numberDiff line numberDiff line change
@@ -34,11 +34,14 @@ import {
3434
} from "./ui/drawer";
3535
import { getLabelFromValue } from "@/lib/barcodeTypes";
3636
import { ScrollArea } from "./ui/scroll-area";
37+
import { TableCell, TableRow } from "./ui/table";
38+
import { Close } from "@radix-ui/react-dialog";
3739

3840
export default function HistoryItem(props: {
3941
item: GeneratedItem;
4042
index: number;
4143
deleteEvent: Function;
44+
home?: boolean;
4245
}) {
4346
const { t } = useTranslation("common");
4447
const settings = GetSettings();
@@ -128,27 +131,20 @@ export default function HistoryItem(props: {
128131
const keys = props.item.metadata ? Object.keys(props.item.metadata) : [];
129132
const vals = props.item.metadata ? Object.values(props.item.metadata) : [];
130133
return (
131-
<div className="m-2 flex w-[230px] flex-col items-center justify-center rounded-md bg-white p-3 shadow-md dark:bg-slate-900">
132-
{isQrCode(props.item.bcid) ? (
133-
<></>
134-
) : (
135-
<span className="mb-2 rounded-full border border-slate-700 px-1 text-sm text-slate-700 dark:border-slate-600 dark:text-slate-600">
136-
{getLabelFromValue(props.item.bcid)}
137-
</span>
138-
)}
134+
<TableRow>
139135
<canvas
140136
className="hidden"
141137
id={`code-${props.item.text}-${props.index}`}
142138
></canvas>
143-
<span
144-
className={`flex items-center ${isQrCode(props.item.bcid) ? "h-[150px]" : "h-[65px]"}`}
139+
<TableCell
140+
className={`${isQrCode(props.item.bcid) ? "h-[150px]" : "h-[65px]"}`}
145141
>
146142
<TooltipProvider>
147143
<Tooltip>
148144
<TooltipTrigger>
149145
<div className="hidden sm:block">
150146
<Dialog>
151-
<DialogTrigger>
147+
<DialogTrigger disabled={props.home}>
152148
<Image
153149
width={150}
154150
height={isQrCode(props.item.bcid) ? 150 : 65}
@@ -287,6 +283,17 @@ export default function HistoryItem(props: {
287283
>
288284
{t("save")}
289285
</Button>
286+
{!props.home && (
287+
<Close>
288+
<Button
289+
onClick={deleteBtn}
290+
variant="outline"
291+
className="h-8 px-2 py-1"
292+
>
293+
<Delete16Regular />
294+
</Button>
295+
</Close>
296+
)}
290297
</div>
291298
</DrawerFooter>
292299
</DrawerContent>
@@ -298,68 +305,76 @@ export default function HistoryItem(props: {
298305
</TooltipContent>
299306
</Tooltip>
300307
</TooltipProvider>
301-
</span>
302-
<div className="m-4 flex space-x-2">
303-
<TooltipProvider>
304-
<Tooltip>
305-
<TooltipTrigger>
306-
<Button
307-
onClick={copyBtn}
308-
variant="outline"
309-
className="h-auto px-2 py-1"
310-
>
311-
<Copy16Regular />
312-
</Button>
313-
</TooltipTrigger>
314-
<TooltipContent>
315-
<p>{t("copy")}</p>
316-
</TooltipContent>
317-
</Tooltip>
318-
</TooltipProvider>
319-
<TooltipProvider>
320-
<Tooltip>
321-
<TooltipTrigger>
322-
<Button
323-
onClick={saveBtn}
324-
variant="outline"
325-
className="h-auto px-2 py-1"
326-
>
327-
<Save16Regular />
328-
</Button>
329-
</TooltipTrigger>
330-
<TooltipContent>
331-
<p>{t("save")}</p>
332-
</TooltipContent>
333-
</Tooltip>
334-
</TooltipProvider>
335-
<TooltipProvider>
336-
<Tooltip>
337-
<TooltipTrigger>
338-
<Button
339-
onClick={deleteBtn}
340-
variant="outline"
341-
className="h-auto px-2 py-1"
342-
>
343-
<Delete16Regular />
344-
</Button>
345-
</TooltipTrigger>
346-
<TooltipContent>
347-
<p>{t("delete")}</p>
348-
</TooltipContent>
349-
</Tooltip>
350-
</TooltipProvider>
351-
</div>
308+
</TableCell>
352309
{isQrCode(props.item.bcid) ? (
353-
<p className="mt-2 text-wrap text-center">
310+
<></>
311+
) : (
312+
<TableCell>{getLabelFromValue(props.item.bcid)}</TableCell>
313+
)}
314+
315+
<TableCell>
316+
<p className="mt-2 text-wrap">
354317
{props.item.metadata
355318
? t("interactive")
356319
: props.item.text.length > 30
357320
? props.item.text.substring(0, 27) + "..."
358321
: props.item.text}
359322
</p>
360-
) : (
361-
<></>
323+
</TableCell>
324+
{!props.home && (
325+
<TableCell>
326+
<div className="flex space-x-2">
327+
<TooltipProvider>
328+
<Tooltip>
329+
<TooltipTrigger>
330+
<Button
331+
onClick={copyBtn}
332+
variant="outline"
333+
className="h-auto px-2 py-1"
334+
>
335+
<Copy16Regular />
336+
</Button>
337+
</TooltipTrigger>
338+
<TooltipContent>
339+
<p>{t("copy")}</p>
340+
</TooltipContent>
341+
</Tooltip>
342+
</TooltipProvider>
343+
<TooltipProvider>
344+
<Tooltip>
345+
<TooltipTrigger>
346+
<Button
347+
onClick={saveBtn}
348+
variant="outline"
349+
className="h-auto px-2 py-1"
350+
>
351+
<Save16Regular />
352+
</Button>
353+
</TooltipTrigger>
354+
<TooltipContent>
355+
<p>{t("save")}</p>
356+
</TooltipContent>
357+
</Tooltip>
358+
</TooltipProvider>
359+
<TooltipProvider>
360+
<Tooltip>
361+
<TooltipTrigger>
362+
<Button
363+
onClick={deleteBtn}
364+
variant="outline"
365+
className="h-auto px-2 py-1"
366+
>
367+
<Delete16Regular />
368+
</Button>
369+
</TooltipTrigger>
370+
<TooltipContent>
371+
<p>{t("delete")}</p>
372+
</TooltipContent>
373+
</Tooltip>
374+
</TooltipProvider>
375+
</div>
376+
</TableCell>
362377
)}
363-
</div>
378+
</TableRow>
364379
);
365380
}

components/ui/calendar.tsx

+7-7
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ function Calendar({
4040
"text-muted-foreground rounded-md w-9 font-normal text-[0.8rem]",
4141
row: "flex w-full mt-2",
4242
cell: "h-9 w-9 text-center text-sm p-0 relative [&:has([aria-selected].day-range-end)]:rounded-r-md [&:has([aria-selected].day-outside)]:bg-accent/50 [&:has([aria-selected])]:bg-accent first:[&:has([aria-selected])]:rounded-l-md last:[&:has([aria-selected])]:rounded-r-md focus-within:relative focus-within:z-20",
43-
day: cn(
43+
day_button: cn(
4444
buttonVariants({ variant: "ghost" }),
4545
"h-9 w-9 p-0 flex justify-center font-normal hover:bg-slate-100 dark:hover:bg-slate-800 aria-selected:bg-accent-color aria-selected:text-white aria-selected:opacity-100",
4646
),
@@ -56,12 +56,12 @@ function Calendar({
5656
...classNames,
5757
}}
5858
components={{
59-
IconLeft: ({ ...props }) => (
60-
<ChevronLeft16Regular className="h-4 w-4" />
61-
),
62-
IconRight: ({ ...props }) => (
63-
<ChevronRight16Regular className="h-4 w-4" />
64-
),
59+
Chevron: (props) => {
60+
if (props.orientation === "left") {
61+
return <ChevronLeft16Regular className="h-4 w-4" />;
62+
}
63+
return <ChevronRight16Regular className="h-4 w-4" />;
64+
},
6565
}}
6666
{...props}
6767
/>

components/ui/card.tsx

+86
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
import * as React from "react";
2+
3+
import { cn } from "@/lib/utils";
4+
5+
const Card = React.forwardRef<
6+
HTMLDivElement,
7+
React.HTMLAttributes<HTMLDivElement>
8+
>(({ className, ...props }, ref) => (
9+
<div
10+
ref={ref}
11+
className={cn(
12+
"rounded-lg border border-slate-200 bg-card text-card-foreground shadow-sm dark:border-slate-700",
13+
className,
14+
)}
15+
{...props}
16+
/>
17+
));
18+
Card.displayName = "Card";
19+
20+
const CardHeader = React.forwardRef<
21+
HTMLDivElement,
22+
React.HTMLAttributes<HTMLDivElement>
23+
>(({ className, ...props }, ref) => (
24+
<div
25+
ref={ref}
26+
className={cn("flex flex-col space-y-1.5 p-6", className)}
27+
{...props}
28+
/>
29+
));
30+
CardHeader.displayName = "CardHeader";
31+
32+
const CardTitle = React.forwardRef<
33+
HTMLParagraphElement,
34+
React.HTMLAttributes<HTMLHeadingElement>
35+
>(({ className, ...props }, ref) => (
36+
<h3
37+
ref={ref}
38+
className={cn(
39+
"text-2xl font-semibold leading-none tracking-tight",
40+
className,
41+
)}
42+
{...props}
43+
/>
44+
));
45+
CardTitle.displayName = "CardTitle";
46+
47+
const CardDescription = React.forwardRef<
48+
HTMLParagraphElement,
49+
React.HTMLAttributes<HTMLParagraphElement>
50+
>(({ className, ...props }, ref) => (
51+
<p
52+
ref={ref}
53+
className={cn("text-sm text-muted-foreground", className)}
54+
{...props}
55+
/>
56+
));
57+
CardDescription.displayName = "CardDescription";
58+
59+
const CardContent = React.forwardRef<
60+
HTMLDivElement,
61+
React.HTMLAttributes<HTMLDivElement>
62+
>(({ className, ...props }, ref) => (
63+
<div ref={ref} className={cn("p-6 pt-0", className)} {...props} />
64+
));
65+
CardContent.displayName = "CardContent";
66+
67+
const CardFooter = React.forwardRef<
68+
HTMLDivElement,
69+
React.HTMLAttributes<HTMLDivElement>
70+
>(({ className, ...props }, ref) => (
71+
<div
72+
ref={ref}
73+
className={cn("flex items-center p-6 pt-0", className)}
74+
{...props}
75+
/>
76+
));
77+
CardFooter.displayName = "CardFooter";
78+
79+
export {
80+
Card,
81+
CardHeader,
82+
CardFooter,
83+
CardTitle,
84+
CardDescription,
85+
CardContent,
86+
};

components/ui/date-picker.tsx

-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@ export function DatePicker(props: { setDate: Function }) {
3939
setDate(d);
4040
props.setDate(`${formatDate(d)}`);
4141
}}
42-
initialFocus
4342
/>
4443
</PopoverContent>
4544
</Popover>

0 commit comments

Comments
 (0)