Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions src/content/Components/Folder/Folder.css
Original file line number Diff line number Diff line change
Expand Up @@ -120,3 +120,9 @@
transform-origin: bottom;
transition: all 0.3s ease-in-out;
}

.folder:focus-visible {
outline: 2px solid #ffffff;
outline-offset: 4px;
border-radius: 10px;
}
17 changes: 16 additions & 1 deletion src/content/Components/Folder/Folder.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,22 @@ const Folder = ({ color = '#5227FF', size = 1, items = [], className = '' }) =>

return (
<div style={scaleStyle} className={className}>
<div className={folderClassName} style={folderStyle} onClick={handleClick}>
<div
className={folderClassName}
style={folderStyle}
onClick={handleClick}
onKeyDown={e => {
if (e.key === 'Enter' || e.key === ' ') {
e.preventDefault();

handleClick();
}
}}
tabIndex={0}
role="button"
aria-expanded={open}
aria-label={open ? 'Close folder' : 'Open folder'}
>
<div className="folder__back">
{papers.map((item, i) => (
<div
Expand Down
13 changes: 12 additions & 1 deletion src/tailwind/Components/Folder/Folder.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -82,14 +82,25 @@ const Folder = ({ color = '#5227FF', size = 1, items = [], className = '' }) =>
return (
<div style={scaleStyle} className={className}>
<div
className={`group relative transition-all duration-200 ease-in cursor-pointer ${
className={`group relative transition-all duration-200 ease-in cursor-pointer focus:outline-none focus-visible:ring-2 focus-visible:ring-white focus-visible:ring-offset-2 ${
!open ? 'hover:-translate-y-2' : ''
}`}
style={{
...folderStyle,
transform: open ? 'translateY(-8px)' : undefined
}}
onClick={handleClick}
onKeyDown={e => {
if (e.key === 'Enter' || e.key === ' ') {
e.preventDefault();

handleClick();
}
}}
tabIndex={0}
role="button"
aria-expanded={open}
aria-label={open ? 'Close folder' : 'Open folder'}
>
<div
className="relative w-[100px] h-[80px] rounded-tl-0 rounded-tr-[10px] rounded-br-[10px] rounded-bl-[10px]"
Expand Down
6 changes: 6 additions & 0 deletions src/ts-default/Components/Folder/Folder.css
Original file line number Diff line number Diff line change
Expand Up @@ -120,3 +120,9 @@
transform-origin: bottom;
transition: all 0.3s ease-in-out;
}

.folder:focus-visible {
outline: 2px solid #ffffff;
outline-offset: 4px;
border-radius: 10px;
}
16 changes: 15 additions & 1 deletion src/ts-default/Components/Folder/Folder.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,21 @@ const Folder: React.FC<FolderProps> = ({ color = '#5227FF', size = 1, items = []

return (
<div style={scaleStyle} className={className}>
<div className={folderClassName} style={folderStyle} onClick={handleClick}>
<div
className={folderClassName}
style={folderStyle}
onClick={handleClick}
onKeyDown={e => {
if (e.key === 'Enter' || e.key === ' ') {
e.preventDefault();
handleClick();
}
}}
tabIndex={0}
role="button"
aria-expanded={open}
aria-label={open ? 'Close folder' : 'Open folder'}
>
<div className="folder__back">
{papers.map((item, i) => (
<div
Expand Down
12 changes: 11 additions & 1 deletion src/ts-tailwind/Components/Folder/Folder.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -91,14 +91,24 @@ const Folder: React.FC<FolderProps> = ({ color = '#5227FF', size = 1, items = []
return (
<div style={scaleStyle} className={className}>
<div
className={`group relative transition-all duration-200 ease-in cursor-pointer ${
className={`group relative transition-all duration-200 ease-in cursor-pointer focus:outline-none focus-visible:ring-2 focus-visible:ring-white focus-visible:ring-offset-2 ${
!open ? 'hover:-translate-y-2' : ''
}`}
style={{
...folderStyle,
transform: open ? 'translateY(-8px)' : undefined
}}
onClick={handleClick}
onKeyDown={e => {
if (e.key === 'Enter' || e.key === ' ') {
e.preventDefault();
handleClick();
}
}}
tabIndex={0}
role="button"
aria-expanded={open}
aria-label={open ? 'Close folder' : 'Open folder'}
>
<div
className="relative w-[100px] h-[80px] rounded-tl-0 rounded-tr-[10px] rounded-br-[10px] rounded-bl-[10px]"
Expand Down