Skip to content

Commit

Permalink
updates
Browse files Browse the repository at this point in the history
  • Loading branch information
Fercas123 committed Dec 18, 2024
1 parent c33d971 commit 7c3d5f2
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 13 deletions.
2 changes: 1 addition & 1 deletion .changeset/poor-scissors-chew.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
"@salt-ds/lab": patch
---

fix alignment for titles spanning into multiple lines, wrap labs dialog header in H2 to avoid breaking change
Overlay and Dialog headers fix alignment for titles spanning into multiple lines, wrap preheader and headers in H2.
10 changes: 4 additions & 6 deletions packages/lab/src/dialog/DialogHeader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -83,12 +83,10 @@ export const DialogHeader = forwardRef<HTMLDivElement, DialogHeaderProps>(
>
{status && <StatusIndicator status={status} />}
<div className={withBaseName("container")}>
<div className={withBaseName("header")}>
{preheader && (
<Text className={withBaseName("preheader")}>{preheader}</Text>
)}
<H2 className={withBaseName("header")}>{header}</H2>
</div>
<H2 className={withBaseName("header")}>
{preheader && <Text color="primary">{preheader}</Text>}
{header}
</H2>
{description && (
<Text color="secondary" className={withBaseName("description")}>
{description}
Expand Down
10 changes: 4 additions & 6 deletions packages/lab/src/overlay/OverlayHeader.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Text, makePrefixer } from "@salt-ds/core";
import { H2, Text, makePrefixer } from "@salt-ds/core";
import { useComponentCssInjection } from "@salt-ds/styles";
import { useWindow } from "@salt-ds/window";
import { clsx } from "clsx";
Expand Down Expand Up @@ -45,12 +45,10 @@ export const OverlayHeader = forwardRef<HTMLDivElement, OverlayHeaderProps>(
return (
<div className={clsx(withBaseName(), className)} {...rest} ref={ref}>
<div className={withBaseName("container")}>
<div className={withBaseName("header")}>
{preheader && (
<Text className={withBaseName("preheader")}>{preheader}</Text>
)}
<H2 styleAs="h4" className={withBaseName("header")}>
{preheader && <Text color="primary">{preheader}</Text>}
{header}
</div>
</H2>
{description && (
<Text color="secondary" className={withBaseName("description")}>
{description}
Expand Down

0 comments on commit 7c3d5f2

Please sign in to comment.