Skip to content

Spinnerの修正 - #115

Merged
touyou merged 2 commits into
mainfrom
fix/spinner
Jul 30, 2025
Merged

Spinnerの修正#115
touyou merged 2 commits into
mainfrom
fix/spinner

Conversation

@touyou

@touyou touyou commented Jul 28, 2025

Copy link
Copy Markdown
Member
  • Introduced a new size prop in the Spinner component to allow dynamic sizing via a range control in the storybook.
  • Updated the default size in the Spinner story to 6.
  • Modified the Spinner's className to include a default text color for better visibility.

feat(tooltip): add Tooltip component with content and trigger

  • Implemented a new Tooltip component using Radix UI for displaying additional information.
  • Created TooltipContent and TooltipTrigger components for better structure and usage.
  • Added TypeScript types for props to enhance developer experience and type safety.

概要

以下の指摘の修正と調整
https://www.notion.so/goodpatch-design-div/Spinner-f909cf8005bb4beeb715ccac69f99e95?source=copy_link

変更内容

  • 色の修正
  • Storybookの整備
  • registryの更新

動作確認

  • pnpm lint を実行
  • pnpm build:package を実行してプロジェクトが正常にビルドされることを確認
  • pnpm test を実行してテストがすべて成功することを確認

関連 Issue

- Introduced a new `size` prop in the Spinner component to allow dynamic sizing via a range control in the storybook.
- Updated the default size in the Spinner story to 6.
- Modified the Spinner's className to include a default text color for better visibility.

feat(tooltip): add Tooltip component with content and trigger

- Implemented a new Tooltip component using Radix UI for displaying additional information.
- Created TooltipContent and TooltipTrigger components for better structure and usage.
- Added TypeScript types for props to enhance developer experience and type safety.
@touyou
touyou requested a review from ore0 July 28, 2025 02:54
@touyou touyou self-assigned this Jul 28, 2025
Copilot AI review requested due to automatic review settings July 28, 2025 02:54
@vercel

vercel Bot commented Jul 28, 2025

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
sparkle-design ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jul 28, 2025 5:31am

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

このPRはSpinnerコンポーネントの修正とTooltipコンポーネントの追加を含む包括的な更新を行っています。主にUI改善とコンポーネントライブラリの拡張に焦点を当てています。

  • Spinnerコンポーネントの視認性向上とStorybook設定の改善
  • 新しいTooltipコンポーネントの実装とRadix UIの活用
  • registryファイルの整理と更新

Reviewed Changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
src/components/ui/spinner/index.tsx デフォルトテキスト色(text-text-low)を追加して視認性を向上
src/components/ui/spinner/index.stories.tsx StorybookのargTypes設定をsize propのrange controlに変更し、デフォルト値を6に設定
registry.json コンポーネント定義の整理とTooltipコンポーネントの追加
public/r/tooltip.json Radix UIベースの新しいTooltipコンポーネントの実装
public/r/spinner.json Spinnerコンポーネントのtext-text-lowクラス追加を反映
public/r/registry.json メインregistryファイルとの同期更新

Comment thread public/r/tooltip.json
"type": "registry:component",
"title": "Tooltip",
"description": "ツールチップは情報を一時的に補足するために使用するコンポーネントです。",
"dependencies": [],

Copilot AI Jul 28, 2025

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The Tooltip component uses Radix UI (as shown in the imports), but the dependencies array is empty. It should include "@radix-ui/react-tooltip" as a dependency.

Copilot uses AI. Check for mistakes.
Comment thread public/r/tooltip.json
"files": [
{
"path": "src/components/ui/tooltip/index.tsx",
"content": "\"use client\";\n\nimport * as React from \"react\";\nimport { Tooltip as TooltipPrimitive } from \"radix-ui\";\nimport { cn } from \"@/lib/utils\";\n\n/**\n * TooltipContentコンポーネントのプロパティ型\n * en: Props type for TooltipContent component\n */\ninterface TooltipContentProps\n extends React.ComponentProps<typeof TooltipPrimitive.Content> {\n /**\n * ツールチップの表示位置を指定します。\n * en: Specifies the position of the tooltip (top, right, bottom, left).\n */\n side?: \"top\" | \"right\" | \"bottom\" | \"left\";\n\n /**\n * トリガー要素とツールチップの間の距離を指定します。\n * en: Specifies the distance between the trigger element and the tooltip.\n */\n sideOffset?: number;\n}\n\n/**\n * TooltipProvider コンポーネント\n * en: TooltipProvider component\n */\nfunction TooltipProvider({\n delayDuration = 0,\n ...props\n}: React.ComponentProps<typeof TooltipPrimitive.Provider>) {\n return (\n <TooltipPrimitive.Provider\n data-slot=\"tooltip-provider\"\n delayDuration={delayDuration}\n {...props}\n />\n );\n}\n\n/**\n * Tooltip コンポーネント\n * en: Tooltip component\n */\nfunction Tooltip({\n ...props\n}: React.ComponentProps<typeof TooltipPrimitive.Root>) {\n return (\n <TooltipProvider>\n <TooltipPrimitive.Root data-slot=\"tooltip\" {...props} />\n </TooltipProvider>\n );\n}\n\n/**\n * TooltipTrigger コンポーネント\n * en: TooltipTrigger component\n */\nfunction TooltipTrigger({\n ...props\n}: React.ComponentProps<typeof TooltipPrimitive.Trigger>) {\n return <TooltipPrimitive.Trigger data-slot=\"tooltip-trigger\" {...props} />;\n}\n\n/**\n * **概要 / Overview**\n *\n * - ツールチップは情報を一時的に補足するために使用するコンポーネントです。\n * - en: The Tooltip component is used to provide additional information temporarily.\n *\n * **使用例 / Usage Example**\n *\n * ```tsx\n * <Tooltip>\n * <TooltipTrigger>Tooltip Trigger</TooltipTrigger>\n * <TooltipContent>Tooltip Content</TooltipContent>\n * </Tooltip>\n * ```\n *\n * @param {ButtonProps} props\n */\nfunction TooltipContent({\n className,\n side = \"top\",\n sideOffset = 0,\n children,\n ...props\n}: TooltipContentProps) {\n return (\n <TooltipPrimitive.Portal>\n <TooltipPrimitive.Content\n data-slot=\"tooltip-content\"\n side={side}\n sideOffset={sideOffset}\n className={cn(\n \"bg-neutral-900 shadow-float animate-in fade-in-0 zoom-in-95\",\n \"data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95\",\n \"data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2\",\n \"data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2\",\n \"z-50 w-fit origin-[--radix-tooltip-content-transform-origin] rounded-notice\",\n \"px-2 py-1 character-2-regular-pro text-white\",\n className\n )}\n {...props}\n >\n {children}\n <TooltipPrimitive.Arrow className=\"bg-neutral-900 fill-neutral-900 shadow-float z-50 size-3 translate-y-[calc(-50%_-_1px)] rotate-45 rounded-xs\" />\n </TooltipPrimitive.Content>\n </TooltipPrimitive.Portal>\n );\n}\n\nexport { Tooltip, TooltipTrigger, TooltipContent, TooltipProvider };\n",

Copilot AI Jul 28, 2025

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The import statement 'import { Tooltip as TooltipPrimitive } from "radix-ui";' is incorrect. It should be 'import * as TooltipPrimitive from "@radix-ui/react-tooltip";' to properly import Radix UI tooltip components.

Copilot uses AI. Check for mistakes.
Comment thread public/r/tooltip.json
"files": [
{
"path": "src/components/ui/tooltip/index.tsx",
"content": "\"use client\";\n\nimport * as React from \"react\";\nimport { Tooltip as TooltipPrimitive } from \"radix-ui\";\nimport { cn } from \"@/lib/utils\";\n\n/**\n * TooltipContentコンポーネントのプロパティ型\n * en: Props type for TooltipContent component\n */\ninterface TooltipContentProps\n extends React.ComponentProps<typeof TooltipPrimitive.Content> {\n /**\n * ツールチップの表示位置を指定します。\n * en: Specifies the position of the tooltip (top, right, bottom, left).\n */\n side?: \"top\" | \"right\" | \"bottom\" | \"left\";\n\n /**\n * トリガー要素とツールチップの間の距離を指定します。\n * en: Specifies the distance between the trigger element and the tooltip.\n */\n sideOffset?: number;\n}\n\n/**\n * TooltipProvider コンポーネント\n * en: TooltipProvider component\n */\nfunction TooltipProvider({\n delayDuration = 0,\n ...props\n}: React.ComponentProps<typeof TooltipPrimitive.Provider>) {\n return (\n <TooltipPrimitive.Provider\n data-slot=\"tooltip-provider\"\n delayDuration={delayDuration}\n {...props}\n />\n );\n}\n\n/**\n * Tooltip コンポーネント\n * en: Tooltip component\n */\nfunction Tooltip({\n ...props\n}: React.ComponentProps<typeof TooltipPrimitive.Root>) {\n return (\n <TooltipProvider>\n <TooltipPrimitive.Root data-slot=\"tooltip\" {...props} />\n </TooltipProvider>\n );\n}\n\n/**\n * TooltipTrigger コンポーネント\n * en: TooltipTrigger component\n */\nfunction TooltipTrigger({\n ...props\n}: React.ComponentProps<typeof TooltipPrimitive.Trigger>) {\n return <TooltipPrimitive.Trigger data-slot=\"tooltip-trigger\" {...props} />;\n}\n\n/**\n * **概要 / Overview**\n *\n * - ツールチップは情報を一時的に補足するために使用するコンポーネントです。\n * - en: The Tooltip component is used to provide additional information temporarily.\n *\n * **使用例 / Usage Example**\n *\n * ```tsx\n * <Tooltip>\n * <TooltipTrigger>Tooltip Trigger</TooltipTrigger>\n * <TooltipContent>Tooltip Content</TooltipContent>\n * </Tooltip>\n * ```\n *\n * @param {ButtonProps} props\n */\nfunction TooltipContent({\n className,\n side = \"top\",\n sideOffset = 0,\n children,\n ...props\n}: TooltipContentProps) {\n return (\n <TooltipPrimitive.Portal>\n <TooltipPrimitive.Content\n data-slot=\"tooltip-content\"\n side={side}\n sideOffset={sideOffset}\n className={cn(\n \"bg-neutral-900 shadow-float animate-in fade-in-0 zoom-in-95\",\n \"data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95\",\n \"data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2\",\n \"data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2\",\n \"z-50 w-fit origin-[--radix-tooltip-content-transform-origin] rounded-notice\",\n \"px-2 py-1 character-2-regular-pro text-white\",\n className\n )}\n {...props}\n >\n {children}\n <TooltipPrimitive.Arrow className=\"bg-neutral-900 fill-neutral-900 shadow-float z-50 size-3 translate-y-[calc(-50%_-_1px)] rotate-45 rounded-xs\" />\n </TooltipPrimitive.Content>\n </TooltipPrimitive.Portal>\n );\n}\n\nexport { Tooltip, TooltipTrigger, TooltipContent, TooltipProvider };\n",

Copilot AI Jul 28, 2025

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The JSDoc comment incorrectly references 'ButtonProps' for the TooltipContent component. It should reference 'TooltipContentProps' instead.

Copilot uses AI. Check for mistakes.
- Sizeコンポーネントのrender関数をargsを使用するように変更
- Spinnerコンポーネントのサイズを動的に設定

@ore0 ore0 left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTMです!ご対応ありがとうございます!!

@touyou
touyou merged commit 8becd49 into main Jul 30, 2025
3 checks passed
@touyou
touyou deleted the fix/spinner branch July 30, 2025 09:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants