From 7f455ed5d5f5797a47a46cd8c8d048807c293cd3 Mon Sep 17 00:00:00 2001 From: Danny White <3104761+dnywh@users.noreply.github.com> Date: Wed, 3 Sep 2025 14:39:00 +1000 Subject: [PATCH 1/3] chore: api keys ux improvements (#38390) * simply API key pills * add tooltip to other copy button * consistent destructive dropdown icon * design system documentation --- apps/design-system/content/docs/icons.mdx | 20 ++- .../interfaces/APIKeys/APIKeyDeleteDialog.tsx | 2 +- .../interfaces/APIKeys/ApiKeyPill.tsx | 122 +++++++----------- .../interfaces/APIKeys/PublishableAPIKeys.tsx | 38 ++++-- 4 files changed, 98 insertions(+), 84 deletions(-) diff --git a/apps/design-system/content/docs/icons.mdx b/apps/design-system/content/docs/icons.mdx index e3d259cb7f34b..f9df03365a43f 100644 --- a/apps/design-system/content/docs/icons.mdx +++ b/apps/design-system/content/docs/icons.mdx @@ -1,6 +1,24 @@ --- title: Icons -description: Icons system breakdown. Copy values of Icons. +description: Icons make actions and navigation across Supabase easier. --- +## Principles + +1. Paired: Icons should accompany text, as they aren’t often obvious enough on their own. +2. Clear: Icons should be legible at small sizes and unembellished. Let the text do the heavy lifting. +3. Consistent: Use the same icons for similar actions throughout Supabase. This makes the app easier to use. + +## Tints + +Destructive actions, such as deleting an API key, don’t need to be [tinted](color-usage#text) with `text-destructive` because there should be a confirmation dialog as a failsafe right after. + +## UI Icons + +We rely on Lucide icons for most of our UI icons. + +## Custom Icons + +Tap on an icon below to copy the JSX, SVG, or import path. + diff --git a/apps/studio/components/interfaces/APIKeys/APIKeyDeleteDialog.tsx b/apps/studio/components/interfaces/APIKeys/APIKeyDeleteDialog.tsx index f646d50246837..7ab3876edeb65 100644 --- a/apps/studio/components/interfaces/APIKeys/APIKeyDeleteDialog.tsx +++ b/apps/studio/components/interfaces/APIKeys/APIKeyDeleteDialog.tsx @@ -56,7 +56,7 @@ export const APIKeyDeleteDialog = ({ apiKey, lastSeen }: APIKeyDeleteDialogProps }, }} > - Delete API key + Delete API key - -
- {isSecret ? ( - <> - {apiKey?.api_key.slice(0, 15)} - - {show && data?.api_key ? data?.api_key.slice(15) : '••••••••••••••••'} - - - ) : ( - {apiKey?.api_key} - )} -
-
- - {/* Reveal button - only shown for secret keys and when not already revealed */} +
+ {isSecret ? ( + <> + {apiKey?.api_key.slice(0, 15)} + {show && data?.api_key ? data?.api_key.slice(15) : '••••••••••••••••'} + + ) : ( + {apiKey?.api_key} + )} +
+ + {/* Toggle button */} {isSecret && ( - - {!show && ( - - - -