@fanvue/ui 3.30.0 → 3.32.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.
Files changed (54) hide show
  1. package/dist/cjs/components/AiButton/AiButton.cjs +8 -6
  2. package/dist/cjs/components/AiButton/AiButton.cjs.map +1 -1
  3. package/dist/cjs/components/ChatInput/ChatInput.cjs +6 -5
  4. package/dist/cjs/components/ChatInput/ChatInput.cjs.map +1 -1
  5. package/dist/cjs/components/DropdownMenu/DropdownMenuHeader.cjs +190 -0
  6. package/dist/cjs/components/DropdownMenu/DropdownMenuHeader.cjs.map +1 -0
  7. package/dist/cjs/components/DropdownMenu/DropdownMenuItem.cjs +213 -0
  8. package/dist/cjs/components/DropdownMenu/DropdownMenuItem.cjs.map +1 -0
  9. package/dist/cjs/components/DropdownMenu/DropdownMenuReorderGroup.cjs +438 -0
  10. package/dist/cjs/components/DropdownMenu/DropdownMenuReorderGroup.cjs.map +1 -0
  11. package/dist/cjs/components/DropdownMenu/DropdownMenuReorderItem.cjs +197 -0
  12. package/dist/cjs/components/DropdownMenu/DropdownMenuReorderItem.cjs.map +1 -0
  13. package/dist/cjs/components/DropdownMenu/DropdownMenuRoot.cjs +221 -0
  14. package/dist/cjs/components/DropdownMenu/DropdownMenuRoot.cjs.map +1 -0
  15. package/dist/cjs/components/DropdownMenu/DropdownMenuSelectionItems.cjs +128 -0
  16. package/dist/cjs/components/DropdownMenu/DropdownMenuSelectionItems.cjs.map +1 -0
  17. package/dist/cjs/components/DropdownMenu/context.cjs +26 -0
  18. package/dist/cjs/components/DropdownMenu/context.cjs.map +1 -0
  19. package/dist/cjs/components/DropdownMenu/reorderShared.cjs +38 -0
  20. package/dist/cjs/components/DropdownMenu/reorderShared.cjs.map +1 -0
  21. package/dist/cjs/components/SwitchButton/SwitchButton.cjs +97 -0
  22. package/dist/cjs/components/SwitchButton/SwitchButton.cjs.map +1 -0
  23. package/dist/cjs/index.cjs +21 -12
  24. package/dist/cjs/index.cjs.map +1 -1
  25. package/dist/components/AiButton/AiButton.mjs +8 -6
  26. package/dist/components/AiButton/AiButton.mjs.map +1 -1
  27. package/dist/components/ChatInput/ChatInput.mjs +2 -1
  28. package/dist/components/ChatInput/ChatInput.mjs.map +1 -1
  29. package/dist/components/DropdownMenu/DropdownMenuHeader.mjs +173 -0
  30. package/dist/components/DropdownMenu/DropdownMenuHeader.mjs.map +1 -0
  31. package/dist/components/DropdownMenu/DropdownMenuItem.mjs +195 -0
  32. package/dist/components/DropdownMenu/DropdownMenuItem.mjs.map +1 -0
  33. package/dist/components/DropdownMenu/DropdownMenuReorderGroup.mjs +421 -0
  34. package/dist/components/DropdownMenu/DropdownMenuReorderGroup.mjs.map +1 -0
  35. package/dist/components/DropdownMenu/DropdownMenuReorderItem.mjs +180 -0
  36. package/dist/components/DropdownMenu/DropdownMenuReorderItem.mjs.map +1 -0
  37. package/dist/components/DropdownMenu/DropdownMenuRoot.mjs +203 -0
  38. package/dist/components/DropdownMenu/DropdownMenuRoot.mjs.map +1 -0
  39. package/dist/components/DropdownMenu/DropdownMenuSelectionItems.mjs +110 -0
  40. package/dist/components/DropdownMenu/DropdownMenuSelectionItems.mjs.map +1 -0
  41. package/dist/components/DropdownMenu/context.mjs +9 -0
  42. package/dist/components/DropdownMenu/context.mjs.map +1 -0
  43. package/dist/components/DropdownMenu/reorderShared.mjs +21 -0
  44. package/dist/components/DropdownMenu/reorderShared.mjs.map +1 -0
  45. package/dist/components/SwitchButton/SwitchButton.mjs +80 -0
  46. package/dist/components/SwitchButton/SwitchButton.mjs.map +1 -0
  47. package/dist/index.d.ts +223 -1
  48. package/dist/index.mjs +10 -1
  49. package/dist/index.mjs.map +1 -1
  50. package/package.json +3 -2
  51. package/dist/cjs/components/DropdownMenu/DropdownMenu.cjs +0 -598
  52. package/dist/cjs/components/DropdownMenu/DropdownMenu.cjs.map +0 -1
  53. package/dist/components/DropdownMenu/DropdownMenu.mjs +0 -580
  54. package/dist/components/DropdownMenu/DropdownMenu.mjs.map +0 -1
@@ -0,0 +1,213 @@
1
+ "use client";
2
+ "use strict";
3
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
4
+ const jsxRuntime = require("react/jsx-runtime");
5
+ const DropdownMenuPrimitive = require("@radix-ui/react-dropdown-menu");
6
+ const reactSlot = require("@radix-ui/react-slot");
7
+ const React = require("react");
8
+ const cn = require("../../utils/cn.cjs");
9
+ const CheckIcon = require("../Icons/CheckIcon.cjs");
10
+ const context = require("./context.cjs");
11
+ function _interopNamespaceDefault(e) {
12
+ const n = Object.create(null, { [Symbol.toStringTag]: { value: "Module" } });
13
+ if (e) {
14
+ for (const k in e) {
15
+ if (k !== "default") {
16
+ const d = Object.getOwnPropertyDescriptor(e, k);
17
+ Object.defineProperty(n, k, d.get ? d : {
18
+ enumerable: true,
19
+ get: () => e[k]
20
+ });
21
+ }
22
+ }
23
+ }
24
+ n.default = e;
25
+ return Object.freeze(n);
26
+ }
27
+ const DropdownMenuPrimitive__namespace = /* @__PURE__ */ _interopNamespaceDefault(DropdownMenuPrimitive);
28
+ const React__namespace = /* @__PURE__ */ _interopNamespaceDefault(React);
29
+ const DropdownMenuLabel = React__namespace.forwardRef(({ className, position = "default", ...props }, ref) => {
30
+ const variant = React__namespace.useContext(context.DropdownMenuVariantContext);
31
+ const labelClassName = cn.cn(
32
+ "typography-description-12px-regular flex items-center px-3 text-content-secondary",
33
+ position === "top" ? "py-2" : "pt-4 pb-2",
34
+ className
35
+ );
36
+ if (variant === "sheet") {
37
+ return /* @__PURE__ */ jsxRuntime.jsx("div", { ref, className: labelClassName, ...props });
38
+ }
39
+ return /* @__PURE__ */ jsxRuntime.jsx(DropdownMenuPrimitive__namespace.Label, { ref, className: labelClassName, ...props });
40
+ });
41
+ DropdownMenuLabel.displayName = "DropdownMenuLabel";
42
+ const SIZE_NORMALIZED = {
43
+ "40": "40",
44
+ md: "40",
45
+ "32": "32",
46
+ sm: "32"
47
+ };
48
+ const ITEM_SIZE_CLASSES = {
49
+ "40": "min-h-10 py-2 typography-body-default-16px-regular",
50
+ "32": "min-h-8 py-[7px] typography-body-small-14px-regular"
51
+ };
52
+ const ITEM_COUNT_TYPOGRAPHY = {
53
+ "40": "typography-body-small-14px-regular",
54
+ "32": "typography-body-small-14px-regular"
55
+ };
56
+ function SelectedCheckIndicator({ hasDescription }) {
57
+ return /* @__PURE__ */ jsxRuntime.jsx(
58
+ CheckIcon.CheckIcon,
59
+ {
60
+ className: cn.cn(
61
+ "size-4 shrink-0 text-content-primary",
62
+ // The two-line layout switches the row to `items-start`, which would hang
63
+ // the tick off the title's line. A leading icon or avatar belongs there —
64
+ // it labels the title — but the tick is a property of the whole row, so it
65
+ // centres against both lines. {@link SelectItem} already does this.
66
+ hasDescription && "self-center"
67
+ )
68
+ }
69
+ );
70
+ }
71
+ const DropdownMenuItem = React__namespace.forwardRef(
72
+ ({
73
+ size = "40",
74
+ destructive,
75
+ leadingIcon,
76
+ avatar,
77
+ trailingIcon,
78
+ count,
79
+ description,
80
+ selected,
81
+ className,
82
+ children,
83
+ asChild,
84
+ onSelect,
85
+ disabled,
86
+ ...props
87
+ }, ref) => {
88
+ const variant = React__namespace.useContext(context.DropdownMenuVariantContext);
89
+ const toggleOpen = React__namespace.useContext(context.ToggleOpenContext);
90
+ const normalizedSize = SIZE_NORMALIZED[size];
91
+ const hasDescription = description != null;
92
+ const hasAvatar = avatar != null;
93
+ const itemClassName = cn.cn(
94
+ // `text-start` because the sheet variant renders the row as a <button>,
95
+ // whose UA-centred text misaligned it from the popper variant's rows.
96
+ "group flex w-full cursor-pointer gap-2 rounded-sm px-3 text-start outline-none",
97
+ hasDescription ? "items-start" : "items-center",
98
+ // The sheet's header runs the full width of the panel, so its rows have to
99
+ // come in off the edge themselves — 12px here on the panel's own 4px is the
100
+ // design's 16px. `w-auto` lets the column stretch them to the space left
101
+ // over; `w-full` plus a margin would overflow.
102
+ variant === "sheet" && "mx-3 w-auto",
103
+ ITEM_SIZE_CLASSES[normalizedSize],
104
+ // A 24px avatar would push the compact 32px row past its height with the
105
+ // default padding; tighten it so the avatar variant keeps the 32px contract.
106
+ hasAvatar && !hasDescription && normalizedSize === "32" && "py-1",
107
+ "data-[highlighted]:bg-neutral-alphas-50",
108
+ "data-[disabled]:cursor-not-allowed data-[disabled]:text-content-disabled",
109
+ "disabled:cursor-not-allowed disabled:text-content-disabled",
110
+ // Sheet-variant asChild items are marked disabled via aria-disabled
111
+ // (see below), not the native disabled attribute or Radix's
112
+ // data-disabled — neither selector above matches them.
113
+ "aria-disabled:cursor-not-allowed aria-disabled:text-content-disabled",
114
+ destructive && "text-error-content",
115
+ // bg-interaction-hover aliases to the same token as the plain hover
116
+ // background above, so a selected row would be indistinguishable from a
117
+ // hovered-but-unselected one. Use the next step up the neutral-alphas
118
+ // ramp instead (still a subtle overlay, not the heavy filled style).
119
+ selected && ["bg-neutral-alphas-100", "data-[highlighted]:bg-neutral-alphas-200"],
120
+ className
121
+ );
122
+ const iconAlignClassName = hasDescription ? "flex h-[18px] shrink-0 items-center" : null;
123
+ const countNode = count != null && /* @__PURE__ */ jsxRuntime.jsx(
124
+ "span",
125
+ {
126
+ className: cn.cn(
127
+ "shrink-0 tabular-nums",
128
+ iconAlignClassName,
129
+ ITEM_COUNT_TYPOGRAPHY[normalizedSize],
130
+ destructive ? "text-error-content" : "text-content-tertiary",
131
+ "group-data-[disabled]:text-content-disabled"
132
+ ),
133
+ children: count
134
+ }
135
+ );
136
+ const trailingNode = trailingIcon != null ? hasDescription ? /* @__PURE__ */ jsxRuntime.jsx("span", { className: iconAlignClassName, children: trailingIcon }) : trailingIcon : selected && /* @__PURE__ */ jsxRuntime.jsx(SelectedCheckIndicator, { hasDescription });
137
+ const itemChildren = /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
138
+ avatar != null ? /* @__PURE__ */ jsxRuntime.jsx("span", { className: cn.cn("shrink-0", iconAlignClassName), children: avatar }) : leadingIcon != null && (hasDescription ? /* @__PURE__ */ jsxRuntime.jsx("span", { className: iconAlignClassName, children: leadingIcon }) : leadingIcon),
139
+ hasDescription ? /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "flex min-w-0 flex-1 flex-col gap-0.5", children: [
140
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "typography-body-small-14px-semibold truncate", children }),
141
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "typography-body-small-14px-regular truncate text-content-secondary", children: description })
142
+ ] }) : /* @__PURE__ */ jsxRuntime.jsx("span", { className: "min-w-0 flex-1 truncate", children }),
143
+ countNode,
144
+ trailingNode
145
+ ] });
146
+ if (variant === "sheet") {
147
+ const Comp = asChild ? reactSlot.Slot : "button";
148
+ const { onClick: consumerOnClick, ...restProps } = props;
149
+ const sheetSpecificProps = !asChild ? { type: "button", disabled } : disabled ? { "aria-disabled": true } : {};
150
+ return /* @__PURE__ */ jsxRuntime.jsx(
151
+ Comp,
152
+ {
153
+ ref,
154
+ ...restProps,
155
+ ...sheetSpecificProps,
156
+ role: "option",
157
+ "aria-selected": selected,
158
+ className: itemClassName,
159
+ onClick: (event) => {
160
+ if (disabled) {
161
+ event.preventDefault();
162
+ return;
163
+ }
164
+ consumerOnClick?.(event);
165
+ if (event.defaultPrevented) return;
166
+ onSelect?.(event.nativeEvent);
167
+ if (!event.nativeEvent.defaultPrevented) toggleOpen?.(() => false);
168
+ },
169
+ children: asChild ? children : itemChildren
170
+ }
171
+ );
172
+ }
173
+ if (asChild) {
174
+ return /* @__PURE__ */ jsxRuntime.jsx(
175
+ DropdownMenuPrimitive__namespace.Item,
176
+ {
177
+ ref,
178
+ asChild: true,
179
+ className: itemClassName,
180
+ disabled,
181
+ onSelect,
182
+ ...props,
183
+ children
184
+ }
185
+ );
186
+ }
187
+ return /* @__PURE__ */ jsxRuntime.jsx(
188
+ DropdownMenuPrimitive__namespace.Item,
189
+ {
190
+ ref,
191
+ className: itemClassName,
192
+ disabled,
193
+ onSelect,
194
+ ...props,
195
+ children: itemChildren
196
+ }
197
+ );
198
+ }
199
+ );
200
+ DropdownMenuItem.displayName = "DropdownMenuItem";
201
+ const DropdownMenuSeparator = React__namespace.forwardRef(({ className, ...props }, ref) => {
202
+ const variant = React__namespace.useContext(context.DropdownMenuVariantContext);
203
+ const separatorClassName = cn.cn("my-1 h-px bg-neutral-alphas-200", className);
204
+ if (variant === "sheet") {
205
+ return /* @__PURE__ */ jsxRuntime.jsx("hr", { ref, className: separatorClassName, ...props });
206
+ }
207
+ return /* @__PURE__ */ jsxRuntime.jsx(DropdownMenuPrimitive__namespace.Separator, { ref, className: separatorClassName, ...props });
208
+ });
209
+ DropdownMenuSeparator.displayName = "DropdownMenuSeparator";
210
+ exports.DropdownMenuItem = DropdownMenuItem;
211
+ exports.DropdownMenuLabel = DropdownMenuLabel;
212
+ exports.DropdownMenuSeparator = DropdownMenuSeparator;
213
+ //# sourceMappingURL=DropdownMenuItem.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DropdownMenuItem.cjs","sources":["../../../../src/components/DropdownMenu/DropdownMenuItem.tsx"],"sourcesContent":["import * as DropdownMenuPrimitive from \"@radix-ui/react-dropdown-menu\";\nimport { Slot } from \"@radix-ui/react-slot\";\nimport * as React from \"react\";\nimport { cn } from \"../../utils/cn\";\nimport { CheckIcon } from \"../Icons/CheckIcon\";\nimport { DropdownMenuVariantContext, ToggleOpenContext } from \"./context\";\n\n/** Vertical placement of a {@link DropdownMenuLabel} within its group. */\nexport type DropdownMenuLabelPosition = \"default\" | \"top\";\n\n/** Props for the {@link DropdownMenuLabel} component. */\nexport interface DropdownMenuLabelProps\n extends React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Label> {\n /**\n * Vertical placement within the surrounding group. `\"top\"` is used for the\n * first label directly under a header; `\"default\"` adds extra top padding to\n * separate it from preceding items. @default \"default\"\n */\n position?: DropdownMenuLabelPosition;\n}\n\n/** A non-interactive label that groups related items within a menu. */\nexport const DropdownMenuLabel = React.forwardRef<\n React.ComponentRef<typeof DropdownMenuPrimitive.Label>,\n DropdownMenuLabelProps\n>(({ className, position = \"default\", ...props }, ref) => {\n const variant = React.useContext(DropdownMenuVariantContext);\n const labelClassName = cn(\n \"typography-description-12px-regular flex items-center px-3 text-content-secondary\",\n position === \"top\" ? \"py-2\" : \"pt-4 pb-2\",\n className,\n );\n\n // DropdownMenuPrimitive.Label requires Radix menu context, unavailable when\n // the sheet variant renders inside a Drawer (Dialog) instead.\n if (variant === \"sheet\") {\n return <div ref={ref} className={labelClassName} {...props} />;\n }\n\n return <DropdownMenuPrimitive.Label ref={ref} className={labelClassName} {...props} />;\n});\nDropdownMenuLabel.displayName = \"DropdownMenuLabel\";\n\n/**\n * Height preset for a dropdown menu item.\n *\n * `\"40\"` (default) and `\"32\"` are the v2 numeric tokens that mirror the Figma\n * design system. `\"sm\"` and `\"md\"` are deprecated aliases retained for\n * backwards compatibility — `\"sm\"` maps to `\"32\"`, `\"md\"` maps to `\"40\"`.\n */\nexport type DropdownMenuItemSize =\n | \"40\"\n | \"32\"\n /** @deprecated Use `\"32\"` instead. */\n | \"sm\"\n /** @deprecated Use `\"40\"` instead. */\n | \"md\";\n\nconst SIZE_NORMALIZED: Record<DropdownMenuItemSize, \"40\" | \"32\"> = {\n \"40\": \"40\",\n md: \"40\",\n \"32\": \"32\",\n sm: \"32\",\n};\n\nconst ITEM_SIZE_CLASSES: Record<\"40\" | \"32\", string> = {\n \"40\": \"min-h-10 py-2 typography-body-default-16px-regular\",\n \"32\": \"min-h-8 py-[7px] typography-body-small-14px-regular\",\n};\n\n/*\n * 14px at both heights. `V2 Menu Item` draws the count as `Body Small 14px/Regular`\n * in `content-tertiary` (node `21542:8629`), and the 40 row previously stepped up to\n * 16px — which also put the count's line box at 24px against the two-line layout's\n * 18px title leading.\n *\n * Only the 40 row is drawn in Figma: the component set's variants are Type and State\n * with no size axis. The 32 row is ours, and 14px matches the body type it already\n * uses, so both entries agree by construction rather than by design reference.\n */\nconst ITEM_COUNT_TYPOGRAPHY: Record<\"40\" | \"32\", string> = {\n \"40\": \"typography-body-small-14px-regular\",\n \"32\": \"typography-body-small-14px-regular\",\n};\n\n// Background alone can't reliably tell \"selected\" apart from a\n// hovered-but-unselected row across every theme/contrast combination (see the\n// neutral-alphas fix on itemClassName below) — pair it with an explicit\n// indicator, matching SelectItem's check indicator for the same V2 Menu Item\n// spec.\nfunction SelectedCheckIndicator({ hasDescription }: { hasDescription: boolean }) {\n return (\n <CheckIcon\n className={cn(\n \"size-4 shrink-0 text-content-primary\",\n // The two-line layout switches the row to `items-start`, which would hang\n // the tick off the title's line. A leading icon or avatar belongs there —\n // it labels the title — but the tick is a property of the whole row, so it\n // centres against both lines. {@link SelectItem} already does this.\n hasDescription && \"self-center\",\n )}\n />\n );\n}\n\nexport interface DropdownMenuItemProps\n extends React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Item> {\n /** Height of the menu item row. @default \"40\" */\n size?: DropdownMenuItemSize;\n /** Applies the destructive (error) treatment. Use for irreversible actions. @default false */\n destructive?: boolean;\n /** Icon (or other node) rendered before the label. Ignored when {@link DropdownMenuItemProps.avatar} is set. */\n leadingIcon?: React.ReactNode;\n /**\n * Leading avatar rendered in place of {@link DropdownMenuItemProps.leadingIcon},\n * for rows that represent a person or account. Pass an `Avatar` sized to `24`.\n * Takes precedence over `leadingIcon`.\n */\n avatar?: React.ReactNode;\n /**\n * Icon (or other node) rendered after the label. When\n * {@link DropdownMenuItemProps.selected} is true and no `trailingIcon` is\n * given, the built-in selected check indicator renders in this slot\n * instead — pass a `trailingIcon` to use a custom selected indicator (e.g.\n * a themed tick) rather than the default one.\n */\n trailingIcon?: React.ReactNode;\n /** Trailing count or number (e.g. an unread total) rendered before {@link DropdownMenuItemProps.trailingIcon}. */\n count?: React.ReactNode;\n /**\n * Optional secondary text rendered on a second line below the label. When\n * provided, the row switches to a two-line layout and the leading/trailing\n * icons align to the title line (top) rather than the row's vertical centre.\n */\n description?: React.ReactNode;\n /** Marks the item as the current selection in a single-select menu. @default false */\n selected?: boolean;\n}\n\n/**\n * An individual item within a {@link DropdownMenuContent}.\n *\n * @example\n * ```tsx\n * <DropdownMenuItem>Edit profile</DropdownMenuItem>\n * <DropdownMenuItem destructive>Delete</DropdownMenuItem>\n * <DropdownMenuItem leadingIcon={<EditIcon />}>Edit</DropdownMenuItem>\n *\n * // Feature-rich row with an avatar and a trailing count\n * <DropdownMenuItem avatar={<Avatar size={24} src={src} />} count=\"12\">\n * Jane Doe\n * </DropdownMenuItem>\n *\n * // As a link\n * <DropdownMenuItem asChild>\n * <a href=\"/settings\">Settings</a>\n * </DropdownMenuItem>\n * ```\n */\nexport const DropdownMenuItem = React.forwardRef<\n React.ComponentRef<typeof DropdownMenuPrimitive.Item>,\n DropdownMenuItemProps\n>(\n (\n {\n size = \"40\",\n destructive,\n leadingIcon,\n avatar,\n trailingIcon,\n count,\n description,\n selected,\n className,\n children,\n asChild,\n onSelect,\n disabled,\n ...props\n },\n ref,\n ) => {\n const variant = React.useContext(DropdownMenuVariantContext);\n const toggleOpen = React.useContext(ToggleOpenContext);\n const normalizedSize = SIZE_NORMALIZED[size];\n const hasDescription = description != null;\n const hasAvatar = avatar != null;\n const itemClassName = cn(\n // `text-start` because the sheet variant renders the row as a <button>,\n // whose UA-centred text misaligned it from the popper variant's rows.\n \"group flex w-full cursor-pointer gap-2 rounded-sm px-3 text-start outline-none\",\n hasDescription ? \"items-start\" : \"items-center\",\n // The sheet's header runs the full width of the panel, so its rows have to\n // come in off the edge themselves — 12px here on the panel's own 4px is the\n // design's 16px. `w-auto` lets the column stretch them to the space left\n // over; `w-full` plus a margin would overflow.\n variant === \"sheet\" && \"mx-3 w-auto\",\n ITEM_SIZE_CLASSES[normalizedSize],\n // A 24px avatar would push the compact 32px row past its height with the\n // default padding; tighten it so the avatar variant keeps the 32px contract.\n hasAvatar && !hasDescription && normalizedSize === \"32\" && \"py-1\",\n \"data-[highlighted]:bg-neutral-alphas-50\",\n \"data-[disabled]:cursor-not-allowed data-[disabled]:text-content-disabled\",\n \"disabled:cursor-not-allowed disabled:text-content-disabled\",\n // Sheet-variant asChild items are marked disabled via aria-disabled\n // (see below), not the native disabled attribute or Radix's\n // data-disabled — neither selector above matches them.\n \"aria-disabled:cursor-not-allowed aria-disabled:text-content-disabled\",\n destructive && \"text-error-content\",\n // bg-interaction-hover aliases to the same token as the plain hover\n // background above, so a selected row would be indistinguishable from a\n // hovered-but-unselected one. Use the next step up the neutral-alphas\n // ramp instead (still a subtle overlay, not the heavy filled style).\n selected && [\"bg-neutral-alphas-100\", \"data-[highlighted]:bg-neutral-alphas-200\"],\n className,\n );\n\n // In the two-line (description) layout everything beside the title sits on\n // the title's line, not the centre of the two-line block. A box the height of\n // that line centres each sibling on it whatever its own size — a 16px icon, a\n // 24px avatar, or the count's larger text box. The height is the title's, from\n // `typography-body-small-14px-semibold`; a `pt-*` nudge cannot do this because\n // the correct offset differs per sibling, and the previous `pt-1` was computed\n // against the single-line title's 24px leading, leaving all four 3px low.\n const iconAlignClassName = hasDescription ? \"flex h-[18px] shrink-0 items-center\" : null;\n\n const countNode = count != null && (\n <span\n className={cn(\n \"shrink-0 tabular-nums\",\n iconAlignClassName,\n ITEM_COUNT_TYPOGRAPHY[normalizedSize],\n destructive ? \"text-error-content\" : \"text-content-tertiary\",\n \"group-data-[disabled]:text-content-disabled\",\n )}\n >\n {count}\n </span>\n );\n\n // A caller-supplied trailingIcon always wins the trailing slot — some\n // consumers pass their own selected indicator (e.g. a themed tick) and\n // rely on it being shown as-is rather than replaced. Only fall back to\n // the built-in check indicator when selected and no trailingIcon is given.\n const trailingNode =\n trailingIcon != null ? (\n hasDescription ? (\n <span className={iconAlignClassName!}>{trailingIcon}</span>\n ) : (\n trailingIcon\n )\n ) : (\n selected && <SelectedCheckIndicator hasDescription={hasDescription} />\n );\n\n const itemChildren = (\n <>\n {avatar != null ? (\n <span className={cn(\"shrink-0\", iconAlignClassName)}>{avatar}</span>\n ) : (\n leadingIcon != null &&\n (hasDescription ? (\n <span className={iconAlignClassName!}>{leadingIcon}</span>\n ) : (\n leadingIcon\n ))\n )}\n {hasDescription ? (\n <span className=\"flex min-w-0 flex-1 flex-col gap-0.5\">\n {/*\n * The two-line row sets its own title type rather than inheriting the\n * row's: `V2 Menu Item` pairs a 14px semibold title with the 14px\n * regular description below it, where a single-line row's title is the\n * size's own 16px regular. It also settles the row's height — 18 + 2 +\n * 18 of text inside `py-2` is the design's 54px.\n */}\n <span className=\"typography-body-small-14px-semibold truncate\">{children}</span>\n <span className=\"typography-body-small-14px-regular truncate text-content-secondary\">\n {description}\n </span>\n </span>\n ) : (\n <span className=\"min-w-0 flex-1 truncate\">{children}</span>\n )}\n {countNode}\n {trailingNode}\n </>\n );\n\n // The sheet variant renders inside a Drawer (Dialog), not a Radix menu, so\n // DropdownMenuPrimitive.Item (which requires menu context) can't be used —\n // render a plain option element with equivalent selection semantics instead.\n // asChild goes through the same Slot primitive Radix's own Item uses\n // internally, so a custom element (e.g. a link) gets the option\n // role/handlers merged onto it without needing menu context.\n if (variant === \"sheet\") {\n const Comp = asChild ? Slot : \"button\";\n // Pull the consumer's onClick out of the passthrough spread so the\n // handler below can compose with it instead of the spread order\n // silently overwriting it (an explicit onClick after {...props} always\n // wins over the spread's).\n const { onClick: consumerOnClick, ...restProps } =\n props as React.ComponentPropsWithoutRef<\"button\">;\n const sheetSpecificProps = !asChild\n ? { type: \"button\" as const, disabled }\n : disabled\n ? { \"aria-disabled\": true }\n : {};\n return (\n <Comp\n ref={ref as React.Ref<HTMLButtonElement>}\n {...restProps}\n {...sheetSpecificProps}\n role=\"option\"\n aria-selected={selected}\n className={itemClassName}\n onClick={(event: React.MouseEvent<HTMLButtonElement>) => {\n // A native <button disabled> already blocks its click event, but\n // asChild's element (e.g. a link) has no such enforcement — guard\n // explicitly, and prevent the click's default action (e.g. anchor\n // navigation) since aria-disabled alone doesn't stop it.\n if (disabled) {\n event.preventDefault();\n return;\n }\n consumerOnClick?.(event);\n if (event.defaultPrevented) return;\n // Pass the real native event through, not a fake partial shape —\n // handlers that call any Event API beyond preventDefault (e.g.\n // stopPropagation, composedPath) need it to actually exist. It's\n // still live (currentTarget/target are valid) since we're inside\n // the same synchronous click handler that produced it.\n onSelect?.(event.nativeEvent);\n if (!event.nativeEvent.defaultPrevented) toggleOpen?.(() => false);\n }}\n >\n {asChild ? children : itemChildren}\n </Comp>\n );\n }\n\n if (asChild) {\n return (\n <DropdownMenuPrimitive.Item\n ref={ref}\n asChild\n className={itemClassName}\n disabled={disabled}\n onSelect={onSelect}\n {...props}\n >\n {children}\n </DropdownMenuPrimitive.Item>\n );\n }\n\n return (\n <DropdownMenuPrimitive.Item\n ref={ref}\n className={itemClassName}\n disabled={disabled}\n onSelect={onSelect}\n {...props}\n >\n {itemChildren}\n </DropdownMenuPrimitive.Item>\n );\n },\n);\nDropdownMenuItem.displayName = \"DropdownMenuItem\";\n\n/** Props for the {@link DropdownMenuSeparator} component. */\nexport interface DropdownMenuSeparatorProps\n extends React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Separator> {}\n\n/** Visual separator between groups of items. */\nexport const DropdownMenuSeparator = React.forwardRef<\n React.ComponentRef<typeof DropdownMenuPrimitive.Separator>,\n DropdownMenuSeparatorProps\n>(({ className, ...props }, ref) => {\n const variant = React.useContext(DropdownMenuVariantContext);\n const separatorClassName = cn(\"my-1 h-px bg-neutral-alphas-200\", className);\n\n // DropdownMenuPrimitive.Separator requires Radix menu context, unavailable\n // when the sheet variant renders inside a Drawer (Dialog) instead. <hr> is a\n // native separator, so it needs no ARIA role.\n if (variant === \"sheet\") {\n return <hr ref={ref as React.Ref<HTMLHRElement>} className={separatorClassName} {...props} />;\n }\n\n return <DropdownMenuPrimitive.Separator ref={ref} className={separatorClassName} {...props} />;\n});\nDropdownMenuSeparator.displayName = \"DropdownMenuSeparator\";\n"],"names":["React","DropdownMenuVariantContext","cn","jsx","DropdownMenuPrimitive","CheckIcon","ToggleOpenContext","jsxs","Fragment","Slot"],"mappings":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