-
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.
Loading status checks…
feat: transmission list + history + bookmarks: (#115)
- transmission list + items - split list item base into header with links + more - clean up dialog stories - bookmarks list - history, attachments, transmissions - expand/collapse history Co-authored-by: Inge Fossland <[email protected]>
- Loading branch information
1 parent
9a90419
commit f5686c6
Showing
75 changed files
with
1,939 additions
and
400 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
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
10 changes: 5 additions & 5 deletions
10
...components/History/HistoryAttachments.tsx → ...mponents/Attachment/AttachmentSection.tsx
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,2 +1,3 @@ | ||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
import type { Meta, StoryObj } from '@storybook/react'; | ||
import { BookmarksList } from './BookmarksList'; | ||
|
||
const meta = { | ||
title: 'Bookmarks/BookmarksList', | ||
component: BookmarksList, | ||
tags: ['autodocs'], | ||
parameters: {}, | ||
args: { | ||
items: [ | ||
{ | ||
id: 'bookmark-1', | ||
title: 'Mitt eget søk', | ||
params: [ | ||
{ type: 'search', label: 'Skatt' }, | ||
{ type: 'filter', label: 'Under arbeid' }, | ||
], | ||
}, | ||
{ | ||
id: 'bookmark-2', | ||
params: [ | ||
{ type: 'search', label: 'Skatt' }, | ||
{ type: 'filter', label: 'Under arbeid' }, | ||
], | ||
}, | ||
{ | ||
id: 'bookmark-3', | ||
params: [ | ||
{ type: 'filter', label: 'Brønnøysundregistrene' }, | ||
{ type: 'filter', label: 'Krever handling' }, | ||
], | ||
}, | ||
], | ||
}, | ||
} satisfies Meta<typeof BookmarksList>; | ||
|
||
export default meta; | ||
type Story = StoryObj<typeof meta>; | ||
|
||
export const Default: Story = { | ||
args: {}, | ||
}; | ||
|
||
export const WithContextMenu: Story = { | ||
args: { | ||
items: meta.args.items.map((item) => { | ||
return { | ||
...item, | ||
menu: { | ||
id: [item.id, 'menu'].join('-'), | ||
items: [ | ||
{ | ||
icon: 'pencil', | ||
title: 'Rediger søk', | ||
}, | ||
{ | ||
icon: 'trash', | ||
title: 'Slett søk', | ||
}, | ||
], | ||
}, | ||
}; | ||
}), | ||
}, | ||
}; |
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,67 @@ | ||
import type { Meta, StoryObj } from '@storybook/react'; | ||
import { BookmarksSection } from './BookmarksSection'; | ||
|
||
const meta = { | ||
title: 'Bookmarks/BookmarksSection', | ||
component: BookmarksSection, | ||
tags: ['autodocs'], | ||
parameters: {}, | ||
args: { | ||
title: '3 lagrede søk', | ||
updatedAtLabel: 'Sist oppdatert 3 minutter siden', | ||
items: [ | ||
{ | ||
id: 'bookmark-1', | ||
title: 'Mitt eget søk', | ||
params: [ | ||
{ type: 'search', label: 'Skatt' }, | ||
{ type: 'filter', label: 'Under arbeid' }, | ||
], | ||
}, | ||
{ | ||
id: 'bookmark-2', | ||
params: [ | ||
{ type: 'search', label: 'Skatt' }, | ||
{ type: 'filter', label: 'Under arbeid' }, | ||
], | ||
}, | ||
{ | ||
id: 'bookmark-3', | ||
params: [ | ||
{ type: 'filter', label: 'Brønnøysundregistrene' }, | ||
{ type: 'filter', label: 'Krever handling' }, | ||
], | ||
}, | ||
], | ||
}, | ||
} satisfies Meta<typeof BookmarksSection>; | ||
|
||
export default meta; | ||
type Story = StoryObj<typeof meta>; | ||
|
||
export const Default: Story = { | ||
args: {}, | ||
}; | ||
|
||
export const WithContextMenu: Story = { | ||
args: { | ||
items: meta.args.items.map((item) => { | ||
return { | ||
...item, | ||
menu: { | ||
id: [item.id, 'menu'].join('-'), | ||
items: [ | ||
{ | ||
icon: 'pencil', | ||
title: 'Rediger søk', | ||
}, | ||
{ | ||
icon: 'trash', | ||
title: 'Slett søk', | ||
}, | ||
], | ||
}, | ||
}; | ||
}), | ||
}, | ||
}; |
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,22 @@ | ||
import { BookmarksList, Heading, MetaItem, SectionBase, SectionFooter, SectionHeader } from '../'; | ||
import type { BookmarksListItemProps } from '../'; | ||
|
||
export interface BookmarksSectionProps { | ||
title?: string; | ||
items: BookmarksListItemProps[]; | ||
updatedAtLabel?: string; | ||
} | ||
|
||
export const BookmarksSection = ({ title, items, updatedAtLabel }) => { | ||
return ( | ||
<SectionBase padding color="subtle" spacing="lg" inset> | ||
<SectionHeader> | ||
<Heading size="sm">{title}</Heading> | ||
</SectionHeader> | ||
<BookmarksList items={items} /> | ||
<SectionFooter padding> | ||
<MetaItem>{updatedAtLabel}</MetaItem> | ||
</SectionFooter> | ||
</SectionBase> | ||
); | ||
}; |
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.