@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.
- package/LICENSE +21 -0
- package/README.md +126 -0
- package/dist/fonts/bricolage-grotesque-0.woff2 +0 -0
- package/dist/fonts/bricolage-grotesque-1.woff2 +0 -0
- package/dist/fonts/bricolage-grotesque-2.woff2 +0 -0
- package/dist/fonts/figtree-0.woff2 +0 -0
- package/dist/fonts/figtree-1.woff2 +0 -0
- package/dist/fonts/figtree-2.woff2 +0 -0
- package/dist/fonts/figtree-3.woff2 +0 -0
- package/dist/fonts/jetbrains-mono-0.woff2 +0 -0
- package/dist/fonts/jetbrains-mono-1.woff2 +0 -0
- package/dist/fonts/jetbrains-mono-10.woff2 +0 -0
- package/dist/fonts/jetbrains-mono-11.woff2 +0 -0
- package/dist/fonts/jetbrains-mono-2.woff2 +0 -0
- package/dist/fonts/jetbrains-mono-3.woff2 +0 -0
- package/dist/fonts/jetbrains-mono-4.woff2 +0 -0
- package/dist/fonts/jetbrains-mono-5.woff2 +0 -0
- package/dist/fonts/jetbrains-mono-6.woff2 +0 -0
- package/dist/fonts/jetbrains-mono-7.woff2 +0 -0
- package/dist/fonts/jetbrains-mono-8.woff2 +0 -0
- package/dist/fonts/jetbrains-mono-9.woff2 +0 -0
- package/dist/fonts.css +187 -0
- package/dist/index.js +42425 -0
- package/dist/index.js.map +1 -0
- package/dist/styles.css +190 -0
- package/dist/types/components/Accordion.d.ts +15 -0
- package/dist/types/components/AppShell.d.ts +58 -0
- package/dist/types/components/Avatar.d.ts +154 -0
- package/dist/types/components/Badge.d.ts +73 -0
- package/dist/types/components/Button.d.ts +103 -0
- package/dist/types/components/Card.d.ts +193 -0
- package/dist/types/components/Choice.d.ts +112 -0
- package/dist/types/components/CodeEditor.d.ts +86 -0
- package/dist/types/components/Combobox.d.ts +37 -0
- package/dist/types/components/CommandPalette.d.ts +33 -0
- package/dist/types/components/DatePicker.d.ts +20 -0
- package/dist/types/components/Dialog.d.ts +117 -0
- package/dist/types/components/DragDrop.d.ts +60 -0
- package/dist/types/components/ErrorBoundary.d.ts +16 -0
- package/dist/types/components/Field.d.ts +37 -0
- package/dist/types/components/FileUpload.d.ts +22 -0
- package/dist/types/components/Icon.d.ts +40 -0
- package/dist/types/components/Input.d.ts +120 -0
- package/dist/types/components/Loading.d.ts +83 -0
- package/dist/types/components/MarkdownEditor.d.ts +24 -0
- package/dist/types/components/Menu.d.ts +57 -0
- package/dist/types/components/Navigation.d.ts +46 -0
- package/dist/types/components/NumberInput.d.ts +88 -0
- package/dist/types/components/OTPInput.d.ts +11 -0
- package/dist/types/components/Panel.d.ts +94 -0
- package/dist/types/components/Popover.d.ts +64 -0
- package/dist/types/components/Progress.d.ts +178 -0
- package/dist/types/components/Select.d.ts +53 -0
- package/dist/types/components/Slider.d.ts +203 -0
- package/dist/types/components/Spinner.d.ts +29 -0
- package/dist/types/components/Stat.d.ts +98 -0
- package/dist/types/components/StatusSelect.d.ts +23 -0
- package/dist/types/components/Surface.d.ts +110 -0
- package/dist/types/components/Table.d.ts +46 -0
- package/dist/types/components/Tabs.d.ts +84 -0
- package/dist/types/components/ThemeMenu.d.ts +4 -0
- package/dist/types/components/Toast.d.ts +46 -0
- package/dist/types/components/Toggle.d.ts +65 -0
- package/dist/types/components/Tree.d.ts +20 -0
- package/dist/types/components/calendar/CalendarMonth.d.ts +33 -0
- package/dist/types/components/calendar/CalendarTimeGrid.d.ts +75 -0
- package/dist/types/components/calendar/EventActions.d.ts +17 -0
- package/dist/types/components/calendar/format.d.ts +43 -0
- package/dist/types/components/calendar/index.d.ts +9 -0
- package/dist/types/components/calendar/palette.d.ts +17 -0
- package/dist/types/components/calendar/use-calendar-drag.d.ts +54 -0
- package/dist/types/components/calendar/use-event-keyboard.d.ts +24 -0
- package/dist/types/components/calendar/use-grid-navigation.d.ts +47 -0
- package/dist/types/components/calendar/use-now.d.ts +20 -0
- package/dist/types/components/chat/Attachment.d.ts +49 -0
- package/dist/types/components/chat/Chat.d.ts +60 -0
- package/dist/types/components/chat/Composer.d.ts +29 -0
- package/dist/types/components/chat/ContextMeter.d.ts +55 -0
- package/dist/types/components/chat/EffortControl.d.ts +23 -0
- package/dist/types/components/chat/Markdown.d.ts +22 -0
- package/dist/types/components/chat/Message.d.ts +59 -0
- package/dist/types/components/chat/MessageScroller.d.ts +13 -0
- package/dist/types/components/chat/ModelSelector.d.ts +44 -0
- package/dist/types/components/chat/types.d.ts +155 -0
- package/dist/types/components/code-editor/context.d.ts +32 -0
- package/dist/types/components/code-editor/editing.d.ts +39 -0
- package/dist/types/components/code-editor/highlight.d.ts +20 -0
- package/dist/types/components/code-editor/recipe.d.ts +109 -0
- package/dist/types/components/code-editor/state.d.ts +14 -0
- package/dist/types/components/drag-drop/context.d.ts +45 -0
- package/dist/types/components/drag-drop/recipe.d.ts +121 -0
- package/dist/types/components/drag-drop/shift.d.ts +66 -0
- package/dist/types/components/markdown/Affordances.d.ts +76 -0
- package/dist/types/components/rbac/AccountMenu.d.ts +8 -0
- package/dist/types/components/rbac/DevToolsPopover.d.ts +5 -0
- package/dist/types/components/rbac/ProfilePage.d.ts +1 -0
- package/dist/types/components/rbac/RBACProvider.d.ts +64 -0
- package/dist/types/components/rbac/RolePermissionMatrix.d.ts +6 -0
- package/dist/types/components/rbac/RolesPermissionsPage.d.ts +1 -0
- package/dist/types/components/rbac/index.d.ts +7 -0
- package/dist/types/components/rbac/types.d.ts +26 -0
- package/dist/types/components/roadmap/PhaseManager.d.ts +19 -0
- package/dist/types/components/roadmap/RoadmapItemCard.d.ts +45 -0
- package/dist/types/components/roadmap/RoadmapPage.d.ts +9 -0
- package/dist/types/components/roadmap/RoadmapSwimlaneBoard.d.ts +9 -0
- package/dist/types/components/roadmap/UseCaseCard.d.ts +14 -0
- package/dist/types/components/roadmap/UseCaseLedgerPage.d.ts +21 -0
- package/dist/types/components/roadmap/chip-tones.d.ts +2 -0
- package/dist/types/components/roadmap/derive.d.ts +12 -0
- package/dist/types/components/roadmap/index.d.ts +9 -0
- package/dist/types/components/roadmap/types.d.ts +54 -0
- package/dist/types/icons/data.d.ts +1318 -0
- package/dist/types/index.d.ts +97 -0
- package/dist/types/lib/calendar/band-packer.d.ts +53 -0
- package/dist/types/lib/calendar/drag.d.ts +125 -0
- package/dist/types/lib/calendar/index.d.ts +4 -0
- package/dist/types/lib/calendar/lane-packer.d.ts +88 -0
- package/dist/types/lib/calendar/segments.d.ts +91 -0
- package/dist/types/lib/calendar/types.d.ts +166 -0
- package/dist/types/lib/cn.d.ts +7 -0
- package/dist/types/lib/dnd/announce.d.ts +132 -0
- package/dist/types/lib/dnd/autoscroll.d.ts +88 -0
- package/dist/types/lib/dnd/geometry.d.ts +78 -0
- package/dist/types/lib/dnd/index.d.ts +16 -0
- package/dist/types/lib/dnd/sensors/gesture.d.ts +37 -0
- package/dist/types/lib/dnd/sensors/keyboard.d.ts +50 -0
- package/dist/types/lib/dnd/sensors/pointer.d.ts +59 -0
- package/dist/types/lib/dnd/session.d.ts +99 -0
- package/dist/types/lib/dnd/types.d.ts +162 -0
- package/dist/types/lib/dnd/use-drag.d.ts +56 -0
- package/dist/types/lib/icons.d.ts +40 -0
- package/dist/types/lib/markdown/caret-map.d.ts +48 -0
- package/dist/types/lib/markdown/caret.d.ts +6 -0
- package/dist/types/lib/markdown/commands.d.ts +170 -0
- package/dist/types/lib/markdown/convert.d.ts +82 -0
- package/dist/types/lib/markdown/dom.d.ts +67 -0
- package/dist/types/lib/markdown/edit.d.ts +16 -0
- package/dist/types/lib/markdown/history.d.ts +47 -0
- package/dist/types/lib/markdown/hotkeys.d.ts +39 -0
- package/dist/types/lib/markdown/input.d.ts +15 -0
- package/dist/types/lib/markdown/keys.d.ts +34 -0
- package/dist/types/lib/markdown/paste.d.ts +9 -0
- package/dist/types/lib/markdown/position.d.ts +43 -0
- package/dist/types/lib/markdown/project.d.ts +88 -0
- package/dist/types/lib/markdown/reconcile.d.ts +63 -0
- package/dist/types/lib/markdown/surface.d.ts +177 -0
- package/dist/types/lib/persist.d.ts +40 -0
- package/dist/types/lib/preferences.d.ts +80 -0
- package/dist/types/lib/sim/createSimStore.d.ts +18 -0
- package/dist/types/lib/sim/index.d.ts +5 -0
- package/dist/types/lib/sim/latency.d.ts +10 -0
- package/dist/types/lib/sim/registry.d.ts +14 -0
- package/dist/types/lib/sim/settings.d.ts +11 -0
- package/dist/types/lib/sim/types.d.ts +3 -0
- package/dist/types/lib/syntax/index.d.ts +16 -0
- package/dist/types/lib/syntax/languages/bash.d.ts +1 -0
- package/dist/types/lib/syntax/languages/css.d.ts +1 -0
- package/dist/types/lib/syntax/languages/html.d.ts +17 -0
- package/dist/types/lib/syntax/languages/index.d.ts +33 -0
- package/dist/types/lib/syntax/languages/javascript.d.ts +22 -0
- package/dist/types/lib/syntax/languages/json.d.ts +1 -0
- package/dist/types/lib/syntax/languages/mongodb.d.ts +1 -0
- package/dist/types/lib/syntax/languages/plain.d.ts +9 -0
- package/dist/types/lib/syntax/languages/sql.d.ts +4 -0
- package/dist/types/lib/syntax/languages/vue.d.ts +1 -0
- package/dist/types/lib/syntax/languages/yaml.d.ts +1 -0
- package/dist/types/lib/syntax/markdown/frames.d.ts +145 -0
- package/dist/types/lib/syntax/markdown/grammar.d.ts +1 -0
- package/dist/types/lib/syntax/markdown/index.d.ts +4 -0
- package/dist/types/lib/syntax/markdown/inline.d.ts +21 -0
- package/dist/types/lib/syntax/markdown/parse.d.ts +11 -0
- package/dist/types/lib/syntax/markdown/render.d.ts +19 -0
- package/dist/types/lib/syntax/markdown/spans.d.ts +84 -0
- package/dist/types/lib/syntax/markdown/types.d.ts +108 -0
- package/dist/types/lib/syntax/registry.d.ts +37 -0
- package/dist/types/lib/syntax/tokenize.d.ts +17 -0
- package/dist/types/lib/syntax/types.d.ts +119 -0
- package/dist/types/lib/time/index.d.ts +3 -0
- package/dist/types/lib/time/plain.d.ts +61 -0
- package/dist/types/lib/time/types.d.ts +87 -0
- package/dist/types/lib/time/zone.d.ts +97 -0
- package/dist/types/lib/use-media-query.d.ts +29 -0
- package/package.json +130 -0
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { type ReactNode } from "react";
|
|
2
|
+
export interface MarkdownEditorProps {
|
|
3
|
+
/** The markdown. Controlled when `onChange` is given. */
|
|
4
|
+
value: string;
|
|
5
|
+
onChange?: (value: string) => void;
|
|
6
|
+
/**
|
|
7
|
+
* Read-only surfaces are not editable at all — not a disabled editor.
|
|
8
|
+
*
|
|
9
|
+
* Same reasoning as `CodeEditor`: a `value` with no change handler on an
|
|
10
|
+
* editable surface is the React controlled-input trap, where the field
|
|
11
|
+
* silently refuses every keystroke and nothing reports why.
|
|
12
|
+
*/
|
|
13
|
+
readOnly?: boolean;
|
|
14
|
+
/** Accessible name. Rendered visibly unless `hideLabel`. */
|
|
15
|
+
label: string;
|
|
16
|
+
hideLabel?: boolean;
|
|
17
|
+
placeholder?: string;
|
|
18
|
+
/** Extra toolbar content, after the built-in groups. */
|
|
19
|
+
toolbar?: ReactNode;
|
|
20
|
+
className?: string;
|
|
21
|
+
/** Height of the editable area. Grows with content when omitted. */
|
|
22
|
+
minHeight?: number | string;
|
|
23
|
+
}
|
|
24
|
+
export declare function MarkdownEditor({ value, onChange, readOnly, label, hideLabel, placeholder, toolbar, className, minHeight, }: MarkdownEditorProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import type { ReactNode, Ref } from "react";
|
|
2
|
+
import { Menu as BaseMenu } from "@base-ui/react/menu";
|
|
3
|
+
export interface MenuProps {
|
|
4
|
+
/** The control that opens the menu. */
|
|
5
|
+
trigger: ReactNode;
|
|
6
|
+
/** Which side of the trigger the popup prefers. */
|
|
7
|
+
side?: "top" | "bottom" | "left" | "right";
|
|
8
|
+
/** How the popup lines up along that side. */
|
|
9
|
+
align?: "start" | "center" | "end";
|
|
10
|
+
/**
|
|
11
|
+
* Controlled open state.
|
|
12
|
+
*
|
|
13
|
+
* Not decoration: a menu that advertises a keyboard shortcut has to know
|
|
14
|
+
* when it is open in order to honour it, and a caller cannot listen for a
|
|
15
|
+
* key that only applies while a popup it cannot see is showing.
|
|
16
|
+
*/
|
|
17
|
+
open?: boolean;
|
|
18
|
+
onOpenChange?: (open: boolean) => void;
|
|
19
|
+
className?: string;
|
|
20
|
+
children: ReactNode;
|
|
21
|
+
}
|
|
22
|
+
export declare function Menu({ trigger, side, align, open, onOpenChange, className, children, }: MenuProps): import("react").JSX.Element;
|
|
23
|
+
export interface MenuItemProps extends Omit<BaseMenu.Item.Props, "className"> {
|
|
24
|
+
className?: string;
|
|
25
|
+
/**
|
|
26
|
+
* Marks this row as the current choice among alternatives.
|
|
27
|
+
*
|
|
28
|
+
* For menus that ARE a choice but are not a radio group — a model picker
|
|
29
|
+
* that draws its own tick, say. Without it the only signal is the tick, and
|
|
30
|
+
* a tick is not a state a pointer can see it is already on.
|
|
31
|
+
*/
|
|
32
|
+
selected?: boolean;
|
|
33
|
+
ref?: Ref<HTMLDivElement>;
|
|
34
|
+
}
|
|
35
|
+
export declare function MenuItem({ className, selected, children, ref, ...props }: MenuItemProps): import("react").JSX.Element;
|
|
36
|
+
export interface MenuRadioGroupProps extends Omit<BaseMenu.RadioGroup.Props, "className"> {
|
|
37
|
+
className?: string;
|
|
38
|
+
}
|
|
39
|
+
/** Single-choice group — for a setting rather than a list of actions. */
|
|
40
|
+
export declare function MenuRadioGroup({ className, children, ...props }: MenuRadioGroupProps): import("react").JSX.Element;
|
|
41
|
+
export interface MenuRadioItemProps extends Omit<BaseMenu.RadioItem.Props, "className"> {
|
|
42
|
+
className?: string;
|
|
43
|
+
ref?: Ref<HTMLDivElement>;
|
|
44
|
+
}
|
|
45
|
+
export declare function MenuRadioItem({ className, children, ref, ...props }: MenuRadioItemProps): import("react").JSX.Element;
|
|
46
|
+
export interface MenuGroupProps {
|
|
47
|
+
/**
|
|
48
|
+
* The group's heading. A prop rather than a child component, so a label
|
|
49
|
+
* cannot be placed outside a group — where it would throw at render.
|
|
50
|
+
*/
|
|
51
|
+
label?: ReactNode;
|
|
52
|
+
children: ReactNode;
|
|
53
|
+
}
|
|
54
|
+
export declare function MenuGroup({ label, children }: MenuGroupProps): import("react").JSX.Element;
|
|
55
|
+
export declare function MenuSeparator({ className }: {
|
|
56
|
+
className?: string;
|
|
57
|
+
}): import("react").JSX.Element;
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import type { ReactNode } from "react";
|
|
2
|
+
export type Crumb = {
|
|
3
|
+
label: ReactNode;
|
|
4
|
+
href?: string;
|
|
5
|
+
onClick?: () => void;
|
|
6
|
+
};
|
|
7
|
+
export interface BreadcrumbProps {
|
|
8
|
+
items: Crumb[];
|
|
9
|
+
/**
|
|
10
|
+
* Collapse the middle when the trail is longer than this.
|
|
11
|
+
*
|
|
12
|
+
* A trail that wraps to two lines has stopped being a trail. Collapsing
|
|
13
|
+
* keeps the two ends — where you came from and where you are — which is the
|
|
14
|
+
* information people actually use; the middle is nearly always scenery.
|
|
15
|
+
*/
|
|
16
|
+
maxItems?: number;
|
|
17
|
+
className?: string;
|
|
18
|
+
}
|
|
19
|
+
export declare function Breadcrumb({ items, maxItems, className }: BreadcrumbProps): import("react").JSX.Element;
|
|
20
|
+
export interface PaginationProps {
|
|
21
|
+
page: number;
|
|
22
|
+
pageCount: number;
|
|
23
|
+
onPageChange: (page: number) => void;
|
|
24
|
+
/**
|
|
25
|
+
* How many numbers to show around the current page.
|
|
26
|
+
*
|
|
27
|
+
* CLAMPED TO 0 BELOW 640px, whatever is passed. Every control in this row is
|
|
28
|
+
* at least 44px wide once the pointer is coarse, so the default window is
|
|
29
|
+
* nine targets plus eight gaps — 428px, which does not fit a 375px phone and
|
|
30
|
+
* pushed the entire page sideways. Fewer numbers is the only thing that can
|
|
31
|
+
* give here: a horizontally scrolling pagination control is a worse answer
|
|
32
|
+
* than a shorter one, because the pages you cannot see are the ones you were
|
|
33
|
+
* looking for.
|
|
34
|
+
*/
|
|
35
|
+
siblings?: number;
|
|
36
|
+
className?: string;
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Numbered pagination with a stable width.
|
|
40
|
+
*
|
|
41
|
+
* The window of page numbers is padded so the control does not change size as
|
|
42
|
+
* you move through it — a row of buttons that grows and shrinks under the
|
|
43
|
+
* pointer makes people misclick, and it is the single most common flaw in
|
|
44
|
+
* hand-rolled pagination.
|
|
45
|
+
*/
|
|
46
|
+
export declare function Pagination({ page, pageCount, onPageChange, siblings, className, }: PaginationProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
import type { Ref } from "react";
|
|
2
|
+
import { NumberField } from "@base-ui/react/number-field";
|
|
3
|
+
import { type VariantProps } from "tailwind-variants";
|
|
4
|
+
declare const numberInput: import("tailwind-variants").TVReturnType<{
|
|
5
|
+
size: {
|
|
6
|
+
sm: {
|
|
7
|
+
group: string;
|
|
8
|
+
input: string;
|
|
9
|
+
stepper: string;
|
|
10
|
+
};
|
|
11
|
+
md: {
|
|
12
|
+
group: string;
|
|
13
|
+
input: string;
|
|
14
|
+
stepper: string;
|
|
15
|
+
};
|
|
16
|
+
lg: {
|
|
17
|
+
group: string;
|
|
18
|
+
input: string;
|
|
19
|
+
stepper: string;
|
|
20
|
+
};
|
|
21
|
+
};
|
|
22
|
+
}, {
|
|
23
|
+
group: string[];
|
|
24
|
+
input: string[];
|
|
25
|
+
stepper: string[];
|
|
26
|
+
scrub: string;
|
|
27
|
+
}, undefined, {
|
|
28
|
+
size: {
|
|
29
|
+
sm: {
|
|
30
|
+
group: string;
|
|
31
|
+
input: string;
|
|
32
|
+
stepper: string;
|
|
33
|
+
};
|
|
34
|
+
md: {
|
|
35
|
+
group: string;
|
|
36
|
+
input: string;
|
|
37
|
+
stepper: string;
|
|
38
|
+
};
|
|
39
|
+
lg: {
|
|
40
|
+
group: string;
|
|
41
|
+
input: string;
|
|
42
|
+
stepper: string;
|
|
43
|
+
};
|
|
44
|
+
};
|
|
45
|
+
}, {
|
|
46
|
+
group: string[];
|
|
47
|
+
input: string[];
|
|
48
|
+
stepper: string[];
|
|
49
|
+
scrub: string;
|
|
50
|
+
}, import("tailwind-variants").TVReturnTypeLike<{
|
|
51
|
+
size: {
|
|
52
|
+
sm: {
|
|
53
|
+
group: string;
|
|
54
|
+
input: string;
|
|
55
|
+
stepper: string;
|
|
56
|
+
};
|
|
57
|
+
md: {
|
|
58
|
+
group: string;
|
|
59
|
+
input: string;
|
|
60
|
+
stepper: string;
|
|
61
|
+
};
|
|
62
|
+
lg: {
|
|
63
|
+
group: string;
|
|
64
|
+
input: string;
|
|
65
|
+
stepper: string;
|
|
66
|
+
};
|
|
67
|
+
};
|
|
68
|
+
}, {
|
|
69
|
+
group: string[];
|
|
70
|
+
input: string[];
|
|
71
|
+
stepper: string[];
|
|
72
|
+
scrub: string;
|
|
73
|
+
}>>;
|
|
74
|
+
export interface NumberInputProps extends Omit<NumberField.Root.Props, "className" | "render">, VariantProps<typeof numberInput> {
|
|
75
|
+
className?: string;
|
|
76
|
+
/** Hide the +/− buttons — for a field driven by typing or scrubbing alone. */
|
|
77
|
+
hideSteppers?: boolean;
|
|
78
|
+
/**
|
|
79
|
+
* A draggable label. Dragging it left or right changes the value.
|
|
80
|
+
*
|
|
81
|
+
* Worth adding wherever the exact number matters less than the relationship
|
|
82
|
+
* between it and what it affects — a delay, a threshold, a weight.
|
|
83
|
+
*/
|
|
84
|
+
scrubLabel?: string;
|
|
85
|
+
ref?: Ref<HTMLDivElement>;
|
|
86
|
+
}
|
|
87
|
+
export declare function NumberInput({ size, className, hideSteppers, scrubLabel, ref, ...props }: NumberInputProps): import("react").JSX.Element;
|
|
88
|
+
export {};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { Ref } from "react";
|
|
2
|
+
import { OTPField } from "@base-ui/react/otp-field";
|
|
3
|
+
export interface OTPInputProps extends Omit<OTPField.Root.Props, "className" | "render" | "length"> {
|
|
4
|
+
/** How many characters. 6 is the near-universal default. */
|
|
5
|
+
length?: number;
|
|
6
|
+
/** Draw a gap after this many characters — "123 456" reads faster than "123456". */
|
|
7
|
+
groupAfter?: number;
|
|
8
|
+
className?: string;
|
|
9
|
+
ref?: Ref<HTMLDivElement>;
|
|
10
|
+
}
|
|
11
|
+
export declare function OTPInput({ length, groupAfter, className, ref, ...props }: OTPInputProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
import { type ReactNode, type Ref } from "react";
|
|
2
|
+
import { type Breakpoint } from "../lib/use-media-query";
|
|
3
|
+
export type PanelDirection = "horizontal" | "vertical";
|
|
4
|
+
/** What a group turns into below its narrow breakpoint. */
|
|
5
|
+
export type PanelNarrowMode = "tabs" | "stack";
|
|
6
|
+
type Sizes = Record<string, number>;
|
|
7
|
+
export interface PanelGroupProps {
|
|
8
|
+
children: ReactNode;
|
|
9
|
+
direction?: PanelDirection;
|
|
10
|
+
/**
|
|
11
|
+
* Below this width the group stops being a splitter. `narrowMode` decides
|
|
12
|
+
* what it becomes; either way splitters are not rendered and stored sizes are
|
|
13
|
+
* ignored until the width comes back.
|
|
14
|
+
*
|
|
15
|
+
* A SPLITTER IS A POINTER AFFORDANCE, and phone width has neither the room
|
|
16
|
+
* nor the precision for it. Left as a splitter, a two-pane chat at 375px
|
|
17
|
+
* gives each pane about 170px: prose wraps one word per line and the buttons
|
|
18
|
+
* inside it collide. That is not a narrower version of the layout, it is a
|
|
19
|
+
* broken one.
|
|
20
|
+
*
|
|
21
|
+
* Defaults to `md` (768px) — a portrait tablet is the last width where two
|
|
22
|
+
* panes and a splitter between them still leave each pane a readable column.
|
|
23
|
+
* Pass `false` for a group that genuinely must stay split at every width.
|
|
24
|
+
*/
|
|
25
|
+
narrowBelow?: Breakpoint | false;
|
|
26
|
+
/**
|
|
27
|
+
* What the group becomes below `narrowBelow`.
|
|
28
|
+
*
|
|
29
|
+
* TABS is the default, for panes a person moves BETWEEN — a conversation and
|
|
30
|
+
* the thing it is about. Only one of those is being read at any moment, so
|
|
31
|
+
* giving the active one the whole screen and charging a tap to switch costs
|
|
32
|
+
* nothing and keeps both reachable at a fixed place on screen.
|
|
33
|
+
*
|
|
34
|
+
* STACK is for panes read TOGETHER, where scrolling out of one and into the
|
|
35
|
+
* next is the point. Tabs there hide half the content behind a control the
|
|
36
|
+
* reader has no reason to expect, and the two halves can no longer be
|
|
37
|
+
* compared at all.
|
|
38
|
+
*/
|
|
39
|
+
narrowMode?: PanelNarrowMode;
|
|
40
|
+
/**
|
|
41
|
+
* Remembers this group's layout under `danxbot-<persistId>`.
|
|
42
|
+
*
|
|
43
|
+
* A layout stored against a different set of panels is DISCARDED, not merged:
|
|
44
|
+
* ids are compared as a set on mount, and any mismatch falls back to the
|
|
45
|
+
* defaults and clears the entry. Merging would produce a broken layout that
|
|
46
|
+
* survives every refresh, because it keeps getting written back — the one
|
|
47
|
+
* failure a person cannot fix by dragging.
|
|
48
|
+
*/
|
|
49
|
+
persistId?: string;
|
|
50
|
+
onLayout?: (sizes: Sizes) => void;
|
|
51
|
+
className?: string;
|
|
52
|
+
ref?: Ref<HTMLDivElement>;
|
|
53
|
+
}
|
|
54
|
+
export declare function PanelGroup({ children, direction, narrowBelow, narrowMode, persistId, onLayout, className, ref, }: PanelGroupProps): import("react").JSX.Element;
|
|
55
|
+
export interface PanelProps {
|
|
56
|
+
children: ReactNode;
|
|
57
|
+
/** Stable identity — the key its size persists under. Required precisely so
|
|
58
|
+
a remembered layout can be matched against the panels that exist now. */
|
|
59
|
+
id: string;
|
|
60
|
+
/** The panel's name on its tab, once the group is narrow enough to show one.
|
|
61
|
+
Falls back to `id`, which is readable often enough to be a useful default
|
|
62
|
+
and obviously wrong when it is not. */
|
|
63
|
+
label?: string;
|
|
64
|
+
/** Percent of the group. Omitted panels split whatever is left over. */
|
|
65
|
+
defaultSize?: number;
|
|
66
|
+
minSize?: number;
|
|
67
|
+
maxSize?: number;
|
|
68
|
+
collapsible?: boolean;
|
|
69
|
+
collapsedSize?: number;
|
|
70
|
+
className?: string;
|
|
71
|
+
ref?: Ref<HTMLDivElement>;
|
|
72
|
+
}
|
|
73
|
+
export declare function Panel({ children, id, label, defaultSize, minSize, maxSize, collapsible, collapsedSize, className, ref, }: PanelProps): import("react").JSX.Element;
|
|
74
|
+
export interface PanelResizerProps {
|
|
75
|
+
/** Names the splitter for screen readers — "Sidebar width", not "separator". */
|
|
76
|
+
label: string;
|
|
77
|
+
/** Percent moved per arrow key. */
|
|
78
|
+
step?: number;
|
|
79
|
+
/** Shows a grip so the splitter reads as draggable rather than decorative. */
|
|
80
|
+
withGrip?: boolean;
|
|
81
|
+
disabled?: boolean;
|
|
82
|
+
className?: string;
|
|
83
|
+
ref?: Ref<HTMLDivElement>;
|
|
84
|
+
}
|
|
85
|
+
/**
|
|
86
|
+
* The draggable divider.
|
|
87
|
+
*
|
|
88
|
+
* `role="separator"` with `tabindex="0"` is the WAI-ARIA window splitter: the
|
|
89
|
+
* one case where a separator is interactive. Keyboard support is not a bonus
|
|
90
|
+
* here — a pointer-only splitter is unusable for anyone who cannot drag, and
|
|
91
|
+
* "drag" is the entire interaction.
|
|
92
|
+
*/
|
|
93
|
+
export declare function PanelResizer({ label, step, withGrip, disabled, className, ref, }: PanelResizerProps): import("react").JSX.Element | null;
|
|
94
|
+
export {};
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import type { ReactNode, Ref } from "react";
|
|
2
|
+
export interface PopoverProps {
|
|
3
|
+
trigger: ReactNode;
|
|
4
|
+
side?: "top" | "bottom" | "left" | "right";
|
|
5
|
+
align?: "start" | "center" | "end";
|
|
6
|
+
/** Draws the little pointer at the trigger. Off by default — see below. */
|
|
7
|
+
arrow?: boolean;
|
|
8
|
+
className?: string;
|
|
9
|
+
children: ReactNode;
|
|
10
|
+
ref?: Ref<HTMLDivElement>;
|
|
11
|
+
/**
|
|
12
|
+
* Render open on mount. Uncontrolled — the popover still closes on its own
|
|
13
|
+
* afterwards; this only decides the starting state.
|
|
14
|
+
*
|
|
15
|
+
* `Menu` already forwarded its open state and consequently had a preview
|
|
16
|
+
* card showing a real open menu, while these two showed a picture of a
|
|
17
|
+
* button. Consistency across the three overlays is the point; a static
|
|
18
|
+
* documentation surface cannot dispatch a click.
|
|
19
|
+
*/
|
|
20
|
+
defaultOpen?: boolean;
|
|
21
|
+
}
|
|
22
|
+
export declare function Popover({ trigger, side, align, arrow, className, children, ref, defaultOpen, }: PopoverProps): import("react").JSX.Element;
|
|
23
|
+
/** Closes the nearest Popover. */
|
|
24
|
+
export declare function PopoverClose({ children }: {
|
|
25
|
+
children: ReactNode;
|
|
26
|
+
}): import("react").JSX.Element;
|
|
27
|
+
export interface TooltipProps {
|
|
28
|
+
/** The label. Plain text — anything interactive belongs in a Popover. */
|
|
29
|
+
content: ReactNode;
|
|
30
|
+
children: ReactNode;
|
|
31
|
+
side?: "top" | "bottom" | "left" | "right";
|
|
32
|
+
className?: string;
|
|
33
|
+
/**
|
|
34
|
+
* Render open on mount, without a hover. For documentation surfaces and
|
|
35
|
+
* static captures — a tooltip nobody is pointing at is otherwise invisible,
|
|
36
|
+
* so a preview card of one shows an unexplained button.
|
|
37
|
+
*/
|
|
38
|
+
defaultOpen?: boolean;
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Hover delay is set once on `TooltipProvider`, not per tooltip — that is where
|
|
42
|
+
* Base UI keeps it, and it is the right place: the delay only means anything
|
|
43
|
+
* relative to the OTHER tooltips nearby.
|
|
44
|
+
*/
|
|
45
|
+
export declare function Tooltip({ content, children, side, className, defaultOpen }: TooltipProps): import("react").JSX.Element;
|
|
46
|
+
/**
|
|
47
|
+
* Share hover timing across every tooltip beneath it.
|
|
48
|
+
*
|
|
49
|
+
* Wrap the app once. Without it each tooltip keeps its own timer, so moving
|
|
50
|
+
* between two adjacent icons makes you wait out the full delay twice — the
|
|
51
|
+
* thing that makes tooltips feel broken in dense toolbars.
|
|
52
|
+
*
|
|
53
|
+
* THE DEFAULT IS ZERO. A hover delay exists to stop tooltips firing while the
|
|
54
|
+
* pointer merely crosses a toolbar on its way somewhere else — but the cost is
|
|
55
|
+
* paid by everyone who actually wanted the label, every time, and it is the
|
|
56
|
+
* cost people describe as "the tooltip is slow". These tooltips name controls
|
|
57
|
+
* that are often icon-only, so the label IS the affordance and withholding it
|
|
58
|
+
* for 400ms is withholding the interface. The prop remains for anyone who
|
|
59
|
+
* wants the traditional behaviour back.
|
|
60
|
+
*/
|
|
61
|
+
export declare function TooltipProvider({ children, delay }: {
|
|
62
|
+
children: ReactNode;
|
|
63
|
+
delay?: number;
|
|
64
|
+
}): import("react").JSX.Element;
|
|
@@ -0,0 +1,178 @@
|
|
|
1
|
+
import type { ReactNode, Ref } from "react";
|
|
2
|
+
import { type VariantProps } from "tailwind-variants";
|
|
3
|
+
declare const bar: import("tailwind-variants").TVReturnType<{
|
|
4
|
+
size: {
|
|
5
|
+
sm: {
|
|
6
|
+
track: string;
|
|
7
|
+
};
|
|
8
|
+
md: {
|
|
9
|
+
track: string;
|
|
10
|
+
};
|
|
11
|
+
lg: {
|
|
12
|
+
track: string;
|
|
13
|
+
};
|
|
14
|
+
};
|
|
15
|
+
tone: {
|
|
16
|
+
accent: {
|
|
17
|
+
indicator: string;
|
|
18
|
+
};
|
|
19
|
+
brand: {
|
|
20
|
+
indicator: string;
|
|
21
|
+
};
|
|
22
|
+
success: {
|
|
23
|
+
indicator: string;
|
|
24
|
+
};
|
|
25
|
+
warning: {
|
|
26
|
+
indicator: string;
|
|
27
|
+
};
|
|
28
|
+
danger: {
|
|
29
|
+
indicator: string;
|
|
30
|
+
};
|
|
31
|
+
};
|
|
32
|
+
}, {
|
|
33
|
+
root: string;
|
|
34
|
+
header: string;
|
|
35
|
+
label: string;
|
|
36
|
+
value: string;
|
|
37
|
+
track: string;
|
|
38
|
+
indicator: string[];
|
|
39
|
+
}, undefined, {
|
|
40
|
+
size: {
|
|
41
|
+
sm: {
|
|
42
|
+
track: string;
|
|
43
|
+
};
|
|
44
|
+
md: {
|
|
45
|
+
track: string;
|
|
46
|
+
};
|
|
47
|
+
lg: {
|
|
48
|
+
track: string;
|
|
49
|
+
};
|
|
50
|
+
};
|
|
51
|
+
tone: {
|
|
52
|
+
accent: {
|
|
53
|
+
indicator: string;
|
|
54
|
+
};
|
|
55
|
+
brand: {
|
|
56
|
+
indicator: string;
|
|
57
|
+
};
|
|
58
|
+
success: {
|
|
59
|
+
indicator: string;
|
|
60
|
+
};
|
|
61
|
+
warning: {
|
|
62
|
+
indicator: string;
|
|
63
|
+
};
|
|
64
|
+
danger: {
|
|
65
|
+
indicator: string;
|
|
66
|
+
};
|
|
67
|
+
};
|
|
68
|
+
}, {
|
|
69
|
+
root: string;
|
|
70
|
+
header: string;
|
|
71
|
+
label: string;
|
|
72
|
+
value: string;
|
|
73
|
+
track: string;
|
|
74
|
+
indicator: string[];
|
|
75
|
+
}, import("tailwind-variants").TVReturnTypeLike<{
|
|
76
|
+
size: {
|
|
77
|
+
sm: {
|
|
78
|
+
track: string;
|
|
79
|
+
};
|
|
80
|
+
md: {
|
|
81
|
+
track: string;
|
|
82
|
+
};
|
|
83
|
+
lg: {
|
|
84
|
+
track: string;
|
|
85
|
+
};
|
|
86
|
+
};
|
|
87
|
+
tone: {
|
|
88
|
+
accent: {
|
|
89
|
+
indicator: string;
|
|
90
|
+
};
|
|
91
|
+
brand: {
|
|
92
|
+
indicator: string;
|
|
93
|
+
};
|
|
94
|
+
success: {
|
|
95
|
+
indicator: string;
|
|
96
|
+
};
|
|
97
|
+
warning: {
|
|
98
|
+
indicator: string;
|
|
99
|
+
};
|
|
100
|
+
danger: {
|
|
101
|
+
indicator: string;
|
|
102
|
+
};
|
|
103
|
+
};
|
|
104
|
+
}, {
|
|
105
|
+
root: string;
|
|
106
|
+
header: string;
|
|
107
|
+
label: string;
|
|
108
|
+
value: string;
|
|
109
|
+
track: string;
|
|
110
|
+
indicator: string[];
|
|
111
|
+
}>>;
|
|
112
|
+
export interface ProgressProps extends VariantProps<typeof bar> {
|
|
113
|
+
/** 0–100, or `null` for work of unknown length. */
|
|
114
|
+
value: number | null;
|
|
115
|
+
label?: ReactNode;
|
|
116
|
+
/** Turn the number into what a person should read. */
|
|
117
|
+
format?: (value: number) => string;
|
|
118
|
+
showValue?: boolean;
|
|
119
|
+
className?: string;
|
|
120
|
+
ref?: Ref<HTMLDivElement>;
|
|
121
|
+
}
|
|
122
|
+
export declare function Progress({ value, label, format, showValue, size, tone, className, ref, }: ProgressProps): import("react").JSX.Element;
|
|
123
|
+
export interface MeterProps extends VariantProps<typeof bar> {
|
|
124
|
+
value: number;
|
|
125
|
+
min?: number;
|
|
126
|
+
max?: number;
|
|
127
|
+
label?: ReactNode;
|
|
128
|
+
format?: (value: number) => string;
|
|
129
|
+
showValue?: boolean;
|
|
130
|
+
className?: string;
|
|
131
|
+
ref?: Ref<HTMLDivElement>;
|
|
132
|
+
}
|
|
133
|
+
/** A gauge: how full something is right now. Never indeterminate. */
|
|
134
|
+
export declare function Meter({ value, min, max, label, format, showValue, size, tone, className, ref, }: MeterProps): import("react").JSX.Element;
|
|
135
|
+
declare const ring: import("tailwind-variants").TVReturnType<{
|
|
136
|
+
size: {
|
|
137
|
+
sm: "size-10";
|
|
138
|
+
md: "size-16";
|
|
139
|
+
lg: "size-24";
|
|
140
|
+
};
|
|
141
|
+
}, undefined, "relative grid shrink-0 place-items-center", {
|
|
142
|
+
size: {
|
|
143
|
+
sm: "size-10";
|
|
144
|
+
md: "size-16";
|
|
145
|
+
lg: "size-24";
|
|
146
|
+
};
|
|
147
|
+
}, undefined, import("tailwind-variants").TVReturnTypeLike<{
|
|
148
|
+
size: {
|
|
149
|
+
sm: "size-10";
|
|
150
|
+
md: "size-16";
|
|
151
|
+
lg: "size-24";
|
|
152
|
+
};
|
|
153
|
+
}, undefined>>;
|
|
154
|
+
export interface ProgressRingProps extends VariantProps<typeof ring> {
|
|
155
|
+
value: number | null;
|
|
156
|
+
/**
|
|
157
|
+
* REQUIRED, and a plain string.
|
|
158
|
+
*
|
|
159
|
+
* The ring draws a bare number in a circle, so unlike the bar it has no
|
|
160
|
+
* visible label to borrow a name from — without this it announces as
|
|
161
|
+
* "progress bar, 64" with no indication of 64 WHAT. Optional here would mean
|
|
162
|
+
* "forgotten most of the time", which the browser scan proved within minutes
|
|
163
|
+
* of this component existing.
|
|
164
|
+
*/
|
|
165
|
+
label: string;
|
|
166
|
+
tone?: VariantProps<typeof bar>["tone"];
|
|
167
|
+
className?: string;
|
|
168
|
+
}
|
|
169
|
+
/**
|
|
170
|
+
* Circular progress, for when the number belongs INSIDE the indicator —
|
|
171
|
+
* a tile, a card corner, a stat.
|
|
172
|
+
*
|
|
173
|
+
* Uses `pathLength="1"` so the dash numbers are fractions rather than
|
|
174
|
+
* circumference maths: the same two values work at any radius, and it dodges
|
|
175
|
+
* the Safari bug where a zoomed SVG rescales absolute dash lengths.
|
|
176
|
+
*/
|
|
177
|
+
export declare function ProgressRing({ value, label, size, tone, className, }: ProgressRingProps): import("react").JSX.Element;
|
|
178
|
+
export {};
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import type { ReactNode, Ref } from "react";
|
|
2
|
+
import { Select as BaseSelect } from "@base-ui/react/select";
|
|
3
|
+
import { type VariantProps } from "tailwind-variants";
|
|
4
|
+
declare const trigger: 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
|
+
}, undefined, string[], {
|
|
11
|
+
size: {
|
|
12
|
+
sm: "h-control-sm rounded-md px-3 text-xs";
|
|
13
|
+
md: "h-control-md rounded-md px-3.5 text-sm";
|
|
14
|
+
lg: "h-control-lg rounded-lg px-4 text-md";
|
|
15
|
+
};
|
|
16
|
+
}, undefined, import("tailwind-variants").TVReturnTypeLike<{
|
|
17
|
+
size: {
|
|
18
|
+
sm: "h-control-sm rounded-md px-3 text-xs";
|
|
19
|
+
md: "h-control-md rounded-md px-3.5 text-sm";
|
|
20
|
+
lg: "h-control-lg rounded-lg px-4 text-md";
|
|
21
|
+
};
|
|
22
|
+
}, undefined>>;
|
|
23
|
+
export interface SelectProps<Value> extends Omit<BaseSelect.Root.Props<Value, boolean>, "children">, VariantProps<typeof trigger> {
|
|
24
|
+
placeholder?: string;
|
|
25
|
+
className?: string;
|
|
26
|
+
/** Accessible name for the trigger when no visible label is present. */
|
|
27
|
+
"aria-label"?: string;
|
|
28
|
+
children: ReactNode;
|
|
29
|
+
ref?: Ref<HTMLButtonElement>;
|
|
30
|
+
}
|
|
31
|
+
export declare function Select<Value>({ size, placeholder, className, children, ref, "aria-label": ariaLabel, ...props }: SelectProps<Value>): import("react").JSX.Element;
|
|
32
|
+
export interface SelectItemProps extends Omit<BaseSelect.Item.Props, "className"> {
|
|
33
|
+
className?: string;
|
|
34
|
+
ref?: Ref<HTMLDivElement>;
|
|
35
|
+
}
|
|
36
|
+
export declare function SelectItem({ className, children, ref, ...props }: SelectItemProps): import("react").JSX.Element;
|
|
37
|
+
export interface SelectGroupProps {
|
|
38
|
+
/**
|
|
39
|
+
* The group's heading.
|
|
40
|
+
*
|
|
41
|
+
* A prop rather than a `<SelectGroupLabel>` child, because the label is only
|
|
42
|
+
* valid INSIDE a group — as a separate exported component it can be placed
|
|
43
|
+
* anywhere and throws at render. Making it a prop makes the misuse
|
|
44
|
+
* unrepresentable, which is how a blank page happened here once.
|
|
45
|
+
*/
|
|
46
|
+
label?: ReactNode;
|
|
47
|
+
children: ReactNode;
|
|
48
|
+
}
|
|
49
|
+
export declare function SelectGroup({ label, children }: SelectGroupProps): import("react").JSX.Element;
|
|
50
|
+
export declare function SelectSeparator({ className }: {
|
|
51
|
+
className?: string;
|
|
52
|
+
}): import("react").JSX.Element;
|
|
53
|
+
export {};
|