Draw the unlocked pickup box lock as an open padlock

The shackle now morphs instead of lifting: unlocked, the left leg stays
on the body and the right leg shrinks to a stub. The icon may draw past
its viewBox so the raised arc isn't clipped.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-01 11:38:31 +02:00
co-authored by Claude Opus 5.5
parent 3efde72524
commit d68806aaf8
2 changed files with 12 additions and 4 deletions
@@ -326,6 +326,11 @@
flex-shrink: 0; flex-shrink: 0;
} }
// The shackle lifts above the 24-unit viewBox when unlocked.
.lockIcon {
overflow: visible;
}
.cancelButton { .cancelButton {
padding: $space-1 $space-2; padding: $space-1 $space-2;
border: none; border: none;
+7 -4
View File
@@ -113,6 +113,10 @@ const ActionIcon = ({ name }: { name: keyof typeof actionIconPaths }) => (
) )
const LOCK_DURATION_SECONDS = 0.25 const LOCK_DURATION_SECONDS = 0.25
// Same commands in both so the shackle morphs: unlocked, the left leg
// stretches up from the body and the right leg shrinks to a stub.
const LOCKED_SHACKLE = 'M7 11V7a5 5 0 0 1 10 0v4'
const UNLOCKED_SHACKLE = 'M7 11V4a5 5 0 0 1 10 0v1'
// The shackle lifts while the box is open, and drops back first when the // The shackle lifts while the box is open, and drops back first when the
// button leaves after closing, so the lock visibly snaps shut. // button leaves after closing, so the lock visibly snaps shut.
@@ -123,7 +127,7 @@ const LockIcon = ({ open }: { open: boolean }) => {
: { duration: LOCK_DURATION_SECONDS, ease: 'easeOut' as const } : { duration: LOCK_DURATION_SECONDS, ease: 'easeOut' as const }
return ( return (
<svg <svg
className={styles.actionIcon} className={`${styles.actionIcon} ${styles.lockIcon}`}
viewBox="0 0 24 24" viewBox="0 0 24 24"
fill="none" fill="none"
stroke="currentColor" stroke="currentColor"
@@ -134,10 +138,9 @@ const LockIcon = ({ open }: { open: boolean }) => {
> >
<path d="M5 11h14a2 2 0 0 1 2 2v7a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-7a2 2 0 0 1 2-2Z" /> <path d="M5 11h14a2 2 0 0 1 2 2v7a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-7a2 2 0 0 1 2-2Z" />
<motion.path <motion.path
d="M7 11V7a5 5 0 0 1 10 0v4"
initial={false} initial={false}
animate={{ y: open ? -3 : 0 }} animate={{ d: open ? UNLOCKED_SHACKLE : LOCKED_SHACKLE }}
exit={{ y: 0 }} exit={{ d: LOCKED_SHACKLE }}
transition={transition} transition={transition}
/> />
</svg> </svg>