@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.
Files changed (84) 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 +71 -0
  73. package/dist/index.js +7434 -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/responsive.d.ts +9 -0
  82. package/dist/utils/scrollEdges.d.ts +9 -0
  83. package/dist/utils/space.d.ts +2 -0
  84. package/package.json +68 -4
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Alejandro Vasquez (https://alevasquez.dev)
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,3 +1,18 @@
1
- # Temporary Holding Version
1
+ # @alea-design/ui
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ The core of **Alea**, the complete React design system: accessible components, Alea Motion, design tokens for dark and light, presets and glass surfaces.
4
+
5
+ ```bash
6
+ npm install @alea-design/ui
7
+ ```
8
+
9
+ ```tsx
10
+ import '@alea-design/ui/styles.css';
11
+ import { ThemeProvider, Button } from '@alea-design/ui';
12
+
13
+ <ThemeProvider locale="es-ES" motion={{ mode: 'productive' }} preset="graphite">
14
+ <Button>Guardar</Button>
15
+ </ThemeProvider>
16
+ ```
17
+
18
+ Docs: https://alea.alevasquez.dev · MIT license · Alea Pro (charts, DataGrid, effects, templates): https://alea.alevasquez.dev/pro
@@ -0,0 +1,29 @@
1
+ import type { ReactNode } from 'react';
2
+ import { type DisclosureProps, type DisclosureGroupProps } from 'react-aria-components';
3
+ export interface AccordionProps extends DisclosureGroupProps {
4
+ /** separated cards (default), joined (one card with dividers), ghost (no card, dividers only) or filled (tinted sections). */
5
+ variant?: 'separated' | 'joined' | 'ghost' | 'filled';
6
+ /** sm (44 px headers), md (56 px, default) or lg (64 px). */
7
+ size?: 'sm' | 'md' | 'lg';
8
+ /** Where the indicator sits: end (default) or start. */
9
+ indicatorPosition?: 'start' | 'end';
10
+ /** chevron (default, turns over) or plus (turns into a cross). */
11
+ indicator?: 'chevron' | 'plus';
12
+ }
13
+ /** A list of sections that expand and collapse: four looks, three sizes, the indicator on either side, icons, subtitles and extra content in each header. allowsMultipleExpanded keeps several open. */
14
+ export declare function Accordion({ variant, size, indicatorPosition, indicator, className, ...props }: AccordionProps): import("react").JSX.Element;
15
+ export interface AccordionItemProps extends Omit<DisclosureProps, 'children'> {
16
+ /** The always-visible header. */
17
+ title: ReactNode;
18
+ /** A second, muted line under the title. */
19
+ subtitle?: ReactNode;
20
+ /** An icon before the title. */
21
+ icon?: ReactNode;
22
+ /** Content at the end of the header, before the indicator: a badge, a count, a status. Keep it non-interactive: the whole header is one button. */
23
+ extra?: ReactNode;
24
+ children: ReactNode;
25
+ /** Heading level for the header button. Default 3. */
26
+ headingLevel?: 2 | 3 | 4 | 5 | 6;
27
+ }
28
+ /** One expandable section. Works alone too (a single disclosure). */
29
+ export declare function AccordionItem({ title, subtitle, icon, extra, children, headingLevel, className, ...props }: AccordionItemProps): import("react").JSX.Element;
@@ -0,0 +1,157 @@
1
+ import { type ReactNode } from 'react';
2
+ export interface PromptInputProps {
3
+ /** The text (controlled). */
4
+ value?: string;
5
+ /** The text at first. */
6
+ defaultValue?: string;
7
+ /** Called on every change. */
8
+ onChange?: (value: string) => void;
9
+ /** Called with the text on Enter or the send button. Empty text never sends. */
10
+ onSubmit?: (value: string) => void;
11
+ /** A response is being generated: the send button becomes Stop, and the border glows. */
12
+ isGenerating?: boolean;
13
+ /** Called by the Stop button. */
14
+ onStop?: () => void;
15
+ /** Shows a paperclip button; called when it is pressed (open your file picker there). */
16
+ onAttach?: () => void;
17
+ /** Content above the text: attached files, a quoted message. */
18
+ header?: ReactNode;
19
+ /** Content at the start of the bottom row: a model select, tool toggles. */
20
+ tools?: ReactNode;
21
+ /** Shown while empty. */
22
+ placeholder?: string;
23
+ /** Visible label; without one the field is named "Message". */
24
+ label?: ReactNode;
25
+ /** Lines before it scrolls. Default 8. */
26
+ maxRows?: number;
27
+ /** Clears the text after sending. Default true. */
28
+ clearOnSubmit?: boolean;
29
+ /** Disables typing and sending. */
30
+ isDisabled?: boolean;
31
+ /** Shows the Enter and Shift+Enter hint under the field. Default false. */
32
+ showHint?: boolean;
33
+ /** Extra class names. */
34
+ className?: string;
35
+ }
36
+ /** The message box of an assistant: grows with the text, Enter sends and Shift+Enter adds a line, a Send button that turns into Stop while a response is generated, a slot for files above and tools below. The border glows while it works. */
37
+ export declare function PromptInput({ value, defaultValue, onChange, onSubmit, isGenerating, onStop, onAttach, header, tools, placeholder, label, maxRows, clearOnSubmit, isDisabled, showHint, className }: PromptInputProps): import("react").JSX.Element;
38
+ export interface PromptSuggestion {
39
+ id: string;
40
+ /** What is shown. */
41
+ label: string;
42
+ /** What is sent, when different from the label. */
43
+ prompt?: string;
44
+ /** An icon before the label. */
45
+ icon?: ReactNode;
46
+ /** A second line, for the card look. */
47
+ description?: string;
48
+ }
49
+ export interface PromptSuggestionsProps {
50
+ /** The suggestions, each with its label and the prompt it sends. */
51
+ items: PromptSuggestion[];
52
+ /** Called with the prompt to send. */
53
+ onSelect: (prompt: string, item: PromptSuggestion) => void;
54
+ /** chips (default) for a row under the box, or cards for an empty conversation. */
55
+ variant?: 'chips' | 'cards';
56
+ /** Extra class names. */
57
+ className?: string;
58
+ }
59
+ /** Starting points for a conversation, as chips or cards. Each is a button; they enter one after another. */
60
+ export declare function PromptSuggestions({ items, onSelect, variant, className }: PromptSuggestionsProps): import("react").JSX.Element;
61
+ export interface ResponseActionsProps {
62
+ /** The text Copy puts on the clipboard. Leave out to hide Copy. */
63
+ copyText?: string;
64
+ /** Shows Regenerate. */
65
+ onRegenerate?: () => void;
66
+ /** Shows the thumbs; called with the choice (null when taken back). */
67
+ onFeedback?: (value: 'good' | 'bad' | null) => void;
68
+ /** The current feedback (controlled). */
69
+ feedback?: 'good' | 'bad' | null;
70
+ /** More buttons at the end: share, read aloud. */
71
+ extra?: ReactNode;
72
+ /** Extra class names. */
73
+ className?: string;
74
+ }
75
+ /** The row under an answer: copy (it confirms), regenerate, and good or bad feedback as toggle buttons. */
76
+ export declare function ResponseActions({ copyText, onRegenerate, onFeedback, feedback, extra, className }: ResponseActionsProps): import("react").JSX.Element;
77
+ export interface ReasoningProps {
78
+ /** The model's reasoning, as text or nodes. */
79
+ children: ReactNode;
80
+ /** Still thinking: the label shimmers and the panel stays open. */
81
+ isThinking?: boolean;
82
+ /** How long it thought, in seconds, shown when done. */
83
+ seconds?: number;
84
+ /** Open at first. Default: open while thinking, closed after. */
85
+ defaultOpen?: boolean;
86
+ /** While it thinks and the panel is closed, show the latest lines of the reasoning as they stream in, scrolling up under a soft fade. How many lines (1 to 4). Off by default. */
87
+ previewLines?: 1 | 2 | 3 | 4;
88
+ /** Extra class names. */
89
+ className?: string;
90
+ }
91
+ /** The model's thinking, behind a disclosure: "Thinking…" shimmers while it works, then "Thought for 4 s" and it folds away. */
92
+ export declare function Reasoning({ children, isThinking, seconds, defaultOpen, previewLines, className }: ReasoningProps): import("react").JSX.Element;
93
+ export interface ThinkingStatusProps {
94
+ /** What it is doing right now: "Searching the web". Each change swaps with a soft blur crossfade. */
95
+ children: string;
96
+ /** Still working: the line shimmers. When false it holds still, with a check. Default true. */
97
+ isActive?: boolean;
98
+ /** Extra class names. */
99
+ className?: string;
100
+ }
101
+ /** A one line status for an assistant that works in steps ("Searching", "Reading 4 sources", "Writing"): it shimmers while it works and swaps to the next step. Announced politely. */
102
+ export declare function ThinkingStatus({ children, isActive, className }: ThinkingStatusProps): import("react").JSX.Element;
103
+ export interface ToolCallProps {
104
+ /** The tool's name: "Search the web". */
105
+ name: string;
106
+ /** running, done or error. */
107
+ status: 'running' | 'done' | 'error';
108
+ /** A short line: the query, the file. */
109
+ summary?: ReactNode;
110
+ /** What was sent to the tool, shown when expanded. */
111
+ input?: ReactNode;
112
+ /** What came back, shown when expanded. */
113
+ output?: ReactNode;
114
+ /** An icon for the tool. */
115
+ icon?: ReactNode;
116
+ /** Extra class names. */
117
+ className?: string;
118
+ }
119
+ /** One step of an agent: the tool, its status (running spins, done checks, error warns) and, on demand, what went in and what came back. Status changes are announced. */
120
+ export declare function ToolCall({ name, status, summary, input, output, icon, className }: ToolCallProps): import("react").JSX.Element;
121
+ export interface Source {
122
+ id: string;
123
+ title: string;
124
+ href: string;
125
+ /** A short quote or description. */
126
+ snippet?: string;
127
+ }
128
+ export interface SourcesProps {
129
+ /** The sources in citation order, each with its title, link and an optional snippet. */
130
+ sources: Source[];
131
+ /** Extra class names. */
132
+ className?: string;
133
+ }
134
+ /** The sources behind an answer, numbered to match the citations in the text, each a link with its site. */
135
+ export declare function Sources({ sources, className }: SourcesProps): import("react").JSX.Element;
136
+ export interface CitationProps {
137
+ /** The number shown, matching Sources. */
138
+ n: number;
139
+ /** The source it points to. */
140
+ source: Source;
141
+ /** Extra class names. */
142
+ className?: string;
143
+ }
144
+ /** An inline citation: a small number that links to its source and is named with the source's title. */
145
+ export declare function Citation({ n, source, className }: CitationProps): import("react").JSX.Element;
146
+ export interface AIOrbProps {
147
+ /** idle (a slow drift), listening (it breathes), thinking (it swirls) or speaking (it pulses). */
148
+ state?: 'idle' | 'listening' | 'thinking' | 'speaking';
149
+ /** Size in px. Default 48. */
150
+ size?: number;
151
+ /** Announces state changes (for a voice assistant). Default false: decorative. */
152
+ announce?: boolean;
153
+ /** Extra class names. */
154
+ className?: string;
155
+ }
156
+ /** A living gradient orb for an assistant: its motion shows what it is doing. Decorative unless announce is on; with reduced motion it holds still. */
157
+ export declare function AIOrb({ state, size, announce, className }: AIOrbProps): import("react").JSX.Element;
@@ -0,0 +1,105 @@
1
+ import { type ReactNode } from 'react';
2
+ export interface DockedWindowProps {
3
+ /** The title in the bar; it names the window. */
4
+ title: ReactNode;
5
+ /** The content: a form (compose a message), a list (uploads), a chat. */
6
+ children: ReactNode;
7
+ /** Content pinned at the bottom: Send, Discard. */
8
+ footer?: ReactNode;
9
+ /** Shows a close button and calls this. */
10
+ onClose?: () => void;
11
+ /** Minimized to its title bar (controlled). */
12
+ isMinimized?: boolean;
13
+ /** Minimized at first. */
14
+ defaultMinimized?: boolean;
15
+ /** Called when it is minimized or restored. */
16
+ onMinimizedChange?: (minimized: boolean) => void;
17
+ /** Shows a button that grows it to most of the screen. */
18
+ allowMaximize?: boolean;
19
+ /** Width when docked, in px. Default 480. */
20
+ width?: number;
21
+ /** Height of the content when open, in px. Default 420. */
22
+ height?: number;
23
+ /** Something next to the title: a count, a status. */
24
+ meta?: ReactNode;
25
+ /** Extra class names. */
26
+ className?: string;
27
+ }
28
+ /** A window docked at the bottom of the screen that people keep open while they work: a message being written, uploads in progress, a chat. It minimizes to its bar, can grow to most of the screen, and several sit side by side in a DockedWindowStack. Not modal: the page stays usable. */
29
+ export declare function DockedWindow({ title, children, footer, onClose, isMinimized, defaultMinimized, onMinimizedChange, allowMaximize, width, height, meta, className }: DockedWindowProps): import("react").JSX.Element;
30
+ export interface DockedWindowStackProps {
31
+ /** DockedWindow elements, newest last. */
32
+ children: ReactNode;
33
+ /** Where the stack sits: end (default) or start. */
34
+ placement?: 'start' | 'end';
35
+ /** fixed to the viewport (default) or inline, for demos and previews. */
36
+ position?: 'fixed' | 'inline';
37
+ /** Extra class names. */
38
+ className?: string;
39
+ }
40
+ /** Holds docked windows side by side along the bottom of the screen; on phones they stack full width. */
41
+ export declare function DockedWindowStack({ children, placement, position, className }: DockedWindowStackProps): import("react").JSX.Element;
42
+ export interface SelectionBarProps {
43
+ /** How many items are selected; at 0 the bar hides. */
44
+ count: number;
45
+ /** Clears the selection (the X button and Escape). */
46
+ onClear: () => void;
47
+ /** Actions on the selection: Archive, Delete, Move (small Buttons or IconButtons). */
48
+ children: ReactNode;
49
+ /** The text with the count. Default "3 selected". */
50
+ label?: (count: number) => ReactNode;
51
+ /** floating (centered at the bottom of the screen, default) or inline (where you put it, like a toolbar over a table). */
52
+ variant?: 'floating' | 'inline';
53
+ /** Extra class names. */
54
+ className?: string;
55
+ }
56
+ /** A bar that appears while items are selected, with the count, actions on them and a way to clear the selection. A toolbar (one Tab stop group of actions); the count is announced as it changes; Escape clears. */
57
+ export declare function SelectionBar({ count, onClear, children, label, variant, className }: SelectionBarProps): import("react").JSX.Element;
58
+ export interface Shortcut {
59
+ /** The keys, pressed together: ['mod', 'K'] ("mod" is each system's main modifier: ⌘ or Ctrl). For a sequence, pass several combos: [['G'], ['I']]. */
60
+ keys: string[] | string[][];
61
+ /** What it does. */
62
+ label: string;
63
+ }
64
+ export interface KeyboardShortcutsProps {
65
+ /** The shortcuts in groups: Navigation, Actions, Editing. */
66
+ groups: Array<{
67
+ title: string;
68
+ shortcuts: Shortcut[];
69
+ }>;
70
+ /** Open (controlled). Leave out and pass openKey to open it from the keyboard. */
71
+ isOpen?: boolean;
72
+ /** Called when it opens or closes. */
73
+ onOpenChange?: (open: boolean) => void;
74
+ /** A key that opens it from anywhere (outside text fields). Default "?". */
75
+ openKey?: string | false;
76
+ /** A button that opens it. */
77
+ trigger?: ReactNode;
78
+ /** The title. Default "Keyboard shortcuts". */
79
+ title?: ReactNode;
80
+ }
81
+ /** Every keyboard shortcut of an app in one searchable dialog, opened with "?" from anywhere. The main modifier shows as each system's own key (⌘ or Ctrl); sequences ("G then I") read as such. */
82
+ export declare function KeyboardShortcuts({ groups, isOpen, onOpenChange, openKey, trigger, title }: KeyboardShortcutsProps): import("react").JSX.Element;
83
+ export interface AppLauncherItem {
84
+ id: string;
85
+ label: string;
86
+ /** An icon or logo. */
87
+ icon: ReactNode;
88
+ href: string;
89
+ /** Tile color behind the icon (a token or any CSS color). */
90
+ color?: string;
91
+ }
92
+ export interface AppLauncherProps {
93
+ /** The apps, in order. */
94
+ apps: AppLauncherItem[];
95
+ /** Columns in the grid. Default 3. */
96
+ columns?: number;
97
+ /** A link at the bottom: "More apps". */
98
+ moreHref?: string;
99
+ /** Name of the button. Default "Apps". */
100
+ 'aria-label'?: string;
101
+ /** Where the grid opens. Default bottom end. */
102
+ placement?: 'bottom end' | 'bottom start' | 'bottom';
103
+ }
104
+ /** The grid of apps behind a button in the header, to jump between the products of a suite. A navigation of links: arrows move in the grid, Tab leaves it. */
105
+ export declare function AppLauncher({ apps, columns, moreHref, 'aria-label': label, placement }: AppLauncherProps): import("react").JSX.Element;
@@ -0,0 +1,95 @@
1
+ import { type ReactNode } from 'react';
2
+ import { type ButtonProps as RACButtonProps, type ToggleButtonProps as RACToggleButtonProps, type ToggleButtonGroupProps, type Key } from 'react-aria-components';
3
+ import type { Responsive } from '../../utils/responsive';
4
+ export type ButtonVariant = 'primary' | 'secondary' | 'soft' | 'ghost' | 'text' | 'dashed' | 'danger' | 'link';
5
+ export type ButtonSize = 'xs' | 'sm' | 'md' | 'lg' | 'xl';
6
+ export type ButtonTone = 'neutral' | 'accent' | 'success' | 'warning' | 'danger' | 'info';
7
+ export type ButtonShape = 'pill' | 'rounded' | 'square';
8
+ export interface ButtonProps extends Omit<RACButtonProps, 'isPending'> {
9
+ /** primary: the dark gradient button (solid in its tone when tone is set); secondary: the chip (white on dark, black on light); soft: tinted; ghost: outlined; text: no border until hover; dashed: dashed outline; danger: destructive; link: text only. */
10
+ variant?: ButtonVariant;
11
+ /** The color of soft, ghost, text, dashed and link buttons, and of a solid primary: neutral (default), accent, success, warning, danger or info. */
12
+ tone?: ButtonTone;
13
+ /** xs 28 px, sm 32 px, md 40 px (default), lg 48 px, xl 56 px. Can change per breakpoint: { base: 'lg', md: 'md' }. */
14
+ size?: Responsive<ButtonSize>;
15
+ /** pill (default), rounded (8 px) or square (4 px corners). */
16
+ shape?: ButtonShape;
17
+ /** Icon before the label. */
18
+ iconStart?: ReactNode;
19
+ /** Icon after the label. */
20
+ iconEnd?: ReactNode;
21
+ /** Shows a spinner, keeps the width and tells screen readers it is busy. */
22
+ isLoading?: boolean;
23
+ /** Text to show next to the spinner while loading. Without it the spinner covers the label. */
24
+ loadingLabel?: ReactNode;
25
+ /** Where the spinner goes while loading: center (covers the label, default), start or end (takes the icon's place). */
26
+ loadingPosition?: 'center' | 'start' | 'end';
27
+ /** Stretches to the width of its container. Can change per breakpoint: { base: true, md: false } is full width on phones only. */
28
+ fullWidth?: Responsive<boolean>;
29
+ /** How the content sits in a wide button: center (default), start, or between (label left, end icon right). */
30
+ justify?: 'center' | 'start' | 'between';
31
+ /** A keyboard shortcut shown at the end, like ⌘S (also set as aria-keyshortcuts when it is text). */
32
+ shortcut?: ReactNode;
33
+ /** Turns the button into a link that looks like a button. */
34
+ href?: string;
35
+ /** With href: where to open it. */
36
+ target?: string;
37
+ /** With href: the link relationship. */
38
+ rel?: string;
39
+ /** Shows a check that draws itself and successLabel (the success pattern); set it for a moment after the action worked. */
40
+ isSuccess?: boolean;
41
+ /** The label while isSuccess. Default "Done". */
42
+ successLabel?: ReactNode;
43
+ /** A ripple grows from the pointer on press (the ripple pattern). */
44
+ ripple?: boolean;
45
+ }
46
+ /** The action button: eight looks, six tones, five sizes, three shapes, icons, a shortcut, loading and success states, and links that look like buttons. */
47
+ export declare const Button: import("react").ForwardRefExoticComponent<ButtonProps & import("react").RefAttributes<HTMLButtonElement>>;
48
+ export interface IconButtonProps extends Omit<ButtonProps, 'iconStart' | 'iconEnd' | 'children' | 'fullWidth' | 'shape' | 'loadingLabel' | 'loadingPosition' | 'justify' | 'shortcut'> {
49
+ /** What the button does, for screen readers (the icon has no text). */
50
+ 'aria-label': string;
51
+ /** The icon. */
52
+ children: ReactNode;
53
+ /** circle (default), rounded (8 px) or square (4 px corners). */
54
+ shape?: 'circle' | 'rounded' | 'square';
55
+ /** Shows aria-label in a tooltip on hover and focus. */
56
+ tooltip?: boolean;
57
+ }
58
+ /** A button with only an icon. aria-label is required; tooltip shows it to sighted people too. */
59
+ export declare const IconButton: import("react").ForwardRefExoticComponent<IconButtonProps & import("react").RefAttributes<HTMLButtonElement>>;
60
+ export interface SegmentedControlProps extends Omit<ToggleButtonGroupProps, 'selectionMode' | 'selectedKeys' | 'defaultSelectedKeys' | 'onSelectionChange' | 'children'> {
61
+ /** The options: id and label. */
62
+ items: Array<{
63
+ id: Key;
64
+ label: ReactNode;
65
+ isDisabled?: boolean;
66
+ }>;
67
+ /** Selected id (controlled). */
68
+ value?: Key;
69
+ /** Selected id to start with. */
70
+ defaultValue?: Key;
71
+ /** Called with the id of the option picked. */
72
+ onChange?: (value: Key) => void;
73
+ /** sm (28 px) or md (34 px, default). */
74
+ size?: 'sm' | 'md';
75
+ /** Label for screen readers. */
76
+ 'aria-label'?: string;
77
+ }
78
+ /** One choice among a few, as a row of pills. */
79
+ export declare function SegmentedControl({ items, value, defaultValue, onChange, size, className, ...props }: SegmentedControlProps): import("react").JSX.Element;
80
+ export interface ToggleButtonProps extends RACToggleButtonProps {
81
+ /** sm (32 px) or md (40 px, default). */
82
+ size?: 'sm' | 'md';
83
+ }
84
+ /** A button that stays pressed (bold, mute, pin). */
85
+ export declare function ToggleButton({ size, className, ...props }: ToggleButtonProps): import("react").JSX.Element;
86
+ export interface HoldButtonProps extends Omit<ButtonProps, 'onPress' | 'isLoading' | 'isSuccess'> {
87
+ /** Runs when the button has been held the whole time. */
88
+ onConfirm: () => void;
89
+ /** How long to hold, in ms. Default 1200. */
90
+ duration?: number;
91
+ /** Read by screen readers after the label. Default "Press and hold to confirm". */
92
+ hint?: string;
93
+ }
94
+ /** Hold to confirm (the hold pattern): a fill grows while it is pressed, with pointer, Space or Enter, and the action runs when it is full. For destructive actions without a dialog. */
95
+ export declare function HoldButton({ onConfirm, duration, hint, variant, className, children, ...props }: HoldButtonProps): import("react").JSX.Element;
@@ -0,0 +1,91 @@
1
+ import { type ReactNode } from 'react';
2
+ import { type ToolbarProps as RACToolbarProps, type Key } from 'react-aria-components';
3
+ import { type ButtonProps } from './Button';
4
+ export interface ButtonGroupProps {
5
+ /** What the buttons do together, for screen readers ("Text alignment"). */
6
+ 'aria-label'?: string;
7
+ children: ReactNode;
8
+ /** Joins the buttons into one shape. Default true; false only spaces them. */
9
+ attached?: boolean;
10
+ /** horizontal (default) or vertical. */
11
+ orientation?: 'horizontal' | 'vertical';
12
+ /** Extra class names for the root element. */
13
+ className?: string;
14
+ }
15
+ /** Related buttons side by side, joined into one control. */
16
+ export declare function ButtonGroup({ children, attached, orientation, className, 'aria-label': label }: ButtonGroupProps): import("react").JSX.Element;
17
+ export interface SplitButtonProps extends Omit<ButtonProps, 'children' | 'className'> {
18
+ /** Extra class names for the root element. */
19
+ className?: string;
20
+ /** The main action's label. */
21
+ children: ReactNode;
22
+ /** The other actions in the menu: id, label (and an optional icon or description). */
23
+ actions: Array<{
24
+ id: Key;
25
+ label: string;
26
+ icon?: ReactNode;
27
+ description?: string;
28
+ }>;
29
+ /** Called with the id of the menu action picked. */
30
+ onAction?: (id: Key) => void;
31
+ /** Name of the menu button. Default "More options". */
32
+ menuLabel?: string;
33
+ }
34
+ /** A main action plus a menu of related ones. */
35
+ export declare function SplitButton({ children, actions, onAction, menuLabel, variant, size, className, ...props }: SplitButtonProps): import("react").JSX.Element;
36
+ export interface ToggleGroupProps {
37
+ /** What the group controls, for screen readers ("Text style"). */
38
+ 'aria-label': string;
39
+ /** Buttons: id, label, and an icon. With iconOnly the label becomes the accessible name. */
40
+ items: Array<{
41
+ id: Key;
42
+ label: string;
43
+ icon?: ReactNode;
44
+ isDisabled?: boolean;
45
+ }>;
46
+ /** single (like radio buttons) or multiple (like checkboxes). Default single. */
47
+ selectionMode?: 'single' | 'multiple';
48
+ /** The pressed ids (controlled). */
49
+ value?: Key[];
50
+ /** The pressed ids to start with. */
51
+ defaultValue?: Key[];
52
+ /** Called with the pressed ids. */
53
+ onChange?: (keys: Key[]) => void;
54
+ /** Show only the icons. */
55
+ iconOnly?: boolean;
56
+ /** sm (26 px) or md (32 px, default). */
57
+ size?: 'sm' | 'md';
58
+ /** Extra class names for the root element. */
59
+ className?: string;
60
+ }
61
+ /** A set of toggle buttons, one or several on: bold/italic, view modes, filters. */
62
+ export declare function ToggleGroup({ items, selectionMode, value, defaultValue, onChange, iconOnly, size, className, 'aria-label': label }: ToggleGroupProps): import("react").JSX.Element;
63
+ /** An action in a Toolbar built from items. */
64
+ export interface ToolbarItem {
65
+ id: Key;
66
+ label: string;
67
+ icon?: ReactNode;
68
+ onAction?: () => void;
69
+ isDisabled?: boolean;
70
+ isSelected?: boolean;
71
+ separatorBefore?: boolean;
72
+ }
73
+ export interface ToolbarProps extends Omit<RACToolbarProps, 'children'> {
74
+ children?: RACToolbarProps['children'];
75
+ /** The actions as data. Those that do not fit move into a More menu at the end, last first (priority overflow). */
76
+ items?: ToolbarItem[];
77
+ /** With items: icon buttons with tooltips (default), or buttons with labels. */
78
+ itemStyle?: 'icon' | 'label';
79
+ }
80
+ /** A row of controls that is one Tab stop; arrow keys move inside it (editor toolbars, table tools). Pass items and it folds what does not fit into a More menu. */
81
+ export declare function Toolbar({ className, items, itemStyle, children, ...props }: ToolbarProps): import("react").JSX.Element;
82
+ export interface CompoundButtonProps extends Omit<ButtonProps, 'children' | 'iconEnd' | 'loadingLabel'> {
83
+ /** The main text. */
84
+ children: ReactNode;
85
+ /** A second, smaller line under it. */
86
+ description?: ReactNode;
87
+ /** An icon on the left, larger than in a Button. */
88
+ icon?: ReactNode;
89
+ }
90
+ /** A tall button with a title and a second line: choices on an empty state, "Create from template", start screens. */
91
+ export declare function CompoundButton({ children, description, icon, className, size, variant, ...props }: CompoundButtonProps): import("react").JSX.Element;
@@ -0,0 +1,61 @@
1
+ import { type ElementType, type HTMLAttributes, type ReactNode } from 'react';
2
+ export interface CardProps extends HTMLAttributes<HTMLElement> {
3
+ /** default: the surface with the soft ring; deep: a darker inset panel; outline: border only; glass: frosted glass over what is behind it. */
4
+ variant?: 'default' | 'deep' | 'outline' | 'glass';
5
+ /** tight uses less padding and a smaller radius. */
6
+ padding?: 'none' | 'tight' | 'normal' | 'loose';
7
+ /** Lifts and glows on hover; use when the whole card is a link (put the link inside with CardLink). */
8
+ interactive?: boolean;
9
+ /** The element to render. Default div; use article or section when it fits. */
10
+ as?: ElementType;
11
+ /** vertical (default) or horizontal: CardMedia on the left, the rest on the right (stacks on narrow cards). */
12
+ orientation?: 'vertical' | 'horizontal';
13
+ /** Shows a skeleton of a card while its content loads. */
14
+ isLoading?: boolean;
15
+ children?: ReactNode;
16
+ }
17
+ /** The Alea panel: rounded surface with the soft inner ring. Header, media and footer parts, side by side or stacked, and a loading state. */
18
+ export declare function Card({ variant, padding, interactive, as, orientation, isLoading, className, children, ...props }: CardProps): import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>;
19
+ export interface CardTitleProps extends HTMLAttributes<HTMLHeadingElement> {
20
+ /** The heading element. Default h3; match the page outline. */
21
+ as?: ElementType;
22
+ }
23
+ /** Card title in Crimson Pro. */
24
+ export declare function CardTitle({ as, className, ...props }: CardTitleProps): import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>;
25
+ /** Card body text, muted. */
26
+ export declare function CardDescription({ className, ...props }: HTMLAttributes<HTMLParagraphElement>): import("react").JSX.Element;
27
+ /** Makes the whole card clickable through one real link (keeps one tab stop and the link text as the name). */
28
+ export declare function CardLink({ className, ...props }: React.AnchorHTMLAttributes<HTMLAnchorElement>): import("react").JSX.Element;
29
+ export interface CardHeaderProps {
30
+ /** The title. */
31
+ title: ReactNode;
32
+ /** A line under the title. */
33
+ subtitle?: ReactNode;
34
+ /** An avatar, icon or logo before the title. */
35
+ media?: ReactNode;
36
+ /** Actions or a menu on the right. */
37
+ actions?: ReactNode;
38
+ /** Heading level of the title. Default 3. */
39
+ headingLevel?: 2 | 3 | 4 | 5;
40
+ className?: string;
41
+ }
42
+ /** The top of a card: media, title, subtitle and actions. */
43
+ export declare function CardHeader({ title, subtitle, media, actions, headingLevel, className }: CardHeaderProps): import("react").JSX.Element;
44
+ export interface CardMediaProps {
45
+ /** The image URL, or your own media as children. */
46
+ src?: string;
47
+ /** The image's text; leave empty for decorative images. */
48
+ alt?: string;
49
+ /** Width to height ratio. Default 16 / 9. */
50
+ ratio?: number;
51
+ children?: ReactNode;
52
+ className?: string;
53
+ }
54
+ /** A cover image or video that reaches the card's edges. Put it first or last in the card. */
55
+ export declare function CardMedia({ src, alt, ratio, children, className }: CardMediaProps): import("react").JSX.Element;
56
+ /** The bottom of a card: actions, with a line above. */
57
+ export declare function CardFooter({ children, className, divider }: {
58
+ children: ReactNode;
59
+ className?: string; /** A line above. Default true. */
60
+ divider?: boolean;
61
+ }): import("react").JSX.Element;