@danxbot/ui 4.1.6 → 4.1.8
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 +617 -604
- package/dist/index.js.map +1 -1
- package/dist/types/components/Menu.d.ts +18 -1
- package/package.json +1 -1
|
@@ -32,6 +32,23 @@ export declare function Menu({ trigger, side, align, open, onOpenChange, classNa
|
|
|
32
32
|
export type MenuItemTone = "neutral" | "danger";
|
|
33
33
|
export interface MenuItemProps extends Omit<BaseMenu.Item.Props, "className"> {
|
|
34
34
|
className?: string;
|
|
35
|
+
/**
|
|
36
|
+
* Leading icon, positioned exactly where `MenuSub`'s own icon slot sits —
|
|
37
|
+
* absolutely at the row's left edge, inside the `pl-8` the row's own
|
|
38
|
+
* padding already reserves for it.
|
|
39
|
+
*
|
|
40
|
+
* A ROW WITH AN ICON MUST USE THIS, NOT AN INLINE `<Icon>` AMONG `children`.
|
|
41
|
+
* `ITEM`'s `pl-8` exists so an icon rendered here lines up under a sibling
|
|
42
|
+
* `MenuSub`'s trigger icon (which uses the identical `absolute left-2`
|
|
43
|
+
* placement) — an icon laid out inline as a normal flex child instead sits
|
|
44
|
+
* to the RIGHT of that padding, one full icon-width further in than every
|
|
45
|
+
* `MenuSub` row beside it. That drift is exactly what misaligned this
|
|
46
|
+
* app's account menu before this prop existed: `children` carried a
|
|
47
|
+
* hand-rolled `<span className="flex items-center gap-2">` wrapping icon
|
|
48
|
+
* and label together, which reads fine in isolation and wrong the moment a
|
|
49
|
+
* `MenuSub` shares the same popup.
|
|
50
|
+
*/
|
|
51
|
+
icon?: ReactNode;
|
|
35
52
|
/**
|
|
36
53
|
* Marks this row as the current choice among alternatives.
|
|
37
54
|
*
|
|
@@ -57,7 +74,7 @@ export interface MenuItemProps extends Omit<BaseMenu.Item.Props, "className"> {
|
|
|
57
74
|
tone?: MenuItemTone;
|
|
58
75
|
ref?: Ref<HTMLDivElement>;
|
|
59
76
|
}
|
|
60
|
-
export declare function MenuItem({ className, selected, tone, children, ref, ...props }: MenuItemProps): import("react").JSX.Element;
|
|
77
|
+
export declare function MenuItem({ className, icon, selected, tone, children, ref, ...props }: MenuItemProps): import("react").JSX.Element;
|
|
61
78
|
export interface MenuRadioGroupProps extends Omit<BaseMenu.RadioGroup.Props, "className"> {
|
|
62
79
|
className?: string;
|
|
63
80
|
}
|