@danxbot/ui 1.0.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 (183) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +126 -0
  3. package/dist/fonts/bricolage-grotesque-0.woff2 +0 -0
  4. package/dist/fonts/bricolage-grotesque-1.woff2 +0 -0
  5. package/dist/fonts/bricolage-grotesque-2.woff2 +0 -0
  6. package/dist/fonts/figtree-0.woff2 +0 -0
  7. package/dist/fonts/figtree-1.woff2 +0 -0
  8. package/dist/fonts/figtree-2.woff2 +0 -0
  9. package/dist/fonts/figtree-3.woff2 +0 -0
  10. package/dist/fonts/jetbrains-mono-0.woff2 +0 -0
  11. package/dist/fonts/jetbrains-mono-1.woff2 +0 -0
  12. package/dist/fonts/jetbrains-mono-10.woff2 +0 -0
  13. package/dist/fonts/jetbrains-mono-11.woff2 +0 -0
  14. package/dist/fonts/jetbrains-mono-2.woff2 +0 -0
  15. package/dist/fonts/jetbrains-mono-3.woff2 +0 -0
  16. package/dist/fonts/jetbrains-mono-4.woff2 +0 -0
  17. package/dist/fonts/jetbrains-mono-5.woff2 +0 -0
  18. package/dist/fonts/jetbrains-mono-6.woff2 +0 -0
  19. package/dist/fonts/jetbrains-mono-7.woff2 +0 -0
  20. package/dist/fonts/jetbrains-mono-8.woff2 +0 -0
  21. package/dist/fonts/jetbrains-mono-9.woff2 +0 -0
  22. package/dist/fonts.css +187 -0
  23. package/dist/index.js +42425 -0
  24. package/dist/index.js.map +1 -0
  25. package/dist/styles.css +190 -0
  26. package/dist/types/components/Accordion.d.ts +15 -0
  27. package/dist/types/components/AppShell.d.ts +58 -0
  28. package/dist/types/components/Avatar.d.ts +154 -0
  29. package/dist/types/components/Badge.d.ts +73 -0
  30. package/dist/types/components/Button.d.ts +103 -0
  31. package/dist/types/components/Card.d.ts +193 -0
  32. package/dist/types/components/Choice.d.ts +112 -0
  33. package/dist/types/components/CodeEditor.d.ts +86 -0
  34. package/dist/types/components/Combobox.d.ts +37 -0
  35. package/dist/types/components/CommandPalette.d.ts +33 -0
  36. package/dist/types/components/DatePicker.d.ts +20 -0
  37. package/dist/types/components/Dialog.d.ts +117 -0
  38. package/dist/types/components/DragDrop.d.ts +60 -0
  39. package/dist/types/components/ErrorBoundary.d.ts +16 -0
  40. package/dist/types/components/Field.d.ts +37 -0
  41. package/dist/types/components/FileUpload.d.ts +22 -0
  42. package/dist/types/components/Icon.d.ts +40 -0
  43. package/dist/types/components/Input.d.ts +120 -0
  44. package/dist/types/components/Loading.d.ts +83 -0
  45. package/dist/types/components/MarkdownEditor.d.ts +24 -0
  46. package/dist/types/components/Menu.d.ts +57 -0
  47. package/dist/types/components/Navigation.d.ts +46 -0
  48. package/dist/types/components/NumberInput.d.ts +88 -0
  49. package/dist/types/components/OTPInput.d.ts +11 -0
  50. package/dist/types/components/Panel.d.ts +94 -0
  51. package/dist/types/components/Popover.d.ts +64 -0
  52. package/dist/types/components/Progress.d.ts +178 -0
  53. package/dist/types/components/Select.d.ts +53 -0
  54. package/dist/types/components/Slider.d.ts +203 -0
  55. package/dist/types/components/Spinner.d.ts +29 -0
  56. package/dist/types/components/Stat.d.ts +98 -0
  57. package/dist/types/components/StatusSelect.d.ts +23 -0
  58. package/dist/types/components/Surface.d.ts +110 -0
  59. package/dist/types/components/Table.d.ts +46 -0
  60. package/dist/types/components/Tabs.d.ts +84 -0
  61. package/dist/types/components/ThemeMenu.d.ts +4 -0
  62. package/dist/types/components/Toast.d.ts +46 -0
  63. package/dist/types/components/Toggle.d.ts +65 -0
  64. package/dist/types/components/Tree.d.ts +20 -0
  65. package/dist/types/components/calendar/CalendarMonth.d.ts +33 -0
  66. package/dist/types/components/calendar/CalendarTimeGrid.d.ts +75 -0
  67. package/dist/types/components/calendar/EventActions.d.ts +17 -0
  68. package/dist/types/components/calendar/format.d.ts +43 -0
  69. package/dist/types/components/calendar/index.d.ts +9 -0
  70. package/dist/types/components/calendar/palette.d.ts +17 -0
  71. package/dist/types/components/calendar/use-calendar-drag.d.ts +54 -0
  72. package/dist/types/components/calendar/use-event-keyboard.d.ts +24 -0
  73. package/dist/types/components/calendar/use-grid-navigation.d.ts +47 -0
  74. package/dist/types/components/calendar/use-now.d.ts +20 -0
  75. package/dist/types/components/chat/Attachment.d.ts +49 -0
  76. package/dist/types/components/chat/Chat.d.ts +60 -0
  77. package/dist/types/components/chat/Composer.d.ts +29 -0
  78. package/dist/types/components/chat/ContextMeter.d.ts +55 -0
  79. package/dist/types/components/chat/EffortControl.d.ts +23 -0
  80. package/dist/types/components/chat/Markdown.d.ts +22 -0
  81. package/dist/types/components/chat/Message.d.ts +59 -0
  82. package/dist/types/components/chat/MessageScroller.d.ts +13 -0
  83. package/dist/types/components/chat/ModelSelector.d.ts +44 -0
  84. package/dist/types/components/chat/types.d.ts +155 -0
  85. package/dist/types/components/code-editor/context.d.ts +32 -0
  86. package/dist/types/components/code-editor/editing.d.ts +39 -0
  87. package/dist/types/components/code-editor/highlight.d.ts +20 -0
  88. package/dist/types/components/code-editor/recipe.d.ts +109 -0
  89. package/dist/types/components/code-editor/state.d.ts +14 -0
  90. package/dist/types/components/drag-drop/context.d.ts +45 -0
  91. package/dist/types/components/drag-drop/recipe.d.ts +121 -0
  92. package/dist/types/components/drag-drop/shift.d.ts +66 -0
  93. package/dist/types/components/markdown/Affordances.d.ts +76 -0
  94. package/dist/types/components/rbac/AccountMenu.d.ts +8 -0
  95. package/dist/types/components/rbac/DevToolsPopover.d.ts +5 -0
  96. package/dist/types/components/rbac/ProfilePage.d.ts +1 -0
  97. package/dist/types/components/rbac/RBACProvider.d.ts +64 -0
  98. package/dist/types/components/rbac/RolePermissionMatrix.d.ts +6 -0
  99. package/dist/types/components/rbac/RolesPermissionsPage.d.ts +1 -0
  100. package/dist/types/components/rbac/index.d.ts +7 -0
  101. package/dist/types/components/rbac/types.d.ts +26 -0
  102. package/dist/types/components/roadmap/PhaseManager.d.ts +19 -0
  103. package/dist/types/components/roadmap/RoadmapItemCard.d.ts +45 -0
  104. package/dist/types/components/roadmap/RoadmapPage.d.ts +9 -0
  105. package/dist/types/components/roadmap/RoadmapSwimlaneBoard.d.ts +9 -0
  106. package/dist/types/components/roadmap/UseCaseCard.d.ts +14 -0
  107. package/dist/types/components/roadmap/UseCaseLedgerPage.d.ts +21 -0
  108. package/dist/types/components/roadmap/chip-tones.d.ts +2 -0
  109. package/dist/types/components/roadmap/derive.d.ts +12 -0
  110. package/dist/types/components/roadmap/index.d.ts +9 -0
  111. package/dist/types/components/roadmap/types.d.ts +54 -0
  112. package/dist/types/icons/data.d.ts +1318 -0
  113. package/dist/types/index.d.ts +97 -0
  114. package/dist/types/lib/calendar/band-packer.d.ts +53 -0
  115. package/dist/types/lib/calendar/drag.d.ts +125 -0
  116. package/dist/types/lib/calendar/index.d.ts +4 -0
  117. package/dist/types/lib/calendar/lane-packer.d.ts +88 -0
  118. package/dist/types/lib/calendar/segments.d.ts +91 -0
  119. package/dist/types/lib/calendar/types.d.ts +166 -0
  120. package/dist/types/lib/cn.d.ts +7 -0
  121. package/dist/types/lib/dnd/announce.d.ts +132 -0
  122. package/dist/types/lib/dnd/autoscroll.d.ts +88 -0
  123. package/dist/types/lib/dnd/geometry.d.ts +78 -0
  124. package/dist/types/lib/dnd/index.d.ts +16 -0
  125. package/dist/types/lib/dnd/sensors/gesture.d.ts +37 -0
  126. package/dist/types/lib/dnd/sensors/keyboard.d.ts +50 -0
  127. package/dist/types/lib/dnd/sensors/pointer.d.ts +59 -0
  128. package/dist/types/lib/dnd/session.d.ts +99 -0
  129. package/dist/types/lib/dnd/types.d.ts +162 -0
  130. package/dist/types/lib/dnd/use-drag.d.ts +56 -0
  131. package/dist/types/lib/icons.d.ts +40 -0
  132. package/dist/types/lib/markdown/caret-map.d.ts +48 -0
  133. package/dist/types/lib/markdown/caret.d.ts +6 -0
  134. package/dist/types/lib/markdown/commands.d.ts +170 -0
  135. package/dist/types/lib/markdown/convert.d.ts +82 -0
  136. package/dist/types/lib/markdown/dom.d.ts +67 -0
  137. package/dist/types/lib/markdown/edit.d.ts +16 -0
  138. package/dist/types/lib/markdown/history.d.ts +47 -0
  139. package/dist/types/lib/markdown/hotkeys.d.ts +39 -0
  140. package/dist/types/lib/markdown/input.d.ts +15 -0
  141. package/dist/types/lib/markdown/keys.d.ts +34 -0
  142. package/dist/types/lib/markdown/paste.d.ts +9 -0
  143. package/dist/types/lib/markdown/position.d.ts +43 -0
  144. package/dist/types/lib/markdown/project.d.ts +88 -0
  145. package/dist/types/lib/markdown/reconcile.d.ts +63 -0
  146. package/dist/types/lib/markdown/surface.d.ts +177 -0
  147. package/dist/types/lib/persist.d.ts +40 -0
  148. package/dist/types/lib/preferences.d.ts +80 -0
  149. package/dist/types/lib/sim/createSimStore.d.ts +18 -0
  150. package/dist/types/lib/sim/index.d.ts +5 -0
  151. package/dist/types/lib/sim/latency.d.ts +10 -0
  152. package/dist/types/lib/sim/registry.d.ts +14 -0
  153. package/dist/types/lib/sim/settings.d.ts +11 -0
  154. package/dist/types/lib/sim/types.d.ts +3 -0
  155. package/dist/types/lib/syntax/index.d.ts +16 -0
  156. package/dist/types/lib/syntax/languages/bash.d.ts +1 -0
  157. package/dist/types/lib/syntax/languages/css.d.ts +1 -0
  158. package/dist/types/lib/syntax/languages/html.d.ts +17 -0
  159. package/dist/types/lib/syntax/languages/index.d.ts +33 -0
  160. package/dist/types/lib/syntax/languages/javascript.d.ts +22 -0
  161. package/dist/types/lib/syntax/languages/json.d.ts +1 -0
  162. package/dist/types/lib/syntax/languages/mongodb.d.ts +1 -0
  163. package/dist/types/lib/syntax/languages/plain.d.ts +9 -0
  164. package/dist/types/lib/syntax/languages/sql.d.ts +4 -0
  165. package/dist/types/lib/syntax/languages/vue.d.ts +1 -0
  166. package/dist/types/lib/syntax/languages/yaml.d.ts +1 -0
  167. package/dist/types/lib/syntax/markdown/frames.d.ts +145 -0
  168. package/dist/types/lib/syntax/markdown/grammar.d.ts +1 -0
  169. package/dist/types/lib/syntax/markdown/index.d.ts +4 -0
  170. package/dist/types/lib/syntax/markdown/inline.d.ts +21 -0
  171. package/dist/types/lib/syntax/markdown/parse.d.ts +11 -0
  172. package/dist/types/lib/syntax/markdown/render.d.ts +19 -0
  173. package/dist/types/lib/syntax/markdown/spans.d.ts +84 -0
  174. package/dist/types/lib/syntax/markdown/types.d.ts +108 -0
  175. package/dist/types/lib/syntax/registry.d.ts +37 -0
  176. package/dist/types/lib/syntax/tokenize.d.ts +17 -0
  177. package/dist/types/lib/syntax/types.d.ts +119 -0
  178. package/dist/types/lib/time/index.d.ts +3 -0
  179. package/dist/types/lib/time/plain.d.ts +61 -0
  180. package/dist/types/lib/time/types.d.ts +87 -0
  181. package/dist/types/lib/time/zone.d.ts +97 -0
  182. package/dist/types/lib/use-media-query.d.ts +29 -0
  183. package/package.json +130 -0
@@ -0,0 +1,86 @@
1
+ import { type ComponentPropsWithoutRef, type ReactNode, type Ref } from "react";
2
+ import { type CodeEditorView } from "./code-editor/context";
3
+ export type { CodeEditorView } from "./code-editor/context";
4
+ export interface CodeEditorProps extends Omit<ComponentPropsWithoutRef<"div">, "children" | "title" | "onChange"> {
5
+ /** The text, when the consumer owns it. */
6
+ value?: string;
7
+ /** The starting text, when the component owns it. */
8
+ defaultValue?: string;
9
+ /** Called with the whole document after every edit. */
10
+ onValueChange?: (next: string) => void;
11
+ /**
12
+ * No textarea, no editing chrome — a viewer. Defaults to TRUE; see the banner
13
+ * for why that direction and not the other.
14
+ */
15
+ readOnly?: boolean;
16
+ /** Grammar to highlight with. Unknown or absent renders as plain text. */
17
+ language?: string;
18
+ /** Caption for the toolbar — a filename, usually. */
19
+ filename?: string;
20
+ /** Accessible name for the editable surface or the scrollable viewer. */
21
+ label?: string;
22
+ /**
23
+ * Number to print beside the FIRST line. Supplying one is what renders the
24
+ * gutter, so an excerpt lifted from the middle of a file numbers itself
25
+ * honestly and there is no second boolean to disagree with it.
26
+ */
27
+ startLine?: number;
28
+ /** Tallest the surface may grow, in lines, before it scrolls. */
29
+ maxLines?: number;
30
+ /**
31
+ * Start collapsed to this many lines, with a control to open it. Read-only
32
+ * only: collapsing a surface someone is typing into hides their own caret.
33
+ */
34
+ previewLines?: number;
35
+ /** Soft wrap, when the consumer owns it. */
36
+ wrap?: boolean;
37
+ /** Soft wrap at mount, when the component owns it. */
38
+ defaultWrap?: boolean;
39
+ onWrapChange?: (next: boolean) => void;
40
+ /** Presentation, when the consumer owns it. */
41
+ view?: CodeEditorView;
42
+ /** Presentation at mount, when the component owns it. */
43
+ defaultView?: CodeEditorView;
44
+ onViewChange?: (next: CodeEditorView) => void;
45
+ /** What Tab inserts and what auto-indent repeats. */
46
+ indent?: string;
47
+ /** Shown in an empty editable surface. */
48
+ placeholder?: string;
49
+ /**
50
+ * Replaces the default toolbar. Compose `CodeEditorCaption`,
51
+ * `CodeEditorViewSwitch`, `CodeEditorWrapToggle` and `CodeEditorCopyButton`
52
+ * inside a `CodeEditorToolbar` — they read the same context the default one
53
+ * does — or render anything else entirely.
54
+ */
55
+ toolbar?: ReactNode;
56
+ className?: string;
57
+ ref?: Ref<HTMLDivElement>;
58
+ }
59
+ export declare function CodeEditor({ value, defaultValue, onValueChange, readOnly, language, filename, label, startLine, maxLines, previewLines, wrap, defaultWrap, onWrapChange, view, defaultView, onViewChange, indent, placeholder, toolbar, className, ref, ...props }: CodeEditorProps): import("react").JSX.Element;
60
+ export interface CodeEditorToolbarProps {
61
+ children: ReactNode;
62
+ className?: string;
63
+ }
64
+ /** The bar itself. WRAPS rather than scrolls — at 375px the caption drops onto
65
+ its own line instead of pushing the copy button off the screen. */
66
+ export declare function CodeEditorToolbar({ children, className }: CodeEditorToolbarProps): import("react").JSX.Element;
67
+ /** Filename, or the language when there is no filename — whichever names it. */
68
+ export declare function CodeEditorCaption({ className }: {
69
+ className?: string;
70
+ }): import("react").JSX.Element;
71
+ export declare function CodeEditorCopyButton({ className }: {
72
+ className?: string;
73
+ }): import("react").JSX.Element;
74
+ export declare function CodeEditorWrapToggle({ className }: {
75
+ className?: string;
76
+ }): import("react").JSX.Element;
77
+ /**
78
+ * Source / Preview / Split.
79
+ *
80
+ * RENDERS NOTHING when the instance has only one view. A switch with a single
81
+ * position is a control that teaches people it does not work — and that is the
82
+ * configuration being the switch, not a `showViewSwitch` prop.
83
+ */
84
+ export declare function CodeEditorViewSwitch({ className }: {
85
+ className?: string;
86
+ }): import("react").JSX.Element | null;
@@ -0,0 +1,37 @@
1
+ import { type ReactNode, type Ref } from "react";
2
+ import { Combobox as BaseCombobox } from "@base-ui/react/combobox";
3
+ export interface ComboboxProps<Value> extends Omit<BaseCombobox.Root.Props<Value, boolean>, "children"> {
4
+ placeholder?: string;
5
+ /** Shown when the filter matches nothing. */
6
+ emptyMessage?: ReactNode;
7
+ /** Accessible name, when there is no visible label. */
8
+ "aria-label"?: string;
9
+ className?: string;
10
+ children: ReactNode;
11
+ ref?: Ref<HTMLInputElement>;
12
+ }
13
+ export declare function Combobox<Value>({ placeholder, emptyMessage, className, children, ref, "aria-label": ariaLabel, onOpenChange, ...props }: ComboboxProps<Value>): import("react").JSX.Element;
14
+ export interface ComboboxItemProps extends Omit<BaseCombobox.Item.Props, "className"> {
15
+ className?: string;
16
+ ref?: Ref<HTMLDivElement>;
17
+ }
18
+ export declare function ComboboxItem({ className, children, ref, ...props }: ComboboxItemProps): import("react").JSX.Element;
19
+ export interface ComboboxGroupProps {
20
+ /** Prop, not a child component, so a label cannot be placed outside a group. */
21
+ label?: ReactNode;
22
+ children: ReactNode;
23
+ }
24
+ export declare function ComboboxGroup({ label, children }: ComboboxGroupProps): import("react").JSX.Element;
25
+ export interface MultiComboboxProps<Value> extends ComboboxProps<Value> {
26
+ /** How each selected value should read on its chip. */
27
+ renderChip?: (value: Value) => ReactNode;
28
+ }
29
+ /**
30
+ * Multi-select, where the input becomes a chip container.
31
+ *
32
+ * Chips sit INSIDE the field rather than under it. Below the field they push
33
+ * every following control down as selections accumulate, so a form visibly
34
+ * reflows while someone is still choosing — and the chips stop looking like
35
+ * part of the input they belong to.
36
+ */
37
+ export declare function MultiCombobox<Value>({ placeholder, emptyMessage, renderChip, className, children, ref, "aria-label": ariaLabel, onOpenChange, ...props }: MultiComboboxProps<Value>): import("react").JSX.Element;
@@ -0,0 +1,33 @@
1
+ import type { ReactNode } from "react";
2
+ import { type IconName } from "./Icon";
3
+ export type CommandItem = {
4
+ id: string;
5
+ label: string;
6
+ /** Extra words to match against that are not shown — synonyms, old names. */
7
+ keywords?: string;
8
+ description?: string;
9
+ icon?: IconName;
10
+ /** Displayed on the right — "⌘K", "G then D". */
11
+ shortcut?: string;
12
+ group?: string;
13
+ onSelect: () => void;
14
+ };
15
+ export interface CommandPaletteProps {
16
+ items: CommandItem[];
17
+ open: boolean;
18
+ onOpenChange: (open: boolean) => void;
19
+ placeholder?: string;
20
+ emptyMessage?: ReactNode;
21
+ }
22
+ export declare function CommandPalette({ items, open, onOpenChange, placeholder, emptyMessage, }: CommandPaletteProps): import("react").JSX.Element;
23
+ /**
24
+ * Opens the palette on a keyboard shortcut.
25
+ *
26
+ * Bound to ⌘K / Ctrl-K, and deliberately NOT active while a text field has
27
+ * focus unless the modifier is held — a bare-key shortcut that fires mid-
28
+ * sentence is the fastest way to make people distrust an app.
29
+ */
30
+ export declare function useCommandPalette(key?: string): {
31
+ open: boolean;
32
+ setOpen: import("react").Dispatch<import("react").SetStateAction<boolean>>;
33
+ };
@@ -0,0 +1,20 @@
1
+ export type DateRange = {
2
+ from: Date | null;
3
+ to: Date | null;
4
+ };
5
+ export interface DatePickerProps {
6
+ /** A single date, or a range when `range` is set. */
7
+ value?: Date | DateRange | null;
8
+ onValueChange?: (value: Date | DateRange | null) => void;
9
+ range?: boolean;
10
+ min?: Date;
11
+ max?: Date;
12
+ /** Disable specific days — weekends, holidays, taken slots. */
13
+ isDateDisabled?: (date: Date) => boolean;
14
+ placeholder?: string;
15
+ disabled?: boolean;
16
+ /** How the chosen date reads in the trigger. */
17
+ format?: (date: Date) => string;
18
+ className?: string;
19
+ }
20
+ export declare function DatePicker({ value, onValueChange, range, min, max, isDateDisabled, placeholder, disabled, format, className, }: DatePickerProps): import("react").JSX.Element;
@@ -0,0 +1,117 @@
1
+ import type { ReactNode, Ref } from "react";
2
+ import { type VariantProps } from "tailwind-variants";
3
+ declare const dialog: import("tailwind-variants").TVReturnType<{
4
+ size: {
5
+ sm: {
6
+ popup: string;
7
+ };
8
+ md: {
9
+ popup: string;
10
+ };
11
+ lg: {
12
+ popup: string;
13
+ };
14
+ xl: {
15
+ popup: string;
16
+ };
17
+ };
18
+ }, {
19
+ backdrop: string[];
20
+ popup: string[];
21
+ header: string;
22
+ title: string;
23
+ description: string;
24
+ body: string;
25
+ footer: string[];
26
+ }, undefined, {
27
+ size: {
28
+ sm: {
29
+ popup: string;
30
+ };
31
+ md: {
32
+ popup: string;
33
+ };
34
+ lg: {
35
+ popup: string;
36
+ };
37
+ xl: {
38
+ popup: string;
39
+ };
40
+ };
41
+ }, {
42
+ backdrop: string[];
43
+ popup: string[];
44
+ header: string;
45
+ title: string;
46
+ description: string;
47
+ body: string;
48
+ footer: string[];
49
+ }, import("tailwind-variants").TVReturnTypeLike<{
50
+ size: {
51
+ sm: {
52
+ popup: string;
53
+ };
54
+ md: {
55
+ popup: string;
56
+ };
57
+ lg: {
58
+ popup: string;
59
+ };
60
+ xl: {
61
+ popup: string;
62
+ };
63
+ };
64
+ }, {
65
+ backdrop: string[];
66
+ popup: string[];
67
+ header: string;
68
+ title: string;
69
+ description: string;
70
+ body: string;
71
+ footer: string[];
72
+ }>>;
73
+ export interface DialogProps extends VariantProps<typeof dialog> {
74
+ /** The control that opens the dialog. Omit for a fully controlled dialog. */
75
+ trigger?: ReactNode;
76
+ open?: boolean;
77
+ onOpenChange?: (open: boolean) => void;
78
+ title: ReactNode;
79
+ description?: ReactNode;
80
+ /** Buttons for the footer. Omit to render no footer at all. */
81
+ actions?: ReactNode;
82
+ /** Hide the corner close button — for a dialog that must be answered. */
83
+ hideClose?: boolean;
84
+ className?: string;
85
+ children?: ReactNode;
86
+ ref?: Ref<HTMLDivElement>;
87
+ }
88
+ export declare function Dialog({ trigger, open, onOpenChange, title, description, actions, hideClose, size, className, children, ref, }: DialogProps): import("react").JSX.Element;
89
+ /** Closes the nearest Dialog. Wrap any button: `<DialogClose>{<Button/>}</DialogClose>`. */
90
+ export declare function DialogClose({ children }: {
91
+ children: ReactNode;
92
+ }): import("react").JSX.Element;
93
+ export interface AlertDialogProps {
94
+ trigger?: ReactNode;
95
+ open?: boolean;
96
+ onOpenChange?: (open: boolean) => void;
97
+ title: ReactNode;
98
+ description?: ReactNode;
99
+ confirmLabel?: string;
100
+ cancelLabel?: string;
101
+ /** Styles the confirm button as destructive. */
102
+ destructive?: boolean;
103
+ loading?: boolean;
104
+ onConfirm?: () => void;
105
+ className?: string;
106
+ ref?: Ref<HTMLDivElement>;
107
+ }
108
+ /**
109
+ * A dialog that must be answered — no outside click, no Escape.
110
+ *
111
+ * The confirm button is the LAST in the footer and the cancel button comes
112
+ * first, which is the reverse of how people often write it. Cancel-first means
113
+ * the pointer travelling in from the panel's content reaches the safe option
114
+ * before the destructive one, and keyboard focus lands on cancel by default.
115
+ */
116
+ export declare function AlertDialog({ trigger, open, onOpenChange, title, description, confirmLabel, cancelLabel, destructive, loading, onConfirm, className, ref, }: AlertDialogProps): import("react").JSX.Element;
117
+ export {};
@@ -0,0 +1,60 @@
1
+ import { type ReactNode } from "react";
2
+ import { type AutoScrollOptions, type ContainerId, type DragAxis, type DragId, type DragSessionCallbacks, type DragStrings } from "../lib/dnd";
3
+ export interface DragDropProps extends DragSessionCallbacks {
4
+ /** Override any subset of the announcement grammar — localisation, or a domain noun. */
5
+ strings?: Partial<DragStrings>;
6
+ /** Tune the edge auto-scroll. It cannot be turned off; see the banner. */
7
+ autoScroll?: AutoScrollOptions;
8
+ className?: string;
9
+ children?: ReactNode;
10
+ }
11
+ export declare function DragDrop({ strings, autoScroll, className, children, ...callbacks }: DragDropProps): import("react").JSX.Element;
12
+ export interface DragDropContainerProps {
13
+ id: ContainerId;
14
+ /**
15
+ * Human name for this container, spoken in every announcement about it —
16
+ * "position 3 of 7 in ToDo". Falls back to the id, which is at least
17
+ * speakable and never right.
18
+ */
19
+ label?: string;
20
+ /**
21
+ * Reorder axis. `"y"` is a column of rows, `"x"` a row of columns. It decides
22
+ * which arrow pair steps inside the container and which moves between
23
+ * containers, which way the siblings part, and which scroll direction the
24
+ * handle leaves alone for a finger.
25
+ *
26
+ * @default "y"
27
+ */
28
+ axis?: DragAxis;
29
+ className?: string;
30
+ children?: ReactNode;
31
+ }
32
+ export declare function DragDropContainer({ id, label, axis, className, children, }: DragDropContainerProps): import("react").JSX.Element;
33
+ export interface DragDropItemProps {
34
+ id: DragId;
35
+ /**
36
+ * Position in the consumer's data for this container. The engine
37
+ * re-registers on every change, so it must be the real index — never the
38
+ * render order of a filtered list.
39
+ */
40
+ index: number;
41
+ /** Human name, spoken in announcements and used to name the handle. */
42
+ label?: string;
43
+ className?: string;
44
+ children?: ReactNode;
45
+ }
46
+ export declare function DragDropItem({ id, index, label, className, children, }: DragDropItemProps): import("react").JSX.Element;
47
+ export interface DragDropHandleProps {
48
+ /** Accessible name. Defaults to `Reorder <the item's label>`. */
49
+ label?: string;
50
+ className?: string;
51
+ /** Defaults to the grip. */
52
+ children?: ReactNode;
53
+ }
54
+ export declare function DragDropHandle({ label, className, children }: DragDropHandleProps): import("react").JSX.Element;
55
+ export interface DragDropOverlayProps {
56
+ /** Renders the carried card. Called only while a card is being carried. */
57
+ children: (id: DragId) => ReactNode;
58
+ className?: string;
59
+ }
60
+ export declare function DragDropOverlay({ children, className }: DragDropOverlayProps): import("react").ReactPortal | null;
@@ -0,0 +1,16 @@
1
+ import { Component, type ErrorInfo, type ReactNode } from "react";
2
+ interface Props {
3
+ children: ReactNode;
4
+ /** Shown in the fallback so the failing region is identifiable at a glance. */
5
+ label?: string;
6
+ }
7
+ interface State {
8
+ error: Error | null;
9
+ }
10
+ export declare class ErrorBoundary extends Component<Props, State> {
11
+ state: State;
12
+ static getDerivedStateFromError(error: Error): State;
13
+ componentDidCatch(error: Error, info: ErrorInfo): void;
14
+ render(): string | number | bigint | boolean | import("react").JSX.Element | Iterable<ReactNode> | Promise<string | number | bigint | boolean | import("react").ReactPortal | import("react").ReactElement<unknown, string | import("react").JSXElementConstructor<any>> | Iterable<ReactNode> | null | undefined> | null | undefined;
15
+ }
16
+ export {};
@@ -0,0 +1,37 @@
1
+ import type { ReactNode, Ref } from "react";
2
+ export interface FieldProps {
3
+ label?: ReactNode;
4
+ /** Helper text. Rendered under the label, and referenced by the control. */
5
+ description?: ReactNode;
6
+ /**
7
+ * An error message. Presence marks the field invalid — one prop rather than
8
+ * a separate `invalid` boolean, because a field that is invalid with no
9
+ * message tells the user nothing, and the two are never legitimately apart.
10
+ */
11
+ error?: ReactNode;
12
+ required?: boolean;
13
+ disabled?: boolean;
14
+ /** Identifies the field in a form submission. */
15
+ name?: string;
16
+ layout?: "stacked" | "inline";
17
+ className?: string;
18
+ children: ReactNode;
19
+ ref?: Ref<HTMLDivElement>;
20
+ }
21
+ export declare function Field({ label, description, error, required, disabled, name, layout, className, children, ref, }: FieldProps): import("react").JSX.Element;
22
+ export interface FieldSetProps {
23
+ legend?: ReactNode;
24
+ description?: ReactNode;
25
+ className?: string;
26
+ children: ReactNode;
27
+ ref?: Ref<HTMLFieldSetElement>;
28
+ }
29
+ /**
30
+ * Groups related fields under a shared legend.
31
+ *
32
+ * A real `<fieldset>` / `<legend>` rather than a heading, because a screen
33
+ * reader announces the legend with EACH control inside it — which is the whole
34
+ * point for a group of radios or a set of related toggles, and is not something
35
+ * a heading can do.
36
+ */
37
+ export declare function FieldSet({ legend, description, className, children, ref }: FieldSetProps): import("react").JSX.Element;
@@ -0,0 +1,22 @@
1
+ import type { ReactNode } from "react";
2
+ export type UploadFile = {
3
+ id: string;
4
+ file: File;
5
+ /** 0–100 while uploading; omit when the caller is not tracking it. */
6
+ progress?: number;
7
+ error?: string;
8
+ };
9
+ export interface FileUploadProps {
10
+ files?: UploadFile[];
11
+ onFilesAdded?: (files: File[]) => void;
12
+ onFileRemoved?: (id: string) => void;
13
+ accept?: string;
14
+ multiple?: boolean;
15
+ /** Bytes. Files over this are rejected with a message naming the limit. */
16
+ maxSize?: number;
17
+ disabled?: boolean;
18
+ label?: ReactNode;
19
+ hint?: ReactNode;
20
+ className?: string;
21
+ }
22
+ export declare function FileUpload({ files, onFilesAdded, onFileRemoved, accept, multiple, maxSize, disabled, label, hint, className, }: FileUploadProps): import("react").JSX.Element;
@@ -0,0 +1,40 @@
1
+ import type { SVGProps } from "react";
2
+ import { type IconNode } from "../lib/icons";
3
+ import type { CoreIconName } from "../icons/data";
4
+ export type IconSize = "xs" | "sm" | "md" | "lg" | "xl";
5
+ /**
6
+ * `(string & {})` keeps the core names as autocomplete suggestions while still
7
+ * accepting anything a consumer registered. Plain `string` would collapse the
8
+ * union and lose the suggestions entirely.
9
+ */
10
+ export type IconName = CoreIconName | (string & {});
11
+ export interface IconProps extends Omit<SVGProps<SVGSVGElement>, "name" | "ref"> {
12
+ /** A registered icon name. Ignored when `node` is given. */
13
+ name?: IconName;
14
+ /** Raw geometry, for an icon that is not worth registering. */
15
+ node?: IconNode;
16
+ size?: IconSize;
17
+ /**
18
+ * An accessible name. Supplying it makes the icon `role="img"`; omitting it
19
+ * marks the icon decorative and hides it from assistive tech.
20
+ *
21
+ * The DEFAULT IS DECORATIVE, and that is the right default: an icon almost
22
+ * always sits beside a label that already carries the meaning, and announcing
23
+ * both makes every button read twice. The exception — an icon that IS the
24
+ * only label — is the case worth typing a prop for.
25
+ */
26
+ label?: string;
27
+ ref?: React.Ref<SVGSVGElement>;
28
+ }
29
+ /**
30
+ * Renders registered icon geometry.
31
+ *
32
+ * Everything is `currentColor` and sized from CSS variables, so an icon inherits
33
+ * both the colour and the size scale of whatever it sits in — no per-call
34
+ * colour prop, and no icon left behind when the user changes the size toggle.
35
+ *
36
+ * `shrink-0` is not a detail: an icon inside a flex row with a long label will
37
+ * otherwise be squeezed into an oval, which is the single most common way icons
38
+ * break in a real layout.
39
+ */
40
+ export declare function Icon({ name, node, size, label, className, style, ref, ...props }: IconProps): import("react").JSX.Element | null;
@@ -0,0 +1,120 @@
1
+ import type { ReactNode, Ref, TextareaHTMLAttributes } from "react";
2
+ import { Input as BaseInput } from "@base-ui/react/input";
3
+ import { type VariantProps } from "tailwind-variants";
4
+ declare const control: import("tailwind-variants").TVReturnType<{
5
+ size: {
6
+ sm: "h-control-sm rounded-md px-3 text-xs";
7
+ md: "h-control-md rounded-md px-3.5 text-sm";
8
+ lg: "h-control-lg rounded-lg px-4 text-md";
9
+ };
10
+ hasLeading: {
11
+ true: "";
12
+ false: "";
13
+ };
14
+ hasTrailing: {
15
+ true: "";
16
+ false: "";
17
+ };
18
+ }, undefined, string[], {
19
+ size: {
20
+ sm: "h-control-sm rounded-md px-3 text-xs";
21
+ md: "h-control-md rounded-md px-3.5 text-sm";
22
+ lg: "h-control-lg rounded-lg px-4 text-md";
23
+ };
24
+ hasLeading: {
25
+ true: "";
26
+ false: "";
27
+ };
28
+ hasTrailing: {
29
+ true: "";
30
+ false: "";
31
+ };
32
+ }, undefined, import("tailwind-variants").TVReturnTypeLike<{
33
+ size: {
34
+ sm: "h-control-sm rounded-md px-3 text-xs";
35
+ md: "h-control-md rounded-md px-3.5 text-sm";
36
+ lg: "h-control-lg rounded-lg px-4 text-md";
37
+ };
38
+ hasLeading: {
39
+ true: "";
40
+ false: "";
41
+ };
42
+ hasTrailing: {
43
+ true: "";
44
+ false: "";
45
+ };
46
+ }, undefined>>;
47
+ export interface InputProps extends Omit<BaseInput.Props, "className" | "render" | "size">, VariantProps<typeof control> {
48
+ className?: string;
49
+ /** Icon or text shown inside the field's leading edge. */
50
+ leading?: ReactNode;
51
+ /** Icon, unit or action shown inside the field's trailing edge. */
52
+ trailing?: ReactNode;
53
+ /**
54
+ * Replaces the trailing adornment with a spinner — for a field doing its own
55
+ * async work (an availability check, a lookup) rather than a form-wide submit.
56
+ */
57
+ loading?: boolean;
58
+ ref?: Ref<HTMLInputElement>;
59
+ }
60
+ export declare function Input({ className, size, leading, trailing, loading, ref, ...props }: InputProps): import("react").JSX.Element;
61
+ declare const textarea: import("tailwind-variants").TVReturnType<{
62
+ size: {
63
+ sm: "rounded-md px-3 py-2 text-xs";
64
+ md: "rounded-md px-3.5 py-2.5 text-sm";
65
+ lg: "rounded-lg px-4 py-3 text-md";
66
+ };
67
+ /**
68
+ * `auto` uses field-sizing, which grows the box with its content with no
69
+ * JS, no hidden mirror element and no scroll-height measuring — the three
70
+ * things every auto-resize textarea implementation has needed until now.
71
+ * Engines without it simply keep the fixed height and a scrollbar, which
72
+ * is the correct graceful degradation.
73
+ */
74
+ resize: {
75
+ none: "resize-none";
76
+ vertical: "resize-y";
77
+ auto: "resize-none field-sizing-content";
78
+ };
79
+ }, undefined, string[], {
80
+ size: {
81
+ sm: "rounded-md px-3 py-2 text-xs";
82
+ md: "rounded-md px-3.5 py-2.5 text-sm";
83
+ lg: "rounded-lg px-4 py-3 text-md";
84
+ };
85
+ /**
86
+ * `auto` uses field-sizing, which grows the box with its content with no
87
+ * JS, no hidden mirror element and no scroll-height measuring — the three
88
+ * things every auto-resize textarea implementation has needed until now.
89
+ * Engines without it simply keep the fixed height and a scrollbar, which
90
+ * is the correct graceful degradation.
91
+ */
92
+ resize: {
93
+ none: "resize-none";
94
+ vertical: "resize-y";
95
+ auto: "resize-none field-sizing-content";
96
+ };
97
+ }, undefined, import("tailwind-variants").TVReturnTypeLike<{
98
+ size: {
99
+ sm: "rounded-md px-3 py-2 text-xs";
100
+ md: "rounded-md px-3.5 py-2.5 text-sm";
101
+ lg: "rounded-lg px-4 py-3 text-md";
102
+ };
103
+ /**
104
+ * `auto` uses field-sizing, which grows the box with its content with no
105
+ * JS, no hidden mirror element and no scroll-height measuring — the three
106
+ * things every auto-resize textarea implementation has needed until now.
107
+ * Engines without it simply keep the fixed height and a scrollbar, which
108
+ * is the correct graceful degradation.
109
+ */
110
+ resize: {
111
+ none: "resize-none";
112
+ vertical: "resize-y";
113
+ auto: "resize-none field-sizing-content";
114
+ };
115
+ }, undefined>>;
116
+ export interface TextareaProps extends Omit<TextareaHTMLAttributes<HTMLTextAreaElement>, "size">, VariantProps<typeof textarea> {
117
+ ref?: Ref<HTMLTextAreaElement>;
118
+ }
119
+ export declare function Textarea({ className, size, resize, rows, ref, ...props }: TextareaProps): import("react").JSX.Element;
120
+ export {};
@@ -0,0 +1,83 @@
1
+ import type { CSSProperties, ReactNode, Ref } from "react";
2
+ import { type VariantProps } from "tailwind-variants";
3
+ declare const skeleton: import("tailwind-variants").TVReturnType<{
4
+ shape: {
5
+ text: "h-[1em] rounded-sm";
6
+ block: "rounded-md";
7
+ circle: "aspect-square rounded-full";
8
+ pill: "rounded-full";
9
+ };
10
+ sweep: {
11
+ true: "dx-sweep animate-none";
12
+ false: "";
13
+ };
14
+ }, undefined, string[], {
15
+ shape: {
16
+ text: "h-[1em] rounded-sm";
17
+ block: "rounded-md";
18
+ circle: "aspect-square rounded-full";
19
+ pill: "rounded-full";
20
+ };
21
+ sweep: {
22
+ true: "dx-sweep animate-none";
23
+ false: "";
24
+ };
25
+ }, undefined, import("tailwind-variants").TVReturnTypeLike<{
26
+ shape: {
27
+ text: "h-[1em] rounded-sm";
28
+ block: "rounded-md";
29
+ circle: "aspect-square rounded-full";
30
+ pill: "rounded-full";
31
+ };
32
+ sweep: {
33
+ true: "dx-sweep animate-none";
34
+ false: "";
35
+ };
36
+ }, undefined>>;
37
+ export interface SkeletonProps extends VariantProps<typeof skeleton> {
38
+ className?: string;
39
+ width?: string | number;
40
+ height?: string | number;
41
+ style?: CSSProperties;
42
+ ref?: Ref<HTMLSpanElement>;
43
+ }
44
+ export declare function Skeleton({ shape, sweep, className, width, height, style, ref }: SkeletonProps): import("react").JSX.Element;
45
+ export interface SkeletonTextProps {
46
+ /** How many lines to draw. */
47
+ lines?: number;
48
+ className?: string;
49
+ }
50
+ /**
51
+ * A paragraph-shaped skeleton.
52
+ *
53
+ * The last line is short. That single detail is what makes it read as text
54
+ * rather than as a stack of bars — every real paragraph ends mid-line, and a
55
+ * block of equal-length bars reads as a table.
56
+ */
57
+ export declare function SkeletonText({ lines, className }: SkeletonTextProps): import("react").JSX.Element;
58
+ export interface LoadingOverlayProps {
59
+ /** Whether the overlay is showing. */
60
+ active: boolean;
61
+ /** Text inside the card. Keep it short — it sits over content being read. */
62
+ message?: ReactNode;
63
+ children: ReactNode;
64
+ className?: string;
65
+ }
66
+ /**
67
+ * Dims existing content and floats a card over it while that content is being
68
+ * replaced.
69
+ *
70
+ * TWO DETAILS DO THE REAL WORK.
71
+ *
72
+ * The veil is `inert`, not `pointer-events: none`. Blocking the mouse alone
73
+ * leaves every control underneath reachable by Tab and clickable by Enter, so
74
+ * a keyboard user can act on data that is mid-replacement — which is exactly
75
+ * the race the overlay exists to prevent. `inert` removes the subtree from the
76
+ * tab order and the accessibility tree together.
77
+ *
78
+ * The card is OPAQUE while the veil is translucent. A translucent card over
79
+ * translucent content produces text over text, which is unreadable at
80
+ * precisely the moment someone is trying to work out what is happening.
81
+ */
82
+ export declare function LoadingOverlay({ active, message, children, className }: LoadingOverlayProps): import("react").JSX.Element;
83
+ export {};