@overmap-ai/blocks 0.0.11-alpha.1 → 1.0.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/README.md CHANGED
@@ -1,3 +1,3 @@
1
- # overmap-ai blocks
2
-
3
- Contains basic components used by overmap-ai libraries.
1
+ # overmap-ai blocks
2
+
3
+ Contains basic components used by overmap-ai libraries.
@@ -0,0 +1,27 @@
1
+ import { Link } from "@radix-ui/themes";
2
+ import { FlexProps } from "../Flex";
3
+ import { ComponentProps, HTMLProps, ReactNode } from "react";
4
+ import { Severity } from "../typings.ts";
5
+ export interface BreadcrumbItemProps extends Omit<HTMLProps<HTMLAnchorElement>, "size" | "ref" | "color"> {
6
+ }
7
+ export declare const Item: import("react").MemoExoticComponent<import("react").ForwardRefExoticComponent<BreadcrumbItemProps & import("react").RefAttributes<HTMLAnchorElement>>>;
8
+ export interface BreadcrumbGroupProps extends Omit<HTMLProps<HTMLDivElement>, "height" | "width" | "wrap" | "ref" | "size"> {
9
+ children: ReactNode;
10
+ /** The separator used in between Breadcrumb items*/
11
+ separator: ReactNode;
12
+ /** The severity of the items in the Breadcrumb
13
+ * @default "info"
14
+ * */
15
+ severity?: Severity;
16
+ /** The text size of the items in the Breadcrumb */
17
+ size?: ComponentProps<typeof Link>["size"];
18
+ /** The gap between Breadcrumb items
19
+ * @default "2"
20
+ * */
21
+ gap?: FlexProps["gap"];
22
+ }
23
+ export declare const Group: import("react").MemoExoticComponent<import("react").ForwardRefExoticComponent<BreadcrumbGroupProps & import("react").RefAttributes<HTMLDivElement>>>;
24
+ export declare const Breadcrumb: {
25
+ Group: import("react").MemoExoticComponent<import("react").ForwardRefExoticComponent<BreadcrumbGroupProps & import("react").RefAttributes<HTMLDivElement>>>;
26
+ Item: import("react").MemoExoticComponent<import("react").ForwardRefExoticComponent<BreadcrumbItemProps & import("react").RefAttributes<HTMLAnchorElement>>>;
27
+ };
@@ -0,0 +1,10 @@
1
+ import type { Severity } from "../typings.ts";
2
+ import { ComponentProps } from "react";
3
+ import { Link } from "@radix-ui/themes";
4
+ interface IBreadcrumbContext {
5
+ severity: Severity;
6
+ size: ComponentProps<typeof Link>["size"];
7
+ }
8
+ export declare const BreadcrumbContext: import("react").Context<IBreadcrumbContext>;
9
+ export declare const useBreadcrumbContext: () => IBreadcrumbContext;
10
+ export {};
@@ -0,0 +1,2 @@
1
+ export { Breadcrumb } from "./Breadcrumb";
2
+ export type { BreadcrumbGroupProps, BreadcrumbItemProps } from "./Breadcrumb";
@@ -0,0 +1,6 @@
1
+ import { ReactNode } from "react";
2
+ import { BadgeProps } from "../Badge";
3
+ export interface CornerBadgeProps extends BadgeProps {
4
+ children: ReactNode;
5
+ }
6
+ export declare const CornerBadge: import("react").MemoExoticComponent<import("react").ForwardRefExoticComponent<Omit<CornerBadgeProps, "ref"> & import("react").RefAttributes<HTMLDivElement>>>;
@@ -0,0 +1,2 @@
1
+ export * from "./CornerBadge";
2
+ export type { CornerBadgeProps } from "./CornerBadge";
@@ -1,12 +1,21 @@
1
- import { FC } from "react";
2
- import { DropdownMenuItemGroupProps, DropdownMenuItemProps, DropdownMenuProps, DropdownSubMenuProps } from "./typings.ts";
1
+ import { DropdownMenu as RadixDropdownMenu } from "@radix-ui/themes";
2
+ import { ComponentProps, FC, ReactElement, ReactNode } from "react";
3
+ import { Severity } from "../typings.ts";
4
+ export interface DropdownMenuItemProps extends Omit<ComponentProps<typeof RadixDropdownMenu.Item>, "textValue" | "asChild" | "children" | "color" | "content"> {
5
+ content: ReactNode;
6
+ closeOnSelect?: boolean;
7
+ separator?: boolean;
8
+ }
9
+ export interface DropdownMenuProps extends Omit<ComponentProps<typeof RadixDropdownMenu.Content>, "asChild" | "color" | "children"> {
10
+ severity?: Severity;
11
+ disabled?: boolean;
12
+ label?: string;
13
+ trigger: ReactElement;
14
+ items: DropdownMenuItemProps[];
15
+ modal?: boolean;
16
+ closeOnSelect?: boolean;
17
+ }
3
18
  /** The DropdownMenu component is a user interface element that provides a list of options for the user to choose from.
4
19
  * It is commonly used in web applications to present a set of related choices in a compact and organized manner.
5
20
  * 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
- };
21
+ export declare const DropdownMenu: FC<DropdownMenuProps>;
@@ -1,2 +1,2 @@
1
1
  export { DropdownMenu } from "./DropdownMenu";
2
- export * from "./typings.ts";
2
+ export type { DropdownMenuProps, DropdownMenuItemProps } from "./DropdownMenu";
@@ -0,0 +1,58 @@
1
+ import { DropdownMenu as RadixDropdownMenu } from "@radix-ui/themes";
2
+ import { ComponentProps, FC, ReactElement, ReactNode } from "react";
3
+ import { Severity } from "../typings.ts";
4
+ export interface DropdownSelectIconProps {
5
+ leftInputIcon?: ReactNode;
6
+ rightInputIcon?: ReactNode;
7
+ selectedItemIcon?: ReactNode;
8
+ }
9
+ export interface DropdownSelectItemProps {
10
+ /** the content to rendered for the dropdown select item */
11
+ content: ReactNode;
12
+ value: string;
13
+ /** the disabled state of the dropdown select item
14
+ * @default false
15
+ * */
16
+ disabled?: boolean;
17
+ }
18
+ export type DropdownSelectProps = {
19
+ /** currently selected value of the dropdown select*/
20
+ value: string | undefined;
21
+ /** callback fired when an item in the dropdown select is clicked*/
22
+ onValueChange: (value: string | undefined) => void;
23
+ /** a ReactElement representing the trigger for the dropdown select, must be clickable*/
24
+ trigger: ReactElement;
25
+ /** the selectable items to be displayed in the dropdown select */
26
+ items: DropdownSelectItemProps[];
27
+ /** the disabled state of the dropdown select
28
+ * @default false
29
+ * */
30
+ disabled?: boolean;
31
+ /** placeholder for the user input contained within the dropdown select */
32
+ placeholder?: string;
33
+ /** determines if the dropdown select should close after selecting an item
34
+ * @default true
35
+ * */
36
+ closeOnSelect?: boolean;
37
+ /** a set of icons to be fill the different icon spots within the dropdown select */
38
+ icons?: DropdownSelectIconProps;
39
+ /** determines on which side of the trigger the dropdown select renders on, if open space
40
+ * @default "bottom"
41
+ * */
42
+ side?: ComponentProps<typeof RadixDropdownMenu.Content>["side"];
43
+ /** severity of the dropdown select
44
+ * @default "info"
45
+ * */
46
+ severity?: Severity;
47
+ } & ({
48
+ /** the current value in the user input contained within the dropdown select */
49
+ filterValue: undefined;
50
+ /** callback fired when an item in the dropdown select is clicked*/
51
+ onFilterValueChange: undefined;
52
+ } | {
53
+ /** the current value in the user input contained within the dropdown select */
54
+ filterValue: string;
55
+ /** callback fired when an item in the dropdown select is clicked*/
56
+ onFilterValueChange: (value: string) => void;
57
+ });
58
+ export declare const DropdownSelect: FC<DropdownSelectProps>;
@@ -0,0 +1,2 @@
1
+ export { DropdownSelect } from "./DropdownSelect";
2
+ export type { DropdownSelectProps, DropdownSelectItemProps, DropdownSelectIconProps } from "./DropdownSelect";
@@ -0,0 +1,17 @@
1
+ import { ComponentProps, ReactElement } from "react";
2
+ import { Theme } from "@radix-ui/themes";
3
+ import { Severity } from "../typings.ts";
4
+ interface IconColorUtilityProps {
5
+ children: ReactElement;
6
+ }
7
+ interface IconColorUtilitySeverityProps extends IconColorUtilityProps {
8
+ severity: Severity;
9
+ color?: undefined;
10
+ }
11
+ interface IconColorUtilityColorProps extends IconColorUtilityProps {
12
+ color: Exclude<ComponentProps<typeof Theme>["accentColor"], undefined>;
13
+ severity?: undefined;
14
+ }
15
+ /** This component is used to provide Icons color based on Severity or a Radix theme accentColor */
16
+ export declare const IconColorUtility: import("react").NamedExoticComponent<IconColorUtilitySeverityProps | IconColorUtilityColorProps>;
17
+ export {};
@@ -0,0 +1 @@
1
+ export * from "./IconColorUtility";
@@ -3,11 +3,12 @@ import { Responsive, TextField as RadixTextField } from "@radix-ui/themes";
3
3
  import { Severity, Size } from "../typings.ts";
4
4
  import { MarginProps } from "@radix-ui/themes";
5
5
  type TextFieldInputProps = React.ComponentProps<typeof RadixTextField.Input>;
6
- export interface InputProps extends Omit<TextFieldInputProps, "size" | "color" | "radius" | keyof MarginProps> {
6
+ export interface InputProps extends Omit<TextFieldInputProps, "size" | "color" | "radius" | "variant" | keyof MarginProps> {
7
7
  leftSlot?: React.ReactNode;
8
8
  rightSlot?: React.ReactNode;
9
9
  size?: Responsive<Size>;
10
- severity?: Exclude<Severity, "success" | "info">;
10
+ severity?: Severity;
11
11
  showInputLength?: boolean;
12
+ variant?: TextFieldInputProps["variant"] | "ghost";
12
13
  }
13
14
  export {};
@@ -1,4 +1,3 @@
1
1
  import { FC } from "react";
2
2
  import { TableProps } from "./typings";
3
- declare const Table: FC<TableProps>;
4
- export default Table;
3
+ export declare const Table: FC<TableProps>;
@@ -1,7 +1,7 @@
1
1
  import { ComponentProps } from "react";
2
2
  import { TextArea as RadixTextArea, MarginProps } from "@radix-ui/themes";
3
3
  import { Severity } from "../typings.ts";
4
- export interface TextAreaProps extends Omit<ComponentProps<typeof RadixTextArea>, keyof MarginProps | "color"> {
4
+ export interface TextAreaProps extends Omit<ComponentProps<typeof RadixTextArea>, keyof MarginProps | "color" | "variant"> {
5
5
  /** used to set the severity of the TextArea, supports all 5 global severities
6
6
  * @default "primary"
7
7
  * */
@@ -12,4 +12,5 @@ export interface TextAreaProps extends Omit<ComponentProps<typeof RadixTextArea>
12
12
  showInputLength?: boolean;
13
13
  resize: "vertical" | "horizontal" | "both";
14
14
  inputLengthTemplate?: string;
15
+ variant?: ComponentProps<typeof RadixTextArea>["variant"] | "ghost";
15
16
  }
@@ -47,4 +47,5 @@ export interface IToastContext {
47
47
  showSuccess: (simpleMessage: SimpleToastProps) => void;
48
48
  showInfo: (simpleMessage: SimpleToastProps) => void;
49
49
  showError: (simpleMessage: SimpleToastProps) => void;
50
+ showWarning: (simpleMessage: SimpleToastProps) => void;
50
51
  }