@alea-design/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 +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 +71 -0
- package/dist/index.js +7434 -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/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,120 @@
|
|
|
1
|
+
import { type ReactNode } from 'react';
|
|
2
|
+
import { type AvatarProps } from '../display/Display';
|
|
3
|
+
export interface PersonaProps {
|
|
4
|
+
/** The person's (or team's) name. */
|
|
5
|
+
name: string;
|
|
6
|
+
/** Photo URL. */
|
|
7
|
+
src?: string;
|
|
8
|
+
/** A second line: role, email. */
|
|
9
|
+
secondary?: ReactNode;
|
|
10
|
+
/** A third line, shown from size lg: status message, last seen. */
|
|
11
|
+
tertiary?: ReactNode;
|
|
12
|
+
/** A presence dot on the avatar. */
|
|
13
|
+
status?: AvatarProps['status'];
|
|
14
|
+
/** sm (24 px avatar, one line), md (40 px, default), lg (56 px), xl (80 px). */
|
|
15
|
+
size?: 'sm' | 'md' | 'lg' | 'xl';
|
|
16
|
+
/** Text after the avatar (default) or below it, centered. */
|
|
17
|
+
textPosition?: 'after' | 'below';
|
|
18
|
+
/** Something at the end: a badge, a button. */
|
|
19
|
+
end?: ReactNode;
|
|
20
|
+
/** Extra class names. */
|
|
21
|
+
className?: string;
|
|
22
|
+
}
|
|
23
|
+
/** A person at a glance: avatar with presence, name, and up to two more lines. For lists, cards, menus and comments. */
|
|
24
|
+
export declare function Persona({ name, src, secondary, tertiary, status, size, textPosition, end, className }: PersonaProps): import("react").JSX.Element;
|
|
25
|
+
export interface CommentProps {
|
|
26
|
+
/** Who wrote it. */
|
|
27
|
+
author: string;
|
|
28
|
+
/** Their photo. */
|
|
29
|
+
avatarSrc?: string;
|
|
30
|
+
/** When: a Date (shown relative, like "5 min ago", with the full date on hover) or your own text. */
|
|
31
|
+
time?: Date | ReactNode;
|
|
32
|
+
/** The comment. */
|
|
33
|
+
children: ReactNode;
|
|
34
|
+
/** Actions under it: Reply, Like, Edit (use Button variant="text" size="xs"). */
|
|
35
|
+
actions?: ReactNode;
|
|
36
|
+
/** A short tag after the name: Author, Admin, Bot. */
|
|
37
|
+
badge?: ReactNode;
|
|
38
|
+
/** Marks it as edited. */
|
|
39
|
+
isEdited?: boolean;
|
|
40
|
+
/** Only some people can see it: shows a lock and this text ("Only visible to your team"). */
|
|
41
|
+
restricted?: ReactNode;
|
|
42
|
+
/** Draws attention to it: a linked or new comment. */
|
|
43
|
+
isHighlighted?: boolean;
|
|
44
|
+
/** Shows it as being saved (dimmed) or failed (with errorMessage). */
|
|
45
|
+
state?: 'saving' | 'failed';
|
|
46
|
+
/** What went wrong when state is failed, with your retry action in actions. */
|
|
47
|
+
errorMessage?: ReactNode;
|
|
48
|
+
/** Replies: nested Comment elements. */
|
|
49
|
+
replies?: ReactNode;
|
|
50
|
+
/** Heading level of the author line for screen readers' heading navigation. Default none (plain text). */
|
|
51
|
+
headingLevel?: 2 | 3 | 4 | 5 | 6;
|
|
52
|
+
/** Extra class names. */
|
|
53
|
+
className?: string;
|
|
54
|
+
}
|
|
55
|
+
/** One comment in a conversation: author, time, text, actions, and nested replies. */
|
|
56
|
+
export declare function Comment({ author, avatarSrc, time, children, actions, badge, isEdited, restricted, isHighlighted, state, errorMessage, replies, headingLevel, className }: CommentProps): import("react").JSX.Element;
|
|
57
|
+
export interface CommentComposerProps {
|
|
58
|
+
/** Called with the text when sent; clear it yourself if you control value. */
|
|
59
|
+
onSubmit: (text: string) => void;
|
|
60
|
+
/** Who is writing (shows their avatar). */
|
|
61
|
+
author?: string;
|
|
62
|
+
/** Their photo. */
|
|
63
|
+
avatarSrc?: string;
|
|
64
|
+
/** Placeholder. Default "Add a comment…". */
|
|
65
|
+
placeholder?: string;
|
|
66
|
+
/** Label for screen readers. Default "Comment". */
|
|
67
|
+
label?: string;
|
|
68
|
+
/** Text of the send button. Default "Comment". */
|
|
69
|
+
submitLabel?: ReactNode;
|
|
70
|
+
/** Shows Cancel, for inline replies. */
|
|
71
|
+
onCancel?: () => void;
|
|
72
|
+
/** Disables sending while it saves. */
|
|
73
|
+
isSubmitting?: boolean;
|
|
74
|
+
/** Extra class names. */
|
|
75
|
+
className?: string;
|
|
76
|
+
}
|
|
77
|
+
/** Where people write a comment or a reply: grows with the text, ⌘Enter or Ctrl+Enter sends. */
|
|
78
|
+
export declare function CommentComposer({ onSubmit, author, avatarSrc, placeholder, label, submitLabel, onCancel, isSubmitting, className }: CommentComposerProps): import("react").JSX.Element;
|
|
79
|
+
export interface MediaCardProps {
|
|
80
|
+
/** An image, video or illustration. */
|
|
81
|
+
media: ReactNode;
|
|
82
|
+
/** The title. */
|
|
83
|
+
title: ReactNode;
|
|
84
|
+
/** The text. */
|
|
85
|
+
children?: ReactNode;
|
|
86
|
+
/** The main action. */
|
|
87
|
+
primaryAction?: ReactNode;
|
|
88
|
+
/** A second action. */
|
|
89
|
+
secondaryAction?: ReactNode;
|
|
90
|
+
/** Adds a close button that calls this. */
|
|
91
|
+
onDismiss?: () => void;
|
|
92
|
+
/** horizontal (media on the side, default; stacks on narrow cards) or vertical (media on top). */
|
|
93
|
+
layout?: 'horizontal' | 'vertical';
|
|
94
|
+
/** Heading level of the title. Default 3. */
|
|
95
|
+
headingLevel?: 2 | 3 | 4;
|
|
96
|
+
/** Extra class names. */
|
|
97
|
+
className?: string;
|
|
98
|
+
}
|
|
99
|
+
/** A card that leads with media: an image or video beside (or above) a title, text and actions. For tutorials, promotions, onboarding. */
|
|
100
|
+
export declare function MediaCard({ media, title, children, primaryAction, secondaryAction, onDismiss, layout, headingLevel, className }: MediaCardProps): import("react").JSX.Element;
|
|
101
|
+
export interface CalloutCardProps {
|
|
102
|
+
/** The title. */
|
|
103
|
+
title: ReactNode;
|
|
104
|
+
/** The text. */
|
|
105
|
+
children?: ReactNode;
|
|
106
|
+
/** An illustration on the right (hidden on narrow cards). */
|
|
107
|
+
illustration?: ReactNode;
|
|
108
|
+
/** The main action. */
|
|
109
|
+
primaryAction?: ReactNode;
|
|
110
|
+
/** A second action. */
|
|
111
|
+
secondaryAction?: ReactNode;
|
|
112
|
+
/** Adds a close button that calls this. */
|
|
113
|
+
onDismiss?: () => void;
|
|
114
|
+
/** Heading level of the title. Default 3. */
|
|
115
|
+
headingLevel?: 2 | 3 | 4;
|
|
116
|
+
/** Extra class names. */
|
|
117
|
+
className?: string;
|
|
118
|
+
}
|
|
119
|
+
/** A card that suggests a next step: a title, a sentence, an action and an illustration. Dismissible. */
|
|
120
|
+
export declare function CalloutCard({ title, children, illustration, primaryAction, secondaryAction, onDismiss, headingLevel, className }: CalloutCardProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
import { type ElementType, type HTMLAttributes, type ReactNode } from 'react';
|
|
2
|
+
export interface DescriptionsProps extends Omit<HTMLAttributes<HTMLElement>, 'title'> {
|
|
3
|
+
/** The pairs: label and value. span sets how many columns an item takes; wide spans the whole row. */
|
|
4
|
+
items: Array<{
|
|
5
|
+
label: ReactNode;
|
|
6
|
+
value: ReactNode; /** Columns it spans (1 to 4). */
|
|
7
|
+
span?: 1 | 2 | 3 | 4; /** Spans the whole row. */
|
|
8
|
+
wide?: boolean;
|
|
9
|
+
}>;
|
|
10
|
+
/** Columns on wide screens: 1 to 4. Default 2. Three and four columns drop to two below 1024 px; everything is one column on phones. */
|
|
11
|
+
columns?: 1 | 2 | 3 | 4;
|
|
12
|
+
/** stacked (label above the value, default) or inline (label and value side by side). */
|
|
13
|
+
layout?: 'stacked' | 'inline';
|
|
14
|
+
/** Draws lines between items. */
|
|
15
|
+
bordered?: boolean;
|
|
16
|
+
/** sm (tighter, 13 px values) or md (default). */
|
|
17
|
+
size?: 'sm' | 'md';
|
|
18
|
+
/** A title above the list (an h3). */
|
|
19
|
+
title?: ReactNode;
|
|
20
|
+
/** Something at the end of the title row: an Edit button or link. */
|
|
21
|
+
extra?: ReactNode;
|
|
22
|
+
/** With layout inline: the width of the label column, any CSS length. Default 40%. */
|
|
23
|
+
labelWidth?: string;
|
|
24
|
+
}
|
|
25
|
+
/** Key and value pairs: order details, profile facts, settings summaries. A title with an action, one to four columns, item spans, stacked or inline, two sizes. */
|
|
26
|
+
export declare function Descriptions({ items, columns, layout, bordered, size, title, extra, labelWidth, className, style, ...props }: DescriptionsProps): import("react").JSX.Element;
|
|
27
|
+
export interface StatisticProps extends Omit<HTMLAttributes<HTMLDivElement>, 'prefix'> {
|
|
28
|
+
/** What the number is. */
|
|
29
|
+
label: ReactNode;
|
|
30
|
+
/** The number. */
|
|
31
|
+
value: number;
|
|
32
|
+
/** Intl number format (currency, percent, compact). */
|
|
33
|
+
formatOptions?: Intl.NumberFormatOptions;
|
|
34
|
+
/** Change versus before, e.g. 0.12 for +12%. */
|
|
35
|
+
delta?: number;
|
|
36
|
+
/** Is up good? Default true (turns green); false flips the colors (costs, errors). */
|
|
37
|
+
higherIsBetter?: boolean;
|
|
38
|
+
/** Counts up from 0 when it appears (skipped with reduced motion). */
|
|
39
|
+
animate?: boolean;
|
|
40
|
+
/** Before the number, e.g. "$". */
|
|
41
|
+
prefix?: ReactNode;
|
|
42
|
+
/** After the number, e.g. " ms". */
|
|
43
|
+
suffix?: ReactNode;
|
|
44
|
+
}
|
|
45
|
+
/** A big number with its label and change. */
|
|
46
|
+
export declare function Statistic({ label, value, formatOptions, delta, higherIsBetter, animate, prefix, suffix, className, ...props }: StatisticProps): import("react").JSX.Element;
|
|
47
|
+
export interface EmptyStateProps extends Omit<HTMLAttributes<HTMLDivElement>, 'title'> {
|
|
48
|
+
/** What is empty, in a few words. */
|
|
49
|
+
title: ReactNode;
|
|
50
|
+
/** What to do about it. */
|
|
51
|
+
description?: ReactNode;
|
|
52
|
+
/** An icon or illustration. Default an inbox. Pass an <img> or SVG for a full illustration (it is shown larger, without the tile). */
|
|
53
|
+
icon?: ReactNode;
|
|
54
|
+
/** Shows icon as a full illustration instead of an icon in a tile. */
|
|
55
|
+
illustration?: boolean;
|
|
56
|
+
/** A button to fix it: "Create your first palette". */
|
|
57
|
+
action?: ReactNode;
|
|
58
|
+
/** A second, quieter action next to it: "Import", "Learn more". */
|
|
59
|
+
secondaryAction?: ReactNode;
|
|
60
|
+
/** A line under the actions: a help link, a note. */
|
|
61
|
+
footer?: ReactNode;
|
|
62
|
+
/** sm (inside cards and tables), md (default) or lg (a whole page). */
|
|
63
|
+
size?: 'sm' | 'md' | 'lg';
|
|
64
|
+
/** plain (default) or dashed: a dashed box, for areas waiting to be filled. */
|
|
65
|
+
variant?: 'plain' | 'dashed';
|
|
66
|
+
/** The title's heading element. Default h3. */
|
|
67
|
+
headingAs?: ElementType;
|
|
68
|
+
}
|
|
69
|
+
/** What to show when there is nothing yet, and what to do about it: three sizes, a dashed look, an illustration, two actions and a footer. */
|
|
70
|
+
export declare function EmptyState({ title, description, icon, illustration, action, secondaryAction, footer, size, variant, headingAs, className, ...props }: EmptyStateProps): import("react").JSX.Element;
|
|
71
|
+
declare const RESULT_ICON: {
|
|
72
|
+
readonly success: import("react").ForwardRefExoticComponent<Omit<import("lucide-react").LucideProps, "ref"> & import("react").RefAttributes<SVGSVGElement>>;
|
|
73
|
+
readonly error: import("react").ForwardRefExoticComponent<Omit<import("lucide-react").LucideProps, "ref"> & import("react").RefAttributes<SVGSVGElement>>;
|
|
74
|
+
readonly '404': import("react").ForwardRefExoticComponent<Omit<import("lucide-react").LucideProps, "ref"> & import("react").RefAttributes<SVGSVGElement>>;
|
|
75
|
+
readonly '403': import("react").ForwardRefExoticComponent<Omit<import("lucide-react").LucideProps, "ref"> & import("react").RefAttributes<SVGSVGElement>>;
|
|
76
|
+
readonly '500': import("react").ForwardRefExoticComponent<Omit<import("lucide-react").LucideProps, "ref"> & import("react").RefAttributes<SVGSVGElement>>;
|
|
77
|
+
readonly info: import("react").ForwardRefExoticComponent<Omit<import("lucide-react").LucideProps, "ref"> & import("react").RefAttributes<SVGSVGElement>>;
|
|
78
|
+
};
|
|
79
|
+
export interface ResultProps extends Omit<EmptyStateProps, 'icon'> {
|
|
80
|
+
/** success, error, 404, 403, 500 or info. */
|
|
81
|
+
status: keyof typeof RESULT_ICON;
|
|
82
|
+
}
|
|
83
|
+
/** The outcome of a flow or a whole page: done, failed, not found, no access. */
|
|
84
|
+
export declare function Result({ status, className, ...props }: ResultProps): import("react").JSX.Element;
|
|
85
|
+
export {};
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
import { type CalendarProps as RACCalendarProps, type RangeCalendarProps as RACRangeCalendarProps, type DatePickerProps as RACDatePickerProps, type DateRangePickerProps as RACDateRangePickerProps, type DateFieldProps as RACDateFieldProps, type TimeFieldProps as RACTimeFieldProps, type DateValue, type TimeValue, type ValidationResult } from 'react-aria-components';
|
|
3
|
+
import type { MotionProp } from '@alea-design/motion';
|
|
4
|
+
interface CalendarExtras {
|
|
5
|
+
/** Month and year dropdowns in the header, to jump far (birthdays, contracts). */
|
|
6
|
+
pickers?: boolean;
|
|
7
|
+
/** How many months show side by side. Default 1; 2 is common for ranges. They stack on narrow screens. */
|
|
8
|
+
visibleMonths?: number;
|
|
9
|
+
}
|
|
10
|
+
export interface CalendarProps<T extends DateValue> extends RACCalendarProps<T>, CalendarExtras {
|
|
11
|
+
}
|
|
12
|
+
/** A month to pick a date from: month and year dropdowns, several months side by side. Arrow keys move by day, Page Up/Down by month. */
|
|
13
|
+
export declare function Calendar<T extends DateValue>({ className, pickers, visibleMonths, ...props }: CalendarProps<T>): import("react").JSX.Element;
|
|
14
|
+
export interface RangeCalendarProps<T extends DateValue> extends RACRangeCalendarProps<T>, CalendarExtras {
|
|
15
|
+
}
|
|
16
|
+
/** Months to pick a start and end date from. */
|
|
17
|
+
export declare function RangeCalendar<T extends DateValue>({ className, pickers, visibleMonths, ...props }: RangeCalendarProps<T>): import("react").JSX.Element;
|
|
18
|
+
interface Bits {
|
|
19
|
+
/** The visible label. */
|
|
20
|
+
label?: ReactNode;
|
|
21
|
+
/** Help text under the field. */
|
|
22
|
+
description?: ReactNode;
|
|
23
|
+
/** Error text, shown when invalid. */
|
|
24
|
+
errorMessage?: ReactNode | ((v: ValidationResult) => ReactNode);
|
|
25
|
+
/** Shows a spinner at the end of the value while it is saved or checked (a date being validated against a calendar, say). It takes no room, the field stays editable, and screen readers hear it as busy. */
|
|
26
|
+
isLoading?: boolean;
|
|
27
|
+
}
|
|
28
|
+
export interface DateFieldProps<T extends DateValue> extends RACDateFieldProps<T>, Bits {
|
|
29
|
+
}
|
|
30
|
+
/** Type a date segment by segment, in the person's locale format. */
|
|
31
|
+
export declare function DateField<T extends DateValue>({ label, description, errorMessage, isLoading, className, ...props }: DateFieldProps<T>): import("react").JSX.Element;
|
|
32
|
+
export interface TimeFieldProps<T extends TimeValue> extends RACTimeFieldProps<T>, Bits {
|
|
33
|
+
}
|
|
34
|
+
/** Type a time; 12 or 24 hours from the locale (hourCycle to force one). */
|
|
35
|
+
export declare function TimeField<T extends TimeValue>({ label, description, errorMessage, isLoading, className, ...props }: TimeFieldProps<T>): import("react").JSX.Element;
|
|
36
|
+
export interface DatePickerProps<T extends DateValue> extends RACDatePickerProps<T>, Bits {
|
|
37
|
+
/** How the popup enters and leaves: a preset (fade, scale, pop, slide-down, blur...), false for none, or options. */
|
|
38
|
+
motion?: MotionProp;
|
|
39
|
+
}
|
|
40
|
+
/** Type a date or pick it from a calendar. */
|
|
41
|
+
export declare function DatePicker<T extends DateValue>({ motion, label, description, errorMessage, isLoading, className, ...props }: DatePickerProps<T>): import("react").JSX.Element;
|
|
42
|
+
export interface DateRangePickerProps<T extends DateValue> extends RACDateRangePickerProps<T>, Bits {
|
|
43
|
+
/** How the popup enters and leaves: a preset (fade, scale, pop, slide-down, blur...), false for none, or options. */
|
|
44
|
+
motion?: MotionProp;
|
|
45
|
+
}
|
|
46
|
+
/** Type or pick a start and end date. */
|
|
47
|
+
export declare function DateRangePicker<T extends DateValue>({ motion, label, description, errorMessage, isLoading, className, ...props }: DateRangePickerProps<T>): import("react").JSX.Element;
|
|
48
|
+
export {};
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
import { type HTMLAttributes, type ReactNode } from 'react';
|
|
2
|
+
import { type TagGroupProps as RACTagGroupProps, type TagProps as RACTagProps, type Key } from 'react-aria-components';
|
|
3
|
+
export type Tone = 'neutral' | 'accent' | 'success' | 'warning' | 'danger' | 'info';
|
|
4
|
+
export interface BadgeProps extends HTMLAttributes<HTMLSpanElement> {
|
|
5
|
+
/** neutral, accent, success, warning, danger or info. */
|
|
6
|
+
tone?: Tone;
|
|
7
|
+
/** soft (tinted, default), solid, or outline. */
|
|
8
|
+
appearance?: 'soft' | 'solid' | 'outline';
|
|
9
|
+
/** A dot before the text, for statuses. pulse makes it breathe, for live things. */
|
|
10
|
+
dot?: boolean | 'pulse';
|
|
11
|
+
/** An icon before the text. */
|
|
12
|
+
icon?: ReactNode;
|
|
13
|
+
/** sm 20 px, md 24 px (default) or lg 28 px. */
|
|
14
|
+
size?: 'sm' | 'md' | 'lg';
|
|
15
|
+
/** pill (default) or rounded (6 px corners). */
|
|
16
|
+
shape?: 'pill' | 'rounded';
|
|
17
|
+
children?: ReactNode;
|
|
18
|
+
}
|
|
19
|
+
/** A small status or count label: six tones, three looks, three sizes, a dot or an icon. Not interactive. */
|
|
20
|
+
export declare function Badge({ tone, appearance, dot, icon, size, shape, className, children, ...props }: BadgeProps): import("react").JSX.Element;
|
|
21
|
+
/** The tone for common status words (lowercase). Extend or override it with StatusBadge's tones. */
|
|
22
|
+
export declare const STATUS_TONES: Record<string, Tone>;
|
|
23
|
+
export interface StatusBadgeProps extends Omit<BadgeProps, 'tone' | 'children'> {
|
|
24
|
+
/** The status as people read it: "Paid", "In review". */
|
|
25
|
+
status: string;
|
|
26
|
+
/** Your own words and their tones, merged over STATUS_TONES (keys in lowercase): { 'awaiting stock': 'warning' }. */
|
|
27
|
+
tones?: Record<string, Tone>;
|
|
28
|
+
/** Force a tone instead of looking it up. */
|
|
29
|
+
tone?: Tone;
|
|
30
|
+
}
|
|
31
|
+
/** A status in its tone: Published and Paid in green, Draft and Pending in amber, Failed and Overdue in red, anything unknown neutral. The word always shows, so color is never the only cue. */
|
|
32
|
+
export declare function StatusBadge({ status, tones, tone, size, dot, ...props }: StatusBadgeProps): import("react").JSX.Element;
|
|
33
|
+
export interface CountBadgeProps extends HTMLAttributes<HTMLSpanElement> {
|
|
34
|
+
/** The number to show. */
|
|
35
|
+
count: number;
|
|
36
|
+
/** Shows max+ above this. Default 99. */
|
|
37
|
+
max?: number;
|
|
38
|
+
/** Name for screen readers, e.g. "unread messages". */
|
|
39
|
+
label?: string;
|
|
40
|
+
/** Color of the bubble. Default accent. */
|
|
41
|
+
tone?: Tone;
|
|
42
|
+
/** Shows 0 instead of hiding the bubble. */
|
|
43
|
+
showZero?: boolean;
|
|
44
|
+
/** Only a dot, without the number (screen readers still hear the count). */
|
|
45
|
+
dot?: boolean;
|
|
46
|
+
/** sm (16 px) or md (20 px, default). */
|
|
47
|
+
size?: 'sm' | 'md';
|
|
48
|
+
}
|
|
49
|
+
/** A number bubble for notifications. Hidden at zero unless showZero. */
|
|
50
|
+
export declare function CountBadge({ count, max, label, tone, showZero, dot, size, className, ...props }: CountBadgeProps): import("react").JSX.Element | null;
|
|
51
|
+
export interface TagGroupProps<T extends object> extends Omit<RACTagGroupProps, 'children'> {
|
|
52
|
+
/** The visible label for the group. */
|
|
53
|
+
label?: ReactNode;
|
|
54
|
+
/** The tags as data, rendered with the children function. */
|
|
55
|
+
items?: Iterable<T>;
|
|
56
|
+
children: ReactNode | ((item: T) => ReactNode);
|
|
57
|
+
/** Called with the removed keys; shows an x on each tag. */
|
|
58
|
+
onRemove?: (keys: Set<Key>) => void;
|
|
59
|
+
/** Shown when there are no tags. */
|
|
60
|
+
renderEmptyState?: () => ReactNode;
|
|
61
|
+
/** wrap (default): tags flow onto more lines. scroll: one line that scrolls sideways, with arrows for the pointer, for filter chips above a list. */
|
|
62
|
+
overflow?: 'wrap' | 'scroll';
|
|
63
|
+
}
|
|
64
|
+
/** Tags that can be selected (filters) or removed (chosen values). Arrow keys move, Delete removes. */
|
|
65
|
+
export declare function TagGroup<T extends object>({ label, items, children, renderEmptyState, overflow, className, ...props }: TagGroupProps<T>): import("react").JSX.Element;
|
|
66
|
+
export interface TagProps extends RACTagProps {
|
|
67
|
+
/** Color of the tag: neutral (default), accent, success, warning, danger or info. */
|
|
68
|
+
tone?: Tone;
|
|
69
|
+
/** outline (default), soft (tinted) or solid. */
|
|
70
|
+
appearance?: 'outline' | 'soft' | 'solid';
|
|
71
|
+
/** sm (24 px), md (32 px, default) or lg (40 px). */
|
|
72
|
+
size?: 'sm' | 'md' | 'lg';
|
|
73
|
+
/** An icon or a small avatar before the text. */
|
|
74
|
+
icon?: ReactNode;
|
|
75
|
+
}
|
|
76
|
+
/** One tag in a TagGroup. */
|
|
77
|
+
export declare function Tag({ tone, appearance, size, icon, children, className, ...props }: TagProps): import("react").JSX.Element;
|
|
78
|
+
export interface AvatarProps extends HTMLAttributes<HTMLSpanElement> {
|
|
79
|
+
/** Image URL. Falls back to initials when missing or broken. */
|
|
80
|
+
src?: string;
|
|
81
|
+
/** The person's name: alt text and initials. */
|
|
82
|
+
name: string;
|
|
83
|
+
/** xs 24, sm 32, md 40 (default), lg 56, xl 80, 2xl 96 px. */
|
|
84
|
+
size?: 'xs' | 'sm' | 'md' | 'lg' | 'xl' | '2xl';
|
|
85
|
+
/** A status dot in the corner. */
|
|
86
|
+
status?: 'online' | 'away' | 'busy' | 'offline';
|
|
87
|
+
/** circle (default) or square. */
|
|
88
|
+
shape?: 'circle' | 'square';
|
|
89
|
+
/** What shows without a photo instead of initials: an icon, a logo. */
|
|
90
|
+
fallback?: ReactNode;
|
|
91
|
+
/** A ring around the avatar, in the accent or a tone (for the current user, or a story). */
|
|
92
|
+
ring?: boolean | Tone;
|
|
93
|
+
/** A count in the top corner (unread messages). */
|
|
94
|
+
count?: number;
|
|
95
|
+
}
|
|
96
|
+
/** A person: photo, or initials on a gradient. */
|
|
97
|
+
export declare function Avatar({ src, name, size, status, shape, fallback, ring, count, className, style, ...props }: AvatarProps): import("react").JSX.Element;
|
|
98
|
+
export interface AvatarGroupProps extends HTMLAttributes<HTMLDivElement> {
|
|
99
|
+
/** Shows this many, then +N. Default 4. */
|
|
100
|
+
max?: number;
|
|
101
|
+
/** Size of every avatar. */
|
|
102
|
+
size?: AvatarProps['size'];
|
|
103
|
+
/** The people: name, and src for a photo. */
|
|
104
|
+
people: Array<{
|
|
105
|
+
name: string;
|
|
106
|
+
src?: string;
|
|
107
|
+
}>;
|
|
108
|
+
/** The avatars spread apart on hover or focus (the fan pattern). */
|
|
109
|
+
fan?: boolean;
|
|
110
|
+
/** How much the avatars overlap: tight, normal (default) or none (side by side). */
|
|
111
|
+
spacing?: 'tight' | 'normal' | 'none';
|
|
112
|
+
}
|
|
113
|
+
/** Overlapping avatars with a +N for the rest. */
|
|
114
|
+
export declare function AvatarGroup({ people, max, size, fan, spacing, className, ...props }: AvatarGroupProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
type Tone = 'accent' | 'neutral' | 'success' | 'warning' | 'danger' | 'info';
|
|
3
|
+
export interface IconTileProps {
|
|
4
|
+
/** The icon (a Lucide icon or any 24 px SVG). Decorative: say what it means in the text next to it. */
|
|
5
|
+
icon: ReactNode;
|
|
6
|
+
/** The color. Default accent. */
|
|
7
|
+
tone?: Tone;
|
|
8
|
+
/** soft (a tinted square, default), solid (filled, for a brand mark) or gradient (the accent gradient, for a product's logo mark). */
|
|
9
|
+
variant?: 'soft' | 'solid' | 'gradient';
|
|
10
|
+
/** xs (20 px, beside a name in a menu), sm (28 px, a logo in a navbar), md (40 px, default) or lg (48 px). */
|
|
11
|
+
size?: 'xs' | 'sm' | 'md' | 'lg';
|
|
12
|
+
/** Square with rounded corners (default) or a circle. */
|
|
13
|
+
shape?: 'square' | 'circle';
|
|
14
|
+
className?: string;
|
|
15
|
+
}
|
|
16
|
+
/** An icon in a tinted square: the face of a feature card, a collection, an integration, or an app's mark. */
|
|
17
|
+
export declare function IconTile({ icon, tone, variant, size, shape, className }: IconTileProps): import("react").JSX.Element;
|
|
18
|
+
export interface PaymentCardProps {
|
|
19
|
+
/** The name on the card. */
|
|
20
|
+
holder: string;
|
|
21
|
+
/** The last four digits. */
|
|
22
|
+
last4: string;
|
|
23
|
+
/** Physical, Virtual, Debit… shown top right. */
|
|
24
|
+
kind?: string;
|
|
25
|
+
/** MM/YY. */
|
|
26
|
+
expiry?: string;
|
|
27
|
+
/** The issuer's name, top left. */
|
|
28
|
+
brand?: ReactNode;
|
|
29
|
+
/** Frozen: muted, with a snowflake. */
|
|
30
|
+
frozen?: boolean;
|
|
31
|
+
/** The card's color. Default accent (follows the theme). */
|
|
32
|
+
tone?: 'accent' | 'graphite' | 'emerald' | 'indigo' | 'sunset';
|
|
33
|
+
/** Makes the card a link (to its details), named like the picture. */
|
|
34
|
+
href?: string;
|
|
35
|
+
className?: string;
|
|
36
|
+
}
|
|
37
|
+
/** A bank card as a picture: issuer, number ending, holder and expiry on a gradient. One image for screen readers ("Physical card for Ana, ending 4410"). */
|
|
38
|
+
export declare function PaymentCard({ holder, last4, kind, expiry, brand, frozen, tone, href, className }: PaymentCardProps): import("react").JSX.Element;
|
|
39
|
+
export interface AmountProps {
|
|
40
|
+
/** The amount: positive is money in, negative money out. */
|
|
41
|
+
value: number;
|
|
42
|
+
/** ISO currency code. Default USD. */
|
|
43
|
+
currency?: string;
|
|
44
|
+
/** Show the in/out arrow before it. Default false. */
|
|
45
|
+
icon?: boolean;
|
|
46
|
+
/** Color money in green. Default true. */
|
|
47
|
+
colorIn?: boolean;
|
|
48
|
+
/** Number format options (merged with the currency). */
|
|
49
|
+
formatOptions?: Intl.NumberFormatOptions;
|
|
50
|
+
className?: string;
|
|
51
|
+
}
|
|
52
|
+
/** Money with its direction: +$8,400.00 in green for money in, −$842.17 for money out, in the people's locale. */
|
|
53
|
+
export declare function Amount({ value, currency, icon, colorIn, formatOptions, className }: AmountProps): import("react").JSX.Element;
|
|
54
|
+
export {};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export interface EmojiPickerProps {
|
|
2
|
+
/** Called with the picked emoji and its name. */
|
|
3
|
+
onSelect: (emoji: string, name: string) => void;
|
|
4
|
+
/** Remembers the last picks (in this browser) and shows them first. Default true. */
|
|
5
|
+
showRecent?: boolean;
|
|
6
|
+
/** Columns in the grid. Default 8. */
|
|
7
|
+
columns?: number;
|
|
8
|
+
/** Height of the scrolling grid in px. Default 280. */
|
|
9
|
+
height?: number;
|
|
10
|
+
/** Puts the cursor in the search field when it opens. Default true. */
|
|
11
|
+
autoFocusSearch?: boolean;
|
|
12
|
+
/** Extra class names. */
|
|
13
|
+
className?: string;
|
|
14
|
+
}
|
|
15
|
+
/** Pick an emoji: search by name (English or Spanish), jump by category, recent picks first. The grid is a listbox in a grid layout: arrows move in two directions, Enter picks, and every emoji has a name for screen readers. */
|
|
16
|
+
export declare function EmojiPicker({ onSelect, showRecent, columns, height, autoFocusSearch, className }: EmojiPickerProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export type EmojiCategory = 'smileys' | 'people' | 'nature' | 'food' | 'activities' | 'travel' | 'objects' | 'symbols';
|
|
2
|
+
export interface EmojiEntry {
|
|
3
|
+
emoji: string;
|
|
4
|
+
en: string;
|
|
5
|
+
es: string;
|
|
6
|
+
category: EmojiCategory;
|
|
7
|
+
}
|
|
8
|
+
export declare const EMOJI: EmojiEntry[];
|
|
9
|
+
export declare const EMOJI_CATEGORIES: Array<{
|
|
10
|
+
id: EmojiCategory;
|
|
11
|
+
icon: string;
|
|
12
|
+
}>;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
export interface CodeStep {
|
|
3
|
+
/** Short name of the step: "Install the package". */
|
|
4
|
+
title: ReactNode;
|
|
5
|
+
/** What to do and why, beside the code. */
|
|
6
|
+
description?: ReactNode;
|
|
7
|
+
/** The code for this step. Leave it out for a step that is only text. */
|
|
8
|
+
code?: string;
|
|
9
|
+
/** Label over the code: a file name ("main.tsx") or "Terminal". */
|
|
10
|
+
file?: string;
|
|
11
|
+
/** Anything else under the description (a note, a link, an alert). */
|
|
12
|
+
children?: ReactNode;
|
|
13
|
+
}
|
|
14
|
+
export interface CodeStepsProps {
|
|
15
|
+
steps: CodeStep[];
|
|
16
|
+
/** Heading level of each step's title, to fit the page outline. Default 3. */
|
|
17
|
+
headingLevel?: 2 | 3 | 4;
|
|
18
|
+
/** Number to start counting from. Default 1. */
|
|
19
|
+
start?: number;
|
|
20
|
+
/** Extra class names for the root element. */
|
|
21
|
+
className?: string;
|
|
22
|
+
}
|
|
23
|
+
/** Numbered steps with the text on one side and the code on the other: an install guide, a setup, a migration. Stacks on narrow screens. */
|
|
24
|
+
export declare function CodeSteps({ steps, headingLevel, start, className }: CodeStepsProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import { type HTMLAttributes, type ReactNode } from 'react';
|
|
2
|
+
export interface GradientTextProps extends HTMLAttributes<HTMLSpanElement> {
|
|
3
|
+
children: ReactNode;
|
|
4
|
+
}
|
|
5
|
+
/** Text filled with the purple to yellow accent gradient. */
|
|
6
|
+
export declare function GradientText({ className, ...props }: GradientTextProps): import("react").JSX.Element;
|
|
7
|
+
export interface GradientDotProps extends HTMLAttributes<HTMLSpanElement> {
|
|
8
|
+
/** Diameter in px. Default 14. */
|
|
9
|
+
size?: number;
|
|
10
|
+
/** Pulses softly, for "live" or "new". */
|
|
11
|
+
pulse?: boolean;
|
|
12
|
+
}
|
|
13
|
+
/** The Alea dot: a small circle in the accent gradient. Decorative. */
|
|
14
|
+
export declare function GradientDot({ size, pulse, className, style, ...props }: GradientDotProps): import("react").JSX.Element;
|
|
15
|
+
export interface OrbBackgroundProps extends HTMLAttributes<HTMLDivElement> {
|
|
16
|
+
/** fixed covers the viewport behind the page; absolute fills the nearest positioned parent. */
|
|
17
|
+
position?: 'fixed' | 'absolute';
|
|
18
|
+
/** Adds the faint dot grid on top. */
|
|
19
|
+
grid?: boolean;
|
|
20
|
+
}
|
|
21
|
+
/** The drifting purple, violet and yellow glow behind Alea pages. Decorative and pointer-transparent. */
|
|
22
|
+
export declare function OrbBackground({ position, grid, className, ...props }: OrbBackgroundProps): import("react").JSX.Element;
|
|
23
|
+
export interface ThemeToggleProps {
|
|
24
|
+
/** icon: one button cycling dark/light; segmented: dark, light, system. */
|
|
25
|
+
appearance?: 'icon' | 'segmented';
|
|
26
|
+
/** Extra class names. */
|
|
27
|
+
className?: string;
|
|
28
|
+
}
|
|
29
|
+
/** Switches the theme (needs ThemeProvider for system and storage). */
|
|
30
|
+
export declare function ThemeToggle({ appearance, className }: ThemeToggleProps): import("react").JSX.Element;
|
|
31
|
+
export interface CopyButtonProps {
|
|
32
|
+
/** The text to copy. */
|
|
33
|
+
value: string;
|
|
34
|
+
/** What is copied, for the label ("Copy hex"). Default "Copy". */
|
|
35
|
+
label?: string;
|
|
36
|
+
/** icon (default) or a button with the label. */
|
|
37
|
+
appearance?: 'icon' | 'button';
|
|
38
|
+
/** sm or md (default). */
|
|
39
|
+
size?: 'sm' | 'md';
|
|
40
|
+
/** Called after the text is copied. */
|
|
41
|
+
onCopy?: () => void;
|
|
42
|
+
}
|
|
43
|
+
/** Copies a value and confirms it, announced to screen readers. */
|
|
44
|
+
export declare function CopyButton({ value, label, appearance, size, onCopy }: CopyButtonProps): import("react").JSX.Element;
|
|
45
|
+
export interface CodeBlockProps {
|
|
46
|
+
/** The code. */
|
|
47
|
+
code: string;
|
|
48
|
+
/** Shown above the code, e.g. a file name or "bash". */
|
|
49
|
+
title?: ReactNode;
|
|
50
|
+
/** Shows line numbers. */
|
|
51
|
+
lineNumbers?: boolean;
|
|
52
|
+
/** Line numbers to highlight, from 1: [3, 4, 5]. */
|
|
53
|
+
highlightLines?: number[];
|
|
54
|
+
/** Shows this many lines and a Show more button for the rest. */
|
|
55
|
+
maxLines?: number;
|
|
56
|
+
/** Long lines wrap instead of scrolling sideways. */
|
|
57
|
+
wrap?: boolean;
|
|
58
|
+
/** Copy button. Default true. */
|
|
59
|
+
copy?: boolean;
|
|
60
|
+
/** Extra class names for the root element. */
|
|
61
|
+
className?: string;
|
|
62
|
+
}
|
|
63
|
+
/** Code with a copy button, line numbers, highlighted lines, wrapping, and Show more for long snippets (no highlighter bundled). */
|
|
64
|
+
export declare function CodeBlock({ code, title, lineNumbers, highlightLines, maxLines, wrap, copy, className }: CodeBlockProps): import("react").JSX.Element;
|
|
65
|
+
export interface CodeSnippetProps {
|
|
66
|
+
/** The code to show and copy. */
|
|
67
|
+
code: string;
|
|
68
|
+
/** inline: in a sentence, copies when pressed; single: one line in a box with a copy button. */
|
|
69
|
+
variant?: 'inline' | 'single';
|
|
70
|
+
/** A prompt shown before a single line, like $ (not copied). */
|
|
71
|
+
prompt?: string;
|
|
72
|
+
/** Extra class names. */
|
|
73
|
+
className?: string;
|
|
74
|
+
}
|
|
75
|
+
/** A short piece of code to copy: inline in a sentence (press to copy), or a single line with a copy button, like an install command. */
|
|
76
|
+
export declare function CodeSnippet({ code, variant, prompt, className }: CodeSnippetProps): import("react").JSX.Element;
|
|
77
|
+
export interface SplitTextProps extends HTMLAttributes<HTMLSpanElement> {
|
|
78
|
+
/** The text to animate, word by word. */
|
|
79
|
+
children: string;
|
|
80
|
+
/** Delay between words in ms. Default 60. */
|
|
81
|
+
stagger?: number;
|
|
82
|
+
}
|
|
83
|
+
/** A headline that rises in word by word (reads as one string to screen readers; still with reduced motion). */
|
|
84
|
+
export declare function SplitText({ children, stagger, className, ...props }: SplitTextProps): import("react").JSX.Element;
|