@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,203 @@
|
|
|
1
|
+
import type { ReactNode, Ref } from "react";
|
|
2
|
+
import { type VariantProps } from "tailwind-variants";
|
|
3
|
+
declare const slider: import("tailwind-variants").TVReturnType<{
|
|
4
|
+
size: {
|
|
5
|
+
sm: {
|
|
6
|
+
track: string;
|
|
7
|
+
thumb: string;
|
|
8
|
+
};
|
|
9
|
+
md: {
|
|
10
|
+
track: string;
|
|
11
|
+
thumb: string;
|
|
12
|
+
};
|
|
13
|
+
lg: {
|
|
14
|
+
track: string;
|
|
15
|
+
thumb: string;
|
|
16
|
+
};
|
|
17
|
+
};
|
|
18
|
+
tone: {
|
|
19
|
+
accent: {
|
|
20
|
+
indicator: string;
|
|
21
|
+
thumb: string;
|
|
22
|
+
};
|
|
23
|
+
brand: {
|
|
24
|
+
indicator: string;
|
|
25
|
+
thumb: string;
|
|
26
|
+
};
|
|
27
|
+
success: {
|
|
28
|
+
indicator: string;
|
|
29
|
+
thumb: string;
|
|
30
|
+
};
|
|
31
|
+
warning: {
|
|
32
|
+
indicator: string;
|
|
33
|
+
thumb: string;
|
|
34
|
+
};
|
|
35
|
+
danger: {
|
|
36
|
+
indicator: string;
|
|
37
|
+
thumb: string;
|
|
38
|
+
};
|
|
39
|
+
};
|
|
40
|
+
disabled: {
|
|
41
|
+
true: {
|
|
42
|
+
root: string;
|
|
43
|
+
control: string;
|
|
44
|
+
label: string;
|
|
45
|
+
};
|
|
46
|
+
false: {};
|
|
47
|
+
};
|
|
48
|
+
}, {
|
|
49
|
+
root: string;
|
|
50
|
+
header: string;
|
|
51
|
+
label: string;
|
|
52
|
+
readout: string;
|
|
53
|
+
control: string;
|
|
54
|
+
track: string;
|
|
55
|
+
indicator: string;
|
|
56
|
+
thumb: string[];
|
|
57
|
+
marks: string;
|
|
58
|
+
markLabel: string;
|
|
59
|
+
}, undefined, {
|
|
60
|
+
size: {
|
|
61
|
+
sm: {
|
|
62
|
+
track: string;
|
|
63
|
+
thumb: string;
|
|
64
|
+
};
|
|
65
|
+
md: {
|
|
66
|
+
track: string;
|
|
67
|
+
thumb: string;
|
|
68
|
+
};
|
|
69
|
+
lg: {
|
|
70
|
+
track: string;
|
|
71
|
+
thumb: string;
|
|
72
|
+
};
|
|
73
|
+
};
|
|
74
|
+
tone: {
|
|
75
|
+
accent: {
|
|
76
|
+
indicator: string;
|
|
77
|
+
thumb: string;
|
|
78
|
+
};
|
|
79
|
+
brand: {
|
|
80
|
+
indicator: string;
|
|
81
|
+
thumb: string;
|
|
82
|
+
};
|
|
83
|
+
success: {
|
|
84
|
+
indicator: string;
|
|
85
|
+
thumb: string;
|
|
86
|
+
};
|
|
87
|
+
warning: {
|
|
88
|
+
indicator: string;
|
|
89
|
+
thumb: string;
|
|
90
|
+
};
|
|
91
|
+
danger: {
|
|
92
|
+
indicator: string;
|
|
93
|
+
thumb: string;
|
|
94
|
+
};
|
|
95
|
+
};
|
|
96
|
+
disabled: {
|
|
97
|
+
true: {
|
|
98
|
+
root: string;
|
|
99
|
+
control: string;
|
|
100
|
+
label: string;
|
|
101
|
+
};
|
|
102
|
+
false: {};
|
|
103
|
+
};
|
|
104
|
+
}, {
|
|
105
|
+
root: string;
|
|
106
|
+
header: string;
|
|
107
|
+
label: string;
|
|
108
|
+
readout: string;
|
|
109
|
+
control: string;
|
|
110
|
+
track: string;
|
|
111
|
+
indicator: string;
|
|
112
|
+
thumb: string[];
|
|
113
|
+
marks: string;
|
|
114
|
+
markLabel: string;
|
|
115
|
+
}, import("tailwind-variants").TVReturnTypeLike<{
|
|
116
|
+
size: {
|
|
117
|
+
sm: {
|
|
118
|
+
track: string;
|
|
119
|
+
thumb: string;
|
|
120
|
+
};
|
|
121
|
+
md: {
|
|
122
|
+
track: string;
|
|
123
|
+
thumb: string;
|
|
124
|
+
};
|
|
125
|
+
lg: {
|
|
126
|
+
track: string;
|
|
127
|
+
thumb: string;
|
|
128
|
+
};
|
|
129
|
+
};
|
|
130
|
+
tone: {
|
|
131
|
+
accent: {
|
|
132
|
+
indicator: string;
|
|
133
|
+
thumb: string;
|
|
134
|
+
};
|
|
135
|
+
brand: {
|
|
136
|
+
indicator: string;
|
|
137
|
+
thumb: string;
|
|
138
|
+
};
|
|
139
|
+
success: {
|
|
140
|
+
indicator: string;
|
|
141
|
+
thumb: string;
|
|
142
|
+
};
|
|
143
|
+
warning: {
|
|
144
|
+
indicator: string;
|
|
145
|
+
thumb: string;
|
|
146
|
+
};
|
|
147
|
+
danger: {
|
|
148
|
+
indicator: string;
|
|
149
|
+
thumb: string;
|
|
150
|
+
};
|
|
151
|
+
};
|
|
152
|
+
disabled: {
|
|
153
|
+
true: {
|
|
154
|
+
root: string;
|
|
155
|
+
control: string;
|
|
156
|
+
label: string;
|
|
157
|
+
};
|
|
158
|
+
false: {};
|
|
159
|
+
};
|
|
160
|
+
}, {
|
|
161
|
+
root: string;
|
|
162
|
+
header: string;
|
|
163
|
+
label: string;
|
|
164
|
+
readout: string;
|
|
165
|
+
control: string;
|
|
166
|
+
track: string;
|
|
167
|
+
indicator: string;
|
|
168
|
+
thumb: string[];
|
|
169
|
+
marks: string;
|
|
170
|
+
markLabel: string;
|
|
171
|
+
}>>;
|
|
172
|
+
export type SliderMark = {
|
|
173
|
+
value: number;
|
|
174
|
+
/** Shown under the tick. Omit for a bare tick. */
|
|
175
|
+
label?: ReactNode;
|
|
176
|
+
};
|
|
177
|
+
export interface SliderProps extends Omit<VariantProps<typeof slider>, "disabled"> {
|
|
178
|
+
/** A number for a single thumb; two numbers for a range. */
|
|
179
|
+
value?: number | number[];
|
|
180
|
+
defaultValue?: number | number[];
|
|
181
|
+
onValueChange?: (value: number | number[]) => void;
|
|
182
|
+
/** Fired once when dragging ends — for expensive commits. */
|
|
183
|
+
onValueCommitted?: (value: number | number[]) => void;
|
|
184
|
+
min?: number;
|
|
185
|
+
max?: number;
|
|
186
|
+
step?: number;
|
|
187
|
+
/** Smallest allowed gap between range thumbs. */
|
|
188
|
+
minStepsBetweenValues?: number;
|
|
189
|
+
label?: ReactNode;
|
|
190
|
+
/** Turn the raw number into what a person should read. */
|
|
191
|
+
format?: (value: number) => string;
|
|
192
|
+
/** Show the formatted value beside the label. */
|
|
193
|
+
showValue?: boolean;
|
|
194
|
+
/** Ticks. `true` derives them from `step`; an array places them exactly. */
|
|
195
|
+
marks?: boolean | SliderMark[];
|
|
196
|
+
/** When to float the value over the thumb. */
|
|
197
|
+
tooltip?: "never" | "drag" | "always";
|
|
198
|
+
disabled?: boolean;
|
|
199
|
+
className?: string;
|
|
200
|
+
ref?: Ref<HTMLDivElement>;
|
|
201
|
+
}
|
|
202
|
+
export declare function Slider({ value, defaultValue, onValueChange, onValueCommitted, min, max, step, minStepsBetweenValues, label, format, showValue, marks, tooltip, size, tone, disabled, className, ref, }: SliderProps): import("react").JSX.Element;
|
|
203
|
+
export {};
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import type { Ref, SVGProps } from "react";
|
|
2
|
+
import type { IconSize } from "./Icon";
|
|
3
|
+
export interface SpinnerProps extends Omit<SVGProps<SVGSVGElement>, "ref"> {
|
|
4
|
+
size?: IconSize;
|
|
5
|
+
/**
|
|
6
|
+
* An accessible name. Omitted by default because a spinner is almost always
|
|
7
|
+
* inside something that already announces its own busy state — a button with
|
|
8
|
+
* `aria-busy`, or a region with `aria-live`. Announcing "Loading" a second
|
|
9
|
+
* time from the spinner itself is noise, not help.
|
|
10
|
+
*/
|
|
11
|
+
label?: string;
|
|
12
|
+
ref?: Ref<SVGSVGElement>;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* An indeterminate spinner built from TWO nested rates: the whole SVG rotates
|
|
16
|
+
* at a constant speed while the visible arc grows and shrinks underneath it.
|
|
17
|
+
*
|
|
18
|
+
* That combination is what separates a spinner that reads as alive from one
|
|
19
|
+
* that reads as mechanical. A single constant rotation has one frequency, and
|
|
20
|
+
* the eye locks onto it within a second — which is precisely when a spinner
|
|
21
|
+
* starts feeling like the app has hung. The second rate keeps the motion from
|
|
22
|
+
* ever repeating exactly where the eye expects it.
|
|
23
|
+
*
|
|
24
|
+
* Both animations are transform / stroke-dash on a ~20px element, so the cost
|
|
25
|
+
* is inside the paint budget even though `stroke-dasharray` is a paint
|
|
26
|
+
* property: the rule is animated AREA x FREQUENCY, and this loops forever but
|
|
27
|
+
* over almost no area.
|
|
28
|
+
*/
|
|
29
|
+
export declare function Spinner({ size, label, className, style, ref, ...props }: SpinnerProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
import type { ReactNode, Ref } from "react";
|
|
2
|
+
import { type VariantProps } from "tailwind-variants";
|
|
3
|
+
declare const stat: import("tailwind-variants").TVReturnType<{
|
|
4
|
+
size: {
|
|
5
|
+
sm: {
|
|
6
|
+
value: string;
|
|
7
|
+
};
|
|
8
|
+
md: {
|
|
9
|
+
value: string;
|
|
10
|
+
};
|
|
11
|
+
lg: {
|
|
12
|
+
value: string;
|
|
13
|
+
};
|
|
14
|
+
};
|
|
15
|
+
}, {
|
|
16
|
+
root: string;
|
|
17
|
+
label: string;
|
|
18
|
+
value: string;
|
|
19
|
+
unit: string;
|
|
20
|
+
delta: string;
|
|
21
|
+
hint: string;
|
|
22
|
+
}, undefined, {
|
|
23
|
+
size: {
|
|
24
|
+
sm: {
|
|
25
|
+
value: string;
|
|
26
|
+
};
|
|
27
|
+
md: {
|
|
28
|
+
value: string;
|
|
29
|
+
};
|
|
30
|
+
lg: {
|
|
31
|
+
value: string;
|
|
32
|
+
};
|
|
33
|
+
};
|
|
34
|
+
}, {
|
|
35
|
+
root: string;
|
|
36
|
+
label: string;
|
|
37
|
+
value: string;
|
|
38
|
+
unit: string;
|
|
39
|
+
delta: string;
|
|
40
|
+
hint: string;
|
|
41
|
+
}, import("tailwind-variants").TVReturnTypeLike<{
|
|
42
|
+
size: {
|
|
43
|
+
sm: {
|
|
44
|
+
value: string;
|
|
45
|
+
};
|
|
46
|
+
md: {
|
|
47
|
+
value: string;
|
|
48
|
+
};
|
|
49
|
+
lg: {
|
|
50
|
+
value: string;
|
|
51
|
+
};
|
|
52
|
+
};
|
|
53
|
+
}, {
|
|
54
|
+
root: string;
|
|
55
|
+
label: string;
|
|
56
|
+
value: string;
|
|
57
|
+
unit: string;
|
|
58
|
+
delta: string;
|
|
59
|
+
hint: string;
|
|
60
|
+
}>>;
|
|
61
|
+
export type StatTrend = "up" | "down" | "flat";
|
|
62
|
+
/** Whether this movement is good news, bad news, or neither. */
|
|
63
|
+
export type StatSentiment = "positive" | "negative" | "neutral";
|
|
64
|
+
export interface StatProps extends VariantProps<typeof stat> {
|
|
65
|
+
label: ReactNode;
|
|
66
|
+
value: ReactNode;
|
|
67
|
+
/** Rendered smaller, beside the value — "ms", "/min", "GB". */
|
|
68
|
+
unit?: ReactNode;
|
|
69
|
+
/** The change itself — "12%", "+1.2k". */
|
|
70
|
+
delta?: ReactNode;
|
|
71
|
+
trend?: StatTrend;
|
|
72
|
+
/** Whether that movement is good. Independent of direction, on purpose. */
|
|
73
|
+
sentiment?: StatSentiment;
|
|
74
|
+
hint?: ReactNode;
|
|
75
|
+
/** A sparkline, ring, or icon shown alongside. */
|
|
76
|
+
visual?: ReactNode;
|
|
77
|
+
className?: string;
|
|
78
|
+
ref?: Ref<HTMLDivElement>;
|
|
79
|
+
}
|
|
80
|
+
export declare function Stat({ label, value, unit, delta, trend, sentiment, hint, visual, size, className, ref, }: StatProps): import("react").JSX.Element;
|
|
81
|
+
export interface SparklineProps {
|
|
82
|
+
values: number[];
|
|
83
|
+
/** Matches the stat's sentiment, so the line agrees with the delta beside it. */
|
|
84
|
+
sentiment?: StatSentiment;
|
|
85
|
+
className?: string;
|
|
86
|
+
}
|
|
87
|
+
/**
|
|
88
|
+
* A bare trend line — no axes, no grid, no labels.
|
|
89
|
+
*
|
|
90
|
+
* A sparkline answers "which way, and how steadily", not "what value". Adding
|
|
91
|
+
* axes makes it a bad chart instead of a good sparkline, and at this size the
|
|
92
|
+
* ink spent on them is ink taken from the only thing being communicated.
|
|
93
|
+
*
|
|
94
|
+
* The last point is marked, because "where it ended up" is the one specific
|
|
95
|
+
* value anyone reads off a shape this small.
|
|
96
|
+
*/
|
|
97
|
+
export declare function Sparkline({ values, sentiment, className }: SparklineProps): import("react").JSX.Element | null;
|
|
98
|
+
export {};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { ReactNode } from "react";
|
|
2
|
+
import { type BadgeProps } from "./Badge";
|
|
3
|
+
export interface StatusOption<Value extends string = string> {
|
|
4
|
+
value: Value;
|
|
5
|
+
label: string;
|
|
6
|
+
tone: BadgeProps["tone"];
|
|
7
|
+
/** Rendered inside the Badge via its own `icon` slot — pass an `<Icon>`. */
|
|
8
|
+
icon?: ReactNode;
|
|
9
|
+
dot?: boolean;
|
|
10
|
+
/** Reserved for a genuinely live state — see `Badge`'s own `pulse` doc. */
|
|
11
|
+
pulse?: boolean;
|
|
12
|
+
}
|
|
13
|
+
export interface StatusSelectProps<Value extends string = string> {
|
|
14
|
+
value: Value;
|
|
15
|
+
options: StatusOption<Value>[];
|
|
16
|
+
onValueChange: (value: Value) => void;
|
|
17
|
+
size?: "sm" | "md";
|
|
18
|
+
/** Accessible name for the trigger — there is no visible label otherwise. */
|
|
19
|
+
"aria-label"?: string;
|
|
20
|
+
disabled?: boolean;
|
|
21
|
+
className?: string;
|
|
22
|
+
}
|
|
23
|
+
export declare function StatusSelect<Value extends string = string>({ value, options, onValueChange, size, "aria-label": ariaLabel, disabled, className, }: StatusSelectProps<Value>): import("react").JSX.Element;
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
import type { ReactNode, Ref } from "react";
|
|
2
|
+
export interface SeparatorProps {
|
|
3
|
+
orientation?: "horizontal" | "vertical";
|
|
4
|
+
/** Text or a chip centred on the line — "or", "Today", a count. */
|
|
5
|
+
label?: ReactNode;
|
|
6
|
+
className?: string;
|
|
7
|
+
ref?: Ref<HTMLDivElement>;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* A rule.
|
|
11
|
+
*
|
|
12
|
+
* With a label it becomes two rules with content between them, which is the
|
|
13
|
+
* only correct way to do it — a background-coloured span sitting on top of one
|
|
14
|
+
* continuous line looks right until the surface behind it changes, and then
|
|
15
|
+
* the patch is visible.
|
|
16
|
+
*/
|
|
17
|
+
export declare function Separator({ orientation, label, className, ref }: SeparatorProps): import("react").JSX.Element;
|
|
18
|
+
export interface ScrollAreaProps {
|
|
19
|
+
children: ReactNode;
|
|
20
|
+
/** Caps the height and scrolls internally. */
|
|
21
|
+
maxHeight?: string;
|
|
22
|
+
className?: string;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* A scrollable region with a styled, always-consistent scrollbar.
|
|
26
|
+
*
|
|
27
|
+
* Native scrollbars differ per platform: macOS overlays and hides them, Windows
|
|
28
|
+
* reserves a permanent 17px gutter. That difference silently changes your
|
|
29
|
+
* content width between platforms, which is why a layout that fits on a Mac
|
|
30
|
+
* wraps on Windows. This reserves nothing and draws its own.
|
|
31
|
+
*
|
|
32
|
+
* The scrollbar FADES IN on hover and interaction rather than sitting there —
|
|
33
|
+
* present when you are steering, invisible when you are reading.
|
|
34
|
+
*/
|
|
35
|
+
export declare function ScrollArea({ children, maxHeight, className }: ScrollAreaProps): import("react").JSX.Element;
|
|
36
|
+
export interface CollapsibleProps {
|
|
37
|
+
/**
|
|
38
|
+
* The trigger's CONTENT — not a button.
|
|
39
|
+
*
|
|
40
|
+
* This component supplies the button itself, so passing one nests a button
|
|
41
|
+
* inside a button: invalid HTML, and unreachable by keyboard past the outer
|
|
42
|
+
* one. The prop is content-only by design, which removes the possibility
|
|
43
|
+
* rather than documenting against it.
|
|
44
|
+
*/
|
|
45
|
+
trigger: ReactNode;
|
|
46
|
+
defaultOpen?: boolean;
|
|
47
|
+
open?: boolean;
|
|
48
|
+
onOpenChange?: (open: boolean) => void;
|
|
49
|
+
/**
|
|
50
|
+
* Restyles the trigger — for disclosures whose header is a full-width row
|
|
51
|
+
* rather than a line of text, which is most of them outside prose.
|
|
52
|
+
*/
|
|
53
|
+
triggerClassName?: string;
|
|
54
|
+
/**
|
|
55
|
+
* Draws the leading chevron. Turn it off when the trigger places its own
|
|
56
|
+
* (trailing, usually) and rotate it with
|
|
57
|
+
* `group-data-panel-open/collapsible:rotate-90`.
|
|
58
|
+
*/
|
|
59
|
+
chevron?: boolean;
|
|
60
|
+
children: ReactNode;
|
|
61
|
+
className?: string;
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* One disclosure, without the accordion around it.
|
|
65
|
+
*
|
|
66
|
+
* Height animates from `--collapsible-panel-height`, which Base UI publishes —
|
|
67
|
+
* no measuring, no effect, no frame of lag on first open.
|
|
68
|
+
*/
|
|
69
|
+
export declare function Collapsible({ trigger, defaultOpen, open, onOpenChange, triggerClassName, chevron, children, className, }: CollapsibleProps): import("react").JSX.Element;
|
|
70
|
+
export interface EmptyStateProps {
|
|
71
|
+
icon?: ReactNode;
|
|
72
|
+
title: ReactNode;
|
|
73
|
+
description?: ReactNode;
|
|
74
|
+
/** The primary way out. An empty state without one is a dead end. */
|
|
75
|
+
action?: ReactNode;
|
|
76
|
+
/** A quieter alternative — "learn more", "clear filters". */
|
|
77
|
+
secondaryAction?: ReactNode;
|
|
78
|
+
className?: string;
|
|
79
|
+
}
|
|
80
|
+
/**
|
|
81
|
+
* Nothing here — and what to do about it.
|
|
82
|
+
*
|
|
83
|
+
* The action is the point. An empty state that only apologises leaves someone
|
|
84
|
+
* exactly where they started; the two questions worth answering are "why is
|
|
85
|
+
* this empty" and "what do I press". "No results" with a Clear filters button
|
|
86
|
+
* is a different experience from "No results" alone, and it is the same amount
|
|
87
|
+
* of screen.
|
|
88
|
+
*/
|
|
89
|
+
export declare function EmptyState({ icon, title, description, action, secondaryAction, className, }: EmptyStateProps): import("react").JSX.Element;
|
|
90
|
+
export interface TimelineItem {
|
|
91
|
+
id: string;
|
|
92
|
+
title: ReactNode;
|
|
93
|
+
description?: ReactNode;
|
|
94
|
+
timestamp?: ReactNode;
|
|
95
|
+
icon?: ReactNode;
|
|
96
|
+
tone?: "neutral" | "accent" | "success" | "warning" | "danger";
|
|
97
|
+
}
|
|
98
|
+
export interface TimelineProps {
|
|
99
|
+
items: TimelineItem[];
|
|
100
|
+
className?: string;
|
|
101
|
+
}
|
|
102
|
+
/**
|
|
103
|
+
* A vertical sequence of events.
|
|
104
|
+
*
|
|
105
|
+
* The connecting line is drawn per item and stops at the LAST one, rather than
|
|
106
|
+
* being one line behind everything. A single full-height line runs past the
|
|
107
|
+
* final marker into empty space, which reads as "and then something else
|
|
108
|
+
* happened" — the opposite of what a finished timeline means.
|
|
109
|
+
*/
|
|
110
|
+
export declare function Timeline({ items, className }: TimelineProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { type ReactNode } from "react";
|
|
2
|
+
import { type ColumnDef, type Table as TanstackTable } from "@tanstack/react-table";
|
|
3
|
+
export type TableDensity = "comfortable" | "cozy" | "compact";
|
|
4
|
+
export interface DataTableProps<TData> {
|
|
5
|
+
data: TData[];
|
|
6
|
+
columns: ColumnDef<TData, unknown>[];
|
|
7
|
+
density?: TableDensity;
|
|
8
|
+
/** Adds a leading checkbox column with header select-all. */
|
|
9
|
+
selectable?: boolean;
|
|
10
|
+
/** Constrain height and scroll internally, keeping the header pinned. */
|
|
11
|
+
maxHeight?: string;
|
|
12
|
+
/** Tint alternating rows. Off by default — hairlines usually suffice. */
|
|
13
|
+
zebra?: boolean;
|
|
14
|
+
/**
|
|
15
|
+
* First load — no data yet. Draws skeleton rows.
|
|
16
|
+
*
|
|
17
|
+
* Distinct from `refreshing` on purpose: a skeleton REPLACES content, which
|
|
18
|
+
* is right when there is none and wrong the moment there is. Collapsing the
|
|
19
|
+
* two into one `loading` flag is what produces the table that flashes to grey
|
|
20
|
+
* bars on every filter change.
|
|
21
|
+
*/
|
|
22
|
+
loading?: boolean;
|
|
23
|
+
/** Refetching with data already on screen. Dims the rows under a card. */
|
|
24
|
+
refreshing?: boolean;
|
|
25
|
+
/** Skeleton row count while `loading`. */
|
|
26
|
+
loadingRows?: number;
|
|
27
|
+
emptyState?: ReactNode;
|
|
28
|
+
onRowClick?: (row: TData) => void;
|
|
29
|
+
/** Rendered above the table; receives the table instance for counts/filters. */
|
|
30
|
+
toolbar?: (table: TanstackTable<TData>) => ReactNode;
|
|
31
|
+
className?: string;
|
|
32
|
+
getRowId?: (row: TData, index: number) => string;
|
|
33
|
+
}
|
|
34
|
+
export declare function DataTable<TData>({ data, columns, density, selectable, maxHeight, zebra, loading, refreshing, loadingRows, emptyState, onRowClick, toolbar, className, getRowId, }: DataTableProps<TData>): import("react").JSX.Element;
|
|
35
|
+
export declare function TableEmptyState({ icon, title, description, action, }: {
|
|
36
|
+
icon?: ReactNode;
|
|
37
|
+
title?: string;
|
|
38
|
+
description?: string;
|
|
39
|
+
action?: ReactNode;
|
|
40
|
+
}): import("react").JSX.Element;
|
|
41
|
+
/** Two-line cell: a strong primary value with a muted secondary beneath. */
|
|
42
|
+
export declare function CellStack({ primary, secondary, mono, }: {
|
|
43
|
+
primary: ReactNode;
|
|
44
|
+
secondary?: ReactNode;
|
|
45
|
+
mono?: boolean;
|
|
46
|
+
}): import("react").JSX.Element;
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import type { ReactNode, Ref } from "react";
|
|
2
|
+
import { Tabs as BaseTabs } from "@base-ui/react/tabs";
|
|
3
|
+
import { type VariantProps } from "tailwind-variants";
|
|
4
|
+
declare const tabs: import("tailwind-variants").TVReturnType<{
|
|
5
|
+
variant: {
|
|
6
|
+
line: {
|
|
7
|
+
list: string;
|
|
8
|
+
tab: string;
|
|
9
|
+
indicator: string;
|
|
10
|
+
};
|
|
11
|
+
pill: {
|
|
12
|
+
list: string;
|
|
13
|
+
tab: string;
|
|
14
|
+
indicator: string;
|
|
15
|
+
};
|
|
16
|
+
};
|
|
17
|
+
}, {
|
|
18
|
+
root: string;
|
|
19
|
+
list: string;
|
|
20
|
+
tab: string[];
|
|
21
|
+
indicator: string[];
|
|
22
|
+
panel: string;
|
|
23
|
+
}, undefined, {
|
|
24
|
+
variant: {
|
|
25
|
+
line: {
|
|
26
|
+
list: string;
|
|
27
|
+
tab: string;
|
|
28
|
+
indicator: string;
|
|
29
|
+
};
|
|
30
|
+
pill: {
|
|
31
|
+
list: string;
|
|
32
|
+
tab: string;
|
|
33
|
+
indicator: string;
|
|
34
|
+
};
|
|
35
|
+
};
|
|
36
|
+
}, {
|
|
37
|
+
root: string;
|
|
38
|
+
list: string;
|
|
39
|
+
tab: string[];
|
|
40
|
+
indicator: string[];
|
|
41
|
+
panel: string;
|
|
42
|
+
}, import("tailwind-variants").TVReturnTypeLike<{
|
|
43
|
+
variant: {
|
|
44
|
+
line: {
|
|
45
|
+
list: string;
|
|
46
|
+
tab: string;
|
|
47
|
+
indicator: string;
|
|
48
|
+
};
|
|
49
|
+
pill: {
|
|
50
|
+
list: string;
|
|
51
|
+
tab: string;
|
|
52
|
+
indicator: string;
|
|
53
|
+
};
|
|
54
|
+
};
|
|
55
|
+
}, {
|
|
56
|
+
root: string;
|
|
57
|
+
list: string;
|
|
58
|
+
tab: string[];
|
|
59
|
+
indicator: string[];
|
|
60
|
+
panel: string;
|
|
61
|
+
}>>;
|
|
62
|
+
export interface TabsProps extends Omit<BaseTabs.Root.Props, "className">, VariantProps<typeof tabs> {
|
|
63
|
+
className?: string;
|
|
64
|
+
ref?: Ref<HTMLDivElement>;
|
|
65
|
+
}
|
|
66
|
+
export declare function Tabs({ variant, className, children, ref, ...props }: TabsProps): import("react").JSX.Element;
|
|
67
|
+
export interface TabListProps {
|
|
68
|
+
className?: string;
|
|
69
|
+
children: ReactNode;
|
|
70
|
+
variant?: VariantProps<typeof tabs>["variant"];
|
|
71
|
+
}
|
|
72
|
+
export declare function TabList({ className, children, variant }: TabListProps): import("react").JSX.Element;
|
|
73
|
+
export interface TabProps extends Omit<BaseTabs.Tab.Props, "className"> {
|
|
74
|
+
className?: string;
|
|
75
|
+
variant?: VariantProps<typeof tabs>["variant"];
|
|
76
|
+
ref?: Ref<HTMLButtonElement>;
|
|
77
|
+
}
|
|
78
|
+
export declare function Tab({ className, children, variant, ref, ...props }: TabProps): import("react").JSX.Element;
|
|
79
|
+
export interface TabPanelProps extends Omit<BaseTabs.Panel.Props, "className"> {
|
|
80
|
+
className?: string;
|
|
81
|
+
ref?: Ref<HTMLDivElement>;
|
|
82
|
+
}
|
|
83
|
+
export declare function TabPanel({ className, children, ref, ...props }: TabPanelProps): import("react").JSX.Element;
|
|
84
|
+
export {};
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import type { ReactNode } from "react";
|
|
2
|
+
import { type IconName } from "./Icon";
|
|
3
|
+
declare const TONE: Record<string, {
|
|
4
|
+
icon: IconName;
|
|
5
|
+
className: string;
|
|
6
|
+
}>;
|
|
7
|
+
export type ToastTone = keyof typeof TONE;
|
|
8
|
+
export interface ToasterProps {
|
|
9
|
+
/** Where the stack lives. Bottom-right keeps it clear of primary content. */
|
|
10
|
+
position?: "top-right" | "top-center" | "bottom-right" | "bottom-center";
|
|
11
|
+
}
|
|
12
|
+
/** Renders the stack. Mount once, inside `ToastProvider`. */
|
|
13
|
+
export declare function Toaster({ position }: ToasterProps): import("react").JSX.Element;
|
|
14
|
+
export interface ToastProviderProps {
|
|
15
|
+
children: ReactNode;
|
|
16
|
+
limit?: number;
|
|
17
|
+
}
|
|
18
|
+
export declare function ToastProvider({ children, limit }: ToastProviderProps): import("react").JSX.Element;
|
|
19
|
+
export interface ToastOptions {
|
|
20
|
+
title: ReactNode;
|
|
21
|
+
description?: ReactNode;
|
|
22
|
+
tone?: ToastTone;
|
|
23
|
+
/** Override the tone's default lifetime. `0` keeps it until dismissed. */
|
|
24
|
+
timeout?: number;
|
|
25
|
+
action?: {
|
|
26
|
+
label: string;
|
|
27
|
+
onClick: () => void;
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Raise toasts from anywhere under `ToastProvider`.
|
|
32
|
+
*
|
|
33
|
+
* `promise` is the one worth reaching for: it shows a loading toast, then
|
|
34
|
+
* swaps that SAME toast to success or error in place. Two separate toasts for
|
|
35
|
+
* one operation makes the stack tell a story nobody asked for.
|
|
36
|
+
*/
|
|
37
|
+
export declare function useToast(): {
|
|
38
|
+
show({ title, description, tone, timeout, action }: ToastOptions): string;
|
|
39
|
+
promise<T>(promise: Promise<T>, messages: {
|
|
40
|
+
loading: ReactNode;
|
|
41
|
+
success: ReactNode;
|
|
42
|
+
error: ReactNode;
|
|
43
|
+
}): Promise<T>;
|
|
44
|
+
close: (toastId?: string) => void;
|
|
45
|
+
};
|
|
46
|
+
export {};
|