@overmap-ai/blocks 1.0.34-command-menu.3 → 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.
- package/dist/CheckedIndicator/CheckedIndicator.d.ts +2 -2
- package/dist/CommandMenu/CheckboxIndicator.d.ts +1 -2
- package/dist/CommandMenu/Item.d.ts +3 -1
- package/dist/CommandMenu/MultiSelectGroup.d.ts +3 -5
- package/dist/CommandMenu/MultiSelectItem.d.ts +3 -3
- package/dist/CommandMenu/RadioGroup.d.ts +3 -6
- package/dist/CommandMenu/RadioItem.d.ts +3 -3
- package/dist/CommandMenu/SelectAllItem.d.ts +1 -1
- package/dist/CommandMenu/SelectedIndicator.d.ts +1 -2
- package/dist/CommandMenu/context.d.ts +1 -13
- package/dist/CommandMenu/index.d.ts +7 -7
- package/dist/CommandMenu/utils.d.ts +1 -1
- package/dist/Menu/CheckboxItem/CheckboxItem.d.ts +1 -1
- package/dist/Menu/CheckboxItemIndicator/CheckboxItemIndicator.d.ts +1 -1
- package/dist/Menu/Group/Group.d.ts +1 -1
- package/dist/Menu/Item/Item.d.ts +1 -1
- package/dist/Menu/MultiSelectGroup/MultiSelectGroup.d.ts +1 -2
- package/dist/Menu/MultiSelectItem/MultiSelectItem.d.ts +1 -2
- package/dist/Menu/PageTrigger/PageTrigger.d.ts +1 -1
- package/dist/Menu/SelectAll/SelectAllItem.d.ts +1 -2
- package/dist/Menu/SelectAll/index.d.ts +0 -1
- package/dist/Menu/SelectGroup/SelectGroup.d.ts +1 -2
- package/dist/Menu/SelectItem/SelectItem.d.ts +1 -2
- package/dist/Menu/SelectedIndicator/SelectedIndicator.d.ts +1 -1
- package/dist/Menu/SelectedIndicator/context.d.ts +2 -6
- package/dist/Menu/SubTrigger/SubTrigger.d.ts +1 -1
- package/dist/Menu/cva.d.ts +0 -3
- package/dist/Menu/index.d.ts +12 -13
- package/dist/Menu/typings.d.ts +8 -16
- package/dist/Menu/utils.d.ts +7 -1
- package/dist/SelectContext/MultiSelectProvider.d.ts +3 -0
- package/dist/SelectContext/SingleSelectProvider.d.ts +4 -0
- package/dist/SelectContext/context.d.ts +14 -4
- package/dist/SelectContext/index.d.ts +2 -2
- package/dist/SelectContext/typings.d.ts +16 -8
- package/dist/blocks.js +403 -397
- package/dist/blocks.js.map +1 -1
- package/dist/blocks.umd.cjs +402 -396
- package/dist/blocks.umd.cjs.map +1 -1
- package/dist/utils.d.ts +1 -1
- package/package.json +1 -1
- package/dist/Menu/SelectAll/SelectAllIndicator.d.ts +0 -3
- package/dist/Menu/SelectAll/context.d.ts +0 -6
- package/dist/SelectContext/Provider.d.ts +0 -14
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { FC, PropsWithChildren } from "react";
|
|
2
|
-
export interface CheckedIndicatorProps {
|
|
1
|
+
import { ComponentPropsWithRef, FC, PropsWithChildren } from "react";
|
|
2
|
+
export interface CheckedIndicatorProps extends Omit<ComponentPropsWithRef<"span">, "children"> {
|
|
3
3
|
children: PropsWithChildren["children"] | ((indeterminate: boolean) => PropsWithChildren["children"]);
|
|
4
4
|
}
|
|
5
5
|
export declare const CheckedIndicator: FC<CheckedIndicatorProps>;
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { ComponentPropsWithRef, ReactNode } from "react";
|
|
2
2
|
import type { CheckedState } from "./typings";
|
|
3
3
|
export interface CommandMenuCheckboxIndicatorProps extends Omit<ComponentPropsWithRef<"span">, "children"> {
|
|
4
|
-
alwaysRender?: boolean;
|
|
5
4
|
children: ReactNode | ((checked: CheckedState) => ReactNode);
|
|
6
5
|
}
|
|
7
|
-
export declare const CommandMenuCheckboxIndicator: (props: CommandMenuCheckboxIndicatorProps) => import("react/jsx-runtime").JSX.Element
|
|
6
|
+
export declare const CommandMenuCheckboxIndicator: (props: CommandMenuCheckboxIndicatorProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -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,7 +1,5 @@
|
|
|
1
|
+
import type { MultiSelectProps } from "../SelectContext/typings";
|
|
1
2
|
import { CommandMenuGroupProps } from "./Group";
|
|
2
|
-
export interface CommandMenuMultiSelectGroupProps extends CommandMenuGroupProps {
|
|
3
|
-
defaultValues?: string[];
|
|
4
|
-
values?: string[];
|
|
5
|
-
onValuesChange?: (values: string[]) => void;
|
|
3
|
+
export interface CommandMenuMultiSelectGroupProps<TValue> extends CommandMenuGroupProps, MultiSelectProps<TValue> {
|
|
6
4
|
}
|
|
7
|
-
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:
|
|
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,7 +1,4 @@
|
|
|
1
|
+
import { SingleSelectProps } from "../SelectContext/typings";
|
|
1
2
|
import { CommandMenuGroupProps } from "./Group";
|
|
2
|
-
export
|
|
3
|
-
|
|
4
|
-
value?: string | null;
|
|
5
|
-
onValueChange?: (value: string | null) => void;
|
|
6
|
-
}
|
|
7
|
-
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:
|
|
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;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { ComponentPropsWithRef, ReactNode } from "react";
|
|
2
2
|
export interface CommandMenuSelectedIndicatorProps extends Omit<ComponentPropsWithRef<"span">, "children"> {
|
|
3
|
-
alwaysRender?: boolean;
|
|
4
3
|
children: ReactNode | ((selected: boolean) => ReactNode);
|
|
5
4
|
}
|
|
6
|
-
export declare const CommandMenuSelectedIndicator: (props: CommandMenuSelectedIndicatorProps) => import("react/jsx-runtime").JSX.Element
|
|
5
|
+
export declare const CommandMenuSelectedIndicator: (props: CommandMenuSelectedIndicatorProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
/// <reference types="react" />
|
|
2
2
|
import type { ComponentRadius } from "../Provider";
|
|
3
3
|
import type { CheckedState, CommandMenuSize, CommandMenuVariant } from "./typings";
|
|
4
4
|
interface ICommandMenuContext {
|
|
@@ -7,18 +7,6 @@ interface ICommandMenuContext {
|
|
|
7
7
|
radius: ComponentRadius;
|
|
8
8
|
}
|
|
9
9
|
export declare const CommandMenuContext: import("react").Context<ICommandMenuContext>;
|
|
10
|
-
export interface ISelectContext {
|
|
11
|
-
selectValue: (value: string) => void;
|
|
12
|
-
selected: (value: string) => boolean;
|
|
13
|
-
}
|
|
14
|
-
export declare const SelectContext: import("react").Context<ISelectContext>;
|
|
15
|
-
export interface IMultiSelectGroupContext {
|
|
16
|
-
itemValueMapping: Map<string, string>;
|
|
17
|
-
setItemValueMapping: Dispatch<SetStateAction<Map<string, string>>>;
|
|
18
|
-
values: string[];
|
|
19
|
-
setValues: (values: string[]) => void;
|
|
20
|
-
}
|
|
21
|
-
export declare const MultiSelectGroupContext: import("react").Context<IMultiSelectGroupContext>;
|
|
22
10
|
export declare const SelectedIndicatorContext: import("react").Context<boolean>;
|
|
23
11
|
export declare const CheckboxIndicatorContext: import("react").Context<CheckedState>;
|
|
24
12
|
export interface IMenuPagesContext {
|
|
@@ -32,14 +32,14 @@ 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;
|
|
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;
|
|
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
|
+
SelectedIndicator: (props: import("./SelectedIndicator").CommandMenuSelectedIndicatorProps) => 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
|
-
CheckboxIndicator: (props: import("./CheckboxIndicator").CommandMenuCheckboxIndicatorProps) => import("react/jsx-runtime").JSX.Element
|
|
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;
|
|
44
44
|
Page: (props: import("./Page").CommandMenuPageProps) => import("react/jsx-runtime").JSX.Element;
|
|
45
45
|
PageTriggerItem: (props: import("./PageTriggerItem").CommandMenuPageTriggerItemProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { CheckedState } from "
|
|
1
|
+
import type { CheckedState } from "../CheckedIndicator";
|
|
2
2
|
export declare function getSelectedState(selected: boolean): "selected" | "unselected";
|
|
3
3
|
export declare function getCheckedState(checked: CheckedState): "checked" | "indeterminate" | "unchecked";
|
|
4
4
|
export declare function getActiveState(active: boolean): "active" | "inactive";
|
|
@@ -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 { MenuCheckboxIndicatorProps } from "../typings";
|
|
3
|
-
export declare const MenuCheckboxItemIndicator: import("react").ForwardRefExoticComponent<MenuCheckboxIndicatorProps & import("react").RefAttributes<HTMLSpanElement>>;
|
|
3
|
+
export declare const MenuCheckboxItemIndicator: import("react").ForwardRefExoticComponent<Omit<MenuCheckboxIndicatorProps, "ref"> & import("react").RefAttributes<HTMLSpanElement>>;
|
|
@@ -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>>;
|
package/dist/Menu/Item/Item.d.ts
CHANGED
|
@@ -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
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
2
|
+
export declare const MenuSelectItem: <TValue>(props: MenuSelectItemProps<TValue>) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,7 +1,3 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
}
|
|
5
|
-
export declare const SelectedIndicatorContext: import("react").Context<ISelectedIndicatorContext>;
|
|
6
|
-
export declare const useSelectedIndicatorContext: () => ISelectedIndicatorContext;
|
|
7
|
-
export {};
|
|
2
|
+
export declare const SelectedIndicatorContext: import("react").Context<boolean>;
|
|
3
|
+
export declare const useSelectedIndicatorContext: () => boolean;
|
|
@@ -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>>;
|
package/dist/Menu/cva.d.ts
CHANGED
|
@@ -5,9 +5,6 @@ export declare const menuItem: (props?: ({
|
|
|
5
5
|
export declare const menuSeparator: (props?: ({
|
|
6
6
|
size?: "xs" | "sm" | "md" | "lg" | "xl" | null | undefined;
|
|
7
7
|
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
8
|
-
export declare const menuSelectedIndicator: (props?: ({
|
|
9
|
-
size?: "xs" | "sm" | "md" | "lg" | "xl" | null | undefined;
|
|
10
|
-
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
11
8
|
export declare const menuContent: (props?: ({
|
|
12
9
|
size?: "xs" | "sm" | "md" | "lg" | "xl" | null | undefined;
|
|
13
10
|
radius?: "none" | "xs" | "sm" | "md" | "lg" | "xl" | "full" | null | undefined;
|
package/dist/Menu/index.d.ts
CHANGED
|
@@ -29,26 +29,25 @@ 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:
|
|
41
|
-
MultiSelectGroup:
|
|
42
|
-
Item: import("react").NamedExoticComponent<import("./typings").MenuItemProps
|
|
43
|
-
SelectItem:
|
|
44
|
-
MultiSelectItem:
|
|
45
|
-
SelectAllItem:
|
|
46
|
-
CheckboxItem: import("react").ForwardRefExoticComponent<import("./typings").MenuCheckboxItemProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
47
|
-
SelectAllIndicator: import("react").ForwardRefExoticComponent<import("./typings").SelectAllIndicatorProps & import("react").RefAttributes<HTMLSpanElement>>;
|
|
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>>;
|
|
48
47
|
SelectedIndicator: import("react").ForwardRefExoticComponent<{
|
|
49
48
|
children?: import("react").ReactNode;
|
|
50
|
-
} & import("react").RefAttributes<
|
|
51
|
-
CheckboxItemIndicator: import("react").ForwardRefExoticComponent<import("./typings").MenuCheckboxIndicatorProps & import("react").RefAttributes<HTMLSpanElement>>;
|
|
49
|
+
} & import("react").RefAttributes<HTMLSpanElement>>;
|
|
50
|
+
CheckboxItemIndicator: import("react").ForwardRefExoticComponent<Omit<import("./typings").MenuCheckboxIndicatorProps, "ref"> & import("react").RefAttributes<HTMLSpanElement>>;
|
|
52
51
|
InputRoot: import("react").NamedExoticComponent<import("./typings").MenuInputRootProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
53
52
|
InputField: import("react").NamedExoticComponent<Omit<import("./typings").MenuInputProps, "ref"> & import("react").RefAttributes<HTMLInputElement>>;
|
|
54
53
|
InputSlot: import("react").NamedExoticComponent<import("./typings").MenuInputSlotProps & import("react").RefAttributes<HTMLDivElement>>;
|
package/dist/Menu/typings.d.ts
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
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
|
+
import type { MultiSelectProps, SingleSelectProps } from "../SelectContext/typings";
|
|
7
8
|
import type { AccentColorProps } from "../typings";
|
|
8
9
|
import { menuItem } from "./cva";
|
|
9
10
|
type MenuItemVariants = VariantProps<typeof menuItem>;
|
|
@@ -41,32 +42,26 @@ export interface MenuVirtualTriggerProps {
|
|
|
41
42
|
virtualElement: VirtualElement | null;
|
|
42
43
|
disabled?: boolean;
|
|
43
44
|
}
|
|
44
|
-
export interface MenuGroupProps extends
|
|
45
|
+
export interface MenuGroupProps extends ComponentPropsWithRef<"div"> {
|
|
45
46
|
}
|
|
46
|
-
export
|
|
47
|
-
|
|
48
|
-
onValueChange: (value: string | null) => void;
|
|
49
|
-
}
|
|
50
|
-
export interface MenuMultiSelectGroupProps extends MenuGroupProps {
|
|
51
|
-
values: string[];
|
|
52
|
-
onValuesChange: (values: string[]) => void;
|
|
47
|
+
export type MenuSelectGroupProps<TValue> = MenuGroupProps & SingleSelectProps<TValue>;
|
|
48
|
+
export interface MenuMultiSelectGroupProps<TValue> extends MenuGroupProps, MultiSelectProps<TValue> {
|
|
53
49
|
}
|
|
54
50
|
export interface MenuItemMeta {
|
|
55
51
|
active: boolean;
|
|
56
52
|
selected: boolean;
|
|
57
53
|
}
|
|
58
54
|
type ActiveAndSelectedItemCallback<T> = (meta: MenuItemMeta) => T;
|
|
59
|
-
export interface MenuItemProps extends Omit<
|
|
55
|
+
export interface MenuItemProps extends Omit<ComponentPropsWithRef<"div">, "children"> {
|
|
60
56
|
disabled?: boolean;
|
|
61
57
|
children: ReactNode | ActiveAndSelectedItemCallback<ReactNode>;
|
|
62
58
|
closeOnSelect?: boolean;
|
|
63
59
|
onSelect?: () => void;
|
|
64
60
|
}
|
|
65
|
-
export interface MenuSelectItemProps extends MenuItemProps {
|
|
66
|
-
value:
|
|
61
|
+
export interface MenuSelectItemProps<TValue> extends MenuItemProps {
|
|
62
|
+
value: TValue;
|
|
67
63
|
}
|
|
68
64
|
export interface SelectAllItemProps extends Omit<MenuItemProps, "children"> {
|
|
69
|
-
allValues: string[];
|
|
70
65
|
children: ReactNode | ((meta: {
|
|
71
66
|
active: boolean;
|
|
72
67
|
selected: boolean | "indeterminate";
|
|
@@ -111,9 +106,6 @@ export interface MenuInputRootProps extends PropsWithoutRef<ComponentProps<"div"
|
|
|
111
106
|
}
|
|
112
107
|
export interface MenuInputSlotProps extends PropsWithoutRef<ComponentProps<"div">> {
|
|
113
108
|
}
|
|
114
|
-
export interface SelectAllIndicatorProps extends Omit<PropsWithoutRef<ComponentProps<"span">>, "children"> {
|
|
115
|
-
children: ReactNode | ((indeterminate: boolean) => ReactNode);
|
|
116
|
-
}
|
|
117
109
|
export interface MenuCheckboxIndicatorProps extends Omit<PropsWithoutRef<ComponentProps<"span">>, "children">, CheckedIndicatorProps {
|
|
118
110
|
}
|
|
119
111
|
export interface MenuScrollProps extends PropsWithoutRef<ComponentProps<"div">> {
|
package/dist/Menu/utils.d.ts
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { CheckedState } from "../CheckedIndicator";
|
|
2
|
+
import type { MenuAlignment, MenuSide } from "./typings";
|
|
2
3
|
export declare const computeOffsets: (side: MenuSide, alignment: MenuAlignment) => {
|
|
3
4
|
mainAxis: number;
|
|
4
5
|
crossAxis: number;
|
|
5
6
|
};
|
|
7
|
+
export declare function getSelectedState(selected: boolean): "selected" | "unselected";
|
|
8
|
+
export declare function getCheckedState(checked: CheckedState): "checked" | "indeterminate" | "unchecked";
|
|
9
|
+
export declare function getActiveState(active: boolean): "active" | "inactive";
|
|
10
|
+
export declare function getBooleanState(value: boolean): "true" | "false";
|
|
11
|
+
export declare function getOpenState(open: boolean): "open" | "closed";
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { PropsWithChildren } from "react";
|
|
2
|
+
import type { SingleSelectNotRequiredProps, SingleSelectRequiredProps } from "./typings";
|
|
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,5 +1,15 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
2
|
+
export interface ISelectContext<TValue> {
|
|
3
|
+
selectValue: (value: TValue) => void;
|
|
4
|
+
selected: (value: TValue) => boolean;
|
|
5
|
+
}
|
|
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
|
+
allSelected: boolean;
|
|
12
|
+
someSelected: boolean;
|
|
13
|
+
toggleSelectAll: () => void;
|
|
14
|
+
}
|
|
15
|
+
export declare const MultiSelectContext: import("react").Context<IMultiSelectContext<never>>;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
export * from "./context";
|
|
2
|
-
export * from "./
|
|
3
|
-
export * from "./
|
|
2
|
+
export * from "./MultiSelectProvider";
|
|
3
|
+
export * from "./SingleSelectProvider";
|
|
@@ -1,10 +1,18 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
type _SingleSelectProps<TValue> = {
|
|
2
|
+
onValueChange?: (value: TValue) => void;
|
|
3
|
+
defaultValue?: TValue;
|
|
4
|
+
value?: TValue;
|
|
5
5
|
};
|
|
6
|
-
export type
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
6
|
+
export type SingleSelectRequiredProps<TValue> = _SingleSelectProps<TValue>;
|
|
7
|
+
export type SingleSelectNotRequiredProps<TValue> = _SingleSelectProps<TValue | null>;
|
|
8
|
+
export type SingleSelectProps<TValue> = (SingleSelectRequiredProps<TValue> & {
|
|
9
|
+
required: true;
|
|
10
|
+
}) | (SingleSelectNotRequiredProps<TValue> & {
|
|
11
|
+
required: false;
|
|
12
|
+
});
|
|
13
|
+
export type MultiSelectProps<TValue> = {
|
|
14
|
+
onValuesChange?: (value: TValue[]) => void;
|
|
15
|
+
defaultValues?: TValue[];
|
|
16
|
+
values?: TValue[];
|
|
10
17
|
};
|
|
18
|
+
export {};
|