@ai-matrx/design-system 0.86.335 → 0.86.337
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/CHANGELOG.md +5 -0
- package/dist/{chunk-SUVIHUAD.js → chunk-BYOFPPPI.js} +53 -6
- package/dist/chunk-BYOFPPPI.js.map +1 -0
- package/dist/chunk-L5OACQXS.js +409 -0
- package/dist/chunk-L5OACQXS.js.map +1 -0
- package/dist/{chunk-4CO5STZU.js → chunk-WZC3K7SO.js} +74 -157
- package/dist/chunk-WZC3K7SO.js.map +1 -0
- package/dist/desktop.cjs.map +1 -1
- package/dist/desktop.js +7 -6
- package/dist/desktop.js.map +1 -1
- package/dist/index.cjs +1526 -1187
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +7 -3
- package/dist/index.d.ts +7 -3
- package/dist/index.js +19 -18
- package/dist/index.js.map +1 -1
- package/dist/item.cjs +646 -372
- package/dist/item.cjs.map +1 -1
- package/dist/item.d.cts +1 -3
- package/dist/item.d.ts +1 -3
- package/dist/item.js +25 -33
- package/dist/item.js.map +1 -1
- package/dist/menu-look.cjs +521 -36
- package/dist/menu-look.cjs.map +1 -1
- package/dist/menu-look.css +96 -1
- package/dist/menu-look.d.cts +320 -37
- package/dist/menu-look.d.ts +320 -37
- package/dist/menu-look.js +60 -121
- package/dist/menu-look.js.map +1 -1
- package/dist/record-list.cjs +533 -253
- package/dist/record-list.cjs.map +1 -1
- package/dist/record-list.js +3 -1
- package/dist/record-list.js.map +1 -1
- package/package.json +2 -2
- package/dist/chunk-4CO5STZU.js.map +0 -1
- package/dist/chunk-SUVIHUAD.js.map +0 -1
package/dist/record-list.cjs
CHANGED
|
@@ -945,7 +945,6 @@ function keepMovedFocus(handler) {
|
|
|
945
945
|
var import_jsx_runtime13 = require("react/jsx-runtime");
|
|
946
946
|
var DropdownMenu = DropdownMenuPrimitive.Root;
|
|
947
947
|
var DropdownMenuTrigger = DropdownMenuPrimitive.Trigger;
|
|
948
|
-
var DropdownMenuSub = DropdownMenuPrimitive.Sub;
|
|
949
948
|
var MENU_SURFACE_CLASS = "z-[10001] min-w-[8rem] max-h-[var(--radix-dropdown-menu-content-available-height)] overflow-y-auto overflow-x-hidden overscroll-contain rounded-md border bg-popover p-1 text-popover-foreground";
|
|
950
949
|
var MENU_ITEM_CLASS = "relative flex select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:text-disabled-foreground";
|
|
951
950
|
var MENU_INDICATOR_ITEM_CLASS = "relative flex select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:text-disabled-foreground";
|
|
@@ -1700,7 +1699,6 @@ var React10 = __toESM(require("react"), 1);
|
|
|
1700
1699
|
var import_jsx_runtime18 = require("react/jsx-runtime");
|
|
1701
1700
|
var ContextMenu = ContextMenuPrimitive.Root;
|
|
1702
1701
|
var ContextMenuTrigger = ContextMenuPrimitive.Trigger;
|
|
1703
|
-
var ContextMenuSub = ContextMenuPrimitive.Sub;
|
|
1704
1702
|
var SURFACE_CLASS = "z-[10001] min-w-[8rem] max-h-[var(--radix-context-menu-content-available-height)] overflow-y-auto overflow-x-hidden overscroll-contain rounded-md border bg-popover p-1 text-popover-foreground";
|
|
1705
1703
|
var ITEM_CLASS = "relative flex select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:text-disabled-foreground";
|
|
1706
1704
|
var INDICATOR_ITEM_CLASS = "relative flex select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:text-disabled-foreground";
|
|
@@ -1857,19 +1855,381 @@ var ContextMenuShortcut = ({
|
|
|
1857
1855
|
);
|
|
1858
1856
|
ContextMenuShortcut.displayName = "ContextMenuShortcut";
|
|
1859
1857
|
|
|
1858
|
+
// src/menu-look.tsx
|
|
1859
|
+
var React12 = __toESM(require("react"), 1);
|
|
1860
|
+
var DropdownMenuPrimitive2 = __toESM(require("@radix-ui/react-dropdown-menu"), 1);
|
|
1861
|
+
var ContextMenuPrimitive2 = __toESM(require("@radix-ui/react-context-menu"), 1);
|
|
1862
|
+
|
|
1863
|
+
// src/popover.tsx
|
|
1864
|
+
var PopoverPrimitive = __toESM(require("@radix-ui/react-popover"), 1);
|
|
1865
|
+
var React11 = __toESM(require("react"), 1);
|
|
1866
|
+
var import_jsx_runtime19 = require("react/jsx-runtime");
|
|
1867
|
+
var POPOVER_WIDTH_CLASS = {
|
|
1868
|
+
xs: "w-48",
|
|
1869
|
+
sm: "w-60",
|
|
1870
|
+
md: "w-72",
|
|
1871
|
+
lg: "w-80",
|
|
1872
|
+
xl: "w-[26rem]",
|
|
1873
|
+
"2xl": "w-[34rem]"
|
|
1874
|
+
};
|
|
1875
|
+
var POPOVER_PADDING_CLASS = {
|
|
1876
|
+
none: "p-0",
|
|
1877
|
+
xs: "p-1",
|
|
1878
|
+
sm: "p-2",
|
|
1879
|
+
md: "p-3",
|
|
1880
|
+
default: "p-4"
|
|
1881
|
+
};
|
|
1882
|
+
var PopoverContent = React11.forwardRef(
|
|
1883
|
+
({
|
|
1884
|
+
className,
|
|
1885
|
+
align = "center",
|
|
1886
|
+
sideOffset = 4,
|
|
1887
|
+
container,
|
|
1888
|
+
animated = true,
|
|
1889
|
+
sizing = "fixed",
|
|
1890
|
+
surface = "default",
|
|
1891
|
+
width = "md",
|
|
1892
|
+
padding = "default",
|
|
1893
|
+
collisionPadding = 16,
|
|
1894
|
+
onCloseAutoFocus,
|
|
1895
|
+
...props
|
|
1896
|
+
}, ref) => {
|
|
1897
|
+
const portalContainer = usePortalContainer(container);
|
|
1898
|
+
return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(PopoverPrimitive.Portal, { container: portalContainer, children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
1899
|
+
PopoverPrimitive.Content,
|
|
1900
|
+
{
|
|
1901
|
+
ref,
|
|
1902
|
+
align,
|
|
1903
|
+
sideOffset,
|
|
1904
|
+
collisionPadding,
|
|
1905
|
+
"data-surface": surface === "solid" ? "solid" : void 0,
|
|
1906
|
+
"data-width": sizing === "content" ? void 0 : width,
|
|
1907
|
+
"data-padding": padding,
|
|
1908
|
+
className: cn(
|
|
1909
|
+
// Cap to the viewport space Radix measured and scroll — a popover taller
|
|
1910
|
+
// than the screen must never trap the user with unreachable content.
|
|
1911
|
+
// z must EQUAL the dialog layer (z-[10000]), never exceed it: with equal
|
|
1912
|
+
// z, DOM portal order decides, so a dialog opened FROM a popover stacks
|
|
1913
|
+
// above it, and a popover opened from a dialog still stacks above the
|
|
1914
|
+
// dialog. z-[10001] buried dialogs behind fullscreen popovers.
|
|
1915
|
+
"z-[10000] max-h-[var(--radix-popover-content-available-height)] overflow-y-auto overscroll-contain rounded-md border bg-popover text-popover-foreground shadow-md outline-none",
|
|
1916
|
+
POPOVER_PADDING_CLASS[padding],
|
|
1917
|
+
sizing === "content" ? "w-auto min-w-[min(max(var(--radix-popover-trigger-width),20rem),calc(100vw-2rem))] max-w-[min(28rem,calc(100vw-2rem))]" : cn(POPOVER_WIDTH_CLASS[width], "max-w-[calc(100vw-2rem)]"),
|
|
1918
|
+
surface === "solid" && SOLID_SURFACE_CLASS,
|
|
1919
|
+
animated && MOTION_POPPER,
|
|
1920
|
+
className
|
|
1921
|
+
),
|
|
1922
|
+
...props,
|
|
1923
|
+
onCloseAutoFocus: keepMovedFocus(onCloseAutoFocus)
|
|
1924
|
+
}
|
|
1925
|
+
) });
|
|
1926
|
+
}
|
|
1927
|
+
);
|
|
1928
|
+
PopoverContent.displayName = PopoverPrimitive.Content.displayName;
|
|
1929
|
+
|
|
1930
|
+
// src/menu-look.tsx
|
|
1931
|
+
var import_jsx_runtime20 = require("react/jsx-runtime");
|
|
1932
|
+
var MENU_LOOK_CLASS = {
|
|
1933
|
+
panel: "cm-menu",
|
|
1934
|
+
item: "cm-item",
|
|
1935
|
+
iconSlot: "cm-icon-slot",
|
|
1936
|
+
icon: "cm-icon",
|
|
1937
|
+
text: "cm-text",
|
|
1938
|
+
label: "cm-label",
|
|
1939
|
+
hint: "cm-hint",
|
|
1940
|
+
current: "cm-current",
|
|
1941
|
+
chevron: "cm-chevron",
|
|
1942
|
+
search: "cm-search",
|
|
1943
|
+
trail: "cm-trail",
|
|
1944
|
+
badge: "cm-badge",
|
|
1945
|
+
shortcut: "cm-shortcut",
|
|
1946
|
+
control: "cm-control",
|
|
1947
|
+
divider: "cm-divider",
|
|
1948
|
+
sectionLabel: "cm-section-label",
|
|
1949
|
+
header: "cm-header",
|
|
1950
|
+
headerMark: "cm-header-mark",
|
|
1951
|
+
headerText: "cm-header-text",
|
|
1952
|
+
headerTitle: "cm-header-title",
|
|
1953
|
+
headerSubtitle: "cm-header-subtitle",
|
|
1954
|
+
danger: "cm-danger",
|
|
1955
|
+
dimmed: "cm-dimmed"
|
|
1956
|
+
};
|
|
1957
|
+
function MenuLookIconSlot({ children }) {
|
|
1958
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("span", { className: MENU_LOOK_CLASS.iconSlot, children });
|
|
1959
|
+
}
|
|
1960
|
+
function MenuLookRowBody({ icon, label, labelTitle, description, trail, badge, shortcut, current }) {
|
|
1961
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(import_jsx_runtime20.Fragment, { children: [
|
|
1962
|
+
icon ? /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(MenuLookIconSlot, { children: icon }) : null,
|
|
1963
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("span", { className: MENU_LOOK_CLASS.text, children: [
|
|
1964
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("span", { className: MENU_LOOK_CLASS.label, title: labelTitle, children: label }),
|
|
1965
|
+
description ? /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("span", { className: MENU_LOOK_CLASS.hint, children: description }) : null
|
|
1966
|
+
] }),
|
|
1967
|
+
trail ? /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("span", { className: MENU_LOOK_CLASS.trail, children: trail }) : null,
|
|
1968
|
+
badge ? /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("span", { className: MENU_LOOK_CLASS.badge, children: badge }) : null,
|
|
1969
|
+
shortcut ? /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("kbd", { className: MENU_LOOK_CLASS.shortcut, children: shortcut }) : null,
|
|
1970
|
+
current ? /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(RadixCheckIcon, { className: MENU_LOOK_CLASS.current, "aria-hidden": "true", "data-menu-current-mark": "" }) : null
|
|
1971
|
+
] });
|
|
1972
|
+
}
|
|
1973
|
+
function menuLookItemClass({ destructive, dimmed } = {}) {
|
|
1974
|
+
return `${MENU_LOOK_CLASS.item}${destructive ? ` ${MENU_LOOK_CLASS.danger}` : ""}${dimmed ? ` ${MENU_LOOK_CLASS.dimmed}` : ""}`;
|
|
1975
|
+
}
|
|
1976
|
+
function DeclaredOverflow({ label, children }) {
|
|
1977
|
+
const fade = useScrollFade();
|
|
1978
|
+
const viewport = React12.useRef(null);
|
|
1979
|
+
const setViewport = React12.useCallback(
|
|
1980
|
+
(node) => {
|
|
1981
|
+
viewport.current = node;
|
|
1982
|
+
fade.ref(node);
|
|
1983
|
+
},
|
|
1984
|
+
[fade.ref]
|
|
1985
|
+
);
|
|
1986
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(import_jsx_runtime20.Fragment, { children: [
|
|
1987
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("div", { ref: setViewport, className: "cm-viewport", "data-slot": "menu-look-viewport", children }),
|
|
1988
|
+
fade.state.bottom ? /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(
|
|
1989
|
+
"button",
|
|
1990
|
+
{
|
|
1991
|
+
type: "button",
|
|
1992
|
+
className: "cm-more-below",
|
|
1993
|
+
"data-slot": "menu-look-more-below",
|
|
1994
|
+
tabIndex: -1,
|
|
1995
|
+
"aria-hidden": "true",
|
|
1996
|
+
onPointerDown: (event) => event.preventDefault(),
|
|
1997
|
+
onClick: () => viewport.current?.scrollTo({ top: viewport.current.scrollHeight, behavior: "smooth" }),
|
|
1998
|
+
children: [
|
|
1999
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(RadixChevronDownIcon, { "aria-hidden": "true" }),
|
|
2000
|
+
label
|
|
2001
|
+
]
|
|
2002
|
+
}
|
|
2003
|
+
) : null
|
|
2004
|
+
] });
|
|
2005
|
+
}
|
|
2006
|
+
var MenuLookContent = React12.forwardRef(function MenuLookContent2({ size = "standard", density = "comfortable", moreBelowLabel, children, ...props }, ref) {
|
|
2007
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
2008
|
+
DropdownMenuContent,
|
|
2009
|
+
{
|
|
2010
|
+
ref,
|
|
2011
|
+
surface: "solid",
|
|
2012
|
+
"data-menu-look": "",
|
|
2013
|
+
"data-menu-family": "dropdown",
|
|
2014
|
+
"data-size": size,
|
|
2015
|
+
"data-density": density,
|
|
2016
|
+
...moreBelowLabel ? { "data-overflow": "declared" } : {},
|
|
2017
|
+
...props,
|
|
2018
|
+
className: MENU_LOOK_CLASS.panel,
|
|
2019
|
+
children: moreBelowLabel ? /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(DeclaredOverflow, { label: moreBelowLabel, children }) : children
|
|
2020
|
+
}
|
|
2021
|
+
);
|
|
2022
|
+
});
|
|
2023
|
+
var MenuLookSubContent = React12.forwardRef(function MenuLookSubContent2({ size = "standard", density = "comfortable", fit = "menu", ...props }, ref) {
|
|
2024
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
2025
|
+
DropdownMenuSubContent,
|
|
2026
|
+
{
|
|
2027
|
+
ref,
|
|
2028
|
+
surface: "solid",
|
|
2029
|
+
"data-menu-look": "",
|
|
2030
|
+
"data-menu-family": "dropdown",
|
|
2031
|
+
"data-size": size,
|
|
2032
|
+
"data-density": density,
|
|
2033
|
+
"data-fit": fit,
|
|
2034
|
+
...props,
|
|
2035
|
+
className: MENU_LOOK_CLASS.panel
|
|
2036
|
+
}
|
|
2037
|
+
);
|
|
2038
|
+
});
|
|
2039
|
+
var MenuLookContextContent = React12.forwardRef(function MenuLookContextContent2({ size = "standard", density = "comfortable", ...props }, ref) {
|
|
2040
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
2041
|
+
ContextMenuContent,
|
|
2042
|
+
{
|
|
2043
|
+
ref,
|
|
2044
|
+
"data-menu-look": "",
|
|
2045
|
+
"data-menu-family": "context",
|
|
2046
|
+
"data-size": size,
|
|
2047
|
+
"data-density": density,
|
|
2048
|
+
...props,
|
|
2049
|
+
className: MENU_LOOK_CLASS.panel
|
|
2050
|
+
}
|
|
2051
|
+
);
|
|
2052
|
+
});
|
|
2053
|
+
var MenuLookContextSubContent = React12.forwardRef(function MenuLookContextSubContent2({ size = "standard", density = "comfortable", fit = "menu", ...props }, ref) {
|
|
2054
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
2055
|
+
ContextMenuSubContent,
|
|
2056
|
+
{
|
|
2057
|
+
ref,
|
|
2058
|
+
"data-menu-look": "",
|
|
2059
|
+
"data-menu-family": "context",
|
|
2060
|
+
"data-size": size,
|
|
2061
|
+
"data-density": density,
|
|
2062
|
+
"data-fit": fit,
|
|
2063
|
+
...props,
|
|
2064
|
+
className: MENU_LOOK_CLASS.panel
|
|
2065
|
+
}
|
|
2066
|
+
);
|
|
2067
|
+
});
|
|
2068
|
+
function menuLookRows(P, family) {
|
|
2069
|
+
const Item3 = React12.forwardRef(function MenuLookItem2({ icon, label, labelTitle, description, trail, badge, shortcut, current, destructive, dimmed, href, target, linkProps, ...props }, ref) {
|
|
2070
|
+
const className = menuLookItemClass({ destructive, dimmed });
|
|
2071
|
+
const body = /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(MenuLookRowBody, { icon, label, labelTitle, description, trail, badge, shortcut, current });
|
|
2072
|
+
const mark = current ? { "data-current": "" } : {};
|
|
2073
|
+
if (href) {
|
|
2074
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(P.Item, { ref, asChild: true, "data-slot": `${family}-item`, ...props, ...mark, className, children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("a", { href, target, rel: target === "_blank" ? "noopener noreferrer" : void 0, ...linkProps, children: body }) });
|
|
2075
|
+
}
|
|
2076
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(P.Item, { ref, "data-slot": `${family}-item`, ...props, ...mark, className, children: body });
|
|
2077
|
+
});
|
|
2078
|
+
const SubTrigger3 = React12.forwardRef(function MenuLookSubTrigger2({ icon, label, labelTitle, description, trail, badge, shortcut, current, ...props }, ref) {
|
|
2079
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(P.SubTrigger, { ref, "data-slot": `${family}-sub-trigger`, ...props, ...current ? { "data-current": "" } : {}, className: MENU_LOOK_CLASS.item, children: [
|
|
2080
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(MenuLookRowBody, { icon, label, labelTitle, description, trail, badge, shortcut }),
|
|
2081
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(RadixChevronRightIcon, { className: MENU_LOOK_CLASS.chevron, "aria-hidden": "true" })
|
|
2082
|
+
] });
|
|
2083
|
+
});
|
|
2084
|
+
const CheckboxItem3 = React12.forwardRef(function MenuLookCheckboxItem2({ icon, label, labelTitle, description, trail, badge, shortcut, checked, ...props }, ref) {
|
|
2085
|
+
const on = checked === true;
|
|
2086
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(P.CheckboxItem, { ref, ...checked === void 0 ? {} : { checked }, ...props, className: MENU_LOOK_CLASS.item, children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(MenuLookRowBody, { icon: on ? /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(RadixCheckIcon, { className: MENU_LOOK_CLASS.icon }) : icon ?? /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("span", { className: MENU_LOOK_CLASS.icon, "aria-hidden": "true" }), label, labelTitle, description, trail, badge, shortcut }) });
|
|
2087
|
+
});
|
|
2088
|
+
const RadioItem3 = React12.forwardRef(function MenuLookRadioItem2({ icon, label, labelTitle, description, trail, badge, shortcut, ...props }, ref) {
|
|
2089
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(P.RadioItem, { ref, ...props, className: MENU_LOOK_CLASS.item, children: [
|
|
2090
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(MenuLookRowBody, { icon, label, labelTitle, description, trail, badge, shortcut }),
|
|
2091
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(P.ItemIndicator, { className: MENU_LOOK_CLASS.current, "data-menu-current-mark": "", children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(RadixCheckIcon, { "aria-hidden": "true" }) })
|
|
2092
|
+
] });
|
|
2093
|
+
});
|
|
2094
|
+
const Label3 = React12.forwardRef(function MenuLookLabel2({ description, children, ...props }, ref) {
|
|
2095
|
+
if (!description) return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(P.Label, { ref, ...props, className: MENU_LOOK_CLASS.sectionLabel, children });
|
|
2096
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(P.Label, { ref, ...props, "data-has-hint": "", className: MENU_LOOK_CLASS.sectionLabel, children: [
|
|
2097
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("span", { children }),
|
|
2098
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("span", { className: MENU_LOOK_CLASS.hint, children: description })
|
|
2099
|
+
] });
|
|
2100
|
+
});
|
|
2101
|
+
const Separator3 = React12.forwardRef(function MenuLookSeparator2(props, ref) {
|
|
2102
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(P.Separator, { ref, ...props, className: MENU_LOOK_CLASS.divider });
|
|
2103
|
+
});
|
|
2104
|
+
return { Item: Item3, SubTrigger: SubTrigger3, CheckboxItem: CheckboxItem3, RadioItem: RadioItem3, Label: Label3, Separator: Separator3 };
|
|
2105
|
+
}
|
|
2106
|
+
var dropdownRows = menuLookRows(DropdownMenuPrimitive2, "dropdown-menu");
|
|
2107
|
+
var contextRows = menuLookRows(ContextMenuPrimitive2, "context-menu");
|
|
2108
|
+
var MenuLookItem = dropdownRows.Item;
|
|
2109
|
+
var MenuLookSub = DropdownMenuPrimitive2.Sub;
|
|
2110
|
+
var MenuLookSubTrigger = dropdownRows.SubTrigger;
|
|
2111
|
+
var MenuLookCheckboxItem = dropdownRows.CheckboxItem;
|
|
2112
|
+
var MenuLookRadioItem = dropdownRows.RadioItem;
|
|
2113
|
+
var MenuLookLabel = dropdownRows.Label;
|
|
2114
|
+
var MenuLookSeparator = dropdownRows.Separator;
|
|
2115
|
+
var MenuLookContextItem = contextRows.Item;
|
|
2116
|
+
var MenuLookContextSub = ContextMenuPrimitive2.Sub;
|
|
2117
|
+
var MenuLookContextSubTrigger = contextRows.SubTrigger;
|
|
2118
|
+
var MenuLookContextCheckboxItem = contextRows.CheckboxItem;
|
|
2119
|
+
var MenuLookContextRadioItem = contextRows.RadioItem;
|
|
2120
|
+
var MenuLookContextLabel = contextRows.Label;
|
|
2121
|
+
var MenuLookContextSeparator = contextRows.Separator;
|
|
2122
|
+
var MenuLookPanel = React12.forwardRef(function MenuLookPanel2({ size = "standard", density = "comfortable", surface = "floating", fillBelow, role = "menu", ...props }, ref) {
|
|
2123
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
2124
|
+
"div",
|
|
2125
|
+
{
|
|
2126
|
+
ref,
|
|
2127
|
+
role,
|
|
2128
|
+
"data-menu-look": "",
|
|
2129
|
+
"data-menu-family": "panel",
|
|
2130
|
+
"data-surface": surface,
|
|
2131
|
+
...fillBelow ? { "data-fill-below": fillBelow } : {},
|
|
2132
|
+
"data-size": size,
|
|
2133
|
+
"data-density": density,
|
|
2134
|
+
...props,
|
|
2135
|
+
className: MENU_LOOK_CLASS.panel
|
|
2136
|
+
}
|
|
2137
|
+
);
|
|
2138
|
+
});
|
|
2139
|
+
var MenuLookPopoverContent = React12.forwardRef(function MenuLookPopoverContent2({ size = "standard", density = "comfortable", role = "menu", ...props }, ref) {
|
|
2140
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
2141
|
+
PopoverContent,
|
|
2142
|
+
{
|
|
2143
|
+
ref,
|
|
2144
|
+
role,
|
|
2145
|
+
surface: "solid",
|
|
2146
|
+
padding: "none",
|
|
2147
|
+
animated: true,
|
|
2148
|
+
"data-menu-look": "",
|
|
2149
|
+
"data-menu-family": "panel",
|
|
2150
|
+
"data-in-popover": "",
|
|
2151
|
+
"data-surface": "floating",
|
|
2152
|
+
"data-size": size,
|
|
2153
|
+
"data-density": density,
|
|
2154
|
+
...props,
|
|
2155
|
+
className: MENU_LOOK_CLASS.panel
|
|
2156
|
+
}
|
|
2157
|
+
);
|
|
2158
|
+
});
|
|
2159
|
+
var MenuLookPanelItem = React12.forwardRef(function MenuLookPanelItem2({ icon, label, labelTitle, description, trail, badge, shortcut, current, pressed, destructive, dimmed, href, target, rel, as, linkProps, onClick, role = "menuitem", ...props }, ref) {
|
|
2160
|
+
const marked = Boolean(current || pressed);
|
|
2161
|
+
const body = /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(MenuLookRowBody, { icon, label, labelTitle, description, trail, badge, shortcut, current: marked });
|
|
2162
|
+
const className = menuLookItemClass({ destructive, dimmed });
|
|
2163
|
+
const mark = marked ? { "data-current": "" } : {};
|
|
2164
|
+
if (href) {
|
|
2165
|
+
const Link = as ?? "a";
|
|
2166
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
2167
|
+
Link,
|
|
2168
|
+
{
|
|
2169
|
+
ref,
|
|
2170
|
+
href,
|
|
2171
|
+
target,
|
|
2172
|
+
rel: rel ?? (target === "_blank" ? "noopener noreferrer" : void 0),
|
|
2173
|
+
role,
|
|
2174
|
+
onClick,
|
|
2175
|
+
...props,
|
|
2176
|
+
...linkProps,
|
|
2177
|
+
...mark,
|
|
2178
|
+
className,
|
|
2179
|
+
children: body
|
|
2180
|
+
}
|
|
2181
|
+
);
|
|
2182
|
+
}
|
|
2183
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
2184
|
+
"button",
|
|
2185
|
+
{
|
|
2186
|
+
ref,
|
|
2187
|
+
type: "button",
|
|
2188
|
+
role,
|
|
2189
|
+
onClick,
|
|
2190
|
+
...pressed === void 0 ? {} : { "aria-pressed": pressed },
|
|
2191
|
+
...props,
|
|
2192
|
+
...mark,
|
|
2193
|
+
className,
|
|
2194
|
+
children: body
|
|
2195
|
+
}
|
|
2196
|
+
);
|
|
2197
|
+
});
|
|
2198
|
+
var MenuLookPanelControlRow = React12.forwardRef(function MenuLookPanelControlRow2({ icon, label, description, control, as = "div", ...props }, ref) {
|
|
2199
|
+
const Row = as;
|
|
2200
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(Row, { ref, "data-control-row": "", ...props, className: MENU_LOOK_CLASS.item, children: [
|
|
2201
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(MenuLookRowBody, { icon, label, description }),
|
|
2202
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("span", { className: MENU_LOOK_CLASS.control, children: control })
|
|
2203
|
+
] });
|
|
2204
|
+
});
|
|
2205
|
+
var MenuLookSearch = React12.forwardRef(function MenuLookSearch2({ placeholder = "Search", ...props }, ref) {
|
|
2206
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("div", { className: MENU_LOOK_CLASS.search, "data-menu-look-search": "", children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
2207
|
+
"input",
|
|
2208
|
+
{
|
|
2209
|
+
ref,
|
|
2210
|
+
type: "search",
|
|
2211
|
+
autoComplete: "off",
|
|
2212
|
+
spellCheck: false,
|
|
2213
|
+
placeholder,
|
|
2214
|
+
"aria-label": props["aria-label"] ?? placeholder,
|
|
2215
|
+
...props
|
|
2216
|
+
}
|
|
2217
|
+
) });
|
|
2218
|
+
});
|
|
2219
|
+
|
|
1860
2220
|
// src/item/ItemMenuDrawer.tsx
|
|
1861
2221
|
var import_react6 = require("react");
|
|
1862
2222
|
|
|
1863
2223
|
// src/drawer.tsx
|
|
1864
2224
|
var import_react_tree = require("@ai-matrx/kit/react-tree");
|
|
1865
|
-
var
|
|
2225
|
+
var React15 = __toESM(require("react"), 1);
|
|
1866
2226
|
var import_vaul = require("vaul");
|
|
1867
2227
|
|
|
1868
2228
|
// src/floating-layer.tsx
|
|
1869
2229
|
var import_react_focus_scope = require("@radix-ui/react-focus-scope");
|
|
1870
2230
|
var import_react_slot3 = require("@radix-ui/react-slot");
|
|
1871
|
-
var
|
|
1872
|
-
var
|
|
2231
|
+
var React13 = __toESM(require("react"), 1);
|
|
2232
|
+
var import_jsx_runtime21 = require("react/jsx-runtime");
|
|
1873
2233
|
var FLOATING_LAYER_ATTR = "data-matrx-floating-layer";
|
|
1874
2234
|
var REGISTRY_SLOT = /* @__PURE__ */ Symbol.for("ai-matrx.design-system.modal-layer-registry");
|
|
1875
2235
|
var registryHost = globalThis;
|
|
@@ -1908,7 +2268,7 @@ function isModalLayerOpen() {
|
|
|
1908
2268
|
return registry2.count > 0;
|
|
1909
2269
|
}
|
|
1910
2270
|
function useModalLayer(active) {
|
|
1911
|
-
|
|
2271
|
+
React13.useLayoutEffect(() => active ? registerModalLayer() : void 0, [active]);
|
|
1912
2272
|
}
|
|
1913
2273
|
var POPPER_WRAPPER = "[data-radix-popper-content-wrapper]";
|
|
1914
2274
|
function isInsideFloatingLayer(target) {
|
|
@@ -1923,8 +2283,8 @@ function keepFloatingLayersInside(handler) {
|
|
|
1923
2283
|
};
|
|
1924
2284
|
}
|
|
1925
2285
|
var preventAutoFocus = (event) => event.preventDefault();
|
|
1926
|
-
var FloatingLayer =
|
|
1927
|
-
const [opener] =
|
|
2286
|
+
var FloatingLayer = React13.forwardRef(({ children }, ref) => {
|
|
2287
|
+
const [opener] = React13.useState(
|
|
1928
2288
|
() => typeof document === "undefined" ? null : document.activeElement
|
|
1929
2289
|
);
|
|
1930
2290
|
const returnFocus = (event) => {
|
|
@@ -1935,7 +2295,7 @@ var FloatingLayer = React11.forwardRef(({ children }, ref) => {
|
|
|
1935
2295
|
opener.focus({ preventScroll: true });
|
|
1936
2296
|
}
|
|
1937
2297
|
};
|
|
1938
|
-
return /* @__PURE__ */ (0,
|
|
2298
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
1939
2299
|
import_react_focus_scope.FocusScope,
|
|
1940
2300
|
{
|
|
1941
2301
|
asChild: true,
|
|
@@ -1943,7 +2303,7 @@ var FloatingLayer = React11.forwardRef(({ children }, ref) => {
|
|
|
1943
2303
|
loop: false,
|
|
1944
2304
|
onMountAutoFocus: preventAutoFocus,
|
|
1945
2305
|
onUnmountAutoFocus: returnFocus,
|
|
1946
|
-
children: /* @__PURE__ */ (0,
|
|
2306
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
1947
2307
|
import_react_slot3.Slot,
|
|
1948
2308
|
{
|
|
1949
2309
|
ref,
|
|
@@ -1958,22 +2318,22 @@ var FloatingLayer = React11.forwardRef(({ children }, ref) => {
|
|
|
1958
2318
|
FloatingLayer.displayName = "FloatingLayer";
|
|
1959
2319
|
|
|
1960
2320
|
// src/radix-dialog-modal-context.tsx
|
|
1961
|
-
var
|
|
1962
|
-
var
|
|
2321
|
+
var React14 = __toESM(require("react"), 1);
|
|
2322
|
+
var import_jsx_runtime22 = require("react/jsx-runtime");
|
|
1963
2323
|
var CONTEXT_SLOT2 = /* @__PURE__ */ Symbol.for("ai-matrx.design-system.dialog-modal-context");
|
|
1964
2324
|
var contextRegistry2 = globalThis;
|
|
1965
|
-
var RadixDialogModalContext = contextRegistry2[CONTEXT_SLOT2] ??=
|
|
2325
|
+
var RadixDialogModalContext = contextRegistry2[CONTEXT_SLOT2] ??= React14.createContext(true);
|
|
1966
2326
|
function RadixDialogModalProvider({
|
|
1967
2327
|
children,
|
|
1968
2328
|
modal
|
|
1969
2329
|
}) {
|
|
1970
|
-
return /* @__PURE__ */ (0,
|
|
2330
|
+
return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(RadixDialogModalContext.Provider, { value: modal, children });
|
|
1971
2331
|
}
|
|
1972
2332
|
|
|
1973
2333
|
// src/drawer.tsx
|
|
1974
|
-
var
|
|
1975
|
-
var DrawerDirectionContext =
|
|
1976
|
-
var useDrawerDirection = () =>
|
|
2334
|
+
var import_jsx_runtime23 = require("react/jsx-runtime");
|
|
2335
|
+
var DrawerDirectionContext = React15.createContext("bottom");
|
|
2336
|
+
var useDrawerDirection = () => React15.useContext(DrawerDirectionContext);
|
|
1977
2337
|
var Drawer = ({
|
|
1978
2338
|
children,
|
|
1979
2339
|
shouldScaleBackground = true,
|
|
@@ -1987,7 +2347,7 @@ var Drawer = ({
|
|
|
1987
2347
|
}
|
|
1988
2348
|
onOpenChange?.(open);
|
|
1989
2349
|
};
|
|
1990
|
-
return /* @__PURE__ */ (0,
|
|
2350
|
+
return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(RadixDialogModalProvider, { modal: true, children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(DrawerDirectionContext.Provider, { value: direction, children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
1991
2351
|
import_vaul.Drawer.Root,
|
|
1992
2352
|
{
|
|
1993
2353
|
modal: true,
|
|
@@ -2003,7 +2363,7 @@ Drawer.displayName = "Drawer";
|
|
|
2003
2363
|
var DrawerTrigger = import_vaul.Drawer.Trigger;
|
|
2004
2364
|
var DrawerPortal = import_vaul.Drawer.Portal;
|
|
2005
2365
|
var DrawerClose = import_vaul.Drawer.Close;
|
|
2006
|
-
var DrawerOverlay =
|
|
2366
|
+
var DrawerOverlay = React15.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
2007
2367
|
import_vaul.Drawer.Overlay,
|
|
2008
2368
|
{
|
|
2009
2369
|
ref,
|
|
@@ -2016,7 +2376,7 @@ var DrawerOverlay = React13.forwardRef(({ className, ...props }, ref) => /* @__P
|
|
|
2016
2376
|
}
|
|
2017
2377
|
));
|
|
2018
2378
|
DrawerOverlay.displayName = import_vaul.Drawer.Overlay.displayName;
|
|
2019
|
-
var DrawerDescription =
|
|
2379
|
+
var DrawerDescription = React15.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
2020
2380
|
import_vaul.Drawer.Description,
|
|
2021
2381
|
{
|
|
2022
2382
|
ref,
|
|
@@ -2026,9 +2386,9 @@ var DrawerDescription = React13.forwardRef(({ className, ...props }, ref) => /*
|
|
|
2026
2386
|
}
|
|
2027
2387
|
));
|
|
2028
2388
|
DrawerDescription.displayName = import_vaul.Drawer.Description.displayName;
|
|
2029
|
-
var DrawerContentPrimitive =
|
|
2389
|
+
var DrawerContentPrimitive = React15.forwardRef(({ onInteractOutside, ...props }, ref) => {
|
|
2030
2390
|
useModalLayer(true);
|
|
2031
|
-
return /* @__PURE__ */ (0,
|
|
2391
|
+
return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
2032
2392
|
import_vaul.Drawer.Content,
|
|
2033
2393
|
{
|
|
2034
2394
|
"data-matrx-entrance": "none",
|
|
@@ -2052,13 +2412,13 @@ var SIZE_CLASSES = {
|
|
|
2052
2412
|
left: { adaptive: "w-auto max-w-[92vw]", full: "h-dvh w-[92vw] max-w-sm" },
|
|
2053
2413
|
right: { adaptive: "w-auto max-w-[92vw]", full: "h-dvh w-[92vw] max-w-sm" }
|
|
2054
2414
|
};
|
|
2055
|
-
var DrawerContent =
|
|
2415
|
+
var DrawerContent = React15.forwardRef(({ className, children, size = "adaptive", showHandle, ...props }, ref) => {
|
|
2056
2416
|
const direction = useDrawerDirection();
|
|
2057
2417
|
const hasDescription = (0, import_react_tree.treeContainsComponent)(children, DrawerDescription) || (0, import_react_tree.treeContainsComponent)(children, import_vaul.Drawer.Description);
|
|
2058
2418
|
const withHandle = showHandle ?? (direction === "bottom" || direction === "top");
|
|
2059
|
-
return /* @__PURE__ */ (0,
|
|
2060
|
-
/* @__PURE__ */ (0,
|
|
2061
|
-
/* @__PURE__ */ (0,
|
|
2419
|
+
return /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(DrawerPortal, { children: [
|
|
2420
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(DrawerOverlay, {}),
|
|
2421
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(
|
|
2062
2422
|
DrawerContentPrimitive,
|
|
2063
2423
|
{
|
|
2064
2424
|
ref,
|
|
@@ -2075,7 +2435,7 @@ var DrawerContent = React13.forwardRef(({ className, children, size = "adaptive"
|
|
|
2075
2435
|
children: [
|
|
2076
2436
|
withHandle ? (
|
|
2077
2437
|
// Rule 3: the pill is 4px; the TARGET is 44px.
|
|
2078
|
-
/* @__PURE__ */ (0,
|
|
2438
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
2079
2439
|
"div",
|
|
2080
2440
|
{
|
|
2081
2441
|
"aria-hidden": true,
|
|
@@ -2084,7 +2444,7 @@ var DrawerContent = React13.forwardRef(({ className, children, size = "adaptive"
|
|
|
2084
2444
|
"flex min-h-11 w-full shrink-0 cursor-grab items-center justify-center active:cursor-grabbing",
|
|
2085
2445
|
direction === "top" && "order-last"
|
|
2086
2446
|
),
|
|
2087
|
-
children: /* @__PURE__ */ (0,
|
|
2447
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("div", { className: "h-1 w-[100px] rounded-full bg-muted" })
|
|
2088
2448
|
}
|
|
2089
2449
|
)
|
|
2090
2450
|
) : null,
|
|
@@ -2098,7 +2458,7 @@ DrawerContent.displayName = "DrawerContent";
|
|
|
2098
2458
|
var DrawerHeader = ({
|
|
2099
2459
|
className,
|
|
2100
2460
|
...props
|
|
2101
|
-
}) => /* @__PURE__ */ (0,
|
|
2461
|
+
}) => /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
2102
2462
|
"div",
|
|
2103
2463
|
{
|
|
2104
2464
|
"data-slot": "drawer-header",
|
|
@@ -2113,7 +2473,7 @@ DrawerHeader.displayName = "DrawerHeader";
|
|
|
2113
2473
|
var DrawerBody = ({
|
|
2114
2474
|
className,
|
|
2115
2475
|
...props
|
|
2116
|
-
}) => /* @__PURE__ */ (0,
|
|
2476
|
+
}) => /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
2117
2477
|
"div",
|
|
2118
2478
|
{
|
|
2119
2479
|
"data-slot": "drawer-body",
|
|
@@ -2125,7 +2485,7 @@ DrawerBody.displayName = "DrawerBody";
|
|
|
2125
2485
|
var DrawerFooter = ({
|
|
2126
2486
|
className,
|
|
2127
2487
|
...props
|
|
2128
|
-
}) => /* @__PURE__ */ (0,
|
|
2488
|
+
}) => /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
2129
2489
|
"div",
|
|
2130
2490
|
{
|
|
2131
2491
|
"data-slot": "drawer-footer",
|
|
@@ -2134,7 +2494,7 @@ var DrawerFooter = ({
|
|
|
2134
2494
|
}
|
|
2135
2495
|
);
|
|
2136
2496
|
DrawerFooter.displayName = "DrawerFooter";
|
|
2137
|
-
var DrawerTitle =
|
|
2497
|
+
var DrawerTitle = React15.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
2138
2498
|
import_vaul.Drawer.Title,
|
|
2139
2499
|
{
|
|
2140
2500
|
ref,
|
|
@@ -2166,7 +2526,7 @@ function resolveItemMenuConfig(input) {
|
|
|
2166
2526
|
}
|
|
2167
2527
|
|
|
2168
2528
|
// src/item/ItemMenuDrawer.tsx
|
|
2169
|
-
var
|
|
2529
|
+
var import_jsx_runtime24 = require("react/jsx-runtime");
|
|
2170
2530
|
function resolveSections(config, path) {
|
|
2171
2531
|
let sections = config.sections;
|
|
2172
2532
|
let title = null;
|
|
@@ -2207,24 +2567,24 @@ function ItemMenuDrawer({
|
|
|
2207
2567
|
if (!next) setPath([]);
|
|
2208
2568
|
onOpenChange(next);
|
|
2209
2569
|
};
|
|
2210
|
-
return /* @__PURE__ */ (0,
|
|
2211
|
-
atRoot ? headerTitle ? /* @__PURE__ */ (0,
|
|
2212
|
-
/* @__PURE__ */ (0,
|
|
2213
|
-
config.header?.description && /* @__PURE__ */ (0,
|
|
2214
|
-
] }) : /* @__PURE__ */ (0,
|
|
2215
|
-
/* @__PURE__ */ (0,
|
|
2570
|
+
return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(Drawer, { open, onOpenChange: handleOpenChange, children: /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(DrawerContent, { className: "max-h-[80dvh] flex flex-col", children: [
|
|
2571
|
+
atRoot ? headerTitle ? /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { className: "flex-shrink-0 border-b border-border px-4 pb-3 pt-1", children: [
|
|
2572
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(DrawerTitle, { className: "text-center text-[15px] font-semibold", children: headerTitle }),
|
|
2573
|
+
config.header?.description && /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("p", { className: "mt-1 text-center type-body text-muted-foreground", children: config.header.description })
|
|
2574
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(DrawerTitle, { className: "sr-only", children: "Options" }) : /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { className: "flex h-11 flex-shrink-0 items-center border-b border-border px-1", children: [
|
|
2575
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
2216
2576
|
"button",
|
|
2217
2577
|
{
|
|
2218
2578
|
type: "button",
|
|
2219
2579
|
onClick: pop,
|
|
2220
2580
|
"aria-label": "Back",
|
|
2221
2581
|
className: "flex h-9 items-center gap-1 rounded-md px-2 text-sm text-muted-foreground hover:bg-accent hover:text-foreground",
|
|
2222
|
-
children: /* @__PURE__ */ (0,
|
|
2582
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(ChevronLeftIcon, { className: "h-5 w-5" })
|
|
2223
2583
|
}
|
|
2224
2584
|
),
|
|
2225
|
-
/* @__PURE__ */ (0,
|
|
2585
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(DrawerTitle, { className: "flex-1 truncate pr-10 text-center text-[15px] font-semibold", children: headerTitle ?? "Options" })
|
|
2226
2586
|
] }),
|
|
2227
|
-
/* @__PURE__ */ (0,
|
|
2587
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(
|
|
2228
2588
|
"div",
|
|
2229
2589
|
{
|
|
2230
2590
|
className: cn(
|
|
@@ -2236,10 +2596,10 @@ function ItemMenuDrawer({
|
|
|
2236
2596
|
sections.map((section, sIdx) => {
|
|
2237
2597
|
const visible = section.items.filter((e) => !e.hidden);
|
|
2238
2598
|
if (visible.length === 0) return null;
|
|
2239
|
-
return /* @__PURE__ */ (0,
|
|
2240
|
-
sIdx > 0 && /* @__PURE__ */ (0,
|
|
2241
|
-
section.label && /* @__PURE__ */ (0,
|
|
2242
|
-
visible.map((entry) => /* @__PURE__ */ (0,
|
|
2599
|
+
return /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { children: [
|
|
2600
|
+
sIdx > 0 && /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("div", { className: "my-1 h-px bg-border" }),
|
|
2601
|
+
section.label && /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("div", { className: "px-4 pb-1 pt-2 type-secondary font-medium uppercase tracking-wide text-muted-foreground", children: section.label }),
|
|
2602
|
+
visible.map((entry) => /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
2243
2603
|
DrawerEntry,
|
|
2244
2604
|
{
|
|
2245
2605
|
entry,
|
|
@@ -2273,8 +2633,8 @@ function DrawerEntry({
|
|
|
2273
2633
|
disabled ? "opacity-50" : "active:bg-accent",
|
|
2274
2634
|
destructive && "text-destructive"
|
|
2275
2635
|
);
|
|
2276
|
-
const content = /* @__PURE__ */ (0,
|
|
2277
|
-
Icon && /* @__PURE__ */ (0,
|
|
2636
|
+
const content = /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(import_jsx_runtime24.Fragment, { children: [
|
|
2637
|
+
Icon && /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
2278
2638
|
Icon,
|
|
2279
2639
|
{
|
|
2280
2640
|
className: cn(
|
|
@@ -2283,19 +2643,19 @@ function DrawerEntry({
|
|
|
2283
2643
|
)
|
|
2284
2644
|
}
|
|
2285
2645
|
),
|
|
2286
|
-
/* @__PURE__ */ (0,
|
|
2287
|
-
/* @__PURE__ */ (0,
|
|
2288
|
-
disabled && entry.disabledReason ? /* @__PURE__ */ (0,
|
|
2646
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("span", { className: "flex min-w-0 flex-1 flex-col", children: [
|
|
2647
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("span", { className: "truncate text-[15px]", title: entry.description, children: entry.label }),
|
|
2648
|
+
disabled && entry.disabledReason ? /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("span", { className: "truncate type-body text-muted-foreground", children: entry.disabledReason }) : null
|
|
2289
2649
|
] })
|
|
2290
2650
|
] });
|
|
2291
2651
|
if (isSubmenu(entry)) {
|
|
2292
|
-
return /* @__PURE__ */ (0,
|
|
2652
|
+
return /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("button", { type: "button", disabled, onClick: onDrill, className: rowClass, children: [
|
|
2293
2653
|
content,
|
|
2294
|
-
/* @__PURE__ */ (0,
|
|
2654
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(ChevronRightIcon, { className: "h-5 w-5 shrink-0 text-muted-foreground" })
|
|
2295
2655
|
] });
|
|
2296
2656
|
}
|
|
2297
2657
|
if (isCheckbox(entry)) {
|
|
2298
|
-
return /* @__PURE__ */ (0,
|
|
2658
|
+
return /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(
|
|
2299
2659
|
"button",
|
|
2300
2660
|
{
|
|
2301
2661
|
type: "button",
|
|
@@ -2304,13 +2664,13 @@ function DrawerEntry({
|
|
|
2304
2664
|
className: rowClass,
|
|
2305
2665
|
children: [
|
|
2306
2666
|
content,
|
|
2307
|
-
entry.checked && /* @__PURE__ */ (0,
|
|
2667
|
+
entry.checked && /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(CheckIcon, { className: "h-5 w-5 shrink-0 text-primary" })
|
|
2308
2668
|
]
|
|
2309
2669
|
}
|
|
2310
2670
|
);
|
|
2311
2671
|
}
|
|
2312
2672
|
if (isLink(entry)) {
|
|
2313
|
-
return /* @__PURE__ */ (0,
|
|
2673
|
+
return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
2314
2674
|
"a",
|
|
2315
2675
|
{
|
|
2316
2676
|
href: entry.href,
|
|
@@ -2322,7 +2682,7 @@ function DrawerEntry({
|
|
|
2322
2682
|
}
|
|
2323
2683
|
);
|
|
2324
2684
|
}
|
|
2325
|
-
return /* @__PURE__ */ (0,
|
|
2685
|
+
return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
2326
2686
|
"button",
|
|
2327
2687
|
{
|
|
2328
2688
|
type: "button",
|
|
@@ -2338,13 +2698,13 @@ function DrawerEntry({
|
|
|
2338
2698
|
}
|
|
2339
2699
|
|
|
2340
2700
|
// src/item/host.tsx
|
|
2341
|
-
var
|
|
2342
|
-
var
|
|
2701
|
+
var React16 = __toESM(require("react"), 1);
|
|
2702
|
+
var import_jsx_runtime25 = require("react/jsx-runtime");
|
|
2343
2703
|
var HOST_KEY = /* @__PURE__ */ Symbol.for("@ai-matrx/design-system/item-menu-host");
|
|
2344
2704
|
var hostRegistry2 = globalThis;
|
|
2345
|
-
var ItemMenuHostContext = hostRegistry2[HOST_KEY] ?? (hostRegistry2[HOST_KEY] =
|
|
2705
|
+
var ItemMenuHostContext = hostRegistry2[HOST_KEY] ?? (hostRegistry2[HOST_KEY] = React16.createContext(null));
|
|
2346
2706
|
function useItemMenuHost() {
|
|
2347
|
-
return
|
|
2707
|
+
return React16.useContext(ItemMenuHostContext);
|
|
2348
2708
|
}
|
|
2349
2709
|
|
|
2350
2710
|
// src/item/run-entry.ts
|
|
@@ -2373,54 +2733,39 @@ function runToggle(entry, next) {
|
|
|
2373
2733
|
}
|
|
2374
2734
|
|
|
2375
2735
|
// src/item/ItemMenu.tsx
|
|
2376
|
-
var
|
|
2736
|
+
var import_jsx_runtime26 = require("react/jsx-runtime");
|
|
2377
2737
|
var dropdownFamily = {
|
|
2378
|
-
Item:
|
|
2379
|
-
CheckboxItem:
|
|
2380
|
-
Sub:
|
|
2381
|
-
SubTrigger:
|
|
2382
|
-
SubContent:
|
|
2383
|
-
Separator:
|
|
2384
|
-
Label:
|
|
2385
|
-
Shortcut: DropdownMenuShortcut
|
|
2738
|
+
Item: MenuLookItem,
|
|
2739
|
+
CheckboxItem: MenuLookCheckboxItem,
|
|
2740
|
+
Sub: MenuLookSub,
|
|
2741
|
+
SubTrigger: MenuLookSubTrigger,
|
|
2742
|
+
SubContent: MenuLookSubContent,
|
|
2743
|
+
Separator: MenuLookSeparator,
|
|
2744
|
+
Label: MenuLookLabel
|
|
2386
2745
|
};
|
|
2387
2746
|
var contextFamily = {
|
|
2388
|
-
Item:
|
|
2389
|
-
CheckboxItem:
|
|
2390
|
-
Sub:
|
|
2391
|
-
SubTrigger:
|
|
2392
|
-
SubContent:
|
|
2393
|
-
Separator:
|
|
2394
|
-
Label:
|
|
2395
|
-
Shortcut: ContextMenuShortcut
|
|
2747
|
+
Item: MenuLookContextItem,
|
|
2748
|
+
CheckboxItem: MenuLookContextCheckboxItem,
|
|
2749
|
+
Sub: MenuLookContextSub,
|
|
2750
|
+
SubTrigger: MenuLookContextSubTrigger,
|
|
2751
|
+
SubContent: MenuLookContextSubContent,
|
|
2752
|
+
Separator: MenuLookContextSeparator,
|
|
2753
|
+
Label: MenuLookContextLabel
|
|
2396
2754
|
};
|
|
2397
|
-
|
|
2398
|
-
function EntryInner({
|
|
2399
|
-
entry,
|
|
2400
|
-
Shortcut,
|
|
2401
|
-
showShortcut = true
|
|
2402
|
-
}) {
|
|
2755
|
+
function entryRow(entry, { showShortcut = true } = {}) {
|
|
2403
2756
|
const Icon = entry.icon;
|
|
2404
|
-
const
|
|
2405
|
-
|
|
2406
|
-
|
|
2407
|
-
|
|
2408
|
-
|
|
2409
|
-
|
|
2410
|
-
|
|
2411
|
-
|
|
2412
|
-
|
|
2413
|
-
|
|
2414
|
-
|
|
2415
|
-
|
|
2416
|
-
),
|
|
2417
|
-
/* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("span", { className: "flex min-w-0 flex-1 flex-col", children: [
|
|
2418
|
-
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("span", { className: "truncate", title: entry.description, children: entry.label }),
|
|
2419
|
-
secondLine && /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("span", { className: "truncate type-secondary text-muted-foreground", children: secondLine })
|
|
2420
|
-
] }),
|
|
2421
|
-
entry.badge && /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("span", { className: "ml-2 shrink-0 rounded border border-border px-1.5 py-px type-meta font-medium uppercase tracking-wide text-muted-foreground", children: entry.badge }),
|
|
2422
|
-
showShortcut && shortcutText && /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(Shortcut, { children: shortcutText })
|
|
2423
|
-
] });
|
|
2757
|
+
const shortcut = showShortcut && (isCommand(entry) || isCheckbox(entry)) ? entry.shortcut ?? entry.shortcutKey?.toUpperCase() : void 0;
|
|
2758
|
+
return {
|
|
2759
|
+
// A destructive row's glyph takes the row's danger tone (menu-look.css); others keep their own color.
|
|
2760
|
+
icon: Icon ? /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(Icon, { className: isCommand(entry) && entry.tone === "destructive" ? void 0 : entry.iconClassName }) : void 0,
|
|
2761
|
+
label: entry.label,
|
|
2762
|
+
labelTitle: entry.description,
|
|
2763
|
+
// The only second line an entry draws is why it is disabled; `description` is hover text
|
|
2764
|
+
// (Arman, 2026-10-14: no "novels" in menus).
|
|
2765
|
+
description: entry.disabled && entry.disabledReason ? entry.disabledReason : void 0,
|
|
2766
|
+
badge: entry.badge,
|
|
2767
|
+
shortcut
|
|
2768
|
+
};
|
|
2424
2769
|
}
|
|
2425
2770
|
function MenuSections({
|
|
2426
2771
|
family,
|
|
@@ -2428,10 +2773,10 @@ function MenuSections({
|
|
|
2428
2773
|
onCloseRequest
|
|
2429
2774
|
}) {
|
|
2430
2775
|
const visibleSections = sections.map((s) => ({ ...s, items: s.items.filter((e) => !e.hidden) })).filter((s) => s.items.length > 0);
|
|
2431
|
-
return /* @__PURE__ */ (0,
|
|
2432
|
-
sIdx > 0 && /* @__PURE__ */ (0,
|
|
2433
|
-
section.label && /* @__PURE__ */ (0,
|
|
2434
|
-
section.items.map((entry) => /* @__PURE__ */ (0,
|
|
2776
|
+
return /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(import_jsx_runtime26.Fragment, { children: visibleSections.map((section, sIdx) => /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(import_react7.Fragment, { children: [
|
|
2777
|
+
sIdx > 0 && /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(family.Separator, {}),
|
|
2778
|
+
section.label && /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(family.Label, { children: section.label }),
|
|
2779
|
+
section.items.map((entry) => /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
2435
2780
|
MenuLeaf,
|
|
2436
2781
|
{
|
|
2437
2782
|
family,
|
|
@@ -2453,18 +2798,11 @@ function MenuLeaf({
|
|
|
2453
2798
|
}) {
|
|
2454
2799
|
const toastPromise = useItemMenuHost()?.toastPromise;
|
|
2455
2800
|
if (isSubmenu(entry)) {
|
|
2456
|
-
return /* @__PURE__ */ (0,
|
|
2457
|
-
/* @__PURE__ */ (0,
|
|
2801
|
+
return /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(family.Sub, { children: [
|
|
2802
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)(family.SubTrigger, { ...entryRow(entry, { showShortcut: false }), disabled: entry.disabled, onPointerLeave: (event) => {
|
|
2458
2803
|
if (entry.renderContent && event.relatedTarget instanceof Element && event.relatedTarget.closest("[data-canonical-alchemy-submenu]")) event.preventDefault();
|
|
2459
|
-
}
|
|
2460
|
-
|
|
2461
|
-
{
|
|
2462
|
-
entry,
|
|
2463
|
-
Shortcut: family.Shortcut,
|
|
2464
|
-
showShortcut: false
|
|
2465
|
-
}
|
|
2466
|
-
) }),
|
|
2467
|
-
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(family.SubContent, { onFocusOutside: keepCanonicalPaletteInteraction, onPointerDownOutside: keepCanonicalPaletteInteraction, className: entry.renderContent ? "p-0 [--radix-popover-content-available-height:var(--radix-dropdown-menu-content-available-height)]" : void 0, children: entry.renderContent ? entry.renderContent(onCloseRequest) : /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
2804
|
+
} }),
|
|
2805
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)(family.SubContent, { onFocusOutside: keepCanonicalPaletteInteraction, onPointerDownOutside: keepCanonicalPaletteInteraction, fit: entry.renderContent ? "content" : "menu", children: entry.renderContent ? entry.renderContent(onCloseRequest) : /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
2468
2806
|
MenuSections,
|
|
2469
2807
|
{
|
|
2470
2808
|
family,
|
|
@@ -2475,40 +2813,36 @@ function MenuLeaf({
|
|
|
2475
2813
|
] });
|
|
2476
2814
|
}
|
|
2477
2815
|
if (isCheckbox(entry)) {
|
|
2478
|
-
return /* @__PURE__ */ (0,
|
|
2816
|
+
return /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
2479
2817
|
family.CheckboxItem,
|
|
2480
2818
|
{
|
|
2819
|
+
...entryRow(entry),
|
|
2481
2820
|
checked: entry.checked,
|
|
2482
2821
|
disabled: entry.disabled,
|
|
2483
2822
|
onSelect: (e) => e.preventDefault(),
|
|
2484
|
-
onCheckedChange: (next) => runToggle(entry, next)
|
|
2485
|
-
className: "gap-2",
|
|
2486
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(EntryInner, { entry, Shortcut: family.Shortcut })
|
|
2823
|
+
onCheckedChange: (next) => runToggle(entry, next)
|
|
2487
2824
|
}
|
|
2488
2825
|
);
|
|
2489
2826
|
}
|
|
2490
2827
|
if (isLink(entry)) {
|
|
2491
|
-
return /* @__PURE__ */ (0,
|
|
2492
|
-
|
|
2828
|
+
return /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
2829
|
+
family.Item,
|
|
2493
2830
|
{
|
|
2831
|
+
...entryRow(entry),
|
|
2832
|
+
disabled: entry.disabled,
|
|
2494
2833
|
href: entry.href,
|
|
2495
2834
|
target: entry.target,
|
|
2496
|
-
|
|
2497
|
-
onClick: onCloseRequest,
|
|
2498
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(EntryInner, { entry, Shortcut: family.Shortcut })
|
|
2835
|
+
linkProps: { onClick: onCloseRequest }
|
|
2499
2836
|
}
|
|
2500
|
-
)
|
|
2837
|
+
);
|
|
2501
2838
|
}
|
|
2502
|
-
return /* @__PURE__ */ (0,
|
|
2839
|
+
return /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
2503
2840
|
family.Item,
|
|
2504
2841
|
{
|
|
2842
|
+
...entryRow(entry),
|
|
2505
2843
|
disabled: entry.disabled,
|
|
2506
|
-
|
|
2507
|
-
|
|
2508
|
-
"gap-2",
|
|
2509
|
-
entry.tone === "destructive" && DESTRUCTIVE_ITEM_CLASS
|
|
2510
|
-
),
|
|
2511
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(EntryInner, { entry, Shortcut: family.Shortcut })
|
|
2844
|
+
destructive: entry.tone === "destructive",
|
|
2845
|
+
onSelect: () => runCommand(entry, toastPromise)
|
|
2512
2846
|
}
|
|
2513
2847
|
);
|
|
2514
2848
|
}
|
|
@@ -2533,7 +2867,7 @@ function makeShortcutHandler(config, close, toastPromise) {
|
|
|
2533
2867
|
};
|
|
2534
2868
|
}
|
|
2535
2869
|
function RowAlchemyIcon(props) {
|
|
2536
|
-
return /* @__PURE__ */ (0,
|
|
2870
|
+
return /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: 2, strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": true, ...props, children: ALCHEMY_GLYPH_PATHS.portal.map((d, index) => /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("path", { d }, index)) });
|
|
2537
2871
|
}
|
|
2538
2872
|
function hasVisibleEntry(config, id) {
|
|
2539
2873
|
const entries = config?.sections.flatMap((section) => section.items) ?? [];
|
|
@@ -2562,7 +2896,7 @@ function RowAlchemySubmenuContent({ onClose, restoreFocus }) {
|
|
|
2562
2896
|
mountMenu?.(target.current, () => closeRef.current(), () => focusRef.current());
|
|
2563
2897
|
return () => mountMenu?.(null);
|
|
2564
2898
|
}, [mountMenu]);
|
|
2565
|
-
return /* @__PURE__ */ (0,
|
|
2899
|
+
return /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("div", { ref: target, "data-canonical-alchemy-submenu": true, "aria-label": "Alchemy output options", onKeyDown: (event) => {
|
|
2566
2900
|
if (event.key === "Tab") event.stopPropagation();
|
|
2567
2901
|
} });
|
|
2568
2902
|
}
|
|
@@ -2575,7 +2909,6 @@ function ItemMenu({
|
|
|
2575
2909
|
open: openProp,
|
|
2576
2910
|
onOpenChange,
|
|
2577
2911
|
onCloseAutoFocus,
|
|
2578
|
-
contentMinWidth = "12rem",
|
|
2579
2912
|
presentation = "auto"
|
|
2580
2913
|
}) {
|
|
2581
2914
|
const toastPromise = useItemMenuHost()?.toastPromise;
|
|
@@ -2599,7 +2932,7 @@ function ItemMenu({
|
|
|
2599
2932
|
icon: RowAlchemyIcon,
|
|
2600
2933
|
disabled: rowAlchemy.copy.disabled,
|
|
2601
2934
|
sections: [],
|
|
2602
|
-
renderContent: (onClose) => /* @__PURE__ */ (0,
|
|
2935
|
+
renderContent: (onClose) => /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(RowAlchemySubmenuContent, { onClose, restoreFocus: () => (dropdownTriggerRef.current ?? restoreTargetRef.current)?.focus() })
|
|
2603
2936
|
} : null;
|
|
2604
2937
|
const normalSections = baseConfig?.sections.map((section, index) => ({ section, index })).filter(({ section }) => section.id !== "danger" && !containsDestructiveAction(section.items)) ?? [];
|
|
2605
2938
|
const targetSection = (normalSections.find(({ section }) => !section.label) ?? normalSections[0])?.index;
|
|
@@ -2613,20 +2946,6 @@ function ItemMenu({
|
|
|
2613
2946
|
...baseConfig,
|
|
2614
2947
|
sections: targetSection !== void 0 ? baseConfig.sections.map((section, index) => index === targetSection ? { ...section, items: [...section.items, ...injectedRowItems] } : section) : [{ id: "actions", items: injectedRowItems }, ...baseConfig.sections]
|
|
2615
2948
|
} : baseConfig;
|
|
2616
|
-
const scrollFade = useScrollFade();
|
|
2617
|
-
const viewportRef = (0, import_react7.useRef)(null);
|
|
2618
|
-
const setViewport = (0, import_react7.useCallback)(
|
|
2619
|
-
(node) => {
|
|
2620
|
-
viewportRef.current = node;
|
|
2621
|
-
scrollFade.ref(node);
|
|
2622
|
-
},
|
|
2623
|
-
[scrollFade.ref]
|
|
2624
|
-
);
|
|
2625
|
-
const scrollToEnd = () => {
|
|
2626
|
-
const el = viewportRef.current;
|
|
2627
|
-
if (!el) return;
|
|
2628
|
-
el.scrollTo({ top: el.scrollHeight, behavior: "smooth" });
|
|
2629
|
-
};
|
|
2630
2949
|
const handleOpenChange = (next) => {
|
|
2631
2950
|
if (!isControlled) setUncontrolledOpen(next);
|
|
2632
2951
|
onOpenChange?.(next);
|
|
@@ -2643,8 +2962,8 @@ function ItemMenu({
|
|
|
2643
2962
|
dropdownTriggerRef.current?.focus();
|
|
2644
2963
|
}, [armed]);
|
|
2645
2964
|
if (mode === "drawer") {
|
|
2646
|
-
return /* @__PURE__ */ (0,
|
|
2647
|
-
/* @__PURE__ */ (0,
|
|
2965
|
+
return /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(import_jsx_runtime26.Fragment, { children: [
|
|
2966
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
2648
2967
|
import_react_slot4.Slot,
|
|
2649
2968
|
{
|
|
2650
2969
|
onClick: (e) => {
|
|
@@ -2655,7 +2974,7 @@ function ItemMenu({
|
|
|
2655
2974
|
children
|
|
2656
2975
|
}
|
|
2657
2976
|
),
|
|
2658
|
-
resolved && /* @__PURE__ */ (0,
|
|
2977
|
+
resolved && /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
2659
2978
|
ItemMenuDrawer,
|
|
2660
2979
|
{
|
|
2661
2980
|
open,
|
|
@@ -2668,7 +2987,7 @@ function ItemMenu({
|
|
|
2668
2987
|
] });
|
|
2669
2988
|
}
|
|
2670
2989
|
if (!live) {
|
|
2671
|
-
return /* @__PURE__ */ (0,
|
|
2990
|
+
return /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
2672
2991
|
import_react_slot4.Slot,
|
|
2673
2992
|
{
|
|
2674
2993
|
"data-item-menu-trigger": "idle",
|
|
@@ -2691,20 +3010,17 @@ function ItemMenu({
|
|
|
2691
3010
|
}
|
|
2692
3011
|
);
|
|
2693
3012
|
}
|
|
2694
|
-
return /* @__PURE__ */ (0,
|
|
2695
|
-
/* @__PURE__ */ (0,
|
|
2696
|
-
resolved && /* @__PURE__ */ (0,
|
|
2697
|
-
|
|
3013
|
+
return /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(DropdownMenu, { open, onOpenChange: handleOpenChange, modal: false, children: [
|
|
3014
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)(DropdownMenuTrigger, { ref: dropdownTriggerRef, asChild: true, children }),
|
|
3015
|
+
resolved && /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(
|
|
3016
|
+
MenuLookContent,
|
|
2698
3017
|
{
|
|
2699
3018
|
onFocusOutside: keepCanonicalPaletteInteraction,
|
|
2700
3019
|
onPointerDownOutside: keepCanonicalPaletteInteraction,
|
|
2701
3020
|
align,
|
|
2702
3021
|
...side ? { side } : {},
|
|
2703
3022
|
collisionPadding: 12,
|
|
2704
|
-
|
|
2705
|
-
"flex max-h-[var(--radix-dropdown-menu-content-available-height)] flex-col overflow-hidden p-0"
|
|
2706
|
-
),
|
|
2707
|
-
style: { minWidth: contentMinWidth },
|
|
3023
|
+
moreBelowLabel: "More actions below",
|
|
2708
3024
|
...onCloseAutoFocus ? { onCloseAutoFocus } : {},
|
|
2709
3025
|
onKeyDown: makeShortcutHandler(
|
|
2710
3026
|
resolved,
|
|
@@ -2712,42 +3028,13 @@ function ItemMenu({
|
|
|
2712
3028
|
toastPromise
|
|
2713
3029
|
),
|
|
2714
3030
|
children: [
|
|
2715
|
-
/* @__PURE__ */ (0,
|
|
2716
|
-
|
|
3031
|
+
resolved.header?.title && /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(MenuLookLabel, { description: resolved.header.description, children: resolved.header.title }),
|
|
3032
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
3033
|
+
MenuSections,
|
|
2717
3034
|
{
|
|
2718
|
-
|
|
2719
|
-
|
|
2720
|
-
|
|
2721
|
-
children: [
|
|
2722
|
-
resolved.header?.title && /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(DropdownMenuLabel, { className: "text-xs", children: [
|
|
2723
|
-
resolved.header.title,
|
|
2724
|
-
resolved.header.description && /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("span", { className: "mt-0.5 block type-meta font-normal text-muted-foreground", children: resolved.header.description })
|
|
2725
|
-
] }),
|
|
2726
|
-
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
2727
|
-
MenuSections,
|
|
2728
|
-
{
|
|
2729
|
-
family: dropdownFamily,
|
|
2730
|
-
sections: resolved.sections,
|
|
2731
|
-
onCloseRequest: () => handleOpenChange(false)
|
|
2732
|
-
}
|
|
2733
|
-
)
|
|
2734
|
-
]
|
|
2735
|
-
}
|
|
2736
|
-
),
|
|
2737
|
-
scrollFade.state.bottom && /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(
|
|
2738
|
-
"button",
|
|
2739
|
-
{
|
|
2740
|
-
type: "button",
|
|
2741
|
-
"data-slot": "item-menu-more-below",
|
|
2742
|
-
tabIndex: -1,
|
|
2743
|
-
"aria-hidden": "true",
|
|
2744
|
-
onPointerDown: (e) => e.preventDefault(),
|
|
2745
|
-
onClick: scrollToEnd,
|
|
2746
|
-
className: "flex w-full shrink-0 items-center justify-center gap-1 border-t border-border bg-popover px-2 py-1 text-[11px] font-medium text-muted-foreground hover:bg-accent hover:text-accent-foreground",
|
|
2747
|
-
children: [
|
|
2748
|
-
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(ChevronDownIcon, { className: "h-3 w-3" }),
|
|
2749
|
-
"More actions below"
|
|
2750
|
-
]
|
|
3035
|
+
family: dropdownFamily,
|
|
3036
|
+
sections: resolved.sections,
|
|
3037
|
+
onCloseRequest: () => handleOpenChange(false)
|
|
2751
3038
|
}
|
|
2752
3039
|
)
|
|
2753
3040
|
]
|
|
@@ -2758,10 +3045,10 @@ function ItemMenu({
|
|
|
2758
3045
|
ItemMenu.routeHeaderMenu = true;
|
|
2759
3046
|
function ItemContextMenu(props) {
|
|
2760
3047
|
const host = useItemMenuHost();
|
|
2761
|
-
if (props.enabled === false) return /* @__PURE__ */ (0,
|
|
3048
|
+
if (props.enabled === false) return /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(import_jsx_runtime26.Fragment, { children: props.children });
|
|
2762
3049
|
const HostMenu = host?.ContextMenu;
|
|
2763
|
-
if (HostMenu) return /* @__PURE__ */ (0,
|
|
2764
|
-
return /* @__PURE__ */ (0,
|
|
3050
|
+
if (HostMenu) return /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(HostMenu, { ...props });
|
|
3051
|
+
return /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(DefaultItemContextMenu, { ...props });
|
|
2765
3052
|
}
|
|
2766
3053
|
function DefaultItemContextMenu({
|
|
2767
3054
|
config,
|
|
@@ -2772,7 +3059,7 @@ function DefaultItemContextMenu({
|
|
|
2772
3059
|
}) {
|
|
2773
3060
|
const [resolved, setResolved] = (0, import_react7.useState)(null);
|
|
2774
3061
|
const targetRef = (0, import_react7.useRef)(null);
|
|
2775
|
-
return /* @__PURE__ */ (0,
|
|
3062
|
+
return /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(
|
|
2776
3063
|
ContextMenu,
|
|
2777
3064
|
{
|
|
2778
3065
|
modal: false,
|
|
@@ -2784,7 +3071,7 @@ function DefaultItemContextMenu({
|
|
|
2784
3071
|
onOpenChange?.(open);
|
|
2785
3072
|
},
|
|
2786
3073
|
children: [
|
|
2787
|
-
/* @__PURE__ */ (0,
|
|
3074
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
2788
3075
|
ContextMenuTrigger,
|
|
2789
3076
|
{
|
|
2790
3077
|
asChild: true,
|
|
@@ -2794,17 +3081,10 @@ function DefaultItemContextMenu({
|
|
|
2794
3081
|
children
|
|
2795
3082
|
}
|
|
2796
3083
|
),
|
|
2797
|
-
resolved && /* @__PURE__ */ (0,
|
|
2798
|
-
|
|
2799
|
-
{
|
|
2800
|
-
|
|
2801
|
-
onCloseAutoFocus,
|
|
2802
|
-
children: [
|
|
2803
|
-
resolved.header?.title && /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(ContextMenuLabel, { className: "text-xs font-medium text-muted-foreground", children: resolved.header.title }),
|
|
2804
|
-
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(MenuSections, { family: contextFamily, sections: resolved.sections, onCloseRequest: () => onOpenChange?.(false) })
|
|
2805
|
-
]
|
|
2806
|
-
}
|
|
2807
|
-
)
|
|
3084
|
+
resolved && /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(MenuLookContextContent, { onCloseAutoFocus, children: [
|
|
3085
|
+
resolved.header?.title && /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(MenuLookContextLabel, { description: resolved.header.description, children: resolved.header.title }),
|
|
3086
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)(MenuSections, { family: contextFamily, sections: resolved.sections, onCloseRequest: () => onOpenChange?.(false) })
|
|
3087
|
+
] })
|
|
2808
3088
|
]
|
|
2809
3089
|
}
|
|
2810
3090
|
);
|
|
@@ -2813,7 +3093,7 @@ declareLazyDataProps(ItemMenu, ["config"]);
|
|
|
2813
3093
|
declareLazyDataProps(ItemContextMenu, ["config"]);
|
|
2814
3094
|
|
|
2815
3095
|
// src/item/ItemRow.tsx
|
|
2816
|
-
var
|
|
3096
|
+
var import_jsx_runtime27 = require("react/jsx-runtime");
|
|
2817
3097
|
var SIZE = {
|
|
2818
3098
|
// A nested sub-row (a conversation's helpers under it in the chat sidebar):
|
|
2819
3099
|
// finer and quieter than its parent, so a tree reads at a glance.
|
|
@@ -2902,7 +3182,7 @@ function ItemRow({
|
|
|
2902
3182
|
const startInlineRename = () => {
|
|
2903
3183
|
if (canRename) setEditing(true);
|
|
2904
3184
|
};
|
|
2905
|
-
const labelNode = editing && rename ? /* @__PURE__ */ (0,
|
|
3185
|
+
const labelNode = editing && rename ? /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
2906
3186
|
EditableLabel,
|
|
2907
3187
|
{
|
|
2908
3188
|
activation: "controlled",
|
|
@@ -2917,17 +3197,17 @@ function ItemRow({
|
|
|
2917
3197
|
className: "flex-1",
|
|
2918
3198
|
inputClassName: cn("font-normal", sz.text)
|
|
2919
3199
|
}
|
|
2920
|
-
) : subtitle != null ? /* @__PURE__ */ (0,
|
|
2921
|
-
/* @__PURE__ */ (0,
|
|
2922
|
-
/* @__PURE__ */ (0,
|
|
2923
|
-
] }) : /* @__PURE__ */ (0,
|
|
2924
|
-
const primaryInner = /* @__PURE__ */ (0,
|
|
2925
|
-
leading != null && /* @__PURE__ */ (0,
|
|
3200
|
+
) : subtitle != null ? /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("span", { className: "flex min-w-0 flex-1 flex-col", children: [
|
|
3201
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)("span", { className: cn("item-fade min-w-0", sz.text), title: label, children: label }),
|
|
3202
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)("span", { className: "min-w-0 truncate type-secondary text-muted-foreground", "data-item-subtitle": "", children: subtitle })
|
|
3203
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("span", { className: cn("item-fade min-w-0 flex-1", sz.text), title: label, children: label });
|
|
3204
|
+
const primaryInner = /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(import_jsx_runtime27.Fragment, { children: [
|
|
3205
|
+
leading != null && /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("span", { className: "flex shrink-0 items-center", children: leading }),
|
|
2926
3206
|
labelNode,
|
|
2927
3207
|
secondaryLabel && // Clamped: a secondary value can be a sentence (a lineage edge's
|
|
2928
3208
|
// "140 cards - 1 section could not be covered …"). Unclamped it pushed
|
|
2929
3209
|
// the label out of the row (owner, 2026-10-04).
|
|
2930
|
-
/* @__PURE__ */ (0,
|
|
3210
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
2931
3211
|
"span",
|
|
2932
3212
|
{
|
|
2933
3213
|
className: cn(
|
|
@@ -2938,14 +3218,14 @@ function ItemRow({
|
|
|
2938
3218
|
children: secondaryLabel
|
|
2939
3219
|
}
|
|
2940
3220
|
),
|
|
2941
|
-
(trailing != null || trailingOnHover != null) && /* @__PURE__ */ (0,
|
|
3221
|
+
(trailing != null || trailingOnHover != null) && /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("span", { className: "item-shift flex shrink-0 items-center gap-1 pr-0.5", children: [
|
|
2942
3222
|
trailing,
|
|
2943
|
-
trailingOnHover != null && /* @__PURE__ */ (0,
|
|
3223
|
+
trailingOnHover != null && /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("span", { className: cn("hidden", REVEAL_DISPLAY), "data-item-trailing-hover": "", children: trailingOnHover })
|
|
2944
3224
|
] })
|
|
2945
3225
|
] });
|
|
2946
3226
|
const twoLine = subtitle != null && !editing;
|
|
2947
3227
|
const sideBySide = actions != null || leadingControl != null;
|
|
2948
|
-
const disclosureButton = disclosure ? /* @__PURE__ */ (0,
|
|
3228
|
+
const disclosureButton = disclosure ? /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
2949
3229
|
Button2,
|
|
2950
3230
|
{
|
|
2951
3231
|
type: "button",
|
|
@@ -2957,7 +3237,7 @@ function ItemRow({
|
|
|
2957
3237
|
e.stopPropagation();
|
|
2958
3238
|
disclosure.onToggle();
|
|
2959
3239
|
},
|
|
2960
|
-
icon: disclosure.open ? /* @__PURE__ */ (0,
|
|
3240
|
+
icon: disclosure.open ? /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(ChevronDownIcon, { className: sz.icon }) : /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(ChevronRightIcon, { className: sz.icon }),
|
|
2961
3241
|
className: "shrink-0"
|
|
2962
3242
|
}
|
|
2963
3243
|
) : null;
|
|
@@ -2976,11 +3256,11 @@ function ItemRow({
|
|
|
2976
3256
|
} : void 0;
|
|
2977
3257
|
let primary;
|
|
2978
3258
|
if (editing || disabled) {
|
|
2979
|
-
primary = /* @__PURE__ */ (0,
|
|
3259
|
+
primary = /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("div", { className: primaryClass, style: indentStyle, "data-item-primary": "", children: primaryInner });
|
|
2980
3260
|
} else if (href) {
|
|
2981
3261
|
const RegisteredLink = getTapTargetLinkComponent();
|
|
2982
3262
|
const Link = RegisteredLink ?? "a";
|
|
2983
|
-
primary = /* @__PURE__ */ (0,
|
|
3263
|
+
primary = /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
2984
3264
|
Link,
|
|
2985
3265
|
{
|
|
2986
3266
|
href,
|
|
@@ -3002,7 +3282,7 @@ function ItemRow({
|
|
|
3002
3282
|
}
|
|
3003
3283
|
);
|
|
3004
3284
|
} else {
|
|
3005
|
-
primary = /* @__PURE__ */ (0,
|
|
3285
|
+
primary = /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
3006
3286
|
"button",
|
|
3007
3287
|
{
|
|
3008
3288
|
type: "button",
|
|
@@ -3019,19 +3299,19 @@ function ItemRow({
|
|
|
3019
3299
|
}
|
|
3020
3300
|
);
|
|
3021
3301
|
}
|
|
3022
|
-
const kebab = mappedMenu && !editing ? /* @__PURE__ */ (0,
|
|
3302
|
+
const kebab = mappedMenu && !editing ? /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
3023
3303
|
ItemMenu,
|
|
3024
3304
|
{
|
|
3025
3305
|
config: mappedMenu,
|
|
3026
3306
|
align: "end",
|
|
3027
3307
|
onCloseAutoFocus: handleCloseAutoFocus,
|
|
3028
|
-
children: /* @__PURE__ */ (0,
|
|
3308
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
3029
3309
|
Button2,
|
|
3030
3310
|
{
|
|
3031
3311
|
type: "button",
|
|
3032
3312
|
variant: "quiet",
|
|
3033
3313
|
"aria-label": kebabAriaLabel ?? `Options for ${label}`,
|
|
3034
|
-
icon: /* @__PURE__ */ (0,
|
|
3314
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(MoreHorizontalIcon, { className: sz.icon }),
|
|
3035
3315
|
"aria-haspopup": "menu",
|
|
3036
3316
|
onClick: (e) => e.stopPropagation(),
|
|
3037
3317
|
"data-item-kebab": "",
|
|
@@ -3047,7 +3327,7 @@ function ItemRow({
|
|
|
3047
3327
|
)
|
|
3048
3328
|
}
|
|
3049
3329
|
) : null;
|
|
3050
|
-
const row = /* @__PURE__ */ (0,
|
|
3330
|
+
const row = /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(
|
|
3051
3331
|
"div",
|
|
3052
3332
|
{
|
|
3053
3333
|
"data-active": active || void 0,
|
|
@@ -3060,9 +3340,9 @@ function ItemRow({
|
|
|
3060
3340
|
className
|
|
3061
3341
|
),
|
|
3062
3342
|
children: [
|
|
3063
|
-
leadingControl != null ? /* @__PURE__ */ (0,
|
|
3343
|
+
leadingControl != null ? /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("span", { className: "flex shrink-0 items-center pl-2", "data-item-leading-control": "", children: leadingControl }) : null,
|
|
3064
3344
|
primary,
|
|
3065
|
-
!sideBySide && disclosureButton ? /* @__PURE__ */ (0,
|
|
3345
|
+
!sideBySide && disclosureButton ? /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
3066
3346
|
"span",
|
|
3067
3347
|
{
|
|
3068
3348
|
className: "item-shift absolute inset-y-0 right-1 flex items-center",
|
|
@@ -3071,7 +3351,7 @@ function ItemRow({
|
|
|
3071
3351
|
}
|
|
3072
3352
|
) : null,
|
|
3073
3353
|
!sideBySide && kebab,
|
|
3074
|
-
sideBySide && (actions != null || kebab || disclosureButton) ? /* @__PURE__ */ (0,
|
|
3354
|
+
sideBySide && (actions != null || kebab || disclosureButton) ? /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(
|
|
3075
3355
|
"span",
|
|
3076
3356
|
{
|
|
3077
3357
|
className: "flex shrink-0 items-center [&>:not(.matrx-tap-target,.matrx-alchemy)]:mx-0.5",
|
|
@@ -3087,7 +3367,7 @@ function ItemRow({
|
|
|
3087
3367
|
}
|
|
3088
3368
|
);
|
|
3089
3369
|
if (!mappedMenu || disableContextMenu) return row;
|
|
3090
|
-
return /* @__PURE__ */ (0,
|
|
3370
|
+
return /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
3091
3371
|
ItemContextMenu,
|
|
3092
3372
|
{
|
|
3093
3373
|
config: mappedMenu,
|
|
@@ -3109,13 +3389,13 @@ function ItemRow({
|
|
|
3109
3389
|
|
|
3110
3390
|
// src/checkbox.tsx
|
|
3111
3391
|
var CheckboxPrimitive = __toESM(require("@radix-ui/react-checkbox"), 1);
|
|
3112
|
-
var
|
|
3113
|
-
var
|
|
3392
|
+
var React17 = __toESM(require("react"), 1);
|
|
3393
|
+
var import_jsx_runtime28 = require("react/jsx-runtime");
|
|
3114
3394
|
var CHECKBOX_SIZES = {
|
|
3115
3395
|
sm: { root: "h-3.5 w-3.5 rounded-xs", glyph: "h-3 w-3" },
|
|
3116
3396
|
md: { root: "h-4 w-4 rounded-sm", glyph: "h-3.5 w-3.5" }
|
|
3117
3397
|
};
|
|
3118
|
-
var Checkbox =
|
|
3398
|
+
var Checkbox = React17.forwardRef(({ className, size = "md", ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
3119
3399
|
CheckboxPrimitive.Root,
|
|
3120
3400
|
{
|
|
3121
3401
|
ref,
|
|
@@ -3126,12 +3406,12 @@ var Checkbox = React15.forwardRef(({ className, size = "md", ...props }, ref) =>
|
|
|
3126
3406
|
className
|
|
3127
3407
|
),
|
|
3128
3408
|
...props,
|
|
3129
|
-
children: /* @__PURE__ */ (0,
|
|
3409
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
3130
3410
|
CheckboxPrimitive.Indicator,
|
|
3131
3411
|
{
|
|
3132
3412
|
"data-slot": "checkbox-indicator",
|
|
3133
3413
|
className: "flex items-center justify-center text-current",
|
|
3134
|
-
children: props.checked === "indeterminate" ? /* @__PURE__ */ (0,
|
|
3414
|
+
children: props.checked === "indeterminate" ? /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(DividerHorizontalIcon, { className: CHECKBOX_SIZES[size].glyph }) : /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(RadixCheckIcon, { className: CHECKBOX_SIZES[size].glyph })
|
|
3135
3415
|
}
|
|
3136
3416
|
)
|
|
3137
3417
|
}
|
|
@@ -3172,7 +3452,7 @@ var MAC_ROW_HEIGHT_BY_DENSITY = {
|
|
|
3172
3452
|
};
|
|
3173
3453
|
|
|
3174
3454
|
// src/record-list/RecordList.tsx
|
|
3175
|
-
var
|
|
3455
|
+
var import_jsx_runtime29 = require("react/jsx-runtime");
|
|
3176
3456
|
function RecordList({
|
|
3177
3457
|
items,
|
|
3178
3458
|
getKey,
|
|
@@ -3202,7 +3482,7 @@ function RecordList({
|
|
|
3202
3482
|
}) {
|
|
3203
3483
|
const listRef = (0, import_react9.useRef)(null);
|
|
3204
3484
|
if (items.length === 0) {
|
|
3205
|
-
return /* @__PURE__ */ (0,
|
|
3485
|
+
return /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("div", { className, "data-record-list": "", ...{ [MAC_LIST_ATTRIBUTE]: "" }, children: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(ReadEmpty, { read, children: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(ListEmptyView, { emptyState }) }) });
|
|
3206
3486
|
}
|
|
3207
3487
|
const selectable = selectedKeys !== void 0;
|
|
3208
3488
|
const selected = new Set(selectedKeys ?? []);
|
|
@@ -3225,9 +3505,9 @@ function RecordList({
|
|
|
3225
3505
|
next.focus();
|
|
3226
3506
|
}
|
|
3227
3507
|
};
|
|
3228
|
-
return /* @__PURE__ */ (0,
|
|
3229
|
-
/* @__PURE__ */ (0,
|
|
3230
|
-
/* @__PURE__ */ (0,
|
|
3508
|
+
return /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)("div", { className: cn("flex flex-col gap-2", className), "data-record-list": "", ...{ [MAC_LIST_ATTRIBUTE]: "" }, children: [
|
|
3509
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(ReadStaleNotice, { read }),
|
|
3510
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
3231
3511
|
"ul",
|
|
3232
3512
|
{
|
|
3233
3513
|
ref: listRef,
|
|
@@ -3247,7 +3527,7 @@ function RecordList({
|
|
|
3247
3527
|
const lead = leading?.(item);
|
|
3248
3528
|
const trail = trailing?.(item);
|
|
3249
3529
|
const sub = subtitle?.(item);
|
|
3250
|
-
return /* @__PURE__ */ (0,
|
|
3530
|
+
return /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("li", { "data-record-key": key, children: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
3251
3531
|
ItemRow,
|
|
3252
3532
|
{
|
|
3253
3533
|
label: name,
|
|
@@ -3267,7 +3547,7 @@ function RecordList({
|
|
|
3267
3547
|
...surfaceName ? { surfaceName } : {},
|
|
3268
3548
|
...rowEntity ? { entity: rowEntity } : {},
|
|
3269
3549
|
...selectable ? {
|
|
3270
|
-
leadingControl: /* @__PURE__ */ (0,
|
|
3550
|
+
leadingControl: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
3271
3551
|
Checkbox,
|
|
3272
3552
|
{
|
|
3273
3553
|
size: "sm",
|