feat(frontend): add accessible confirmation modal for destructive actions

Replace native window.confirm() dialogs with branded ConfirmationModal component
for all delete operations (users, categories). Implements progressive disclosure
for high-risk operations and requires confirmation text input for deletions with
100+ affected items.

Features:
- ConfirmationModal component with dynamic risk levels (low/medium/high)
- High-risk operations (100+ affected items) require 'DELETE' text confirmation
- Clear consequence messaging with affected item counts
- Loading state during deletion with visual feedback
- Full keyboard accessibility (Esc to cancel, Enter to confirm)
- Proper focus management and ARIA labels

Affected:
- AdminOverlay: Delete user and category now use ConfirmationModal
- New: ConfirmationModal.tsx component

Design: Matches CreateUserModal aesthetic (clean, minimal) with rose-500
accent for danger context. Progressive disclosure shows additional warnings
only for high-risk operations.

Build: Passes with zero errors.
This commit is contained in:
2026-04-17 10:37:56 +03:00
parent b6a48f1249
commit 710806bb14
4 changed files with 245 additions and 18 deletions

View File

@@ -37,7 +37,8 @@
"Bash(ls -lh aInventory-PROD-v*.zip)",
"Bash(npm install *)",
"Bash(/Library/Developer/CommandLineTools/usr/bin/git commit *)",
"Bash(/Library/Developer/CommandLineTools/usr/bin/git add *)"
"Bash(/Library/Developer/CommandLineTools/usr/bin/git add *)",
"Bash(command -v npx)"
]
}
}