Skip to content

Commit

Permalink
feat: re-write dialog without stackflow
Browse files Browse the repository at this point in the history
  • Loading branch information
malangcat committed Jan 16, 2025
1 parent 8c8a112 commit 2492a41
Show file tree
Hide file tree
Showing 49 changed files with 1,414 additions and 460 deletions.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
50 changes: 39 additions & 11 deletions docs/components/example/alert-dialog-danger.tsx
Original file line number Diff line number Diff line change
@@ -1,19 +1,47 @@
"use client";

import { ActionButton } from "seed-design/ui/action-button";
import { AlertDialog, AlertDialogAction } from "seed-design/ui/alert-dialog";
import {
AlertDialogAction,
AlertDialogContent,
AlertDialogDescription,
AlertDialogFooter,
AlertDialogHeader,
AlertDialogRoot,
AlertDialogTitle,
AlertDialogTrigger,
} from "seed-design/ui/alert-dialog";
import { Column, Columns } from "@seed-design/react";

const AlertDialogDangerActivity = () => {
const AlertDialogDanger = () => {
return (
<AlertDialog title="제목" description="파괴적, 비가역적 작업을 경고">
<AlertDialogAction asChild>
<ActionButton variant="neutralWeak">취소</ActionButton>
</AlertDialogAction>
<AlertDialogAction asChild>
<ActionButton variant="dangerSolid">확인</ActionButton>
</AlertDialogAction>
</AlertDialog>
// You can set z-index dialog with "--layer-index" custom property. useful for stackflow integration.
<AlertDialogRoot>
<AlertDialogTrigger asChild>
<ActionButton>열기</ActionButton>
</AlertDialogTrigger>
<AlertDialogContent layerIndex={50}>
<AlertDialogHeader>
<AlertDialogTitle>제목</AlertDialogTitle>
<AlertDialogDescription>파괴적, 비가역적 작업을 경고합니다.</AlertDialogDescription>
</AlertDialogHeader>
<AlertDialogFooter>
<Columns gap="s2">
<Column>
<AlertDialogAction asChild>
<ActionButton variant="neutralSolid">취소</ActionButton>
</AlertDialogAction>
</Column>
<Column>
<AlertDialogAction asChild>
<ActionButton variant="dangerSolid">확인</ActionButton>
</AlertDialogAction>
</Column>
</Columns>
</AlertDialogFooter>
</AlertDialogContent>
</AlertDialogRoot>
);
};

export default AlertDialogDangerActivity;
export default AlertDialogDanger;
112 changes: 0 additions & 112 deletions docs/components/example/alert-dialog-default-activity.tsx

This file was deleted.

50 changes: 39 additions & 11 deletions docs/components/example/alert-dialog-neutral.tsx
Original file line number Diff line number Diff line change
@@ -1,19 +1,47 @@
"use client";

import { ActionButton } from "seed-design/ui/action-button";
import { AlertDialog, AlertDialogAction } from "seed-design/ui/alert-dialog";
import {
AlertDialogAction,
AlertDialogContent,
AlertDialogDescription,
AlertDialogFooter,
AlertDialogHeader,
AlertDialogRoot,
AlertDialogTitle,
AlertDialogTrigger,
} from "seed-design/ui/alert-dialog";
import { Column, Columns } from "@seed-design/react";

const AlertDialogNeutralActivity = () => {
const AlertDialogNeutral = () => {
return (
<AlertDialog title="제목" description="중립적인 선택지를 제공">
<AlertDialogAction asChild>
<ActionButton variant="neutralWeak">취소</ActionButton>
</AlertDialogAction>
<AlertDialogAction asChild>
<ActionButton variant="neutralSolid">확인</ActionButton>
</AlertDialogAction>
</AlertDialog>
// You can set z-index dialog with "--layer-index" custom property. useful for stackflow integration.
<AlertDialogRoot>
<AlertDialogTrigger asChild>
<ActionButton>열기</ActionButton>
</AlertDialogTrigger>
<AlertDialogContent layerIndex={50}>
<AlertDialogHeader>
<AlertDialogTitle>제목</AlertDialogTitle>
<AlertDialogDescription>중립적인 선택지를 제공합니다.</AlertDialogDescription>
</AlertDialogHeader>
<AlertDialogFooter>
<Columns gap="s2">
<Column>
<AlertDialogAction asChild>
<ActionButton variant="neutralSolid">취소</ActionButton>
</AlertDialogAction>
</Column>
<Column>
<AlertDialogAction asChild>
<ActionButton variant="neutralWeak">확인</ActionButton>
</AlertDialogAction>
</Column>
</Columns>
</AlertDialogFooter>
</AlertDialogContent>
</AlertDialogRoot>
);
};

export default AlertDialogNeutralActivity;
export default AlertDialogNeutral;
32 changes: 0 additions & 32 deletions docs/components/example/alert-dialog-nonpreferred.tsx

This file was deleted.

50 changes: 39 additions & 11 deletions docs/components/example/alert-dialog-preview.tsx
Original file line number Diff line number Diff line change
@@ -1,19 +1,47 @@
"use client";

import { Column, Columns } from "@seed-design/react";
import { ActionButton } from "seed-design/ui/action-button";
import { AlertDialog, AlertDialogAction } from "seed-design/ui/alert-dialog";
import {
AlertDialogAction,
AlertDialogContent,
AlertDialogDescription,
AlertDialogFooter,
AlertDialogHeader,
AlertDialogRoot,
AlertDialogTitle,
AlertDialogTrigger,
} from "seed-design/ui/alert-dialog";

const AlertDialogPreviewActivity = () => {
const AlertDialogSingle = () => {
return (
<AlertDialog title="주의" description="이 작업은 되돌릴 수 없습니다.">
<AlertDialogAction asChild>
<ActionButton variant="neutralWeak">취소</ActionButton>
</AlertDialogAction>
<AlertDialogAction asChild>
<ActionButton variant="dangerSolid">확인</ActionButton>
</AlertDialogAction>
</AlertDialog>
// You can set z-index dialog with "--layer-index" custom property. useful for stackflow integration.
<AlertDialogRoot>
<AlertDialogTrigger asChild>
<ActionButton>열기</ActionButton>
</AlertDialogTrigger>
<AlertDialogContent layerIndex={50}>
<AlertDialogHeader>
<AlertDialogTitle>주의</AlertDialogTitle>
<AlertDialogDescription>이 작업은 되돌릴 수 없습니다.</AlertDialogDescription>
</AlertDialogHeader>
<AlertDialogFooter>
<Columns gap="s2">
<Column>
<AlertDialogAction asChild>
<ActionButton variant="neutralSolid">취소</ActionButton>
</AlertDialogAction>
</Column>
<Column>
<AlertDialogAction asChild>
<ActionButton variant="neutralWeak">확인</ActionButton>
</AlertDialogAction>
</Column>
</Columns>
</AlertDialogFooter>
</AlertDialogContent>
</AlertDialogRoot>
);
};

export default AlertDialogPreviewActivity;
export default AlertDialogSingle;
38 changes: 29 additions & 9 deletions docs/components/example/alert-dialog-single.tsx
Original file line number Diff line number Diff line change
@@ -1,17 +1,37 @@
"use client";

import { Flex } from "seed-design/ui/layout";
import { ActionButton } from "seed-design/ui/action-button";
import { AlertDialog } from "seed-design/ui/alert-dialog";
import {
AlertDialogAction,
AlertDialogContent,
AlertDialogDescription,
AlertDialogFooter,
AlertDialogHeader,
AlertDialogRoot,
AlertDialogTitle,
AlertDialogTrigger,
} from "seed-design/ui/alert-dialog";

const AlertDialogSingleActivity = () => {
const AlertDialogSingle = () => {
// You can set z-index dialog with "--layer-index" custom property. useful for stackflow integration.
return (
<AlertDialog title="제목" description="단일 선택지를 제공">
<Flex flexGrow={1} direction="column">
<ActionButton variant="neutralSolid">확인</ActionButton>
</Flex>
</AlertDialog>
<AlertDialogRoot>
<AlertDialogTrigger asChild>
<ActionButton>열기</ActionButton>
</AlertDialogTrigger>
<AlertDialogContent layerIndex={50}>
<AlertDialogHeader>
<AlertDialogTitle>제목</AlertDialogTitle>
<AlertDialogDescription>단일 선택지를 제공합니다.</AlertDialogDescription>
</AlertDialogHeader>
<AlertDialogFooter>
<AlertDialogAction asChild>
<ActionButton variant="neutralSolid">확인</ActionButton>
</AlertDialogAction>
</AlertDialogFooter>
</AlertDialogContent>
</AlertDialogRoot>
);
};

export default AlertDialogSingleActivity;
export default AlertDialogSingle;
Loading

0 comments on commit 2492a41

Please sign in to comment.