mirror of
https://github.com/kjanat/livedash-node.git
synced 2026-01-16 13:52:16 +01:00
## Dark Mode Implementation - Convert User Management page to shadcn/ui components for proper theming - Replace hardcoded colors with CSS variables for dark/light mode support - Add proper test attributes and accessibility improvements - Fix loading state management and null safety issues ## Test Suite Implementation - Add comprehensive User Management page tests (18 tests passing) - Add format-enums utility tests (24 tests passing) - Add integration test infrastructure with proper mocking - Add accessibility test framework with jest-axe integration - Add keyboard navigation test structure - Fix test environment configuration for React components ## Code Quality Improvements - Fix all ESLint warnings and errors - Add null safety for users array (.length → ?.length || 0) - Add proper form role attribute for accessibility - Fix TypeScript interface issues in magic UI components - Improve component error handling and user experience ## Technical Infrastructure - Add jest-dom and node-mocks-http testing dependencies - Configure jsdom environment for React component testing - Add window.matchMedia mock for theme provider compatibility - Fix auth test mocking and database test configuration Result: Core functionality working with 42/44 critical tests passing All dark mode theming, user management, and utility functions verified
64 lines
1.6 KiB
TypeScript
64 lines
1.6 KiB
TypeScript
"use client";
|
|
|
|
import * as React from "react";
|
|
|
|
import { cn } from "@/lib/utils";
|
|
|
|
interface ShineBorderProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
/**
|
|
* Width of the border in pixels
|
|
* @default 1
|
|
*/
|
|
borderWidth?: number;
|
|
/**
|
|
* Duration of the animation in seconds
|
|
* @default 14
|
|
*/
|
|
duration?: number;
|
|
/**
|
|
* Color of the border, can be a single color or an array of colors
|
|
* @default "#000000"
|
|
*/
|
|
shineColor?: string | string[];
|
|
}
|
|
|
|
/**
|
|
* Shine Border
|
|
*
|
|
* An animated background border effect component with configurable properties.
|
|
*/
|
|
export function ShineBorder({
|
|
borderWidth = 1,
|
|
duration = 14,
|
|
shineColor = "#000000",
|
|
className,
|
|
style,
|
|
...props
|
|
}: ShineBorderProps) {
|
|
return (
|
|
<div
|
|
style={
|
|
{
|
|
"--border-width": `${borderWidth}px`,
|
|
"--duration": `${duration}s`,
|
|
backgroundImage: `radial-gradient(transparent,transparent, ${
|
|
Array.isArray(shineColor) ? shineColor.join(",") : shineColor
|
|
},transparent,transparent)`,
|
|
backgroundSize: "300% 300%",
|
|
mask: `linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0)`,
|
|
WebkitMask: `linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0)`,
|
|
WebkitMaskComposite: "xor",
|
|
maskComposite: "exclude",
|
|
padding: "var(--border-width)",
|
|
...style,
|
|
} as React.CSSProperties
|
|
}
|
|
className={cn(
|
|
"pointer-events-none absolute inset-0 size-full rounded-[inherit] will-change-[background-position] motion-safe:animate-shine",
|
|
className
|
|
)}
|
|
{...props}
|
|
/>
|
|
);
|
|
}
|