menus: address several little big things about menu styling (#2624)

- menu: fix accidental stacking of menus
https://linear.app/tldraw/issue/TLD-2077/radix-menus-double-submenu
which is a followup to https://github.com/tldraw/tldraw/pull/2101
- cc @steveruizok I might be missing context here but looking at the
original PR I don't see why this is needed anymore? can you show me in
person?
- menu: rework checkboxes
https://linear.app/tldraw/issue/TLD-2071/improve-appearance-of-menu-checkboxes
- menu: nix the text-shadow on menus
- menu: fix the kbd being off by a couple pixels

### Change Type

- [x] `patch` — Bug fix

### Release Notes

- Fixes nits on styling on our Radix menus.
pull/2632/head
Mime Čuvalo 2024-01-25 11:34:18 +00:00 zatwierdzone przez GitHub
rodzic 4aaeafd916
commit ace1743ae5
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: B5690EEEBB952194
3 zmienionych plików z 22 dodań i 10 usunięć

Wyświetl plik

@ -1,3 +1,19 @@
<svg width="30" height="30" viewBox="0 0 30 30" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M8 8H22V22H8V8Z" stroke="black" stroke-opacity="0.5" stroke-width="2"/>
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg
width="30"
height="30"
viewBox="0 0 30 30"
fill="none"
version="1.1"
id="svg1"
xmlns="http://www.w3.org/2000/svg"
xmlns:svg="http://www.w3.org/2000/svg">
<defs
id="defs1" />
<path
d="M 6.4651362,4.9397125 H 23.974196 a 1.7194619,1.7194619 45 0 1 1.719462,1.7194619 l 0,17.5090556 a 1.779661,1.779661 135 0 1 -1.779661,1.779661 H 6.5922549 A 1.9067797,1.9067797 45 0 1 4.6854752,24.041111 V 6.7193735 a 1.779661,1.779661 135 0 1 1.779661,-1.779661 z"
stroke="#000000"
stroke-width="3"
id="path1"
transform="translate(0.81043485,0.55619755)" />
</svg>

Przed

Szerokość:  |  Wysokość:  |  Rozmiar: 184 B

Po

Szerokość:  |  Wysokość:  |  Rozmiar: 668 B

Wyświetl plik

@ -33,7 +33,6 @@
font-size: 12px;
gap: 0px;
color: var(--color-text-1);
text-shadow: 1px 1px var(--color-text-shadow);
}
.tlui-button:disabled {
@ -528,6 +527,10 @@
border-radius: 2px;
}
.tlui-kbd > span:last-child {
padding-right: 0;
}
.tlui-kbd:not(:last-child) {
margin-right: var(--space-2);
}

Wyświetl plik

@ -8,15 +8,8 @@ export function useMenuIsOpen(id: string, cb?: (isOpen: boolean) => void) {
const rIsOpen = useRef(false)
const trackEvent = useUiEvents()
const rLastChange = useRef(0)
const onOpenChange = useCallback(
(isOpen: boolean) => {
// prevent multiple calls in quick succession
const now = Date.now()
if (now - rLastChange.current < 50) return
rLastChange.current = now
rIsOpen.current = isOpen
editor.batch(() => {