@team6083/ui 0.0.0-stage → 0.1.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/LICENSE +202 -0
- package/README.md +211 -2
- package/dist/blocks/api-error-message.d.ts +11 -0
- package/dist/blocks/api-error-message.d.ts.map +1 -0
- package/dist/blocks/api-error-message.js +29 -0
- package/dist/blocks/api-error-message.js.map +1 -0
- package/dist/blocks/app-commit.d.ts +35 -0
- package/dist/blocks/app-commit.d.ts.map +1 -0
- package/dist/blocks/app-commit.js +66 -0
- package/dist/blocks/app-commit.js.map +1 -0
- package/dist/blocks/app-shell.d.ts +99 -0
- package/dist/blocks/app-shell.d.ts.map +1 -0
- package/dist/blocks/app-shell.js +56 -0
- package/dist/blocks/app-shell.js.map +1 -0
- package/dist/blocks/config-error-page.d.ts +8 -0
- package/dist/blocks/config-error-page.d.ts.map +1 -0
- package/dist/blocks/config-error-page.js +21 -0
- package/dist/blocks/config-error-page.js.map +1 -0
- package/dist/blocks/data-parts.d.ts +57 -0
- package/dist/blocks/data-parts.d.ts.map +1 -0
- package/dist/blocks/data-parts.js +30 -0
- package/dist/blocks/data-parts.js.map +1 -0
- package/dist/blocks/data-table.d.ts +56 -0
- package/dist/blocks/data-table.d.ts.map +1 -0
- package/dist/blocks/data-table.js +93 -0
- package/dist/blocks/data-table.js.map +1 -0
- package/dist/blocks/member-avatar.d.ts +12 -0
- package/dist/blocks/member-avatar.d.ts.map +1 -0
- package/dist/blocks/member-avatar.js +14 -0
- package/dist/blocks/member-avatar.js.map +1 -0
- package/dist/blocks/no-access-page.d.ts +9 -0
- package/dist/blocks/no-access-page.d.ts.map +1 -0
- package/dist/blocks/no-access-page.js +15 -0
- package/dist/blocks/no-access-page.js.map +1 -0
- package/dist/blocks/page-parts.d.ts +41 -0
- package/dist/blocks/page-parts.d.ts.map +1 -0
- package/dist/blocks/page-parts.js +24 -0
- package/dist/blocks/page-parts.js.map +1 -0
- package/dist/blocks/runtime-config.d.ts +20 -0
- package/dist/blocks/runtime-config.d.ts.map +1 -0
- package/dist/blocks/runtime-config.js +39 -0
- package/dist/blocks/runtime-config.js.map +1 -0
- package/dist/blocks/status-page.d.ts +12 -0
- package/dist/blocks/status-page.d.ts.map +1 -0
- package/dist/blocks/status-page.js +8 -0
- package/dist/blocks/status-page.js.map +1 -0
- package/dist/chakra/color-mode.d.ts +26 -0
- package/dist/chakra/color-mode.d.ts.map +1 -0
- package/dist/chakra/color-mode.js +55 -0
- package/dist/chakra/color-mode.js.map +1 -0
- package/dist/chakra/toaster.d.ts +3 -0
- package/dist/chakra/toaster.d.ts.map +1 -0
- package/dist/chakra/toaster.js +11 -0
- package/dist/chakra/toaster.js.map +1 -0
- package/dist/chakra/toggle-tip.d.ts +15 -0
- package/dist/chakra/toggle-tip.d.ts.map +1 -0
- package/dist/chakra/toggle-tip.js +14 -0
- package/dist/chakra/toggle-tip.js.map +1 -0
- package/dist/chakra/tooltip.d.ts +12 -0
- package/dist/chakra/tooltip.d.ts.map +1 -0
- package/dist/chakra/tooltip.js +11 -0
- package/dist/chakra/tooltip.js.map +1 -0
- package/dist/i18n.d.ts +50 -0
- package/dist/i18n.d.ts.map +1 -0
- package/dist/i18n.js +107 -0
- package/dist/i18n.js.map +1 -0
- package/dist/index.d.ts +22 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +28 -0
- package/dist/index.js.map +1 -0
- package/dist/lib/api-error.d.ts +25 -0
- package/dist/lib/api-error.d.ts.map +1 -0
- package/dist/lib/api-error.js +77 -0
- package/dist/lib/api-error.js.map +1 -0
- package/dist/lib/commit.d.ts +11 -0
- package/dist/lib/commit.d.ts.map +1 -0
- package/dist/lib/commit.js +27 -0
- package/dist/lib/commit.js.map +1 -0
- package/dist/lib/runtime-config.d.ts +33 -0
- package/dist/lib/runtime-config.d.ts.map +1 -0
- package/dist/lib/runtime-config.js +78 -0
- package/dist/lib/runtime-config.js.map +1 -0
- package/dist/provider.d.ts +11 -0
- package/dist/provider.d.ts.map +1 -0
- package/dist/provider.js +11 -0
- package/dist/provider.js.map +1 -0
- package/dist/theme.d.ts +2 -0
- package/dist/theme.d.ts.map +1 -0
- package/dist/theme.js +38 -0
- package/dist/theme.js.map +1 -0
- package/package.json +74 -4
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
import { type ContainerProps } from "@chakra-ui/react";
|
|
2
|
+
import { type ReactElement, type ReactNode } from "react";
|
|
3
|
+
/**
|
|
4
|
+
* Renders a client-side link around `children`. Next.js:
|
|
5
|
+
* `(href, children) => <NextLink href={href}>{children}</NextLink>`; react-router:
|
|
6
|
+
* `(href, children) => <Link to={href}>{children}</Link>`. Defaults to a plain <a>.
|
|
7
|
+
*/
|
|
8
|
+
export type RenderLink = (href: string, children: ReactNode) => ReactElement;
|
|
9
|
+
export interface NavItem {
|
|
10
|
+
href: string;
|
|
11
|
+
label: ReactNode;
|
|
12
|
+
/** A react-icons icon, shown before the label. */
|
|
13
|
+
icon?: ReactNode;
|
|
14
|
+
/** The page the user is on; shown highlighted and marked aria-current. */
|
|
15
|
+
active?: boolean;
|
|
16
|
+
}
|
|
17
|
+
/** Other Container props (padding, margins) go to the content area, `<main>`. */
|
|
18
|
+
export interface AppShellProps extends Omit<ContainerProps, "title"> {
|
|
19
|
+
/** The app's name, linking home. */
|
|
20
|
+
appName: ReactNode;
|
|
21
|
+
/** The organization's display name, from configuration (never hard-coded). */
|
|
22
|
+
orgName?: ReactNode;
|
|
23
|
+
homeHref?: string;
|
|
24
|
+
/** About five pages, each a word or two; they fold into a drawer on phones. */
|
|
25
|
+
nav?: NavItem[];
|
|
26
|
+
renderLink?: RenderLink;
|
|
27
|
+
/** An <AccountMenu>, or a sign-in button when signed out. */
|
|
28
|
+
account?: ReactNode;
|
|
29
|
+
/** Extra controls left of the color mode toggle; keep it to icons. */
|
|
30
|
+
actions?: ReactNode;
|
|
31
|
+
/** The build line in the footer and the drawer, e.g. <BuildInfo />. */
|
|
32
|
+
buildInfo?: ReactNode;
|
|
33
|
+
/** The footer's left side, e.g. © year and the organization. */
|
|
34
|
+
footer?: ReactNode;
|
|
35
|
+
/**
|
|
36
|
+
* The app's width, set once where the app renders AppShell, so the header
|
|
37
|
+
* never moves from page to page and content never runs past it.
|
|
38
|
+
* "column" (default): 5xl, for apps whose pages are read top to bottom.
|
|
39
|
+
* "wide": 8xl, for apps with pages whose point is a wide table (a batch's
|
|
40
|
+
* items, placing orders). Their other pages wrap their content in
|
|
41
|
+
* `PageColumn` to stay in a centered 5xl column.
|
|
42
|
+
*/
|
|
43
|
+
width?: "column" | "wide";
|
|
44
|
+
children: ReactNode;
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* The frame every team app shares (taken from OverHours): the app name and
|
|
48
|
+
* organization on the left; the pages, the color mode toggle and the account on
|
|
49
|
+
* the right; a drawer with the pages on phones; a quiet footer. Header,
|
|
50
|
+
* content and footer share one width: a 5xl column, or 8xl for apps with wide
|
|
51
|
+
* tables. The update banner shows above it when the server is on a newer build.
|
|
52
|
+
*/
|
|
53
|
+
export declare function AppShell({ appName, orgName, homeHref, nav, renderLink, account, actions, buildInfo, footer, width, children, ...containerProps }: AppShellProps): import("react").JSX.Element;
|
|
54
|
+
export interface AccountMenuProps {
|
|
55
|
+
name: string;
|
|
56
|
+
image?: string | null;
|
|
57
|
+
/** Shown under the name at the top of the menu, e.g. the email. */
|
|
58
|
+
detail?: ReactNode;
|
|
59
|
+
/**
|
|
60
|
+
* The menu's contents, in the app's own order: Chakra's Menu.Item,
|
|
61
|
+
* Menu.Separator and Menu.ItemGroup, and this package's LanguageMenu and
|
|
62
|
+
* SignOutMenuItem. Sign out goes last.
|
|
63
|
+
*/
|
|
64
|
+
children: ReactNode;
|
|
65
|
+
/** Called with the selected item's value; a Next.js server action works too. */
|
|
66
|
+
onSelect?: (value: string) => void | Promise<void>;
|
|
67
|
+
}
|
|
68
|
+
/** The signed-in user's avatar, opening the app's account menu under their name. */
|
|
69
|
+
export declare function AccountMenu({ name, image, detail, children, onSelect }: AccountMenuProps): import("react").JSX.Element;
|
|
70
|
+
export interface LanguageMenuProps {
|
|
71
|
+
/** The languages to offer, each labeled in its own language (English, 繁體中文). */
|
|
72
|
+
languages: {
|
|
73
|
+
value: string;
|
|
74
|
+
label: string;
|
|
75
|
+
}[];
|
|
76
|
+
value: string;
|
|
77
|
+
onChange: (value: string) => void;
|
|
78
|
+
}
|
|
79
|
+
/** A 語言 item in the account menu that opens the languages beside it, the current one checked. */
|
|
80
|
+
export declare function LanguageMenu({ languages, value, onChange }: LanguageMenuProps): import("react").JSX.Element;
|
|
81
|
+
/** The last item of the account menu. */
|
|
82
|
+
export declare function SignOutMenuItem({ value, onSelect }: {
|
|
83
|
+
value?: string;
|
|
84
|
+
onSelect?: () => void;
|
|
85
|
+
}): import("react").JSX.Element;
|
|
86
|
+
/** The account slot when signed out. */
|
|
87
|
+
export declare function SignInButton({ onClick }: {
|
|
88
|
+
onClick: () => void | Promise<void>;
|
|
89
|
+
}): import("react").JSX.Element;
|
|
90
|
+
export interface BuildInfoProps {
|
|
91
|
+
/** A release version; shown instead of the commit when set. */
|
|
92
|
+
version?: string | null;
|
|
93
|
+
commit?: string | null;
|
|
94
|
+
/** ISO time the build ran. */
|
|
95
|
+
builtAt?: string | null;
|
|
96
|
+
}
|
|
97
|
+
/** Which build is running: the version, else the short commit and build time, else "dev". */
|
|
98
|
+
export declare function BuildInfo({ version, commit, builtAt }: BuildInfoProps): import("react").JSX.Element;
|
|
99
|
+
//# sourceMappingURL=app-shell.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"app-shell.d.ts","sourceRoot":"","sources":["../../src/blocks/app-shell.tsx"],"names":[],"mappings":"AAEA,OAAO,EAeL,KAAK,cAAc,EACpB,MAAM,kBAAkB,CAAA;AACzB,OAAO,EAAgC,KAAK,YAAY,EAAE,KAAK,SAAS,EAAE,MAAM,OAAO,CAAA;AAQvF;;;;GAIG;AACH,MAAM,MAAM,UA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AAO,EAAE,MAAM,EAAE,OAAO,EAAE,EAAE,cAAc,+BAUrE"}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { Box, Button, CloseButton, Container, Drawer, Flex, Heading, HStack, IconButton, Menu, Portal, Separator, Stack, Text, } from "@chakra-ui/react";
|
|
4
|
+
import { cloneElement, isValidElement } from "react";
|
|
5
|
+
import { LuChevronRight, LuLanguages, LuLogIn, LuLogOut, LuMenu } from "react-icons/lu";
|
|
6
|
+
import { ColorModeButton } from "../chakra/color-mode.js";
|
|
7
|
+
import { useUiMessages } from "../i18n.js";
|
|
8
|
+
import { AppOutdatedBanner } from "./app-commit.js";
|
|
9
|
+
import { MemberAvatar } from "./member-avatar.js";
|
|
10
|
+
const plainLink = (href, children) => _jsx("a", { href: href, children: children });
|
|
11
|
+
function NavButton({ item, renderLink, onClick }) {
|
|
12
|
+
const link = renderLink(item.href, _jsxs(_Fragment, { children: [item.icon, item.label] }));
|
|
13
|
+
return (_jsx(Button, { size: "sm", variant: item.active ? "subtle" : "ghost", justifyContent: "flex-start", asChild: true, onClick: onClick, children: isValidElement(link) ? cloneElement(link, { "aria-current": item.active ? "page" : undefined }) : link }));
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* The frame every team app shares (taken from OverHours): the app name and
|
|
17
|
+
* organization on the left; the pages, the color mode toggle and the account on
|
|
18
|
+
* the right; a drawer with the pages on phones; a quiet footer. Header,
|
|
19
|
+
* content and footer share one width: a 5xl column, or 8xl for apps with wide
|
|
20
|
+
* tables. The update banner shows above it when the server is on a newer build.
|
|
21
|
+
*/
|
|
22
|
+
export function AppShell({ appName, orgName, homeHref = "/", nav = [], renderLink = plainLink, account, actions, buildInfo, footer, width = "column", children, ...containerProps }) {
|
|
23
|
+
const m = useUiMessages().shell;
|
|
24
|
+
const frameW = width === "wide" ? "8xl" : "5xl";
|
|
25
|
+
return (_jsxs(_Fragment, { children: [_jsx(AppOutdatedBanner, {}), _jsx(Container, { maxW: frameW, fluid: true, px: "4", pt: "4", mt: "2", children: _jsxs(Flex, { as: "header", align: "center", justify: "space-between", gap: "3", mb: "4", children: [_jsxs(Stack, { gap: "0", minW: "0", children: [_jsxs(Heading, { as: "div", size: "xl", display: "flex", alignItems: "baseline", gap: "2", children: [_jsx(Box, { as: "span", truncate: true, children: renderLink(homeHref, appName) }), orgName && (_jsx(Box, { as: "span", textStyle: "md", fontWeight: "normal", hideBelow: "md", truncate: true, children: orgName }))] }), orgName && (_jsx(Text, { as: "span", textStyle: "xs", hideFrom: "md", truncate: true, children: orgName }))] }), _jsxs(HStack, { gap: "2", flexShrink: 0, children: [nav.length > 0 && (_jsx(HStack, { as: "nav", gap: "1", hideBelow: "md", children: nav.map((item) => (_jsx(NavButton, { item: item, renderLink: renderLink }, item.href))) })), actions, _jsx(ColorModeButton, { hideBelow: "md" }), account, _jsxs(Drawer.Root, { size: "xs", placement: "start", children: [_jsx(Drawer.Trigger, { asChild: true, children: _jsx(IconButton, { hideFrom: "md", size: "sm", variant: "outline", "aria-label": m.openMenu, children: _jsx(LuMenu, {}) }) }), _jsxs(Portal, { children: [_jsx(Drawer.Backdrop, {}), _jsx(Drawer.Positioner, { children: _jsxs(Drawer.Content, { maxW: "3xs", children: [_jsx(Drawer.Context, { children: (drawer) => (_jsxs(_Fragment, { children: [_jsx(Drawer.Header, { children: _jsx(Drawer.Title, { children: m.menu }) }), _jsxs(Drawer.Body, { children: [_jsx(Separator, { mb: "4" }), _jsx(Stack, { as: "nav", gap: "2", children: nav.map((item) => (_jsx(NavButton, { item: item, renderLink: renderLink, onClick: () => drawer.setOpen(false) }, item.href))) })] }), _jsxs(Drawer.Footer, { justifyContent: "space-between", children: [_jsx(Box, { textStyle: "xs", color: "fg.muted", children: buildInfo }), _jsx(ColorModeButton, {})] })] })) }), _jsx(Drawer.CloseTrigger, { asChild: true, children: _jsx(CloseButton, { size: "sm" }) })] }) })] })] })] })] }) }), _jsx(Container, { as: "main", maxW: frameW, fluid: true, px: "4", pb: "4", mb: "2", ...containerProps, children: children }), (footer || buildInfo) && (_jsx(Container, { as: "footer", maxW: frameW, fluid: true, px: "4", mb: "8", children: _jsxs(Flex, { direction: { base: "column", sm: "row" }, justify: "space-between", gap: "2", textStyle: "xs", color: "fg.muted", textAlign: { base: "center", sm: "start" }, children: [_jsx(Box, { children: footer }), _jsx(Box, { hideBelow: "sm", textAlign: "end", children: buildInfo })] }) }))] }));
|
|
26
|
+
}
|
|
27
|
+
/** The signed-in user's avatar, opening the app's account menu under their name. */
|
|
28
|
+
export function AccountMenu({ name, image, detail, children, onSelect }) {
|
|
29
|
+
return (_jsxs(Menu.Root, { positioning: { placement: "bottom-end" }, onSelect: onSelect && (({ value }) => void onSelect(value)), children: [_jsx(Menu.Trigger, { asChild: true, children: _jsx(Button, { variant: "plain", p: "0", h: "auto", minW: "0", rounded: "full", "aria-label": name, children: _jsx(MemberAvatar, { name: name, image: image, size: "sm" }) }) }), _jsx(Portal, { children: _jsx(Menu.Positioner, { children: _jsxs(Menu.Content, { minW: "48", children: [_jsxs(Box, { px: "2", py: "1.5", children: [_jsx(Text, { fontWeight: "medium", truncate: true, children: name }), detail && (_jsx(Text, { textStyle: "xs", color: "fg.muted", truncate: true, children: detail }))] }), _jsx(Menu.Separator, {}), children] }) }) })] }));
|
|
30
|
+
}
|
|
31
|
+
/** A 語言 item in the account menu that opens the languages beside it, the current one checked. */
|
|
32
|
+
export function LanguageMenu({ languages, value, onChange }) {
|
|
33
|
+
const m = useUiMessages().shell;
|
|
34
|
+
const current = languages.find((l) => l.value === value);
|
|
35
|
+
return (_jsxs(Menu.Root, { positioning: { placement: "left-start", gutter: 2 }, children: [_jsxs(Menu.TriggerItem, { children: [_jsx(LuLanguages, {}), _jsx(Box, { flex: "1", children: m.language }), current && (_jsx(Text, { as: "span", color: "fg.muted", textStyle: "xs", children: current.label })), _jsx(LuChevronRight, {})] }), _jsx(Portal, { children: _jsx(Menu.Positioner, { children: _jsx(Menu.Content, { children: _jsx(Menu.RadioItemGroup, { value: value, onValueChange: (e) => onChange(e.value), children: languages.map((language) => (_jsxs(Menu.RadioItem, { value: language.value, children: [_jsx(Menu.ItemText, { children: language.label }), _jsx(Menu.ItemIndicator, {})] }, language.value))) }) }) }) })] }));
|
|
36
|
+
}
|
|
37
|
+
/** The last item of the account menu. */
|
|
38
|
+
export function SignOutMenuItem({ value = "signout", onSelect }) {
|
|
39
|
+
const m = useUiMessages().shell;
|
|
40
|
+
return (_jsxs(Menu.Item, { value: value, onSelect: onSelect, children: [_jsx(LuLogOut, {}), m.signOut] }));
|
|
41
|
+
}
|
|
42
|
+
/** The account slot when signed out. */
|
|
43
|
+
export function SignInButton({ onClick }) {
|
|
44
|
+
const m = useUiMessages().shell;
|
|
45
|
+
return (_jsxs(Button, { size: "sm", onClick: () => void onClick(), children: [m.signIn, _jsx(LuLogIn, {})] }));
|
|
46
|
+
}
|
|
47
|
+
/** Which build is running: the version, else the short commit and build time, else "dev". */
|
|
48
|
+
export function BuildInfo({ version, commit, builtAt }) {
|
|
49
|
+
if (version)
|
|
50
|
+
return _jsx(Text, { as: "span", children: version });
|
|
51
|
+
if (!commit)
|
|
52
|
+
return _jsx(Text, { as: "span", children: "dev" });
|
|
53
|
+
const time = builtAt ? new Date(builtAt) : null;
|
|
54
|
+
return (_jsxs(Text, { as: "span", fontFamily: "mono", children: [commit.replace(/^sha-/, "").slice(0, 7), time && !Number.isNaN(time.getTime()) && _jsx(Text, { as: "span", fontFamily: "body", suppressHydrationWarning: true, children: ` · ${time.toLocaleString()}` })] }));
|
|
55
|
+
}
|
|
56
|
+
//# sourceMappingURL=app-shell.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"app-shell.js","sourceRoot":"","sources":["../../src/blocks/app-shell.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAA;;AAEZ,OAAO,EACL,GAA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AC,IAAI,CAAC,OAAO,EAAE,CAAC,IAAI,KAAC,IAAI,IAAC,EAAE,EAAC,MAAM,EAAC,UAAU,EAAC,MAAM,EAAC,wBAAwB,kBAAE,MAAM,IAAI,CAAC,cAAc,EAAE,EAAE,GAAQ,IACtI,CACR,CAAA;AACH,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { type StatusPageProps } from "./status-page.js";
|
|
2
|
+
export interface ConfigErrorPageProps extends Partial<Omit<StatusPageProps, "icon">> {
|
|
3
|
+
/** What went wrong; a ConfigError lists each problem on its own line. */
|
|
4
|
+
error?: unknown;
|
|
5
|
+
}
|
|
6
|
+
/** Shown instead of the app when config.json can't be loaded or is invalid. */
|
|
7
|
+
export declare function ConfigErrorPage({ error, ...props }: ConfigErrorPageProps): import("react").JSX.Element;
|
|
8
|
+
//# sourceMappingURL=config-error-page.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config-error-page.d.ts","sourceRoot":"","sources":["../../src/blocks/config-error-page.tsx"],"names":[],"mappings":"AAOA,OAAO,EAAc,KAAK,eAAe,EAAE,MAAM,kBAAkB,CAAA;AAEnE,MAAM,WAAW,oBAAqB,SAAQ,OAAO,CAAC,IAAI,CAAC,eAAe,EAAE,MAAM,CAAC,CAAC;IAClF,yEAAyE;IACzE,KAAK,CAAC,EAAE,OAAO,CAAA;CAChB;AAQD,+EAA+E;AAC/E,wBAAgB,eAAe,CAAC,EAAE,KAAK,EAAE,GAAG,KAAK,EAAE,EAAE,oBAAoB,+BAiBxE"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
import { Box, List } from "@chakra-ui/react";
|
|
4
|
+
import { LuSettings } from "react-icons/lu";
|
|
5
|
+
import { useUiMessages } from "../i18n.js";
|
|
6
|
+
import { ConfigError } from "../lib/runtime-config.js";
|
|
7
|
+
import { StatusPage } from "./status-page.js";
|
|
8
|
+
function issuesOf(error) {
|
|
9
|
+
if (error instanceof ConfigError)
|
|
10
|
+
return error.issues;
|
|
11
|
+
if (error instanceof Error)
|
|
12
|
+
return [error.message];
|
|
13
|
+
return error === undefined ? [] : [String(error)];
|
|
14
|
+
}
|
|
15
|
+
/** Shown instead of the app when config.json can't be loaded or is invalid. */
|
|
16
|
+
export function ConfigErrorPage({ error, ...props }) {
|
|
17
|
+
const m = useUiMessages().configError;
|
|
18
|
+
const issues = issuesOf(error);
|
|
19
|
+
return (_jsx(StatusPage, { icon: _jsx(LuSettings, {}), title: m.title, description: m.description, ...props, children: issues.length > 0 && (_jsx(Box, { w: "full", textAlign: "start", bg: "bg.muted", rounded: "l2", px: "4", py: "3", children: _jsx(List.Root, { fontFamily: "mono", textStyle: "sm", gap: "1", ps: "4", children: issues.map((issue) => (_jsx(List.Item, { children: issue }, issue))) }) })) }));
|
|
20
|
+
}
|
|
21
|
+
//# sourceMappingURL=config-error-page.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config-error-page.js","sourceRoot":"","sources":["../../src/blocks/config-error-page.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAA;;AAEZ,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAA;AAC5C,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAA;AAE3C,OAAO,EAAE,aAAa,EAAE,MAAM,YAAY,CAAA;AAC1C,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAA;AACtD,OAAO,EAAE,UAAU,EAAwB,MAAM,kBAAkB,CAAA;AAOnE,SAAS,QAAQ,CAAC,KAAc;IAC9B,IAAI,KAAK,YAAY,WAAW;QAAE,OAAO,KAAK,CAAC,MAAM,CAAA;IACrD,IAAI,KAAK,YAAY,KAAK;QAAE,OAAO,CAAC,KAAK,CAAC,OAAO,CAAC,CAAA;IAClD,OAAO,KAAK,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAA;AACnD,CAAC;AAED,+EAA+E;AAC/E,MAAM,UAAU,eAAe,CAAC,EAAE,KAAK,EAAE,GAAG,KAAK,EAAwB;IACvE,MAAM,CAAC,GAAG,aAAa,EAAE,CAAC,WAAW,CAAA;IACrC,MAAM,MAAM,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAA;IAE9B,OAAO,CACL,KAAC,UAAU,IAAC,IAAI,EAAE,KAAC,UAAU,KAAG,EAAE,KAAK,EAAE,CAAC,CAAC,KAAK,EAAE,WAAW,EAAE,CAAC,CAAC,WAAW,KAAM,KAAK,YACpF,MAAM,CAAC,MAAM,GAAG,CAAC,IAAI,CACpB,KAAC,GAAG,IAAC,CAAC,EAAC,MAAM,EAAC,SAAS,EAAC,OAAO,EAAC,EAAE,EAAC,UAAU,EAAC,OAAO,EAAC,IAAI,EAAC,EAAE,EAAC,GAAG,EAAC,EAAE,EAAC,GAAG,YACtE,KAAC,IAAI,CAAC,IAAI,IAAC,UAAU,EAAC,MAAM,EAAC,SAAS,EAAC,IAAI,EAAC,GAAG,EAAC,GAAG,EAAC,EAAE,EAAC,GAAG,YACvD,MAAM,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,CACrB,KAAC,IAAI,CAAC,IAAI,cAAc,KAAK,IAAb,KAAK,CAAqB,CAC3C,CAAC,GACQ,GACR,CACP,GACU,CACd,CAAA;AACH,CAAC"}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { type FlexProps, type PopoverRootProps, type SimpleGridProps, type StackProps } from "@chakra-ui/react";
|
|
2
|
+
import type { ReactNode } from "react";
|
|
3
|
+
export interface FilterBarProps extends Omit<FlexProps, "children"> {
|
|
4
|
+
search?: {
|
|
5
|
+
value: string;
|
|
6
|
+
onChange: (value: string) => void;
|
|
7
|
+
placeholder?: string;
|
|
8
|
+
};
|
|
9
|
+
/** How many filters are set; shown on the button so a filtered list never looks complete. */
|
|
10
|
+
activeCount?: number;
|
|
11
|
+
onClear?: () => void;
|
|
12
|
+
/** The filter fields (selects, date pickers), shown in a popover under the 篩選 button. */
|
|
13
|
+
children?: ReactNode;
|
|
14
|
+
/** Actions on the right of the bar, e.g. 新增批次 when the page header is far away. */
|
|
15
|
+
actions?: ReactNode;
|
|
16
|
+
/**
|
|
17
|
+
* Where the filter popover opens, merged over the default (below the button,
|
|
18
|
+
* flipping above it when there is no room).
|
|
19
|
+
*/
|
|
20
|
+
positioning?: PopoverRootProps["positioning"];
|
|
21
|
+
}
|
|
22
|
+
/** A search box and one 篩選 button, instead of a row of always-open selects. */
|
|
23
|
+
export declare function FilterBar({ search, activeCount, onClear, children, actions, positioning, ...rest }: FilterBarProps): import("react").JSX.Element;
|
|
24
|
+
export interface SelectionBarProps extends Omit<FlexProps, "children"> {
|
|
25
|
+
count: number;
|
|
26
|
+
onClear: () => void;
|
|
27
|
+
/** What can be done to the picked rows; the main one solid, the rest outline. */
|
|
28
|
+
children: ReactNode;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Appears once rows are picked, pinned to the bottom of the screen, with what
|
|
32
|
+
* can be done to them. Actions on a pick live here instead of as disabled
|
|
33
|
+
* "(0)" buttons above the table.
|
|
34
|
+
*/
|
|
35
|
+
export declare function SelectionBar({ count, onClear, children, ...rest }: SelectionBarProps): import("react").JSX.Element | null;
|
|
36
|
+
export interface Fact {
|
|
37
|
+
label: ReactNode;
|
|
38
|
+
value: ReactNode;
|
|
39
|
+
}
|
|
40
|
+
export interface FactListProps extends Omit<SimpleGridProps, "children"> {
|
|
41
|
+
items: Fact[];
|
|
42
|
+
}
|
|
43
|
+
/** One record's facts in a grid of label over value; columns at least 12rem wide, so dates never wrap. */
|
|
44
|
+
export declare function FactList({ items, ...rest }: FactListProps): import("react").JSX.Element;
|
|
45
|
+
export interface TotalsLine {
|
|
46
|
+
label: ReactNode;
|
|
47
|
+
value: ReactNode;
|
|
48
|
+
/** The bottom line (the total to pay); set apart and in bold. */
|
|
49
|
+
emphasis?: boolean;
|
|
50
|
+
hint?: ReactNode;
|
|
51
|
+
}
|
|
52
|
+
export interface TotalsProps extends StackProps {
|
|
53
|
+
lines: TotalsLine[];
|
|
54
|
+
}
|
|
55
|
+
/** Amounts that add up, right-aligned under a list or table; the emphasized line is the total. */
|
|
56
|
+
export declare function Totals({ lines, ...rest }: TotalsProps): import("react").JSX.Element;
|
|
57
|
+
//# sourceMappingURL=data-parts.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"data-parts.d.ts","sourceRoot":"","sources":["../../src/blocks/data-parts.tsx"],"names":[],"mappings":"AAEA,OAAO,EAcL,KAAK,SAAS,EACd,KAAK,gBAAgB,EACrB,KAAK,eAAe,EACpB,KAAK,UAAU,EAChB,MAAM,kBAAkB,CAAA;AACzB,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAKtC,MAAM,WAAW,cAAe,SAAQ,IAAI,CAAC,SAAS,EAAE,UAAU,CAAC;IACjE,MAAM,CAAC,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;QAAC,WAAW,CAAC,EAAE,MAAM,CAAA;KAAE,CAAA;IACnF,6FAA6F;IAC7F,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,OAAO,CAAC,EAAE,MAAM,IAAI,CAAA;IACpB,yFAAyF;IACzF,QAAQ,CAAC,EAAE,SAAS,CAAA;IACpB,mFAAmF;IACnF,OAAO,CAAC,EAAE,SAAS,CAAA;IACnB;;;OAGG;IACH,WAAW,CAAC,EAAE,gBAAgB,CAAC,aAAa,CAAC,CAAA;CAC9C;AAED,+EAA+E;AAC/E,wBAAgB,SAAS,CAAC,EAAE,MAAM,EAAE,WAAe,EAAE,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,WAAW,EAAE,GAAG,IAAI,EAAE,EAAE,cAAc,+BAsDtH;AAED,MAAM,WAAW,iBAAkB,SAAQ,IAAI,CAAC,SAAS,EAAE,UAAU,CAAC;IACpE,KAAK,EAAE,MAAM,CAAA;IACb,OAAO,EAAE,MAAM,IAAI,CAAA;IACnB,iFAAiF;IACjF,QAAQ,EAAE,SAAS,CAAA;CACpB;AAED;;;;GAIG;AACH,wBAAgB,YAAY,CAAC,EAAE,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE,GAAG,IAAI,EAAE,EAAE,iBAAiB,sCAiCpF;AAED,MAAM,WAAW,IAAI;IACnB,KAAK,EAAE,SAAS,CAAA;IAChB,KAAK,EAAE,SAAS,CAAA;CACjB;AAED,MAAM,WAAW,aAAc,SAAQ,IAAI,CAAC,eAAe,EAAE,UAAU,CAAC;IACtE,KAAK,EAAE,IAAI,EAAE,CAAA;CACd;AAED,0GAA0G;AAC1G,wBAAgB,QAAQ,CAAC,EAAE,KAAK,EAAE,GAAG,IAAI,EAAE,EAAE,aAAa,+BAazD;AAED,MAAM,WAAW,UAAU;IACzB,KAAK,EAAE,SAAS,CAAA;IAChB,KAAK,EAAE,SAAS,CAAA;IAChB,iEAAiE;IACjE,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,IAAI,CAAC,EAAE,SAAS,CAAA;CACjB;AAED,MAAM,WAAW,WAAY,SAAQ,UAAU;IAC7C,KAAK,EAAE,UAAU,EAAE,CAAA;CACpB;AAED,kGAAkG;AAClG,wBAAgB,MAAM,CAAC,EAAE,KAAK,EAAE,GAAG,IAAI,EAAE,EAAE,WAAW,+BAqBrD"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { Badge, Box, Button, Flex, HStack, Input, InputGroup, Popover, Portal, Separator, SimpleGrid, Stack, Text, } from "@chakra-ui/react";
|
|
4
|
+
import { LuListFilter, LuSearch, LuX } from "react-icons/lu";
|
|
5
|
+
import { useUiMessages } from "../i18n.js";
|
|
6
|
+
/** A search box and one 篩選 button, instead of a row of always-open selects. */
|
|
7
|
+
export function FilterBar({ search, activeCount = 0, onClear, children, actions, positioning, ...rest }) {
|
|
8
|
+
const m = useUiMessages().data;
|
|
9
|
+
return (_jsxs(Flex, { gap: "2", align: "center", wrap: "wrap", mb: "3", ...rest, children: [search && (_jsx(InputGroup, { startElement: _jsx(LuSearch, {}), flex: "1", minW: "48", maxW: { md: "sm" }, children: _jsx(Input, { size: "sm", value: search.value, onChange: (e) => search.onChange(e.currentTarget.value), placeholder: search.placeholder ?? m.search, "aria-label": search.placeholder ?? m.search }) })), children && (_jsxs(Popover.Root, { positioning: { placement: "bottom-start", ...positioning }, lazyMount: true, unmountOnExit: true, children: [_jsx(Popover.Trigger, { asChild: true, children: _jsxs(Button, { size: "sm", variant: "outline", children: [_jsx(LuListFilter, {}), m.filter, activeCount > 0 && (_jsx(Badge, { size: "sm", colorPalette: "brand", variant: "solid", children: activeCount }))] }) }), _jsx(Portal, { children: _jsx(Popover.Positioner, { children: _jsxs(Popover.Content, { w: "xs", overflowY: "auto", children: [_jsx(Popover.Body, { children: _jsx(Stack, { gap: "3", children: children }) }), onClear && activeCount > 0 && (_jsx(Popover.Footer, { justifyContent: "flex-end", children: _jsx(Button, { size: "xs", variant: "ghost", onClick: onClear, children: m.clearFilters }) }))] }) }) })] })), onClear && activeCount > 0 && (_jsxs(Button, { size: "sm", variant: "ghost", onClick: onClear, children: [_jsx(LuX, {}), m.clearFilters] })), actions && (_jsx(HStack, { gap: "2", ms: "auto", children: actions }))] }));
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Appears once rows are picked, pinned to the bottom of the screen, with what
|
|
13
|
+
* can be done to them. Actions on a pick live here instead of as disabled
|
|
14
|
+
* "(0)" buttons above the table.
|
|
15
|
+
*/
|
|
16
|
+
export function SelectionBar({ count, onClear, children, ...rest }) {
|
|
17
|
+
const m = useUiMessages().data;
|
|
18
|
+
if (count === 0)
|
|
19
|
+
return null;
|
|
20
|
+
return (_jsxs(Flex, { role: "region", "aria-label": m.selected.replace("{count}", String(count)), position: "sticky", bottom: "4", zIndex: "sticky", mt: "3", align: "center", gap: "3", wrap: "wrap", bg: "bg.panel", borderWidth: "1px", rounded: "l3", shadow: "lg", px: "4", py: "2.5", ...rest, children: [_jsx(Text, { fontWeight: "medium", fontVariantNumeric: "tabular-nums", children: m.selected.replace("{count}", String(count)) }), _jsx(Button, { size: "xs", variant: "ghost", onClick: onClear, children: m.clearSelection }), _jsx(HStack, { gap: "2", ms: "auto", wrap: "wrap", children: children })] }));
|
|
21
|
+
}
|
|
22
|
+
/** One record's facts in a grid of label over value; columns at least 12rem wide, so dates never wrap. */
|
|
23
|
+
export function FactList({ items, ...rest }) {
|
|
24
|
+
return (_jsx(SimpleGrid, { as: "dl", minChildWidth: "12rem", gap: "4", ...rest, children: items.map((item, i) => (_jsxs(Box, { minW: "0", children: [_jsx(Text, { as: "dt", textStyle: "xs", color: "fg.muted", children: item.label }), _jsx(Box, { as: "dd", children: item.value })] }, i))) }));
|
|
25
|
+
}
|
|
26
|
+
/** Amounts that add up, right-aligned under a list or table; the emphasized line is the total. */
|
|
27
|
+
export function Totals({ lines, ...rest }) {
|
|
28
|
+
return (_jsx(Stack, { gap: "1.5", ms: "auto", w: "full", maxW: { md: "sm" }, ...rest, children: lines.map((line, i) => (_jsxs(Box, { children: [line.emphasis && i > 0 && _jsx(Separator, { mb: "1.5" }), _jsxs(HStack, { justify: "space-between", gap: "4", fontWeight: line.emphasis ? "semibold" : undefined, children: [_jsx(Text, { color: line.emphasis ? "fg" : "fg.muted", children: line.label }), _jsx(Text, { fontVariantNumeric: "tabular-nums", whiteSpace: "nowrap", children: line.value })] }), line.hint && (_jsx(Text, { textStyle: "xs", color: "fg.muted", textAlign: "end", children: line.hint }))] }, i))) }));
|
|
29
|
+
}
|
|
30
|
+
//# sourceMappingURL=data-parts.js.map
|
|
@@ -0,0 +1 @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ACxD,IAAI,CAAC,KAAK,GACN,IACA,EACR,IAAI,CAAC,IAAI,IAAI,CACZ,KAAC,IAAI,IAAC,SAAS,EAAC,IAAI,EAAC,KAAK,EAAC,UAAU,EAAC,SAAS,EAAC,KAAK,YAClD,IAAI,CAAC,IAAI,GACL,CACR,KAZO,CAAC,CAaL,CACP,CAAC,GACI,CACT,CAAA;AACH,CAAC"}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { type TableRootProps } from "@chakra-ui/react";
|
|
2
|
+
import { type ReactNode } from "react";
|
|
3
|
+
export interface DataColumn<T> {
|
|
4
|
+
key: string;
|
|
5
|
+
header: ReactNode;
|
|
6
|
+
/** The header as text, for the label in front of the value on a phone; defaults to `header` when it is a string. */
|
|
7
|
+
label?: string;
|
|
8
|
+
cell: (row: T) => ReactNode;
|
|
9
|
+
/** Amounts, quantities, prices: right-aligned with tabular figures. */
|
|
10
|
+
numeric?: boolean;
|
|
11
|
+
/**
|
|
12
|
+
* "primary": the row's name; the title of the row's card on a phone.
|
|
13
|
+
* "secondary": detail that can go when space runs out; hidden below lg.
|
|
14
|
+
*/
|
|
15
|
+
priority?: "primary" | "secondary";
|
|
16
|
+
width?: string;
|
|
17
|
+
}
|
|
18
|
+
export interface RowAction {
|
|
19
|
+
value: string;
|
|
20
|
+
label: ReactNode;
|
|
21
|
+
icon?: ReactNode;
|
|
22
|
+
onSelect: () => void;
|
|
23
|
+
/** Destructive actions (cancel, delete, mark unpurchasable) are shown in red. */
|
|
24
|
+
danger?: boolean;
|
|
25
|
+
disabled?: boolean;
|
|
26
|
+
}
|
|
27
|
+
export interface DataTableSelection<T> {
|
|
28
|
+
selected: readonly string[];
|
|
29
|
+
onChange: (ids: string[]) => void;
|
|
30
|
+
/** Rows that cannot be picked get no checkbox. */
|
|
31
|
+
canSelect?: (row: T) => boolean;
|
|
32
|
+
}
|
|
33
|
+
export interface DataTableProps<T> extends Omit<TableRootProps, "children" | "rows" | "columns"> {
|
|
34
|
+
rows: T[];
|
|
35
|
+
columns: DataColumn<T>[];
|
|
36
|
+
getRowId: (row: T) => string;
|
|
37
|
+
/** Checkboxes for picking rows; act on the pick with a SelectionBar. */
|
|
38
|
+
selection?: DataTableSelection<T>;
|
|
39
|
+
/** A row's actions, folded into one ⋯ menu at the end of the row. */
|
|
40
|
+
rowActions?: (row: T) => RowAction[];
|
|
41
|
+
/** Splits the rows under group headings (e.g. by vendor), in first-seen order. */
|
|
42
|
+
groupBy?: (row: T) => string;
|
|
43
|
+
groupLabel?: (key: string, rows: T[]) => ReactNode;
|
|
44
|
+
/** Shown instead of the table when there are no rows, e.g. an EmptyState. */
|
|
45
|
+
empty?: ReactNode;
|
|
46
|
+
/** Names the table for screen readers. */
|
|
47
|
+
"aria-label"?: string;
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* The table for records people pick from and act on: numbers right-aligned,
|
|
51
|
+
* secondary columns dropped when space runs out, a row's actions in one ⋯
|
|
52
|
+
* menu, optional checkboxes and group headings, and cards instead of columns
|
|
53
|
+
* on a phone.
|
|
54
|
+
*/
|
|
55
|
+
export declare function DataTable<T>({ rows, columns, getRowId, selection, rowActions, groupBy, groupLabel, empty, ...rest }: DataTableProps<T>): import("react").JSX.Element;
|
|
56
|
+
//# sourceMappingURL=data-table.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"data-table.d.ts","sourceRoot":"","sources":["../../src/blocks/data-table.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAmD,KAAK,cAAc,EAAE,MAAM,kBAAkB,CAAA;AACvG,OAAO,EAAY,KAAK,SAAS,EAAE,MAAM,OAAO,CAAA;AAKhD,MAAM,WAAW,UAAU,CAAC,CAAC;IAC3B,GAAG,EAAE,MAAM,CAAA;IACX,MAAM,EAAE,SAAS,CAAA;IACjB,oHAAoH;IACpH,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,IAAI,EAAE,CAAC,GAAG,EAAE,CAAC,KAAK,SAAS,CAAA;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AAA;IAClD,6EAA6E;IAC7E,KAAK,CAAC,EAAE,SAAS,CAAA;IACjB,0CAA0C;IAC1C,YAAY,CAAC,EAAE,MAAM,CAAA;CACtB;AA6CD;;;;;GAKG;AACH,wBAAgB,SAAS,CAAC,CAAC,EAAE,EAC3B,IAAI,EACJ,OAAO,EACP,QAAQ,EACR,SAAS,EACT,UAAU,EACV,OAAO,EACP,UAAU,EACV,KAAK,EACL,GAAG,IAAI,EACR,EAAE,cAAc,CAAC,CAAC,CAAC,+BAqInB"}
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { Checkbox, IconButton, Menu, Portal, Table, Text } from "@chakra-ui/react";
|
|
4
|
+
import { Fragment } from "react";
|
|
5
|
+
import { LuEllipsis } from "react-icons/lu";
|
|
6
|
+
import { useUiMessages } from "../i18n.js";
|
|
7
|
+
function groupRows(rows, groupBy) {
|
|
8
|
+
if (!groupBy)
|
|
9
|
+
return [["", rows]];
|
|
10
|
+
const groups = new Map();
|
|
11
|
+
for (const row of rows) {
|
|
12
|
+
const key = groupBy(row);
|
|
13
|
+
groups.set(key, [...(groups.get(key) ?? []), row]);
|
|
14
|
+
}
|
|
15
|
+
return [...groups];
|
|
16
|
+
}
|
|
17
|
+
// Below md the same rows lay out as cards: one DOM, so tests and screen readers see one table.
|
|
18
|
+
const cardRow = {
|
|
19
|
+
display: { base: "block", md: "table-row" },
|
|
20
|
+
borderWidth: { base: "1px", md: "0" },
|
|
21
|
+
rounded: { base: "l3", md: "0" },
|
|
22
|
+
px: { base: "3", md: "0" },
|
|
23
|
+
py: { base: "2", md: "0" },
|
|
24
|
+
mb: { base: "3", md: "0" },
|
|
25
|
+
position: "relative",
|
|
26
|
+
};
|
|
27
|
+
const cardCell = {
|
|
28
|
+
display: { base: "flex", md: "table-cell" },
|
|
29
|
+
justifyContent: "space-between",
|
|
30
|
+
gap: "4",
|
|
31
|
+
borderBottomWidth: { base: "0", md: "1px" },
|
|
32
|
+
px: { base: "0", md: "3" },
|
|
33
|
+
py: { base: "1", md: "2" },
|
|
34
|
+
_before: { base: { content: "attr(data-label)", color: "fg.muted", flexShrink: 0 }, md: { content: "none" } },
|
|
35
|
+
};
|
|
36
|
+
// A card's name and checkbox have no label: they start at the left, with no empty label taking up the gap.
|
|
37
|
+
const unlabeledCell = { ...cardCell, justifyContent: "flex-start", _before: { content: "none" } };
|
|
38
|
+
// On a card the checkbox sits at the top left, beside the first line, instead of on a line of its own.
|
|
39
|
+
const cardCheckboxCell = {
|
|
40
|
+
...unlabeledCell,
|
|
41
|
+
position: { base: "absolute", md: "static" },
|
|
42
|
+
insetStart: "3",
|
|
43
|
+
top: "2.5",
|
|
44
|
+
py: { base: "0", md: "2" },
|
|
45
|
+
};
|
|
46
|
+
/**
|
|
47
|
+
* The table for records people pick from and act on: numbers right-aligned,
|
|
48
|
+
* secondary columns dropped when space runs out, a row's actions in one ⋯
|
|
49
|
+
* menu, optional checkboxes and group headings, and cards instead of columns
|
|
50
|
+
* on a phone.
|
|
51
|
+
*/
|
|
52
|
+
export function DataTable({ rows, columns, getRowId, selection, rowActions, groupBy, groupLabel, empty, ...rest }) {
|
|
53
|
+
const m = useUiMessages().data;
|
|
54
|
+
if (rows.length === 0 && empty)
|
|
55
|
+
return _jsx(_Fragment, { children: empty });
|
|
56
|
+
const selected = new Set(selection?.selected ?? []);
|
|
57
|
+
const selectable = selection ? rows.filter((r) => selection.canSelect?.(r) ?? true) : [];
|
|
58
|
+
const toggle = (ids, on) => {
|
|
59
|
+
if (!selection)
|
|
60
|
+
return;
|
|
61
|
+
const next = new Set(selected);
|
|
62
|
+
for (const id of ids) {
|
|
63
|
+
if (on)
|
|
64
|
+
next.add(id);
|
|
65
|
+
else
|
|
66
|
+
next.delete(id);
|
|
67
|
+
}
|
|
68
|
+
selection.onChange([...next]);
|
|
69
|
+
};
|
|
70
|
+
const allState = (ids) => {
|
|
71
|
+
const picked = ids.filter((id) => selected.has(id)).length;
|
|
72
|
+
return picked === 0 ? false : picked === ids.length ? true : "indeterminate";
|
|
73
|
+
};
|
|
74
|
+
const span = columns.length + (selection ? 1 : 0) + (rowActions ? 1 : 0);
|
|
75
|
+
const hideSecondary = (c) => (c.priority === "secondary" ? { hideBelow: "lg" } : {});
|
|
76
|
+
const checkbox = (checked, label, onChange) => (_jsxs(Checkbox.Root, { size: "sm", checked: checked, onCheckedChange: (e) => onChange(e.checked === true), "aria-label": label, children: [_jsx(Checkbox.HiddenInput, {}), _jsx(Checkbox.Control, {})] }));
|
|
77
|
+
return (_jsx(Table.ScrollArea, { borderWidth: { base: "0", md: "1px" }, rounded: "l3", children: _jsxs(Table.Root, { size: "sm", display: { base: "block", md: "table" }, ...rest, children: [_jsx(Table.Header, { display: { base: "none", md: "table-header-group" }, children: _jsxs(Table.Row, { bg: "bg.subtle", children: [selection && (_jsx(Table.ColumnHeader, { w: "10", children: selectable.length > 0 && checkbox(allState(selectable.map(getRowId)), m.selectAll, (on) => toggle(selectable.map(getRowId), on)) })), columns.map((c) => (_jsx(Table.ColumnHeader, { textAlign: c.numeric ? "end" : "start", w: c.width, whiteSpace: "nowrap", color: "fg.muted", fontWeight: "medium", ...hideSecondary(c), children: c.header }, c.key))), rowActions && _jsx(Table.ColumnHeader, { w: "10" })] }) }), _jsx(Table.Body, { display: { base: "block", md: "table-row-group" }, children: groupRows(rows, groupBy).map(([key, groupRowsList]) => {
|
|
78
|
+
const groupIds = groupRowsList.filter((r) => selection?.canSelect?.(r) ?? true).map(getRowId);
|
|
79
|
+
return (_jsxs(Fragment, { children: [groupBy && (_jsxs(Table.Row, { display: { base: "flex", md: "table-row" }, alignItems: "center", gap: "2", mb: { base: "2", md: "0" }, children: [selection && (_jsx(Table.Cell, { borderBottomWidth: { base: "0", md: "1px" }, px: { base: "0", md: "3" }, pt: { md: "4" }, children: groupIds.length > 0 && checkbox(allState(groupIds), m.selectAll, (on) => toggle(groupIds, on)) })), _jsx(Table.Cell, { colSpan: span, fontWeight: "semibold", borderBottomWidth: { base: "0", md: "1px" }, px: { base: "0", md: "3" }, pt: { md: "4" }, children: groupLabel ? groupLabel(key, groupRowsList) : key })] })), groupRowsList.map((row) => {
|
|
80
|
+
const id = getRowId(row);
|
|
81
|
+
const actions = rowActions?.(row) ?? [];
|
|
82
|
+
const canPick = selection && (selection.canSelect?.(row) ?? true);
|
|
83
|
+
return (_jsxs(Table.Row, { css: cardRow, "data-selected": selected.has(id) ? "" : undefined, _selected: { bg: "brand.subtle/40" }, children: [selection && (_jsx(Table.Cell, { css: canPick ? cardCheckboxCell : unlabeledCell, "data-label": "", w: { md: "10" }, display: canPick ? undefined : { base: "none", md: "table-cell" }, children: canPick && checkbox(selected.has(id), m.selectRow, (on) => toggle([id], on)) })), columns.map((c, i) => {
|
|
84
|
+
const label = c.label ?? (typeof c.header === "string" ? c.header : "");
|
|
85
|
+
const primary = c.priority === "primary";
|
|
86
|
+
return (_jsx(Table.Cell, { css: primary ? unlabeledCell : cardCell, "data-label": primary ? "" : label,
|
|
87
|
+
// The card's first line leaves room for the checkbox at its top left and the ⋯ button at its top right.
|
|
88
|
+
ps: i === 0 && canPick ? { base: "7", md: "3" } : undefined, pe: i === 0 && rowActions ? { base: "8", md: "3" } : undefined, textAlign: c.numeric ? "end" : "start", fontVariantNumeric: c.numeric ? "tabular-nums" : undefined, whiteSpace: c.numeric ? "nowrap" : undefined, fontWeight: primary ? "medium" : undefined, ...hideSecondary(c), children: _jsx(Text, { as: "span", textAlign: c.numeric ? "end" : primary ? "start" : { base: "end", md: "start" }, minW: "0", overflowWrap: { base: "anywhere", md: "normal" }, children: c.cell(row) }) }, c.key));
|
|
89
|
+
}), rowActions && (_jsx(Table.Cell, { css: unlabeledCell, "data-label": "", w: { md: "10" }, textAlign: "end", position: { base: "absolute", md: "static" }, top: "1", right: "1", children: actions.length > 0 && (_jsxs(Menu.Root, { positioning: { placement: "bottom-end" }, children: [_jsx(Menu.Trigger, { asChild: true, children: _jsx(IconButton, { size: "xs", variant: "ghost", "aria-label": m.rowActions, children: _jsx(LuEllipsis, {}) }) }), _jsx(Portal, { children: _jsx(Menu.Positioner, { children: _jsx(Menu.Content, { children: actions.map((a) => (_jsxs(Menu.Item, { value: a.value, disabled: a.disabled, onSelect: a.onSelect, color: a.danger ? "fg.error" : undefined, _highlighted: a.danger ? { bg: "bg.error", color: "fg.error" } : undefined, children: [a.icon, a.label] }, a.value))) }) }) })] })) }))] }, id));
|
|
90
|
+
})] }, key));
|
|
91
|
+
}) })] }) }));
|
|
92
|
+
}
|
|
93
|
+
//# sourceMappingURL=data-table.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"data-table.js","sourceRoot":"","sources":["../../src/blocks/data-table.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAA;;AAEZ,OAAO,EAAE,QAAQ,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,IAAI,EAAuB,MAAM,kBAAkB,CAAA;AACvG,OAAO,EAAE,QAAQ,EAAkB,MAAM,OAAO,CAAA;AAChD,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAA;AAE3C,OAAO,EAAE,aAAa,EAAE,MAAM,YAAY,CAAA;AAoD1C,SAAS,SAAS,CAAI,IAAS,EAAE,OAA4B;IAC3D,IAAI,CAAC,OAAO;QAAE,OAAO,CAAC,CAAC,EAAE,EAAE,IAAI,CAAC,CAAC,CAAA;IACjC,MAAM,MAAM,GAAG,IAAI,GAAG,EAAe,CAAA;IACrC,KAAK,MAAM,GAAG,IAAI,IAAI,EAAE,CAAC;QACvB,MAAM,GAAG,GAAG,OAAO,CAAC,GAAG,CAAC,CAAA;QACxB,MAAM,CAAC,GAAG,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,GAAG,CAAC,IAAI,EAAE,CAAC,EAAE,GAAG,CAAC,CAAC,CAAA;IAC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AAY,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,EAAE,UAAU,EAAE,KAAK,EAAE,UAAU,EAAE,CAAC,CAAC,CAAC,SAAS,aACtM,CAAC,CAAC,IAAI,EACN,CAAC,CAAC,KAAK,KAFM,CAAC,CAAC,KAAK,CAGX,CACb,CAAC,GACW,GACC,GACX,IACC,CACb,GACU,CACd,KArDa,EAAE,CAsDN,CACb,CAAA;gCACH,CAAC,CAAC,KA1EW,GAAG,CA2EP,CACZ,CAAA;oBACH,CAAC,CAAC,GACS,IACF,GACI,CACpB,CAAA;AACH,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { Avatar } from "@chakra-ui/react";
|
|
2
|
+
declare const PALETTES: readonly ["blue", "teal", "purple", "orange", "pink", "cyan"];
|
|
3
|
+
/** The same name always gets the same color, in every app. */
|
|
4
|
+
export declare function avatarPaletteFor(name: string): (typeof PALETTES)[number];
|
|
5
|
+
export interface MemberAvatarProps extends Omit<Avatar.RootProps, "children"> {
|
|
6
|
+
name: string;
|
|
7
|
+
image?: string | null;
|
|
8
|
+
}
|
|
9
|
+
/** A person's avatar: their picture, or their initials on a color picked from their name. */
|
|
10
|
+
export declare function MemberAvatar({ name, image, ...rest }: MemberAvatarProps): import("react").JSX.Element;
|
|
11
|
+
export {};
|
|
12
|
+
//# sourceMappingURL=member-avatar.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"member-avatar.d.ts","sourceRoot":"","sources":["../../src/blocks/member-avatar.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAA;AAEzC,QAAA,MAAM,QAAQ,+DAAgE,CAAA;AAE9E,8DAA8D;AAC9D,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,MAAM,GAAG,CAAC,OAAO,QAAQ,CAAC,CAAC,MAAM,CAAC,CAGxE;AAED,MAAM,WAAW,iBAAkB,SAAQ,IAAI,CAAC,MAAM,CAAC,SAAS,EAAE,UAAU,CAAC;IAC3E,IAAI,EAAE,MAAM,CAAA;IACZ,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;CACtB;AAED,6FAA6F;AAC7F,wBAAgB,YAAY,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,GAAG,IAAI,EAAE,EAAE,iBAAiB,+BAOvE"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { Avatar } from "@chakra-ui/react";
|
|
4
|
+
const PALETTES = ["blue", "teal", "purple", "orange", "pink", "cyan"];
|
|
5
|
+
/** The same name always gets the same color, in every app. */
|
|
6
|
+
export function avatarPaletteFor(name) {
|
|
7
|
+
const hash = [...name].reduce((h, char) => (h * 31 + (char.codePointAt(0) ?? 0)) >>> 0, 0);
|
|
8
|
+
return PALETTES[hash % PALETTES.length];
|
|
9
|
+
}
|
|
10
|
+
/** A person's avatar: their picture, or their initials on a color picked from their name. */
|
|
11
|
+
export function MemberAvatar({ name, image, ...rest }) {
|
|
12
|
+
return (_jsxs(Avatar.Root, { colorPalette: avatarPaletteFor(name), title: name, ...rest, children: [image && _jsx(Avatar.Image, { src: image, alt: "" }), _jsx(Avatar.Fallback, { name: name })] }));
|
|
13
|
+
}
|
|
14
|
+
//# sourceMappingURL=member-avatar.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"member-avatar.js","sourceRoot":"","sources":["../../src/blocks/member-avatar.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAA;;AAEZ,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAA;AAEzC,MAAM,QAAQ,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,CAAU,CAAA;AAE9E,8DAA8D;AAC9D,MAAM,UAAU,gBAAgB,CAAC,IAAY;IAC3C,MAAM,IAAI,GAAG,CAAC,GAAG,IAAI,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,EAAE,CAAC,CAAC,CAAC,GAAG,EAAE,GAAG,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC,CAAA;IAC1F,OAAO,QAAQ,CAAC,IAAI,GAAG,QAAQ,CAAC,MAAM,CAAE,CAAA;AAC1C,CAAC;AAOD,6FAA6F;AAC7F,MAAM,UAAU,YAAY,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,GAAG,IAAI,EAAqB;IACtE,OAAO,CACL,MAAC,MAAM,CAAC,IAAI,IAAC,YAAY,EAAE,gBAAgB,CAAC,IAAI,CAAC,EAAE,KAAK,EAAE,IAAI,KAAM,IAAI,aACrE,KAAK,IAAI,KAAC,MAAM,CAAC,KAAK,IAAC,GAAG,EAAE,KAAK,EAAE,GAAG,EAAC,EAAE,GAAG,EAC7C,KAAC,MAAM,CAAC,QAAQ,IAAC,IAAI,EAAE,IAAI,GAAI,IACnB,CACf,CAAA;AACH,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { type StatusPageProps } from "./status-page.js";
|
|
2
|
+
export type NoAccessPageProps = Partial<Omit<StatusPageProps, "icon">>;
|
|
3
|
+
/**
|
|
4
|
+
* Shown when the API answers 403 missing_role (the user is signed in but has
|
|
5
|
+
* none of ALLOWED_ROLES). Every app shows this same page; pass a sign-out
|
|
6
|
+
* button as `actions` so the user can switch accounts.
|
|
7
|
+
*/
|
|
8
|
+
export declare function NoAccessPage(props: NoAccessPageProps): import("react").JSX.Element;
|
|
9
|
+
//# sourceMappingURL=no-access-page.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"no-access-page.d.ts","sourceRoot":"","sources":["../../src/blocks/no-access-page.tsx"],"names":[],"mappings":"AAKA,OAAO,EAAc,KAAK,eAAe,EAAE,MAAM,kBAAkB,CAAA;AAEnE,MAAM,MAAM,iBAAiB,GAAG,OAAO,CAAC,IAAI,CAAC,eAAe,EAAE,MAAM,CAAC,CAAC,CAAA;AAEtE;;;;GAIG;AACH,wBAAgB,YAAY,CAAC,KAAK,EAAE,iBAAiB,+BAGpD"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
import { LuShieldX } from "react-icons/lu";
|
|
4
|
+
import { useUiMessages } from "../i18n.js";
|
|
5
|
+
import { StatusPage } from "./status-page.js";
|
|
6
|
+
/**
|
|
7
|
+
* Shown when the API answers 403 missing_role (the user is signed in but has
|
|
8
|
+
* none of ALLOWED_ROLES). Every app shows this same page; pass a sign-out
|
|
9
|
+
* button as `actions` so the user can switch accounts.
|
|
10
|
+
*/
|
|
11
|
+
export function NoAccessPage(props) {
|
|
12
|
+
const m = useUiMessages().noAccess;
|
|
13
|
+
return _jsx(StatusPage, { icon: _jsx(LuShieldX, {}), title: m.title, description: m.description, ...props });
|
|
14
|
+
}
|
|
15
|
+
//# sourceMappingURL=no-access-page.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"no-access-page.js","sourceRoot":"","sources":["../../src/blocks/no-access-page.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAA;;AAEZ,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAA;AAE1C,OAAO,EAAE,aAAa,EAAE,MAAM,YAAY,CAAA;AAC1C,OAAO,EAAE,UAAU,EAAwB,MAAM,kBAAkB,CAAA;AAInE;;;;GAIG;AACH,MAAM,UAAU,YAAY,CAAC,KAAwB;IACnD,MAAM,CAAC,GAAG,aAAa,EAAE,CAAC,QAAQ,CAAA;IAClC,OAAO,KAAC,UAAU,IAAC,IAAI,EAAE,KAAC,SAAS,KAAG,EAAE,KAAK,EAAE,CAAC,CAAC,KAAK,EAAE,WAAW,EAAE,CAAC,CAAC,WAAW,KAAM,KAAK,GAAI,CAAA;AACnG,CAAC"}
|