@overmap-ai/blocks 1.0.34-command-menu.4 → 1.0.34-command-menu.5

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.
@@ -1,6 +1,8 @@
1
1
  import { CommandItem } from "cmdk";
2
2
  import { ComponentPropsWithRef } from "react";
3
- export interface CommandMenuItemProps extends ComponentPropsWithRef<typeof CommandItem> {
3
+ export interface CommandMenuItemProps extends Omit<ComponentPropsWithRef<typeof CommandItem>, "value" | "onSelect"> {
4
4
  closeOnSelect?: boolean;
5
+ filterValue?: string;
6
+ onSelect?: () => void;
5
7
  }
6
8
  export declare const CommandMenuItem: import("react").NamedExoticComponent<CommandMenuItemProps>;
@@ -1,5 +1,5 @@
1
- import { MultiSelectProps } from "../SelectContext/typings";
1
+ import type { MultiSelectProps } from "../SelectContext/typings";
2
2
  import { CommandMenuGroupProps } from "./Group";
3
- export interface CommandMenuMultiSelectGroupProps extends CommandMenuGroupProps, MultiSelectProps {
3
+ export interface CommandMenuMultiSelectGroupProps<TValue> extends CommandMenuGroupProps, MultiSelectProps<TValue> {
4
4
  }
5
- export declare const CommandMenuMultiSelectGroup: (props: CommandMenuMultiSelectGroupProps) => import("react/jsx-runtime").JSX.Element;
5
+ export declare const CommandMenuMultiSelectGroup: <TValue>(props: CommandMenuMultiSelectGroupProps<TValue>) => import("react/jsx-runtime").JSX.Element;
@@ -1,5 +1,5 @@
1
1
  import { CommandMenuItemProps } from "./Item";
2
- export interface CommandMenuMultiSelectItemProps extends CommandMenuItemProps {
3
- value: string;
2
+ export interface CommandMenuMultiSelectItemProps<TValue> extends CommandMenuItemProps {
3
+ value: TValue;
4
4
  }
5
- export declare const CommandMenuMultiSelectItem: (props: CommandMenuMultiSelectItemProps) => import("react/jsx-runtime").JSX.Element;
5
+ export declare const CommandMenuMultiSelectItem: <TValue>(props: CommandMenuMultiSelectItemProps<TValue>) => import("react/jsx-runtime").JSX.Element;
@@ -1,4 +1,4 @@
1
1
  import { SingleSelectProps } from "../SelectContext/typings";
2
2
  import { CommandMenuGroupProps } from "./Group";
3
- export type CommandMenuRadioGroupProps = SingleSelectProps & Omit<CommandMenuGroupProps, "defaultValue" | "value">;
4
- export declare const CommandMenuRadioGroup: (props: CommandMenuRadioGroupProps) => import("react/jsx-runtime").JSX.Element;
3
+ export type CommandMenuRadioGroupProps<TValue> = SingleSelectProps<TValue> & Omit<CommandMenuGroupProps, "defaultValue" | "value">;
4
+ export declare const CommandMenuRadioGroup: <TValue>(props: CommandMenuRadioGroupProps<TValue>) => import("react/jsx-runtime").JSX.Element;
@@ -1,5 +1,5 @@
1
1
  import { CommandMenuItemProps } from "./Item";
2
- export interface CommandMenuRadioItemProps extends CommandMenuItemProps {
3
- value: string;
2
+ export interface CommandMenuRadioItemProps<TValue> extends CommandMenuItemProps {
3
+ value: TValue;
4
4
  }
5
- export declare const CommandMenuRadioItem: (props: CommandMenuRadioItemProps) => import("react/jsx-runtime").JSX.Element;
5
+ export declare const CommandMenuRadioItem: <TValue>(props: CommandMenuRadioItemProps<TValue>) => import("react/jsx-runtime").JSX.Element;
@@ -1,4 +1,4 @@
1
1
  import { CommandMenuItemProps } from "./Item";
2
2
  export interface CommandMenuSelectAllItemProps extends CommandMenuItemProps {
3
3
  }
4
- export declare const CommandMenuSelectAllItem: (props: CommandMenuSelectAllItemProps) => import("react/jsx-runtime").JSX.Element;
4
+ export declare const CommandMenuSelectAllItem: <TValue>(props: CommandMenuSelectAllItemProps) => import("react/jsx-runtime").JSX.Element;
@@ -32,12 +32,12 @@ export declare const CommandMenu: {
32
32
  Item: import("react").NamedExoticComponent<import("./Item").CommandMenuItemProps>;
33
33
  Separator: import("react").NamedExoticComponent<import("./Separator").CommandMenuSeparatorProps>;
34
34
  Empty: import("react").NamedExoticComponent<import("./Empty").CommandMenuEmptyProps>;
35
- MultiSelectGroup: (props: import("./MultiSelectGroup").CommandMenuMultiSelectGroupProps) => import("react/jsx-runtime").JSX.Element;
36
- MultiSelectItem: (props: import("./MultiSelectItem").CommandMenuMultiSelectItemProps) => import("react/jsx-runtime").JSX.Element;
37
- SelectAllItem: (props: import("./SelectAllItem").CommandMenuSelectAllItemProps) => import("react/jsx-runtime").JSX.Element;
35
+ MultiSelectGroup: <TValue>(props: import("./MultiSelectGroup").CommandMenuMultiSelectGroupProps<TValue>) => import("react/jsx-runtime").JSX.Element;
36
+ MultiSelectItem: <TValue_1>(props: import("./MultiSelectItem").CommandMenuMultiSelectItemProps<TValue_1>) => import("react/jsx-runtime").JSX.Element;
37
+ SelectAllItem: <TValue_2>(props: import("./SelectAllItem").CommandMenuSelectAllItemProps) => import("react/jsx-runtime").JSX.Element;
38
38
  SelectedIndicator: (props: import("./SelectedIndicator").CommandMenuSelectedIndicatorProps) => import("react/jsx-runtime").JSX.Element;
39
- RadioGroup: (props: import("./RadioGroup").CommandMenuRadioGroupProps) => import("react/jsx-runtime").JSX.Element;
40
- RadioItem: (props: import("./RadioItem").CommandMenuRadioItemProps) => import("react/jsx-runtime").JSX.Element;
39
+ RadioGroup: <TValue_3>(props: import("./RadioGroup").CommandMenuRadioGroupProps<TValue_3>) => import("react/jsx-runtime").JSX.Element;
40
+ RadioItem: <TValue_4>(props: import("./RadioItem").CommandMenuRadioItemProps<TValue_4>) => import("react/jsx-runtime").JSX.Element;
41
41
  CheckboxItem: (props: import("./CheckboxItem").CommandMenuCheckboxItemProps) => import("react/jsx-runtime").JSX.Element;
42
42
  CheckboxIndicator: (props: import("./CheckboxIndicator").CommandMenuCheckboxIndicatorProps) => import("react/jsx-runtime").JSX.Element;
43
43
  Pages: (props: import("./Pages").CommandMenuPagesProps) => import("react/jsx-runtime").JSX.Element;
@@ -1,3 +1,3 @@
1
1
  /// <reference types="react" />
2
2
  import { MenuCheckboxItemProps } from "../typings";
3
- export declare const MenuCheckboxItem: import("react").ForwardRefExoticComponent<MenuCheckboxItemProps & import("react").RefAttributes<HTMLDivElement>>;
3
+ export declare const MenuCheckboxItem: import("react").ForwardRefExoticComponent<Omit<MenuCheckboxItemProps, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
@@ -1,3 +1,3 @@
1
1
  /// <reference types="react" />
2
2
  import type { MenuGroupProps } from "../typings";
3
- export declare const MenuGroup: import("react").NamedExoticComponent<MenuGroupProps & import("react").RefAttributes<HTMLDivElement>>;
3
+ export declare const MenuGroup: import("react").NamedExoticComponent<Omit<MenuGroupProps, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
@@ -1,3 +1,3 @@
1
1
  /// <reference types="react" />
2
2
  import type { MenuItemProps } from "../typings";
3
- export declare const MenuItem: import("react").NamedExoticComponent<MenuItemProps & import("react").RefAttributes<HTMLDivElement>>;
3
+ export declare const MenuItem: import("react").NamedExoticComponent<MenuItemProps>;
@@ -1,3 +1,2 @@
1
- /// <reference types="react" />
2
1
  import type { MenuMultiSelectGroupProps } from "../typings";
3
- export declare const MenuMultiSelectGroup: import("react").NamedExoticComponent<MenuMultiSelectGroupProps & import("react").RefAttributes<HTMLDivElement>>;
2
+ export declare const MenuMultiSelectGroup: <TValue>(props: MenuMultiSelectGroupProps<TValue>) => import("react/jsx-runtime").JSX.Element;
@@ -1,3 +1,2 @@
1
- /// <reference types="react" />
2
1
  import { MenuSelectItemProps } from "../typings";
3
- export declare const MenuMultiSelectItem: import("react").NamedExoticComponent<MenuSelectItemProps & import("react").RefAttributes<HTMLDivElement>>;
2
+ export declare const MenuMultiSelectItem: <TValue>(props: MenuSelectItemProps<TValue>) => import("react/jsx-runtime").JSX.Element;
@@ -1,3 +1,3 @@
1
1
  /// <reference types="react" />
2
2
  import type { PageTriggerProps } from "../typings";
3
- export declare const MenuPageTrigger: import("react").NamedExoticComponent<PageTriggerProps & import("react").RefAttributes<HTMLDivElement>>;
3
+ export declare const MenuPageTrigger: import("react").NamedExoticComponent<Omit<PageTriggerProps, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
@@ -1,3 +1,2 @@
1
- /// <reference types="react" />
2
1
  import type { SelectAllItemProps } from "../typings";
3
- export declare const MenuSelectAllItem: import("react").ForwardRefExoticComponent<SelectAllItemProps & import("react").RefAttributes<HTMLDivElement>>;
2
+ export declare const MenuSelectAllItem: <TValue>(props: SelectAllItemProps) => import("react/jsx-runtime").JSX.Element;
@@ -1,3 +1,2 @@
1
- /// <reference types="react" />
2
1
  import type { MenuSelectGroupProps } from "../typings";
3
- export declare const MenuSelectGroup: import("react").NamedExoticComponent<MenuSelectGroupProps & import("react").RefAttributes<HTMLDivElement>>;
2
+ export declare const MenuSelectGroup: <TValue>(props: MenuSelectGroupProps<TValue>) => import("react/jsx-runtime").JSX.Element;
@@ -1,3 +1,2 @@
1
- /// <reference types="react" />
2
1
  import type { MenuSelectItemProps } from "../typings";
3
- export declare const MenuSelectItem: import("react").NamedExoticComponent<MenuSelectItemProps & import("react").RefAttributes<HTMLDivElement>>;
2
+ export declare const MenuSelectItem: <TValue>(props: MenuSelectItemProps<TValue>) => import("react/jsx-runtime").JSX.Element;
@@ -1,3 +1,3 @@
1
1
  /// <reference types="react" />
2
2
  import type { MenuSubTriggerProps } from "../typings";
3
- export declare const MenuSubTrigger: import("react").NamedExoticComponent<MenuSubTriggerProps & import("react").RefAttributes<HTMLDivElement>>;
3
+ export declare const MenuSubTrigger: import("react").NamedExoticComponent<Omit<MenuSubTriggerProps, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
@@ -29,21 +29,21 @@ export declare const Menu: {
29
29
  Content: import("react").NamedExoticComponent<Omit<import("./typings").MenuContentProps, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
30
30
  Sub: import("react").FC<import("./typings").MenuSubProps>;
31
31
  SubContent: import("react").NamedExoticComponent<import("./typings").SubMenuContentProps & import("react").RefAttributes<HTMLDivElement>>;
32
- SubTrigger: import("react").NamedExoticComponent<import("./typings").MenuSubTriggerProps & import("react").RefAttributes<HTMLDivElement>>;
32
+ SubTrigger: import("react").NamedExoticComponent<Omit<import("./typings").MenuSubTriggerProps, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
33
33
  Pages: import("react").FC<import("./typings").PageProps>;
34
34
  PageContent: import("react").FC<import("./typings").PageContentProps>;
35
- PageTrigger: import("react").NamedExoticComponent<import("./typings").PageTriggerProps & import("react").RefAttributes<HTMLDivElement>>;
35
+ PageTrigger: import("react").NamedExoticComponent<Omit<import("./typings").PageTriggerProps, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
36
36
  ClickTrigger: import("react").NamedExoticComponent<import("./typings").MenuClickTriggerProps & import("react").RefAttributes<HTMLElement>>;
37
37
  ContextTrigger: import("react").NamedExoticComponent<import("./typings").MenuContextTriggerProps & import("react").RefAttributes<HTMLElement>>;
38
38
  VirtualTrigger: import("react").MemoExoticComponent<(props: import("./typings").MenuVirtualTriggerProps) => null>;
39
- Group: import("react").NamedExoticComponent<import("./typings").MenuGroupProps & import("react").RefAttributes<HTMLDivElement>>;
40
- SelectGroup: import("react").NamedExoticComponent<import("./typings").MenuSelectGroupProps & import("react").RefAttributes<HTMLDivElement>>;
41
- MultiSelectGroup: import("react").NamedExoticComponent<import("./typings").MenuMultiSelectGroupProps & import("react").RefAttributes<HTMLDivElement>>;
42
- Item: import("react").NamedExoticComponent<import("./typings").MenuItemProps & import("react").RefAttributes<HTMLDivElement>>;
43
- SelectItem: import("react").NamedExoticComponent<import("./typings").MenuSelectItemProps & import("react").RefAttributes<HTMLDivElement>>;
44
- MultiSelectItem: import("react").NamedExoticComponent<import("./typings").MenuSelectItemProps & import("react").RefAttributes<HTMLDivElement>>;
45
- SelectAllItem: import("react").ForwardRefExoticComponent<import("./typings").SelectAllItemProps & import("react").RefAttributes<HTMLDivElement>>;
46
- CheckboxItem: import("react").ForwardRefExoticComponent<import("./typings").MenuCheckboxItemProps & import("react").RefAttributes<HTMLDivElement>>;
39
+ Group: import("react").NamedExoticComponent<Omit<import("./typings").MenuGroupProps, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
40
+ SelectGroup: <TValue>(props: import("./typings").MenuSelectGroupProps<TValue>) => import("react/jsx-runtime").JSX.Element;
41
+ MultiSelectGroup: <TValue_1>(props: import("./typings").MenuMultiSelectGroupProps<TValue_1>) => import("react/jsx-runtime").JSX.Element;
42
+ Item: import("react").NamedExoticComponent<import("./typings").MenuItemProps>;
43
+ SelectItem: <TValue_2>(props: import("./typings").MenuSelectItemProps<TValue_2>) => import("react/jsx-runtime").JSX.Element;
44
+ MultiSelectItem: <TValue_3>(props: import("./typings").MenuSelectItemProps<TValue_3>) => import("react/jsx-runtime").JSX.Element;
45
+ SelectAllItem: <TValue_4>(props: import("./typings").SelectAllItemProps) => import("react/jsx-runtime").JSX.Element;
46
+ CheckboxItem: import("react").ForwardRefExoticComponent<Omit<import("./typings").MenuCheckboxItemProps, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
47
47
  SelectedIndicator: import("react").ForwardRefExoticComponent<{
48
48
  children?: import("react").ReactNode;
49
49
  } & import("react").RefAttributes<HTMLSpanElement>>;
@@ -1,7 +1,7 @@
1
1
  import type { VirtualElement } from "@floating-ui/react";
2
2
  import * as RadixSeparator from "@radix-ui/react-separator";
3
3
  import type { VariantProps } from "class-variance-authority";
4
- import { ComponentProps, PropsWithChildren, PropsWithoutRef, ReactElement, ReactNode } from "react";
4
+ import { ComponentProps, ComponentPropsWithRef, PropsWithChildren, PropsWithoutRef, ReactElement, ReactNode } from "react";
5
5
  import type { CheckedIndicatorProps } from "../CheckedIndicator";
6
6
  import type { ComponentRadius } from "../Provider";
7
7
  import type { MultiSelectProps, SingleSelectProps } from "../SelectContext/typings";
@@ -42,26 +42,24 @@ export interface MenuVirtualTriggerProps {
42
42
  virtualElement: VirtualElement | null;
43
43
  disabled?: boolean;
44
44
  }
45
- export interface MenuGroupProps extends PropsWithoutRef<ComponentProps<"div">> {
45
+ export interface MenuGroupProps extends ComponentPropsWithRef<"div"> {
46
46
  }
47
- export type MenuSelectGroupProps = MenuGroupProps & SingleSelectProps;
48
- export interface MenuMultiSelectGroupProps extends MenuGroupProps, MultiSelectProps {
49
- values: string[];
50
- onValuesChange: (values: string[]) => void;
47
+ export type MenuSelectGroupProps<TValue> = MenuGroupProps & SingleSelectProps<TValue>;
48
+ export interface MenuMultiSelectGroupProps<TValue> extends MenuGroupProps, MultiSelectProps<TValue> {
51
49
  }
52
50
  export interface MenuItemMeta {
53
51
  active: boolean;
54
52
  selected: boolean;
55
53
  }
56
54
  type ActiveAndSelectedItemCallback<T> = (meta: MenuItemMeta) => T;
57
- export interface MenuItemProps extends Omit<PropsWithoutRef<ComponentProps<"div">>, "children"> {
55
+ export interface MenuItemProps extends Omit<ComponentPropsWithRef<"div">, "children"> {
58
56
  disabled?: boolean;
59
57
  children: ReactNode | ActiveAndSelectedItemCallback<ReactNode>;
60
58
  closeOnSelect?: boolean;
61
59
  onSelect?: () => void;
62
60
  }
63
- export interface MenuSelectItemProps extends MenuItemProps {
64
- value: string;
61
+ export interface MenuSelectItemProps<TValue> extends MenuItemProps {
62
+ value: TValue;
65
63
  }
66
64
  export interface SelectAllItemProps extends Omit<MenuItemProps, "children"> {
67
65
  children: ReactNode | ((meta: {
@@ -1,3 +1,3 @@
1
1
  import { PropsWithChildren } from "react";
2
2
  import type { MultiSelectProps } from "./typings";
3
- export declare const MultiSelectProvider: import("react").NamedExoticComponent<PropsWithChildren<MultiSelectProps>>;
3
+ export declare const MultiSelectProvider: <TValue>(props: PropsWithChildren<MultiSelectProps<TValue>>) => import("react/jsx-runtime").JSX.Element;
@@ -1,4 +1,4 @@
1
1
  import { PropsWithChildren } from "react";
2
2
  import type { SingleSelectNotRequiredProps, SingleSelectRequiredProps } from "./typings";
3
- export declare const SingleSelectRequiredProvider: import("react").NamedExoticComponent<PropsWithChildren<SingleSelectRequiredProps>>;
4
- export declare const SingleSelectNotRequiredProvider: import("react").NamedExoticComponent<PropsWithChildren<SingleSelectNotRequiredProps>>;
3
+ export declare const SingleSelectRequiredProvider: <TValue>(props: PropsWithChildren<SingleSelectRequiredProps<TValue>>) => import("react/jsx-runtime").JSX.Element;
4
+ export declare const SingleSelectNotRequiredProvider: <TValue>(props: PropsWithChildren<SingleSelectNotRequiredProps<TValue>>) => import("react/jsx-runtime").JSX.Element;
@@ -1,15 +1,15 @@
1
1
  /// <reference types="react" />
2
- export interface ISelectContext {
3
- selectValue: (value: string) => void;
4
- selected: (value: string) => boolean;
2
+ export interface ISelectContext<TValue> {
3
+ selectValue: (value: TValue) => void;
4
+ selected: (value: TValue) => boolean;
5
5
  }
6
- export declare const SelectContext: import("react").Context<ISelectContext>;
7
- export interface IMultiSelectContext {
8
- selectValue: (value: string) => void;
9
- selected: (value: string) => boolean;
10
- registerValue: (value: string) => () => void;
6
+ export declare const SelectContext: import("react").Context<ISelectContext<never>>;
7
+ export interface IMultiSelectContext<TValue> {
8
+ selectValue: (value: TValue) => void;
9
+ selected: (value: TValue) => boolean;
10
+ registerValue: (value: TValue) => () => void;
11
11
  allSelected: boolean;
12
12
  someSelected: boolean;
13
13
  toggleSelectAll: () => void;
14
14
  }
15
- export declare const MultiSelectContext: import("react").Context<IMultiSelectContext>;
15
+ export declare const MultiSelectContext: import("react").Context<IMultiSelectContext<never>>;
@@ -3,16 +3,16 @@ type _SingleSelectProps<TValue> = {
3
3
  defaultValue?: TValue;
4
4
  value?: TValue;
5
5
  };
6
- export type SingleSelectRequiredProps = _SingleSelectProps<string>;
7
- export type SingleSelectNotRequiredProps = _SingleSelectProps<string | null>;
8
- export type SingleSelectProps = (SingleSelectRequiredProps & {
6
+ export type SingleSelectRequiredProps<TValue> = _SingleSelectProps<TValue>;
7
+ export type SingleSelectNotRequiredProps<TValue> = _SingleSelectProps<TValue | null>;
8
+ export type SingleSelectProps<TValue> = (SingleSelectRequiredProps<TValue> & {
9
9
  required: true;
10
- }) | (SingleSelectNotRequiredProps & {
10
+ }) | (SingleSelectNotRequiredProps<TValue> & {
11
11
  required: false;
12
12
  });
13
- export type MultiSelectProps = {
14
- onValuesChange?: (value: string[]) => void;
15
- defaultValues?: string[];
16
- values?: string[];
13
+ export type MultiSelectProps<TValue> = {
14
+ onValuesChange?: (value: TValue[]) => void;
15
+ defaultValues?: TValue[];
16
+ values?: TValue[];
17
17
  };
18
18
  export {};