@alexgorbatchev/shadcn 0.0.72 → 0.0.73

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (39) hide show
  1. package/dist/{chunk-8sktrf74.js → chunk-074ehhx1.js} +1 -1
  2. package/dist/{chunk-0bwg27nq.js → chunk-336c0c3z.js} +3 -3
  3. package/dist/{chunk-3qrvksfh.js → chunk-78ntbpa4.js} +1 -1
  4. package/dist/{chunk-16qrkr8k.js → chunk-8t11333k.js} +1 -1
  5. package/dist/{chunk-6pj5fxa2.js → chunk-bshdrjwh.js} +8 -8
  6. package/dist/{chunk-3b15harp.js → chunk-da67wbm4.js} +1 -1
  7. package/dist/{chunk-qff5s98n.js → chunk-ga3h6738.js} +1 -1
  8. package/dist/{chunk-fjw7yyt3.js → chunk-jrf138sy.js} +1 -1
  9. package/dist/{chunk-vqgw4xab.js → chunk-q3jmy8bv.js} +4 -4
  10. package/dist/{chunk-pr5s27j8.js → chunk-st134dvp.js} +1 -1
  11. package/dist/{chunk-5bq2j907.js → chunk-v0bv70xv.js} +119 -3
  12. package/dist/{chunk-zthc8ajd.js → chunk-wh8gdhc7.js} +1 -1
  13. package/dist/{chunk-xywttk96.js → chunk-yxwtpq9d.js} +1 -1
  14. package/dist/{chunk-10vjajh7.js → chunk-yywr1jgk.js} +19 -3
  15. package/dist/{chunk-d1z748rn.js → chunk-zz072pjn.js} +1 -1
  16. package/dist/components/MenuParts.d.ts +2 -2
  17. package/dist/components/assistant-ui/elements/CommandPalette.js +2 -2
  18. package/dist/components/assistant-ui/elements/ModelSelector.js +8 -8
  19. package/dist/components/assistant-ui/elements/ModelSelectorContent.js +7 -7
  20. package/dist/components/assistant-ui/elements/ModelSelectorEmpty.js +2 -2
  21. package/dist/components/assistant-ui/elements/ModelSelectorFocusAnchor.js +2 -2
  22. package/dist/components/assistant-ui/elements/ModelSelectorGroup.js +2 -2
  23. package/dist/components/assistant-ui/elements/ModelSelectorItem.js +2 -2
  24. package/dist/components/assistant-ui/elements/ModelSelectorList.js +4 -4
  25. package/dist/components/assistant-ui/elements/ModelSelectorSearch.js +2 -2
  26. package/dist/components/assistant-ui/elements/ModelSelectorSeparator.js +2 -2
  27. package/dist/components/assistant-ui/elements/RegenerateMenu.js +2 -2
  28. package/dist/components/assistant-ui/index.js +13 -13
  29. package/dist/components/assistant-ui/native/ModelSelector.js +10 -10
  30. package/dist/components/assistant-ui/native/index.js +10 -10
  31. package/dist/components/command/Command.d.ts +12 -3
  32. package/dist/components/command/index.js +1 -1
  33. package/dist/components/json-render/index.js +2 -2
  34. package/dist/index.js +2 -2
  35. package/dist/menu/types.d.ts +5 -0
  36. package/dist/prototype.js +1 -1
  37. package/llms/components/navigation/Command.md +72 -0
  38. package/llms/components/navigation/DropdownMenu.md +29 -0
  39. package/package.json +1 -1
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  CommandItem2
3
- } from "./chunk-5bq2j907.js";
3
+ } from "./chunk-v0bv70xv.js";
4
4
  import {
5
5
  useModelSelectorContext
6
6
  } from "./chunk-ydfx8r6d.js";
@@ -1,16 +1,16 @@
1
1
  import {
2
2
  CommandList2,
3
3
  CommandGroup2
4
- } from "./chunk-5bq2j907.js";
4
+ } from "./chunk-v0bv70xv.js";
5
5
  import {
6
6
  useModelSelectorContext
7
7
  } from "./chunk-ydfx8r6d.js";
8
8
  import {
9
9
  ModelSelectorEmpty2
10
- } from "./chunk-zthc8ajd.js";
10
+ } from "./chunk-wh8gdhc7.js";
11
11
  import {
12
12
  ModelSelectorItem2
13
- } from "./chunk-8sktrf74.js";
13
+ } from "./chunk-074ehhx1.js";
14
14
 
15
15
  // src/components/assistant-ui/elements/ModelSelectorList.tsx
16
16
  import { jsx, jsxs, Fragment } from "react/jsx-runtime";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  CommandSeparator2
3
- } from "./chunk-5bq2j907.js";
3
+ } from "./chunk-v0bv70xv.js";
4
4
 
5
5
  // src/components/assistant-ui/elements/ModelSelectorSeparator.tsx
6
6
  import { jsx } from "react/jsx-runtime";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  CommandInput2
3
- } from "./chunk-5bq2j907.js";
3
+ } from "./chunk-v0bv70xv.js";
4
4
 
5
5
  // src/components/assistant-ui/elements/ModelSelectorSearch.tsx
6
6
  import { jsx } from "react/jsx-runtime";
@@ -12,31 +12,31 @@ import {
12
12
  } from "./chunk-gb16cwpw.js";
13
13
  import {
14
14
  ModelSelectorFocusAnchor2
15
- } from "./chunk-3b15harp.js";
15
+ } from "./chunk-da67wbm4.js";
16
16
  import {
17
17
  ModelSelectorSearch2
18
- } from "./chunk-16qrkr8k.js";
18
+ } from "./chunk-8t11333k.js";
19
19
  import {
20
20
  ModelSelectorEmpty2
21
- } from "./chunk-zthc8ajd.js";
21
+ } from "./chunk-wh8gdhc7.js";
22
22
  import {
23
23
  ModelSelectorItem2
24
- } from "./chunk-8sktrf74.js";
24
+ } from "./chunk-074ehhx1.js";
25
25
  import {
26
26
  ModelSelectorList2
27
- } from "./chunk-0bwg27nq.js";
27
+ } from "./chunk-336c0c3z.js";
28
28
  import {
29
29
  ModelSelectorEffort2
30
30
  } from "./chunk-pzr1f2tz.js";
31
31
  import {
32
32
  ModelSelectorContent2
33
- } from "./chunk-vqgw4xab.js";
33
+ } from "./chunk-q3jmy8bv.js";
34
34
  import {
35
35
  ModelSelectorGroup2
36
- } from "./chunk-d1z748rn.js";
36
+ } from "./chunk-zz072pjn.js";
37
37
  import {
38
38
  ModelSelectorSeparator2
39
- } from "./chunk-3qrvksfh.js";
39
+ } from "./chunk-78ntbpa4.js";
40
40
 
41
41
  // src/components/assistant-ui/native/ModelSelector.tsx
42
42
  import { memo, useEffect } from "react";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  CommandInput2
3
- } from "./chunk-5bq2j907.js";
3
+ } from "./chunk-v0bv70xv.js";
4
4
 
5
5
  // src/components/assistant-ui/elements/ModelSelectorFocusAnchor.tsx
6
6
  import { jsx } from "react/jsx-runtime";
@@ -6,7 +6,7 @@ import {
6
6
  } from "./chunk-gb16cwpw.js";
7
7
  import {
8
8
  ModelSelectorContent2
9
- } from "./chunk-vqgw4xab.js";
9
+ } from "./chunk-q3jmy8bv.js";
10
10
 
11
11
  // src/components/assistant-ui/elements/ModelSelector.tsx
12
12
  import { jsx, jsxs } from "react/jsx-runtime";
@@ -9,7 +9,7 @@ import {
9
9
  MenuItem2,
10
10
  DropdownMenu2,
11
11
  DropdownMenuTrigger2
12
- } from "./chunk-10vjajh7.js";
12
+ } from "./chunk-yywr1jgk.js";
13
13
  import {
14
14
  mono
15
15
  } from "./chunk-fgmcbtyt.js";
@@ -4,19 +4,19 @@ import {
4
4
  } from "./chunk-bf8kbj33.js";
5
5
  import {
6
6
  Command2
7
- } from "./chunk-5bq2j907.js";
7
+ } from "./chunk-v0bv70xv.js";
8
8
  import {
9
9
  useModelSelectorContext
10
10
  } from "./chunk-ydfx8r6d.js";
11
11
  import {
12
12
  ModelSelectorFocusAnchor2
13
- } from "./chunk-3b15harp.js";
13
+ } from "./chunk-da67wbm4.js";
14
14
  import {
15
15
  ModelSelectorSearch2
16
- } from "./chunk-16qrkr8k.js";
16
+ } from "./chunk-8t11333k.js";
17
17
  import {
18
18
  ModelSelectorList2
19
- } from "./chunk-0bwg27nq.js";
19
+ } from "./chunk-336c0c3z.js";
20
20
  import {
21
21
  ModelSelectorEffort2
22
22
  } from "./chunk-pzr1f2tz.js";
@@ -38,7 +38,7 @@ import {
38
38
  MenuShortcut2,
39
39
  DropdownMenu2,
40
40
  DropdownMenuTrigger2
41
- } from "./chunk-10vjajh7.js";
41
+ } from "./chunk-yywr1jgk.js";
42
42
  import {
43
43
  Alert2,
44
44
  AlertTitle2,
@@ -18,15 +18,102 @@ import {
18
18
  } from "./chunk-5mydsjp3.js";
19
19
 
20
20
  // src/components/command/Command.tsx
21
+ import {
22
+ useEffect,
23
+ useId,
24
+ useLayoutEffect,
25
+ useRef,
26
+ useState
27
+ } from "react";
21
28
  import { Command as CommandPrimitive } from "cmdk";
22
29
  import { CheckIcon, SearchIcon } from "lucide-react";
30
+ import { useMergedRefs } from "@base-ui/utils/useMergedRefs";
23
31
  import { jsx, jsxs } from "react/jsx-runtime";
24
- function Command2({ density, className, ...props }) {
32
+ var DISABLED_SELECT = "command-item-disabled-select";
33
+ var ITEM = '[cmdk-item=""]';
34
+ var STEPS = { ArrowDown: 1, ArrowUp: -1 };
35
+ function hasModifier(event) {
36
+ return event.altKey || event.ctrlKey || event.metaKey || event.shiftKey;
37
+ }
38
+ function moveThroughReasons(event, loop, select) {
39
+ if (hasModifier(event) || event.nativeEvent.isComposing)
40
+ return;
41
+ const items = [...event.currentTarget.querySelectorAll(ITEM)].filter((item) => item.getAttribute("aria-disabled") !== "true" || item.hasAttribute("data-disabled-reason"));
42
+ if (!items.some((item) => item.hasAttribute("data-disabled-reason")))
43
+ return;
44
+ const current = items.findIndex((item) => item.getAttribute("aria-selected") === "true");
45
+ if (event.key === "Enter") {
46
+ const item = items[current];
47
+ if (!item?.hasAttribute("data-disabled-reason"))
48
+ return;
49
+ event.preventDefault();
50
+ item.dispatchEvent(new Event(DISABLED_SELECT));
51
+ return;
52
+ }
53
+ const step = STEPS[event.key];
54
+ const last = items.length - 1;
55
+ let next;
56
+ if (event.key === "Home")
57
+ next = 0;
58
+ else if (event.key === "End")
59
+ next = last;
60
+ else if (step === undefined)
61
+ return;
62
+ else if (current < 0)
63
+ next = step > 0 ? 0 : last;
64
+ else if (loop)
65
+ next = (current + step + items.length) % items.length;
66
+ else
67
+ next = Math.min(Math.max(current + step, 0), last);
68
+ const target = items[next];
69
+ if (!target)
70
+ return;
71
+ event.preventDefault();
72
+ select(target.getAttribute("data-value") ?? "");
73
+ }
74
+ function revealSelected(root, value) {
75
+ const item = value ? root?.querySelector(`${ITEM}[data-value="${CSS.escape(value)}"]`) : null;
76
+ if (!item)
77
+ return;
78
+ if (item.parentElement?.firstChild === item)
79
+ item.closest('[cmdk-group=""]')?.querySelector('[cmdk-group-heading=""]')?.scrollIntoView({ block: "nearest" });
80
+ item.scrollIntoView({ block: "nearest" });
81
+ }
82
+ function Command2({
83
+ density,
84
+ className,
85
+ value: valueProp,
86
+ defaultValue = "",
87
+ onValueChange,
88
+ onKeyDown,
89
+ loop = false,
90
+ ref,
91
+ ...props
92
+ }) {
93
+ const [ownValue, setOwnValue] = useState(defaultValue);
94
+ const value = valueProp ?? ownValue;
95
+ const root = useRef(null);
96
+ const mergedRef = useMergedRefs(ref, root);
97
+ useLayoutEffect(() => revealSelected(root.current, value), [value]);
98
+ const select = (next) => {
99
+ if (valueProp === undefined)
100
+ setOwnValue(next);
101
+ onValueChange?.(next);
102
+ };
25
103
  return /* @__PURE__ */ jsx(CommandPrimitive, {
104
+ ref: mergedRef,
26
105
  "data-density": density,
27
106
  "data-slot": "command",
28
107
  className: cn2("flex size-full flex-col overflow-hidden bg-popover p-1 text-popover-foreground", className),
29
- ...props
108
+ ...props,
109
+ loop,
110
+ value,
111
+ onValueChange: select,
112
+ onKeyDown: (event) => {
113
+ onKeyDown?.(event);
114
+ if (!event.defaultPrevented)
115
+ moveThroughReasons(event, loop, select);
116
+ }
30
117
  });
31
118
  }
32
119
  function CommandDialog2({
@@ -115,19 +202,48 @@ function CommandItem2({
115
202
  analytics,
116
203
  className,
117
204
  children,
205
+ disabledReason,
206
+ onDisabledSelect,
207
+ ref,
118
208
  ...props
119
209
  }) {
120
210
  const trackedOnSelect = useAnalyticsCallback("CommandItem", analytics, { name: "ui.activate" }, props.onSelect);
211
+ const reasonId = useId();
212
+ const item = useRef(null);
213
+ const mergedRef = useMergedRefs(ref, item);
214
+ const disabledSelect = useRef(onDisabledSelect);
215
+ useEffect(() => {
216
+ disabledSelect.current = onDisabledSelect;
217
+ });
218
+ useEffect(() => {
219
+ const element = item.current;
220
+ if (!element || !disabledReason)
221
+ return;
222
+ const select = () => disabledSelect.current?.();
223
+ element.addEventListener(DISABLED_SELECT, select);
224
+ return () => element.removeEventListener(DISABLED_SELECT, select);
225
+ }, [disabledReason]);
121
226
  return /* @__PURE__ */ jsxs(CommandPrimitive.Item, {
227
+ ref: mergedRef,
122
228
  "data-slot": "command-item",
123
- 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 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg]:size-4", className),
229
+ "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),
124
231
  ...props,
232
+ disabled: Boolean(disabledReason) || props.disabled,
233
+ "aria-describedby": [props["aria-describedby"], disabledReason ? reasonId : undefined].filter(Boolean).join(" ") || undefined,
234
+ onClickCapture: disabledReason ? () => onDisabledSelect?.() : props.onClickCapture,
125
235
  onSelect: trackedOnSelect,
126
236
  children: [
127
237
  children,
128
238
  /* @__PURE__ */ jsx(CheckIcon, {
129
239
  "aria-hidden": "true",
130
240
  className: "ms-auto opacity-0 group-has-data-[slot=command-shortcut]/command-item:hidden group-data-[checked=true]/command-item:opacity-100"
241
+ }),
242
+ disabledReason && /* @__PURE__ */ jsx("span", {
243
+ id: reasonId,
244
+ "data-slot": "command-item-reason",
245
+ className: "basis-full text-xs text-muted-foreground",
246
+ children: disabledReason
131
247
  })
132
248
  ]
133
249
  });
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  CommandEmpty2
3
- } from "./chunk-5bq2j907.js";
3
+ } from "./chunk-v0bv70xv.js";
4
4
 
5
5
  // src/components/assistant-ui/elements/ModelSelectorEmpty.tsx
6
6
  import { jsx } from "react/jsx-runtime";
@@ -6,7 +6,7 @@ import {
6
6
  CommandGroup2,
7
7
  CommandItem2,
8
8
  CommandShortcut2
9
- } from "./chunk-5bq2j907.js";
9
+ } from "./chunk-v0bv70xv.js";
10
10
  import {
11
11
  Kbd2
12
12
  } from "./chunk-7vnpp3ya.js";
@@ -66,11 +66,12 @@ function MenuPopup({
66
66
  }
67
67
 
68
68
  // src/components/MenuParts.tsx
69
+ import { useId } from "react";
69
70
  import { Menu as MenuPrimitive2 } from "@base-ui/react/menu";
70
71
  import { ChevronRightIcon, CheckIcon } from "lucide-react";
71
72
  import { jsx as jsx2, jsxs } from "react/jsx-runtime";
72
73
  "use client";
73
- var menuItemClassName = "group/menu-item relative flex cursor-default items-center gap-control-gap rounded-md px-1.5 py-1 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground data-inset:ps-7 data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 data-[variant=destructive]:focus:text-destructive data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 data-[variant=destructive]:*:[svg]:text-destructive";
74
+ var menuItemClassName = "group/menu-item relative flex cursor-default items-center data-has-reason:flex-wrap data-has-reason:data-disabled:opacity-100 data-has-reason:data-disabled:text-muted-foreground gap-control-gap rounded-md px-1.5 py-1 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground data-inset:ps-7 data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 data-[variant=destructive]:focus:text-destructive data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 data-[variant=destructive]:*:[svg]:text-destructive";
74
75
  function MenuGroup2({ ...props }) {
75
76
  return /* @__PURE__ */ jsx2(MenuPrimitive2.Group, {
76
77
  "data-slot": "menu-group",
@@ -92,17 +93,32 @@ function MenuItem2({
92
93
  className,
93
94
  inset,
94
95
  variant = "default",
96
+ disabledReason,
97
+ children,
95
98
  ...props
96
99
  }) {
97
100
  const trackedOnClick = useAnalyticsCallback("MenuItem", analytics, { name: "ui.activate" }, props.onClick);
98
- return /* @__PURE__ */ jsx2(MenuPrimitive2.Item, {
101
+ const reasonId = useId();
102
+ return /* @__PURE__ */ jsxs(MenuPrimitive2.Item, {
99
103
  "data-density": density,
100
104
  "data-slot": "menu-item",
101
105
  "data-inset": inset,
102
106
  "data-variant": variant,
107
+ "data-has-reason": disabledReason ? "" : undefined,
103
108
  className: (state) => cn2(menuItemClassName, typeof className === "function" ? className(state) : className),
104
109
  ...props,
105
- onClick: trackedOnClick
110
+ disabled: Boolean(disabledReason) || props.disabled,
111
+ "aria-describedby": [props["aria-describedby"], disabledReason ? reasonId : undefined].filter(Boolean).join(" ") || undefined,
112
+ onClick: trackedOnClick,
113
+ children: [
114
+ children,
115
+ disabledReason && /* @__PURE__ */ jsx2("span", {
116
+ id: reasonId,
117
+ "data-slot": "menu-item-reason",
118
+ className: "basis-full text-xs text-muted-foreground group-has-[>svg]/menu-item:ps-6",
119
+ children: disabledReason
120
+ })
121
+ ]
106
122
  });
107
123
  }
108
124
  function MenuLinkItem2({
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  CommandGroup2
3
- } from "./chunk-5bq2j907.js";
3
+ } from "./chunk-v0bv70xv.js";
4
4
 
5
5
  // src/components/assistant-ui/elements/ModelSelectorGroup.tsx
6
6
  import { jsx } from "react/jsx-runtime";
@@ -1,11 +1,11 @@
1
1
  import type { IAnalyticsProps } from "../analytics/types.js";
2
2
  import type { MenuLabelProps, MenuItemProps, MenuSubTriggerProps, MenuCheckboxItemProps, MenuRadioItemProps, MenuPopupProps } from "../menu/types.js";
3
3
  import type { IDensityProps } from "../density/types.js";
4
- import type { ComponentProps, ReactElement } from "react";
4
+ import { type ComponentProps, type ReactElement } from "react";
5
5
  import { Menu as MenuPrimitive } from "@base-ui/react/menu";
6
6
  declare function MenuGroup({ ...props }: MenuPrimitive.Group.Props): ReactElement;
7
7
  declare function MenuLabel({ density, className, inset, ...props }: MenuLabelProps): ReactElement;
8
- declare function MenuItem({ analytics, density, className, inset, variant, ...props }: MenuItemProps & IAnalyticsProps): ReactElement;
8
+ declare function MenuItem({ analytics, density, className, inset, variant, disabledReason, children, ...props }: MenuItemProps & IAnalyticsProps): ReactElement;
9
9
  type MenuLinkItemProps = MenuPrimitive.LinkItem.Props & IDensityProps & IAnalyticsProps & {
10
10
  inset?: boolean;
11
11
  variant?: "default" | "destructive";
@@ -1,8 +1,8 @@
1
1
  import {
2
2
  CommandPalette2
3
- } from "../../../chunk-xywttk96.js";
3
+ } from "../../../chunk-yxwtpq9d.js";
4
4
  import"../../../chunk-7vnpp3ya.js";
5
- import"../../../chunk-5bq2j907.js";
5
+ import"../../../chunk-v0bv70xv.js";
6
6
  import"../../../chunk-4t23yhc0.js";
7
7
  import"../../../chunk-rxjxb4vy.js";
8
8
  import"../../../chunk-er6e5fj8.js";
@@ -1,21 +1,21 @@
1
1
  import {
2
2
  ModelSelector2
3
- } from "../../../chunk-qff5s98n.js";
3
+ } from "../../../chunk-ga3h6738.js";
4
4
  import"../../../chunk-k2t9ey7z.js";
5
5
  import"../../../chunk-gb16cwpw.js";
6
- import"../../../chunk-vqgw4xab.js";
7
- import"../../../chunk-0bwg27nq.js";
6
+ import"../../../chunk-q3jmy8bv.js";
7
+ import"../../../chunk-336c0c3z.js";
8
8
  import"../../../chunk-pzr1f2tz.js";
9
- import"../../../chunk-zthc8ajd.js";
10
- import"../../../chunk-3b15harp.js";
11
- import"../../../chunk-16qrkr8k.js";
12
- import"../../../chunk-8sktrf74.js";
9
+ import"../../../chunk-wh8gdhc7.js";
10
+ import"../../../chunk-da67wbm4.js";
11
+ import"../../../chunk-8t11333k.js";
12
+ import"../../../chunk-074ehhx1.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-5bq2j907.js";
18
+ import"../../../chunk-v0bv70xv.js";
19
19
  import"../../../chunk-4t23yhc0.js";
20
20
  import"../../../chunk-rxjxb4vy.js";
21
21
  import"../../../chunk-er6e5fj8.js";
@@ -1,17 +1,17 @@
1
1
  import {
2
2
  ModelSelectorContent2
3
- } from "../../../chunk-vqgw4xab.js";
4
- import"../../../chunk-0bwg27nq.js";
3
+ } from "../../../chunk-q3jmy8bv.js";
4
+ import"../../../chunk-336c0c3z.js";
5
5
  import"../../../chunk-pzr1f2tz.js";
6
- import"../../../chunk-zthc8ajd.js";
7
- import"../../../chunk-3b15harp.js";
8
- import"../../../chunk-16qrkr8k.js";
9
- import"../../../chunk-8sktrf74.js";
6
+ import"../../../chunk-wh8gdhc7.js";
7
+ import"../../../chunk-da67wbm4.js";
8
+ import"../../../chunk-8t11333k.js";
9
+ import"../../../chunk-074ehhx1.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-5bq2j907.js";
14
+ import"../../../chunk-v0bv70xv.js";
15
15
  import"../../../chunk-4t23yhc0.js";
16
16
  import"../../../chunk-rxjxb4vy.js";
17
17
  import"../../../chunk-er6e5fj8.js";
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  ModelSelectorEmpty2
3
- } from "../../../chunk-zthc8ajd.js";
4
- import"../../../chunk-5bq2j907.js";
3
+ } from "../../../chunk-wh8gdhc7.js";
4
+ import"../../../chunk-v0bv70xv.js";
5
5
  import"../../../chunk-4t23yhc0.js";
6
6
  import"../../../chunk-rxjxb4vy.js";
7
7
  import"../../../chunk-er6e5fj8.js";
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  ModelSelectorFocusAnchor2
3
- } from "../../../chunk-3b15harp.js";
4
- import"../../../chunk-5bq2j907.js";
3
+ } from "../../../chunk-da67wbm4.js";
4
+ import"../../../chunk-v0bv70xv.js";
5
5
  import"../../../chunk-4t23yhc0.js";
6
6
  import"../../../chunk-rxjxb4vy.js";
7
7
  import"../../../chunk-er6e5fj8.js";
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  ModelSelectorGroup2
3
- } from "../../../chunk-d1z748rn.js";
4
- import"../../../chunk-5bq2j907.js";
3
+ } from "../../../chunk-zz072pjn.js";
4
+ import"../../../chunk-v0bv70xv.js";
5
5
  import"../../../chunk-4t23yhc0.js";
6
6
  import"../../../chunk-rxjxb4vy.js";
7
7
  import"../../../chunk-er6e5fj8.js";
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  ModelSelectorItem2
3
- } from "../../../chunk-8sktrf74.js";
3
+ } from "../../../chunk-074ehhx1.js";
4
4
  import"../../../chunk-ydfx8r6d.js";
5
5
  import"../../../chunk-kp3jgjng.js";
6
- import"../../../chunk-5bq2j907.js";
6
+ import"../../../chunk-v0bv70xv.js";
7
7
  import"../../../chunk-4t23yhc0.js";
8
8
  import"../../../chunk-rxjxb4vy.js";
9
9
  import"../../../chunk-er6e5fj8.js";
@@ -1,11 +1,11 @@
1
1
  import {
2
2
  ModelSelectorList2
3
- } from "../../../chunk-0bwg27nq.js";
4
- import"../../../chunk-zthc8ajd.js";
5
- import"../../../chunk-8sktrf74.js";
3
+ } from "../../../chunk-336c0c3z.js";
4
+ import"../../../chunk-wh8gdhc7.js";
5
+ import"../../../chunk-074ehhx1.js";
6
6
  import"../../../chunk-ydfx8r6d.js";
7
7
  import"../../../chunk-kp3jgjng.js";
8
- import"../../../chunk-5bq2j907.js";
8
+ import"../../../chunk-v0bv70xv.js";
9
9
  import"../../../chunk-4t23yhc0.js";
10
10
  import"../../../chunk-rxjxb4vy.js";
11
11
  import"../../../chunk-er6e5fj8.js";
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  ModelSelectorSearch2
3
- } from "../../../chunk-16qrkr8k.js";
4
- import"../../../chunk-5bq2j907.js";
3
+ } from "../../../chunk-8t11333k.js";
4
+ import"../../../chunk-v0bv70xv.js";
5
5
  import"../../../chunk-4t23yhc0.js";
6
6
  import"../../../chunk-rxjxb4vy.js";
7
7
  import"../../../chunk-er6e5fj8.js";
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  ModelSelectorSeparator2
3
- } from "../../../chunk-3qrvksfh.js";
4
- import"../../../chunk-5bq2j907.js";
3
+ } from "../../../chunk-78ntbpa4.js";
4
+ import"../../../chunk-v0bv70xv.js";
5
5
  import"../../../chunk-4t23yhc0.js";
6
6
  import"../../../chunk-rxjxb4vy.js";
7
7
  import"../../../chunk-er6e5fj8.js";
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  RegenerateMenu2
3
- } from "../../../chunk-fjw7yyt3.js";
4
- import"../../../chunk-10vjajh7.js";
3
+ } from "../../../chunk-jrf138sy.js";
4
+ import"../../../chunk-yywr1jgk.js";
5
5
  import"../../../chunk-bd09gygt.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-8w8mnk5h.js";
88
88
  import"../../chunk-4t23yhc0.js";
89
- import"../../chunk-5bq2j907.js";
89
+ import"../../chunk-v0bv70xv.js";
90
90
  import"../../chunk-7vnpp3ya.js";
91
91
  import {
92
92
  CommandPalette2
93
- } from "../../chunk-xywttk96.js";
93
+ } from "../../chunk-yxwtpq9d.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-3b15harp.js";
390
+ } from "../../chunk-da67wbm4.js";
391
391
  import {
392
392
  ModelSelectorSearch2
393
- } from "../../chunk-16qrkr8k.js";
393
+ } from "../../chunk-8t11333k.js";
394
394
  import {
395
395
  ModelSelectorEmpty2
396
- } from "../../chunk-zthc8ajd.js";
396
+ } from "../../chunk-wh8gdhc7.js";
397
397
  import {
398
398
  ModelSelectorItem2
399
- } from "../../chunk-8sktrf74.js";
399
+ } from "../../chunk-074ehhx1.js";
400
400
  import {
401
401
  ModelSelectorList2
402
- } from "../../chunk-0bwg27nq.js";
402
+ } from "../../chunk-336c0c3z.js";
403
403
  import {
404
404
  ModelSelectorEffort2
405
405
  } from "../../chunk-pzr1f2tz.js";
406
406
  import {
407
407
  ModelSelectorContent2
408
- } from "../../chunk-vqgw4xab.js";
408
+ } from "../../chunk-q3jmy8bv.js";
409
409
  import {
410
410
  ModelSelector2
411
- } from "../../chunk-qff5s98n.js";
411
+ } from "../../chunk-ga3h6738.js";
412
412
  import {
413
413
  ModelSelectorGroup2
414
- } from "../../chunk-d1z748rn.js";
414
+ } from "../../chunk-zz072pjn.js";
415
415
  import {
416
416
  ModelSelectorSeparator2
417
- } from "../../chunk-3qrvksfh.js";
417
+ } from "../../chunk-78ntbpa4.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-58cpjhsr.js";
484
- import"../../chunk-10vjajh7.js";
484
+ import"../../chunk-yywr1jgk.js";
485
485
  import {
486
486
  RegenerateMenu2
487
- } from "../../chunk-fjw7yyt3.js";
487
+ } from "../../chunk-jrf138sy.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-6pj5fxa2.js";
3
+ } from "../../../chunk-bshdrjwh.js";
4
4
  import"../../../chunk-k2t9ey7z.js";
5
5
  import"../../../chunk-gb16cwpw.js";
6
- import"../../../chunk-d1z748rn.js";
7
- import"../../../chunk-3qrvksfh.js";
8
- import"../../../chunk-vqgw4xab.js";
9
- import"../../../chunk-0bwg27nq.js";
6
+ import"../../../chunk-zz072pjn.js";
7
+ import"../../../chunk-78ntbpa4.js";
8
+ import"../../../chunk-q3jmy8bv.js";
9
+ import"../../../chunk-336c0c3z.js";
10
10
  import"../../../chunk-pzr1f2tz.js";
11
- import"../../../chunk-zthc8ajd.js";
12
- import"../../../chunk-3b15harp.js";
13
- import"../../../chunk-16qrkr8k.js";
14
- import"../../../chunk-8sktrf74.js";
11
+ import"../../../chunk-wh8gdhc7.js";
12
+ import"../../../chunk-da67wbm4.js";
13
+ import"../../../chunk-8t11333k.js";
14
+ import"../../../chunk-074ehhx1.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-5bq2j907.js";
20
+ import"../../../chunk-v0bv70xv.js";
21
21
  import"../../../chunk-4t23yhc0.js";
22
22
  import"../../../chunk-rxjxb4vy.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-rxjxb4vy.js";
156
- import"../../../chunk-5bq2j907.js";
157
- import"../../../chunk-3b15harp.js";
158
- import"../../../chunk-16qrkr8k.js";
159
- import"../../../chunk-zthc8ajd.js";
160
- import"../../../chunk-8sktrf74.js";
161
- import"../../../chunk-0bwg27nq.js";
156
+ import"../../../chunk-v0bv70xv.js";
157
+ import"../../../chunk-da67wbm4.js";
158
+ import"../../../chunk-8t11333k.js";
159
+ import"../../../chunk-wh8gdhc7.js";
160
+ import"../../../chunk-074ehhx1.js";
161
+ import"../../../chunk-336c0c3z.js";
162
162
  import"../../../chunk-pzr1f2tz.js";
163
- import"../../../chunk-vqgw4xab.js";
164
- import"../../../chunk-d1z748rn.js";
165
- import"../../../chunk-3qrvksfh.js";
163
+ import"../../../chunk-q3jmy8bv.js";
164
+ import"../../../chunk-zz072pjn.js";
165
+ import"../../../chunk-78ntbpa4.js";
166
166
  import {
167
167
  ModelSelector3
168
- } from "../../../chunk-6pj5fxa2.js";
168
+ } from "../../../chunk-bshdrjwh.js";
169
169
  import {
170
170
  QuoteBlockRoot2,
171
171
  QuoteBlockIcon2,
@@ -1,10 +1,10 @@
1
1
  import type { IAnalyticsProps } from "../../analytics/types.js";
2
- import type { ComponentProps, ReactElement } from "react";
2
+ import { type ComponentProps, type ReactElement } from "react";
3
3
  import type { IDensityProps } from "../../density/types.js";
4
4
  import { Command as CommandPrimitive } from "cmdk";
5
5
  import { Dialog } from "../Dialog.js";
6
6
  type CommandProps = ComponentProps<typeof CommandPrimitive> & IDensityProps;
7
- declare function Command({ density, className, ...props }: CommandProps): ReactElement;
7
+ declare function Command({ density, className, value: valueProp, defaultValue, onValueChange, onKeyDown, loop, ref, ...props }: CommandProps): ReactElement;
8
8
  type CommandDialogProps<Payload> = ComponentProps<typeof Dialog<Payload>> & IDensityProps & {
9
9
  title?: string;
10
10
  description?: string;
@@ -17,6 +17,15 @@ declare function CommandList({ className, ...props }: ComponentProps<typeof Comm
17
17
  declare function CommandEmpty({ className, ...props }: ComponentProps<typeof CommandPrimitive.Empty>): ReactElement;
18
18
  declare function CommandGroup({ className, ...props }: ComponentProps<typeof CommandPrimitive.Group>): ReactElement;
19
19
  declare function CommandSeparator({ className, ...props }: ComponentProps<typeof CommandPrimitive.Separator>): ReactElement;
20
- declare function CommandItem({ analytics, className, children, ...props }: ComponentProps<typeof CommandPrimitive.Item> & IAnalyticsProps): ReactElement;
20
+ type CommandItemProps = ComponentProps<typeof CommandPrimitive.Item> & IAnalyticsProps & {
21
+ /**
22
+ * Disables the item while keeping it reachable with the arrow keys, and shows why as visible secondary text that
23
+ * the item references through `aria-describedby`.
24
+ */
25
+ disabledReason?: string;
26
+ /** Runs instead of `onSelect` when Enter or a click selects an item with a disabled reason, to announce it. */
27
+ onDisabledSelect?: () => void;
28
+ };
29
+ declare function CommandItem({ analytics, className, children, disabledReason, onDisabledSelect, ref, ...props }: CommandItemProps): ReactElement;
21
30
  declare function CommandShortcut({ className, ...props }: ComponentProps<"span">): ReactElement;
22
31
  export { Command, CommandDialog, CommandInput, CommandList, CommandEmpty, CommandGroup, CommandItem, CommandSeparator, CommandShortcut, };
@@ -20,7 +20,7 @@ import {
20
20
  CommandSeparator2,
21
21
  CommandItem2,
22
22
  CommandShortcut2
23
- } from "../../chunk-5bq2j907.js";
23
+ } from "../../chunk-v0bv70xv.js";
24
24
  import"../../chunk-5mydsjp3.js";
25
25
  export {
26
26
  Command2 as Command,
@@ -31,13 +31,13 @@ import {
31
31
  DrawerHeader2,
32
32
  DrawerTitle2,
33
33
  DrawerDescription2
34
- } from "../../chunk-pr5s27j8.js";
34
+ } from "../../chunk-st134dvp.js";
35
35
  import {
36
36
  MenuPopup,
37
37
  MenuItem2,
38
38
  DropdownMenu2,
39
39
  DropdownMenuTrigger2
40
- } from "../../chunk-10vjajh7.js";
40
+ } from "../../chunk-yywr1jgk.js";
41
41
  import {
42
42
  Alert2,
43
43
  AlertTitle2,
package/dist/index.js CHANGED
@@ -171,7 +171,7 @@ import {
171
171
  StatusTracker2,
172
172
  DashboardLayout2,
173
173
  BillingUsage2
174
- } from "./chunk-pr5s27j8.js";
174
+ } from "./chunk-st134dvp.js";
175
175
  import {
176
176
  Combobox2,
177
177
  ComboboxValue2,
@@ -240,7 +240,7 @@ import {
240
240
  MenuShortcut2,
241
241
  DropdownMenu2,
242
242
  DropdownMenuTrigger2
243
- } from "./chunk-10vjajh7.js";
243
+ } from "./chunk-yywr1jgk.js";
244
244
  import {
245
245
  Empty2,
246
246
  EmptyHeader2,
@@ -5,6 +5,11 @@ interface IMenuInsetProps extends IDensityProps {
5
5
  }
6
6
  interface IMenuItemOptions extends IMenuInsetProps {
7
7
  variant?: "default" | "destructive";
8
+ /**
9
+ * Disables the item while keeping it reachable with the arrow keys, and shows why as visible secondary text that
10
+ * the item references through `aria-describedby`.
11
+ */
12
+ disabledReason?: string;
8
13
  }
9
14
  export type MenuLabelProps = Menu.GroupLabel.Props & IMenuInsetProps;
10
15
  export type MenuItemProps = Menu.Item.Props & IMenuItemOptions;
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.72",
2054
+ version: "0.0.73",
2055
2055
  description: "Sharp, monospace React components with compact and comfortable densities.",
2056
2056
  license: "MIT",
2057
2057
  repository: {
@@ -469,3 +469,75 @@ Storybook CSF excerpts. Default args and render apply unless overridden. Local h
469
469
  decorators: RightToLeft.decorators
470
470
  }
471
471
  ```
472
+
473
+ ### DisabledReasons
474
+
475
+ ```tsx
476
+ {
477
+ args: { loop: false },
478
+ render: function Render(args) {
479
+ const [action, setAction] = useState("None");
480
+ const [announced, setAnnounced] = useState("");
481
+ return (<div className="w-80 border border-border">
482
+ <Command {...args} label="Search commands">
483
+ <CommandInput placeholder="Search commands" aria-label="Search commands"/>
484
+ <CommandList label="Commands">
485
+ <CommandEmpty>No results found.</CommandEmpty>
486
+ <CommandGroup heading="Commands for 2 tracks">
487
+ <CommandItem value="analyze" onSelect={setAction}>
488
+ Analyze…
489
+ </CommandItem>
490
+ <CommandItem value="move" keywords={["relocate"]} disabledReason="One track only" onSelect={setAction} onDisabledSelect={() => setAnnounced("One track only")}>
491
+ Move audio file…<CommandShortcut>M</CommandShortcut>
492
+ </CommandItem>
493
+ <CommandItem value="delete" disabled>
494
+ Delete workspace
495
+ </CommandItem>
496
+ <CommandItem value="tags" onSelect={setAction}>
497
+ Tags…
498
+ </CommandItem>
499
+ </CommandGroup>
500
+ </CommandList>
501
+ </Command>
502
+ <output aria-label="Executed command">{action}</output>
503
+ <output aria-label="Announced reason">{announced}</output>
504
+ </div>);
505
+ }
506
+ }
507
+ ```
508
+
509
+ ### LoopingDisabledReasons
510
+
511
+ ```tsx
512
+ {
513
+ args: { loop: true },
514
+ render: function Render(args) {
515
+ const [action, setAction] = useState("None");
516
+ const [announced, setAnnounced] = useState("");
517
+ return (<div className="w-80 border border-border">
518
+ <Command {...args} label="Search commands">
519
+ <CommandInput placeholder="Search commands" aria-label="Search commands"/>
520
+ <CommandList label="Commands">
521
+ <CommandEmpty>No results found.</CommandEmpty>
522
+ <CommandGroup heading="Commands for 2 tracks">
523
+ <CommandItem value="analyze" onSelect={setAction}>
524
+ Analyze…
525
+ </CommandItem>
526
+ <CommandItem value="move" keywords={["relocate"]} disabledReason="One track only" onSelect={setAction} onDisabledSelect={() => setAnnounced("One track only")}>
527
+ Move audio file…<CommandShortcut>M</CommandShortcut>
528
+ </CommandItem>
529
+ <CommandItem value="delete" disabled>
530
+ Delete workspace
531
+ </CommandItem>
532
+ <CommandItem value="tags" onSelect={setAction}>
533
+ Tags…
534
+ </CommandItem>
535
+ </CommandGroup>
536
+ </CommandList>
537
+ </Command>
538
+ <output aria-label="Executed command">{action}</output>
539
+ <output aria-label="Announced reason">{announced}</output>
540
+ </div>);
541
+ }
542
+ }
543
+ ```
@@ -600,3 +600,32 @@ Storybook CSF excerpts. Default args and render apply unless overridden. Local h
600
600
  decorators: RightToLeft.decorators
601
601
  }
602
602
  ```
603
+
604
+ ### DisabledReasons
605
+
606
+ ```tsx
607
+ {
608
+ render: function Render() {
609
+ const [action, setAction] = useState("None");
610
+ return (<>
611
+ <DropdownMenu>
612
+ <DropdownMenuTrigger render={<Button variant="outline"/>}>Track actions</DropdownMenuTrigger>
613
+ <DropdownMenuContent>
614
+ <DropdownMenuGroup>
615
+ <DropdownMenuItem onClick={() => setAction("Edit")}>
616
+ <FileIcon />
617
+ Edit track info…
618
+ </DropdownMenuItem>
619
+ <DropdownMenuItem disabledReason="One track only" onClick={() => setAction("Move")}>
620
+ <SaveIcon />
621
+ Move audio file…
622
+ </DropdownMenuItem>
623
+ <DropdownMenuItem onClick={() => setAction("Analyze")}>Analyze…</DropdownMenuItem>
624
+ </DropdownMenuGroup>
625
+ </DropdownMenuContent>
626
+ </DropdownMenu>
627
+ <output aria-label="Menu action">{action}</output>
628
+ </>);
629
+ }
630
+ }
631
+ ```
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@alexgorbatchev/shadcn",
3
- "version": "0.0.72",
3
+ "version": "0.0.73",
4
4
  "description": "Sharp, monospace React components with compact and comfortable densities.",
5
5
  "license": "MIT",
6
6
  "repository": {