From c11fbfc5b1a7eca384fdcf8c60f6976fe37c8dfd Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Gabriele=20Vigan=C3=B2?=
{groups.map((group) => (
-
) : (
@@ -146,18 +148,14 @@ export function PermissionsPanel({ permissions }: { permissions: Permission[] })
className="pointer-events-none absolute top-1/2 left-2.5 size-4 -translate-y-1/2 text-muted-foreground"
aria-hidden="true"
/>
- setSearch(event.target.value)}
- onKeyDown={(event) => {
- if (event.key === "Escape") setSearch("");
- }}
+ onValueChange={setSearch}
aria-label="Search permissions"
placeholder="Search"
autoComplete="off"
spellCheck={false}
- className="h-9 w-full rounded-md border bg-background pr-2.5 pl-8 text-base outline-none placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 sm:text-sm dark:bg-input/30"
+ className="h-9 w-full rounded-md border bg-background pl-8 text-base outline-none placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 sm:text-sm dark:bg-input/30"
/>
{matching.length ? (
diff --git a/src/components/account/account-cards.tsx b/src/components/account/account-cards.tsx
index 8b309be..84ff258 100644
--- a/src/components/account/account-cards.tsx
+++ b/src/components/account/account-cards.tsx
@@ -1,3 +1,4 @@
+import { Hint } from "@/components/ui/tooltip";
import { useRouter } from "@tanstack/react-router";
import { useState, type ReactNode } from "react";
import { cn } from "cn";
@@ -67,17 +68,19 @@ function UnlinkAction({
onClick: () => void;
}) {
return (
-
-
-
+
- {scope.id}
-
-
-
+ {scope.id}
+
+
+ - {options.length === 0 ? emptyText : "Nothing matches that filter."} -
- ) : ( - visible.map((option) => { - const checked = selected.includes(option.key); - return ( -{option.key}
-
- {(option.disabled && option.disabledReason) || option.hint ? (
-
- {option.disabled ? option.disabledReason : option.hint}
+ + {options.length === 0 ? emptyText : "Nothing matches that filter."} +
+ ) : ( + visible.map((option) => { + const checked = selected.includes(option.key); + return ( +{option.key}
- ) : null}
-
-
{error}
diff --git a/src/components/ui/input.tsx b/src/components/ui/input.tsx
index 86342c1..8ab754c 100644
--- a/src/components/ui/input.tsx
+++ b/src/components/ui/input.tsx
@@ -7,7 +7,7 @@ function Input({ className, type, ...props }: React.ComponentProps<"input">) {
type={type}
data-slot="input"
className={cn(
- "h-9 w-full min-w-0 rounded-md border border-input bg-transparent px-3 py-1 text-base shadow-xs transition-[color,box-shadow] outline-none selection:bg-primary selection:text-primary-foreground file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm dark:bg-input/30",
+ "h-9 w-full min-w-0 appearance-none rounded-md border border-input bg-transparent px-3 py-1 text-base shadow-xs transition-[color,box-shadow] outline-none selection:bg-primary selection:text-primary-foreground file:inline-flex file:h-7 file:border-0 file:mr-3 file:rounded-sm file:bg-secondary file:px-2 file:text-secondary-foreground file:text-sm file:font-medium placeholder:text-muted-foreground disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm dark:bg-input/30",
"focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50",
"aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40",
className,
diff --git a/src/components/ui/scroll-area.tsx b/src/components/ui/scroll-area.tsx
new file mode 100644
index 0000000..e2ba50b
--- /dev/null
+++ b/src/components/ui/scroll-area.tsx
@@ -0,0 +1,54 @@
+import type { ComponentProps } from "react";
+import { ScrollArea as ScrollAreaPrimitive } from "radix-ui";
+import { cn } from "cn";
+
+/** Styled scrollbars with native wheel, touch and keyboard scrolling. */
+export function ScrollArea({
+ children,
+ className,
+ viewportLabel,
+ ...props
+}: ComponentProps
&mjR)N__ze*&wOqe3HDy!s E#h5{@(*
z<(}1;LB^&o-+*y<9Jx*8G%@D>dH&RR&?gyKMhZ?xC5_v^%4nV!d+nqWz^K_KVfW)l
zO*aE&)`rUMRmMok(>odZl0T8hbJ=$~TA6n|3x1veYH~BgoX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