-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat:
adapt-essentials-asset-fields
search and bugfixes (#1828)
- Loading branch information
Showing
21 changed files
with
485 additions
and
91 deletions.
There are no files selected for viewing
96 changes: 96 additions & 0 deletions
96
apps/adapt-essentials-asset-fields/src/components/AdvancedSearch.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,96 @@ | ||
import { Button, Flex, Select, Stack, TextInput } from '@contentful/f36-components'; | ||
import { FilterIcon, PlusIcon } from '@contentful/f36-icons'; | ||
import { css } from 'emotion'; | ||
import tokens from '@contentful/f36-tokens'; | ||
import { useState } from 'react'; | ||
|
||
export function AdvancedSearch() { | ||
const [searchTerm, setSearchTerm] = useState(''); | ||
|
||
const styles = { | ||
searchWrapper: css({ | ||
border: `1px solid ${tokens.gray200}`, | ||
borderRadius: '0.3rem', | ||
}), | ||
searchInput: css({ | ||
border: 'none', | ||
}), | ||
searchInputFilter: css({ | ||
border: 'none', | ||
fontSize: '0.8rem', | ||
color: tokens.blue600, | ||
'&:hover': { | ||
color: tokens.blue600, | ||
}, | ||
}), | ||
icon: css({ | ||
border: `1px solid ${tokens.gray600}`, | ||
borderRadius: '50%', | ||
}), | ||
filterButton: css({ | ||
border: `1px dashed ${tokens.gray600}`, | ||
borderRadius: '0.8rem', | ||
padding: '0.2rem 0.5rem 0.2rem 0.2rem', | ||
minHeight: '0', | ||
fontSize: '0.8rem', | ||
color: tokens.gray600, | ||
backgroundColor: tokens.gray100, | ||
}), | ||
filters: css({ | ||
marginTop: '0.3rem', | ||
}), | ||
}; | ||
|
||
return ( | ||
<Flex flexDirection="column"> | ||
<TextInput.Group className={styles.searchWrapper}> | ||
<Flex gap="1rem"> | ||
<Flex> | ||
<Flex alignItems="center">filterName</Flex> | ||
<Select id="optionSelect-controlled" name="optionSelect-controlled" value={''}> | ||
<Select.Option value="optionOne">Option 1</Select.Option> | ||
<Select.Option value="optionTwo">Long Option 2</Select.Option> | ||
</Select> | ||
<Select id="optionSelect-controlled" name="optionSelect-controlled" value={''}> | ||
<Select.Option value="optionOne">Option 1</Select.Option> | ||
<Select.Option value="optionTwo">Long Option 2</Select.Option> | ||
</Select> | ||
</Flex> | ||
<Flex> | ||
<Flex alignItems="center">filterName</Flex> | ||
<Select id="optionSelect-controlled" name="optionSelect-controlled" value={''}> | ||
<Select.Option value="optionOne">Option 1</Select.Option> | ||
<Select.Option value="optionTwo">Long Option 2</Select.Option> | ||
</Select> | ||
<Select id="optionSelect-controlled" name="optionSelect-controlled" value={''}> | ||
<Select.Option value="optionOne">Option 1</Select.Option> | ||
<Select.Option value="optionTwo">Long Option 2</Select.Option> | ||
</Select> | ||
</Flex> | ||
</Flex> | ||
<TextInput | ||
id="search" | ||
name="search" | ||
className={styles.searchInput} | ||
placeholder="Type to search for assets" | ||
value={searchTerm} | ||
onChange={(e) => setSearchTerm(e.target.value)} | ||
/> | ||
<Button variant="secondary" className={styles.searchInputFilter} startIcon={<FilterIcon />} onClick={() => {}} aria-label="Filter"> | ||
Filter | ||
</Button> | ||
</TextInput.Group> | ||
<Stack className={styles.filters}> | ||
<Button variant="secondary" size="small" className={styles.filterButton} startIcon={<PlusIcon className={styles.icon} />}> | ||
Created by me | ||
</Button> | ||
<Button variant="secondary" className={styles.filterButton} startIcon={<PlusIcon className={styles.icon} />}> | ||
Status is | ||
</Button> | ||
<Button variant="secondary" className={styles.filterButton} startIcon={<PlusIcon className={styles.icon} />}> | ||
Tag is one of | ||
</Button> | ||
</Stack> | ||
</Flex> | ||
); | ||
} |
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
Oops, something went wrong.