Skip to content
Draft
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
37 changes: 4 additions & 33 deletions Source/Toolbar/Toolbar.css
Original file line number Diff line number Diff line change
@@ -1,42 +1,12 @@
/* Copyright (c) Cratis. All rights reserved. */
/* Licensed under the MIT license. See LICENSE file in the project root for full license information. */

/* ── Toolbar container ───────────────────────────────────────────────────── */
.toolbar {
background: var(--surface-card);
border: 1px solid var(--surface-border);
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

/* ── Toolbar button ──────────────────────────────────────────────────────── */
.toolbar-button {
color: var(--text-color-secondary);
background: transparent;
border: none;
transition: background 0.15s, color 0.15s;
}

.toolbar-button:hover {
background: var(--surface-100);
color: var(--text-color);
}

.toolbar-button--active {
background: var(--primary-color);
color: var(--primary-color-text);
}

.toolbar-button--active:hover {
background: var(--primary-color);
color: var(--primary-color-text);
}

/* ── Toolbar project name label ──────────────────────────────────────────── */
.toolbar-project-name {
padding: 0 8px;
font-size: 0.875rem;
font-weight: 500;
color: var(--text-color);
color: #f3f4f6;
white-space: nowrap;
}

Expand Down Expand Up @@ -102,8 +72,9 @@
align-items: center;
gap: 0.25rem;
padding: 0.5rem;
background: var(--surface-card);
border: 1px solid var(--surface-border);
/* bg-gray-800 / border-white/10 — matches the Toolbar container Tailwind classes */
background: #1f2937;
border: 1px solid rgba(255, 255, 255, 0.1);
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
border-radius: 1rem;
white-space: nowrap;
Expand Down
5 changes: 2 additions & 3 deletions Source/Toolbar/Toolbar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
// Licensed under the MIT license. See LICENSE file in the project root for full license information.

import { ReactNode } from 'react';
import './Toolbar.css';

/** Props for the {@link Toolbar} component. */
export interface ToolbarProps {
Expand All @@ -19,9 +18,9 @@ export interface ToolbarProps {
*/
export const Toolbar = ({ children, orientation = 'vertical' }: ToolbarProps) => (
<div
className={`toolbar inline-flex ${
className={`inline-flex ${
orientation === 'horizontal' ? 'flex-row' : 'flex-col'
} items-center gap-1 p-2 rounded-2xl`}
} items-center gap-1 p-2 rounded-2xl bg-gray-800 border border-white/10 shadow-md`}
>
{children}
</div>
Expand Down
6 changes: 4 additions & 2 deletions Source/Toolbar/ToolbarButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,15 +27,17 @@ export interface ToolbarButtonProps {
* Uses the shared {@link Tooltip} component for consistent hover labels.
*/
export const ToolbarButton = ({ icon, tooltip, active = false, onClick, tooltipPosition = 'right' }: ToolbarButtonProps) => {
const activeClass = active ? 'toolbar-button--active' : '';
const buttonStateClass = active
? 'bg-blue-600 text-white'
: 'text-gray-400 hover:bg-gray-700 hover:text-gray-100';

return (
<Tooltip content={tooltip} position={tooltipPosition}>
<button
type='button'
aria-label={tooltip}
onClick={onClick}
className={`toolbar-button w-10 h-10 flex items-center justify-center rounded-lg cursor-pointer ${activeClass}`}
className={`w-10 h-10 flex items-center justify-center rounded-lg cursor-pointer transition-colors duration-150 ${buttonStateClass}`}
>
<i className={`${icon} text-lg`} />
</button>
Expand Down
7 changes: 5 additions & 2 deletions Source/Toolbar/ToolbarFanOutItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
// Licensed under the MIT license. See LICENSE file in the project root for full license information.

import { ReactNode, useEffect, useRef, useState } from 'react';
import './Toolbar.css';
import { Tooltip } from '../Common/Tooltip';
import type { TooltipPosition } from '../Common/Tooltip';

Expand Down Expand Up @@ -63,7 +64,9 @@ export const ToolbarFanOutItem = ({
};
}, [isExpanded]);

const activeClass = isExpanded ? 'toolbar-button--active' : '';
const buttonStateClass = isExpanded
? 'bg-blue-600 text-white'
: 'text-gray-400 hover:bg-gray-700 hover:text-gray-100';
const panelVisibleClass = isExpanded ? 'toolbar-fanout-panel--visible' : '';
const directionClass = `toolbar-fanout-panel--${fanOutDirection}`;

Expand All @@ -75,7 +78,7 @@ export const ToolbarFanOutItem = ({
aria-label={tooltip}
aria-expanded={isExpanded}
onClick={handleToggle}
className={`toolbar-button w-10 h-10 flex items-center justify-center rounded-lg cursor-pointer ${activeClass}`}
className={`w-10 h-10 flex items-center justify-center rounded-lg cursor-pointer transition-colors duration-150 ${buttonStateClass}`}
>
<i className={`${icon} text-lg`} />
</button>
Expand Down
1 change: 1 addition & 0 deletions Source/Toolbar/ToolbarSection.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

import { Children, ReactElement, ReactNode, isValidElement, useCallback, useEffect, useLayoutEffect, useRef, useState } from 'react';

import './Toolbar.css';
import type { ToolbarContextProps } from './ToolbarContext';

/** Props for the {@link ToolbarSection} component. */
Expand Down