From 6c1373c33212e26521701acf73c0398721b3a881 Mon Sep 17 00:00:00 2001 From: Jacob Richman Date: Fri, 15 Aug 2025 20:18:31 -0700 Subject: Revert "Update semantic color tokens" (#6365) --- .../cli/src/ui/components/shared/MaxSizedBox.tsx | 7 ++--- .../src/ui/components/shared/RadioButtonSelect.tsx | 32 +++++++++------------- 2 files changed, 16 insertions(+), 23 deletions(-) (limited to 'packages/cli/src/ui/components/shared') diff --git a/packages/cli/src/ui/components/shared/MaxSizedBox.tsx b/packages/cli/src/ui/components/shared/MaxSizedBox.tsx index 4c8b0862..346472bf 100644 --- a/packages/cli/src/ui/components/shared/MaxSizedBox.tsx +++ b/packages/cli/src/ui/components/shared/MaxSizedBox.tsx @@ -7,7 +7,7 @@ import React, { Fragment, useEffect, useId } from 'react'; import { Box, Text } from 'ink'; import stringWidth from 'string-width'; -import { theme } from '../../semantic-colors.js'; +import { Colors } from '../../colors.js'; import { toCodePoints } from '../../utils/textUtils.js'; import { useOverflowActions } from '../../contexts/OverflowContext.js'; @@ -173,7 +173,6 @@ export const MaxSizedBox: React.FC = ({ {line.length > 0 ? ( line.map((segment, segIndex) => ( - // Avoid adding color styles to this element, breaks code colorization {segment.text} @@ -187,14 +186,14 @@ export const MaxSizedBox: React.FC = ({ return ( {totalHiddenLines > 0 && overflowDirection === 'top' && ( - + ... first {totalHiddenLines} line{totalHiddenLines === 1 ? '' : 's'}{' '} hidden ... )} {visibleLines} {totalHiddenLines > 0 && overflowDirection === 'bottom' && ( - + ... last {totalHiddenLines} line{totalHiddenLines === 1 ? '' : 's'}{' '} hidden ... diff --git a/packages/cli/src/ui/components/shared/RadioButtonSelect.tsx b/packages/cli/src/ui/components/shared/RadioButtonSelect.tsx index b6c78feb..746744e5 100644 --- a/packages/cli/src/ui/components/shared/RadioButtonSelect.tsx +++ b/packages/cli/src/ui/components/shared/RadioButtonSelect.tsx @@ -6,7 +6,7 @@ import React, { useEffect, useState, useRef } from 'react'; import { Text, Box } from 'ink'; -import { theme } from '../../semantic-colors.js'; +import { Colors } from '../../colors.js'; import { useKeypress } from '../../hooks/useKeypress.js'; /** @@ -164,9 +164,7 @@ export function RadioButtonSelect({ return ( {showScrollArrows && ( - 0 ? theme.text.primary : theme.text.secondary} - > + 0 ? Colors.Foreground : Colors.Gray}> ▲ )} @@ -174,18 +172,18 @@ export function RadioButtonSelect({ const itemIndex = scrollOffset + index; const isSelected = activeIndex === itemIndex; - let textColor = theme.text.primary; - let numberColor = theme.text.primary; + let textColor = Colors.Foreground; + let numberColor = Colors.Foreground; if (isSelected) { - textColor = theme.status.success; - numberColor = theme.status.success; + textColor = Colors.AccentGreen; + numberColor = Colors.AccentGreen; } else if (item.disabled) { - textColor = theme.text.secondary; - numberColor = theme.text.secondary; + textColor = Colors.Gray; + numberColor = Colors.Gray; } if (!showNumbers) { - numberColor = theme.text.secondary; + numberColor = Colors.Gray; } const numberColumnWidth = String(items.length).length; @@ -196,9 +194,7 @@ export function RadioButtonSelect({ return ( - + {isSelected ? '●' : ' '} @@ -212,9 +208,7 @@ export function RadioButtonSelect({ {item.themeNameDisplay && item.themeTypeDisplay ? ( {item.themeNameDisplay}{' '} - - {item.themeTypeDisplay} - + {item.themeTypeDisplay} ) : ( @@ -228,8 +222,8 @@ export function RadioButtonSelect({ ▼ -- cgit v1.2.3