@shellui/core 0.5.0-alpha.5 → 0.5.0-beta.2
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/package.json +2 -2
- package/src/components/ContentView.tsx +1 -1
- package/src/components/ui/alert-dialog.tsx +51 -34
- package/src/components/ui/drawer.tsx +57 -40
- package/src/components/ui/sidebar.tsx +12 -5
- package/src/components/ui/sonner.tsx +20 -2
- package/src/features/admin/AdminView.tsx +31 -2
- package/src/features/alertDialog/DialogContext.tsx +11 -5
- package/src/features/auth/components/AccessPendingView.tsx +1 -1
- package/src/features/auth/components/LoginButton.tsx +2 -2
- package/src/features/auth/components/LoginView.tsx +77 -30
- package/src/features/layouts/LayoutFallback.tsx +1 -1
- package/src/features/layouts/OverlayShell.tsx +76 -44
- package/src/features/layouts/appbar/AppBarLayout.tsx +501 -293
- package/src/features/layouts/chrome/CollapsedDesktopTitlebar.tsx +18 -10
- package/src/features/layouts/chrome/ContentDragOverlay.tsx +1 -1
- package/src/features/layouts/chrome/DesktopChrome.tsx +1 -1
- package/src/features/layouts/chrome/SafeAreaTopbar.tsx +48 -0
- package/src/features/layouts/chrome/constants.ts +7 -1
- package/src/features/layouts/chrome/index.ts +5 -0
- package/src/features/layouts/chrome/runtime.ts +157 -7
- package/src/features/layouts/chrome/viewport.ts +66 -0
- package/src/features/layouts/fullscreen/FullscreenLayout.tsx +10 -5
- package/src/features/layouts/sidebar/SidebarInner.tsx +26 -30
- package/src/features/layouts/sidebar/SidebarLayout.tsx +90 -39
- package/src/features/layouts/windows/WindowsLayout.tsx +138 -42
- package/src/features/overlays/ResponsiveModal.tsx +36 -17
- package/src/features/overlays/overlaySize.spec.ts +27 -1
- package/src/features/overlays/overlaySize.ts +73 -18
- package/src/features/overlays/useOverlayReportedSize.ts +5 -4
- package/src/features/settings/SettingsView.tsx +9 -2
- package/src/features/storage/uploads/UploadToastCard.tsx +1 -1
- package/src/features/storage/uploads/UploadToaster.tsx +6 -3
- package/src/features/theme/applyTheme.ts +20 -1
- package/src/i18n/translations/en/common.json +2 -1
- package/src/i18n/translations/fr/common.json +2 -1
- package/src/index.css +177 -18
- package/src/index.html +32 -3
- package/src/routes/components/RouteErrorBoundary.tsx +1 -1
- package/src/routes/components/RouteFallback.tsx +1 -1
|
@@ -23,9 +23,16 @@ import {
|
|
|
23
23
|
redirectToCliCallback,
|
|
24
24
|
} from '../utils';
|
|
25
25
|
import { AppBrandIcon } from '../../layouts/branding/AppBrandIcon';
|
|
26
|
+
import { DESKTOP_TITLEBAR_HEIGHT_PX } from '../../layouts/chrome/constants';
|
|
27
|
+
import { useMacTrafficLights } from '../../layouts/chrome/runtime';
|
|
26
28
|
import { AccessPendingView } from './AccessPendingView';
|
|
27
29
|
import { LoginPreferencesControls } from './LoginPreferencesControls';
|
|
28
30
|
|
|
31
|
+
/** Shared top inset for login chrome when traffic lights are absent. */
|
|
32
|
+
const LOGIN_CHROME_PAD_Y = '2rem';
|
|
33
|
+
/** Gap below the macOS titlebar before the brand icon. */
|
|
34
|
+
const LOGIN_BRAND_BELOW_TITLEBAR_GAP = '0.75rem';
|
|
35
|
+
|
|
29
36
|
const LAST_USED_LOGIN_STORAGE_KEY = 'shellui.auth.last_used_login';
|
|
30
37
|
|
|
31
38
|
const SHELLUI_OAUTH_ERROR_PARAM = 'shellui_oauth_error';
|
|
@@ -84,6 +91,7 @@ export const LoginView = () => {
|
|
|
84
91
|
const navigate = useNavigate();
|
|
85
92
|
const location = useLocation();
|
|
86
93
|
const { config } = useConfig();
|
|
94
|
+
const trafficLights = useMacTrafficLights();
|
|
87
95
|
const {
|
|
88
96
|
isAuthenticated,
|
|
89
97
|
isLoading: authLoading,
|
|
@@ -143,6 +151,11 @@ export const LoginView = () => {
|
|
|
143
151
|
captureCliCallbackFromSearch(location.search);
|
|
144
152
|
}, [location.search]);
|
|
145
153
|
|
|
154
|
+
useEffect(() => {
|
|
155
|
+
const loginLabel = t('authMenu.login');
|
|
156
|
+
document.title = config?.title ? `${loginLabel} | ${config.title}` : loginLabel;
|
|
157
|
+
}, [config?.title, t]);
|
|
158
|
+
|
|
146
159
|
useEffect(() => {
|
|
147
160
|
const params = new URLSearchParams(location.search);
|
|
148
161
|
const rawErr = params.get(SHELLUI_OAUTH_ERROR_PARAM);
|
|
@@ -405,6 +418,7 @@ export const LoginView = () => {
|
|
|
405
418
|
|
|
406
419
|
const panelUrl = config.backend?.login?.panelUrl?.trim() || null;
|
|
407
420
|
const panelImage = config.backend?.login?.panelImage?.trim() || null;
|
|
421
|
+
const hasCustomPanel = Boolean(panelUrl || panelImage);
|
|
408
422
|
const legalDocuments = useMemo(() => getLegalDocuments(config), [config]);
|
|
409
423
|
|
|
410
424
|
if (isAuthenticated) {
|
|
@@ -424,8 +438,52 @@ export const LoginView = () => {
|
|
|
424
438
|
);
|
|
425
439
|
}
|
|
426
440
|
|
|
441
|
+
const chromePadTop = `calc(${LOGIN_CHROME_PAD_Y} + var(--shellui-safe-area-top))`;
|
|
442
|
+
// Clear traffic-light titlebar, then keep a small gap — only when native lights are shown.
|
|
443
|
+
const brandPadTop = trafficLights
|
|
444
|
+
? `calc(var(--shellui-safe-area-top) + ${DESKTOP_TITLEBAR_HEIGHT_PX}px + ${LOGIN_BRAND_BELOW_TITLEBAR_GAP})`
|
|
445
|
+
: chromePadTop;
|
|
446
|
+
const contentPadTop = trafficLights
|
|
447
|
+
? `calc(var(--shellui-safe-area-top) + ${DESKTOP_TITLEBAR_HEIGHT_PX}px + ${LOGIN_BRAND_BELOW_TITLEBAR_GAP} + 2rem)`
|
|
448
|
+
: `calc(4rem + var(--shellui-safe-area-top))`;
|
|
449
|
+
|
|
427
450
|
return (
|
|
428
|
-
<main className="flex min-h-full w-full bg-background">
|
|
451
|
+
<main className="relative flex min-h-full w-full bg-background">
|
|
452
|
+
{!isIframeView ? (
|
|
453
|
+
<>
|
|
454
|
+
<div
|
|
455
|
+
className={cn(
|
|
456
|
+
'pointer-events-none absolute top-0 left-0 z-10 pl-[calc(1.5rem+var(--shellui-safe-area-left))]',
|
|
457
|
+
hasCustomPanel && 'md:invisible',
|
|
458
|
+
)}
|
|
459
|
+
style={{ paddingTop: brandPadTop }}
|
|
460
|
+
>
|
|
461
|
+
<div className="pointer-events-auto">
|
|
462
|
+
{config.appIcon ? (
|
|
463
|
+
<AppBrandIcon
|
|
464
|
+
appIcon={config.appIcon}
|
|
465
|
+
title={config.title}
|
|
466
|
+
imgClassName="size-8"
|
|
467
|
+
/>
|
|
468
|
+
) : (
|
|
469
|
+
<span
|
|
470
|
+
className="block size-8"
|
|
471
|
+
aria-hidden
|
|
472
|
+
/>
|
|
473
|
+
)}
|
|
474
|
+
</div>
|
|
475
|
+
</div>
|
|
476
|
+
<div
|
|
477
|
+
className="pointer-events-none absolute top-0 right-0 z-10 pr-[calc(1.5rem+var(--shellui-safe-area-right))]"
|
|
478
|
+
style={{ paddingTop: chromePadTop }}
|
|
479
|
+
>
|
|
480
|
+
<div className="pointer-events-auto">
|
|
481
|
+
<LoginPreferencesControls />
|
|
482
|
+
</div>
|
|
483
|
+
</div>
|
|
484
|
+
</>
|
|
485
|
+
) : null}
|
|
486
|
+
|
|
429
487
|
{!isIframeView && (
|
|
430
488
|
<section
|
|
431
489
|
className="relative hidden min-h-full w-1/2 overflow-hidden bg-muted/40 md:block"
|
|
@@ -435,50 +493,34 @@ export const LoginView = () => {
|
|
|
435
493
|
<iframe
|
|
436
494
|
src={panelUrl}
|
|
437
495
|
title={t('loginPage.brandingIframeTitle')}
|
|
438
|
-
className="h-full
|
|
496
|
+
className="h-full w-full border-0"
|
|
439
497
|
/>
|
|
440
498
|
) : panelImage ? (
|
|
441
|
-
<div className="flex h-full
|
|
499
|
+
<div className="flex h-full w-full items-center justify-center overflow-hidden">
|
|
442
500
|
<img
|
|
443
501
|
src={panelImage}
|
|
444
502
|
alt=""
|
|
445
503
|
className="max-h-full max-w-full object-contain"
|
|
446
504
|
/>
|
|
447
505
|
</div>
|
|
448
|
-
) :
|
|
449
|
-
<div className="flex h-full min-h-svh w-full items-start justify-start p-6">
|
|
450
|
-
<AppBrandIcon
|
|
451
|
-
appIcon={config.appIcon}
|
|
452
|
-
title={config.title}
|
|
453
|
-
imgClassName="size-8"
|
|
454
|
-
/>
|
|
455
|
-
</div>
|
|
456
|
-
)}
|
|
506
|
+
) : null}
|
|
457
507
|
</section>
|
|
458
508
|
)}
|
|
459
509
|
|
|
460
510
|
<section
|
|
461
511
|
className={cn(
|
|
462
|
-
'relative flex min-h-
|
|
512
|
+
'relative flex min-h-full w-full flex-col',
|
|
513
|
+
isIframeView
|
|
514
|
+
? 'px-6 py-6'
|
|
515
|
+
: [
|
|
516
|
+
'pr-[calc(1.5rem+var(--shellui-safe-area-right))]',
|
|
517
|
+
'pb-[calc(1.5rem+var(--shellui-safe-area-bottom))] md:pb-[calc(2.5rem+var(--shellui-safe-area-bottom))]',
|
|
518
|
+
'pl-[calc(1.5rem+var(--shellui-safe-area-left))]',
|
|
519
|
+
],
|
|
463
520
|
!isIframeView && 'md:w-1/2',
|
|
464
521
|
)}
|
|
522
|
+
style={!isIframeView ? { paddingTop: contentPadTop } : undefined}
|
|
465
523
|
>
|
|
466
|
-
{!isIframeView ? (
|
|
467
|
-
<div className="flex shrink-0 items-center gap-4 pb-6 md:pb-2">
|
|
468
|
-
{config.appIcon ? (
|
|
469
|
-
<div className="md:hidden">
|
|
470
|
-
<AppBrandIcon
|
|
471
|
-
appIcon={config.appIcon}
|
|
472
|
-
title={config.title}
|
|
473
|
-
imgClassName="size-8"
|
|
474
|
-
/>
|
|
475
|
-
</div>
|
|
476
|
-
) : null}
|
|
477
|
-
<div className="ml-auto">
|
|
478
|
-
<LoginPreferencesControls />
|
|
479
|
-
</div>
|
|
480
|
-
</div>
|
|
481
|
-
) : null}
|
|
482
524
|
<div className="flex w-full min-h-0 flex-1 items-center justify-center">
|
|
483
525
|
<div
|
|
484
526
|
className={cn(
|
|
@@ -711,7 +753,12 @@ export const LoginView = () => {
|
|
|
711
753
|
? t('loginPage.otherSocialLogins')
|
|
712
754
|
: t('loginPage.socialLogin')}
|
|
713
755
|
</p>
|
|
714
|
-
<div
|
|
756
|
+
<div
|
|
757
|
+
className={cn(
|
|
758
|
+
'grid gap-2',
|
|
759
|
+
otherOAuthProviders.length > 1 && 'sm:grid-cols-2',
|
|
760
|
+
)}
|
|
761
|
+
>
|
|
715
762
|
{otherOAuthProviders.map((provider) => {
|
|
716
763
|
const visual = getProviderVisual(provider);
|
|
717
764
|
const label = formatProviderLabel(provider);
|
|
@@ -20,6 +20,8 @@ import {
|
|
|
20
20
|
resolveDialogSize,
|
|
21
21
|
resolveDismissOptions,
|
|
22
22
|
resolveDrawerSize,
|
|
23
|
+
resolveDrawerSizeForViewport,
|
|
24
|
+
resolveEffectiveDrawerPosition,
|
|
23
25
|
isDynamicSizing,
|
|
24
26
|
} from '../overlays/overlaySize';
|
|
25
27
|
import { useOverlayReportedSize } from '../overlays/useOverlayReportedSize';
|
|
@@ -27,6 +29,9 @@ import { ResponsiveModal } from '../overlays/ResponsiveModal';
|
|
|
27
29
|
import { OverlayPendingSpinner } from '../overlays/OverlayPendingSpinner';
|
|
28
30
|
import { OverlayDrawerPendingBar } from '../overlays/OverlayDrawerPendingBar';
|
|
29
31
|
|
|
32
|
+
/** Matches --shellui-overlay-max-height in index.css */
|
|
33
|
+
const OVERLAY_MAX_H = 'var(--shellui-overlay-max-height)';
|
|
34
|
+
|
|
30
35
|
interface OverlayShellProps {
|
|
31
36
|
children: ReactNode;
|
|
32
37
|
}
|
|
@@ -58,6 +63,8 @@ function OverlayIframe({
|
|
|
58
63
|
pending,
|
|
59
64
|
pendingFill,
|
|
60
65
|
pendingChrome = 'spinner',
|
|
66
|
+
/** Mobile sheet: measure and lay out at full viewport width (ignore reported width). */
|
|
67
|
+
forceFullWidth = false,
|
|
61
68
|
}: {
|
|
62
69
|
url: string;
|
|
63
70
|
navItem: NavigationItem;
|
|
@@ -72,26 +79,27 @@ function OverlayIframe({
|
|
|
72
79
|
pendingFill?: boolean;
|
|
73
80
|
/** Modal: centered spinner. Drawer: full-bleed 40px loading bar. */
|
|
74
81
|
pendingChrome?: 'spinner' | 'bar';
|
|
82
|
+
forceFullWidth?: boolean;
|
|
75
83
|
}) {
|
|
76
84
|
// Content-sized: iframe tracks reported content. While pending, chrome is a square/strip
|
|
77
85
|
// but the iframe lays out at a realistic width (opacity 0) so the first report matches
|
|
78
|
-
// final wrap — drawers use viewport width; modals use
|
|
86
|
+
// final wrap — drawers / mobile sheets use viewport width; desktop modals use compact measure.
|
|
79
87
|
const scroll = allowInnerScroll || !contentSized;
|
|
80
88
|
const modalPendingPx = DYNAMIC_OVERLAY_PENDING_PX;
|
|
81
89
|
const drawerPendingPx = DYNAMIC_DRAWER_PENDING_PX;
|
|
82
|
-
const useSquarePending =
|
|
90
|
+
const useSquarePending =
|
|
91
|
+
pending && !pendingFill && pendingChrome === 'spinner' && !forceFullWidth;
|
|
83
92
|
const useDrawerBarPending = pending && pendingChrome === 'bar';
|
|
93
|
+
const useFullWidthPending = pending && forceFullWidth && pendingChrome === 'spinner';
|
|
94
|
+
const viewportW =
|
|
95
|
+
typeof window !== 'undefined' ? window.innerWidth : DYNAMIC_OVERLAY_MEASURE_WIDTH_PX;
|
|
84
96
|
const measureW =
|
|
85
|
-
pendingChrome === 'bar'
|
|
86
|
-
? typeof window !== 'undefined'
|
|
87
|
-
? window.innerWidth
|
|
88
|
-
: DYNAMIC_OVERLAY_MEASURE_WIDTH_PX
|
|
89
|
-
: DYNAMIC_OVERLAY_MEASURE_WIDTH_PX;
|
|
97
|
+
forceFullWidth || pendingChrome === 'bar' ? viewportW : DYNAMIC_OVERLAY_MEASURE_WIDTH_PX;
|
|
90
98
|
|
|
91
99
|
if (!contentSized) {
|
|
92
100
|
// Fill drawer chrome so ContentView's top loading bar is visible (not a 0-height flex quirk).
|
|
93
101
|
return (
|
|
94
|
-
<div className="relative min-h-0 w-full flex-1">
|
|
102
|
+
<div className="relative h-full min-h-0 w-full flex-1">
|
|
95
103
|
<div className="absolute inset-0 overflow-hidden bg-background">
|
|
96
104
|
<ContentView
|
|
97
105
|
url={url}
|
|
@@ -117,23 +125,29 @@ function OverlayIframe({
|
|
|
117
125
|
overflow: 'hidden',
|
|
118
126
|
}
|
|
119
127
|
: {
|
|
120
|
-
height
|
|
121
|
-
|
|
122
|
-
|
|
128
|
+
// Fill the chrome. Do NOT set an absolute pixel height here — the chrome
|
|
129
|
+
// owns height/maxHeight; a taller iframe would paint past the visible sheet.
|
|
130
|
+
height: '100%',
|
|
131
|
+
minHeight: 0,
|
|
132
|
+
width: forceFullWidth ? '100%' : (reportedWidth ?? '100%'),
|
|
123
133
|
overflow: scroll ? 'auto' : 'hidden',
|
|
124
134
|
};
|
|
125
135
|
|
|
126
136
|
return (
|
|
127
137
|
<div
|
|
128
|
-
className={`relative w-full
|
|
138
|
+
className={`relative w-full min-h-0 bg-background${
|
|
139
|
+
pending ? '' : ' h-full'
|
|
140
|
+
}${useDrawerBarPending && pendingFill ? ' h-full min-h-0' : ''}`}
|
|
129
141
|
style={
|
|
130
142
|
useSquarePending
|
|
131
143
|
? { width: modalPendingPx, height: modalPendingPx, overflow: 'hidden' }
|
|
132
|
-
:
|
|
133
|
-
? { width: '100%', height:
|
|
134
|
-
: useDrawerBarPending && pendingFill
|
|
135
|
-
? { width: '100%', height:
|
|
136
|
-
:
|
|
144
|
+
: useFullWidthPending
|
|
145
|
+
? { width: '100%', height: modalPendingPx, overflow: 'hidden' }
|
|
146
|
+
: useDrawerBarPending && !pendingFill
|
|
147
|
+
? { width: '100%', height: drawerPendingPx, overflow: 'hidden' }
|
|
148
|
+
: useDrawerBarPending && pendingFill
|
|
149
|
+
? { width: '100%', height: '100%', minHeight: drawerPendingPx, overflow: 'hidden' }
|
|
150
|
+
: undefined
|
|
137
151
|
}
|
|
138
152
|
aria-busy={pending || undefined}
|
|
139
153
|
aria-live={pending ? 'polite' : undefined}
|
|
@@ -182,9 +196,11 @@ export const OverlayShell = ({ children }: OverlayShellProps) => {
|
|
|
182
196
|
const drawerDynamic = isDynamicSizing(drawerOptions);
|
|
183
197
|
|
|
184
198
|
const dialogSize = useMemo(() => resolveDialogSize(modalOptions), [modalOptions]);
|
|
199
|
+
// Mobile: every drawer edge uses bottom-sheet chrome (consistent with openModal).
|
|
200
|
+
const effectiveDrawerPosition = resolveEffectiveDrawerPosition(drawerPosition, isMobile);
|
|
185
201
|
const drawerSize = useMemo(
|
|
186
|
-
() =>
|
|
187
|
-
[drawerOptions, drawerPosition],
|
|
202
|
+
() => resolveDrawerSizeForViewport(drawerOptions, drawerPosition, isMobile),
|
|
203
|
+
[drawerOptions, drawerPosition, isMobile],
|
|
188
204
|
);
|
|
189
205
|
// Sheet presentation for mobile — bottom drawer sizing from the same modal options.
|
|
190
206
|
const sheetSize = useMemo(
|
|
@@ -199,6 +215,8 @@ export const OverlayShell = ({ children }: OverlayShellProps) => {
|
|
|
199
215
|
),
|
|
200
216
|
[modalOptions, modalDynamic],
|
|
201
217
|
);
|
|
218
|
+
const drawerIsVertical =
|
|
219
|
+
effectiveDrawerPosition === 'top' || effectiveDrawerPosition === 'bottom';
|
|
202
220
|
|
|
203
221
|
const modalContentSized = dialogSize.contentSized || sheetSize.contentSized || modalDynamic;
|
|
204
222
|
const {
|
|
@@ -268,18 +286,25 @@ export const OverlayShell = ({ children }: OverlayShellProps) => {
|
|
|
268
286
|
|
|
269
287
|
const modalChromeClassName = modalPending
|
|
270
288
|
? presentation === 'sheet'
|
|
271
|
-
? 'w-full p-0 overflow-hidden flex flex-col'
|
|
289
|
+
? 'w-full max-w-none p-0 overflow-hidden flex flex-col'
|
|
272
290
|
: 'rounded-lg p-0 overflow-hidden flex flex-col !w-auto !max-w-none'
|
|
273
291
|
: presentation === 'sheet'
|
|
274
|
-
?
|
|
292
|
+
? // Dynamic mobile sheets always fill width; height still follows content reports
|
|
293
|
+
modalContentSized
|
|
294
|
+
? 'w-full max-w-none p-0 overflow-hidden flex flex-col'
|
|
295
|
+
: sheetSize.className
|
|
275
296
|
: dialogSize.className;
|
|
276
297
|
|
|
298
|
+
const overlayMaxH = OVERLAY_MAX_H;
|
|
299
|
+
|
|
277
300
|
const modalChromeStyle: CSSProperties = {
|
|
278
301
|
// Dynamic overlays snap to reported size — no height/width tween (avoids multi-step jumps)
|
|
279
302
|
...(modalContentSized ? { transition: 'none' } : {}),
|
|
280
303
|
...(modalPending
|
|
281
304
|
? presentation === 'sheet'
|
|
282
305
|
? {
|
|
306
|
+
width: '100%',
|
|
307
|
+
maxWidth: '100%',
|
|
283
308
|
height: pendingPx,
|
|
284
309
|
minHeight: pendingPx,
|
|
285
310
|
maxHeight: pendingPx,
|
|
@@ -298,23 +323,27 @@ export const OverlayShell = ({ children }: OverlayShellProps) => {
|
|
|
298
323
|
? presentation === 'sheet'
|
|
299
324
|
? {
|
|
300
325
|
height: modalReported.height,
|
|
301
|
-
maxHeight: `min(${modalReported.height}px,
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
326
|
+
maxHeight: `min(${modalReported.height}px, ${overlayMaxH})`,
|
|
327
|
+
// Phone sheets: always full width (dynamic sizing only drives height)
|
|
328
|
+
width: '100%',
|
|
329
|
+
maxWidth: '100%',
|
|
305
330
|
}
|
|
306
331
|
: {
|
|
307
332
|
height: modalReported.height,
|
|
308
|
-
maxHeight: `min(${modalReported.height}px,
|
|
333
|
+
maxHeight: `min(${modalReported.height}px, ${overlayMaxH})`,
|
|
309
334
|
width: modalReported.width ?? DYNAMIC_OVERLAY_MEASURE_WIDTH_PX,
|
|
310
335
|
maxWidth: 'min(92vw, 100%)',
|
|
311
336
|
}
|
|
312
337
|
: presentation === 'sheet' && sheetSize.drawerSize
|
|
313
338
|
? {
|
|
314
339
|
height: sheetSize.drawerSize,
|
|
315
|
-
maxHeight: `min(${sheetSize.drawerSize},
|
|
340
|
+
maxHeight: `min(${sheetSize.drawerSize}, ${overlayMaxH})`,
|
|
341
|
+
width: '100%',
|
|
342
|
+
maxWidth: '100%',
|
|
316
343
|
}
|
|
317
|
-
:
|
|
344
|
+
: presentation === 'sheet'
|
|
345
|
+
? { width: '100%', maxWidth: '100%' }
|
|
346
|
+
: {}),
|
|
318
347
|
}),
|
|
319
348
|
};
|
|
320
349
|
|
|
@@ -322,7 +351,7 @@ export const OverlayShell = ({ children }: OverlayShellProps) => {
|
|
|
322
351
|
...drawerSize.style,
|
|
323
352
|
...(drawerSize.contentSized || drawerDynamic ? { transition: 'none' } : {}),
|
|
324
353
|
...(drawerPending
|
|
325
|
-
?
|
|
354
|
+
? drawerIsVertical
|
|
326
355
|
? {
|
|
327
356
|
height: drawerPendingPx,
|
|
328
357
|
maxHeight: drawerPendingPx,
|
|
@@ -334,10 +363,10 @@ export const OverlayShell = ({ children }: OverlayShellProps) => {
|
|
|
334
363
|
minWidth: drawerPendingPx,
|
|
335
364
|
}
|
|
336
365
|
: drawerReported
|
|
337
|
-
?
|
|
366
|
+
? drawerIsVertical
|
|
338
367
|
? {
|
|
339
368
|
height: drawerReported.height,
|
|
340
|
-
maxHeight: `min(${drawerReported.height}px,
|
|
369
|
+
maxHeight: `min(${drawerReported.height}px, ${overlayMaxH})`,
|
|
341
370
|
}
|
|
342
371
|
: {
|
|
343
372
|
width: drawerReported.width ?? drawerReported.height,
|
|
@@ -395,28 +424,32 @@ export const OverlayShell = ({ children }: OverlayShellProps) => {
|
|
|
395
424
|
navItem={modalNavItem}
|
|
396
425
|
contentSized={modalContentSized}
|
|
397
426
|
reportedHeight={modalReported?.height ?? null}
|
|
398
|
-
reportedWidth={modalReported?.width ?? null}
|
|
427
|
+
reportedWidth={presentation === 'sheet' ? null : (modalReported?.width ?? null)}
|
|
399
428
|
allowInnerScroll={modalSizeFallback || modalWasClamped}
|
|
400
429
|
pending={modalPending}
|
|
430
|
+
forceFullWidth={presentation === 'sheet'}
|
|
401
431
|
/>
|
|
402
432
|
) : (
|
|
403
433
|
<OverlayUrlError kind="modal" />
|
|
404
434
|
)}
|
|
405
435
|
</ResponsiveModal>
|
|
406
436
|
|
|
407
|
-
{/*
|
|
437
|
+
{/*
|
|
438
|
+
Explicit drawers — on mobile every edge presents as a bottom sheet
|
|
439
|
+
(same chrome as openModal sheet), so side panels stay usable.
|
|
440
|
+
*/}
|
|
408
441
|
<Drawer
|
|
409
442
|
open={isDrawerOpen}
|
|
410
443
|
onOpenChange={handleDrawerOpenChange}
|
|
411
|
-
direction={
|
|
444
|
+
direction={effectiveDrawerPosition}
|
|
412
445
|
dismissible={drawerDismiss.dismissible}
|
|
413
446
|
>
|
|
414
447
|
<DrawerContent
|
|
415
|
-
direction={
|
|
448
|
+
direction={effectiveDrawerPosition}
|
|
416
449
|
open={isDrawerOpen}
|
|
417
450
|
size={
|
|
418
451
|
drawerReported
|
|
419
|
-
?
|
|
452
|
+
? drawerIsVertical
|
|
420
453
|
? `${drawerReported.height}px`
|
|
421
454
|
: `${drawerReported.width ?? drawerReported.height}px`
|
|
422
455
|
: drawerPending
|
|
@@ -427,7 +460,10 @@ export const OverlayShell = ({ children }: OverlayShellProps) => {
|
|
|
427
460
|
className={drawerSize.className}
|
|
428
461
|
showCloseButton={!drawerPending && drawerDismiss.showCloseButton}
|
|
429
462
|
showDragHandle={
|
|
430
|
-
!drawerPending &&
|
|
463
|
+
!drawerPending &&
|
|
464
|
+
drawerIsVertical &&
|
|
465
|
+
drawerDismiss.showDragHandle &&
|
|
466
|
+
drawerDismiss.dismissible
|
|
431
467
|
}
|
|
432
468
|
closeOnOverlayClick={drawerDismiss.closeOnOverlayClick}
|
|
433
469
|
resizable={
|
|
@@ -448,18 +484,14 @@ export const OverlayShell = ({ children }: OverlayShellProps) => {
|
|
|
448
484
|
navItem={drawerNavItem}
|
|
449
485
|
contentSized={drawerSize.contentSized}
|
|
450
486
|
reportedHeight={
|
|
451
|
-
|
|
487
|
+
drawerIsVertical
|
|
452
488
|
? (drawerReported?.height ?? null)
|
|
453
489
|
: (drawerReported?.width ?? drawerReported?.height ?? null)
|
|
454
490
|
}
|
|
455
|
-
reportedWidth={
|
|
456
|
-
drawerPosition === 'left' || drawerPosition === 'right'
|
|
457
|
-
? (drawerReported?.width ?? null)
|
|
458
|
-
: null
|
|
459
|
-
}
|
|
491
|
+
reportedWidth={!drawerIsVertical ? (drawerReported?.width ?? null) : null}
|
|
460
492
|
allowInnerScroll={drawerSizeFallback || drawerWasClamped}
|
|
461
493
|
pending={drawerPending}
|
|
462
|
-
pendingFill={
|
|
494
|
+
pendingFill={!drawerIsVertical}
|
|
463
495
|
pendingChrome="bar"
|
|
464
496
|
/>
|
|
465
497
|
</>
|