@alexgorbatchev/shadcn 0.0.82 → 0.0.84
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/README.md +4 -0
- package/dist/{chunk-6em6sp6y.js → chunk-4r1fne02.js} +1 -1
- package/dist/{chunk-hn4se2j1.js → chunk-6fj02yzp.js} +3 -3
- package/dist/{chunk-8fk1cene.js → chunk-afegpa2s.js} +1 -1
- package/dist/{chunk-nz2exxhn.js → chunk-bdsdkjcq.js} +1 -1
- package/dist/{chunk-wncennvw.js → chunk-fkxhe17e.js} +1 -1
- package/dist/{chunk-wg3g8pyt.js → chunk-fnqdw884.js} +1 -1
- package/dist/{chunk-gfrg1484.js → chunk-hyhr09xy.js} +1 -1
- package/dist/{chunk-4ak25cx4.js → chunk-j2tm6kjm.js} +2 -1
- package/dist/{chunk-kh4ecqqe.js → chunk-kk558p5p.js} +2 -1
- package/dist/{chunk-29xw11s7.js → chunk-mjxhvwgg.js} +4 -4
- package/dist/{chunk-ghfmc1t4.js → chunk-s8qhybtb.js} +1 -1
- package/dist/{chunk-yeh4zh4b.js → chunk-tz7zjkw3.js} +1 -1
- package/dist/{chunk-84ezpzmn.js → chunk-w67bf59k.js} +1 -1
- package/dist/{chunk-tegj7xts.js → chunk-w8hgwhgc.js} +39 -5
- package/dist/{chunk-ygmp2qax.js → chunk-wrm689qy.js} +8 -8
- package/dist/components/MenuParts.d.ts +15 -1
- package/dist/components/MenuPopup.d.ts +2 -2
- package/dist/components/assistant-ui/elements/CommandPalette.js +2 -2
- package/dist/components/assistant-ui/elements/ModelSelector.js +8 -8
- package/dist/components/assistant-ui/elements/ModelSelectorContent.js +7 -7
- package/dist/components/assistant-ui/elements/ModelSelectorEmpty.js +2 -2
- package/dist/components/assistant-ui/elements/ModelSelectorFocusAnchor.js +2 -2
- package/dist/components/assistant-ui/elements/ModelSelectorGroup.js +2 -2
- package/dist/components/assistant-ui/elements/ModelSelectorItem.js +2 -2
- package/dist/components/assistant-ui/elements/ModelSelectorList.js +4 -4
- package/dist/components/assistant-ui/elements/ModelSelectorSearch.js +2 -2
- package/dist/components/assistant-ui/elements/ModelSelectorSeparator.js +2 -2
- package/dist/components/assistant-ui/elements/RegenerateMenu.js +2 -2
- package/dist/components/assistant-ui/index.js +13 -13
- package/dist/components/assistant-ui/native/ModelSelector.js +10 -10
- package/dist/components/assistant-ui/native/index.js +10 -10
- package/dist/components/command/Command.d.ts +3 -1
- package/dist/components/command/index.js +1 -1
- package/dist/components/json-render/index.js +2 -2
- package/dist/index.d.ts +2 -1
- package/dist/index.js +10 -2
- package/dist/menu/types.d.ts +8 -0
- package/dist/prototype.js +1 -1
- package/llms/components/navigation/Command.md +1 -1
- package/llms/components/navigation/DropdownMenu.md +56 -1
- package/llms/setup.md +4 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -452,6 +452,10 @@ Keep preferred widths separate from the table's rendered sizing atom. In `onFitW
|
|
|
452
452
|
|
|
453
453
|
`ActionsMenu` shares one `items` definition between a dropdown action and an optional context menu. Supply an accessible `label`; the default trigger is a ghost icon button. `size="sm"` displays the label, and `variant`, `disabled`, and `trigger` customize the action. Supplying `contextTarget` composes the native context trigger with that element and adds its popup. Compose items with `MenuItem`, `MenuLinkItem`, checkbox/radio parts, groups, labels, separators, shortcuts, and submenu parts; dropdown and context menus share these implementations. `MenuLinkItem` retains its native anchor and menu keyboard semantics.
|
|
454
454
|
|
|
455
|
+
Menus never scroll. `DropdownMenuContent`, `ContextMenuContent`, and submenu content carry `data-scroll="none"`, so the development `ScrollGuard` reports a menu whose content outgrows the viewport; shorten it, for example by grouping items under submenus, instead of letting it scroll. A list longer than a menu should show belongs in a filterable menu: wrap the menu or submenu root in `MenuFilterProvider`, put `MenuInput` at the top of its content, its items in `MenuList`, and an optional `MenuEmpty` message after them. Typing narrows the items while the arrow keys keep moving among them. Pass `filter={null}` with a controlled `value` and `onValueChange` to render the matching items yourself, for example only as many as fit.
|
|
456
|
+
|
|
457
|
+
One menu instance can serve a whole list: open it through a `DropdownMenu` `handle` with each row's payload, and pass `point={{ clientX: event.clientX, clientY: event.clientY }}` to `DropdownMenuContent` when a right-click opened it, so it opens at the pointer instead of at the row's trigger. At a point the menu's top start corner sits on the pointer; near the viewport's edges it flips to the side with room and then shifts until it lies wholly inside the viewport. Leave `point` unset for keyboard and trigger opens, which anchor to their trigger.
|
|
458
|
+
|
|
455
459
|
For nested layouts, compose `ActionsMenuTrigger`, `ActionsMenuContextTarget`, and `ActionsMenuContextContent` explicitly inside `ActionsMenu`. The dropdown trigger owns its local native dropdown root and popup; the context target and content share an independent context root. A tree row can use `TreeItem render={<ActionsMenuContextTarget />}` and put the trigger in its action slot. For a table row, render the context target as the actual `tr`, then place the dropdown trigger and context content inside a `td`: native popup portals insert focus guards at their declaration, which must remain valid table children.
|
|
456
460
|
|
|
457
461
|
`TreeItem linkProps` places the registered tree item, roving focus, and native drag handlers on an anchor. Pass `href` and anchor events directly, or compose a router link through `linkProps.render`. The outer `render` and `ref` remain available for row overlays; disclosure and `endEnhancer` controls remain siblings of the link. Enter and modified clicks retain native link behavior, while tree arrows retain navigation and expansion behavior. Optional `dropHint={{ content, open, side }}` displays caller-controlled drag feedback without adding a focus target. `isDimmed` fades a settled row, such as completed work, to 70% opacity and exposes `data-dimmed`; hovering or focusing anything in the row restores full opacity, and the row stays interactive.
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import {
|
|
2
2
|
CommandList2,
|
|
3
3
|
CommandGroup2
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-j2tm6kjm.js";
|
|
5
5
|
import {
|
|
6
6
|
useModelSelectorContext
|
|
7
7
|
} from "./chunk-ydfx8r6d.js";
|
|
8
8
|
import {
|
|
9
9
|
ModelSelectorEmpty2
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-afegpa2s.js";
|
|
11
11
|
import {
|
|
12
12
|
ModelSelectorItem2
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-tz7zjkw3.js";
|
|
14
14
|
|
|
15
15
|
// src/components/assistant-ui/elements/ModelSelectorList.tsx
|
|
16
16
|
import { jsx, jsxs, Fragment } from "react/jsx-runtime";
|
|
@@ -205,6 +205,7 @@ function CommandItem2({
|
|
|
205
205
|
disabledReason,
|
|
206
206
|
onDisabledSelect,
|
|
207
207
|
ref,
|
|
208
|
+
touchTarget,
|
|
208
209
|
...props
|
|
209
210
|
}) {
|
|
210
211
|
const trackedOnSelect = useAnalyticsCallback("CommandItem", analytics, { name: "ui.activate" }, props.onSelect);
|
|
@@ -227,7 +228,7 @@ function CommandItem2({
|
|
|
227
228
|
ref: mergedRef,
|
|
228
229
|
"data-slot": "command-item",
|
|
229
230
|
"data-disabled-reason": disabledReason ? "" : undefined,
|
|
230
|
-
className: cn2("group/command-item relative flex min-h-control cursor-default items-center gap-control-gap px-control-x text-sm outline-none select-none data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50 data-[selected=true]:bg-muted data-[selected=true]:text-foreground data-disabled-reason:flex-wrap data-disabled-reason:py-1 data-disabled-reason:data-[disabled=true]:pointer-events-auto data-disabled-reason:data-[disabled=true]:opacity-100 data-disabled-reason:data-[disabled=true]:text-muted-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg]:size-4", className),
|
|
231
|
+
className: cn2("group/command-item relative flex min-h-control cursor-default items-center gap-control-gap px-control-x text-sm outline-none select-none data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50 data-[selected=true]:bg-muted data-[selected=true]:text-foreground data-disabled-reason:flex-wrap data-disabled-reason:py-1 data-disabled-reason:data-[disabled=true]:pointer-events-auto data-disabled-reason:data-[disabled=true]:opacity-100 data-disabled-reason:data-[disabled=true]:text-muted-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg]:size-4", touchTarget && "pointer-coarse:min-h-11", className),
|
|
231
232
|
...props,
|
|
232
233
|
disabled: Boolean(disabledReason) || props.disabled,
|
|
233
234
|
"aria-describedby": [props["aria-describedby"], disabledReason ? reasonId : undefined].filter(Boolean).join(" ") || undefined,
|
|
@@ -38,7 +38,7 @@ import {
|
|
|
38
38
|
MenuShortcut2,
|
|
39
39
|
DropdownMenu2,
|
|
40
40
|
DropdownMenuTrigger2
|
|
41
|
-
} from "./chunk-
|
|
41
|
+
} from "./chunk-w8hgwhgc.js";
|
|
42
42
|
import {
|
|
43
43
|
Alert2,
|
|
44
44
|
AlertTitle2,
|
|
@@ -253,6 +253,7 @@ function ContextMenuContent2({
|
|
|
253
253
|
dir: direction,
|
|
254
254
|
"data-density": resolvedDensity,
|
|
255
255
|
"data-slot": "context-menu-content",
|
|
256
|
+
"data-scroll": "none",
|
|
256
257
|
className: (state) => cn2(" max-h-(--available-height) min-w-36 origin-(--transform-origin) overflow-x-hidden overflow-y-auto rounded-sm bg-popover p-1 text-popover-foreground border border-frame-edge shadow-frame duration-100 outline-none data-open:animate-in data-open:fade-in-0 data-closed:animate-out data-closed:fade-out-0 motion-reduce:data-open:animate-none motion-reduce:data-closed:animate-none ", typeof className === "function" ? className(state) : className),
|
|
257
258
|
...props
|
|
258
259
|
})
|
|
@@ -4,19 +4,19 @@ import {
|
|
|
4
4
|
} from "./chunk-bf8kbj33.js";
|
|
5
5
|
import {
|
|
6
6
|
Command2
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-j2tm6kjm.js";
|
|
8
8
|
import {
|
|
9
9
|
useModelSelectorContext
|
|
10
10
|
} from "./chunk-ydfx8r6d.js";
|
|
11
11
|
import {
|
|
12
12
|
ModelSelectorFocusAnchor2
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-fnqdw884.js";
|
|
14
14
|
import {
|
|
15
15
|
ModelSelectorSearch2
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-s8qhybtb.js";
|
|
17
17
|
import {
|
|
18
18
|
ModelSelectorList2
|
|
19
|
-
} from "./chunk-
|
|
19
|
+
} from "./chunk-6fj02yzp.js";
|
|
20
20
|
import {
|
|
21
21
|
ModelSelectorEffort2
|
|
22
22
|
} from "./chunk-pzr1f2tz.js";
|
|
@@ -17,6 +17,7 @@ import {
|
|
|
17
17
|
} from "./chunk-5mydsjp3.js";
|
|
18
18
|
|
|
19
19
|
// src/components/MenuPopup.tsx
|
|
20
|
+
import { useMemo } from "react";
|
|
20
21
|
import { Menu as MenuPrimitive } from "@base-ui/react/menu";
|
|
21
22
|
import { jsx } from "react/jsx-runtime";
|
|
22
23
|
"use client";
|
|
@@ -34,6 +35,11 @@ function MenuPortal({ container, ref, children, ...props }) {
|
|
|
34
35
|
})
|
|
35
36
|
});
|
|
36
37
|
}
|
|
38
|
+
function usePointAnchor(point) {
|
|
39
|
+
const x = point?.clientX;
|
|
40
|
+
const y = point?.clientY;
|
|
41
|
+
return useMemo(() => x === undefined || y === undefined ? undefined : { getBoundingClientRect: () => DOMRect.fromRect({ x, y, width: 0, height: 0 }) }, [x, y]);
|
|
42
|
+
}
|
|
37
43
|
function MenuPopup({
|
|
38
44
|
density,
|
|
39
45
|
width = "content",
|
|
@@ -41,23 +47,24 @@ function MenuPopup({
|
|
|
41
47
|
alignOffset = 0,
|
|
42
48
|
side = "bottom",
|
|
43
49
|
sideOffset = 4,
|
|
50
|
+
point,
|
|
44
51
|
className,
|
|
45
52
|
...props
|
|
46
53
|
}) {
|
|
47
54
|
const resolvedDensity = useDensity(density);
|
|
48
55
|
const direction = useDirection2();
|
|
56
|
+
const anchor = usePointAnchor(point);
|
|
57
|
+
const placement = anchor ? { anchor, align: "start", alignOffset: 0, side: "bottom", sideOffset: 0, sticky: true } : { align, alignOffset, side, sideOffset };
|
|
49
58
|
return /* @__PURE__ */ jsx(MenuPortal, {
|
|
50
59
|
children: /* @__PURE__ */ jsx(MenuPrimitive.Positioner, {
|
|
51
60
|
dir: direction,
|
|
52
61
|
className: "isolate outline-none",
|
|
53
|
-
|
|
54
|
-
alignOffset,
|
|
55
|
-
side,
|
|
56
|
-
sideOffset,
|
|
62
|
+
...placement,
|
|
57
63
|
children: /* @__PURE__ */ jsx(MenuPrimitive.Popup, {
|
|
58
64
|
dir: direction,
|
|
59
65
|
"data-density": resolvedDensity,
|
|
60
66
|
"data-slot": "dropdown-menu-content",
|
|
67
|
+
"data-scroll": "none",
|
|
61
68
|
className: (state) => cn2("max-h-(--available-height) max-w-(--available-width) min-w-32 origin-(--transform-origin) overflow-x-hidden overflow-y-auto rounded-md bg-popover p-1 text-popover-foreground shadow-frame border border-frame-edge shadow-frame duration-120 outline-none data-open:animate-in data-open:fade-in-0 data-closed:animate-out data-closed:overflow-hidden data-closed:fade-out-0", width === "anchor" ? "w-(--anchor-width)" : "w-max", typeof className === "function" ? className(state) : className),
|
|
62
69
|
...props
|
|
63
70
|
})
|
|
@@ -198,6 +205,33 @@ function MenuSubContent2({
|
|
|
198
205
|
...props
|
|
199
206
|
});
|
|
200
207
|
}
|
|
208
|
+
function MenuFilterProvider2(props) {
|
|
209
|
+
return /* @__PURE__ */ jsx2(MenuPrimitive2.FilterProvider, {
|
|
210
|
+
...props
|
|
211
|
+
});
|
|
212
|
+
}
|
|
213
|
+
function MenuInput2({ density, className, ...props }) {
|
|
214
|
+
return /* @__PURE__ */ jsx2(MenuPrimitive2.Input, {
|
|
215
|
+
"data-density": density,
|
|
216
|
+
"data-slot": "menu-input",
|
|
217
|
+
className: (state) => cn2("mb-1 h-control-sm w-full min-w-0 rounded-sm border border-input bg-secondary px-1.5 text-sm outline-none placeholder:text-faint-foreground focus-visible:border-ring focus-visible:ring-1 focus-visible:ring-ring", typeof className === "function" ? className(state) : className),
|
|
218
|
+
...props
|
|
219
|
+
});
|
|
220
|
+
}
|
|
221
|
+
function MenuList2(props) {
|
|
222
|
+
return /* @__PURE__ */ jsx2(MenuPrimitive2.List, {
|
|
223
|
+
"data-slot": "menu-list",
|
|
224
|
+
...props
|
|
225
|
+
});
|
|
226
|
+
}
|
|
227
|
+
function MenuEmpty2({ density, className, ...props }) {
|
|
228
|
+
return /* @__PURE__ */ jsx2(MenuPrimitive2.Empty, {
|
|
229
|
+
"data-density": density,
|
|
230
|
+
"data-slot": "menu-empty",
|
|
231
|
+
className: (state) => cn2("px-1.5 py-1 text-sm text-muted-foreground empty:hidden", typeof className === "function" ? className(state) : className),
|
|
232
|
+
...props
|
|
233
|
+
});
|
|
234
|
+
}
|
|
201
235
|
function MenuCheckboxItem2({
|
|
202
236
|
analytics,
|
|
203
237
|
density,
|
|
@@ -294,4 +328,4 @@ function DropdownMenuTrigger2({ ...props }) {
|
|
|
294
328
|
});
|
|
295
329
|
}
|
|
296
330
|
|
|
297
|
-
export { MenuPortal, MenuPopup, MenuGroup2, MenuLabel2, MenuItem2, MenuLinkItem2, MenuSub2, MenuSubTrigger2, MenuSubContent2, MenuCheckboxItem2, MenuRadioGroup2, MenuRadioItem2, MenuSeparator2, MenuShortcut2, DropdownMenu2, DropdownMenuTrigger2 };
|
|
331
|
+
export { MenuPortal, MenuPopup, MenuGroup2, MenuLabel2, MenuItem2, MenuLinkItem2, MenuSub2, MenuSubTrigger2, MenuSubContent2, MenuFilterProvider2, MenuInput2, MenuList2, MenuEmpty2, MenuCheckboxItem2, MenuRadioGroup2, MenuRadioItem2, MenuSeparator2, MenuShortcut2, DropdownMenu2, DropdownMenuTrigger2 };
|
|
@@ -12,31 +12,31 @@ import {
|
|
|
12
12
|
} from "./chunk-gb16cwpw.js";
|
|
13
13
|
import {
|
|
14
14
|
ModelSelectorFocusAnchor2
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-fnqdw884.js";
|
|
16
16
|
import {
|
|
17
17
|
ModelSelectorSearch2
|
|
18
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-s8qhybtb.js";
|
|
19
19
|
import {
|
|
20
20
|
ModelSelectorEmpty2
|
|
21
|
-
} from "./chunk-
|
|
21
|
+
} from "./chunk-afegpa2s.js";
|
|
22
22
|
import {
|
|
23
23
|
ModelSelectorItem2
|
|
24
|
-
} from "./chunk-
|
|
24
|
+
} from "./chunk-tz7zjkw3.js";
|
|
25
25
|
import {
|
|
26
26
|
ModelSelectorList2
|
|
27
|
-
} from "./chunk-
|
|
27
|
+
} from "./chunk-6fj02yzp.js";
|
|
28
28
|
import {
|
|
29
29
|
ModelSelectorEffort2
|
|
30
30
|
} from "./chunk-pzr1f2tz.js";
|
|
31
31
|
import {
|
|
32
32
|
ModelSelectorContent2
|
|
33
|
-
} from "./chunk-
|
|
33
|
+
} from "./chunk-mjxhvwgg.js";
|
|
34
34
|
import {
|
|
35
35
|
ModelSelectorGroup2
|
|
36
|
-
} from "./chunk-
|
|
36
|
+
} from "./chunk-bdsdkjcq.js";
|
|
37
37
|
import {
|
|
38
38
|
ModelSelectorSeparator2
|
|
39
|
-
} from "./chunk-
|
|
39
|
+
} from "./chunk-fkxhe17e.js";
|
|
40
40
|
|
|
41
41
|
// src/components/assistant-ui/native/ModelSelector.tsx
|
|
42
42
|
import { memo, useEffect } from "react";
|
|
@@ -14,6 +14,20 @@ declare function MenuLinkItem({ analytics, density, className, inset, variant, .
|
|
|
14
14
|
declare function MenuSub({ analytics, ...props }: MenuPrimitive.SubmenuRoot.Props & IAnalyticsProps): ReactElement;
|
|
15
15
|
declare function MenuSubTrigger({ density, className, inset, children, ...props }: MenuSubTriggerProps): ReactElement;
|
|
16
16
|
declare function MenuSubContent({ density, align, alignOffset, side, sideOffset, className, ...props }: MenuPopupProps): ReactElement;
|
|
17
|
+
/**
|
|
18
|
+
* Makes the menu or submenu it wraps filterable: put a `MenuInput` at the top of its content and its items in a
|
|
19
|
+
* `MenuList`. Pass `filter={null}` with a controlled `value` to render the matching items yourself, for example to show
|
|
20
|
+
* only as many as fit.
|
|
21
|
+
*/
|
|
22
|
+
declare function MenuFilterProvider(props: MenuPrimitive.FilterProvider.Props): ReactElement;
|
|
23
|
+
type MenuInputProps = MenuPrimitive.Input.Props & IDensityProps;
|
|
24
|
+
/** The filter field of a `MenuFilterProvider` menu; typing narrows the items while the arrows keep moving among them. */
|
|
25
|
+
declare function MenuInput({ density, className, ...props }: MenuInputProps): ReactElement;
|
|
26
|
+
/** The items of a filterable menu, so the filter field can share the popup with them. */
|
|
27
|
+
declare function MenuList(props: MenuPrimitive.List.Props): ReactElement;
|
|
28
|
+
type MenuEmptyProps = MenuPrimitive.Empty.Props & IDensityProps;
|
|
29
|
+
/** Shown in a filterable menu when no item matches its query. */
|
|
30
|
+
declare function MenuEmpty({ density, className, ...props }: MenuEmptyProps): ReactElement;
|
|
17
31
|
declare function MenuCheckboxItem({ analytics, density, className, children, checked, inset, ...props }: MenuCheckboxItemProps & IAnalyticsProps): ReactElement;
|
|
18
32
|
declare function MenuRadioGroup({ analytics, ...props }: MenuPrimitive.RadioGroup.Props & IAnalyticsProps): ReactElement;
|
|
19
33
|
declare function MenuRadioItem({ density, className, children, inset, ...props }: MenuRadioItemProps): ReactElement;
|
|
@@ -21,4 +35,4 @@ type MenuSeparatorProps = MenuPrimitive.Separator.Props & IDensityProps;
|
|
|
21
35
|
declare function MenuSeparator({ density, className, ...props }: MenuSeparatorProps): ReactElement;
|
|
22
36
|
type MenuShortcutProps = ComponentProps<"span"> & IDensityProps;
|
|
23
37
|
declare function MenuShortcut({ density, className, ...props }: MenuShortcutProps): ReactElement;
|
|
24
|
-
export { MenuGroup, MenuLabel, MenuItem, MenuLinkItem, MenuCheckboxItem, MenuRadioGroup, MenuRadioItem, MenuSeparator, MenuShortcut, MenuSub, MenuSubTrigger, MenuSubContent, };
|
|
38
|
+
export { MenuGroup, MenuLabel, MenuItem, MenuLinkItem, MenuCheckboxItem, MenuRadioGroup, MenuRadioItem, MenuSeparator, MenuShortcut, MenuSub, MenuSubTrigger, MenuSubContent, MenuFilterProvider, MenuInput, MenuList, MenuEmpty, };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { MenuPopupProps } from "../menu/types.js";
|
|
2
|
-
import type
|
|
2
|
+
import { type ReactElement } from "react";
|
|
3
3
|
import { Menu as MenuPrimitive } from "@base-ui/react/menu";
|
|
4
4
|
declare function MenuPortal({ container, ref, children, ...props }: MenuPrimitive.Portal.Props): ReactElement;
|
|
5
|
-
declare function MenuPopup({ density, width, align, alignOffset, side, sideOffset, className, ...props }: MenuPopupProps): ReactElement;
|
|
5
|
+
declare function MenuPopup({ density, width, align, alignOffset, side, sideOffset, point, className, ...props }: MenuPopupProps): ReactElement;
|
|
6
6
|
export { MenuPortal, MenuPopup };
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import {
|
|
2
2
|
CommandPalette2
|
|
3
|
-
} from "../../../chunk-
|
|
3
|
+
} from "../../../chunk-w67bf59k.js";
|
|
4
4
|
import"../../../chunk-7vnpp3ya.js";
|
|
5
|
-
import"../../../chunk-
|
|
5
|
+
import"../../../chunk-j2tm6kjm.js";
|
|
6
6
|
import"../../../chunk-t6gbcj27.js";
|
|
7
7
|
import"../../../chunk-4j3fsft3.js";
|
|
8
8
|
import"../../../chunk-er6e5fj8.js";
|
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
import {
|
|
2
2
|
ModelSelector2
|
|
3
|
-
} from "../../../chunk-
|
|
3
|
+
} from "../../../chunk-hyhr09xy.js";
|
|
4
4
|
import"../../../chunk-k2t9ey7z.js";
|
|
5
5
|
import"../../../chunk-gb16cwpw.js";
|
|
6
|
-
import"../../../chunk-
|
|
7
|
-
import"../../../chunk-
|
|
6
|
+
import"../../../chunk-mjxhvwgg.js";
|
|
7
|
+
import"../../../chunk-6fj02yzp.js";
|
|
8
8
|
import"../../../chunk-pzr1f2tz.js";
|
|
9
|
-
import"../../../chunk-
|
|
10
|
-
import"../../../chunk-
|
|
11
|
-
import"../../../chunk-
|
|
12
|
-
import"../../../chunk-
|
|
9
|
+
import"../../../chunk-afegpa2s.js";
|
|
10
|
+
import"../../../chunk-fnqdw884.js";
|
|
11
|
+
import"../../../chunk-s8qhybtb.js";
|
|
12
|
+
import"../../../chunk-tz7zjkw3.js";
|
|
13
13
|
import"../../../chunk-0qkdp68h.js";
|
|
14
14
|
import"../../../chunk-ydfx8r6d.js";
|
|
15
15
|
import"../../../chunk-kp3jgjng.js";
|
|
16
16
|
import"../../../chunk-tcefvfr8.js";
|
|
17
17
|
import"../../../chunk-bf8kbj33.js";
|
|
18
|
-
import"../../../chunk-
|
|
18
|
+
import"../../../chunk-j2tm6kjm.js";
|
|
19
19
|
import"../../../chunk-t6gbcj27.js";
|
|
20
20
|
import"../../../chunk-4j3fsft3.js";
|
|
21
21
|
import"../../../chunk-er6e5fj8.js";
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import {
|
|
2
2
|
ModelSelectorContent2
|
|
3
|
-
} from "../../../chunk-
|
|
4
|
-
import"../../../chunk-
|
|
3
|
+
} from "../../../chunk-mjxhvwgg.js";
|
|
4
|
+
import"../../../chunk-6fj02yzp.js";
|
|
5
5
|
import"../../../chunk-pzr1f2tz.js";
|
|
6
|
-
import"../../../chunk-
|
|
7
|
-
import"../../../chunk-
|
|
8
|
-
import"../../../chunk-
|
|
9
|
-
import"../../../chunk-
|
|
6
|
+
import"../../../chunk-afegpa2s.js";
|
|
7
|
+
import"../../../chunk-fnqdw884.js";
|
|
8
|
+
import"../../../chunk-s8qhybtb.js";
|
|
9
|
+
import"../../../chunk-tz7zjkw3.js";
|
|
10
10
|
import"../../../chunk-ydfx8r6d.js";
|
|
11
11
|
import"../../../chunk-kp3jgjng.js";
|
|
12
12
|
import"../../../chunk-tcefvfr8.js";
|
|
13
13
|
import"../../../chunk-bf8kbj33.js";
|
|
14
|
-
import"../../../chunk-
|
|
14
|
+
import"../../../chunk-j2tm6kjm.js";
|
|
15
15
|
import"../../../chunk-t6gbcj27.js";
|
|
16
16
|
import"../../../chunk-4j3fsft3.js";
|
|
17
17
|
import"../../../chunk-er6e5fj8.js";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
ModelSelectorEmpty2
|
|
3
|
-
} from "../../../chunk-
|
|
4
|
-
import"../../../chunk-
|
|
3
|
+
} from "../../../chunk-afegpa2s.js";
|
|
4
|
+
import"../../../chunk-j2tm6kjm.js";
|
|
5
5
|
import"../../../chunk-t6gbcj27.js";
|
|
6
6
|
import"../../../chunk-4j3fsft3.js";
|
|
7
7
|
import"../../../chunk-er6e5fj8.js";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
ModelSelectorFocusAnchor2
|
|
3
|
-
} from "../../../chunk-
|
|
4
|
-
import"../../../chunk-
|
|
3
|
+
} from "../../../chunk-fnqdw884.js";
|
|
4
|
+
import"../../../chunk-j2tm6kjm.js";
|
|
5
5
|
import"../../../chunk-t6gbcj27.js";
|
|
6
6
|
import"../../../chunk-4j3fsft3.js";
|
|
7
7
|
import"../../../chunk-er6e5fj8.js";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
ModelSelectorGroup2
|
|
3
|
-
} from "../../../chunk-
|
|
4
|
-
import"../../../chunk-
|
|
3
|
+
} from "../../../chunk-bdsdkjcq.js";
|
|
4
|
+
import"../../../chunk-j2tm6kjm.js";
|
|
5
5
|
import"../../../chunk-t6gbcj27.js";
|
|
6
6
|
import"../../../chunk-4j3fsft3.js";
|
|
7
7
|
import"../../../chunk-er6e5fj8.js";
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
ModelSelectorItem2
|
|
3
|
-
} from "../../../chunk-
|
|
3
|
+
} from "../../../chunk-tz7zjkw3.js";
|
|
4
4
|
import"../../../chunk-ydfx8r6d.js";
|
|
5
5
|
import"../../../chunk-kp3jgjng.js";
|
|
6
|
-
import"../../../chunk-
|
|
6
|
+
import"../../../chunk-j2tm6kjm.js";
|
|
7
7
|
import"../../../chunk-t6gbcj27.js";
|
|
8
8
|
import"../../../chunk-4j3fsft3.js";
|
|
9
9
|
import"../../../chunk-er6e5fj8.js";
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import {
|
|
2
2
|
ModelSelectorList2
|
|
3
|
-
} from "../../../chunk-
|
|
4
|
-
import"../../../chunk-
|
|
5
|
-
import"../../../chunk-
|
|
3
|
+
} from "../../../chunk-6fj02yzp.js";
|
|
4
|
+
import"../../../chunk-afegpa2s.js";
|
|
5
|
+
import"../../../chunk-tz7zjkw3.js";
|
|
6
6
|
import"../../../chunk-ydfx8r6d.js";
|
|
7
7
|
import"../../../chunk-kp3jgjng.js";
|
|
8
|
-
import"../../../chunk-
|
|
8
|
+
import"../../../chunk-j2tm6kjm.js";
|
|
9
9
|
import"../../../chunk-t6gbcj27.js";
|
|
10
10
|
import"../../../chunk-4j3fsft3.js";
|
|
11
11
|
import"../../../chunk-er6e5fj8.js";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
ModelSelectorSearch2
|
|
3
|
-
} from "../../../chunk-
|
|
4
|
-
import"../../../chunk-
|
|
3
|
+
} from "../../../chunk-s8qhybtb.js";
|
|
4
|
+
import"../../../chunk-j2tm6kjm.js";
|
|
5
5
|
import"../../../chunk-t6gbcj27.js";
|
|
6
6
|
import"../../../chunk-4j3fsft3.js";
|
|
7
7
|
import"../../../chunk-er6e5fj8.js";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
ModelSelectorSeparator2
|
|
3
|
-
} from "../../../chunk-
|
|
4
|
-
import"../../../chunk-
|
|
3
|
+
} from "../../../chunk-fkxhe17e.js";
|
|
4
|
+
import"../../../chunk-j2tm6kjm.js";
|
|
5
5
|
import"../../../chunk-t6gbcj27.js";
|
|
6
6
|
import"../../../chunk-4j3fsft3.js";
|
|
7
7
|
import"../../../chunk-er6e5fj8.js";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
RegenerateMenu2
|
|
3
|
-
} from "../../../chunk-
|
|
4
|
-
import"../../../chunk-
|
|
3
|
+
} from "../../../chunk-4r1fne02.js";
|
|
4
|
+
import"../../../chunk-w8hgwhgc.js";
|
|
5
5
|
import"../../../chunk-32t5kc0y.js";
|
|
6
6
|
import"../../../chunk-x90xmrba.js";
|
|
7
7
|
import"../../../chunk-jpvw9xqy.js";
|
|
@@ -86,11 +86,11 @@ import {
|
|
|
86
86
|
CodeRunner2
|
|
87
87
|
} from "../../chunk-r1qyx0ke.js";
|
|
88
88
|
import"../../chunk-t6gbcj27.js";
|
|
89
|
-
import"../../chunk-
|
|
89
|
+
import"../../chunk-j2tm6kjm.js";
|
|
90
90
|
import"../../chunk-7vnpp3ya.js";
|
|
91
91
|
import {
|
|
92
92
|
CommandPalette2
|
|
93
|
-
} from "../../chunk-
|
|
93
|
+
} from "../../chunk-w67bf59k.js";
|
|
94
94
|
import {
|
|
95
95
|
ComparisonCard2
|
|
96
96
|
} from "../../chunk-d93zpy8g.js";
|
|
@@ -387,34 +387,34 @@ import {
|
|
|
387
387
|
} from "../../chunk-gb16cwpw.js";
|
|
388
388
|
import {
|
|
389
389
|
ModelSelectorFocusAnchor2
|
|
390
|
-
} from "../../chunk-
|
|
390
|
+
} from "../../chunk-fnqdw884.js";
|
|
391
391
|
import {
|
|
392
392
|
ModelSelectorSearch2
|
|
393
|
-
} from "../../chunk-
|
|
393
|
+
} from "../../chunk-s8qhybtb.js";
|
|
394
394
|
import {
|
|
395
395
|
ModelSelectorEmpty2
|
|
396
|
-
} from "../../chunk-
|
|
396
|
+
} from "../../chunk-afegpa2s.js";
|
|
397
397
|
import {
|
|
398
398
|
ModelSelectorItem2
|
|
399
|
-
} from "../../chunk-
|
|
399
|
+
} from "../../chunk-tz7zjkw3.js";
|
|
400
400
|
import {
|
|
401
401
|
ModelSelectorList2
|
|
402
|
-
} from "../../chunk-
|
|
402
|
+
} from "../../chunk-6fj02yzp.js";
|
|
403
403
|
import {
|
|
404
404
|
ModelSelectorEffort2
|
|
405
405
|
} from "../../chunk-pzr1f2tz.js";
|
|
406
406
|
import {
|
|
407
407
|
ModelSelectorContent2
|
|
408
|
-
} from "../../chunk-
|
|
408
|
+
} from "../../chunk-mjxhvwgg.js";
|
|
409
409
|
import {
|
|
410
410
|
ModelSelector2
|
|
411
|
-
} from "../../chunk-
|
|
411
|
+
} from "../../chunk-hyhr09xy.js";
|
|
412
412
|
import {
|
|
413
413
|
ModelSelectorGroup2
|
|
414
|
-
} from "../../chunk-
|
|
414
|
+
} from "../../chunk-bdsdkjcq.js";
|
|
415
415
|
import {
|
|
416
416
|
ModelSelectorSeparator2
|
|
417
|
-
} from "../../chunk-
|
|
417
|
+
} from "../../chunk-fkxhe17e.js";
|
|
418
418
|
import {
|
|
419
419
|
NumberRoll2
|
|
420
420
|
} from "../../chunk-wtf2qczs.js";
|
|
@@ -481,10 +481,10 @@ import {
|
|
|
481
481
|
import {
|
|
482
482
|
RecommendationCard2
|
|
483
483
|
} from "../../chunk-nqgpzqmk.js";
|
|
484
|
-
import"../../chunk-
|
|
484
|
+
import"../../chunk-w8hgwhgc.js";
|
|
485
485
|
import {
|
|
486
486
|
RegenerateMenu2
|
|
487
|
-
} from "../../chunk-
|
|
487
|
+
} from "../../chunk-4r1fne02.js";
|
|
488
488
|
import {
|
|
489
489
|
ResearchReport2
|
|
490
490
|
} from "../../chunk-fdhssr0q.js";
|
|
@@ -1,23 +1,23 @@
|
|
|
1
1
|
import {
|
|
2
2
|
ModelSelector3
|
|
3
|
-
} from "../../../chunk-
|
|
3
|
+
} from "../../../chunk-wrm689qy.js";
|
|
4
4
|
import"../../../chunk-k2t9ey7z.js";
|
|
5
5
|
import"../../../chunk-gb16cwpw.js";
|
|
6
|
-
import"../../../chunk-
|
|
7
|
-
import"../../../chunk-
|
|
8
|
-
import"../../../chunk-
|
|
9
|
-
import"../../../chunk-
|
|
6
|
+
import"../../../chunk-bdsdkjcq.js";
|
|
7
|
+
import"../../../chunk-fkxhe17e.js";
|
|
8
|
+
import"../../../chunk-mjxhvwgg.js";
|
|
9
|
+
import"../../../chunk-6fj02yzp.js";
|
|
10
10
|
import"../../../chunk-pzr1f2tz.js";
|
|
11
|
-
import"../../../chunk-
|
|
12
|
-
import"../../../chunk-
|
|
13
|
-
import"../../../chunk-
|
|
14
|
-
import"../../../chunk-
|
|
11
|
+
import"../../../chunk-afegpa2s.js";
|
|
12
|
+
import"../../../chunk-fnqdw884.js";
|
|
13
|
+
import"../../../chunk-s8qhybtb.js";
|
|
14
|
+
import"../../../chunk-tz7zjkw3.js";
|
|
15
15
|
import"../../../chunk-0qkdp68h.js";
|
|
16
16
|
import"../../../chunk-ydfx8r6d.js";
|
|
17
17
|
import"../../../chunk-kp3jgjng.js";
|
|
18
18
|
import"../../../chunk-tcefvfr8.js";
|
|
19
19
|
import"../../../chunk-bf8kbj33.js";
|
|
20
|
-
import"../../../chunk-
|
|
20
|
+
import"../../../chunk-j2tm6kjm.js";
|
|
21
21
|
import"../../../chunk-t6gbcj27.js";
|
|
22
22
|
import"../../../chunk-4j3fsft3.js";
|
|
23
23
|
import"../../../chunk-er6e5fj8.js";
|
|
@@ -153,19 +153,19 @@ import"../../../chunk-k2t9ey7z.js";
|
|
|
153
153
|
import"../../../chunk-0qkdp68h.js";
|
|
154
154
|
import"../../../chunk-gb16cwpw.js";
|
|
155
155
|
import"../../../chunk-4j3fsft3.js";
|
|
156
|
-
import"../../../chunk-
|
|
157
|
-
import"../../../chunk-
|
|
158
|
-
import"../../../chunk-
|
|
159
|
-
import"../../../chunk-
|
|
160
|
-
import"../../../chunk-
|
|
161
|
-
import"../../../chunk-
|
|
156
|
+
import"../../../chunk-j2tm6kjm.js";
|
|
157
|
+
import"../../../chunk-fnqdw884.js";
|
|
158
|
+
import"../../../chunk-s8qhybtb.js";
|
|
159
|
+
import"../../../chunk-afegpa2s.js";
|
|
160
|
+
import"../../../chunk-tz7zjkw3.js";
|
|
161
|
+
import"../../../chunk-6fj02yzp.js";
|
|
162
162
|
import"../../../chunk-pzr1f2tz.js";
|
|
163
|
-
import"../../../chunk-
|
|
164
|
-
import"../../../chunk-
|
|
165
|
-
import"../../../chunk-
|
|
163
|
+
import"../../../chunk-mjxhvwgg.js";
|
|
164
|
+
import"../../../chunk-bdsdkjcq.js";
|
|
165
|
+
import"../../../chunk-fkxhe17e.js";
|
|
166
166
|
import {
|
|
167
167
|
ModelSelector3
|
|
168
|
-
} from "../../../chunk-
|
|
168
|
+
} from "../../../chunk-wrm689qy.js";
|
|
169
169
|
import {
|
|
170
170
|
QuoteBlockRoot2,
|
|
171
171
|
QuoteBlockIcon2,
|
|
@@ -25,7 +25,9 @@ type CommandItemProps = ComponentProps<typeof CommandPrimitive.Item> & IAnalytic
|
|
|
25
25
|
disabledReason?: string;
|
|
26
26
|
/** Runs instead of `onSelect` when Enter or a click selects an item with a disabled reason, to announce it. */
|
|
27
27
|
onDisabledSelect?: () => void;
|
|
28
|
+
/** Gives the item a minimum height of 44px when the primary pointer is coarse. */
|
|
29
|
+
touchTarget?: boolean;
|
|
28
30
|
};
|
|
29
|
-
declare function CommandItem({ analytics, className, children, disabledReason, onDisabledSelect, ref, ...props }: CommandItemProps): ReactElement;
|
|
31
|
+
declare function CommandItem({ analytics, className, children, disabledReason, onDisabledSelect, ref, touchTarget, ...props }: CommandItemProps): ReactElement;
|
|
30
32
|
declare function CommandShortcut({ className, ...props }: ComponentProps<"span">): ReactElement;
|
|
31
33
|
export { Command, CommandDialog, CommandInput, CommandList, CommandEmpty, CommandGroup, CommandItem, CommandSeparator, CommandShortcut, };
|
|
@@ -31,13 +31,13 @@ import {
|
|
|
31
31
|
DrawerHeader2,
|
|
32
32
|
DrawerTitle2,
|
|
33
33
|
DrawerDescription2
|
|
34
|
-
} from "../../chunk-
|
|
34
|
+
} from "../../chunk-kk558p5p.js";
|
|
35
35
|
import {
|
|
36
36
|
MenuPopup,
|
|
37
37
|
MenuItem2,
|
|
38
38
|
DropdownMenu2,
|
|
39
39
|
DropdownMenuTrigger2
|
|
40
|
-
} from "../../chunk-
|
|
40
|
+
} from "../../chunk-w8hgwhgc.js";
|
|
41
41
|
import {
|
|
42
42
|
Alert2,
|
|
43
43
|
AlertTitle2,
|
package/dist/index.d.ts
CHANGED
|
@@ -3,7 +3,8 @@ export { ButtonLink } from "./components/ButtonLink.js";
|
|
|
3
3
|
export { DropdownMenu, DropdownMenuPortal, DropdownMenuTrigger, DropdownMenuContent, DropdownMenuGroup, DropdownMenuLabel, DropdownMenuItem, DropdownMenuCheckboxItem, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubTrigger, DropdownMenuSubContent, } from "./components/DropdownMenu.js";
|
|
4
4
|
export { ActionsMenu, ActionsMenuTrigger, ActionsMenuContextTarget, ActionsMenuContextContent, } from "./components/ActionsMenu.js";
|
|
5
5
|
export type { IActionsMenuProps, ActionsMenuTriggerProps } from "./components/ActionsMenu.js";
|
|
6
|
-
export { MenuGroup, MenuLabel, MenuLinkItem, MenuItem, MenuCheckboxItem, MenuRadioGroup, MenuRadioItem, MenuSeparator, MenuShortcut, MenuSub, MenuSubTrigger, MenuSubContent, } from "./components/MenuParts.js";
|
|
6
|
+
export { MenuGroup, MenuLabel, MenuLinkItem, MenuItem, MenuCheckboxItem, MenuRadioGroup, MenuRadioItem, MenuSeparator, MenuShortcut, MenuSub, MenuSubTrigger, MenuSubContent, MenuFilterProvider, MenuInput, MenuList, MenuEmpty, } from "./components/MenuParts.js";
|
|
7
|
+
export type { MenuPoint, MenuPopupProps } from "./menu/types.js";
|
|
7
8
|
export { FormDialog } from "./components/FormDialog.js";
|
|
8
9
|
export { Accordion, AccordionItem, AccordionTrigger, AccordionContent } from "./components/Accordion.js";
|
|
9
10
|
export { Popover, PopoverContent, PopoverDescription, PopoverHeader, PopoverTitle, PopoverTrigger, } from "./components/Popover.js";
|
package/dist/index.js
CHANGED
|
@@ -174,7 +174,7 @@ import {
|
|
|
174
174
|
StatusTracker2,
|
|
175
175
|
DashboardLayout2,
|
|
176
176
|
BillingUsage2
|
|
177
|
-
} from "./chunk-
|
|
177
|
+
} from "./chunk-kk558p5p.js";
|
|
178
178
|
import {
|
|
179
179
|
Combobox2,
|
|
180
180
|
ComboboxValue2,
|
|
@@ -236,6 +236,10 @@ import {
|
|
|
236
236
|
MenuSub2,
|
|
237
237
|
MenuSubTrigger2,
|
|
238
238
|
MenuSubContent2,
|
|
239
|
+
MenuFilterProvider2,
|
|
240
|
+
MenuInput2,
|
|
241
|
+
MenuList2,
|
|
242
|
+
MenuEmpty2,
|
|
239
243
|
MenuCheckboxItem2,
|
|
240
244
|
MenuRadioGroup2,
|
|
241
245
|
MenuRadioItem2,
|
|
@@ -243,7 +247,7 @@ import {
|
|
|
243
247
|
MenuShortcut2,
|
|
244
248
|
DropdownMenu2,
|
|
245
249
|
DropdownMenuTrigger2
|
|
246
|
-
} from "./chunk-
|
|
250
|
+
} from "./chunk-w8hgwhgc.js";
|
|
247
251
|
import {
|
|
248
252
|
Empty2,
|
|
249
253
|
EmptyHeader2,
|
|
@@ -671,10 +675,14 @@ export {
|
|
|
671
675
|
MarkerContent2 as MarkerContent,
|
|
672
676
|
MarkerIcon2 as MarkerIcon,
|
|
673
677
|
MenuCheckboxItem2 as MenuCheckboxItem,
|
|
678
|
+
MenuEmpty2 as MenuEmpty,
|
|
679
|
+
MenuFilterProvider2 as MenuFilterProvider,
|
|
674
680
|
MenuGroup2 as MenuGroup,
|
|
681
|
+
MenuInput2 as MenuInput,
|
|
675
682
|
MenuItem2 as MenuItem,
|
|
676
683
|
MenuLabel2 as MenuLabel,
|
|
677
684
|
MenuLinkItem2 as MenuLinkItem,
|
|
685
|
+
MenuList2 as MenuList,
|
|
678
686
|
MenuRadioGroup2 as MenuRadioGroup,
|
|
679
687
|
MenuRadioItem2 as MenuRadioItem,
|
|
680
688
|
MenuSeparator2 as MenuSeparator,
|
package/dist/menu/types.d.ts
CHANGED
|
@@ -21,7 +21,15 @@ export type MenuItemProps = Menu.Item.Props & IMenuItemOptions;
|
|
|
21
21
|
export type MenuSubTriggerProps = Menu.SubmenuTrigger.Props & IMenuInsetProps;
|
|
22
22
|
export type MenuCheckboxItemProps = Menu.CheckboxItem.Props & IMenuInsetProps;
|
|
23
23
|
export type MenuRadioItemProps = Menu.RadioItem.Props & IMenuInsetProps;
|
|
24
|
+
/** A viewport point in CSS pixels, such as the right-click event that asked for a menu. */
|
|
25
|
+
export type MenuPoint = Pick<MouseEvent, "clientX" | "clientY">;
|
|
24
26
|
export type MenuPopupProps = Menu.Popup.Props & Pick<Menu.Positioner.Props, "align" | "alignOffset" | "side" | "sideOffset"> & IDensityProps & {
|
|
25
27
|
width?: "content" | "anchor";
|
|
28
|
+
/**
|
|
29
|
+
* Opens the menu at this viewport point instead of at its trigger, as a context menu opens at the pointer. The
|
|
30
|
+
* menu's top start corner sits on the point; where the menu does not fit, it flips to the side with room and then
|
|
31
|
+
* shifts until it lies wholly inside the viewport. `side`, `align` and their offsets are ignored.
|
|
32
|
+
*/
|
|
33
|
+
point?: MenuPoint;
|
|
26
34
|
};
|
|
27
35
|
export {};
|
package/dist/prototype.js
CHANGED
|
@@ -2051,7 +2051,7 @@ var program = new Command;
|
|
|
2051
2051
|
// package.json
|
|
2052
2052
|
var package_default = {
|
|
2053
2053
|
name: "@alexgorbatchev/shadcn",
|
|
2054
|
-
version: "0.0.
|
|
2054
|
+
version: "0.0.84",
|
|
2055
2055
|
description: "Sharp, monospace React components with compact and comfortable densities.",
|
|
2056
2056
|
license: "MIT",
|
|
2057
2057
|
repository: {
|
|
@@ -43,7 +43,7 @@ function Render(args) {
|
|
|
43
43
|
<CommandList label="Commands">
|
|
44
44
|
<CommandEmpty>No results found.</CommandEmpty>
|
|
45
45
|
<CommandGroup heading="Workspace">
|
|
46
|
-
<CommandItem value="new-file" keywords={["create"]} onSelect={setAction}>
|
|
46
|
+
<CommandItem value="new-file" keywords={["create"]} onSelect={setAction} touchTarget>
|
|
47
47
|
New file<CommandShortcut>Ctrl+N</CommandShortcut>
|
|
48
48
|
</CommandItem>
|
|
49
49
|
<CommandItem value="delete" disabled>
|
|
@@ -8,7 +8,7 @@ Source: src/components/stories/navigation/DropdownMenu.stories.tsx
|
|
|
8
8
|
## Public imports
|
|
9
9
|
|
|
10
10
|
```tsx
|
|
11
|
-
import { DropdownMenu, DropdownMenuTrigger, DropdownMenuContent, DropdownMenuGroup, DropdownMenuLabel, DropdownMenuItem, DropdownMenuCheckboxItem, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubTrigger, DropdownMenuSubContent, Button, DirectionProvider, Avatar, AvatarImage, AvatarFallback } from "@alexgorbatchev/shadcn";
|
|
11
|
+
import { DropdownMenu, DropdownMenuTrigger, DropdownMenuContent, DropdownMenuGroup, DropdownMenuLabel, DropdownMenuItem, DropdownMenuCheckboxItem, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubTrigger, DropdownMenuSubContent, MenuEmpty, MenuFilterProvider, MenuInput, MenuList, type MenuPoint, Button, DirectionProvider, Avatar, AvatarImage, AvatarFallback } from "@alexgorbatchev/shadcn";
|
|
12
12
|
```
|
|
13
13
|
|
|
14
14
|
## Supporting imports
|
|
@@ -631,3 +631,58 @@ Storybook CSF excerpts. Default args and render apply unless overridden. Local h
|
|
|
631
631
|
}
|
|
632
632
|
}
|
|
633
633
|
```
|
|
634
|
+
|
|
635
|
+
### AtPoint
|
|
636
|
+
|
|
637
|
+
```tsx
|
|
638
|
+
{
|
|
639
|
+
render: function Render() {
|
|
640
|
+
const [point, setPoint] = useState<MenuPoint>();
|
|
641
|
+
const [row, setRow] = useState<string>();
|
|
642
|
+
return (<div className="flex flex-col gap-1">
|
|
643
|
+
{["Alpha", "Bravo", "Charlie"].map((name) => (<div key={name} role="button" tabIndex={0} className="rounded-sm border border-border px-2 py-1" onContextMenu={(event) => {
|
|
644
|
+
event.preventDefault();
|
|
645
|
+
setRow(name);
|
|
646
|
+
setPoint({ clientX: event.clientX, clientY: event.clientY });
|
|
647
|
+
}}>
|
|
648
|
+
{name}
|
|
649
|
+
</div>))}
|
|
650
|
+
<DropdownMenu open={point !== undefined} onOpenChange={(isOpen) => !isOpen && setPoint(undefined)}>
|
|
651
|
+
<DropdownMenuContent point={point} aria-label={`Actions for ${row ?? "row"}`}>
|
|
652
|
+
<DropdownMenuGroup>
|
|
653
|
+
<DropdownMenuLabel>{row}</DropdownMenuLabel>
|
|
654
|
+
<DropdownMenuItem>Open</DropdownMenuItem>
|
|
655
|
+
<DropdownMenuItem>Rename</DropdownMenuItem>
|
|
656
|
+
</DropdownMenuGroup>
|
|
657
|
+
</DropdownMenuContent>
|
|
658
|
+
</DropdownMenu>
|
|
659
|
+
</div>);
|
|
660
|
+
}
|
|
661
|
+
}
|
|
662
|
+
```
|
|
663
|
+
|
|
664
|
+
### FilterableSubmenu
|
|
665
|
+
|
|
666
|
+
```tsx
|
|
667
|
+
{
|
|
668
|
+
render: () => (<DropdownMenu>
|
|
669
|
+
<DropdownMenuTrigger render={<Button variant="outline"/>}>Track actions</DropdownMenuTrigger>
|
|
670
|
+
<DropdownMenuContent>
|
|
671
|
+
<DropdownMenuGroup>
|
|
672
|
+
<MenuFilterProvider>
|
|
673
|
+
<DropdownMenuSub>
|
|
674
|
+
<DropdownMenuSubTrigger>Add to playlist</DropdownMenuSubTrigger>
|
|
675
|
+
<DropdownMenuSubContent aria-label="Add to playlist">
|
|
676
|
+
<MenuInput aria-label="Filter playlists" placeholder="Filter playlists"/>
|
|
677
|
+
<MenuList>
|
|
678
|
+
{PLAYLISTS.map((playlist) => (<DropdownMenuItem key={playlist}>{playlist}</DropdownMenuItem>))}
|
|
679
|
+
</MenuList>
|
|
680
|
+
<MenuEmpty>No playlists match</MenuEmpty>
|
|
681
|
+
</DropdownMenuSubContent>
|
|
682
|
+
</DropdownMenuSub>
|
|
683
|
+
</MenuFilterProvider>
|
|
684
|
+
</DropdownMenuGroup>
|
|
685
|
+
</DropdownMenuContent>
|
|
686
|
+
</DropdownMenu>)
|
|
687
|
+
}
|
|
688
|
+
```
|
package/llms/setup.md
CHANGED
|
@@ -452,6 +452,10 @@ Keep preferred widths separate from the table's rendered sizing atom. In `onFitW
|
|
|
452
452
|
|
|
453
453
|
`ActionsMenu` shares one `items` definition between a dropdown action and an optional context menu. Supply an accessible `label`; the default trigger is a ghost icon button. `size="sm"` displays the label, and `variant`, `disabled`, and `trigger` customize the action. Supplying `contextTarget` composes the native context trigger with that element and adds its popup. Compose items with `MenuItem`, `MenuLinkItem`, checkbox/radio parts, groups, labels, separators, shortcuts, and submenu parts; dropdown and context menus share these implementations. `MenuLinkItem` retains its native anchor and menu keyboard semantics.
|
|
454
454
|
|
|
455
|
+
Menus never scroll. `DropdownMenuContent`, `ContextMenuContent`, and submenu content carry `data-scroll="none"`, so the development `ScrollGuard` reports a menu whose content outgrows the viewport; shorten it, for example by grouping items under submenus, instead of letting it scroll. A list longer than a menu should show belongs in a filterable menu: wrap the menu or submenu root in `MenuFilterProvider`, put `MenuInput` at the top of its content, its items in `MenuList`, and an optional `MenuEmpty` message after them. Typing narrows the items while the arrow keys keep moving among them. Pass `filter={null}` with a controlled `value` and `onValueChange` to render the matching items yourself, for example only as many as fit.
|
|
456
|
+
|
|
457
|
+
One menu instance can serve a whole list: open it through a `DropdownMenu` `handle` with each row's payload, and pass `point={{ clientX: event.clientX, clientY: event.clientY }}` to `DropdownMenuContent` when a right-click opened it, so it opens at the pointer instead of at the row's trigger. At a point the menu's top start corner sits on the pointer; near the viewport's edges it flips to the side with room and then shifts until it lies wholly inside the viewport. Leave `point` unset for keyboard and trigger opens, which anchor to their trigger.
|
|
458
|
+
|
|
455
459
|
For nested layouts, compose `ActionsMenuTrigger`, `ActionsMenuContextTarget`, and `ActionsMenuContextContent` explicitly inside `ActionsMenu`. The dropdown trigger owns its local native dropdown root and popup; the context target and content share an independent context root. A tree row can use `TreeItem render={<ActionsMenuContextTarget />}` and put the trigger in its action slot. For a table row, render the context target as the actual `tr`, then place the dropdown trigger and context content inside a `td`: native popup portals insert focus guards at their declaration, which must remain valid table children.
|
|
456
460
|
|
|
457
461
|
`TreeItem linkProps` places the registered tree item, roving focus, and native drag handlers on an anchor. Pass `href` and anchor events directly, or compose a router link through `linkProps.render`. The outer `render` and `ref` remain available for row overlays; disclosure and `endEnhancer` controls remain siblings of the link. Enter and modified clicks retain native link behavior, while tree arrows retain navigation and expansion behavior. Optional `dropHint={{ content, open, side }}` displays caller-controlled drag feedback without adding a focus target. `isDimmed` fades a settled row, such as completed work, to 70% opacity and exposes `data-dimmed`; hovering or focusing anything in the row restores full opacity, and the row stays interactive.
|