@overmap-ai/blocks 1.0.34-command-menu.4 → 1.0.34-small-improvements.0

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 (50) hide show
  1. package/dist/CheckedIndicator/CheckedIndicator.d.ts +2 -2
  2. package/dist/Menu/CheckboxItemIndicator/CheckboxItemIndicator.d.ts +1 -1
  3. package/dist/Menu/SelectAll/SelectAllIndicator.d.ts +3 -0
  4. package/dist/Menu/SelectAll/context.d.ts +6 -0
  5. package/dist/Menu/SelectAll/index.d.ts +1 -0
  6. package/dist/Menu/SelectedIndicator/SelectedIndicator.d.ts +1 -1
  7. package/dist/Menu/SelectedIndicator/context.d.ts +6 -2
  8. package/dist/Menu/cva.d.ts +3 -0
  9. package/dist/Menu/index.d.ts +3 -2
  10. package/dist/Menu/typings.d.ts +9 -3
  11. package/dist/Menu/utils.d.ts +1 -7
  12. package/dist/SelectContext/Provider.d.ts +14 -0
  13. package/dist/SelectContext/context.d.ts +3 -13
  14. package/dist/SelectContext/index.d.ts +2 -2
  15. package/dist/SelectContext/typings.d.ts +8 -16
  16. package/dist/blocks.js +194 -829
  17. package/dist/blocks.js.map +1 -1
  18. package/dist/blocks.umd.cjs +195 -828
  19. package/dist/blocks.umd.cjs.map +1 -1
  20. package/dist/index.d.ts +1 -2
  21. package/dist/utils.d.ts +7 -2
  22. package/package.json +1 -4
  23. package/dist/CommandMenu/CheckboxIndicator.d.ts +0 -6
  24. package/dist/CommandMenu/CheckboxItem.d.ts +0 -7
  25. package/dist/CommandMenu/Content.d.ts +0 -7
  26. package/dist/CommandMenu/Empty.d.ts +0 -5
  27. package/dist/CommandMenu/Group.d.ts +0 -5
  28. package/dist/CommandMenu/Input.d.ts +0 -5
  29. package/dist/CommandMenu/Item.d.ts +0 -6
  30. package/dist/CommandMenu/List.d.ts +0 -5
  31. package/dist/CommandMenu/MultiSelectGroup.d.ts +0 -5
  32. package/dist/CommandMenu/MultiSelectItem.d.ts +0 -5
  33. package/dist/CommandMenu/Overlay.d.ts +0 -5
  34. package/dist/CommandMenu/Page.d.ts +0 -5
  35. package/dist/CommandMenu/PageTriggerItem.d.ts +0 -5
  36. package/dist/CommandMenu/Pages.d.ts +0 -7
  37. package/dist/CommandMenu/RadioGroup.d.ts +0 -4
  38. package/dist/CommandMenu/RadioItem.d.ts +0 -5
  39. package/dist/CommandMenu/Root.d.ts +0 -5
  40. package/dist/CommandMenu/SelectAllItem.d.ts +0 -4
  41. package/dist/CommandMenu/SelectedIndicator.d.ts +0 -5
  42. package/dist/CommandMenu/Separator.d.ts +0 -6
  43. package/dist/CommandMenu/Trigger.d.ts +0 -5
  44. package/dist/CommandMenu/context.d.ts +0 -22
  45. package/dist/CommandMenu/cva.d.ts +0 -25
  46. package/dist/CommandMenu/index.d.ts +0 -46
  47. package/dist/CommandMenu/typings.d.ts +0 -10
  48. package/dist/CommandMenu/utils.d.ts +0 -4
  49. package/dist/SelectContext/MultiSelectProvider.d.ts +0 -3
  50. package/dist/SelectContext/SingleSelectProvider.d.ts +0 -4
@@ -1,5 +1,5 @@
1
- import { ComponentPropsWithRef, FC, PropsWithChildren } from "react";
2
- export interface CheckedIndicatorProps extends Omit<ComponentPropsWithRef<"span">, "children"> {
1
+ import { FC, PropsWithChildren } from "react";
2
+ export interface CheckedIndicatorProps {
3
3
  children: PropsWithChildren["children"] | ((indeterminate: boolean) => PropsWithChildren["children"]);
4
4
  }
5
5
  export declare const CheckedIndicator: FC<CheckedIndicatorProps>;
@@ -1,3 +1,3 @@
1
1
  /// <reference types="react" />
2
2
  import type { MenuCheckboxIndicatorProps } from "../typings";
3
- export declare const MenuCheckboxItemIndicator: import("react").ForwardRefExoticComponent<Omit<MenuCheckboxIndicatorProps, "ref"> & import("react").RefAttributes<HTMLSpanElement>>;
3
+ export declare const MenuCheckboxItemIndicator: import("react").ForwardRefExoticComponent<MenuCheckboxIndicatorProps & import("react").RefAttributes<HTMLSpanElement>>;
@@ -0,0 +1,3 @@
1
+ /// <reference types="react" />
2
+ import type { SelectAllIndicatorProps } from "../typings";
3
+ export declare const MenuSelectAllIndicator: import("react").ForwardRefExoticComponent<SelectAllIndicatorProps & import("react").RefAttributes<HTMLSpanElement>>;
@@ -0,0 +1,6 @@
1
+ /// <reference types="react" />
2
+ interface ISelectAllContext {
3
+ selected: boolean | "indeterminate";
4
+ }
5
+ export declare const SelectAllContext: import("react").Context<ISelectAllContext>;
6
+ export {};
@@ -1 +1,2 @@
1
+ export * from "./SelectAllIndicator";
1
2
  export * from "./SelectAllItem";
@@ -1,4 +1,4 @@
1
1
  /// <reference types="react" />
2
2
  export declare const MenuSelectedIndicator: import("react").ForwardRefExoticComponent<{
3
3
  children?: import("react").ReactNode;
4
- } & import("react").RefAttributes<HTMLSpanElement>>;
4
+ } & import("react").RefAttributes<HTMLDivElement>>;
@@ -1,3 +1,7 @@
1
1
  /// <reference types="react" />
2
- export declare const SelectedIndicatorContext: import("react").Context<boolean>;
3
- export declare const useSelectedIndicatorContext: () => boolean;
2
+ interface ISelectedIndicatorContext {
3
+ selected: boolean;
4
+ }
5
+ export declare const SelectedIndicatorContext: import("react").Context<ISelectedIndicatorContext>;
6
+ export declare const useSelectedIndicatorContext: () => ISelectedIndicatorContext;
7
+ export {};
@@ -5,6 +5,9 @@ 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;
8
11
  export declare const menuContent: (props?: ({
9
12
  size?: "xs" | "sm" | "md" | "lg" | "xl" | null | undefined;
10
13
  radius?: "none" | "xs" | "sm" | "md" | "lg" | "xl" | "full" | null | undefined;
@@ -44,10 +44,11 @@ export declare const Menu: {
44
44
  MultiSelectItem: import("react").NamedExoticComponent<import("./typings").MenuSelectItemProps & import("react").RefAttributes<HTMLDivElement>>;
45
45
  SelectAllItem: import("react").ForwardRefExoticComponent<import("./typings").SelectAllItemProps & import("react").RefAttributes<HTMLDivElement>>;
46
46
  CheckboxItem: import("react").ForwardRefExoticComponent<import("./typings").MenuCheckboxItemProps & import("react").RefAttributes<HTMLDivElement>>;
47
+ SelectAllIndicator: import("react").ForwardRefExoticComponent<import("./typings").SelectAllIndicatorProps & import("react").RefAttributes<HTMLSpanElement>>;
47
48
  SelectedIndicator: import("react").ForwardRefExoticComponent<{
48
49
  children?: import("react").ReactNode;
49
- } & import("react").RefAttributes<HTMLSpanElement>>;
50
- CheckboxItemIndicator: import("react").ForwardRefExoticComponent<Omit<import("./typings").MenuCheckboxIndicatorProps, "ref"> & import("react").RefAttributes<HTMLSpanElement>>;
50
+ } & import("react").RefAttributes<HTMLDivElement>>;
51
+ CheckboxItemIndicator: import("react").ForwardRefExoticComponent<import("./typings").MenuCheckboxIndicatorProps & import("react").RefAttributes<HTMLSpanElement>>;
51
52
  InputRoot: import("react").NamedExoticComponent<import("./typings").MenuInputRootProps & import("react").RefAttributes<HTMLDivElement>>;
52
53
  InputField: import("react").NamedExoticComponent<Omit<import("./typings").MenuInputProps, "ref"> & import("react").RefAttributes<HTMLInputElement>>;
53
54
  InputSlot: import("react").NamedExoticComponent<import("./typings").MenuInputSlotProps & import("react").RefAttributes<HTMLDivElement>>;
@@ -4,7 +4,6 @@ import type { VariantProps } from "class-variance-authority";
4
4
  import { ComponentProps, 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";
8
7
  import type { AccentColorProps } from "../typings";
9
8
  import { menuItem } from "./cva";
10
9
  type MenuItemVariants = VariantProps<typeof menuItem>;
@@ -44,8 +43,11 @@ export interface MenuVirtualTriggerProps {
44
43
  }
45
44
  export interface MenuGroupProps extends PropsWithoutRef<ComponentProps<"div">> {
46
45
  }
47
- export type MenuSelectGroupProps = MenuGroupProps & SingleSelectProps;
48
- export interface MenuMultiSelectGroupProps extends MenuGroupProps, MultiSelectProps {
46
+ export interface MenuSelectGroupProps extends MenuGroupProps {
47
+ value: string | null;
48
+ onValueChange: (value: string | null) => void;
49
+ }
50
+ export interface MenuMultiSelectGroupProps extends MenuGroupProps {
49
51
  values: string[];
50
52
  onValuesChange: (values: string[]) => void;
51
53
  }
@@ -64,6 +66,7 @@ export interface MenuSelectItemProps extends MenuItemProps {
64
66
  value: string;
65
67
  }
66
68
  export interface SelectAllItemProps extends Omit<MenuItemProps, "children"> {
69
+ allValues: string[];
67
70
  children: ReactNode | ((meta: {
68
71
  active: boolean;
69
72
  selected: boolean | "indeterminate";
@@ -108,6 +111,9 @@ export interface MenuInputRootProps extends PropsWithoutRef<ComponentProps<"div"
108
111
  }
109
112
  export interface MenuInputSlotProps extends PropsWithoutRef<ComponentProps<"div">> {
110
113
  }
114
+ export interface SelectAllIndicatorProps extends Omit<PropsWithoutRef<ComponentProps<"span">>, "children"> {
115
+ children: ReactNode | ((indeterminate: boolean) => ReactNode);
116
+ }
111
117
  export interface MenuCheckboxIndicatorProps extends Omit<PropsWithoutRef<ComponentProps<"span">>, "children">, CheckedIndicatorProps {
112
118
  }
113
119
  export interface MenuScrollProps extends PropsWithoutRef<ComponentProps<"div">> {
@@ -1,11 +1,5 @@
1
- import type { CheckedState } from "../CheckedIndicator";
2
- import type { MenuAlignment, MenuSide } from "./typings";
1
+ import { MenuAlignment, MenuSide } from "./typings";
3
2
  export declare const computeOffsets: (side: MenuSide, alignment: MenuAlignment) => {
4
3
  mainAxis: number;
5
4
  crossAxis: number;
6
5
  };
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,14 @@
1
+ import { PropsWithChildren } from "react";
2
+ type SelectContextProviderProps = PropsWithChildren & ({
3
+ type: "single";
4
+ defaultValue?: string | null;
5
+ value?: string | null;
6
+ onValueChange?: (value: string | null) => void;
7
+ } | {
8
+ type: "multi";
9
+ defaultValues?: string[];
10
+ values?: string[];
11
+ onValuesChange?: (values: string[]) => void;
12
+ });
13
+ export declare const SelectContextProvider: import("react").MemoExoticComponent<(props: SelectContextProviderProps) => import("react/jsx-runtime").JSX.Element>;
14
+ export {};
@@ -1,15 +1,5 @@
1
1
  /// <reference types="react" />
2
- export interface ISelectContext {
3
- selectValue: (value: string) => void;
4
- selected: (value: string) => boolean;
5
- }
2
+ import { MultiSelectContext, SingleSelectContext } from "./typings";
3
+ export type ISelectContext = SingleSelectContext | MultiSelectContext;
6
4
  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;
11
- allSelected: boolean;
12
- someSelected: boolean;
13
- toggleSelectAll: () => void;
14
- }
15
- export declare const MultiSelectContext: import("react").Context<IMultiSelectContext>;
5
+ export declare function useSelectContext<Type = SingleSelectContext | MultiSelectContext>(): Type;
@@ -1,3 +1,3 @@
1
1
  export * from "./context";
2
- export * from "./MultiSelectProvider";
3
- export * from "./SingleSelectProvider";
2
+ export * from "./Provider";
3
+ export * from "./typings";
@@ -1,18 +1,10 @@
1
- type _SingleSelectProps<TValue> = {
2
- onValueChange?: (value: TValue) => void;
3
- defaultValue?: TValue;
4
- value?: TValue;
1
+ export type SingleSelectContext = {
2
+ type: "single";
3
+ value: string | null;
4
+ handleValueChange: (value: string | null) => void;
5
5
  };
6
- export type SingleSelectRequiredProps = _SingleSelectProps<string>;
7
- export type SingleSelectNotRequiredProps = _SingleSelectProps<string | null>;
8
- export type SingleSelectProps = (SingleSelectRequiredProps & {
9
- required: true;
10
- }) | (SingleSelectNotRequiredProps & {
11
- required: false;
12
- });
13
- export type MultiSelectProps = {
14
- onValuesChange?: (value: string[]) => void;
15
- defaultValues?: string[];
16
- values?: string[];
6
+ export type MultiSelectContext = {
7
+ type: "multi";
8
+ values: string[];
9
+ handleValuesChange: (value: string[]) => void;
17
10
  };
18
- export {};