panelui-web 0.7.0 → 0.9.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/dist/components/alert/index.d.ts +138 -0
- package/dist/components/alert/index.js +279 -0
- package/dist/components/alert-dialog/index.d.ts +128 -0
- package/dist/components/alert-dialog/index.js +327 -0
- package/dist/components/button-group/index.d.ts +156 -0
- package/dist/components/button-group/index.js +78 -0
- package/dist/components/canvas/index.d.ts +114 -0
- package/dist/components/canvas/index.js +210 -0
- package/dist/components/dialog/index.d.ts +162 -0
- package/dist/components/dialog/index.js +299 -0
- package/dist/components/prompt/index.d.ts +34 -8
- package/dist/components/prompt/index.js +43 -13
- package/dist/components/sheet/index.d.ts +47 -1
- package/dist/components/sheet/index.js +251 -2
- package/dist/index.d.ts +7 -2
- package/dist/index.js +6 -1
- package/package.json +1 -1
|
@@ -0,0 +1,210 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
3
|
+
/**
|
|
4
|
+
* Canvas — a surface for other components to sit on: a field of dots, a
|
|
5
|
+
* grid or crosses, with a light that can follow the pointer across it.
|
|
6
|
+
*
|
|
7
|
+
* ```tsx
|
|
8
|
+
* <Canvas className="h-96">
|
|
9
|
+
* <Canvas.Pattern variant="dots" />
|
|
10
|
+
* <Canvas.Spotlight />
|
|
11
|
+
* <Canvas.Content>…</Canvas.Content>
|
|
12
|
+
* </Canvas>
|
|
13
|
+
* ```
|
|
14
|
+
*
|
|
15
|
+
* ## Layers on one surface
|
|
16
|
+
*
|
|
17
|
+
* A canvas is a stack of layers. `Canvas.Pattern` draws marks across the
|
|
18
|
+
* whole surface, several patterns stack, `Canvas.Spotlight` lights them near
|
|
19
|
+
* the pointer, and `Canvas.Content` is what sits on top. Every layer is
|
|
20
|
+
* drawn from the same `viewport`, so a layer added later, such as ink drawn
|
|
21
|
+
* with the pointer, lines up with the pattern without measuring it.
|
|
22
|
+
*
|
|
23
|
+
* ## It moves with what is on it
|
|
24
|
+
*
|
|
25
|
+
* `viewport` takes the `{ x, y, zoom }` a Flow reports from
|
|
26
|
+
* `onViewportChange`, so the pattern pans and scales with the graph on top
|
|
27
|
+
* of it instead of staying behind as the graph slides over it.
|
|
28
|
+
*
|
|
29
|
+
* ## The light follows the hand
|
|
30
|
+
*
|
|
31
|
+
* The spotlight is a second copy of the pattern in the foreground colour,
|
|
32
|
+
* shown through a round window centred on the pointer that fades from the
|
|
33
|
+
* middle to its edge. It follows the pointer without easing, from events on
|
|
34
|
+
* the canvas itself, so it works over whatever is in the content. It is
|
|
35
|
+
* written straight to the element, once a frame, without rendering, and it
|
|
36
|
+
* fades out when the pointer leaves. On a touch screen it shows while a
|
|
37
|
+
* finger is down.
|
|
38
|
+
*/
|
|
39
|
+
import { createContext, useCallback, useContext, useEffect, useId, useLayoutEffect, useMemo, useRef, useState, } from 'react';
|
|
40
|
+
import { tv } from 'tailwind-variants';
|
|
41
|
+
const canvasVariants = tv({
|
|
42
|
+
slots: {
|
|
43
|
+
root: 'relative isolate overflow-hidden bg-background text-foreground',
|
|
44
|
+
layer: 'pointer-events-none absolute inset-0 size-full',
|
|
45
|
+
// The resting marks: the foreground at a fraction of its strength, so the
|
|
46
|
+
// field reads as a texture and not as content.
|
|
47
|
+
pattern: 'text-foreground',
|
|
48
|
+
spotlight: 'text-foreground opacity-0 transition-opacity duration-200 data-on:opacity-100 motion-reduce:transition-none',
|
|
49
|
+
content: 'relative z-10 size-full',
|
|
50
|
+
},
|
|
51
|
+
});
|
|
52
|
+
const CanvasContext = createContext(null);
|
|
53
|
+
function useCanvas(part) {
|
|
54
|
+
const canvas = useContext(CanvasContext);
|
|
55
|
+
if (!canvas)
|
|
56
|
+
throw new Error(`${part} must be used inside a <Canvas>.`);
|
|
57
|
+
return canvas;
|
|
58
|
+
}
|
|
59
|
+
const ORIGIN = { x: 0, y: 0, zoom: 1 };
|
|
60
|
+
const FADES = {
|
|
61
|
+
none: undefined,
|
|
62
|
+
edges: 'radial-gradient(ellipse 75% 70% at 50% 50%, #000 35%, transparent 100%)',
|
|
63
|
+
bottom: 'linear-gradient(to bottom, #000 40%, transparent 95%)',
|
|
64
|
+
};
|
|
65
|
+
function CanvasRoot({ viewport = ORIGIN, className, children, ...props }) {
|
|
66
|
+
const [root, setRoot] = useState(null);
|
|
67
|
+
const [patterns, setPatterns] = useState([]);
|
|
68
|
+
const register = useCallback((key, spec) => {
|
|
69
|
+
setPatterns((current) => [...current.filter((pattern) => pattern.key !== key), { key, ...spec }]);
|
|
70
|
+
return () => setPatterns((current) => current.filter((pattern) => pattern.key !== key));
|
|
71
|
+
}, []);
|
|
72
|
+
const context = useMemo(() => ({ viewport, root, patterns, register }), [viewport, root, patterns, register]);
|
|
73
|
+
return (_jsx(CanvasContext.Provider, { value: context, children: _jsx("div", { ref: setRoot, "data-slot": "canvas", className: canvasVariants().root({ className }), ...props, children: children }) }));
|
|
74
|
+
}
|
|
75
|
+
CanvasRoot.displayName = 'Canvas';
|
|
76
|
+
/** Draws one pattern's marks into an SVG, from the viewport. */
|
|
77
|
+
function Marks({ id, spec, viewport }) {
|
|
78
|
+
const { variant, gap, size, major } = spec;
|
|
79
|
+
const transform = `translate(${viewport.x.toFixed(2)} ${viewport.y.toFixed(2)}) scale(${viewport.zoom.toFixed(4)})`;
|
|
80
|
+
const half = gap / 2;
|
|
81
|
+
const mark = (scale, at) => {
|
|
82
|
+
if (variant === 'dots')
|
|
83
|
+
return _jsx("circle", { cx: at, cy: at, r: size * scale, fill: "currentColor" });
|
|
84
|
+
if (variant === 'cross') {
|
|
85
|
+
const arm = size * scale;
|
|
86
|
+
return (_jsx("path", { d: `M${at - arm} ${at}h${arm * 2}M${at} ${at - arm}v${arm * 2}`, stroke: "currentColor", strokeWidth: scale > 1 ? 1.25 : 1, strokeLinecap: "round", fill: "none" }));
|
|
87
|
+
}
|
|
88
|
+
return null;
|
|
89
|
+
};
|
|
90
|
+
// Every variant marks the same lattice points, half a gap in from each
|
|
91
|
+
// tile's corner, so stacked patterns line up: a cross lands on a grid's
|
|
92
|
+
// crossing, and a major line on a minor one.
|
|
93
|
+
const tile = major ? gap * major : gap;
|
|
94
|
+
return (_jsxs(_Fragment, { children: [_jsxs("defs", { children: [_jsx("pattern", { id: `${id}-minor`, width: gap, height: gap, patternUnits: "userSpaceOnUse", patternTransform: transform, children: variant === 'grid' ? (_jsx("path", { d: `M${half} 0V${gap}M0 ${half}H${gap}`, fill: "none", stroke: "currentColor", strokeWidth: size, opacity: major ? 0.6 : 1 })) : (mark(1, half)) }), major ? (_jsx("pattern", { id: `${id}-major`, width: tile, height: tile, patternUnits: "userSpaceOnUse", patternTransform: transform, children: variant === 'grid' ? (_jsx("path", { d: `M${half} 0V${tile}M0 ${half}H${tile}`, fill: "none", stroke: "currentColor", strokeWidth: size * 1.5 })) : (mark(variant === 'dots' ? 1.8 : 1.6, half)) })) : null] }), _jsx("rect", { width: "100%", height: "100%", fill: `url(#${id}-minor)` }), major ? _jsx("rect", { width: "100%", height: "100%", fill: `url(#${id}-major)` }) : null] }));
|
|
95
|
+
}
|
|
96
|
+
/** A pattern across the whole canvas, which pans and scales with its viewport. */
|
|
97
|
+
function CanvasPattern({ variant = 'dots', gap, size, major, fade = 'none', strength, className, style, ...props }) {
|
|
98
|
+
const canvas = useCanvas('Canvas.Pattern');
|
|
99
|
+
const id = `canvas${useId().replace(/[^a-zA-Z0-9]/g, '')}`;
|
|
100
|
+
const spec = useMemo(() => ({
|
|
101
|
+
variant,
|
|
102
|
+
gap: gap ?? (variant === 'grid' ? 24 : 12),
|
|
103
|
+
size: size ?? (variant === 'dots' ? 0.75 : variant === 'grid' ? 1 : 3),
|
|
104
|
+
major,
|
|
105
|
+
fade,
|
|
106
|
+
}), [variant, gap, size, major, fade]);
|
|
107
|
+
const { register } = canvas;
|
|
108
|
+
// Known to the spotlight, which draws a lit copy of every pattern.
|
|
109
|
+
useLayoutEffect(() => register(id, spec), [register, id, spec]);
|
|
110
|
+
const mask = FADES[fade];
|
|
111
|
+
return (_jsx("svg", { "aria-hidden": "true", "data-slot": "canvas-pattern", className: canvasVariants().layer({ className: [canvasVariants().pattern(), className] }), style: {
|
|
112
|
+
opacity: strength ?? (variant === 'grid' ? '10%' : '28%'),
|
|
113
|
+
maskImage: mask,
|
|
114
|
+
WebkitMaskImage: mask,
|
|
115
|
+
...style,
|
|
116
|
+
}, ...props, children: _jsx(Marks, { id: id, spec: spec, viewport: canvas.viewport }) }));
|
|
117
|
+
}
|
|
118
|
+
CanvasPattern.displayName = 'Canvas.Pattern';
|
|
119
|
+
/**
|
|
120
|
+
* Lights the patterns near the pointer: the marks inside the circle brighten
|
|
121
|
+
* towards the foreground colour, most at the centre.
|
|
122
|
+
*/
|
|
123
|
+
function CanvasSpotlight({ radius = 100, position, className, style, ...props }) {
|
|
124
|
+
const canvas = useCanvas('Canvas.Spotlight');
|
|
125
|
+
const light = useRef(null);
|
|
126
|
+
const prefix = `spot${useId().replace(/[^a-zA-Z0-9]/g, '')}`;
|
|
127
|
+
// Follows the pointer from events on the whole canvas, so content on top
|
|
128
|
+
// does not stop it. Written to the element once a frame, without rendering.
|
|
129
|
+
useEffect(() => {
|
|
130
|
+
const root = canvas.root;
|
|
131
|
+
const node = light.current;
|
|
132
|
+
if (!root || !node || position)
|
|
133
|
+
return;
|
|
134
|
+
let frame = 0;
|
|
135
|
+
let x = 0;
|
|
136
|
+
let y = 0;
|
|
137
|
+
let down = false;
|
|
138
|
+
const write = () => {
|
|
139
|
+
frame = 0;
|
|
140
|
+
node.style.setProperty('--canvas-x', `${x}px`);
|
|
141
|
+
node.style.setProperty('--canvas-y', `${y}px`);
|
|
142
|
+
};
|
|
143
|
+
const place = (event) => {
|
|
144
|
+
const box = root.getBoundingClientRect();
|
|
145
|
+
x = event.clientX - box.left;
|
|
146
|
+
y = event.clientY - box.top;
|
|
147
|
+
if (!frame)
|
|
148
|
+
frame = requestAnimationFrame(write);
|
|
149
|
+
};
|
|
150
|
+
const show = (on) => node.toggleAttribute('data-on', on);
|
|
151
|
+
const move = (event) => {
|
|
152
|
+
place(event);
|
|
153
|
+
if (event.pointerType !== 'touch' || down)
|
|
154
|
+
show(true);
|
|
155
|
+
};
|
|
156
|
+
const press = (event) => {
|
|
157
|
+
down = true;
|
|
158
|
+
place(event);
|
|
159
|
+
show(true);
|
|
160
|
+
};
|
|
161
|
+
const release = (event) => {
|
|
162
|
+
down = false;
|
|
163
|
+
if (event.pointerType === 'touch')
|
|
164
|
+
show(false);
|
|
165
|
+
};
|
|
166
|
+
const leave = () => show(false);
|
|
167
|
+
root.addEventListener('pointermove', move);
|
|
168
|
+
root.addEventListener('pointerdown', press);
|
|
169
|
+
root.addEventListener('pointerup', release);
|
|
170
|
+
root.addEventListener('pointercancel', release);
|
|
171
|
+
root.addEventListener('pointerleave', leave);
|
|
172
|
+
return () => {
|
|
173
|
+
cancelAnimationFrame(frame);
|
|
174
|
+
root.removeEventListener('pointermove', move);
|
|
175
|
+
root.removeEventListener('pointerdown', press);
|
|
176
|
+
root.removeEventListener('pointerup', release);
|
|
177
|
+
root.removeEventListener('pointercancel', release);
|
|
178
|
+
root.removeEventListener('pointerleave', leave);
|
|
179
|
+
};
|
|
180
|
+
}, [canvas.root, position]);
|
|
181
|
+
// A round window on the lit copy: opaque at the pointer, clear at the radius.
|
|
182
|
+
const circle = `radial-gradient(circle var(--canvas-r) at var(--canvas-x, -999px) var(--canvas-y, -999px), #000, transparent)`;
|
|
183
|
+
return (_jsx("div", { ref: light, "aria-hidden": "true", "data-slot": "canvas-spotlight", "data-on": position ? '' : undefined, className: canvasVariants().layer({ className: [canvasVariants().spotlight(), className] }), style: {
|
|
184
|
+
'--canvas-r': `${radius}px`,
|
|
185
|
+
...(position ? { '--canvas-x': `${position.x}px`, '--canvas-y': `${position.y}px` } : null),
|
|
186
|
+
...style,
|
|
187
|
+
}, ...props, children: canvas.patterns.map((pattern) => {
|
|
188
|
+
const fade = FADES[pattern.fade];
|
|
189
|
+
// The pattern's own fade still applies inside the light.
|
|
190
|
+
const mask = fade ? `${circle}, ${fade}` : circle;
|
|
191
|
+
return (_jsx("svg", { className: "absolute inset-0 size-full", style: {
|
|
192
|
+
maskImage: mask,
|
|
193
|
+
WebkitMaskImage: mask,
|
|
194
|
+
maskComposite: fade ? 'intersect' : undefined,
|
|
195
|
+
WebkitMaskComposite: fade ? 'source-in' : undefined,
|
|
196
|
+
}, children: _jsx(Marks, { id: `${prefix}${pattern.key}`, spec: pattern, viewport: canvas.viewport }) }, pattern.key));
|
|
197
|
+
}) }));
|
|
198
|
+
}
|
|
199
|
+
CanvasSpotlight.displayName = 'Canvas.Spotlight';
|
|
200
|
+
/** What sits on the canvas, above its patterns and its light. */
|
|
201
|
+
function CanvasContent({ className, ...props }) {
|
|
202
|
+
return _jsx("div", { "data-slot": "canvas-content", className: canvasVariants().content({ className }), ...props });
|
|
203
|
+
}
|
|
204
|
+
CanvasContent.displayName = 'Canvas.Content';
|
|
205
|
+
export const Canvas = Object.assign(CanvasRoot, {
|
|
206
|
+
Pattern: CanvasPattern,
|
|
207
|
+
Spotlight: CanvasSpotlight,
|
|
208
|
+
Content: CanvasContent,
|
|
209
|
+
});
|
|
210
|
+
export { CanvasPattern, CanvasSpotlight, CanvasContent };
|
|
@@ -0,0 +1,162 @@
|
|
|
1
|
+
import { type ComponentProps, type ReactElement, type ReactNode } from 'react';
|
|
2
|
+
export interface DialogProps {
|
|
3
|
+
children?: ReactNode;
|
|
4
|
+
/** Whether it is open, when the caller holds that. */
|
|
5
|
+
open?: boolean;
|
|
6
|
+
/** Whether it starts open, when the caller does not hold it. */
|
|
7
|
+
defaultOpen?: boolean;
|
|
8
|
+
/** Called when it opens or closes. */
|
|
9
|
+
onOpenChange?: (open: boolean) => void;
|
|
10
|
+
/**
|
|
11
|
+
* Whether a press outside it closes it. Turn it off while a form in it has
|
|
12
|
+
* changes that would be lost; Escape and the close button still work.
|
|
13
|
+
* Default `true`.
|
|
14
|
+
*/
|
|
15
|
+
dismissible?: boolean;
|
|
16
|
+
}
|
|
17
|
+
declare function DialogRoot({ children, open, defaultOpen, onOpenChange, dismissible, }: DialogProps): import("react").JSX.Element;
|
|
18
|
+
declare namespace DialogRoot {
|
|
19
|
+
var displayName: string;
|
|
20
|
+
}
|
|
21
|
+
export interface DialogTriggerProps extends Omit<ComponentProps<'button'>, 'children'> {
|
|
22
|
+
children?: ReactNode;
|
|
23
|
+
/**
|
|
24
|
+
* Your own element to be the trigger, such as a styled button. It is given
|
|
25
|
+
* the click handler and the attributes that tie it to the dialog.
|
|
26
|
+
*/
|
|
27
|
+
render?: ReactElement;
|
|
28
|
+
}
|
|
29
|
+
/** What opens the dialog. A plain button unless `render` supplies one. */
|
|
30
|
+
declare function DialogTrigger({ render, children, ...props }: DialogTriggerProps): import("react").JSX.Element;
|
|
31
|
+
declare namespace DialogTrigger {
|
|
32
|
+
var displayName: string;
|
|
33
|
+
}
|
|
34
|
+
export interface DialogContentProps extends Omit<ComponentProps<'div'>, 'children'> {
|
|
35
|
+
children?: ReactNode;
|
|
36
|
+
/**
|
|
37
|
+
* `inset` sets the task in a panel inside a darker band that holds the
|
|
38
|
+
* footer. `plain` is one surface with the footer ruled off. Default `inset`.
|
|
39
|
+
*/
|
|
40
|
+
variant?: 'inset' | 'plain';
|
|
41
|
+
/** How wide it may grow: `sm` 24rem, `md` 28rem, `lg` 36rem. Default `md`. */
|
|
42
|
+
size?: 'sm' | 'md' | 'lg';
|
|
43
|
+
/** Show the round close button in the top trailing corner. Default `true`. */
|
|
44
|
+
showClose?: boolean;
|
|
45
|
+
/** Frost the page behind it instead of only dimming it. */
|
|
46
|
+
blur?: boolean;
|
|
47
|
+
/**
|
|
48
|
+
* Draw it in the page instead of over it: no backdrop, no trigger, always
|
|
49
|
+
* there. For previews; `open` is ignored.
|
|
50
|
+
*/
|
|
51
|
+
inline?: boolean;
|
|
52
|
+
}
|
|
53
|
+
/** The dialog itself, with the dimmed page behind it. */
|
|
54
|
+
declare function DialogContent({ variant, size, showClose, blur, inline, className, children, ...props }: DialogContentProps): import("react").JSX.Element;
|
|
55
|
+
declare namespace DialogContent {
|
|
56
|
+
var displayName: string;
|
|
57
|
+
}
|
|
58
|
+
export interface DialogHeaderProps extends Omit<ComponentProps<'div'>, 'title'> {
|
|
59
|
+
/** The heading. It is also what the dialog is announced as. */
|
|
60
|
+
title?: ReactNode;
|
|
61
|
+
/** A line under the heading. */
|
|
62
|
+
description?: ReactNode;
|
|
63
|
+
}
|
|
64
|
+
/** The heading block. It leaves room for the close button beside the title. */
|
|
65
|
+
declare function DialogHeader({ title, description, className, children, ...props }: DialogHeaderProps): import("react").JSX.Element;
|
|
66
|
+
declare namespace DialogHeader {
|
|
67
|
+
var displayName: string;
|
|
68
|
+
}
|
|
69
|
+
export interface DialogTitleProps extends ComponentProps<'h2'> {
|
|
70
|
+
}
|
|
71
|
+
/** The dialog's name, announced when it opens. */
|
|
72
|
+
declare function DialogTitle({ className, ...props }: DialogTitleProps): import("react").JSX.Element;
|
|
73
|
+
declare namespace DialogTitle {
|
|
74
|
+
var displayName: string;
|
|
75
|
+
}
|
|
76
|
+
export interface DialogDescriptionProps extends ComponentProps<'p'> {
|
|
77
|
+
}
|
|
78
|
+
/** A sentence under the title, read out after it. */
|
|
79
|
+
declare function DialogDescription({ className, ...props }: DialogDescriptionProps): import("react").JSX.Element;
|
|
80
|
+
declare namespace DialogDescription {
|
|
81
|
+
var displayName: string;
|
|
82
|
+
}
|
|
83
|
+
export interface DialogBodyProps extends ComponentProps<'div'> {
|
|
84
|
+
}
|
|
85
|
+
/**
|
|
86
|
+
* The part that scrolls, between the header and the footer. Its children are
|
|
87
|
+
* laid out in a column with a gap, so a form's fields need no wrapper.
|
|
88
|
+
*/
|
|
89
|
+
declare function DialogBody({ className, children, ...props }: DialogBodyProps): import("react").JSX.Element;
|
|
90
|
+
declare namespace DialogBody {
|
|
91
|
+
var displayName: string;
|
|
92
|
+
}
|
|
93
|
+
export interface DialogFooterProps extends ComponentProps<'div'> {
|
|
94
|
+
}
|
|
95
|
+
/**
|
|
96
|
+
* The buttons. In the inset look they sit in the band under the panel as
|
|
97
|
+
* equal pills; in `plain` they sit at the end of a ruled strip. Keep it a
|
|
98
|
+
* direct child of `Dialog.Content`, so the band can find it.
|
|
99
|
+
*/
|
|
100
|
+
declare function DialogFooter({ className, ...props }: DialogFooterProps): import("react").JSX.Element;
|
|
101
|
+
declare namespace DialogFooter {
|
|
102
|
+
var displayName: string;
|
|
103
|
+
}
|
|
104
|
+
export interface DialogCloseProps extends ComponentProps<'button'> {
|
|
105
|
+
/** Your own element to close the dialog with, such as a Cancel button. */
|
|
106
|
+
render?: ReactElement;
|
|
107
|
+
/** Draw the cross glyph. Set for you on the built-in close button. */
|
|
108
|
+
icon?: boolean;
|
|
109
|
+
}
|
|
110
|
+
/** Closes the dialog. */
|
|
111
|
+
declare function DialogClose({ render, icon, children, ...props }: DialogCloseProps): import("react").JSX.Element;
|
|
112
|
+
declare namespace DialogClose {
|
|
113
|
+
var displayName: string;
|
|
114
|
+
}
|
|
115
|
+
export interface DialogListProps extends ComponentProps<'div'> {
|
|
116
|
+
}
|
|
117
|
+
/**
|
|
118
|
+
* A list of one-line choices in the body. The arrow keys, Home and End move
|
|
119
|
+
* between its items, and it opens scrolled to the selected one.
|
|
120
|
+
*/
|
|
121
|
+
declare function DialogList({ className, onKeyDown, children, ...props }: DialogListProps): import("react").JSX.Element;
|
|
122
|
+
declare namespace DialogList {
|
|
123
|
+
var displayName: string;
|
|
124
|
+
}
|
|
125
|
+
export interface DialogListGroupProps extends Omit<ComponentProps<'div'>, 'title'> {
|
|
126
|
+
/** The heading over the group, which stays pinned while its items scroll under it. */
|
|
127
|
+
label: ReactNode;
|
|
128
|
+
}
|
|
129
|
+
/** A run of items in `Dialog.List` under a heading of their own. */
|
|
130
|
+
declare function DialogListGroup({ label, className, children, ...props }: DialogListGroupProps): import("react").JSX.Element;
|
|
131
|
+
declare namespace DialogListGroup {
|
|
132
|
+
var displayName: string;
|
|
133
|
+
}
|
|
134
|
+
export interface DialogListItemProps extends Omit<ComponentProps<'div'>, 'onSelect'> {
|
|
135
|
+
/** Whether it is the chosen one: it is tinted and checked. */
|
|
136
|
+
selected?: boolean;
|
|
137
|
+
/** Called when it is pressed, or chosen with Enter or Space. */
|
|
138
|
+
onSelect?: () => void;
|
|
139
|
+
/** Quieter text at its end, in figures that line up: a time, a count. */
|
|
140
|
+
meta?: ReactNode;
|
|
141
|
+
/** Shown, but cannot be chosen. */
|
|
142
|
+
disabled?: boolean;
|
|
143
|
+
}
|
|
144
|
+
/** One choice in `Dialog.List`, on one line. */
|
|
145
|
+
declare function DialogListItem({ selected, onSelect, meta, disabled, className, onClick, onKeyDown, children, ...props }: DialogListItemProps): import("react").JSX.Element;
|
|
146
|
+
declare namespace DialogListItem {
|
|
147
|
+
var displayName: string;
|
|
148
|
+
}
|
|
149
|
+
export declare const Dialog: typeof DialogRoot & {
|
|
150
|
+
Trigger: typeof DialogTrigger;
|
|
151
|
+
Content: typeof DialogContent;
|
|
152
|
+
Header: typeof DialogHeader;
|
|
153
|
+
Title: typeof DialogTitle;
|
|
154
|
+
Description: typeof DialogDescription;
|
|
155
|
+
Body: typeof DialogBody;
|
|
156
|
+
Footer: typeof DialogFooter;
|
|
157
|
+
Close: typeof DialogClose;
|
|
158
|
+
List: typeof DialogList;
|
|
159
|
+
ListGroup: typeof DialogListGroup;
|
|
160
|
+
ListItem: typeof DialogListItem;
|
|
161
|
+
};
|
|
162
|
+
export { DialogTrigger, DialogContent, DialogHeader, DialogTitle, DialogDescription, DialogBody, DialogFooter, DialogClose, DialogList, DialogListGroup, DialogListItem, };
|