@olwiba/ui 0.2.11 → 0.2.12
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/index.js +10 -4
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/app/AuthSection.tsx +22 -7
package/package.json
CHANGED
package/src/app/AuthSection.tsx
CHANGED
|
@@ -27,13 +27,28 @@ const defaultRenderLink: AppShellRenderLink = ({ href, children, className }) =>
|
|
|
27
27
|
|
|
28
28
|
function CenteredAuth({ children, brand, className }: { children: React.ReactNode; brand?: React.ReactNode; className?: string }) {
|
|
29
29
|
return (
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
30
|
+
// `min-h-dvh`, not `min-h-screen`: on mobile `100vh` is the viewport with
|
|
31
|
+
// the browser chrome *retracted*, so a screen-height box is always taller
|
|
32
|
+
// than what you can actually see, and it resizes under you as the URL bar
|
|
33
|
+
// hides and shows.
|
|
34
|
+
<section className={cn('flex min-h-dvh flex-col bg-background px-4 py-10 sm:px-6 sm:py-12 lg:px-8', className)}>
|
|
35
|
+
{/*
|
|
36
|
+
Auto margins rather than `justify-center`, and only from `sm` up.
|
|
37
|
+
|
|
38
|
+
A flex item centred with `justify-center` that's taller than its
|
|
39
|
+
container overflows in *both* directions, and the overflow above the
|
|
40
|
+
top edge is unreachable — no scrolling gets you back to it. That's the
|
|
41
|
+
sign-up form on a phone: name, email, password and social buttons
|
|
42
|
+
already run long, and focusing a field drops the keyboard over half
|
|
43
|
+
the viewport. The top of the card, title included, becomes
|
|
44
|
+
unscrollable.
|
|
45
|
+
|
|
46
|
+
Auto margins collapse to zero when there's no free space, so the card
|
|
47
|
+
stays reachable. Below `sm` there's no vertical centring at all — the
|
|
48
|
+
form flows from the top like the contact page.
|
|
49
|
+
*/}
|
|
50
|
+
<div className="mx-auto w-full max-w-md sm:my-auto">
|
|
51
|
+
{brand && <div className="mb-8 text-center">{brand}</div>}
|
|
37
52
|
{children}
|
|
38
53
|
</div>
|
|
39
54
|
</section>
|