Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adjusts the size of the titles in Classic theme #213

Merged
merged 6 commits into from
Nov 15, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 9 additions & 8 deletions src/components/Dialog/Dialog.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { ReactNode } from "react";
import * as RadixDialog from "@radix-ui/react-dialog";
import styled, { keyframes } from "styled-components";
import { Button, Icon, Spacer, Title } from "@/components";
import { Button, Icon, Spacer } from "@/components";
import { CrossButton } from "../commonElement";
import { ButtonProps } from "@/components/Button/Button";

Expand Down Expand Up @@ -81,6 +81,12 @@ const TitleArea = styled.div`
min-height: ${({ theme }) => theme.sizes[9]}; // 32px
`;

const Title = styled.h2`
font: ${({ theme }) => theme.click.dialog.typography.title.default};
padding: 0;
margin: 0;
`;

const CloseButton = ({ onClose }: { onClose?: () => void }) => (
<RadixDialog.Close asChild>
<CrossButton onClick={onClose}>
Expand Down Expand Up @@ -120,15 +126,10 @@ const DialogContent = ({
{showOverlay && <DialogOverlay />}
<ContentArea {...props}>
<TitleArea>
<Title
size="xl"
type="h2"
>
{title}
</Title>
<Title>{title}</Title>
{showClose && <CloseButton onClose={onClose} />}
</TitleArea>
<Spacer />
<Spacer size="sm" />
{children}
</ContentArea>
</RadixDialog.Portal>
Expand Down
10 changes: 7 additions & 3 deletions src/components/Flyout/Flyout.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Button } from "..";
import { Button, Link, Text } from "..";
import { Flyout, FlyoutProps } from "./Flyout";

interface Props extends FlyoutProps {
Expand All @@ -11,7 +11,9 @@ interface Props extends FlyoutProps {
const FlyoutExample = ({ title, description, align, size, ...props }: Props) => {
return (
<Flyout {...props}>
<Flyout.Trigger>Flyout Trigger</Flyout.Trigger>
<Flyout.Trigger>
<Link>Flyout Trigger</Link>
</Flyout.Trigger>
<Flyout.Content
strategy="fixed"
size={size}
Expand All @@ -21,7 +23,9 @@ const FlyoutExample = ({ title, description, align, size, ...props }: Props) =>
description={description}
/>
<Flyout.Body align={align}>
<Flyout.Element>Content1 long text content</Flyout.Element>
<Flyout.Element>
<Text>Flyout content belongs here.</Text>
</Flyout.Element>
</Flyout.Body>
<Flyout.Footer>
<Flyout.Close label="Cancel" />
Expand Down
4 changes: 2 additions & 2 deletions src/components/Flyout/Flyout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ const FlexGrow = styled.div`
const FlyoutTitle = styled(DialogTitle)`
${({ theme }) => `
color: ${theme.click.flyout.color.title.default};
font: ${theme.typography.styles.product.titles.xl};
font: ${theme.click.flyout.typography.title.default};
margin: 0;
padding: 0;
`}
Expand All @@ -200,7 +200,7 @@ const FlyoutTitle = styled(DialogTitle)`
const FlyoutDescription = styled(DialogDescription)`
${({ theme }) => `
color: ${theme.click.flyout.color.description.default};
font: ${theme.typography.styles.product.text.normal.md};
font: ${theme.click.flyout.typography.description.default};
margin: 0;
padding: 0;
`}
Expand Down