From bfa381ef26c72b4b02263761afac8679389cb0b9 Mon Sep 17 00:00:00 2001 From: PrimeTestLab Date: Tue, 10 Nov 2026 12:29:51 +0500 Subject: [PATCH] feat(site): add keyboard shortcuts to the icons page (#5035) * feat(docs): add keyboard shortcuts to the icons page Add the shortcuts suggested in #4916 and list them on the page: - Ctrl/Cmd + click on an icon copies its name - Arrow keys move from the search field into the results and between the icons - Ctrl/Cmd + C copies the name of the selected icon - Ctrl/Cmd + Shift + C copies the SVG of the selected icon Icons can now be focused with the keyboard, and a keyboard button next to the sort select opens a dialog with all shortcuts, including the existing Ctrl/Cmd + K and Shift + click. The dialog also opens with Shift + ? (except while typing in a field). Closes #4916 Co-Authored-By: Claude Opus 5.5 * feat(docs): add copy toasts, open icons with Enter and a shared Kbd component - Copying an icon shows a toast (vue-sonner, bottom-center) that says whether its name or its SVG was copied - Enter opens the selected icon's drawer - The SVG shortcut is now Shift + C, as Ctrl/Cmd + Shift + C opens the browser's inspect tool - Kbd component shared by the search inputs and the shortcuts dialog Co-Authored-By: Claude Opus 5.5 * Adjust keyboard shortcuts * Revert customizer change * Adjust kbd style * Fix toaster styling * Fix types --------- Co-authored-by: Claude Opus 5.5 Co-authored-by: Eric --- .../theme/components/base/FakeInput.vue | 18 +- .../theme/components/base/Input.vue | 28 +- .../theme/components/base/InputField.vue | 30 +- docs/.vitepress/theme/components/base/Kbd.vue | 20 ++ .../theme/components/base/Toaster.vue | 59 ++++ .../theme/components/icons/IconItem.vue | 72 ++++- .../theme/components/icons/IconsOverview.vue | 38 +++ .../components/icons/KeyboardShortcuts.vue | 297 ++++++++++++++++++ .../icons/SidebarIconCustomizer.vue | 1 + docs/.vitepress/theme/index.ts | 2 + .../theme/layouts/IconsSidebarNavAfter.vue | 23 +- docs/.vitepress/theme/style.css | 6 + docs/.vitepress/theme/utils/getSVGIcon.ts | 2 +- .../theme/utils/useSearchShortcut.ts | 6 +- docs/package.json | 3 +- pnpm-lock.yaml | 19 ++ 16 files changed, 563 insertions(+), 61 deletions(-) create mode 100644 docs/.vitepress/theme/components/base/Kbd.vue create mode 100644 docs/.vitepress/theme/components/base/Toaster.vue create mode 100644 docs/.vitepress/theme/components/icons/KeyboardShortcuts.vue diff --git a/docs/.vitepress/theme/components/base/FakeInput.vue b/docs/.vitepress/theme/components/base/FakeInput.vue index c2603f6f6..f941058ef 100644 --- a/docs/.vitepress/theme/components/base/FakeInput.vue +++ b/docs/.vitepress/theme/components/base/FakeInput.vue @@ -1,6 +1,7 @@