Integrated update experience (#259)

This commit is contained in:
Gregory Schier
2025-10-01 09:36:36 -07:00
committed by GitHub
parent 757d28c235
commit 9a94a15c82
35 changed files with 631 additions and 155 deletions

View File

@@ -0,0 +1,25 @@
import { useState } from 'react';
import type { ButtonProps } from './Button';
import { Button } from './Button';
export function ButtonInfiniteLoading({
onClick,
isLoading,
loadingChildren,
children,
...props
}: ButtonProps & { loadingChildren?: string }) {
const [localIsLoading, setLocalIsLoading] = useState<boolean>(false);
return (
<Button
isLoading={localIsLoading || isLoading}
onClick={(e) => {
setLocalIsLoading(true);
onClick?.(e);
}}
{...props}
>
{localIsLoading ? (loadingChildren ?? children) : children}
</Button>
);
}

View File

@@ -40,7 +40,7 @@ export function Checkbox({
className={classNames(
'appearance-none w-4 h-4 flex-shrink-0 border border-border',
'rounded outline-none ring-0',
!disabled && 'hocus:border-border-focus hocus:bg-focus/[5%] ',
!disabled && 'hocus:border-border-focus hocus:bg-focus/[5%]',
disabled && 'border-dotted',
)}
type="checkbox"
@@ -58,7 +58,7 @@ export function Checkbox({
</div>
</div>
{!hideLabel && (
<div className={classNames(fullWidth && 'w-full', disabled && 'opacity-disabled')}>
<div className={classNames('text-sm', fullWidth && 'w-full', disabled && 'opacity-disabled')}>
{title}
</div>
)}

View File

@@ -16,7 +16,7 @@ export interface ToastProps {
className?: string;
timeout: number | null;
action?: (args: { hide: () => void }) => ReactNode;
icon?: ShowToastRequest['icon'];
icon?: ShowToastRequest['icon'] | null;
color?: ShowToastRequest['color'];
}
@@ -42,7 +42,7 @@ export function Toast({ children, open, onClose, timeout, action, icon, color }:
[open],
);
const toastIcon = icon ?? (color && color in ICONS && ICONS[color]);
const toastIcon = icon === null ? null : icon ?? (color && color in ICONS && ICONS[color]);
return (
<m.div