@shellui/core 0.4.1 → 0.5.0-alpha.1
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/README.md +2 -2
- package/package.json +15 -3
- package/schemas/curated-themes.json +4035 -0
- package/schemas/shellui.config.schema.json +961 -0
- package/schemas/shellui.theme.schema.json +187 -0
- package/src/app.tsx +4 -1
- package/src/components/ContentView.tsx +144 -9
- package/src/components/LoadingOverlay.tsx +1 -1
- package/src/components/ui/alert-dialog.tsx +1 -1
- package/src/components/ui/dialog.tsx +23 -5
- package/src/components/ui/drawer.tsx +282 -42
- package/src/components/ui/dropdown-menu.tsx +7 -2
- package/src/components/ui/input.tsx +21 -0
- package/src/components/ui/separator.tsx +23 -0
- package/src/components/ui/sheet.tsx +220 -0
- package/src/components/ui/sidebar.tsx +785 -221
- package/src/components/ui/skeleton.tsx +13 -0
- package/src/constants/urls.ts +1 -0
- package/src/features/admin/utils.ts +2 -45
- package/src/features/alertDialog/DialogContext.tsx +1 -1
- package/src/features/auth/components/LoginButton.tsx +25 -18
- package/src/features/auth/components/LoginPreferencesControls.tsx +124 -0
- package/src/features/auth/components/LoginView.tsx +131 -49
- package/src/features/config/types.ts +64 -82
- package/src/features/drawer/DrawerContext.tsx +55 -19
- package/src/features/layouts/AppLayout.tsx +3 -3
- package/src/features/layouts/OverlayShell.tsx +376 -77
- package/src/features/layouts/appbar/AppBarLayout.tsx +501 -88
- package/src/features/layouts/branding/AppBrandIcon.tsx +95 -0
- package/src/features/layouts/branding/resolveThemeAsset.spec.ts +33 -0
- package/src/features/layouts/branding/resolveThemeAsset.ts +33 -0
- package/src/features/layouts/chrome/CollapsedDesktopTitlebar.tsx +49 -0
- package/src/features/layouts/chrome/ContentDragOverlay.tsx +19 -0
- package/src/features/layouts/chrome/DesktopBackButton.tsx +71 -0
- package/src/features/layouts/chrome/DesktopChrome.tsx +28 -0
- package/src/features/layouts/chrome/DesktopForwardButton.tsx +59 -0
- package/src/features/layouts/chrome/DesktopHistoryButtons.tsx +16 -0
- package/src/features/layouts/chrome/constants.ts +11 -0
- package/src/features/layouts/chrome/goDesktopBack.spec.ts +218 -0
- package/src/features/layouts/chrome/goDesktopBack.ts +106 -0
- package/src/features/layouts/chrome/index.ts +26 -0
- package/src/features/layouts/chrome/runtime.ts +45 -0
- package/src/features/layouts/findMatchingNavigationItem.spec.ts +55 -0
- package/src/features/layouts/fullscreen/FullscreenLayout.tsx +17 -1
- package/src/features/layouts/isFrameForAppUrl.spec.ts +33 -0
- package/src/features/layouts/sidebar/NavigationContent.tsx +70 -34
- package/src/features/layouts/sidebar/SidebarIcons.tsx +41 -42
- package/src/features/layouts/sidebar/SidebarInner.tsx +142 -24
- package/src/features/layouts/sidebar/SidebarLayout.tsx +100 -37
- package/src/features/layouts/sidebar/sidebarUtils.ts +0 -7
- package/src/features/layouts/sidebar/types.ts +3 -3
- package/src/features/layouts/utils.ts +73 -5
- package/src/features/layouts/windows/WindowsLayout.tsx +173 -61
- package/src/features/modal/ModalContext.tsx +21 -8
- package/src/features/overlays/OverlayDrawerPendingBar.tsx +26 -0
- package/src/features/overlays/OverlayDynamicDemoView.tsx +108 -0
- package/src/features/overlays/OverlayPendingSpinner.tsx +18 -0
- package/src/features/overlays/ResponsiveModal.tsx +483 -0
- package/src/features/overlays/overlaySize.spec.ts +71 -0
- package/src/features/overlays/overlaySize.ts +228 -0
- package/src/features/overlays/useOverlayReportedSize.ts +130 -0
- package/src/features/settings/SettingsProvider.tsx +66 -46
- package/src/features/settings/SettingsView.tsx +42 -47
- package/src/features/settings/components/Appearance.tsx +305 -55
- package/src/features/settings/components/develop/DrawerTestButtons.tsx +18 -0
- package/src/features/settings/components/develop/ModalTestButtons.tsx +23 -0
- package/src/features/settings/utils/getResolvedAppearanceForSettings.ts +11 -5
- package/src/features/theme/applyTheme.ts +143 -0
- package/src/features/theme/color.ts +83 -0
- package/src/features/theme/curated/amber-minimal.json +86 -0
- package/src/features/theme/curated/amethyst-haze.json +86 -0
- package/src/features/theme/curated/astro-vista.json +86 -0
- package/src/features/theme/curated/bold-tech.json +86 -0
- package/src/features/theme/curated/bubblegum.json +86 -0
- package/src/features/theme/curated/caffeine.json +83 -0
- package/src/features/theme/curated/candyland.json +86 -0
- package/src/features/theme/curated/catppuccin.json +86 -0
- package/src/features/theme/curated/claude.json +86 -0
- package/src/features/theme/curated/claymorphism.json +86 -0
- package/src/features/theme/curated/clean-slate.json +86 -0
- package/src/features/theme/curated/cosmic-night.json +86 -0
- package/src/features/theme/curated/cyberpunk.json +86 -0
- package/src/features/theme/curated/darkmatter.json +86 -0
- package/src/features/theme/curated/doom-64.json +86 -0
- package/src/features/theme/curated/elegant-luxury.json +86 -0
- package/src/features/theme/curated/graphite.json +86 -0
- package/src/features/theme/curated/index.ts +260 -0
- package/src/features/theme/curated/kodama-grove.json +86 -0
- package/src/features/theme/curated/light-green.json +87 -0
- package/src/features/theme/curated/midnight-bloom.json +86 -0
- package/src/features/theme/curated/mocha-mousse.json +86 -0
- package/src/features/theme/curated/modern-minimal.json +86 -0
- package/src/features/theme/curated/mono.json +84 -0
- package/src/features/theme/curated/nature.json +86 -0
- package/src/features/theme/curated/neo-brutalism.json +86 -0
- package/src/features/theme/curated/northern-lights.json +86 -0
- package/src/features/theme/curated/notebook.json +87 -0
- package/src/features/theme/curated/ocean-breeze.json +86 -0
- package/src/features/theme/curated/pastel-dreams.json +86 -0
- package/src/features/theme/curated/perpetuity.json +86 -0
- package/src/features/theme/curated/quantum-rose.json +86 -0
- package/src/features/theme/curated/retro-arcade.json +86 -0
- package/src/features/theme/curated/sage-garden.json +86 -0
- package/src/features/theme/curated/shadcn.json +83 -0
- package/src/features/theme/curated/shellui.json +82 -0
- package/src/features/theme/curated/soft-pop.json +86 -0
- package/src/features/theme/curated/solar-dusk.json +86 -0
- package/src/features/theme/curated/starry-night.json +86 -0
- package/src/features/theme/curated/sunset-horizon.json +86 -0
- package/src/features/theme/curated/supabase.json +85 -0
- package/src/features/theme/curated/t3-chat.json +83 -0
- package/src/features/theme/curated/tangerine.json +86 -0
- package/src/features/theme/curated/twitter.json +86 -0
- package/src/features/theme/curated/vercel.json +86 -0
- package/src/features/theme/curated/vintage-paper.json +86 -0
- package/src/features/theme/curated/violet-bloom.json +87 -0
- package/src/features/theme/curated/zen-inspired.json +87 -0
- package/src/features/theme/index.ts +76 -0
- package/src/features/theme/normalize.ts +159 -0
- package/src/features/theme/registry.ts +50 -0
- package/src/features/theme/resolveConfig.ts +182 -0
- package/src/features/theme/safeApplyTheme.ts +147 -0
- package/src/features/theme/themes.spec.ts +276 -0
- package/src/features/theme/themes.ts +82 -558
- package/src/features/theme/tokenKeys.ts +60 -0
- package/src/features/theme/types.ts +170 -0
- package/src/features/theme/useTheme.tsx +48 -50
- package/src/hooks/use-mobile.tsx +19 -0
- package/src/i18n/translations/en/common.json +41 -0
- package/src/i18n/translations/en/settings.json +10 -2
- package/src/i18n/translations/fr/common.json +41 -0
- package/src/i18n/translations/fr/settings.json +10 -2
- package/src/index.css +372 -128
- package/src/index.ts +71 -0
- package/src/lib/z-index.ts +4 -1
- package/src/routes/components/IndexRoute.tsx +12 -2
- package/src/routes/components/NavigationItemRoute.tsx +1 -10
- package/src/routes/hooks/useNavigationItems.ts +29 -44
- package/src/routes/routes.tsx +58 -27
- package/tailwind.config.js +27 -27
- package/src/features/layouts/sidebar/BottomNavItem.tsx +0 -88
- package/src/features/layouts/sidebar/MobileBottomNav.tsx +0 -168
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import { useCallback, useEffect, useMemo, useState, type FormEvent } from 'react';
|
|
2
|
+
import { useTranslation } from 'react-i18next';
|
|
2
3
|
import { useLocation, useNavigate } from 'react-router';
|
|
3
4
|
import { shellui } from '@shellui/sdk';
|
|
4
5
|
import { Button } from '../../../components/ui/button';
|
|
5
6
|
import urls from '../../../constants/urls';
|
|
6
7
|
import { cn } from '../../../lib/utils';
|
|
7
8
|
import { useConfig } from '../../config/useConfig';
|
|
9
|
+
import { getLegalDocuments } from '../../legal/legalDocuments';
|
|
8
10
|
import { LegalDocumentsLinks } from '../../legal/LegalDocumentsLinks';
|
|
9
11
|
import { useAuth } from '../hooks/useAuth';
|
|
10
12
|
import type { AuthSettings, LoginMethod } from '../types';
|
|
@@ -18,7 +20,9 @@ import {
|
|
|
18
20
|
isLoginMethod,
|
|
19
21
|
normalizeNextPath,
|
|
20
22
|
} from '../utils';
|
|
23
|
+
import { AppBrandIcon } from '../../layouts/branding/AppBrandIcon';
|
|
21
24
|
import { AccessPendingView } from './AccessPendingView';
|
|
25
|
+
import { LoginPreferencesControls } from './LoginPreferencesControls';
|
|
22
26
|
|
|
23
27
|
const LAST_USED_LOGIN_STORAGE_KEY = 'shellui.auth.last_used_login';
|
|
24
28
|
|
|
@@ -74,6 +78,7 @@ const ChevronDownIcon = ({ className }: { className?: string }) => (
|
|
|
74
78
|
);
|
|
75
79
|
|
|
76
80
|
export const LoginView = () => {
|
|
81
|
+
const { t } = useTranslation('common');
|
|
77
82
|
const navigate = useNavigate();
|
|
78
83
|
const location = useLocation();
|
|
79
84
|
const { config } = useConfig();
|
|
@@ -144,14 +149,16 @@ export const LoginView = () => {
|
|
|
144
149
|
const path = `${location.pathname}${qs ? `?${qs}` : ''}${location.hash}`;
|
|
145
150
|
navigate(path, { replace: true });
|
|
146
151
|
setOauthLoadingProvider(null);
|
|
147
|
-
const baseMsg = rawErr.trim() || '
|
|
152
|
+
const baseMsg = rawErr.trim() || t('loginPage.signInCouldNotContinue');
|
|
148
153
|
const hint =
|
|
149
154
|
code === 'redirect_not_allowed'
|
|
150
|
-
?
|
|
155
|
+
? t('loginPage.redirectNotAllowedHint', {
|
|
156
|
+
origin: typeof window !== 'undefined' ? `${window.location.origin}/login` : '/login',
|
|
157
|
+
})
|
|
151
158
|
: '';
|
|
152
159
|
setOauthBounceError(`${baseMsg}${hint}`);
|
|
153
160
|
setOauthBounceCode(code);
|
|
154
|
-
}, [location.hash, location.pathname, location.search, navigate]);
|
|
161
|
+
}, [location.hash, location.pathname, location.search, navigate, t]);
|
|
155
162
|
|
|
156
163
|
useEffect(() => {
|
|
157
164
|
if (authEvent === 'oauth_callback' && isAuthenticated) {
|
|
@@ -217,16 +224,16 @@ export const LoginView = () => {
|
|
|
217
224
|
}, [featuredMethod]);
|
|
218
225
|
const signInDescription = useMemo(() => {
|
|
219
226
|
if ((supportsOAuth || supportsWeb3) && supportsMagicLink) {
|
|
220
|
-
return '
|
|
227
|
+
return t('loginPage.descriptionOauthOrWeb3AndMagic');
|
|
221
228
|
}
|
|
222
229
|
if (supportsOAuth || supportsWeb3) {
|
|
223
|
-
return '
|
|
230
|
+
return t('loginPage.descriptionOauthOrWeb3');
|
|
224
231
|
}
|
|
225
232
|
if (supportsMagicLink) {
|
|
226
|
-
return '
|
|
233
|
+
return t('loginPage.descriptionMagic');
|
|
227
234
|
}
|
|
228
|
-
return '
|
|
229
|
-
}, [supportsMagicLink, supportsOAuth, supportsWeb3]);
|
|
235
|
+
return t('loginPage.descriptionNone');
|
|
236
|
+
}, [supportsMagicLink, supportsOAuth, supportsWeb3, t]);
|
|
230
237
|
|
|
231
238
|
const verifyMethodSupport = useCallback(
|
|
232
239
|
async (
|
|
@@ -240,8 +247,8 @@ export const LoginView = () => {
|
|
|
240
247
|
// Some Supabase settings payloads do not explicitly advertise web3 methods.
|
|
241
248
|
return { isSupported: true };
|
|
242
249
|
}
|
|
243
|
-
const humanMethod = method === 'magic_link' ? '
|
|
244
|
-
setMethodError(
|
|
250
|
+
const humanMethod = method === 'magic_link' ? t('loginPage.magicLinkMethod') : method;
|
|
251
|
+
setMethodError(t('loginPage.methodUnsupported', { method: humanMethod }));
|
|
245
252
|
return { isSupported: false };
|
|
246
253
|
}
|
|
247
254
|
if (method === 'oauth' && provider && backendSettings.oauthProviders.length > 0) {
|
|
@@ -252,7 +259,9 @@ export const LoginView = () => {
|
|
|
252
259
|
);
|
|
253
260
|
if (!matchedProvider) {
|
|
254
261
|
setMethodError(
|
|
255
|
-
|
|
262
|
+
t('loginPage.oauthUnsupported', {
|
|
263
|
+
provider: formatProviderLabel(provider),
|
|
264
|
+
}),
|
|
256
265
|
);
|
|
257
266
|
return { isSupported: false };
|
|
258
267
|
}
|
|
@@ -279,12 +288,12 @@ export const LoginView = () => {
|
|
|
279
288
|
return { isSupported: true };
|
|
280
289
|
} catch (err) {
|
|
281
290
|
setMethodError(
|
|
282
|
-
err instanceof Error ? err.message : '
|
|
291
|
+
err instanceof Error ? err.message : t('loginPage.couldNotVerifyCapabilities'),
|
|
283
292
|
);
|
|
284
293
|
return { isSupported: false };
|
|
285
294
|
}
|
|
286
295
|
},
|
|
287
|
-
[getAuthSettings, supportsWeb3],
|
|
296
|
+
[getAuthSettings, supportsWeb3, t],
|
|
288
297
|
);
|
|
289
298
|
|
|
290
299
|
const handleOAuthLogin = async (provider: string) => {
|
|
@@ -347,7 +356,7 @@ export const LoginView = () => {
|
|
|
347
356
|
}
|
|
348
357
|
const started = await startWeb3Ethereum();
|
|
349
358
|
if (!started) {
|
|
350
|
-
setMethodError('
|
|
359
|
+
setMethodError(t('loginPage.walletLoginFailed'));
|
|
351
360
|
}
|
|
352
361
|
setWeb3Loading(false);
|
|
353
362
|
};
|
|
@@ -356,7 +365,7 @@ export const LoginView = () => {
|
|
|
356
365
|
event.preventDefault();
|
|
357
366
|
const email = magicLinkEmail.trim();
|
|
358
367
|
if (!email) {
|
|
359
|
-
setMagicLinkError('
|
|
368
|
+
setMagicLinkError(t('loginPage.enterEmail'));
|
|
360
369
|
setMagicLinkMessage(null);
|
|
361
370
|
setMethodError(null);
|
|
362
371
|
return;
|
|
@@ -377,14 +386,18 @@ export const LoginView = () => {
|
|
|
377
386
|
localStorage.setItem(LAST_USED_LOGIN_STORAGE_KEY, JSON.stringify(rememberedLogin));
|
|
378
387
|
}
|
|
379
388
|
await sendMagicLink(email, loginPathWithNext);
|
|
380
|
-
setMagicLinkMessage('
|
|
389
|
+
setMagicLinkMessage(t('loginPage.magicLinkSent'));
|
|
381
390
|
} catch (err) {
|
|
382
|
-
setMagicLinkError(err instanceof Error ? err.message : '
|
|
391
|
+
setMagicLinkError(err instanceof Error ? err.message : t('loginPage.couldNotSendMagicLink'));
|
|
383
392
|
} finally {
|
|
384
393
|
setMagicLinkLoading(false);
|
|
385
394
|
}
|
|
386
395
|
};
|
|
387
396
|
|
|
397
|
+
const panelUrl = config.backend?.login?.panelUrl?.trim() || null;
|
|
398
|
+
const panelImage = config.backend?.login?.panelImage?.trim() || null;
|
|
399
|
+
const legalDocuments = useMemo(() => getLegalDocuments(config), [config]);
|
|
400
|
+
|
|
388
401
|
if (isAuthenticated) {
|
|
389
402
|
return null;
|
|
390
403
|
}
|
|
@@ -406,15 +419,58 @@ export const LoginView = () => {
|
|
|
406
419
|
<main className="flex min-h-full w-full bg-background">
|
|
407
420
|
{!isIframeView && (
|
|
408
421
|
<section
|
|
409
|
-
className="hidden w-1/2 bg-muted/40 md:block"
|
|
410
|
-
aria-hidden
|
|
411
|
-
|
|
422
|
+
className="relative hidden min-h-full w-1/2 overflow-hidden bg-muted/40 md:block"
|
|
423
|
+
aria-hidden={panelImage && !panelUrl ? true : undefined}
|
|
424
|
+
>
|
|
425
|
+
{panelUrl ? (
|
|
426
|
+
<iframe
|
|
427
|
+
src={panelUrl}
|
|
428
|
+
title={t('loginPage.brandingIframeTitle')}
|
|
429
|
+
className="h-full min-h-svh w-full border-0"
|
|
430
|
+
/>
|
|
431
|
+
) : panelImage ? (
|
|
432
|
+
<div className="flex h-full min-h-svh w-full items-center justify-center overflow-hidden">
|
|
433
|
+
<img
|
|
434
|
+
src={panelImage}
|
|
435
|
+
alt=""
|
|
436
|
+
className="max-h-full max-w-full object-contain"
|
|
437
|
+
/>
|
|
438
|
+
</div>
|
|
439
|
+
) : (
|
|
440
|
+
<div className="flex h-full min-h-svh w-full items-start justify-start p-6">
|
|
441
|
+
<AppBrandIcon
|
|
442
|
+
appIcon={config.appIcon}
|
|
443
|
+
title={config.title}
|
|
444
|
+
imgClassName="size-8"
|
|
445
|
+
/>
|
|
446
|
+
</div>
|
|
447
|
+
)}
|
|
448
|
+
</section>
|
|
412
449
|
)}
|
|
413
450
|
|
|
414
451
|
<section
|
|
415
|
-
className={cn(
|
|
452
|
+
className={cn(
|
|
453
|
+
'relative flex min-h-svh w-full flex-col px-6 py-6 md:py-10',
|
|
454
|
+
!isIframeView && 'md:w-1/2',
|
|
455
|
+
)}
|
|
416
456
|
>
|
|
417
|
-
|
|
457
|
+
{!isIframeView ? (
|
|
458
|
+
<div className="flex shrink-0 items-center gap-4 pb-6 md:pb-2">
|
|
459
|
+
{config.appIcon ? (
|
|
460
|
+
<div className="md:hidden">
|
|
461
|
+
<AppBrandIcon
|
|
462
|
+
appIcon={config.appIcon}
|
|
463
|
+
title={config.title}
|
|
464
|
+
imgClassName="size-8"
|
|
465
|
+
/>
|
|
466
|
+
</div>
|
|
467
|
+
) : null}
|
|
468
|
+
<div className="ml-auto">
|
|
469
|
+
<LoginPreferencesControls />
|
|
470
|
+
</div>
|
|
471
|
+
</div>
|
|
472
|
+
) : null}
|
|
473
|
+
<div className="flex w-full min-h-0 flex-1 items-center justify-center">
|
|
418
474
|
<div
|
|
419
475
|
className={cn(
|
|
420
476
|
'w-full max-w-xl space-y-6 animate-in fade-in-0 slide-in-from-bottom-4 duration-500',
|
|
@@ -423,7 +479,7 @@ export const LoginView = () => {
|
|
|
423
479
|
>
|
|
424
480
|
<div className="space-y-2">
|
|
425
481
|
<h1 className="text-3xl font-semibold tracking-tight text-foreground">
|
|
426
|
-
|
|
482
|
+
{t('loginPage.welcomeBack')}
|
|
427
483
|
</h1>
|
|
428
484
|
<p className="text-sm text-muted-foreground">{signInDescription}</p>
|
|
429
485
|
</div>
|
|
@@ -438,7 +494,7 @@ export const LoginView = () => {
|
|
|
438
494
|
{featuredMethod === 'oauth' && featuredOAuthProvider && (
|
|
439
495
|
<section className="space-y-2 rounded-2xl bg-muted/30 p-4">
|
|
440
496
|
<p className="text-xs font-medium uppercase tracking-wide text-muted-foreground">
|
|
441
|
-
|
|
497
|
+
{t('loginPage.lastUsed')}
|
|
442
498
|
</p>
|
|
443
499
|
{(() => {
|
|
444
500
|
const visual = getProviderVisual(featuredOAuthProvider);
|
|
@@ -459,8 +515,8 @@ export const LoginView = () => {
|
|
|
459
515
|
</span>
|
|
460
516
|
<span className="truncate">
|
|
461
517
|
{oauthLoadingProvider === featuredOAuthProvider
|
|
462
|
-
?
|
|
463
|
-
:
|
|
518
|
+
? t('loginPage.redirectingTo', { provider: label })
|
|
519
|
+
: t('loginPage.continueWith', { provider: label })}
|
|
464
520
|
</span>
|
|
465
521
|
</Button>
|
|
466
522
|
);
|
|
@@ -471,7 +527,7 @@ export const LoginView = () => {
|
|
|
471
527
|
{featuredMethod === 'magic_link' && supportsMagicLink && (
|
|
472
528
|
<section className="space-y-2 rounded-2xl bg-muted/30 p-4">
|
|
473
529
|
<p className="text-xs font-medium uppercase tracking-wide text-muted-foreground">
|
|
474
|
-
|
|
530
|
+
{t('loginPage.lastUsed')}
|
|
475
531
|
</p>
|
|
476
532
|
<form
|
|
477
533
|
className="space-y-2"
|
|
@@ -482,7 +538,7 @@ export const LoginView = () => {
|
|
|
482
538
|
type="email"
|
|
483
539
|
value={magicLinkEmail}
|
|
484
540
|
onChange={(event) => setMagicLinkEmail(event.target.value)}
|
|
485
|
-
placeholder=
|
|
541
|
+
placeholder={t('loginPage.emailPlaceholder')}
|
|
486
542
|
autoComplete="email"
|
|
487
543
|
required
|
|
488
544
|
className="h-10 w-full rounded-md border border-input bg-background px-3 text-sm text-foreground outline-none ring-offset-background focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2"
|
|
@@ -493,7 +549,9 @@ export const LoginView = () => {
|
|
|
493
549
|
className="w-full"
|
|
494
550
|
disabled={isActionPending}
|
|
495
551
|
>
|
|
496
|
-
{magicLinkLoading
|
|
552
|
+
{magicLinkLoading
|
|
553
|
+
? t('loginPage.sendingMagicLink')
|
|
554
|
+
: t('loginPage.sendMagicLink')}
|
|
497
555
|
</Button>
|
|
498
556
|
{magicLinkMessage && (
|
|
499
557
|
<p className="text-sm text-muted-foreground">{magicLinkMessage}</p>
|
|
@@ -506,7 +564,7 @@ export const LoginView = () => {
|
|
|
506
564
|
{featuredMethod === 'web3' && supportsWeb3 && (
|
|
507
565
|
<section className="space-y-2 rounded-2xl bg-muted/30 p-4">
|
|
508
566
|
<p className="text-xs font-medium uppercase tracking-wide text-muted-foreground">
|
|
509
|
-
|
|
567
|
+
{t('loginPage.lastUsed')}
|
|
510
568
|
</p>
|
|
511
569
|
{(() => {
|
|
512
570
|
const visual = getProviderVisual('ethereum');
|
|
@@ -525,7 +583,9 @@ export const LoginView = () => {
|
|
|
525
583
|
<visual.Icon className={cn('h-3 w-3', visual.iconClassName)} />
|
|
526
584
|
</span>
|
|
527
585
|
<span className="truncate">
|
|
528
|
-
{web3Loading
|
|
586
|
+
{web3Loading
|
|
587
|
+
? t('loginPage.connectingWallet')
|
|
588
|
+
: t('loginPage.continueWithEthereum')}
|
|
529
589
|
</span>
|
|
530
590
|
</Button>
|
|
531
591
|
);
|
|
@@ -549,7 +609,9 @@ export const LoginView = () => {
|
|
|
549
609
|
showAlternativeMethods ? 'rotate-180' : 'rotate-0',
|
|
550
610
|
)}
|
|
551
611
|
/>
|
|
552
|
-
{showAlternativeMethods
|
|
612
|
+
{showAlternativeMethods
|
|
613
|
+
? t('loginPage.hideOtherMethods')
|
|
614
|
+
: t('loginPage.useAnotherMethod')}
|
|
553
615
|
</Button>
|
|
554
616
|
</div>
|
|
555
617
|
)}
|
|
@@ -578,7 +640,7 @@ export const LoginView = () => {
|
|
|
578
640
|
<div className="relative py-1">
|
|
579
641
|
<div className="border-t border-border" />
|
|
580
642
|
<span className="absolute left-1/2 top-1/2 -translate-x-1/2 -translate-y-1/2 bg-background px-2 text-xs text-muted-foreground">
|
|
581
|
-
or
|
|
643
|
+
{t('loginPage.or')}
|
|
582
644
|
</span>
|
|
583
645
|
</div>
|
|
584
646
|
)}
|
|
@@ -587,7 +649,7 @@ export const LoginView = () => {
|
|
|
587
649
|
<div className="relative py-1">
|
|
588
650
|
<div className="border-t border-border" />
|
|
589
651
|
<span className="absolute left-1/2 top-1/2 -translate-x-1/2 -translate-y-1/2 bg-background px-2 text-xs text-muted-foreground">
|
|
590
|
-
or
|
|
652
|
+
{t('loginPage.or')}
|
|
591
653
|
</span>
|
|
592
654
|
</div>
|
|
593
655
|
)}
|
|
@@ -596,7 +658,7 @@ export const LoginView = () => {
|
|
|
596
658
|
<div className="relative py-1">
|
|
597
659
|
<div className="border-t border-border" />
|
|
598
660
|
<span className="absolute left-1/2 top-1/2 -translate-x-1/2 -translate-y-1/2 bg-background px-2 text-xs text-muted-foreground">
|
|
599
|
-
or
|
|
661
|
+
{t('loginPage.or')}
|
|
600
662
|
</span>
|
|
601
663
|
</div>
|
|
602
664
|
)}
|
|
@@ -604,7 +666,7 @@ export const LoginView = () => {
|
|
|
604
666
|
{supportsWeb3 && featuredMethod !== 'web3' && (
|
|
605
667
|
<section className="space-y-2">
|
|
606
668
|
<p className="text-xs font-medium uppercase tracking-wide text-muted-foreground">
|
|
607
|
-
|
|
669
|
+
{t('loginPage.walletLogin')}
|
|
608
670
|
</p>
|
|
609
671
|
{(() => {
|
|
610
672
|
const visual = getProviderVisual('ethereum');
|
|
@@ -624,8 +686,8 @@ export const LoginView = () => {
|
|
|
624
686
|
</span>
|
|
625
687
|
<span className="truncate">
|
|
626
688
|
{web3Loading
|
|
627
|
-
? '
|
|
628
|
-
: '
|
|
689
|
+
? t('loginPage.connectingWallet')
|
|
690
|
+
: t('loginPage.continueWithEthereum')}
|
|
629
691
|
</span>
|
|
630
692
|
</Button>
|
|
631
693
|
);
|
|
@@ -636,7 +698,9 @@ export const LoginView = () => {
|
|
|
636
698
|
{supportsOAuth && otherOAuthProviders.length > 0 && (
|
|
637
699
|
<section className="space-y-2">
|
|
638
700
|
<p className="text-xs font-medium uppercase tracking-wide text-muted-foreground">
|
|
639
|
-
{featuredMethod === 'oauth'
|
|
701
|
+
{featuredMethod === 'oauth'
|
|
702
|
+
? t('loginPage.otherSocialLogins')
|
|
703
|
+
: t('loginPage.socialLogin')}
|
|
640
704
|
</p>
|
|
641
705
|
<div className="grid gap-2 sm:grid-cols-2">
|
|
642
706
|
{otherOAuthProviders.map((provider) => {
|
|
@@ -659,8 +723,8 @@ export const LoginView = () => {
|
|
|
659
723
|
</span>
|
|
660
724
|
<span className="truncate">
|
|
661
725
|
{oauthLoadingProvider === provider
|
|
662
|
-
?
|
|
663
|
-
:
|
|
726
|
+
? t('loginPage.redirectingTo', { provider: label })
|
|
727
|
+
: t('loginPage.continueWith', { provider: label })}
|
|
664
728
|
</span>
|
|
665
729
|
</Button>
|
|
666
730
|
);
|
|
@@ -675,7 +739,7 @@ export const LoginView = () => {
|
|
|
675
739
|
<div className="relative py-1">
|
|
676
740
|
<div className="border-t border-border" />
|
|
677
741
|
<span className="absolute left-1/2 top-1/2 -translate-x-1/2 -translate-y-1/2 bg-background px-2 text-xs text-muted-foreground">
|
|
678
|
-
or
|
|
742
|
+
{t('loginPage.or')}
|
|
679
743
|
</span>
|
|
680
744
|
</div>
|
|
681
745
|
)}
|
|
@@ -683,7 +747,7 @@ export const LoginView = () => {
|
|
|
683
747
|
{supportsMagicLink && featuredMethod !== 'magic_link' && (
|
|
684
748
|
<section className="space-y-2">
|
|
685
749
|
<p className="text-xs font-medium uppercase tracking-wide text-muted-foreground">
|
|
686
|
-
|
|
750
|
+
{t('loginPage.emailMagicLink')}
|
|
687
751
|
</p>
|
|
688
752
|
<form
|
|
689
753
|
className="space-y-2"
|
|
@@ -694,7 +758,7 @@ export const LoginView = () => {
|
|
|
694
758
|
type="email"
|
|
695
759
|
value={magicLinkEmail}
|
|
696
760
|
onChange={(event) => setMagicLinkEmail(event.target.value)}
|
|
697
|
-
placeholder=
|
|
761
|
+
placeholder={t('loginPage.emailPlaceholder')}
|
|
698
762
|
autoComplete="email"
|
|
699
763
|
required
|
|
700
764
|
className="h-10 w-full rounded-md border border-input bg-background px-3 text-sm text-foreground outline-none ring-offset-background focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2"
|
|
@@ -705,7 +769,9 @@ export const LoginView = () => {
|
|
|
705
769
|
className="w-full"
|
|
706
770
|
disabled={isActionPending}
|
|
707
771
|
>
|
|
708
|
-
{magicLinkLoading
|
|
772
|
+
{magicLinkLoading
|
|
773
|
+
? t('loginPage.sendingMagicLink')
|
|
774
|
+
: t('loginPage.sendMagicLink')}
|
|
709
775
|
</Button>
|
|
710
776
|
{magicLinkMessage && (
|
|
711
777
|
<p className="text-sm text-muted-foreground">{magicLinkMessage}</p>
|
|
@@ -721,14 +787,30 @@ export const LoginView = () => {
|
|
|
721
787
|
</div>
|
|
722
788
|
|
|
723
789
|
{!supportsOAuth && !supportsMagicLink && !supportsWeb3 && (
|
|
724
|
-
<p className="text-sm text-muted-foreground">
|
|
725
|
-
No login method is currently enabled in backend auth settings.
|
|
726
|
-
</p>
|
|
790
|
+
<p className="text-sm text-muted-foreground">{t('loginPage.noMethodsEnabled')}</p>
|
|
727
791
|
)}
|
|
792
|
+
|
|
793
|
+
<div className="flex justify-end">
|
|
794
|
+
<Button
|
|
795
|
+
type="button"
|
|
796
|
+
variant="link"
|
|
797
|
+
size="sm"
|
|
798
|
+
className="h-auto px-0 text-xs font-normal text-muted-foreground/80 hover:text-muted-foreground"
|
|
799
|
+
onClick={() => {
|
|
800
|
+
if (isIframeView) {
|
|
801
|
+
shellui.closeModal();
|
|
802
|
+
return;
|
|
803
|
+
}
|
|
804
|
+
navigate('/');
|
|
805
|
+
}}
|
|
806
|
+
>
|
|
807
|
+
{t('loginPage.cancel')}
|
|
808
|
+
</Button>
|
|
809
|
+
</div>
|
|
728
810
|
</div>
|
|
729
811
|
</div>
|
|
730
812
|
</div>
|
|
731
|
-
{!isIframeView && (
|
|
813
|
+
{!isIframeView && legalDocuments.length > 0 && (
|
|
732
814
|
<div className="w-full max-w-xl border-t border-border pt-4">
|
|
733
815
|
<LegalDocumentsLinks />
|
|
734
816
|
</div>
|
|
@@ -10,7 +10,7 @@ export type LocalizedString =
|
|
|
10
10
|
/** Drawer position when opening a link in a drawer (optional, used when openIn === 'drawer'). */
|
|
11
11
|
export type DrawerPosition = 'top' | 'bottom' | 'left' | 'right';
|
|
12
12
|
|
|
13
|
-
/** Layout mode: 'sidebar' (default) shows navigation sidebar; 'fullscreen' shows only content area; 'windows' shows a taskbar with start menu and multi-window desktop; 'app-bar' shows a compact top bar with
|
|
13
|
+
/** Layout mode: 'sidebar' (default) shows navigation sidebar; 'fullscreen' shows only content area; 'windows' shows a taskbar with start menu and multi-window desktop; 'app-bar' shows a compact top bar with a 9-square launcher for start links and icon-only end links. */
|
|
14
14
|
export type LayoutType = 'sidebar' | 'fullscreen' | 'windows' | 'app-bar';
|
|
15
15
|
|
|
16
16
|
export interface NavigationItem {
|
|
@@ -28,7 +28,7 @@ export interface NavigationItem {
|
|
|
28
28
|
requiresDevMode?: boolean;
|
|
29
29
|
/** When true, this item is available only to staff users (`isStaff`). */
|
|
30
30
|
requiresStaff?: boolean;
|
|
31
|
-
/** When true, hide this item on mobile (
|
|
31
|
+
/** When true, hide this item on mobile (sidebar sheet). Has no effect if hidden is true. */
|
|
32
32
|
hiddenOnMobile?: boolean;
|
|
33
33
|
/** When true, hide this item on desktop (sidebar). Has no effect if hidden is true. */
|
|
34
34
|
hiddenOnDesktop?: boolean;
|
|
@@ -57,81 +57,17 @@ export interface NavigationGroup {
|
|
|
57
57
|
position?: 'start' | 'end';
|
|
58
58
|
}
|
|
59
59
|
|
|
60
|
-
export
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
primaryForeground: string;
|
|
70
|
-
secondary: string;
|
|
71
|
-
secondaryForeground: string;
|
|
72
|
-
muted: string;
|
|
73
|
-
mutedForeground: string;
|
|
74
|
-
accent: string;
|
|
75
|
-
accentForeground: string;
|
|
76
|
-
destructive: string;
|
|
77
|
-
destructiveForeground: string;
|
|
78
|
-
border: string;
|
|
79
|
-
input: string;
|
|
80
|
-
ring: string;
|
|
81
|
-
radius: string;
|
|
82
|
-
sidebarBackground: string;
|
|
83
|
-
sidebarForeground: string;
|
|
84
|
-
sidebarPrimary: string;
|
|
85
|
-
sidebarPrimaryForeground: string;
|
|
86
|
-
sidebarAccent: string;
|
|
87
|
-
sidebarAccentForeground: string;
|
|
88
|
-
sidebarBorder: string;
|
|
89
|
-
sidebarRing: string;
|
|
90
|
-
};
|
|
91
|
-
dark: {
|
|
92
|
-
background: string;
|
|
93
|
-
foreground: string;
|
|
94
|
-
card: string;
|
|
95
|
-
cardForeground: string;
|
|
96
|
-
popover: string;
|
|
97
|
-
popoverForeground: string;
|
|
98
|
-
primary: string;
|
|
99
|
-
primaryForeground: string;
|
|
100
|
-
secondary: string;
|
|
101
|
-
secondaryForeground: string;
|
|
102
|
-
muted: string;
|
|
103
|
-
mutedForeground: string;
|
|
104
|
-
accent: string;
|
|
105
|
-
accentForeground: string;
|
|
106
|
-
destructive: string;
|
|
107
|
-
destructiveForeground: string;
|
|
108
|
-
border: string;
|
|
109
|
-
input: string;
|
|
110
|
-
ring: string;
|
|
111
|
-
radius: string;
|
|
112
|
-
sidebarBackground: string;
|
|
113
|
-
sidebarForeground: string;
|
|
114
|
-
sidebarPrimary: string;
|
|
115
|
-
sidebarPrimaryForeground: string;
|
|
116
|
-
sidebarAccent: string;
|
|
117
|
-
sidebarAccentForeground: string;
|
|
118
|
-
sidebarBorder: string;
|
|
119
|
-
sidebarRing: string;
|
|
120
|
-
};
|
|
121
|
-
}
|
|
60
|
+
export type {
|
|
61
|
+
ThemeColors,
|
|
62
|
+
ThemeColorsMode,
|
|
63
|
+
ThemeDefinition,
|
|
64
|
+
ThemeFonts,
|
|
65
|
+
ThemeInput,
|
|
66
|
+
ThemeRef,
|
|
67
|
+
ThemesConfig,
|
|
68
|
+
} from '../theme/types';
|
|
122
69
|
|
|
123
|
-
|
|
124
|
-
name: string;
|
|
125
|
-
displayName: string;
|
|
126
|
-
colors: ThemeColors;
|
|
127
|
-
fontFamily?: string; // Optional custom font family (backward compatible)
|
|
128
|
-
headingFontFamily?: string; // Optional font family for headings (h1-h6)
|
|
129
|
-
bodyFontFamily?: string; // Optional font family for body text
|
|
130
|
-
fontFiles?: string[]; // Optional array of font file URLs or paths to load (e.g., Google Fonts links or local paths)
|
|
131
|
-
letterSpacing?: string; // Optional custom letter spacing (e.g., "0.02em")
|
|
132
|
-
textShadow?: string; // Optional custom text shadow (e.g., "1px 1px 2px rgba(0, 0, 0, 0.1)")
|
|
133
|
-
lineHeight?: string; // Optional custom line height (e.g., "1.6")
|
|
134
|
-
}
|
|
70
|
+
import type { ThemeDefinition, ThemeRef, ThemesConfig } from '../theme/types';
|
|
135
71
|
|
|
136
72
|
/** Sentry error reporting configuration. Only used in production; ignored in dev. */
|
|
137
73
|
export interface SentryConfig {
|
|
@@ -203,6 +139,10 @@ export interface BackendLoginConfig {
|
|
|
203
139
|
methods?: BackendLoginMethod[];
|
|
204
140
|
/** OAuth providers used when oauth is enabled (e.g. ["github"]). */
|
|
205
141
|
oauthProviders?: string[];
|
|
142
|
+
/** Full-bleed iframe URL for the login left panel (wins over panelImage). */
|
|
143
|
+
panelUrl?: string;
|
|
144
|
+
/** Centered, ratio-preserving image for the login left panel. */
|
|
145
|
+
panelImage?: string;
|
|
206
146
|
}
|
|
207
147
|
|
|
208
148
|
/** Backend API configuration. */
|
|
@@ -256,6 +196,17 @@ export interface AdministrationConfig {
|
|
|
256
196
|
navigation: NavigationItem[];
|
|
257
197
|
}
|
|
258
198
|
|
|
199
|
+
/**
|
|
200
|
+
* Brand asset path, or separate light/dark files when CSS theming is not enough
|
|
201
|
+
* (typical for full-color PNGs). A single SVG/PNG is recolored for light/dark via CSS.
|
|
202
|
+
*/
|
|
203
|
+
export type ThemeAsset =
|
|
204
|
+
| string
|
|
205
|
+
| {
|
|
206
|
+
light: string;
|
|
207
|
+
dark: string;
|
|
208
|
+
};
|
|
209
|
+
|
|
259
210
|
export interface ShellUIConfig {
|
|
260
211
|
port?: number;
|
|
261
212
|
title?: string;
|
|
@@ -263,10 +214,17 @@ export interface ShellUIConfig {
|
|
|
263
214
|
version?: string;
|
|
264
215
|
/** Favicon path (e.g. '/favicon.svg'). Used for the document link rel="icon". */
|
|
265
216
|
favicon?: string;
|
|
266
|
-
/**
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
217
|
+
/**
|
|
218
|
+
* Small square app icon (e.g. '/app-icon.svg').
|
|
219
|
+
* Shown in the sidebar header, app-bar, and windows start menu.
|
|
220
|
+
* Use a string for SVG/mono icons (auto light/dark via CSS), or `{ light, dark }` for paired PNGs.
|
|
221
|
+
*/
|
|
222
|
+
appIcon?: ThemeAsset;
|
|
223
|
+
/**
|
|
224
|
+
* Logo path (e.g. '/logo.svg'). Wider wordmark; use a string or `{ light, dark }` pair.
|
|
225
|
+
* Prefer `appIcon` for the small square mark in chrome.
|
|
226
|
+
*/
|
|
227
|
+
logo?: ThemeAsset;
|
|
270
228
|
language?: string | string[]; // Single language code or array of enabled language codes (e.g., 'en' or ['en', 'fr'])
|
|
271
229
|
/** Layout mode: 'sidebar' (default) or 'fullscreen'. Fullscreen shows only content with no navigation. */
|
|
272
230
|
layout?: LayoutType;
|
|
@@ -284,8 +242,32 @@ export interface ShellUIConfig {
|
|
|
284
242
|
* when `url` is set unless `storage.showInSettings` is false.
|
|
285
243
|
*/
|
|
286
244
|
storage?: StorageConfig;
|
|
287
|
-
|
|
288
|
-
|
|
245
|
+
/**
|
|
246
|
+
* Single theme: built-in name, path to a theme JSON/folder, or inline theme object.
|
|
247
|
+
* When set without `themes`, only this theme is available in the selector.
|
|
248
|
+
*/
|
|
249
|
+
theme?: ThemeRef;
|
|
250
|
+
/**
|
|
251
|
+
* Available themes for the app.
|
|
252
|
+
* - Array of built-in names, paths, or inline objects
|
|
253
|
+
* - Map of id → name | path | object
|
|
254
|
+
* After CLI load, resolved to a `ThemeDefinition[]` for the runtime.
|
|
255
|
+
*/
|
|
256
|
+
themes?: ThemesConfig | ThemeDefinition[];
|
|
257
|
+
/**
|
|
258
|
+
* Directory of theme JSON files (one `.json` per theme) with optional sibling
|
|
259
|
+
* `<name>/fonts/` folders. Resolved by the CLI at load/build time.
|
|
260
|
+
*/
|
|
261
|
+
themesDir?: string;
|
|
262
|
+
/**
|
|
263
|
+
* Active theme name on first visit (and when no user preference is stored).
|
|
264
|
+
* Prefer this over `defaultTheme`.
|
|
265
|
+
*/
|
|
266
|
+
activeTheme?: string;
|
|
267
|
+
/**
|
|
268
|
+
* Default theme name. Alias of `activeTheme` (kept for backward compatibility).
|
|
269
|
+
*/
|
|
270
|
+
defaultTheme?: string;
|
|
289
271
|
/** Sentry error reporting. Load from env (e.g. SENTRY_DSN). Only active in production builds. */
|
|
290
272
|
sentry?: SentryConfig;
|
|
291
273
|
/** Backend communication config. Defaults to undefined (no backend integration). */
|