feat(users): add description field to permission definitions

This commit is contained in:
2026-04-22 16:20:43 -04:00
parent da5a1c6587
commit 71fe05bd2b
3 changed files with 32 additions and 30 deletions
+6 -6
View File
@@ -9,12 +9,12 @@ const Switch = ({
}) => {
return (
<div
className={`flex items-center justify-between gap-4 py-3 ${disabled ? 'opacity-50 cursor-not-allowed' : 'cursor-pointer'}`}
className={`flex items-center justify-between gap-4 px-4 py-3 ${disabled ? 'opacity-50 cursor-not-allowed' : 'cursor-pointer'}`}
onClick={() => !disabled && onChange?.(!checked)}
>
<div className="flex flex-col gap-0.5 min-w-0">
{label && (
<span className="text-sm text-neutral-900 dark:text-white select-none">{label}</span>
<span className="text-sm font-medium text-neutral-900 dark:text-white select-none">{label}</span>
)}
{description && (
<span className="text-xs text-neutral-500 dark:text-neutral-400 select-none">{description}</span>
@@ -27,14 +27,14 @@ const Switch = ({
aria-checked={checked}
disabled={disabled}
onClick={(e) => { e.stopPropagation(); !disabled && onChange?.(!checked); }}
className={`relative flex-shrink-0 w-11 h-6 rounded-full transition-colors duration-200 focus:outline-none focus:ring-2 focus:ring-blue-700 focus:ring-offset-2 focus:ring-offset-white dark:focus:ring-offset-neutral-900 ${
className={`relative flex-shrink-0 w-11 h-6 rounded-full transition-colors duration-200 focus:outline-none focus:ring-2 focus:ring-blue-700 focus:ring-offset-2 focus:ring-offset-white dark:focus:ring-offset-neutral-900 border ${
checked
? 'bg-blue-700'
: 'bg-neutral-300 dark:bg-neutral-600'
? 'bg-blue-700 border-blue-800'
: 'bg-neutral-100 dark:bg-neutral-700 border-neutral-300 dark:border-neutral-600'
} ${disabled ? 'cursor-not-allowed' : 'cursor-pointer'}`}
>
<span
className={`absolute top-0.5 left-0.5 w-5 h-5 rounded-full bg-white shadow-sm transition-transform duration-200 ${
className={`absolute top-1 left-1 w-4 h-4 rounded-full bg-white shadow-sm transition-transform duration-200 ${
checked ? 'translate-x-5' : 'translate-x-0'
}`}
/>