@lbenicio/components 0.0.0-stage → 0.2.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.
Files changed (64) hide show
  1. package/LICENSE.txt +595 -0
  2. package/README.md +151 -2
  3. package/dist/components/badge.d.ts +7 -0
  4. package/dist/components/badge.d.ts.map +1 -0
  5. package/dist/components/badge.js +6 -0
  6. package/dist/components/badge.js.map +1 -0
  7. package/dist/components/button.d.ts +9 -0
  8. package/dist/components/button.d.ts.map +1 -0
  9. package/dist/components/button.js +6 -0
  10. package/dist/components/button.js.map +1 -0
  11. package/dist/components/card.d.ts +3 -0
  12. package/dist/components/card.d.ts.map +1 -0
  13. package/dist/components/card.js +6 -0
  14. package/dist/components/card.js.map +1 -0
  15. package/dist/components/data-table.d.ts +17 -0
  16. package/dist/components/data-table.d.ts.map +1 -0
  17. package/dist/components/data-table.js +27 -0
  18. package/dist/components/data-table.js.map +1 -0
  19. package/dist/components/empty-state.d.ts +9 -0
  20. package/dist/components/empty-state.d.ts.map +1 -0
  21. package/dist/components/empty-state.js +5 -0
  22. package/dist/components/empty-state.js.map +1 -0
  23. package/dist/components/filter-bar.d.ts +8 -0
  24. package/dist/components/filter-bar.d.ts.map +1 -0
  25. package/dist/components/filter-bar.js +9 -0
  26. package/dist/components/filter-bar.js.map +1 -0
  27. package/dist/components/form-field.d.ts +13 -0
  28. package/dist/components/form-field.d.ts.map +1 -0
  29. package/dist/components/form-field.js +15 -0
  30. package/dist/components/form-field.js.map +1 -0
  31. package/dist/components/link.d.ts +16 -0
  32. package/dist/components/link.d.ts.map +1 -0
  33. package/dist/components/link.js +8 -0
  34. package/dist/components/link.js.map +1 -0
  35. package/dist/components/manager-shell.d.ts +33 -0
  36. package/dist/components/manager-shell.d.ts.map +1 -0
  37. package/dist/components/manager-shell.js +143 -0
  38. package/dist/components/manager-shell.js.map +1 -0
  39. package/dist/components/modal.d.ts +11 -0
  40. package/dist/components/modal.d.ts.map +1 -0
  41. package/dist/components/modal.js +33 -0
  42. package/dist/components/modal.js.map +1 -0
  43. package/dist/components/notice.d.ts +8 -0
  44. package/dist/components/notice.d.ts.map +1 -0
  45. package/dist/components/notice.js +6 -0
  46. package/dist/components/notice.js.map +1 -0
  47. package/dist/components/page-header.d.ts +9 -0
  48. package/dist/components/page-header.d.ts.map +1 -0
  49. package/dist/components/page-header.js +5 -0
  50. package/dist/components/page-header.js.map +1 -0
  51. package/dist/components/pagination.d.ts +12 -0
  52. package/dist/components/pagination.d.ts.map +1 -0
  53. package/dist/components/pagination.js +14 -0
  54. package/dist/components/pagination.js.map +1 -0
  55. package/dist/index.d.ts +15 -0
  56. package/dist/index.d.ts.map +1 -0
  57. package/dist/index.js +15 -0
  58. package/dist/index.js.map +1 -0
  59. package/dist/lib/class-names.d.ts +3 -0
  60. package/dist/lib/class-names.d.ts.map +1 -0
  61. package/dist/lib/class-names.js +4 -0
  62. package/dist/lib/class-names.js.map +1 -0
  63. package/dist/styles.css +950 -0
  64. package/package.json +46 -4
package/README.md CHANGED
@@ -1,3 +1,152 @@
1
- # Temporary Holding Version
1
+ # @lbenicio/components
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ Shared, accessible React components for the lbenicio web applications. The package is framework-neutral: it does not depend on Next.js, Cloudflare, or a router. Apps can use the primitives independently or adopt `ApplicationShell` for the common dashboard layout.
4
+
5
+ ## Installation
6
+
7
+ The `0.2.0` release is prepared in this repository. After publishing it, install with:
8
+
9
+ ```sh
10
+ npm install @lbenicio/components@0.2.0
11
+ ```
12
+
13
+ React 18.2 and React 19 are supported as peer dependencies. The consuming application supplies React and its router.
14
+
15
+ ## Quick start
16
+
17
+ Import the stylesheet once from the app's root layout or global stylesheet, then use the components in pages:
18
+
19
+ ```tsx
20
+ import "@lbenicio/components/styles.css";
21
+ import {
22
+ Button,
23
+ FilterActions,
24
+ FilterBar,
25
+ Pagination,
26
+ PageHeader,
27
+ SortableHeader,
28
+ Table,
29
+ TableBody,
30
+ TableCell,
31
+ TableContainer,
32
+ TableHead,
33
+ TableRow,
34
+ } from "@lbenicio/components";
35
+
36
+ export function ContactList() {
37
+ return (
38
+ <>
39
+ <PageHeader
40
+ title="Contacts"
41
+ description="Review and respond to messages."
42
+ />
43
+ <FilterBar action="/contacts" method="get">
44
+ <label className="lbc-field">
45
+ <span className="lbc-field-label">Search</span>
46
+ <input className="lbc-input" name="q" type="search" />
47
+ </label>
48
+ <FilterActions>
49
+ <Button type="submit" variant="primary">
50
+ Apply filters
51
+ </Button>
52
+ </FilterActions>
53
+ </FilterBar>
54
+ <TableContainer>
55
+ <Table>
56
+ <TableHead>
57
+ <TableRow>
58
+ <SortableHeader
59
+ direction="ascending"
60
+ href="?sort=name&direction=desc"
61
+ label="Name"
62
+ />
63
+ </TableRow>
64
+ </TableHead>
65
+ <TableBody>
66
+ <TableRow>
67
+ <TableCell>Example contact</TableCell>
68
+ </TableRow>
69
+ </TableBody>
70
+ </Table>
71
+ </TableContainer>
72
+ <Pagination
73
+ currentPage={1}
74
+ pageSize={25}
75
+ totalItems={1}
76
+ totalPages={1}
77
+ hrefForPage={(page) => `?page=${page}`}
78
+ />
79
+ </>
80
+ );
81
+ }
82
+ ```
83
+
84
+ The stylesheet uses namespaced `--lbc-*` design tokens and `lbc-*` classes. Override the tokens in the consuming app to match its brand. Dark mode styles activate when the root element has `data-theme="dark"`.
85
+
86
+ ## Manager shell
87
+
88
+ `ApplicationShell` provides the shared dashboard frame, profile display, responsive navigation, header theme switcher, collapsible and resizable sidebar, and footer. Theme, collapse, and width preferences are stored in localStorage under the supplied `storageKey`, so each app should use a distinct value. Use `footer` for custom footer content or `footerNote` to add a note beside the default copyright year. `ManagerShell` remains an alias for the same component. The shell uses plain anchors by default. Pass the app's router link component from a client-side wrapper to preserve client navigation. For Next.js, keep the wrapper in a client module so the link component does not cross a Server Component boundary:
89
+
90
+ ```tsx
91
+ "use client";
92
+
93
+ import Link from "next/link";
94
+ import {
95
+ ApplicationShell,
96
+ type ApplicationShellProps,
97
+ } from "@lbenicio/components";
98
+
99
+ export function AppShell(props: Omit<ApplicationShellProps, "linkComponent">) {
100
+ return <ApplicationShell {...props} linkComponent={Link} />;
101
+ }
102
+ ```
103
+
104
+ An app layout can then pass its own branding, Access profile, and route definitions:
105
+
106
+ ```tsx
107
+ <AppShell
108
+ appName="Contact desk"
109
+ storageKey="manager-contact"
110
+ profile={{ name, email, username, picture }}
111
+ navigation={[
112
+ { href: "/", label: "Inbox", activeWhen: ["/", "/contacts"] },
113
+ { href: "/settings/inbound-addresses", label: "Inbound addresses" },
114
+ ]}
115
+ footerNote="Private contact records · Access restricted"
116
+ >
117
+ {children}
118
+ </AppShell>
119
+ ```
120
+
121
+ The profile fields are display-only. Continue to enforce authentication and authorization in the application and API; this UI package does not provide access control.
122
+
123
+ ## Components
124
+
125
+ - `Button`, `Badge`, `Card`, `Modal`, `Notice`, `EmptyState`, and `PageHeader` for common presentation.
126
+ - `FormField`, `TextInput`, `SelectInput`, and `TextArea` for labeled form controls.
127
+ - `FilterBar` and `FilterActions` for URL-backed search and filtering forms.
128
+ - `Table` primitives and `SortableHeader` for semantic, accessible lists.
129
+ - `Pagination` for URL-backed previous/next navigation and result counts.
130
+ - `ApplicationShell` (`ManagerShell` alias) for reusable navigation, theming, and account layout.
131
+
132
+ Components accept native element props where useful. Buttons default to `type="button"`; submit buttons should set `type="submit"`. Sort and pagination URLs are provided by the app so query parameters and routing rules remain owned by the app.
133
+
134
+ ## Development
135
+
136
+ ```sh
137
+ make help
138
+ make deps
139
+ make validate
140
+ make dev
141
+ make preview
142
+ ```
143
+
144
+ `make preview` runs `npm pack --dry-run` to show exactly which files would be published. `make deploy` publishes the package to npm and requires an authenticated npm session. It is not run by CI.
145
+
146
+ ## Releases
147
+
148
+ Use `make release BUMP=patch`, `minor`, or `major` to update the package version and prepare the changelog entry from Git commits since the last version tag. Review the generated entry, then commit and tag the release through the normal repository process. This command does not publish the package.
149
+
150
+ ## License
151
+
152
+ GPL-3.0-only. See [LICENSE.txt](LICENSE.txt).
@@ -0,0 +1,7 @@
1
+ import type { HTMLAttributes } from "react";
2
+ export type BadgeTone = "neutral" | "info" | "success" | "warning" | "danger";
3
+ export interface BadgeProps extends HTMLAttributes<HTMLSpanElement> {
4
+ tone?: BadgeTone;
5
+ }
6
+ export declare function Badge({ className, tone, ...props }: BadgeProps): import("react").JSX.Element;
7
+ //# sourceMappingURL=badge.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"badge.d.ts","sourceRoot":"","sources":["../../src/components/badge.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;AAG5C,MAAM,MAAM,SAAS,GAAG,SAAS,GAAG,MAAM,GAAG,SAAS,GAAG,SAAS,GAAG,QAAQ,CAAC;AAE9E,MAAM,WAAW,UAAW,SAAQ,cAAc,CAAC,eAAe,CAAC;IACjE,IAAI,CAAC,EAAE,SAAS,CAAC;CAClB;AAED,wBAAgB,KAAK,CAAC,EAAE,SAAS,EAAE,IAAgB,EAAE,GAAG,KAAK,EAAE,EAAE,UAAU,+BAO1E"}
@@ -0,0 +1,6 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { classNames } from "../lib/class-names.js";
3
+ export function Badge({ className, tone = "neutral", ...props }) {
4
+ return (_jsx("span", { className: classNames("lbc-badge", `lbc-badge--${tone}`, className), ...props }));
5
+ }
6
+ //# sourceMappingURL=badge.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"badge.js","sourceRoot":"","sources":["../../src/components/badge.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAQnD,MAAM,UAAU,KAAK,CAAC,EAAE,SAAS,EAAE,IAAI,GAAG,SAAS,EAAE,GAAG,KAAK,EAAc;IACzE,OAAO,CACL,eACE,SAAS,EAAE,UAAU,CAAC,WAAW,EAAE,cAAc,IAAI,EAAE,EAAE,SAAS,CAAC,KAC/D,KAAK,GACT,CACH,CAAC;AACJ,CAAC"}
@@ -0,0 +1,9 @@
1
+ import type { ButtonHTMLAttributes } from "react";
2
+ export type ButtonVariant = "primary" | "secondary" | "danger" | "ghost";
3
+ export type ButtonSize = "small" | "medium";
4
+ export interface ButtonProps extends ButtonHTMLAttributes<HTMLButtonElement> {
5
+ variant?: ButtonVariant;
6
+ size?: ButtonSize;
7
+ }
8
+ export declare function Button({ className, size, type, variant, ...props }: ButtonProps): import("react").JSX.Element;
9
+ //# sourceMappingURL=button.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"button.d.ts","sourceRoot":"","sources":["../../src/components/button.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,OAAO,CAAC;AAGlD,MAAM,MAAM,aAAa,GAAG,SAAS,GAAG,WAAW,GAAG,QAAQ,GAAG,OAAO,CAAC;AACzE,MAAM,MAAM,UAAU,GAAG,OAAO,GAAG,QAAQ,CAAC;AAE5C,MAAM,WAAW,WAAY,SAAQ,oBAAoB,CAAC,iBAAiB,CAAC;IAC1E,OAAO,CAAC,EAAE,aAAa,CAAC;IACxB,IAAI,CAAC,EAAE,UAAU,CAAC;CACnB;AAED,wBAAgB,MAAM,CAAC,EACrB,SAAS,EACT,IAAe,EACf,IAAe,EACf,OAAqB,EACrB,GAAG,KAAK,EACT,EAAE,WAAW,+BAab"}
@@ -0,0 +1,6 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { classNames } from "../lib/class-names.js";
3
+ export function Button({ className, size = "medium", type = "button", variant = "secondary", ...props }) {
4
+ return (_jsx("button", { className: classNames("lbc-button", `lbc-button--${variant}`, `lbc-button--${size}`, className), type: type, ...props }));
5
+ }
6
+ //# sourceMappingURL=button.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"button.js","sourceRoot":"","sources":["../../src/components/button.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAUnD,MAAM,UAAU,MAAM,CAAC,EACrB,SAAS,EACT,IAAI,GAAG,QAAQ,EACf,IAAI,GAAG,QAAQ,EACf,OAAO,GAAG,WAAW,EACrB,GAAG,KAAK,EACI;IACZ,OAAO,CACL,iBACE,SAAS,EAAE,UAAU,CACnB,YAAY,EACZ,eAAe,OAAO,EAAE,EACxB,eAAe,IAAI,EAAE,EACrB,SAAS,CACV,EACD,IAAI,EAAE,IAAI,KACN,KAAK,GACT,CACH,CAAC;AACJ,CAAC"}
@@ -0,0 +1,3 @@
1
+ import type { HTMLAttributes } from "react";
2
+ export declare function Card({ className, ...props }: HTMLAttributes<HTMLElement>): import("react").JSX.Element;
3
+ //# sourceMappingURL=card.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"card.d.ts","sourceRoot":"","sources":["../../src/components/card.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;AAG5C,wBAAgB,IAAI,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,cAAc,CAAC,WAAW,CAAC,+BAExE"}
@@ -0,0 +1,6 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { classNames } from "../lib/class-names.js";
3
+ export function Card({ className, ...props }) {
4
+ return _jsx("section", { className: classNames("lbc-card", className), ...props });
5
+ }
6
+ //# sourceMappingURL=card.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"card.js","sourceRoot":"","sources":["../../src/components/card.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAEnD,MAAM,UAAU,IAAI,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAA+B;IACvE,OAAO,kBAAS,SAAS,EAAE,UAAU,CAAC,UAAU,EAAE,SAAS,CAAC,KAAM,KAAK,GAAI,CAAC;AAC9E,CAAC"}
@@ -0,0 +1,17 @@
1
+ import type { HTMLAttributes, ReactNode, ThHTMLAttributes } from "react";
2
+ import { type LinkComponent } from "./link.js";
3
+ export declare function TableContainer({ className, ...props }: HTMLAttributes<HTMLDivElement>): import("react").JSX.Element;
4
+ export declare function Table({ className, ...props }: HTMLAttributes<HTMLTableElement>): import("react").JSX.Element;
5
+ export declare function TableHead({ className, ...props }: HTMLAttributes<HTMLTableSectionElement>): import("react").JSX.Element;
6
+ export declare function TableBody({ className, ...props }: HTMLAttributes<HTMLTableSectionElement>): import("react").JSX.Element;
7
+ export declare function TableRow({ className, ...props }: HTMLAttributes<HTMLTableRowElement>): import("react").JSX.Element;
8
+ export declare function TableCell({ className, ...props }: HTMLAttributes<HTMLTableCellElement>): import("react").JSX.Element;
9
+ export type SortDirection = "ascending" | "descending" | "none";
10
+ export interface SortableHeaderProps extends Omit<ThHTMLAttributes<HTMLTableCellElement>, "children"> {
11
+ direction: SortDirection;
12
+ href: string;
13
+ label: ReactNode;
14
+ linkComponent?: LinkComponent;
15
+ }
16
+ export declare function SortableHeader({ direction, href, label, linkComponent, ...props }: SortableHeaderProps): import("react").JSX.Element;
17
+ //# sourceMappingURL=data-table.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"data-table.d.ts","sourceRoot":"","sources":["../../src/components/data-table.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,SAAS,EAAE,gBAAgB,EAAE,MAAM,OAAO,CAAC;AACzE,OAAO,EAAW,KAAK,aAAa,EAAE,MAAM,WAAW,CAAC;AAGxD,wBAAgB,cAAc,CAAC,EAC7B,SAAS,EACT,GAAG,KAAK,EACT,EAAE,cAAc,CAAC,cAAc,CAAC,+BAIhC;AAED,wBAAgB,KAAK,CAAC,EACpB,SAAS,EACT,GAAG,KAAK,EACT,EAAE,cAAc,CAAC,gBAAgB,CAAC,+BAElC;AAED,wBAAgB,SAAS,CAAC,EACxB,SAAS,EACT,GAAG,KAAK,EACT,EAAE,cAAc,CAAC,uBAAuB,CAAC,+BAEzC;AAED,wBAAgB,SAAS,CAAC,EACxB,SAAS,EACT,GAAG,KAAK,EACT,EAAE,cAAc,CAAC,uBAAuB,CAAC,+BAEzC;AAED,wBAAgB,QAAQ,CAAC,EACvB,SAAS,EACT,GAAG,KAAK,EACT,EAAE,cAAc,CAAC,mBAAmB,CAAC,+BAErC;AAED,wBAAgB,SAAS,CAAC,EACxB,SAAS,EACT,GAAG,KAAK,EACT,EAAE,cAAc,CAAC,oBAAoB,CAAC,+BAEtC;AAED,MAAM,MAAM,aAAa,GAAG,WAAW,GAAG,YAAY,GAAG,MAAM,CAAC;AAEhE,MAAM,WAAW,mBAAoB,SAAQ,IAAI,CAC/C,gBAAgB,CAAC,oBAAoB,CAAC,EACtC,UAAU,CACX;IACC,SAAS,EAAE,aAAa,CAAC;IACzB,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,SAAS,CAAC;IACjB,aAAa,CAAC,EAAE,aAAa,CAAC;CAC/B;AAED,wBAAgB,cAAc,CAAC,EAC7B,SAAS,EACT,IAAI,EACJ,KAAK,EACL,aAAa,EACb,GAAG,KAAK,EACT,EAAE,mBAAmB,+BAmBrB"}
@@ -0,0 +1,27 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { AppLink } from "./link.js";
3
+ import { classNames } from "../lib/class-names.js";
4
+ export function TableContainer({ className, ...props }) {
5
+ return (_jsx("div", { className: classNames("lbc-table-container", className), ...props }));
6
+ }
7
+ export function Table({ className, ...props }) {
8
+ return _jsx("table", { className: classNames("lbc-table", className), ...props });
9
+ }
10
+ export function TableHead({ className, ...props }) {
11
+ return _jsx("thead", { className: className, ...props });
12
+ }
13
+ export function TableBody({ className, ...props }) {
14
+ return _jsx("tbody", { className: className, ...props });
15
+ }
16
+ export function TableRow({ className, ...props }) {
17
+ return _jsx("tr", { className: className, ...props });
18
+ }
19
+ export function TableCell({ className, ...props }) {
20
+ return _jsx("td", { className: className, ...props });
21
+ }
22
+ export function SortableHeader({ direction, href, label, linkComponent, ...props }) {
23
+ const ariaLabel = `Sort by ${typeof label === "string" ? label : "column"}${direction === "none" ? "" : `, ${direction}`}`;
24
+ const indicator = direction === "ascending" ? "↑" : direction === "descending" ? "↓" : "↕";
25
+ return (_jsx("th", { "aria-sort": direction, scope: "col", ...props, children: _jsxs(AppLink, { "aria-label": ariaLabel, className: "lbc-sort-link", component: linkComponent, href: href, children: [label, _jsx("span", { "aria-hidden": "true", className: "lbc-sort-indicator", children: indicator })] }) }));
26
+ }
27
+ //# sourceMappingURL=data-table.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"data-table.js","sourceRoot":"","sources":["../../src/components/data-table.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,OAAO,EAAsB,MAAM,WAAW,CAAC;AACxD,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAEnD,MAAM,UAAU,cAAc,CAAC,EAC7B,SAAS,EACT,GAAG,KAAK,EACuB;IAC/B,OAAO,CACL,cAAK,SAAS,EAAE,UAAU,CAAC,qBAAqB,EAAE,SAAS,CAAC,KAAM,KAAK,GAAI,CAC5E,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,KAAK,CAAC,EACpB,SAAS,EACT,GAAG,KAAK,EACyB;IACjC,OAAO,gBAAO,SAAS,EAAE,UAAU,CAAC,WAAW,EAAE,SAAS,CAAC,KAAM,KAAK,GAAI,CAAC;AAC7E,CAAC;AAED,MAAM,UAAU,SAAS,CAAC,EACxB,SAAS,EACT,GAAG,KAAK,EACgC;IACxC,OAAO,gBAAO,SAAS,EAAE,SAAS,KAAM,KAAK,GAAI,CAAC;AACpD,CAAC;AAED,MAAM,UAAU,SAAS,CAAC,EACxB,SAAS,EACT,GAAG,KAAK,EACgC;IACxC,OAAO,gBAAO,SAAS,EAAE,SAAS,KAAM,KAAK,GAAI,CAAC;AACpD,CAAC;AAED,MAAM,UAAU,QAAQ,CAAC,EACvB,SAAS,EACT,GAAG,KAAK,EAC4B;IACpC,OAAO,aAAI,SAAS,EAAE,SAAS,KAAM,KAAK,GAAI,CAAC;AACjD,CAAC;AAED,MAAM,UAAU,SAAS,CAAC,EACxB,SAAS,EACT,GAAG,KAAK,EAC6B;IACrC,OAAO,aAAI,SAAS,EAAE,SAAS,KAAM,KAAK,GAAI,CAAC;AACjD,CAAC;AAcD,MAAM,UAAU,cAAc,CAAC,EAC7B,SAAS,EACT,IAAI,EACJ,KAAK,EACL,aAAa,EACb,GAAG,KAAK,EACY;IACpB,MAAM,SAAS,GAAG,WAAW,OAAO,KAAK,KAAK,QAAQ,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,QAAQ,GAAG,SAAS,KAAK,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,KAAK,SAAS,EAAE,EAAE,CAAC;IAC3H,MAAM,SAAS,GACb,SAAS,KAAK,WAAW,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,SAAS,KAAK,YAAY,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC;IAC3E,OAAO,CACL,0BAAe,SAAS,EAAE,KAAK,EAAC,KAAK,KAAK,KAAK,YAC7C,MAAC,OAAO,kBACM,SAAS,EACrB,SAAS,EAAC,eAAe,EACzB,SAAS,EAAE,aAAa,EACxB,IAAI,EAAE,IAAI,aAET,KAAK,EACN,8BAAkB,MAAM,EAAC,SAAS,EAAC,oBAAoB,YACpD,SAAS,GACL,IACC,GACP,CACN,CAAC;AACJ,CAAC"}
@@ -0,0 +1,9 @@
1
+ import type { ReactNode } from "react";
2
+ export interface EmptyStateProps {
3
+ title: string;
4
+ description?: ReactNode;
5
+ icon?: ReactNode;
6
+ action?: ReactNode;
7
+ }
8
+ export declare function EmptyState({ action, description, icon, title, }: EmptyStateProps): import("react").JSX.Element;
9
+ //# sourceMappingURL=empty-state.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"empty-state.d.ts","sourceRoot":"","sources":["../../src/components/empty-state.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEvC,MAAM,WAAW,eAAe;IAC9B,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,CAAC,EAAE,SAAS,CAAC;IACxB,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB,MAAM,CAAC,EAAE,SAAS,CAAC;CACpB;AAED,wBAAgB,UAAU,CAAC,EACzB,MAAM,EACN,WAAW,EACX,IAAI,EACJ,KAAK,GACN,EAAE,eAAe,+BAajB"}
@@ -0,0 +1,5 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ export function EmptyState({ action, description, icon, title, }) {
3
+ return (_jsxs("section", { "aria-label": title, className: "lbc-empty-state", children: [icon && (_jsx("div", { className: "lbc-empty-icon", "aria-hidden": "true", children: icon })), _jsx("h2", { children: title }), description && _jsx("p", { children: description }), action && _jsx("div", { className: "lbc-empty-action", children: action })] }));
4
+ }
5
+ //# sourceMappingURL=empty-state.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"empty-state.js","sourceRoot":"","sources":["../../src/components/empty-state.tsx"],"names":[],"mappings":";AASA,MAAM,UAAU,UAAU,CAAC,EACzB,MAAM,EACN,WAAW,EACX,IAAI,EACJ,KAAK,GACW;IAChB,OAAO,CACL,iCAAqB,KAAK,EAAE,SAAS,EAAC,iBAAiB,aACpD,IAAI,IAAI,CACP,cAAK,SAAS,EAAC,gBAAgB,iBAAa,MAAM,YAC/C,IAAI,GACD,CACP,EACD,uBAAK,KAAK,GAAM,EACf,WAAW,IAAI,sBAAI,WAAW,GAAK,EACnC,MAAM,IAAI,cAAK,SAAS,EAAC,kBAAkB,YAAE,MAAM,GAAO,IACnD,CACX,CAAC;AACJ,CAAC"}
@@ -0,0 +1,8 @@
1
+ import type { FormHTMLAttributes, HTMLAttributes, ReactNode } from "react";
2
+ export interface FilterBarProps extends FormHTMLAttributes<HTMLFormElement> {
3
+ children: ReactNode;
4
+ summary?: ReactNode;
5
+ }
6
+ export declare function FilterBar({ children, className, summary, ...props }: FilterBarProps): import("react").JSX.Element;
7
+ export declare function FilterActions({ children, className, ...props }: HTMLAttributes<HTMLDivElement>): import("react").JSX.Element;
8
+ //# sourceMappingURL=filter-bar.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"filter-bar.d.ts","sourceRoot":"","sources":["../../src/components/filter-bar.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAG3E,MAAM,WAAW,cAAe,SAAQ,kBAAkB,CAAC,eAAe,CAAC;IACzE,QAAQ,EAAE,SAAS,CAAC;IACpB,OAAO,CAAC,EAAE,SAAS,CAAC;CACrB;AAED,wBAAgB,SAAS,CAAC,EACxB,QAAQ,EACR,SAAS,EACT,OAAO,EACP,GAAG,KAAK,EACT,EAAE,cAAc,+BAOhB;AAED,wBAAgB,aAAa,CAAC,EAC5B,QAAQ,EACR,SAAS,EACT,GAAG,KAAK,EACT,EAAE,cAAc,CAAC,cAAc,CAAC,+BAMhC"}
@@ -0,0 +1,9 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { classNames } from "../lib/class-names.js";
3
+ export function FilterBar({ children, className, summary, ...props }) {
4
+ return (_jsxs("form", { className: classNames("lbc-filter-bar", className), ...props, children: [_jsx("div", { className: "lbc-filter-fields", children: children }), summary && _jsx("p", { className: "lbc-filter-summary", children: summary })] }));
5
+ }
6
+ export function FilterActions({ children, className, ...props }) {
7
+ return (_jsx("div", { className: classNames("lbc-filter-actions", className), ...props, children: children }));
8
+ }
9
+ //# sourceMappingURL=filter-bar.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"filter-bar.js","sourceRoot":"","sources":["../../src/components/filter-bar.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAOnD,MAAM,UAAU,SAAS,CAAC,EACxB,QAAQ,EACR,SAAS,EACT,OAAO,EACP,GAAG,KAAK,EACO;IACf,OAAO,CACL,gBAAM,SAAS,EAAE,UAAU,CAAC,gBAAgB,EAAE,SAAS,CAAC,KAAM,KAAK,aACjE,cAAK,SAAS,EAAC,mBAAmB,YAAE,QAAQ,GAAO,EAClD,OAAO,IAAI,YAAG,SAAS,EAAC,oBAAoB,YAAE,OAAO,GAAK,IACtD,CACR,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,aAAa,CAAC,EAC5B,QAAQ,EACR,SAAS,EACT,GAAG,KAAK,EACuB;IAC/B,OAAO,CACL,cAAK,SAAS,EAAE,UAAU,CAAC,oBAAoB,EAAE,SAAS,CAAC,KAAM,KAAK,YACnE,QAAQ,GACL,CACP,CAAC;AACJ,CAAC"}
@@ -0,0 +1,13 @@
1
+ import type { InputHTMLAttributes, ReactNode, SelectHTMLAttributes, TextareaHTMLAttributes } from "react";
2
+ export interface FormFieldProps {
3
+ children: ReactNode;
4
+ description?: ReactNode;
5
+ error?: ReactNode;
6
+ htmlFor?: string;
7
+ label: ReactNode;
8
+ }
9
+ export declare function FormField({ children, description, error, htmlFor, label, }: FormFieldProps): import("react").JSX.Element;
10
+ export declare function TextInput({ className, ...props }: InputHTMLAttributes<HTMLInputElement>): import("react").JSX.Element;
11
+ export declare function SelectInput({ className, ...props }: SelectHTMLAttributes<HTMLSelectElement>): import("react").JSX.Element;
12
+ export declare function TextArea({ className, ...props }: TextareaHTMLAttributes<HTMLTextAreaElement>): import("react").JSX.Element;
13
+ //# sourceMappingURL=form-field.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"form-field.d.ts","sourceRoot":"","sources":["../../src/components/form-field.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,mBAAmB,EACnB,SAAS,EACT,oBAAoB,EACpB,sBAAsB,EACvB,MAAM,OAAO,CAAC;AAGf,MAAM,WAAW,cAAc;IAC7B,QAAQ,EAAE,SAAS,CAAC;IACpB,WAAW,CAAC,EAAE,SAAS,CAAC;IACxB,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,KAAK,EAAE,SAAS,CAAC;CAClB;AAED,wBAAgB,SAAS,CAAC,EACxB,QAAQ,EACR,WAAW,EACX,KAAK,EACL,OAAO,EACP,KAAK,GACN,EAAE,cAAc,+BAoBhB;AAED,wBAAgB,SAAS,CAAC,EACxB,SAAS,EACT,GAAG,KAAK,EACT,EAAE,mBAAmB,CAAC,gBAAgB,CAAC,+BAEvC;AAED,wBAAgB,WAAW,CAAC,EAC1B,SAAS,EACT,GAAG,KAAK,EACT,EAAE,oBAAoB,CAAC,iBAAiB,CAAC,+BAEzC;AAED,wBAAgB,QAAQ,CAAC,EACvB,SAAS,EACT,GAAG,KAAK,EACT,EAAE,sBAAsB,CAAC,mBAAmB,CAAC,+BAO7C"}
@@ -0,0 +1,15 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { classNames } from "../lib/class-names.js";
3
+ export function FormField({ children, description, error, htmlFor, label, }) {
4
+ return (_jsxs("div", { className: classNames("lbc-field", error ? "lbc-field--invalid" : undefined), children: [_jsx("label", { className: "lbc-field-label", htmlFor: htmlFor, children: label }), description && _jsx("p", { className: "lbc-field-description", children: description }), children, error && (_jsx("p", { className: "lbc-field-error", role: "alert", children: error }))] }));
5
+ }
6
+ export function TextInput({ className, ...props }) {
7
+ return _jsx("input", { className: classNames("lbc-input", className), ...props });
8
+ }
9
+ export function SelectInput({ className, ...props }) {
10
+ return _jsx("select", { className: classNames("lbc-input", className), ...props });
11
+ }
12
+ export function TextArea({ className, ...props }) {
13
+ return (_jsx("textarea", { className: classNames("lbc-input", "lbc-textarea", className), ...props }));
14
+ }
15
+ //# sourceMappingURL=form-field.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"form-field.js","sourceRoot":"","sources":["../../src/components/form-field.tsx"],"names":[],"mappings":";AAMA,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAUnD,MAAM,UAAU,SAAS,CAAC,EACxB,QAAQ,EACR,WAAW,EACX,KAAK,EACL,OAAO,EACP,KAAK,GACU;IACf,OAAO,CACL,eACE,SAAS,EAAE,UAAU,CACnB,WAAW,EACX,KAAK,CAAC,CAAC,CAAC,oBAAoB,CAAC,CAAC,CAAC,SAAS,CACzC,aAED,gBAAO,SAAS,EAAC,iBAAiB,EAAC,OAAO,EAAE,OAAO,YAChD,KAAK,GACA,EACP,WAAW,IAAI,YAAG,SAAS,EAAC,uBAAuB,YAAE,WAAW,GAAK,EACrE,QAAQ,EACR,KAAK,IAAI,CACR,YAAG,SAAS,EAAC,iBAAiB,EAAC,IAAI,EAAC,OAAO,YACxC,KAAK,GACJ,CACL,IACG,CACP,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,SAAS,CAAC,EACxB,SAAS,EACT,GAAG,KAAK,EAC8B;IACtC,OAAO,gBAAO,SAAS,EAAE,UAAU,CAAC,WAAW,EAAE,SAAS,CAAC,KAAM,KAAK,GAAI,CAAC;AAC7E,CAAC;AAED,MAAM,UAAU,WAAW,CAAC,EAC1B,SAAS,EACT,GAAG,KAAK,EACgC;IACxC,OAAO,iBAAQ,SAAS,EAAE,UAAU,CAAC,WAAW,EAAE,SAAS,CAAC,KAAM,KAAK,GAAI,CAAC;AAC9E,CAAC;AAED,MAAM,UAAU,QAAQ,CAAC,EACvB,SAAS,EACT,GAAG,KAAK,EACoC;IAC5C,OAAO,CACL,mBACE,SAAS,EAAE,UAAU,CAAC,WAAW,EAAE,cAAc,EAAE,SAAS,CAAC,KACzD,KAAK,GACT,CACH,CAAC;AACJ,CAAC"}
@@ -0,0 +1,16 @@
1
+ import { type ComponentType, type MouseEventHandler, type ReactNode } from "react";
2
+ export interface LinkProps {
3
+ href: string;
4
+ className?: string;
5
+ children?: ReactNode;
6
+ "aria-label"?: string;
7
+ "aria-current"?: "page";
8
+ rel?: string;
9
+ title?: string;
10
+ onClick?: MouseEventHandler<HTMLAnchorElement>;
11
+ }
12
+ export type LinkComponent = ComponentType<LinkProps>;
13
+ export declare function AppLink({ component, ...props }: LinkProps & {
14
+ component?: LinkComponent;
15
+ }): import("react").JSX.Element;
16
+ //# sourceMappingURL=link.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"link.d.ts","sourceRoot":"","sources":["../../src/components/link.tsx"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,aAAa,EAClB,KAAK,iBAAiB,EACtB,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AAEf,MAAM,WAAW,SAAS;IACxB,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,iBAAiB,CAAC,iBAAiB,CAAC,CAAC;CAChD;AAED,MAAM,MAAM,aAAa,GAAG,aAAa,CAAC,SAAS,CAAC,CAAC;AAErD,wBAAgB,OAAO,CAAC,EACtB,SAAS,EACT,GAAG,KAAK,EACT,EAAE,SAAS,GAAG;IAAE,SAAS,CAAC,EAAE,aAAa,CAAA;CAAE,+BAG3C"}
@@ -0,0 +1,8 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { createElement, } from "react";
3
+ export function AppLink({ component, ...props }) {
4
+ if (component)
5
+ return createElement(component, props);
6
+ return _jsx("a", { ...props });
7
+ }
8
+ //# sourceMappingURL=link.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"link.js","sourceRoot":"","sources":["../../src/components/link.tsx"],"names":[],"mappings":";AAAA,OAAO,EACL,aAAa,GAId,MAAM,OAAO,CAAC;AAef,MAAM,UAAU,OAAO,CAAC,EACtB,SAAS,EACT,GAAG,KAAK,EACkC;IAC1C,IAAI,SAAS;QAAE,OAAO,aAAa,CAAC,SAAS,EAAE,KAAK,CAAC,CAAC;IACtD,OAAO,eAAO,KAAK,GAAI,CAAC;AAC1B,CAAC"}
@@ -0,0 +1,33 @@
1
+ import { type ReactNode } from "react";
2
+ import { type LinkComponent } from "./link.js";
3
+ export type ThemeMode = "light" | "dark" | "system";
4
+ export interface ManagerProfile {
5
+ name: string;
6
+ email?: string | null;
7
+ username?: string | null;
8
+ picture?: string | null;
9
+ }
10
+ export interface ManagerNavigationItem {
11
+ href: string;
12
+ label: string;
13
+ icon?: ReactNode;
14
+ activeWhen?: readonly string[];
15
+ }
16
+ export interface ApplicationShellProps {
17
+ appName: string;
18
+ activePath?: string;
19
+ children: ReactNode;
20
+ footer?: ReactNode;
21
+ footerNote?: ReactNode;
22
+ headerNavigation?: readonly ManagerNavigationItem[];
23
+ linkComponent?: LinkComponent;
24
+ mark?: ReactNode;
25
+ navigation: readonly ManagerNavigationItem[];
26
+ profile: ManagerProfile;
27
+ storageKey: string;
28
+ subtitle?: string;
29
+ }
30
+ export type ManagerShellProps = ApplicationShellProps;
31
+ export declare function ApplicationShell({ activePath, appName, children, footer, footerNote, headerNavigation, linkComponent, mark, navigation, profile, storageKey, subtitle, }: ApplicationShellProps): import("react").JSX.Element;
32
+ export declare const ManagerShell: typeof ApplicationShell;
33
+ //# sourceMappingURL=manager-shell.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"manager-shell.d.ts","sourceRoot":"","sources":["../../src/components/manager-shell.tsx"],"names":[],"mappings":"AAEA,OAAO,EAOL,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AAEf,OAAO,EAAW,KAAK,aAAa,EAAE,MAAM,WAAW,CAAC;AAExD,MAAM,MAAM,SAAS,GAAG,OAAO,GAAG,MAAM,GAAG,QAAQ,CAAC;AAEpD,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CACzB;AAED,MAAM,WAAW,qBAAqB;IACpC,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB,UAAU,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;CAChC;AAED,MAAM,WAAW,qBAAqB;IACpC,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,SAAS,CAAC;IACpB,MAAM,CAAC,EAAE,SAAS,CAAC;IACnB,UAAU,CAAC,EAAE,SAAS,CAAC;IACvB,gBAAgB,CAAC,EAAE,SAAS,qBAAqB,EAAE,CAAC;IACpD,aAAa,CAAC,EAAE,aAAa,CAAC;IAC9B,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB,UAAU,EAAE,SAAS,qBAAqB,EAAE,CAAC;IAC7C,OAAO,EAAE,cAAc,CAAC;IACxB,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,MAAM,iBAAiB,GAAG,qBAAqB,CAAC;AAwFtD,wBAAgB,gBAAgB,CAAC,EAC/B,UAAU,EACV,OAAO,EACP,QAAQ,EACR,MAAM,EACN,UAAU,EACV,gBAAgB,EAChB,aAAa,EACb,IAAI,EACJ,UAAU,EACV,OAAO,EACP,UAAU,EACV,QAAmC,GACpC,EAAE,qBAAqB,+BA+OvB;AAED,eAAO,MAAM,YAAY,yBAAmB,CAAC"}
@@ -0,0 +1,143 @@
1
+ "use client";
2
+ import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
+ import { useEffect, useId, useState, } from "react";
4
+ import { classNames } from "../lib/class-names.js";
5
+ import { AppLink } from "./link.js";
6
+ const MIN_WIDTH = 200;
7
+ const MAX_WIDTH = 380;
8
+ const DEFAULT_WIDTH = 260;
9
+ function clampWidth(width) {
10
+ return Math.min(MAX_WIDTH, Math.max(MIN_WIDTH, width));
11
+ }
12
+ function readTheme(value) {
13
+ return value === "light" || value === "dark" ? value : "system";
14
+ }
15
+ function applyTheme(mode) {
16
+ const prefersDark = window.matchMedia("(prefers-color-scheme: dark)").matches;
17
+ document.documentElement.dataset.theme =
18
+ mode === "system" ? (prefersDark ? "dark" : "light") : mode;
19
+ }
20
+ function isActive(pathname, item) {
21
+ const matches = item.activeWhen ?? [item.href];
22
+ return matches.some((path) => path === "/"
23
+ ? pathname === "/"
24
+ : pathname === path || pathname.startsWith(`${path}/`));
25
+ }
26
+ function initials(profile) {
27
+ return (profile.name.trim()[0] ||
28
+ profile.email?.trim()[0] ||
29
+ "A").toUpperCase();
30
+ }
31
+ function NavigationLink({ collapsed = false, item, linkComponent, onNavigate, pathname, variant, }) {
32
+ const active = isActive(pathname, item);
33
+ return (_jsxs(AppLink, { "aria-label": variant === "sidebar" && collapsed ? item.label : undefined, "aria-current": active ? "page" : undefined, className: classNames(`lbc-nav-link`, `lbc-nav-link--${variant}`, active ? "is-active" : undefined), component: linkComponent, href: item.href, onClick: (event) => {
34
+ if (event.defaultPrevented ||
35
+ event.button !== 0 ||
36
+ event.metaKey ||
37
+ event.ctrlKey ||
38
+ event.shiftKey ||
39
+ event.altKey) {
40
+ return;
41
+ }
42
+ onNavigate?.(item.href);
43
+ }, children: [(item.icon || collapsed) && (_jsx("span", { "aria-hidden": "true", className: "lbc-nav-icon", children: item.icon ?? item.label.trim().charAt(0).toUpperCase() })), _jsx("span", { className: "lbc-nav-label", children: item.label })] }));
44
+ }
45
+ export function ApplicationShell({ activePath, appName, children, footer, footerNote, headerNavigation, linkComponent, mark, navigation, profile, storageKey, subtitle = "Private administration", }) {
46
+ const [sidebarWidth, setSidebarWidth] = useState(DEFAULT_WIDTH);
47
+ const [sidebarCollapsed, setSidebarCollapsed] = useState(false);
48
+ const [theme, setTheme] = useState("system");
49
+ const [resizing, setResizing] = useState(false);
50
+ const [pathname, setPathname] = useState("");
51
+ const widthKey = `lbc:${storageKey}:sidebar-width`;
52
+ const collapsedKey = `lbc:${storageKey}:sidebar-collapsed`;
53
+ const themeKey = `lbc:${storageKey}:theme`;
54
+ const sidebarId = useId();
55
+ useEffect(() => {
56
+ const syncPathname = () => setPathname(window.location.pathname);
57
+ syncPathname();
58
+ window.addEventListener("popstate", syncPathname);
59
+ try {
60
+ const storedWidth = Number(window.localStorage.getItem(widthKey));
61
+ if (Number.isFinite(storedWidth) && storedWidth > 0)
62
+ setSidebarWidth(clampWidth(storedWidth));
63
+ setSidebarCollapsed(window.localStorage.getItem(collapsedKey) === "true");
64
+ const storedTheme = readTheme(window.localStorage.getItem(themeKey));
65
+ setTheme(storedTheme);
66
+ applyTheme(storedTheme);
67
+ }
68
+ catch {
69
+ applyTheme("system");
70
+ }
71
+ return () => window.removeEventListener("popstate", syncPathname);
72
+ }, [collapsedKey, themeKey, widthKey]);
73
+ useEffect(() => {
74
+ if (theme !== "system")
75
+ return;
76
+ const media = window.matchMedia("(prefers-color-scheme: dark)");
77
+ const update = () => applyTheme("system");
78
+ media.addEventListener("change", update);
79
+ return () => media.removeEventListener("change", update);
80
+ }, [theme]);
81
+ function saveWidth(clientX) {
82
+ const width = clampWidth(clientX);
83
+ setSidebarWidth(width);
84
+ try {
85
+ window.localStorage.setItem(widthKey, String(width));
86
+ }
87
+ catch {
88
+ // The current page remains resizable if storage is unavailable.
89
+ }
90
+ }
91
+ function chooseTheme(mode) {
92
+ setTheme(mode);
93
+ applyTheme(mode);
94
+ try {
95
+ window.localStorage.setItem(themeKey, mode);
96
+ }
97
+ catch {
98
+ // The selected appearance still applies for this page session.
99
+ }
100
+ }
101
+ function toggleSidebar() {
102
+ const next = !sidebarCollapsed;
103
+ setSidebarCollapsed(next);
104
+ try {
105
+ window.localStorage.setItem(collapsedKey, String(next));
106
+ }
107
+ catch {
108
+ // The sidebar remains usable if browser storage is unavailable.
109
+ }
110
+ }
111
+ function startResize(event) {
112
+ if (window.innerWidth <= 640)
113
+ return;
114
+ event.preventDefault();
115
+ event.currentTarget.setPointerCapture(event.pointerId);
116
+ setResizing(true);
117
+ }
118
+ function keyboardResize(event) {
119
+ if (event.key !== "ArrowLeft" && event.key !== "ArrowRight")
120
+ return;
121
+ event.preventDefault();
122
+ saveWidth(sidebarWidth + (event.key === "ArrowRight" ? 16 : -16));
123
+ }
124
+ const style = { "--lbc-sidebar-width": `${sidebarWidth}px` };
125
+ const displayName = profile.name.trim() || profile.email || "Account";
126
+ const currentPath = activePath ?? pathname;
127
+ const handleNavigate = (href) => {
128
+ try {
129
+ setPathname(new URL(href, window.location.href).pathname);
130
+ }
131
+ catch {
132
+ setPathname(href);
133
+ }
134
+ };
135
+ return (_jsxs("div", { className: classNames("lbc-shell", sidebarCollapsed ? "is-collapsed" : undefined), style: style, children: [_jsxs("aside", { "aria-label": `${appName} sidebar`, className: "lbc-sidebar", id: sidebarId, children: [_jsxs(AppLink, { className: "lbc-brand", component: linkComponent, href: "/", children: [_jsx("span", { className: "lbc-brand-mark", children: mark ?? appName.trim()[0]?.toUpperCase() }), _jsxs("span", { children: [_jsx("strong", { children: appName }), _jsx("small", { children: subtitle })] })] }), _jsx("nav", { "aria-label": "Main navigation", className: "lbc-side-navigation", children: navigation.map((item) => (_jsx(NavigationLink, { item: item, linkComponent: linkComponent, onNavigate: handleNavigate, pathname: currentPath, collapsed: sidebarCollapsed, variant: "sidebar" }, item.href))) }), _jsx("div", { className: "lbc-sidebar-footer", children: _jsx("button", { "aria-controls": sidebarId, "aria-expanded": !sidebarCollapsed, "aria-label": sidebarCollapsed ? "Expand sidebar" : "Collapse sidebar", className: "lbc-sidebar-toggle", onClick: toggleSidebar, title: sidebarCollapsed ? "Expand sidebar" : "Collapse sidebar", type: "button", children: _jsx("span", { "aria-hidden": "true", children: sidebarCollapsed ? "»" : "«" }) }) }), _jsx("div", { "aria-label": "Resize sidebar", "aria-orientation": "vertical", "aria-valuemax": MAX_WIDTH, "aria-valuemin": MIN_WIDTH, "aria-valuenow": sidebarWidth, className: classNames("lbc-sidebar-resizer", resizing ? "is-resizing" : undefined), onKeyDown: keyboardResize, onLostPointerCapture: () => setResizing(false), onPointerCancel: () => setResizing(false), onPointerDown: startResize, onPointerMove: (event) => {
136
+ if (resizing)
137
+ saveWidth(event.clientX);
138
+ }, onPointerUp: () => setResizing(false), role: "separator", tabIndex: 0, title: "Drag to resize; use the arrow keys to adjust" })] }), _jsxs("main", { className: "lbc-main", children: [_jsxs("header", { className: "lbc-topbar", children: [headerNavigation && (_jsx("nav", { "aria-label": "Primary navigation", className: "lbc-header-navigation", children: headerNavigation.map((item) => (_jsx(NavigationLink, { item: item, linkComponent: linkComponent, onNavigate: handleNavigate, pathname: currentPath, variant: "header" }, item.href))) })), _jsxs("div", { className: "lbc-user-controls", children: [_jsx("div", { "aria-label": "Color theme", className: "lbc-header-theme-picker", role: "group", children: ["light", "dark", "system"].map((mode) => (_jsx("button", { "aria-label": `${mode[0]?.toUpperCase()}${mode.slice(1)} theme`, "aria-pressed": theme === mode, className: "lbc-header-theme-option", onClick: () => chooseTheme(mode), title: `${mode[0]?.toUpperCase()}${mode.slice(1)} theme`, type: "button", children: _jsx("span", { "aria-hidden": "true", children: mode === "light" ? "☼" : mode === "dark" ? "☾" : "◐" }) }, mode))) }), _jsxs("div", { className: "lbc-account", title: profile.username || undefined, children: [_jsxs("span", { "aria-hidden": "true", className: "lbc-avatar", children: [_jsx("span", { className: "lbc-avatar-fallback", children: initials(profile) }), profile.picture && (_jsx("img", { alt: "", className: "lbc-avatar-image", referrerPolicy: "no-referrer", src: profile.picture, onError: (event) => {
139
+ event.currentTarget.hidden = true;
140
+ } }))] }), _jsxs("span", { className: "lbc-account-details", children: [_jsx("strong", { children: displayName }), profile.email && _jsx("small", { children: profile.email })] })] })] })] }), _jsx("div", { className: "lbc-content", children: children }), _jsx("footer", { className: "lbc-footer", children: footer ?? (_jsxs(_Fragment, { children: [footerNote && _jsx("span", { children: footerNote }), _jsxs("span", { children: ["\u00A9 ", new Date().getFullYear()] })] })) })] })] }));
141
+ }
142
+ export const ManagerShell = ApplicationShell;
143
+ //# sourceMappingURL=manager-shell.js.map