@danxbot/ui 15.17.0 → 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.
@@ -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
- export interface AlertDialogProps {
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 {};
@@ -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 destructive.
24
+ * Neutral, destructive, or a caution.
25
25
  *
26
- * The same two-value union `IconButtonTone` declares, and named to match it
27
- * rather than to be exhaustive: a menu row is not a palette, and every tone
28
- * beyond "this one deletes something" would be a colour choice rather than a
29
- * property of the action. `Badge` has seven because a badge's whole job is to
30
- * carry a state; a menu item's job is to be picked.
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
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@danxbot/ui",
3
- "version": "15.17.0",
3
+ "version": "15.18.0",
4
4
  "type": "module",
5
5
  "description": "Danxbot — a domain-agnostic React design system with motion as a first-class primitive.",
6
6
  "license": "MIT",