feat: add fn win alt keys (#4638)

* feat: add new keys

* feat: add new keys

* chore: update docs & storybook as well

---------

Co-authored-by: WK Wong <wingkwong.code@gmail.com>
This commit is contained in:
winches 2025-01-30 20:40:51 +08:00 committed by GitHub
parent 69aa4769c0
commit 8452603b5b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 22 additions and 2 deletions

View File

@ -0,0 +1,5 @@
---
"@heroui/kbd": patch
---
Add fn win alt keys (#4499)

View File

@ -112,5 +112,8 @@ type KbdKey =
| "home"
| "end"
| "help"
| "space";
| "space"
| "fn"
| "win"
| "alt";
```

View File

@ -17,7 +17,10 @@ export type KbdKey =
| "home"
| "end"
| "help"
| "space";
| "space"
| "fn"
| "win"
| "alt";
export const kbdKeysMap: Record<KbdKey, string> = {
command: "⌘",
@ -39,6 +42,9 @@ export const kbdKeysMap: Record<KbdKey, string> = {
end: "↘",
help: "?",
space: "␣",
fn: "Fn",
win: "⌘",
alt: "⌥",
};
export const kbdKeysLabelMap: Record<KbdKey, string> = {
@ -61,6 +67,9 @@ export const kbdKeysLabelMap: Record<KbdKey, string> = {
end: "End",
help: "Help",
space: "Space",
fn: "Fn",
win: "Win",
alt: "Alt",
};
export type KbdKeysLabelType = typeof kbdKeysLabelMap;

View File

@ -31,6 +31,9 @@ export default {
"end",
"help",
"space",
"fn",
"win",
"alt",
],
},
},