@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,136 @@
|
|
|
1
|
+
import { type HTMLAttributes, type ReactNode } from 'react';
|
|
2
|
+
import { type MotionProp } from '@alea-design/motion';
|
|
3
|
+
import { type ProgressBarProps as RACProgressBarProps, type MeterProps as RACMeterProps } from 'react-aria-components';
|
|
4
|
+
import type { Tone } from '../display/Display';
|
|
5
|
+
export interface ProgressBarProps extends RACProgressBarProps {
|
|
6
|
+
/** The visible label. */
|
|
7
|
+
label?: ReactNode;
|
|
8
|
+
/** Show the percent (or valueLabel). Default true with a label or with valuePosition="end". */
|
|
9
|
+
showValue?: boolean;
|
|
10
|
+
/** Track height: sm 4 px, md 8 px (default) or lg 12 px. */
|
|
11
|
+
size?: 'sm' | 'md' | 'lg';
|
|
12
|
+
/** The fill color: accent (default, the gradient), success, warning, danger or info. */
|
|
13
|
+
tone?: 'accent' | 'success' | 'warning' | 'danger' | 'info';
|
|
14
|
+
/** Moving stripes on the fill, for work that is running. */
|
|
15
|
+
striped?: boolean;
|
|
16
|
+
/** Where the value shows: top (next to the label, default) or end (after the bar). */
|
|
17
|
+
valuePosition?: 'top' | 'end';
|
|
18
|
+
/** A line under the bar: "3 of 12 files", "About 2 minutes left". */
|
|
19
|
+
description?: ReactNode;
|
|
20
|
+
}
|
|
21
|
+
/** How far a task has come: tones, three sizes, stripes, the value on top or at the end, and a description. Without value it is indeterminate. */
|
|
22
|
+
export declare function ProgressBar({ label, showValue: show, size, tone, striped, valuePosition, description, className, ...props }: ProgressBarProps): import("react").JSX.Element;
|
|
23
|
+
export interface ProgressCircleProps extends Omit<RACProgressBarProps, 'children'> {
|
|
24
|
+
/** sm 24, md 40 (default), lg 64, xl 96 px. */
|
|
25
|
+
size?: 'sm' | 'md' | 'lg' | 'xl';
|
|
26
|
+
/** Show the percent in the middle (md and up). */
|
|
27
|
+
showValue?: boolean;
|
|
28
|
+
/** The ring color: accent (default), success, warning, danger or info. */
|
|
29
|
+
tone?: 'accent' | 'success' | 'warning' | 'danger' | 'info';
|
|
30
|
+
/** Ring thickness in the 48 unit drawing: 3 (thin), 5 (default) or 8 (bold). */
|
|
31
|
+
thickness?: number;
|
|
32
|
+
/** Your own content in the middle: an icon, an avatar, "3/5". */
|
|
33
|
+
children?: ReactNode;
|
|
34
|
+
}
|
|
35
|
+
/** Circular progress, for compact places: four sizes, tones, thickness and anything in the middle. */
|
|
36
|
+
export declare function ProgressCircle({ size, showValue, tone, thickness, children, className, ...props }: ProgressCircleProps): import("react").JSX.Element;
|
|
37
|
+
export interface MeterProps extends RACMeterProps {
|
|
38
|
+
/** The visible label. */
|
|
39
|
+
label?: ReactNode;
|
|
40
|
+
/** Show the value next to the label. Default true. */
|
|
41
|
+
showValue?: boolean;
|
|
42
|
+
/** Color by level: auto turns warning above 70% and danger above 90% (storage, quota). */
|
|
43
|
+
tone?: Tone | 'auto';
|
|
44
|
+
}
|
|
45
|
+
/** A measured amount within a known range (storage, password strength, contrast). Not progress. */
|
|
46
|
+
export declare function Meter({ label, showValue, tone, className, ...props }: MeterProps): import("react").JSX.Element;
|
|
47
|
+
export interface SkeletonProps extends HTMLAttributes<HTMLSpanElement> {
|
|
48
|
+
/** text: lines of text; rect: a block; circle: an avatar. */
|
|
49
|
+
shape?: 'text' | 'rect' | 'circle';
|
|
50
|
+
/** Width, as px or any CSS length. */
|
|
51
|
+
width?: number | string;
|
|
52
|
+
/** Height, as px or any CSS length. */
|
|
53
|
+
height?: number | string;
|
|
54
|
+
/** Number of text lines (the last one shorter). */
|
|
55
|
+
lines?: number;
|
|
56
|
+
/** When true, shows children instead, crossfading in. */
|
|
57
|
+
isLoaded?: boolean;
|
|
58
|
+
/** shimmer (a light sweep, default), pulse (fades in and out), matrix (a field of dots that twinkle; with isLoaded it dissolves into the children), blueprint (the children's own shapes drawn as dotted outlines, then they take over) or none. */
|
|
59
|
+
animation?: 'shimmer' | 'pulse' | 'matrix' | 'blueprint' | 'none';
|
|
60
|
+
/** matrix: how many rows of dots. With cols it sets the size of the block; without them the dots fill the container. blueprint with no children: how many text lines to draw. */
|
|
61
|
+
rows?: number;
|
|
62
|
+
/** matrix: how many columns of dots. */
|
|
63
|
+
cols?: number;
|
|
64
|
+
children?: ReactNode;
|
|
65
|
+
}
|
|
66
|
+
/** A placeholder with a soft shimmer while content loads. Hidden from screen readers; mark the region aria-busy. animation="matrix" is a field of dots that wraps its content: it announces Loading, and dissolves into the children when isLoaded turns true. */
|
|
67
|
+
export declare function Skeleton({ shape, width, height, lines, isLoaded, animation, rows, cols, children, className, style, ...props }: SkeletonProps): import("react").JSX.Element;
|
|
68
|
+
export interface AlertProps extends Omit<HTMLAttributes<HTMLDivElement>, 'title'> {
|
|
69
|
+
/** info (default), success, warning, danger, accent or neutral. */
|
|
70
|
+
tone?: Tone;
|
|
71
|
+
/** The headline, in bold. */
|
|
72
|
+
title?: ReactNode;
|
|
73
|
+
children?: ReactNode;
|
|
74
|
+
/** Buttons or links on the right (or below on small screens). */
|
|
75
|
+
actions?: ReactNode;
|
|
76
|
+
/** Shows a close button and calls this. */
|
|
77
|
+
onDismiss?: () => void;
|
|
78
|
+
/** Announce it to screen readers when it appears (role alert for danger, status otherwise). Default false for alerts on page load. */
|
|
79
|
+
live?: boolean;
|
|
80
|
+
/** Hide the icon. */
|
|
81
|
+
hideIcon?: boolean;
|
|
82
|
+
/** Your own icon instead of the tone's. */
|
|
83
|
+
icon?: ReactNode;
|
|
84
|
+
/** soft (tinted, default), outline (a border in the tone), solid (filled) or accent (a bar on the left). */
|
|
85
|
+
variant?: 'soft' | 'outline' | 'solid' | 'accent';
|
|
86
|
+
/** md (default) or sm: one compact line, for forms and tables. */
|
|
87
|
+
size?: 'sm' | 'md';
|
|
88
|
+
}
|
|
89
|
+
/** A message in the page: info, success, warning, danger, accent or neutral, in four looks and two sizes. */
|
|
90
|
+
export declare function Alert({ tone, title, children, actions, onDismiss, live, hideIcon, icon, variant, size, className, ...props }: AlertProps): import("react").JSX.Element;
|
|
91
|
+
export interface ToastOptions {
|
|
92
|
+
title: ReactNode;
|
|
93
|
+
description?: ReactNode;
|
|
94
|
+
tone?: Tone;
|
|
95
|
+
/** ms before it closes; 0 keeps it until closed. Default 5000 (danger: 0). */
|
|
96
|
+
timeout?: number;
|
|
97
|
+
/** One action button, e.g. Undo. */
|
|
98
|
+
action?: {
|
|
99
|
+
label: string;
|
|
100
|
+
onAction: () => void;
|
|
101
|
+
};
|
|
102
|
+
/** Your own icon instead of the tone's. */
|
|
103
|
+
icon?: ReactNode;
|
|
104
|
+
/** Shows a spinner and stays until updated (see promise and update). */
|
|
105
|
+
isLoading?: boolean;
|
|
106
|
+
/** A thin bar that empties until the toast closes. */
|
|
107
|
+
showProgress?: boolean;
|
|
108
|
+
}
|
|
109
|
+
interface ToastApi {
|
|
110
|
+
/** Shows a toast and returns its id. */
|
|
111
|
+
show: (t: ToastOptions) => number;
|
|
112
|
+
/** Closes a toast. */
|
|
113
|
+
close: (id: number) => void;
|
|
114
|
+
/** Changes a toast in place: a new title, tone, description, or isLoading false. */
|
|
115
|
+
update: (id: number, t: Partial<ToastOptions>) => void;
|
|
116
|
+
/** Shows a loading toast while the promise runs, then success or error. Returns the promise. */
|
|
117
|
+
promise: <T>(p: Promise<T>, msgs: {
|
|
118
|
+
loading: ReactNode;
|
|
119
|
+
success: ReactNode | ((v: T) => ReactNode);
|
|
120
|
+
error: ReactNode | ((e: unknown) => ReactNode);
|
|
121
|
+
}) => Promise<T>;
|
|
122
|
+
}
|
|
123
|
+
export interface ToastProviderProps {
|
|
124
|
+
children: ReactNode;
|
|
125
|
+
/** Where toasts stack: bottom-end (default), bottom, top-end or top. */
|
|
126
|
+
placement?: 'bottom-end' | 'bottom' | 'top-end' | 'top';
|
|
127
|
+
/** How toasts enter and leave (default: rise with a spring, slide away): a preset, false, or options. */
|
|
128
|
+
motion?: MotionProp;
|
|
129
|
+
/** Toasts pile up behind the newest and fan out on hover or focus (the stack pattern). */
|
|
130
|
+
stacked?: boolean;
|
|
131
|
+
}
|
|
132
|
+
/** Shows toasts anywhere below it; put it once near the root. */
|
|
133
|
+
export declare function ToastProvider({ children, placement, motion, stacked }: ToastProviderProps): import("react").JSX.Element;
|
|
134
|
+
/** show({ title, tone, description, action, timeout }) and close(id). Needs a ToastProvider above. */
|
|
135
|
+
export declare function useToast(): ToastApi;
|
|
136
|
+
export {};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export interface SpinnerProps {
|
|
2
|
+
/** sm 16, md 24 (default), lg 40 px. */
|
|
3
|
+
size?: 'sm' | 'md' | 'lg';
|
|
4
|
+
/** What is loading, for screen readers. Default "Loading". */
|
|
5
|
+
'aria-label'?: string;
|
|
6
|
+
/** Extra class names. */
|
|
7
|
+
className?: string;
|
|
8
|
+
/** ring (default); dots: a 4 × 4 matrix of dots that pulses in a wave; morph: a soft shape that turns and changes form, for longer waits. */
|
|
9
|
+
variant?: 'ring' | 'dots' | 'morph';
|
|
10
|
+
}
|
|
11
|
+
/** An indeterminate loading ring in the accent gradient. */
|
|
12
|
+
export declare function Spinner({ size, variant, className, 'aria-label': label }: SpinnerProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { type ReactNode } from 'react';
|
|
2
|
+
export interface ToggletipProps {
|
|
3
|
+
/** What the popover says. Can hold links and buttons (unlike a Tooltip). */
|
|
4
|
+
children: ReactNode;
|
|
5
|
+
/** A title at the top of the popover. */
|
|
6
|
+
title?: ReactNode;
|
|
7
|
+
/** The button's name for screen readers. Default "More information". */
|
|
8
|
+
'aria-label'?: string;
|
|
9
|
+
/** The icon: info (default), help, or warning. */
|
|
10
|
+
icon?: 'info' | 'help' | 'warning';
|
|
11
|
+
/** Where it opens. Default top. */
|
|
12
|
+
placement?: 'top' | 'bottom' | 'start' | 'end';
|
|
13
|
+
/** sm (16 px icon, default) or md (20 px). */
|
|
14
|
+
size?: 'sm' | 'md';
|
|
15
|
+
}
|
|
16
|
+
/** A small info button that opens a popover on press: for explanations people may want to read, with links if needed. Escape or a press outside closes it. */
|
|
17
|
+
export declare function Toggletip({ children, title, 'aria-label': label, icon, placement, size }: ToggletipProps): import("react").JSX.Element;
|
|
18
|
+
export interface InfoLabelProps extends Omit<ToggletipProps, 'children'> {
|
|
19
|
+
/** The label text. */
|
|
20
|
+
children: ReactNode;
|
|
21
|
+
/** What the info button explains. */
|
|
22
|
+
info: ReactNode;
|
|
23
|
+
/** The id of the field this labels, to use it as a field label. */
|
|
24
|
+
htmlFor?: string;
|
|
25
|
+
/** Marks the field as required. */
|
|
26
|
+
isRequired?: boolean;
|
|
27
|
+
/** Extra class names. */
|
|
28
|
+
className?: string;
|
|
29
|
+
}
|
|
30
|
+
/** A label with an info button beside it, for fields that need a longer explanation than help text. */
|
|
31
|
+
export declare function InfoLabel({ children, info, htmlFor, isRequired, className, ...tip }: InfoLabelProps): import("react").JSX.Element;
|
|
32
|
+
export interface InlineLoadingProps {
|
|
33
|
+
/** idle (nothing), loading (spinner), success (a check that draws itself) or error. */
|
|
34
|
+
status: 'idle' | 'loading' | 'success' | 'error';
|
|
35
|
+
/** The text for the current status, like "Saving…", "Saved", "Could not save". */
|
|
36
|
+
children?: ReactNode;
|
|
37
|
+
/** After success, wait this long (ms) and call onSuccessEnd: to go back to idle or move on. Default 1500. */
|
|
38
|
+
successDuration?: number;
|
|
39
|
+
/** Called after success has shown for successDuration. */
|
|
40
|
+
onSuccessEnd?: () => void;
|
|
41
|
+
/** Extra class names. */
|
|
42
|
+
className?: string;
|
|
43
|
+
}
|
|
44
|
+
/** A small status line for an action in progress: a spinner, then a check or an error, with text. Screen readers hear each change. */
|
|
45
|
+
export declare function InlineLoading({ status, children, successDuration, onSuccessEnd, className }: InlineLoadingProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
import { type ReactNode } from 'react';
|
|
2
|
+
import { type TextFieldProps as RACTextFieldProps, type SearchFieldProps as RACSearchFieldProps, type NumberFieldProps as RACNumberFieldProps, type ValidationResult, type LabelProps } from 'react-aria-components';
|
|
3
|
+
import type { Responsive } from '../../utils/responsive';
|
|
4
|
+
/** A field label. Marks optional or required fields. */
|
|
5
|
+
export declare function Label({ className, ...props }: LabelProps): import("react").JSX.Element;
|
|
6
|
+
/** Help text under a field. */
|
|
7
|
+
export interface DescriptionProps {
|
|
8
|
+
/** Extra class names. */
|
|
9
|
+
className?: string;
|
|
10
|
+
/** The help text. */
|
|
11
|
+
children?: ReactNode;
|
|
12
|
+
}
|
|
13
|
+
/** Help text under a field, linked to it so screen readers read it after the label. */
|
|
14
|
+
export declare function Description({ className, ...props }: DescriptionProps): import("react").JSX.Element;
|
|
15
|
+
/** The validation message, shown when the field is invalid. */
|
|
16
|
+
export interface FieldErrorProps {
|
|
17
|
+
/** Extra class names. */
|
|
18
|
+
className?: string;
|
|
19
|
+
/** The message, or a function of the validation result. */
|
|
20
|
+
children?: ReactNode | ((v: ValidationResult) => ReactNode);
|
|
21
|
+
}
|
|
22
|
+
/** The validation message of a field, shown and announced when the value is invalid. */
|
|
23
|
+
export declare function FieldError({ className, ...props }: FieldErrorProps): import("react").JSX.Element;
|
|
24
|
+
export type FieldSize = 'xs' | 'sm' | 'md' | 'lg' | 'xl';
|
|
25
|
+
export type FieldVariant = 'outline' | 'filled' | 'underline' | 'borderless';
|
|
26
|
+
interface FieldBits {
|
|
27
|
+
/** The visible label. Use aria-label instead only when the context makes it obvious. */
|
|
28
|
+
label?: ReactNode;
|
|
29
|
+
/** Help text under the field. */
|
|
30
|
+
description?: ReactNode;
|
|
31
|
+
/** Error text, or a function of the validation result. Shown when invalid. */
|
|
32
|
+
errorMessage?: ReactNode | ((v: ValidationResult) => ReactNode);
|
|
33
|
+
/** A warning that does not block: the border turns amber and the text shows under the field. */
|
|
34
|
+
warningMessage?: ReactNode;
|
|
35
|
+
/** Shows "(optional)" after the label. */
|
|
36
|
+
showOptional?: boolean;
|
|
37
|
+
/** xs 28 px, sm 32 px, md 44 px (default), lg 48 px, xl 56 px. Can change per breakpoint: { base: 'lg', md: 'md' }. */
|
|
38
|
+
size?: Responsive<FieldSize>;
|
|
39
|
+
/** outline (default), filled (tinted, no border until hover), underline (a bottom line only) or borderless (for inline editing and toolbars). */
|
|
40
|
+
variant?: FieldVariant;
|
|
41
|
+
/** top (default) or side: the label sits to the left from 640 px up and goes back on top on phones. Set the label column with --alea-label-width. */
|
|
42
|
+
labelPosition?: 'top' | 'side';
|
|
43
|
+
}
|
|
44
|
+
export interface TextFieldProps extends Omit<RACTextFieldProps, 'children'>, FieldBits {
|
|
45
|
+
/** An example of what to type; never a replacement for the label. */
|
|
46
|
+
placeholder?: string;
|
|
47
|
+
/** Icon or text inside the field, before the value. */
|
|
48
|
+
prefix?: ReactNode;
|
|
49
|
+
/** Icon or text inside the field, after the value. */
|
|
50
|
+
suffix?: ReactNode;
|
|
51
|
+
/** A box attached outside the input on the left, like https://. */
|
|
52
|
+
addonStart?: ReactNode;
|
|
53
|
+
/** A box attached on the right, like .com or a unit. */
|
|
54
|
+
addonEnd?: ReactNode;
|
|
55
|
+
/** Shows a clear button while there is text. */
|
|
56
|
+
isClearable?: boolean;
|
|
57
|
+
/** Shows how many characters there are, and the limit with maxLength. Screen readers hear it when 10 or fewer are left. */
|
|
58
|
+
showCount?: boolean;
|
|
59
|
+
/** Shows a spinner at the end of the text, for a value being checked or looked up. It takes no room, the field stays editable, and screen readers hear it as busy. */
|
|
60
|
+
isLoading?: boolean;
|
|
61
|
+
}
|
|
62
|
+
/** A single-line text input: label (top or side), help, warning and error, prefix and suffix, addons, a clear button, a character count, four variants and five sizes. */
|
|
63
|
+
export declare function TextField({ label, description, errorMessage, warningMessage, showOptional, size, variant, labelPosition, placeholder, prefix, suffix, addonStart, addonEnd, isClearable, showCount, isLoading, className, value, defaultValue, onChange, ...props }: TextFieldProps): import("react").JSX.Element;
|
|
64
|
+
export interface TextAreaProps extends Omit<RACTextFieldProps, 'children'>, FieldBits {
|
|
65
|
+
/** An example of what to type. */
|
|
66
|
+
placeholder?: string;
|
|
67
|
+
/** Visible lines. Default 4. */
|
|
68
|
+
rows?: number;
|
|
69
|
+
/** Grows with the text up to maxRows. */
|
|
70
|
+
autoGrow?: boolean;
|
|
71
|
+
/** With autoGrow, the most lines before it scrolls. Default 12. */
|
|
72
|
+
maxRows?: number;
|
|
73
|
+
/** Which way people can drag to resize: vertical (default), none or both. */
|
|
74
|
+
resize?: 'vertical' | 'none' | 'both';
|
|
75
|
+
/** Shows how many characters there are, and the limit with maxLength. */
|
|
76
|
+
showCount?: boolean;
|
|
77
|
+
/** Shows a spinner in the top corner while the text is saved or checked. It takes no room, the field stays editable, and screen readers hear it as busy. */
|
|
78
|
+
isLoading?: boolean;
|
|
79
|
+
}
|
|
80
|
+
/** Multi-line text, optionally growing with its content, with a character count. */
|
|
81
|
+
export declare function TextArea({ label, description, errorMessage, warningMessage, showOptional, size, variant, labelPosition, placeholder, rows, autoGrow, maxRows, resize, showCount, isLoading, className, value, defaultValue, onChange, ...props }: TextAreaProps): import("react").JSX.Element;
|
|
82
|
+
export interface SearchFieldProps extends Omit<RACSearchFieldProps, 'children'>, FieldBits {
|
|
83
|
+
/** Placeholder text. Default "Search". */
|
|
84
|
+
placeholder?: string;
|
|
85
|
+
/** Shows a spinner in place of the search icon while results load (same size, so nothing moves). The field stays editable and screen readers hear it as busy. */
|
|
86
|
+
isLoading?: boolean;
|
|
87
|
+
/** A keyboard hint shown while the field is empty, like ⌘K or /. Bind the key yourself. */
|
|
88
|
+
shortcut?: ReactNode;
|
|
89
|
+
}
|
|
90
|
+
/** A search box with a clear button; Escape clears it too. */
|
|
91
|
+
export declare function SearchField({ label, description, errorMessage, warningMessage, showOptional, size, variant, labelPosition, placeholder, isLoading, shortcut, className, onClear, ...props }: SearchFieldProps): import("react").JSX.Element;
|
|
92
|
+
export interface PasswordFieldProps extends Omit<TextFieldProps, 'type' | 'suffix' | 'isClearable'> {
|
|
93
|
+
/** Shows a four step strength meter under the field (length, case, digits and symbols). */
|
|
94
|
+
showStrength?: boolean;
|
|
95
|
+
/** Your own score from 0 (weak) to 3 (strong), from your own password checker. */
|
|
96
|
+
strength?: (value: string) => 0 | 1 | 2 | 3;
|
|
97
|
+
}
|
|
98
|
+
/** A rough strength score: length, mixed case, digits and symbols. */
|
|
99
|
+
export declare function passwordScore(v: string): 0 | 1 | 2 | 3;
|
|
100
|
+
/** A password input with a show/hide button and an optional strength meter. */
|
|
101
|
+
export declare function PasswordField({ label, showStrength, strength, value, defaultValue, onChange, description, ...props }: PasswordFieldProps): import("react").JSX.Element;
|
|
102
|
+
export interface NumberFieldProps extends Omit<RACNumberFieldProps, 'children'>, FieldBits {
|
|
103
|
+
/** Placeholder text. */
|
|
104
|
+
placeholder?: string;
|
|
105
|
+
/** Shows the − and + buttons. Default true. */
|
|
106
|
+
showStepper?: boolean;
|
|
107
|
+
/** sides: − on the left and + on the right (default); end: small up and down arrows on the right. */
|
|
108
|
+
stepperPosition?: 'sides' | 'end';
|
|
109
|
+
/** Icon or text before the value (a currency sign when you do not use formatOptions). */
|
|
110
|
+
prefix?: ReactNode;
|
|
111
|
+
/** Icon or text after the value (a unit). */
|
|
112
|
+
suffix?: ReactNode;
|
|
113
|
+
/** Shows a spinner at the end of the number while it is saved or checked. It takes no room, the field stays editable, and screen readers hear it as busy. */
|
|
114
|
+
isLoading?: boolean;
|
|
115
|
+
}
|
|
116
|
+
/** A number input with steppers, min, max, step and locale formatting (currency, percent, units). */
|
|
117
|
+
export declare function NumberField({ label, description, errorMessage, warningMessage, showOptional, size, variant, labelPosition, placeholder, showStepper, stepperPosition, prefix, suffix, isLoading, className, ...props }: NumberFieldProps): import("react").JSX.Element;
|
|
118
|
+
export interface InputGroupProps {
|
|
119
|
+
/** Fields, selects and buttons to join into one control, like an amount and its currency, or a search and its button. */
|
|
120
|
+
children: ReactNode;
|
|
121
|
+
/** Name of the group for screen readers, when there is no visible label. */
|
|
122
|
+
'aria-label'?: string;
|
|
123
|
+
/** Id of a visible label for the group. */
|
|
124
|
+
'aria-labelledby'?: string;
|
|
125
|
+
/** Extra class names. */
|
|
126
|
+
className?: string;
|
|
127
|
+
}
|
|
128
|
+
/** Joins several controls into one row with shared borders: amount and currency, search and button, prefix select and text. */
|
|
129
|
+
export declare function InputGroup({ children, className, ...props }: InputGroupProps): import("react").JSX.Element;
|
|
130
|
+
export {};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export declare function FieldSpinner(): import("react").JSX.Element;
|
|
2
|
+
/** Attribute for the root of a field that is loading: it only adds the busy sweep under the control. The control itself carries aria-busy. */
|
|
3
|
+
export declare const loadingAttrs: (isLoading?: boolean) => {
|
|
4
|
+
'data-loading': true | undefined;
|
|
5
|
+
};
|
|
6
|
+
/** Marks the element busy for screen readers. React Aria does not pass aria-busy through on some of its components (Select's button, Tree, Switch), so it is set on the element itself; `pick` finds the real control inside the element the ref points at. */
|
|
7
|
+
export declare function useBusy<T extends HTMLElement>(isBusy?: boolean, pick?: (root: T) => HTMLElement | null): (node: T | null) => void;
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { type ReactNode } from 'react';
|
|
2
|
+
/** A filter people can add: what it filters, and how they pick its value. */
|
|
3
|
+
export interface FilterDef {
|
|
4
|
+
id: string;
|
|
5
|
+
label: string;
|
|
6
|
+
/** select: one option; multi: several; text: contains; boolean: on or off. */
|
|
7
|
+
type: 'select' | 'multi' | 'text' | 'boolean';
|
|
8
|
+
options?: Array<{
|
|
9
|
+
id: string;
|
|
10
|
+
label: string;
|
|
11
|
+
}>;
|
|
12
|
+
icon?: ReactNode;
|
|
13
|
+
}
|
|
14
|
+
export type FilterValue = Record<string, string | string[] | boolean | undefined>;
|
|
15
|
+
export interface FilterBarProps {
|
|
16
|
+
/** The filters people can add. */
|
|
17
|
+
filters: FilterDef[];
|
|
18
|
+
/** The active filters and their values (controlled). */
|
|
19
|
+
value?: FilterValue;
|
|
20
|
+
/** The active filters at first. */
|
|
21
|
+
defaultValue?: FilterValue;
|
|
22
|
+
/** Called with all active filters when one changes. */
|
|
23
|
+
onChange?: (value: FilterValue) => void;
|
|
24
|
+
/** The search text (controlled). Leave out search and onSearchChange to hide the search. */
|
|
25
|
+
search?: string;
|
|
26
|
+
/** Called as people type in the search. */
|
|
27
|
+
onSearchChange?: (q: string) => void;
|
|
28
|
+
/** Placeholder for the search. */
|
|
29
|
+
searchPlaceholder?: string;
|
|
30
|
+
/** Saved views as tabs above the filters (All, Unpaid, Mine). */
|
|
31
|
+
views?: Array<{
|
|
32
|
+
id: string;
|
|
33
|
+
label: string;
|
|
34
|
+
count?: number;
|
|
35
|
+
}>;
|
|
36
|
+
/** The current view. */
|
|
37
|
+
view?: string;
|
|
38
|
+
/** Called when a view is picked. */
|
|
39
|
+
onViewChange?: (id: string) => void;
|
|
40
|
+
/** Content at the end of the row: sort, export, a view switch. */
|
|
41
|
+
end?: ReactNode;
|
|
42
|
+
/** Name for screen readers. Default "Filters". */
|
|
43
|
+
'aria-label'?: string;
|
|
44
|
+
/** Extra class names. */
|
|
45
|
+
className?: string;
|
|
46
|
+
}
|
|
47
|
+
/** Filters for a list or table: saved views, a search, active filters as chips you can edit or remove, an Add filter menu and Clear all. */
|
|
48
|
+
export declare function FilterBar({ filters, value, defaultValue, onChange, search, onSearchChange, searchPlaceholder, views, view, onViewChange, end, className, 'aria-label': label }: FilterBarProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { type FormEvent, type ReactNode } from 'react';
|
|
2
|
+
import { type FormProps as RACFormProps } from 'react-aria-components';
|
|
3
|
+
export interface FormProps extends Omit<RACFormProps, 'onSubmit'> {
|
|
4
|
+
/** Called with the form values when every field is valid. Return server errors by field name to show them on the fields; a promise shows the loading state. */
|
|
5
|
+
onSubmit?: (values: Record<string, FormDataEntryValue>, event: FormEvent<HTMLFormElement>) => void | Record<string, string | string[]> | Promise<void | Record<string, string | string[]>>;
|
|
6
|
+
/** Space between fields. Default 20 px; it lands on the nearest space step, so it follows the density. */
|
|
7
|
+
gap?: number;
|
|
8
|
+
children: ReactNode;
|
|
9
|
+
}
|
|
10
|
+
/** A form that validates on submit, moves focus to the first problem, and shows server errors on their fields. */
|
|
11
|
+
export declare function Form({ onSubmit, gap, children, className, validationBehavior, style, ...props }: FormProps): import("react").JSX.Element;
|
|
12
|
+
export interface FormActionsProps {
|
|
13
|
+
/** The submit button text. Default "Save". */
|
|
14
|
+
submitLabel?: ReactNode;
|
|
15
|
+
/** A cancel or secondary button. */
|
|
16
|
+
secondary?: ReactNode;
|
|
17
|
+
/** Shows the spinner on the submit button. */
|
|
18
|
+
isLoading?: boolean;
|
|
19
|
+
/** start (default), end, or stretch for full-width buttons. */
|
|
20
|
+
align?: 'start' | 'end' | 'stretch';
|
|
21
|
+
}
|
|
22
|
+
/** The buttons at the end of a form. */
|
|
23
|
+
export declare function FormActions({ submitLabel, secondary, isLoading, align }: FormActionsProps): import("react").JSX.Element;
|
|
24
|
+
/** A summary of what to fix, at the top of a long form, with links to the fields. */
|
|
25
|
+
export interface ErrorSummaryProps {
|
|
26
|
+
/** The errors by field id: { email: 'Use a valid email.' }. Each links to its field. */
|
|
27
|
+
errors: Record<string, string>;
|
|
28
|
+
/** The heading. Default "Fix these to continue". */
|
|
29
|
+
title?: ReactNode;
|
|
30
|
+
}
|
|
31
|
+
/** A list of the errors in a form, each a link that moves focus to its field. */
|
|
32
|
+
export declare function ErrorSummary({ errors, title }: ErrorSummaryProps): import("react").JSX.Element | null;
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { type ComponentType, type ReactElement, type SVGProps } from 'react';
|
|
2
|
+
import { type IconName } from './icon-names';
|
|
3
|
+
import { type IconSurface, type IconTone } from './icon-cells';
|
|
4
|
+
export type IconSize = 'sm' | 'md' | 'lg' | number;
|
|
5
|
+
export declare const ICON_SIZE_PX: {
|
|
6
|
+
readonly sm: 16;
|
|
7
|
+
readonly md: 20;
|
|
8
|
+
readonly lg: 24;
|
|
9
|
+
};
|
|
10
|
+
/** Any icon component that takes size and strokeWidth. */
|
|
11
|
+
export type IconComponent = ComponentType<SVGProps<SVGSVGElement> & {
|
|
12
|
+
size?: number | string;
|
|
13
|
+
strokeWidth?: number | string;
|
|
14
|
+
absoluteStrokeWidth?: boolean;
|
|
15
|
+
}>;
|
|
16
|
+
interface IconBaseProps extends Omit<SVGProps<SVGSVGElement>, 'ref'> {
|
|
17
|
+
/** sm, md or lg (the tokens --alea-size-icon-sm, -md, -lg: 16, 20, 24 px), or a number of px. Default: md, or the size the component around it gives its icons (Button, Badge, Tab...). */
|
|
18
|
+
size?: IconSize;
|
|
19
|
+
/** Stroke width in the 24 px grid (it scales with the icon). Default 2. */
|
|
20
|
+
strokeWidth?: number;
|
|
21
|
+
/** Name it for screen readers when the icon means something on its own. Without it, the icon is hidden from them. */
|
|
22
|
+
label?: string;
|
|
23
|
+
/**
|
|
24
|
+
* The color of the icon, by what it means. The same ten names as the Figma `Icon color` modes: default, muted, soft, faint, accent, danger, success, warning, info, status.
|
|
25
|
+
* Also brand, rating, control and like (colors with no surface). Leave it out (or `current`, the old name) to inherit the text color around the icon.
|
|
26
|
+
*/
|
|
27
|
+
tone?: IconTone;
|
|
28
|
+
/** What the icon sits on: normal (the page, default), solid (a filled chip, badge or button in the tone) or button (the primary button). The same three as the Figma `Icon surface` modes. */
|
|
29
|
+
surface?: IconSurface;
|
|
30
|
+
}
|
|
31
|
+
/** The glyph is given as a component or an element (`icon`), or by its name, loaded when needed (`name`). One of the two. */
|
|
32
|
+
export type IconProps = IconBaseProps & ({
|
|
33
|
+
/** The icon component, e.g. `Search`, or the same as an element, `<Search />` (the way Button takes iconStart). Any component with the same props works, so the set can be swapped. */
|
|
34
|
+
icon: IconComponent | ReactElement;
|
|
35
|
+
name?: never;
|
|
36
|
+
} | {
|
|
37
|
+
/** A glyph of the kit by its name (`search`, `arrow-right`: the same as Icon/<name> in Figma), loaded on demand: nothing of it is bundled until it is used. Preload with preloadIcons. */
|
|
38
|
+
name: IconName;
|
|
39
|
+
icon?: never;
|
|
40
|
+
});
|
|
41
|
+
/** Loads a glyph once (a second call, or a second Icon with the same name, reuses it). Resolves to null for a name the kit does not have. */
|
|
42
|
+
export declare function loadIcon(name: string): Promise<IconComponent | null>;
|
|
43
|
+
/** Loads glyphs ahead of time, so an Icon with that name renders at once, also on the server (call it, and await it, before rendering). */
|
|
44
|
+
export declare function preloadIcons(names: readonly IconName[]): Promise<void>;
|
|
45
|
+
/** An icon at the kit's sizes and stroke, from the bundled set or your own. Its color is a token picked by tone and surface. */
|
|
46
|
+
export declare function Icon({ icon, name, size, strokeWidth, label, tone, surface, className, ...props }: IconProps): import("react").JSX.Element;
|
|
47
|
+
export {};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
export declare const ICON_TONES: readonly ["default", "muted", "soft", "faint", "accent", "danger", "success", "warning", "info", "status"];
|
|
2
|
+
export declare const ICON_SURFACES: readonly ["normal", "solid", "button"];
|
|
3
|
+
/** Colors that are not a (tone, surface) cell: they come straight from a Theme token (brand = the active item of a nav, rating = filled stars, control = outline icons, like = a filled heart). */
|
|
4
|
+
export declare const ICON_OVERRIDES: readonly ["brand", "rating", "control", "like"];
|
|
5
|
+
/** The names `tone` took before the tones matched Figma. `current` inherits the text color of the parent (no token). */
|
|
6
|
+
export declare const ICON_TONE_ALIASES: {
|
|
7
|
+
readonly current: undefined;
|
|
8
|
+
};
|
|
9
|
+
export type IconToneName = typeof ICON_TONES[number];
|
|
10
|
+
export type IconSurface = typeof ICON_SURFACES[number];
|
|
11
|
+
export type IconOverride = typeof ICON_OVERRIDES[number];
|
|
12
|
+
export type IconTone = IconToneName | IconOverride | keyof typeof ICON_TONE_ALIASES;
|
|
13
|
+
/** The 17 cells that have a token of their own: `tone/surface` -> the context of the token (--alea-icon-<context>, `default` is --alea-icon). */
|
|
14
|
+
export declare const ICON_CELLS: Readonly<Record<string, string>>;
|
|
15
|
+
/** The token context of a (tone, surface): its own cell, else the normal one of the tone, else default (the same fallback as the Figma kit). Overrides ignore the surface. */
|
|
16
|
+
export declare function iconContext(tone: IconToneName | IconOverride, surface?: IconSurface): string;
|
|
17
|
+
/** The CSS variable of a context: `default` is --alea-icon, the others --alea-icon-<context>. */
|
|
18
|
+
export declare function iconVar(context: string): string;
|
|
19
|
+
/** The two data attributes a holder puts on the element around its icon (or on the icon): the CSS in icon.css colors it from the matching token. */
|
|
20
|
+
export declare function iconCtx(tone: IconToneName | IconOverride, surface?: IconSurface): {
|
|
21
|
+
'data-icon-tone': string;
|
|
22
|
+
'data-icon-surface': string;
|
|
23
|
+
};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { iconCtx } from './icon-cells';
|
|
2
|
+
type Ctx = ReturnType<typeof iconCtx>;
|
|
3
|
+
/** Button and IconButton. A solid look (primary, danger, a toned primary) sits on its tone, the secondary on the chip, the others on the page in their tone. */
|
|
4
|
+
export declare function buttonIcon(variant?: string, tone?: string): Ctx;
|
|
5
|
+
/** Badge (neutral text is muted) and Tag (neutral text is the default color): a solid look sits on its tone, the others on the page. */
|
|
6
|
+
export declare function chipIcon(kind: 'badge' | 'tag', appearance: string | undefined, tone?: string, selected?: boolean): Ctx;
|
|
7
|
+
/** Tab: muted until selected; the pills look sits the selected tab on the chip. */
|
|
8
|
+
export declare function tabIcon(selected: boolean, variant?: string): Ctx;
|
|
9
|
+
/** Link: accent by default, the text color for neutral, danger for danger. The muted look takes the text color, except in danger. */
|
|
10
|
+
export declare function linkIcon(tone?: string, variant?: string): Ctx;
|
|
11
|
+
/** Alert and Toast: the tone on the page; the solid look sits on its tone (danger, accent) or on the shared "on status" color (the others). */
|
|
12
|
+
export declare function alertIcon(tone?: string, solid?: boolean): Ctx;
|
|
13
|
+
/** Menu item: muted, danger in a danger item. */
|
|
14
|
+
export declare function menuIcon(tone?: string): Ctx;
|
|
15
|
+
/** App nav item: muted, the brand color when it is the current page. */
|
|
16
|
+
export declare function navIcon(current?: boolean): Ctx;
|
|
17
|
+
/** Rating: the empty icons are the control color; the filled ones the rating color (a tone changes it: accent is the brand color). */
|
|
18
|
+
export declare function ratingIcon(part: 'empty' | 'filled', tone?: string): Ctx;
|
|
19
|
+
export {};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { IconComponent } from './Icon';
|
|
2
|
+
/** The 184 glyphs of the kit, by the kebab-case name of Icon/<name> in Figma (lucide's own name). */
|
|
3
|
+
export declare const ICON_NAMES: readonly ["search", "x", "check", "chevron-down", "chevron-up", "chevron-left", "chevron-right", "chevrons-left", "chevrons-right", "arrow-left", "arrow-right", "arrow-up", "arrow-down", "arrow-up-right", "plus", "minus", "ellipsis", "ellipsis-vertical", "menu", "grip-vertical", "more-horizontal", "house", "settings", "user", "users", "bell", "mail", "message-square", "calendar", "clock", "star", "heart", "bookmark", "share-2", "link-2", "external-link", "eye", "eye-off", "lock", "lock-open", "key", "shield", "shield-check", "log-in", "log-out", "info", "circle-alert", "circle-check", "circle-x", "triangle-alert", "circle-help", "ban", "trash-2", "pencil", "copy", "clipboard", "download", "upload", "file", "file-text", "folder", "image", "paperclip", "save", "printer", "filter", "sliders-horizontal", "list", "list-ordered", "layout-grid", "table-2", "columns-3", "kanban", "sun", "moon", "monitor", "smartphone", "tablet", "laptop", "bold", "italic", "underline", "strikethrough", "code", "heading-2", "quote", "align-left", "align-center", "align-right", "link", "play", "pause", "skip-forward", "volume-2", "mic", "camera", "video", "refresh-cw", "rotate-ccw", "loader-circle", "zoom-in", "zoom-out", "maximize-2", "minimize-2", "move", "map-pin", "globe", "compass", "navigation", "shopping-cart", "shopping-bag", "credit-card", "wallet", "tag", "gift", "package", "truck", "chart-line", "chart-bar", "chart-pie", "trending-up", "trending-down", "activity", "gauge", "palette", "paintbrush", "type", "contrast", "swatch-book", "pipette", "layers", "component", "frame", "figma", "github", "sparkles", "zap", "rocket", "flag", "award", "trophy", "target", "lightbulb", "thumbs-up", "thumbs-down", "smile", "frown", "inbox", "send", "archive", "reply", "circle", "square", "triangle", "hexagon", "dot", "cloud", "wifi", "battery", "cpu", "database", "server", "hard-drive", "terminal", "book-open", "graduation-cap", "briefcase", "building-2", "phone", "qr-code", "scan-line", "toggle-left", "toggle-right", "ruler", "snowflake", "arrow-down-left", "store", "cloud-upload", "handshake", "layout-list", "leaf", "life-buoy", "newspaper", "piggy-bank"];
|
|
4
|
+
export type IconName = typeof ICON_NAMES[number];
|
|
5
|
+
/** One dynamic import per glyph: nothing of a glyph is bundled or fetched until an Icon with that name (or preloadIcons) asks for it. */
|
|
6
|
+
export declare const ICON_LOADERS: Record<IconName, () => Promise<{
|
|
7
|
+
default: IconComponent;
|
|
8
|
+
}>>;
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { type ElementType, type HTMLAttributes, type ReactNode } from 'react';
|
|
2
|
+
import { type Responsive, type Space } from './Layout';
|
|
3
|
+
export interface BentoGridProps extends HTMLAttributes<HTMLElement> {
|
|
4
|
+
/** Columns per breakpoint. Default { base: 1, sm: 2, lg: 4 }. */
|
|
5
|
+
columns?: Responsive<number>;
|
|
6
|
+
/** Height of one row in px; cards span rows with rowSpan. Default 200. */
|
|
7
|
+
rowHeight?: number;
|
|
8
|
+
/** Space between cards. Default 4 (16 px). */
|
|
9
|
+
gap?: Responsive<Space>;
|
|
10
|
+
as?: ElementType;
|
|
11
|
+
children?: ReactNode;
|
|
12
|
+
}
|
|
13
|
+
/** A bento layout: cards of different sizes on an even grid that fills the gaps. On phones it is one column. */
|
|
14
|
+
export declare function BentoGrid({ columns, rowHeight, gap, as, className, style, ...props }: BentoGridProps): import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>;
|
|
15
|
+
export interface BentoCardProps extends Omit<HTMLAttributes<HTMLElement>, 'title'> {
|
|
16
|
+
/** Columns it spans, per breakpoint: { base: 1, lg: 2 }. */
|
|
17
|
+
colSpan?: Responsive<number>;
|
|
18
|
+
/** Rows it spans, per breakpoint. */
|
|
19
|
+
rowSpan?: Responsive<number>;
|
|
20
|
+
/** A small label above the title. */
|
|
21
|
+
eyebrow?: ReactNode;
|
|
22
|
+
/** The title, at headingLevel. */
|
|
23
|
+
title?: ReactNode;
|
|
24
|
+
/** Text under the title. */
|
|
25
|
+
description?: ReactNode;
|
|
26
|
+
/** An icon by the title. */
|
|
27
|
+
icon?: ReactNode;
|
|
28
|
+
/** A picture, chart or live component that fills the card above the text. */
|
|
29
|
+
visual?: ReactNode;
|
|
30
|
+
/** Makes the whole card a link (one tab stop, named by the title). */
|
|
31
|
+
href?: string;
|
|
32
|
+
/** default: the surface; deep: darker; glass: frosted; outline: border only. */
|
|
33
|
+
variant?: 'default' | 'deep' | 'glass' | 'outline';
|
|
34
|
+
/** Inner space, like Card. Default normal. */
|
|
35
|
+
padding?: 'none' | 'tight' | 'normal' | 'loose';
|
|
36
|
+
/** Heading level of the title. Default 3. */
|
|
37
|
+
headingLevel?: 2 | 3 | 4;
|
|
38
|
+
as?: ElementType;
|
|
39
|
+
children?: ReactNode;
|
|
40
|
+
}
|
|
41
|
+
/** A cell of a BentoGrid: an optional visual on top, then the title and text. */
|
|
42
|
+
export declare function BentoCard({ colSpan, rowSpan, eyebrow, title, description, icon, visual, href, variant, padding, headingLevel, as, className, style, children, ...props }: BentoCardProps): import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>;
|