open-nomad/ui/app/styles/components/keyboard-shortcuts-modal.scss

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

131 lines
2.3 KiB
SCSS
Raw Normal View History

/**
* Copyright (c) HashiCorp, Inc.
* SPDX-License-Identifier: MPL-2.0
*/
[ui] general keyboard navigation: 1.3.4 release (#14138) * Initialized keyboard service Neat but funky: dynamic subnav traversal 👻 generalized traverseSubnav method Shift as special modifier key Nice little demo panel Keyboard shortcuts keycard Some animation styles on keyboard shortcuts Handle situations where a link is deeply nested from its parent menu item Keyboard service cleanup helper-based initializer and teardown for new contextual commands Keyboard shortcuts modal component added and demo-ghost removed Removed j and k from subnav traversal Register and unregister methods for subnav plus new subnavs for volumes and volume register main nav method Generalizing the register nav method 12762 table keynav (#12975) * Experimental feature: shortcut visual hints * Long way around to a custom modifier for keyboard shortcuts * dynamic table and list iterative shortcuts * Progress with regular old tether * Delogging * Table Keynav tether fix, server and client navs, and fix to shiftless on modified arrow keys Go to Optimize keyboard link and storage key changed to g r parameterized jobs keyboard nav Dynamic numeric keynav for multiple tables (#13482) * Multiple tables init * URL-bind enumerable keyboard commands and add to more taskRow and allocationRows * Type safety and lint fixes * Consolidated push to keyCommands * Default value when removing keyCommands * Remove the URL-based removal method and perform a recompute on any add Get tests passing in Keynav: remove math helpers and a few other defensive moves (#13761) * Remove ember math helpers * Test fixes for jobparts/body * Kill an unneeded integration helper test * delog * Trying if disabling percy lets this finish * Okay so its not percy; try parallelism in circle * Percyless yet again * Trying a different angle to not have percy * Upgrade percy to 1.6.1 [ui] Keyboard nav: "u" key to go up a level (#13754) * U to go up a level * Mislabelled my conditional * Custom lint ignore rule * Custom lint ignore rule, this time with commas * Since we're getting rid of ember math helpers elsewhere, do the math ourselves here Replace ArrowLeft etc. with an ascii arrow (#13776) * Replace ArrowLeft etc. with an ascii arrow * non-mutative helper cleanup Keyboard Nav: let users rebind their shortcuts (#13781) * click-outside and shortcuts enabled/disabled toggle * Trap focus when modal open * Enabled/disabled saved to localStorage * Autofocus edit button on variable index * Modal overflow styles * Functional rebind * Saving rebinds to localStorage for all majors * Started on defaultCommandBindings * Modal header style and cancel rebind on escape * keyboardable keybindings w buttons instead of spans * recording and defaultvalues * Enter short-circuits rebind * Only some commands are rebindable, and dont show dupes * No unused get import * More visually distinct header on modal * Disallowed keys for rebind, showing buffer as you type, and moving dedupe to modal logic willDestroy hook to prevent tests from doubling/tripling up addEventListener on kb events remove unused tests Keyboard Navigation acceptance tests (#13893) * Acceptance tests for keyboard modal * a11y audit fix and localStorage clear * Bind/rebind/localStorage tests * Keyboard tests for dynamic nav and tables * Rebinder and assert expectation * Second percy snapshot showing hints no longer relevant Weird issue where linktos with query props specifically from the task-groups page would fail to route / hit undefined.shouldSuperCede errors Adds the concept of exclusivity to a keycommand, removing peers that also share its label Lintfix Changelog and PR feedback Changelog and PR feedback Fix to rebinding in firefox by blurring the now-disabled button on rebind (#14053) * Secure Variables shortcuts removed * Variable index route autofocus removed * Updated changelog entry * Updated changelog entry * Keynav docs (#14148) * Section added to the API Docs UI page * Added a note about disabling * Prev and Next order * Remove dev log and unneeded comments
2022-08-17 16:59:33 +00:00
.keyboard-shortcuts {
position: fixed;
background-color: white;
padding: 2rem;
margin-top: 20vh;
width: 40vw;
left: 30vw;
z-index: 499;
box-shadow: 2px 2px 12px 3000px rgb(0, 0, 0, 0.8);
animation-name: slideIn;
animation-duration: 0.2s;
animation-fill-mode: both;
max-height: 60vh;
display: grid;
grid-template-rows: auto 1fr auto;
header {
margin-bottom: 2rem;
h2 {
font-size: $size-3;
font-weight: $weight-semibold;
}
button.dismiss {
float: right;
font-size: 0.7rem;
margin-bottom: 1rem;
}
}
ul.commands-list {
overflow: auto;
margin: 0 -2rem;
padding: 0 2rem;
li {
list-style-type: none;
padding: 0.5rem 0;
display: grid;
grid-template-columns: auto 1fr;
&:not(:last-of-type) {
border-bottom: 1px solid #ccc;
}
strong {
padding: 0.25rem 0;
}
.keys {
text-align: right;
& > span.recording {
color: $red;
font-size: 0.75rem;
}
button {
border: none;
background: #eee;
cursor: pointer;
&:hover {
background: #ddd;
}
&[disabled],
&[disabled]:hover {
background: #eee;
color: black;
cursor: not-allowed;
}
span {
margin: 0.25rem;
display: inline-block;
}
&.reset-to-default {
background: white;
color: $red;
font-size: 0.75rem;
}
}
}
}
}
footer {
background: #eee;
padding: 1rem 2rem;
margin: 1rem -2rem -2rem;
display: grid;
grid-template-columns: auto 1fr;
.toggle {
text-align: right;
}
}
}
// Global keyboard hint style
[data-shortcut] {
background: lighten($nomad-green, 25%);
border: 1px solid $nomad-green-dark;
content: attr(data-shortcut);
display: block;
position: absolute;
top: 0;
left: 0;
font-size: 0.75rem;
padding: 0 0.5rem;
text-transform: lowercase;
color: black;
font-weight: 300;
z-index: $z-popover;
&.menu-level {
z-index: $z-tooltip;
}
}
@keyframes slideIn {
from {
opacity: 0;
top: 40px;
}
to {
opacity: 1;
top: 0px;
}
}