@mucsi96/react-ui 0.4.0 → 0.5.0

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 CHANGED
@@ -44,6 +44,46 @@ the font to the document root, so applications need no font-family declarations
44
44
  or token overrides. No font downloads are needed.
45
45
  The optional stylesheet does not import fonts or reset page layouts.
46
46
 
47
+ ## Application layout
48
+
49
+ ```tsx
50
+ import { AppHeader, AppHeaderActions, AppMain } from '@mucsi96/react-ui';
51
+
52
+ <AppHeader>
53
+ <a href="/">My application</a>
54
+ <AppHeaderActions>
55
+ <nav aria-label="Main navigation">{/* Application links */}</nav>
56
+ <ProfileMenu />
57
+ </AppHeaderActions>
58
+ </AppHeader>
59
+ <AppMain id="main-content">{/* Page content */}</AppMain>
60
+ ```
61
+
62
+ `AppHeader` renders a native `header` with a width-constrained inner flex row.
63
+ Its safe-area top padding sits outside the row's minimum height, so iOS status
64
+ bars do not compress controls. Children wrap as needed. `AppHeaderActions` is a
65
+ wrapping, end-aligned `div`; make any nested navigation groups wrap as well.
66
+ `AppMain` renders a native `main` with matching horizontal gutters, page spacing,
67
+ and bottom safe-area padding. All three accept native element props, including
68
+ `className`, `style`, and React 19 `ref`. They use ordinary document flow.
69
+
70
+ Set these inherited CSS variables on a common ancestor to customize the layout:
71
+
72
+ | Variable | Default | Purpose |
73
+ | ------------------------ | ------- | ---------------------------------------------------- |
74
+ | `--bt-app-max-width` | `90rem` | Header row and main maximum width, including gutters |
75
+ | `--bt-app-gutter` | `1rem` | Minimum horizontal and bottom page padding |
76
+ | `--bt-app-header-height` | `4rem` | Minimum header row height, excluding top safe area |
77
+ | `--bt-app-header-gap` | `1rem` | Space between header children and actions |
78
+ | `--bt-app-content-gap` | `3rem` | Main content top padding |
79
+
80
+ The host document should reset the body margin and include
81
+ `<meta name="viewport" content="width=device-width, initial-scale=1, viewport-fit=cover">`
82
+ for edge-to-edge safe-area handling. The library does not modify document metadata
83
+ or global layout. Keep routing, profile fetching, navigation labels, and menu
84
+ contents in the application; compose profile menus with `MenuTrigger` and
85
+ `Button variant="avatar"`.
86
+
47
87
  ## Buttons
48
88
 
49
89
  ```tsx
@@ -0,0 +1,7 @@
1
+ import type { ComponentPropsWithRef } from 'react';
2
+ export type AppHeaderProps = ComponentPropsWithRef<'header'>;
3
+ export type AppHeaderActionsProps = ComponentPropsWithRef<'div'>;
4
+ export type AppMainProps = ComponentPropsWithRef<'main'>;
5
+ export declare function AppHeader({ children, className, ...props }: AppHeaderProps): import("react").JSX.Element;
6
+ export declare function AppHeaderActions({ className, ...props }: AppHeaderActionsProps): import("react").JSX.Element;
7
+ export declare function AppMain({ className, ...props }: AppMainProps): import("react").JSX.Element;
package/dist/index.d.ts CHANGED
@@ -1,3 +1,5 @@
1
+ export { AppHeader, AppHeaderActions, AppMain } from './components/app-layout/app-layout';
2
+ export type { AppHeaderProps, AppHeaderActionsProps, AppMainProps, } from './components/app-layout/app-layout';
1
3
  export { Button, LinkButton } from './components/button/button';
2
4
  export type { ButtonProps, ButtonVariant, LinkButtonProps } from './components/button/button';
3
5
  export { TextField } from './components/forms/text-field';