shadboard 0.0.1 → 0.0.4
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/index.d.mts +137 -0
- package/dist/index.d.ts +137 -0
- package/dist/index.js +3 -0
- package/dist/index.js.map +1 -0
- package/dist/index.mjs +3 -0
- package/dist/index.mjs.map +1 -0
- package/package.json +90 -18
- package/.devcontainer/devcontainer.json +0 -18
- package/README.md +0 -42
- package/examples/basic/package.json +0 -17
- package/examples/basic/src/index.ts +0 -3
- package/examples/basic/tsconfig.json +0 -7
- package/packages/core/package.json +0 -26
- package/packages/core/src/index.ts +0 -8
- package/packages/core/tsconfig.json +0 -7
- package/tsconfig.json +0 -14
package/dist/index.d.mts
ADDED
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import { RefineThemedLayoutProps, RefineLayoutThemedTitleProps, RefineCreateButtonProps, RefineSaveButtonProps, RefineDeleteButtonProps, RefineRefreshButtonProps, RefineListButtonProps, RefineEditButtonProps, RefineShowButtonProps, RefineImportButtonProps, RefineCloneButtonProps, RefineExportButtonProps, RefineCrudListProps, RefineCrudCreateProps, RefineCrudEditProps, RefineCrudShowProps, RefineFieldTextProps, RefineFieldBooleanProps, RefineFieldNumberProps, RefineFieldDateProps, RefineFieldMarkdownProps, RefineBreadcrumbProps } from '@refinedev/ui-types';
|
|
3
|
+
import * as class_variance_authority_types from 'class-variance-authority/types';
|
|
4
|
+
import * as React$1 from 'react';
|
|
5
|
+
import { HTMLAttributes, ReactNode } from 'react';
|
|
6
|
+
import { VariantProps } from 'class-variance-authority';
|
|
7
|
+
import { LucideProps } from 'lucide-react';
|
|
8
|
+
import { UseImportInputPropsType, OpenNotificationParams, AutoSaveIndicatorProps, NotificationProvider } from '@refinedev/core';
|
|
9
|
+
import { ConfigType } from 'dayjs';
|
|
10
|
+
import { TooltipProps } from '@radix-ui/react-tooltip';
|
|
11
|
+
import { ThemeProviderProps } from 'next-themes';
|
|
12
|
+
|
|
13
|
+
declare const ThemedLayout: ({ Sider, Header, Title, Footer, OffLayoutArea, children, initialSiderCollapsed, onSiderCollapsed, }: RefineThemedLayoutProps) => react_jsx_runtime.JSX.Element;
|
|
14
|
+
|
|
15
|
+
declare const ThemedTitle: ({ collapsed, icon: iconFromProps, text: textFromProps, }: RefineLayoutThemedTitleProps) => react_jsx_runtime.JSX.Element;
|
|
16
|
+
|
|
17
|
+
declare const buttonVariants: (props?: ({
|
|
18
|
+
variant?: "default" | "destructive" | "outline" | "secondary" | "ghost" | "link" | null | undefined;
|
|
19
|
+
size?: "default" | "sm" | "lg" | "icon" | "icon-sm" | "icon-lg" | null | undefined;
|
|
20
|
+
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
21
|
+
interface ButtonProps extends React$1.ComponentProps<'button'>, VariantProps<typeof buttonVariants> {
|
|
22
|
+
asChild?: boolean;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
type ShowButtonProps = Omit<RefineShowButtonProps<ButtonProps, {
|
|
26
|
+
svgIconProps?: Omit<LucideProps, 'ref'>;
|
|
27
|
+
}>, 'ignoreAccessControlProvider'>;
|
|
28
|
+
type SaveButtonProps = RefineSaveButtonProps<ButtonProps, {
|
|
29
|
+
svgIconProps?: Omit<LucideProps, 'ref'>;
|
|
30
|
+
}>;
|
|
31
|
+
type RefreshButtonProps = RefineRefreshButtonProps<ButtonProps, {
|
|
32
|
+
svgIconProps?: Omit<LucideProps, 'ref'>;
|
|
33
|
+
}>;
|
|
34
|
+
type ListButtonProps = Omit<RefineListButtonProps<ButtonProps, {
|
|
35
|
+
svgIconProps?: Omit<LucideProps, 'ref'>;
|
|
36
|
+
}>, 'ignoreAccessControlProvider'>;
|
|
37
|
+
type ImportButtonProps = RefineImportButtonProps<ButtonProps, {
|
|
38
|
+
inputProps: UseImportInputPropsType;
|
|
39
|
+
svgIconProps?: Omit<LucideProps, 'ref'>;
|
|
40
|
+
}>;
|
|
41
|
+
type ExportButtonProps = RefineExportButtonProps<ButtonProps, {
|
|
42
|
+
svgIconProps?: Omit<LucideProps, 'ref'>;
|
|
43
|
+
}>;
|
|
44
|
+
type EditButtonProps = Omit<RefineEditButtonProps<ButtonProps, {
|
|
45
|
+
svgIconProps?: Omit<LucideProps, 'ref'>;
|
|
46
|
+
}>, 'ignoreAccessControlProvider'>;
|
|
47
|
+
type DeleteButtonProps = Omit<RefineDeleteButtonProps<ButtonProps, {
|
|
48
|
+
svgIconProps?: Omit<LucideProps, 'ref'>;
|
|
49
|
+
}>, 'ignoreAccessControlProvider'>;
|
|
50
|
+
type CloneButtonProps = Omit<RefineCloneButtonProps<ButtonProps, {
|
|
51
|
+
svgIconProps?: Omit<LucideProps, 'ref'>;
|
|
52
|
+
}>, 'ignoreAccessControlProvider'>;
|
|
53
|
+
type CreateButtonProps = Omit<RefineCreateButtonProps<ButtonProps, {
|
|
54
|
+
svgIconProps?: Omit<LucideProps, 'ref'>;
|
|
55
|
+
}>, 'ignoreAccessControlProvider'>;
|
|
56
|
+
|
|
57
|
+
type DivProps = HTMLAttributes<HTMLDivElement>;
|
|
58
|
+
type CreateProps = RefineCrudCreateProps<SaveButtonProps, DivProps, DivProps, DivProps, DivProps, DivProps>;
|
|
59
|
+
type EditProps = RefineCrudEditProps<SaveButtonProps, DeleteButtonProps, DivProps, DivProps, DivProps, DivProps, DivProps, {}, RefreshButtonProps, ListButtonProps>;
|
|
60
|
+
type ListProps = RefineCrudListProps<CreateButtonProps, DivProps, DivProps, DivProps, DivProps>;
|
|
61
|
+
type ShowProps = RefineCrudShowProps<DivProps, DivProps, DivProps, DivProps, DivProps, {}, EditButtonProps, DeleteButtonProps, RefreshButtonProps, ListButtonProps>;
|
|
62
|
+
|
|
63
|
+
declare const List: (props: ListProps) => react_jsx_runtime.JSX.Element;
|
|
64
|
+
|
|
65
|
+
declare const Create: (props: CreateProps) => react_jsx_runtime.JSX.Element;
|
|
66
|
+
|
|
67
|
+
declare const CreateButton: ({ resource: resourceNameFromProps, hideText, accessControl, meta, children, onClick, ...rest }: CreateButtonProps) => react_jsx_runtime.JSX.Element | null;
|
|
68
|
+
|
|
69
|
+
declare const EditButton: ({ resource: resourceNameFromProps, recordItemId, hideText, accessControl, meta, children, onClick, ...rest }: EditButtonProps) => react_jsx_runtime.JSX.Element | null;
|
|
70
|
+
|
|
71
|
+
declare const DeleteButton: ({ resource: resourceNameFromProps, recordItemId, onSuccess, mutationMode: mutationModeProp, children, successNotification, errorNotification, hideText, accessControl, meta, invalidates, dataProviderName, confirmTitle, confirmOkText, confirmCancelText, ...rest }: DeleteButtonProps) => react_jsx_runtime.JSX.Element | null;
|
|
72
|
+
|
|
73
|
+
declare const RefreshButton: ({ resource: resourceNameFromProps, recordItemId, hideText, dataProviderName, children, ...rest }: RefreshButtonProps) => react_jsx_runtime.JSX.Element;
|
|
74
|
+
|
|
75
|
+
declare const ShowButton: ({ resource: resourceNameFromProps, recordItemId, hideText, accessControl, meta, children, onClick, ...rest }: ShowButtonProps) => react_jsx_runtime.JSX.Element | null;
|
|
76
|
+
|
|
77
|
+
declare const ListButton: ({ resource: resourceNameFromProps, hideText, accessControl, meta, children, onClick, ...rest }: ListButtonProps) => react_jsx_runtime.JSX.Element | null;
|
|
78
|
+
|
|
79
|
+
declare const ExportButton: ({ hideText, loading, children, ...rest }: ImportButtonProps) => react_jsx_runtime.JSX.Element;
|
|
80
|
+
|
|
81
|
+
declare const SaveButton: ({ hideText, children, ...rest }: SaveButtonProps) => react_jsx_runtime.JSX.Element;
|
|
82
|
+
|
|
83
|
+
declare const CloneButton: ({ resource: resourceNameFromProps, recordItemId, hideText, accessControl, meta, children, onClick, ...rest }: CloneButtonProps) => react_jsx_runtime.JSX.Element | null;
|
|
84
|
+
|
|
85
|
+
declare const ImportButton: ({ inputProps, hideText, loading, children, ...rest }: ImportButtonProps) => react_jsx_runtime.JSX.Element;
|
|
86
|
+
|
|
87
|
+
declare const textVariants: (props?: ({
|
|
88
|
+
size?: "sm" | "lg" | "md" | null | undefined;
|
|
89
|
+
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
90
|
+
interface TextProps extends React$1.HTMLAttributes<HTMLSpanElement>, VariantProps<typeof textVariants> {
|
|
91
|
+
asChild?: boolean;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
type BooleanFieldProps = RefineFieldBooleanProps<unknown, Omit<TooltipProps, 'label' | 'children'>, {
|
|
95
|
+
svgIconProps?: Omit<LucideProps, 'ref'>;
|
|
96
|
+
}>;
|
|
97
|
+
type DateFieldProps = RefineFieldDateProps<ConfigType, TextProps>;
|
|
98
|
+
type MarkdownFieldProps = RefineFieldMarkdownProps<string | undefined>;
|
|
99
|
+
type NumberFieldProps = RefineFieldNumberProps<ReactNode, TextProps>;
|
|
100
|
+
type TextFieldProps = RefineFieldTextProps<ReactNode, TextProps>;
|
|
101
|
+
|
|
102
|
+
declare const TextField: ({ value, ...rest }: TextFieldProps) => react_jsx_runtime.JSX.Element;
|
|
103
|
+
|
|
104
|
+
declare const BooleanField: ({ value, valueLabelTrue, valueLabelFalse, trueIcon, falseIcon, svgIconProps, ...rest }: BooleanFieldProps) => react_jsx_runtime.JSX.Element;
|
|
105
|
+
|
|
106
|
+
declare const NumberField: ({ value, locale, options, ...rest }: NumberFieldProps) => react_jsx_runtime.JSX.Element;
|
|
107
|
+
|
|
108
|
+
declare const ErrorComponent: () => react_jsx_runtime.JSX.Element;
|
|
109
|
+
|
|
110
|
+
interface BreadcrumbProps$1 extends React$1.ComponentProps<'nav'> {
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
type BreadcrumbProps = RefineBreadcrumbProps<BreadcrumbProps$1>;
|
|
114
|
+
declare const Breadcrumb: ({ breadcrumbProps, showHome, hideIcons, meta, minItems, }: BreadcrumbProps) => react_jsx_runtime.JSX.Element | null;
|
|
115
|
+
|
|
116
|
+
type UndoableNotificationProps = {
|
|
117
|
+
notificationKey: OpenNotificationParams['key'];
|
|
118
|
+
message: OpenNotificationParams['message'];
|
|
119
|
+
cancelMutation: OpenNotificationParams['cancelMutation'];
|
|
120
|
+
undoableTimeout: OpenNotificationParams['undoableTimeout'];
|
|
121
|
+
};
|
|
122
|
+
declare const UndoableNotification: React.FC<UndoableNotificationProps>;
|
|
123
|
+
|
|
124
|
+
declare const AutoSaveIndicator: ({ status, elements: { success, error, loading, idle, }, }: AutoSaveIndicatorProps) => react_jsx_runtime.JSX.Element;
|
|
125
|
+
|
|
126
|
+
declare const useNotificationProvider: () => NotificationProvider;
|
|
127
|
+
|
|
128
|
+
interface ThemedLayoutContext extends ThemeProviderProps {
|
|
129
|
+
}
|
|
130
|
+
declare const ThemedLayoutContextProvider: ({ children, ...rest }: ThemedLayoutContext) => react_jsx_runtime.JSX.Element;
|
|
131
|
+
|
|
132
|
+
type GreetingOptions = {
|
|
133
|
+
name?: string;
|
|
134
|
+
};
|
|
135
|
+
declare function greet(opts?: GreetingOptions): string;
|
|
136
|
+
|
|
137
|
+
export { AutoSaveIndicator, BooleanField, type BooleanFieldProps, Breadcrumb, type BreadcrumbProps, CloneButton, type CloneButtonProps, Create, CreateButton, type CreateButtonProps, type CreateProps, type DateFieldProps, DeleteButton, type DeleteButtonProps, type DivProps, EditButton, type EditButtonProps, type EditProps, ErrorComponent, ExportButton, type ExportButtonProps, type GreetingOptions, ImportButton, type ImportButtonProps, List, ListButton, type ListButtonProps, type ListProps, type MarkdownFieldProps, NumberField, type NumberFieldProps, RefreshButton, type RefreshButtonProps, SaveButton, type SaveButtonProps, ShowButton, type ShowButtonProps, type ShowProps, TextField, type TextFieldProps, ThemedLayout, type ThemedLayoutContext, ThemedLayoutContextProvider, ThemedTitle, UndoableNotification, type UndoableNotificationProps, greet, useNotificationProvider };
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import { RefineThemedLayoutProps, RefineLayoutThemedTitleProps, RefineCreateButtonProps, RefineSaveButtonProps, RefineDeleteButtonProps, RefineRefreshButtonProps, RefineListButtonProps, RefineEditButtonProps, RefineShowButtonProps, RefineImportButtonProps, RefineCloneButtonProps, RefineExportButtonProps, RefineCrudListProps, RefineCrudCreateProps, RefineCrudEditProps, RefineCrudShowProps, RefineFieldTextProps, RefineFieldBooleanProps, RefineFieldNumberProps, RefineFieldDateProps, RefineFieldMarkdownProps, RefineBreadcrumbProps } from '@refinedev/ui-types';
|
|
3
|
+
import * as class_variance_authority_types from 'class-variance-authority/types';
|
|
4
|
+
import * as React$1 from 'react';
|
|
5
|
+
import { HTMLAttributes, ReactNode } from 'react';
|
|
6
|
+
import { VariantProps } from 'class-variance-authority';
|
|
7
|
+
import { LucideProps } from 'lucide-react';
|
|
8
|
+
import { UseImportInputPropsType, OpenNotificationParams, AutoSaveIndicatorProps, NotificationProvider } from '@refinedev/core';
|
|
9
|
+
import { ConfigType } from 'dayjs';
|
|
10
|
+
import { TooltipProps } from '@radix-ui/react-tooltip';
|
|
11
|
+
import { ThemeProviderProps } from 'next-themes';
|
|
12
|
+
|
|
13
|
+
declare const ThemedLayout: ({ Sider, Header, Title, Footer, OffLayoutArea, children, initialSiderCollapsed, onSiderCollapsed, }: RefineThemedLayoutProps) => react_jsx_runtime.JSX.Element;
|
|
14
|
+
|
|
15
|
+
declare const ThemedTitle: ({ collapsed, icon: iconFromProps, text: textFromProps, }: RefineLayoutThemedTitleProps) => react_jsx_runtime.JSX.Element;
|
|
16
|
+
|
|
17
|
+
declare const buttonVariants: (props?: ({
|
|
18
|
+
variant?: "default" | "destructive" | "outline" | "secondary" | "ghost" | "link" | null | undefined;
|
|
19
|
+
size?: "default" | "sm" | "lg" | "icon" | "icon-sm" | "icon-lg" | null | undefined;
|
|
20
|
+
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
21
|
+
interface ButtonProps extends React$1.ComponentProps<'button'>, VariantProps<typeof buttonVariants> {
|
|
22
|
+
asChild?: boolean;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
type ShowButtonProps = Omit<RefineShowButtonProps<ButtonProps, {
|
|
26
|
+
svgIconProps?: Omit<LucideProps, 'ref'>;
|
|
27
|
+
}>, 'ignoreAccessControlProvider'>;
|
|
28
|
+
type SaveButtonProps = RefineSaveButtonProps<ButtonProps, {
|
|
29
|
+
svgIconProps?: Omit<LucideProps, 'ref'>;
|
|
30
|
+
}>;
|
|
31
|
+
type RefreshButtonProps = RefineRefreshButtonProps<ButtonProps, {
|
|
32
|
+
svgIconProps?: Omit<LucideProps, 'ref'>;
|
|
33
|
+
}>;
|
|
34
|
+
type ListButtonProps = Omit<RefineListButtonProps<ButtonProps, {
|
|
35
|
+
svgIconProps?: Omit<LucideProps, 'ref'>;
|
|
36
|
+
}>, 'ignoreAccessControlProvider'>;
|
|
37
|
+
type ImportButtonProps = RefineImportButtonProps<ButtonProps, {
|
|
38
|
+
inputProps: UseImportInputPropsType;
|
|
39
|
+
svgIconProps?: Omit<LucideProps, 'ref'>;
|
|
40
|
+
}>;
|
|
41
|
+
type ExportButtonProps = RefineExportButtonProps<ButtonProps, {
|
|
42
|
+
svgIconProps?: Omit<LucideProps, 'ref'>;
|
|
43
|
+
}>;
|
|
44
|
+
type EditButtonProps = Omit<RefineEditButtonProps<ButtonProps, {
|
|
45
|
+
svgIconProps?: Omit<LucideProps, 'ref'>;
|
|
46
|
+
}>, 'ignoreAccessControlProvider'>;
|
|
47
|
+
type DeleteButtonProps = Omit<RefineDeleteButtonProps<ButtonProps, {
|
|
48
|
+
svgIconProps?: Omit<LucideProps, 'ref'>;
|
|
49
|
+
}>, 'ignoreAccessControlProvider'>;
|
|
50
|
+
type CloneButtonProps = Omit<RefineCloneButtonProps<ButtonProps, {
|
|
51
|
+
svgIconProps?: Omit<LucideProps, 'ref'>;
|
|
52
|
+
}>, 'ignoreAccessControlProvider'>;
|
|
53
|
+
type CreateButtonProps = Omit<RefineCreateButtonProps<ButtonProps, {
|
|
54
|
+
svgIconProps?: Omit<LucideProps, 'ref'>;
|
|
55
|
+
}>, 'ignoreAccessControlProvider'>;
|
|
56
|
+
|
|
57
|
+
type DivProps = HTMLAttributes<HTMLDivElement>;
|
|
58
|
+
type CreateProps = RefineCrudCreateProps<SaveButtonProps, DivProps, DivProps, DivProps, DivProps, DivProps>;
|
|
59
|
+
type EditProps = RefineCrudEditProps<SaveButtonProps, DeleteButtonProps, DivProps, DivProps, DivProps, DivProps, DivProps, {}, RefreshButtonProps, ListButtonProps>;
|
|
60
|
+
type ListProps = RefineCrudListProps<CreateButtonProps, DivProps, DivProps, DivProps, DivProps>;
|
|
61
|
+
type ShowProps = RefineCrudShowProps<DivProps, DivProps, DivProps, DivProps, DivProps, {}, EditButtonProps, DeleteButtonProps, RefreshButtonProps, ListButtonProps>;
|
|
62
|
+
|
|
63
|
+
declare const List: (props: ListProps) => react_jsx_runtime.JSX.Element;
|
|
64
|
+
|
|
65
|
+
declare const Create: (props: CreateProps) => react_jsx_runtime.JSX.Element;
|
|
66
|
+
|
|
67
|
+
declare const CreateButton: ({ resource: resourceNameFromProps, hideText, accessControl, meta, children, onClick, ...rest }: CreateButtonProps) => react_jsx_runtime.JSX.Element | null;
|
|
68
|
+
|
|
69
|
+
declare const EditButton: ({ resource: resourceNameFromProps, recordItemId, hideText, accessControl, meta, children, onClick, ...rest }: EditButtonProps) => react_jsx_runtime.JSX.Element | null;
|
|
70
|
+
|
|
71
|
+
declare const DeleteButton: ({ resource: resourceNameFromProps, recordItemId, onSuccess, mutationMode: mutationModeProp, children, successNotification, errorNotification, hideText, accessControl, meta, invalidates, dataProviderName, confirmTitle, confirmOkText, confirmCancelText, ...rest }: DeleteButtonProps) => react_jsx_runtime.JSX.Element | null;
|
|
72
|
+
|
|
73
|
+
declare const RefreshButton: ({ resource: resourceNameFromProps, recordItemId, hideText, dataProviderName, children, ...rest }: RefreshButtonProps) => react_jsx_runtime.JSX.Element;
|
|
74
|
+
|
|
75
|
+
declare const ShowButton: ({ resource: resourceNameFromProps, recordItemId, hideText, accessControl, meta, children, onClick, ...rest }: ShowButtonProps) => react_jsx_runtime.JSX.Element | null;
|
|
76
|
+
|
|
77
|
+
declare const ListButton: ({ resource: resourceNameFromProps, hideText, accessControl, meta, children, onClick, ...rest }: ListButtonProps) => react_jsx_runtime.JSX.Element | null;
|
|
78
|
+
|
|
79
|
+
declare const ExportButton: ({ hideText, loading, children, ...rest }: ImportButtonProps) => react_jsx_runtime.JSX.Element;
|
|
80
|
+
|
|
81
|
+
declare const SaveButton: ({ hideText, children, ...rest }: SaveButtonProps) => react_jsx_runtime.JSX.Element;
|
|
82
|
+
|
|
83
|
+
declare const CloneButton: ({ resource: resourceNameFromProps, recordItemId, hideText, accessControl, meta, children, onClick, ...rest }: CloneButtonProps) => react_jsx_runtime.JSX.Element | null;
|
|
84
|
+
|
|
85
|
+
declare const ImportButton: ({ inputProps, hideText, loading, children, ...rest }: ImportButtonProps) => react_jsx_runtime.JSX.Element;
|
|
86
|
+
|
|
87
|
+
declare const textVariants: (props?: ({
|
|
88
|
+
size?: "sm" | "lg" | "md" | null | undefined;
|
|
89
|
+
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
90
|
+
interface TextProps extends React$1.HTMLAttributes<HTMLSpanElement>, VariantProps<typeof textVariants> {
|
|
91
|
+
asChild?: boolean;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
type BooleanFieldProps = RefineFieldBooleanProps<unknown, Omit<TooltipProps, 'label' | 'children'>, {
|
|
95
|
+
svgIconProps?: Omit<LucideProps, 'ref'>;
|
|
96
|
+
}>;
|
|
97
|
+
type DateFieldProps = RefineFieldDateProps<ConfigType, TextProps>;
|
|
98
|
+
type MarkdownFieldProps = RefineFieldMarkdownProps<string | undefined>;
|
|
99
|
+
type NumberFieldProps = RefineFieldNumberProps<ReactNode, TextProps>;
|
|
100
|
+
type TextFieldProps = RefineFieldTextProps<ReactNode, TextProps>;
|
|
101
|
+
|
|
102
|
+
declare const TextField: ({ value, ...rest }: TextFieldProps) => react_jsx_runtime.JSX.Element;
|
|
103
|
+
|
|
104
|
+
declare const BooleanField: ({ value, valueLabelTrue, valueLabelFalse, trueIcon, falseIcon, svgIconProps, ...rest }: BooleanFieldProps) => react_jsx_runtime.JSX.Element;
|
|
105
|
+
|
|
106
|
+
declare const NumberField: ({ value, locale, options, ...rest }: NumberFieldProps) => react_jsx_runtime.JSX.Element;
|
|
107
|
+
|
|
108
|
+
declare const ErrorComponent: () => react_jsx_runtime.JSX.Element;
|
|
109
|
+
|
|
110
|
+
interface BreadcrumbProps$1 extends React$1.ComponentProps<'nav'> {
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
type BreadcrumbProps = RefineBreadcrumbProps<BreadcrumbProps$1>;
|
|
114
|
+
declare const Breadcrumb: ({ breadcrumbProps, showHome, hideIcons, meta, minItems, }: BreadcrumbProps) => react_jsx_runtime.JSX.Element | null;
|
|
115
|
+
|
|
116
|
+
type UndoableNotificationProps = {
|
|
117
|
+
notificationKey: OpenNotificationParams['key'];
|
|
118
|
+
message: OpenNotificationParams['message'];
|
|
119
|
+
cancelMutation: OpenNotificationParams['cancelMutation'];
|
|
120
|
+
undoableTimeout: OpenNotificationParams['undoableTimeout'];
|
|
121
|
+
};
|
|
122
|
+
declare const UndoableNotification: React.FC<UndoableNotificationProps>;
|
|
123
|
+
|
|
124
|
+
declare const AutoSaveIndicator: ({ status, elements: { success, error, loading, idle, }, }: AutoSaveIndicatorProps) => react_jsx_runtime.JSX.Element;
|
|
125
|
+
|
|
126
|
+
declare const useNotificationProvider: () => NotificationProvider;
|
|
127
|
+
|
|
128
|
+
interface ThemedLayoutContext extends ThemeProviderProps {
|
|
129
|
+
}
|
|
130
|
+
declare const ThemedLayoutContextProvider: ({ children, ...rest }: ThemedLayoutContext) => react_jsx_runtime.JSX.Element;
|
|
131
|
+
|
|
132
|
+
type GreetingOptions = {
|
|
133
|
+
name?: string;
|
|
134
|
+
};
|
|
135
|
+
declare function greet(opts?: GreetingOptions): string;
|
|
136
|
+
|
|
137
|
+
export { AutoSaveIndicator, BooleanField, type BooleanFieldProps, Breadcrumb, type BreadcrumbProps, CloneButton, type CloneButtonProps, Create, CreateButton, type CreateButtonProps, type CreateProps, type DateFieldProps, DeleteButton, type DeleteButtonProps, type DivProps, EditButton, type EditButtonProps, type EditProps, ErrorComponent, ExportButton, type ExportButtonProps, type GreetingOptions, ImportButton, type ImportButtonProps, List, ListButton, type ListButtonProps, type ListProps, type MarkdownFieldProps, NumberField, type NumberFieldProps, RefreshButton, type RefreshButtonProps, SaveButton, type SaveButtonProps, ShowButton, type ShowButtonProps, type ShowProps, TextField, type TextFieldProps, ThemedLayout, type ThemedLayoutContext, ThemedLayoutContextProvider, ThemedTitle, UndoableNotification, type UndoableNotificationProps, greet, useNotificationProvider };
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
'use strict';var N=require('react'),reactSlot=require('@radix-ui/react-slot'),classVarianceAuthority=require('class-variance-authority'),lucideReact=require('lucide-react'),clsx=require('clsx'),tailwindMerge=require('tailwind-merge'),jsxRuntime=require('react/jsx-runtime'),ot=require('@radix-ui/react-separator'),T=require('@radix-ui/react-dialog'),k=require('@radix-ui/react-tooltip'),core=require('@refinedev/core');require('react-dom');var re=require('@radix-ui/react-avatar'),y=require('@radix-ui/react-dropdown-menu'),nextThemes=require('next-themes'),U=require('@radix-ui/react-popover'),sonner=require('sonner');function _interopNamespace(e){if(e&&e.__esModule)return e;var n=Object.create(null);if(e){Object.keys(e).forEach(function(k){if(k!=='default'){var d=Object.getOwnPropertyDescriptor(e,k);Object.defineProperty(n,k,d.get?d:{enumerable:true,get:function(){return e[k]}});}})}n.default=e;return Object.freeze(n)}var N__namespace=/*#__PURE__*/_interopNamespace(N);var ot__namespace=/*#__PURE__*/_interopNamespace(ot);var T__namespace=/*#__PURE__*/_interopNamespace(T);var k__namespace=/*#__PURE__*/_interopNamespace(k);var re__namespace=/*#__PURE__*/_interopNamespace(re);var y__namespace=/*#__PURE__*/_interopNamespace(y);var U__namespace=/*#__PURE__*/_interopNamespace(U);var Ie=768;function tt(){let[e,t]=N.useState(void 0);return N.useEffect(()=>{let o=window.matchMedia(`(max-width: ${Ie-1}px)`),r=()=>{t(window.innerWidth<Ie);};return o.addEventListener("change",r),t(window.innerWidth<Ie),()=>o.removeEventListener("change",r)},[]),!!e}function l(...e){return tailwindMerge.twMerge(clsx.clsx(e))}var yo=classVarianceAuthority.cva("inline-flex gap-2 items-center justify-center whitespace-nowrap rounded-md text-sm font-medium transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-white hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",outline:"border bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2 has-[>svg]:px-3",sm:"h-8 rounded-md gap-1.5 px-3 has-[>svg]:px-2.5",lg:"h-10 rounded-md px-6 has-[>svg]:px-4",icon:"size-9","icon-sm":"size-8","icon-lg":"size-10"}},defaultVariants:{variant:"default",size:"default"}});function v({className:e,variant:t,size:o,asChild:r=false,...n}){return jsxRuntime.jsx(r?reactSlot.Slot:"button",{"data-slot":"button",className:l(yo({variant:t,size:o,className:e})),...n})}function rt({className:e,orientation:t="horizontal",decorative:o=true,...r}){return jsxRuntime.jsx(ot__namespace.Root,{"data-slot":"separator",decorative:o,orientation:t,className:l("bg-border shrink-0 data-[orientation=horizontal]:h-px data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-px",e),...r})}function nt({...e}){return jsxRuntime.jsx(T__namespace.Root,{"data-slot":"sheet",...e})}function Bo({...e}){return jsxRuntime.jsx(T__namespace.Portal,{"data-slot":"sheet-portal",...e})}function No({className:e,...t}){return jsxRuntime.jsx(T__namespace.Overlay,{"data-slot":"sheet-overlay",className:l("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50",e),...t})}function at({className:e,children:t,side:o="right",...r}){return jsxRuntime.jsxs(Bo,{children:[jsxRuntime.jsx(No,{}),jsxRuntime.jsxs(T__namespace.Content,{"data-slot":"sheet-content",className:l("bg-background data-[state=open]:animate-in data-[state=closed]:animate-out fixed z-50 flex flex-col gap-4 shadow-lg transition ease-in-out data-[state=closed]:duration-300 data-[state=open]:duration-500",o==="right"&&"data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right inset-y-0 right-0 h-full w-3/4 border-l sm:max-w-sm",o==="left"&&"data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left inset-y-0 left-0 h-full w-3/4 border-r sm:max-w-sm",o==="top"&&"data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top inset-x-0 top-0 h-auto border-b",o==="bottom"&&"data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom inset-x-0 bottom-0 h-auto border-t",e),...r,children:[t,jsxRuntime.jsxs(T__namespace.Close,{className:"ring-offset-background focus:ring-ring data-[state=open]:bg-secondary absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none",children:[jsxRuntime.jsx(lucideReact.XIcon,{className:"size-4"}),jsxRuntime.jsx("span",{className:"sr-only",children:"Close"})]})]})]})}function it({className:e,...t}){return jsxRuntime.jsx("div",{"data-slot":"sheet-header",className:l("flex flex-col gap-1.5 p-4",e),...t})}function st({className:e,...t}){return jsxRuntime.jsx(T__namespace.Title,{"data-slot":"sheet-title",className:l("text-foreground font-semibold",e),...t})}function dt({className:e,...t}){return jsxRuntime.jsx(T__namespace.Description,{"data-slot":"sheet-description",className:l("text-muted-foreground text-sm",e),...t})}function Le({delayDuration:e=0,...t}){return jsxRuntime.jsx(k__namespace.Provider,{"data-slot":"tooltip-provider",delayDuration:e,...t})}function ce({...e}){return jsxRuntime.jsx(Le,{children:jsxRuntime.jsx(k__namespace.Root,{"data-slot":"tooltip",...e})})}function lt({...e}){return jsxRuntime.jsx(k__namespace.Trigger,{"data-slot":"tooltip-trigger",...e})}function ut({className:e,sideOffset:t=0,children:o,...r}){return jsxRuntime.jsx(k__namespace.Portal,{children:jsxRuntime.jsxs(k__namespace.Content,{"data-slot":"tooltip-content",sideOffset:t,className:l("bg-foreground text-background animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-fit origin-(--radix-tooltip-content-transform-origin) rounded-md px-3 py-1.5 text-xs text-balance",e),...r,children:[o,jsxRuntime.jsx(k__namespace.Arrow,{className:"bg-foreground fill-foreground z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px]"})]})})}var ko="sidebar_state",Lo=3600*24*7,Eo="16rem",zo="18rem",Oo="3rem",Ao="b",ct=N__namespace.createContext(null);function _(){let e=N__namespace.useContext(ct);if(!e)throw new Error("useSidebar must be used within a SidebarProvider.");return e}function pt({defaultOpen:e=true,open:t,onOpenChange:o,className:r,style:n,children:a,...i}){let s=tt(),[u,d]=N__namespace.useState(false),[c,p]=N__namespace.useState(e),f=t??c,m=N__namespace.useCallback(C=>{let x=typeof C=="function"?C(f):C;o?o(x):p(x),document.cookie=`${ko}=${x}; path=/; max-age=${Lo}`;},[o,f]),b=N__namespace.useCallback(()=>s?d(C=>!C):m(C=>!C),[s,m,d]);N__namespace.useEffect(()=>{let C=x=>{x.key===Ao&&(x.metaKey||x.ctrlKey)&&(x.preventDefault(),b());};return window.addEventListener("keydown",C),()=>window.removeEventListener("keydown",C)},[b]);let g=f?"expanded":"collapsed",h=N__namespace.useMemo(()=>({state:g,open:f,setOpen:m,isMobile:s,openMobile:u,setOpenMobile:d,toggleSidebar:b}),[g,f,m,s,u,d,b]);return jsxRuntime.jsx(ct.Provider,{value:h,children:jsxRuntime.jsx(Le,{delayDuration:0,children:jsxRuntime.jsx("div",{"data-slot":"sidebar-wrapper",style:{"--sidebar-width":Eo,"--sidebar-width-icon":Oo,...n},className:l("group/sidebar-wrapper has-data-[variant=inset]:bg-sidebar flex min-h-svh w-full",r),...i,children:a})})})}function mt({side:e="left",variant:t="sidebar",collapsible:o="offcanvas",className:r,children:n,...a}){let{isMobile:i,state:s,openMobile:u,setOpenMobile:d}=_();return o==="none"?jsxRuntime.jsx("div",{"data-slot":"sidebar",className:l("bg-sidebar text-sidebar-foreground flex h-full w-(--sidebar-width) flex-col",r),...a,children:n}):i?jsxRuntime.jsx(nt,{open:u,onOpenChange:d,...a,children:jsxRuntime.jsxs(at,{"data-sidebar":"sidebar","data-slot":"sidebar","data-mobile":"true",className:"bg-sidebar text-sidebar-foreground w-(--sidebar-width) p-0 [&>button]:hidden",style:{"--sidebar-width":zo},side:e,children:[jsxRuntime.jsxs(it,{className:"sr-only",children:[jsxRuntime.jsx(st,{children:"Sidebar"}),jsxRuntime.jsx(dt,{children:"Displays the mobile sidebar."})]}),jsxRuntime.jsx("div",{className:"flex h-full w-full flex-col",children:n})]})}):jsxRuntime.jsxs("div",{className:"group peer text-sidebar-foreground hidden md:block","data-state":s,"data-collapsible":s==="collapsed"?o:"","data-variant":t,"data-side":e,"data-slot":"sidebar",children:[jsxRuntime.jsx("div",{"data-slot":"sidebar-gap",className:l("relative w-(--sidebar-width) bg-transparent transition-[width] duration-200 ease-linear","group-data-[collapsible=offcanvas]:w-0","group-data-[side=right]:rotate-180",t==="floating"||t==="inset"?"group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4)))]":"group-data-[collapsible=icon]:w-(--sidebar-width-icon)")}),jsxRuntime.jsx("div",{"data-slot":"sidebar-container",className:l("fixed inset-y-0 z-10 hidden h-svh w-(--sidebar-width) transition-[left,right,width] duration-200 ease-linear md:flex",e==="left"?"left-0 group-data-[collapsible=offcanvas]:left-[calc(var(--sidebar-width)*-1)]":"right-0 group-data-[collapsible=offcanvas]:right-[calc(var(--sidebar-width)*-1)]",t==="floating"||t==="inset"?"p-2 group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4))+2px)]":"group-data-[collapsible=icon]:w-(--sidebar-width-icon) group-data-[side=left]:border-r group-data-[side=right]:border-l",r),...a,children:jsxRuntime.jsx("div",{"data-sidebar":"sidebar","data-slot":"sidebar-inner",className:"bg-sidebar group-data-[variant=floating]:border-sidebar-border flex h-full w-full flex-col group-data-[variant=floating]:rounded-lg group-data-[variant=floating]:border group-data-[variant=floating]:shadow-sm",children:n})})]})}function ft({className:e,onClick:t,...o}){let{toggleSidebar:r}=_();return jsxRuntime.jsxs(v,{"data-sidebar":"trigger","data-slot":"sidebar-trigger",variant:"ghost",size:"icon",className:l("size-7",e),onClick:n=>{t?.(n),r();},...o,children:[jsxRuntime.jsx(lucideReact.PanelLeftIcon,{}),jsxRuntime.jsx("span",{className:"sr-only",children:"Toggle Sidebar"})]})}function bt({className:e,...t}){return jsxRuntime.jsx("main",{"data-slot":"sidebar-inset",className:l("bg-background relative flex w-full flex-1 flex-col","md:peer-data-[variant=inset]:m-2 md:peer-data-[variant=inset]:ml-0 md:peer-data-[variant=inset]:rounded-xl md:peer-data-[variant=inset]:shadow-sm md:peer-data-[variant=inset]:peer-data-[state=collapsed]:ml-2",e),...t})}function vt({className:e,...t}){return jsxRuntime.jsx("div",{"data-slot":"sidebar-header","data-sidebar":"header",className:l("flex flex-col gap-2 p-2",e),...t})}function gt({className:e,...t}){return jsxRuntime.jsx("div",{"data-slot":"sidebar-footer","data-sidebar":"footer",className:l("flex flex-col gap-2 p-2",e),...t})}function ht({className:e,...t}){return jsxRuntime.jsx("div",{"data-slot":"sidebar-content","data-sidebar":"content",className:l("flex min-h-0 flex-1 flex-col gap-2 overflow-auto group-data-[collapsible=icon]:overflow-hidden",e),...t})}function xt({className:e,...t}){return jsxRuntime.jsx("div",{"data-slot":"sidebar-group","data-sidebar":"group",className:l("relative flex w-full min-w-0 flex-col p-2",e),...t})}function Pt({className:e,...t}){return jsxRuntime.jsx("div",{"data-slot":"sidebar-group-content","data-sidebar":"group-content",className:l("w-full text-sm",e),...t})}function Q({className:e,...t}){return jsxRuntime.jsx("ul",{"data-slot":"sidebar-menu","data-sidebar":"menu",className:l("flex w-full min-w-0 flex-col gap-1",e),...t})}function K({className:e,...t}){return jsxRuntime.jsx("li",{"data-slot":"sidebar-menu-item","data-sidebar":"menu-item",className:l("group/menu-item relative",e),...t})}var _o=classVarianceAuthority.cva("peer/menu-button flex w-full items-center gap-2 overflow-hidden rounded-md p-2 text-left text-sm outline-hidden ring-sidebar-ring transition-[width,height,padding] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 active:bg-sidebar-accent active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 group-has-data-[sidebar=menu-action]/menu-item:pr-8 aria-disabled:pointer-events-none aria-disabled:opacity-50 data-[active=true]:bg-sidebar-accent data-[active=true]:font-medium data-[active=true]:text-sidebar-accent-foreground data-[state=open]:hover:bg-sidebar-accent data-[state=open]:hover:text-sidebar-accent-foreground group-data-[collapsible=icon]:size-8! group-data-[collapsible=icon]:p-2! [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0",{variants:{variant:{default:"hover:bg-sidebar-accent hover:text-sidebar-accent-foreground",outline:"bg-background shadow-[0_0_0_1px_hsl(var(--sidebar-border))] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground hover:shadow-[0_0_0_1px_hsl(var(--sidebar-accent))]"},size:{default:"h-8 text-sm",sm:"h-7 text-xs",lg:"h-12 text-sm group-data-[collapsible=icon]:p-0!"}},defaultVariants:{variant:"default",size:"default"}});function W({asChild:e=false,isActive:t=false,variant:o="default",size:r="default",tooltip:n,className:a,...i}){let s=e?reactSlot.Slot:"button",{isMobile:u,state:d}=_(),c=jsxRuntime.jsx(s,{"data-slot":"sidebar-menu-button","data-sidebar":"menu-button","data-size":r,"data-active":t,className:l(_o({variant:o,size:r}),a),...i});return n?(typeof n=="string"&&(n={children:n}),jsxRuntime.jsxs(ce,{children:[jsxRuntime.jsx(lt,{asChild:true,children:c}),jsxRuntime.jsx(ut,{side:"right",align:"center",hidden:d!=="collapsed"||u,...n})]})):c}function Ct({className:e,...t}){return jsxRuntime.jsx("ul",{"data-slot":"sidebar-menu-sub","data-sidebar":"menu-sub",className:l("border-sidebar-border mx-3.5 flex min-w-0 translate-x-px flex-col gap-1 border-l px-2.5 py-0.5","group-data-[collapsible=icon]:hidden",e),...t})}var yt=({sticky:e})=>{let{data:t}=core.useGetIdentity();return jsxRuntime.jsx(jsxRuntime.Fragment,{children:jsxRuntime.jsx("header",{className:"flex h-(--header-height) shrink-0 items-center gap-2 border-b transition-[width,height] ease-linear group-has-data-[collapsible=icon]/sidebar-wrapper:h-(--header-height)",children:jsxRuntime.jsxs("div",{className:"flex w-full items-center gap-1 px-4 lg:gap-2 lg:px-6",children:[jsxRuntime.jsx(ft,{className:"-ml-1"}),jsxRuntime.jsx(rt,{orientation:"vertical",className:"mx-2 data-[orientation=vertical]:h-4"}),jsxRuntime.jsx("h1",{className:"text-base font-medium",children:"Documents"}),jsxRuntime.jsx("div",{className:"ml-auto flex items-center gap-2",children:jsxRuntime.jsx(v,{variant:"ghost",asChild:true,size:"sm",className:"hidden sm:flex",children:jsxRuntime.jsx("a",{href:"https://github.com/shadcn-ui/ui/tree/main/apps/v4/app/(examples)/dashboard",rel:"noopener noreferrer",target:"_blank",className:"dark:text-foreground",children:"GitHub"})})})]})})})};var wt=({collapsed:e,icon:t,text:o})=>{let{title:{icon:r,text:n}={}}=core.useRefineOptions(),a=typeof t>"u"?r:t,i=typeof o>"u"?n:o,s=core.useLink(),{state:u,isMobile:d}=_();return jsxRuntime.jsxs(s,{to:"/",className:"flex items-center justify-center gap-2 text-inherit no-underline hover:no-underline",children:[jsxRuntime.jsx("div",{className:"size-6 [&>img]:size-6 [&>svg]:size-6",children:a}),(d||!e&&u==="expanded")&&jsxRuntime.jsx("h6",{className:"text-base font-semibold",children:i})]})};function St(e,t,{checkForDefaultPrevented:o=true}={}){return function(n){if(e?.(n),o===false||!n.defaultPrevented)return t?.(n)}}function Bt(e,t=[]){let o=[];function r(a,i){let s=N__namespace.createContext(i),u=o.length;o=[...o,i];let d=p=>{let{scope:f,children:m,...b}=p,g=f?.[e]?.[u]||s,h=N__namespace.useMemo(()=>b,Object.values(b));return jsxRuntime.jsx(g.Provider,{value:h,children:m})};d.displayName=a+"Provider";function c(p,f){let m=f?.[e]?.[u]||s,b=N__namespace.useContext(m);if(b)return b;if(i!==void 0)return i;throw new Error(`\`${p}\` must be used within \`${a}\``)}return [d,c]}let n=()=>{let a=o.map(i=>N__namespace.createContext(i));return function(s){let u=s?.[e]||a;return N__namespace.useMemo(()=>({[`__scope${e}`]:{...s,[e]:u}}),[s,u])}};return n.scopeName=e,[r,Wo(n,...t)]}function Wo(...e){let t=e[0];if(e.length===1)return t;let o=()=>{let r=e.map(n=>({useScope:n(),scopeName:n.scopeName}));return function(a){let i=r.reduce((s,{useScope:u,scopeName:d})=>{let p=u(a)[`__scope${d}`];return {...s,...p}},{});return N__namespace.useMemo(()=>({[`__scope${t.scopeName}`]:i}),[i])}};return o.scopeName=t.scopeName,o}var F=globalThis?.document?N__namespace.useLayoutEffect:()=>{};var qo=N__namespace[" useInsertionEffect ".trim().toString()]||F;function Tt({prop:e,defaultProp:t,onChange:o=()=>{},caller:r}){let[n,a,i]=Yo({defaultProp:t,onChange:o}),s=e!==void 0,u=s?e:n;{let c=N__namespace.useRef(e!==void 0);N__namespace.useEffect(()=>{let p=c.current;p!==s&&console.warn(`${r} is changing from ${p?"controlled":"uncontrolled"} to ${s?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),c.current=s;},[s,r]);}let d=N__namespace.useCallback(c=>{if(s){let p=Xo(c)?c(e):c;p!==e&&i.current?.(p);}else a(c);},[s,e,a,i]);return [u,d]}function Yo({defaultProp:e,onChange:t}){let[o,r]=N__namespace.useState(e),n=N__namespace.useRef(o),a=N__namespace.useRef(t);return qo(()=>{a.current=t;},[t]),N__namespace.useEffect(()=>{n.current!==o&&(a.current?.(o),n.current=o);},[o,n]),[o,r,a]}function Xo(e){return typeof e=="function"}function Mt(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t);}function Qo(...e){return t=>{let o=false,r=e.map(n=>{let a=Mt(n,t);return !o&&typeof a=="function"&&(o=true),a});if(o)return ()=>{for(let n=0;n<r.length;n++){let a=r[n];typeof a=="function"?a():Mt(e[n],null);}}}}function me(...e){return N__namespace.useCallback(Qo(...e),e)}var er=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],fe=er.reduce((e,t)=>{let o=reactSlot.createSlot(`Primitive.${t}`),r=N__namespace.forwardRef((n,a)=>{let{asChild:i,...s}=n,u=i?o:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=true),jsxRuntime.jsx(u,{...s,ref:a})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function tr(e,t){return N__namespace.useReducer((o,r)=>t[o][r]??o,e)}var Ee=e=>{let{present:t,children:o}=e,r=or(t),n=typeof o=="function"?o({present:r.isPresent}):N__namespace.Children.only(o),a=me(r.ref,rr(n));return typeof o=="function"||r.isPresent?N__namespace.cloneElement(n,{ref:a}):null};Ee.displayName="Presence";function or(e){let[t,o]=N__namespace.useState(),r=N__namespace.useRef(null),n=N__namespace.useRef(e),a=N__namespace.useRef("none"),i=e?"mounted":"unmounted",[s,u]=tr(i,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return N__namespace.useEffect(()=>{let d=be(r.current);a.current=s==="mounted"?d:"none";},[s]),F(()=>{let d=r.current,c=n.current;if(c!==e){let f=a.current,m=be(d);e?u("MOUNT"):m==="none"||d?.display==="none"?u("UNMOUNT"):u(c&&f!==m?"ANIMATION_OUT":"UNMOUNT"),n.current=e;}},[e,u]),F(()=>{if(t){let d,c=t.ownerDocument.defaultView??window,p=m=>{let g=be(r.current).includes(CSS.escape(m.animationName));if(m.target===t&&g&&(u("ANIMATION_END"),!n.current)){let h=t.style.animationFillMode;t.style.animationFillMode="forwards",d=c.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=h);});}},f=m=>{m.target===t&&(a.current=be(r.current));};return t.addEventListener("animationstart",f),t.addEventListener("animationcancel",p),t.addEventListener("animationend",p),()=>{c.clearTimeout(d),t.removeEventListener("animationstart",f),t.removeEventListener("animationcancel",p),t.removeEventListener("animationend",p);}}else u("ANIMATION_END");},[t,u]),{isPresent:["mounted","unmountSuspended"].includes(s),ref:N__namespace.useCallback(d=>{r.current=d?getComputedStyle(d):null,o(d);},[])}}function be(e){return e?.animationName||"none"}function rr(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,o=t&&"isReactWarning"in t&&t.isReactWarning;return o?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,o=t&&"isReactWarning"in t&&t.isReactWarning,o?e.props.ref:e.props.ref||e.ref)}var nr=N__namespace[" useId ".trim().toString()]||(()=>{}),ar=0;function Lt(e){let[t,o]=N__namespace.useState(nr());return F(()=>{o(r=>r??String(ar++));},[e]),e||(t?`radix-${t}`:"")}var ve="Collapsible",[ir]=Bt(ve),[sr,Oe]=ir(ve),Et=N__namespace.forwardRef((e,t)=>{let{__scopeCollapsible:o,open:r,defaultOpen:n,disabled:a,onOpenChange:i,...s}=e,[u,d]=Tt({prop:r,defaultProp:n??false,onChange:i,caller:ve});return jsxRuntime.jsx(sr,{scope:o,disabled:a,contentId:Lt(),open:u,onOpenToggle:N__namespace.useCallback(()=>d(c=>!c),[d]),children:jsxRuntime.jsx(fe.div,{"data-state":Fe(u),"data-disabled":a?"":void 0,...s,ref:t})})});Et.displayName=ve;var zt="CollapsibleTrigger",Ae=N__namespace.forwardRef((e,t)=>{let{__scopeCollapsible:o,...r}=e,n=Oe(zt,o);return jsxRuntime.jsx(fe.button,{type:"button","aria-controls":n.contentId,"aria-expanded":n.open||false,"data-state":Fe(n.open),"data-disabled":n.disabled?"":void 0,disabled:n.disabled,...r,ref:t,onClick:St(e.onClick,n.onOpenToggle)})});Ae.displayName=zt;var _e="CollapsibleContent",He=N__namespace.forwardRef((e,t)=>{let{forceMount:o,...r}=e,n=Oe(_e,e.__scopeCollapsible);return jsxRuntime.jsx(Ee,{present:o||n.open,children:({present:a})=>jsxRuntime.jsx(dr,{...r,ref:t,present:a})})});He.displayName=_e;var dr=N__namespace.forwardRef((e,t)=>{let{__scopeCollapsible:o,present:r,children:n,...a}=e,i=Oe(_e,o),[s,u]=N__namespace.useState(r),d=N__namespace.useRef(null),c=me(t,d),p=N__namespace.useRef(0),f=p.current,m=N__namespace.useRef(0),b=m.current,g=i.open||s,h=N__namespace.useRef(g),C=N__namespace.useRef(void 0);return N__namespace.useEffect(()=>{let x=requestAnimationFrame(()=>h.current=false);return ()=>cancelAnimationFrame(x)},[]),F(()=>{let x=d.current;if(x){C.current=C.current||{transitionDuration:x.style.transitionDuration,animationName:x.style.animationName},x.style.transitionDuration="0s",x.style.animationName="none";let O=x.getBoundingClientRect();p.current=O.height,m.current=O.width,h.current||(x.style.transitionDuration=C.current.transitionDuration,x.style.animationName=C.current.animationName),u(r);}},[i.open,r]),jsxRuntime.jsx(fe.div,{"data-state":Fe(i.open),"data-disabled":i.disabled?"":void 0,id:i.contentId,hidden:!g,...a,ref:c,style:{"--radix-collapsible-content-height":f?`${f}px`:void 0,"--radix-collapsible-content-width":b?`${b}px`:void 0,...e.style},children:g&&n})});function Fe(e){return e?"open":"closed"}var Ot=Et;function At({...e}){return jsxRuntime.jsx(Ot,{"data-slot":"collapsible",...e})}function _t({...e}){return jsxRuntime.jsx(Ae,{"data-slot":"collapsible-trigger",...e})}function Ht({className:e,children:t,...o}){return jsxRuntime.jsx(He,{"data-slot":"collapsible-content",className:l("data-[state=closed]:animate-collapsible-up data-[state=open]:animate-collapsible-down overflow-hidden transition-all",e),...o,children:t})}function Ut({item:e,selectedKey:t,defaultOpenKeys:o,Link:r,activeItemDisabled:n=false}){let{label:a,route:i,name:s,icon:u,children:d}=e,c=e.key===t,p=d&&d.length>0,f=o.includes(e.key||""),[m,b]=N.useState(f);return p?jsxRuntime.jsx(core.CanAccess,{resource:s,action:"list",params:{resource:e},children:jsxRuntime.jsx(At,{open:m,onOpenChange:b,className:"group/collapsible",children:jsxRuntime.jsxs(K,{children:[jsxRuntime.jsx(_t,{asChild:true,children:jsxRuntime.jsxs(W,{tooltip:a,isActive:c,children:[u??jsxRuntime.jsx(lucideReact.ListIcon,{className:"h-4 w-4"}),jsxRuntime.jsx("span",{children:a}),jsxRuntime.jsx(lucideReact.ChevronRight,{className:l("ml-auto h-4 w-4 transition-transform duration-200",m&&"rotate-90")})]})}),jsxRuntime.jsx(Ht,{children:jsxRuntime.jsx(Ct,{children:d.map(g=>jsxRuntime.jsx(Ut,{item:g,selectedKey:t,defaultOpenKeys:o,Link:r,activeItemDisabled:n},g.key))})})]})})},e.key):jsxRuntime.jsx(core.CanAccess,{resource:s,action:"list",params:{resource:e},children:jsxRuntime.jsx(K,{children:jsxRuntime.jsx(W,{asChild:!c||!n,tooltip:a,isActive:c,disabled:c&&n,children:jsxRuntime.jsxs(r,{to:i,children:[u??jsxRuntime.jsx(lucideReact.ListIcon,{className:"h-4 w-4"}),jsxRuntime.jsx("span",{children:a})]})})})},e.key)}function Vt({meta:e,activeItemDisabled:t=false}){let o=core.useLink(),{menuItems:r,selectedKey:n,defaultOpenKeys:a}=core.useMenu({meta:e});return jsxRuntime.jsx(xt,{children:jsxRuntime.jsxs(Pt,{className:"flex flex-col gap-2",children:[jsxRuntime.jsx(Q,{children:jsxRuntime.jsxs(K,{className:"flex items-center gap-2",children:[jsxRuntime.jsxs(W,{tooltip:"Quick Create",className:"bg-primary text-primary-foreground hover:bg-primary/90 hover:text-primary-foreground active:bg-primary/90 active:text-primary-foreground min-w-8 duration-200 ease-linear",children:[jsxRuntime.jsx(lucideReact.CirclePlus,{}),jsxRuntime.jsx("span",{children:"Quick Create"})]}),jsxRuntime.jsxs(v,{size:"icon",className:"size-8 group-data-[collapsible=icon]:opacity-0",variant:"outline",children:[jsxRuntime.jsx(lucideReact.Mail,{}),jsxRuntime.jsx("span",{className:"sr-only",children:"Inbox"})]})]})}),jsxRuntime.jsx(Q,{children:r.map(i=>jsxRuntime.jsx(Ut,{item:i,selectedKey:n,defaultOpenKeys:a,Link:o,activeItemDisabled:t},i.key))})]})})}function Ue({className:e,...t}){return jsxRuntime.jsx(re__namespace.Root,{"data-slot":"avatar",className:l("relative flex size-8 shrink-0 overflow-hidden rounded-full",e),...t})}function Ve({className:e,...t}){return jsxRuntime.jsx(re__namespace.Image,{"data-slot":"avatar-image",className:l("aspect-square size-full",e),...t})}function Ge({className:e,...t}){return jsxRuntime.jsx(re__namespace.Fallback,{"data-slot":"avatar-fallback",className:l("bg-muted flex size-full items-center justify-center rounded-full",e),...t})}function Gt({...e}){return jsxRuntime.jsx(y__namespace.Root,{"data-slot":"dropdown-menu",...e})}function Kt({...e}){return jsxRuntime.jsx(y__namespace.Trigger,{"data-slot":"dropdown-menu-trigger",...e})}function Wt({className:e,sideOffset:t=4,...o}){return jsxRuntime.jsx(y__namespace.Portal,{children:jsxRuntime.jsx(y__namespace.Content,{"data-slot":"dropdown-menu-content",sideOffset:t,className:l("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 max-h-(--radix-dropdown-menu-content-available-height) min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border p-1 shadow-md",e),...o})})}function qt({...e}){return jsxRuntime.jsx(y__namespace.Group,{"data-slot":"dropdown-menu-group",...e})}function de({className:e,inset:t,variant:o="default",...r}){return jsxRuntime.jsx(y__namespace.Item,{"data-slot":"dropdown-menu-item","data-inset":t,"data-variant":o,className:l("focus:bg-accent focus:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 dark:data-[variant=destructive]:focus:bg-destructive/20 data-[variant=destructive]:focus:text-destructive data-[variant=destructive]:*:[svg]:!text-destructive [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",e),...r})}function Yt({className:e,inset:t,...o}){return jsxRuntime.jsx(y__namespace.Label,{"data-slot":"dropdown-menu-label","data-inset":t,className:l("px-2 py-1.5 text-sm font-medium data-[inset]:pl-8",e),...o})}function We({className:e,...t}){return jsxRuntime.jsx(y__namespace.Separator,{"data-slot":"dropdown-menu-separator",className:l("bg-border -mx-1 my-1 h-px",e),...t})}function Xt({user:e}){let{isMobile:t}=_();return jsxRuntime.jsx(Q,{children:jsxRuntime.jsx(K,{children:jsxRuntime.jsxs(Gt,{children:[jsxRuntime.jsx(Kt,{asChild:true,children:jsxRuntime.jsxs(W,{size:"lg",className:"data-[state=open]:bg-sidebar-accent data-[state=open]:text-sidebar-accent-foreground",children:[jsxRuntime.jsxs(Ue,{className:"h-8 w-8 rounded-lg grayscale",children:[jsxRuntime.jsx(Ve,{src:e.avatar,alt:e.name}),jsxRuntime.jsx(Ge,{className:"rounded-lg",children:"CN"})]}),jsxRuntime.jsxs("div",{className:"grid flex-1 text-left text-sm leading-tight",children:[jsxRuntime.jsx("span",{className:"truncate font-medium",children:e.name}),jsxRuntime.jsx("span",{className:"text-muted-foreground truncate text-xs",children:e.email})]}),jsxRuntime.jsx(lucideReact.Dot,{className:"ml-auto size-4"})]})}),jsxRuntime.jsxs(Wt,{className:"w-(--radix-dropdown-menu-trigger-width) min-w-56 rounded-lg",side:t?"bottom":"right",align:"end",sideOffset:4,children:[jsxRuntime.jsx(Yt,{className:"p-0 font-normal",children:jsxRuntime.jsxs("div",{className:"flex items-center gap-2 px-1 py-1.5 text-left text-sm",children:[jsxRuntime.jsxs(Ue,{className:"h-8 w-8 rounded-lg",children:[jsxRuntime.jsx(Ve,{src:e.avatar,alt:e.name}),jsxRuntime.jsx(Ge,{className:"rounded-lg",children:"CN"})]}),jsxRuntime.jsxs("div",{className:"grid flex-1 text-left text-sm leading-tight",children:[jsxRuntime.jsx("span",{className:"truncate font-medium",children:e.name}),jsxRuntime.jsx("span",{className:"text-muted-foreground truncate text-xs",children:e.email})]})]})}),jsxRuntime.jsx(We,{}),jsxRuntime.jsxs(qt,{children:[jsxRuntime.jsxs(de,{children:[jsxRuntime.jsx(lucideReact.UserCircle,{}),"Account"]}),jsxRuntime.jsxs(de,{children:[jsxRuntime.jsx(lucideReact.CreditCard,{}),"Billing"]}),jsxRuntime.jsxs(de,{children:[jsxRuntime.jsx(lucideReact.Bell,{}),"Notifications"]})]}),jsxRuntime.jsx(We,{}),jsxRuntime.jsxs(de,{children:[jsxRuntime.jsx(lucideReact.LogOut,{}),"Log out"]})]})]})})})}var Cr={user:{name:"shadcn",email:"m@example.com",avatar:"/avatars/shadcn.jpg"}};function Qt({Title:e,render:t,meta:o,activeItemDisabled:r=false,siderItemsAreCollapsed:n=true,...a}){let i=e??wt,{state:s}=_();return jsxRuntime.jsxs(mt,{collapsible:"icon",...a,children:[jsxRuntime.jsx(vt,{children:jsxRuntime.jsx(Q,{children:jsxRuntime.jsx(K,{children:jsxRuntime.jsx(W,{asChild:true,className:"data-[slot=sidebar-menu-button]:!p-1.5",children:jsxRuntime.jsx(i,{collapsed:s==="collapsed"})})})})}),jsxRuntime.jsx(ht,{children:jsxRuntime.jsx(Vt,{meta:o,activeItemDisabled:r})}),jsxRuntime.jsx(gt,{children:jsxRuntime.jsx(Xt,{user:Cr.user})})]})}function Jt({children:e,...t}){return jsxRuntime.jsx(nextThemes.ThemeProvider,{...t,children:e})}var qe=({children:e,...t})=>jsxRuntime.jsx(Jt,{attribute:"data-theme",defaultTheme:"system",enableSystem:true,disableTransitionOnChange:true,...t,children:e});var ls=({Sider:e,Header:t,Title:o,Footer:r,OffLayoutArea:n,children:a,initialSiderCollapsed:i,onSiderCollapsed:s})=>jsxRuntime.jsx(qe,{children:jsxRuntime.jsxs(pt,{defaultOpen:i!==void 0?!i:true,onOpenChange:s?c=>s(!c):void 0,style:{"--sidebar-width":"calc(var(--spacing) * 72)","--header-height":"calc(var(--spacing) * 12)"},children:[jsxRuntime.jsx(e??Qt,{Title:o}),jsxRuntime.jsxs(bt,{children:[jsxRuntime.jsx(t??yt,{}),jsxRuntime.jsx("div",{className:"flex flex-1 flex-col gap-4 p-4 pt-0",children:a})]})]})});var w={CloneButton:"refine-clone-button",DeleteButton:"refine-delete-button",EditButton:"refine-edit-button",SaveButton:"refine-save-button",CreateButton:"refine-create-button",ImportButton:"refine-import-button",ExportButton:"refine-export-button",ListButton:"refine-list-button",RefreshButton:"refine-refresh-button",ShowButton:"refine-show-button"},ne={Title:"refine-pageHeader-title"},S={CloneButton:"refine-clone-button",DeleteButton:"refine-delete-button",EditButton:"refine-edit-button",SaveButton:"refine-save-button",CreateButton:"refine-create-button",ImportButton:"refine-import-button",ExportButton:"refine-export-button",ListButton:"refine-list-button",RefreshButton:"refine-refresh-button",ShowButton:"refine-show-button"};var gs=e=>{let{canCreate:t,children:o,createButtonProps:r,resource:n,wrapperProps:a,contentProps:i,headerProps:s,headerButtonProps:u,headerButtons:d,breadcrumb:c,title:p}=e,f=core.useTranslate(),{options:{breadcrumb:m}={}}=core.useRefineContext(),b=core.useUserFriendlyName(),{resource:g,identifier:h}=core.useResourceParams({resource:n}),C=t??(!!g?.create||r),x=typeof c>"u"?m:c,O=C?{resource:h,...r}:void 0,X=C?jsxRuntime.jsx(Xe,{...O}):null,j=d?typeof d=="function"?d({defaultButtons:X,createButtonProps:O}):d:X,ee=()=>p===false?null:p?typeof p=="string"||typeof p=="number"?jsxRuntime.jsx("h3",{className:l("text-2xl font-semibold",ne.Title),children:p}):p:jsxRuntime.jsx("h3",{className:l("text-2xl font-semibold",ne.Title),children:f(`${h}.titles.list`,b(g?.meta?.label??h,"plural"))});return jsxRuntime.jsxs("div",{className:l("bg-background rounded-md px-4 py-3"),...a,children:[jsxRuntime.jsxs("div",{className:l("mb-3 flex flex-wrap items-center justify-between gap-3 md:flex-nowrap"),...s,children:[jsxRuntime.jsxs("div",{className:"min-w-[200px]",children:[typeof x<"u"?jsxRuntime.jsx(jsxRuntime.Fragment,{children:x}):jsxRuntime.jsx(he,{}),ee()]}),jsxRuntime.jsx("div",{className:l("flex flex-wrap justify-start gap-2 md:justify-end"),...u,children:j})]}),jsxRuntime.jsx("div",{...i,children:o})]})};var Bs=e=>{let{children:t,saveButtonProps:o,isLoading:r,resource:n,footerButtons:a,footerButtonProps:i,headerButtons:s,headerButtonProps:u,wrapperProps:d,contentProps:c,headerProps:p,goBack:f,breadcrumb:m,title:b}=e,g=core.useTranslate(),{options:{breadcrumb:h}={}}=core.useRefineContext(),C=core.useBack(),x=core.useUserFriendlyName(),{resource:O,action:X,identifier:j}=core.useResourceParams(),ee=typeof m>"u"?h:m,Ne={...r?{disabled:true}:{},...o},ue=jsxRuntime.jsx(Qe,{...Ne}),Te=f===null?null:jsxRuntime.jsx(v,{variant:"ghost",size:"sm",onClick:X!=="list"||typeof X<"u"?C:void 0,children:typeof f<"u"?f:jsxRuntime.jsx(lucideReact.ArrowLeft,{className:"h-4 w-4"})}),Me=s?typeof s=="function"?s({defaultButtons:null}):s:null,De=a?typeof a=="function"?a({defaultButtons:ue,saveButtonProps:Ne}):a:ue,et=()=>b===false?null:b?typeof b=="string"||typeof b=="number"?jsxRuntime.jsx("h3",{className:l("text-2xl font-semibold",ne.Title),children:b}):b:jsxRuntime.jsx("h3",{className:l("text-2xl font-semibold",ne.Title),children:g(`${j}.titles.create`,`Create ${x(O?.meta?.label??j,"singular")}`)});return jsxRuntime.jsxs("div",{className:l("bg-background relative rounded-md px-4 py-3"),...d,children:[r&&jsxRuntime.jsx("div",{className:"absolute top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2",children:jsxRuntime.jsx(lucideReact.Loader2,{className:"h-6 w-6 animate-spin"})}),jsxRuntime.jsxs("div",{className:l("mb-3 flex flex-wrap items-center justify-between gap-3 md:flex-nowrap"),...p,children:[jsxRuntime.jsxs("div",{className:"min-w-[200px]",children:[typeof ee<"u"?jsxRuntime.jsx(jsxRuntime.Fragment,{children:ee}):jsxRuntime.jsx(he,{}),jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[Te,et()]})]}),jsxRuntime.jsx("div",{className:l("flex flex-wrap justify-start gap-2 md:justify-end"),...u,children:Me})]}),jsxRuntime.jsx("div",{className:l(r&&"opacity-50"),...c,children:t}),jsxRuntime.jsx("div",{className:l("mt-8 flex justify-end gap-2"),...i,children:De})]})};var Xe=({resource:e,hideText:t=false,accessControl:o,meta:r,children:n,onClick:a,...i})=>{let{hidden:s,disabled:u,label:d,title:c,LinkComponent:p,to:f}=core.useCreateButton({resource:e,meta:r,accessControl:o}),m=u||i.disabled;return s||i.hidden?null:jsxRuntime.jsx(p,{to:f,replace:false,onClick:g=>{if(m){g.preventDefault();return}a&&(g.preventDefault(),a(g));},children:jsxRuntime.jsxs(v,{disabled:m,title:c,"data-testid":w.CreateButton,className:S.CreateButton,...i,children:[jsxRuntime.jsx(lucideReact.PlusSquare,{})," ",!t&&(n??d)]})})};var Gr=({resource:e,recordItemId:t,hideText:o=false,accessControl:r,meta:n,children:a,onClick:i,...s})=>{let{hidden:u,disabled:d,label:c,title:p,LinkComponent:f,to:m}=core.useEditButton({resource:e,id:t,meta:n,accessControl:r}),b=d||s.disabled;return u||s.hidden?null:jsxRuntime.jsx(f,{to:m,replace:false,onClick:h=>{if(b){h.preventDefault();return}i&&(h.preventDefault(),i(h));},children:jsxRuntime.jsxs(v,{disabled:b,title:p,"data-testid":w.EditButton,className:S.EditButton,...s,children:[jsxRuntime.jsx(lucideReact.FolderDown,{})," ",!o&&(a??c)]})})};function to({...e}){return jsxRuntime.jsx(U__namespace.Root,{"data-slot":"popover",...e})}function oo({...e}){return jsxRuntime.jsx(U__namespace.Trigger,{"data-slot":"popover-trigger",...e})}function ro({className:e,align:t="center",sideOffset:o=4,...r}){return jsxRuntime.jsx(U__namespace.Portal,{children:jsxRuntime.jsx(U__namespace.Content,{"data-slot":"popover-content",align:t,sideOffset:o,className:l("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-72 origin-(--radix-popover-content-transform-origin) rounded-md border p-4 shadow-md outline-hidden",e),...r})})}var Xr=({resource:e,recordItemId:t,onSuccess:o,mutationMode:r,children:n,successNotification:a,errorNotification:i,hideText:s=false,accessControl:u,meta:d,invalidates:c,dataProviderName:p,confirmTitle:f,confirmOkText:m,confirmCancelText:b,...g})=>{let[h,C]=N.useState(false),{onConfirm:x,label:O,title:X,disabled:j,hidden:ee,loading:Ne,confirmTitle:ue,confirmOkLabel:Te,cancelLabel:Me}=core.useDeleteButton({resource:e,id:t,onSuccess:o,mutationMode:r,successNotification:a,errorNotification:i,accessControl:u,meta:d,dataProviderName:p,invalidates:c}),De=j||g.disabled;return ee||g.hidden?null:jsxRuntime.jsxs(to,{open:h,onOpenChange:C,children:[jsxRuntime.jsx(oo,{asChild:true,children:jsxRuntime.jsxs(v,{disabled:De,title:X,"data-testid":w.DeleteButton,className:S.DeleteButton,...g,children:[jsxRuntime.jsx(lucideReact.Trash,{})," ",!s&&(n??O)]})}),jsxRuntime.jsxs(ro,{children:[f??ue,jsxRuntime.jsxs("div",{className:"gap-x-2",children:[jsxRuntime.jsx(v,{onClick:()=>C(false),children:b??Me}),jsxRuntime.jsx(v,{onClick:()=>{x(),C(false);},children:m??Te})]})]})]})};var Zr=({resource:e,recordItemId:t,hideText:o=false,dataProviderName:r,children:n,...a})=>{let{onClick:i,label:s,loading:u}=core.useRefreshButton({resource:e,id:t,dataProviderName:r}),d=u||a.disabled;return jsxRuntime.jsxs(v,{onClick:i,disabled:d,"data-testid":w.RefreshButton,className:S.RefreshButton,...a,children:[jsxRuntime.jsx(lucideReact.RefreshCcw,{})," ",!o&&(n??s)]})};var rn=({resource:e,recordItemId:t,hideText:o=false,accessControl:r,meta:n,children:a,onClick:i,...s})=>{let{hidden:u,disabled:d,label:c,title:p,LinkComponent:f,to:m}=core.useShowButton({resource:e,id:t,meta:n,accessControl:r}),b=d||s.disabled;return u||s.hidden?null:jsxRuntime.jsx(f,{to:m,replace:false,onClick:h=>{if(b){h.preventDefault();return}i&&(h.preventDefault(),i(h));},children:jsxRuntime.jsxs(v,{disabled:b,title:p,"data-testid":w.ShowButton,className:S.ShowButton,...s,children:[jsxRuntime.jsx(lucideReact.Eye,{})," ",!o&&(a??c)]})})};var dn=({resource:e,hideText:t=false,accessControl:o,meta:r,children:n,onClick:a,...i})=>{let{hidden:s,disabled:u,label:d,title:c,LinkComponent:p,to:f}=core.useListButton({resource:e,meta:r,accessControl:o}),m=u||i.disabled;return s||i.hidden?null:jsxRuntime.jsx(p,{to:f,replace:false,onClick:g=>{if(m){g.preventDefault();return}a&&(g.preventDefault(),a(g));},children:jsxRuntime.jsxs(v,{disabled:m,title:c,"data-testid":w.ListButton,className:S.ListButton,...i,children:[jsxRuntime.jsx(lucideReact.List,{})," ",!t&&(n??d)]})})};var pn=({hideText:e=false,loading:t=false,children:o,...r})=>{let{label:n}=core.useExportButton(),a=t||r.disabled;return jsxRuntime.jsxs(v,{disabled:a,"data-testid":w.ExportButton,className:S.ExportButton,...r,children:[jsxRuntime.jsx(lucideReact.FolderUp,{})," ",!e&&(o??n)]})};var Qe=({hideText:e=false,children:t,...o})=>{let{label:r}=core.useSaveButton();return jsxRuntime.jsxs(v,{"data-testid":w.SaveButton,className:S.SaveButton,...o,children:[jsxRuntime.jsx(lucideReact.Save,{})," ",!e&&(t??r)]})};var Cn=({resource:e,recordItemId:t,hideText:o=false,accessControl:r,meta:n,children:a,onClick:i,...s})=>{let{hidden:u,disabled:d,label:c,title:p,LinkComponent:f,to:m}=core.useCloneButton({resource:e,id:t,meta:n,accessControl:r}),b=d||s.disabled;return u||s.hidden?null:jsxRuntime.jsx(f,{to:m,replace:false,onClick:h=>{if(b){h.preventDefault();return}i&&(h.preventDefault(),i(h));},children:jsxRuntime.jsxs(v,{disabled:b,title:p,"data-testid":w.CloneButton,className:S.CloneButton,...s,children:[jsxRuntime.jsx(lucideReact.Copy,{})," ",!o&&(a??c)]})})};var Sn=({inputProps:e,hideText:t=false,loading:o=false,children:r,...n})=>{let{label:a}=core.useImportButton(),i=o||n.disabled;return jsxRuntime.jsxs(v,{disabled:i,"data-testid":w.ImportButton,className:S.ImportButton,...n,children:[jsxRuntime.jsx(lucideReact.PlusSquare,{})," ",!t&&(r??a)]})};var Dn=classVarianceAuthority.cva("text-foreground",{variants:{size:{sm:"text-sm",md:"text-base",lg:"text-lg"}},defaultVariants:{size:"md"}}),V=N__namespace.forwardRef(({className:e,size:t,asChild:o,...r},n)=>jsxRuntime.jsx(o?reactSlot.Slot:"span",{ref:n,className:l(Dn({size:t}),e),...r}));V.displayName="Text";var dl=({value:e,...t})=>jsxRuntime.jsx(V,{...t,children:e});var ml=({value:e,valueLabelTrue:t="true",valueLabelFalse:o="false",trueIcon:r,falseIcon:n,svgIconProps:a,...i})=>jsxRuntime.jsx(ce,{...i,children:jsxRuntime.jsx("span",{children:e?r??jsxRuntime.jsx(lucideReact.Check,{size:20,...a,className:`icon-check${a?.className?` ${a.className}`:""}`}):n??jsxRuntime.jsx(lucideReact.Minus,{size:20,...a,className:`icon-minus${a?.className?` ${a.className}`:""}`})})});function zn(){return !!(typeof Intl=="object"&&Intl&&typeof Intl.NumberFormat=="function")}var gl=({value:e,locale:t,options:o,...r})=>{let n=Number(e);return jsxRuntime.jsx(V,{...r,children:zn()?n.toLocaleString(t,o):n})};var Rl=()=>{let[e,t]=N.useState(null),[o,r]=N.useState(false),n=core.useTranslate(),a=core.useGo(),{action:i,resource:s}=core.useResourceParams();return N.useEffect(()=>{s&&i&&t(n("pages.error.info",{resource:s.name,action:i},`You attempted to perform the "${i}" action on the "${s.name}" resource, but an error occurred.`));},[s,i,n]),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("h1",{children:"404"}),jsxRuntime.jsx("p",{children:n("pages.error.404","Sorry, the page you visited does not exist.")}),e&&jsxRuntime.jsx("p",{children:e}),s&&i&&["create","edit","show"].includes(i)&&jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("span",{"data-testid":"error-component-tooltip",onMouseOver:()=>r(true),onMouseOut:()=>r(false)}),o&&jsxRuntime.jsx("p",{children:n("pages.error.tipKnownActionMissing",{resource:s.name,action:i},`You may have forgotten to add the "${i}" component to "${s.name}" resource.`)})]}),jsxRuntime.jsx(v,{onClick:()=>{a({to:"/"});},children:n("pages.error.backHome","Back Home")})]})};function co({...e}){return jsxRuntime.jsx("nav",{"aria-label":"breadcrumb","data-slot":"breadcrumb",...e})}function po({className:e,...t}){return jsxRuntime.jsx("ol",{"data-slot":"breadcrumb-list",className:l("text-muted-foreground flex flex-wrap items-center gap-1.5 text-sm break-words sm:gap-2.5",e),...t})}function Je({className:e,...t}){return jsxRuntime.jsx("li",{"data-slot":"breadcrumb-item",className:l("inline-flex items-center gap-1.5",e),...t})}function Ze({asChild:e,className:t,...o}){return jsxRuntime.jsx(e?reactSlot.Slot:"a",{"data-slot":"breadcrumb-link",className:l("hover:text-foreground transition-colors",t),...o})}function je({children:e,className:t,...o}){return jsxRuntime.jsx("li",{"data-slot":"breadcrumb-separator",role:"presentation","aria-hidden":"true",className:l("[&>svg]:size-3.5",t),...o,children:e??jsxRuntime.jsx(lucideReact.ChevronRight,{})})}var he=({breadcrumbProps:e,showHome:t=true,hideIcons:o=false,meta:r,minItems:n=2})=>{let{breadcrumbs:a}=core.useBreadcrumb({meta:r}),i=core.useLink();if(a.length<n)return null;let{resources:s}=core.useResourceParams(),u=core.matchResourceFromRoute("/",s);return jsxRuntime.jsx(co,{...e,children:jsxRuntime.jsxs(po,{children:[t&&u?.found&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(Je,{children:jsxRuntime.jsx(i,{to:"/",children:u?.resource?.meta?.icon??jsxRuntime.jsx(lucideReact.Home,{size:20})})}),a.length>0&&jsxRuntime.jsx(je,{})]}),a.map(({label:d,icon:c,href:p},f)=>jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsxs(Je,{children:[!o&&c,p?jsxRuntime.jsx(Ze,{asChild:true,children:jsxRuntime.jsx(i,{to:p,children:d})}):jsxRuntime.jsx(Ze,{children:d})]},d),f<a.length-1&&jsxRuntime.jsx(je,{})]}))]})})};var bo=({notificationKey:e="",message:t,cancelMutation:o,undoableTimeout:r=0})=>jsxRuntime.jsxs("div",{className:"bg-background flex min-w-[320px] items-center justify-between gap-2 p-2 shadow-md",children:[jsxRuntime.jsx("div",{className:"flex items-center gap-2",children:jsxRuntime.jsxs("span",{className:"inline-flex h-6 min-w-6 items-center justify-center rounded-md border px-2 text-xs",children:[r,"s"]})}),jsxRuntime.jsx(V,{children:t}),jsxRuntime.jsx(v,{"aria-label":"undo",variant:"outline",onClick:()=>{o?.(),e&&sonner.toast.dismiss(e);},size:"icon",children:jsxRuntime.jsx(lucideReact.RotateCcwSquare,{size:18})})]});var ql=({status:e,elements:{success:t=jsxRuntime.jsx(Be,{translationKey:"autoSave.success",defaultMessage:"saved",icon:jsxRuntime.jsx(lucideReact.CheckCircle,{size:"18px"})}),error:o=jsxRuntime.jsx(Be,{translationKey:"autoSave.error",defaultMessage:"auto save failure",icon:jsxRuntime.jsx(lucideReact.FileExclamationPoint,{size:"18px"})}),loading:r=jsxRuntime.jsx(Be,{translationKey:"autoSave.loading",defaultMessage:"saving...",icon:jsxRuntime.jsx(lucideReact.RefreshCcw,{size:"18px"})}),idle:n=jsxRuntime.jsx(Be,{translationKey:"autoSave.idle",defaultMessage:"waiting for changes",icon:jsxRuntime.jsx(lucideReact.Dot,{size:"18px"})})}={}})=>jsxRuntime.jsx(core.AutoSaveIndicator,{status:e,elements:{success:t,error:o,loading:r,idle:n}}),Be=({translationKey:e,defaultMessage:t,icon:o})=>{let r=core.useTranslate();return jsxRuntime.jsxs(V,{color:"gray.700",className:"color-muted mr-2 flex flex-wrap items-center text-sm",children:[r(e,t),jsxRuntime.jsx("span",{style:{marginLeft:"3px"},children:o})]})};var Zl=()=>({open:({key:e,message:t,type:o,description:r,undoableTimeout:n,cancelMutation:a})=>{if(o==="progress"){sonner.toast.custom(()=>jsxRuntime.jsx(bo,{notificationKey:e,message:t,cancelMutation:a,undoableTimeout:n}),{id:e,duration:1/0});return}let i={};e!==void 0&&(i.id=e),r&&(i.description=r),o==="success"?sonner.toast.success(t,i):o==="error"?sonner.toast.error(t,i):sonner.toast(t,i);},close:e=>sonner.toast.dismiss(e)});function nu(e={}){return `Hola, ${e.name??"mundo"}!`}
|
|
2
|
+
exports.AutoSaveIndicator=ql;exports.BooleanField=ml;exports.Breadcrumb=he;exports.CloneButton=Cn;exports.Create=Bs;exports.CreateButton=Xe;exports.DeleteButton=Xr;exports.EditButton=Gr;exports.ErrorComponent=Rl;exports.ExportButton=pn;exports.ImportButton=Sn;exports.List=gs;exports.ListButton=dn;exports.NumberField=gl;exports.RefreshButton=Zr;exports.SaveButton=Qe;exports.ShowButton=rn;exports.TextField=dl;exports.ThemedLayout=ls;exports.ThemedLayoutContextProvider=qe;exports.ThemedTitle=wt;exports.UndoableNotification=bo;exports.greet=nu;exports.useNotificationProvider=Zl;//# sourceMappingURL=index.js.map
|
|
3
|
+
//# sourceMappingURL=index.js.map
|