-
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: autocomplete items and improved list items
- Loading branch information
1 parent
2797250
commit 9781e63
Showing
58 changed files
with
906 additions
and
587 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,32 +1,18 @@ | ||
import type { ElementType } from 'react'; | ||
import { ListItemBase, ListItemLabel, ListItemMedia, type ListItemSize } from '..'; | ||
import { ListItem, type ListItemProps } from '..'; | ||
import { type QueryItemProps, QueryLabel } from './QueryLabel'; | ||
|
||
export interface BookmarksListItemProps { | ||
export interface BookmarksListItemProps extends ListItemProps { | ||
id: string; | ||
/** Element type to render */ | ||
as?: ElementType; | ||
/** ELement link */ | ||
href?: string; | ||
/** Optional onClick */ | ||
onClick?(): void; | ||
/** Size of list item */ | ||
size?: ListItemSize; | ||
/** Optional title */ | ||
title?: string; | ||
/** Optional description */ | ||
description?: string; | ||
/** Query params */ | ||
params?: QueryItemProps[]; | ||
} | ||
|
||
export const BookmarksListItem = ({ size = 'sm', title, description, params, ...rest }: BookmarksListItemProps) => { | ||
return ( | ||
<ListItemBase size={size} linkIcon="chevron-right" {...rest}> | ||
<ListItemMedia size={size} icon={'magnifying-glass'} /> | ||
<ListItemLabel title={title} size={size}> | ||
{!title && <QueryLabel params={params} />} | ||
</ListItemLabel> | ||
</ListItemBase> | ||
<ListItem size={size} icon="magnifying-glass" linkIcon="chevron-right" {...rest}> | ||
{!title && <QueryLabel params={params} />} | ||
</ListItem> | ||
); | ||
}; |
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
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 |
---|---|---|
@@ -1,10 +1,16 @@ | ||
import type { ReactNode } from 'react'; | ||
import type { DialogSize } from './DialogBase'; | ||
import styles from './dialogHeaderBase.module.css'; | ||
|
||
export interface DialogHeaderBaseProps { | ||
size?: DialogSize; | ||
children?: ReactNode; | ||
} | ||
|
||
export const DialogHeaderBase = ({ children }: DialogHeaderBaseProps) => { | ||
return <header className={styles.header}>{children}</header>; | ||
export const DialogHeaderBase = ({ size, children }: DialogHeaderBaseProps) => { | ||
return ( | ||
<header className={styles.header} data-size={size}> | ||
{children} | ||
</header> | ||
); | ||
}; |
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,37 @@ | ||
import type { ReactNode } from 'react'; | ||
import { MetaItem, type MetaItemSize } from '../Meta'; | ||
import type { DialogVariant } from './DialogBase'; | ||
|
||
export interface DialogLabelProps { | ||
size?: MetaItemSize; | ||
variant?: DialogVariant; | ||
label?: string; | ||
children?: ReactNode; | ||
} | ||
|
||
/** | ||
* Dialog label. | ||
*/ | ||
|
||
export const DialogLabel = ({ size = 'xs', variant, label, children }: DialogLabelProps) => { | ||
switch (variant) { | ||
case 'trashed': | ||
return ( | ||
<MetaItem size={size} icon="trash" variant="rounded"> | ||
{children || label} | ||
</MetaItem> | ||
); | ||
case 'archived': | ||
return ( | ||
<MetaItem size={size} icon="archive" variant="rounded"> | ||
{children || label} | ||
</MetaItem> | ||
); | ||
default: | ||
return ( | ||
<MetaItem size={size} variant="rounded"> | ||
{children || label} | ||
</MetaItem> | ||
); | ||
} | ||
}; |
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.