Merge commit 'e178fe370cc71bd2a8adead7a0278b78471b08ed' into iipbs/common/main
This commit is contained in:
@@ -23,6 +23,7 @@
|
||||
--border: #e5e5e5;
|
||||
--input: #e5e5e5;
|
||||
--label: #666666;
|
||||
--placeholder: #a2a2a2;
|
||||
--ring: #0a0a0a;
|
||||
--chart-1: #2094fa;
|
||||
--chart-2: #00dfe5;
|
||||
@@ -31,6 +32,10 @@
|
||||
--chart-5: #ff7865;
|
||||
--chart-6: #e65db5;
|
||||
--radius: 1rem;
|
||||
--field: #fff;
|
||||
--form: #fff;
|
||||
--container: #f1f6f9;
|
||||
--title: #4c5e6f;
|
||||
}
|
||||
[data-mode="dark"] {
|
||||
--background: #0a0a0a;
|
||||
@@ -52,6 +57,7 @@
|
||||
--border: #262626;
|
||||
--input: #262626;
|
||||
--label: #f1f1f1;
|
||||
--placeholder: #737373;
|
||||
--ring: #d4d4d4;
|
||||
--chart-1: #66b3ff;
|
||||
--chart-2: #66f0f2;
|
||||
@@ -60,5 +66,9 @@
|
||||
--chart-5: #ffbcad;
|
||||
--chart-6: #f4a0d3;
|
||||
--radius: 1rem;
|
||||
--field: #5b6269;
|
||||
--form: #1a1a1a;
|
||||
--container: #0a0a0a;
|
||||
--title: #fff;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -34,10 +34,12 @@
|
||||
"@radix-ui/react-label": "^2.1.2",
|
||||
"@radix-ui/react-popover": "^1.1.6",
|
||||
"@radix-ui/react-radio-group": "^1.2.2",
|
||||
"@radix-ui/react-select": "^2.1.6",
|
||||
"@radix-ui/react-slider": "^1.2.3",
|
||||
"@radix-ui/react-slot": "^1.1.2",
|
||||
"@radix-ui/react-switch": "^1.1.3",
|
||||
"@radix-ui/react-tabs": "^1.1.3",
|
||||
"@radix-ui/react-visually-hidden": "^1.1.2",
|
||||
"@tanstack/react-query": "^5.67.1",
|
||||
"@tanstack/react-table": "^8.21.2",
|
||||
"@types/js-cookie": "^3.0.6",
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
"use client";
|
||||
|
||||
import "./accordion.css";
|
||||
|
||||
import * as React from "react";
|
||||
|
||||
@@ -22,7 +22,7 @@ const meta: Meta<typeof Bar> = {
|
||||
description: {
|
||||
component: `
|
||||
- [Docs](https://react-chartjs-2.js.org/)
|
||||
`,
|
||||
`,
|
||||
},
|
||||
source: {
|
||||
code: `
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
"use client";
|
||||
|
||||
import * as React from "react";
|
||||
import { ko } from "date-fns/locale";
|
||||
import { ChevronLeft, ChevronRight } from "lucide-react";
|
||||
|
||||
@@ -14,7 +14,7 @@ const meta: Meta<typeof DataTable> = {
|
||||
description: {
|
||||
component: `
|
||||
- [Docs](https://tanstack.com/table/v8/docs/introduction)
|
||||
`,
|
||||
`,
|
||||
},
|
||||
source: {
|
||||
code: `
|
||||
|
||||
@@ -36,15 +36,22 @@ function THead<T>({ table }: { table: TableType<T> }) {
|
||||
);
|
||||
}
|
||||
|
||||
type TableProps<T> = { table: TableType<T> };
|
||||
type TableProps<T> = {
|
||||
table: TableType<T>;
|
||||
onRowClick?: (row: T) => void;
|
||||
};
|
||||
|
||||
function DataTable<T>({ table }: TableProps<T>) {
|
||||
function DataTable<T>({ table, onRowClick }: TableProps<T>) {
|
||||
return (
|
||||
<Table className="w-full">
|
||||
<THead table={table} />
|
||||
<tbody>
|
||||
{table.getRowModel().rows.map((row) => (
|
||||
<TableRow key={row.id}>
|
||||
<TableRow
|
||||
key={row.id}
|
||||
onClick={() => onRowClick?.(row.original)}
|
||||
className={onRowClick ? "cursor-pointer hover:bg-muted" : ""}
|
||||
>
|
||||
{row.getVisibleCells().map((cell) => {
|
||||
const { meta } = cell.column.columnDef;
|
||||
return (
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
"use client";
|
||||
|
||||
import "./date-picker.css";
|
||||
|
||||
import { format } from "date-fns";
|
||||
|
||||
@@ -26,7 +26,7 @@ export const Default: Story = {
|
||||
<DialogTrigger asChild>
|
||||
<Button>다이얼로그 열기</Button>
|
||||
</DialogTrigger>
|
||||
<DialogContent className="sm:max-w-[425px]">
|
||||
<DialogContent className="sm:max-w-[42.5rem]">
|
||||
<DialogHeader>
|
||||
<DialogTitle>다이얼로그 제목</DialogTitle>
|
||||
</DialogHeader>
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import * as React from "react";
|
||||
import * as DialogPrimitive from "@radix-ui/react-dialog";
|
||||
import { VisuallyHidden } from "@radix-ui/react-visually-hidden";
|
||||
import { X } from "lucide-react";
|
||||
|
||||
import { cn } from "../../lib/utils";
|
||||
@@ -36,14 +37,17 @@ const DialogContent = React.forwardRef<
|
||||
<DialogPrimitive.Content
|
||||
ref={ref}
|
||||
className={cn(
|
||||
"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",
|
||||
"fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border border-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",
|
||||
className,
|
||||
)}
|
||||
{...props}
|
||||
>
|
||||
<VisuallyHidden asChild>
|
||||
<DialogTitle>Dialog</DialogTitle>
|
||||
</VisuallyHidden>
|
||||
{children}
|
||||
<DialogPrimitive.Close className="absolute right-6 top-6 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">
|
||||
<X className="size-6" />
|
||||
<X className="size-6 text-muted-foreground" />
|
||||
<span className="sr-only">Close</span>
|
||||
</DialogPrimitive.Close>
|
||||
</DialogPrimitive.Content>
|
||||
@@ -71,7 +75,7 @@ const DialogFooter = ({
|
||||
}: React.HTMLAttributes<HTMLDivElement>) => (
|
||||
<div
|
||||
className={cn(
|
||||
"-mx-6 flex flex-col-reverse border-t border-t-[#eaeef5] px-6 pt-6 sm:flex-row sm:justify-end sm:space-x-2",
|
||||
"-mx-6 flex flex-col-reverse border-t border-t-border px-6 pt-6 sm:flex-row sm:justify-end sm:space-x-2",
|
||||
className,
|
||||
)}
|
||||
{...props}
|
||||
@@ -86,7 +90,7 @@ const DialogTitle = React.forwardRef<
|
||||
<DialogPrimitive.Title
|
||||
ref={ref}
|
||||
className={cn(
|
||||
"-mx-6 border-b border-b-[#eaeef5] px-6 pb-6 text-[1.4rem] font-semibold leading-none tracking-tight",
|
||||
"-mx-6 border-b border-b-border px-6 pb-6 text-[1.4rem] font-semibold leading-none tracking-tight text-foreground",
|
||||
className,
|
||||
)}
|
||||
{...props}
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
"use client";
|
||||
|
||||
import { images } from "@common/assets";
|
||||
import { useUsersQuery } from "../../api";
|
||||
import { AUTH_USER_ID } from "../../config";
|
||||
@@ -18,14 +16,16 @@ export function Header() {
|
||||
});
|
||||
|
||||
return (
|
||||
<header className="sticky top-0 box-border flex h-[5rem] w-full items-center justify-between border-b border-solid border-border">
|
||||
<header className="sticky top-0 box-border flex h-[5rem] w-full items-center justify-between border-b border-solid border-border bg-background">
|
||||
<div className="flex items-center">
|
||||
<div className="MobMenuBtn">
|
||||
<img src={images.menuBtn} />
|
||||
</div>
|
||||
<h1 className="flex items-center gap-4">
|
||||
<img src={images.logo} className="h-[3rem]" alt="logo" />
|
||||
<span className="text-[1.8rem] font-semibold">통합플랫폼관리</span>
|
||||
<span className="text-[1.8rem] font-semibold text-foreground">
|
||||
통합플랫폼관리
|
||||
</span>
|
||||
</h1>
|
||||
</div>
|
||||
<DropdownMenu>
|
||||
|
||||
@@ -15,6 +15,7 @@ export * from "./layout";
|
||||
export * from "./loading";
|
||||
export * from "./popover";
|
||||
export * from "./radio-group";
|
||||
export * from "./select";
|
||||
export * from "./slider";
|
||||
export * from "./switch";
|
||||
export * from "./table";
|
||||
|
||||
@@ -3,14 +3,15 @@ import * as React from "react";
|
||||
import { cn } from "../../lib/utils";
|
||||
|
||||
const Input = React.forwardRef<HTMLInputElement, React.ComponentProps<"input">>(
|
||||
({ className, type, ...props }, ref) => {
|
||||
({ className, type, value, ...props }, ref) => {
|
||||
return (
|
||||
<input
|
||||
type={type}
|
||||
className={cn(
|
||||
"flex h-[3.2rem] w-full rounded-md border border-input bg-background px-3 py-2 text-base ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",
|
||||
"flex h-[3.2rem] w-full rounded-md border border-input bg-form px-3 py-2 text-base ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-placeholder focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",
|
||||
className,
|
||||
)}
|
||||
value={value ?? ""}
|
||||
ref={ref}
|
||||
{...props}
|
||||
/>
|
||||
|
||||
@@ -5,7 +5,7 @@ import { cva, type VariantProps } from "class-variance-authority";
|
||||
import { cn } from "../../lib/utils";
|
||||
|
||||
const labelVariants = cva(
|
||||
"text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",
|
||||
"text-[1.3rem] font-medium leading-none text-label peer-disabled:cursor-not-allowed peer-disabled:opacity-70",
|
||||
);
|
||||
|
||||
const Label = React.forwardRef<
|
||||
|
||||
@@ -1,7 +1,9 @@
|
||||
export function Footer() {
|
||||
return (
|
||||
<footer className="flex h-[5rem] w-full shrink-0 items-center border-t border-solid border-border p-4">
|
||||
<p>© 2025 Ona And All. All Rights Reserved.</p>
|
||||
<footer className="flex h-[5rem] w-full shrink-0 items-center border-t border-solid border-border bg-background p-4">
|
||||
<p className="text-foreground">
|
||||
© 2025 Ona And All. All Rights Reserved.
|
||||
</p>
|
||||
</footer>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -348,7 +348,7 @@ function IPManagementDialog() {
|
||||
<DialogTrigger asChild>
|
||||
<Button>IP 관리</Button>
|
||||
</DialogTrigger>
|
||||
<DialogContent className="sm:max-w-[600px]">
|
||||
<DialogContent className="sm:max-w-[60rem]">
|
||||
<DialogHeader>
|
||||
<DialogTitle>IP 관리</DialogTitle>
|
||||
</DialogHeader>
|
||||
|
||||
@@ -2,7 +2,7 @@ export function LNB() {
|
||||
return (
|
||||
<div
|
||||
id="lnb"
|
||||
className="!w-[22rem] overflow-auto border-r border-solid border-border"
|
||||
className="!w-[22rem] overflow-auto border-r border-solid border-border bg-background"
|
||||
>
|
||||
<ul>
|
||||
<li id="m_dashboard">
|
||||
|
||||
@@ -13,7 +13,6 @@ import {
|
||||
} from "chart.js";
|
||||
import { Line } from "react-chartjs-2";
|
||||
import { fakerKO as faker } from "@faker-js/faker";
|
||||
import { getCssVariableValue } from "../../lib/utils";
|
||||
|
||||
const meta: Meta<typeof Line> = {
|
||||
title: "Chart/Line",
|
||||
@@ -23,7 +22,7 @@ const meta: Meta<typeof Line> = {
|
||||
description: {
|
||||
component: `
|
||||
- [Docs](https://react-chartjs-2.js.org/)
|
||||
`,
|
||||
`,
|
||||
},
|
||||
source: {
|
||||
code: `
|
||||
@@ -107,7 +106,7 @@ export const Default: Story = {
|
||||
LineElement,
|
||||
Title,
|
||||
Tooltip,
|
||||
Legend
|
||||
Legend,
|
||||
);
|
||||
|
||||
const options: ChartOptions<"line"> = {
|
||||
@@ -124,29 +123,29 @@ export const Default: Story = {
|
||||
};
|
||||
|
||||
const labels = [
|
||||
'January',
|
||||
'February',
|
||||
'March',
|
||||
'April',
|
||||
'May',
|
||||
'June',
|
||||
'July'
|
||||
"January",
|
||||
"February",
|
||||
"March",
|
||||
"April",
|
||||
"May",
|
||||
"June",
|
||||
"July",
|
||||
];
|
||||
|
||||
const data = {
|
||||
labels,
|
||||
datasets: [
|
||||
{
|
||||
label: 'Dataset 1',
|
||||
label: "Dataset 1",
|
||||
data: labels.map(() => faker.number.int({ min: -1000, max: 1000 })),
|
||||
borderColor: 'rgb(255, 99, 132)',
|
||||
backgroundColor: 'rgba(255, 99, 132, 0.5)',
|
||||
borderColor: "rgb(255, 99, 132)",
|
||||
backgroundColor: "rgba(255, 99, 132, 0.5)",
|
||||
},
|
||||
{
|
||||
label: 'Dataset 2',
|
||||
label: "Dataset 2",
|
||||
data: labels.map(() => faker.number.int({ min: -1000, max: 1000 })),
|
||||
borderColor: 'rgb(53, 162, 235)',
|
||||
backgroundColor: 'rgba(53, 162, 235, 0.5)',
|
||||
borderColor: "rgb(53, 162, 235)",
|
||||
backgroundColor: "rgba(53, 162, 235, 0.5)",
|
||||
},
|
||||
],
|
||||
};
|
||||
|
||||
@@ -1,15 +1,7 @@
|
||||
import type { Meta, StoryObj } from "@storybook/react";
|
||||
|
||||
import {
|
||||
Chart as ChartJS,
|
||||
ArcElement,
|
||||
Tooltip,
|
||||
Legend,
|
||||
type ChartOptions,
|
||||
} from "chart.js";
|
||||
import { Chart as ChartJS, ArcElement, Tooltip, Legend } from "chart.js";
|
||||
import { Pie } from "react-chartjs-2";
|
||||
import { fakerKO as faker } from "@faker-js/faker";
|
||||
import { getCssVariableValue } from "../../lib/utils";
|
||||
|
||||
const meta: Meta<typeof Pie> = {
|
||||
title: "Chart/Pie",
|
||||
@@ -19,7 +11,7 @@ const meta: Meta<typeof Pie> = {
|
||||
description: {
|
||||
component: `
|
||||
- [Docs](https://react-chartjs-2.js.org/)
|
||||
`,
|
||||
`,
|
||||
},
|
||||
source: {
|
||||
code: `
|
||||
@@ -83,42 +75,31 @@ type Story = StoryObj<typeof Pie>;
|
||||
|
||||
export const Default: Story = {
|
||||
render: () => {
|
||||
ChartJS.register(
|
||||
ArcElement,
|
||||
Tooltip,
|
||||
Legend,
|
||||
);
|
||||
ChartJS.register(ArcElement, Tooltip, Legend);
|
||||
|
||||
const labels = [
|
||||
'Red',
|
||||
'Blue',
|
||||
'Yellow',
|
||||
'Green',
|
||||
'Purple',
|
||||
'Orange'
|
||||
];
|
||||
const labels = ["Red", "Blue", "Yellow", "Green", "Purple", "Orange"];
|
||||
|
||||
const data = {
|
||||
labels,
|
||||
datasets: [
|
||||
{
|
||||
label: '# of Votes',
|
||||
label: "# of Votes",
|
||||
data: [12, 19, 3, 5, 2, 3],
|
||||
backgroundColor: [
|
||||
'rgba(255, 99, 132, 0.2)',
|
||||
'rgba(54, 162, 235, 0.2)',
|
||||
'rgba(255, 206, 86, 0.2)',
|
||||
'rgba(75, 192, 192, 0.2)',
|
||||
'rgba(153, 102, 255, 0.2)',
|
||||
'rgba(255, 159, 64, 0.2)',
|
||||
"rgba(255, 99, 132, 0.2)",
|
||||
"rgba(54, 162, 235, 0.2)",
|
||||
"rgba(255, 206, 86, 0.2)",
|
||||
"rgba(75, 192, 192, 0.2)",
|
||||
"rgba(153, 102, 255, 0.2)",
|
||||
"rgba(255, 159, 64, 0.2)",
|
||||
],
|
||||
borderColor: [
|
||||
'rgba(255, 99, 132, 1)',
|
||||
'rgba(54, 162, 235, 1)',
|
||||
'rgba(255, 206, 86, 1)',
|
||||
'rgba(75, 192, 192, 1)',
|
||||
'rgba(153, 102, 255, 1)',
|
||||
'rgba(255, 159, 64, 1)',
|
||||
"rgba(255, 99, 132, 1)",
|
||||
"rgba(54, 162, 235, 1)",
|
||||
"rgba(255, 206, 86, 1)",
|
||||
"rgba(75, 192, 192, 1)",
|
||||
"rgba(153, 102, 255, 1)",
|
||||
"rgba(255, 159, 64, 1)",
|
||||
],
|
||||
borderWidth: 1,
|
||||
},
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
@apply flex flex-row gap-4 data-[orientation="vertical"]:flex-col data-[orientation="vertical"]:gap-2;
|
||||
}
|
||||
button[role="radio"] {
|
||||
@apply aspect-square size-[18px] rounded-full bg-[url(../../../public/assets/images/checkbox_off.png)] bg-contain text-primary ring-offset-background focus:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-[url(../../../public/assets/images/checkbox_on.png)];
|
||||
@apply aspect-square size-[1.8rem] rounded-full bg-[url(../../../public/assets/images/checkbox_off.png)] bg-contain text-primary ring-offset-background focus:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-[url(../../../public/assets/images/checkbox_on.png)];
|
||||
}
|
||||
button[role="radio"] + label {
|
||||
@apply text-[1.3rem] font-medium text-label;
|
||||
|
||||
@@ -0,0 +1,157 @@
|
||||
import * as React from "react";
|
||||
import * as SelectPrimitive from "@radix-ui/react-select";
|
||||
import { Check, ChevronDown, ChevronUp } from "lucide-react";
|
||||
|
||||
import { cn } from "../../lib/utils";
|
||||
|
||||
const Select = SelectPrimitive.Root;
|
||||
|
||||
const SelectGroup = SelectPrimitive.Group;
|
||||
|
||||
const SelectValue = SelectPrimitive.Value;
|
||||
|
||||
const SelectTrigger = React.forwardRef<
|
||||
React.ElementRef<typeof SelectPrimitive.Trigger>,
|
||||
React.ComponentPropsWithoutRef<typeof SelectPrimitive.Trigger>
|
||||
>(({ className, children, ...props }, ref) => (
|
||||
<SelectPrimitive.Trigger
|
||||
ref={ref}
|
||||
className={cn(
|
||||
"flex h-[3.2rem] w-full items-center justify-between whitespace-nowrap rounded-sm border border-input bg-form px-4 py-2 text-[1.3rem] text-label ring-offset-background focus:outline-none focus:ring-1 focus:ring-ring disabled:cursor-not-allowed disabled:opacity-50 data-[placeholder]:text-muted-foreground [&>span]:line-clamp-1",
|
||||
className,
|
||||
)}
|
||||
{...props}
|
||||
>
|
||||
{children}
|
||||
<SelectPrimitive.Icon asChild>
|
||||
<ChevronDown className="h-4 w-4 opacity-50" />
|
||||
</SelectPrimitive.Icon>
|
||||
</SelectPrimitive.Trigger>
|
||||
));
|
||||
SelectTrigger.displayName = SelectPrimitive.Trigger.displayName;
|
||||
|
||||
const SelectScrollUpButton = React.forwardRef<
|
||||
React.ElementRef<typeof SelectPrimitive.ScrollUpButton>,
|
||||
React.ComponentPropsWithoutRef<typeof SelectPrimitive.ScrollUpButton>
|
||||
>(({ className, ...props }, ref) => (
|
||||
<SelectPrimitive.ScrollUpButton
|
||||
ref={ref}
|
||||
className={cn(
|
||||
"flex cursor-default items-center justify-center py-1",
|
||||
className,
|
||||
)}
|
||||
{...props}
|
||||
>
|
||||
<ChevronUp className="h-4 w-4" />
|
||||
</SelectPrimitive.ScrollUpButton>
|
||||
));
|
||||
SelectScrollUpButton.displayName = SelectPrimitive.ScrollUpButton.displayName;
|
||||
|
||||
const SelectScrollDownButton = React.forwardRef<
|
||||
React.ElementRef<typeof SelectPrimitive.ScrollDownButton>,
|
||||
React.ComponentPropsWithoutRef<typeof SelectPrimitive.ScrollDownButton>
|
||||
>(({ className, ...props }, ref) => (
|
||||
<SelectPrimitive.ScrollDownButton
|
||||
ref={ref}
|
||||
className={cn(
|
||||
"flex cursor-default items-center justify-center py-1",
|
||||
className,
|
||||
)}
|
||||
{...props}
|
||||
>
|
||||
<ChevronDown className="h-4 w-4" />
|
||||
</SelectPrimitive.ScrollDownButton>
|
||||
));
|
||||
SelectScrollDownButton.displayName =
|
||||
SelectPrimitive.ScrollDownButton.displayName;
|
||||
|
||||
const SelectContent = React.forwardRef<
|
||||
React.ElementRef<typeof SelectPrimitive.Content>,
|
||||
React.ComponentPropsWithoutRef<typeof SelectPrimitive.Content>
|
||||
>(({ className, children, position = "popper", ...props }, ref) => (
|
||||
<SelectPrimitive.Portal>
|
||||
<SelectPrimitive.Content
|
||||
ref={ref}
|
||||
className={cn(
|
||||
"relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-md border bg-popover text-popover-foreground 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-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",
|
||||
position === "popper" &&
|
||||
"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",
|
||||
className,
|
||||
)}
|
||||
position={position}
|
||||
{...props}
|
||||
>
|
||||
<SelectScrollUpButton />
|
||||
<SelectPrimitive.Viewport
|
||||
className={cn(
|
||||
"p-1",
|
||||
position === "popper" &&
|
||||
"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]",
|
||||
)}
|
||||
>
|
||||
{children}
|
||||
</SelectPrimitive.Viewport>
|
||||
<SelectScrollDownButton />
|
||||
</SelectPrimitive.Content>
|
||||
</SelectPrimitive.Portal>
|
||||
));
|
||||
SelectContent.displayName = SelectPrimitive.Content.displayName;
|
||||
|
||||
const SelectLabel = React.forwardRef<
|
||||
React.ElementRef<typeof SelectPrimitive.Label>,
|
||||
React.ComponentPropsWithoutRef<typeof SelectPrimitive.Label>
|
||||
>(({ className, ...props }, ref) => (
|
||||
<SelectPrimitive.Label
|
||||
ref={ref}
|
||||
className={cn("px-2 py-1.5 text-sm font-semibold", className)}
|
||||
{...props}
|
||||
/>
|
||||
));
|
||||
SelectLabel.displayName = SelectPrimitive.Label.displayName;
|
||||
|
||||
const SelectItem = React.forwardRef<
|
||||
React.ElementRef<typeof SelectPrimitive.Item>,
|
||||
React.ComponentPropsWithoutRef<typeof SelectPrimitive.Item>
|
||||
>(({ className, children, ...props }, ref) => (
|
||||
<SelectPrimitive.Item
|
||||
ref={ref}
|
||||
className={cn(
|
||||
"relative flex w-full cursor-default select-none items-center rounded-sm py-3 pl-4 pr-8 text-[1.2rem] outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
|
||||
className,
|
||||
)}
|
||||
{...props}
|
||||
>
|
||||
<span className="absolute right-2 flex h-3.5 w-3.5 items-center justify-center">
|
||||
<SelectPrimitive.ItemIndicator>
|
||||
<Check className="h-4 w-4" />
|
||||
</SelectPrimitive.ItemIndicator>
|
||||
</span>
|
||||
<SelectPrimitive.ItemText>{children}</SelectPrimitive.ItemText>
|
||||
</SelectPrimitive.Item>
|
||||
));
|
||||
SelectItem.displayName = SelectPrimitive.Item.displayName;
|
||||
|
||||
const SelectSeparator = React.forwardRef<
|
||||
React.ElementRef<typeof SelectPrimitive.Separator>,
|
||||
React.ComponentPropsWithoutRef<typeof SelectPrimitive.Separator>
|
||||
>(({ className, ...props }, ref) => (
|
||||
<SelectPrimitive.Separator
|
||||
ref={ref}
|
||||
className={cn("-mx-1 my-1 h-px bg-muted", className)}
|
||||
{...props}
|
||||
/>
|
||||
));
|
||||
SelectSeparator.displayName = SelectPrimitive.Separator.displayName;
|
||||
|
||||
export {
|
||||
Select,
|
||||
SelectGroup,
|
||||
SelectValue,
|
||||
SelectTrigger,
|
||||
SelectContent,
|
||||
SelectLabel,
|
||||
SelectItem,
|
||||
SelectSeparator,
|
||||
SelectScrollUpButton,
|
||||
SelectScrollDownButton,
|
||||
};
|
||||
@@ -0,0 +1,41 @@
|
||||
import type { Meta, StoryObj } from "@storybook/react";
|
||||
import {
|
||||
Select,
|
||||
SelectContent,
|
||||
SelectItem,
|
||||
SelectTrigger,
|
||||
SelectValue,
|
||||
} from ".";
|
||||
|
||||
const meta: Meta<typeof Select> = {
|
||||
title: "Elements/Select",
|
||||
component: Select,
|
||||
parameters: {
|
||||
docs: {
|
||||
description: {
|
||||
component: `
|
||||
- [Docs](https://ui.shadcn.com/docs/components/select)
|
||||
- [API Reference](https://www.radix-ui.com/primitives/docs/components/select#api-reference)
|
||||
`,
|
||||
},
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
export default meta;
|
||||
type Story = StoryObj<typeof Select>;
|
||||
|
||||
export const Default: Story = {
|
||||
render: () => (
|
||||
<Select>
|
||||
<SelectTrigger className="w-[18rem]">
|
||||
<SelectValue placeholder="선택하세요" />
|
||||
</SelectTrigger>
|
||||
<SelectContent>
|
||||
<SelectItem value="option1">옵션 1</SelectItem>
|
||||
<SelectItem value="option2">옵션 2</SelectItem>
|
||||
<SelectItem value="option3">옵션 3</SelectItem>
|
||||
</SelectContent>
|
||||
</Select>
|
||||
),
|
||||
};
|
||||
@@ -13,7 +13,11 @@ const Table = React.forwardRef<HTMLTableElement, TableProps>(
|
||||
<div className="relative w-full">
|
||||
<table
|
||||
ref={ref}
|
||||
className={cn("w-full caption-bottom text-sm", className, variant)}
|
||||
className={cn(
|
||||
"table-ui w-full caption-bottom text-sm",
|
||||
className,
|
||||
variant,
|
||||
)}
|
||||
{...props}
|
||||
/>
|
||||
</div>
|
||||
@@ -63,7 +67,7 @@ const TableRow = React.forwardRef<
|
||||
<tr
|
||||
ref={ref}
|
||||
className={cn(
|
||||
"hover:bg-muted/50 border-b transition-colors data-[state=selected]:bg-muted",
|
||||
"border-b bg-background transition-colors data-[state=selected]:bg-muted",
|
||||
className,
|
||||
)}
|
||||
{...props}
|
||||
@@ -89,7 +93,10 @@ const TableCell = React.forwardRef<
|
||||
>(({ className, ...props }, ref) => (
|
||||
<td
|
||||
ref={ref}
|
||||
className={cn("align-middle [&:has([role=checkbox])]:pr-0", className)}
|
||||
className={cn(
|
||||
"align-middle text-foreground [&:has([role=checkbox])]:pr-0",
|
||||
className,
|
||||
)}
|
||||
{...props}
|
||||
/>
|
||||
));
|
||||
|
||||
@@ -1,22 +1,38 @@
|
||||
th {
|
||||
@apply bg-[#5987bf] px-4 py-[1.2rem] text-[1.3rem] font-medium leading-[1.2] text-[#fff];
|
||||
}
|
||||
td {
|
||||
@apply border-b border-b-[#e0e6ea] bg-[#fff] px-2 py-[1.2rem] text-[1.3rem] font-normal leading-[1.2] text-[#666];
|
||||
}
|
||||
@tailwind components;
|
||||
|
||||
.secondary th {
|
||||
@apply border border-[#e0e6ea] bg-[#eaf3fb] text-[#647784];
|
||||
}
|
||||
@layer components {
|
||||
.table-ui th {
|
||||
@apply bg-[#5987bf] px-4 py-[1.2rem] text-[1.3rem] font-medium leading-[1.2] text-[#fff];
|
||||
}
|
||||
.table-ui td {
|
||||
@apply border-b border-b-border px-2 py-[1.2rem] text-[1.3rem] font-normal leading-[1.2] text-[#666];
|
||||
}
|
||||
|
||||
.secondary td {
|
||||
@apply border border-[#e0e6ea];
|
||||
}
|
||||
.table-ui.secondary th {
|
||||
@apply border border-border bg-[#eaf3fb] text-[#647784];
|
||||
}
|
||||
|
||||
.line th {
|
||||
@apply border-0 border-b-2 border-t border-b-[#d4e0ea] border-t-[#d4e0ea] bg-[#fff] text-[#555];
|
||||
}
|
||||
.table-ui.secondary td {
|
||||
@apply border border-border;
|
||||
}
|
||||
|
||||
.line td {
|
||||
@apply border-b border-b-[#e0e6ea];
|
||||
.table-ui.line th {
|
||||
@apply border-0 border-b-2 border-t border-b-[#d4e0ea] border-t-[#d4e0ea] bg-[#fff] text-[#555];
|
||||
}
|
||||
|
||||
.table-ui.line td {
|
||||
@apply border-b border-b-border;
|
||||
}
|
||||
|
||||
[data-mode="dark"] {
|
||||
.table-ui th {
|
||||
@apply bg-[#5e7b9c] text-[#fff];
|
||||
}
|
||||
.table-ui.secondary th {
|
||||
@apply bg-[#1a1c1d];
|
||||
}
|
||||
.table-ui.line th {
|
||||
@apply bg-[#0a0a0a];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -21,7 +21,7 @@ type Story = StoryObj<typeof Tabs>;
|
||||
|
||||
export const Default: Story = {
|
||||
render: () => (
|
||||
<Tabs defaultValue="account" className="w-[400px]">
|
||||
<Tabs defaultValue="account" className="w-[40rem]">
|
||||
<TabsList>
|
||||
<TabsTrigger value="account">Account</TabsTrigger>
|
||||
<TabsTrigger value="password">Password</TabsTrigger>
|
||||
@@ -38,7 +38,7 @@ export const Default: Story = {
|
||||
|
||||
export const Underline: Story = {
|
||||
render: () => (
|
||||
<Tabs defaultValue="account" className="w-[400px]" variant="underline">
|
||||
<Tabs defaultValue="account" className="w-[40rem]" variant="underline">
|
||||
<TabsList>
|
||||
<TabsTrigger value="account">Account</TabsTrigger>
|
||||
<TabsTrigger value="password">Password</TabsTrigger>
|
||||
@@ -55,7 +55,7 @@ export const Underline: Story = {
|
||||
|
||||
export const Outline: Story = {
|
||||
render: () => (
|
||||
<Tabs defaultValue="account" className="w-[400px]" variant="outline">
|
||||
<Tabs defaultValue="account" className="w-[40rem]" variant="outline">
|
||||
<TabsList>
|
||||
<TabsTrigger value="account">Account</TabsTrigger>
|
||||
<TabsTrigger value="password">Password</TabsTrigger>
|
||||
|
||||
@@ -19,7 +19,7 @@ const meta: Meta<typeof Tree> = {
|
||||
description: {
|
||||
component: `
|
||||
- [Docs](https://github.com/minop1205/react-dnd-treeview/blob/next/README.md)
|
||||
`,
|
||||
`,
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
@@ -28,12 +28,12 @@ class Client {
|
||||
|
||||
if (!token || !userId) {
|
||||
throw new AxiosError(
|
||||
"[Client] Missing required authentication tokens",
|
||||
"The authentication token is invalid.",
|
||||
"UNAUTHORIZED",
|
||||
config,
|
||||
null,
|
||||
{
|
||||
data: { message: "Missing required authentication tokens" },
|
||||
data: { message: "The authentication token is invalid." },
|
||||
status: 401,
|
||||
statusText: "Unauthorized",
|
||||
headers: this.axiosInstance.defaults.headers,
|
||||
|
||||
Reference in New Issue
Block a user