@overmap-ai/blocks 0.0.1 → 0.0.2-alpha.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.
- package/dist/DropdownMenu/DropdownMenu.d.ts +12 -0
- package/dist/DropdownMenu/index.d.ts +2 -0
- package/dist/DropdownMenu/typings.d.ts +41 -0
- package/dist/Separator/Separator.d.ts +3 -0
- package/dist/Separator/index.d.ts +2 -0
- package/dist/Separator/typings.d.ts +19 -0
- package/dist/Toast/ToastProvider.d.ts +3 -1
- package/dist/blocks.js +516 -422
- package/dist/blocks.js.map +1 -1
- package/dist/blocks.umd.cjs +2 -2
- package/dist/blocks.umd.cjs.map +1 -1
- package/dist/index.d.ts +3 -1
- package/package.json +2 -1
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { FC } from "react";
|
|
2
|
+
import { DropdownMenuItemGroupProps, DropdownMenuItemProps, DropdownMenuProps, DropdownSubMenuProps } from "./typings.ts";
|
|
3
|
+
/** The DropdownMenu component is a user interface element that provides a list of options for the user to choose from.
|
|
4
|
+
* It is commonly used in web applications to present a set of related choices in a compact and organized manner.
|
|
5
|
+
* This DropdownMenu component is a wrapper around the Radix-UI DropdownMenu component that can be found here https://www.radix-ui.com/themes/docs/components/dropdown-menu */
|
|
6
|
+
export declare const Root: FC<DropdownMenuProps>;
|
|
7
|
+
export declare const DropdownMenu: {
|
|
8
|
+
Root: FC<DropdownMenuProps>;
|
|
9
|
+
ItemGroup: FC<DropdownMenuItemGroupProps>;
|
|
10
|
+
Item: FC<DropdownMenuItemProps>;
|
|
11
|
+
SubMenu: FC<DropdownSubMenuProps>;
|
|
12
|
+
};
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { DropdownMenu as RadixDropdownMenu } from "@radix-ui/themes";
|
|
2
|
+
import { ComponentProps, ReactNode } from "react";
|
|
3
|
+
import { Severity } from "../typings.ts";
|
|
4
|
+
type RadixDropdownMenuRootProps = ComponentProps<typeof RadixDropdownMenu.Root>;
|
|
5
|
+
type RadixDropdownMenuSubProps = ComponentProps<typeof RadixDropdownMenu.Sub>;
|
|
6
|
+
export interface DropdownMenuItemProps extends Omit<ComponentProps<typeof RadixDropdownMenu.Item>, "textValue"> {
|
|
7
|
+
/** content to be displayed within the DropdownMenuItem */
|
|
8
|
+
itemContent: ReactNode;
|
|
9
|
+
/** severity of the DropdownMenuItem, will overwrite any severity passed into DropdownMenu.Root */
|
|
10
|
+
severity?: Severity;
|
|
11
|
+
/** Determines if the DropdownMenu will close upon clicking the DropdownMenuItem
|
|
12
|
+
* @default true
|
|
13
|
+
* */
|
|
14
|
+
closeOnSelect?: boolean;
|
|
15
|
+
}
|
|
16
|
+
export interface DropdownMenuItemGroupProps extends Omit<ComponentProps<typeof RadixDropdownMenu.Group>, "asChild"> {
|
|
17
|
+
/** will render a separator within the DropdownMenu popover above the ItemGroup
|
|
18
|
+
* @default false
|
|
19
|
+
* */
|
|
20
|
+
separatorAbove?: boolean;
|
|
21
|
+
/** will render a separator within the DropdownMenu popover below the ItemGroup
|
|
22
|
+
* @default false
|
|
23
|
+
* */
|
|
24
|
+
separatorBelow?: boolean;
|
|
25
|
+
}
|
|
26
|
+
export interface DropdownMenuProps extends Omit<ComponentProps<typeof RadixDropdownMenu.Content>, "asChild" | "color"> {
|
|
27
|
+
defaultOpen?: RadixDropdownMenuRootProps["defaultOpen"];
|
|
28
|
+
open?: RadixDropdownMenuRootProps["open"];
|
|
29
|
+
onOpenChange?: RadixDropdownMenuRootProps["onOpenChange"];
|
|
30
|
+
modal?: RadixDropdownMenuRootProps["modal"];
|
|
31
|
+
severity?: Severity;
|
|
32
|
+
trigger: ReactNode;
|
|
33
|
+
label?: ReactNode;
|
|
34
|
+
}
|
|
35
|
+
export interface DropdownSubMenuProps extends Omit<ComponentProps<typeof RadixDropdownMenu.SubContent>, "asChild" | "color"> {
|
|
36
|
+
defaultOpen?: RadixDropdownMenuSubProps["defaultOpen"];
|
|
37
|
+
open?: RadixDropdownMenuSubProps["open"];
|
|
38
|
+
onOpenChange?: RadixDropdownMenuSubProps["onOpenChange"];
|
|
39
|
+
trigger: ReactNode;
|
|
40
|
+
}
|
|
41
|
+
export {};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { Flex, Text, Separator as RadixSeparator, MarginProps } from "@radix-ui/themes";
|
|
2
|
+
import { ComponentProps } from "react";
|
|
3
|
+
import { Severity } from "../typings.ts";
|
|
4
|
+
export interface SeparatorProps extends Omit<ComponentProps<typeof RadixSeparator>, "color" | "asChild" | keyof MarginProps> {
|
|
5
|
+
/** text to be displayed in the middle of the separator */
|
|
6
|
+
text?: string;
|
|
7
|
+
/** when text is passed in, gap specifies the distance between the left and right separators and the text
|
|
8
|
+
* @default "1"
|
|
9
|
+
* */
|
|
10
|
+
gap?: ComponentProps<typeof Flex>["gap"];
|
|
11
|
+
/** the weight of the text
|
|
12
|
+
* @default "light"
|
|
13
|
+
* */
|
|
14
|
+
weight?: ComponentProps<typeof Text>["weight"];
|
|
15
|
+
/** severity of the separator
|
|
16
|
+
* @default "info"
|
|
17
|
+
* */
|
|
18
|
+
severity?: Severity;
|
|
19
|
+
}
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import { FC } from "react";
|
|
2
|
-
import { ToastContextProviderProps } from "./typings";
|
|
2
|
+
import { ToastContextProviderProps, ToastProps } from "./typings";
|
|
3
|
+
/** this is a hack to allow toasts to be shown outside of components where hooks cannot be used */
|
|
4
|
+
export declare let unsafeShowToast: ((toastProps: ToastProps) => void) | undefined;
|
|
3
5
|
/** Toasts will be displayed in the top-right handle corner of the screen */
|
|
4
6
|
export declare const ToastProvider: FC<ToastContextProviderProps>;
|