@olwiba/ui 0.2.13 → 0.2.14
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.d.ts +13 -1
- package/dist/index.js +20 -2
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/app/AuthSection.tsx +35 -2
package/package.json
CHANGED
package/src/app/AuthSection.tsx
CHANGED
|
@@ -25,7 +25,27 @@ const defaultRenderLink: AppShellRenderLink = ({ href, children, className }) =>
|
|
|
25
25
|
|
|
26
26
|
// ─── Centered layout ──────────────────────────────────────────────────────────
|
|
27
27
|
|
|
28
|
-
function CenteredAuth({ children, brand, className }: { children: React.ReactNode; brand?: React.ReactNode; className?: string }) {
|
|
28
|
+
function CenteredAuth({ children, brand, framed, className }: { children: React.ReactNode; brand?: React.ReactNode; framed?: boolean; className?: string }) {
|
|
29
|
+
if (framed) {
|
|
30
|
+
return (
|
|
31
|
+
// Framed: a page frame is already supplying the background, the page
|
|
32
|
+
// padding, and — with a navbar and footer around it — the height. All
|
|
33
|
+
// three have to come off here or they are applied twice: padding inside
|
|
34
|
+
// padding, and a full-viewport section that pushes the footer below the
|
|
35
|
+
// fold on every auth screen.
|
|
36
|
+
//
|
|
37
|
+
// The card fills the content column on a phone, matching the contact
|
|
38
|
+
// form, and only takes its reading width once there is room for the
|
|
39
|
+
// page to centre it.
|
|
40
|
+
<section className={cn('flex flex-col py-6 sm:py-10', className)}>
|
|
41
|
+
<div className="mx-auto w-full max-w-none sm:my-auto sm:max-w-md">
|
|
42
|
+
{brand && <div className="mb-8 text-center">{brand}</div>}
|
|
43
|
+
{children}
|
|
44
|
+
</div>
|
|
45
|
+
</section>
|
|
46
|
+
);
|
|
47
|
+
}
|
|
48
|
+
|
|
29
49
|
return (
|
|
30
50
|
// `min-h-dvh`, not `min-h-screen`: on mobile `100vh` is the viewport with
|
|
31
51
|
// the browser chrome *retracted*, so a screen-height box is always taller
|
|
@@ -325,6 +345,18 @@ export interface AuthSectionProps extends AuthFormProps {
|
|
|
325
345
|
children?: React.ReactNode;
|
|
326
346
|
/** (split layout only) Custom content for the left decorative panel */
|
|
327
347
|
panel?: React.ReactNode;
|
|
348
|
+
/**
|
|
349
|
+
* Render inside an existing page frame — one already providing the
|
|
350
|
+
* background, the horizontal padding, and a navbar and footer.
|
|
351
|
+
*
|
|
352
|
+
* Standalone (the default) the section owns the whole viewport, which is
|
|
353
|
+
* right for an auth screen that is the only thing on the page. It is wrong
|
|
354
|
+
* the moment there is chrome around it: the padding lands on top of the
|
|
355
|
+
* frame's own, and `min-h-dvh` guarantees the footer starts below the fold.
|
|
356
|
+
*
|
|
357
|
+
* (centered layout only)
|
|
358
|
+
*/
|
|
359
|
+
framed?: boolean;
|
|
328
360
|
className?: string;
|
|
329
361
|
}
|
|
330
362
|
|
|
@@ -332,6 +364,7 @@ export function AuthSection({
|
|
|
332
364
|
layout = 'centered',
|
|
333
365
|
children,
|
|
334
366
|
panel,
|
|
367
|
+
framed,
|
|
335
368
|
className,
|
|
336
369
|
...formProps
|
|
337
370
|
}: AuthSectionProps) {
|
|
@@ -348,7 +381,7 @@ export function AuthSection({
|
|
|
348
381
|
const { brand, ...restFormProps } = formProps;
|
|
349
382
|
const form = children ?? <DefaultForm {...restFormProps} />;
|
|
350
383
|
return (
|
|
351
|
-
<CenteredAuth brand={brand} className={className}>
|
|
384
|
+
<CenteredAuth brand={brand} framed={framed} className={className}>
|
|
352
385
|
{form}
|
|
353
386
|
</CenteredAuth>
|
|
354
387
|
);
|