feat: UI improvements to survey editor and summary cards (#6857)

This commit is contained in:
Johannes
2025-11-25 01:49:59 -08:00
committed by GitHub
parent c03c7ec1ed
commit f07092595f
37 changed files with 652 additions and 403 deletions
@@ -35,6 +35,7 @@ interface ConditionsEditorProps {
callbacks: TConditionsEditorCallbacks;
depth?: number;
quotaErrors?: FieldErrors<TSurveyQuotaInput>;
isSubmitted?: boolean;
}
export function ConditionsEditor({
@@ -43,6 +44,7 @@ export function ConditionsEditor({
callbacks,
depth = 0,
quotaErrors,
isSubmitted = false,
}: Readonly<ConditionsEditorProps>) {
const { t } = useTranslation();
const [parent] = useAutoAnimate();
@@ -256,7 +258,7 @@ export function ConditionsEditor({
</DropdownMenuContent>
</DropdownMenu>
</div>
{quotaError && <p className="text-error mt-2 w-full text-right text-sm">{quotaError}</p>}
{quotaError && isSubmitted && <p className="text-error mt-2 w-full text-right text-sm">{quotaError}</p>}
</div>
);
};
@@ -29,7 +29,6 @@
.fb-editor-heading-h1 {
font-size: 25px !important;
font-weight: 400 !important;
margin-bottom: 20px !important;
font-weight: bold !important;
}
@@ -2,9 +2,18 @@
interface EmptyStateProps {
text: string;
variant?: "default" | "simple";
}
export const EmptyState = ({ text }: EmptyStateProps) => {
export const EmptyState = ({ text, variant = "default" }: EmptyStateProps) => {
if (variant === "simple") {
return (
<div className="shadow-xs rounded-xl border border-slate-100 bg-white p-4 text-center">
<p className="text-sm text-slate-500">{text}</p>
</div>
);
}
return (
<div className="shadow-xs rounded-xl border border-slate-100 bg-white p-4">
<div className="w-full space-y-3">