From 54bd800c54cc77284420c19f555fa01cf77fb2b2 Mon Sep 17 00:00:00 2001 From: Takuya Sakoda Date: Sat, 4 Nov 2023 18:03:47 +0900 Subject: [PATCH 1/3] =?UTF-8?q?=E2=9C=A8=20feat(icons):=20move=20icon=20de?= =?UTF-8?q?finition;=20features/=20to=20design-system/?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/{features => design-system}/icons/BookIcon.tsx | 0 src/{features => design-system}/icons/DocumentIcon.tsx | 0 src/{features => design-system}/icons/Icon.stories.tsx | 0 src/{features => design-system}/icons/Icon.test.tsx | 0 src/{features => design-system}/icons/Icon.tsx | 0 src/{features => design-system}/icons/NoteIcon.tsx | 0 src/{features => design-system}/icons/WarnIcon.tsx | 0 .../icons/__snapshots__/Icon.test.tsx.snap | 0 src/design-system/icons/index.ts | 1 + src/{features => design-system}/icons/types.ts | 0 src/features/icons/index.ts | 1 - .../writings/RelatedWritingsNav/WritingLink/WritingLink.tsx | 2 +- src/features/writings/WritingList/WritingBlock/WritingBlock.tsx | 2 +- .../writings/WritingViewer/WritingHeader/WritingHeader.tsx | 2 +- src/features/writings/WritingViewer/mdxParts/Note/Note.tsx | 2 +- src/features/writings/_shared/writingType.ts | 2 +- 16 files changed, 6 insertions(+), 6 deletions(-) rename src/{features => design-system}/icons/BookIcon.tsx (100%) rename src/{features => design-system}/icons/DocumentIcon.tsx (100%) rename src/{features => design-system}/icons/Icon.stories.tsx (100%) rename src/{features => design-system}/icons/Icon.test.tsx (100%) rename src/{features => design-system}/icons/Icon.tsx (100%) rename src/{features => design-system}/icons/NoteIcon.tsx (100%) rename src/{features => design-system}/icons/WarnIcon.tsx (100%) rename src/{features => design-system}/icons/__snapshots__/Icon.test.tsx.snap (100%) create mode 100644 src/design-system/icons/index.ts rename src/{features => design-system}/icons/types.ts (100%) delete mode 100644 src/features/icons/index.ts diff --git a/src/features/icons/BookIcon.tsx b/src/design-system/icons/BookIcon.tsx similarity index 100% rename from src/features/icons/BookIcon.tsx rename to src/design-system/icons/BookIcon.tsx diff --git a/src/features/icons/DocumentIcon.tsx b/src/design-system/icons/DocumentIcon.tsx similarity index 100% rename from src/features/icons/DocumentIcon.tsx rename to src/design-system/icons/DocumentIcon.tsx diff --git a/src/features/icons/Icon.stories.tsx b/src/design-system/icons/Icon.stories.tsx similarity index 100% rename from src/features/icons/Icon.stories.tsx rename to src/design-system/icons/Icon.stories.tsx diff --git a/src/features/icons/Icon.test.tsx b/src/design-system/icons/Icon.test.tsx similarity index 100% rename from src/features/icons/Icon.test.tsx rename to src/design-system/icons/Icon.test.tsx diff --git a/src/features/icons/Icon.tsx b/src/design-system/icons/Icon.tsx similarity index 100% rename from src/features/icons/Icon.tsx rename to src/design-system/icons/Icon.tsx diff --git a/src/features/icons/NoteIcon.tsx b/src/design-system/icons/NoteIcon.tsx similarity index 100% rename from src/features/icons/NoteIcon.tsx rename to src/design-system/icons/NoteIcon.tsx diff --git a/src/features/icons/WarnIcon.tsx b/src/design-system/icons/WarnIcon.tsx similarity index 100% rename from src/features/icons/WarnIcon.tsx rename to src/design-system/icons/WarnIcon.tsx diff --git a/src/features/icons/__snapshots__/Icon.test.tsx.snap b/src/design-system/icons/__snapshots__/Icon.test.tsx.snap similarity index 100% rename from src/features/icons/__snapshots__/Icon.test.tsx.snap rename to src/design-system/icons/__snapshots__/Icon.test.tsx.snap diff --git a/src/design-system/icons/index.ts b/src/design-system/icons/index.ts new file mode 100644 index 0000000..688c980 --- /dev/null +++ b/src/design-system/icons/index.ts @@ -0,0 +1 @@ +export { Icon, type IconName } from "./Icon"; diff --git a/src/features/icons/types.ts b/src/design-system/icons/types.ts similarity index 100% rename from src/features/icons/types.ts rename to src/design-system/icons/types.ts diff --git a/src/features/icons/index.ts b/src/features/icons/index.ts deleted file mode 100644 index 65d727b..0000000 --- a/src/features/icons/index.ts +++ /dev/null @@ -1 +0,0 @@ -export { Icon } from "./Icon"; diff --git a/src/features/writings/RelatedWritingsNav/WritingLink/WritingLink.tsx b/src/features/writings/RelatedWritingsNav/WritingLink/WritingLink.tsx index 186eb4f..a7b1f8e 100644 --- a/src/features/writings/RelatedWritingsNav/WritingLink/WritingLink.tsx +++ b/src/features/writings/RelatedWritingsNav/WritingLink/WritingLink.tsx @@ -1,8 +1,8 @@ import { writingLinkStyles } from "./WritingLink.css"; +import { Icon } from "@/design-system/icons"; import { Col, Row } from "@/design-system/layout"; import { Link } from "@/design-system/ui"; import { H4, Span } from "@/design-system/ui/Text/Text"; -import { Icon } from "@/features/icons"; import { writingTypeConfig } from "@/features/writings/_shared/writingType"; import { WritingMeta } from "@/features/writings/types"; diff --git a/src/features/writings/WritingList/WritingBlock/WritingBlock.tsx b/src/features/writings/WritingList/WritingBlock/WritingBlock.tsx index bb85ae6..65631c7 100644 --- a/src/features/writings/WritingList/WritingBlock/WritingBlock.tsx +++ b/src/features/writings/WritingList/WritingBlock/WritingBlock.tsx @@ -1,8 +1,8 @@ import { writingTypeConfig } from "../../_shared/writingType"; import { writingBlockStyles } from "./WritingBlock.css"; +import { Icon } from "@/design-system/icons"; import { Row } from "@/design-system/layout"; import { H3, Link, Text } from "@/design-system/ui"; -import { Icon } from "@/features/icons"; import type { WritingMeta } from "@/features/writings/types"; type WritingBlockProps = { diff --git a/src/features/writings/WritingViewer/WritingHeader/WritingHeader.tsx b/src/features/writings/WritingViewer/WritingHeader/WritingHeader.tsx index df02d21..5f603e5 100644 --- a/src/features/writings/WritingViewer/WritingHeader/WritingHeader.tsx +++ b/src/features/writings/WritingViewer/WritingHeader/WritingHeader.tsx @@ -1,9 +1,9 @@ import { writingTypeConfig } from "../../_shared/writingType"; import type { WritingMeta } from "../../types"; import { writingHeaderStyles } from "./WritingHeader.css"; +import { Icon } from "@/design-system/icons"; import { Center, Col, Row, Spacer } from "@/design-system/layout"; import { H1, Link, Span, Text } from "@/design-system/ui"; -import { Icon } from "@/features/icons"; type WritingHeaderProps = { meta: WritingMeta; diff --git a/src/features/writings/WritingViewer/mdxParts/Note/Note.tsx b/src/features/writings/WritingViewer/mdxParts/Note/Note.tsx index 99d9e7b..11d3713 100644 --- a/src/features/writings/WritingViewer/mdxParts/Note/Note.tsx +++ b/src/features/writings/WritingViewer/mdxParts/Note/Note.tsx @@ -1,6 +1,6 @@ import type { RecipeVariants } from "@vanilla-extract/recipes"; import { noteStyles } from "./Note.css"; -import { Icon } from "@/features/icons"; +import { Icon } from "@/design-system/icons"; type NoteProps = { children: React.ReactNode; diff --git a/src/features/writings/_shared/writingType.ts b/src/features/writings/_shared/writingType.ts index 0a9af52..47361eb 100644 --- a/src/features/writings/_shared/writingType.ts +++ b/src/features/writings/_shared/writingType.ts @@ -1,4 +1,4 @@ -import type { IconName } from "@/features/icons/Icon"; +import type { IconName } from "@/design-system/icons"; import type { WritingType } from "@/features/writings/types"; type WritingTypeConfigItem = { From 729a1ba41eaaccf4b3ca0a8b842177c7204db583 Mon Sep 17 00:00:00 2001 From: Takuya Sakoda Date: Sat, 4 Nov 2023 18:07:56 +0900 Subject: [PATCH 2/3] =?UTF-8?q?=E2=9C=85=20test(utils/array):=20update=20t?= =?UTF-8?q?est=20description?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/utils/array/isIntersect.test.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/utils/array/isIntersect.test.ts b/src/utils/array/isIntersect.test.ts index 8dac4c0..5d2ad04 100644 --- a/src/utils/array/isIntersect.test.ts +++ b/src/utils/array/isIntersect.test.ts @@ -23,7 +23,7 @@ describe("isIntersect", () => { array1: ["4", "8", "12"], array2: ["1", "2", "3", "5", "8"], }, - ])("$1 ∩ $2 /== φ", ({ array1, array2 }) => { + ])("$array1 ∩ $array2 /= φ", ({ array1, array2 }) => { expect(isIntersect(array1, array2)).toBeTruthy(); }); @@ -48,7 +48,7 @@ describe("isIntersect", () => { array1: [], array2: [], }, - ])("$1 ∩ $2 === φ", ({ array1, array2 }) => { + ])("$array1 ∩ $array2 = φ", ({ array1, array2 }) => { expect(isIntersect(array1, array2)).toBeFalsy(); }); }); From 43ed159fd97aaee2534f94151efd5f1807b1aeac Mon Sep 17 00:00:00 2001 From: Takuya Sakoda Date: Sat, 4 Nov 2023 18:15:24 +0900 Subject: [PATCH 3/3] =?UTF-8?q?=E2=9C=A8=20feat(design-system/ui/Link):=20?= =?UTF-8?q?apply=20next=20link?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .eslintrc.cjs | 2 +- src/design-system/ui/Link/Link.tsx | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/.eslintrc.cjs b/.eslintrc.cjs index 1363e26..14062e9 100644 --- a/.eslintrc.cjs +++ b/.eslintrc.cjs @@ -31,7 +31,7 @@ module.exports = { }, { propName: "className", - allowedFor: ["PolymorphicComponent", "Image"], + allowedFor: ["PolymorphicComponent", "Image", "NextLink"], }, ], }, diff --git a/src/design-system/ui/Link/Link.tsx b/src/design-system/ui/Link/Link.tsx index 374cbe5..8766b54 100644 --- a/src/design-system/ui/Link/Link.tsx +++ b/src/design-system/ui/Link/Link.tsx @@ -1,5 +1,6 @@ import React from "react"; import type { RecipeVariants } from "@vanilla-extract/recipes"; +import NextLink from "next/link"; import { linkStyle } from "./Link.css"; type LinkProps = { @@ -16,11 +17,11 @@ export const Link: React.FC = ({ display, }) => { return ( - {children} - + ); };