@alea-design/ui 0.0.0-stage → 0.1.1
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 +17 -2
- package/dist/components/accordion/Accordion.d.ts +29 -0
- package/dist/components/ai/AI.d.ts +157 -0
- package/dist/components/app/AppParts.d.ts +105 -0
- package/dist/components/button/Button.d.ts +95 -0
- package/dist/components/button/Groups.d.ts +91 -0
- package/dist/components/card/Card.d.ts +61 -0
- package/dist/components/chat/Chat.d.ts +191 -0
- package/dist/components/choice/Choice.d.ts +87 -0
- package/dist/components/color/Color.d.ts +77 -0
- package/dist/components/combobox/Autocomplete.d.ts +76 -0
- package/dist/components/combobox/ComboBox.d.ts +81 -0
- package/dist/components/combobox/Highlight.d.ts +27 -0
- package/dist/components/command/CommandPalette.d.ts +35 -0
- package/dist/components/content/Content.d.ts +120 -0
- package/dist/components/data/Data.d.ts +85 -0
- package/dist/components/date/Date.d.ts +48 -0
- package/dist/components/display/Display.d.ts +114 -0
- package/dist/components/display/Display2.d.ts +54 -0
- package/dist/components/emoji/EmojiPicker.d.ts +16 -0
- package/dist/components/emoji/emoji-data.d.ts +12 -0
- package/dist/components/extras/CodeSteps.d.ts +24 -0
- package/dist/components/extras/Extras.d.ts +84 -0
- package/dist/components/feedback/Feedback.d.ts +136 -0
- package/dist/components/feedback/Spinner.d.ts +12 -0
- package/dist/components/feedback/Status.d.ts +45 -0
- package/dist/components/field/Field.d.ts +130 -0
- package/dist/components/field/FieldLoading.d.ts +7 -0
- package/dist/components/filter/FilterBar.d.ts +48 -0
- package/dist/components/form/Form.d.ts +32 -0
- package/dist/components/icon/Icon.d.ts +47 -0
- package/dist/components/icon/icon-cells.d.ts +23 -0
- package/dist/components/icon/icon-contexts.d.ts +19 -0
- package/dist/components/icon/icon-names.d.ts +8 -0
- package/dist/components/layout/Bento.d.ts +42 -0
- package/dist/components/layout/Layout.d.ts +76 -0
- package/dist/components/layout/Layout2.d.ts +120 -0
- package/dist/components/layout/Layout3.d.ts +65 -0
- package/dist/components/layout/Responsive.d.ts +21 -0
- package/dist/components/list/List.d.ts +41 -0
- package/dist/components/list/Lists2.d.ts +79 -0
- package/dist/components/media/Media.d.ts +133 -0
- package/dist/components/menu/Menu.d.ts +87 -0
- package/dist/components/more/More.d.ts +176 -0
- package/dist/components/navigation/Navbar.d.ts +23 -0
- package/dist/components/navigation/Navigation.d.ts +88 -0
- package/dist/components/navigation/Navigation2.d.ts +152 -0
- package/dist/components/overlay/Drawer.d.ts +40 -0
- package/dist/components/overlay/Modal.d.ts +41 -0
- package/dist/components/overlay/Overlay.d.ts +95 -0
- package/dist/components/overlay/Sheet.d.ts +55 -0
- package/dist/components/page/Page.d.ts +91 -0
- package/dist/components/page/PageParts.d.ts +94 -0
- package/dist/components/picker/Picker.d.ts +136 -0
- package/dist/components/picker/Wheel.d.ts +63 -0
- package/dist/components/rating/Rating.d.ts +35 -0
- package/dist/components/select/Select.d.ts +116 -0
- package/dist/components/shell/AppShell.d.ts +52 -0
- package/dist/components/shell/AppSidebar.d.ts +55 -0
- package/dist/components/slider/Slider.d.ts +27 -0
- package/dist/components/table/Table.d.ts +45 -0
- package/dist/components/tabs/Tabs.d.ts +59 -0
- package/dist/components/theme/Theme.d.ts +94 -0
- package/dist/components/theme/lens.d.ts +18 -0
- package/dist/components/tree/Tree.d.ts +125 -0
- package/dist/components/typography/Typography.d.ts +59 -0
- package/dist/components/upload/Upload.d.ts +63 -0
- package/dist/components/work/Ops.d.ts +29 -0
- package/dist/components/work/Work.d.ts +216 -0
- package/dist/i18n/strings.d.ts +429 -0
- package/dist/index.d.ts +72 -0
- package/dist/index.js +7439 -0
- package/dist/styles.css +1 -0
- package/dist/utils/Blueprint.d.ts +12 -0
- package/dist/utils/DotField.d.ts +6 -0
- package/dist/utils/attr.d.ts +2 -0
- package/dist/utils/blueprintScene.d.ts +81 -0
- package/dist/utils/controlled.d.ts +2 -0
- package/dist/utils/cx.d.ts +2 -0
- package/dist/utils/inert.d.ts +2 -0
- package/dist/utils/responsive.d.ts +9 -0
- package/dist/utils/scrollEdges.d.ts +9 -0
- package/dist/utils/space.d.ts +2 -0
- package/package.json +68 -4
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { type ReactNode } from 'react';
|
|
2
|
+
import { type LinkProps } from 'react-aria-components';
|
|
3
|
+
export interface AppSidebarProps {
|
|
4
|
+
/** The top: usually a WorkspaceSwitcher. Stays in place while the links scroll. */
|
|
5
|
+
header?: ReactNode;
|
|
6
|
+
/** AppNavSections and AppNavItems. */
|
|
7
|
+
children: ReactNode;
|
|
8
|
+
/** The bottom: an invite button, a plan meter, help. */
|
|
9
|
+
footer?: ReactNode;
|
|
10
|
+
/** Name of the navigation. Default "Sidebar". */
|
|
11
|
+
'aria-label'?: string;
|
|
12
|
+
className?: string;
|
|
13
|
+
}
|
|
14
|
+
/** The side navigation of a web app: a workspace switcher on top, compact links, sections that fold. Pair it with AppShell layout="sidebar". */
|
|
15
|
+
export declare function AppSidebar({ header, children, footer, className, 'aria-label': label }: AppSidebarProps): import("react").JSX.Element;
|
|
16
|
+
export interface WorkspaceSwitcherProps {
|
|
17
|
+
/** The workspace or product name. */
|
|
18
|
+
name: ReactNode;
|
|
19
|
+
/** A logo or mark before the name (about 20 px). */
|
|
20
|
+
logo?: ReactNode;
|
|
21
|
+
/** The menu: MenuItems to switch workspaces, settings, sign out. Without it the name is plain text. */
|
|
22
|
+
children?: ReactNode;
|
|
23
|
+
/** Name of the menu button. Default "{name}, workspace menu" when name is text. */
|
|
24
|
+
'aria-label'?: string;
|
|
25
|
+
/** Icon buttons on the right: search, new item. */
|
|
26
|
+
actions?: ReactNode;
|
|
27
|
+
/** Called with the menu item's id. */
|
|
28
|
+
onAction?: (key: string | number) => void;
|
|
29
|
+
}
|
|
30
|
+
/** The workspace name at the top of the sidebar: a menu to switch workspaces, with quick actions beside it. */
|
|
31
|
+
export declare function WorkspaceSwitcher({ name, logo, children, actions, onAction, 'aria-label': label }: WorkspaceSwitcherProps): import("react").JSX.Element;
|
|
32
|
+
export interface AppNavSectionProps {
|
|
33
|
+
/** The section's name, small and muted. Leave it out for the first, main group. */
|
|
34
|
+
title?: ReactNode;
|
|
35
|
+
/** The AppNavItems. */
|
|
36
|
+
children: ReactNode;
|
|
37
|
+
/** People can fold it (a chevron next to the title). Default true when there is a title. */
|
|
38
|
+
collapsible?: boolean;
|
|
39
|
+
/** Open at first. Default true. */
|
|
40
|
+
defaultExpanded?: boolean;
|
|
41
|
+
/** Something on the right of the title: an add button. */
|
|
42
|
+
action?: ReactNode;
|
|
43
|
+
}
|
|
44
|
+
/** A group of links in the AppSidebar; with a title it folds. */
|
|
45
|
+
export declare function AppNavSection({ title, children, collapsible, defaultExpanded, action }: AppNavSectionProps): import("react").JSX.Element;
|
|
46
|
+
export interface AppNavItemProps extends LinkProps {
|
|
47
|
+
/** Marks the current page (aria-current). */
|
|
48
|
+
isCurrent?: boolean;
|
|
49
|
+
/** A 16 px icon before the label. */
|
|
50
|
+
icon?: ReactNode;
|
|
51
|
+
/** A count, a badge or a shortcut on the right. */
|
|
52
|
+
end?: ReactNode;
|
|
53
|
+
}
|
|
54
|
+
/** A compact link in the AppSidebar: icon, label and an optional count. */
|
|
55
|
+
export declare function AppNavItem({ isCurrent, icon, end, children, className, ...props }: AppNavItemProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
import { type SliderProps as RACSliderProps } from 'react-aria-components';
|
|
3
|
+
export interface SliderProps<T extends number | number[] = number> extends RACSliderProps<T> {
|
|
4
|
+
/** The visible label. */
|
|
5
|
+
label?: ReactNode;
|
|
6
|
+
/** Show the current value next to the label. Default true. */
|
|
7
|
+
showValue?: boolean;
|
|
8
|
+
/** Labels for each thumb in a range ("Minimum", "Maximum"). */
|
|
9
|
+
thumbLabels?: string[];
|
|
10
|
+
/** Marks along the track: true for one at every step, or values with optional labels ([{ value: 0, label: 'Off' }]). */
|
|
11
|
+
marks?: boolean | Array<{
|
|
12
|
+
value: number;
|
|
13
|
+
label?: ReactNode;
|
|
14
|
+
}>;
|
|
15
|
+
/** A bubble with the value over the thumb: while dragging or focused (default when showValue is false), always, or never. */
|
|
16
|
+
showTooltip?: 'drag' | 'always' | 'never';
|
|
17
|
+
/** sm (4 px track, 16 px thumb), md (default) or lg (8 px track, 24 px thumb). */
|
|
18
|
+
size?: 'sm' | 'md' | 'lg';
|
|
19
|
+
/** The fill color: accent (default), success, warning, danger or info. */
|
|
20
|
+
tone?: 'accent' | 'success' | 'warning' | 'danger' | 'info';
|
|
21
|
+
/** The fill starts here instead of the minimum: 0 in a −50 to 50 slider fills to either side. */
|
|
22
|
+
fillOffset?: number;
|
|
23
|
+
/** The value as words, shown and spoken instead of the number: "1:23 of 4:56", "16 px", "Loud". */
|
|
24
|
+
getValueText?: (value: number) => string;
|
|
25
|
+
}
|
|
26
|
+
/** Pick a value, or a range when value is an array (two thumbs): marks with labels, a value bubble, three sizes, tones and a centered fill. Arrows, Page Up/Down, Home and End work. */
|
|
27
|
+
export declare function Slider<T extends number | number[] = number>({ label, showValue, thumbLabels, marks, showTooltip, size, tone, fillOffset, getValueText, className, ...props }: SliderProps<T>): import("react").JSX.Element;
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { type ReactNode } from 'react';
|
|
2
|
+
import { type TableProps as RACTableProps, type TableHeaderProps, type ColumnProps as RACColumnProps, type TableBodyProps, type RowProps, type CellProps } from 'react-aria-components';
|
|
3
|
+
export interface TableProps extends RACTableProps {
|
|
4
|
+
/** Header stays visible while the body scrolls (needs a height on the container). */
|
|
5
|
+
stickyHeader?: boolean;
|
|
6
|
+
/** compact rows (40 px) or comfy (52 px, default). 'comfortable' is a deprecated alias of 'comfy'. */
|
|
7
|
+
density?: 'comfy' | 'compact' | 'comfortable';
|
|
8
|
+
/** Max height of the scroll area, e.g. 400. */
|
|
9
|
+
maxHeight?: number | string;
|
|
10
|
+
/** Lets people drag column edges to resize. */
|
|
11
|
+
resizable?: boolean;
|
|
12
|
+
/** default, striped (alternate row shades) or bordered (lines between columns too). */
|
|
13
|
+
variant?: 'default' | 'striped' | 'bordered';
|
|
14
|
+
/** Below this breakpoint each row becomes a card, every cell with its column label (give Cell a label). */
|
|
15
|
+
stackBelow?: 'sm' | 'md';
|
|
16
|
+
/** Renders only the rows on screen, for thousands of rows: fixed row height in px (needs maxHeight). */
|
|
17
|
+
virtualized?: {
|
|
18
|
+
rowHeight: number;
|
|
19
|
+
headingHeight?: number;
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
/** Data in rows and columns: sorting, row selection, sticky header, resizing, keyboard grid navigation. */
|
|
23
|
+
export declare function Table({ stickyHeader, density: densityProp, maxHeight, resizable, variant, stackBelow, virtualized, className, ...props }: TableProps): import("react").JSX.Element;
|
|
24
|
+
/** The header row. Adds the select-all checkbox when the table selects multiple rows. */
|
|
25
|
+
export declare function TableHeader<T extends object>({ columns, children, className, ...props }: TableHeaderProps<T>): import("react").JSX.Element;
|
|
26
|
+
export interface ColumnProps extends RACColumnProps {
|
|
27
|
+
children?: ReactNode;
|
|
28
|
+
/** Right-aligns numbers. */
|
|
29
|
+
align?: 'start' | 'end' | 'center';
|
|
30
|
+
}
|
|
31
|
+
/** A column header; allowsSorting shows the sort arrow and makes it pressable. */
|
|
32
|
+
export declare function Column({ children, align, className, ...props }: ColumnProps): import("react").JSX.Element;
|
|
33
|
+
/** The rows. renderEmptyState shows when there are none. */
|
|
34
|
+
export declare function TableBody<T extends object>({ className, ...props }: TableBodyProps<T>): import("react").JSX.Element;
|
|
35
|
+
/** A row; with selection it starts with a checkbox. */
|
|
36
|
+
export declare function Row<T extends object>({ id, columns, children, className, ...props }: RowProps<T>): import("react").JSX.Element;
|
|
37
|
+
/** A cell. */
|
|
38
|
+
export interface FlCellProps extends CellProps {
|
|
39
|
+
/** Text alignment: start (default), center, or end for numbers. */
|
|
40
|
+
align?: 'start' | 'end' | 'center';
|
|
41
|
+
/** The column's name, shown before the value when the table stacks into cards (stackBelow). */
|
|
42
|
+
label?: string;
|
|
43
|
+
}
|
|
44
|
+
/** A table cell. */
|
|
45
|
+
export declare function Cell({ className, ...props }: FlCellProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { type ReactNode } from 'react';
|
|
2
|
+
import { type TabsProps as RACTabsProps, type TabListProps as RACTabListProps, type TabProps as RACTabProps, type TabPanelProps } from 'react-aria-components';
|
|
3
|
+
export interface TabsProps extends RACTabsProps {
|
|
4
|
+
/** underline (default), pills (the segmented look), enclosed (card tabs joined to the panel) or soft (a tinted pill). */
|
|
5
|
+
variant?: 'underline' | 'pills' | 'enclosed' | 'soft';
|
|
6
|
+
/** sm (32 px tabs), md (40 px, default) or lg (48 px). */
|
|
7
|
+
size?: 'sm' | 'md' | 'lg';
|
|
8
|
+
/** The tabs share the full width equally. */
|
|
9
|
+
fitted?: boolean;
|
|
10
|
+
/** Where the tabs sit in the row when not fitted: start (default), center or end. */
|
|
11
|
+
justify?: 'start' | 'center' | 'end';
|
|
12
|
+
}
|
|
13
|
+
/** Switch between views: four looks, three sizes, icons, badges, closable tabs, extra content and scroll arrows when tabs overflow. Arrow keys move between tabs; Home and End jump. */
|
|
14
|
+
export declare function Tabs({ variant, size, fitted, justify, className, ...props }: TabsProps): import("react").JSX.Element;
|
|
15
|
+
export interface TabListProps<T extends object> extends RACTabListProps<T> {
|
|
16
|
+
/** Content at the end of the row, outside the tabs: an add button, a filter. */
|
|
17
|
+
extra?: ReactNode;
|
|
18
|
+
/** Makes the tabs reorderable: drag them, or Alt + Shift + arrows on the focused tab. Called with the moved tab's id and its new index; update your order. */
|
|
19
|
+
onReorder?: (key: string, toIndex: number) => void;
|
|
20
|
+
}
|
|
21
|
+
/** The row of tabs. Needs an aria-label when there is no visible heading for it. Shows scroll arrows when the tabs do not fit, and can be reordered. */
|
|
22
|
+
export declare function TabList<T extends object>({ className, extra, onReorder, ...props }: TabListProps<T>): import("react").JSX.Element;
|
|
23
|
+
export interface TabProps extends RACTabProps {
|
|
24
|
+
/** An icon before the label. */
|
|
25
|
+
icon?: ReactNode;
|
|
26
|
+
/** A count or short tag after the label. */
|
|
27
|
+
badge?: ReactNode;
|
|
28
|
+
/** Makes the tab closable: Delete or Backspace closes it, and an × shows for the pointer. */
|
|
29
|
+
onClose?: () => void;
|
|
30
|
+
}
|
|
31
|
+
/** One tab; its id matches a TabPanel. */
|
|
32
|
+
export declare function Tab({ className, children, icon, badge, onClose, ...props }: TabProps): import("react").JSX.Element;
|
|
33
|
+
/** The content for the tab with the same id. Pass shouldForceMount to keep it mounted while hidden. */
|
|
34
|
+
export declare function TabPanel({ className, ...props }: TabPanelProps): import("react").JSX.Element | null;
|
|
35
|
+
export interface TabNavItem {
|
|
36
|
+
/** Matches current. */
|
|
37
|
+
id: string;
|
|
38
|
+
label: ReactNode;
|
|
39
|
+
/** The page it opens. */
|
|
40
|
+
href: string;
|
|
41
|
+
/** An icon before the label. */
|
|
42
|
+
icon?: ReactNode;
|
|
43
|
+
/** A count or short word after the label. */
|
|
44
|
+
badge?: ReactNode;
|
|
45
|
+
}
|
|
46
|
+
export interface TabNavProps {
|
|
47
|
+
/** The pages of the section, in order. */
|
|
48
|
+
items: TabNavItem[];
|
|
49
|
+
/** The id of the page being shown. */
|
|
50
|
+
current?: string;
|
|
51
|
+
/** Name of the navigation ("Settings"). */
|
|
52
|
+
'aria-label': string;
|
|
53
|
+
/** The same looks and sizes as Tabs. */
|
|
54
|
+
variant?: TabsProps['variant'];
|
|
55
|
+
size?: TabsProps['size'];
|
|
56
|
+
className?: string;
|
|
57
|
+
}
|
|
58
|
+
/** Tabs that are links: the pages of one section (settings, a project, a profile), each with its own address. A navigation landmark; the current page is marked with aria-current. Use Tabs to switch views inside one page. */
|
|
59
|
+
export declare function TabNav({ items, current, variant, size, className, 'aria-label': label }: TabNavProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
import { type ReactNode } from 'react';
|
|
2
|
+
import { type MotionConfig } from '@alea-design/motion';
|
|
3
|
+
import { type AleaStrings } from '../../i18n/strings';
|
|
4
|
+
import { type GlassRefraction } from './lens';
|
|
5
|
+
/** Brand changes on top of the Alea tokens. Everything not set keeps the default. */
|
|
6
|
+
export interface BrandTheme {
|
|
7
|
+
/** Your accent color (any CSS color). Strong (for text and links), subtle and focus are mixed from it per theme; check text on it with ContrastBadge. */
|
|
8
|
+
accent?: string;
|
|
9
|
+
/** Text on solid accent surfaces. Default the kit's (near black). */
|
|
10
|
+
accentOn?: string;
|
|
11
|
+
/** Multiplies every radius: 0 square, 0.5 tight, 1 the Alea default, 1.4 rounder. */
|
|
12
|
+
radius?: number;
|
|
13
|
+
/** compact (controls 8 px shorter and the Compact space scale: base 2 px) or comfy (default). To change the space scale only, use the density prop of ThemeProvider. 'comfortable' is a deprecated alias of 'comfy'. */
|
|
14
|
+
density?: 'comfy' | 'compact' | 'comfortable';
|
|
15
|
+
/** Font stacks: body (UI and text), display (big titles), mono (code). Load the fonts yourself. */
|
|
16
|
+
fonts?: {
|
|
17
|
+
body?: string;
|
|
18
|
+
display?: string;
|
|
19
|
+
mono?: string;
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
export declare const COMPACT_SPACE: Record<string, string>;
|
|
23
|
+
/** Glass is the one look with its own ladder: twice Graphite from xs to 4xl; the hairlines 3xs and 2xs stay. */
|
|
24
|
+
export declare const GLASS_RADII: Array<[string, number]>;
|
|
25
|
+
/** The CSS variables a brand sets. Use it to theme a server-rendered page or a wrapper by hand. */
|
|
26
|
+
export declare function brandVariables(b?: BrandTheme, preset?: string): Record<string, string>;
|
|
27
|
+
export type ThemeName = 'dark' | 'light' | 'system';
|
|
28
|
+
interface ThemeContextValue {
|
|
29
|
+
/** The theme picked: dark, light or system. */
|
|
30
|
+
theme: ThemeName;
|
|
31
|
+
/** The theme in effect after resolving system. */
|
|
32
|
+
resolvedTheme: 'dark' | 'light';
|
|
33
|
+
setTheme: (theme: ThemeName) => void;
|
|
34
|
+
}
|
|
35
|
+
export interface ThemeProviderProps {
|
|
36
|
+
children: ReactNode;
|
|
37
|
+
/** Theme to start with when nothing is stored. Defaults to dark. */
|
|
38
|
+
defaultTheme?: ThemeName;
|
|
39
|
+
/** Controlled theme. */
|
|
40
|
+
theme?: ThemeName;
|
|
41
|
+
/** Called with the new theme when it changes. */
|
|
42
|
+
onThemeChange?: (theme: ThemeName) => void;
|
|
43
|
+
/** localStorage key to remember the choice; pass null to not store it. */
|
|
44
|
+
storageKey?: string | null;
|
|
45
|
+
/** Where data-theme goes: the document root (default) or a wrapper div. */
|
|
46
|
+
scope?: 'document' | 'element';
|
|
47
|
+
/** Class names for the wrapper (scope="element"). */
|
|
48
|
+
className?: string;
|
|
49
|
+
/** Brand changes: accent color, radius, density, fonts. */
|
|
50
|
+
brand?: BrandTheme;
|
|
51
|
+
/** Space density: "comfy" (default, base 4 px; "comfortable" is a deprecated alias) or "compact" (base 2 px: every space token halves, odd results rounded up to even). Sets data-density on the root or the wrapper; controls keep their size (use brand.density for shorter controls too). */
|
|
52
|
+
density?: 'comfy' | 'compact' | 'comfortable';
|
|
53
|
+
/** Your router's navigate function (React Router's useNavigate(), Next's router.push): links in the kit then navigate without a reload. */
|
|
54
|
+
navigate?: (path: string, options?: any) => void;
|
|
55
|
+
/** Your router's useHref, for routers with a base path. */
|
|
56
|
+
useHref?: (href: string) => string;
|
|
57
|
+
/** A BCP 47 locale ("es-ES", "pt-BR"): dates, numbers, calendars and the built-in labels follow it. Default the browser's. */
|
|
58
|
+
locale?: string;
|
|
59
|
+
/** A look on top of the tokens, each with dark and light: "graphite" is monochrome (near-black and white, gray surfaces, sans titles); "midnight" is serious and precise (navy, hairline borders, a clear blue accent and button, sans titles); "glass" is light and airy (frosted glass on every surface, Inter, a blue accent); "ember", "solar" and "moss" keep one hue each: warm red, amber and green, in dark and light. */
|
|
60
|
+
preset?: 'default' | 'graphite' | 'midnight' | 'glass' | 'ember' | 'solar' | 'moss';
|
|
61
|
+
/** "glass" turns floating surfaces (navbar, popovers, menus, dialogs, toasts, drawers) into frosted glass. */
|
|
62
|
+
surface?: 'solid' | 'glass';
|
|
63
|
+
/** system (default) raises contrast when the device asks for it; more always raises it to WCAG AAA (7:1 text, stronger borders); normal never does. */
|
|
64
|
+
contrast?: 'system' | 'more' | 'normal';
|
|
65
|
+
/** decorated (default) keeps the background orbs and aurora; plain turns them off for a flat page, in any look and contrast. */
|
|
66
|
+
background?: 'decorated' | 'plain';
|
|
67
|
+
/** The glass look's liquid edge (Chromium; others keep the frost): how much what is behind a glass surface bends at its edge,
|
|
68
|
+
* 'off', 'subtle', 'medium' (default) or 'strong', or a multiplier; lensSelector adds your own surfaces (CSS selector).
|
|
69
|
+
* The lens rests while the page scrolls and comes back ~150 ms after it stops (the frost stays); pauseOnScroll={false} keeps it on always. Surfaces over 400 x 300 px keep the frost only. */
|
|
70
|
+
glass?: {
|
|
71
|
+
refraction?: GlassRefraction;
|
|
72
|
+
lensSelector?: string;
|
|
73
|
+
pauseOnScroll?: boolean;
|
|
74
|
+
};
|
|
75
|
+
/** Change any text the kit writes (labels, placeholders, announcements), on top of the locale's pack (English and Spanish ship). */
|
|
76
|
+
strings?: Partial<AleaStrings>;
|
|
77
|
+
/** Motion for everything below: mode (expressive, productive, reduced, off), reduced (system, always, never), speed, intensity, and per-component defaults. */
|
|
78
|
+
motion?: MotionConfig;
|
|
79
|
+
}
|
|
80
|
+
/** An inline script for server-rendered pages: sets data-theme on <html> from the stored choice (or the OS) before
|
|
81
|
+
* the first paint, so the page never flashes the other theme. Put it in <head> with suppressHydrationWarning on <html>. */
|
|
82
|
+
export declare function themeScript(storageKey?: string, defaultTheme?: ThemeName): string;
|
|
83
|
+
/** The same script as an element, for React frameworks with server components (a server layout can render it; it cannot
|
|
84
|
+
* call themeScript() directly): <head><ThemeScript /></head>, with suppressHydrationWarning on <html>. */
|
|
85
|
+
export declare function ThemeScript({ storageKey, defaultTheme }: {
|
|
86
|
+
storageKey?: string;
|
|
87
|
+
defaultTheme?: ThemeName;
|
|
88
|
+
}): import("react").JSX.Element;
|
|
89
|
+
/** A router's useHref that leaves absolute URLs, protocol-relative URLs and #anchors alone (routers would turn https://… into /current/https:/…). */
|
|
90
|
+
export declare function keepAbsolute(useHref: (href: string) => string): (href: string) => string;
|
|
91
|
+
export declare function ThemeProvider({ children, defaultTheme, theme: controlled, onThemeChange, storageKey, scope, className, brand, density, navigate, useHref, locale, motion, preset, surface, contrast, background, strings, glass }: ThemeProviderProps): import("react").JSX.Element;
|
|
92
|
+
/** The current theme and a setter. Works without a provider (reads the document). */
|
|
93
|
+
export declare function useTheme(): ThemeContextValue;
|
|
94
|
+
export {};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/** The surfaces that get the lens in the glass look (any element can opt in with data-alea-lens). */
|
|
2
|
+
export declare const LENS_SURFACES = ".alea-popover, .alea-modal, .alea-toast, .alea-command, .alea-hovercard, .alea-menu, .alea-button[data-variant=\"secondary\"], .alea-button[data-variant=\"primary\"], .alea-input-wrap, .alea-select-trigger, .alea-segmented, .alea-tag, .alea-switch-track, [data-alea-lens]";
|
|
3
|
+
/** How much the edge bends: a word or a multiplier (1 = medium). */
|
|
4
|
+
export type GlassRefraction = 'off' | 'subtle' | 'medium' | 'strong' | number;
|
|
5
|
+
export declare function refractionLevel(r: GlassRefraction | undefined): number;
|
|
6
|
+
/** How long after the last scroll event the lens comes back (ms). */
|
|
7
|
+
export declare const LENS_IDLE_MS = 150;
|
|
8
|
+
export declare function supportsLens(): boolean;
|
|
9
|
+
/** Pauses the lens while the page scrolls: one attribute on <html> (data-alea-scrolling), set on the first scroll event
|
|
10
|
+
* of a burst and removed after LENS_IDLE_MS of quiet. The stylesheet turns the lens off under it (the frost stays),
|
|
11
|
+
* so a scroll never pays for the SVG filters. Scroll events do not bubble, so one capturing listener hears every
|
|
12
|
+
* scroll container. Opt out with data-alea-lens-pause="off" on <html> (ThemeProvider glass.pauseOnScroll={false}). */
|
|
13
|
+
export declare function watchScrolling(root?: HTMLElement, idle?: number): () => void;
|
|
14
|
+
/** Starts the shared lens manager (once per page). The strength comes from data-alea-refraction on <html>. */
|
|
15
|
+
export declare function startGlassLens(extra?: string): {
|
|
16
|
+
stop: () => void;
|
|
17
|
+
refresh: () => void;
|
|
18
|
+
};
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
import { type ReactNode } from 'react';
|
|
2
|
+
import { type TreeProps as RACTreeProps, type TreeItemProps as RACTreeItemProps, type Key } from 'react-aria-components';
|
|
3
|
+
/** One node of a data tree (the data prop). */
|
|
4
|
+
export interface TreeNode {
|
|
5
|
+
id: Key;
|
|
6
|
+
/** The label. Plain text, so filtering, typeahead and renaming work; use renderTitle for rich content. */
|
|
7
|
+
title: string;
|
|
8
|
+
/** An icon before the title. With directory, folders and files get one automatically. */
|
|
9
|
+
icon?: ReactNode;
|
|
10
|
+
/** A second, muted line under the title. */
|
|
11
|
+
description?: ReactNode;
|
|
12
|
+
/** Meta or actions on the right: a count, a badge, an IconButton. */
|
|
13
|
+
end?: ReactNode;
|
|
14
|
+
/** The children. Leave it out (and isLeaf off) to load them with loadChildren when the node opens. */
|
|
15
|
+
children?: TreeNode[];
|
|
16
|
+
/** No children and no chevron, even with loadChildren. */
|
|
17
|
+
isLeaf?: boolean;
|
|
18
|
+
/** Not selectable, checkable or actionable; still visible. */
|
|
19
|
+
isDisabled?: boolean;
|
|
20
|
+
/** Turns the row into a link. */
|
|
21
|
+
href?: string;
|
|
22
|
+
/** Its children are loading (you load them yourself, or refresh them): a spinner takes the chevron's place and a Loading row shows under the node. Lazy loading with loadChildren sets it for you. */
|
|
23
|
+
isLoading?: boolean;
|
|
24
|
+
}
|
|
25
|
+
export type TreeSize = 'sm' | 'md' | 'lg';
|
|
26
|
+
export interface TreeProps<T extends object> extends Omit<RACTreeProps<T>, 'children'> {
|
|
27
|
+
/** Items as JSX (TreeItem) or a render function for items. Or pass data instead. */
|
|
28
|
+
children?: RACTreeProps<T>['children'];
|
|
29
|
+
/** The tree as data: unlocks defaultExpandAll, checkable cascading, loadChildren, filterText, draggable and renaming. */
|
|
30
|
+
data?: TreeNode[];
|
|
31
|
+
/** Called with the new data after a drag, a rename or a lazy load, so you can keep it. */
|
|
32
|
+
onDataChange?: (data: TreeNode[]) => void;
|
|
33
|
+
/** Row height: sm 28 px, md 36 px (default), lg 44 px. Touch screens get at least 44 px. */
|
|
34
|
+
size?: TreeSize;
|
|
35
|
+
/** How the selected row looks: subtle (tinted, default) or solid (accent). */
|
|
36
|
+
variant?: 'subtle' | 'solid';
|
|
37
|
+
/** Guide lines that show each level. */
|
|
38
|
+
showLines?: boolean;
|
|
39
|
+
/** Indent per level in px. Default 16, 20 or 24 by size. */
|
|
40
|
+
indent?: number;
|
|
41
|
+
/** A file browser: folders and files get icons, and pressing a folder opens it. */
|
|
42
|
+
directory?: boolean;
|
|
43
|
+
/** Pressing a row opens or closes it. Default: on when there is no selection, or with directory. */
|
|
44
|
+
expandOnClick?: boolean;
|
|
45
|
+
/** Opens every node at first (data mode). */
|
|
46
|
+
defaultExpandAll?: boolean;
|
|
47
|
+
/** Checkboxes that cascade: checking a parent checks its children, and a parent with some checked children shows a dash (data mode). */
|
|
48
|
+
checkable?: boolean;
|
|
49
|
+
/** Parents and children are checked on their own, no cascading. */
|
|
50
|
+
checkStrictly?: boolean;
|
|
51
|
+
/** The checked keys (controlled). */
|
|
52
|
+
checkedKeys?: Iterable<Key>;
|
|
53
|
+
/** The checked keys at first. */
|
|
54
|
+
defaultCheckedKeys?: Iterable<Key>;
|
|
55
|
+
/** Called with every checked key, and the half checked parents. */
|
|
56
|
+
onCheckedChange?: (keys: Key[], info: {
|
|
57
|
+
halfChecked: Key[];
|
|
58
|
+
}) => void;
|
|
59
|
+
/** Loads the children of a node the first time it opens (lazy loading). A loading row shows while it waits. */
|
|
60
|
+
loadChildren?: (node: TreeNode) => Promise<TreeNode[]>;
|
|
61
|
+
/** The whole tree is loading. With no nodes yet it shows skeleton rows with a shimmer; with nodes it shows a Loading row at the end. The tree is marked busy for screen readers and rows stay usable. */
|
|
62
|
+
isLoading?: boolean;
|
|
63
|
+
/** With isLoading and no nodes, how many skeleton rows to show. Default 4. */
|
|
64
|
+
loadingRows?: number;
|
|
65
|
+
/** Shows only the nodes that match (and their parents), opens them and marks the match. */
|
|
66
|
+
filterText?: string;
|
|
67
|
+
/** Rows can be dragged to reorder, or dropped on a folder to move inside it; keyboard users use the handle (data mode). */
|
|
68
|
+
draggable?: boolean;
|
|
69
|
+
/** F2 or a double click renames a row; Enter saves, Escape cancels (data mode). */
|
|
70
|
+
onRename?: (id: Key, title: string) => void;
|
|
71
|
+
/** Custom content for a node's title. */
|
|
72
|
+
renderTitle?: (node: TreeNode, state: {
|
|
73
|
+
isExpanded: boolean;
|
|
74
|
+
level: number;
|
|
75
|
+
}) => ReactNode;
|
|
76
|
+
/** Renders only the rows on screen: pass the row height. Needs maxHeight. */
|
|
77
|
+
virtualized?: number;
|
|
78
|
+
/** Scrolls inside this height. */
|
|
79
|
+
maxHeight?: number | string;
|
|
80
|
+
}
|
|
81
|
+
/** Every key in the data: handy for an "Expand all" button. */
|
|
82
|
+
export declare function getTreeKeys(nodes: TreeNode[], onlyParents?: boolean): Key[];
|
|
83
|
+
/** Nested items that open and close: files, categories, outlines, org charts. Arrow Right opens, Arrow Left closes.
|
|
84
|
+
* Pass TreeItems as children, or the whole tree as data to get cascading checkboxes, lazy loading, filtering, drag and drop and renaming. */
|
|
85
|
+
export declare function Tree<T extends object>({ data, onDataChange, size, variant, showLines, indent, directory, expandOnClick, defaultExpandAll, checkable, checkStrictly, checkedKeys, defaultCheckedKeys, onCheckedChange, loadChildren, isLoading, loadingRows, filterText, draggable, onRename, renderTitle, virtualized, maxHeight, expandedKeys, defaultExpandedKeys, onExpandedChange, className, style, children, renderEmptyState, onAction, selectionMode, ...props }: TreeProps<T>): import("react").JSX.Element;
|
|
86
|
+
export interface TreeItemProps extends Omit<RACTreeItemProps, 'children' | 'textValue'> {
|
|
87
|
+
/** Text for typeahead and screen readers when title is not plain text. */
|
|
88
|
+
textValue?: string;
|
|
89
|
+
/** The item's label. */
|
|
90
|
+
title: ReactNode;
|
|
91
|
+
/** An icon before the title. */
|
|
92
|
+
icon?: ReactNode;
|
|
93
|
+
/** A second, muted line under the title. */
|
|
94
|
+
description?: ReactNode;
|
|
95
|
+
/** Meta or actions on the right (they stay reachable with the keyboard). */
|
|
96
|
+
end?: ReactNode;
|
|
97
|
+
/** Custom title content, with the row's state. */
|
|
98
|
+
renderTitle?: (state: {
|
|
99
|
+
isExpanded: boolean;
|
|
100
|
+
level: number;
|
|
101
|
+
}) => ReactNode;
|
|
102
|
+
/** In a directory tree, show a folder icon even with no children yet. */
|
|
103
|
+
isFolder?: boolean;
|
|
104
|
+
/** Its children are loading: a spinner takes the chevron's place and a Loading row shows under the item. The item is marked busy for screen readers. */
|
|
105
|
+
isLoading?: boolean;
|
|
106
|
+
/** Nested TreeItems. */
|
|
107
|
+
children?: ReactNode;
|
|
108
|
+
}
|
|
109
|
+
/** An item in a Tree; nest TreeItems inside for children. */
|
|
110
|
+
export declare function TreeItem({ title, icon, description, end, renderTitle, isFolder, isLoading, children, className, textValue, ...props }: TreeItemProps): import("react").JSX.Element;
|
|
111
|
+
export interface TreeSectionProps<T extends object> {
|
|
112
|
+
children?: ReactNode | ((item: T) => ReactNode);
|
|
113
|
+
/** The items in the section, for a dynamic collection. */
|
|
114
|
+
items?: Iterable<T>;
|
|
115
|
+
id?: Key;
|
|
116
|
+
className?: string;
|
|
117
|
+
'aria-label'?: string;
|
|
118
|
+
}
|
|
119
|
+
/** A group of items with a header inside a Tree. */
|
|
120
|
+
export declare function TreeSection<T extends object>({ className, ...props }: TreeSectionProps<T>): import("react").JSX.Element;
|
|
121
|
+
/** The heading of a TreeSection. */
|
|
122
|
+
export declare function TreeHeader({ className, ...props }: {
|
|
123
|
+
children: ReactNode;
|
|
124
|
+
className?: string;
|
|
125
|
+
}): import("react").JSX.Element;
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { type ElementType, type HTMLAttributes, type ReactNode } from 'react';
|
|
2
|
+
import { type LinkProps as RACLinkProps } from 'react-aria-components';
|
|
3
|
+
export type HeadingSize = 'display' | '4xl' | '3xl' | '2xl' | 'xl' | 'lg' | 'md';
|
|
4
|
+
export interface HeadingProps extends HTMLAttributes<HTMLHeadingElement> {
|
|
5
|
+
/** The outline level (h1 to h6). Pick it for the page structure, not the size. */
|
|
6
|
+
level?: 1 | 2 | 3 | 4 | 5 | 6;
|
|
7
|
+
/** Visual size; defaults from the level. display is the hero size. */
|
|
8
|
+
size?: HeadingSize;
|
|
9
|
+
/** serif (Crimson Pro, light) for titles, sans (Inter, semibold) for UI headings. */
|
|
10
|
+
family?: 'serif' | 'sans';
|
|
11
|
+
/** Fills the text with the accent gradient. */
|
|
12
|
+
gradient?: boolean;
|
|
13
|
+
}
|
|
14
|
+
/** A heading with the Alea type: Crimson Pro light for titles, Inter for UI. */
|
|
15
|
+
export declare const Heading: import("react").ForwardRefExoticComponent<HeadingProps & import("react").RefAttributes<HTMLHeadingElement>>;
|
|
16
|
+
export interface TextProps extends HTMLAttributes<HTMLElement> {
|
|
17
|
+
/** The element to render. Default p. */
|
|
18
|
+
as?: ElementType;
|
|
19
|
+
/** xs 12, sm 13, md 14, base 16 (default), lg 18, xl 20 px. */
|
|
20
|
+
size?: 'xs' | 'sm' | 'md' | 'base' | 'lg' | 'xl';
|
|
21
|
+
/** default, muted, faint, accent, success, warning or danger. */
|
|
22
|
+
tone?: 'default' | 'muted' | 'faint' | 'accent' | 'success' | 'warning' | 'danger';
|
|
23
|
+
/** regular, medium or semibold. */
|
|
24
|
+
weight?: 'regular' | 'medium' | 'semibold';
|
|
25
|
+
/** Cut to one line with an ellipsis. */
|
|
26
|
+
truncate?: boolean;
|
|
27
|
+
/** Text alignment: start (default), center or end. */
|
|
28
|
+
align?: 'start' | 'center' | 'end';
|
|
29
|
+
/** Cut to this many lines with an ellipsis. */
|
|
30
|
+
lineClamp?: number;
|
|
31
|
+
children?: ReactNode;
|
|
32
|
+
}
|
|
33
|
+
/** Body text with the token sizes and tones; cut to one line or several. */
|
|
34
|
+
export declare function Text({ as, size, tone, weight, truncate, lineClamp, align, className, style, ...props }: TextProps): import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>;
|
|
35
|
+
/** The small uppercase label above a section title. */
|
|
36
|
+
export declare function Eyebrow({ className, ...props }: HTMLAttributes<HTMLParagraphElement>): import("react").JSX.Element;
|
|
37
|
+
/** Inline code. */
|
|
38
|
+
export declare function Code({ className, ...props }: HTMLAttributes<HTMLElement>): import("react").JSX.Element;
|
|
39
|
+
export interface KbdProps extends HTMLAttributes<HTMLElement> {
|
|
40
|
+
children: ReactNode;
|
|
41
|
+
}
|
|
42
|
+
/** A key or shortcut, like ⌘K. */
|
|
43
|
+
export declare function Kbd({ className, ...props }: KbdProps): import("react").JSX.Element;
|
|
44
|
+
export interface LinkProps extends RACLinkProps {
|
|
45
|
+
/** inline: underlined accent text; standalone: no underline until hover; muted: text color. */
|
|
46
|
+
variant?: 'inline' | 'standalone' | 'muted';
|
|
47
|
+
/** Opens in a new tab with rel=noopener and an arrow. */
|
|
48
|
+
external?: boolean;
|
|
49
|
+
/** sm (13 px), md (14 px) or lg (16 px). Default: the size of the text around it. */
|
|
50
|
+
size?: 'sm' | 'md' | 'lg';
|
|
51
|
+
/** accent (default), neutral (text color, for dense lists) or danger (destructive links like "Remove"). */
|
|
52
|
+
tone?: 'accent' | 'neutral' | 'danger';
|
|
53
|
+
/** An icon before the text. */
|
|
54
|
+
iconStart?: ReactNode;
|
|
55
|
+
/** An icon after the text (with standalone links it nudges toward where the link goes). */
|
|
56
|
+
iconEnd?: ReactNode;
|
|
57
|
+
}
|
|
58
|
+
/** A link, accessible and focus-visible: three looks, three sizes, three tones, icons, and external links that say they open a new tab. */
|
|
59
|
+
export declare function Link({ variant, external, size, tone, iconStart, iconEnd, className, children, ...props }: LinkProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { type ReactNode } from 'react';
|
|
2
|
+
import { type DropZoneProps as RACDropZoneProps } from 'react-aria-components';
|
|
3
|
+
export interface UploadFile {
|
|
4
|
+
id: string;
|
|
5
|
+
file: File;
|
|
6
|
+
/** 0 to 100 while uploading. */
|
|
7
|
+
progress?: number;
|
|
8
|
+
/** Set when it failed. */
|
|
9
|
+
error?: string;
|
|
10
|
+
}
|
|
11
|
+
export interface FileUploadProps {
|
|
12
|
+
/** Accepted types, e.g. ['image/png', '.svg']. */
|
|
13
|
+
accept?: string[];
|
|
14
|
+
/** Pick or drop more than one. Default true. */
|
|
15
|
+
allowsMultiple?: boolean;
|
|
16
|
+
/** Largest size in bytes; bigger files are listed with an error. */
|
|
17
|
+
maxSize?: number;
|
|
18
|
+
/** The files (controlled), with progress and errors you set. */
|
|
19
|
+
files?: UploadFile[];
|
|
20
|
+
/** Called with the full new list when files are added or removed. */
|
|
21
|
+
onChange?: (files: UploadFile[]) => void;
|
|
22
|
+
/** The text in the drop area. */
|
|
23
|
+
label?: ReactNode;
|
|
24
|
+
/** Help under it: types and size. */
|
|
25
|
+
description?: ReactNode;
|
|
26
|
+
/** Disables every part of it. */
|
|
27
|
+
isDisabled?: boolean;
|
|
28
|
+
/** How the files show: text (rows with an icon, default), thumbnail (rows with a preview of images) or grid (picture cards, for galleries and avatars). */
|
|
29
|
+
listType?: 'text' | 'thumbnail' | 'grid';
|
|
30
|
+
/** dropzone (a drop area with a button, default) or button (only the button and the list, for tight forms). */
|
|
31
|
+
variant?: 'dropzone' | 'button';
|
|
32
|
+
/** The most files kept; the rest are listed with an error. */
|
|
33
|
+
maxFiles?: number;
|
|
34
|
+
/** Shows a Retry button on files with an error, and calls this with the file. */
|
|
35
|
+
onRetry?: (file: UploadFile) => void;
|
|
36
|
+
/** Label of the browse button. Default "Browse files". */
|
|
37
|
+
buttonLabel?: ReactNode;
|
|
38
|
+
/** Extra class names for the root element. */
|
|
39
|
+
className?: string;
|
|
40
|
+
}
|
|
41
|
+
/** Drop files or browse for them, with a list that shows size, progress, done and errors: rows, rows with previews, or a grid of picture cards. */
|
|
42
|
+
export declare function FileUpload({ accept, allowsMultiple, maxSize, files, onChange, label, description, isDisabled, listType, variant, maxFiles, onRetry, buttonLabel, className }: FileUploadProps): import("react").JSX.Element;
|
|
43
|
+
export interface DropZoneProps extends RACDropZoneProps {
|
|
44
|
+
children: ReactNode;
|
|
45
|
+
}
|
|
46
|
+
/** A bare drop target, for custom layouts. Keyboard users get the button inside. */
|
|
47
|
+
export declare function DropZone({ className, ...props }: DropZoneProps): import("react").JSX.Element;
|
|
48
|
+
export interface FileTriggerProps {
|
|
49
|
+
/** The element that opens the file picker: a Button, IconButton or Link. */
|
|
50
|
+
children: ReactNode;
|
|
51
|
+
/** File types to offer, like ['image/*', '.pdf']. */
|
|
52
|
+
acceptedFileTypes?: string[];
|
|
53
|
+
/** Lets people pick several files. */
|
|
54
|
+
allowsMultiple?: boolean;
|
|
55
|
+
/** Picks a whole folder instead of files. */
|
|
56
|
+
acceptDirectory?: boolean;
|
|
57
|
+
/** On phones, opens the camera: user (front) or environment (back). */
|
|
58
|
+
defaultCamera?: 'user' | 'environment';
|
|
59
|
+
/** Called with the picked files. */
|
|
60
|
+
onSelect?: (files: FileList | null) => void;
|
|
61
|
+
}
|
|
62
|
+
/** Any button that opens the file picker: avatars, attachments, imports. For drag and drop as well, use FileUpload or DropZone. */
|
|
63
|
+
export declare function FileTrigger(props: FileTriggerProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { type ReactNode } from 'react';
|
|
2
|
+
export type UptimeState = 'ok' | 'degraded' | 'down' | 'none';
|
|
3
|
+
export interface UptimeBarProps {
|
|
4
|
+
/** One state per day (or hour), oldest first. */
|
|
5
|
+
days: UptimeState[];
|
|
6
|
+
/** What it measures: "API gateway". */
|
|
7
|
+
label: string;
|
|
8
|
+
/** The uptime to say, e.g. 99.98 (percent). Without it the bar is described by its incidents. */
|
|
9
|
+
uptime?: number;
|
|
10
|
+
/** What one bar is: "day" (default) or "hour". */
|
|
11
|
+
unit?: string;
|
|
12
|
+
className?: string;
|
|
13
|
+
}
|
|
14
|
+
/** A service's recent history as thin bars, one per day: green, amber when it was slow, red when it was down. Read as one sentence. */
|
|
15
|
+
export declare function UptimeBar({ days, label, uptime, unit, className }: UptimeBarProps): import("react").JSX.Element;
|
|
16
|
+
export interface DiffLine {
|
|
17
|
+
/** add (new), remove (gone) or same (context). */
|
|
18
|
+
type: 'add' | 'remove' | 'same';
|
|
19
|
+
text: ReactNode;
|
|
20
|
+
}
|
|
21
|
+
export interface DiffViewProps {
|
|
22
|
+
/** The lines, in order. */
|
|
23
|
+
lines: DiffLine[];
|
|
24
|
+
/** A name for the change ("Venue", "tokens.css"); also the list's label. */
|
|
25
|
+
title?: string;
|
|
26
|
+
className?: string;
|
|
27
|
+
}
|
|
28
|
+
/** What changed between two versions, line by line: removed lines marked − in red, added + in green, the rest as context. */
|
|
29
|
+
export declare function DiffView({ lines, title, className }: DiffViewProps): import("react").JSX.Element;
|