@overmap-ai/blocks 0.0.10-alpha.2 → 0.0.10-alpha.3
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 +18 -9
- package/dist/DropdownMenu/index.d.ts +1 -1
- package/dist/Input/typings.d.ts +2 -1
- package/dist/Table/Table.d.ts +3 -0
- package/dist/Table/constants.d.ts +151 -0
- package/dist/Table/index.d.ts +3 -0
- package/dist/Table/typings.d.ts +63 -0
- package/dist/TextArea/typings.d.ts +2 -1
- package/dist/blocks.js +2045 -1358
- package/dist/blocks.js.map +1 -1
- package/dist/blocks.umd.cjs +16 -2
- package/dist/blocks.umd.cjs.map +1 -1
- package/dist/index.d.ts +2 -1
- package/dist/style.css +1 -1
- package/package.json +5 -2
- package/dist/DropdownMenu/typings.d.ts +0 -42
|
@@ -1,12 +1,21 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
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
|
|
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
|
|
2
|
+
export type { DropdownMenuProps, DropdownMenuItemProps } from "./DropdownMenu";
|
package/dist/Input/typings.d.ts
CHANGED
|
@@ -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
10
|
severity?: Exclude<Severity, "success" | "info">;
|
|
11
11
|
showInputLength?: boolean;
|
|
12
|
+
variant?: TextFieldInputProps["variant"] | "ghost";
|
|
12
13
|
}
|
|
13
14
|
export {};
|
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
export declare const TableData: string[][];
|
|
2
|
+
export declare const DefaultTableColumns: (sort?: boolean, search?: boolean, filter?: boolean) => ({
|
|
3
|
+
id: string;
|
|
4
|
+
label: string;
|
|
5
|
+
sort: boolean;
|
|
6
|
+
search: boolean;
|
|
7
|
+
filter?: undefined;
|
|
8
|
+
} | {
|
|
9
|
+
id: string;
|
|
10
|
+
label: string;
|
|
11
|
+
sort: boolean;
|
|
12
|
+
search: boolean;
|
|
13
|
+
filter: boolean;
|
|
14
|
+
} | {
|
|
15
|
+
id: string;
|
|
16
|
+
label: string;
|
|
17
|
+
sort: boolean;
|
|
18
|
+
search?: undefined;
|
|
19
|
+
filter?: undefined;
|
|
20
|
+
})[];
|
|
21
|
+
export declare const DefaultTableRows: (len: number) => {
|
|
22
|
+
id: string;
|
|
23
|
+
columns: {
|
|
24
|
+
full_name: {
|
|
25
|
+
id: string;
|
|
26
|
+
value: string | undefined;
|
|
27
|
+
label: string | undefined;
|
|
28
|
+
};
|
|
29
|
+
job_title: {
|
|
30
|
+
id: string;
|
|
31
|
+
value: string | undefined;
|
|
32
|
+
label: string | undefined;
|
|
33
|
+
};
|
|
34
|
+
gender: {
|
|
35
|
+
id: string;
|
|
36
|
+
value: string | undefined;
|
|
37
|
+
label: string | undefined;
|
|
38
|
+
};
|
|
39
|
+
age: {
|
|
40
|
+
id: string;
|
|
41
|
+
value: string | undefined;
|
|
42
|
+
label: string | undefined;
|
|
43
|
+
};
|
|
44
|
+
annual_salary: {
|
|
45
|
+
id: string;
|
|
46
|
+
value: string | undefined;
|
|
47
|
+
label: string | undefined;
|
|
48
|
+
};
|
|
49
|
+
country: {
|
|
50
|
+
id: string;
|
|
51
|
+
value: string | undefined;
|
|
52
|
+
label: string | undefined;
|
|
53
|
+
};
|
|
54
|
+
};
|
|
55
|
+
}[];
|
|
56
|
+
export declare const AdvancedTableColumns: () => ({
|
|
57
|
+
id: string;
|
|
58
|
+
label: string;
|
|
59
|
+
sort: boolean;
|
|
60
|
+
search: boolean;
|
|
61
|
+
width: string;
|
|
62
|
+
filter?: undefined;
|
|
63
|
+
filterValues?: undefined;
|
|
64
|
+
} | {
|
|
65
|
+
id: string;
|
|
66
|
+
label: string;
|
|
67
|
+
search: boolean;
|
|
68
|
+
filter: boolean;
|
|
69
|
+
width: string;
|
|
70
|
+
sort?: undefined;
|
|
71
|
+
filterValues?: undefined;
|
|
72
|
+
} | {
|
|
73
|
+
id: string;
|
|
74
|
+
label: string;
|
|
75
|
+
sort: boolean;
|
|
76
|
+
filter: boolean;
|
|
77
|
+
search?: undefined;
|
|
78
|
+
width?: undefined;
|
|
79
|
+
filterValues?: undefined;
|
|
80
|
+
} | {
|
|
81
|
+
id: string;
|
|
82
|
+
label: string;
|
|
83
|
+
sort: boolean;
|
|
84
|
+
search?: undefined;
|
|
85
|
+
width?: undefined;
|
|
86
|
+
filter?: undefined;
|
|
87
|
+
filterValues?: undefined;
|
|
88
|
+
} | {
|
|
89
|
+
id: string;
|
|
90
|
+
label: string;
|
|
91
|
+
sort: boolean;
|
|
92
|
+
filter: boolean;
|
|
93
|
+
filterValues: {
|
|
94
|
+
value: number;
|
|
95
|
+
label: import("react/jsx-runtime").JSX.Element;
|
|
96
|
+
}[];
|
|
97
|
+
search?: undefined;
|
|
98
|
+
width?: undefined;
|
|
99
|
+
} | {
|
|
100
|
+
id: string;
|
|
101
|
+
label: string;
|
|
102
|
+
sort?: undefined;
|
|
103
|
+
search?: undefined;
|
|
104
|
+
width?: undefined;
|
|
105
|
+
filter?: undefined;
|
|
106
|
+
filterValues?: undefined;
|
|
107
|
+
})[];
|
|
108
|
+
export declare const AdvancedTableRows: (len: number) => {
|
|
109
|
+
id: string;
|
|
110
|
+
onClick: () => void;
|
|
111
|
+
columns: {
|
|
112
|
+
full_name: {
|
|
113
|
+
id: string;
|
|
114
|
+
value: string | undefined;
|
|
115
|
+
label: string | undefined;
|
|
116
|
+
};
|
|
117
|
+
job_title: {
|
|
118
|
+
id: string;
|
|
119
|
+
value: string | undefined;
|
|
120
|
+
label: string | undefined;
|
|
121
|
+
};
|
|
122
|
+
gender: {
|
|
123
|
+
id: string;
|
|
124
|
+
value: string | undefined;
|
|
125
|
+
label: import("react/jsx-runtime").JSX.Element;
|
|
126
|
+
sortValue: number;
|
|
127
|
+
};
|
|
128
|
+
age: {
|
|
129
|
+
id: string;
|
|
130
|
+
value: string | undefined;
|
|
131
|
+
label: string | undefined;
|
|
132
|
+
};
|
|
133
|
+
annual_salary: {
|
|
134
|
+
id: string;
|
|
135
|
+
value: string | undefined;
|
|
136
|
+
label: string | undefined;
|
|
137
|
+
filterValue: number;
|
|
138
|
+
};
|
|
139
|
+
country: {
|
|
140
|
+
id: string;
|
|
141
|
+
value: string | undefined;
|
|
142
|
+
label: string | undefined;
|
|
143
|
+
searchValue: string;
|
|
144
|
+
};
|
|
145
|
+
remove_user: {
|
|
146
|
+
id: string;
|
|
147
|
+
value: number;
|
|
148
|
+
label: import("react/jsx-runtime").JSX.Element;
|
|
149
|
+
};
|
|
150
|
+
};
|
|
151
|
+
}[];
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { ReactNode } from "react";
|
|
2
|
+
export type IdLabel = string | number;
|
|
3
|
+
export type ValueLabel = IdLabel | null | undefined;
|
|
4
|
+
export type TableLabel = ValueLabel | ReactNode;
|
|
5
|
+
export interface FilterValue {
|
|
6
|
+
value: ValueLabel;
|
|
7
|
+
label: ReactNode;
|
|
8
|
+
}
|
|
9
|
+
export interface TableCell {
|
|
10
|
+
id: IdLabel;
|
|
11
|
+
value: ValueLabel;
|
|
12
|
+
label: TableLabel;
|
|
13
|
+
onClick?: (cell: TableCell) => void;
|
|
14
|
+
filterValue?: ValueLabel;
|
|
15
|
+
sortValue?: ValueLabel;
|
|
16
|
+
searchValue?: ValueLabel;
|
|
17
|
+
className?: string;
|
|
18
|
+
}
|
|
19
|
+
export interface TableColumn {
|
|
20
|
+
id: IdLabel;
|
|
21
|
+
label: TableLabel;
|
|
22
|
+
sort?: boolean;
|
|
23
|
+
search?: boolean;
|
|
24
|
+
filter?: boolean;
|
|
25
|
+
width?: string;
|
|
26
|
+
className?: string;
|
|
27
|
+
filterValues?: FilterValue[];
|
|
28
|
+
}
|
|
29
|
+
export interface TableRow {
|
|
30
|
+
id: IdLabel;
|
|
31
|
+
onClick?: (row: TableRow) => void;
|
|
32
|
+
className?: string;
|
|
33
|
+
columns: {
|
|
34
|
+
[columnId: string]: TableCell;
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
export interface TableProps {
|
|
38
|
+
columns: TableColumn[];
|
|
39
|
+
data: TableRow[];
|
|
40
|
+
color?: "light" | "dark";
|
|
41
|
+
title?: string | ReactNode;
|
|
42
|
+
description?: string | ReactNode;
|
|
43
|
+
rowsPerPage?: number[];
|
|
44
|
+
showSearchBar?: boolean;
|
|
45
|
+
searchBarPlaceholder?: string;
|
|
46
|
+
showSelect?: boolean;
|
|
47
|
+
showFilterButton?: boolean;
|
|
48
|
+
showContainer?: boolean;
|
|
49
|
+
showRowsPerPage?: boolean;
|
|
50
|
+
showPageNumber?: boolean;
|
|
51
|
+
showPageNavigation?: boolean;
|
|
52
|
+
children?: ReactNode;
|
|
53
|
+
/**
|
|
54
|
+
* Show top bar content which includes search bar, filter button, and edit and delete buttons
|
|
55
|
+
* @default false
|
|
56
|
+
*/
|
|
57
|
+
showTopBar?: boolean;
|
|
58
|
+
showBottomBar?: boolean;
|
|
59
|
+
className?: string;
|
|
60
|
+
columnClassName?: string;
|
|
61
|
+
rowClassName?: string;
|
|
62
|
+
cellClassName?: string;
|
|
63
|
+
}
|
|
@@ -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
|
}
|