@calliopelabs/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 +21 -0
- package/README.md +332 -2
- package/dist/appearance/AppearancePicker.d.ts +10 -0
- package/dist/appearance/AppearancePicker.js +75 -0
- package/dist/appearance/AppearanceProvider.d.ts +53 -0
- package/dist/appearance/AppearanceProvider.js +113 -0
- package/dist/appearance/AppearanceScript.d.ts +16 -0
- package/dist/appearance/AppearanceScript.js +14 -0
- package/dist/appearance/appearance.d.ts +90 -0
- package/dist/appearance/appearance.js +151 -0
- package/dist/appearance/boot.d.ts +30 -0
- package/dist/appearance/boot.js +91 -0
- package/dist/appearance/brands.d.ts +94 -0
- package/dist/appearance/brands.js +61 -0
- package/dist/appearance/product.d.ts +89 -0
- package/dist/appearance/product.js +96 -0
- package/dist/data/DataTable.d.ts +66 -0
- package/dist/data/DataTable.js +148 -0
- package/dist/data/List.d.ts +55 -0
- package/dist/data/List.js +41 -0
- package/dist/data/types.d.ts +92 -0
- package/dist/data/types.js +2 -0
- package/dist/data/use-row-selection.d.ts +17 -0
- package/dist/data/use-row-selection.js +51 -0
- package/dist/index.d.ts +50 -0
- package/dist/index.js +61 -0
- package/dist/lib/cn.d.ts +3 -0
- package/dist/lib/cn.js +6 -0
- package/dist/lib/local-store.d.ts +12 -0
- package/dist/lib/local-store.js +54 -0
- package/dist/nav/Nav.d.ts +21 -0
- package/dist/nav/Nav.js +97 -0
- package/dist/nav/model.d.ts +77 -0
- package/dist/nav/model.js +72 -0
- package/dist/overlays/ConfirmDialog.d.ts +37 -0
- package/dist/overlays/ConfirmDialog.js +70 -0
- package/dist/overlays/Dialog.d.ts +18 -0
- package/dist/overlays/Dialog.js +39 -0
- package/dist/overlays/Drawer.d.ts +24 -0
- package/dist/overlays/Drawer.js +42 -0
- package/dist/page/Breadcrumbs.d.ts +20 -0
- package/dist/page/Breadcrumbs.js +25 -0
- package/dist/page/PageFrame.d.ts +17 -0
- package/dist/page/PageFrame.js +14 -0
- package/dist/page/PageHeader.d.ts +28 -0
- package/dist/page/PageHeader.js +13 -0
- package/dist/page/Section.d.ts +18 -0
- package/dist/page/Section.js +12 -0
- package/dist/page/TabNav.d.ts +19 -0
- package/dist/page/TabNav.js +16 -0
- package/dist/primitives/Button.d.ts +16 -0
- package/dist/primitives/Button.js +36 -0
- package/dist/primitives/Checkbox.d.ts +8 -0
- package/dist/primitives/Checkbox.js +13 -0
- package/dist/primitives/DropdownMenu.d.ts +11 -0
- package/dist/primitives/DropdownMenu.js +25 -0
- package/dist/primitives/Input.d.ts +2 -0
- package/dist/primitives/Input.js +5 -0
- package/dist/primitives/Popover.d.ts +5 -0
- package/dist/primitives/Popover.js +13 -0
- package/dist/primitives/Skeleton.d.ts +3 -0
- package/dist/primitives/Skeleton.js +6 -0
- package/dist/primitives/Tabs.d.ts +12 -0
- package/dist/primitives/Tabs.js +22 -0
- package/dist/provider/UIProvider.d.ts +29 -0
- package/dist/provider/UIProvider.js +21 -0
- package/dist/provider/messages.d.ts +106 -0
- package/dist/provider/messages.js +104 -0
- package/dist/shell/AppShell.d.ts +43 -0
- package/dist/shell/AppShell.js +62 -0
- package/dist/shell/BrandMark.d.ts +14 -0
- package/dist/shell/BrandMark.js +14 -0
- package/dist/shell/RailPanel.d.ts +39 -0
- package/dist/shell/RailPanel.js +62 -0
- package/dist/shell/RailTree.d.ts +35 -0
- package/dist/shell/RailTree.js +32 -0
- package/dist/shell/Sidebar.d.ts +26 -0
- package/dist/shell/Sidebar.js +21 -0
- package/dist/shell/UserMenu.d.ts +22 -0
- package/dist/shell/UserMenu.js +31 -0
- package/dist/shell/placement.d.ts +10 -0
- package/dist/shell/placement.js +6 -0
- package/dist/shell/rail-state.d.ts +13 -0
- package/dist/shell/rail-state.js +28 -0
- package/dist/states/EmptyState.d.ts +20 -0
- package/dist/states/EmptyState.js +15 -0
- package/dist/states/ErrorState.d.ts +23 -0
- package/dist/states/ErrorState.js +16 -0
- package/dist/states/LoadingState.d.ts +14 -0
- package/dist/states/LoadingState.js +14 -0
- package/dist/status/StatusBadge.d.ts +19 -0
- package/dist/status/StatusBadge.js +13 -0
- package/dist/status/StatusDot.d.ts +14 -0
- package/dist/status/StatusDot.js +7 -0
- package/dist/status/tones.d.ts +17 -0
- package/dist/status/tones.js +29 -0
- package/dist/styles/preset.css +175 -0
- package/dist/styles/theme.css +339 -0
- package/dist/theme/contrast.d.ts +8 -0
- package/dist/theme/contrast.js +18 -0
- package/dist/theme/css.d.ts +23 -0
- package/dist/theme/css.js +116 -0
- package/dist/theme/tokens.d.ts +195 -0
- package/dist/theme/tokens.js +294 -0
- package/package.json +112 -4
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { XIcon } from "lucide-react";
|
|
4
|
+
import { Dialog as DrawerPrimitive } from "radix-ui";
|
|
5
|
+
import { cn } from "../lib/cn.js";
|
|
6
|
+
import { useUI } from "../provider/UIProvider.js";
|
|
7
|
+
import { overlayClassName } from "./Dialog.js";
|
|
8
|
+
export function Drawer(props) {
|
|
9
|
+
return _jsx(DrawerPrimitive.Root, { "data-slot": "drawer", ...props });
|
|
10
|
+
}
|
|
11
|
+
export function DrawerTrigger(props) {
|
|
12
|
+
return _jsx(DrawerPrimitive.Trigger, { "data-slot": "drawer-trigger", ...props });
|
|
13
|
+
}
|
|
14
|
+
export function DrawerClose(props) {
|
|
15
|
+
return _jsx(DrawerPrimitive.Close, { "data-slot": "drawer-close", ...props });
|
|
16
|
+
}
|
|
17
|
+
const SIDE = {
|
|
18
|
+
right: "inset-y-0 right-0 h-full w-3/4 border-l data-[state=open]:animate-cui-slide-in-right sm:max-w-sm",
|
|
19
|
+
left: "inset-y-0 left-0 h-full w-3/4 border-r data-[state=open]:animate-cui-slide-in-left sm:max-w-sm",
|
|
20
|
+
bottom: "inset-x-0 bottom-0 max-h-[85dvh] border-t data-[state=open]:animate-cui-slide-in-bottom",
|
|
21
|
+
};
|
|
22
|
+
/**
|
|
23
|
+
* A modal panel from an edge: secondary content that should not cost a page
|
|
24
|
+
* (a detail sheet, a filter set), and the shell's rails on narrow screens.
|
|
25
|
+
* The Astrolift UI calls it a sheet.
|
|
26
|
+
*/
|
|
27
|
+
export function DrawerContent({ className, children, side = "right", hideCloseButton = false, ...props }) {
|
|
28
|
+
const { messages } = useUI();
|
|
29
|
+
return (_jsxs(DrawerPrimitive.Portal, { children: [_jsx(DrawerPrimitive.Overlay, { "data-slot": "drawer-overlay", className: overlayClassName() }), _jsxs(DrawerPrimitive.Content, { "data-slot": "drawer-content", "data-side": side, className: cn("fixed z-50 flex flex-col gap-4 overflow-y-auto border-border bg-background text-sm text-foreground shadow-lg outline-none", SIDE[side], className), ...props, children: [children, !hideCloseButton && (_jsx(DrawerPrimitive.Close, { "data-slot": "drawer-close-button", "aria-label": messages.dialog.close, className: "absolute top-3 right-3 rounded-lg p-1 text-muted-foreground transition-colors hover:text-foreground focus-visible:ring-2 focus-visible:ring-ring focus-visible:outline-none", children: _jsx(XIcon, { className: "size-4", "aria-hidden": true }) }))] })] }));
|
|
30
|
+
}
|
|
31
|
+
export function DrawerHeader({ className, ...props }) {
|
|
32
|
+
return (_jsx("div", { "data-slot": "drawer-header", className: cn("flex flex-col gap-1 p-4 pr-10", className), ...props }));
|
|
33
|
+
}
|
|
34
|
+
export function DrawerFooter({ className, ...props }) {
|
|
35
|
+
return (_jsx("div", { "data-slot": "drawer-footer", className: cn("mt-auto flex flex-col gap-2 p-4", className), ...props }));
|
|
36
|
+
}
|
|
37
|
+
export function DrawerTitle({ className, ...props }) {
|
|
38
|
+
return (_jsx(DrawerPrimitive.Title, { "data-slot": "drawer-title", className: cn("font-head text-base font-semibold text-foreground", className), ...props }));
|
|
39
|
+
}
|
|
40
|
+
export function DrawerDescription({ className, ...props }) {
|
|
41
|
+
return (_jsx(DrawerPrimitive.Description, { "data-slot": "drawer-description", className: cn("text-sm text-muted-foreground", className), ...props }));
|
|
42
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { CrumbSwitchOption } from "../nav/model.js";
|
|
2
|
+
export interface Crumb {
|
|
3
|
+
label: string;
|
|
4
|
+
/** Absent on the last crumb, the page itself. */
|
|
5
|
+
href?: string;
|
|
6
|
+
/** The sideways move: the area's other functions (`areaSwitcher`), or the person's projects. */
|
|
7
|
+
switcher?: readonly CrumbSwitchOption[];
|
|
8
|
+
}
|
|
9
|
+
export interface BreadcrumbsProps {
|
|
10
|
+
crumbs: readonly Crumb[];
|
|
11
|
+
/** The landmark's name. Defaults to "Breadcrumb". */
|
|
12
|
+
label?: string;
|
|
13
|
+
className?: string;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Where the page sits. Crumbs come from the navigation model, never from
|
|
17
|
+
* path segments (a segment is not always a page). The first crumb usually
|
|
18
|
+
* switches between the area's functions.
|
|
19
|
+
*/
|
|
20
|
+
export declare function Breadcrumbs({ crumbs, label, className }: BreadcrumbsProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { CheckIcon, ChevronDownIcon } from "lucide-react";
|
|
4
|
+
import { cn } from "../lib/cn.js";
|
|
5
|
+
import { DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuTrigger, } from "../primitives/DropdownMenu.js";
|
|
6
|
+
import { useUI } from "../provider/UIProvider.js";
|
|
7
|
+
/**
|
|
8
|
+
* Where the page sits. Crumbs come from the navigation model, never from
|
|
9
|
+
* path segments (a segment is not always a page). The first crumb usually
|
|
10
|
+
* switches between the area's functions.
|
|
11
|
+
*/
|
|
12
|
+
export function Breadcrumbs({ crumbs, label, className }) {
|
|
13
|
+
const { messages } = useUI();
|
|
14
|
+
return (_jsx("nav", { "aria-label": label ?? messages.breadcrumb.label, className: cn("min-w-0", className), children: _jsx("ol", { className: "flex min-w-0 flex-wrap items-center gap-1.5 text-sm text-muted-foreground", children: crumbs.map((crumb, i) => (_jsxs("li", { className: "flex min-w-0 items-center gap-1.5", children: [i > 0 && (_jsx("span", { "aria-hidden": true, className: "text-muted-foreground/60", children: "\u203A" })), _jsx(CrumbItem, { crumb: crumb, isLast: i === crumbs.length - 1 })] }, `${crumb.label}-${i}`))) }) }));
|
|
15
|
+
}
|
|
16
|
+
function CrumbItem({ crumb, isLast }) {
|
|
17
|
+
const { Link, messages } = useUI();
|
|
18
|
+
if (crumb.switcher && crumb.switcher.length > 0) {
|
|
19
|
+
return (_jsxs(DropdownMenu, { children: [_jsxs(DropdownMenuTrigger, { "aria-label": messages.breadcrumb.switchFrom(crumb.label), className: "inline-flex min-w-0 items-center gap-1 rounded-lg hover:text-foreground focus-visible:ring-2 focus-visible:ring-ring focus-visible:outline-none", children: [_jsx("span", { className: "truncate", children: crumb.label }), _jsx(ChevronDownIcon, { className: "size-3.5 shrink-0", "aria-hidden": true })] }), _jsx(DropdownMenuContent, { className: "min-w-48", children: crumb.switcher.map((option) => (_jsx(DropdownMenuItem, { asChild: true, children: _jsxs(Link, { href: option.href, "aria-current": option.active ? "page" : undefined, children: [_jsx(CheckIcon, { className: cn("size-3.5", !option.active && "invisible"), "aria-hidden": true }), option.label] }) }, option.href))) })] }));
|
|
20
|
+
}
|
|
21
|
+
if (isLast || !crumb.href) {
|
|
22
|
+
return (_jsx("span", { "aria-current": isLast ? "page" : undefined, className: cn("min-w-0 truncate", isLast && "text-foreground"), children: crumb.label }));
|
|
23
|
+
}
|
|
24
|
+
return (_jsx(Link, { href: crumb.href, className: "min-w-0 truncate rounded-lg hover:text-foreground focus-visible:ring-2 focus-visible:ring-ring focus-visible:outline-none", children: crumb.label }));
|
|
25
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type * as React from "react";
|
|
2
|
+
import { type PageHeaderProps } from "./PageHeader.js";
|
|
3
|
+
export interface PageFrameProps extends PageHeaderProps {
|
|
4
|
+
/** The filter bar, under the header: search, filter selects, the list's actions. */
|
|
5
|
+
filters?: React.ReactNode;
|
|
6
|
+
/** A notice the reader must see before the body (a one-time reveal). Not a second list. */
|
|
7
|
+
notice?: React.ReactNode;
|
|
8
|
+
children: React.ReactNode;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* A page: its header (breadcrumb, title, actions, tabs), an optional filter
|
|
12
|
+
* bar and notice, then the body. The body is made of Sections holding Cards,
|
|
13
|
+
* tables or charts, two container levels at most (Astrolift's container
|
|
14
|
+
* rule). A page fits about two screens; more becomes a tab, a section that
|
|
15
|
+
* loads when opened, or a drawer.
|
|
16
|
+
*/
|
|
17
|
+
export declare function PageFrame({ filters, notice, children, className, ...header }: PageFrameProps): React.JSX.Element;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { cn } from "../lib/cn.js";
|
|
4
|
+
import { PageHeader } from "./PageHeader.js";
|
|
5
|
+
/**
|
|
6
|
+
* A page: its header (breadcrumb, title, actions, tabs), an optional filter
|
|
7
|
+
* bar and notice, then the body. The body is made of Sections holding Cards,
|
|
8
|
+
* tables or charts, two container levels at most (Astrolift's container
|
|
9
|
+
* rule). A page fits about two screens; more becomes a tab, a section that
|
|
10
|
+
* loads when opened, or a drawer.
|
|
11
|
+
*/
|
|
12
|
+
export function PageFrame({ filters, notice, children, className, ...header }) {
|
|
13
|
+
return (_jsxs("div", { "data-slot": "page-frame", className: cn("flex min-w-0 flex-1 flex-col gap-4", className), children: [_jsx(PageHeader, { ...header }), notice, filters && (_jsx("div", { "data-slot": "page-filters", className: "flex min-w-0 flex-wrap items-center gap-2", children: filters })), _jsx("div", { className: "flex min-w-0 flex-col gap-6", children: children })] }));
|
|
14
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import type * as React from "react";
|
|
2
|
+
import { type Crumb } from "./Breadcrumbs.js";
|
|
3
|
+
import { type TabNavItem } from "./TabNav.js";
|
|
4
|
+
export interface PageHeaderProps {
|
|
5
|
+
crumbs?: readonly Crumb[];
|
|
6
|
+
title: React.ReactNode;
|
|
7
|
+
/** A status badge beside the title. */
|
|
8
|
+
status?: React.ReactNode;
|
|
9
|
+
/** One line of context beside the title: environment, region, model. */
|
|
10
|
+
context?: React.ReactNode;
|
|
11
|
+
/** Supporting copy under the title row. */
|
|
12
|
+
description?: React.ReactNode;
|
|
13
|
+
/** The page's one primary action. */
|
|
14
|
+
primaryAction?: React.ReactNode;
|
|
15
|
+
/** The `⋯` menu, beside the primary action. */
|
|
16
|
+
menu?: React.ReactNode;
|
|
17
|
+
/** At most one row of tabs: the views of a list, or an entity's own tabs. */
|
|
18
|
+
tabs?: readonly TabNavItem[];
|
|
19
|
+
/** Names the tab row. Defaults to "Page". */
|
|
20
|
+
tabsLabel?: string;
|
|
21
|
+
className?: string;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Every page's header, in three rows (Astrolift spec 44 §4.4): the
|
|
25
|
+
* breadcrumb, the title row with its status, context and actions, and at
|
|
26
|
+
* most one row of tabs. Pure.
|
|
27
|
+
*/
|
|
28
|
+
export declare function PageHeader({ crumbs, title, status, context, description, primaryAction, menu, tabs, tabsLabel, className, }: PageHeaderProps): React.JSX.Element;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { cn } from "../lib/cn.js";
|
|
4
|
+
import { Breadcrumbs } from "./Breadcrumbs.js";
|
|
5
|
+
import { TabNav } from "./TabNav.js";
|
|
6
|
+
/**
|
|
7
|
+
* Every page's header, in three rows (Astrolift spec 44 §4.4): the
|
|
8
|
+
* breadcrumb, the title row with its status, context and actions, and at
|
|
9
|
+
* most one row of tabs. Pure.
|
|
10
|
+
*/
|
|
11
|
+
export function PageHeader({ crumbs, title, status, context, description, primaryAction, menu, tabs, tabsLabel = "Page", className, }) {
|
|
12
|
+
return (_jsxs("header", { "data-slot": "page-header", className: cn("flex min-w-0 flex-col gap-3", className), children: [crumbs && crumbs.length > 0 && _jsx(Breadcrumbs, { crumbs: crumbs }), _jsxs("div", { className: "flex min-w-0 flex-wrap items-center gap-x-3 gap-y-2", children: [_jsx("h1", { className: "min-w-0 truncate font-head text-xl font-semibold", children: title }), status, context && (_jsx("span", { className: "min-w-0 truncate text-sm text-muted-foreground", children: context })), (primaryAction || menu) && (_jsxs("div", { className: "ml-auto flex shrink-0 items-center gap-2", children: [primaryAction, menu] }))] }), description && (_jsx("div", { className: "max-w-2xl text-sm [overflow-wrap:anywhere] text-muted-foreground", children: description })), tabs && tabs.length > 0 && (_jsx(TabNav, { tabs: tabs, label: tabsLabel, className: "-mx-3 md:-mx-6" }))] }));
|
|
13
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type * as React from "react";
|
|
2
|
+
export interface SectionProps extends Omit<React.ComponentProps<"section">, "title"> {
|
|
3
|
+
title?: React.ReactNode;
|
|
4
|
+
description?: React.ReactNode;
|
|
5
|
+
/** Actions beside the title. */
|
|
6
|
+
action?: React.ReactNode;
|
|
7
|
+
/** A hairline under the heading; spacing alone by default. */
|
|
8
|
+
divided?: boolean;
|
|
9
|
+
/** For the document outline. Defaults to h2. */
|
|
10
|
+
headingLevel?: "h2" | "h3";
|
|
11
|
+
children: React.ReactNode;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* A page region, expressed as a heading rather than a border: the top level
|
|
15
|
+
* of `PageFrame > Section > (Card | table | chart)`. Never wrap a bordered box
|
|
16
|
+
* around another, and never put a Section inside a Card.
|
|
17
|
+
*/
|
|
18
|
+
export declare function Section({ title, description, action, divided, headingLevel, className, children, ...props }: SectionProps): React.JSX.Element;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { cn } from "../lib/cn.js";
|
|
3
|
+
/**
|
|
4
|
+
* A page region, expressed as a heading rather than a border: the top level
|
|
5
|
+
* of `PageFrame > Section > (Card | table | chart)`. Never wrap a bordered box
|
|
6
|
+
* around another, and never put a Section inside a Card.
|
|
7
|
+
*/
|
|
8
|
+
export function Section({ title, description, action, divided = false, headingLevel = "h2", className, children, ...props }) {
|
|
9
|
+
const Heading = headingLevel;
|
|
10
|
+
const hasHeader = Boolean(title || description || action);
|
|
11
|
+
return (_jsxs("section", { "data-slot": "section", className: cn("flex min-w-0 flex-col gap-4", className), ...props, children: [hasHeader && (_jsxs("div", { className: cn("flex flex-col gap-1 sm:flex-row sm:items-center sm:justify-between", divided && "border-b pb-3"), children: [_jsxs("div", { className: "flex min-w-0 flex-col gap-0.5", children: [title && _jsx(Heading, { className: "text-base font-semibold tracking-tight", children: title }), description && _jsx("p", { className: "text-sm text-muted-foreground", children: description })] }), action && _jsx("div", { className: "flex flex-wrap items-center gap-2", children: action })] })), children] }));
|
|
12
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export interface TabNavItem {
|
|
2
|
+
key: string;
|
|
3
|
+
label: string;
|
|
4
|
+
href: string;
|
|
5
|
+
active: boolean;
|
|
6
|
+
}
|
|
7
|
+
export interface TabNavProps {
|
|
8
|
+
tabs: readonly TabNavItem[];
|
|
9
|
+
/** The landmark's name ("Agent", "Views"). */
|
|
10
|
+
label: string;
|
|
11
|
+
className?: string;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Tabs that are pages: an entity's Overview, Activity, Settings; a list's
|
|
15
|
+
* views. Links, so each can be opened in a new tab and shared; the current
|
|
16
|
+
* one carries `aria-current="page"`. One row at most per page, named by
|
|
17
|
+
* function. On a narrow screen the row scrolls sideways under an edge fade.
|
|
18
|
+
*/
|
|
19
|
+
export declare function TabNav({ tabs, label, className }: TabNavProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { cn } from "../lib/cn.js";
|
|
4
|
+
import { useUI } from "../provider/UIProvider.js";
|
|
5
|
+
/**
|
|
6
|
+
* Tabs that are pages: an entity's Overview, Activity, Settings; a list's
|
|
7
|
+
* views. Links, so each can be opened in a new tab and shared; the current
|
|
8
|
+
* one carries `aria-current="page"`. One row at most per page, named by
|
|
9
|
+
* function. On a narrow screen the row scrolls sideways under an edge fade.
|
|
10
|
+
*/
|
|
11
|
+
export function TabNav({ tabs, label, className }) {
|
|
12
|
+
const { Link } = useUI();
|
|
13
|
+
return (_jsx("nav", { "aria-label": label, className: cn("flex min-w-0 [scrollbar-width:none] gap-1 overflow-x-auto border-b border-border [mask-image:linear-gradient(to_right,transparent_0,black_1.5rem,black_calc(100%-3rem),transparent_100%)] px-3 md:px-6", className), children: tabs.map((tab) => (_jsxs(Link, { href: tab.href, "aria-current": tab.active ? "page" : undefined, className: cn("relative shrink-0 rounded-lg px-3 py-2.5 text-sm transition-colors focus-visible:ring-2 focus-visible:ring-ring focus-visible:outline-none", tab.active
|
|
14
|
+
? "font-medium text-foreground"
|
|
15
|
+
: "text-muted-foreground hover:text-foreground"), children: [tab.label, tab.active && (_jsx("span", { "aria-hidden": true, className: "absolute inset-x-1 -bottom-px h-0.5 rounded-full bg-primary" }))] }, tab.key))) }));
|
|
16
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { type VariantProps } from "class-variance-authority";
|
|
2
|
+
import type * as React from "react";
|
|
3
|
+
/**
|
|
4
|
+
* Astrolift's button (shadcn), on the family tokens. Every size takes the
|
|
5
|
+
* corners setting (`rounded-lg` is `--radius`), so a 0px or 10px choice
|
|
6
|
+
* reaches buttons as it reaches panels.
|
|
7
|
+
*/
|
|
8
|
+
export declare const buttonVariants: (props?: ({
|
|
9
|
+
variant?: "link" | "default" | "outline" | "secondary" | "ghost" | "destructive" | null | undefined;
|
|
10
|
+
size?: "default" | "xs" | "sm" | "lg" | "icon" | "icon-xs" | "icon-sm" | "icon-lg" | null | undefined;
|
|
11
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
12
|
+
export interface ButtonProps extends React.ComponentProps<"button">, VariantProps<typeof buttonVariants> {
|
|
13
|
+
/** Render the child (a link, usually) with the button's styling instead of a <button>. */
|
|
14
|
+
asChild?: boolean;
|
|
15
|
+
}
|
|
16
|
+
export declare function Button({ className, variant, size, asChild, ...props }: ButtonProps): React.JSX.Element;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { cva } from "class-variance-authority";
|
|
3
|
+
import { Slot } from "radix-ui";
|
|
4
|
+
import { cn } from "../lib/cn.js";
|
|
5
|
+
/**
|
|
6
|
+
* Astrolift's button (shadcn), on the family tokens. Every size takes the
|
|
7
|
+
* corners setting (`rounded-lg` is `--radius`), so a 0px or 10px choice
|
|
8
|
+
* reaches buttons as it reaches panels.
|
|
9
|
+
*/
|
|
10
|
+
export const buttonVariants = cva("group/button inline-flex shrink-0 items-center justify-center rounded-lg border border-transparent bg-clip-padding text-sm font-medium whitespace-nowrap transition-colors outline-none select-none focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4", {
|
|
11
|
+
variants: {
|
|
12
|
+
variant: {
|
|
13
|
+
default: "bg-primary text-primary-foreground hover:bg-primary/85",
|
|
14
|
+
outline: "border-border bg-transparent hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground",
|
|
15
|
+
secondary: "bg-secondary text-secondary-foreground hover:bg-secondary/80 aria-expanded:bg-secondary",
|
|
16
|
+
ghost: "hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground",
|
|
17
|
+
destructive: "bg-danger/10 text-danger-fg hover:bg-danger/15 focus-visible:border-danger-border focus-visible:ring-danger/20",
|
|
18
|
+
link: "text-primary underline-offset-4 hover:underline",
|
|
19
|
+
},
|
|
20
|
+
size: {
|
|
21
|
+
default: "h-8 gap-1.5 px-2.5",
|
|
22
|
+
xs: "h-6 gap-1 px-2 text-xs [&_svg:not([class*='size-'])]:size-3",
|
|
23
|
+
sm: "h-7 gap-1 px-2.5 text-[0.8rem] [&_svg:not([class*='size-'])]:size-3.5",
|
|
24
|
+
lg: "h-9 gap-1.5 px-3",
|
|
25
|
+
icon: "size-8",
|
|
26
|
+
"icon-xs": "size-6 [&_svg:not([class*='size-'])]:size-3",
|
|
27
|
+
"icon-sm": "size-7",
|
|
28
|
+
"icon-lg": "size-9",
|
|
29
|
+
},
|
|
30
|
+
},
|
|
31
|
+
defaultVariants: { variant: "default", size: "default" },
|
|
32
|
+
});
|
|
33
|
+
export function Button({ className, variant, size, asChild = false, ...props }) {
|
|
34
|
+
const Component = asChild ? Slot.Root : "button";
|
|
35
|
+
return (_jsx(Component, { "data-slot": "button", "data-variant": variant ?? "default", className: cn(buttonVariants({ variant, size }), className), ...props }));
|
|
36
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { Checkbox as CheckboxPrimitive } from "radix-ui";
|
|
2
|
+
import type * as React from "react";
|
|
3
|
+
/**
|
|
4
|
+
* The selection box for data surfaces. Radix rather than a native input:
|
|
5
|
+
* `indeterminate` has no HTML attribute, so the header's "some selected"
|
|
6
|
+
* state cannot be expressed in JSX on a native box.
|
|
7
|
+
*/
|
|
8
|
+
export declare function Checkbox({ className, ...props }: React.ComponentProps<typeof CheckboxPrimitive.Root>): React.JSX.Element;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
import { CheckIcon, MinusIcon } from "lucide-react";
|
|
4
|
+
import { Checkbox as CheckboxPrimitive } from "radix-ui";
|
|
5
|
+
import { cn } from "../lib/cn.js";
|
|
6
|
+
/**
|
|
7
|
+
* The selection box for data surfaces. Radix rather than a native input:
|
|
8
|
+
* `indeterminate` has no HTML attribute, so the header's "some selected"
|
|
9
|
+
* state cannot be expressed in JSX on a native box.
|
|
10
|
+
*/
|
|
11
|
+
export function Checkbox({ className, ...props }) {
|
|
12
|
+
return (_jsx(CheckboxPrimitive.Root, { "data-slot": "checkbox", className: cn("peer size-4 shrink-0 rounded-sm border border-input transition-shadow outline-none focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:border-primary data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground data-[state=indeterminate]:border-primary data-[state=indeterminate]:bg-primary data-[state=indeterminate]:text-primary-foreground", className), ...props, children: _jsx(CheckboxPrimitive.Indicator, { "data-slot": "checkbox-indicator", className: "flex items-center justify-center text-current", children: props.checked === "indeterminate" ? (_jsx(MinusIcon, { className: "size-3.5", "aria-hidden": true })) : (_jsx(CheckIcon, { className: "size-3.5", "aria-hidden": true })) }) }));
|
|
13
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { DropdownMenu as DropdownMenuPrimitive } from "radix-ui";
|
|
2
|
+
import type * as React from "react";
|
|
3
|
+
export declare function DropdownMenu(props: React.ComponentProps<typeof DropdownMenuPrimitive.Root>): React.JSX.Element;
|
|
4
|
+
export declare function DropdownMenuTrigger(props: React.ComponentProps<typeof DropdownMenuPrimitive.Trigger>): React.JSX.Element;
|
|
5
|
+
export declare function DropdownMenuContent({ className, align, sideOffset, ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.Content>): React.JSX.Element;
|
|
6
|
+
export declare function DropdownMenuGroup(props: React.ComponentProps<typeof DropdownMenuPrimitive.Group>): React.JSX.Element;
|
|
7
|
+
export declare function DropdownMenuItem({ className, variant, ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.Item> & {
|
|
8
|
+
variant?: "default" | "destructive";
|
|
9
|
+
}): React.JSX.Element;
|
|
10
|
+
export declare function DropdownMenuLabel({ className, ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.Label>): React.JSX.Element;
|
|
11
|
+
export declare function DropdownMenuSeparator({ className, ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.Separator>): React.JSX.Element;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
import { DropdownMenu as DropdownMenuPrimitive } from "radix-ui";
|
|
4
|
+
import { cn } from "../lib/cn.js";
|
|
5
|
+
export function DropdownMenu(props) {
|
|
6
|
+
return _jsx(DropdownMenuPrimitive.Root, { "data-slot": "dropdown-menu", ...props });
|
|
7
|
+
}
|
|
8
|
+
export function DropdownMenuTrigger(props) {
|
|
9
|
+
return _jsx(DropdownMenuPrimitive.Trigger, { "data-slot": "dropdown-menu-trigger", ...props });
|
|
10
|
+
}
|
|
11
|
+
export function DropdownMenuContent({ className, align = "start", sideOffset = 4, ...props }) {
|
|
12
|
+
return (_jsx(DropdownMenuPrimitive.Portal, { children: _jsx(DropdownMenuPrimitive.Content, { "data-slot": "dropdown-menu-content", align: align, sideOffset: sideOffset, className: cn("z-50 max-h-(--radix-dropdown-menu-content-available-height) min-w-32 origin-(--radix-dropdown-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-lg bg-popover p-1 text-popover-foreground shadow-md ring-1 ring-foreground/10 data-[state=open]:animate-cui-fade-in", className), ...props }) }));
|
|
13
|
+
}
|
|
14
|
+
export function DropdownMenuGroup(props) {
|
|
15
|
+
return _jsx(DropdownMenuPrimitive.Group, { "data-slot": "dropdown-menu-group", ...props });
|
|
16
|
+
}
|
|
17
|
+
export function DropdownMenuItem({ className, variant = "default", ...props }) {
|
|
18
|
+
return (_jsx(DropdownMenuPrimitive.Item, { "data-slot": "dropdown-menu-item", "data-variant": variant, className: cn("relative flex cursor-default items-center gap-1.5 rounded-lg px-1.5 py-1 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground data-disabled:pointer-events-none data-disabled:opacity-50 data-[variant=destructive]:text-danger-fg data-[variant=destructive]:focus:bg-danger/10 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4", className), ...props }));
|
|
19
|
+
}
|
|
20
|
+
export function DropdownMenuLabel({ className, ...props }) {
|
|
21
|
+
return (_jsx(DropdownMenuPrimitive.Label, { "data-slot": "dropdown-menu-label", className: cn("px-1.5 py-1 text-xs font-medium text-muted-foreground", className), ...props }));
|
|
22
|
+
}
|
|
23
|
+
export function DropdownMenuSeparator({ className, ...props }) {
|
|
24
|
+
return (_jsx(DropdownMenuPrimitive.Separator, { "data-slot": "dropdown-menu-separator", className: cn("-mx-1 my-1 h-px bg-border", className), ...props }));
|
|
25
|
+
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { cn } from "../lib/cn.js";
|
|
3
|
+
export function Input({ className, type, ...props }) {
|
|
4
|
+
return (_jsx("input", { type: type, "data-slot": "input", className: cn("h-8 w-full min-w-0 rounded-lg border border-input bg-transparent px-2.5 py-1 text-base transition-colors outline-none placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 md:text-sm", className), ...props }));
|
|
5
|
+
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { Popover as PopoverPrimitive } from "radix-ui";
|
|
2
|
+
import type * as React from "react";
|
|
3
|
+
export declare function Popover(props: React.ComponentProps<typeof PopoverPrimitive.Root>): React.JSX.Element;
|
|
4
|
+
export declare function PopoverTrigger(props: React.ComponentProps<typeof PopoverPrimitive.Trigger>): React.JSX.Element;
|
|
5
|
+
export declare function PopoverContent({ className, align, sideOffset, ...props }: React.ComponentProps<typeof PopoverPrimitive.Content>): React.JSX.Element;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
import { Popover as PopoverPrimitive } from "radix-ui";
|
|
4
|
+
import { cn } from "../lib/cn.js";
|
|
5
|
+
export function Popover(props) {
|
|
6
|
+
return _jsx(PopoverPrimitive.Root, { "data-slot": "popover", ...props });
|
|
7
|
+
}
|
|
8
|
+
export function PopoverTrigger(props) {
|
|
9
|
+
return _jsx(PopoverPrimitive.Trigger, { "data-slot": "popover-trigger", ...props });
|
|
10
|
+
}
|
|
11
|
+
export function PopoverContent({ className, align = "center", sideOffset = 4, ...props }) {
|
|
12
|
+
return (_jsx(PopoverPrimitive.Portal, { children: _jsx(PopoverPrimitive.Content, { "data-slot": "popover-content", align: align, sideOffset: sideOffset, className: cn("z-50 flex w-72 origin-(--radix-popover-content-transform-origin) flex-col gap-2 rounded-lg bg-popover p-2.5 text-sm text-popover-foreground shadow-md ring-1 ring-foreground/10 outline-hidden data-[state=open]:animate-cui-fade-in", className), ...props }) }));
|
|
13
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { cn } from "../lib/cn.js";
|
|
3
|
+
/** A placeholder block with the geometry of what it stands in for. It pulses; with reduced motion it holds still. */
|
|
4
|
+
export function Skeleton({ className, ...props }) {
|
|
5
|
+
return (_jsx("div", { "data-slot": "skeleton", "aria-hidden": true, className: cn("animate-pulse rounded-lg bg-muted motion-reduce:animate-none", className), ...props }));
|
|
6
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { Tabs as TabsPrimitive } from "radix-ui";
|
|
2
|
+
import type * as React from "react";
|
|
3
|
+
/**
|
|
4
|
+
* In-page tabs: panels on one URL, with the ARIA tablist pattern (arrow keys
|
|
5
|
+
* move between tabs). Tabs that are pages (an entity's Overview, Logs,
|
|
6
|
+
* Settings) are links: use TabNav. The underline matches TabNav's, so the two
|
|
7
|
+
* read as one family.
|
|
8
|
+
*/
|
|
9
|
+
export declare function Tabs({ className, ...props }: React.ComponentProps<typeof TabsPrimitive.Root>): React.JSX.Element;
|
|
10
|
+
export declare function TabsList({ className, ...props }: React.ComponentProps<typeof TabsPrimitive.List>): React.JSX.Element;
|
|
11
|
+
export declare function TabsTrigger({ className, ...props }: React.ComponentProps<typeof TabsPrimitive.Trigger>): React.JSX.Element;
|
|
12
|
+
export declare function TabsContent({ className, ...props }: React.ComponentProps<typeof TabsPrimitive.Content>): React.JSX.Element;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
import { Tabs as TabsPrimitive } from "radix-ui";
|
|
4
|
+
import { cn } from "../lib/cn.js";
|
|
5
|
+
/**
|
|
6
|
+
* In-page tabs: panels on one URL, with the ARIA tablist pattern (arrow keys
|
|
7
|
+
* move between tabs). Tabs that are pages (an entity's Overview, Logs,
|
|
8
|
+
* Settings) are links: use TabNav. The underline matches TabNav's, so the two
|
|
9
|
+
* read as one family.
|
|
10
|
+
*/
|
|
11
|
+
export function Tabs({ className, ...props }) {
|
|
12
|
+
return (_jsx(TabsPrimitive.Root, { "data-slot": "tabs", className: cn("flex min-w-0 flex-col gap-4", className), ...props }));
|
|
13
|
+
}
|
|
14
|
+
export function TabsList({ className, ...props }) {
|
|
15
|
+
return (_jsx(TabsPrimitive.List, { "data-slot": "tabs-list", className: cn("flex min-w-0 gap-1 overflow-x-auto border-b border-border", className), ...props }));
|
|
16
|
+
}
|
|
17
|
+
export function TabsTrigger({ className, ...props }) {
|
|
18
|
+
return (_jsx(TabsPrimitive.Trigger, { "data-slot": "tabs-trigger", className: cn("relative shrink-0 px-3 py-2.5 text-sm text-muted-foreground transition-colors outline-none hover:text-foreground focus-visible:rounded-lg focus-visible:ring-2 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 data-[state=active]:font-medium data-[state=active]:text-foreground data-[state=active]:after:absolute data-[state=active]:after:inset-x-1 data-[state=active]:after:-bottom-px data-[state=active]:after:h-0.5 data-[state=active]:after:rounded-full data-[state=active]:after:bg-primary", className), ...props }));
|
|
19
|
+
}
|
|
20
|
+
export function TabsContent({ className, ...props }) {
|
|
21
|
+
return (_jsx(TabsPrimitive.Content, { "data-slot": "tabs-content", className: cn("min-w-0 outline-none focus-visible:ring-2 focus-visible:ring-ring", className), ...props }));
|
|
22
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { type MessageOverrides, type Messages } from "./messages.js";
|
|
3
|
+
/** What the package hands a link: anchor props with a string `href`. */
|
|
4
|
+
export interface LinkProps extends React.AnchorHTMLAttributes<HTMLAnchorElement> {
|
|
5
|
+
href: string;
|
|
6
|
+
ref?: React.Ref<HTMLAnchorElement>;
|
|
7
|
+
}
|
|
8
|
+
/** The app's link component: next/link, a router's Link, or a plain anchor. */
|
|
9
|
+
export type LinkComponent = React.ComponentType<LinkProps>;
|
|
10
|
+
interface UIContextValue {
|
|
11
|
+
Link: LinkComponent;
|
|
12
|
+
messages: Messages;
|
|
13
|
+
}
|
|
14
|
+
export interface UIProviderProps {
|
|
15
|
+
/** Rendered for every link the package draws. Defaults to a plain `<a>`. */
|
|
16
|
+
link?: LinkComponent;
|
|
17
|
+
/** Copy overrides, one level deep (`{ table: { retry: "Reintentar" } }`). */
|
|
18
|
+
messages?: MessageOverrides;
|
|
19
|
+
children: React.ReactNode;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* The app's environment: its link component and its copy. The package never
|
|
23
|
+
* imports a router, so this is how navigation stays the app's: pass next/link
|
|
24
|
+
* in a Next app, your router's Link elsewhere. Without a provider every link
|
|
25
|
+
* is a plain anchor and every string is English.
|
|
26
|
+
*/
|
|
27
|
+
export declare function UIProvider({ link, messages, children }: UIProviderProps): React.JSX.Element;
|
|
28
|
+
export declare function useUI(): UIContextValue;
|
|
29
|
+
export {};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
import * as React from "react";
|
|
4
|
+
import { defaultMessages, mergeMessages, } from "./messages.js";
|
|
5
|
+
function Anchor({ ref, children, ...props }) {
|
|
6
|
+
return (_jsx("a", { ref: ref, ...props, children: children }));
|
|
7
|
+
}
|
|
8
|
+
const UIContext = React.createContext({ Link: Anchor, messages: defaultMessages });
|
|
9
|
+
/**
|
|
10
|
+
* The app's environment: its link component and its copy. The package never
|
|
11
|
+
* imports a router, so this is how navigation stays the app's: pass next/link
|
|
12
|
+
* in a Next app, your router's Link elsewhere. Without a provider every link
|
|
13
|
+
* is a plain anchor and every string is English.
|
|
14
|
+
*/
|
|
15
|
+
export function UIProvider({ link, messages, children }) {
|
|
16
|
+
const value = React.useMemo(() => ({ Link: link ?? Anchor, messages: mergeMessages(messages) }), [link, messages]);
|
|
17
|
+
return _jsx(UIContext.Provider, { value: value, children: children });
|
|
18
|
+
}
|
|
19
|
+
export function useUI() {
|
|
20
|
+
return React.useContext(UIContext);
|
|
21
|
+
}
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Every string the package renders, in English. An app with a message
|
|
3
|
+
* catalog overrides any of them through `UIProvider messages={...}`; a
|
|
4
|
+
* message that takes a value is a function, so the app's own i18n formats
|
|
5
|
+
* it (plurals, numbers, word order).
|
|
6
|
+
*/
|
|
7
|
+
export interface Messages {
|
|
8
|
+
shell: {
|
|
9
|
+
skipToContent: string;
|
|
10
|
+
/** The mobile button and drawer title for the sidebar. */
|
|
11
|
+
navigation: string;
|
|
12
|
+
close: string;
|
|
13
|
+
};
|
|
14
|
+
nav: {
|
|
15
|
+
/** The sidebar's landmark name. */
|
|
16
|
+
label: string;
|
|
17
|
+
collapse: string;
|
|
18
|
+
expand: string;
|
|
19
|
+
collapseTitle: string;
|
|
20
|
+
expandTitle: string;
|
|
21
|
+
};
|
|
22
|
+
rail: {
|
|
23
|
+
show: (label: string) => string;
|
|
24
|
+
hide: (label: string) => string;
|
|
25
|
+
resize: (label: string) => string;
|
|
26
|
+
expand: (label: string) => string;
|
|
27
|
+
restore: (label: string) => string;
|
|
28
|
+
};
|
|
29
|
+
breadcrumb: {
|
|
30
|
+
label: string;
|
|
31
|
+
switchFrom: (label: string) => string;
|
|
32
|
+
};
|
|
33
|
+
table: {
|
|
34
|
+
search: string;
|
|
35
|
+
clearSearch: string;
|
|
36
|
+
results: (count: number) => string;
|
|
37
|
+
loading: string;
|
|
38
|
+
loadFailed: (label: string) => string;
|
|
39
|
+
requestFailed: string;
|
|
40
|
+
retry: string;
|
|
41
|
+
noMatches: string;
|
|
42
|
+
noMatchesDescription: (label: string) => string;
|
|
43
|
+
selected: (count: number) => string;
|
|
44
|
+
clearSelection: string;
|
|
45
|
+
selectRow: (id: string) => string;
|
|
46
|
+
selectPage: (label: string) => string;
|
|
47
|
+
actions: string;
|
|
48
|
+
rowActions: (label: string) => string;
|
|
49
|
+
rowsPerPage: string;
|
|
50
|
+
page: (page: number) => string;
|
|
51
|
+
previousPage: string;
|
|
52
|
+
nextPage: string;
|
|
53
|
+
sortKey: (index: number) => string;
|
|
54
|
+
};
|
|
55
|
+
states: {
|
|
56
|
+
errorTitle: string;
|
|
57
|
+
unexpected: string;
|
|
58
|
+
retry: string;
|
|
59
|
+
errorId: (digest: string) => string;
|
|
60
|
+
loading: string;
|
|
61
|
+
learnMore: string;
|
|
62
|
+
};
|
|
63
|
+
dialog: {
|
|
64
|
+
close: string;
|
|
65
|
+
};
|
|
66
|
+
confirm: {
|
|
67
|
+
confirm: string;
|
|
68
|
+
cancel: string;
|
|
69
|
+
working: string;
|
|
70
|
+
failed: string;
|
|
71
|
+
reasonRequired: string;
|
|
72
|
+
};
|
|
73
|
+
user: {
|
|
74
|
+
/** The collapsed trigger's name: it shows only the initials, so the name starts with them (WCAG 2.5.3). */
|
|
75
|
+
accountMenu: (name: string, initials: string) => string;
|
|
76
|
+
signOut: string;
|
|
77
|
+
};
|
|
78
|
+
appearance: {
|
|
79
|
+
locked: string;
|
|
80
|
+
themes: string;
|
|
81
|
+
accent: string;
|
|
82
|
+
ground: string;
|
|
83
|
+
density: string;
|
|
84
|
+
corners: string;
|
|
85
|
+
reset: string;
|
|
86
|
+
mode: (mode: "dark" | "light") => string;
|
|
87
|
+
groundLabel: (ground: string, label: string) => string;
|
|
88
|
+
accentLabel: (accent: string, label: string) => string;
|
|
89
|
+
densityLabel: (density: "compact" | "cards") => string;
|
|
90
|
+
densityHint: (density: "compact" | "cards") => string;
|
|
91
|
+
cornersLabel: (corners: number) => string;
|
|
92
|
+
customAccent: string;
|
|
93
|
+
customAccentPick: string;
|
|
94
|
+
customAccentHelp: string;
|
|
95
|
+
customAccentInvalid: string;
|
|
96
|
+
customAccentInUse: string;
|
|
97
|
+
customAccentOk: (ratio: string) => string;
|
|
98
|
+
customAccentFaint: (ratio: string, min: number, mode: "dark" | "light") => string;
|
|
99
|
+
};
|
|
100
|
+
}
|
|
101
|
+
export declare const defaultMessages: Messages;
|
|
102
|
+
/** Any subset of the messages, one level deep. */
|
|
103
|
+
export type MessageOverrides = {
|
|
104
|
+
[Group in keyof Messages]?: Partial<Messages[Group]>;
|
|
105
|
+
};
|
|
106
|
+
export declare function mergeMessages(overrides: MessageOverrides | undefined): Messages;
|