Skip to content

Commit cd83b96

Browse files
authored
Fix ColorConverter RGB input, layout toggle, and styling issues (#35)
* fix: color converter, input, layout * fix: ibm plex mono font
1 parent 1180292 commit cd83b96

5 files changed

Lines changed: 210 additions & 173 deletions

File tree

frontend/src/components/ToolUI.jsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ export function ToolControls({ children, style = {} }) {
2020
return (
2121
<div className="controls" style={{
2222
display: 'flex',
23-
alignItems: 'flex-end',
2423
gap: '1rem',
2524
flexWrap: 'wrap',
2625
marginBottom: '1rem',
Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,27 @@
11
import React from 'react';
2-
import { IconButton } from '@carbon/react';
2+
import { Button } from '@carbon/react';
33
import { SplitScreen, VerticalView } from '@carbon/icons-react';
44
import { TOGGLE_POSITIONS } from './constants';
55

66
/**
77
* Layout toggle button for switching between horizontal and vertical layouts
8-
*
8+
*
99
* @param {Object} props
1010
* @param {'horizontal'|'vertical'} props.direction - Current layout direction
1111
* @param {Function} props.onToggle - Callback when toggle is clicked
1212
* @param {string} [props.position='top-right'] - Position styling
1313
* @param {boolean} [props.disabled=false] - Whether toggle is disabled
1414
* @param {Object} [props.style={}] - Additional styles
1515
*/
16-
export default function ToolLayoutToggle({
17-
direction,
18-
onToggle,
16+
export default function ToolLayoutToggle({
17+
direction,
18+
onToggle,
1919
position = 'top-right',
2020
disabled = false,
2121
style = {}
2222
}) {
2323
const isHorizontal = direction === 'horizontal';
24-
24+
2525
// Position styling based on position prop
2626
const positionStyles = {
2727
'top-right': {
@@ -43,25 +43,24 @@ export default function ToolLayoutToggle({
4343
boxShadow: '0 2px 4px rgba(0, 0, 0, 0.1)'
4444
}
4545
};
46-
46+
4747
const containerStyle = {
4848
...positionStyles[position] || positionStyles['top-right'],
4949
...style
5050
};
51-
51+
5252
return (
5353
<div style={containerStyle}>
54-
<IconButton
54+
<Button
5555
kind="ghost"
5656
size="sm"
57-
label={isHorizontal ? "Switch to vertical layout" : "Switch to horizontal layout"}
57+
renderIcon={isHorizontal ? VerticalView : SplitScreen}
5858
iconDescription={isHorizontal ? "Vertical layout" : "Horizontal layout"}
59-
align="bottom"
59+
hasIconOnly
6060
disabled={disabled}
6161
onClick={onToggle}
62-
>
63-
{isHorizontal ? <VerticalView size={16} /> : <SplitScreen size={16} />}
64-
</IconButton>
62+
title={isHorizontal ? "Switch to vertical layout" : "Switch to horizontal layout"}
63+
/>
6564
</div>
6665
);
6766
}

0 commit comments

Comments
 (0)