Skip to content

Commit

Permalink
fix system status icon styles (#4466)
Browse files Browse the repository at this point in the history
  • Loading branch information
Fercas123 authored Nov 29, 2024
1 parent 5af2978 commit 33c8da5
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 3 deletions.
5 changes: 5 additions & 0 deletions .changeset/modern-zebras-pretend.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@salt-ds/lab": patch
---

Fix system status icons in content from using the component styles override
3 changes: 1 addition & 2 deletions packages/lab/src/system-status/SystemStatus.css
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
/* Styles applied to root component */
.saltSystemStatus {
--saltIcon-color: var(--salt-content-bold-foreground);

background: var(--saltSystemStatus-background, var(--systemStatus-background));
border-color: var(--saltSystemStatus-borderColor, var(--systemStatus-borderColor));
border-width: var(--saltSystemStatus-borderWidth, var(--salt-size-border));
Expand All @@ -21,6 +19,7 @@
/* Styles applied to icon */
.saltSystemStatus-icon.saltIcon {
min-height: var(--salt-size-base);
--saltIcon-color: var(--salt-content-bold-foreground);
}

/* Styles applied when state = "info" */
Expand Down
27 changes: 26 additions & 1 deletion packages/lab/stories/system-status/system-status.qa.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { StackLayout, Text } from "@salt-ds/core";
import { Button, SplitLayout, StackLayout, Text } from "@salt-ds/core";
import { CloseIcon } from "@salt-ds/icons";
import {
SystemStatus,
SystemStatusContent,
Expand Down Expand Up @@ -36,13 +37,37 @@ const WarningSystemStatus = () => (
const SuccessSystemStatus = () => (
<BasicSystemStatusExample status={"success"} />
);
const WithButtonSystemStatusExample: FC<SystemStatusProps> = ({ status }) => {
return (
<SystemStatus status={status}>
<SystemStatusContent>
<StackLayout gap={0.5}>
<SplitLayout
startItem={
<Text color="inherit">
<strong>Title</strong>
</Text>
}
endItem={
<Button appearance="transparent" aria-label="close">
<CloseIcon aria-hidden />
</Button>
}
/>

<Text color="inherit">Example custom renderer</Text>
</StackLayout>
</SystemStatusContent>
</SystemStatus>
);
};
export const ExamplesGrid: StoryFn = (props) => (
<QAContainer cols={1} itemPadding={10} height={600} width={1000} {...props}>
<InfoSystemStatus />
<ErrorSystemStatus />
<WarningSystemStatus />
<SuccessSystemStatus />
<WithButtonSystemStatusExample />
</QAContainer>
);

Expand Down

0 comments on commit 33c8da5

Please sign in to comment.