-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: timeline + dialog fixes (#135)
- Fefactor History to generic Timeline components. - Replace DialogHeadings with a generic Byline compoent. - Rename SectionBase to Section, ArticleBase to Article and align most generic components to make it easier to build generic pages and concepts. - Replace spesific dialog components with more generic concepts that are easier to adjust. - Visual alignment and tuning. - Stories for dialogs.
- Loading branch information
1 parent
b59e4a0
commit e6f16f5
Showing
171 changed files
with
3,082 additions
and
2,236 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,2 @@ | ||
export * from './AttachmentLink'; | ||
export * from './AttachmentList'; | ||
export * from './AttachmentSection'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
export * from './BookmarksList'; | ||
export * from './BookmarksListItem'; | ||
export * from './QueryLabel'; | ||
export * from './BookmarksSection'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
import type { Meta, StoryObj } from '@storybook/react'; | ||
import { Byline } from './Byline'; | ||
|
||
const meta = { | ||
title: 'Byline/Byline', | ||
component: Byline, | ||
tags: ['autodocs'], | ||
parameters: {}, | ||
args: { | ||
datetime: '2024-12-12 11:15', | ||
}, | ||
} satisfies Meta<typeof Byline>; | ||
|
||
export default meta; | ||
type Story = StoryObj<typeof meta>; | ||
|
||
export const Default: Story = { | ||
args: { | ||
children: '12. desember 2024 kl 11.15', | ||
}, | ||
}; | ||
|
||
export const Avatar: Story = { | ||
args: { | ||
avatar: { | ||
type: 'person', | ||
name: 'Per Person', | ||
}, | ||
children: ( | ||
<> | ||
<strong>Per Person,</strong> 12. desember 2024 | ||
</> | ||
), | ||
}, | ||
}; | ||
|
||
export const LargeAvatar: Story = { | ||
args: { | ||
size: 'lg', | ||
avatar: { | ||
type: 'person', | ||
name: 'Per Person', | ||
}, | ||
children: ( | ||
<> | ||
<strong>Skatteetaten</strong> til Per Person | ||
</> | ||
), | ||
}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
import type { ReactNode } from 'react'; | ||
import { Avatar, AvatarGroup, type AvatarGroupProps, type AvatarProps, Skeleton } from '..'; | ||
import styles from './byline.module.css'; | ||
|
||
export type BylineSize = 'xs' | 'sm' | 'lg'; | ||
|
||
export interface BylineProps { | ||
size?: BylineSize; | ||
avatar?: AvatarProps; | ||
avatarGroup?: AvatarGroupProps; | ||
datetime?: string; | ||
loading?: boolean; | ||
children?: ReactNode; | ||
} | ||
|
||
/** Byline, possible avatar/avatarGroup, name and more info */ | ||
|
||
export const Byline = ({ loading, size = 'xs', avatar, avatarGroup, datetime, children }: BylineProps) => { | ||
return ( | ||
<div className={styles.byline} data-size={size}> | ||
<Skeleton variant="circle" className={styles.avatar} loading={loading}> | ||
{avatarGroup ? ( | ||
<AvatarGroup {...avatarGroup} size={size} className={styles.avatar} /> | ||
) : ( | ||
avatar && <Avatar {...avatar} size={size} className={styles.avatar} /> | ||
)} | ||
</Skeleton> | ||
<time data-size={size} dateTime={datetime} className={styles.label}> | ||
<Skeleton loading={loading}>{children}</Skeleton> | ||
</time> | ||
</div> | ||
); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
.byline { | ||
display: inline-flex; | ||
align-items: center; | ||
column-gap: 0.5em; | ||
} | ||
|
||
.label { | ||
display: inline-flex; | ||
flex-wrap: wrap; | ||
column-gap: 0.25em; | ||
color: var(--theme-text-subtle); | ||
} | ||
|
||
.label[data-size="xs"], | ||
.label[data-size="sm"] { | ||
font-size: 14px; | ||
line-height: 1.125rem; | ||
padding: 0.1875rem 0; | ||
} | ||
|
||
.label[data-size="md"], | ||
.label[data-size="lg"] { | ||
font-size: 16px; | ||
line-height: 1.25rem; | ||
} | ||
|
||
.label > strong { | ||
font-weight: 500; | ||
color: var(--theme-text-default); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export * from './Byline'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.