File tree Expand file tree Collapse file tree
client/src/components/input Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11<script lang =" ts" >
2+ import { fly } from ' svelte/transition' ;
23 import { slashCommandState } from ' ../../lib/state/slash-commands.svelte' ;
34 import type { SlashCommand } from ' ../../lib/commands/registry' ;
45
6+ const reducedMotion = window .matchMedia (' (prefers-reduced-motion: reduce)' ).matches ;
7+
58 interface Props {
69 onselect: (cmd : SlashCommand ) => void ;
710 }
2629 id =" slash-command-menu"
2730 role =" listbox"
2831 aria-label =" Slash commands"
32+ transition:fly ={{ y : 4 , duration : reducedMotion ? 0 : 120 }}
2933>
3034 {#each slashCommandState .suggestions as cmd , i }
3135 <!-- svelte-ignore a11y_click_events_have_key_events -->
6670 overflow-y : auto ;
6771 z-index : 100 ;
6872 margin-bottom : 4px ;
69- animation : slide-up 120ms ease-out ;
70- }
71-
72- @keyframes slide-up {
73- from {
74- opacity : 0 ;
75- transform : translateY (4px );
76- }
77- to {
78- opacity : 1 ;
79- transform : translateY (0 );
80- }
81- }
82-
83- @media (prefers-reduced-motion: reduce) {
84- .slash-menu {
85- animation : none ;
86- }
8773 }
8874
8975 .slash-item {
You can’t perform that action at this time.
0 commit comments