@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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@olwiba/ui",
3
- "version": "0.2.11",
3
+ "version": "0.2.12",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "sideEffects": false,
@@ -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
- <section className={cn('flex min-h-screen flex-col justify-center bg-background py-12 px-4 sm:px-6 lg:px-8', className)}>
31
- {brand && (
32
- <div className="mx-auto w-full max-w-md text-center mb-8">
33
- {brand}
34
- </div>
35
- )}
36
- <div className="mx-auto w-full max-w-md">
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>