Move ServerCard dimmed style to Card theme variant
Replaces inline style and opacity prop on ServerCard with a new 'disabled' variant on the Card theme, per AGENTS.md rules against inline styles on components. Also picks up prettier formatting on ResourcesScreen. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
064b807ea4
commit
4f37321e2c
3 changed files with 18 additions and 14 deletions
|
|
@ -113,8 +113,7 @@ export function ServerCard({
|
||||||
<Card
|
<Card
|
||||||
withBorder
|
withBorder
|
||||||
padding="lg"
|
padding="lg"
|
||||||
opacity={isDimmed ? 0.4 : 1}
|
variant={isDimmed ? "disabled" : undefined}
|
||||||
style={isDimmed ? { pointerEvents: "none" } : undefined}
|
|
||||||
{...(isDimmed ? { "aria-disabled": true, inert: true } : {})}
|
{...(isDimmed ? { "aria-disabled": true, inert: true } : {})}
|
||||||
>
|
>
|
||||||
<Stack gap="sm">
|
<Stack gap="sm">
|
||||||
|
|
|
||||||
|
|
@ -136,9 +136,7 @@ export function ResourcesScreen({
|
||||||
<ResourcePreviewPanel
|
<ResourcePreviewPanel
|
||||||
{...selectedResource}
|
{...selectedResource}
|
||||||
onRefresh={() => onReadResource(selectedResource.uri)}
|
onRefresh={() => onReadResource(selectedResource.uri)}
|
||||||
onSubscribe={() =>
|
onSubscribe={() => onSubscribeResource(selectedResource.uri)}
|
||||||
onSubscribeResource(selectedResource.uri)
|
|
||||||
}
|
|
||||||
onUnsubscribe={() =>
|
onUnsubscribe={() =>
|
||||||
onUnsubscribeResource(selectedResource.uri)
|
onUnsubscribeResource(selectedResource.uri)
|
||||||
}
|
}
|
||||||
|
|
@ -146,9 +144,7 @@ export function ResourcesScreen({
|
||||||
</DetailCard>
|
</DetailCard>
|
||||||
) : (
|
) : (
|
||||||
<DetailCard>
|
<DetailCard>
|
||||||
<EmptyState>
|
<EmptyState>Enter a URI and click Read to preview</EmptyState>
|
||||||
Enter a URI and click Read to preview
|
|
||||||
</EmptyState>
|
|
||||||
</DetailCard>
|
</DetailCard>
|
||||||
)}
|
)}
|
||||||
</ScrollArea.Autosize>
|
</ScrollArea.Autosize>
|
||||||
|
|
@ -163,9 +159,7 @@ export function ResourcesScreen({
|
||||||
{...selectedResource}
|
{...selectedResource}
|
||||||
onRefresh={() => onReadResource(selectedResource.uri)}
|
onRefresh={() => onReadResource(selectedResource.uri)}
|
||||||
onSubscribe={() => onSubscribeResource(selectedResource.uri)}
|
onSubscribe={() => onSubscribeResource(selectedResource.uri)}
|
||||||
onUnsubscribe={() =>
|
onUnsubscribe={() => onUnsubscribeResource(selectedResource.uri)}
|
||||||
onUnsubscribeResource(selectedResource.uri)
|
|
||||||
}
|
|
||||||
/>
|
/>
|
||||||
</DetailCard>
|
</DetailCard>
|
||||||
</ScrollArea.Autosize>
|
</ScrollArea.Autosize>
|
||||||
|
|
|
||||||
|
|
@ -10,7 +10,18 @@ export const ThemeCard = Card.extend({
|
||||||
if (props.variant === "responsive") return { root: "card-responsive" };
|
if (props.variant === "responsive") return { root: "card-responsive" };
|
||||||
return {};
|
return {};
|
||||||
},
|
},
|
||||||
styles: () => ({
|
styles: (_theme, props) => {
|
||||||
root: { backgroundColor: "var(--inspector-surface-card)" },
|
if (props.variant === "disabled") {
|
||||||
}),
|
return {
|
||||||
|
root: {
|
||||||
|
backgroundColor: "var(--inspector-surface-card)",
|
||||||
|
opacity: 0.4,
|
||||||
|
pointerEvents: "none",
|
||||||
|
},
|
||||||
|
};
|
||||||
|
}
|
||||||
|
return {
|
||||||
|
root: { backgroundColor: "var(--inspector-surface-card)" },
|
||||||
|
};
|
||||||
|
},
|
||||||
});
|
});
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue