@fanvue/ui 3.31.0 → 3.32.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/components/ChatInput/ChatInput.cjs +6 -5
- package/dist/cjs/components/ChatInput/ChatInput.cjs.map +1 -1
- package/dist/cjs/components/DropdownMenu/DropdownMenuHeader.cjs +190 -0
- package/dist/cjs/components/DropdownMenu/DropdownMenuHeader.cjs.map +1 -0
- package/dist/cjs/components/DropdownMenu/DropdownMenuItem.cjs +213 -0
- package/dist/cjs/components/DropdownMenu/DropdownMenuItem.cjs.map +1 -0
- package/dist/cjs/components/DropdownMenu/DropdownMenuReorderGroup.cjs +438 -0
- package/dist/cjs/components/DropdownMenu/DropdownMenuReorderGroup.cjs.map +1 -0
- package/dist/cjs/components/DropdownMenu/DropdownMenuReorderItem.cjs +197 -0
- package/dist/cjs/components/DropdownMenu/DropdownMenuReorderItem.cjs.map +1 -0
- package/dist/cjs/components/DropdownMenu/DropdownMenuRoot.cjs +221 -0
- package/dist/cjs/components/DropdownMenu/DropdownMenuRoot.cjs.map +1 -0
- package/dist/cjs/components/DropdownMenu/DropdownMenuSelectionItems.cjs +128 -0
- package/dist/cjs/components/DropdownMenu/DropdownMenuSelectionItems.cjs.map +1 -0
- package/dist/cjs/components/DropdownMenu/context.cjs +26 -0
- package/dist/cjs/components/DropdownMenu/context.cjs.map +1 -0
- package/dist/cjs/components/DropdownMenu/reorderShared.cjs +38 -0
- package/dist/cjs/components/DropdownMenu/reorderShared.cjs.map +1 -0
- package/dist/cjs/index.cjs +19 -12
- package/dist/cjs/index.cjs.map +1 -1
- package/dist/components/ChatInput/ChatInput.mjs +2 -1
- package/dist/components/ChatInput/ChatInput.mjs.map +1 -1
- package/dist/components/DropdownMenu/DropdownMenuHeader.mjs +173 -0
- package/dist/components/DropdownMenu/DropdownMenuHeader.mjs.map +1 -0
- package/dist/components/DropdownMenu/DropdownMenuItem.mjs +195 -0
- package/dist/components/DropdownMenu/DropdownMenuItem.mjs.map +1 -0
- package/dist/components/DropdownMenu/DropdownMenuReorderGroup.mjs +421 -0
- package/dist/components/DropdownMenu/DropdownMenuReorderGroup.mjs.map +1 -0
- package/dist/components/DropdownMenu/DropdownMenuReorderItem.mjs +180 -0
- package/dist/components/DropdownMenu/DropdownMenuReorderItem.mjs.map +1 -0
- package/dist/components/DropdownMenu/DropdownMenuRoot.mjs +203 -0
- package/dist/components/DropdownMenu/DropdownMenuRoot.mjs.map +1 -0
- package/dist/components/DropdownMenu/DropdownMenuSelectionItems.mjs +110 -0
- package/dist/components/DropdownMenu/DropdownMenuSelectionItems.mjs.map +1 -0
- package/dist/components/DropdownMenu/context.mjs +9 -0
- package/dist/components/DropdownMenu/context.mjs.map +1 -0
- package/dist/components/DropdownMenu/reorderShared.mjs +21 -0
- package/dist/components/DropdownMenu/reorderShared.mjs.map +1 -0
- package/dist/index.d.ts +121 -1
- package/dist/index.mjs +8 -1
- package/dist/index.mjs.map +1 -1
- package/package.json +3 -2
- package/dist/cjs/components/DropdownMenu/DropdownMenu.cjs +0 -598
- package/dist/cjs/components/DropdownMenu/DropdownMenu.cjs.map +0 -1
- package/dist/components/DropdownMenu/DropdownMenu.mjs +0 -580
- package/dist/components/DropdownMenu/DropdownMenu.mjs.map +0 -1
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsxs, jsx } from "react/jsx-runtime";
|
|
3
|
+
import * as DropdownMenuPrimitive from "@radix-ui/react-dropdown-menu";
|
|
4
|
+
import * as React from "react";
|
|
5
|
+
import { cn } from "../../utils/cn.mjs";
|
|
6
|
+
import { TickIcon } from "../Icons/TickIcon.mjs";
|
|
7
|
+
const DropdownMenuRadioGroup = DropdownMenuPrimitive.RadioGroup;
|
|
8
|
+
const DropdownMenuRadioItem = React.forwardRef(({ className, children, helper, size: _size = "40", ...props }, ref) => {
|
|
9
|
+
return /* @__PURE__ */ jsxs(
|
|
10
|
+
DropdownMenuPrimitive.RadioItem,
|
|
11
|
+
{
|
|
12
|
+
ref,
|
|
13
|
+
className: cn(
|
|
14
|
+
// `px-3` (12px), not 16px: `V2 Menu Radio Item` is `px-[12px] py-[8px]`
|
|
15
|
+
// (node `7393:62008`), and at 16px a radio row indented 4px further than a
|
|
16
|
+
// `DropdownMenuCheckboxItem` in the same menu.
|
|
17
|
+
"group flex w-full cursor-pointer items-start gap-3 rounded-xs px-3 py-2 outline-none",
|
|
18
|
+
"data-[highlighted]:bg-neutral-alphas-50",
|
|
19
|
+
"data-[disabled]:cursor-not-allowed data-[disabled]:text-content-disabled",
|
|
20
|
+
// See DropdownMenuItem above: bg-interaction-hover aliases to the same
|
|
21
|
+
// token as the plain hover background, so it can't distinguish the
|
|
22
|
+
// checked state from an unchecked-but-hovered row.
|
|
23
|
+
"data-[state=checked]:bg-neutral-alphas-100",
|
|
24
|
+
"data-[state=checked]:data-[highlighted]:bg-neutral-alphas-200",
|
|
25
|
+
className
|
|
26
|
+
),
|
|
27
|
+
...props,
|
|
28
|
+
children: [
|
|
29
|
+
/* @__PURE__ */ jsx(
|
|
30
|
+
"span",
|
|
31
|
+
{
|
|
32
|
+
className: cn(
|
|
33
|
+
"mt-1 flex size-4 shrink-0 items-center justify-center rounded-full border border-icons-primary",
|
|
34
|
+
"group-data-[disabled]:border-content-disabled"
|
|
35
|
+
),
|
|
36
|
+
"aria-hidden": "true",
|
|
37
|
+
children: /* @__PURE__ */ jsx(DropdownMenuPrimitive.ItemIndicator, { asChild: true, children: /* @__PURE__ */ jsx("span", { className: "size-2 rounded-full bg-content-primary" }) })
|
|
38
|
+
}
|
|
39
|
+
),
|
|
40
|
+
/* @__PURE__ */ jsxs("span", { className: "flex min-w-0 flex-1 flex-col gap-1", children: [
|
|
41
|
+
/* @__PURE__ */ jsx("span", { className: "typography-body-default-16px-semibold truncate", children }),
|
|
42
|
+
helper && /* @__PURE__ */ jsx(
|
|
43
|
+
"span",
|
|
44
|
+
{
|
|
45
|
+
className: cn(
|
|
46
|
+
"typography-description-12px-regular text-content-secondary",
|
|
47
|
+
"group-data-[disabled]:text-content-disabled"
|
|
48
|
+
),
|
|
49
|
+
children: helper
|
|
50
|
+
}
|
|
51
|
+
)
|
|
52
|
+
] })
|
|
53
|
+
]
|
|
54
|
+
}
|
|
55
|
+
);
|
|
56
|
+
});
|
|
57
|
+
DropdownMenuRadioItem.displayName = "DropdownMenuRadioItem";
|
|
58
|
+
const DropdownMenuCheckboxItem = React.forwardRef(({ className, children, helper, avatar, ...props }, ref) => {
|
|
59
|
+
return /* @__PURE__ */ jsxs(
|
|
60
|
+
DropdownMenuPrimitive.CheckboxItem,
|
|
61
|
+
{
|
|
62
|
+
ref,
|
|
63
|
+
className: cn(
|
|
64
|
+
"group flex w-full cursor-pointer items-center gap-3 rounded-xs px-3 py-2 outline-none",
|
|
65
|
+
// Checked state is carried by the tick alone. A background here would
|
|
66
|
+
// leave every selected row shaded, which reads as "all highlighted" on
|
|
67
|
+
// a menu that starts fully selected.
|
|
68
|
+
"data-[highlighted]:bg-neutral-alphas-50",
|
|
69
|
+
"data-[disabled]:cursor-not-allowed data-[disabled]:text-content-disabled",
|
|
70
|
+
className
|
|
71
|
+
),
|
|
72
|
+
...props,
|
|
73
|
+
children: [
|
|
74
|
+
/* @__PURE__ */ jsx(
|
|
75
|
+
"span",
|
|
76
|
+
{
|
|
77
|
+
className: cn(
|
|
78
|
+
"flex size-4 shrink-0 items-center justify-center rounded-2xs border border-icons-primary",
|
|
79
|
+
"group-data-[state=checked]:bg-icons-primary",
|
|
80
|
+
"group-data-[disabled]:border-content-disabled"
|
|
81
|
+
),
|
|
82
|
+
"aria-hidden": "true",
|
|
83
|
+
children: /* @__PURE__ */ jsx(DropdownMenuPrimitive.ItemIndicator, { asChild: true, children: /* @__PURE__ */ jsx(TickIcon, { className: "size-4 text-content-primary-inverted" }) })
|
|
84
|
+
}
|
|
85
|
+
),
|
|
86
|
+
avatar && /* @__PURE__ */ jsx("span", { className: "shrink-0", children: avatar }),
|
|
87
|
+
/* @__PURE__ */ jsxs("span", { className: "flex min-w-0 flex-1 flex-col gap-1", children: [
|
|
88
|
+
/* @__PURE__ */ jsx("span", { className: "typography-body-default-16px-semibold truncate", children }),
|
|
89
|
+
helper && /* @__PURE__ */ jsx(
|
|
90
|
+
"span",
|
|
91
|
+
{
|
|
92
|
+
className: cn(
|
|
93
|
+
"typography-description-12px-regular text-content-secondary",
|
|
94
|
+
"group-data-[disabled]:text-content-disabled"
|
|
95
|
+
),
|
|
96
|
+
children: helper
|
|
97
|
+
}
|
|
98
|
+
)
|
|
99
|
+
] })
|
|
100
|
+
]
|
|
101
|
+
}
|
|
102
|
+
);
|
|
103
|
+
});
|
|
104
|
+
DropdownMenuCheckboxItem.displayName = "DropdownMenuCheckboxItem";
|
|
105
|
+
export {
|
|
106
|
+
DropdownMenuCheckboxItem,
|
|
107
|
+
DropdownMenuRadioGroup,
|
|
108
|
+
DropdownMenuRadioItem
|
|
109
|
+
};
|
|
110
|
+
//# sourceMappingURL=DropdownMenuSelectionItems.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DropdownMenuSelectionItems.mjs","sources":["../../../src/components/DropdownMenu/DropdownMenuSelectionItems.tsx"],"sourcesContent":["import * as DropdownMenuPrimitive from \"@radix-ui/react-dropdown-menu\";\nimport * as React from \"react\";\nimport { cn } from \"../../utils/cn\";\nimport { TickIcon } from \"../Icons/TickIcon\";\n\n/** Props for the {@link DropdownMenuRadioGroup} component. */\nexport interface DropdownMenuRadioGroupProps\n extends React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.RadioGroup> {}\n\n/**\n * Groups {@link DropdownMenuRadioItem} children so they behave as a\n * single-select set. Controlled via `value`/`onValueChange`.\n *\n * @example\n * ```tsx\n * <DropdownMenuRadioGroup value={sort} onValueChange={setSort}>\n * <DropdownMenuRadioItem value=\"newest\">Newest first</DropdownMenuRadioItem>\n * <DropdownMenuRadioItem value=\"oldest\">Oldest first</DropdownMenuRadioItem>\n * </DropdownMenuRadioGroup>\n * ```\n *\n * Requires Radix menu context — not supported inside a `variant=\"sheet\"` menu.\n */\nexport const DropdownMenuRadioGroup = DropdownMenuPrimitive.RadioGroup;\n\n/** Height preset for a {@link DropdownMenuRadioItem}. */\nexport type DropdownMenuRadioItemSize = \"40\";\n\nexport interface DropdownMenuRadioItemProps\n extends React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.RadioItem> {\n /** Optional secondary text shown below the title. */\n helper?: string;\n /** Height of the item row. @default \"40\" */\n size?: DropdownMenuRadioItemSize;\n}\n\n/**\n * A single radio-style choice within a {@link DropdownMenuRadioGroup}. Shows\n * a circular indicator that fills when selected, plus an optional helper line\n * underneath the title.\n */\nexport const DropdownMenuRadioItem = React.forwardRef<\n React.ComponentRef<typeof DropdownMenuPrimitive.RadioItem>,\n DropdownMenuRadioItemProps\n>(({ className, children, helper, size: _size = \"40\", ...props }, ref) => {\n return (\n <DropdownMenuPrimitive.RadioItem\n ref={ref}\n className={cn(\n // `px-3` (12px), not 16px: `V2 Menu Radio Item` is `px-[12px] py-[8px]`\n // (node `7393:62008`), and at 16px a radio row indented 4px further than a\n // `DropdownMenuCheckboxItem` in the same menu.\n \"group flex w-full cursor-pointer items-start gap-3 rounded-xs px-3 py-2 outline-none\",\n \"data-[highlighted]:bg-neutral-alphas-50\",\n \"data-[disabled]:cursor-not-allowed data-[disabled]:text-content-disabled\",\n // See DropdownMenuItem above: bg-interaction-hover aliases to the same\n // token as the plain hover background, so it can't distinguish the\n // checked state from an unchecked-but-hovered row.\n \"data-[state=checked]:bg-neutral-alphas-100\",\n \"data-[state=checked]:data-[highlighted]:bg-neutral-alphas-200\",\n className,\n )}\n {...props}\n >\n <span\n className={cn(\n \"mt-1 flex size-4 shrink-0 items-center justify-center rounded-full border border-icons-primary\",\n \"group-data-[disabled]:border-content-disabled\",\n )}\n aria-hidden=\"true\"\n >\n <DropdownMenuPrimitive.ItemIndicator asChild>\n <span className=\"size-2 rounded-full bg-content-primary\" />\n </DropdownMenuPrimitive.ItemIndicator>\n </span>\n <span className=\"flex min-w-0 flex-1 flex-col gap-1\">\n <span className=\"typography-body-default-16px-semibold truncate\">{children}</span>\n {helper && (\n <span\n className={cn(\n \"typography-description-12px-regular text-content-secondary\",\n \"group-data-[disabled]:text-content-disabled\",\n )}\n >\n {helper}\n </span>\n )}\n </span>\n </DropdownMenuPrimitive.RadioItem>\n );\n});\nDropdownMenuRadioItem.displayName = \"DropdownMenuRadioItem\";\n\nexport interface DropdownMenuCheckboxItemProps\n extends React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.CheckboxItem> {\n /** Optional secondary text shown below the title. */\n helper?: string;\n /** Leading avatar rendered between the checkbox and the title. Render at 32px to match the design. */\n avatar?: React.ReactNode;\n}\n\n/**\n * A single multi-select choice within a dropdown menu. Shows a square indicator\n * that fills when checked, an optional leading avatar, and an optional helper\n * line underneath the title.\n *\n * Pair with {@link DropdownMenuHeader} at `type=\"search\"` for filterable menus.\n * Use {@link DropdownMenuRadioItem} instead when only one option may be active.\n *\n * @example\n * ```tsx\n * <DropdownMenuCheckboxItem\n * checked={selected.has(creator.id)}\n * onCheckedChange={() => toggle(creator.id)}\n * avatar={<Avatar size={32} src={creator.avatarUrl} />}\n * >\n * @sofiabloom\n * </DropdownMenuCheckboxItem>\n * ```\n */\nexport const DropdownMenuCheckboxItem = React.forwardRef<\n React.ComponentRef<typeof DropdownMenuPrimitive.CheckboxItem>,\n DropdownMenuCheckboxItemProps\n>(({ className, children, helper, avatar, ...props }, ref) => {\n return (\n <DropdownMenuPrimitive.CheckboxItem\n ref={ref}\n className={cn(\n \"group flex w-full cursor-pointer items-center gap-3 rounded-xs px-3 py-2 outline-none\",\n // Checked state is carried by the tick alone. A background here would\n // leave every selected row shaded, which reads as \"all highlighted\" on\n // a menu that starts fully selected.\n \"data-[highlighted]:bg-neutral-alphas-50\",\n \"data-[disabled]:cursor-not-allowed data-[disabled]:text-content-disabled\",\n className,\n )}\n {...props}\n >\n <span\n className={cn(\n \"flex size-4 shrink-0 items-center justify-center rounded-2xs border border-icons-primary\",\n \"group-data-[state=checked]:bg-icons-primary\",\n \"group-data-[disabled]:border-content-disabled\",\n )}\n aria-hidden=\"true\"\n >\n <DropdownMenuPrimitive.ItemIndicator asChild>\n <TickIcon className=\"size-4 text-content-primary-inverted\" />\n </DropdownMenuPrimitive.ItemIndicator>\n </span>\n {avatar && <span className=\"shrink-0\">{avatar}</span>}\n <span className=\"flex min-w-0 flex-1 flex-col gap-1\">\n <span className=\"typography-body-default-16px-semibold truncate\">{children}</span>\n {helper && (\n <span\n className={cn(\n \"typography-description-12px-regular text-content-secondary\",\n \"group-data-[disabled]:text-content-disabled\",\n )}\n >\n {helper}\n </span>\n )}\n </span>\n </DropdownMenuPrimitive.CheckboxItem>\n );\n});\nDropdownMenuCheckboxItem.displayName = \"DropdownMenuCheckboxItem\";\n"],"names":[],"mappings":";;;;;;AAuBO,MAAM,yBAAyB,sBAAsB;AAkBrD,MAAM,wBAAwB,MAAM,WAGzC,CAAC,EAAE,WAAW,UAAU,QAAQ,MAAM,QAAQ,MAAM,GAAG,MAAA,GAAS,QAAQ;AACxE,SACE;AAAA,IAAC,sBAAsB;AAAA,IAAtB;AAAA,MACC;AAAA,MACA,WAAW;AAAA;AAAA;AAAA;AAAA,QAIT;AAAA,QACA;AAAA,QACA;AAAA;AAAA;AAAA;AAAA,QAIA;AAAA,QACA;AAAA,QACA;AAAA,MAAA;AAAA,MAED,GAAG;AAAA,MAEJ,UAAA;AAAA,QAAA;AAAA,UAAC;AAAA,UAAA;AAAA,YACC,WAAW;AAAA,cACT;AAAA,cACA;AAAA,YAAA;AAAA,YAEF,eAAY;AAAA,YAEZ,UAAA,oBAAC,sBAAsB,eAAtB,EAAoC,SAAO,MAC1C,UAAA,oBAAC,QAAA,EAAK,WAAU,yCAAA,CAAyC,EAAA,CAC3D;AAAA,UAAA;AAAA,QAAA;AAAA,QAEF,qBAAC,QAAA,EAAK,WAAU,sCACd,UAAA;AAAA,UAAA,oBAAC,QAAA,EAAK,WAAU,kDAAkD,SAAA,CAAS;AAAA,UAC1E,UACC;AAAA,YAAC;AAAA,YAAA;AAAA,cACC,WAAW;AAAA,gBACT;AAAA,gBACA;AAAA,cAAA;AAAA,cAGD,UAAA;AAAA,YAAA;AAAA,UAAA;AAAA,QACH,EAAA,CAEJ;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA;AAGN,CAAC;AACD,sBAAsB,cAAc;AA6B7B,MAAM,2BAA2B,MAAM,WAG5C,CAAC,EAAE,WAAW,UAAU,QAAQ,QAAQ,GAAG,MAAA,GAAS,QAAQ;AAC5D,SACE;AAAA,IAAC,sBAAsB;AAAA,IAAtB;AAAA,MACC;AAAA,MACA,WAAW;AAAA,QACT;AAAA;AAAA;AAAA;AAAA,QAIA;AAAA,QACA;AAAA,QACA;AAAA,MAAA;AAAA,MAED,GAAG;AAAA,MAEJ,UAAA;AAAA,QAAA;AAAA,UAAC;AAAA,UAAA;AAAA,YACC,WAAW;AAAA,cACT;AAAA,cACA;AAAA,cACA;AAAA,YAAA;AAAA,YAEF,eAAY;AAAA,YAEZ,UAAA,oBAAC,sBAAsB,eAAtB,EAAoC,SAAO,MAC1C,UAAA,oBAAC,UAAA,EAAS,WAAU,uCAAA,CAAuC,EAAA,CAC7D;AAAA,UAAA;AAAA,QAAA;AAAA,QAED,UAAU,oBAAC,QAAA,EAAK,WAAU,YAAY,UAAA,QAAO;AAAA,QAC9C,qBAAC,QAAA,EAAK,WAAU,sCACd,UAAA;AAAA,UAAA,oBAAC,QAAA,EAAK,WAAU,kDAAkD,SAAA,CAAS;AAAA,UAC1E,UACC;AAAA,YAAC;AAAA,YAAA;AAAA,cACC,WAAW;AAAA,gBACT;AAAA,gBACA;AAAA,cAAA;AAAA,cAGD,UAAA;AAAA,YAAA;AAAA,UAAA;AAAA,QACH,EAAA,CAEJ;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA;AAGN,CAAC;AACD,yBAAyB,cAAc;"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
const ToggleOpenContext = React.createContext(null);
|
|
4
|
+
const DropdownMenuVariantContext = React.createContext("menu");
|
|
5
|
+
export {
|
|
6
|
+
DropdownMenuVariantContext,
|
|
7
|
+
ToggleOpenContext
|
|
8
|
+
};
|
|
9
|
+
//# sourceMappingURL=context.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"context.mjs","sources":["../../../src/components/DropdownMenu/context.ts"],"sourcesContent":["import * as React from \"react\";\n\n// Lets DropdownMenuTrigger toggle the menu directly so it can gate on touch\n// movement — see radix-ui/primitives#1912.\nexport const ToggleOpenContext = React.createContext<\n ((updater: (prev: boolean) => boolean) => void) | null\n>(null);\n\n/**\n * How a {@link DropdownMenu} presents its content.\n * - `\"menu\"` (default) — a Radix-positioned panel anchored to the trigger.\n * - `\"sheet\"` — a bottom drawer (via {@link Drawer}), for mobile/touch viewports.\n *\n * The viewport decision belongs to the consumer (it owns the breakpoint\n * source of truth), so pass e.g. `variant={isDesktop ? \"menu\" : \"sheet\"}`.\n */\nexport type DropdownMenuVariant = \"menu\" | \"sheet\";\n\nexport const DropdownMenuVariantContext = React.createContext<DropdownMenuVariant>(\"menu\");\n"],"names":[],"mappings":";;AAIO,MAAM,oBAAoB,MAAM,cAErC,IAAI;AAYC,MAAM,6BAA6B,MAAM,cAAmC,MAAM;"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsxs, jsx } from "react/jsx-runtime";
|
|
3
|
+
import * as React from "react";
|
|
4
|
+
function DragHandleDots(props) {
|
|
5
|
+
return /* @__PURE__ */ jsxs("svg", { viewBox: "0 0 16 16", fill: "currentColor", "aria-hidden": "true", ...props, children: [
|
|
6
|
+
/* @__PURE__ */ jsx("circle", { cx: "5.333", cy: "2.667", r: "1.333" }),
|
|
7
|
+
/* @__PURE__ */ jsx("circle", { cx: "5.333", cy: "8", r: "1.333" }),
|
|
8
|
+
/* @__PURE__ */ jsx("circle", { cx: "5.333", cy: "13.333", r: "1.333" }),
|
|
9
|
+
/* @__PURE__ */ jsx("circle", { cx: "10.667", cy: "2.667", r: "1.333" }),
|
|
10
|
+
/* @__PURE__ */ jsx("circle", { cx: "10.667", cy: "8", r: "1.333" }),
|
|
11
|
+
/* @__PURE__ */ jsx("circle", { cx: "10.667", cy: "13.333", r: "1.333" })
|
|
12
|
+
] });
|
|
13
|
+
}
|
|
14
|
+
const ReorderActionsContext = React.createContext(null);
|
|
15
|
+
const ReorderLiftedContext = React.createContext(null);
|
|
16
|
+
export {
|
|
17
|
+
DragHandleDots,
|
|
18
|
+
ReorderActionsContext,
|
|
19
|
+
ReorderLiftedContext
|
|
20
|
+
};
|
|
21
|
+
//# sourceMappingURL=reorderShared.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"reorderShared.mjs","sources":["../../../src/components/DropdownMenu/reorderShared.tsx"],"sourcesContent":["import * as React from \"react\";\n\n// Types, contexts and the grip glyph shared by DropdownMenuReorderGroup and\n// DropdownMenuReorderItem. Internal to the DropdownMenu directory.\n// The `V2 Menu Item` drag handle glyph (2×3 dot grip). Inlined rather than\n// added to `src/components/Icons` because that directory is generated from\n// Figma exports and hand-written files there are overwritten by icons:sync.\nexport function DragHandleDots(props: React.SVGAttributes<SVGSVGElement>) {\n return (\n <svg viewBox=\"0 0 16 16\" fill=\"currentColor\" aria-hidden=\"true\" {...props}>\n <circle cx=\"5.333\" cy=\"2.667\" r=\"1.333\" />\n <circle cx=\"5.333\" cy=\"8\" r=\"1.333\" />\n <circle cx=\"5.333\" cy=\"13.333\" r=\"1.333\" />\n <circle cx=\"10.667\" cy=\"2.667\" r=\"1.333\" />\n <circle cx=\"10.667\" cy=\"8\" r=\"1.333\" />\n <circle cx=\"10.667\" cy=\"13.333\" r=\"1.333\" />\n </svg>\n );\n}\n\n/** Describes a completed reorder: which item moved and where. */\nexport interface DropdownMenuReorderDetail {\n /** `value` of the item that moved. */\n value: string;\n /** Plain-text name of the item that moved (see `DropdownMenuReorderItem.label`). */\n label: string;\n /** Index the item moved from. */\n from: number;\n /** Index the item now occupies. */\n to: number;\n /** Number of items in the group. */\n total: number;\n}\n\nexport type RegisteredReorderItem = { element: HTMLDivElement; label: string };\n\n// Everything a drag needs between pointer events. It lives in a ref rather\n// than state: pointer moves mutate it and write the ghost's transform directly,\n// and only a lift, a drop-index change or the drop itself reach React.\nexport type ReorderDrag = {\n value: string;\n pointerId: number;\n element: HTMLDivElement;\n startX: number;\n startY: number;\n offsetX: number;\n offsetY: number;\n lifted: boolean;\n dropIndex: number;\n // Geometry captured once at lift. Rows never move during a drag — the source\n // row stays in flow, dimmed — so the only thing that shifts them is the\n // scroll container, tracked by comparing its scrollTop with the value here.\n /** Row vertical centres in viewport coordinates at measure time. */\n midpoints: number[];\n /** Row top edges plus the last row's bottom, relative to the group. */\n edges: number[];\n scrollTopAtMeasure: number;\n containerRect: DOMRect | null;\n};\n\nexport type ReorderLifted = { value: string; width: number; zIndex: string };\n\nexport type ReorderActions = {\n registerItem: (value: string, item: RegisteredReorderItem | null) => void;\n registerGhost: (element: HTMLDivElement | null) => void;\n /** Returns `false` when another pointer already owns a drag. */\n startDrag: (value: string, event: React.PointerEvent, element: HTMLDivElement) => boolean;\n updateDrag: (event: React.PointerEvent) => void;\n endDrag: (pointerId: number, commit: boolean) => void;\n moveItem: (value: string, delta: number) => void;\n instructionsId: string;\n};\n\nexport const ReorderActionsContext = React.createContext<ReorderActions | null>(null);\n// Separate from the actions so rows re-render only when a lift starts or ends,\n// not on every drop-index change (which only the group's indicator needs).\nexport const ReorderLiftedContext = React.createContext<ReorderLifted | null>(null);\n"],"names":[],"mappings":";;;AAOO,SAAS,eAAe,OAA2C;AACxE,SACE,qBAAC,SAAI,SAAQ,aAAY,MAAK,gBAAe,eAAY,QAAQ,GAAG,OAClE,UAAA;AAAA,IAAA,oBAAC,YAAO,IAAG,SAAQ,IAAG,SAAQ,GAAE,SAAQ;AAAA,wBACvC,UAAA,EAAO,IAAG,SAAQ,IAAG,KAAI,GAAE,SAAQ;AAAA,wBACnC,UAAA,EAAO,IAAG,SAAQ,IAAG,UAAS,GAAE,SAAQ;AAAA,wBACxC,UAAA,EAAO,IAAG,UAAS,IAAG,SAAQ,GAAE,SAAQ;AAAA,wBACxC,UAAA,EAAO,IAAG,UAAS,IAAG,KAAI,GAAE,SAAQ;AAAA,wBACpC,UAAA,EAAO,IAAG,UAAS,IAAG,UAAS,GAAE,QAAA,CAAQ;AAAA,EAAA,GAC5C;AAEJ;AAuDO,MAAM,wBAAwB,MAAM,cAAqC,IAAI;AAG7E,MAAM,uBAAuB,MAAM,cAAoC,IAAI;"}
|
package/dist/index.d.ts
CHANGED
|
@@ -2861,12 +2861,30 @@ export declare interface DropdownMenuHeaderProps extends React_2.HTMLAttributes<
|
|
|
2861
2861
|
title?: string;
|
|
2862
2862
|
/** Configuration for the embedded search input when `type="search"`. */
|
|
2863
2863
|
searchProps?: DropdownMenuHeaderSearchProps;
|
|
2864
|
+
/**
|
|
2865
|
+
* Action elements rendered at the end of the header row, before the close
|
|
2866
|
+
* button — e.g. icon buttons for search/add, or a primary "Done" button that
|
|
2867
|
+
* commits a {@link DropdownMenuReorderGroup} reorder. An action that should
|
|
2868
|
+
* close the menu needs the menu's `open` state controlled (only the built-in
|
|
2869
|
+
* close button can dismiss an uncontrolled menu).
|
|
2870
|
+
*/
|
|
2871
|
+
actions?: React_2.ReactNode;
|
|
2864
2872
|
/** Whether to render the close icon button on the right. @default true */
|
|
2865
2873
|
showClose?: boolean;
|
|
2866
2874
|
/** Fires when the close icon button is activated. */
|
|
2867
2875
|
onClose?: () => void;
|
|
2868
2876
|
/** Accessible label for the close button. @default "Close menu" */
|
|
2869
2877
|
closeLabel?: string;
|
|
2878
|
+
/**
|
|
2879
|
+
* Fires when the back icon button at the start of the row is activated.
|
|
2880
|
+
* Rendering it lets a menu step back from a sub-view — a `type="search"`
|
|
2881
|
+
* header returning to its title, for instance — without closing the menu.
|
|
2882
|
+
*/
|
|
2883
|
+
onBack?: () => void;
|
|
2884
|
+
/** Whether to render the back icon button. @default `onBack !== undefined` */
|
|
2885
|
+
showBack?: boolean;
|
|
2886
|
+
/** Accessible label for the back button. @default "Back" */
|
|
2887
|
+
backLabel?: string;
|
|
2870
2888
|
}
|
|
2871
2889
|
|
|
2872
2890
|
/** Search-input configuration for {@link DropdownMenuHeader} when `type="search"`. */
|
|
@@ -3022,6 +3040,108 @@ export declare interface DropdownMenuRadioItemProps extends React_2.ComponentPro
|
|
|
3022
3040
|
/** Height preset for a {@link DropdownMenuRadioItem}. */
|
|
3023
3041
|
export declare type DropdownMenuRadioItemSize = "40";
|
|
3024
3042
|
|
|
3043
|
+
/** Describes a completed reorder: which item moved and where. */
|
|
3044
|
+
export declare interface DropdownMenuReorderDetail {
|
|
3045
|
+
/** `value` of the item that moved. */
|
|
3046
|
+
value: string;
|
|
3047
|
+
/** Plain-text name of the item that moved (see `DropdownMenuReorderItem.label`). */
|
|
3048
|
+
label: string;
|
|
3049
|
+
/** Index the item moved from. */
|
|
3050
|
+
from: number;
|
|
3051
|
+
/** Index the item now occupies. */
|
|
3052
|
+
to: number;
|
|
3053
|
+
/** Number of items in the group. */
|
|
3054
|
+
total: number;
|
|
3055
|
+
}
|
|
3056
|
+
|
|
3057
|
+
/**
|
|
3058
|
+
* A drag-to-reorder list of {@link DropdownMenuReorderItem} rows within a
|
|
3059
|
+
* dropdown menu — the "Reorganise" mode of `V2 Menu Dropdown`. Rows are
|
|
3060
|
+
* dragged with the pointer (from anywhere on the row with a mouse, from the
|
|
3061
|
+
* drag handle on touch) or moved with ArrowUp/ArrowDown on the focused
|
|
3062
|
+
* handle. Works in both the `"menu"` and `"sheet"` variants — for a long
|
|
3063
|
+
* list in a sheet, give the scrolling ancestor `overflow-y-auto` (the sheet
|
|
3064
|
+
* only caps its height) so edge auto-scroll has something to scroll.
|
|
3065
|
+
*
|
|
3066
|
+
* Inside a `"menu"`, Tab cycles through the handles and any header actions
|
|
3067
|
+
* (Radix menus otherwise swallow Tab), and the first handle takes focus when
|
|
3068
|
+
* the menu opens straight into the group.
|
|
3069
|
+
*
|
|
3070
|
+
* Pair with a {@link DropdownMenuHeader} whose `actions` contains a commit
|
|
3071
|
+
* button to exit the reorder mode.
|
|
3072
|
+
*
|
|
3073
|
+
* @example
|
|
3074
|
+
* ```tsx
|
|
3075
|
+
* <DropdownMenuReorderGroup
|
|
3076
|
+
* values={folders.map((folder) => folder.id)}
|
|
3077
|
+
* onReorder={(_, { value, to }) => moveFolder(value, to)}
|
|
3078
|
+
* aria-label="Reorder folders"
|
|
3079
|
+
* >
|
|
3080
|
+
* {folders.map((folder) => (
|
|
3081
|
+
* <DropdownMenuReorderItem key={folder.id} value={folder.id} label={folder.name}>
|
|
3082
|
+
* {folder.name}
|
|
3083
|
+
* </DropdownMenuReorderItem>
|
|
3084
|
+
* ))}
|
|
3085
|
+
* </DropdownMenuReorderGroup>
|
|
3086
|
+
* ```
|
|
3087
|
+
*/
|
|
3088
|
+
export declare const DropdownMenuReorderGroup: React_2.ForwardRefExoticComponent<DropdownMenuReorderGroupProps & React_2.RefAttributes<HTMLDivElement>>;
|
|
3089
|
+
|
|
3090
|
+
/** Props for the {@link DropdownMenuReorderGroup} component. */
|
|
3091
|
+
export declare interface DropdownMenuReorderGroupProps extends Omit<React_2.HTMLAttributes<HTMLDivElement>, "onChange"> {
|
|
3092
|
+
/**
|
|
3093
|
+
* Item values in their current order. Must contain one entry per
|
|
3094
|
+
* {@link DropdownMenuReorderItem} child, in the same order the children are
|
|
3095
|
+
* rendered.
|
|
3096
|
+
*/
|
|
3097
|
+
values: string[];
|
|
3098
|
+
/**
|
|
3099
|
+
* Fires after a drop or a keyboard move completes with the new order, plus
|
|
3100
|
+
* which item moved and from/to where — enough to call a move-to-position
|
|
3101
|
+
* API without diffing the arrays.
|
|
3102
|
+
*/
|
|
3103
|
+
onReorder: (values: string[], detail: DropdownMenuReorderDetail) => void;
|
|
3104
|
+
/**
|
|
3105
|
+
* Builds the text announced to screen readers after a move. Override to
|
|
3106
|
+
* localise it.
|
|
3107
|
+
* @default ({ label, to, total }) => `${label} moved to position ${to + 1} of ${total}`
|
|
3108
|
+
*/
|
|
3109
|
+
getAnnouncement?: (detail: DropdownMenuReorderDetail) => string;
|
|
3110
|
+
/**
|
|
3111
|
+
* Screen-reader instructions attached to every drag handle. Override to
|
|
3112
|
+
* localise them.
|
|
3113
|
+
* @default "Press the up and down arrow keys to move this item."
|
|
3114
|
+
*/
|
|
3115
|
+
instructions?: string;
|
|
3116
|
+
}
|
|
3117
|
+
|
|
3118
|
+
/**
|
|
3119
|
+
* A draggable row within a {@link DropdownMenuReorderGroup}. Shows the drag
|
|
3120
|
+
* handle grip, dims in place while its floating copy follows the pointer, and
|
|
3121
|
+
* supports ArrowUp/ArrowDown reordering when the handle has focus.
|
|
3122
|
+
*/
|
|
3123
|
+
export declare const DropdownMenuReorderItem: React_2.ForwardRefExoticComponent<DropdownMenuReorderItemProps & React_2.RefAttributes<HTMLDivElement>>;
|
|
3124
|
+
|
|
3125
|
+
/** Props for the {@link DropdownMenuReorderItem} component. */
|
|
3126
|
+
export declare interface DropdownMenuReorderItemProps extends React_2.HTMLAttributes<HTMLDivElement> {
|
|
3127
|
+
/** Value identifying this item within the parent group's `values`. */
|
|
3128
|
+
value: string;
|
|
3129
|
+
/**
|
|
3130
|
+
* Plain-text name used in the group's screen-reader announcements and
|
|
3131
|
+
* reported in `onReorder`'s detail. Defaults to `children` when that is a
|
|
3132
|
+
* string or number, then to `value` — so pass it whenever `value` is an id.
|
|
3133
|
+
*/
|
|
3134
|
+
label?: string;
|
|
3135
|
+
/** Icon (or other node) rendered between the drag handle and the label. */
|
|
3136
|
+
leadingIcon?: React_2.ReactNode;
|
|
3137
|
+
/** Content rendered at the end of the row, e.g. an item count. */
|
|
3138
|
+
trailing?: React_2.ReactNode;
|
|
3139
|
+
/** Accessible label for the drag handle button. @default "Reorder" */
|
|
3140
|
+
dragHandleLabel?: string;
|
|
3141
|
+
/** Disables dragging and keyboard reordering for this item. @default false */
|
|
3142
|
+
disabled?: boolean;
|
|
3143
|
+
}
|
|
3144
|
+
|
|
3025
3145
|
/** Visual separator between groups of items. */
|
|
3026
3146
|
export declare const DropdownMenuSeparator: React_2.ForwardRefExoticComponent<DropdownMenuSeparatorProps & React_2.RefAttributes<HTMLDivElement>>;
|
|
3027
3147
|
|
|
@@ -3050,7 +3170,7 @@ export declare type DropdownMenuTriggerProps = React_2.ComponentPropsWithoutRef<
|
|
|
3050
3170
|
* The viewport decision belongs to the consumer (it owns the breakpoint
|
|
3051
3171
|
* source of truth), so pass e.g. `variant={isDesktop ? "menu" : "sheet"}`.
|
|
3052
3172
|
*/
|
|
3053
|
-
declare type DropdownMenuVariant = "menu" | "sheet";
|
|
3173
|
+
export declare type DropdownMenuVariant = "menu" | "sheet";
|
|
3054
3174
|
|
|
3055
3175
|
/**
|
|
3056
3176
|
* Edit icon. Renders at sizes 16, 24, or 32 px with outlined and filled variants.
|
package/dist/index.mjs
CHANGED
|
@@ -38,7 +38,6 @@ import { Demographics } from "./components/Demographics/Demographics.mjs";
|
|
|
38
38
|
import { Dialog, DialogBody, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogTitle, DialogTrigger } from "./components/Dialog/Dialog.mjs";
|
|
39
39
|
import { Divider } from "./components/Divider/Divider.mjs";
|
|
40
40
|
import { Drawer, DrawerClose, DrawerContent, DrawerDescription, DrawerFooter, DrawerHeader, DrawerOverlay, DrawerTitle, DrawerTrigger } from "./components/Drawer/Drawer.mjs";
|
|
41
|
-
import { DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuHeader, DropdownMenuItem, DropdownMenuLabel, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuTrigger } from "./components/DropdownMenu/DropdownMenu.mjs";
|
|
42
41
|
import { EmptyState } from "./components/EmptyState/EmptyState.mjs";
|
|
43
42
|
import { FanFollowerCount } from "./components/FanFollowerCount/FanFollowerCount.mjs";
|
|
44
43
|
import { FloatingActionButton } from "./components/FloatingActionButton/FloatingActionButton.mjs";
|
|
@@ -272,6 +271,12 @@ import { cn } from "./utils/cn.mjs";
|
|
|
272
271
|
import { getInitials } from "./utils/getInitials.mjs";
|
|
273
272
|
import { useFittedBarCount } from "./utils/useFittedBarCount.mjs";
|
|
274
273
|
import { useSuppressClickAfterDrag } from "./utils/useSuppressClickAfterDrag.mjs";
|
|
274
|
+
import { DropdownMenu, DropdownMenuContent, DropdownMenuGroup, DropdownMenuTrigger } from "./components/DropdownMenu/DropdownMenuRoot.mjs";
|
|
275
|
+
import { DropdownMenuCheckboxItem, DropdownMenuRadioGroup, DropdownMenuRadioItem } from "./components/DropdownMenu/DropdownMenuSelectionItems.mjs";
|
|
276
|
+
import { DropdownMenuHeader } from "./components/DropdownMenu/DropdownMenuHeader.mjs";
|
|
277
|
+
import { DropdownMenuItem, DropdownMenuLabel, DropdownMenuSeparator } from "./components/DropdownMenu/DropdownMenuItem.mjs";
|
|
278
|
+
import { DropdownMenuReorderGroup } from "./components/DropdownMenu/DropdownMenuReorderGroup.mjs";
|
|
279
|
+
import { DropdownMenuReorderItem } from "./components/DropdownMenu/DropdownMenuReorderItem.mjs";
|
|
275
280
|
export {
|
|
276
281
|
AI2Icon,
|
|
277
282
|
AICallIcon,
|
|
@@ -403,6 +408,8 @@ export {
|
|
|
403
408
|
DropdownMenuLabel,
|
|
404
409
|
DropdownMenuRadioGroup,
|
|
405
410
|
DropdownMenuRadioItem,
|
|
411
|
+
DropdownMenuReorderGroup,
|
|
412
|
+
DropdownMenuReorderItem,
|
|
406
413
|
DropdownMenuSeparator,
|
|
407
414
|
DropdownMenuTrigger,
|
|
408
415
|
EditIcon,
|
package/dist/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fanvue/ui",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.32.0",
|
|
4
4
|
"description": "React component library built with Tailwind CSS for Fanvue ecosystem",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org",
|
|
@@ -196,7 +196,8 @@
|
|
|
196
196
|
"lodash-es": ">=4.18.0",
|
|
197
197
|
"minimatch": ">=10.2.3",
|
|
198
198
|
"ajv": ">=8.18.0",
|
|
199
|
-
"fast-uri": ">=4.1.
|
|
199
|
+
"fast-uri": ">=4.1.3",
|
|
200
|
+
"browserslist": ">=4.28.7",
|
|
200
201
|
"brace-expansion": ">=5.0.9",
|
|
201
202
|
"yaml": ">=2.8.3",
|
|
202
203
|
"postcss": ">=8.5.23",
|