File tree Expand file tree Collapse file tree 6 files changed +17
-40
lines changed
settings/shortcuts/keyboard-shortcut-recorder Expand file tree Collapse file tree 6 files changed +17
-40
lines changed Original file line number Diff line number Diff line change @@ -85,11 +85,11 @@ const BROWSER_KEY_DISPLAY_LABELS: Partial<
8585 * Gets display label for a full shortcut string.
8686 *
8787 * @param shortcut - The shortcut string (e.g., "control+shift+ ", "a")
88- * @returns Human-readable display (e.g., "Ctrl+ Shift+ Space", "A")
88+ * @returns Human-readable display (e.g., "Ctrl + Shift + Space", "A")
8989 *
9090 * @example
9191 * getShortcutDisplayLabel(' ') // 'Space'
92- * getShortcutDisplayLabel('control+a') // 'Ctrl+ A'
92+ * getShortcutDisplayLabel('control+a') // 'Ctrl + A'
9393 * getShortcutDisplayLabel(null) // ''
9494 */
9595export function getShortcutDisplayLabel ( shortcut : string | null ) : string {
@@ -98,7 +98,7 @@ export function getShortcutDisplayLabel(shortcut: string | null): string {
9898 return shortcut
9999 . split ( '+' )
100100 . map ( ( key ) => formatKeyForDisplay ( key . toLowerCase ( ) ) )
101- . join ( '+ ' ) ;
101+ . join ( ' + ' ) ;
102102}
103103
104104/**
Original file line number Diff line number Diff line change @@ -16,12 +16,9 @@ export {
1616 KEYBOARD_EVENT_SUPPORTED_KEYS ,
1717 type KeyboardEventSupportedKey ,
1818} from './browser/supported-keys' ;
19-
19+ export { getShortcutDisplayLabel } from './display-labels' ;
2020export {
2121 normalizeOptionKeyCharacter ,
2222 OPTION_DEAD_KEYS ,
2323} from './macos-option-key-map' ;
24-
2524export { CommandOrAlt , CommandOrControl } from './modifiers' ;
26-
27- export { getShortcutDisplayLabel } from './display-labels' ;
Original file line number Diff line number Diff line change 11<script lang =" ts" >
22 import { Button , buttonVariants } from ' @epicenter/ui/button' ;
3+ import * as Kbd from ' @epicenter/ui/kbd' ;
34 import { Link } from ' @epicenter/ui/link' ;
45 import * as Card from ' @epicenter/ui/card' ;
56 import * as Alert from ' @epicenter/ui/alert' ;
230231 <li class =" flex gap-3" >
231232 <span class =" shrink-0" >a.</span >
232233 <span
233- >Press <kbd
234- class =" bg-muted px-2 py-1 rounded font-mono text-xs"
235- >Windows + X</kbd
236- > and select "System"</span
234+ >Press <Kbd .Root >Windows + X</Kbd .Root > and select
235+ "System"</span
237236 >
238237 </li >
239238 <li class =" flex gap-3" >
Original file line number Diff line number Diff line change 11<script lang =" ts" >
22 import * as Alert from ' @epicenter/ui/alert' ;
3- import { Badge } from ' @epicenter/ui/badge' ;
43 import { Button } from ' @epicenter/ui/button' ;
4+ import * as Kbd from ' @epicenter/ui/kbd' ;
55 import { Input } from ' @epicenter/ui/input' ;
66 import * as Popover from ' @epicenter/ui/popover' ;
77 import {
4141
4242<div class =" flex items-center justify-end gap-2" >
4343 {#if rawKeyCombination }
44- <Badge variant =" secondary" class =" font-mono text-xs" >
45- {getShortcutDisplayLabel (rawKeyCombination )}
46- </Badge >
44+ <Kbd .Root >{getShortcutDisplayLabel (rawKeyCombination )}</Kbd .Root >
4745 <Button
4846 variant =" ghost"
4947 size =" icon"
137135 class =" flex grow items-center gap-1.5 overflow-x-auto pr-2 scrollbar-none"
138136 >
139137 {#if rawKeyCombination && ! keyRecorder .isListening }
140- <Badge variant =" secondary" class =" font-mono text-xs" >
141- {getShortcutDisplayLabel (rawKeyCombination )}
142- </Badge >
138+ <Kbd .Root >{getShortcutDisplayLabel (rawKeyCombination )}</Kbd .Root >
143139 {:else if ! keyRecorder .isListening }
144140 <span class =" truncate text-muted-foreground"
145141 >{placeholder }</span
Original file line number Diff line number Diff line change 11<script lang =" ts" >
22 import * as Alert from ' @epicenter/ui/alert' ;
3- import { Badge } from ' @epicenter/ui/badge' ;
43 import { Button } from ' @epicenter/ui/button' ;
4+ import * as Kbd from ' @epicenter/ui/kbd' ;
55 import * as Dialog from ' @epicenter/ui/dialog' ;
66 import {
77 ACCELERATOR_SECTIONS ,
9090 <p class =" text-xs text-muted-foreground mb-2" >Hold with other keys</p >
9191 <div class =" flex flex-wrap sm:flex-col gap-1" >
9292 {#each (isLocal ? KEYBOARD_EVENT_SUPPORTED_KEY_SECTIONS .at (0 ) : ACCELERATOR_SECTIONS .at (0 )).keys as modifier }
93- <Badge variant =" outline" class =" font-mono text-sm justify-start" >
94- {modifier }
95- </Badge >
93+ <Kbd .Root >{modifier }</Kbd .Root >
9694 {/each }
9795 </div >
9896 </div >
108106 </p >
109107 <div class =" flex flex-wrap gap-1" >
110108 {#each section .keys as key }
111- <Badge variant =" secondary" class =" font-mono text-xs" >
112- {key }
113- </Badge >
109+ <Kbd .Root >{key }</Kbd .Root >
114110 {/each }
115111 </div >
116112 </div >
140136 </p >
141137 <div class =" flex flex-wrap gap-1 my-2" >
142138 {#each OPTION_DEAD_KEYS as key }
143- <Badge variant =" outline" class =" font-mono text-xs" >
144- Option+{key .toUpperCase ()}
145- </Badge >
139+ <Kbd .Root >Option + {key .toUpperCase ()}</Kbd .Root >
146140 {/each }
147141 </div >
148142 <p class =" font-medium" >Workarounds:</p >
Original file line number Diff line number Diff line change 33 import NavItems from ' $lib/components/NavItems.svelte' ;
44 import CopyToClipboardButton from ' $lib/components/copyable/CopyToClipboardButton.svelte' ;
55 import { Button } from ' @epicenter/ui/button' ;
6+ import * as Kbd from ' @epicenter/ui/kbd' ;
67 import { Link } from ' @epicenter/ui/link' ;
78 import { ClipboardIcon } from ' $lib/components/icons' ;
89 import {
365366 tooltip =" Go to local shortcut in settings"
366367 href =" /settings/shortcuts/local"
367368 >
368- <kbd
369- class =" bg-muted relative rounded px-[0.3rem] py-[0.15rem] font-mono text-sm font-semibold"
370- >
371- {getShortcutDisplayLabel (
372- settings .value [' shortcuts.local.toggleManualRecording' ],
373- )}
374- </kbd >
369+ <Kbd .Root >{getShortcutDisplayLabel (settings .value [' shortcuts.local.toggleManualRecording' ])}</Kbd .Root >
375370 </Link >{' ' }
376371 to start recording here.
377372 </p >
382377 tooltip =" Go to global shortcut in settings"
383378 href =" /settings/shortcuts/global"
384379 >
385- <kbd
386- class =" bg-muted relative rounded px-[0.3rem] py-[0.15rem] font-mono text-sm font-semibold"
387- >
388- {settings .value [' shortcuts.global.toggleManualRecording' ]}
389- </kbd >
380+ <Kbd .Root >{getShortcutDisplayLabel (settings .value [' shortcuts.global.toggleManualRecording' ])}</Kbd .Root >
390381 </Link >{' ' }
391382 to start recording anywhere.
392383 </p >
You can’t perform that action at this time.
0 commit comments