Extract BackdropCard and EmptyState components
The subprocessor list item, commitment card, and empty state each inlined layout and color Tailwind classes on className, against the v2 UI rules that keep look-and-layout in tailwind-variants slots. Move the shared soft-Card frame (a backdrop header faded over a body) into a presentational BackdropCard, and the icon/title/description placeholder into a generic EmptyState, both under components/. Refactor CommitmentCard and SubprocessorListItem onto BackdropCard, and SubprocessorsEmpty onto EmptyState, leaving only component-specific slots in each variants.ts. Subprocessors without a website now show the dotted backdrop behind the fallback icon, matching the commitment card. Signed-off-by: Émile Ré <emile@probo.com>
This commit is contained in:
26
apps/compliance-portal/src/components/EmptyState/variants.ts
Normal file
26
apps/compliance-portal/src/components/EmptyState/variants.ts
Normal file
@@ -0,0 +1,26 @@
|
||||
// Copyright (c) 2026 Probo Inc <hello@probo.com>.
|
||||
//
|
||||
// Permission to use, copy, modify, and/or distribute this software for any
|
||||
// purpose with or without fee is hereby granted, provided that the above
|
||||
// copyright notice and this permission notice appear in all copies.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
||||
// REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
||||
// AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
||||
// INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
||||
// LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
||||
// OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
||||
// PERFORMANCE OF THIS SOFTWARE.
|
||||
|
||||
import { tv } from "tailwind-variants/lite";
|
||||
|
||||
// Empty-state placeholder: a faint icon above a centered title / description
|
||||
// and an optional call to action. The icon slot tones and sizes any phosphor
|
||||
// icon passed in, so consumers hand in a bare icon element.
|
||||
export const emptyState = tv({
|
||||
slots: {
|
||||
root: "flex flex-col items-center gap-5 py-8 text-center",
|
||||
icon: "text-sand-a8 [&_svg]:size-6",
|
||||
body: "flex max-w-xs flex-col items-center gap-2",
|
||||
},
|
||||
});
|
||||
Reference in New Issue
Block a user