@fanvue/ui 3.37.1 → 3.39.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 (27) hide show
  1. package/dist/cjs/components/ChatEmbed/ChatEmbed.cjs +315 -0
  2. package/dist/cjs/components/ChatEmbed/ChatEmbed.cjs.map +1 -0
  3. package/dist/cjs/components/DropdownMenu/DropdownMenuItem.cjs +24 -25
  4. package/dist/cjs/components/DropdownMenu/DropdownMenuItem.cjs.map +1 -1
  5. package/dist/cjs/components/DropdownMenu/DropdownMenuRoot.cjs +7 -8
  6. package/dist/cjs/components/DropdownMenu/DropdownMenuRoot.cjs.map +1 -1
  7. package/dist/cjs/components/LiveStatus/LiveStatus.cjs +51 -0
  8. package/dist/cjs/components/LiveStatus/LiveStatus.cjs.map +1 -0
  9. package/dist/cjs/components/SwitchField/SwitchField.cjs +12 -1
  10. package/dist/cjs/components/SwitchField/SwitchField.cjs.map +1 -1
  11. package/dist/cjs/index.cjs +6 -0
  12. package/dist/cjs/index.cjs.map +1 -1
  13. package/dist/components/ChatEmbed/ChatEmbed.mjs +298 -0
  14. package/dist/components/ChatEmbed/ChatEmbed.mjs.map +1 -0
  15. package/dist/components/DropdownMenu/DropdownMenuItem.mjs +24 -25
  16. package/dist/components/DropdownMenu/DropdownMenuItem.mjs.map +1 -1
  17. package/dist/components/DropdownMenu/DropdownMenuRoot.mjs +7 -8
  18. package/dist/components/DropdownMenu/DropdownMenuRoot.mjs.map +1 -1
  19. package/dist/components/LiveStatus/LiveStatus.mjs +34 -0
  20. package/dist/components/LiveStatus/LiveStatus.mjs.map +1 -0
  21. package/dist/components/SwitchField/SwitchField.mjs +12 -1
  22. package/dist/components/SwitchField/SwitchField.mjs.map +1 -1
  23. package/dist/index.d.ts +178 -5
  24. package/dist/index.mjs +6 -0
  25. package/dist/index.mjs.map +1 -1
  26. package/dist/styles/theme.css +21 -2
  27. package/package.json +9 -9
@@ -0,0 +1,315 @@
1
+ "use client";
2
+ "use strict";
3
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
4
+ const jsxRuntime = require("react/jsx-runtime");
5
+ const React = require("react");
6
+ const cn = require("../../utils/cn.cjs");
7
+ const AiDisclosureBadge = require("../AiDisclosureBadge/AiDisclosureBadge.cjs");
8
+ const Avatar = require("../Avatar/Avatar.cjs");
9
+ const Skeleton = require("../Skeleton/Skeleton.cjs");
10
+ const UserDisplayName = require("../UserDisplayName/UserDisplayName.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 React__namespace = /* @__PURE__ */ _interopNamespaceDefault(React);
28
+ const FRAME = "relative isolate flex w-full max-w-100 flex-col overflow-hidden rounded-sm after:pointer-events-none after:absolute after:inset-0 after:z-10 after:rounded-[inherit] after:border after:border-neutral-alphas-100";
29
+ const HEIGHT = {
30
+ creator: "h-40",
31
+ experience: "h-[239px]"
32
+ };
33
+ const SCRIM_FADE = "bg-linear-to-b from-transparent via-40% via-[color-mix(in_srgb,var(--color-content-always-black)_40%,transparent)] to-[color-mix(in_srgb,var(--color-content-always-black)_88%,transparent)]";
34
+ const SCRIM_SOFT = "bg-linear-to-b from-transparent via-40% via-[color-mix(in_srgb,var(--color-content-always-black)_24%,transparent)] to-[color-mix(in_srgb,var(--color-content-always-black)_40%,transparent)]";
35
+ const PROGRESSIVE_BLUR = [
36
+ "backdrop-blur-[4px] [mask-image:linear-gradient(to_bottom,transparent_13%,black_42%)]",
37
+ "backdrop-blur-[8px] [mask-image:linear-gradient(to_bottom,transparent_42%,black_71%)]",
38
+ "backdrop-blur-[12px] [mask-image:linear-gradient(to_bottom,transparent_71%,black)]"
39
+ ];
40
+ const MEDIA_FILL = "*:size-full [&>img]:object-cover [&>video]:object-cover";
41
+ const OVERLAY = "absolute inset-0 z-[1] cursor-pointer rounded-[inherit] focus-visible:shadow-focus-ring focus-visible:outline-none";
42
+ const DEFAULT_UNAVAILABLE = {
43
+ creator: "This profile is no longer available",
44
+ experience: "This experience is no longer available"
45
+ };
46
+ function SocialProof({ avatars, name, label }) {
47
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex min-w-0 items-center gap-2", children: [
48
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex shrink-0", children: avatars.map((avatar, index) => /* @__PURE__ */ jsxRuntime.jsx(
49
+ "span",
50
+ {
51
+ className: cn.cn(
52
+ "flex",
53
+ index < avatars.length - 1 && "-mr-2",
54
+ index > 0 && "[mask-image:radial-gradient(circle_at_-4px_50%,transparent_14px,black_14.5px)]"
55
+ ),
56
+ children: /* @__PURE__ */ jsxRuntime.jsx(Avatar.Avatar, { size: 24, ...avatar })
57
+ },
58
+ index
59
+ )) }),
60
+ /* @__PURE__ */ jsxRuntime.jsxs("p", { className: "m-0 flex min-w-0 items-center gap-1 whitespace-nowrap text-content-always-white", children: [
61
+ name && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "typography-body-small-14px-semibold max-w-30 truncate", children: name }),
62
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "typography-body-small-14px-regular shrink-0", children: label })
63
+ ] })
64
+ ] });
65
+ }
66
+ function Media({
67
+ media,
68
+ backdrop,
69
+ vertical,
70
+ greyscale
71
+ }) {
72
+ if (!media) return null;
73
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "pointer-events-none absolute inset-0 select-none", children: [
74
+ vertical ? /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
75
+ /* @__PURE__ */ jsxRuntime.jsx(
76
+ "div",
77
+ {
78
+ "aria-hidden": "true",
79
+ className: cn.cn(
80
+ "-translate-1/2 absolute top-1/2 left-1/2 h-[709px] w-[475px] blur-[20px]",
81
+ MEDIA_FILL
82
+ ),
83
+ children: backdrop
84
+ }
85
+ ),
86
+ /* @__PURE__ */ jsxRuntime.jsx(
87
+ "div",
88
+ {
89
+ className: cn.cn(
90
+ "absolute inset-y-0 left-1/2 aspect-9/16 -translate-x-1/2 shadow-md",
91
+ MEDIA_FILL
92
+ ),
93
+ children: media
94
+ }
95
+ )
96
+ ] }) : /* @__PURE__ */ jsxRuntime.jsx("div", { className: cn.cn("absolute inset-0", MEDIA_FILL), children: media }),
97
+ greyscale && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "absolute inset-0 bg-content-always-black mix-blend-saturation" })
98
+ ] });
99
+ }
100
+ function Scrim({ experience }) {
101
+ return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
102
+ PROGRESSIVE_BLUR.map((step) => /* @__PURE__ */ jsxRuntime.jsx("div", { "aria-hidden": "true", className: cn.cn("absolute inset-0", step) }, step)),
103
+ /* @__PURE__ */ jsxRuntime.jsx("div", { "aria-hidden": "true", className: cn.cn("absolute inset-0 mix-blend-luminosity", SCRIM_FADE) }),
104
+ experience && /* @__PURE__ */ jsxRuntime.jsx("div", { "aria-hidden": "true", className: cn.cn("absolute inset-0 mix-blend-multiply", SCRIM_SOFT) })
105
+ ] });
106
+ }
107
+ function CreatorName({
108
+ verified,
109
+ verifiedLabel,
110
+ aiDisclosure,
111
+ aiDisclosureLabel,
112
+ nameId,
113
+ className,
114
+ children
115
+ }) {
116
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex min-w-0 items-center gap-1", children: [
117
+ /* @__PURE__ */ jsxRuntime.jsx(
118
+ UserDisplayName.UserDisplayName,
119
+ {
120
+ component: "p",
121
+ verified,
122
+ verifiedLabel,
123
+ className: cn.cn("m-0 [&>[role=img]]:ml-1 [&>span:empty+[role=img]]:ml-0", className),
124
+ children: children && /* @__PURE__ */ jsxRuntime.jsx("span", { id: nameId, children })
125
+ }
126
+ ),
127
+ aiDisclosure && /* @__PURE__ */ jsxRuntime.jsx(
128
+ AiDisclosureBadge.AiDisclosureBadge,
129
+ {
130
+ tone: "light",
131
+ role: "img",
132
+ "aria-hidden": false,
133
+ "aria-label": aiDisclosureLabel,
134
+ className: "shrink-0"
135
+ }
136
+ )
137
+ ] });
138
+ }
139
+ function TopRow({
140
+ badge,
141
+ category,
142
+ meta
143
+ }) {
144
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "relative flex items-center justify-between gap-2 px-3 pt-3", children: [
145
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex min-w-0 items-center gap-1", children: [
146
+ badge,
147
+ category && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "typography-description-12px-semibold whitespace-nowrap rounded-xs bg-buttons-always-white-default px-2 py-1 text-content-always-black", children: category })
148
+ ] }),
149
+ meta && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "typography-description-12px-semibold whitespace-nowrap rounded-full bg-background-overlay-default px-2 py-1 text-center text-content-always-white backdrop-blur-[10px]", children: meta })
150
+ ] });
151
+ }
152
+ function OpenOverlay({
153
+ href,
154
+ target,
155
+ onOpen,
156
+ labelledBy
157
+ }) {
158
+ if (href) {
159
+ return (
160
+ // biome-ignore lint/a11y/useAnchorContent: Named by the visible title via aria-labelledby
161
+ /* @__PURE__ */ jsxRuntime.jsx(
162
+ "a",
163
+ {
164
+ href,
165
+ target,
166
+ rel: target === "_blank" ? "noopener noreferrer" : void 0,
167
+ "aria-labelledby": labelledBy,
168
+ className: OVERLAY
169
+ }
170
+ )
171
+ );
172
+ }
173
+ if (!onOpen) return null;
174
+ return /* @__PURE__ */ jsxRuntime.jsx("button", { type: "button", onClick: onOpen, "aria-labelledby": labelledBy, className: OVERLAY });
175
+ }
176
+ const ChatEmbed = React__namespace.forwardRef(
177
+ ({
178
+ variant = "creator",
179
+ media,
180
+ mediaBackdrop,
181
+ verticalMedia = false,
182
+ avatar,
183
+ title,
184
+ subtitle,
185
+ verified = false,
186
+ verifiedLabel = "Verified",
187
+ aiDisclosure = false,
188
+ aiDisclosureLabel = "AI creator",
189
+ action,
190
+ badge,
191
+ category,
192
+ meta,
193
+ inactive = false,
194
+ href,
195
+ target,
196
+ onOpen,
197
+ socialProof,
198
+ className,
199
+ ...props
200
+ }, ref) => {
201
+ const titleId = React__namespace.useId();
202
+ const isExperience = variant === "experience";
203
+ const hasTopRow = Boolean(badge || category || meta);
204
+ const badges = { verified, verifiedLabel, aiDisclosure, aiDisclosureLabel };
205
+ return /* @__PURE__ */ jsxRuntime.jsxs(
206
+ "div",
207
+ {
208
+ ref,
209
+ className: cn.cn(
210
+ FRAME,
211
+ HEIGHT[variant],
212
+ "bg-content-always-black",
213
+ hasTopRow ? "justify-between" : "justify-end",
214
+ className
215
+ ),
216
+ ...props,
217
+ children: [
218
+ /* @__PURE__ */ jsxRuntime.jsx(
219
+ Media,
220
+ {
221
+ media,
222
+ backdrop: mediaBackdrop,
223
+ vertical: verticalMedia,
224
+ greyscale: inactive
225
+ }
226
+ ),
227
+ /* @__PURE__ */ jsxRuntime.jsx(OpenOverlay, { href, target, onOpen, labelledBy: titleId }),
228
+ hasTopRow && /* @__PURE__ */ jsxRuntime.jsx(TopRow, { badge, category, meta }),
229
+ /* @__PURE__ */ jsxRuntime.jsxs(
230
+ "div",
231
+ {
232
+ className: cn.cn("relative flex flex-col gap-2 px-3 pb-3", isExperience ? "pt-6" : "pt-3"),
233
+ children: [
234
+ /* @__PURE__ */ jsxRuntime.jsx(Scrim, { experience: isExperience }),
235
+ isExperience && socialProof && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "relative", children: /* @__PURE__ */ jsxRuntime.jsx(SocialProof, { ...socialProof }) }),
236
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: cn.cn("relative flex items-center", isExperience ? "gap-6" : "gap-2"), children: [
237
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex min-w-0 flex-1 items-center gap-3", children: [
238
+ avatar && /* @__PURE__ */ jsxRuntime.jsx(Avatar.Avatar, { size: 40, ...avatar }),
239
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex min-w-0 flex-col justify-center text-content-always-white", children: isExperience ? /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
240
+ /* @__PURE__ */ jsxRuntime.jsx("p", { id: titleId, className: "typography-body-default-16px-semibold m-0 truncate", children: title }),
241
+ (subtitle || verified || aiDisclosure) && /* @__PURE__ */ jsxRuntime.jsx(CreatorName, { ...badges, className: "typography-body-small-14px-regular", children: subtitle })
242
+ ] }) : /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
243
+ /* @__PURE__ */ jsxRuntime.jsx(
244
+ CreatorName,
245
+ {
246
+ ...badges,
247
+ nameId: titleId,
248
+ className: "typography-body-default-16px-semibold",
249
+ children: title
250
+ }
251
+ ),
252
+ subtitle && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "typography-body-small-14px-regular m-0 truncate", children: subtitle })
253
+ ] }) })
254
+ ] }),
255
+ action && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "relative z-[2] shrink-0", children: action })
256
+ ] })
257
+ ]
258
+ }
259
+ )
260
+ ]
261
+ }
262
+ );
263
+ }
264
+ );
265
+ ChatEmbed.displayName = "ChatEmbed";
266
+ const ChatEmbedSkeleton = React__namespace.forwardRef(
267
+ ({ variant = "creator", label = "Loading", className, ...props }, ref) => {
268
+ return /* @__PURE__ */ jsxRuntime.jsxs(
269
+ "div",
270
+ {
271
+ ref,
272
+ "aria-busy": "true",
273
+ className: cn.cn(FRAME, HEIGHT[variant], "justify-end bg-surface-secondary", className),
274
+ ...props,
275
+ children: [
276
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "sr-only", children: label }),
277
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "relative flex items-center gap-3 p-3", children: [
278
+ /* @__PURE__ */ jsxRuntime.jsx(Skeleton.Skeleton, { variant: "circular", width: 40, height: 40, className: "shrink-0" }),
279
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex min-w-0 flex-1 flex-col gap-1", children: [
280
+ /* @__PURE__ */ jsxRuntime.jsx(Skeleton.Skeleton, { width: "50%", height: 16 }),
281
+ /* @__PURE__ */ jsxRuntime.jsx(Skeleton.Skeleton, { width: "30%", height: 14 })
282
+ ] })
283
+ ] })
284
+ ]
285
+ }
286
+ );
287
+ }
288
+ );
289
+ ChatEmbedSkeleton.displayName = "ChatEmbedSkeleton";
290
+ const ChatEmbedUnavailable = React__namespace.forwardRef(
291
+ ({ variant = "creator", icon, className, children, ...props }, ref) => {
292
+ return /* @__PURE__ */ jsxRuntime.jsxs(
293
+ "div",
294
+ {
295
+ ref,
296
+ className: cn.cn(
297
+ FRAME,
298
+ HEIGHT[variant],
299
+ "items-center justify-center gap-2 bg-surface-secondary px-6 text-center text-content-secondary",
300
+ className
301
+ ),
302
+ ...props,
303
+ children: [
304
+ icon && /* @__PURE__ */ jsxRuntime.jsx("span", { "aria-hidden": "true", className: "flex", children: icon }),
305
+ /* @__PURE__ */ jsxRuntime.jsx("p", { className: "typography-body-small-14px-regular m-0", children: children ?? DEFAULT_UNAVAILABLE[variant] })
306
+ ]
307
+ }
308
+ );
309
+ }
310
+ );
311
+ ChatEmbedUnavailable.displayName = "ChatEmbedUnavailable";
312
+ exports.ChatEmbed = ChatEmbed;
313
+ exports.ChatEmbedSkeleton = ChatEmbedSkeleton;
314
+ exports.ChatEmbedUnavailable = ChatEmbedUnavailable;
315
+ //# sourceMappingURL=ChatEmbed.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ChatEmbed.cjs","sources":["../../../../src/components/ChatEmbed/ChatEmbed.tsx"],"sourcesContent":["import * as React from \"react\";\nimport { cn } from \"../../utils/cn\";\nimport { AiDisclosureBadge } from \"../AiDisclosureBadge/AiDisclosureBadge\";\nimport { Avatar, type AvatarProps } from \"../Avatar/Avatar\";\nimport { Skeleton } from \"../Skeleton/Skeleton\";\nimport { UserDisplayName } from \"../UserDisplayName/UserDisplayName\";\n\n/** Layout of the embed: a creator profile card or a fan experience card. */\nexport type ChatEmbedVariant = \"creator\" | \"experience\";\n\n/** Overlapping avatars and copy showing who else is taking part. */\nexport interface ChatEmbedSocialProof {\n /** Avatars shown in the overlapping stack, left to right. */\n avatars: AvatarProps[];\n /** Name shown in bold before the label, truncated at 120px. */\n name?: React.ReactNode;\n /** Copy shown after the name, e.g. \"+2 watching\". */\n label: React.ReactNode;\n}\n\ninterface ChatEmbedBaseProps\n extends Omit<React.HTMLAttributes<HTMLDivElement>, \"title\" | \"onClick\"> {\n /** Media filling the card, typically an `img` or `video`, over a dark surface. */\n media?: React.ReactNode;\n /** Still image blurred behind `verticalMedia`, e.g. the same image or a video's poster frame. */\n mediaBackdrop?: React.ReactNode;\n /** Frame portrait media in a centred 9:16 column over `mediaBackdrop`. @default false */\n verticalMedia?: boolean;\n /** Avatar shown at the start of the profile row. */\n avatar?: AvatarProps;\n /** Primary line of the profile row: a display name or an experience title. */\n title: React.ReactNode;\n /** Secondary line under the title, e.g. a handle or \"Made by @jane_doe\". */\n subtitle?: React.ReactNode;\n /** Show the verified badge on the creator line. @default false */\n verified?: boolean;\n /** Accessible label for the verified badge. @default \"Verified\" */\n verifiedLabel?: string;\n /** Show the EU AI-disclosure badge on the creator line. @default false */\n aiDisclosure?: boolean;\n /** Accessible label for the AI-disclosure badge. @default \"AI creator\" */\n aiDisclosureLabel?: string;\n /** Action at the end of the profile row, typically a `Button` with `variant=\"white\"` and `size=\"32\"`. */\n action?: React.ReactNode;\n /** Badge in the top-left corner, typically a {@link LiveStatus}. */\n badge?: React.ReactNode;\n /** Short category label shown as a tag after the badge, e.g. \"Game\" or \"Audio\". */\n category?: React.ReactNode;\n /** Short copy in a translucent pill in the top-right corner, e.g. \"2 hours ago\". */\n meta?: React.ReactNode;\n /** Renders the media in greyscale, e.g. once a live has ended. @default false */\n inactive?: boolean;\n}\n\ninterface ChatEmbedLinkProps {\n /** Makes the whole card a link to this URL, named by the title. */\n href: string;\n /** Where to open `href`; `\"_blank\"` adds `rel=\"noopener noreferrer\"`. */\n target?: React.HTMLAttributeAnchorTarget;\n /** Not available with `href`. */\n onOpen?: never;\n}\n\ninterface ChatEmbedButtonProps {\n /** Not available with `onOpen`. */\n href?: never;\n /** Not available with `onOpen`. */\n target?: never;\n /** Makes the whole card a button named by the title, e.g. to open a dialog. */\n onOpen?: () => void;\n}\n\ninterface ChatEmbedCreatorProps extends ChatEmbedBaseProps {\n /** Layout of the embed. @default \"creator\" */\n variant?: \"creator\";\n /** Only available on the `experience` variant. */\n socialProof?: never;\n}\n\ninterface ChatEmbedExperienceProps extends ChatEmbedBaseProps {\n /** Layout of the embed. */\n variant: \"experience\";\n /** Social proof row shown above the profile row. */\n socialProof?: ChatEmbedSocialProof;\n}\n\n/** Props for {@link ChatEmbed}. `socialProof` is only accepted on `experience`, and `href` and `onOpen` are exclusive. */\nexport type ChatEmbedProps = (ChatEmbedCreatorProps | ChatEmbedExperienceProps) &\n (ChatEmbedLinkProps | ChatEmbedButtonProps);\n\nexport interface ChatEmbedSkeletonProps extends React.HTMLAttributes<HTMLDivElement> {\n /** Layout to match while the embed loads. @default \"creator\" */\n variant?: ChatEmbedVariant;\n /** Visually hidden text read by screen readers in place of the placeholder. @default \"Loading\" */\n label?: string;\n}\n\nexport interface ChatEmbedUnavailableProps extends React.HTMLAttributes<HTMLDivElement> {\n /** Layout to match the embed it replaces. @default \"creator\" */\n variant?: ChatEmbedVariant;\n /** Icon shown above the message. */\n icon?: React.ReactNode;\n}\n\nconst FRAME =\n \"relative isolate flex w-full max-w-100 flex-col overflow-hidden rounded-sm after:pointer-events-none after:absolute after:inset-0 after:z-10 after:rounded-[inherit] after:border after:border-neutral-alphas-100\";\n\nconst HEIGHT: Record<ChatEmbedVariant, string> = {\n creator: \"h-40\",\n experience: \"h-[239px]\",\n};\n\nconst SCRIM_FADE =\n \"bg-linear-to-b from-transparent via-40% via-[color-mix(in_srgb,var(--color-content-always-black)_40%,transparent)] to-[color-mix(in_srgb,var(--color-content-always-black)_88%,transparent)]\";\n\nconst SCRIM_SOFT =\n \"bg-linear-to-b from-transparent via-40% via-[color-mix(in_srgb,var(--color-content-always-black)_24%,transparent)] to-[color-mix(in_srgb,var(--color-content-always-black)_40%,transparent)]\";\n\nconst PROGRESSIVE_BLUR = [\n \"backdrop-blur-[4px] [mask-image:linear-gradient(to_bottom,transparent_13%,black_42%)]\",\n \"backdrop-blur-[8px] [mask-image:linear-gradient(to_bottom,transparent_42%,black_71%)]\",\n \"backdrop-blur-[12px] [mask-image:linear-gradient(to_bottom,transparent_71%,black)]\",\n];\n\nconst MEDIA_FILL = \"*:size-full [&>img]:object-cover [&>video]:object-cover\";\n\nconst OVERLAY =\n \"absolute inset-0 z-[1] cursor-pointer rounded-[inherit] focus-visible:shadow-focus-ring focus-visible:outline-none\";\n\nconst DEFAULT_UNAVAILABLE: Record<ChatEmbedVariant, string> = {\n creator: \"This profile is no longer available\",\n experience: \"This experience is no longer available\",\n};\n\nfunction SocialProof({ avatars, name, label }: ChatEmbedSocialProof) {\n return (\n <div className=\"flex min-w-0 items-center gap-2\">\n <div className=\"flex shrink-0\">\n {avatars.map((avatar, index) => (\n <span\n // biome-ignore lint/suspicious/noArrayIndexKey: avatars can share a src and the stack never reorders\n key={index}\n className={cn(\n \"flex\",\n index < avatars.length - 1 && \"-mr-2\",\n index > 0 &&\n \"[mask-image:radial-gradient(circle_at_-4px_50%,transparent_14px,black_14.5px)]\",\n )}\n >\n <Avatar size={24} {...avatar} />\n </span>\n ))}\n </div>\n <p className=\"m-0 flex min-w-0 items-center gap-1 whitespace-nowrap text-content-always-white\">\n {name && (\n <span className=\"typography-body-small-14px-semibold max-w-30 truncate\">{name}</span>\n )}\n <span className=\"typography-body-small-14px-regular shrink-0\">{label}</span>\n </p>\n </div>\n );\n}\n\nfunction Media({\n media,\n backdrop,\n vertical,\n greyscale,\n}: {\n media?: React.ReactNode;\n backdrop?: React.ReactNode;\n vertical: boolean;\n greyscale: boolean;\n}) {\n if (!media) return null;\n\n return (\n <div className=\"pointer-events-none absolute inset-0 select-none\">\n {vertical ? (\n <>\n <div\n aria-hidden=\"true\"\n className={cn(\n \"-translate-1/2 absolute top-1/2 left-1/2 h-[709px] w-[475px] blur-[20px]\",\n MEDIA_FILL,\n )}\n >\n {backdrop}\n </div>\n <div\n className={cn(\n \"absolute inset-y-0 left-1/2 aspect-9/16 -translate-x-1/2 shadow-md\",\n MEDIA_FILL,\n )}\n >\n {media}\n </div>\n </>\n ) : (\n <div className={cn(\"absolute inset-0\", MEDIA_FILL)}>{media}</div>\n )}\n {greyscale && (\n <div className=\"absolute inset-0 bg-content-always-black mix-blend-saturation\" />\n )}\n </div>\n );\n}\n\nfunction Scrim({ experience }: { experience: boolean }) {\n return (\n <>\n {PROGRESSIVE_BLUR.map((step) => (\n <div key={step} aria-hidden=\"true\" className={cn(\"absolute inset-0\", step)} />\n ))}\n <div aria-hidden=\"true\" className={cn(\"absolute inset-0 mix-blend-luminosity\", SCRIM_FADE)} />\n {experience && (\n <div aria-hidden=\"true\" className={cn(\"absolute inset-0 mix-blend-multiply\", SCRIM_SOFT)} />\n )}\n </>\n );\n}\n\nfunction CreatorName({\n verified,\n verifiedLabel,\n aiDisclosure,\n aiDisclosureLabel,\n nameId,\n className,\n children,\n}: {\n verified: boolean;\n verifiedLabel: string;\n aiDisclosure: boolean;\n aiDisclosureLabel: string;\n nameId?: string;\n className: string;\n children?: React.ReactNode;\n}) {\n return (\n <div className=\"flex min-w-0 items-center gap-1\">\n <UserDisplayName\n component=\"p\"\n verified={verified}\n verifiedLabel={verifiedLabel}\n className={cn(\"m-0 [&>[role=img]]:ml-1 [&>span:empty+[role=img]]:ml-0\", className)}\n >\n {children && <span id={nameId}>{children}</span>}\n </UserDisplayName>\n {aiDisclosure && (\n <AiDisclosureBadge\n tone=\"light\"\n role=\"img\"\n aria-hidden={false}\n aria-label={aiDisclosureLabel}\n className=\"shrink-0\"\n />\n )}\n </div>\n );\n}\n\nfunction TopRow({\n badge,\n category,\n meta,\n}: Pick<ChatEmbedBaseProps, \"badge\" | \"category\" | \"meta\">) {\n return (\n <div className=\"relative flex items-center justify-between gap-2 px-3 pt-3\">\n <div className=\"flex min-w-0 items-center gap-1\">\n {badge}\n {category && (\n <span className=\"typography-description-12px-semibold whitespace-nowrap rounded-xs bg-buttons-always-white-default px-2 py-1 text-content-always-black\">\n {category}\n </span>\n )}\n </div>\n {meta && (\n <span className=\"typography-description-12px-semibold whitespace-nowrap rounded-full bg-background-overlay-default px-2 py-1 text-center text-content-always-white backdrop-blur-[10px]\">\n {meta}\n </span>\n )}\n </div>\n );\n}\n\nfunction OpenOverlay({\n href,\n target,\n onOpen,\n labelledBy,\n}: {\n href?: string;\n target?: React.HTMLAttributeAnchorTarget;\n onOpen?: () => void;\n labelledBy: string;\n}) {\n if (href) {\n return (\n // biome-ignore lint/a11y/useAnchorContent: Named by the visible title via aria-labelledby\n <a\n href={href}\n target={target}\n rel={target === \"_blank\" ? \"noopener noreferrer\" : undefined}\n aria-labelledby={labelledBy}\n className={OVERLAY}\n />\n );\n }\n if (!onOpen) return null;\n return <button type=\"button\" onClick={onOpen} aria-labelledby={labelledBy} className={OVERLAY} />;\n}\n\n/**\n * A card embedded in a chat thread that links out to a creator profile or a fan\n * experience such as a live stream or game. Media fills the card and the profile\n * row sits on a blurred scrim along the bottom edge.\n *\n * The `creator` variant is 160px tall and the `experience` variant 239px; both\n * fill their container up to 400px wide. Pass `href` (or `onOpen`) to make the\n * whole card clickable; the `action` stays separately clickable above it. Use\n * {@link ChatEmbedSkeleton} while the embed's data loads and\n * {@link ChatEmbedUnavailable} when the shared item no longer exists.\n *\n * Give `media` meaningful alt text when it conveys content, or `alt=\"\"` when the\n * title already describes it. When `media` is a video with `verticalMedia`, pass\n * its poster frame as `mediaBackdrop` so the video is not decoded twice.\n * `socialProof` is shown to everyone in the chat, so prefer a count over naming\n * other fans.\n *\n * @example\n * ```tsx\n * <ChatEmbed\n * variant=\"experience\"\n * href=\"https://www.fanvue.com\"\n * badge={<LiveStatus variant=\"live\" />}\n * category=\"Audio\"\n * media={<img src=\"/stream.jpg\" alt=\"\" />}\n * avatar={{ src: \"/avatar.jpg\", fallback: \"JD\" }}\n * title=\"Friday night Q&A\"\n * subtitle=\"@jane_doe\"\n * action={<Button variant=\"white\" size=\"32\">Join</Button>}\n * />\n * ```\n */\nexport const ChatEmbed = React.forwardRef<HTMLDivElement, ChatEmbedProps>(\n (\n {\n variant = \"creator\",\n media,\n mediaBackdrop,\n verticalMedia = false,\n avatar,\n title,\n subtitle,\n verified = false,\n verifiedLabel = \"Verified\",\n aiDisclosure = false,\n aiDisclosureLabel = \"AI creator\",\n action,\n badge,\n category,\n meta,\n inactive = false,\n href,\n target,\n onOpen,\n socialProof,\n className,\n ...props\n },\n ref,\n ) => {\n const titleId = React.useId();\n const isExperience = variant === \"experience\";\n const hasTopRow = Boolean(badge || category || meta);\n const badges = { verified, verifiedLabel, aiDisclosure, aiDisclosureLabel };\n\n return (\n <div\n ref={ref}\n className={cn(\n FRAME,\n HEIGHT[variant],\n \"bg-content-always-black\",\n hasTopRow ? \"justify-between\" : \"justify-end\",\n className,\n )}\n {...props}\n >\n <Media\n media={media}\n backdrop={mediaBackdrop}\n vertical={verticalMedia}\n greyscale={inactive}\n />\n <OpenOverlay href={href} target={target} onOpen={onOpen} labelledBy={titleId} />\n\n {hasTopRow && <TopRow badge={badge} category={category} meta={meta} />}\n\n <div\n className={cn(\"relative flex flex-col gap-2 px-3 pb-3\", isExperience ? \"pt-6\" : \"pt-3\")}\n >\n <Scrim experience={isExperience} />\n\n {isExperience && socialProof && (\n <div className=\"relative\">\n <SocialProof {...socialProof} />\n </div>\n )}\n\n <div className={cn(\"relative flex items-center\", isExperience ? \"gap-6\" : \"gap-2\")}>\n <div className=\"flex min-w-0 flex-1 items-center gap-3\">\n {avatar && <Avatar size={40} {...avatar} />}\n <div className=\"flex min-w-0 flex-col justify-center text-content-always-white\">\n {isExperience ? (\n <>\n <p id={titleId} className=\"typography-body-default-16px-semibold m-0 truncate\">\n {title}\n </p>\n {(subtitle || verified || aiDisclosure) && (\n <CreatorName {...badges} className=\"typography-body-small-14px-regular\">\n {subtitle}\n </CreatorName>\n )}\n </>\n ) : (\n <>\n <CreatorName\n {...badges}\n nameId={titleId}\n className=\"typography-body-default-16px-semibold\"\n >\n {title}\n </CreatorName>\n {subtitle && (\n <p className=\"typography-body-small-14px-regular m-0 truncate\">{subtitle}</p>\n )}\n </>\n )}\n </div>\n </div>\n {action && <div className=\"relative z-[2] shrink-0\">{action}</div>}\n </div>\n </div>\n </div>\n );\n },\n);\n\nChatEmbed.displayName = \"ChatEmbed\";\n\n/**\n * Loading placeholder sized to match a {@link ChatEmbed}, shown while the data\n * for a shared link is being fetched.\n *\n * @example\n * ```tsx\n * <ChatEmbedSkeleton variant=\"experience\" />\n * ```\n */\nexport const ChatEmbedSkeleton = React.forwardRef<HTMLDivElement, ChatEmbedSkeletonProps>(\n ({ variant = \"creator\", label = \"Loading\", className, ...props }, ref) => {\n return (\n <div\n ref={ref}\n aria-busy=\"true\"\n className={cn(FRAME, HEIGHT[variant], \"justify-end bg-surface-secondary\", className)}\n {...props}\n >\n <span className=\"sr-only\">{label}</span>\n <div className=\"relative flex items-center gap-3 p-3\">\n <Skeleton variant=\"circular\" width={40} height={40} className=\"shrink-0\" />\n <div className=\"flex min-w-0 flex-1 flex-col gap-1\">\n <Skeleton width=\"50%\" height={16} />\n <Skeleton width=\"30%\" height={14} />\n </div>\n </div>\n </div>\n );\n },\n);\n\nChatEmbedSkeleton.displayName = \"ChatEmbedSkeleton\";\n\n/**\n * Placeholder sized to match a {@link ChatEmbed}, shown in place of the card when\n * the shared profile or experience has been removed, hidden or unpublished.\n * Pass `children` to localise the message.\n *\n * @example\n * ```tsx\n * <ChatEmbedUnavailable variant=\"experience\" />\n * ```\n */\nexport const ChatEmbedUnavailable = React.forwardRef<HTMLDivElement, ChatEmbedUnavailableProps>(\n ({ variant = \"creator\", icon, className, children, ...props }, ref) => {\n return (\n <div\n ref={ref}\n className={cn(\n FRAME,\n HEIGHT[variant],\n \"items-center justify-center gap-2 bg-surface-secondary px-6 text-center text-content-secondary\",\n className,\n )}\n {...props}\n >\n {icon && (\n <span aria-hidden=\"true\" className=\"flex\">\n {icon}\n </span>\n )}\n <p className=\"typography-body-small-14px-regular m-0\">\n {children ?? DEFAULT_UNAVAILABLE[variant]}\n </p>\n </div>\n );\n },\n);\n\nChatEmbedUnavailable.displayName = \"ChatEmbedUnavailable\";\n"],"names":["jsxs","jsx","cn","Avatar","Fragment","UserDisplayName","AiDisclosureBadge","React","Skeleton"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAwGA,MAAM,QACJ;AAEF,MAAM,SAA2C;AAAA,EAC/C,SAAS;AAAA,EACT,YAAY;AACd;AAEA,MAAM,aACJ;AAEF,MAAM,aACJ;AAEF,MAAM,mBAAmB;AAAA,EACvB;AAAA,EACA;AAAA,EACA;AACF;AAEA,MAAM,aAAa;AAEnB,MAAM,UACJ;AAEF,MAAM,sBAAwD;AAAA,EAC5D,SAAS;AAAA,EACT,YAAY;AACd;AAEA,SAAS,YAAY,EAAE,SAAS,MAAM,SAA+B;AACnE,SACEA,2BAAAA,KAAC,OAAA,EAAI,WAAU,mCACb,UAAA;AAAA,IAAAC,2BAAAA,IAAC,SAAI,WAAU,iBACZ,kBAAQ,IAAI,CAAC,QAAQ,UACpBA,2BAAAA;AAAAA,MAAC;AAAA,MAAA;AAAA,QAGC,WAAWC,GAAAA;AAAAA,UACT;AAAA,UACA,QAAQ,QAAQ,SAAS,KAAK;AAAA,UAC9B,QAAQ,KACN;AAAA,QAAA;AAAA,QAGJ,UAAAD,2BAAAA,IAACE,OAAAA,QAAA,EAAO,MAAM,IAAK,GAAG,OAAA,CAAQ;AAAA,MAAA;AAAA,MARzB;AAAA,IAAA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ACA,OAAO,OAAO;AAAA,UACd;AAAA,UACA;AAAA,QAAA;AAAA,QAED,GAAG;AAAA,QAEH,UAAA;AAAA,UAAA,uCACE,QAAA,EAAK,eAAY,QAAO,WAAU,QAChC,UAAA,MACH;AAAA,yCAED,KAAA,EAAE,WAAU,0CACV,UAAA,YAAY,oBAAoB,OAAO,EAAA,CAC1C;AAAA,QAAA;AAAA,MAAA;AAAA,IAAA;AAAA,EAGN;AACF;AAEA,qBAAqB,cAAc;;;;"}
@@ -6,7 +6,6 @@ const DropdownMenuPrimitive = require("@radix-ui/react-dropdown-menu");
6
6
  const reactSlot = require("@radix-ui/react-slot");
7
7
  const React = require("react");
8
8
  const cn = require("../../utils/cn.cjs");
9
- const CheckIcon = require("../Icons/CheckIcon.cjs");
10
9
  const context = require("./context.cjs");
11
10
  function _interopNamespaceDefault(e) {
12
11
  const n = Object.create(null, { [Symbol.toStringTag]: { value: "Module" } });
@@ -53,21 +52,10 @@ const ITEM_COUNT_TYPOGRAPHY = {
53
52
  "40": "typography-body-small-14px-regular",
54
53
  "32": "typography-body-small-14px-regular"
55
54
  };
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
- }
55
+ const ITEM_SELECTED_TYPOGRAPHY = {
56
+ "40": "typography-body-default-16px-semibold",
57
+ "32": "typography-body-small-14px-semibold"
58
+ };
71
59
  const DropdownMenuItem = React__namespace.forwardRef(
72
60
  ({
73
61
  size = "40",
@@ -93,7 +81,7 @@ const DropdownMenuItem = React__namespace.forwardRef(
93
81
  const itemClassName = cn.cn(
94
82
  // `text-start` because the sheet variant renders the row as a <button>,
95
83
  // 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",
84
+ "group flex w-full cursor-pointer gap-2 rounded-xs px-3 text-start outline-none",
97
85
  hasDescription ? "items-start" : "items-center",
98
86
  // The sheet's header runs the full width of the panel, so its rows have to
99
87
  // come in off the edge themselves — 12px here on the panel's own 4px is the
@@ -112,11 +100,13 @@ const DropdownMenuItem = React__namespace.forwardRef(
112
100
  // data-disabled — neither selector above matches them.
113
101
  "aria-disabled:cursor-not-allowed aria-disabled:text-content-disabled",
114
102
  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"],
103
+ // `V2 Menu Item` Selected: a `Buttons/Primary/Default` fill with semibold
104
+ // `Content/Primary Inverted` text. The highlighted override keeps the fill
105
+ // when the row is also hovered or keyboard-focused.
106
+ selected && [
107
+ "bg-buttons-primary-default text-content-primary-inverted data-[highlighted]:bg-buttons-primary-default",
108
+ !hasDescription && ITEM_SELECTED_TYPOGRAPHY[normalizedSize]
109
+ ],
120
110
  className
121
111
  );
122
112
  const iconAlignClassName = hasDescription ? "flex h-[18px] shrink-0 items-center" : null;
@@ -127,18 +117,27 @@ const DropdownMenuItem = React__namespace.forwardRef(
127
117
  "shrink-0 tabular-nums",
128
118
  iconAlignClassName,
129
119
  ITEM_COUNT_TYPOGRAPHY[normalizedSize],
130
- destructive ? "text-error-content" : "text-content-tertiary",
120
+ destructive ? "text-error-content" : selected ? "text-content-primary-inverted" : "text-content-tertiary",
131
121
  "group-data-[disabled]:text-content-disabled"
132
122
  ),
133
123
  children: count
134
124
  }
135
125
  );
136
- const trailingNode = trailingIcon != null ? hasDescription ? /* @__PURE__ */ jsxRuntime.jsx("span", { className: iconAlignClassName, children: trailingIcon }) : trailingIcon : selected && /* @__PURE__ */ jsxRuntime.jsx(SelectedCheckIndicator, { hasDescription });
126
+ const trailingNode = trailingIcon != null && (hasDescription ? /* @__PURE__ */ jsxRuntime.jsx("span", { className: iconAlignClassName, children: trailingIcon }) : trailingIcon);
137
127
  const itemChildren = /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
138
128
  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
129
  hasDescription ? /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "flex min-w-0 flex-1 flex-col gap-0.5", children: [
140
130
  /* @__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 })
131
+ /* @__PURE__ */ jsxRuntime.jsx(
132
+ "span",
133
+ {
134
+ className: cn.cn(
135
+ "typography-body-small-14px-regular truncate",
136
+ selected ? "text-content-primary-inverted" : "text-content-secondary"
137
+ ),
138
+ children: description
139
+ }
140
+ )
142
141
  ] }) : /* @__PURE__ */ jsxRuntime.jsx("span", { className: "min-w-0 flex-1 truncate", children }),
143
142
  countNode,
144
143
  trailingNode
@@ -1 +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":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAsBO,MAAM,oBAAoBA,iBAAM,WAGrC,CAAC,EAAE,WAAW,WAAW,WAAW,GAAG,MAAA,GAAS,QAAQ;AACxD,QAAM,UAAUA,iBAAM,WAAWC,kCAA0B;AAC3D,QAAM,iBAAiBC,GAAAA;AAAAA,IACrB;AAAA,IACA,aAAa,QAAQ,SAAS;AAAA,IAC9B;AAAA,EAAA;AAKF,MAAI,YAAY,SAAS;AACvB,0CAAQ,OAAA,EAAI,KAAU,WAAW,gBAAiB,GAAG,OAAO;AAAA,EAC9D;AAEA,SAAOC,2BAAAA,IAACC,iCAAsB,OAAtB,EAA4B,KAAU,WAAW,gBAAiB,GAAG,OAAO;AACtF,CAAC;AACD,kBAAkB,cAAc;AAiBhC,MAAM,kBAA6D;AAAA,EACjE,MAAM;AAAA,EACN,IAAI;AAAA,EACJ,MAAM;AAAA,EACN,IAAI;AACN;AAEA,MAAM,oBAAiD;AAAA,EACrD,MAAM;AAAA,EACN,MAAM;AACR;AAYA,MAAM,wBAAqD;AAAA,EACzD,MAAM;AAAA,EACN,MAAM;AACR;AAOA,SAAS,uBAAuB,EAAE,kBAA+C;AAC/E,SACED,2BAAAA;AAAAA,IAACE,UAAAA;AAAAA,IAAA;AAAA,MACC,WAAWH,GAAAA;AAAAA,QACT;AAAA;AAAA;AAAA;AAAA;AAAA,QAKA,kBAAkB;AAAA,MAAA;AAAA,IACpB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QAACC,iCAAsB;AAAA,QAAtB;AAAA,UACC;AAAA,UACA,SAAO;AAAA,UACP,WAAW;AAAA,UACX;AAAA,UACA;AAAA,UACC,GAAG;AAAA,UAEH;AAAA,QAAA;AAAA,MAAA;AAAA,IAGP;AAEA,WACED,2BAAAA;AAAAA,MAACC,iCAAsB;AAAA,MAAtB;AAAA,QACC;AAAA,QACA,WAAW;AAAA,QACX;AAAA,QACA;AAAA,QACC,GAAG;AAAA,QAEH,UAAA;AAAA,MAAA;AAAA,IAAA;AAAA,EAGP;AACF;AACA,iBAAiB,cAAc;AAOxB,MAAM,wBAAwBJ,iBAAM,WAGzC,CAAC,EAAE,WAAW,GAAG,MAAA,GAAS,QAAQ;AAClC,QAAM,UAAUA,iBAAM,WAAWC,kCAA0B;AAC3D,QAAM,qBAAqBC,GAAAA,GAAG,mCAAmC,SAAS;AAK1E,MAAI,YAAY,SAAS;AACvB,0CAAQ,MAAA,EAAG,KAAsC,WAAW,oBAAqB,GAAG,OAAO;AAAA,EAC7F;AAEA,SAAOC,2BAAAA,IAACC,iCAAsB,WAAtB,EAAgC,KAAU,WAAW,oBAAqB,GAAG,OAAO;AAC9F,CAAC;AACD,sBAAsB,cAAc;;;;"}
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 { 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\nconst ITEM_SELECTED_TYPOGRAPHY: Record<\"40\" | \"32\", string> = {\n \"40\": \"typography-body-default-16px-semibold\",\n \"32\": \"typography-body-small-14px-semibold\",\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.\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-xs 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 // `V2 Menu Item` Selected: a `Buttons/Primary/Default` fill with semibold\n // `Content/Primary Inverted` text. The highlighted override keeps the fill\n // when the row is also hovered or keyboard-focused.\n selected && [\n \"bg-buttons-primary-default text-content-primary-inverted data-[highlighted]:bg-buttons-primary-default\",\n !hasDescription && ITEM_SELECTED_TYPOGRAPHY[normalizedSize],\n ],\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\n ? \"text-error-content\"\n : selected\n ? \"text-content-primary-inverted\"\n : \"text-content-tertiary\",\n \"group-data-[disabled]:text-content-disabled\",\n )}\n >\n {count}\n </span>\n );\n\n const trailingNode =\n trailingIcon != null &&\n (hasDescription ? <span className={iconAlignClassName!}>{trailingIcon}</span> : trailingIcon);\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\n className={cn(\n \"typography-body-small-14px-regular truncate\",\n selected ? \"text-content-primary-inverted\" : \"text-content-secondary\",\n )}\n >\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","ToggleOpenContext","jsxs","Fragment","Slot"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAqBO,MAAM,oBAAoBA,iBAAM,WAGrC,CAAC,EAAE,WAAW,WAAW,WAAW,GAAG,MAAA,GAAS,QAAQ;AACxD,QAAM,UAAUA,iBAAM,WAAWC,kCAA0B;AAC3D,QAAM,iBAAiBC,GAAAA;AAAAA,IACrB;AAAA,IACA,aAAa,QAAQ,SAAS;AAAA,IAC9B;AAAA,EAAA;AAKF,MAAI,YAAY,SAAS;AACvB,0CAAQ,OAAA,EAAI,KAAU,WAAW,gBAAiB,GAAG,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;;"}
@@ -185,15 +185,14 @@ const DropdownMenuContent = React__namespace.forwardRef(
185
185
  sideOffset,
186
186
  collisionPadding,
187
187
  className: cn.cn(
188
- // Panel tokens come from `V2 Menu Dropdown` (product file node
189
- // `7393:62008`): `rounded-lg` (24px) over `Background/Secondary`, a
190
- // `Border/Strong` stroke, and 8px of padding. The 12px `rounded-sm` is
191
- // the row radius, not the panel's — the two were transposed here.
188
+ // Panel tokens come from `V2 Menu Dropdown`: `rounded-sm` (12px) over
189
+ // `Surface/Primary`, a `Border/Primary` stroke, 4px of padding, and the
190
+ // `blur + shadow/floating` effect.
192
191
  //
193
- // `backdrop-blur-[4px]` is the CSS equivalent of that node's
194
- // `blur + shadow/menu` BACKGROUND_BLUR radius 8, which Figma halves on
195
- // export. It is not a 4-against-8 mismatch.
196
- "w-max min-w-(--radix-dropdown-menu-trigger-width) max-w-(--radix-dropdown-menu-content-available-width) overflow-y-auto rounded-lg border border-border-strong bg-background-secondary p-2 text-content-primary shadow-blur-menu backdrop-blur-[4px]",
192
+ // `backdrop-blur-[4px]` is the CSS equivalent of that effect's
193
+ // BACKGROUND_BLUR radius 8, which Figma halves on export. It is not a
194
+ // 4-against-8 mismatch.
195
+ "w-max min-w-(--radix-dropdown-menu-trigger-width) max-w-(--radix-dropdown-menu-content-available-width) overflow-y-auto rounded-sm border border-border-primary bg-surface-primary p-1 text-content-primary shadow-blur-floating backdrop-blur-[4px]",
197
196
  "data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95 data-[state=open]:animate-in",
198
197
  "data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=closed]:animate-out",
199
198
  "data-[side=top]:slide-in-from-bottom-2 data-[side=bottom]:slide-in-from-top-2",