@rebasepro/ui 0.2.3 → 0.2.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/components/Button.d.ts +2 -2
- package/dist/components/ErrorBoundary.d.ts +25 -3
- package/dist/components/VirtualTable/VirtualTable.d.ts +1 -1
- package/dist/components/VirtualTable/VirtualTableCell.d.ts +6 -6
- package/dist/components/VirtualTable/VirtualTableHeader.d.ts +8 -8
- package/dist/components/VirtualTable/VirtualTableHeaderRow.d.ts +1 -1
- package/dist/components/VirtualTable/VirtualTableProps.d.ts +11 -11
- package/dist/components/VirtualTable/VirtualTableRow.d.ts +1 -1
- package/dist/components/VirtualTable/types.d.ts +9 -9
- package/dist/hooks/useDebounceCallback.d.ts +1 -1
- package/dist/index.es.js +126 -67
- package/dist/index.es.js.map +1 -1
- package/dist/index.umd.js +121 -62
- package/dist/index.umd.js.map +1 -1
- package/dist/util/debounce.d.ts +1 -1
- package/package.json +2 -2
- package/src/components/BooleanSwitch.tsx +1 -1
- package/src/components/Button.tsx +5 -5
- package/src/components/ErrorBoundary.tsx +171 -18
- package/src/components/MultiSelect.tsx +6 -6
- package/src/components/SearchBar.tsx +1 -1
- package/src/components/Tabs.tsx +2 -2
- package/src/components/TextareaAutosize.tsx +2 -2
- package/src/components/VirtualTable/VirtualTable.tsx +8 -8
- package/src/components/VirtualTable/VirtualTableCell.tsx +6 -6
- package/src/components/VirtualTable/VirtualTableHeader.tsx +15 -15
- package/src/components/VirtualTable/VirtualTableHeaderRow.tsx +6 -6
- package/src/components/VirtualTable/VirtualTableProps.tsx +11 -11
- package/src/components/VirtualTable/VirtualTableRow.tsx +2 -2
- package/src/components/VirtualTable/types.tsx +9 -9
- package/src/hooks/useDebounceCallback.tsx +2 -1
- package/src/util/debounce.ts +2 -1
- package/src/scripts/migrateIconImports.ts +0 -108
- package/src/scripts/test.ts +0 -6
|
@@ -9,6 +9,6 @@ export type ButtonProps<C extends React.ElementType = "button"> = {
|
|
|
9
9
|
fullWidth?: boolean;
|
|
10
10
|
className?: string;
|
|
11
11
|
component?: C;
|
|
12
|
-
onClick?: React.MouseEventHandler<
|
|
12
|
+
onClick?: React.MouseEventHandler<HTMLElement>;
|
|
13
13
|
} & React.ComponentPropsWithoutRef<C>;
|
|
14
|
-
export declare const Button: React.FC<ButtonProps<
|
|
14
|
+
export declare const Button: React.FC<ButtonProps<React.ElementType>>;
|
|
@@ -1,11 +1,33 @@
|
|
|
1
1
|
import React, { ErrorInfo, PropsWithChildren } from "react";
|
|
2
|
-
export
|
|
2
|
+
export interface ErrorBoundaryProps {
|
|
3
|
+
/**
|
|
4
|
+
* When true, renders a full-page centered error screen instead of the
|
|
5
|
+
* compact inline error. Intended for wrapping top-level app roots or
|
|
6
|
+
* major route sections.
|
|
7
|
+
*/
|
|
8
|
+
fullPage?: boolean;
|
|
9
|
+
/**
|
|
10
|
+
* Optional callback invoked when the user clicks "Try again". If provided,
|
|
11
|
+
* the boundary resets its error state and calls this handler. If omitted,
|
|
12
|
+
* the "Try again" button resets the boundary state, re-mounting children.
|
|
13
|
+
*/
|
|
14
|
+
onReset?: () => void;
|
|
15
|
+
}
|
|
16
|
+
interface ErrorBoundaryState {
|
|
3
17
|
error: Error | null;
|
|
4
|
-
|
|
5
|
-
|
|
18
|
+
showDetails: boolean;
|
|
19
|
+
}
|
|
20
|
+
export declare class ErrorBoundary extends React.Component<PropsWithChildren<ErrorBoundaryProps>, ErrorBoundaryState> {
|
|
21
|
+
constructor(props: PropsWithChildren<ErrorBoundaryProps>);
|
|
6
22
|
static getDerivedStateFromError(error: Error): {
|
|
7
23
|
error: Error;
|
|
8
24
|
};
|
|
9
25
|
componentDidCatch(error: Error, _errorInfo: ErrorInfo): void;
|
|
26
|
+
private handleReset;
|
|
27
|
+
private handleReload;
|
|
28
|
+
private toggleDetails;
|
|
10
29
|
render(): string | number | bigint | boolean | Iterable<React.ReactNode> | Promise<string | number | bigint | boolean | React.ReactPortal | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | Iterable<React.ReactNode> | null | undefined> | import("react/jsx-runtime").JSX.Element | null | undefined;
|
|
30
|
+
private renderInline;
|
|
31
|
+
private renderFullPage;
|
|
11
32
|
}
|
|
33
|
+
export {};
|
|
@@ -8,4 +8,4 @@ import { VirtualTableProps } from "./VirtualTableProps";
|
|
|
8
8
|
*
|
|
9
9
|
* @group Components
|
|
10
10
|
*/
|
|
11
|
-
export declare const VirtualTable: React.NamedExoticComponent<VirtualTableProps<
|
|
11
|
+
export declare const VirtualTable: React.NamedExoticComponent<VirtualTableProps<Record<string, unknown>>>;
|
|
@@ -4,18 +4,18 @@ type VirtualTableCellProps<T> = {
|
|
|
4
4
|
dataKey: string;
|
|
5
5
|
column: VirtualTableColumn;
|
|
6
6
|
columns: VirtualTableColumn[];
|
|
7
|
-
rowData:
|
|
8
|
-
cellData:
|
|
9
|
-
rowIndex:
|
|
7
|
+
rowData: T;
|
|
8
|
+
cellData: unknown;
|
|
9
|
+
rowIndex: number;
|
|
10
10
|
columnIndex: number;
|
|
11
11
|
cellRenderer: (props: CellRendererParams<T>) => React.ReactNode;
|
|
12
12
|
sortableNodeRef?: (node: HTMLElement | null) => void;
|
|
13
13
|
sortableStyle?: React.CSSProperties;
|
|
14
|
-
sortableAttributes?: Record<string,
|
|
14
|
+
sortableAttributes?: Record<string, unknown>;
|
|
15
15
|
isDragging?: boolean;
|
|
16
16
|
isDraggable?: boolean;
|
|
17
17
|
frozen?: boolean;
|
|
18
|
-
extraData?:
|
|
18
|
+
extraData?: unknown;
|
|
19
19
|
};
|
|
20
|
-
export declare const VirtualTableCell: React.NamedExoticComponent<VirtualTableCellProps<
|
|
20
|
+
export declare const VirtualTableCell: React.NamedExoticComponent<VirtualTableCellProps<unknown>>;
|
|
21
21
|
export {};
|
|
@@ -2,28 +2,28 @@ import React from "react";
|
|
|
2
2
|
import { VirtualTableColumn, VirtualTableSort, VirtualTableWhereFilterOp } from "./VirtualTableProps";
|
|
3
3
|
export type FilterFormFieldProps<CustomProps> = {
|
|
4
4
|
id: React.Key;
|
|
5
|
-
filterValue: [VirtualTableWhereFilterOp,
|
|
6
|
-
setFilterValue: (filterValue?: [VirtualTableWhereFilterOp,
|
|
5
|
+
filterValue: [VirtualTableWhereFilterOp, unknown] | undefined;
|
|
6
|
+
setFilterValue: (filterValue?: [VirtualTableWhereFilterOp, unknown]) => void;
|
|
7
7
|
column: VirtualTableColumn<CustomProps>;
|
|
8
8
|
hidden: boolean;
|
|
9
9
|
setHidden: (hidden: boolean) => void;
|
|
10
10
|
};
|
|
11
|
-
type VirtualTableHeaderProps<M extends Record<string,
|
|
11
|
+
type VirtualTableHeaderProps<M extends Record<string, unknown>> = {
|
|
12
12
|
resizeHandleRef: React.Ref<HTMLDivElement>;
|
|
13
13
|
columnIndex: number;
|
|
14
14
|
isResizingIndex: number;
|
|
15
|
-
column: VirtualTableColumn<
|
|
15
|
+
column: VirtualTableColumn<unknown>;
|
|
16
16
|
onColumnSort: (key: Extract<keyof M, string>) => void;
|
|
17
|
-
filter?: [VirtualTableWhereFilterOp,
|
|
17
|
+
filter?: [VirtualTableWhereFilterOp, unknown];
|
|
18
18
|
sort: VirtualTableSort;
|
|
19
|
-
onFilterUpdate: (column: VirtualTableColumn, filterForProperty?: [VirtualTableWhereFilterOp,
|
|
19
|
+
onFilterUpdate: (column: VirtualTableColumn, filterForProperty?: [VirtualTableWhereFilterOp, unknown]) => void;
|
|
20
20
|
onClickResizeColumn?: (columnIndex: number, column: VirtualTableColumn) => void;
|
|
21
|
-
createFilterField?: (props: FilterFormFieldProps<
|
|
21
|
+
createFilterField?: (props: FilterFormFieldProps<unknown>) => React.ReactNode;
|
|
22
22
|
AdditionalHeaderWidget?: (props: {
|
|
23
23
|
onHover: boolean;
|
|
24
24
|
}) => React.ReactNode;
|
|
25
25
|
isDragging?: boolean;
|
|
26
26
|
isDraggable?: boolean;
|
|
27
27
|
};
|
|
28
|
-
export declare const VirtualTableHeader: React.FunctionComponent<VirtualTableHeaderProps<
|
|
28
|
+
export declare const VirtualTableHeader: React.FunctionComponent<VirtualTableHeaderProps<Record<string, unknown>>>;
|
|
29
29
|
export {};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { VirtualTableContextProps } from "./types";
|
|
2
|
-
export declare const VirtualTableHeaderRow: ({ columns, currentSort, onColumnSort, onFilterUpdate, sortByProperty, filter, onColumnResize, onColumnResizeEnd, createFilterField, AddColumnComponent, onColumnsOrderChange, data, cellRenderer: CellRenderer, rowHeight, draggingColumnId, headerHeight }: VirtualTableContextProps<
|
|
2
|
+
export declare const VirtualTableHeaderRow: ({ columns, currentSort, onColumnSort, onFilterUpdate, sortByProperty, filter, onColumnResize, onColumnResizeEnd, createFilterField, AddColumnComponent, onColumnsOrderChange, data, cellRenderer: CellRenderer, rowHeight, draggingColumnId, headerHeight }: VirtualTableContextProps<Record<string, unknown>>) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { FilterFormFieldProps } from "./VirtualTableHeader";
|
|
3
|
-
export type OnRowClickParams<T extends Record<string,
|
|
3
|
+
export type OnRowClickParams<T extends Record<string, unknown>> = {
|
|
4
4
|
rowData: T;
|
|
5
5
|
rowIndex: number;
|
|
6
6
|
event: React.SyntheticEvent;
|
|
@@ -9,7 +9,7 @@ export type OnRowClickParams<T extends Record<string, any>> = {
|
|
|
9
9
|
* @see Table
|
|
10
10
|
* @group Components
|
|
11
11
|
*/
|
|
12
|
-
export interface VirtualTableProps<T extends Record<string,
|
|
12
|
+
export interface VirtualTableProps<T extends Record<string, unknown>> {
|
|
13
13
|
/**
|
|
14
14
|
* Array of arbitrary data
|
|
15
15
|
*/
|
|
@@ -61,12 +61,12 @@ export interface VirtualTableProps<T extends Record<string, any>> {
|
|
|
61
61
|
/**
|
|
62
62
|
* In case this table should have some filters set by default
|
|
63
63
|
*/
|
|
64
|
-
filter?: VirtualTableFilterValues<
|
|
64
|
+
filter?: VirtualTableFilterValues<string>;
|
|
65
65
|
/**
|
|
66
66
|
* Callback used when filters are updated
|
|
67
67
|
* @param filter
|
|
68
68
|
*/
|
|
69
|
-
onFilterUpdate?: (filter?: VirtualTableFilterValues<
|
|
69
|
+
onFilterUpdate?: (filter?: VirtualTableFilterValues<string> | undefined) => void;
|
|
70
70
|
/**
|
|
71
71
|
* Callback when the table is scrolled
|
|
72
72
|
* @param props
|
|
@@ -111,7 +111,7 @@ export interface VirtualTableProps<T extends Record<string, any>> {
|
|
|
111
111
|
* Callback to create a filter field, displayed in the header as a dropdown
|
|
112
112
|
* @param props
|
|
113
113
|
*/
|
|
114
|
-
createFilterField?: (props: FilterFormFieldProps<
|
|
114
|
+
createFilterField?: (props: FilterFormFieldProps<unknown>) => React.ReactNode;
|
|
115
115
|
/**
|
|
116
116
|
* Class name applied to the table
|
|
117
117
|
*/
|
|
@@ -141,9 +141,9 @@ export interface VirtualTableProps<T extends Record<string, any>> {
|
|
|
141
141
|
/**
|
|
142
142
|
* Extra data passed to the cell renderer
|
|
143
143
|
*/
|
|
144
|
-
extraData?:
|
|
144
|
+
extraData?: unknown;
|
|
145
145
|
}
|
|
146
|
-
export type CellRendererParams<T =
|
|
146
|
+
export type CellRendererParams<T = unknown> = {
|
|
147
147
|
column: VirtualTableColumn;
|
|
148
148
|
columns: VirtualTableColumn[];
|
|
149
149
|
columnIndex: number;
|
|
@@ -153,17 +153,17 @@ export type CellRendererParams<T = any> = {
|
|
|
153
153
|
isScrolling?: boolean;
|
|
154
154
|
sortableNodeRef?: (node: HTMLElement | null) => void;
|
|
155
155
|
sortableStyle?: React.CSSProperties;
|
|
156
|
-
sortableAttributes?: Record<string,
|
|
156
|
+
sortableAttributes?: Record<string, unknown>;
|
|
157
157
|
isDragging?: boolean;
|
|
158
158
|
isDraggable?: boolean;
|
|
159
159
|
frozen?: boolean;
|
|
160
|
-
extraData?:
|
|
160
|
+
extraData?: unknown;
|
|
161
161
|
};
|
|
162
162
|
/**
|
|
163
163
|
* @see Table
|
|
164
164
|
* @group Components
|
|
165
165
|
*/
|
|
166
|
-
export interface VirtualTableColumn<CustomProps =
|
|
166
|
+
export interface VirtualTableColumn<CustomProps = unknown> {
|
|
167
167
|
/**
|
|
168
168
|
* Data key for the cell value, could be "a.b.c"
|
|
169
169
|
*/
|
|
@@ -233,7 +233,7 @@ export type VirtualTableSort = "asc" | "desc" | undefined;
|
|
|
233
233
|
* @see Table
|
|
234
234
|
* @group Components
|
|
235
235
|
*/
|
|
236
|
-
export type VirtualTableFilterValues<Key extends string> = Partial<Record<Key, [VirtualTableWhereFilterOp,
|
|
236
|
+
export type VirtualTableFilterValues<Key extends string> = Partial<Record<Key, [VirtualTableWhereFilterOp, unknown]>>;
|
|
237
237
|
/**
|
|
238
238
|
* Filter conditions in a `Query.where()` clause are specified using the
|
|
239
239
|
* strings `<`, `<=`, `==`, `>=`, `>`, `array-contains`, `in`, and `array-contains-any`.
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { VirtualTableRowProps } from "./types";
|
|
3
|
-
export declare const VirtualTableRow: React.NamedExoticComponent<VirtualTableRowProps<
|
|
3
|
+
export declare const VirtualTableRow: React.NamedExoticComponent<VirtualTableRowProps<Record<string, unknown>>>;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { CellRendererParams, OnRowClickParams, OnVirtualTableColumnResizeParams, VirtualTableColumn, VirtualTableFilterValues, VirtualTableWhereFilterOp } from "./VirtualTableProps";
|
|
3
3
|
import { FilterFormFieldProps } from "./VirtualTableHeader";
|
|
4
|
-
export type VirtualTableRowProps<T
|
|
5
|
-
style:
|
|
4
|
+
export type VirtualTableRowProps<T extends Record<string, unknown>> = {
|
|
5
|
+
style: React.CSSProperties;
|
|
6
6
|
rowHeight: number;
|
|
7
7
|
rowData: T;
|
|
8
8
|
rowIndex: number;
|
|
9
|
-
onRowClick?: (props: OnRowClickParams<
|
|
9
|
+
onRowClick?: (props: OnRowClickParams<Record<string, unknown>>) => void;
|
|
10
10
|
children: React.ReactNode[];
|
|
11
11
|
columns: VirtualTableColumn[];
|
|
12
12
|
hoverRow?: boolean;
|
|
@@ -19,20 +19,20 @@ export type VirtualTableContextProps<T> = {
|
|
|
19
19
|
columns: VirtualTableColumn[];
|
|
20
20
|
cellRenderer: React.ComponentType<CellRendererParams<T>>;
|
|
21
21
|
currentSort: "asc" | "desc" | undefined;
|
|
22
|
-
filter?: VirtualTableFilterValues<
|
|
23
|
-
onRowClick?: (props: OnRowClickParams<
|
|
24
|
-
onColumnSort: (key: string) =>
|
|
22
|
+
filter?: VirtualTableFilterValues<string>;
|
|
23
|
+
onRowClick?: (props: OnRowClickParams<Record<string, unknown>>) => void;
|
|
24
|
+
onColumnSort: (key: string) => void;
|
|
25
25
|
onColumnResize: (params: OnVirtualTableColumnResizeParams) => void;
|
|
26
26
|
onColumnResizeEnd: (params: OnVirtualTableColumnResizeParams) => void;
|
|
27
|
-
onFilterUpdate: (column: VirtualTableColumn, filterForProperty?: [VirtualTableWhereFilterOp,
|
|
27
|
+
onFilterUpdate: (column: VirtualTableColumn, filterForProperty?: [VirtualTableWhereFilterOp, unknown]) => void;
|
|
28
28
|
sortByProperty?: string;
|
|
29
29
|
customView?: React.ReactNode;
|
|
30
30
|
hoverRow: boolean;
|
|
31
|
-
createFilterField?: (props: FilterFormFieldProps<
|
|
31
|
+
createFilterField?: (props: FilterFormFieldProps<unknown>) => React.ReactNode;
|
|
32
32
|
rowClassName?: (rowData: T) => string | undefined;
|
|
33
33
|
endAdornment?: React.ReactNode;
|
|
34
34
|
AddColumnComponent?: React.ComponentType;
|
|
35
35
|
onColumnsOrderChange?: (columns: VirtualTableColumn[]) => void;
|
|
36
36
|
draggingColumnId?: string | null;
|
|
37
|
-
extraData?:
|
|
37
|
+
extraData?: unknown;
|
|
38
38
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare function useDebounceCallback<T extends (...args: any[]) =>
|
|
1
|
+
export declare function useDebounceCallback<T extends (...args: any[]) => unknown>(callback?: T, delay?: number): T;
|
package/dist/index.es.js
CHANGED
|
@@ -6,8 +6,8 @@ import { twMerge } from "tailwind-merge";
|
|
|
6
6
|
import * as React from "react";
|
|
7
7
|
import React__default, { createContext, useContext, useEffect, useRef, useState, Children, forwardRef, useLayoutEffect, useId, useDeferredValue, useMemo, createRef, useCallback } from "react";
|
|
8
8
|
import * as Collapsible from "@radix-ui/react-collapsible";
|
|
9
|
-
import { AlertCircleIcon, MinusIcon, CheckIcon, CalendarIcon, XIcon,
|
|
10
|
-
import { AlertCircleIcon as AlertCircleIcon2, AlertTriangleIcon, AlignLeftIcon, AppWindow, ArrowDownToLineIcon, ArrowLeftIcon, ArrowRightFromLineIcon, ArrowRightIcon, ArrowRightToLineIcon, ArrowUpToLineIcon, BoldIcon, BookOpenIcon, CalendarIcon as CalendarIcon2, CheckCircleIcon, CheckIcon as CheckIcon2, CheckSquareIcon, ChevronDownIcon as ChevronDownIcon2, ChevronLeftIcon as ChevronLeftIcon2, ChevronRightIcon as ChevronRightIcon2, ChevronUpIcon, ChevronsLeftIcon, ChevronsRightIcon, ChevronsUpDownIcon, CircleIcon, CircleUserIcon, CodeIcon, ColumnsIcon, CopyIcon, DatabaseIcon, DownloadIcon, ExternalLinkIcon, EyeIcon, EyeOffIcon, FileIcon, FileSearchIcon, FileTextIcon, FilterIcon as FilterIcon2, FilterXIcon, FlagIcon, FolderIcon, FolderPlusIcon, FolderUpIcon, FunctionSquareIcon, GitBranchIcon, GlobeIcon, HashIcon, Heading1Icon, Heading2Icon, Heading3Icon, HelpCircleIcon, HistoryIcon, HomeIcon, ImageIcon, ImageOffIcon, InfoIcon, ItalicIcon, KanbanIcon, KeyIcon, KeyRoundIcon, LanguagesIcon, LayoutGridIcon, LinkIcon, ListIcon, ListOrderedIcon, LoaderIcon, LogOutIcon, MailIcon, Maximize2Icon, MenuIcon, MinusCircleIcon, MinusIcon as MinusIcon2, MoonIcon, MoreVerticalIcon, Music2Icon, PanelLeftIcon, PauseIcon, PencilIcon, PhoneIcon, PlayIcon, PlusIcon, QuoteIcon, RefreshCcwIcon, RefreshCwIcon, RepeatIcon, Rows3Icon, SaveIcon, SearchIcon as SearchIcon2, SendIcon, SettingsIcon, ShieldIcon, ShoppingCartIcon, SlidersHorizontalIcon, SquareIcon, StarIcon, StrikethroughIcon, SunIcon, SunMoonIcon, TableIcon, TagIcon, TerminalIcon, TextIcon, Trash2Icon, TypeIcon, UnderlineIcon, UndoIcon, UploadCloudIcon, UploadIcon, UserCheckIcon, UserIcon, VideoIcon, VoteIcon, Wand2Icon, XCircleIcon, XIcon as XIcon2, icons } from "lucide-react";
|
|
9
|
+
import { AlertCircleIcon, ShieldAlertIcon, ArrowLeftIcon, RefreshCwIcon, ChevronUpIcon, ChevronDownIcon, MinusIcon, CheckIcon, CalendarIcon, XIcon, ChevronRightIcon, SearchIcon, ChevronLeftIcon, ArrowUpIcon, FilterIcon } from "lucide-react";
|
|
10
|
+
import { AlertCircleIcon as AlertCircleIcon2, AlertTriangleIcon, AlignLeftIcon, AppWindow, ArrowDownToLineIcon, ArrowLeftIcon as ArrowLeftIcon2, ArrowRightFromLineIcon, ArrowRightIcon, ArrowRightToLineIcon, ArrowUpToLineIcon, BoldIcon, BookOpenIcon, CalendarIcon as CalendarIcon2, CheckCircleIcon, CheckIcon as CheckIcon2, CheckSquareIcon, ChevronDownIcon as ChevronDownIcon2, ChevronLeftIcon as ChevronLeftIcon2, ChevronRightIcon as ChevronRightIcon2, ChevronUpIcon as ChevronUpIcon2, ChevronsLeftIcon, ChevronsRightIcon, ChevronsUpDownIcon, CircleIcon, CircleUserIcon, CodeIcon, ColumnsIcon, CopyIcon, DatabaseIcon, DownloadIcon, ExternalLinkIcon, EyeIcon, EyeOffIcon, FileIcon, FileSearchIcon, FileTextIcon, FilterIcon as FilterIcon2, FilterXIcon, FlagIcon, FolderIcon, FolderPlusIcon, FolderUpIcon, FunctionSquareIcon, GitBranchIcon, GlobeIcon, HashIcon, Heading1Icon, Heading2Icon, Heading3Icon, HelpCircleIcon, HistoryIcon, HomeIcon, ImageIcon, ImageOffIcon, InfoIcon, ItalicIcon, KanbanIcon, KeyIcon, KeyRoundIcon, LanguagesIcon, LayoutGridIcon, LinkIcon, ListIcon, ListOrderedIcon, LoaderIcon, LogOutIcon, MailIcon, Maximize2Icon, MenuIcon, MinusCircleIcon, MinusIcon as MinusIcon2, MoonIcon, MoreVerticalIcon, Music2Icon, PanelLeftIcon, PauseIcon, PencilIcon, PhoneIcon, PlayIcon, PlusIcon, QuoteIcon, RefreshCcwIcon, RefreshCwIcon as RefreshCwIcon2, RepeatIcon, Rows3Icon, SaveIcon, SearchIcon as SearchIcon2, SendIcon, SettingsIcon, ShieldIcon, ShoppingCartIcon, SlidersHorizontalIcon, SquareIcon, StarIcon, StrikethroughIcon, SunIcon, SunMoonIcon, TableIcon, TagIcon, TerminalIcon, TextIcon, Trash2Icon, TypeIcon, UnderlineIcon, UndoIcon, UploadCloudIcon, UploadIcon, UserCheckIcon, UserIcon, VideoIcon, VoteIcon, Wand2Icon, XCircleIcon, XIcon as XIcon2, icons } from "lucide-react";
|
|
11
11
|
import * as CheckboxPrimitive from "@radix-ui/react-checkbox";
|
|
12
12
|
import * as TooltipPrimitive from "@radix-ui/react-tooltip";
|
|
13
13
|
import * as DialogPrimitive from "@radix-ui/react-dialog";
|
|
@@ -1548,11 +1548,18 @@ const colorClassesMapping = {
|
|
|
1548
1548
|
disabled: "text-text-disabled dark:text-text-disabled-dark",
|
|
1549
1549
|
error: "text-red-500"
|
|
1550
1550
|
};
|
|
1551
|
+
function isPermissionError(error) {
|
|
1552
|
+
if (!error) return false;
|
|
1553
|
+
const msg = error.message?.toLowerCase() ?? "";
|
|
1554
|
+
const code = error.code?.toLowerCase() ?? "";
|
|
1555
|
+
return msg.includes("permission") || msg.includes("insufficient") || msg.includes("unauthorized") || msg.includes("forbidden") || msg.includes("access denied") || code === "permission_denied" || code === "insufficient_permissions" || error.status === 403;
|
|
1556
|
+
}
|
|
1551
1557
|
class ErrorBoundary extends React__default.Component {
|
|
1552
1558
|
constructor(props) {
|
|
1553
1559
|
super(props);
|
|
1554
1560
|
this.state = {
|
|
1555
|
-
error: null
|
|
1561
|
+
error: null,
|
|
1562
|
+
showDetails: false
|
|
1556
1563
|
};
|
|
1557
1564
|
}
|
|
1558
1565
|
static getDerivedStateFromError(error) {
|
|
@@ -1563,18 +1570,71 @@ class ErrorBoundary extends React__default.Component {
|
|
|
1563
1570
|
componentDidCatch(error, _errorInfo) {
|
|
1564
1571
|
console.error(error);
|
|
1565
1572
|
}
|
|
1573
|
+
handleReset = () => {
|
|
1574
|
+
this.setState({
|
|
1575
|
+
error: null,
|
|
1576
|
+
showDetails: false
|
|
1577
|
+
});
|
|
1578
|
+
this.props.onReset?.();
|
|
1579
|
+
};
|
|
1580
|
+
handleReload = () => {
|
|
1581
|
+
window.location.reload();
|
|
1582
|
+
};
|
|
1583
|
+
toggleDetails = () => {
|
|
1584
|
+
this.setState((prev) => ({
|
|
1585
|
+
showDetails: !prev.showDetails
|
|
1586
|
+
}));
|
|
1587
|
+
};
|
|
1566
1588
|
render() {
|
|
1567
1589
|
if (this.state.error) {
|
|
1568
|
-
|
|
1569
|
-
|
|
1570
|
-
|
|
1571
|
-
|
|
1572
|
-
] }),
|
|
1573
|
-
/* @__PURE__ */ jsx(Typography, { variant: "caption", children: this.state.error?.message ?? "See the error in the console" })
|
|
1574
|
-
] });
|
|
1590
|
+
if (this.props.fullPage) {
|
|
1591
|
+
return this.renderFullPage();
|
|
1592
|
+
}
|
|
1593
|
+
return this.renderInline();
|
|
1575
1594
|
}
|
|
1576
1595
|
return this.props.children;
|
|
1577
1596
|
}
|
|
1597
|
+
renderInline() {
|
|
1598
|
+
return /* @__PURE__ */ jsxs("div", { className: "flex flex-col m-2", children: [
|
|
1599
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center m-2", children: [
|
|
1600
|
+
/* @__PURE__ */ jsx(AlertCircleIcon, { className: "text-red-500", size: iconSize.small }),
|
|
1601
|
+
/* @__PURE__ */ jsx("div", { className: "ml-4", children: "Error" })
|
|
1602
|
+
] }),
|
|
1603
|
+
/* @__PURE__ */ jsx(Typography, { variant: "caption", children: this.state.error?.message ?? "See the error in the console" })
|
|
1604
|
+
] });
|
|
1605
|
+
}
|
|
1606
|
+
renderFullPage() {
|
|
1607
|
+
const {
|
|
1608
|
+
error,
|
|
1609
|
+
showDetails
|
|
1610
|
+
} = this.state;
|
|
1611
|
+
const isPermission = isPermissionError(error);
|
|
1612
|
+
const Icon = isPermission ? ShieldAlertIcon : AlertCircleIcon;
|
|
1613
|
+
const title = isPermission ? "Access denied" : "Something went wrong";
|
|
1614
|
+
const description = isPermission ? "You don't have permission to access this resource. Please check your account permissions or contact your administrator." : "An unexpected error occurred. You can try reloading the page or going back.";
|
|
1615
|
+
return /* @__PURE__ */ jsx("div", { className: cls("flex items-center justify-center min-h-[400px] h-full w-full", "bg-surface-50 dark:bg-surface-950"), children: /* @__PURE__ */ jsxs("div", { className: "flex flex-col items-center max-w-md px-6 py-10 text-center", children: [
|
|
1616
|
+
/* @__PURE__ */ jsx("div", { className: cls("flex items-center justify-center w-14 h-14 rounded-2xl mb-6", isPermission ? "bg-amber-100 dark:bg-amber-900/30" : "bg-red-100 dark:bg-red-900/30"), children: /* @__PURE__ */ jsx(Icon, { size: 28, className: isPermission ? "text-amber-600 dark:text-amber-400" : "text-red-500 dark:text-red-400" }) }),
|
|
1617
|
+
/* @__PURE__ */ jsx(Typography, { variant: "h6", className: "text-text-primary dark:text-text-primary-dark mb-2", children: title }),
|
|
1618
|
+
/* @__PURE__ */ jsx(Typography, { variant: "body2", className: "text-text-secondary dark:text-text-secondary-dark mb-8", children: description }),
|
|
1619
|
+
/* @__PURE__ */ jsxs("div", { className: "flex gap-3", children: [
|
|
1620
|
+
/* @__PURE__ */ jsxs(Button, { variant: "outlined", color: "neutral", size: "medium", onClick: this.handleReset, children: [
|
|
1621
|
+
/* @__PURE__ */ jsx(ArrowLeftIcon, { size: 16 }),
|
|
1622
|
+
"Try again"
|
|
1623
|
+
] }),
|
|
1624
|
+
/* @__PURE__ */ jsxs(Button, { variant: "filled", color: "primary", size: "medium", onClick: this.handleReload, children: [
|
|
1625
|
+
/* @__PURE__ */ jsx(RefreshCwIcon, { size: 16 }),
|
|
1626
|
+
"Reload page"
|
|
1627
|
+
] })
|
|
1628
|
+
] }),
|
|
1629
|
+
error?.message && /* @__PURE__ */ jsxs("div", { className: "mt-8 w-full", children: [
|
|
1630
|
+
/* @__PURE__ */ jsxs("button", { onClick: this.toggleDetails, className: cls("flex items-center gap-1 mx-auto text-xs", "text-text-disabled dark:text-text-disabled-dark", "hover:text-text-secondary dark:hover:text-text-secondary-dark", "transition-colors cursor-pointer bg-transparent border-none p-0"), children: [
|
|
1631
|
+
"Technical details",
|
|
1632
|
+
showDetails ? /* @__PURE__ */ jsx(ChevronUpIcon, { size: 14 }) : /* @__PURE__ */ jsx(ChevronDownIcon, { size: 14 })
|
|
1633
|
+
] }),
|
|
1634
|
+
showDetails && /* @__PURE__ */ jsx("div", { className: cls("mt-3 p-3 rounded-lg text-left text-xs", "bg-surface-100 dark:bg-surface-800", "text-text-secondary dark:text-text-secondary-dark", "font-mono break-all"), children: error.message })
|
|
1635
|
+
] })
|
|
1636
|
+
] }) });
|
|
1637
|
+
}
|
|
1578
1638
|
}
|
|
1579
1639
|
const sizeClasses$2 = {
|
|
1580
1640
|
large: "w-6 h-6 rounded flex items-center justify-center",
|
|
@@ -4321,7 +4381,7 @@ const MultiSelect = React.forwardRef((t0, ref) => {
|
|
|
4321
4381
|
if (selectedValues.some((v_0) => String(v_0) === String(newValue))) {
|
|
4322
4382
|
newSelectedValues = selectedValues.filter((v) => String(v) !== String(newValue));
|
|
4323
4383
|
} else {
|
|
4324
|
-
newSelectedValues = [...selectedValues, newValue];
|
|
4384
|
+
newSelectedValues = [...selectedValues, String(newValue)];
|
|
4325
4385
|
}
|
|
4326
4386
|
updateValues(newSelectedValues);
|
|
4327
4387
|
};
|
|
@@ -5243,88 +5303,87 @@ function SearchBar(t0) {
|
|
|
5243
5303
|
t10 = $[17];
|
|
5244
5304
|
}
|
|
5245
5305
|
const t11 = searchText ?? "";
|
|
5246
|
-
const t12 =
|
|
5247
|
-
|
|
5248
|
-
let t14;
|
|
5306
|
+
const t12 = !onTextSearch;
|
|
5307
|
+
let t13;
|
|
5249
5308
|
if ($[18] !== onTextSearch) {
|
|
5250
|
-
|
|
5309
|
+
t13 = onTextSearch ? (event) => {
|
|
5251
5310
|
setSearchText(event.target.value);
|
|
5252
5311
|
} : void 0;
|
|
5253
5312
|
$[18] = onTextSearch;
|
|
5254
|
-
$[19] =
|
|
5313
|
+
$[19] = t13;
|
|
5255
5314
|
} else {
|
|
5256
|
-
|
|
5315
|
+
t13 = $[19];
|
|
5257
5316
|
}
|
|
5317
|
+
let t14;
|
|
5258
5318
|
let t15;
|
|
5259
|
-
let t16;
|
|
5260
5319
|
if ($[20] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
|
|
5261
|
-
|
|
5262
|
-
|
|
5263
|
-
$[20] =
|
|
5264
|
-
$[21] =
|
|
5320
|
+
t14 = () => setActive(true);
|
|
5321
|
+
t15 = () => setActive(false);
|
|
5322
|
+
$[20] = t14;
|
|
5323
|
+
$[21] = t15;
|
|
5265
5324
|
} else {
|
|
5266
|
-
|
|
5267
|
-
|
|
5325
|
+
t14 = $[20];
|
|
5326
|
+
t15 = $[21];
|
|
5268
5327
|
}
|
|
5269
|
-
const
|
|
5270
|
-
const
|
|
5271
|
-
const
|
|
5272
|
-
let
|
|
5273
|
-
if ($[22] !== innerClassName || $[23] !== inputPaddingClass || $[24] !==
|
|
5274
|
-
|
|
5328
|
+
const t16 = (disabled || loading) && "pointer-events-none";
|
|
5329
|
+
const t17 = size === "small" ? "text-sm" : "";
|
|
5330
|
+
const t18 = expandable ? active ? "w-[220px]" : "w-[180px]" : "";
|
|
5331
|
+
let t19;
|
|
5332
|
+
if ($[22] !== innerClassName || $[23] !== inputPaddingClass || $[24] !== t16 || $[25] !== t17 || $[26] !== t18) {
|
|
5333
|
+
t19 = cls(t16, "placeholder-text-disabled dark:placeholder-text-disabled-dark", "relative flex items-center transition-all bg-transparent outline-none focus:outline-none focus:ring-0 appearance-none border-none focus:border-transparent", inputPaddingClass, "h-full w-full text-current", t17, t18, innerClassName);
|
|
5275
5334
|
$[22] = innerClassName;
|
|
5276
5335
|
$[23] = inputPaddingClass;
|
|
5277
|
-
$[24] =
|
|
5278
|
-
$[25] =
|
|
5279
|
-
$[26] =
|
|
5280
|
-
$[27] =
|
|
5336
|
+
$[24] = t16;
|
|
5337
|
+
$[25] = t17;
|
|
5338
|
+
$[26] = t18;
|
|
5339
|
+
$[27] = t19;
|
|
5281
5340
|
} else {
|
|
5282
|
-
|
|
5341
|
+
t19 = $[27];
|
|
5283
5342
|
}
|
|
5284
|
-
let
|
|
5285
|
-
if ($[28] !== autoFocus || $[29] !==
|
|
5286
|
-
|
|
5343
|
+
let t20;
|
|
5344
|
+
if ($[28] !== autoFocus || $[29] !== inputRef || $[30] !== onClick || $[31] !== placeholder || $[32] !== t11 || $[33] !== t12 || $[34] !== t13 || $[35] !== t19) {
|
|
5345
|
+
t20 = /* @__PURE__ */ jsx("input", { value: t11, ref: inputRef, onClick, placeholder, "aria-label": placeholder, readOnly: t12, onChange: t13, autoFocus, onFocus: t14, onBlur: t15, className: t19 });
|
|
5287
5346
|
$[28] = autoFocus;
|
|
5288
|
-
$[29] =
|
|
5289
|
-
$[30] =
|
|
5290
|
-
$[31] =
|
|
5291
|
-
$[32] =
|
|
5292
|
-
$[33] =
|
|
5293
|
-
$[34] =
|
|
5294
|
-
$[35] =
|
|
5295
|
-
$[36] =
|
|
5347
|
+
$[29] = inputRef;
|
|
5348
|
+
$[30] = onClick;
|
|
5349
|
+
$[31] = placeholder;
|
|
5350
|
+
$[32] = t11;
|
|
5351
|
+
$[33] = t12;
|
|
5352
|
+
$[34] = t13;
|
|
5353
|
+
$[35] = t19;
|
|
5354
|
+
$[36] = t20;
|
|
5296
5355
|
} else {
|
|
5297
|
-
|
|
5356
|
+
t20 = $[36];
|
|
5298
5357
|
}
|
|
5299
|
-
let
|
|
5358
|
+
let t21;
|
|
5300
5359
|
if ($[37] !== clearText || $[38] !== searchText || $[39] !== size) {
|
|
5301
|
-
|
|
5360
|
+
t21 = searchText ? /* @__PURE__ */ jsx(IconButton, { className: `${size === "small" ? "mr-0 top-0" : "mr-1 top-0"} absolute right-0 z-10`, size: "small", "aria-label": "Clear search", onClick: clearText, children: /* @__PURE__ */ jsx(XIcon, { size: iconSize.smallest }) }) : /* @__PURE__ */ jsx("div", { style: {
|
|
5302
5361
|
width: 26
|
|
5303
5362
|
} });
|
|
5304
5363
|
$[37] = clearText;
|
|
5305
5364
|
$[38] = searchText;
|
|
5306
5365
|
$[39] = size;
|
|
5307
|
-
$[40] =
|
|
5366
|
+
$[40] = t21;
|
|
5308
5367
|
} else {
|
|
5309
|
-
|
|
5368
|
+
t21 = $[40];
|
|
5310
5369
|
}
|
|
5311
|
-
let
|
|
5312
|
-
if ($[41] !== onClick || $[42] !== t10 || $[43] !==
|
|
5313
|
-
|
|
5370
|
+
let t22;
|
|
5371
|
+
if ($[41] !== onClick || $[42] !== t10 || $[43] !== t20 || $[44] !== t21 || $[45] !== t7) {
|
|
5372
|
+
t22 = /* @__PURE__ */ jsxs("div", { role: "search", "aria-label": "Search", onClick, className: t7, children: [
|
|
5314
5373
|
t10,
|
|
5315
|
-
|
|
5316
|
-
|
|
5374
|
+
t20,
|
|
5375
|
+
t21
|
|
5317
5376
|
] });
|
|
5318
5377
|
$[41] = onClick;
|
|
5319
5378
|
$[42] = t10;
|
|
5320
|
-
$[43] =
|
|
5321
|
-
$[44] =
|
|
5379
|
+
$[43] = t20;
|
|
5380
|
+
$[44] = t21;
|
|
5322
5381
|
$[45] = t7;
|
|
5323
|
-
$[46] =
|
|
5382
|
+
$[46] = t22;
|
|
5324
5383
|
} else {
|
|
5325
|
-
|
|
5384
|
+
t22 = $[46];
|
|
5326
5385
|
}
|
|
5327
|
-
return
|
|
5386
|
+
return t22;
|
|
5328
5387
|
}
|
|
5329
5388
|
const Select = forwardRef((t0, ref) => {
|
|
5330
5389
|
const $ = c(123);
|
|
@@ -6942,7 +7001,7 @@ function Tabs(t0) {
|
|
|
6942
7001
|
} else {
|
|
6943
7002
|
t10 = $[12];
|
|
6944
7003
|
}
|
|
6945
|
-
const t11 = variant === "standard" && "inline-flex h-
|
|
7004
|
+
const t11 = variant === "standard" && "inline-flex h-9 items-center justify-start rounded-md bg-surface-50 p-1 text-surface-600 dark:bg-surface-900 dark:text-surface-400 gap-2 border";
|
|
6946
7005
|
const t12 = variant === "standard" && defaultBorderMixin;
|
|
6947
7006
|
const t13 = variant === "boxy" && "flex items-center h-full";
|
|
6948
7007
|
const t14 = variant === "pill" && "flex items-center gap-0.5";
|
|
@@ -7016,7 +7075,7 @@ function Tab(t0) {
|
|
|
7016
7075
|
const {
|
|
7017
7076
|
variant
|
|
7018
7077
|
} = useContext(TabsContext);
|
|
7019
|
-
const t1 = variant === "standard" && "rounded-sm px-3 py-1
|
|
7078
|
+
const t1 = variant === "standard" && "rounded-sm px-3 py-1 data-[state=active]:bg-white data-[state=active]:text-surface-900 data-[state=active]:shadow-sm dark:data-[state=active]:bg-surface-900 dark:data-[state=active]:text-surface-50";
|
|
7020
7079
|
let t2;
|
|
7021
7080
|
if ($[0] !== className || $[1] !== innerClassName || $[2] !== t1 || $[3] !== variant) {
|
|
7022
7081
|
t2 = cls("inline-flex items-center justify-center whitespace-nowrap text-sm font-medium ring-offset-white transition-all", "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-surface-400 focus-visible:ring-offset-2", "disabled:pointer-events-none disabled:opacity-50", t1, variant === "boxy" && cls("flex-shrink-0 flex items-center gap-1.5 px-3.5 h-9 border-r border-surface-200 dark:border-surface-800 cursor-pointer text-[12px] font-medium transition-colors group relative box-border overflow-hidden", "border-b-2 border-b-transparent", "data-[state=active]:bg-surface-50 dark:data-[state=active]:bg-surface-900", "data-[state=active]:text-text-primary dark:data-[state=active]:text-text-primary-dark", "data-[state=active]:border-b-primary", "text-text-secondary dark:text-text-secondary-dark hover:bg-surface-100 dark:hover:bg-surface-800"), variant === "pill" && cls("px-2 py-0.5 rounded text-[10px] font-medium transition-colors", "data-[state=active]:bg-primary/10 data-[state=active]:text-primary dark:data-[state=active]:bg-primary/20 dark:data-[state=active]:text-blue-400", "text-text-disabled dark:text-text-disabled-dark hover:text-text-secondary dark:hover:text-text-secondary-dark"), className, variant === "standard" && innerClassName);
|
|
@@ -8760,7 +8819,7 @@ function MemoizedList({
|
|
|
8760
8819
|
zIndex: 1
|
|
8761
8820
|
}, children: endAdornment });
|
|
8762
8821
|
}
|
|
8763
|
-
const rowData = data
|
|
8822
|
+
const rowData = data ? data[index] : void 0;
|
|
8764
8823
|
return /* @__PURE__ */ jsxs(VirtualTableRow, { rowData, rowIndex: index, onRowClick, columns, hoverRow, rowClassName, style: {
|
|
8765
8824
|
...style,
|
|
8766
8825
|
top: `calc(${style.top}px + ${headerHeight ?? 48}px)`
|
|
@@ -8902,7 +8961,7 @@ export {
|
|
|
8902
8961
|
AlignLeftIcon,
|
|
8903
8962
|
AppWindow,
|
|
8904
8963
|
ArrowDownToLineIcon,
|
|
8905
|
-
ArrowLeftIcon,
|
|
8964
|
+
ArrowLeftIcon2 as ArrowLeftIcon,
|
|
8906
8965
|
ArrowRightFromLineIcon,
|
|
8907
8966
|
ArrowRightIcon,
|
|
8908
8967
|
ArrowRightToLineIcon,
|
|
@@ -8927,7 +8986,7 @@ export {
|
|
|
8927
8986
|
ChevronDownIcon2 as ChevronDownIcon,
|
|
8928
8987
|
ChevronLeftIcon2 as ChevronLeftIcon,
|
|
8929
8988
|
ChevronRightIcon2 as ChevronRightIcon,
|
|
8930
|
-
ChevronUpIcon,
|
|
8989
|
+
ChevronUpIcon2 as ChevronUpIcon,
|
|
8931
8990
|
ChevronsLeftIcon,
|
|
8932
8991
|
ChevronsRightIcon,
|
|
8933
8992
|
ChevronsUpDownIcon,
|
|
@@ -9042,7 +9101,7 @@ export {
|
|
|
9042
9101
|
RadioGroup,
|
|
9043
9102
|
RadioGroupItem,
|
|
9044
9103
|
RefreshCcwIcon,
|
|
9045
|
-
RefreshCwIcon,
|
|
9104
|
+
RefreshCwIcon2 as RefreshCwIcon,
|
|
9046
9105
|
RepeatIcon,
|
|
9047
9106
|
ResizablePanels,
|
|
9048
9107
|
Rows3Icon,
|