Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
52 changes: 51 additions & 1 deletion jobdri/app/page.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import IconBox from "@/components/common/icons/IconBox";
import CheckBox from "@/components/common/icons/CheckBox";
import Header from "@/components/common/header/Header";
import { Footer } from "@/components/common/footer";
import { DropDown } from "@/components/common/dropdown";
import { Lnb } from "@/components/common/lnb";
import {
Button,
Expand All @@ -11,10 +13,20 @@ import {
TextButton,
} from "@/components/common/buttons";
import { Toast, ToastFrame } from "@/components/common/toast";
import { ChipRound, ChipRoundSelected, ChipQnumber } from "@/components/common/chips";
import {
ChipQnumber,
ChipRound,
ChipRoundSelected,
ChipTag,
} from "@/components/common/chips";
import ChipMainDemo from "@/components/common/chips/ChipMainDemo";
import ModalLinkInputDemo from "@/components/common/modal/ModalLinkInputDemo";
import { ModalNotice } from "@/components/common/modal";
import { CompleteBadge } from "@/components/common/badges";
import {
ProgressPanelRow,
ProgressSidebar,
} from "@/components/common/progress";
import { Tooltip, TooltipModify } from "@/components/common/tooltip";
import { TabMenuThree, TabMenuTwo } from "@/components/common/tabs";
import { CreditHeader, CreditRow } from "@/components/common/credit";
Expand All @@ -23,6 +35,7 @@ import {
InputAutoGrow,
InputFile,
InputMain,
InputModalQuestion,
InputMultiLine,
InputMultiLine1000,
InputSingleLine,
Expand Down Expand Up @@ -51,6 +64,31 @@ export default function Home() {
<Header />
</div>
</Section>
<Section title="Footer">
<div className="w-full">
<Footer />
</div>
</Section>
<Section title="DropDown">
<div className="flex items-start gap-8">
<DropDown />
</div>
</Section>
<Section title="Progress โ€” PanelRow">
<div className="flex flex-col gap-5 rounded-card-s bg-bg-default p-8">
<div className="flex items-start gap-8">
<span className="w-6 shrink-0 text-h28-bold">3</span>
<ProgressPanelRow itemCount={3} />
</div>
<div className="flex items-start gap-8">
<span className="w-6 shrink-0 text-h28-bold">4</span>
<ProgressPanelRow itemCount={4} />
</div>
</div>
</Section>
<Section title="Progress โ€” Sidebar">
<ProgressSidebar />
</Section>
<Section title="Toast">
<div className="flex w-full max-w-[594px] flex-col gap-5">
<Toast />
Expand Down Expand Up @@ -233,6 +271,9 @@ export default function Home() {
<ChipRoundSelected label="mid" />
<ChipRoundSelected label="mid selected" selected />
</Section>
<Section title="ChipTag">
<ChipTag label="๋ฐ์ดํ„ฐ๋ถ„์„" />
</Section>
<Section title="ChipQnumber">
<ChipQnumber number={1} showComplete />
<ChipQnumber number={1} showComplete selected />
Expand All @@ -242,6 +283,12 @@ export default function Home() {
<Section title="Modal โ€” LinkInput">
<ModalLinkInputDemo />
</Section>{" "}
<Section title="Modal โ€” Notice">
<div className="flex flex-wrap items-start gap-9">
<ModalNotice />
<ModalNotice variant="double" />
</div>
</Section>
<Section title="SearchBar">
<div className="w-[500px]">
<SearchBar />
Expand Down Expand Up @@ -277,6 +324,9 @@ export default function Home() {
<InputSingleLine placeholder="๋‚ด์šฉ์„ ์ž…๋ ฅํ•ด์ฃผ์„ธ์š”." />
</div>
</Section>
<Section title="InputModalQuestion">
<InputModalQuestion />
</Section>
<Section title="InputMultiLine">
<div className="flex flex-col gap-4 w-[360px]">
<InputMultiLine placeholder="๋‚ด์šฉ์„ ์ž…๋ ฅํ•ด์ฃผ์„ธ์š”." />
Expand Down
3 changes: 3 additions & 0 deletions jobdri/assets/ic_Arrow_Down_M.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions jobdri/assets/ic_Arrow_Left_M.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions jobdri/assets/ic_Arrow_Up_M.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 5 additions & 0 deletions jobdri/assets/ic_Kabab.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
36 changes: 29 additions & 7 deletions jobdri/components/common/LoadMotion.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,23 @@ import clsx from "clsx";

interface LoadMotionProps {
className?: string;
dotFrameClassName?: string;
dotClassName?: string;
activeDotClassName?: string;
inactiveDotClassName?: string;
activeMotionClassName?: string;
inactiveMotionClassName?: string;
}

export default function LoadMotion({ className }: LoadMotionProps) {
export default function LoadMotion({
className,
dotFrameClassName,
dotClassName,
activeDotClassName = "bg-icon-neutral-heavy",
inactiveDotClassName = "bg-icon-neutral-assistive",
activeMotionClassName = "-translate-y-0.5",
inactiveMotionClassName = "translate-y-0",
}: LoadMotionProps) {
const [active, setActive] = useState(0);

useEffect(() => {
Expand All @@ -17,17 +31,25 @@ export default function LoadMotion({ className }: LoadMotionProps) {
return () => clearInterval(interval);
}, []);
return (
<div className={clsx("flex items-end gap-2 h-4", className)}>
<div className={clsx("flex items-center gap-1 py-1", className)}>
{[0, 1, 2].map((i) => (
<div
key={i}
className={clsx(
"w-2 h-2 rounded-full transition-all duration-300",
active === i
? "bg-icon-neutral-heavy -translate-y-1"
: "bg-icon-neutral-assistive translate-y-0",
"flex h-1.5 w-1 items-end justify-center",
dotFrameClassName,
)}
/>
>
<span
className={clsx(
"aspect-square h-1 w-1 rounded-full transition-transform duration-300",
dotClassName,
active === i
? clsx(activeDotClassName, activeMotionClassName)
: clsx(inactiveDotClassName, inactiveMotionClassName),
)}
/>
</div>
))}
</div>
);
Expand Down
8 changes: 3 additions & 5 deletions jobdri/components/common/chips/ChipTag.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,15 @@

import clsx from "clsx";

interface ChipTagProps {
export interface ChipTagProps {
label: string;
// ๋‚˜์ค‘์— "active"๋‚˜ "disabled" ๋“ฑ์ด ์ถ”๊ฐ€๋  ๊ฒƒ์„ ๋Œ€๋น„ํ•ด ์œ ๋‹ˆ์˜จ ํƒ€์ž…์œผ๋กœ ์œ ์ง€ํ•ฉ๋‹ˆ๋‹ค.
state?: "default";
className?: string;
}

// Record์˜ ํ‚ค ํƒ€์ž…์„ ChipTagProps์˜ state๋กœ ์ง€์ •ํ•˜์—ฌ ํƒ€์ž… ์•ˆ์ •์„ฑ์„ ๋†’์ž…๋‹ˆ๋‹ค.
const styles: Record<NonNullable<ChipTagProps["state"]>, string> = {
default:
"bg-fill-quaternary-default border border-line-neutral-default text-text-neutral-title hover:shadow-chip",
"border border-line-neutral-default bg-fill-quaternary-default text-text-neutral-description",
};

export default function ChipTag({
Expand All @@ -23,7 +21,7 @@ export default function ChipTag({
return (
<div
className={clsx(
"inline-flex items-center justify-center rounded-chip-m px-1.5 py-1 text-cap12-med transition-all",
"inline-flex items-center justify-center gap-2.5 rounded-chip-s px-1.5 py-1 text-cap12-med tracking-normal [font-feature-settings:'liga'_off,'clig'_off]",
styles[state],
className,
)}
Expand Down
2 changes: 2 additions & 0 deletions jobdri/components/common/chips/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,5 @@ export { ChipMain } from "./ChipMain";
export { ChipRound } from "./ChipRound";
export { ChipRoundSelected } from "./ChipRoundSelected";
export { ChipQnumber } from "./ChipQnumber";
export { default as ChipTag } from "./ChipTag";
export type { ChipTagProps } from "./ChipTag";
3 changes: 1 addition & 2 deletions jobdri/components/common/credit/CreditRow.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import clsx from "clsx";
import type { HTMLAttributes } from "react";

import { ChipMain } from "@/components/common/chips";
import ChipTag from "../chips/ChipTag";
import { ChipTag } from "@/components/common/chips";

type CreditRowVariant = "white" | "assistive";

Expand Down
101 changes: 101 additions & 0 deletions jobdri/components/common/dropdown/DropDown.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
"use client";

import { useId, useState } from "react";
import clsx from "clsx";
import Icon from "@/components/common/icons/Icon";

export interface DropDownOption {
label: string;
value: string;
}

interface DropDownProps {
options?: DropDownOption[];
value?: string;
defaultValue?: string;
onChange?: (value: string) => void;
className?: string;
}

const defaultOptions: DropDownOption[] = [
{ label: "300์ž", value: "300" },
{ label: "500์ž", value: "500" },
{ label: "800์ž", value: "800" },
{ label: "1,000์ž", value: "1000" },
{ label: "1,500์ž", value: "1500" },
{ label: "2,000์ž", value: "2000" },
];

export default function DropDown({
options = defaultOptions,
value,
defaultValue = "1000",
onChange,
className,
}: DropDownProps) {
const listboxId = useId();
const [open, setOpen] = useState(false);
const [internalValue, setInternalValue] = useState(defaultValue);
const selectedValue = value ?? internalValue;
const selectedOption =
options.find((option) => option.value === selectedValue) ?? options[0];

const handleSelect = (nextValue: string) => {
setInternalValue(nextValue);
onChange?.(nextValue);
setOpen(false);
};

return (
<div className={clsx("relative inline-flex w-[104px]", className)}>
<button
type="button"
aria-expanded={open}
aria-haspopup="listbox"
aria-controls={listboxId}
onClick={() => setOpen((current) => !current)}
className={clsx(
"group flex w-[104px] items-center justify-between rounded-cta-s bg-fill-quaternary-default pt-[15px] pr-3 pb-[14px] pl-4 shadow-card transition-shadow hover:shadow-hover",
open && "shadow-hover",
)}
>
<span className="text-label14-med tracking-normal text-text-neutral-description [font-feature-settings:'liga'_off,'clig'_off]">
{selectedOption.label}
</span>
<Icon
type={open ? "ARROW_UP_M" : "ARROW_DOWN_M"}
className="h-6 w-6 shrink-0 text-icon-neutral-assistive group-hover:text-icon-neutral-default"
/>
</button>

{open && (
<div
id={listboxId}
role="listbox"
className="absolute top-[calc(100%+8px)] left-0 z-20 flex w-[104px] flex-col items-start overflow-hidden rounded-cta-s bg-bg-contents-default shadow-hover"
>
{options.map((option, index) => {
const selected = option.value === selectedValue;

return (
<div key={option.value} className="flex w-full flex-col">
<button
type="button"
role="option"
aria-selected={selected}
onClick={() => handleSelect(option.value)}
className="flex w-full items-center gap-1.5 self-stretch bg-bg-contents-default px-4 py-3 text-left text-label14-med tracking-normal text-text-neutral-description [font-feature-settings:'liga'_off,'clig'_off] hover:bg-bg-contents-assistive active:bg-bg-default"
>
{option.label}
</button>
{index < options.length - 1 && (
<span className="h-px self-stretch bg-line-neutral-default" />
)}
</div>
);
})}
</div>
)}
</div>
);
}
2 changes: 2 additions & 0 deletions jobdri/components/common/dropdown/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
export { default as DropDown } from "./DropDown";
export type { DropDownOption } from "./DropDown";
58 changes: 58 additions & 0 deletions jobdri/components/common/footer/Footer.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
import type { ButtonHTMLAttributes } from "react";
import clsx from "clsx";
import { Button } from "@/components/common/buttons";

interface FooterActionProps
extends Omit<ButtonHTMLAttributes<HTMLButtonElement>, "children"> {
label?: string;
}

interface FooterProps {
backAction?: FooterActionProps;
ctaAction?: FooterActionProps;
className?: string;
}

export default function Footer({
backAction = {},
ctaAction = {},
className,
}: FooterProps) {
const {
label: backLabel = "๋’ค๋กœ๊ฐ€๊ธฐ",
className: backClassName,
...backButtonProps
} = backAction;
const {
label: ctaLabel = "CTA",
className: ctaClassName,
...ctaButtonProps
} = ctaAction;

return (
<footer
className={clsx(
"flex w-[1280px] shrink-0 items-center justify-center gap-8 border-t border-line-neutral-default bg-bg-contents-assistive px-[82px] pt-4 pb-8",
className,
)}
>
<div className="flex max-w-[1440px] flex-1 items-start justify-between">
<Button
label={backLabel}
styleType="tertiary"
size="medium"
iconType="ARROW_L"
className={backClassName}
{...backButtonProps}
/>
<Button
label={ctaLabel}
styleType="primary"
size="medium"
className={ctaClassName}
{...ctaButtonProps}
/>
</div>
</footer>
);
}
1 change: 1 addition & 0 deletions jobdri/components/common/footer/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export { default as Footer } from "./Footer";
Loading