diff --git a/src/styles/App.css b/src/App.css similarity index 100% rename from src/styles/App.css rename to src/App.css diff --git a/src/App.tsx b/src/App.tsx index 36bd543..791ee9d 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -1,7 +1,7 @@ import { invoke } from '@tauri-apps/api/core'; import { useState } from 'react'; -import './styles/App.css'; +import './App.css'; import { DSP, DSPStatus, AppPage } from './types/types'; import TopBar from './components/Topbar/Topbar'; import DSPPage from './pages/DspPage/DspPage'; diff --git a/src/components/Led/Led.tsx b/src/components/Led/Led.tsx index c3e6b81..13d1f28 100644 --- a/src/components/Led/Led.tsx +++ b/src/components/Led/Led.tsx @@ -5,10 +5,12 @@ type LedProps = { className?: string; }; -export function Led({ status = 'disconnected', className = '' }: LedProps) { +function Led({ status = 'disconnected', className = '' }: LedProps) { return ( ); } + +export default Led; diff --git a/src/components/dsp408/ConnectionSection/ConnectionSection.css b/src/components/dsp408/ConnectionSection/ConnectionSection.css index cde4110..a888b51 100644 --- a/src/components/dsp408/ConnectionSection/ConnectionSection.css +++ b/src/components/dsp408/ConnectionSection/ConnectionSection.css @@ -1,64 +1,107 @@ -/* .connection-panel-frame { - width: 33.333%; - height: 33.333%; - box-sizing: border-box; -} - -.panel { +.connection-section { width: 100%; height: 100%; + display: flex; - flex-direction: column; - box-sizing: border-box; - overflow: hidden; - position: relative; + justify-content: center; + align-items: center; } -.panel-type { +.connection-panel { + width: 340px; + display: flex; + flex-direction: column; +} + +.connection-panel__header { + display: flex; + align-items: flex-start; + justify-content: space-between; + gap: var(--space-3); + min-width: 0; +} + +.connection-panel__header-text { + flex: 1; + min-width: 0; +} + +.connection-panel__title { + margin: 0; + + font-size: var(--font-lg); + font-weight: var(--font-weight-semibold); + color: var(--text-primary); + + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; +} + +.connection-panel__type { margin-top: var(--space-1); - font-size: 12px; + + font-size: var(--font-sm); color: var(--text-muted); font-family: var(--font-mono); letter-spacing: 0.03em; } -.panel-header { +.connection-panel__specs { + margin: var(--space-5) 0; + + display: flex; + flex-direction: column; + gap: var(--space-3); +} + +.connection-panel__spec { display: flex; - align-items: flex-start; justify-content: space-between; - gap: 12px; - min-width: 0; + align-items: center; + gap: var(--space-3); } -.panel-header-text { - min-width: 0; - flex: 1 1 auto; +.connection-panel__spec dt { + color: var(--text-muted); + font-size: var(--font-sm); } -.panel-title { - white-space: nowrap; - overflow: hidden; - text-overflow: ellipsis; +.connection-panel__spec dd { margin: 0; - font-size: 18px; - font-weight: var(--font-weight-semibold); + color: var(--text-primary); } -.mono { +.connection-panel__mono { + font-family: var(--font-mono); + white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } -.specs { +.connection-panel__actions { + margin-top: auto; + + display: flex; + justify-content: flex-end; +} + +.connection-panel__status { + display: flex; + align-items: center; + gap: var(--space-2); + flex-shrink: 0; } -.connection-section { - position: absolute; - inset: 0; +.connection-panel__led { + height: 14px; + aspect-ratio: 1 / 1; display: flex; - justify-content: center; align-items: center; -} */ + justify-content: center; + + flex: 0 0 auto; +} diff --git a/src/components/dsp408/ConnectionSection/ConnectionSection.tsx b/src/components/dsp408/ConnectionSection/ConnectionSection.tsx index 6ec2825..ef1b689 100644 --- a/src/components/dsp408/ConnectionSection/ConnectionSection.tsx +++ b/src/components/dsp408/ConnectionSection/ConnectionSection.tsx @@ -1,14 +1,10 @@ -// ConnectionPanel.tsx import { DSP } from '../../../types/types'; import Button from '../../Button/Button'; +import Card from '../../Card/Card'; +import Led from '../../Led/Led'; + import './ConnectionSection.css'; -const DESIGN_WIDTH = 340; -const DESIGN_HEIGHT = 280; - -const BTN_W = 100; -const BTN_H = 40; - function ConnectionPanel({ dsp, onConnect, @@ -27,59 +23,58 @@ function ConnectionPanel({ return (