Skip to content

Commit c43a918

Browse files
Set TypeScript 5.1 as the minimum TS version (#18)
1 parent fe142f6 commit c43a918

File tree

6 files changed

+26
-23
lines changed

6 files changed

+26
-23
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
## [Unreleased]
22

33
- Add `sticky` prop on `EmojiPicker.Root` to allow disabling sticky category headers, thanks @Earthsplit!
4+
- Add TypeScript as an optional peer dependency to prevent using TypeScript versions lower than 5.1.
45

56
## [0.2.0] - 2025-04-02
67

README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,11 @@ It can be composed and combined with other shadcn/ui components like [Popover](h
7676

7777
Find the full documentation and examples on [frimousse.liveblocks.io](https://frimousse.liveblocks.io).
7878

79+
## Compatibility
80+
81+
- React 18 and 19
82+
- TypeScript 5.1 and above
83+
7984
## Miscellaneous
8085

8186
The name [“frimousse”](https://en.wiktionary.org/wiki/frimousse) means “little face” in French, and it can also refer to smileys and emoticons.

package-lock.json

Lines changed: 7 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,13 @@
3838
"release": "release-it"
3939
},
4040
"peerDependencies": {
41-
"react": "^18 || ^19"
41+
"react": "^18 || ^19",
42+
"typescript": ">=5.1.0"
43+
},
44+
"peerDependenciesMeta": {
45+
"typescript": {
46+
"optional": true
47+
}
4248
},
4349
"devDependencies": {
4450
"@arethetypeswrong/cli": "^0.17.4",

src/components/emoji-picker.tsx

Lines changed: 5 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -930,11 +930,7 @@ const EmojiPickerListCategory = memo(
930930
return (
931931
<div {...listCategoryProps(categoryIndex, category)}>
932932
<CategoryHeader
933-
{...listCategoryHeaderProps(
934-
{ label: category.label },
935-
false,
936-
sticky,
937-
)}
933+
{...listCategoryHeaderProps({ label: category.label }, false, sticky)}
938934
/>
939935
</div>
940936
);
@@ -1301,10 +1297,7 @@ const EmojiPickerSkinToneSelector = forwardRef<
13011297
* </EmojiPicker.Root>
13021298
* ```
13031299
*/
1304-
function EmojiPickerLoading({
1305-
children,
1306-
...props
1307-
}: EmojiPickerLoadingProps): ReactNode {
1300+
function EmojiPickerLoading({ children, ...props }: EmojiPickerLoadingProps) {
13081301
const store = useEmojiPickerStore();
13091302
const isLoading = useSelector(store, $isLoading);
13101303

@@ -1353,10 +1346,7 @@ function EmojiPickerEmptyWithSearch({
13531346
* </EmojiPicker.Empty>
13541347
* ```
13551348
*/
1356-
function EmojiPickerEmpty({
1357-
children,
1358-
...props
1359-
}: EmojiPickerEmptyProps): ReactNode {
1349+
function EmojiPickerEmpty({ children, ...props }: EmojiPickerEmptyProps) {
13601350
const store = useEmojiPickerStore();
13611351
const isEmpty = useSelector(store, $isEmpty);
13621352

@@ -1407,9 +1397,7 @@ function EmojiPickerEmpty({
14071397
* If you prefer to use a hook rather than a component,
14081398
* {@link useActiveEmoji} is also available.
14091399
*/
1410-
function EmojiPickerActiveEmoji({
1411-
children,
1412-
}: EmojiPickerActiveEmojiProps): ReactNode {
1400+
function EmojiPickerActiveEmoji({ children }: EmojiPickerActiveEmojiProps) {
14131401
const activeEmoji = useActiveEmoji();
14141402

14151403
return children({ emoji: activeEmoji });
@@ -1459,10 +1447,7 @@ function EmojiPickerActiveEmoji({
14591447
* An already-built skin tone selector is also available,
14601448
* {@link EmojiPicker.SkinToneSelector|`<EmojiPicker.SkinToneSelector />`}.
14611449
*/
1462-
function EmojiPickerSkinTone({
1463-
children,
1464-
emoji,
1465-
}: EmojiPickerSkinToneProps): ReactNode {
1450+
function EmojiPickerSkinTone({ children, emoji }: EmojiPickerSkinToneProps) {
14661451
const [skinTone, setSkinTone, skinToneVariations] = useSkinTone(emoji);
14671452

14681453
return children({ skinTone, setSkinTone, skinToneVariations });

src/hooks.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,5 +90,5 @@ export function useSkinTone(
9090
store.set({ skinTone });
9191
}, []);
9292

93-
return [skinTone, setSkinTone, skinToneVariations] as const;
93+
return [skinTone, setSkinTone, skinToneVariations];
9494
}

0 commit comments

Comments
 (0)