mirror of
https://github.com/shumaiOne/shumai.git
synced 2026-12-03 06:24:30 +00:00
feat(ui): update sidebar icons and alignment
This commit is contained in:
@@ -97,8 +97,8 @@ export const DualSidebar: React.FC<DualSidebarProps> = ({ children }) => {
|
|||||||
>
|
>
|
||||||
<div className="absolute bottom-0 w-full h-[70dvh] bg-linear-to-t from-orange-400/10 to-transparent"></div>
|
<div className="absolute bottom-0 w-full h-[70dvh] bg-linear-to-t from-orange-400/10 to-transparent"></div>
|
||||||
{/* Level 1: Icon Bar */}
|
{/* Level 1: Icon Bar */}
|
||||||
<nav className="w-16 bg-slate-100 dark:bg-slate-900 border-r border-slate-200 dark:border-slate-800 flex flex-col items-center pb-4 pt-2 space-y-2 flex-shrink-0">
|
<nav className="w-16 bg-slate-100 dark:bg-slate-900 border-r border-slate-200 dark:border-slate-800 flex flex-col items-center pb-4 pt-0 space-y-2 flex-shrink-0">
|
||||||
<div className="flex-1 space-y-2">
|
<div className="flex-1 w-full flex flex-col items-center space-y-5">
|
||||||
{sidebarItems.map((item, index) => (
|
{sidebarItems.map((item, index) => (
|
||||||
<div key={item.props.label} className="relative group">
|
<div key={item.props.label} className="relative group">
|
||||||
<button
|
<button
|
||||||
@@ -108,7 +108,7 @@ export const DualSidebar: React.FC<DualSidebarProps> = ({ children }) => {
|
|||||||
className={`p-3 rounded-lg transition-all duration-200 outline-none focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:ring-blue-500 dark:focus-visible:ring-offset-slate-900 ${
|
className={`p-3 rounded-lg transition-all duration-200 outline-none focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:ring-blue-500 dark:focus-visible:ring-offset-slate-900 ${
|
||||||
activeItem === index
|
activeItem === index
|
||||||
? 'bg-blue-600 text-white shadow-lg'
|
? 'bg-blue-600 text-white shadow-lg'
|
||||||
: 'text-slate-500 hover:bg-slate-200 dark:hover:bg-slate-800 dark:text-slate-400'
|
: 'text-slate-400 hover:text-slate-500 dark:hover:text-slate-400 dark:text-slate-500 cursor-pointer'
|
||||||
}`}
|
}`}
|
||||||
>
|
>
|
||||||
{item.props.icon}
|
{item.props.icon}
|
||||||
@@ -122,7 +122,7 @@ export const DualSidebar: React.FC<DualSidebarProps> = ({ children }) => {
|
|||||||
</div>
|
</div>
|
||||||
))}
|
))}
|
||||||
</div>
|
</div>
|
||||||
<div className="mt-auto">
|
<div className="mt-auto w-full flex flex-col items-center">
|
||||||
<UserMenu />
|
<UserMenu />
|
||||||
</div>
|
</div>
|
||||||
</nav>
|
</nav>
|
||||||
|
|||||||
@@ -1,19 +1,19 @@
|
|||||||
import React, { type SVGProps } from "react";
|
import React, { type SVGProps } from 'react'
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Common props for the icons, extending standard SVG attributes.
|
* Common props for the icons, extending standard SVG attributes.
|
||||||
*/
|
*/
|
||||||
type IconProps = SVGProps<SVGSVGElement>;
|
type IconProps = SVGProps<SVGSVGElement>
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Shared props for consistent styling across this icon set.
|
* Shared props for consistent styling across this icon set.
|
||||||
* Uses the Material Symbols coordinate system.
|
* Uses the Material Symbols coordinate system.
|
||||||
*/
|
*/
|
||||||
const defaultProps: IconProps = {
|
const defaultProps: IconProps = {
|
||||||
viewBox: "0 -960 960 960",
|
viewBox: '0 -960 960 960',
|
||||||
fill: "currentColor",
|
fill: 'currentColor',
|
||||||
xmlns: "http://www.w3.org/2000/svg",
|
xmlns: 'http://www.w3.org/2000/svg',
|
||||||
};
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Icon: Dock To Left (Outline)
|
* Icon: Dock To Left (Outline)
|
||||||
@@ -23,7 +23,7 @@ export const DockToLeft: React.FC<IconProps> = (props) => (
|
|||||||
<svg {...defaultProps} {...props}>
|
<svg {...defaultProps} {...props}>
|
||||||
<path d="M200-120q-33 0-56.5-23.5T120-200v-560q0-33 23.5-56.5T200-840h560q33 0 56.5 23.5T840-760v560q0 33-23.5 56.5T760-120H200Zm120-80v-560H200v560h120Zm80 0h360v-560H400v560Z" />
|
<path d="M200-120q-33 0-56.5-23.5T120-200v-560q0-33 23.5-56.5T200-840h560q33 0 56.5 23.5T840-760v560q0 33-23.5 56.5T760-120H200Zm120-80v-560H200v560h120Zm80 0h360v-560H400v560Z" />
|
||||||
</svg>
|
</svg>
|
||||||
);
|
)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Icon: Dock To Right (Outline)
|
* Icon: Dock To Right (Outline)
|
||||||
@@ -33,7 +33,7 @@ export const DockToRight: React.FC<IconProps> = (props) => (
|
|||||||
<svg {...defaultProps} {...props}>
|
<svg {...defaultProps} {...props}>
|
||||||
<path d="M200-120q-33 0-56.5-23.5T120-200v-560q0-33 23.5-56.5T200-840h560q33 0 56.5 23.5T840-760v560q0 33-23.5 56.5T760-120H200Zm360-80v-560H200v560h360Zm200 0v-560H640v560h120Z" />
|
<path d="M200-120q-33 0-56.5-23.5T120-200v-560q0-33 23.5-56.5T200-840h560q33 0 56.5 23.5T840-760v560q0 33-23.5 56.5T760-120H200Zm360-80v-560H200v560h360Zm200 0v-560H640v560h120Z" />
|
||||||
</svg>
|
</svg>
|
||||||
);
|
)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Icon: Dock To Left (Filled)
|
* Icon: Dock To Left (Filled)
|
||||||
@@ -43,7 +43,7 @@ export const DockToLeftFilled: React.FC<IconProps> = (props) => (
|
|||||||
<svg {...defaultProps} {...props}>
|
<svg {...defaultProps} {...props}>
|
||||||
<path d="M200-120q-33 0-56.5-23.5T120-200v-560q0-33 23.5-56.5T200-840h560q33 0 56.5 23.5T840-760v560q0 33-23.5 56.5T760-120H200Zm560-80v-560H400v560h360Z" />
|
<path d="M200-120q-33 0-56.5-23.5T120-200v-560q0-33 23.5-56.5T200-840h560q33 0 56.5 23.5T840-760v560q0 33-23.5 56.5T760-120H200Zm560-80v-560H400v560h360Z" />
|
||||||
</svg>
|
</svg>
|
||||||
);
|
)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Icon: Dock To Right (Filled)
|
* Icon: Dock To Right (Filled)
|
||||||
@@ -53,15 +53,13 @@ export const DockToRightFilled: React.FC<IconProps> = (props) => (
|
|||||||
<svg {...defaultProps} {...props}>
|
<svg {...defaultProps} {...props}>
|
||||||
<path d="M200-120q-33 0-56.5-23.5T120-200v-560q0-33 23.5-56.5T200-840h560q33 0 56.5 23.5T840-760v560q0 33-23.5 56.5T760-120H200Zm360-80v-560H200v560h360Z" />
|
<path d="M200-120q-33 0-56.5-23.5T120-200v-560q0-33 23.5-56.5T200-840h560q33 0 56.5 23.5T840-760v560q0 33-23.5 56.5T760-120H200Zm360-80v-560H200v560h360Z" />
|
||||||
</svg>
|
</svg>
|
||||||
);
|
)
|
||||||
|
|
||||||
export const NotificationFillIcon: React.FC<React.SVGProps<SVGSVGElement>> = (
|
export const NotificationFillIcon: React.FC<React.SVGProps<SVGSVGElement>> = (props) => (
|
||||||
props,
|
|
||||||
) => (
|
|
||||||
<svg
|
<svg
|
||||||
xmlns="http://www.w3.org/2000/svg"
|
xmlns="http://www.w3.org/2000/svg"
|
||||||
width={24}
|
width={30}
|
||||||
height={24}
|
height={30}
|
||||||
viewBox="0 -960 960 960"
|
viewBox="0 -960 960 960"
|
||||||
fill="none"
|
fill="none"
|
||||||
aria-hidden="true"
|
aria-hidden="true"
|
||||||
@@ -73,13 +71,12 @@ export const NotificationFillIcon: React.FC<React.SVGProps<SVGSVGElement>> = (
|
|||||||
clipRule="evenodd"
|
clipRule="evenodd"
|
||||||
d="M160-200v-80h80v-280q0-83 50-147.5T420-792v-28q0-25 17.5-42.5T480-880q25 0 42.5 17.5T540-820v28q80 20 130 84.5T720-560v280h80v80H160ZM480-80q-33 0-56.5-23.5T400-160h160q0 33-23.5 56.5T480-80Z"
|
d="M160-200v-80h80v-280q0-83 50-147.5T420-792v-28q0-25 17.5-42.5T480-880q25 0 42.5 17.5T540-820v28q80 20 130 84.5T720-560v280h80v80H160ZM480-80q-33 0-56.5-23.5T400-160h160q0 33-23.5 56.5T480-80Z"
|
||||||
fill="currentColor"
|
fill="currentColor"
|
||||||
|
transform="translate(0, -48) scale(1, 0.9)"
|
||||||
/>
|
/>
|
||||||
</svg>
|
</svg>
|
||||||
);
|
)
|
||||||
|
|
||||||
export const DrawAnnotation: React.FC<React.SVGProps<SVGSVGElement>> = (
|
export const DrawAnnotation: React.FC<React.SVGProps<SVGSVGElement>> = (props) => (
|
||||||
props,
|
|
||||||
) => (
|
|
||||||
<svg
|
<svg
|
||||||
xmlns="http://www.w3.org/2000/svg"
|
xmlns="http://www.w3.org/2000/svg"
|
||||||
width={24}
|
width={24}
|
||||||
@@ -103,16 +100,11 @@ export const DrawAnnotation: React.FC<React.SVGProps<SVGSVGElement>> = (
|
|||||||
fill="currentColor"
|
fill="currentColor"
|
||||||
/>
|
/>
|
||||||
</svg>
|
</svg>
|
||||||
);
|
)
|
||||||
|
|
||||||
export const ShumaiLogo: React.FC<React.SVGProps<SVGSVGElement>> = (props) => {
|
export const ShumaiLogo: React.FC<React.SVGProps<SVGSVGElement>> = (props) => {
|
||||||
return (
|
return (
|
||||||
<svg
|
<svg viewBox="0 0 100 100" fill="none" xmlns="http://www.w3.org/2000/svg" {...props}>
|
||||||
viewBox="0 0 100 100"
|
|
||||||
fill="none"
|
|
||||||
xmlns="http://www.w3.org/2000/svg"
|
|
||||||
{...props}
|
|
||||||
>
|
|
||||||
<defs>
|
<defs>
|
||||||
<clipPath id="bg-clip">
|
<clipPath id="bg-clip">
|
||||||
<rect x="5" y="5" width="90" height="90" rx="22" />
|
<rect x="5" y="5" width="90" height="90" rx="22" />
|
||||||
@@ -130,25 +122,16 @@ export const ShumaiLogo: React.FC<React.SVGProps<SVGSVGElement>> = (props) => {
|
|||||||
/>
|
/>
|
||||||
|
|
||||||
{/* Left Cream */}
|
{/* Left Cream */}
|
||||||
<path
|
<path d="M 25 30 Q 38 36 50 42 L 35 55 L 35 75 L 20 60 Z" fill="#FDF0D5" />
|
||||||
d="M 25 30 Q 38 36 50 42 L 35 55 L 35 75 L 20 60 Z"
|
|
||||||
fill="#FDF0D5"
|
|
||||||
/>
|
|
||||||
|
|
||||||
{/* Right Orange */}
|
{/* Right Orange */}
|
||||||
<path
|
<path d="M 50 42 Q 62 36 75 30 L 80 60 L 65 75 L 65 55 Z" fill="#E77A65" />
|
||||||
d="M 50 42 Q 62 36 75 30 L 80 60 L 65 75 L 65 55 Z"
|
|
||||||
fill="#E77A65"
|
|
||||||
/>
|
|
||||||
|
|
||||||
{/* Front Peach */}
|
{/* Front Peach */}
|
||||||
<path d="M 35 75 L 65 75 L 65 55 L 50 42 L 35 55 Z" fill="#F5B895" />
|
<path d="M 35 75 L 65 75 L 65 55 L 50 42 L 35 55 Z" fill="#F5B895" />
|
||||||
|
|
||||||
{/* Top Pink */}
|
{/* Top Pink */}
|
||||||
<path
|
<path d="M 50 42 Q 38 36 25 30 Q 38 26 50 20 Q 62 26 75 30 Q 62 36 50 42 Z" fill="#F4B8B8" />
|
||||||
d="M 50 42 Q 38 36 25 30 Q 38 26 50 20 Q 62 26 75 30 Q 62 36 50 42 Z"
|
|
||||||
fill="#F4B8B8"
|
|
||||||
/>
|
|
||||||
|
|
||||||
{/* Hole Left */}
|
{/* Hole Left */}
|
||||||
<path d="M 50 25 L 42 30 L 50 35 Z" fill="#E57A5F" />
|
<path d="M 50 25 L 42 30 L 50 35 Z" fill="#E57A5F" />
|
||||||
@@ -156,5 +139,24 @@ export const ShumaiLogo: React.FC<React.SVGProps<SVGSVGElement>> = (props) => {
|
|||||||
{/* Hole Right */}
|
{/* Hole Right */}
|
||||||
<path d="M 50 25 L 58 30 L 50 35 Z" fill="#C2523C" />
|
<path d="M 50 25 L 58 30 L 50 35 Z" fill="#C2523C" />
|
||||||
</svg>
|
</svg>
|
||||||
);
|
)
|
||||||
};
|
}
|
||||||
|
|
||||||
|
export const HomeIcon: React.FC<React.SVGProps<SVGSVGElement>> = (props) => (
|
||||||
|
<svg
|
||||||
|
xmlns="http://www.w3.org/2000/svg"
|
||||||
|
viewBox="0 0 200 200"
|
||||||
|
width={30}
|
||||||
|
height={30}
|
||||||
|
fill="none"
|
||||||
|
aria-hidden="true"
|
||||||
|
focusable="false"
|
||||||
|
{...props}
|
||||||
|
>
|
||||||
|
<path
|
||||||
|
d="M 44 170 L 44 100 L 24 100 L 100 30 L 126 54 L 126 36 L 142 36 L 142 69 L 176 100 L 156 100 L 156 170 L 120 170 L 120 136 A 20 20 0 0 0 80 136 L 80 170 Z"
|
||||||
|
fill="currentColor"
|
||||||
|
transform="scale(1, 0.95)"
|
||||||
|
/>
|
||||||
|
</svg>
|
||||||
|
)
|
||||||
|
|||||||
@@ -1,131 +1,48 @@
|
|||||||
import React, { useId } from "react";
|
import React from 'react'
|
||||||
|
|
||||||
interface UploadCloudIconProps extends React.SVGProps<SVGSVGElement> {
|
interface UploadCloudIconProps extends React.SVGProps<SVGSVGElement> {
|
||||||
uploading?: boolean;
|
uploading?: boolean
|
||||||
className?: string;
|
className?: string
|
||||||
}
|
}
|
||||||
|
|
||||||
const CLOUD_PATH =
|
/**
|
||||||
"M17.5 19C19.9853 19 22 16.9853 22 14.5C22 12.132 20.177 10.244 17.819 10.035C17.65 6.94 15.11 4.5 12 4.5C9.22 4.5 6.91 6.47 6.32 9.1C3.89 9.5 2 11.5 2 14C2 16.76 4.24 19 7 19H17.5Z";
|
* Custom UploadCloudIcon component.
|
||||||
const ARROW_PATH = "M12 6.5L16 10.5L14.6 11.9L12 9.3L9.4 11.9L8 10.5L12 6.5Z";
|
* Replaces the animated version with a custom SVG while maintaining prop compatibility.
|
||||||
|
*/
|
||||||
export function UploadCloudIcon({
|
export function UploadCloudIcon({
|
||||||
uploading = false,
|
uploading = false,
|
||||||
className = "",
|
className = '',
|
||||||
...props
|
...props
|
||||||
}: UploadCloudIconProps) {
|
}: UploadCloudIconProps) {
|
||||||
const id = useId();
|
|
||||||
const safeId = id.replace(/:/g, "");
|
|
||||||
const clipId = `cloud-clip-${safeId}`;
|
|
||||||
const maskId = `cloud-mask-${safeId}`;
|
|
||||||
const launchAnimId = `launch-${safeId}`;
|
|
||||||
const spinAnimId = `spin-${safeId}`;
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<svg
|
<svg
|
||||||
width="24"
|
|
||||||
height="24"
|
|
||||||
viewBox="0 0 24 24"
|
|
||||||
fill="none"
|
|
||||||
xmlns="http://www.w3.org/2000/svg"
|
xmlns="http://www.w3.org/2000/svg"
|
||||||
|
viewBox="0 0 100 100"
|
||||||
|
width={30}
|
||||||
|
height={30}
|
||||||
className={className}
|
className={className}
|
||||||
style={{ overflow: "visible" }}
|
aria-hidden="true"
|
||||||
|
focusable="false"
|
||||||
{...props}
|
{...props}
|
||||||
>
|
>
|
||||||
<style>
|
|
||||||
{`
|
|
||||||
@keyframes ${launchAnimId} {
|
|
||||||
0% { transform: translateY(3px); opacity: 0; }
|
|
||||||
20% { opacity: 1; }
|
|
||||||
80% { opacity: 1; }
|
|
||||||
100% { transform: translateY(-6px); opacity: 0; }
|
|
||||||
}
|
|
||||||
@keyframes ${spinAnimId} {
|
|
||||||
to { transform: rotate(360deg); }
|
|
||||||
}
|
|
||||||
`}
|
|
||||||
</style>
|
|
||||||
|
|
||||||
<defs>
|
|
||||||
{/*
|
|
||||||
Scaled clip path for uploading state.
|
|
||||||
Scaling down the cloud path creates the requested "padding"
|
|
||||||
between the cloud border and the animating arrow.
|
|
||||||
*/}
|
|
||||||
<clipPath id={clipId}>
|
|
||||||
<path
|
|
||||||
d={CLOUD_PATH}
|
|
||||||
transform="translate(12, 12) scale(0.75) translate(-12, -12)"
|
|
||||||
/>
|
|
||||||
</clipPath>
|
|
||||||
|
|
||||||
{/*
|
|
||||||
Mask for static state.
|
|
||||||
This creates a transparent "cutout" of the arrow in the center of the cloud.
|
|
||||||
*/}
|
|
||||||
<mask id={maskId}>
|
|
||||||
<rect width="24" height="24" fill="white" />
|
|
||||||
{/* Translated down by 2.5px to visually center the arrow in the cloud body */}
|
|
||||||
<path d={ARROW_PATH} fill="black" transform="translate(0, 2.5)" />
|
|
||||||
</mask>
|
|
||||||
</defs>
|
|
||||||
|
|
||||||
{/*
|
|
||||||
Cloud Background
|
|
||||||
- Static: Uses mask to show cutout arrow.
|
|
||||||
- Uploading: No mask (solid fill), arrow rendered on top.
|
|
||||||
*/}
|
|
||||||
<path
|
<path
|
||||||
d={CLOUD_PATH}
|
d="M 44.4 75 H 30 A 15 15 0 0 1 30 45 A 20 20 0 0 1 70 45 A 15 15 0 0 1 70 75 H 55.6 V 61 H 61.2 L 50 47 L 38.8 61 H 44.4 Z"
|
||||||
fill="currentColor"
|
fill="currentColor"
|
||||||
mask={!uploading ? `url(#${maskId})` : undefined}
|
transform="scale(1.01, 1.05)"
|
||||||
style={{ transition: "all 0.2s ease" }}
|
|
||||||
/>
|
/>
|
||||||
|
{uploading && (
|
||||||
{/*
|
<circle
|
||||||
Animated Arrow
|
cx="50"
|
||||||
Only visible when uploading.
|
cy="50"
|
||||||
It is white (to contrast with the colored cloud) and clipped by the scaled cloud shape.
|
r="48"
|
||||||
*/}
|
stroke="currentColor"
|
||||||
<g
|
strokeWidth="2"
|
||||||
clipPath={`url(#${clipId})`}
|
strokeDasharray="10 20"
|
||||||
style={{ opacity: uploading ? 1 : 0, transition: "opacity 0.2s" }}
|
fill="none"
|
||||||
>
|
className="animate-spin"
|
||||||
<path
|
style={{ transformOrigin: 'center' }}
|
||||||
d={ARROW_PATH}
|
|
||||||
fill="white"
|
|
||||||
style={
|
|
||||||
uploading
|
|
||||||
? {
|
|
||||||
animation: `${launchAnimId} 0.8s cubic-bezier(0.4, 0, 0.2, 1) infinite`,
|
|
||||||
}
|
|
||||||
: {}
|
|
||||||
}
|
|
||||||
/>
|
/>
|
||||||
</g>
|
)}
|
||||||
|
|
||||||
{/*
|
|
||||||
Spinning Blue Arc
|
|
||||||
r="12.5" places it outside the 24x24 box (diameter 25).
|
|
||||||
overflow: visible on SVG ensures it's seen.
|
|
||||||
*/}
|
|
||||||
<circle
|
|
||||||
cx="12"
|
|
||||||
cy="12"
|
|
||||||
r="12.5"
|
|
||||||
stroke="currentColor"
|
|
||||||
strokeWidth="1.5"
|
|
||||||
strokeLinecap="round"
|
|
||||||
strokeDasharray="9.8 68.7"
|
|
||||||
fill="none"
|
|
||||||
style={{
|
|
||||||
transformOrigin: "center",
|
|
||||||
animation: `${spinAnimId} 1s linear infinite`,
|
|
||||||
opacity: uploading ? 1 : 0,
|
|
||||||
transition: "opacity 0.3s ease-in-out",
|
|
||||||
pointerEvents: "none",
|
|
||||||
}}
|
|
||||||
/>
|
|
||||||
</svg>
|
</svg>
|
||||||
);
|
)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import { DualSidebar, DualSidebarItem } from '@/ui/components/dual-sidebar'
|
import { DualSidebar, DualSidebarItem } from '@/ui/components/dual-sidebar'
|
||||||
import { NotificationList } from '@/ui/components/notification-list'
|
import { NotificationList } from '@/ui/components/notification-list'
|
||||||
import { NotificationFillIcon } from '@/ui/components/ui/icons'
|
import { NotificationFillIcon, HomeIcon } from '@/ui/components/ui/icons'
|
||||||
import { Toaster } from '@/ui/components/ui/sonner'
|
import { Toaster } from '@/ui/components/ui/sonner'
|
||||||
import { UploadCloudIcon } from '@/ui/components/ui/upload-cloud'
|
import { UploadCloudIcon } from '@/ui/components/ui/upload-cloud'
|
||||||
import { UploadTasks } from '@/ui/components/upload-tasks'
|
import { UploadTasks } from '@/ui/components/upload-tasks'
|
||||||
@@ -13,7 +13,6 @@ import {
|
|||||||
useNavigate,
|
useNavigate,
|
||||||
useRouterState,
|
useRouterState,
|
||||||
} from '@tanstack/react-router'
|
} from '@tanstack/react-router'
|
||||||
import { HomeIcon } from 'lucide-react'
|
|
||||||
import { useEffect } from 'react'
|
import { useEffect } from 'react'
|
||||||
import { TopNav } from '@/ui/components/top-nav'
|
import { TopNav } from '@/ui/components/top-nav'
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user