-
-
Notifications
You must be signed in to change notification settings - Fork 176
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* ? * postcss config * Order custom * ClickableEmojiButton * custom categories icon * x * Extract Most * Hide Custom Category * custom emojis prop * custom emojis visible * x * Custom Emojis Ready * docs
- Loading branch information
Showing
34 changed files
with
463 additions
and
209 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,8 +1,19 @@ | ||
module.exports = { | ||
stories: ['../stories/**/*.stories.@(ts|tsx|js|jsx)'], | ||
addons: ['@storybook/addon-links', '@storybook/addon-essentials'], | ||
addons: [ | ||
'@storybook/addon-links', | ||
'@storybook/addon-essentials', | ||
{ | ||
name: '@storybook/addon-postcss', | ||
options: { | ||
postcssLoaderOptions: { | ||
implementation: require('postcss') | ||
} | ||
} | ||
} | ||
], | ||
// https://storybook.js.org/docs/react/configure/typescript#mainjs-configuration | ||
typescript: { | ||
check: true, // type-check stories during Storybook build | ||
check: true // type-check stories during Storybook build | ||
} | ||
}; |
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,9 @@ | ||
module.exports = { | ||
plugins: [ | ||
require('postcss-inline-svg'), | ||
require('postcss-svgo'), | ||
require('autoprefixer'), | ||
require('cssnano') | ||
], | ||
inject: true | ||
}; |
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,13 @@ | ||
import { CustomEmoji } from '../../config/customEmojiConfig'; | ||
import { DataEmoji } from '../../dataUtils/DataTypes'; | ||
import { EmojiStyle } from '../../types/exposedTypes'; | ||
|
||
export type BaseEmojiProps = { | ||
emoji?: DataEmoji | CustomEmoji; | ||
emojiStyle: EmojiStyle; | ||
unified: string; | ||
size?: number; | ||
lazyLoad?: boolean; | ||
getEmojiUrl?: GetEmojiUrl; | ||
}; | ||
export type GetEmojiUrl = (unified: string, style: EmojiStyle) => string; |
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,42 @@ | ||
import clsx from 'clsx'; | ||
import * as React from 'react'; | ||
|
||
import { ClassNames } from '../../DomUtils/classNames'; | ||
import { Button } from '../atoms/Button'; | ||
import './Emoji.css'; | ||
|
||
type ClickableEmojiButtonProps = Readonly<{ | ||
hidden?: boolean; | ||
showVariations?: boolean; | ||
hiddenOnSearch?: boolean; | ||
emojiNames: string[]; | ||
children: React.ReactNode; | ||
hasVariations: boolean; | ||
unified?: string; | ||
}>; | ||
|
||
export function ClickableEmojiButton({ | ||
emojiNames, | ||
unified, | ||
hidden, | ||
hiddenOnSearch, | ||
showVariations = true, | ||
hasVariations, | ||
children | ||
}: ClickableEmojiButtonProps) { | ||
return ( | ||
<Button | ||
className={clsx(ClassNames.emoji, { | ||
[ClassNames.hidden]: hidden, | ||
[ClassNames.hiddenOnSearch]: hiddenOnSearch, | ||
[ClassNames.visible]: !hidden && !hiddenOnSearch, | ||
[ClassNames.emojiHasVariations]: hasVariations && showVariations | ||
})} | ||
data-unified={unified} | ||
aria-label={emojiNames[0]} | ||
data-full-name={emojiNames} | ||
> | ||
{children} | ||
</Button> | ||
); | ||
} |
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.