@danxbot/ui 15.16.1 → 15.18.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/index.js +7019 -6826
- package/dist/index.js.map +1 -1
- package/dist/types/components/Dialog.d.ts +21 -4
- package/dist/types/components/IconStack.d.ts +28 -0
- package/dist/types/components/Menu.d.ts +44 -8
- package/dist/types/icons/data.d.ts +8 -0
- package/dist/types/index.d.ts +2 -1
- package/package.json +1 -1
|
@@ -108,7 +108,7 @@ export declare function Dialog({ trigger, open, onOpenChange, title, description
|
|
|
108
108
|
export declare function DialogClose({ children }: {
|
|
109
109
|
children: ReactNode;
|
|
110
110
|
}): import("react").JSX.Element;
|
|
111
|
-
|
|
111
|
+
interface AlertDialogBaseProps {
|
|
112
112
|
trigger?: ReactNode;
|
|
113
113
|
open?: boolean;
|
|
114
114
|
onOpenChange?: (open: boolean) => void;
|
|
@@ -116,13 +116,30 @@ export interface AlertDialogProps {
|
|
|
116
116
|
description?: ReactNode;
|
|
117
117
|
confirmLabel?: string;
|
|
118
118
|
cancelLabel?: string;
|
|
119
|
-
/** Styles the confirm button as destructive. */
|
|
120
|
-
destructive?: boolean;
|
|
121
119
|
loading?: boolean;
|
|
122
120
|
onConfirm?: () => void;
|
|
123
121
|
className?: string;
|
|
124
122
|
ref?: Ref<HTMLDivElement>;
|
|
125
123
|
}
|
|
124
|
+
/**
|
|
125
|
+
* The severity of what the dialog asks.
|
|
126
|
+
*
|
|
127
|
+
* `destructive` and `tone="warning"` are different questions and cannot both be
|
|
128
|
+
* true, so the type refuses the pair rather than letting one silently win:
|
|
129
|
+
* - `destructive` — "this cannot be undone": a red medallion and a red confirm.
|
|
130
|
+
* - `tone="warning"` — "this can be done, but not in the state things are in
|
|
131
|
+
* right now" (promote docs before the plan is complete): an amber
|
|
132
|
+
* medallion and an amber confirm, with the caller's description saying what
|
|
133
|
+
* may go wrong. Reversible, so the confirm is not red; unusual, so it is not
|
|
134
|
+
* the plain accent either.
|
|
135
|
+
*/
|
|
136
|
+
export type AlertDialogProps = AlertDialogBaseProps & ({
|
|
137
|
+
destructive: true;
|
|
138
|
+
tone?: never;
|
|
139
|
+
} | {
|
|
140
|
+
destructive?: false;
|
|
141
|
+
tone?: "default" | "warning";
|
|
142
|
+
});
|
|
126
143
|
/**
|
|
127
144
|
* A dialog that must be answered — no outside click, no Escape.
|
|
128
145
|
*
|
|
@@ -131,5 +148,5 @@ export interface AlertDialogProps {
|
|
|
131
148
|
* the pointer travelling in from the panel's content reaches the safe option
|
|
132
149
|
* before the destructive one, and keyboard focus lands on cancel by default.
|
|
133
150
|
*/
|
|
134
|
-
export declare function AlertDialog({ trigger, open, onOpenChange, title, description, confirmLabel, cancelLabel, destructive, loading, onConfirm, className, ref, }: AlertDialogProps): import("react").JSX.Element;
|
|
151
|
+
export declare function AlertDialog({ trigger, open, onOpenChange, title, description, confirmLabel, cancelLabel, destructive, tone, loading, onConfirm, className, ref, }: AlertDialogProps): import("react").JSX.Element;
|
|
135
152
|
export {};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import type { HTMLAttributes, Ref } from "react";
|
|
2
|
+
import { type IconName } from "./Icon";
|
|
3
|
+
export type IconStackTone = "neutral" | "accent" | "success" | "warning" | "danger" | "info" | "muted";
|
|
4
|
+
export interface IconStackBadge {
|
|
5
|
+
icon: IconName;
|
|
6
|
+
tone?: IconStackTone;
|
|
7
|
+
}
|
|
8
|
+
export interface IconStackItem {
|
|
9
|
+
icon: IconName;
|
|
10
|
+
tone?: IconStackTone;
|
|
11
|
+
/**
|
|
12
|
+
* The fact is ABSENT: a dashed, quiet outline in place of the filled chip.
|
|
13
|
+
* `tone` is ignored — an absent mark is always the muted one.
|
|
14
|
+
*/
|
|
15
|
+
empty?: boolean;
|
|
16
|
+
/** A smaller mark pinned to this chip's bottom-right corner. */
|
|
17
|
+
badge?: IconStackBadge;
|
|
18
|
+
}
|
|
19
|
+
export type IconStackSize = "sm" | "md" | "lg";
|
|
20
|
+
export interface IconStackProps extends Omit<HTMLAttributes<HTMLSpanElement>, "children" | "aria-label"> {
|
|
21
|
+
/** Marks in paint order: the LAST one is on top. At least one. */
|
|
22
|
+
items: readonly IconStackItem[];
|
|
23
|
+
/** The whole combination, in words. REQUIRED — the marks carry no text. */
|
|
24
|
+
label: string;
|
|
25
|
+
size?: IconStackSize;
|
|
26
|
+
ref?: Ref<HTMLSpanElement>;
|
|
27
|
+
}
|
|
28
|
+
export declare function IconStack({ items, label, size, className, ref, ...props }: IconStackProps): import("react").JSX.Element;
|
|
@@ -21,15 +21,15 @@ export interface MenuProps {
|
|
|
21
21
|
}
|
|
22
22
|
export declare function Menu({ trigger, side, align, open, onOpenChange, className, children, }: MenuProps): import("react").JSX.Element;
|
|
23
23
|
/**
|
|
24
|
-
* Neutral, or
|
|
24
|
+
* Neutral, destructive, or a caution.
|
|
25
25
|
*
|
|
26
|
-
*
|
|
27
|
-
*
|
|
28
|
-
*
|
|
29
|
-
*
|
|
30
|
-
*
|
|
26
|
+
* Not a palette: a menu row is picked, not read, so each tone beyond neutral
|
|
27
|
+
* is a property of the ACTION. `danger` says "this deletes something";
|
|
28
|
+
* `warning` says "this works, but not in the state the thing is in right
|
|
29
|
+
* now" (promote docs before the plan is complete, publish a draft). `Badge`
|
|
30
|
+
* has seven because a badge's whole job is to carry a state.
|
|
31
31
|
*/
|
|
32
|
-
export type MenuItemTone = "neutral" | "danger";
|
|
32
|
+
export type MenuItemTone = "neutral" | "danger" | "warning";
|
|
33
33
|
export interface MenuItemProps extends Omit<BaseMenu.Item.Props, "className"> {
|
|
34
34
|
className?: string;
|
|
35
35
|
/**
|
|
@@ -70,9 +70,16 @@ export interface MenuItemProps extends Omit<BaseMenu.Item.Props, "className"> {
|
|
|
70
70
|
* being the current choice in the first place.
|
|
71
71
|
*/
|
|
72
72
|
tone?: MenuItemTone;
|
|
73
|
+
/**
|
|
74
|
+
* A second, quieter line saying what picking the row DOES (or why it is
|
|
75
|
+
* cautioned) — shown under the label, like `MenuCheckboxItem.description`.
|
|
76
|
+
* Without it a caller hand-builds a two-line `children` stack, and the row's
|
|
77
|
+
* icon (absolutely positioned for a one-line row) stops lining up with it.
|
|
78
|
+
*/
|
|
79
|
+
description?: ReactNode;
|
|
73
80
|
ref?: Ref<HTMLDivElement>;
|
|
74
81
|
}
|
|
75
|
-
export declare function MenuItem({ className, icon, selected, tone, children, ref, ...props }: MenuItemProps): import("react").JSX.Element;
|
|
82
|
+
export declare function MenuItem({ className, icon, selected, tone, description, children, ref, ...props }: MenuItemProps): import("react").JSX.Element;
|
|
76
83
|
export interface MenuRadioGroupProps extends Omit<BaseMenu.RadioGroup.Props, "className"> {
|
|
77
84
|
className?: string;
|
|
78
85
|
}
|
|
@@ -83,6 +90,35 @@ export interface MenuRadioItemProps extends Omit<BaseMenu.RadioItem.Props, "clas
|
|
|
83
90
|
ref?: Ref<HTMLDivElement>;
|
|
84
91
|
}
|
|
85
92
|
export declare function MenuRadioItem({ className, children, ref, ...props }: MenuRadioItemProps): import("react").JSX.Element;
|
|
93
|
+
export interface MenuCheckboxItemProps extends Omit<BaseMenu.CheckboxItem.Props, "className"> {
|
|
94
|
+
className?: string;
|
|
95
|
+
/** Leading icon — same slot, and same reason it is a prop, as `MenuItem.icon`. */
|
|
96
|
+
icon?: ReactNode;
|
|
97
|
+
/**
|
|
98
|
+
* A second, quieter line saying what the toggle DOES — shown under the label.
|
|
99
|
+
* A switch row that cannot say what it controls sends the reader to a help
|
|
100
|
+
* page; one line here is the whole help page.
|
|
101
|
+
*/
|
|
102
|
+
description?: ReactNode;
|
|
103
|
+
ref?: Ref<HTMLDivElement>;
|
|
104
|
+
}
|
|
105
|
+
/**
|
|
106
|
+
* An independent on/off setting inside a menu.
|
|
107
|
+
*
|
|
108
|
+
* A `MenuItem` is an ACTION and closes the menu when picked; a setting that is
|
|
109
|
+
* flipped three at a time must not. Base UI's checkbox item keeps the menu open
|
|
110
|
+
* (`closeOnClick` defaults to `false` here, not by our choice) and announces
|
|
111
|
+
* itself as `menuitemcheckbox` with `aria-checked`, which a `MenuItem` carrying
|
|
112
|
+
* a hand-drawn tick cannot — that is the reason this is its own row and not a
|
|
113
|
+
* `selected` `MenuItem`.
|
|
114
|
+
*
|
|
115
|
+
* The state is drawn as a small trailing switch rather than a leading tick:
|
|
116
|
+
* every other row in the same popup puts its icon on the left, and a tick there
|
|
117
|
+
* reads as "this is the current choice among alternatives" (`MenuRadioItem`),
|
|
118
|
+
* not "this is on". The track is fill AND thumb position, so on/off survives
|
|
119
|
+
* the loss of colour.
|
|
120
|
+
*/
|
|
121
|
+
export declare function MenuCheckboxItem({ className, icon, description, children, ref, ...props }: MenuCheckboxItemProps): import("react").JSX.Element;
|
|
86
122
|
export interface MenuGroupProps {
|
|
87
123
|
/**
|
|
88
124
|
* The group's heading. A prop rather than a child component, so a label
|
|
@@ -355,6 +355,9 @@ export declare const coreIcons: {
|
|
|
355
355
|
readonly "loader-circle": readonly [readonly ["path", {
|
|
356
356
|
readonly d: "M21 12a9 9 0 1 1-6.219-8.56";
|
|
357
357
|
}]];
|
|
358
|
+
readonly shield: readonly [readonly ["path", {
|
|
359
|
+
readonly d: "M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z";
|
|
360
|
+
}]];
|
|
358
361
|
readonly "shield-check": readonly [readonly ["path", {
|
|
359
362
|
readonly d: "M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z";
|
|
360
363
|
}], readonly ["path", {
|
|
@@ -381,6 +384,11 @@ export declare const coreIcons: {
|
|
|
381
384
|
}], readonly ["path", {
|
|
382
385
|
readonly d: "M8.668 3.01A6 6 0 0 1 18 8c0 2.687.77 4.653 1.707 6.05";
|
|
383
386
|
}]];
|
|
387
|
+
readonly "book-open": readonly [readonly ["path", {
|
|
388
|
+
readonly d: "M12 7v14";
|
|
389
|
+
}], readonly ["path", {
|
|
390
|
+
readonly d: "M3 18a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h5a4 4 0 0 1 4 4 4 4 0 0 1 4-4h5a1 1 0 0 1 1 1v13a1 1 0 0 1-1 1h-6a3 3 0 0 0-3 3 3 3 0 0 0-3-3z";
|
|
391
|
+
}]];
|
|
384
392
|
readonly bookmark: readonly [readonly ["path", {
|
|
385
393
|
readonly d: "m19 21-7-4-7 4V5a2 2 0 0 1 2-2h10a2 2 0 0 1 2 2v16z";
|
|
386
394
|
}]];
|
package/dist/types/index.d.ts
CHANGED
|
@@ -38,7 +38,7 @@ export { TriStateSwitch, type TriStateSwitchProps, type TriStateSwitchSize, } fr
|
|
|
38
38
|
export { Dialog, DialogClose, AlertDialog, type DialogProps, type AlertDialogProps, } from "./components/Dialog";
|
|
39
39
|
export { Popover, PopoverClose, Tooltip, TooltipProvider, type PopoverProps, type TooltipProps, } from "./components/Popover";
|
|
40
40
|
export { Toaster, ToastProvider, useToast, type ToasterProps, type ToastProviderProps, type ToastOptions, type ToastTone, } from "./components/Toast";
|
|
41
|
-
export { Menu, MenuItem, MenuGroup, MenuRadioGroup, MenuRadioItem, MenuSeparator, type MenuProps, type MenuItemProps, type MenuItemTone, type MenuGroupProps, type MenuRadioGroupProps, type MenuRadioItemProps, } from "./components/Menu";
|
|
41
|
+
export { Menu, MenuItem, MenuGroup, MenuRadioGroup, MenuRadioItem, MenuCheckboxItem, MenuSeparator, type MenuProps, type MenuItemProps, type MenuItemTone, type MenuGroupProps, type MenuRadioGroupProps, type MenuRadioItemProps, type MenuCheckboxItemProps, } from "./components/Menu";
|
|
42
42
|
export { ThemeMenu, type ThemeMenuProps } from "./components/ThemeMenu";
|
|
43
43
|
export { AppShell, type AppShellProps, type NavItem, type NavSection, } from "./components/AppShell";
|
|
44
44
|
export { FileUpload, type FileUploadProps, type UploadFile } from "./components/FileUpload";
|
|
@@ -72,6 +72,7 @@ export { DataTable, TableEmptyState, CellStack, type DataTableProps, type TableD
|
|
|
72
72
|
export { CodeEditor, CodeEditorToolbar, CodeEditorCaption, CodeEditorCopyButton, CodeEditorWrapToggle, CodeEditorViewSwitch, type CodeEditorProps, type CodeEditorToolbarProps, type CodeEditorView, } from "./components/CodeEditor";
|
|
73
73
|
export { Markdown, CodeBlock, type MarkdownProps, type CodeBlockProps } from "./components/Markdown";
|
|
74
74
|
export { LineDiff, type LineDiffProps } from "./components/LineDiff";
|
|
75
|
+
export { IconStack, type IconStackProps, type IconStackItem, type IconStackBadge, type IconStackTone, type IconStackSize, } from "./components/IconStack";
|
|
75
76
|
export { MarkdownEditor, type MarkdownEditorProps, type MarkdownEditorHandle, } from "./components/MarkdownEditor";
|
|
76
77
|
export { ReadMore, type ReadMoreProps } from "./components/ReadMore";
|
|
77
78
|
export { MarkdownSurface, type SurfaceOptions, type Splice } from "./lib/markdown/surface";
|