docs(theming/shortcuts): improve (#3259)

Co-authored-by: Benjamin Canac <canacb1@gmail.com>
This commit is contained in:
Nexos Creator
2025-02-07 01:48:52 +05:30
committed by GitHub
parent 53ac62eae5
commit e16eeee8c1
3 changed files with 38 additions and 10 deletions

View File

@@ -389,6 +389,12 @@ export default defineAppConfig({
loadingIcon: 'i-octicon-sync-24' loadingIcon: 'i-octicon-sync-24'
} }
}, },
inputMenu: {
default: {
selectedIcon: 'i-octicon-check-24',
trailingIcon: 'i-octicon-chevron-down-24'
}
},
select: { select: {
default: { default: {
loadingIcon: 'i-octicon-sync-24', loadingIcon: 'i-octicon-sync-24',
@@ -424,6 +430,9 @@ export default defineAppConfig({
sortButton: { sortButton: {
icon: 'i-octicon-arrow-switch-24' icon: 'i-octicon-arrow-switch-24'
}, },
expandButton: {
icon: 'i-octicon-chevron-down-24'
},
loadingState: { loadingState: {
icon: 'i-octicon-sync-24' icon: 'i-octicon-sync-24'
}, },
@@ -457,6 +466,21 @@ export default defineAppConfig({
default: { default: {
divider: 'i-octicon-chevron-right-24' divider: 'i-octicon-chevron-right-24'
} }
},
carousel: {
default: {
prevButton: {
icon: 'i-octicon-chevron-left-24'
},
nextButton: {
icon: 'i-octicon-chevron-right-24'
}
}
},
toggle: {
default: {
loadingIcon: 'i-octicon-sync-24'
}
} }
} }
}) })

View File

@@ -49,18 +49,22 @@ defineShortcuts({
Shortcuts keys are written as the literal keyboard key value. Combinations are made with `_` separator. Chained shortcuts are made with `-` separator. Shortcuts keys are written as the literal keyboard key value. Combinations are made with `_` separator. Chained shortcuts are made with `-` separator.
Modifiers are also available: Modifiers are also available:
- `meta`: acts as `Command` for MacOS and `Control` for others | Modifier | Description |
- `ctrl`: acts as `Control` |----------|-------------|
- `shift`: acts as `Shift` and is only necessary for alphabetic keys | `meta` | Acts as `Command (⌘)` on macOS and `Control (Ctrl)` on Windows/Linux. |
| `ctrl` | Represents the `Control (Ctrl)` key across all operating systems. |
| `shift` | Represents the `Shift` key, only needed for alphabetic keys (e.g., `shift_e`). |
Examples of keys: Examples of keys:
- `escape`: will trigger by hitting `Esc` | Shortcut Key | Action |
- `meta_k`: will trigger by hitting `⌘` and `K` at the same time on MacOS, and `Ctrl` and `K` on Windows and Linux |---------------|--------|
- `ctrl_k`: will trigger by hitting `Ctrl` and `K` at the same time on MacOS, Windows and Linux | `escape` | Triggers when `Esc` is pressed |
- `shift_e`: will trigger by hitting `Shift` and `E` at the same time on MacOS, Windows and Linux | `meta_k` | `⌘ + K` on Mac, `Ctrl + K` on Windows/Linux |
- `?`: will trigger by hitting `?` on some keyboard layouts, or for example `Shift` and `/`, which results in `?` on US Mac keyboards | `ctrl_k` | Triggers `Ctrl + K` on all OS |
- `g-d`: will trigger by hitting `g` then `d` with a maximum delay of 800ms by default | `shift_e` | Triggers `Shift + E` on all OS |
- `arrowleft`: will trigger by hitting `` (also: `arrowright`, `arrowup`, `arrowdown`) | `?` | Triggers `?` (Shift + `/` on US Mac keyboards) |
| `g-d` | Triggers when `g` then `d` are pressed within 800ms |
| `arrowleft` | Triggers when `←` is pressed (also: `arrowright`, `arrowup`, `arrowdown`) |
::callout{icon="i-heroicons-light-bulb"} ::callout{icon="i-heroicons-light-bulb"}
For a complete list of available shortcut keys, refer to the [`KeyboardEvent`](https://developer.mozilla.org/en-US/docs/Web/API/UI_Events/Keyboard_event_key_values) API docs. Note the `KeyboardEvent.key` has to be written in lowercase. For a complete list of available shortcut keys, refer to the [`KeyboardEvent`](https://developer.mozilla.org/en-US/docs/Web/API/UI_Events/Keyboard_event_key_values) API docs. Note the `KeyboardEvent.key` has to be written in lowercase.