@windrun-huaiin/third-ui 29.2.1 → 30.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/fuma/fuma-page-genarator.d.ts +2 -6
- package/dist/fuma/fuma-page-genarator.js +3 -2
- package/dist/fuma/fuma-page-genarator.mjs +3 -2
- package/dist/fuma/mdx/cheet-table.d.ts +13 -0
- package/dist/fuma/mdx/cheet-table.js +295 -0
- package/dist/fuma/mdx/cheet-table.mjs +293 -0
- package/dist/fuma/mdx/index.d.ts +1 -0
- package/dist/fuma/mdx/index.js +2 -0
- package/dist/fuma/mdx/index.mjs +1 -0
- package/dist/fuma/server/features/widgets.js +2 -0
- package/dist/fuma/server/features/widgets.mjs +2 -0
- package/dist/lib/fuma-schema-check-util.d.ts +1 -1
- package/dist/main/404-page.d.ts +12 -0
- package/dist/main/404-page.js +66 -0
- package/dist/main/404-page.mjs +64 -0
- package/dist/main/alert-dialog/confirm-dialog.js +1 -1
- package/dist/main/alert-dialog/confirm-dialog.mjs +2 -2
- package/dist/main/alert-dialog/dialog-loading-action.js +5 -2
- package/dist/main/alert-dialog/dialog-loading-action.mjs +5 -2
- package/dist/main/alert-dialog/dialog-styles.d.ts +4 -2
- package/dist/main/alert-dialog/dialog-styles.js +8 -4
- package/dist/main/alert-dialog/dialog-styles.mjs +7 -5
- package/dist/main/alert-dialog/high-priority-confirm-dialog.js +5 -5
- package/dist/main/alert-dialog/high-priority-confirm-dialog.mjs +6 -6
- package/dist/main/alert-dialog/info-dialog.js +1 -1
- package/dist/main/alert-dialog/info-dialog.mjs +2 -2
- package/dist/main/alert-dialog/undoable-confirm-dialog.js +2 -2
- package/dist/main/alert-dialog/undoable-confirm-dialog.mjs +3 -3
- package/dist/main/anime/anime-404-page.d.ts +14 -0
- package/dist/main/anime/anime-404-page.js +197 -0
- package/dist/main/anime/anime-404-page.mjs +195 -0
- package/dist/main/anime/anime-beam-frame.d.ts +3 -0
- package/dist/main/anime/anime-beam-frame.js +63 -0
- package/dist/main/anime/anime-beam-frame.mjs +61 -0
- package/dist/main/anime/anime-not-found-page.d.ts +7 -0
- package/dist/main/anime/anime-not-found-page.js +142 -0
- package/dist/main/anime/anime-not-found-page.mjs +140 -0
- package/dist/main/anime/anime-spiral-loading.d.ts +10 -0
- package/dist/main/anime/anime-spiral-loading.js +77 -0
- package/dist/main/anime/anime-spiral-loading.mjs +75 -0
- package/dist/main/anime/index.d.ts +3 -0
- package/dist/main/anime/index.js +12 -0
- package/dist/main/anime/index.mjs +4 -0
- package/dist/main/beam-frame/animate.d.ts +3 -0
- package/dist/main/beam-frame/animate.js +63 -0
- package/dist/main/beam-frame/animate.mjs +61 -0
- package/dist/main/beam-frame/beam-frame.d.ts +4 -0
- package/dist/main/beam-frame/beam-frame.js +262 -0
- package/dist/main/beam-frame/beam-frame.mjs +258 -0
- package/dist/main/beam-frame/index.d.ts +4 -0
- package/dist/main/beam-frame/index.js +11 -0
- package/dist/main/beam-frame/index.mjs +3 -0
- package/dist/main/beam-frame/motion.d.ts +3 -0
- package/dist/main/beam-frame/motion.js +61 -0
- package/dist/main/beam-frame/motion.mjs +59 -0
- package/dist/main/beam-frame/share-config.d.ts +54 -0
- package/dist/main/beam-frame/share-config.js +161 -0
- package/dist/main/beam-frame/share-config.mjs +152 -0
- package/dist/main/beam-frame-config.d.ts +54 -0
- package/dist/main/beam-frame-config.js +161 -0
- package/dist/main/beam-frame-config.mjs +152 -0
- package/dist/main/calendar/random-date-range-dialog.js +177 -51
- package/dist/main/calendar/random-date-range-dialog.mjs +178 -52
- package/dist/main/cta.js +17 -1
- package/dist/main/cta.mjs +18 -2
- package/dist/main/delayed-img.d.ts +1 -1
- package/dist/main/delayed-img.js +8 -5
- package/dist/main/delayed-img.mjs +8 -5
- package/dist/main/index.d.ts +1 -0
- package/dist/main/index.js +2 -0
- package/dist/main/index.mjs +1 -0
- package/dist/main/info-tooltip.js +70 -9
- package/dist/main/info-tooltip.mjs +70 -9
- package/dist/main/loading-frame/index.d.ts +1 -0
- package/dist/main/loading.d.ts +2 -1
- package/dist/main/loading.js +64 -26
- package/dist/main/loading.mjs +64 -26
- package/dist/main/motion/creative-left-panel.d.ts +7 -0
- package/dist/main/motion/creative-left-panel.js +11 -0
- package/dist/main/motion/creative-left-panel.mjs +9 -0
- package/dist/main/motion/creative-right-panel.d.ts +7 -0
- package/dist/main/motion/creative-right-panel.js +11 -0
- package/dist/main/motion/creative-right-panel.mjs +9 -0
- package/dist/main/motion/index.d.ts +1 -0
- package/dist/main/motion/index.js +9 -0
- package/dist/main/motion/index.mjs +2 -0
- package/dist/main/motion/motion-beam-frame.d.ts +3 -0
- package/dist/main/motion/motion-beam-frame.js +61 -0
- package/dist/main/motion/motion-beam-frame.mjs +59 -0
- package/dist/main/snake-loading-frame.d.ts +7 -3
- package/dist/main/snake-loading-frame.js +45 -252
- package/dist/main/snake-loading-frame.mjs +47 -254
- package/package.json +16 -5
- package/src/fuma/fuma-page-genarator.tsx +2 -22
- package/src/fuma/mdx/cheet-table.tsx +650 -0
- package/src/fuma/mdx/index.ts +1 -0
- package/src/fuma/server/features/widgets.tsx +2 -0
- package/src/main/404-page.tsx +162 -0
- package/src/main/alert-dialog/confirm-dialog.tsx +2 -1
- package/src/main/alert-dialog/dialog-loading-action.tsx +7 -5
- package/src/main/alert-dialog/dialog-styles.ts +13 -3
- package/src/main/alert-dialog/high-priority-confirm-dialog.tsx +26 -23
- package/src/main/alert-dialog/info-dialog.tsx +2 -1
- package/src/main/alert-dialog/undoable-confirm-dialog.tsx +18 -17
- package/src/main/anime/anime-404-page.tsx +344 -0
- package/src/main/anime/anime-beam-frame.tsx +128 -0
- package/src/main/anime/anime-spiral-loading.tsx +123 -0
- package/src/main/anime/index.ts +10 -0
- package/src/main/beam-frame-config.tsx +341 -0
- package/src/main/calendar/random-date-range-dialog.tsx +225 -69
- package/src/main/cta.tsx +50 -21
- package/src/main/delayed-img.tsx +9 -4
- package/src/main/index.ts +1 -0
- package/src/main/info-tooltip.tsx +116 -20
- package/src/main/loading-frame/index.ts +4 -0
- package/src/main/loading.tsx +75 -24
- package/src/main/motion/index.ts +8 -0
- package/src/main/motion/motion-beam-frame.tsx +137 -0
- package/src/main/snake-loading-frame.tsx +95 -496
- package/src/styles/cta.css +21 -4
- package/src/styles/third-ui.css +0 -20
|
@@ -0,0 +1,162 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
import { NotFoundIcon } from '@windrun-huaiin/base-ui/components/shared';
|
|
4
|
+
import {
|
|
5
|
+
THEME_BUTTON_GRADIENT_CLASS_MAP,
|
|
6
|
+
themeBgColor,
|
|
7
|
+
themeButtonGradientClass,
|
|
8
|
+
themeIconColor,
|
|
9
|
+
themeViaColor,
|
|
10
|
+
type SupportedThemeColor,
|
|
11
|
+
} from '@windrun-huaiin/base-ui/lib';
|
|
12
|
+
import { cn } from '@windrun-huaiin/lib/utils';
|
|
13
|
+
import { useEffect, useState, type ReactNode } from 'react';
|
|
14
|
+
|
|
15
|
+
interface NotFoundPageProps {
|
|
16
|
+
siteIcon: ReactNode;
|
|
17
|
+
errorIcon?: ReactNode;
|
|
18
|
+
className?: string;
|
|
19
|
+
compact?: boolean;
|
|
20
|
+
themeClass?: SupportedThemeColor;
|
|
21
|
+
animated?: boolean;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
const THEME_BG_CLASS_MAP: Record<SupportedThemeColor, string> = {
|
|
25
|
+
'text-purple-500': 'bg-purple-500/20',
|
|
26
|
+
'text-orange-500': 'bg-orange-500/20',
|
|
27
|
+
'text-indigo-500': 'bg-indigo-500/20',
|
|
28
|
+
'text-emerald-500': 'bg-emerald-500/20',
|
|
29
|
+
'text-rose-500': 'bg-rose-500/20',
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
const THEME_VIA_CLASS_MAP: Record<SupportedThemeColor, string> = {
|
|
33
|
+
'text-purple-500': 'via-purple-500/20',
|
|
34
|
+
'text-orange-500': 'via-orange-500/20',
|
|
35
|
+
'text-indigo-500': 'via-indigo-500/20',
|
|
36
|
+
'text-emerald-500': 'via-emerald-500/20',
|
|
37
|
+
'text-rose-500': 'via-rose-500/20',
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
export function NotFoundPage({
|
|
41
|
+
siteIcon,
|
|
42
|
+
errorIcon,
|
|
43
|
+
className,
|
|
44
|
+
compact = false,
|
|
45
|
+
themeClass,
|
|
46
|
+
animated = true,
|
|
47
|
+
}: NotFoundPageProps) {
|
|
48
|
+
const [glitchText, setGlitchText] = useState('404');
|
|
49
|
+
const homeUrl = process.env.NEXT_PUBLIC_BASE_URL || '/';
|
|
50
|
+
const activeThemeClass = themeClass ?? themeIconColor;
|
|
51
|
+
const activeGradientClass = themeClass ? THEME_BUTTON_GRADIENT_CLASS_MAP[themeClass] : themeButtonGradientClass;
|
|
52
|
+
const activeBgClass = themeClass ? THEME_BG_CLASS_MAP[themeClass] : themeBgColor;
|
|
53
|
+
const activeViaClass = themeClass ? THEME_VIA_CLASS_MAP[themeClass] : themeViaColor;
|
|
54
|
+
|
|
55
|
+
useEffect(() => {
|
|
56
|
+
if (!animated) {
|
|
57
|
+
setGlitchText('404');
|
|
58
|
+
return undefined;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
const glitchChars = ['4', '0', '4', '?', '#', '!', '*', '&', '%', '$'];
|
|
62
|
+
|
|
63
|
+
const interval = setInterval(() => {
|
|
64
|
+
if (Math.random() < 0.5) {
|
|
65
|
+
setGlitchText('404');
|
|
66
|
+
} else {
|
|
67
|
+
const randomChars = Array.from(
|
|
68
|
+
{ length: 3 },
|
|
69
|
+
() => glitchChars[Math.floor(Math.random() * glitchChars.length)]
|
|
70
|
+
).join('');
|
|
71
|
+
setGlitchText(randomChars);
|
|
72
|
+
}
|
|
73
|
+
}, 600);
|
|
74
|
+
|
|
75
|
+
return () => clearInterval(interval);
|
|
76
|
+
}, [animated]);
|
|
77
|
+
|
|
78
|
+
return (
|
|
79
|
+
<div className={cn('relative flex w-full flex-col items-center justify-center px-4 py-8', compact ? 'h-full min-h-full' : 'min-h-dvh', className)}>
|
|
80
|
+
<div className="text-center space-y-8 max-w-2xl">
|
|
81
|
+
<div className="relative flex justify-center">
|
|
82
|
+
<h1
|
|
83
|
+
className={cn(
|
|
84
|
+
'text-8xl md:text-9xl font-bold bg-linear-to-r bg-clip-text text-transparent select-none',
|
|
85
|
+
activeGradientClass
|
|
86
|
+
)}
|
|
87
|
+
style={{
|
|
88
|
+
fontFamily: 'Montserrat, monospace',
|
|
89
|
+
textShadow: '0 0 30px rgba(172, 98, 253, 0.3)',
|
|
90
|
+
letterSpacing: '0.1em',
|
|
91
|
+
}}
|
|
92
|
+
>
|
|
93
|
+
{glitchText}
|
|
94
|
+
</h1>
|
|
95
|
+
<div className="absolute inset-0 pointer-events-none">
|
|
96
|
+
<div className={cn('h-full w-full bg-linear-to-b from-transparent to-transparent', animated && 'animate-pulse', activeViaClass)} />
|
|
97
|
+
</div>
|
|
98
|
+
</div>
|
|
99
|
+
|
|
100
|
+
<div className="space-y-4">
|
|
101
|
+
<h2 className="text-2xl md:text-3xl font-semibold text-foreground">
|
|
102
|
+
Page Not Found
|
|
103
|
+
</h2>
|
|
104
|
+
<p className="text-lg text-muted-foreground max-w-md mx-auto leading-relaxed">
|
|
105
|
+
The page you're looking for doesn't exist
|
|
106
|
+
</p>
|
|
107
|
+
<a
|
|
108
|
+
href={homeUrl}
|
|
109
|
+
className={cn(
|
|
110
|
+
'inline-flex text-sm font-medium underline underline-offset-4 transition-opacity hover:opacity-80',
|
|
111
|
+
activeThemeClass,
|
|
112
|
+
'decoration-current'
|
|
113
|
+
)}
|
|
114
|
+
>
|
|
115
|
+
Back to Homepage
|
|
116
|
+
</a>
|
|
117
|
+
</div>
|
|
118
|
+
|
|
119
|
+
<div className="flex justify-center items-center gap-8 pt-8 opacity-60">
|
|
120
|
+
<a
|
|
121
|
+
href={homeUrl}
|
|
122
|
+
className="flex items-center gap-2 text-sm text-muted-foreground transition-opacity hover:opacity-80"
|
|
123
|
+
>
|
|
124
|
+
{siteIcon}
|
|
125
|
+
<span>Woops!</span>
|
|
126
|
+
</a>
|
|
127
|
+
<div className={cn('w-2 h-2 rounded-full', animated && 'animate-ping', activeBgClass)} />
|
|
128
|
+
<div className="flex items-center gap-2 text-sm text-muted-foreground">
|
|
129
|
+
{errorIcon ?? <NotFoundIcon />}
|
|
130
|
+
<span>Error Code: 404</span>
|
|
131
|
+
</div>
|
|
132
|
+
</div>
|
|
133
|
+
</div>
|
|
134
|
+
|
|
135
|
+
<div className={cn('pointer-events-none inset-0 overflow-hidden -z-10', compact ? 'absolute' : 'fixed')}>
|
|
136
|
+
<div
|
|
137
|
+
className="absolute inset-0 opacity-[0.02] dark:opacity-[0.05]"
|
|
138
|
+
style={{
|
|
139
|
+
backgroundImage: `
|
|
140
|
+
linear-gradient(rgba(172, 98, 253, 0.1) 1px, transparent 1px),
|
|
141
|
+
linear-gradient(90deg, rgba(172, 98, 253, 0.1) 1px, transparent 1px)
|
|
142
|
+
`,
|
|
143
|
+
backgroundSize: '50px 50px',
|
|
144
|
+
}}
|
|
145
|
+
/>
|
|
146
|
+
|
|
147
|
+
{Array.from({ length: 6 }).map((_, i) => (
|
|
148
|
+
<div
|
|
149
|
+
key={i}
|
|
150
|
+
className={cn('absolute w-2 h-2 rounded-full', animated && 'animate-bounce', activeBgClass)}
|
|
151
|
+
style={{
|
|
152
|
+
left: `${20 + i * 15}%`,
|
|
153
|
+
top: `${30 + (i % 3) * 20}%`,
|
|
154
|
+
animationDelay: `${i * 0.5}s`,
|
|
155
|
+
animationDuration: `${2 + i * 0.3}s`,
|
|
156
|
+
}}
|
|
157
|
+
/>
|
|
158
|
+
))}
|
|
159
|
+
</div>
|
|
160
|
+
</div>
|
|
161
|
+
);
|
|
162
|
+
}
|
|
@@ -21,6 +21,7 @@ import {
|
|
|
21
21
|
dialogHeaderClass,
|
|
22
22
|
dialogThemedOverlayClass,
|
|
23
23
|
dialogTitleClass,
|
|
24
|
+
dialogTitleTextClass,
|
|
24
25
|
primaryButtonClass,
|
|
25
26
|
secondaryButtonClass,
|
|
26
27
|
} from './dialog-styles';
|
|
@@ -108,7 +109,7 @@ export function ConfirmDialog({
|
|
|
108
109
|
<span className={cn('inline-flex size-9 shrink-0 items-center justify-center rounded-full ring-1', typeClass.iconWrap)}>
|
|
109
110
|
<Icon className={cn('size-5', typeClass.icon)} />
|
|
110
111
|
</span>
|
|
111
|
-
<span className=
|
|
112
|
+
<span className={dialogTitleTextClass}>{title}</span>
|
|
112
113
|
</div>
|
|
113
114
|
</AlertDialogTitle>
|
|
114
115
|
<button
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
import React from 'react';
|
|
4
4
|
import { createPortal } from 'react-dom';
|
|
5
5
|
import { Loading } from '../loading';
|
|
6
|
+
import { dialogLoadingContentClass } from './dialog-styles';
|
|
6
7
|
|
|
7
8
|
export type DialogLoadingAction = 'cancel' | 'confirm' | 'undo';
|
|
8
9
|
export type DialogActionHandler = () => void | Promise<void>;
|
|
@@ -29,18 +30,19 @@ export function useDialogLoadingAction({
|
|
|
29
30
|
action: DialogLoadingAction,
|
|
30
31
|
handler?: DialogActionHandler
|
|
31
32
|
) => {
|
|
32
|
-
onOpenChange(false);
|
|
33
|
-
|
|
34
33
|
if (!handler) {
|
|
34
|
+
onOpenChange(false);
|
|
35
35
|
return;
|
|
36
36
|
}
|
|
37
37
|
|
|
38
38
|
if (!loadingActions?.includes(action)) {
|
|
39
|
+
onOpenChange(false);
|
|
39
40
|
await handler();
|
|
40
41
|
return;
|
|
41
42
|
}
|
|
42
43
|
|
|
43
44
|
setLoading(true);
|
|
45
|
+
onOpenChange(false);
|
|
44
46
|
|
|
45
47
|
try {
|
|
46
48
|
await handler();
|
|
@@ -56,12 +58,12 @@ export function useDialogLoadingAction({
|
|
|
56
58
|
<Loading className="h-full w-full" />
|
|
57
59
|
</div>
|
|
58
60
|
) : (
|
|
59
|
-
<div className="
|
|
60
|
-
<div className=
|
|
61
|
+
<div className="fixed inset-0 z-10000">
|
|
62
|
+
<div className={dialogLoadingContentClass}>
|
|
61
63
|
<Loading
|
|
62
64
|
compact
|
|
63
65
|
label="Loading"
|
|
64
|
-
className="min-h-[
|
|
66
|
+
className="min-h-[220px] w-fit max-w-full rounded-none bg-transparent px-0 py-0 dark:bg-transparent"
|
|
65
67
|
labelClassName="text-foreground"
|
|
66
68
|
/>
|
|
67
69
|
</div>
|
|
@@ -12,7 +12,7 @@ import {
|
|
|
12
12
|
import { cn } from '@windrun-huaiin/lib/utils';
|
|
13
13
|
|
|
14
14
|
export const dialogSurfaceClass = cn(
|
|
15
|
-
'w-[calc(100vw-2rem)] max-w-md rounded-2xl border bg-white p-5 text-neutral-950 shadow-2xl outline-none dark:bg-neutral-950 dark:text-neutral-50',
|
|
15
|
+
'min-h-[240px] w-[calc(100vw-2rem)] max-w-md rounded-2xl border bg-white p-5 text-neutral-950 shadow-2xl outline-none dark:bg-neutral-950 dark:text-neutral-50',
|
|
16
16
|
'border-neutral-200 dark:border-neutral-800'
|
|
17
17
|
);
|
|
18
18
|
|
|
@@ -26,13 +26,22 @@ export const dialogContentClass = cn(
|
|
|
26
26
|
dialogSurfaceClass
|
|
27
27
|
);
|
|
28
28
|
|
|
29
|
+
export const dialogLoadingContentClass = cn(
|
|
30
|
+
'fixed left-1/2 top-1/2 z-10000 -translate-x-1/2 -translate-y-1/2',
|
|
31
|
+
dialogSurfaceClass,
|
|
32
|
+
'flex items-center justify-center overflow-hidden animate-in fade-in-0 zoom-in-95 duration-150'
|
|
33
|
+
);
|
|
34
|
+
|
|
29
35
|
export const dialogHeaderClass = 'flex items-start justify-between gap-4';
|
|
30
36
|
|
|
31
37
|
export const dialogTitleClass =
|
|
32
|
-
'flex min-w-0 items-center gap-2 text-lg font-bold leading-tight text-neutral-950 dark:text-neutral-50';
|
|
38
|
+
'flex min-w-0 flex-1 items-center gap-2 text-lg font-bold leading-tight text-neutral-950 dark:text-neutral-50';
|
|
39
|
+
|
|
40
|
+
export const dialogTitleTextClass =
|
|
41
|
+
'min-w-0 flex-1 line-clamp-2 break-words';
|
|
33
42
|
|
|
34
43
|
export const dialogDescriptionClass =
|
|
35
|
-
'mt-3 text-sm font-medium leading-relaxed text-neutral-600 dark:text-neutral-300';
|
|
44
|
+
'mt-3 break-words text-sm font-medium leading-relaxed text-neutral-600 dark:text-neutral-300';
|
|
36
45
|
|
|
37
46
|
export const dialogFooterClass = 'mt-6 flex flex-col-reverse gap-2 sm:flex-row sm:justify-end';
|
|
38
47
|
|
|
@@ -67,6 +76,7 @@ export const highPriorityTitleClass = cn(
|
|
|
67
76
|
|
|
68
77
|
export const highPrioritySurfaceClass = cn(
|
|
69
78
|
dialogSurfaceClass,
|
|
79
|
+
'flex flex-col',
|
|
70
80
|
'backdrop-blur-md ring-4 animate-in zoom-in-95 duration-300',
|
|
71
81
|
themeBorderColor,
|
|
72
82
|
themeRingColor
|
|
@@ -11,6 +11,7 @@ import {
|
|
|
11
11
|
dialogHeaderClass,
|
|
12
12
|
highPrioritySurfaceClass,
|
|
13
13
|
highPriorityTitleClass,
|
|
14
|
+
dialogTitleTextClass,
|
|
14
15
|
primaryButtonClass,
|
|
15
16
|
secondaryButtonClass,
|
|
16
17
|
} from "./dialog-styles";
|
|
@@ -71,7 +72,7 @@ export function HighPriorityConfirmDialog({
|
|
|
71
72
|
<span className={cn('inline-flex size-9 shrink-0 items-center justify-center rounded-full ring-1', themeBgColor, themeBorderColor)}>
|
|
72
73
|
<FAQSIcon className={cn('size-5', themeIconColor)} />
|
|
73
74
|
</span>
|
|
74
|
-
<span className=
|
|
75
|
+
<span className={dialogTitleTextClass}>{title}</span>
|
|
75
76
|
</h3>
|
|
76
77
|
<button
|
|
77
78
|
type="button"
|
|
@@ -82,28 +83,30 @@ export function HighPriorityConfirmDialog({
|
|
|
82
83
|
<XIcon className="size-4" />
|
|
83
84
|
</button>
|
|
84
85
|
</div>
|
|
85
|
-
<div className=
|
|
86
|
-
{
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
<
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
86
|
+
<div className="flex min-h-0 flex-1 flex-col">
|
|
87
|
+
<div className={dialogDescriptionClass}>
|
|
88
|
+
{description}
|
|
89
|
+
</div>
|
|
90
|
+
<div className={cn(dialogFooterClass, 'mt-auto')}>
|
|
91
|
+
<button
|
|
92
|
+
type="button"
|
|
93
|
+
onClick={() => {
|
|
94
|
+
void runDialogAction('cancel', onCancel);
|
|
95
|
+
}}
|
|
96
|
+
className={secondaryButtonClass}
|
|
97
|
+
>
|
|
98
|
+
{cancelText}
|
|
99
|
+
</button>
|
|
100
|
+
<button
|
|
101
|
+
type="button"
|
|
102
|
+
onClick={() => {
|
|
103
|
+
void runDialogAction('confirm', onConfirm);
|
|
104
|
+
}}
|
|
105
|
+
className={cn(primaryButtonClass, "hover:scale-105 active:scale-95")}
|
|
106
|
+
>
|
|
107
|
+
{confirmText}
|
|
108
|
+
</button>
|
|
109
|
+
</div>
|
|
107
110
|
</div>
|
|
108
111
|
</div>
|
|
109
112
|
</div>,
|
|
@@ -24,6 +24,7 @@ import {
|
|
|
24
24
|
dialogHeaderClass,
|
|
25
25
|
dialogThemedOverlayClass,
|
|
26
26
|
dialogTitleClass,
|
|
27
|
+
dialogTitleTextClass,
|
|
27
28
|
} from './dialog-styles';
|
|
28
29
|
import { DialogLoadingAction, DialogActionHandler, useDialogLoadingAction } from './dialog-loading-action';
|
|
29
30
|
|
|
@@ -109,7 +110,7 @@ export function InfoDialog({
|
|
|
109
110
|
<span className={cn('inline-flex size-9 shrink-0 items-center justify-center rounded-full ring-1', typeClass.iconWrap)}>
|
|
110
111
|
<Icon className={cn('size-5', typeClass.icon)} />
|
|
111
112
|
</span>
|
|
112
|
-
<span className=
|
|
113
|
+
<span className={dialogTitleTextClass}>{title}</span>
|
|
113
114
|
</div>
|
|
114
115
|
</AlertDialogTitle>
|
|
115
116
|
<button
|
|
@@ -19,6 +19,7 @@ import {
|
|
|
19
19
|
dialogHeaderClass,
|
|
20
20
|
dialogThemedOverlayClass,
|
|
21
21
|
dialogTitleClass,
|
|
22
|
+
dialogTitleTextClass,
|
|
22
23
|
secondaryButtonClass,
|
|
23
24
|
} from './dialog-styles';
|
|
24
25
|
import type { ConfirmDialogEmphasis } from './confirm-dialog';
|
|
@@ -163,7 +164,7 @@ export function UndoableConfirmDialog({
|
|
|
163
164
|
<span className="inline-flex size-9 shrink-0 items-center justify-center rounded-full bg-red-100 text-red-600 ring-1 ring-red-200 dark:bg-red-950 dark:text-red-300 dark:ring-red-900">
|
|
164
165
|
{pending ? <Trash2Icon className="size-5" /> : <CircleAlertIcon className="size-5" />}
|
|
165
166
|
</span>
|
|
166
|
-
<span className=
|
|
167
|
+
<span className={dialogTitleTextClass}>{displayTitle}</span>
|
|
167
168
|
</div>
|
|
168
169
|
</AlertDialogTitle>
|
|
169
170
|
<button
|
|
@@ -199,7 +200,7 @@ export function UndoableConfirmDialog({
|
|
|
199
200
|
onClick={() => {
|
|
200
201
|
void handleUndo();
|
|
201
202
|
}}
|
|
202
|
-
className={secondaryButtonClass}
|
|
203
|
+
className={cn(secondaryButtonClass, 'w-full sm:w-auto')}
|
|
203
204
|
disabled={confirming}
|
|
204
205
|
>
|
|
205
206
|
<Undo2Icon className="mr-1.5 size-4" />
|
|
@@ -207,21 +208,21 @@ export function UndoableConfirmDialog({
|
|
|
207
208
|
</button>
|
|
208
209
|
) : (
|
|
209
210
|
<>
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
211
|
+
<button
|
|
212
|
+
type="button"
|
|
213
|
+
onClick={handleCancel}
|
|
214
|
+
className={cn(cancelButtonClass, 'w-full sm:w-auto')}
|
|
215
|
+
>
|
|
216
|
+
{cancelText}
|
|
217
|
+
</button>
|
|
218
|
+
<button
|
|
219
|
+
type="button"
|
|
220
|
+
onClick={startCountdown}
|
|
221
|
+
className={cn(confirmButtonClass, 'w-full sm:w-auto')}
|
|
222
|
+
>
|
|
223
|
+
{confirmText}
|
|
224
|
+
</button>
|
|
225
|
+
</>
|
|
225
226
|
)}
|
|
226
227
|
</div>
|
|
227
228
|
</AlertDialogContent>
|