-
Notifications
You must be signed in to change notification settings - Fork 45
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(select-with-tags): design review fixes (#472)
* feat(select-with-tags): fix gaps * feat(select-with-tags): add empty list placeholder, fix colors * feat(select-with-tags): fix list open/close * feat(select-with-tags): add input on new line * feat(select-with-tags): fix label * feat(select-with-tags): add tag render prop * docs(select-with-tags): updates * feat(select-with-tags): change renderTag fn to Component * feat(input-autocomplete): arrow click behaviour Co-authored-by: reme3d2y <AYatsenko@alfabank.ru>
- Loading branch information
Showing
13 changed files
with
180 additions
and
99 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
export * from './tag-list'; | ||
export * from './tag'; |
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
25 changes: 25 additions & 0 deletions
25
packages/select-with-tags/src/components/tag/component.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,25 @@ | ||
import React, { useCallback } from 'react'; | ||
import { Tag as CoreTag } from '@alfalab/core-components-tag'; | ||
import { CrossCompactMIcon } from '@alfalab/icons-glyph/CrossCompactMIcon'; | ||
|
||
import { TagComponent } from '../../types'; | ||
|
||
import styles from './index.module.css'; | ||
|
||
export const Tag: TagComponent = ({ option: { content, key }, handleDeleteTag }) => { | ||
const handleClick = useCallback(() => { | ||
if (handleDeleteTag) { | ||
handleDeleteTag(key); | ||
} | ||
}, [handleDeleteTag, key]); | ||
|
||
return ( | ||
<CoreTag key={key} size='xs' checked={true} className={styles.tag}> | ||
<span className={styles.tagContentWrap}> | ||
{content} | ||
|
||
<CrossCompactMIcon onClick={handleClick} className={styles.tagCross} /> | ||
</span> | ||
</CoreTag> | ||
); | ||
}; |
Oops, something went wrong.