mirror of
https://github.com/movie-web/movie-web.git
synced 2024-11-13 10:35:08 +01:00
mediagrid focus styles
This commit is contained in:
parent
dccc8c363c
commit
9f65821fce
@ -42,9 +42,11 @@ function MediaCardContent({
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<Flare.Base
|
<Flare.Base
|
||||||
className={`group -m-3 mb-2 rounded-xl bg-background-main transition-colors duration-100 ${
|
className={`group -m-3 mb-2 rounded-xl bg-background-main transition-colors duration-100 focus:relative focus:z-10 ${
|
||||||
canLink ? "hover:bg-mediaCard-hoverBackground" : ""
|
canLink ? "hover:bg-mediaCard-hoverBackground tabbable" : ""
|
||||||
}`}
|
}`}
|
||||||
|
tabIndex={canLink ? 0 : -1}
|
||||||
|
onKeyUp={(e) => e.key === "Enter" && e.currentTarget.click()}
|
||||||
>
|
>
|
||||||
<Flare.Light
|
<Flare.Light
|
||||||
flareSize={300}
|
flareSize={300}
|
||||||
@ -157,6 +159,7 @@ export function MediaCard(props: MediaCardProps) {
|
|||||||
return (
|
return (
|
||||||
<Link
|
<Link
|
||||||
to={link}
|
to={link}
|
||||||
|
tabIndex={-1}
|
||||||
className={classNames(
|
className={classNames(
|
||||||
"tabbable",
|
"tabbable",
|
||||||
props.closable ? "hover:cursor-default" : ""
|
props.closable ? "hover:cursor-default" : ""
|
||||||
|
@ -13,8 +13,21 @@ export interface FlareProps {
|
|||||||
const SIZE_DEFAULT = 200;
|
const SIZE_DEFAULT = 200;
|
||||||
const CSS_VAR_DEFAULT = "--colors-global-accentA";
|
const CSS_VAR_DEFAULT = "--colors-global-accentA";
|
||||||
|
|
||||||
function Base(props: { className?: string; children?: ReactNode }) {
|
function Base(props: {
|
||||||
return <div className={c(props.className, "relative")}>{props.children}</div>;
|
className?: string;
|
||||||
|
children?: ReactNode;
|
||||||
|
tabIndex?: number;
|
||||||
|
onKeyUp?: (e: React.KeyboardEvent<HTMLDivElement>) => void;
|
||||||
|
}) {
|
||||||
|
return (
|
||||||
|
<div
|
||||||
|
tabIndex={props.tabIndex}
|
||||||
|
className={c(props.className, "relative")}
|
||||||
|
onKeyUp={props.onKeyUp}
|
||||||
|
>
|
||||||
|
{props.children}
|
||||||
|
</div>
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
function Child(props: { className?: string; children?: ReactNode }) {
|
function Child(props: { className?: string; children?: ReactNode }) {
|
||||||
|
Loading…
Reference in New Issue
Block a user