@fanvue/ui 3.52.0 → 3.54.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 (189) hide show
  1. package/dist/cjs/components/AudioPlayer/AudioPlayer.cjs +4 -2
  2. package/dist/cjs/components/AudioPlayer/AudioPlayer.cjs.map +1 -1
  3. package/dist/cjs/components/Autocomplete/Autocomplete.cjs +34 -10
  4. package/dist/cjs/components/Autocomplete/Autocomplete.cjs.map +1 -1
  5. package/dist/cjs/components/Autocomplete/AutocompleteOptionItem.cjs +13 -1
  6. package/dist/cjs/components/Autocomplete/AutocompleteOptionItem.cjs.map +1 -1
  7. package/dist/cjs/components/Badge/Badge.cjs +7 -6
  8. package/dist/cjs/components/Badge/Badge.cjs.map +1 -1
  9. package/dist/cjs/components/BottomNavigation/BottomNavigation.cjs +2 -2
  10. package/dist/cjs/components/BottomNavigation/BottomNavigation.cjs.map +1 -1
  11. package/dist/cjs/components/Button/Button.cjs +2 -1
  12. package/dist/cjs/components/Button/Button.cjs.map +1 -1
  13. package/dist/cjs/components/Card/Card.cjs +6 -3
  14. package/dist/cjs/components/Card/Card.cjs.map +1 -1
  15. package/dist/cjs/components/Chart/ChartCard.cjs +2 -1
  16. package/dist/cjs/components/Chart/ChartCard.cjs.map +1 -1
  17. package/dist/cjs/components/Chart/ChartLoadingOverlay.cjs +1 -1
  18. package/dist/cjs/components/Chart/ChartLoadingOverlay.cjs.map +1 -1
  19. package/dist/cjs/components/ChatInput/ChatInput.cjs +2 -2
  20. package/dist/cjs/components/ChatInput/ChatInput.cjs.map +1 -1
  21. package/dist/cjs/components/ChatMessage/ChatMessage.cjs +4 -2
  22. package/dist/cjs/components/ChatMessage/ChatMessage.cjs.map +1 -1
  23. package/dist/cjs/components/Chip/Chip.cjs +10 -9
  24. package/dist/cjs/components/Chip/Chip.cjs.map +1 -1
  25. package/dist/cjs/components/CreatorCard/CreatorCard.cjs +3 -5
  26. package/dist/cjs/components/CreatorCard/CreatorCard.cjs.map +1 -1
  27. package/dist/cjs/components/CreatorCover/CreatorCover.cjs +11 -7
  28. package/dist/cjs/components/CreatorCover/CreatorCover.cjs.map +1 -1
  29. package/dist/cjs/components/DatePicker/DatePicker.cjs +37 -16
  30. package/dist/cjs/components/DatePicker/DatePicker.cjs.map +1 -1
  31. package/dist/cjs/components/DatePicker/DateRangePanel.cjs +143 -0
  32. package/dist/cjs/components/DatePicker/DateRangePanel.cjs.map +1 -0
  33. package/dist/cjs/components/DatePicker/DateRangePicker.cjs +33 -0
  34. package/dist/cjs/components/DatePicker/DateRangePicker.cjs.map +1 -0
  35. package/dist/cjs/components/DropdownMenu/DropdownMenuItem.cjs +33 -10
  36. package/dist/cjs/components/DropdownMenu/DropdownMenuItem.cjs.map +1 -1
  37. package/dist/cjs/components/DropdownMenu/DropdownMenuReorderItem.cjs +2 -1
  38. package/dist/cjs/components/DropdownMenu/DropdownMenuReorderItem.cjs.map +1 -1
  39. package/dist/cjs/components/DropdownMenu/DropdownMenuRoot.cjs +18 -13
  40. package/dist/cjs/components/DropdownMenu/DropdownMenuRoot.cjs.map +1 -1
  41. package/dist/cjs/components/DropdownMenu/DropdownMenuSelectionItems.cjs +56 -40
  42. package/dist/cjs/components/DropdownMenu/DropdownMenuSelectionItems.cjs.map +1 -1
  43. package/dist/cjs/components/FilterMenu/FilterMenu.cjs +45 -0
  44. package/dist/cjs/components/FilterMenu/FilterMenu.cjs.map +1 -0
  45. package/dist/cjs/components/IconButton/IconButton.cjs +7 -3
  46. package/dist/cjs/components/IconButton/IconButton.cjs.map +1 -1
  47. package/dist/cjs/components/Icons/MenuRowIcon.cjs +9 -2
  48. package/dist/cjs/components/Icons/MenuRowIcon.cjs.map +1 -1
  49. package/dist/cjs/components/Icons/ReorganiseIcon.cjs +65 -0
  50. package/dist/cjs/components/Icons/ReorganiseIcon.cjs.map +1 -0
  51. package/dist/cjs/components/Icons/VerifiedIcon.cjs +9 -15
  52. package/dist/cjs/components/Icons/VerifiedIcon.cjs.map +1 -1
  53. package/dist/cjs/components/Pagination/Pagination.cjs +3 -2
  54. package/dist/cjs/components/Pagination/Pagination.cjs.map +1 -1
  55. package/dist/cjs/components/PhoneField/PhoneField.cjs +21 -17
  56. package/dist/cjs/components/PhoneField/PhoneField.cjs.map +1 -1
  57. package/dist/cjs/components/Popover/Popover.cjs +69 -0
  58. package/dist/cjs/components/Popover/Popover.cjs.map +1 -0
  59. package/dist/cjs/components/Select/Select.cjs +49 -12
  60. package/dist/cjs/components/Select/Select.cjs.map +1 -1
  61. package/dist/cjs/components/Slider/SliderThumb.cjs +3 -2
  62. package/dist/cjs/components/Slider/SliderThumb.cjs.map +1 -1
  63. package/dist/cjs/components/Snackbar/Snackbar.cjs +1 -1
  64. package/dist/cjs/components/Snackbar/Snackbar.cjs.map +1 -1
  65. package/dist/cjs/components/Switch/Switch.cjs +1 -1
  66. package/dist/cjs/components/Switch/Switch.cjs.map +1 -1
  67. package/dist/cjs/components/Table/Table.cjs +104 -38
  68. package/dist/cjs/components/Table/Table.cjs.map +1 -1
  69. package/dist/cjs/components/Table/TableToolbarSearchFilters.cjs +152 -0
  70. package/dist/cjs/components/Table/TableToolbarSearchFilters.cjs.map +1 -0
  71. package/dist/cjs/components/Table/useFittingCount.cjs +51 -0
  72. package/dist/cjs/components/Table/useFittingCount.cjs.map +1 -0
  73. package/dist/cjs/components/Tag/Tag.cjs +99 -0
  74. package/dist/cjs/components/Tag/Tag.cjs.map +1 -0
  75. package/dist/cjs/components/TextArea/TextArea.cjs +5 -4
  76. package/dist/cjs/components/TextArea/TextArea.cjs.map +1 -1
  77. package/dist/cjs/components/TextField/TextField.cjs +30 -15
  78. package/dist/cjs/components/TextField/TextField.cjs.map +1 -1
  79. package/dist/cjs/date-picker.cjs +4 -0
  80. package/dist/cjs/date-picker.cjs.map +1 -1
  81. package/dist/cjs/index.cjs +12 -0
  82. package/dist/cjs/index.cjs.map +1 -1
  83. package/dist/cjs/utils/floatingContentSurface.cjs +8 -0
  84. package/dist/cjs/utils/floatingContentSurface.cjs.map +1 -0
  85. package/dist/cjs/utils/inputFieldClasses.cjs +8 -0
  86. package/dist/cjs/utils/inputFieldClasses.cjs.map +1 -0
  87. package/dist/cjs/utils/pointerCapture.cjs +20 -0
  88. package/dist/cjs/utils/pointerCapture.cjs.map +1 -0
  89. package/dist/cjs/utils/useDragToDismiss.cjs +3 -2
  90. package/dist/cjs/utils/useDragToDismiss.cjs.map +1 -1
  91. package/dist/cjs/utils/useSuppressClickAfterDrag.cjs +2 -1
  92. package/dist/cjs/utils/useSuppressClickAfterDrag.cjs.map +1 -1
  93. package/dist/components/AudioPlayer/AudioPlayer.mjs +4 -2
  94. package/dist/components/AudioPlayer/AudioPlayer.mjs.map +1 -1
  95. package/dist/components/Autocomplete/Autocomplete.mjs +34 -10
  96. package/dist/components/Autocomplete/Autocomplete.mjs.map +1 -1
  97. package/dist/components/Autocomplete/AutocompleteOptionItem.mjs +13 -1
  98. package/dist/components/Autocomplete/AutocompleteOptionItem.mjs.map +1 -1
  99. package/dist/components/Badge/Badge.mjs +7 -6
  100. package/dist/components/Badge/Badge.mjs.map +1 -1
  101. package/dist/components/BottomNavigation/BottomNavigation.mjs +2 -2
  102. package/dist/components/BottomNavigation/BottomNavigation.mjs.map +1 -1
  103. package/dist/components/Button/Button.mjs +2 -1
  104. package/dist/components/Button/Button.mjs.map +1 -1
  105. package/dist/components/Card/Card.mjs +6 -3
  106. package/dist/components/Card/Card.mjs.map +1 -1
  107. package/dist/components/Chart/ChartCard.mjs +2 -1
  108. package/dist/components/Chart/ChartCard.mjs.map +1 -1
  109. package/dist/components/Chart/ChartLoadingOverlay.mjs +1 -1
  110. package/dist/components/Chart/ChartLoadingOverlay.mjs.map +1 -1
  111. package/dist/components/ChatInput/ChatInput.mjs +2 -2
  112. package/dist/components/ChatInput/ChatInput.mjs.map +1 -1
  113. package/dist/components/ChatMessage/ChatMessage.mjs +4 -2
  114. package/dist/components/ChatMessage/ChatMessage.mjs.map +1 -1
  115. package/dist/components/Chip/Chip.mjs +10 -9
  116. package/dist/components/Chip/Chip.mjs.map +1 -1
  117. package/dist/components/CreatorCard/CreatorCard.mjs +3 -5
  118. package/dist/components/CreatorCard/CreatorCard.mjs.map +1 -1
  119. package/dist/components/CreatorCover/CreatorCover.mjs +11 -7
  120. package/dist/components/CreatorCover/CreatorCover.mjs.map +1 -1
  121. package/dist/components/DatePicker/DatePicker.mjs +39 -18
  122. package/dist/components/DatePicker/DatePicker.mjs.map +1 -1
  123. package/dist/components/DatePicker/DateRangePanel.mjs +126 -0
  124. package/dist/components/DatePicker/DateRangePanel.mjs.map +1 -0
  125. package/dist/components/DatePicker/DateRangePicker.mjs +33 -0
  126. package/dist/components/DatePicker/DateRangePicker.mjs.map +1 -0
  127. package/dist/components/DropdownMenu/DropdownMenuItem.mjs +33 -10
  128. package/dist/components/DropdownMenu/DropdownMenuItem.mjs.map +1 -1
  129. package/dist/components/DropdownMenu/DropdownMenuReorderItem.mjs +2 -1
  130. package/dist/components/DropdownMenu/DropdownMenuReorderItem.mjs.map +1 -1
  131. package/dist/components/DropdownMenu/DropdownMenuRoot.mjs +18 -13
  132. package/dist/components/DropdownMenu/DropdownMenuRoot.mjs.map +1 -1
  133. package/dist/components/DropdownMenu/DropdownMenuSelectionItems.mjs +56 -40
  134. package/dist/components/DropdownMenu/DropdownMenuSelectionItems.mjs.map +1 -1
  135. package/dist/components/FilterMenu/FilterMenu.mjs +28 -0
  136. package/dist/components/FilterMenu/FilterMenu.mjs.map +1 -0
  137. package/dist/components/IconButton/IconButton.mjs +7 -3
  138. package/dist/components/IconButton/IconButton.mjs.map +1 -1
  139. package/dist/components/Icons/MenuRowIcon.mjs +9 -2
  140. package/dist/components/Icons/MenuRowIcon.mjs.map +1 -1
  141. package/dist/components/Icons/ReorganiseIcon.mjs +48 -0
  142. package/dist/components/Icons/ReorganiseIcon.mjs.map +1 -0
  143. package/dist/components/Icons/VerifiedIcon.mjs +9 -15
  144. package/dist/components/Icons/VerifiedIcon.mjs.map +1 -1
  145. package/dist/components/Pagination/Pagination.mjs +3 -2
  146. package/dist/components/Pagination/Pagination.mjs.map +1 -1
  147. package/dist/components/PhoneField/PhoneField.mjs +21 -17
  148. package/dist/components/PhoneField/PhoneField.mjs.map +1 -1
  149. package/dist/components/Popover/Popover.mjs +51 -0
  150. package/dist/components/Popover/Popover.mjs.map +1 -0
  151. package/dist/components/Select/Select.mjs +49 -12
  152. package/dist/components/Select/Select.mjs.map +1 -1
  153. package/dist/components/Slider/SliderThumb.mjs +3 -2
  154. package/dist/components/Slider/SliderThumb.mjs.map +1 -1
  155. package/dist/components/Snackbar/Snackbar.mjs +1 -1
  156. package/dist/components/Snackbar/Snackbar.mjs.map +1 -1
  157. package/dist/components/Switch/Switch.mjs +1 -1
  158. package/dist/components/Switch/Switch.mjs.map +1 -1
  159. package/dist/components/Table/Table.mjs +104 -38
  160. package/dist/components/Table/Table.mjs.map +1 -1
  161. package/dist/components/Table/TableToolbarSearchFilters.mjs +135 -0
  162. package/dist/components/Table/TableToolbarSearchFilters.mjs.map +1 -0
  163. package/dist/components/Table/useFittingCount.mjs +34 -0
  164. package/dist/components/Table/useFittingCount.mjs.map +1 -0
  165. package/dist/components/Tag/Tag.mjs +82 -0
  166. package/dist/components/Tag/Tag.mjs.map +1 -0
  167. package/dist/components/TextArea/TextArea.mjs +5 -4
  168. package/dist/components/TextArea/TextArea.mjs.map +1 -1
  169. package/dist/components/TextField/TextField.mjs +30 -15
  170. package/dist/components/TextField/TextField.mjs.map +1 -1
  171. package/dist/date-picker.d.ts +109 -0
  172. package/dist/date-picker.mjs +5 -1
  173. package/dist/date-picker.mjs.map +1 -1
  174. package/dist/index.d.ts +317 -20
  175. package/dist/index.mjs +12 -0
  176. package/dist/index.mjs.map +1 -1
  177. package/dist/styles/base.css +51 -4
  178. package/dist/styles/theme.css +1217 -1
  179. package/dist/utils/floatingContentSurface.mjs +8 -0
  180. package/dist/utils/floatingContentSurface.mjs.map +1 -0
  181. package/dist/utils/inputFieldClasses.mjs +8 -0
  182. package/dist/utils/inputFieldClasses.mjs.map +1 -0
  183. package/dist/utils/pointerCapture.mjs +20 -0
  184. package/dist/utils/pointerCapture.mjs.map +1 -0
  185. package/dist/utils/useDragToDismiss.mjs +3 -2
  186. package/dist/utils/useDragToDismiss.mjs.map +1 -1
  187. package/dist/utils/useSuppressClickAfterDrag.mjs +2 -1
  188. package/dist/utils/useSuppressClickAfterDrag.mjs.map +1 -1
  189. package/package.json +1 -1
@@ -0,0 +1,143 @@
1
+ "use client";
2
+ "use strict";
3
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
4
+ const jsxRuntime = require("react/jsx-runtime");
5
+ const RadioGroupPrimitive = require("@radix-ui/react-radio-group");
6
+ const React = require("react");
7
+ const cn = require("../../utils/cn.cjs");
8
+ const Button = require("../Button/Button.cjs");
9
+ const CheckIcon = require("../Icons/CheckIcon.cjs");
10
+ const RadioGroup = require("../RadioGroup/RadioGroup.cjs");
11
+ const DatePicker = require("./DatePicker.cjs");
12
+ function _interopNamespaceDefault(e) {
13
+ const n = Object.create(null, { [Symbol.toStringTag]: { value: "Module" } });
14
+ if (e) {
15
+ for (const k in e) {
16
+ if (k !== "default") {
17
+ const d = Object.getOwnPropertyDescriptor(e, k);
18
+ Object.defineProperty(n, k, d.get ? d : {
19
+ enumerable: true,
20
+ get: () => e[k]
21
+ });
22
+ }
23
+ }
24
+ }
25
+ n.default = e;
26
+ return Object.freeze(n);
27
+ }
28
+ const RadioGroupPrimitive__namespace = /* @__PURE__ */ _interopNamespaceDefault(RadioGroupPrimitive);
29
+ const CUSTOM_ROW_VALUE = "__custom-range__";
30
+ const ROW_CLASS_NAME = [
31
+ "typography-body-small-14px-regular flex min-h-8 w-full cursor-pointer items-center gap-2 rounded-sm border-0 bg-transparent px-3 py-1.5 text-start text-content-primary outline-none",
32
+ "hover:bg-interaction-hover focus-visible:bg-interaction-hover",
33
+ "data-[state=checked]:bg-menu-item-selected data-[state=checked]:font-semibold data-[state=checked]:hover:bg-interaction-hover data-[state=checked]:focus-visible:bg-interaction-hover",
34
+ "theme-v2:data-[state=checked]:text-content-primary-inverted theme-v2:data-[state=checked]:hover:bg-menu-item-selected-hover theme-v2:data-[state=checked]:focus-visible:bg-menu-item-selected-hover"
35
+ ].join(" ");
36
+ const ARROW_KEYS = /* @__PURE__ */ new Set(["ArrowUp", "ArrowDown", "ArrowLeft", "ArrowRight"]);
37
+ function DateRangeRow({ value, onClick, children }) {
38
+ return /* @__PURE__ */ jsxRuntime.jsxs(RadioGroupPrimitive__namespace.Item, { value, onClick, className: ROW_CLASS_NAME, children: [
39
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "min-w-0 flex-1 truncate", children }),
40
+ /* @__PURE__ */ jsxRuntime.jsx(RadioGroupPrimitive__namespace.Indicator, { children: /* @__PURE__ */ jsxRuntime.jsx(CheckIcon.CheckIcon, { className: "size-4 shrink-0" }) })
41
+ ] });
42
+ }
43
+ const DateRangePanel = React.forwardRef(
44
+ ({
45
+ presets,
46
+ customRangeLabel,
47
+ value,
48
+ onValueChange,
49
+ applyLabel = "Apply",
50
+ cancelLabel = "Cancel",
51
+ onCancel,
52
+ calendarProps,
53
+ "aria-label": ariaLabel,
54
+ className
55
+ }, ref) => {
56
+ const appliedRange = value.type === "custom" ? value.range : void 0;
57
+ const [showCalendar, setShowCalendar] = React.useState(false);
58
+ const [draft, setDraft] = React.useState(appliedRange);
59
+ const arrowKeyDown = React.useRef(false);
60
+ const openCalendar = () => {
61
+ setDraft(appliedRange);
62
+ setShowCalendar(true);
63
+ };
64
+ const pickRow = (rowValue) => {
65
+ if (rowValue === CUSTOM_ROW_VALUE) openCalendar();
66
+ else onValueChange({ type: "preset", presetId: rowValue });
67
+ };
68
+ const apply = () => {
69
+ if (draft?.from && draft.to) {
70
+ onValueChange({ type: "custom", range: { from: draft.from, to: draft.to } });
71
+ }
72
+ };
73
+ const cancel = () => {
74
+ setDraft(void 0);
75
+ setShowCalendar(false);
76
+ onCancel?.();
77
+ };
78
+ if (showCalendar) {
79
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { ref, className: cn.cn("flex flex-col", className), children: [
80
+ /* @__PURE__ */ jsxRuntime.jsx(
81
+ DatePicker.DatePicker,
82
+ {
83
+ mode: "range",
84
+ variant: "single",
85
+ size: "32",
86
+ showFooter: false,
87
+ defaultMonth: appliedRange?.from,
88
+ selected: draft,
89
+ onSelect: setDraft,
90
+ className: "rounded-none border-0 bg-transparent p-0 shadow-none backdrop-blur-none",
91
+ ...calendarProps
92
+ }
93
+ ),
94
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "grid grid-cols-2 gap-2 pt-4", children: [
95
+ /* @__PURE__ */ jsxRuntime.jsx(Button.Button, { variant: "outline", size: "32", onClick: cancel, children: cancelLabel }),
96
+ /* @__PURE__ */ jsxRuntime.jsx(
97
+ Button.Button,
98
+ {
99
+ variant: "primary",
100
+ size: "32",
101
+ disabled: !draft?.from || !draft.to,
102
+ onClick: apply,
103
+ children: applyLabel
104
+ }
105
+ )
106
+ ] })
107
+ ] });
108
+ }
109
+ const rowClick = (rowValue) => () => {
110
+ if (!arrowKeyDown.current) pickRow(rowValue);
111
+ };
112
+ return /* @__PURE__ */ jsxRuntime.jsxs(
113
+ RadioGroup.RadioGroup,
114
+ {
115
+ ref,
116
+ "aria-label": ariaLabel,
117
+ value: value.type === "preset" ? value.presetId : customRangeLabel === void 0 ? "" : CUSTOM_ROW_VALUE,
118
+ className: cn.cn("flex min-w-48 flex-col gap-0.5", className),
119
+ onKeyDown: (event) => {
120
+ if (ARROW_KEYS.has(event.key)) arrowKeyDown.current = true;
121
+ const row = event.target instanceof HTMLElement ? event.target.closest("[role=radio]") : null;
122
+ if (event.key === "Enter" && row instanceof HTMLButtonElement) pickRow(row.value);
123
+ },
124
+ onKeyUp: () => {
125
+ arrowKeyDown.current = false;
126
+ },
127
+ onBlur: (event) => {
128
+ if (!event.currentTarget.contains(event.relatedTarget)) arrowKeyDown.current = false;
129
+ },
130
+ children: [
131
+ presets.map((preset) => /* @__PURE__ */ jsxRuntime.jsx(DateRangeRow, { value: preset.id, onClick: rowClick(preset.id), children: preset.label }, preset.id)),
132
+ customRangeLabel !== void 0 && /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
133
+ /* @__PURE__ */ jsxRuntime.jsx("div", { "aria-hidden": true, className: "my-1 h-px bg-neutral-alphas-200" }),
134
+ /* @__PURE__ */ jsxRuntime.jsx(DateRangeRow, { value: CUSTOM_ROW_VALUE, onClick: rowClick(CUSTOM_ROW_VALUE), children: customRangeLabel })
135
+ ] })
136
+ ]
137
+ }
138
+ );
139
+ }
140
+ );
141
+ DateRangePanel.displayName = "DateRangePanel";
142
+ exports.DateRangePanel = DateRangePanel;
143
+ //# sourceMappingURL=DateRangePanel.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DateRangePanel.cjs","sources":["../../../../src/components/DatePicker/DateRangePanel.tsx"],"sourcesContent":["import * as RadioGroupPrimitive from \"@radix-ui/react-radio-group\";\nimport { forwardRef, useRef, useState } from \"react\";\nimport type { DateRange, DayPickerProps } from \"react-day-picker\";\nimport { cn } from \"../../utils/cn\";\nimport { Button } from \"../Button/Button\";\nimport { CheckIcon } from \"../Icons/CheckIcon\";\nimport { RadioGroup } from \"../RadioGroup/RadioGroup\";\nimport { DatePicker } from \"./DatePicker\";\n\n/** A named preset the caller maps to a date range. The kit does no date maths. */\nexport interface DateRangePreset {\n /** Stable identifier emitted in `{ type: \"preset\", presetId }`. */\n id: string;\n /** Visible, already translated label. */\n label: string;\n}\n\n/** The applied selection: one of the caller's presets, or an explicit custom range. */\nexport type DateRangeValue =\n | { type: \"preset\"; presetId: string }\n | { type: \"custom\"; range: { from: Date; to: Date } };\n\n/** Calendar options forwarded to the custom range calendar. */\nexport type DateRangeCalendarProps = Pick<\n DayPickerProps,\n \"disabled\" | \"startMonth\" | \"endMonth\" | \"weekStartsOn\" | \"locale\"\n>;\n\n/** Props for {@link DateRangePanel}. */\nexport interface DateRangePanelProps {\n /** Preset rows, in display order. */\n presets: readonly DateRangePreset[];\n /** Label of the last row, which opens the calendar. Omit to offer presets only. Translated by the caller. */\n customRangeLabel?: string;\n /** The applied selection. A custom value checks the Custom range row. Picking that row opens the calendar on the applied range. */\n value: DateRangeValue;\n /**\n * Called with `{ type: \"preset\", presetId }` as soon as a preset row is picked by click, Space or\n * Enter, including the current one, and with `{ type: \"custom\", range }` when Apply is clicked.\n * Arrow keys move focus without calling it.\n */\n onValueChange: (value: DateRangeValue) => void;\n /** Label of the Apply button. @default \"Apply\" */\n applyLabel?: string;\n /** Label of the Cancel button. @default \"Cancel\" */\n cancelLabel?: string;\n /** Called after Cancel drops the draft range and the panel returns to the preset list. */\n onCancel?: () => void;\n /** Bounds, locale and first weekday for the calendar. */\n calendarProps?: DateRangeCalendarProps;\n /** Accessible name of the preset list. Translated by the caller. */\n \"aria-label\": string;\n /** Additional CSS class name for the root element. */\n className?: string;\n}\n\nconst CUSTOM_ROW_VALUE = \"__custom-range__\";\nconst ROW_CLASS_NAME = [\n \"typography-body-small-14px-regular flex min-h-8 w-full cursor-pointer items-center gap-2 rounded-sm border-0 bg-transparent px-3 py-1.5 text-start text-content-primary outline-none\",\n \"hover:bg-interaction-hover focus-visible:bg-interaction-hover\",\n \"data-[state=checked]:bg-menu-item-selected data-[state=checked]:font-semibold data-[state=checked]:hover:bg-interaction-hover data-[state=checked]:focus-visible:bg-interaction-hover\",\n \"theme-v2:data-[state=checked]:text-content-primary-inverted theme-v2:data-[state=checked]:hover:bg-menu-item-selected-hover theme-v2:data-[state=checked]:focus-visible:bg-menu-item-selected-hover\",\n].join(\" \");\n\nconst ARROW_KEYS = new Set([\"ArrowUp\", \"ArrowDown\", \"ArrowLeft\", \"ArrowRight\"]);\n\ninterface DateRangeRowProps {\n value: string;\n onClick: () => void;\n children: string;\n}\n\nfunction DateRangeRow({ value, onClick, children }: DateRangeRowProps) {\n return (\n <RadioGroupPrimitive.Item value={value} onClick={onClick} className={ROW_CLASS_NAME}>\n <span className=\"min-w-0 flex-1 truncate\">{children}</span>\n <RadioGroupPrimitive.Indicator>\n <CheckIcon className=\"size-4 shrink-0\" />\n </RadioGroupPrimitive.Indicator>\n </RadioGroupPrimitive.Item>\n );\n}\n\n/**\n * A list of date range presets, with a \"Custom range\" row that swaps to a one-month calendar when\n * `customRangeLabel` is given. A pointer click, Space or Enter on a row picks it. A preset applies\n * at once, and a custom range applies on Apply, with Cancel returning to the list. It always opens\n * on the list, even when a custom range is applied, so a preset stays reachable. The arrow keys\n * only move focus between rows and never pick one, so a keyboard user can reach a row without\n * applying it. It renders no popover, so it can sit inside a popover or a phone sheet. The caller\n * maps preset ids to dates.\n *\n * @example\n * ```tsx\n * <DateRangePanel\n * aria-label=\"Date range\"\n * presets={[{ id: \"7d\", label: \"Last 7 days\" }]}\n * customRangeLabel=\"Custom range\"\n * value={value}\n * onValueChange={setValue}\n * />\n * ```\n */\nexport const DateRangePanel = forwardRef<HTMLDivElement, DateRangePanelProps>(\n (\n {\n presets,\n customRangeLabel,\n value,\n onValueChange,\n applyLabel = \"Apply\",\n cancelLabel = \"Cancel\",\n onCancel,\n calendarProps,\n \"aria-label\": ariaLabel,\n className,\n },\n ref,\n ) => {\n const appliedRange = value.type === \"custom\" ? value.range : undefined;\n const [showCalendar, setShowCalendar] = useState(false);\n const [draft, setDraft] = useState<DateRange | undefined>(appliedRange);\n const arrowKeyDown = useRef(false);\n\n const openCalendar = () => {\n setDraft(appliedRange);\n setShowCalendar(true);\n };\n\n const pickRow = (rowValue: string) => {\n if (rowValue === CUSTOM_ROW_VALUE) openCalendar();\n else onValueChange({ type: \"preset\", presetId: rowValue });\n };\n\n const apply = () => {\n if (draft?.from && draft.to) {\n onValueChange({ type: \"custom\", range: { from: draft.from, to: draft.to } });\n }\n };\n\n const cancel = () => {\n setDraft(undefined);\n setShowCalendar(false);\n onCancel?.();\n };\n\n if (showCalendar) {\n return (\n <div ref={ref} className={cn(\"flex flex-col\", className)}>\n <DatePicker\n mode=\"range\"\n variant=\"single\"\n size=\"32\"\n showFooter={false}\n defaultMonth={appliedRange?.from}\n selected={draft}\n onSelect={setDraft}\n className=\"rounded-none border-0 bg-transparent p-0 shadow-none backdrop-blur-none\"\n {...calendarProps}\n />\n <div className=\"grid grid-cols-2 gap-2 pt-4\">\n <Button variant=\"outline\" size=\"32\" onClick={cancel}>\n {cancelLabel}\n </Button>\n <Button\n variant=\"primary\"\n size=\"32\"\n disabled={!draft?.from || !draft.to}\n onClick={apply}\n >\n {applyLabel}\n </Button>\n </div>\n </div>\n );\n }\n\n const rowClick = (rowValue: string) => () => {\n if (!arrowKeyDown.current) pickRow(rowValue);\n };\n\n return (\n <RadioGroup\n ref={ref}\n aria-label={ariaLabel}\n value={\n value.type === \"preset\"\n ? value.presetId\n : customRangeLabel === undefined\n ? \"\"\n : CUSTOM_ROW_VALUE\n }\n className={cn(\"flex min-w-48 flex-col gap-0.5\", className)}\n onKeyDown={(event) => {\n if (ARROW_KEYS.has(event.key)) arrowKeyDown.current = true;\n const row =\n event.target instanceof HTMLElement ? event.target.closest(\"[role=radio]\") : null;\n if (event.key === \"Enter\" && row instanceof HTMLButtonElement) pickRow(row.value);\n }}\n onKeyUp={() => {\n arrowKeyDown.current = false;\n }}\n onBlur={(event) => {\n if (!event.currentTarget.contains(event.relatedTarget)) arrowKeyDown.current = false;\n }}\n >\n {presets.map((preset) => (\n <DateRangeRow key={preset.id} value={preset.id} onClick={rowClick(preset.id)}>\n {preset.label}\n </DateRangeRow>\n ))}\n {customRangeLabel !== undefined && (\n <>\n <div aria-hidden className=\"my-1 h-px bg-neutral-alphas-200\" />\n <DateRangeRow value={CUSTOM_ROW_VALUE} onClick={rowClick(CUSTOM_ROW_VALUE)}>\n {customRangeLabel}\n </DateRangeRow>\n </>\n )}\n </RadioGroup>\n );\n },\n);\n\nDateRangePanel.displayName = \"DateRangePanel\";\n"],"names":["RadioGroupPrimitive","jsx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A,QACzD,WAAW,CAAC,UAAU;AACpB,cAAI,WAAW,IAAI,MAAM,GAAG,gBAAgB,UAAU;AACtD,gBAAM,MACJ,MAAM,kBAAkB,cAAc,MAAM,OAAO,QAAQ,cAAc,IAAI;AAC/E,cAAI,MAAM,QAAQ,WAAW,eAAe,kBAAmB,SAAQ,IAAI,KAAK;AAAA,QAClF;AAAA,QACA,SAAS,MAAM;AACb,uBAAa,UAAU;AAAA,QACzB;AAAA,QACA,QAAQ,CAAC,UAAU;AACjB,cAAI,CAAC,MAAM,cAAc,SAAS,MAAM,aAAa,gBAAgB,UAAU;AAAA,QACjF;AAAA,QAEC,UAAA;AAAA,UAAA,QAAQ,IAAI,CAAC,WACZL,2BAAAA,IAAC,cAAA,EAA6B,OAAO,OAAO,IAAI,SAAS,SAAS,OAAO,EAAE,GACxE,iBAAO,MAAA,GADS,OAAO,EAE1B,CACD;AAAA,UACA,qBAAqB,UACpBO,2BAAAA,KAAAG,WAAAA,UAAA,EACE,UAAA;AAAA,YAAAV,2BAAAA,IAAC,OAAA,EAAI,eAAW,MAAC,WAAU,mCAAkC;AAAA,YAC7DA,+BAAC,gBAAa,OAAO,kBAAkB,SAAS,SAAS,gBAAgB,GACtE,UAAA,iBAAA,CACH;AAAA,UAAA,EAAA,CACF;AAAA,QAAA;AAAA,MAAA;AAAA,IAAA;AAAA,EAIR;AACF;AAEA,eAAe,cAAc;;"}
@@ -0,0 +1,33 @@
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 Popover = require("../Popover/Popover.cjs");
7
+ const DateRangePanel = require("./DateRangePanel.cjs");
8
+ const DateRangePicker = React.forwardRef(
9
+ ({ children, onValueChange, onCancel, "aria-label": ariaLabel, ...panelProps }, ref) => {
10
+ const [open, setOpen] = React.useState(false);
11
+ return /* @__PURE__ */ jsxRuntime.jsxs(Popover.Popover, { open, onOpenChange: setOpen, children: [
12
+ /* @__PURE__ */ jsxRuntime.jsx(Popover.PopoverTrigger, { asChild: true, children }),
13
+ /* @__PURE__ */ jsxRuntime.jsx(Popover.PopoverContent, { ref, "aria-label": ariaLabel, children: /* @__PURE__ */ jsxRuntime.jsx(
14
+ DateRangePanel.DateRangePanel,
15
+ {
16
+ ...panelProps,
17
+ "aria-label": ariaLabel,
18
+ onValueChange: (next) => {
19
+ onValueChange(next);
20
+ setOpen(false);
21
+ },
22
+ onCancel: () => {
23
+ onCancel?.();
24
+ setOpen(false);
25
+ }
26
+ }
27
+ ) })
28
+ ] });
29
+ }
30
+ );
31
+ DateRangePicker.displayName = "DateRangePicker";
32
+ exports.DateRangePicker = DateRangePicker;
33
+ //# sourceMappingURL=DateRangePicker.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DateRangePicker.cjs","sources":["../../../../src/components/DatePicker/DateRangePicker.tsx"],"sourcesContent":["import { forwardRef, useState } from \"react\";\nimport { Popover, PopoverContent, PopoverTrigger } from \"../Popover/Popover\";\nimport { DateRangePanel, type DateRangePanelProps } from \"./DateRangePanel\";\n\n/** Props for {@link DateRangePicker}. */\nexport interface DateRangePickerProps extends Omit<DateRangePanelProps, \"className\"> {\n /** The trigger element, rendered as the popover trigger. It shows no value, so the caller owns its label. */\n children: React.ReactElement;\n /** Accessible name of the popover dialog and of the preset list inside it. Translated by the caller. */\n \"aria-label\": string;\n}\n\n/**\n * A {@link DateRangePanel} in a popover under a caller-supplied trigger. The popover closes after\n * a preset pick, Apply and Cancel. Closing it any other way drops an unapplied range.\n *\n * @example\n * ```tsx\n * <DateRangePicker\n * aria-label=\"Date range\"\n * presets={presets}\n * customRangeLabel=\"Custom range\"\n * value={value}\n * onValueChange={setValue}\n * >\n * <TableToolbarAction icon={<ChevronDownIcon />}>Date</TableToolbarAction>\n * </DateRangePicker>\n * ```\n */\nexport const DateRangePicker = forwardRef<HTMLDivElement, DateRangePickerProps>(\n ({ children, onValueChange, onCancel, \"aria-label\": ariaLabel, ...panelProps }, ref) => {\n const [open, setOpen] = useState(false);\n\n return (\n <Popover open={open} onOpenChange={setOpen}>\n <PopoverTrigger asChild>{children}</PopoverTrigger>\n <PopoverContent ref={ref} aria-label={ariaLabel}>\n <DateRangePanel\n {...panelProps}\n aria-label={ariaLabel}\n onValueChange={(next) => {\n onValueChange(next);\n setOpen(false);\n }}\n onCancel={() => {\n onCancel?.();\n setOpen(false);\n }}\n />\n </PopoverContent>\n </Popover>\n );\n },\n);\n\nDateRangePicker.displayName = \"DateRangePicker\";\n"],"names":["forwardRef","useState","jsxs","Popover","jsx","PopoverTrigger","PopoverContent","DateRangePanel"],"mappings":";;;;;;;AA6BO,MAAM,kBAAkBA,MAAAA;AAAAA,EAC7B,CAAC,EAAE,UAAU,eAAe,UAAU,cAAc,WAAW,GAAG,WAAA,GAAc,QAAQ;AACtF,UAAM,CAAC,MAAM,OAAO,IAAIC,MAAAA,SAAS,KAAK;AAEtC,WACEC,2BAAAA,KAACC,QAAAA,SAAA,EAAQ,MAAY,cAAc,SACjC,UAAA;AAAA,MAAAC,2BAAAA,IAACC,QAAAA,gBAAA,EAAe,SAAO,MAAE,SAAA,CAAS;AAAA,MAClCD,2BAAAA,IAACE,QAAAA,gBAAA,EAAe,KAAU,cAAY,WACpC,UAAAF,2BAAAA;AAAAA,QAACG,eAAAA;AAAAA,QAAA;AAAA,UACE,GAAG;AAAA,UACJ,cAAY;AAAA,UACZ,eAAe,CAAC,SAAS;AACvB,0BAAc,IAAI;AAClB,oBAAQ,KAAK;AAAA,UACf;AAAA,UACA,UAAU,MAAM;AACd,uBAAA;AACA,oBAAQ,KAAK;AAAA,UACf;AAAA,QAAA;AAAA,MAAA,EACF,CACF;AAAA,IAAA,GACF;AAAA,EAEJ;AACF;AAEA,gBAAgB,cAAc;;"}
@@ -53,6 +53,9 @@ const ITEM_COUNT_TYPOGRAPHY = {
53
53
  "40": "typography-body-small-14px-regular",
54
54
  "32": "typography-body-small-14px-regular"
55
55
  };
56
+ const SELECTED_V2_CLASSES = "theme-v2:text-content-primary-inverted theme-v2:data-[highlighted]:bg-menu-item-selected-hover";
57
+ const SELECTED_SECONDARY_V2_CLASSES = "theme-v2:group-data-[selected]:text-content-secondary-inverted theme-v2:group-data-[selected]:group-data-[highlighted]:text-menu-item-selected-hover-secondary";
58
+ const SELECTED_DISABLED_V2_CLASSES = "theme-v2:bg-transparent";
56
59
  const DropdownMenuItem = React__namespace.forwardRef(
57
60
  ({
58
61
  size = "40",
@@ -79,7 +82,7 @@ const DropdownMenuItem = React__namespace.forwardRef(
79
82
  const itemClassName = cn.cn(
80
83
  // `text-start` because the sheet variant renders the row as a <button>,
81
84
  // whose UA-centred text misaligned it from the popper variant's rows.
82
- "group flex w-full cursor-pointer gap-2 rounded-sm px-3 text-start outline-none",
85
+ "group flex w-full shrink-0 cursor-pointer gap-2 rounded-sm px-3 text-start outline-none",
83
86
  hasDescription ? "items-start" : "items-center",
84
87
  // The sheet's header runs the full width of the panel, so its rows have to
85
88
  // come in off the edge themselves — 4px here on the panel's own 4px gives the
@@ -98,9 +101,10 @@ const DropdownMenuItem = React__namespace.forwardRef(
98
101
  // data-disabled — neither selector above matches them.
99
102
  "aria-disabled:cursor-not-allowed aria-disabled:text-content-disabled",
100
103
  destructive && "text-error-content",
101
- // Selected: the same `Interaction/Hover` fill as a highlighted row (library
102
- // node `23452:13432`), so the current value reads as the resting highlight.
103
- selected && "bg-interaction-hover",
104
+ selected && [
105
+ "bg-menu-item-selected",
106
+ disabled ? SELECTED_DISABLED_V2_CLASSES : SELECTED_V2_CLASSES
107
+ ],
104
108
  className
105
109
  );
106
110
  const selectedProps = selected ? {
@@ -116,12 +120,22 @@ const DropdownMenuItem = React__namespace.forwardRef(
116
120
  iconAlignClassName,
117
121
  ITEM_COUNT_TYPOGRAPHY[normalizedSize],
118
122
  destructive ? "text-error-content" : "text-content-tertiary",
119
- "group-data-[disabled]:text-content-disabled"
123
+ "group-data-[disabled]:text-content-disabled",
124
+ !disabled && SELECTED_SECONDARY_V2_CLASSES
120
125
  ),
121
126
  children: count
122
127
  }
123
128
  );
124
- const renderIcon = (icon, className2) => /* @__PURE__ */ jsxRuntime.jsx(MenuRowIcon.MenuRowIcon, { inheritColor: destructive, alignToTitle: hasDescription, className: className2, children: icon });
129
+ const renderIcon = (icon, className2) => /* @__PURE__ */ jsxRuntime.jsx(
130
+ MenuRowIcon.MenuRowIcon,
131
+ {
132
+ inheritColor: destructive,
133
+ alignToTitle: hasDescription,
134
+ invertWhenSelected: !disabled,
135
+ className: className2,
136
+ children: icon
137
+ }
138
+ );
125
139
  const leadingNode = leadingIcon != null && renderIcon(leadingIcon);
126
140
  const trailingNode = trailingIcon != null && renderIcon(trailingIcon, asChild ? "ms-auto" : void 0);
127
141
  const trailingActionNode = trailingAction != null && /* @__PURE__ */ jsxRuntime.jsx(
@@ -136,11 +150,20 @@ const DropdownMenuItem = React__namespace.forwardRef(
136
150
  }
137
151
  );
138
152
  const itemChildren = /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
139
- avatar != null ? /* @__PURE__ */ jsxRuntime.jsx("span", { className: cn.cn("shrink-0", iconAlignClassName), children: avatar }) : leadingNode,
153
+ avatar != null ? /* @__PURE__ */ jsxRuntime.jsx("span", { className: cn.cn("shrink-0", iconAlignClassName, disabled && "theme-v2:opacity-60"), children: avatar }) : leadingNode,
140
154
  hasDescription ? /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "flex min-w-0 flex-1 flex-col gap-0.5", children: [
141
155
  /* @__PURE__ */ jsxRuntime.jsx("span", { className: "typography-body-small-14px-semibold truncate", children }),
142
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "typography-body-small-14px-regular truncate text-content-secondary", children: description })
143
- ] }) : /* @__PURE__ */ jsxRuntime.jsx("span", { className: "min-w-0 flex-1 truncate", children }),
156
+ /* @__PURE__ */ jsxRuntime.jsx(
157
+ "span",
158
+ {
159
+ className: cn.cn(
160
+ "typography-body-small-14px-regular truncate text-content-secondary",
161
+ disabled ? "theme-v2:text-content-disabled" : SELECTED_SECONDARY_V2_CLASSES
162
+ ),
163
+ children: description
164
+ }
165
+ )
166
+ ] }) : /* @__PURE__ */ jsxRuntime.jsx("span", { className: cn.cn("min-w-0 flex-1 truncate", selected && "font-semibold"), children }),
144
167
  countNode,
145
168
  trailingNode,
146
169
  trailingActionNode
@@ -215,7 +238,7 @@ const DropdownMenuItem = React__namespace.forwardRef(
215
238
  DropdownMenuItem.displayName = "DropdownMenuItem";
216
239
  const DropdownMenuSeparator = React__namespace.forwardRef(({ className, ...props }, ref) => {
217
240
  const variant = React__namespace.useContext(context.DropdownMenuVariantContext);
218
- const separatorClassName = cn.cn("my-1 h-px border-0 bg-neutral-alphas-200", className);
241
+ const separatorClassName = cn.cn("my-1.5 h-px border-0 bg-neutral-alphas-200", className);
219
242
  if (variant === "sheet") {
220
243
  return /* @__PURE__ */ jsxRuntime.jsx("hr", { ref, className: separatorClassName, ...props });
221
244
  }
@@ -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, Slottable } from \"@radix-ui/react-slot\";\nimport * as React from \"react\";\nimport { cn } from \"../../utils/cn\";\nimport { MenuRowIcon } from \"../Icons/MenuRowIcon\";\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-small-14px-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\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 /**\n * Icon (or other node) rendered before the label. Ignored when {@link DropdownMenuItemProps.avatar} is set.\n * Icons sit in a 16px box in `Icons/Secondary`, and prop-based icons draw filled at 16px unless they set\n * `filled` or `size` themselves (`filled={false}` opts out). Legacy icons such as `TrashBinIcon` stay outlined.\n */\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. Treated like {@link DropdownMenuItemProps.leadingIcon}.\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 * A small action drawn at the row's end, after everything else — typically a 24px\n * `Button` rendered `asChild` as a span. The whole row performs the action through\n * `onSelect`, so pass a visual, never a second interactive control. Its text joins the\n * row's accessible name, so the label people see is also the one they can speak.\n * The row does not restyle it: when the row is `disabled`, disable the visual too\n * (or show its `loading` state) so it does not look live.\n */\n trailingAction?: 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 trailingAction,\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 — 4px here on the panel's own 4px gives the\n // same 8px inset as the popper panel. `w-auto` lets the column stretch them\n // to the space left over; `w-full` plus a margin would overflow.\n variant === \"sheet\" && \"mx-1 w-auto\",\n ITEM_SIZE_CLASSES[normalizedSize],\n // A 24px avatar or trailing action would push the compact 32px row past its\n // height with the default padding; tighten it so the row keeps the 32px contract.\n (hasAvatar || trailingAction != null) && !hasDescription && normalizedSize === \"32\" && \"py-1\",\n \"data-[highlighted]:bg-interaction-hover\",\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 // Selected: the same `Interaction/Hover` fill as a highlighted row (library\n // node `23452:13432`), so the current value reads as the resting highlight.\n selected && \"bg-interaction-hover\",\n className,\n );\n // The selected row shares the hover fill, so it also carries the state in the\n // markup: `aria-current` for assistive tech and `data-selected` for styling.\n // A consumer that already exposes the state (e.g. `menuitemradio` with\n // `aria-checked`) keeps it, without a second `aria-current` on top.\n const selectedProps = selected\n ? {\n ...(props[\"aria-checked\"] === undefined && { \"aria-current\": \"true\" as const }),\n \"data-selected\": \"\",\n }\n : undefined;\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-4.5 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 // Destructive rows keep the row's error colour on their icons.\n const renderIcon = (icon: React.ReactNode, className?: string) => (\n <MenuRowIcon inheritColor={destructive} alignToTitle={hasDescription} className={className}>\n {icon}\n </MenuRowIcon>\n );\n const leadingNode = leadingIcon != null && renderIcon(leadingIcon);\n\n // In an asChild row the consumer's children have no flex-1 wrapper, so `ms-auto`\n // pushes the trailing icon to the row's end.\n const trailingNode =\n trailingIcon != null && renderIcon(trailingIcon, asChild ? \"ms-auto\" : undefined);\n const trailingActionNode = trailingAction != null && (\n <span\n className={cn(\n \"flex shrink-0 items-center\",\n iconAlignClassName,\n asChild && trailingIcon == null && \"ms-auto\",\n )}\n >\n {trailingAction}\n </span>\n );\n\n const itemChildren = (\n <>\n {avatar != null ? (\n <span className={cn(\"shrink-0\", iconAlignClassName)}>{avatar}</span>\n ) : (\n leadingNode\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 14px 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 {trailingActionNode}\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 data-selected={selected ? \"\" : undefined}\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\n ? [\n leadingNode,\n <Slottable key=\"children\">{children}</Slottable>,\n trailingNode,\n trailingActionNode,\n ]\n : 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 {...selectedProps}\n {...props}\n >\n {/* The icons slot into the consumer's element (e.g. a link) around its own children. */}\n <Slot>\n {leadingNode}\n <Slottable>{children}</Slottable>\n {trailingNode}\n {trailingActionNode}\n </Slot>\n </DropdownMenuPrimitive.Item>\n );\n }\n\n return (\n <DropdownMenuPrimitive.Item\n ref={ref}\n className={itemClassName}\n disabled={disabled}\n onSelect={onSelect}\n {...selectedProps}\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 // border-0 resets the currentColor border-top that preflight gives <hr>,\n // which would otherwise draw a second line on the sheet variant.\n const separatorClassName = cn(\"my-1 h-px border-0 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","className","MenuRowIcon","jsxs","Fragment","Slot","Slottable"],"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;AAiEO,MAAM,mBAAmBJ,iBAAM;AAAA,EAIpC,CACE;AAAA,IACE,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AA,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, Slottable } from \"@radix-ui/react-slot\";\nimport * as React from \"react\";\nimport { cn } from \"../../utils/cn\";\nimport { MenuRowIcon } from \"../Icons/MenuRowIcon\";\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-small-14px-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\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 /**\n * Icon (or other node) rendered before the label. Ignored when {@link DropdownMenuItemProps.avatar} is set.\n * Icons sit in a 16px box in `Icons/Secondary`, and prop-based icons draw filled at 16px unless they set\n * `filled` or `size` themselves (`filled={false}` opts out). Legacy icons such as `TrashBinIcon` stay outlined.\n */\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. Treated like {@link DropdownMenuItemProps.leadingIcon}.\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 * A small action drawn at the row's end, after everything else — typically a 24px\n * `Button` rendered `asChild` as a span. The whole row performs the action through\n * `onSelect`, so pass a visual, never a second interactive control. Its text joins the\n * row's accessible name, so the label people see is also the one they can speak.\n * The row does not restyle it: when the row is `disabled`, disable the visual too\n * (or show its `loading` state) so it does not look live.\n */\n trailingAction?: 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 /**\n * Marks the item as the current selection in a single-select menu. The row\n * rests on `Buttons/Navigation/Hover` with a semibold label; hover still shows\n * `Interaction/Hover`, because `data-[highlighted]` outranks the selected class.\n * Under the v2 palette that fill is inverted, with inverted content, and a\n * highlighted row moves to `Menu Item Selected Hover` so keyboard focus stays visible.\n * The row also gets `data-selected`, and `aria-current` unless the consumer\n * already sets `aria-checked`.\n * @default false\n */\n selected?: boolean;\n}\n\n/**\n * Under the v2 palette a selected row's `Menu Item Selected` fill is inverted, so its\n * content inverts too, and a highlighted row moves to `Menu Item Selected Hover`.\n */\nconst SELECTED_V2_CLASSES =\n \"theme-v2:text-content-primary-inverted theme-v2:data-[highlighted]:bg-menu-item-selected-hover\";\n\n/**\n * Secondary lines (description, count) on a selected row under the v2 palette: inverted,\n * and `Menu Item Selected Hover Secondary` while the row is highlighted, so they keep\n * contrast on the hover fill.\n */\nconst SELECTED_SECONDARY_V2_CLASSES =\n \"theme-v2:group-data-[selected]:text-content-secondary-inverted theme-v2:group-data-[selected]:group-data-[highlighted]:text-menu-item-selected-hover-secondary\";\n\n/** A disabled selected row takes the library's Disabled state under the v2 palette, which has no fill. */\nconst SELECTED_DISABLED_V2_CLASSES = \"theme-v2:bg-transparent\";\n\n/**\n * An individual item within a {@link DropdownMenuContent}.\n *\n * Rows do not shrink (`shrink-0`): the panel is a scrolling flex column capped at the\n * space available, and a row allowed to shrink would drop to its minimum height and\n * spill a second line.\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 trailingAction,\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 shrink-0 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 — 4px here on the panel's own 4px gives the\n // same 8px inset as the popper panel. `w-auto` lets the column stretch them\n // to the space left over; `w-full` plus a margin would overflow.\n variant === \"sheet\" && \"mx-1 w-auto\",\n ITEM_SIZE_CLASSES[normalizedSize],\n // A 24px avatar or trailing action would push the compact 32px row past its\n // height with the default padding; tighten it so the row keeps the 32px contract.\n (hasAvatar || trailingAction != null) && !hasDescription && normalizedSize === \"32\" && \"py-1\",\n \"data-[highlighted]:bg-interaction-hover\",\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 selected && [\n \"bg-menu-item-selected\",\n disabled ? SELECTED_DISABLED_V2_CLASSES : SELECTED_V2_CLASSES,\n ],\n className,\n );\n const selectedProps = selected\n ? {\n ...(props[\"aria-checked\"] === undefined && { \"aria-current\": \"true\" as const }),\n \"data-selected\": \"\",\n }\n : undefined;\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-4.5 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 !disabled && SELECTED_SECONDARY_V2_CLASSES,\n )}\n >\n {count}\n </span>\n );\n\n // Destructive rows keep the row's error colour on their icons.\n const renderIcon = (icon: React.ReactNode, className?: string) => (\n <MenuRowIcon\n inheritColor={destructive}\n alignToTitle={hasDescription}\n invertWhenSelected={!disabled}\n className={className}\n >\n {icon}\n </MenuRowIcon>\n );\n const leadingNode = leadingIcon != null && renderIcon(leadingIcon);\n\n // In an asChild row the consumer's children have no flex-1 wrapper, so `ms-auto`\n // pushes the trailing icon to the row's end.\n const trailingNode =\n trailingIcon != null && renderIcon(trailingIcon, asChild ? \"ms-auto\" : undefined);\n const trailingActionNode = trailingAction != null && (\n <span\n className={cn(\n \"flex shrink-0 items-center\",\n iconAlignClassName,\n asChild && trailingIcon == null && \"ms-auto\",\n )}\n >\n {trailingAction}\n </span>\n );\n\n const itemChildren = (\n <>\n {avatar != null ? (\n <span className={cn(\"shrink-0\", iconAlignClassName, disabled && \"theme-v2:opacity-60\")}>\n {avatar}\n </span>\n ) : (\n leadingNode\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 14px 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 text-content-secondary\",\n disabled ? \"theme-v2:text-content-disabled\" : SELECTED_SECONDARY_V2_CLASSES,\n )}\n >\n {description}\n </span>\n </span>\n ) : (\n <span className={cn(\"min-w-0 flex-1 truncate\", selected && \"font-semibold\")}>\n {children}\n </span>\n )}\n {countNode}\n {trailingNode}\n {trailingActionNode}\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 data-selected={selected ? \"\" : undefined}\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\n ? [\n leadingNode,\n <Slottable key=\"children\">{children}</Slottable>,\n trailingNode,\n trailingActionNode,\n ]\n : 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 {...selectedProps}\n {...props}\n >\n {/* The icons slot into the consumer's element (e.g. a link) around its own children. */}\n <Slot>\n {leadingNode}\n <Slottable>{children}</Slottable>\n {trailingNode}\n {trailingActionNode}\n </Slot>\n </DropdownMenuPrimitive.Item>\n );\n }\n\n return (\n <DropdownMenuPrimitive.Item\n ref={ref}\n className={itemClassName}\n disabled={disabled}\n onSelect={onSelect}\n {...selectedProps}\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 // border-0 resets the currentColor border-top that preflight gives <hr>,\n // which would otherwise draw a second line on the sheet variant.\n const separatorClassName = cn(\"my-1.5 h-px border-0 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","className","MenuRowIcon","jsxs","Fragment","Slot","Slottable"],"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,KAA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,UAGJ,0CAACM,gBAAA,EACE,UAAA;AAAA,YAAA;AAAA,YACDP,+BAACQ,UAAAA,aAAW,UAAS;AAAA,YACpB;AAAA,YACA;AAAA,UAAA,EAAA,CACH;AAAA,QAAA;AAAA,MAAA;AAAA,IAGN;AAEA,WACER,2BAAAA;AAAAA,MAACC,iCAAsB;AAAA,MAAtB;AAAA,QACC;AAAA,QACA,WAAW;AAAA,QACX;AAAA,QACA;AAAA,QACC,GAAG;AAAA,QACH,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;AAG3D,QAAM,qBAAqBC,GAAAA,GAAG,8CAA8C,SAAS;AAKrF,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;;;;"}
@@ -5,6 +5,7 @@ const jsxRuntime = require("react/jsx-runtime");
5
5
  const React = require("react");
6
6
  const reactDom = require("react-dom");
7
7
  const cn = require("../../utils/cn.cjs");
8
+ const pointerCapture = require("../../utils/pointerCapture.cjs");
8
9
  const MenuRowIcon = require("../Icons/MenuRowIcon.cjs");
9
10
  const context = require("./context.cjs");
10
11
  const reorderShared = require("./reorderShared.cjs");
@@ -137,7 +138,7 @@ const DropdownMenuReorderItem = React__namespace.forwardRef(
137
138
  if (!canStartReorderDrag(event, handleRef.current)) return;
138
139
  if (!actions.startDrag(value, event, element)) return;
139
140
  event.preventDefault();
140
- element.setPointerCapture?.(event.pointerId);
141
+ pointerCapture.capturePointer(element, event.pointerId);
141
142
  },
142
143
  onPointerMove: (event) => {
143
144
  onPointerMove?.(event);
@@ -1 +1 @@
1
- {"version":3,"file":"DropdownMenuReorderItem.cjs","sources":["../../../../src/components/DropdownMenu/DropdownMenuReorderItem.tsx"],"sourcesContent":["import * as React from \"react\";\nimport { createPortal } from \"react-dom\";\nimport { cn } from \"../../utils/cn\";\nimport { MenuRowIcon } from \"../Icons/MenuRowIcon\";\nimport { DropdownMenuVariantContext } from \"./context\";\nimport {\n DragHandleDots,\n type ReorderActions,\n ReorderActionsContext,\n type ReorderLifted,\n ReorderLiftedContext,\n} from \"./reorderShared\";\n\nconst INTERACTIVE_CONTROL_SELECTOR = 'button, a[href], input, select, textarea, [role=\"button\"]';\n\n// A drag starts from a primary mouse button anywhere on the row — except on\n// another control inside it (a `trailing` action, say), which keeps its click\n// and focus — or from the drag handle only for touch/pen, so the rest of the\n// row still scrolls a long menu with a finger.\nfunction canStartReorderDrag(event: React.PointerEvent, handle: HTMLElement | null): boolean {\n if (event.defaultPrevented || !(event.target instanceof Element)) return false;\n const onHandle = handle?.contains(event.target) === true;\n if (event.pointerType !== \"mouse\") return onHandle;\n if (event.button !== 0) return false;\n return onHandle || event.target.closest(INTERACTIVE_CONTROL_SELECTOR) === null;\n}\n\n// pointerdown's preventDefault (needed to stop text selection) also suppresses\n// focus, so a plain click on the grip focuses it here — ArrowUp/Down then work.\nfunction focusHandleAfterClick(event: React.PointerEvent, handle: HTMLElement | null): void {\n if (handle !== null && event.target instanceof Node && handle.contains(event.target)) {\n handle.focus({ preventScroll: true });\n }\n}\n// Icon, label and trailing slot of a row — rendered once in the row itself and\n// again inside its floating copy while lifted.\nfunction ReorderRowContent({\n leadingIcon,\n trailing,\n children,\n}: Pick<DropdownMenuReorderItemProps, \"leadingIcon\" | \"trailing\" | \"children\">) {\n return (\n <>\n {leadingIcon != null && <MenuRowIcon>{leadingIcon}</MenuRowIcon>}\n <span className=\"min-w-0 flex-1 truncate\">{children}</span>\n {trailing != null && <span className=\"shrink-0\">{trailing}</span>}\n </>\n );\n}\n\n// The floating copy of a lifted row. Anchored at the viewport origin and moved\n// with a transform (see the group's positionGhost) so each pointer move is\n// compositor work only.\nfunction ReorderGhost({\n lifted,\n registerGhost,\n container,\n children,\n}: {\n lifted: ReorderLifted;\n registerGhost: ReorderActions[\"registerGhost\"];\n container: Element;\n children: React.ReactNode;\n}) {\n return createPortal(\n <div\n aria-hidden=\"true\"\n data-reorder-ghost=\"\"\n ref={registerGhost}\n className=\"pointer-events-none fixed top-0 left-0 will-change-transform\"\n style={{ width: lifted.width, zIndex: lifted.zIndex }}\n >\n {/*\n * The design draws the floating copy as frosted glass — a translucent\n * surface with a heavy backdrop blur and no drop shadow (the same\n * treatment the panel itself gets) — so what the ghost passes over\n * smears through it.\n */}\n <div className=\"overflow-hidden rounded-sm bg-surface-primary/65 backdrop-blur-[20px]\">\n <div className=\"typography-body-small-14px-regular flex min-h-10 items-center gap-2 bg-neutral-alphas-100 py-2 pr-6 pl-3 text-content-primary\">\n <DragHandleDots className=\"size-4 shrink-0 text-icons-tertiary\" />\n {children}\n </div>\n </div>\n </div>,\n container,\n );\n}\n\n/** Props for the {@link DropdownMenuReorderItem} component. */\nexport interface DropdownMenuReorderItemProps extends React.HTMLAttributes<HTMLDivElement> {\n /** Value identifying this item within the parent group's `values`. */\n value: string;\n /**\n * Plain-text name used in the group's screen-reader announcements and\n * reported in `onReorder`'s detail. Defaults to `children` when that is a\n * string or number, then to `value` — so pass it whenever `value` is an id.\n */\n label?: string;\n /** Icon (or other node) rendered between the drag handle and the label. */\n leadingIcon?: React.ReactNode;\n /** Content rendered at the end of the row, e.g. an item count. */\n trailing?: React.ReactNode;\n /** Accessible label for the drag handle button. @default \"Reorder\" */\n dragHandleLabel?: string;\n /** Disables dragging and keyboard reordering for this item. @default false */\n disabled?: boolean;\n}\n\n/**\n * A draggable row within a {@link DropdownMenuReorderGroup}. Shows the drag\n * handle grip, dims in place while its floating copy follows the pointer, and\n * supports ArrowUp/ArrowDown reordering when the handle has focus.\n */\nexport const DropdownMenuReorderItem = React.forwardRef<\n HTMLDivElement,\n DropdownMenuReorderItemProps\n>(\n (\n {\n value,\n label,\n leadingIcon,\n trailing,\n dragHandleLabel = \"Reorder\",\n disabled,\n className,\n children,\n onPointerDown,\n onPointerMove,\n onPointerUp,\n onPointerCancel,\n ...props\n },\n ref,\n ) => {\n const actions = React.useContext(ReorderActionsContext);\n const lifted = React.useContext(ReorderLiftedContext);\n const variant = React.useContext(DropdownMenuVariantContext);\n const elementRef = React.useRef<HTMLDivElement | null>(null);\n const handleRef = React.useRef<HTMLButtonElement | null>(null);\n const liftedHere = lifted !== null && lifted.value === value ? lifted : null;\n const isLifted = liftedHere !== null;\n const resolvedLabel =\n label ??\n (typeof children === \"string\" || typeof children === \"number\" ? String(children) : value);\n const grabCursor = isLifted ? \"cursor-grabbing\" : \"cursor-grab\";\n // The design dims the lifted source row as a whole — 60% opacity over its\n // own colours — rather than swapping to the disabled tone.\n const rowStateClasses = disabled\n ? \"cursor-default text-content-disabled\"\n : cn(grabCursor, isLifted ? \"opacity-60\" : \"hover:bg-neutral-alphas-50\");\n const handleStateClasses = disabled\n ? \"cursor-not-allowed [&>svg]:text-content-disabled\"\n : grabCursor;\n\n const setElement = React.useCallback(\n (node: HTMLDivElement | null) => {\n elementRef.current = node;\n if (typeof ref === \"function\") {\n ref(node);\n } else if (ref) {\n ref.current = node;\n }\n },\n [ref],\n );\n\n // Registered from an effect, not the ref callback, so re-renders don't\n // churn the group's registry with a delete + set per row.\n React.useLayoutEffect(() => {\n const element = elementRef.current;\n if (actions === null || element === null) return;\n actions.registerItem(value, { element, label: resolvedLabel });\n return () => actions.registerItem(value, null);\n }, [actions, value, resolvedLabel]);\n\n const rowContent = (\n <ReorderRowContent leadingIcon={leadingIcon} trailing={trailing}>\n {children}\n </ReorderRowContent>\n );\n\n return (\n <div\n ref={setElement}\n data-dragging={isLifted || undefined}\n className={cn(\n \"typography-body-small-14px-regular group relative flex min-h-10 w-full select-none items-center gap-2 rounded-sm px-3 py-2 text-content-primary\",\n variant === \"sheet\" && \"mx-1 w-auto\",\n rowStateClasses,\n className,\n )}\n {...props}\n onPointerDown={(event) => {\n onPointerDown?.(event);\n const element = elementRef.current;\n if (disabled || actions === null || element === null) return;\n if (!canStartReorderDrag(event, handleRef.current)) return;\n if (!actions.startDrag(value, event, element)) return;\n event.preventDefault();\n element.setPointerCapture?.(event.pointerId);\n }}\n onPointerMove={(event) => {\n onPointerMove?.(event);\n actions?.updateDrag(event);\n }}\n onPointerUp={(event) => {\n onPointerUp?.(event);\n actions?.endDrag(event.pointerId, true);\n if (!isLifted) focusHandleAfterClick(event, handleRef.current);\n }}\n onPointerCancel={(event) => {\n onPointerCancel?.(event);\n actions?.endDrag(event.pointerId, false);\n }}\n >\n <button\n ref={handleRef}\n type=\"button\"\n aria-label={dragHandleLabel}\n aria-describedby={actions?.instructionsId}\n disabled={disabled}\n className={cn(\n \"relative flex size-4 shrink-0 touch-none items-center justify-center rounded-2xs outline-none focus-visible:shadow-focus-ring\",\n // The grip draws at 16px but is the only touch drag affordance, so\n // its hit area extends 12px each way to the row's edges — a 40px\n // target — without changing the glyph.\n \"before:absolute before:-inset-3 before:content-['']\",\n handleStateClasses,\n )}\n onKeyDown={(event) => {\n if (event.key !== \"ArrowUp\" && event.key !== \"ArrowDown\") return;\n event.preventDefault();\n event.stopPropagation();\n actions?.moveItem(value, event.key === \"ArrowUp\" ? -1 : 1);\n }}\n >\n <DragHandleDots className=\"size-4 text-icons-tertiary\" />\n </button>\n {rowContent}\n {liftedHere !== null && actions !== null && (\n <ReorderGhost\n lifted={liftedHere}\n registerGhost={actions.registerGhost}\n container={elementRef.current?.ownerDocument.body ?? document.body}\n >\n {rowContent}\n </ReorderGhost>\n )}\n </div>\n );\n },\n);\nDropdownMenuReorderItem.displayName = \"DropdownMenuReorderItem\";\n"],"names":["jsxs","Fragment","jsx","MenuRowIcon","createPortal","DragHandleDots","React","ReorderActionsContext","ReorderLiftedContext","Dropdown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,GAAAA;AAAAA,gBACT;AAAA;AAAA;AAAA;AAAA,gBAIA;AAAA,gBACA;AAAA,cAAA;AAAA,cAEF,WAAW,CAAC,UAAU;AACpB,oBAAI,MAAM,QAAQ,aAAa,MAAM,QAAQ,YAAa;AAC1D,sBAAM,eAAA;AACN,sBAAM,gBAAA;AACN,yBAAS,SAAS,OAAO,MAAM,QAAQ,YAAY,KAAK,CAAC;AAAA,cAC3D;AAAA,cAEA,UAAAR,2BAAAA,IAACG,cAAAA,gBAAA,EAAe,WAAU,6BAAA,CAA6B;AAAA,YAAA;AAAA,UAAA;AAAA,UAExD;AAAA,UACA,eAAe,QAAQ,YAAY,QAClCH,2BAAAA;AAAAA,YAAC;AAAA,YAAA;AAAA,cACC,QAAQ;AAAA,cACR,eAAe,QAAQ;AAAA,cACvB,WAAW,WAAW,SAAS,cAAc,QAAQ,SAAS;AAAA,cAE7D,UAAA;AAAA,YAAA;AAAA,UAAA;AAAA,QACH;AAAA,MAAA;AAAA,IAAA;AAAA,EAIR;AACF;AACA,wBAAwB,cAAc;;"}
1
+ {"version":3,"file":"DropdownMenuReorderItem.cjs","sources":["../../../../src/components/DropdownMenu/DropdownMenuReorderItem.tsx"],"sourcesContent":["import * as React from \"react\";\nimport { createPortal } from \"react-dom\";\nimport { cn } from \"../../utils/cn\";\nimport { capturePointer } from \"../../utils/pointerCapture\";\nimport { MenuRowIcon } from \"../Icons/MenuRowIcon\";\nimport { DropdownMenuVariantContext } from \"./context\";\nimport {\n DragHandleDots,\n type ReorderActions,\n ReorderActionsContext,\n type ReorderLifted,\n ReorderLiftedContext,\n} from \"./reorderShared\";\n\nconst INTERACTIVE_CONTROL_SELECTOR = 'button, a[href], input, select, textarea, [role=\"button\"]';\n\n// A drag starts from a primary mouse button anywhere on the row — except on\n// another control inside it (a `trailing` action, say), which keeps its click\n// and focus — or from the drag handle only for touch/pen, so the rest of the\n// row still scrolls a long menu with a finger.\nfunction canStartReorderDrag(event: React.PointerEvent, handle: HTMLElement | null): boolean {\n if (event.defaultPrevented || !(event.target instanceof Element)) return false;\n const onHandle = handle?.contains(event.target) === true;\n if (event.pointerType !== \"mouse\") return onHandle;\n if (event.button !== 0) return false;\n return onHandle || event.target.closest(INTERACTIVE_CONTROL_SELECTOR) === null;\n}\n\n// pointerdown's preventDefault (needed to stop text selection) also suppresses\n// focus, so a plain click on the grip focuses it here — ArrowUp/Down then work.\nfunction focusHandleAfterClick(event: React.PointerEvent, handle: HTMLElement | null): void {\n if (handle !== null && event.target instanceof Node && handle.contains(event.target)) {\n handle.focus({ preventScroll: true });\n }\n}\n// Icon, label and trailing slot of a row — rendered once in the row itself and\n// again inside its floating copy while lifted.\nfunction ReorderRowContent({\n leadingIcon,\n trailing,\n children,\n}: Pick<DropdownMenuReorderItemProps, \"leadingIcon\" | \"trailing\" | \"children\">) {\n return (\n <>\n {leadingIcon != null && <MenuRowIcon>{leadingIcon}</MenuRowIcon>}\n <span className=\"min-w-0 flex-1 truncate\">{children}</span>\n {trailing != null && <span className=\"shrink-0\">{trailing}</span>}\n </>\n );\n}\n\n// The floating copy of a lifted row. Anchored at the viewport origin and moved\n// with a transform (see the group's positionGhost) so each pointer move is\n// compositor work only.\nfunction ReorderGhost({\n lifted,\n registerGhost,\n container,\n children,\n}: {\n lifted: ReorderLifted;\n registerGhost: ReorderActions[\"registerGhost\"];\n container: Element;\n children: React.ReactNode;\n}) {\n return createPortal(\n <div\n aria-hidden=\"true\"\n data-reorder-ghost=\"\"\n ref={registerGhost}\n className=\"pointer-events-none fixed top-0 left-0 will-change-transform\"\n style={{ width: lifted.width, zIndex: lifted.zIndex }}\n >\n {/*\n * The design draws the floating copy as frosted glass — a translucent\n * surface with a heavy backdrop blur and no drop shadow (the same\n * treatment the panel itself gets) — so what the ghost passes over\n * smears through it.\n */}\n <div className=\"overflow-hidden rounded-sm bg-surface-primary/65 backdrop-blur-[20px]\">\n <div className=\"typography-body-small-14px-regular flex min-h-10 items-center gap-2 bg-neutral-alphas-100 py-2 pr-6 pl-3 text-content-primary\">\n <DragHandleDots className=\"size-4 shrink-0 text-icons-tertiary\" />\n {children}\n </div>\n </div>\n </div>,\n container,\n );\n}\n\n/** Props for the {@link DropdownMenuReorderItem} component. */\nexport interface DropdownMenuReorderItemProps extends React.HTMLAttributes<HTMLDivElement> {\n /** Value identifying this item within the parent group's `values`. */\n value: string;\n /**\n * Plain-text name used in the group's screen-reader announcements and\n * reported in `onReorder`'s detail. Defaults to `children` when that is a\n * string or number, then to `value` — so pass it whenever `value` is an id.\n */\n label?: string;\n /** Icon (or other node) rendered between the drag handle and the label. */\n leadingIcon?: React.ReactNode;\n /** Content rendered at the end of the row, e.g. an item count. */\n trailing?: React.ReactNode;\n /** Accessible label for the drag handle button. @default \"Reorder\" */\n dragHandleLabel?: string;\n /** Disables dragging and keyboard reordering for this item. @default false */\n disabled?: boolean;\n}\n\n/**\n * A draggable row within a {@link DropdownMenuReorderGroup}. Shows the drag\n * handle grip, dims in place while its floating copy follows the pointer, and\n * supports ArrowUp/ArrowDown reordering when the handle has focus.\n */\nexport const DropdownMenuReorderItem = React.forwardRef<\n HTMLDivElement,\n DropdownMenuReorderItemProps\n>(\n (\n {\n value,\n label,\n leadingIcon,\n trailing,\n dragHandleLabel = \"Reorder\",\n disabled,\n className,\n children,\n onPointerDown,\n onPointerMove,\n onPointerUp,\n onPointerCancel,\n ...props\n },\n ref,\n ) => {\n const actions = React.useContext(ReorderActionsContext);\n const lifted = React.useContext(ReorderLiftedContext);\n const variant = React.useContext(DropdownMenuVariantContext);\n const elementRef = React.useRef<HTMLDivElement | null>(null);\n const handleRef = React.useRef<HTMLButtonElement | null>(null);\n const liftedHere = lifted !== null && lifted.value === value ? lifted : null;\n const isLifted = liftedHere !== null;\n const resolvedLabel =\n label ??\n (typeof children === \"string\" || typeof children === \"number\" ? String(children) : value);\n const grabCursor = isLifted ? \"cursor-grabbing\" : \"cursor-grab\";\n // The design dims the lifted source row as a whole — 60% opacity over its\n // own colours — rather than swapping to the disabled tone.\n const rowStateClasses = disabled\n ? \"cursor-default text-content-disabled\"\n : cn(grabCursor, isLifted ? \"opacity-60\" : \"hover:bg-neutral-alphas-50\");\n const handleStateClasses = disabled\n ? \"cursor-not-allowed [&>svg]:text-content-disabled\"\n : grabCursor;\n\n const setElement = React.useCallback(\n (node: HTMLDivElement | null) => {\n elementRef.current = node;\n if (typeof ref === \"function\") {\n ref(node);\n } else if (ref) {\n ref.current = node;\n }\n },\n [ref],\n );\n\n // Registered from an effect, not the ref callback, so re-renders don't\n // churn the group's registry with a delete + set per row.\n React.useLayoutEffect(() => {\n const element = elementRef.current;\n if (actions === null || element === null) return;\n actions.registerItem(value, { element, label: resolvedLabel });\n return () => actions.registerItem(value, null);\n }, [actions, value, resolvedLabel]);\n\n const rowContent = (\n <ReorderRowContent leadingIcon={leadingIcon} trailing={trailing}>\n {children}\n </ReorderRowContent>\n );\n\n return (\n <div\n ref={setElement}\n data-dragging={isLifted || undefined}\n className={cn(\n \"typography-body-small-14px-regular group relative flex min-h-10 w-full select-none items-center gap-2 rounded-sm px-3 py-2 text-content-primary\",\n variant === \"sheet\" && \"mx-1 w-auto\",\n rowStateClasses,\n className,\n )}\n {...props}\n onPointerDown={(event) => {\n onPointerDown?.(event);\n const element = elementRef.current;\n if (disabled || actions === null || element === null) return;\n if (!canStartReorderDrag(event, handleRef.current)) return;\n if (!actions.startDrag(value, event, element)) return;\n event.preventDefault();\n capturePointer(element, event.pointerId);\n }}\n onPointerMove={(event) => {\n onPointerMove?.(event);\n actions?.updateDrag(event);\n }}\n onPointerUp={(event) => {\n onPointerUp?.(event);\n actions?.endDrag(event.pointerId, true);\n if (!isLifted) focusHandleAfterClick(event, handleRef.current);\n }}\n onPointerCancel={(event) => {\n onPointerCancel?.(event);\n actions?.endDrag(event.pointerId, false);\n }}\n >\n <button\n ref={handleRef}\n type=\"button\"\n aria-label={dragHandleLabel}\n aria-describedby={actions?.instructionsId}\n disabled={disabled}\n className={cn(\n \"relative flex size-4 shrink-0 touch-none items-center justify-center rounded-2xs outline-none focus-visible:shadow-focus-ring\",\n // The grip draws at 16px but is the only touch drag affordance, so\n // its hit area extends 12px each way to the row's edges — a 40px\n // target — without changing the glyph.\n \"before:absolute before:-inset-3 before:content-['']\",\n handleStateClasses,\n )}\n onKeyDown={(event) => {\n if (event.key !== \"ArrowUp\" && event.key !== \"ArrowDown\") return;\n event.preventDefault();\n event.stopPropagation();\n actions?.moveItem(value, event.key === \"ArrowUp\" ? -1 : 1);\n }}\n >\n <DragHandleDots className=\"size-4 text-icons-tertiary\" />\n </button>\n {rowContent}\n {liftedHere !== null && actions !== null && (\n <ReorderGhost\n lifted={liftedHere}\n registerGhost={actions.registerGhost}\n container={elementRef.current?.ownerDocument.body ?? document.body}\n >\n {rowContent}\n </ReorderGhost>\n )}\n </div>\n );\n },\n);\nDropdownMenuReorderItem.displayName = \"DropdownMenuReorderItem\";\n"],"names":["jsxs","Fragment","jsx","MenuRowIcon","createPortal","DragHandleDots","React","ReorderActionsContext","ReorderLiftedContext","DropdownMenuVariantContext","cn","capturePointer"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAcA,MAAM,+BAA+B;AAMrC,SAAS,oBAAoB,OAA2B,QAAqC;AAC3F,MAAI,MAAM,oBAAoB,EAAE,MAAM,kBAAkB,SAAU,QAAO;AACzE,QAAM,WAAW,QAAQ,SAAS,MAAM,MAAM,MAAM;AACpD,MAAI,MAAM,gBAAgB,QAAS,QAAO;AAC1C,MAAI,MAAM,WAAW,EAAG,QAAO;AAC/B,SAAO,YAAY,MAAM,OAAO,QAAQ,4BAA4B,MAAM;AAC5E;AAIA,SAAS,sBAAsB,OAA2B,QAAkC;AAC1F,MAAI,WAAW,QAAQ,MAAM,kBAAkB,QAAQ,OAAO,SAAS,MAAM,MAAM,GAAG;AACpF,WAAO,MAAM,EAAE,eAAe,KAAA,CAAM;AAAA,EACtC;AACF;AAGA,SAAS,kBAAkB;AAAA,EACzB;AAAA,EACA;AAAA,EACA;AACF,GA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H;AAAA,MAAA;AAAA,IAAA;AAAA,EAIR;AACF;AACA,wBAAwB,cAAc;;"}
@@ -7,6 +7,8 @@ const reactUseControllableState = require("@radix-ui/react-use-controllable-stat
7
7
  const React = require("react");
8
8
  const cn = require("../../utils/cn.cjs");
9
9
  const floatingContentCollisionPadding = require("../../utils/floatingContentCollisionPadding.cjs");
10
+ const floatingContentSurface = require("../../utils/floatingContentSurface.cjs");
11
+ const pointerCapture = require("../../utils/pointerCapture.cjs");
10
12
  const Drawer = require("../Drawer/Drawer.cjs");
11
13
  const IconDefaults = require("../Icons/IconDefaults.cjs");
12
14
  const context = require("./context.cjs");
@@ -89,7 +91,7 @@ const DropdownMenuTrigger = React__namespace.forwardRef((props, ref) => {
89
91
  onPointerDown: (event) => {
90
92
  props.onPointerDown?.(event);
91
93
  if (event.pointerType === "mouse" || props.disabled) return;
92
- event.currentTarget.setPointerCapture?.(event.pointerId);
94
+ pointerCapture.capturePointer(event.currentTarget, event.pointerId);
93
95
  tapRef.current = {
94
96
  pointerId: event.pointerId,
95
97
  x: event.clientX,
@@ -156,7 +158,7 @@ const DropdownMenuContent = React__namespace.forwardRef(
156
158
  position: "bottom",
157
159
  variant: "menu",
158
160
  overlayProps: { className: "backdrop-blur-[8px]" },
159
- className: cn.cn("flex flex-col gap-1 p-1 pb-2", className),
161
+ className: cn.cn("flex flex-col gap-0.5 p-1 pb-2", className),
160
162
  style,
161
163
  onPointerDownOutside,
162
164
  onCloseAutoFocus,
@@ -186,15 +188,11 @@ const DropdownMenuContent = React__namespace.forwardRef(
186
188
  sideOffset,
187
189
  collisionPadding,
188
190
  className: cn.cn(
189
- // Panel tokens come from `V2 Menu Dropdown` (library node `17245:2317`):
190
- // `rounded-md` (16px) over `Background/Secondary`, a `Border/Strong`
191
- // stroke, 8px of padding, and the `blur + shadow/menu` effect. Rows
192
- // inside it are 12px `rounded-sm`, the library's `V2 Menu Item` radius.
193
- //
194
- // `backdrop-blur-xs` (4px) is the CSS equivalent of that effect's
195
- // BACKGROUND_BLUR radius 8, which Figma halves on export. It is not a
196
- // 4-against-8 mismatch.
197
- "w-max min-w-(--radix-dropdown-menu-trigger-width) max-w-(--radix-dropdown-menu-content-available-width) overflow-y-auto rounded-md border border-border-strong bg-background-secondary p-2 text-content-primary shadow-blur-menu backdrop-blur-xs",
191
+ // The surface is shared with Select and Popover. `V2 Menu Dropdown`
192
+ // (library node `17245:2317`) adds 8px of padding here. Rows inside it
193
+ // are 12px `rounded-sm`, the library's `V2 Menu Item` radius.
194
+ floatingContentSurface.FLOATING_CONTENT_SURFACE_CLASS,
195
+ "flex w-max min-w-(--radix-dropdown-menu-trigger-width) max-w-(--radix-dropdown-menu-content-available-width) flex-col gap-0.5 overflow-y-auto p-2",
198
196
  "data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95 data-[state=open]:animate-in",
199
197
  "data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=closed]:animate-out",
200
198
  "data-[side=top]:slide-in-from-bottom-2 data-[side=bottom]:slide-in-from-top-2",
@@ -202,7 +200,7 @@ const DropdownMenuContent = React__namespace.forwardRef(
202
200
  className
203
201
  ),
204
202
  style: {
205
- zIndex: "var(--fanvue-ui-portal-z-index, 50)",
203
+ zIndex: floatingContentSurface.FLOATING_CONTENT_Z_INDEX,
206
204
  maxHeight: "var(--radix-dropdown-menu-content-available-height)",
207
205
  ...style
208
206
  },
@@ -213,7 +211,14 @@ const DropdownMenuContent = React__namespace.forwardRef(
213
211
  }
214
212
  );
215
213
  DropdownMenuContent.displayName = "DropdownMenuContent";
216
- const DropdownMenuGroup = DropdownMenuPrimitive__namespace.Group;
214
+ const DropdownMenuGroup = React__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
215
+ DropdownMenuPrimitive__namespace.Group,
216
+ {
217
+ ref,
218
+ className: cn.cn("flex flex-col gap-0.5", className),
219
+ ...props
220
+ }
221
+ ));
217
222
  DropdownMenuGroup.displayName = "DropdownMenuGroup";
218
223
  exports.DropdownMenu = DropdownMenu;
219
224
  exports.DropdownMenuContent = DropdownMenuContent;