@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.
Files changed (85) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +17 -2
  3. package/dist/components/accordion/Accordion.d.ts +29 -0
  4. package/dist/components/ai/AI.d.ts +157 -0
  5. package/dist/components/app/AppParts.d.ts +105 -0
  6. package/dist/components/button/Button.d.ts +95 -0
  7. package/dist/components/button/Groups.d.ts +91 -0
  8. package/dist/components/card/Card.d.ts +61 -0
  9. package/dist/components/chat/Chat.d.ts +191 -0
  10. package/dist/components/choice/Choice.d.ts +87 -0
  11. package/dist/components/color/Color.d.ts +77 -0
  12. package/dist/components/combobox/Autocomplete.d.ts +76 -0
  13. package/dist/components/combobox/ComboBox.d.ts +81 -0
  14. package/dist/components/combobox/Highlight.d.ts +27 -0
  15. package/dist/components/command/CommandPalette.d.ts +35 -0
  16. package/dist/components/content/Content.d.ts +120 -0
  17. package/dist/components/data/Data.d.ts +85 -0
  18. package/dist/components/date/Date.d.ts +48 -0
  19. package/dist/components/display/Display.d.ts +114 -0
  20. package/dist/components/display/Display2.d.ts +54 -0
  21. package/dist/components/emoji/EmojiPicker.d.ts +16 -0
  22. package/dist/components/emoji/emoji-data.d.ts +12 -0
  23. package/dist/components/extras/CodeSteps.d.ts +24 -0
  24. package/dist/components/extras/Extras.d.ts +84 -0
  25. package/dist/components/feedback/Feedback.d.ts +136 -0
  26. package/dist/components/feedback/Spinner.d.ts +12 -0
  27. package/dist/components/feedback/Status.d.ts +45 -0
  28. package/dist/components/field/Field.d.ts +130 -0
  29. package/dist/components/field/FieldLoading.d.ts +7 -0
  30. package/dist/components/filter/FilterBar.d.ts +48 -0
  31. package/dist/components/form/Form.d.ts +32 -0
  32. package/dist/components/icon/Icon.d.ts +47 -0
  33. package/dist/components/icon/icon-cells.d.ts +23 -0
  34. package/dist/components/icon/icon-contexts.d.ts +19 -0
  35. package/dist/components/icon/icon-names.d.ts +8 -0
  36. package/dist/components/layout/Bento.d.ts +42 -0
  37. package/dist/components/layout/Layout.d.ts +76 -0
  38. package/dist/components/layout/Layout2.d.ts +120 -0
  39. package/dist/components/layout/Layout3.d.ts +65 -0
  40. package/dist/components/layout/Responsive.d.ts +21 -0
  41. package/dist/components/list/List.d.ts +41 -0
  42. package/dist/components/list/Lists2.d.ts +79 -0
  43. package/dist/components/media/Media.d.ts +133 -0
  44. package/dist/components/menu/Menu.d.ts +87 -0
  45. package/dist/components/more/More.d.ts +176 -0
  46. package/dist/components/navigation/Navbar.d.ts +23 -0
  47. package/dist/components/navigation/Navigation.d.ts +88 -0
  48. package/dist/components/navigation/Navigation2.d.ts +152 -0
  49. package/dist/components/overlay/Drawer.d.ts +40 -0
  50. package/dist/components/overlay/Modal.d.ts +41 -0
  51. package/dist/components/overlay/Overlay.d.ts +95 -0
  52. package/dist/components/overlay/Sheet.d.ts +55 -0
  53. package/dist/components/page/Page.d.ts +91 -0
  54. package/dist/components/page/PageParts.d.ts +94 -0
  55. package/dist/components/picker/Picker.d.ts +136 -0
  56. package/dist/components/picker/Wheel.d.ts +63 -0
  57. package/dist/components/rating/Rating.d.ts +35 -0
  58. package/dist/components/select/Select.d.ts +116 -0
  59. package/dist/components/shell/AppShell.d.ts +52 -0
  60. package/dist/components/shell/AppSidebar.d.ts +55 -0
  61. package/dist/components/slider/Slider.d.ts +27 -0
  62. package/dist/components/table/Table.d.ts +45 -0
  63. package/dist/components/tabs/Tabs.d.ts +59 -0
  64. package/dist/components/theme/Theme.d.ts +94 -0
  65. package/dist/components/theme/lens.d.ts +18 -0
  66. package/dist/components/tree/Tree.d.ts +125 -0
  67. package/dist/components/typography/Typography.d.ts +59 -0
  68. package/dist/components/upload/Upload.d.ts +63 -0
  69. package/dist/components/work/Ops.d.ts +29 -0
  70. package/dist/components/work/Work.d.ts +216 -0
  71. package/dist/i18n/strings.d.ts +429 -0
  72. package/dist/index.d.ts +72 -0
  73. package/dist/index.js +7439 -0
  74. package/dist/styles.css +1 -0
  75. package/dist/utils/Blueprint.d.ts +12 -0
  76. package/dist/utils/DotField.d.ts +6 -0
  77. package/dist/utils/attr.d.ts +2 -0
  78. package/dist/utils/blueprintScene.d.ts +81 -0
  79. package/dist/utils/controlled.d.ts +2 -0
  80. package/dist/utils/cx.d.ts +2 -0
  81. package/dist/utils/inert.d.ts +2 -0
  82. package/dist/utils/responsive.d.ts +9 -0
  83. package/dist/utils/scrollEdges.d.ts +9 -0
  84. package/dist/utils/space.d.ts +2 -0
  85. package/package.json +68 -4
@@ -0,0 +1,76 @@
1
+ import { type ElementType, type HTMLAttributes, type ReactNode } from 'react';
2
+ import { type SeparatorProps } from 'react-aria-components';
3
+ /** Steps of the 4 px space scale (--alea-space-*). */
4
+ export type Space = 0 | 0.5 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 10 | 12 | 16 | 20 | 24;
5
+ import type { Breakpoint, Responsive } from '../../utils/responsive';
6
+ export type { Breakpoint, Responsive };
7
+ /** CSS variables --{name}-{bp} for a responsive value; the CSS picks the right one per breakpoint. */
8
+ export declare function responsiveVars<T>(name: string, value: Responsive<T> | undefined, toCss: (v: T) => string): Record<string, string>;
9
+ interface BoxProps extends HTMLAttributes<HTMLElement> {
10
+ /** The element to render. Default div. */
11
+ as?: ElementType;
12
+ }
13
+ export interface StackProps extends BoxProps {
14
+ /** Space between children, from the space scale. Default 4 (16 px). Can change per breakpoint. */
15
+ gap?: Responsive<Space>;
16
+ /** Cross-axis alignment: start, center, end, stretch or baseline. */
17
+ align?: 'start' | 'center' | 'end' | 'stretch' | 'baseline';
18
+ /** Main-axis distribution: start, center, end or between. */
19
+ justify?: 'start' | 'center' | 'end' | 'between';
20
+ /** Room above and below, from the space scale: one value for both, or [top, bottom]. For a page's main area or a section. */
21
+ paddingBlock?: Space | [Space, Space];
22
+ }
23
+ /** Children in a column with even space between them. */
24
+ export declare function Stack({ as, gap, align, justify, paddingBlock, className, style, ...props }: StackProps): import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>;
25
+ export interface InlineProps extends StackProps {
26
+ /** Wrap onto new lines when there is no room. Default true. */
27
+ wrap?: boolean;
28
+ }
29
+ /** Children in a row, wrapping by default. */
30
+ export declare function Inline({ as, gap, align, justify, wrap, paddingBlock, className, style, ...props }: InlineProps): import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>;
31
+ export interface FlexProps extends StackProps {
32
+ /** row or column, per breakpoint: { base: 'column', md: 'row' } stacks on phones and lines up on tablets. */
33
+ direction?: Responsive<'row' | 'column' | 'row-reverse' | 'column-reverse'>;
34
+ /** Wrap onto new lines. Default false. */
35
+ wrap?: boolean;
36
+ }
37
+ /** A flex row or column whose direction and gap can change per breakpoint. */
38
+ export declare function Flex({ as, gap, direction, align, justify, wrap, paddingBlock, className, style, ...props }: FlexProps): import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>;
39
+ export interface GridProps extends BoxProps {
40
+ /** Columns: a number, 'auto' to fit as many as minItemWidth allows, or one per breakpoint: { base: 1, md: 2, lg: 4 }. Use 12 with GridItem spans for page layouts. */
41
+ columns?: Responsive<number | 'auto'>;
42
+ /** Smallest column width for columns='auto'. Default 240 px. */
43
+ minItemWidth?: number;
44
+ /** Space between cells, from the space scale. Default 4 (16 px). Can change per breakpoint. */
45
+ gap?: Responsive<Space>;
46
+ /** With columns='auto': the items stretch to fill the row (no empty columns when there are few). Default false: the columns keep their width, so a lone card stays card-sized. */
47
+ stretch?: boolean;
48
+ }
49
+ /** A responsive grid: fixed columns, as many as fit, or a different count per breakpoint. */
50
+ export declare function Grid({ as, columns, minItemWidth, gap, stretch, className, style, ...props }: GridProps): import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>;
51
+ export interface GridItemProps extends BoxProps {
52
+ /** Columns it spans (of the grid's columns, usually 12), per breakpoint: { base: 12, md: 6, lg: 4 }. 'full' spans all. */
53
+ span?: Responsive<number | 'full'>;
54
+ /** Column it starts at, per breakpoint. */
55
+ start?: Responsive<number>;
56
+ }
57
+ /** A cell of a Grid that spans several columns, with a value per breakpoint. */
58
+ export declare function GridItem({ as, span, start, className, style, ...props }: GridItemProps): import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>;
59
+ export interface ContainerProps extends BoxProps {
60
+ /** Max width: sm 640, md 768, lg 1024, xl 1280 (the default page width), full. */
61
+ size?: 'sm' | 'md' | 'lg' | 'xl' | 'full';
62
+ }
63
+ /** Centers content at a max width with the page gutters. */
64
+ export declare function Container({ as, size, className, ...props }: ContainerProps): import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>;
65
+ export interface DividerProps extends SeparatorProps {
66
+ /** Spacing around the line, from the space scale. */
67
+ spacing?: Space;
68
+ /** Text or an icon in the line ("or", "Today"). Horizontal only. */
69
+ label?: ReactNode;
70
+ /** Where the label sits: center (default), start or end. */
71
+ labelPosition?: 'start' | 'center' | 'end';
72
+ /** solid (default), dashed or dotted. */
73
+ variant?: 'solid' | 'dashed' | 'dotted';
74
+ }
75
+ /** A thin rule between groups, with an optional label in it; solid, dashed or dotted. */
76
+ export declare function Divider({ orientation, spacing, label, labelPosition, variant, className, style, ...props }: DividerProps): import("react").JSX.Element;
@@ -0,0 +1,120 @@
1
+ import { type CSSProperties, type ReactNode } from 'react';
2
+ export interface AspectRatioProps {
3
+ /** width / height, e.g. 16 / 9. Default 16 / 9. */
4
+ ratio?: number;
5
+ children: ReactNode;
6
+ /** Extra class names for the root element. */
7
+ className?: string;
8
+ /** Inline styles for the root element. */
9
+ style?: CSSProperties;
10
+ }
11
+ /** Keeps its content at a width-to-height ratio: videos, maps, images. */
12
+ export declare function AspectRatio({ ratio, children, className, style }: AspectRatioProps): import("react").JSX.Element;
13
+ export interface ScrollAreaProps {
14
+ children: ReactNode;
15
+ /** Max height (or height) in px or CSS. */
16
+ height?: number | string;
17
+ /** Name, so keyboard users can find and scroll it. */
18
+ 'aria-label': string;
19
+ /** vertical (default), horizontal or both. */
20
+ direction?: 'vertical' | 'horizontal' | 'both';
21
+ /** Extra class names for the root element. */
22
+ className?: string;
23
+ }
24
+ /** A scrolling region with thin themed scrollbars and fades that show there is more. Focusable only when it scrolls. */
25
+ export declare function ScrollArea({ children, height, direction, className, 'aria-label': label }: ScrollAreaProps): import("react").JSX.Element;
26
+ export interface MasonryProps {
27
+ children: ReactNode;
28
+ /** Least column width in px; columns are added as space allows. Default 220. */
29
+ columnWidth?: number;
30
+ /** Gap in px, landed on the nearest space step. Default 12. */
31
+ gap?: number;
32
+ /** Extra class names for the root element. */
33
+ className?: string;
34
+ /** Render as a list (ul); children should then be li. Default false. */
35
+ asList?: boolean;
36
+ }
37
+ /** Cards of different heights packed into columns. Reading order follows the columns top to bottom. */
38
+ export declare function Masonry({ children, columnWidth, gap, className, asList }: MasonryProps): import("react").JSX.Element;
39
+ export interface ImageListProps {
40
+ /** Images: src, alt, and an optional title and subtitle shown over the bottom. */
41
+ items: Array<{
42
+ src: string;
43
+ alt: string;
44
+ title?: string;
45
+ subtitle?: string;
46
+ href?: string;
47
+ }>;
48
+ /** grid (same size) or masonry (keeps each image's shape). Default grid. */
49
+ variant?: 'grid' | 'masonry';
50
+ /** Least width of a tile. Default 180. */
51
+ minItemWidth?: number;
52
+ /** Tile ratio in grid. Default 1. */
53
+ ratio?: number;
54
+ /** Extra class names for the root element. */
55
+ className?: string;
56
+ }
57
+ /** A gallery of images with optional captions. */
58
+ export declare function ImageList({ items, variant, minItemWidth, ratio, className }: ImageListProps): import("react").JSX.Element;
59
+ export interface FieldsetProps {
60
+ /** The group's name, read before each field in it. */
61
+ legend: ReactNode;
62
+ /** One sentence under the legend, linked to the group. */
63
+ description?: ReactNode;
64
+ children: ReactNode;
65
+ /** Disables every field inside. */
66
+ isDisabled?: boolean;
67
+ /** filled (a panel, default) or plain. */
68
+ variant?: 'filled' | 'plain';
69
+ /** Extra class names for the root element. */
70
+ className?: string;
71
+ }
72
+ /** Groups related fields under a legend: an address, a payment method (HTML fieldset). */
73
+ export declare function Fieldset({ legend, description, children, isDisabled, variant, className }: FieldsetProps): import("react").JSX.Element;
74
+ export interface SpoilerProps {
75
+ children: ReactNode;
76
+ /** Height shown before "Show more", px. Default 120. */
77
+ maxHeight?: number;
78
+ /** Text of the button that expands. Default "Show more". */
79
+ showLabel?: string;
80
+ /** Text of the button that collapses. Default "Show less". */
81
+ hideLabel?: string;
82
+ /** Extra class names for the root element. */
83
+ className?: string;
84
+ }
85
+ /** Long content cut to a height with a fade and a Show more button. */
86
+ export declare function Spoiler({ children, maxHeight, showLabel, hideLabel, className }: SpoilerProps): import("react").JSX.Element;
87
+ export interface RibbonProps {
88
+ /** The ribbon's text: New, Popular, -20%. */
89
+ text: ReactNode;
90
+ children: ReactNode;
91
+ /** Color meaning: accent, success, warning, danger or neutral. */
92
+ tone?: 'accent' | 'success' | 'warning' | 'danger' | 'neutral';
93
+ /** start or end (default) corner. */
94
+ placement?: 'start' | 'end';
95
+ /** Extra class names for the root element. */
96
+ className?: string;
97
+ }
98
+ /** A label wrapped around the corner of a card. */
99
+ export declare function Ribbon({ text, children, tone, placement, className }: RibbonProps): import("react").JSX.Element;
100
+ export interface IndicatorProps {
101
+ children: ReactNode;
102
+ /** A number, or nothing for a dot. */
103
+ count?: number;
104
+ /** Shows max+ above this. Default 99. */
105
+ max?: number;
106
+ /** What it means, for screen readers ("3 unread messages", "Online"). */
107
+ label: string;
108
+ /** Color meaning: accent, success, warning, danger or neutral. */
109
+ tone?: 'accent' | 'success' | 'warning' | 'danger' | 'neutral';
110
+ /** Which corner. Default top end. */
111
+ position?: 'top-end' | 'top-start' | 'bottom-end' | 'bottom-start';
112
+ /** Pulse to draw attention. Respects reduced motion. */
113
+ processing?: boolean;
114
+ /** Hide it (keeps the child). */
115
+ isHidden?: boolean;
116
+ /** Extra class names for the root element. */
117
+ className?: string;
118
+ }
119
+ /** A dot or number on the corner of an avatar, icon or button: status, unread count. */
120
+ export declare function Indicator({ children, count, max, label, tone, position, processing, isHidden, className }: IndicatorProps): import("react").JSX.Element;
@@ -0,0 +1,65 @@
1
+ import { type CSSProperties, type ReactNode } from 'react';
2
+ export interface SplitLayoutProps {
3
+ /** Two children: the main content and a narrower column (details, settings, a summary). */
4
+ children: [ReactNode, ReactNode];
5
+ /** Which child is the narrow column. end (default): main, then the side; start: a list or tree first, then the main. */
6
+ narrow?: 'start' | 'end';
7
+ /** Width of the narrow column in px. Default 340. */
8
+ narrowWidth?: number;
9
+ /** Below this available width the columns stack (the layout measures its own space, not the window). Default md (760 px). */
10
+ stackBelow?: 'sm' | 'md' | 'lg';
11
+ /** Extra class names for the root element. */
12
+ className?: string;
13
+ /** Inline styles for the root element. */
14
+ style?: CSSProperties;
15
+ }
16
+ /** A main column and a narrower one side by side (an editor and its settings, a list and its detail); they stack when the space gets narrow. */
17
+ export declare function SplitLayout({ children, narrow, narrowWidth, stackBelow, className, style }: SplitLayoutProps): import("react").JSX.Element;
18
+ export interface FocusLayoutProps {
19
+ /** The one task: sign in, a code, a setup step. */
20
+ children: ReactNode;
21
+ /** Card width: sm (420 px, a form) or md (640 px, a step with choices). Default sm. */
22
+ size?: 'sm' | 'md';
23
+ /** Wrap the content in a card. Default true. */
24
+ card?: boolean;
25
+ /** The element: main (default, when it is the page) or div. */
26
+ as?: 'main' | 'div';
27
+ /** Extra class names for the root element. */
28
+ className?: string;
29
+ }
30
+ /** One task in the middle of the screen, nothing else around it: sign in, verify, onboarding, a result. */
31
+ export declare function FocusLayout({ children, size, card, as: As, className }: FocusLayoutProps): import("react").JSX.Element;
32
+ export interface PaneLayoutProps {
33
+ /** The bar across the top: back, the document's name, tools, publish. */
34
+ bar?: ReactNode;
35
+ /** The pane on the start side (layers, files, outline). Hidden below 1280 px, a tab on phones. */
36
+ start?: ReactNode;
37
+ /** The pane on the end side (inspector, properties, comments). A tab on phones. */
38
+ end?: ReactNode;
39
+ /** The work area (canvas, editor, preview). */
40
+ children: ReactNode;
41
+ /** Names of the three areas, for landmarks and the phone tabs. Default Layers, Canvas, Inspector (translated). */
42
+ labels?: {
43
+ start?: string;
44
+ main?: string;
45
+ end?: string;
46
+ };
47
+ /** Height of the whole layout. Default 100dvh (a full-screen tool). */
48
+ height?: CSSProperties['height'];
49
+ /** The work area's element: main (default) when the layout is the page, div when it sits inside another page. */
50
+ mainAs?: 'main' | 'div';
51
+ /** Extra class names for the root element. */
52
+ className?: string;
53
+ }
54
+ /** A full-screen tool: a bar on top, panes on the sides and the work area between; on tablets the start pane goes, on phones one area at a time behind tabs. */
55
+ export declare function PaneLayout({ bar, start, end, children, labels, height, mainAs: Main, className }: PaneLayoutProps): import("react").JSX.Element;
56
+ export interface DeviceFrameProps {
57
+ /** desktop (up to 1280 px), tablet (768) or phone (390). The width animates between them. */
58
+ device?: 'desktop' | 'tablet' | 'phone';
59
+ /** The page inside: a preview of a site, an email, a component. */
60
+ children: ReactNode;
61
+ /** Extra class names for the root element. */
62
+ className?: string;
63
+ }
64
+ /** A preview at a device's width, centred, with a soft frame: pair it with a SegmentedControl of devices. */
65
+ export declare function DeviceFrame({ device, children, className }: DeviceFrameProps): import("react").JSX.Element;
@@ -0,0 +1,21 @@
1
+ import { type ReactNode } from 'react';
2
+ import type { Breakpoint } from './Layout';
3
+ /** Whether a media query matches, updating live. False on the server. */
4
+ export declare function useMediaQuery(query: string): boolean;
5
+ /** The current breakpoint (base, sm, md, lg, xl) and helpers: isAbove('md'), isBelow('lg'). */
6
+ export declare function useBreakpoint(): {
7
+ current: Breakpoint;
8
+ isAbove: (bp: Breakpoint) => boolean;
9
+ isBelow: (bp: Breakpoint) => boolean;
10
+ };
11
+ export interface ShowProps {
12
+ /** Show from this breakpoint up. */
13
+ above?: Exclude<Breakpoint, 'base'>;
14
+ /** Show below this breakpoint. */
15
+ below?: Exclude<Breakpoint, 'base'>;
16
+ children: ReactNode;
17
+ }
18
+ /** Shows its children only above or below a breakpoint, with CSS (no flash, same markup on the server). */
19
+ export declare function Show({ above, below, children }: ShowProps): import("react").JSX.Element;
20
+ /** The opposite of Show: hides its children above or below a breakpoint. */
21
+ export declare function Hide({ above, below, children }: ShowProps): import("react").JSX.Element;
@@ -0,0 +1,41 @@
1
+ import type { ReactNode } from 'react';
2
+ import { type GridListProps, type GridListItemProps, type Key, type DropIndicatorProps } from 'react-aria-components';
3
+ type WithId = {
4
+ id: Key;
5
+ };
6
+ /** Moves keys of a list before, after (or into) a target: the new array after a drag. */
7
+ export declare function reorderItems<T extends WithId>(items: T[], keys: Key[], target: {
8
+ key: Key;
9
+ dropPosition: 'before' | 'after' | 'on';
10
+ }): T[];
11
+ export interface ListViewProps<T extends object> extends GridListProps<T> {
12
+ /** Lines between items (joined), separate cards, or nothing (plain). */
13
+ variant?: 'joined' | 'separated' | 'plain';
14
+ /** stack (rows, default) or grid (cards in columns, arrow keys move in two directions). Set the column width with --alea-list-min. */
15
+ layout?: 'stack' | 'grid';
16
+ /** With items: rows can be dragged to reorder (and moved between lists with the same dragGroup). Called with the new array. */
17
+ onItemsChange?: (items: T[]) => void;
18
+ /** Lists with the same dragGroup accept each other's rows. Items must be plain data (they travel as JSON). */
19
+ dragGroup?: string;
20
+ }
21
+ /** A list of rich items people can select, open or act on, with keyboard navigation. Rows can be dragged to reorder, or between lists; cards can sit in a grid. */
22
+ export declare function ListView<T extends object>({ variant, layout, onItemsChange, dragGroup, items, className, ...props }: ListViewProps<T>): import("react").JSX.Element;
23
+ /** The line that shows where a dragged row will land. Use it in renderDropIndicator of your own drag and drop. */
24
+ export declare function DropIndicator(props: DropIndicatorProps): import("react").JSX.Element;
25
+ /** The handle that starts a drag with the keyboard (Enter) or a screen reader. Put it in rows of a draggable list or table. */
26
+ export declare function DragHandle({ label, className }: {
27
+ label?: string;
28
+ className?: string;
29
+ }): import("react").JSX.Element;
30
+ export { useDragAndDrop, isTextDropItem, useListData, useTreeData, useAsyncList } from 'react-aria-components';
31
+ export interface ListItemProps extends Omit<GridListItemProps, 'children'> {
32
+ children: ReactNode;
33
+ /** A second line. */
34
+ description?: ReactNode;
35
+ /** An avatar, icon or image on the left. */
36
+ start?: ReactNode;
37
+ /** Actions or meta on the right (buttons stay reachable with Tab and arrows). */
38
+ end?: ReactNode;
39
+ }
40
+ /** One item of a ListView. */
41
+ export declare function ListItem({ children, description, start, end, className, textValue, ...props }: ListItemProps): import("react").JSX.Element;
@@ -0,0 +1,79 @@
1
+ import type { ReactNode } from 'react';
2
+ export interface StructuredListProps<T extends {
3
+ id: string;
4
+ }> {
5
+ /** The columns: key in each row, header, and alignment. */
6
+ columns: Array<{
7
+ key: keyof T & string;
8
+ label: ReactNode;
9
+ align?: 'start' | 'end';
10
+ width?: string;
11
+ }>;
12
+ /** The rows. */
13
+ rows: T[];
14
+ /** Name for screen readers. */
15
+ 'aria-label': string;
16
+ /** single: each row is a choice (a radio), for plans and options compared side by side. Default none. */
17
+ selectionMode?: 'none' | 'single';
18
+ /** The chosen row id (controlled). */
19
+ value?: string;
20
+ /** The chosen row at first. */
21
+ defaultValue?: string;
22
+ /** Called with the chosen row id. */
23
+ onChange?: (id: string) => void;
24
+ /** Shows the column headers. Default true. */
25
+ showHeader?: boolean;
26
+ /** Extra class names. */
27
+ className?: string;
28
+ }
29
+ /** Rows of facts in columns, lighter than a table: plan comparisons, settings summaries. With selectionMode="single", each row is a choice. On phones each row stacks its cells. */
30
+ export declare function StructuredList<T extends {
31
+ id: string;
32
+ }>({ columns, rows, selectionMode, value, defaultValue, onChange, showHeader, className, 'aria-label': label }: StructuredListProps<T>): import("react").JSX.Element;
33
+ export interface ContainedListProps {
34
+ /** The title of the list. */
35
+ label: ReactNode;
36
+ /** An action beside the title: Add, View all. */
37
+ action?: ReactNode;
38
+ /** ContainedListItem elements. */
39
+ children: ReactNode;
40
+ /** on-page (a card, default) or disclosed (flat, for lists inside popovers and panels). */
41
+ kind?: 'on-page' | 'disclosed';
42
+ /** sm (40 px rows), md (48 px, default) or lg (64 px). */
43
+ size?: 'sm' | 'md' | 'lg';
44
+ /** Heading level of the title. Default 3. */
45
+ headingLevel?: 2 | 3 | 4;
46
+ /** Extra class names. */
47
+ className?: string;
48
+ }
49
+ /** A titled list in its own container, with an action: recent files, members, integrations. Rows hold text, an icon or avatar at the start, and actions at the end. */
50
+ export declare function ContainedList({ label, action, children, kind, size, headingLevel, className }: ContainedListProps): import("react").JSX.Element;
51
+ export interface ContainedListItemProps {
52
+ children: ReactNode;
53
+ /** A second line. */
54
+ description?: ReactNode;
55
+ /** An icon or avatar at the start. */
56
+ start?: ReactNode;
57
+ /** Meta or actions at the end. */
58
+ end?: ReactNode;
59
+ /** Makes the whole row a link. */
60
+ href?: string;
61
+ }
62
+ /** One row of a ContainedList. */
63
+ export declare function ContainedListItem({ children, description, start, end, href }: ContainedListItemProps): import("react").JSX.Element;
64
+ export interface PageIndicatorProps {
65
+ /** How many pages. */
66
+ count: number;
67
+ /** The current page, from 0. */
68
+ current: number;
69
+ /** Called with the page to go to; leave it out for a display only indicator. */
70
+ onChange?: (index: number) => void;
71
+ /** dots (default), bars (the current one stretches) or numbers ("2 / 5"). */
72
+ variant?: 'dots' | 'bars' | 'numbers';
73
+ /** Name for screen readers. Default "Pages". */
74
+ 'aria-label'?: string;
75
+ /** Extra class names. */
76
+ className?: string;
77
+ }
78
+ /** Shows where you are in a set of pages: onboarding screens, a carousel, a gallery. Each dot is a button when onChange is set. */
79
+ export declare function PageIndicator({ count, current, onChange, variant, className, 'aria-label': label }: PageIndicatorProps): import("react").JSX.Element;
@@ -0,0 +1,133 @@
1
+ import { type CSSProperties, type ReactNode } from 'react';
2
+ export interface TimelineItem {
3
+ id: string;
4
+ title: ReactNode;
5
+ /** When: shown above the title (a <time> when you pass dateTime). */
6
+ time?: ReactNode;
7
+ dateTime?: string;
8
+ description?: ReactNode;
9
+ tone?: 'neutral' | 'accent' | 'success' | 'warning' | 'danger';
10
+ /** A custom dot (an icon). */
11
+ dot?: ReactNode;
12
+ /** Marks the item happening now: its dot pulses. */
13
+ isActive?: boolean;
14
+ }
15
+ export interface TimelineProps {
16
+ /** The entries: id, title, optional time, dateTime, description, tone, icon. */
17
+ items: TimelineItem[];
18
+ /** Newest first or oldest first is up to you; this only marks the last item as pending. */
19
+ pending?: ReactNode;
20
+ /** start (content on the right of the line, default), alternate (sides take turns, times on the other side from 640 px) or end. */
21
+ mode?: 'start' | 'alternate' | 'end';
22
+ /** Shows the items in reverse order. */
23
+ reverse?: boolean;
24
+ /** sm (tighter, for side panels) or md (default). */
25
+ size?: 'sm' | 'md';
26
+ /** Extra class names for the root element. */
27
+ className?: string;
28
+ }
29
+ /** Events in order: a changelog, an order's progress, an activity feed. Content on one side, the other, or alternating; reversed; two sizes. */
30
+ export declare function Timeline({ items, pending, mode, reverse, size, className }: TimelineProps): import("react").JSX.Element;
31
+ export interface CarouselProps {
32
+ /** The slides. */
33
+ children: ReactNode[];
34
+ /** Name of the carousel for screen readers. */
35
+ 'aria-label': string;
36
+ /** Moves on by itself every n ms (pauses on hover, focus and with reduced motion; has a pause button). */
37
+ autoplay?: number;
38
+ /** Slides visible at once. Default 1. */
39
+ perView?: number;
40
+ /** Show the dots. Default true. */
41
+ showDots?: boolean;
42
+ /** Extra class names for the root element. */
43
+ className?: string;
44
+ }
45
+ /** Slides you swipe or step through, with dots and an optional autoplay that people can pause (WAI-ARIA carousel pattern). */
46
+ export declare function Carousel({ children, 'aria-label': label, autoplay, perView, showDots, className }: CarouselProps): import("react").JSX.Element;
47
+ export interface ImageProps {
48
+ /** The image URL. */
49
+ src: string;
50
+ /** Describe the image; empty string only when it is decorative. */
51
+ alt: string;
52
+ /** Width in px. */
53
+ width?: number | string;
54
+ /** Height in px. */
55
+ height?: number | string;
56
+ /** Opens a larger view with zoom on press. Default true. */
57
+ preview?: boolean;
58
+ /** Shown while loading and if it fails. */
59
+ fallback?: ReactNode;
60
+ /** CSS object-fit. Default cover. */
61
+ fit?: CSSProperties['objectFit'];
62
+ /** Corner radius token: sm, md (default), lg or none. */
63
+ radius?: 'none' | 'sm' | 'md' | 'lg';
64
+ /** Responsive sources: "hero-640.jpg 640w, hero-1280.jpg 1280w". */
65
+ srcSet?: string;
66
+ /** How wide it shows, for srcSet: "(min-width: 768px) 50vw, 100vw". */
67
+ sizes?: string;
68
+ /** Width / height, e.g. 16 / 9: reserves the space so nothing jumps while it loads. */
69
+ ratio?: number;
70
+ /** The main image of the page (LCP): loads right away with high priority instead of lazily. */
71
+ priority?: boolean;
72
+ /** A tiny blurred version (data URL or color) shown until it loads; then the image fades in. Default the shimmer. */
73
+ placeholder?: string;
74
+ /** What shows while it loads: shimmer (a light sweep, default) or matrix (a field of dots that twinkle, then dissolves into the picture). */
75
+ loadingEffect?: 'shimmer' | 'matrix';
76
+ /** The picture is still being made (an AI image): keeps the loading effect, with or without a src, until you set it to false. */
77
+ isLoading?: boolean;
78
+ /** Extra class names for the root element. */
79
+ className?: string;
80
+ }
81
+ /** An image that loads lazily, shows a shimmer while loading and a fallback on error, and opens a zoomable preview. */
82
+ export declare function Image({ src, alt, width, height, preview, fallback, fit, radius, srcSet, sizes, ratio, priority, placeholder, loadingEffect, isLoading, className }: ImageProps): import("react").JSX.Element;
83
+ export interface QRCodeProps {
84
+ /** What the code holds: a URL, text, a Wi-Fi string. */
85
+ value: string;
86
+ /** Size in px. Default 160. */
87
+ size?: number;
88
+ /** Error correction: L, M (default), Q, H. Use H when you put a logo in the middle. */
89
+ level?: 'L' | 'M' | 'Q' | 'H';
90
+ /** A logo or icon in the middle (use level H). */
91
+ logo?: ReactNode;
92
+ /** Describe what it opens, for screen readers. Default "QR code: " + value. */
93
+ label?: string;
94
+ /** Colors; dark on light reads best. */
95
+ color?: string;
96
+ /** Background color. Default white. */
97
+ background?: string;
98
+ }
99
+ /** A QR code drawn as SVG, crisp at any size. */
100
+ export declare function QRCode({ value, size, level, logo, label, color, background }: QRCodeProps): import("react").JSX.Element;
101
+ export interface WatermarkProps {
102
+ children: ReactNode;
103
+ /** The text repeated across the area. */
104
+ text: string;
105
+ /** Angle in degrees. Default -22. */
106
+ rotate?: number;
107
+ /** Gap between marks in px. Default 120. */
108
+ gap?: number;
109
+ /** 0 to 1. Default 0.08. */
110
+ opacity?: number;
111
+ /** Extra class names for the root element. */
112
+ className?: string;
113
+ }
114
+ /** Repeats a faint text over content: drafts, confidential previews. Decorative: hidden from screen readers, not a security measure. */
115
+ export declare function Watermark({ children, text, rotate, gap, opacity, className }: WatermarkProps): import("react").JSX.Element;
116
+ export interface TourStep {
117
+ /** CSS selector or element to point at. Leave out for a centered step. */
118
+ target?: string | HTMLElement | null;
119
+ title: ReactNode;
120
+ content?: ReactNode;
121
+ }
122
+ export interface TourProps {
123
+ /** The steps: target (a CSS selector), title and content. */
124
+ steps: TourStep[];
125
+ /** Whether the tour runs (controlled). */
126
+ isOpen: boolean;
127
+ /** Called when it starts or ends. */
128
+ onOpenChange: (open: boolean) => void;
129
+ /** Called when the last step is done. */
130
+ onFinish?: () => void;
131
+ }
132
+ /** A guided walk through a screen: each step spotlights an element and explains it. Escape skips; focus stays in the step. */
133
+ export declare function Tour({ steps, isOpen, onOpenChange, onFinish }: TourProps): import("react").JSX.Element | null;
@@ -0,0 +1,87 @@
1
+ import type { ReactNode } from 'react';
2
+ import { type MenuProps as RACMenuProps, type MenuItemProps as RACMenuItemProps, type MenuTriggerProps, type SubmenuTriggerProps } from 'react-aria-components';
3
+ import type { MotionProp } from '@alea-design/motion';
4
+ import { type PopoverProps } from '../overlay/Overlay';
5
+ import { type BadgeProps } from '../display/Display';
6
+ export interface MenuProps<T extends object> extends RACMenuProps<T> {
7
+ /** sm (32 px items, for dense apps and context menus) or md (40 px, default). */
8
+ size?: 'sm' | 'md';
9
+ }
10
+ /** A list of actions or choices. Arrow keys move, typing jumps, Enter picks. */
11
+ export declare function Menu<T extends object>({ className, size, ...props }: MenuProps<T>): import("react").JSX.Element;
12
+ export interface MenuItemProps extends Omit<RACMenuItemProps, 'children'> {
13
+ children: ReactNode;
14
+ /** Icon before the label. */
15
+ icon?: ReactNode;
16
+ /** A second line under the label. */
17
+ description?: ReactNode;
18
+ /** A shortcut shown at the end, e.g. ⌘D. A list of keys, like ['⌘', '⇧', 'P'], shows each key as a keycap. Display only: wire the keys yourself. It is also set as aria-keyshortcuts. */
19
+ shortcut?: string | string[];
20
+ /** danger turns it red, for destructive actions. */
21
+ tone?: 'default' | 'danger';
22
+ /** Something at the end: a count, a status, an icon button. */
23
+ end?: ReactNode;
24
+ /** A small badge at the end, after end: a count, New, Beta. It is read with the item. */
25
+ badge?: ReactNode;
26
+ /** The tone of the badge: neutral (default), accent, success, warning, danger or info. */
27
+ badgeTone?: BadgeProps['tone'];
28
+ /** Shows a chevron at the end for an item that leads somewhere else (a dialog, a page). Items that open a submenu always show one. */
29
+ chevron?: boolean;
30
+ }
31
+ /** One item: an action, a link (href), or a choice in a selectable menu. Slots at the end, in order: end, badge, shortcut and a chevron. */
32
+ export declare function MenuItem({ children, icon, description, shortcut, tone, end, badge, badgeTone, chevron, className, textValue, ...props }: MenuItemProps): import("react").JSX.Element;
33
+ /** A titled group of items. */
34
+ export interface MenuSectionProps {
35
+ /** The group heading. */
36
+ title?: ReactNode;
37
+ /** The MenuItems. */
38
+ children: ReactNode;
39
+ }
40
+ /** A group of menu items under a title. */
41
+ export declare function MenuSection({ title, children }: MenuSectionProps): import("react").JSX.Element;
42
+ /** A line between groups of items. */
43
+ export declare function MenuSeparator(): import("react").JSX.Element;
44
+ export interface DropdownMenuProps<T extends object> extends Omit<MenuTriggerProps, 'children' | 'trigger'> {
45
+ /** The button that opens it (usually a Button or IconButton). */
46
+ trigger: ReactNode;
47
+ children: RACMenuProps<T>['children'];
48
+ /** Where it opens. Default bottom start. */
49
+ placement?: PopoverProps['placement'];
50
+ /** Menu props: onAction, selectionMode, selectedKeys, items, disabledKeys... */
51
+ menuProps?: Omit<MenuProps<T>, 'children'>;
52
+ /** Name of the menu; defaults to the trigger's name. */
53
+ 'aria-label'?: string;
54
+ /** How the popup enters and leaves: a preset (fade, scale, pop, slide-down, blur...), false for none, or options. */
55
+ motion?: MotionProp;
56
+ /** sm (32 px items) or md (40 px, default). */
57
+ size?: 'sm' | 'md';
58
+ /** Content above the items, not focusable: who is signed in, a plan. */
59
+ header?: ReactNode;
60
+ /** Content under the items, not focusable: a version, a hint. */
61
+ footer?: ReactNode;
62
+ /** Least width of the menu, any CSS length. Default 200 px. */
63
+ minWidth?: string | number;
64
+ /** Most height before it scrolls, in px. */
65
+ maxHeight?: number;
66
+ }
67
+ /** A button that opens a menu: two sizes, a header and footer, a width and a height limit. */
68
+ export declare function DropdownMenu<T extends object>({ motion, trigger, children, placement, menuProps, size, header, footer, minWidth, maxHeight, 'aria-label': label, ...props }: DropdownMenuProps<T>): import("react").JSX.Element;
69
+ export interface SubmenuProps extends Omit<SubmenuTriggerProps, 'children'> {
70
+ /** The item that opens the submenu. */
71
+ label: ReactNode;
72
+ /** An icon before the item label. */
73
+ icon?: ReactNode;
74
+ /** A second line under the label. */
75
+ description?: ReactNode;
76
+ /** Something at the end of the item, before the chevron: a count, a status. */
77
+ end?: ReactNode;
78
+ /** A small badge at the end of the item, before the chevron. */
79
+ badge?: ReactNode;
80
+ /** The tone of the badge. */
81
+ badgeTone?: MenuItemProps['badgeTone'];
82
+ /** Not available: the item is dimmed and the submenu does not open. */
83
+ isDisabled?: boolean;
84
+ children: ReactNode;
85
+ }
86
+ /** An item that opens another menu (arrow right or hover). It takes the same slots as MenuItem. */
87
+ export declare function Submenu({ label, icon, description, end, badge, badgeTone, isDisabled, children, ...props }: SubmenuProps): import("react").JSX.Element;