From 73efef6809e0aea35b60f41e1cb8783649db11ad Mon Sep 17 00:00:00 2001 From: saebyn Date: Tue, 11 Feb 2025 16:19:08 -0800 Subject: [PATCH 1/8] refactor: remove unused copy plugin from rollup configuration --- rollup.config.mjs | 1 - 1 file changed, 1 deletion(-) diff --git a/rollup.config.mjs b/rollup.config.mjs index 9e79408..95d8e44 100644 --- a/rollup.config.mjs +++ b/rollup.config.mjs @@ -4,7 +4,6 @@ import json from '@rollup/plugin-json'; import postcss from 'rollup-plugin-postcss'; import postcssImport from 'postcss-import'; import postcssUrl from 'postcss-url'; -import copy from 'rollup-plugin-copy'; import tailwind from 'tailwindcss'; import nodeResolve from '@rollup/plugin-node-resolve'; import commonjs from '@rollup/plugin-commonjs'; From e20bf5534aa83fec9be97514057c8a0d59345270 Mon Sep 17 00:00:00 2001 From: saebyn Date: Tue, 11 Feb 2025 16:19:27 -0800 Subject: [PATCH 2/8] feat: add key press handler to Button and IconButton components --- src/components/atoms/Button.tsx | 15 +++++++++++++++ src/components/atoms/IconButton.tsx | 1 + 2 files changed, 16 insertions(+) diff --git a/src/components/atoms/Button.tsx b/src/components/atoms/Button.tsx index 90b0c90..246a8cb 100644 --- a/src/components/atoms/Button.tsx +++ b/src/components/atoms/Button.tsx @@ -4,16 +4,31 @@ function Button({ children, variant = "default", className, + onClick, ...props }: React.ComponentPropsWithoutRef<"button"> & { children: React.ReactNode; className?: string; + onClick?: () => void; variant?: "primary" | "danger" | "secondary" | "default"; }) { const variantClass = getVariantClass(variant); + const handleClick = () => { + onClick?.(); + }; + + const handleKeyDown = (e: React.KeyboardEvent) => { + if (e.key === "Enter") { + onClick?.(); + } + }; + return ( + + + Highlights From 9718b02cc7ebc2ad63c3a36a7f97e60d02581a79 Mon Sep 17 00:00:00 2001 From: saebyn Date: Tue, 11 Feb 2025 16:23:26 -0800 Subject: [PATCH 7/8] feat: add onSeekToTime action to ClipSelectionDialog stories --- src/components/molecules/ClipSelectionDialog.stories.tsx | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/components/molecules/ClipSelectionDialog.stories.tsx b/src/components/molecules/ClipSelectionDialog.stories.tsx index 76f7455..25c5d92 100644 --- a/src/components/molecules/ClipSelectionDialog.stories.tsx +++ b/src/components/molecules/ClipSelectionDialog.stories.tsx @@ -30,6 +30,7 @@ export const Default = () => { onClear={action("onClear")} onRemove={action("onRemove")} onReorder={action("onReorder")} + onSeekToTime={action("onSeekToTime")} /> ); }; @@ -61,6 +62,7 @@ export const MultipleCuts = () => { onClear={action("onClear")} onRemove={action("onRemove")} onReorder={action("onReorder")} + onSeekToTime={action("onSeekToTime")} /> ); }; From 6279de88af2ab7f34cd768e9bb96b4c241b50ad9 Mon Sep 17 00:00:00 2001 From: saebyn Date: Tue, 11 Feb 2025 16:28:51 -0800 Subject: [PATCH 8/8] feat: enhance Button component to support space key activation --- src/components/atoms/Button.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/components/atoms/Button.tsx b/src/components/atoms/Button.tsx index 246a8cb..a48c618 100644 --- a/src/components/atoms/Button.tsx +++ b/src/components/atoms/Button.tsx @@ -19,7 +19,7 @@ function Button({ }; const handleKeyDown = (e: React.KeyboardEvent) => { - if (e.key === "Enter") { + if (e.key === "Enter" || e.key === " ") { onClick?.(); } }; @@ -29,6 +29,7 @@ function Button({ onClick={handleClick} onKeyDown={handleKeyDown} tabIndex={props.tabIndex ?? 0} + type="button" className={`mx-2 rounded px-5 py-3 max-h-12 ${variantClass} disabled:bg-gray-200 disabled:text-gray-400 disabled:cursor-not-allowed disabled:hover:bg-gray-200 disabled:hover:text-gray-400 disabled:active:bg-gray-200 disabled:active:text-gray-400 disabled:dark:bg-gray-700 disabled:dark:text-gray-400 disabled:dark:hover:bg-gray-700 disabled:dark:hover:text-gray-400 disabled:dark:active:bg-gray-700 disabled:dark:active:text-gray-400 ${className}`} {...props} >