@murabei-data-science/pumpwood-ui 1.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +145 -0
- package/dist/components.d.ts +1227 -0
- package/dist/components.esm.js +39 -0
- package/dist/components.js +40 -0
- package/dist/design-system.d.ts +391 -0
- package/dist/design-system.esm.js +26 -0
- package/dist/design-system.js +27 -0
- package/dist/index.css +1 -0
- package/dist/index.d.ts +1599 -0
- package/dist/index.esm.js +39 -0
- package/dist/index.js +40 -0
- package/dist/types/components/AlertWithIcon/index.d.ts +12 -0
- package/dist/types/components/Auth/AuthenticatedView.d.ts +18 -0
- package/dist/types/components/Auth/LoginCard.d.ts +33 -0
- package/dist/types/components/Auth/LoginCardSSO.d.ts +31 -0
- package/dist/types/components/Auth/NotAuthenticatedView.d.ts +21 -0
- package/dist/types/components/Auth/index.d.ts +4 -0
- package/dist/types/components/AutoFormContent/index.d.ts +46 -0
- package/dist/types/components/Badge/index.d.ts +17 -0
- package/dist/types/components/Card/index.d.ts +23 -0
- package/dist/types/components/ClearButton/index.d.ts +3 -0
- package/dist/types/components/CombinedFilterTable/index.d.ts +9 -0
- package/dist/types/components/ConfirmationDialog/index.d.ts +71 -0
- package/dist/types/components/CustomBreadcrumb/index.d.ts +6 -0
- package/dist/types/components/DatePicker/index.d.ts +35 -0
- package/dist/types/components/DeleteDialog/index.d.ts +9 -0
- package/dist/types/components/DetailPage/AutoDetailContent.d.ts +27 -0
- package/dist/types/components/DetailPage/DetailPage.d.ts +24 -0
- package/dist/types/components/DetailPage/detail-utils.d.ts +24 -0
- package/dist/types/components/DetailPage/index.d.ts +3 -0
- package/dist/types/components/DownloadButton/index.d.ts +20 -0
- package/dist/types/components/Dropzone/index.d.ts +21 -0
- package/dist/types/components/EmptyContainer/index.d.ts +16 -0
- package/dist/types/components/ErrorBoundary/index.d.ts +10 -0
- package/dist/types/components/ErrorMessage/index.d.ts +4 -0
- package/dist/types/components/ErrorToast/index.d.ts +4 -0
- package/dist/types/components/FKSelect/index.d.ts +63 -0
- package/dist/types/components/FileDropzone/index.d.ts +22 -0
- package/dist/types/components/FilePreview/index.d.ts +13 -0
- package/dist/types/components/Filters/CreatedByUserFilter.d.ts +24 -0
- package/dist/types/components/Filters/DateRangeFilter.d.ts +23 -0
- package/dist/types/components/KeyValueContent/index.d.ts +3 -0
- package/dist/types/components/Loading/index.d.ts +2 -0
- package/dist/types/components/M2MTable/index.d.ts +35 -0
- package/dist/types/components/MarkdownEditor/index.d.ts +12 -0
- package/dist/types/components/MultiSelectDropdown/index.d.ts +14 -0
- package/dist/types/components/NoResult/index.d.ts +15 -0
- package/dist/types/components/Pagination/index.d.ts +12 -0
- package/dist/types/components/Select/FKSelectVariant.d.ts +52 -0
- package/dist/types/components/Select/index.d.ts +70 -0
- package/dist/types/components/Sidebar/NavigationSidebar.d.ts +45 -0
- package/dist/types/components/Sidebar/index.d.ts +157 -0
- package/dist/types/components/Sidebar/useSidebarCollapse.d.ts +18 -0
- package/dist/types/components/Stack/index.d.ts +28 -0
- package/dist/types/components/Table/index.d.ts +92 -0
- package/dist/types/components/TableSkeleton/index.d.ts +23 -0
- package/dist/types/components/TagInput/index.d.ts +13 -0
- package/dist/types/components/Text/index.d.ts +21 -0
- package/dist/types/components/TooltipComponent/index.d.ts +8 -0
- package/dist/types/components/index.d.ts +56 -0
- package/dist/types/components/ui/accordion.d.ts +7 -0
- package/dist/types/components/ui/alert-dialog.d.ts +33 -0
- package/dist/types/components/ui/alert.d.ts +8 -0
- package/dist/types/components/ui/badge.d.ts +18 -0
- package/dist/types/components/ui/breadcrumb.d.ts +11 -0
- package/dist/types/components/ui/button.d.ts +32 -0
- package/dist/types/components/ui/calendar.d.ts +21 -0
- package/dist/types/components/ui/card.d.ts +21 -0
- package/dist/types/components/ui/checkbox.d.ts +4 -0
- package/dist/types/components/ui/combobox.d.ts +33 -0
- package/dist/types/components/ui/command.d.ts +31 -0
- package/dist/types/components/ui/dialog.d.ts +32 -0
- package/dist/types/components/ui/dropdown-menu.d.ts +27 -0
- package/dist/types/components/ui/empty.d.ts +23 -0
- package/dist/types/components/ui/input.d.ts +15 -0
- package/dist/types/components/ui/label.d.ts +5 -0
- package/dist/types/components/ui/popover.d.ts +18 -0
- package/dist/types/components/ui/radio.d.ts +3 -0
- package/dist/types/components/ui/select.d.ts +13 -0
- package/dist/types/components/ui/skeleton.d.ts +11 -0
- package/dist/types/components/ui/spinner.d.ts +8 -0
- package/dist/types/components/ui/table.d.ts +29 -0
- package/dist/types/components/ui/tabs.d.ts +20 -0
- package/dist/types/components/ui/textarea.d.ts +3 -0
- package/dist/types/components/ui/tooltip.d.ts +7 -0
- package/dist/types/design-system/Auth/AuthenticatedView.d.ts +18 -0
- package/dist/types/design-system/Auth/LoginCard.d.ts +33 -0
- package/dist/types/design-system/Auth/LoginCardSSO.d.ts +31 -0
- package/dist/types/design-system/Auth/NotAuthenticatedView.d.ts +21 -0
- package/dist/types/design-system/Auth/index.d.ts +4 -0
- package/dist/types/design-system/AutoFormContent/index.d.ts +46 -0
- package/dist/types/design-system/CombinedFilterTable/index.d.ts +9 -0
- package/dist/types/design-system/CustomBreadcrumb/index.d.ts +6 -0
- package/dist/types/design-system/DetailPage/AutoDetailContent.d.ts +27 -0
- package/dist/types/design-system/DetailPage/DetailPage.d.ts +24 -0
- package/dist/types/design-system/DetailPage/detail-utils.d.ts +24 -0
- package/dist/types/design-system/DetailPage/index.d.ts +3 -0
- package/dist/types/design-system/FilePreview/index.d.ts +13 -0
- package/dist/types/design-system/Filters/CreatedByUserFilter.d.ts +24 -0
- package/dist/types/design-system/Filters/DateRangeFilter.d.ts +23 -0
- package/dist/types/design-system/KeyValueContent/index.d.ts +3 -0
- package/dist/types/design-system/M2MTable/index.d.ts +35 -0
- package/dist/types/design-system/NavigationSidebar/index.d.ts +47 -0
- package/dist/types/design-system/index.d.ts +11 -0
- package/dist/types/index.d.ts +67 -0
- package/dist/types/lib/field-trigger.d.ts +5 -0
- package/dist/types/lib/fk-select-fetcher.d.ts +26 -0
- package/dist/types/lib/utils.d.ts +2 -0
- package/dist/types/src/components/Badge/index.d.ts +17 -0
- package/dist/types/src/components/Card/index.d.ts +23 -0
- package/dist/types/src/components/CombinedFilterTable/index.d.ts +9 -0
- package/dist/types/src/components/ConfirmationDialog/index.d.ts +71 -0
- package/dist/types/src/components/Dropzone/index.d.ts +21 -0
- package/dist/types/src/components/EmptyContainer/index.d.ts +16 -0
- package/dist/types/src/components/FKSelect/index.d.ts +45 -0
- package/dist/types/src/components/FileDropzone/index.d.ts +22 -0
- package/dist/types/src/components/Filters/CreatedByUserFilter.d.ts +24 -0
- package/dist/types/src/components/Filters/DateRangeFilter.d.ts +23 -0
- package/dist/types/src/components/Sidebar/index.d.ts +115 -0
- package/dist/types/src/components/Stack/index.d.ts +22 -0
- package/dist/types/src/components/Table/index.d.ts +29 -0
- package/dist/types/src/components/Text/index.d.ts +21 -0
- package/dist/types/src/components/ui/alert-dialog.d.ts +33 -0
- package/dist/types/src/components/ui/badge.d.ts +18 -0
- package/dist/types/src/components/ui/button.d.ts +22 -0
- package/dist/types/src/components/ui/calendar.d.ts +21 -0
- package/dist/types/src/components/ui/card.d.ts +21 -0
- package/dist/types/src/components/ui/combobox.d.ts +28 -0
- package/dist/types/src/components/ui/command.d.ts +31 -0
- package/dist/types/src/components/ui/dialog.d.ts +32 -0
- package/dist/types/src/components/ui/empty.d.ts +23 -0
- package/dist/types/src/components/ui/popover.d.ts +18 -0
- package/dist/types/src/components/ui/table.d.ts +29 -0
- package/dist/types/src/components/ui/tabs.d.ts +20 -0
- package/dist/types/src/index.d.ts +21 -0
- package/dist/types/src/lib/utils.d.ts +2 -0
- package/dist/types/src/stories/Components/CombinedFilterTable.stories.d.ts +8 -0
- package/dist/types/src/stories/Components/ConfirmationDialog.stories.d.ts +8 -0
- package/dist/types/src/stories/Components/CreatedByUserFilter.stories.d.ts +8 -0
- package/dist/types/src/stories/Components/DateRangeFilter.stories.d.ts +8 -0
- package/dist/types/src/stories/Components/EmptyContainer.stories.d.ts +24 -0
- package/dist/types/src/stories/Components/FKSelect.stories.d.ts +8 -0
- package/dist/types/src/stories/Components/FileDropZone.stories.d.ts +9 -0
- package/dist/types/src/stories/Components/Sidebar.stories.d.ts +18 -0
- package/dist/types/src/stories/Components/Table.stories.d.ts +11 -0
- package/dist/types/src/stories/Components/Tabs.stories.d.ts +13 -0
- package/dist/types/src/stories/Elements/Badge.stories.d.ts +13 -0
- package/dist/types/src/stories/Elements/Button.stories.d.ts +13 -0
- package/dist/types/src/stories/Elements/Stack.stories.d.ts +9 -0
- package/dist/types/src/stories/Elements/Text.stories.d.ts +8 -0
- package/dist/types/stories/Components/CombinedFilterTable.stories.d.ts +8 -0
- package/dist/types/stories/Components/ConfirmationDialog.stories.d.ts +8 -0
- package/dist/types/stories/Components/CreatedByUserFilter.stories.d.ts +8 -0
- package/dist/types/stories/Components/DateRangeFilter.stories.d.ts +8 -0
- package/dist/types/stories/Components/EmptyContainer.stories.d.ts +24 -0
- package/dist/types/stories/Components/FKSelect.stories.d.ts +8 -0
- package/dist/types/stories/Components/FileDropZone.stories.d.ts +9 -0
- package/dist/types/stories/Components/Sidebar.stories.d.ts +18 -0
- package/dist/types/stories/Components/Table.stories.d.ts +11 -0
- package/dist/types/stories/Components/Tabs.stories.d.ts +13 -0
- package/dist/types/stories/Elements/Badge.stories.d.ts +13 -0
- package/dist/types/stories/Elements/Button.stories.d.ts +13 -0
- package/dist/types/stories/Elements/Stack.stories.d.ts +9 -0
- package/dist/types/stories/Elements/Text.stories.d.ts +8 -0
- package/package.json +119 -0
- package/tailwind.config.ts +91 -0
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { ReactNode } from "react";
|
|
2
|
+
export interface IAlertWithIconProps {
|
|
3
|
+
icon: ReactNode;
|
|
4
|
+
title: string;
|
|
5
|
+
description: string;
|
|
6
|
+
variant?: "default" | "destructive";
|
|
7
|
+
className?: string;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Alert with icon, title and description.
|
|
11
|
+
*/
|
|
12
|
+
export declare function AlertWithIcon({ icon, title, description, variant, className, }: IAlertWithIconProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { ComponentType, ReactNode } from "react";
|
|
2
|
+
export interface IAuthenticatedViewProps {
|
|
3
|
+
redirectHref: string;
|
|
4
|
+
redirectDelayMs?: number;
|
|
5
|
+
onRedirect?: (href: string) => void;
|
|
6
|
+
title?: string;
|
|
7
|
+
fallbackLinkLabel?: string;
|
|
8
|
+
LinkComponent?: ComponentType<{
|
|
9
|
+
href: string;
|
|
10
|
+
className?: string;
|
|
11
|
+
children: ReactNode;
|
|
12
|
+
}>;
|
|
13
|
+
className?: string;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* OAuth success screen with auto-redirect.
|
|
17
|
+
*/
|
|
18
|
+
export declare function AuthenticatedView({ redirectHref, redirectDelayMs, onRedirect, title, fallbackLinkLabel, LinkComponent, className, }: IAuthenticatedViewProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import type { ComponentType, ReactNode } from "react";
|
|
2
|
+
export interface ILoginCardProps {
|
|
3
|
+
onLogin: (credentials: {
|
|
4
|
+
username: string;
|
|
5
|
+
password: string;
|
|
6
|
+
}) => Promise<{
|
|
7
|
+
error?: string | null;
|
|
8
|
+
}>;
|
|
9
|
+
onSuccess?: () => void;
|
|
10
|
+
onError?: (message: string, error: string) => void;
|
|
11
|
+
sessionExpired?: boolean;
|
|
12
|
+
sessionExpiredAlert?: {
|
|
13
|
+
icon: ReactNode;
|
|
14
|
+
title?: string;
|
|
15
|
+
description?: string;
|
|
16
|
+
};
|
|
17
|
+
forgotPasswordHref?: string;
|
|
18
|
+
forgotPasswordLabel?: string;
|
|
19
|
+
usernameLabel?: string;
|
|
20
|
+
passwordLabel?: string;
|
|
21
|
+
submitLabel?: string;
|
|
22
|
+
loginErrorMessage?: string;
|
|
23
|
+
LinkComponent?: ComponentType<{
|
|
24
|
+
href: string;
|
|
25
|
+
className?: string;
|
|
26
|
+
children: ReactNode;
|
|
27
|
+
}>;
|
|
28
|
+
className?: string;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Username and password login card.
|
|
32
|
+
*/
|
|
33
|
+
export declare function LoginCard({ onLogin, onSuccess, onError, sessionExpired, sessionExpiredAlert, forgotPasswordHref, forgotPasswordLabel, usernameLabel, passwordLabel, submitLabel, loginErrorMessage, LinkComponent, className, }: ILoginCardProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import type { ComponentType, ReactNode } from "react";
|
|
2
|
+
export interface ILoginCardSSOProps {
|
|
3
|
+
onLoginSSO: (email: string) => Promise<{
|
|
4
|
+
redirect_url?: string | null;
|
|
5
|
+
error?: string | null;
|
|
6
|
+
}>;
|
|
7
|
+
onRedirect?: (url: string) => void;
|
|
8
|
+
onError?: (message: string, error: string) => void;
|
|
9
|
+
sessionExpired?: boolean;
|
|
10
|
+
sessionExpiredAlert?: {
|
|
11
|
+
icon: ReactNode;
|
|
12
|
+
title?: string;
|
|
13
|
+
description?: string;
|
|
14
|
+
};
|
|
15
|
+
forgotPasswordHref?: string;
|
|
16
|
+
forgotPasswordLabel?: string;
|
|
17
|
+
emailLabel?: string;
|
|
18
|
+
submitLabel?: string;
|
|
19
|
+
unauthorizedMessage?: string;
|
|
20
|
+
genericErrorMessage?: string;
|
|
21
|
+
LinkComponent?: ComponentType<{
|
|
22
|
+
href: string;
|
|
23
|
+
className?: string;
|
|
24
|
+
children: ReactNode;
|
|
25
|
+
}>;
|
|
26
|
+
className?: string;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* SSO email login card.
|
|
30
|
+
*/
|
|
31
|
+
export declare function LoginCardSSO({ onLoginSSO, onRedirect, onError, sessionExpired, sessionExpiredAlert, forgotPasswordHref, forgotPasswordLabel, emailLabel, submitLabel, unauthorizedMessage, genericErrorMessage, LinkComponent, className, }: ILoginCardSSOProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { ComponentType, ReactNode } from "react";
|
|
2
|
+
export interface INotAuthenticatedViewProps {
|
|
3
|
+
error: unknown;
|
|
4
|
+
loginHref: string;
|
|
5
|
+
title?: string;
|
|
6
|
+
description?: string;
|
|
7
|
+
fallbackLinkLabel?: string;
|
|
8
|
+
errorDetailsLabel?: string;
|
|
9
|
+
copyLabel?: string;
|
|
10
|
+
copiedLabel?: string;
|
|
11
|
+
LinkComponent?: ComponentType<{
|
|
12
|
+
href: string;
|
|
13
|
+
className?: string;
|
|
14
|
+
children: ReactNode;
|
|
15
|
+
}>;
|
|
16
|
+
className?: string;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* OAuth error screen with expandable error details.
|
|
20
|
+
*/
|
|
21
|
+
export declare function NotAuthenticatedView({ error, loginHref, title, description, fallbackLinkLabel, errorDetailsLabel, copyLabel, copiedLabel, LinkComponent, className, }: INotAuthenticatedViewProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export { LoginCard, type ILoginCardProps } from "./LoginCard";
|
|
2
|
+
export { LoginCardSSO, type ILoginCardSSOProps } from "./LoginCardSSO";
|
|
3
|
+
export { AuthenticatedView, type IAuthenticatedViewProps, } from "./AuthenticatedView";
|
|
4
|
+
export { NotAuthenticatedView, type INotAuthenticatedViewProps, } from "./NotAuthenticatedView";
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import type * as React from "react";
|
|
2
|
+
/**
|
|
3
|
+
* Interface representing a form field specification
|
|
4
|
+
*/
|
|
5
|
+
export interface IFormField {
|
|
6
|
+
type: "text" | "number" | "password" | "email" | "textarea" | "checkbox" | "select" | "date" | "key-value";
|
|
7
|
+
label?: string;
|
|
8
|
+
placeholder?: string;
|
|
9
|
+
required?: boolean;
|
|
10
|
+
disabled?: boolean;
|
|
11
|
+
options?: {
|
|
12
|
+
label: string;
|
|
13
|
+
value: string;
|
|
14
|
+
}[];
|
|
15
|
+
className?: string;
|
|
16
|
+
cols?: 1 | 2 | 3 | 4;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Custom section grouping configuration similar to AutoDetailContent
|
|
20
|
+
*/
|
|
21
|
+
export interface IFormSection {
|
|
22
|
+
title: string;
|
|
23
|
+
fields: string[];
|
|
24
|
+
cols?: 1 | 2 | 3 | 4;
|
|
25
|
+
isFullWidth?: boolean;
|
|
26
|
+
}
|
|
27
|
+
export interface IAutoFormContentProps {
|
|
28
|
+
fields: Record<string, IFormField>;
|
|
29
|
+
values?: Record<string, any>;
|
|
30
|
+
defaultValue?: Record<string, any>;
|
|
31
|
+
onChange?: (values: Record<string, any>) => void;
|
|
32
|
+
errors?: Record<string, string>;
|
|
33
|
+
config?: {
|
|
34
|
+
exclude?: string[];
|
|
35
|
+
labels?: Record<string, string>;
|
|
36
|
+
sections?: IFormSection[];
|
|
37
|
+
};
|
|
38
|
+
customFields?: Record<string, (props: {
|
|
39
|
+
value: any;
|
|
40
|
+
onChange: (val: any) => void;
|
|
41
|
+
error?: string;
|
|
42
|
+
disabled?: boolean;
|
|
43
|
+
fieldKey: string;
|
|
44
|
+
}) => React.ReactNode>;
|
|
45
|
+
}
|
|
46
|
+
export declare function AutoFormContent({ fields, values: externalValues, defaultValue, onChange, errors, config, customFields, }: IAutoFormContentProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { type VariantProps } from "class-variance-authority";
|
|
2
|
+
export declare const pumpwoodBadgeVariants: (props?: ({
|
|
3
|
+
variant?: "destructive" | "secondary" | "warning" | "primary" | "muted" | null | undefined;
|
|
4
|
+
size?: "default" | "sm" | "lg" | null | undefined;
|
|
5
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
6
|
+
export interface PumpwoodBadgeProps extends React.HTMLAttributes<HTMLDivElement>, VariantProps<typeof pumpwoodBadgeVariants> {
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* A Badge component for status indicators and labels.
|
|
10
|
+
*
|
|
11
|
+
* @example
|
|
12
|
+
* ```tsx
|
|
13
|
+
* <Badge variant="primary">New</Badge>
|
|
14
|
+
* <Badge variant="destructive" size="sm">Error</Badge>
|
|
15
|
+
* ```
|
|
16
|
+
*/
|
|
17
|
+
export declare function PumpwoodBadge({ className, variant, size, ...props }: PumpwoodBadgeProps): React.JSX.Element;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A Card component system for displaying content in boxes.
|
|
3
|
+
*
|
|
4
|
+
* @example
|
|
5
|
+
* ```tsx
|
|
6
|
+
* <Card.Root>
|
|
7
|
+
* <Card.Header>
|
|
8
|
+
* <Card.Title>Card Title</Card.Title>
|
|
9
|
+
* <Card.Description>Card Description</Card.Description>
|
|
10
|
+
* </Card.Header>
|
|
11
|
+
* <Card.Content>
|
|
12
|
+
* <p>Card Content</p>
|
|
13
|
+
* </Card.Content>
|
|
14
|
+
* </Card.Root>
|
|
15
|
+
* ```
|
|
16
|
+
*/
|
|
17
|
+
export declare const PumpwoodCard: {
|
|
18
|
+
Root: import("react").ForwardRefExoticComponent<import("react").HTMLAttributes<HTMLDivElement> & import("react").RefAttributes<HTMLDivElement>>;
|
|
19
|
+
Content: import("react").ForwardRefExoticComponent<import("react").HTMLAttributes<HTMLDivElement> & import("react").RefAttributes<HTMLDivElement>>;
|
|
20
|
+
Header: import("react").ForwardRefExoticComponent<import("react").HTMLAttributes<HTMLDivElement> & import("react").RefAttributes<HTMLDivElement>>;
|
|
21
|
+
Title: import("react").ForwardRefExoticComponent<import("react").HTMLAttributes<HTMLDivElement> & import("react").RefAttributes<HTMLDivElement>>;
|
|
22
|
+
Description: import("react").ForwardRefExoticComponent<import("react").HTMLAttributes<HTMLDivElement> & import("react").RefAttributes<HTMLDivElement>>;
|
|
23
|
+
};
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import type { ReactNode } from "react";
|
|
2
|
+
export interface RootProps {
|
|
3
|
+
open: boolean;
|
|
4
|
+
onOpenChange: (open: boolean) => void;
|
|
5
|
+
children: ReactNode;
|
|
6
|
+
}
|
|
7
|
+
declare function Root({ open, onOpenChange, children }: RootProps): import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
export interface ContentProps {
|
|
9
|
+
children: ReactNode;
|
|
10
|
+
className?: string;
|
|
11
|
+
}
|
|
12
|
+
declare function Content({ children, className }: ContentProps): import("react/jsx-runtime").JSX.Element;
|
|
13
|
+
export interface HeaderProps {
|
|
14
|
+
children: ReactNode;
|
|
15
|
+
}
|
|
16
|
+
declare function Header({ children }: HeaderProps): import("react/jsx-runtime").JSX.Element;
|
|
17
|
+
export interface TitleProps {
|
|
18
|
+
children: ReactNode;
|
|
19
|
+
}
|
|
20
|
+
declare function Title({ children }: TitleProps): import("react/jsx-runtime").JSX.Element;
|
|
21
|
+
export interface DescriptionProps {
|
|
22
|
+
children: ReactNode;
|
|
23
|
+
}
|
|
24
|
+
declare function Description({ children }: DescriptionProps): import("react/jsx-runtime").JSX.Element;
|
|
25
|
+
export interface FooterProps {
|
|
26
|
+
children: ReactNode;
|
|
27
|
+
}
|
|
28
|
+
declare function Footer({ children }: FooterProps): import("react/jsx-runtime").JSX.Element;
|
|
29
|
+
export interface ActionProps {
|
|
30
|
+
children: ReactNode;
|
|
31
|
+
onClick: () => void;
|
|
32
|
+
variant?: "default" | "destructive";
|
|
33
|
+
className?: string;
|
|
34
|
+
}
|
|
35
|
+
declare function Action({ children, onClick, variant, className, }: ActionProps): import("react/jsx-runtime").JSX.Element;
|
|
36
|
+
export interface CancelProps {
|
|
37
|
+
children: ReactNode;
|
|
38
|
+
onClick?: () => void;
|
|
39
|
+
className?: string;
|
|
40
|
+
}
|
|
41
|
+
declare function Cancel({ children, onClick, className }: CancelProps): import("react/jsx-runtime").JSX.Element;
|
|
42
|
+
/**
|
|
43
|
+
* A dialog component for confirming actions (e.g., delete).
|
|
44
|
+
*
|
|
45
|
+
* @example
|
|
46
|
+
* ```tsx
|
|
47
|
+
* <ConfirmationDialog.Root open={isOpen} onOpenChange={setIsOpen}>
|
|
48
|
+
* <ConfirmationDialog.Content>
|
|
49
|
+
* <ConfirmationDialog.Header>
|
|
50
|
+
* <ConfirmationDialog.Title>Are you sure?</ConfirmationDialog.Title>
|
|
51
|
+
* <ConfirmationDialog.Description>This action cannot be undone.</ConfirmationDialog.Description>
|
|
52
|
+
* </ConfirmationDialog.Header>
|
|
53
|
+
* <ConfirmationDialog.Footer>
|
|
54
|
+
* <ConfirmationDialog.Cancel onClick={() => setIsOpen(false)}>Cancel</ConfirmationDialog.Cancel>
|
|
55
|
+
* <ConfirmationDialog.Action onClick={handleDelete} variant="destructive">Delete</ConfirmationDialog.Action>
|
|
56
|
+
* </ConfirmationDialog.Footer>
|
|
57
|
+
* </ConfirmationDialog.Content>
|
|
58
|
+
* </ConfirmationDialog.Root>
|
|
59
|
+
* ```
|
|
60
|
+
*/
|
|
61
|
+
export declare const ConfirmationDialog: {
|
|
62
|
+
Root: typeof Root;
|
|
63
|
+
Content: typeof Content;
|
|
64
|
+
Header: typeof Header;
|
|
65
|
+
Title: typeof Title;
|
|
66
|
+
Description: typeof Description;
|
|
67
|
+
Footer: typeof Footer;
|
|
68
|
+
Action: typeof Action;
|
|
69
|
+
Cancel: typeof Cancel;
|
|
70
|
+
};
|
|
71
|
+
export {};
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Props for the DatePicker component.
|
|
3
|
+
*/
|
|
4
|
+
export interface IDatePickerProps {
|
|
5
|
+
/** Optional id used as data-testid on the trigger button. */
|
|
6
|
+
id?: string;
|
|
7
|
+
/** Placeholder text when no date is selected. */
|
|
8
|
+
placeholder: string;
|
|
9
|
+
/** Controlled ISO date string (empty = no selection). */
|
|
10
|
+
value?: string;
|
|
11
|
+
/** Callback when the selected date changes (ISO string or empty). */
|
|
12
|
+
onValueChange?: (value: string) => void;
|
|
13
|
+
/** Optional class names for the wrapper (width, layout). */
|
|
14
|
+
className?: string;
|
|
15
|
+
/** Day boundary when serializing to ISO. */
|
|
16
|
+
boundary?: "start" | "end";
|
|
17
|
+
/** Display format for the selected date. */
|
|
18
|
+
dateFormat?: string;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* A reusable date picker built with shadcn/ui.
|
|
22
|
+
*
|
|
23
|
+
* @example
|
|
24
|
+
* ```tsx
|
|
25
|
+
* <DatePicker
|
|
26
|
+
* placeholder="Data inicial"
|
|
27
|
+
* boundary="start"
|
|
28
|
+
* value={filters.created_at__gte}
|
|
29
|
+
* onValueChange={(value) =>
|
|
30
|
+
* onFiltersChange({ target: "created_at__gte", value })
|
|
31
|
+
* }
|
|
32
|
+
* />
|
|
33
|
+
* ```
|
|
34
|
+
*/
|
|
35
|
+
export declare const DatePicker: ({ id, placeholder, value, onValueChange, className, boundary, dateFormat, }: IDatePickerProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* DeleteDialog - Confirmation dialog component for delete documents.
|
|
3
|
+
*/
|
|
4
|
+
export declare const DeleteDialog: ({ openDialog, setOpenDialog, handleDelete, count, }: {
|
|
5
|
+
openDialog: boolean;
|
|
6
|
+
setOpenDialog: (value: boolean) => void;
|
|
7
|
+
handleDelete: () => void;
|
|
8
|
+
count?: number;
|
|
9
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import type { ReactNode } from "react";
|
|
2
|
+
import { type IDetailFieldConfig } from "./detail-utils";
|
|
3
|
+
export type { IDetailFieldConfig, IDetailSection } from "./detail-utils";
|
|
4
|
+
export interface IAutoDetailContentProps {
|
|
5
|
+
data: Record<string, any>;
|
|
6
|
+
config?: IDetailFieldConfig;
|
|
7
|
+
formatters?: {
|
|
8
|
+
key: string;
|
|
9
|
+
formatter: (value: unknown) => string;
|
|
10
|
+
}[];
|
|
11
|
+
wrapperElements?: {
|
|
12
|
+
keys: string[];
|
|
13
|
+
element: (props: {
|
|
14
|
+
key: string;
|
|
15
|
+
label: string;
|
|
16
|
+
fieldValue: unknown;
|
|
17
|
+
isFullWidth: boolean;
|
|
18
|
+
data: Record<string, any>;
|
|
19
|
+
}) => ReactNode;
|
|
20
|
+
}[];
|
|
21
|
+
statusLabels?: Record<string, string>;
|
|
22
|
+
formatDate?: (date: string) => string;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Auto-render entity detail fields in configurable sections.
|
|
26
|
+
*/
|
|
27
|
+
export declare function AutoDetailContent({ data, config, formatters, wrapperElements, statusLabels, formatDate, }: IAutoDetailContentProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { ReactNode } from "react";
|
|
2
|
+
export interface IDetailPageSection {
|
|
3
|
+
id?: string;
|
|
4
|
+
title: string;
|
|
5
|
+
content: ReactNode;
|
|
6
|
+
defaultOpen?: boolean;
|
|
7
|
+
}
|
|
8
|
+
export interface IDetailPageProps {
|
|
9
|
+
title: string;
|
|
10
|
+
titleAddon?: ReactNode;
|
|
11
|
+
isLoading?: boolean;
|
|
12
|
+
error?: Error | null;
|
|
13
|
+
onBack?: () => void;
|
|
14
|
+
actions?: ReactNode;
|
|
15
|
+
sections?: IDetailPageSection[];
|
|
16
|
+
children?: ReactNode;
|
|
17
|
+
loadingComponent?: ReactNode;
|
|
18
|
+
errorComponent?: ReactNode;
|
|
19
|
+
backButtonLabel?: string;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Reusable detail page shell with header, loading/error states and sections.
|
|
23
|
+
*/
|
|
24
|
+
export declare function DetailPage({ title, titleAddon, isLoading, error, onBack, actions, sections, children, loadingComponent, errorComponent, backButtonLabel, }: IDetailPageProps): string | number | bigint | boolean | Iterable<ReactNode> | Promise<string | number | bigint | boolean | import("react").ReactPortal | import("react").ReactElement<unknown, string | import("react").JSXElementConstructor<any>> | Iterable<ReactNode> | null | undefined> | import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
export interface IDetailSection {
|
|
2
|
+
title: string;
|
|
3
|
+
fields: string[];
|
|
4
|
+
cols?: 2 | 3 | 4;
|
|
5
|
+
isFullWidth?: boolean;
|
|
6
|
+
}
|
|
7
|
+
export interface IDetailFieldConfig {
|
|
8
|
+
exclude?: string[];
|
|
9
|
+
labels?: Record<string, string>;
|
|
10
|
+
formatters?: Record<string, (value: unknown) => string>;
|
|
11
|
+
sections?: IDetailSection[];
|
|
12
|
+
}
|
|
13
|
+
export interface IFormatDetailValueOptions {
|
|
14
|
+
statusLabels?: Record<string, string>;
|
|
15
|
+
formatDate?: (date: string) => string;
|
|
16
|
+
booleanLabels?: {
|
|
17
|
+
true: string;
|
|
18
|
+
false: string;
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
export declare const formatDetailLabel: (key: string, labels?: Record<string, string>) => string;
|
|
22
|
+
export declare const formatDetailValue: (value: unknown, key: string, options?: IFormatDetailValueOptions) => string;
|
|
23
|
+
export declare const getDetailFieldValue: (data: Record<string, unknown>, key: string) => unknown;
|
|
24
|
+
export declare const FULL_WIDTH_DETAIL_FIELDS: string[];
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
export { AutoDetailContent, type IAutoDetailContentProps } from "./AutoDetailContent";
|
|
2
|
+
export { DetailPage, type IDetailPageProps, type IDetailPageSection } from "./DetailPage";
|
|
3
|
+
export { formatDetailLabel, formatDetailValue, getDetailFieldValue, FULL_WIDTH_DETAIL_FIELDS, type IDetailFieldConfig, type IDetailSection, type IFormatDetailValueOptions, } from "./detail-utils";
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
type ExpectedFile = {
|
|
2
|
+
file: string;
|
|
3
|
+
};
|
|
4
|
+
export type RetrieveFileFn = (modelClass: string, fileId: number) => Promise<[
|
|
5
|
+
{
|
|
6
|
+
data: number[];
|
|
7
|
+
contentType: string;
|
|
8
|
+
} | null,
|
|
9
|
+
{
|
|
10
|
+
message: string;
|
|
11
|
+
} | null
|
|
12
|
+
]>;
|
|
13
|
+
interface IDownloadButtonProps<T extends ExpectedFile> {
|
|
14
|
+
item: T;
|
|
15
|
+
propertyName: keyof T;
|
|
16
|
+
modelClass: string;
|
|
17
|
+
retrieveFile: RetrieveFileFn;
|
|
18
|
+
}
|
|
19
|
+
export declare const DownloadButton: <T extends ExpectedFile>({ item, modelClass, propertyName, retrieveFile, }: IDownloadButtonProps<T>) => import("react/jsx-runtime").JSX.Element;
|
|
20
|
+
export {};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { type ReactNode } from "react";
|
|
2
|
+
import { type FileWithPath } from "react-dropzone";
|
|
3
|
+
type DropzoneProps = {
|
|
4
|
+
children: ReactNode;
|
|
5
|
+
maxFiles?: number;
|
|
6
|
+
maxSize?: number;
|
|
7
|
+
accept?: Record<string, string[]>;
|
|
8
|
+
onFilesAccepted: (files: FileWithPath[]) => void;
|
|
9
|
+
};
|
|
10
|
+
/**
|
|
11
|
+
* A drag-and-drop zone for file uploads.
|
|
12
|
+
*
|
|
13
|
+
* @example
|
|
14
|
+
* ```tsx
|
|
15
|
+
* <Dropzone onFilesAccepted={(files) => console.log(files)}>
|
|
16
|
+
* <Button>Upload</Button>
|
|
17
|
+
* </Dropzone>
|
|
18
|
+
* ```
|
|
19
|
+
*/
|
|
20
|
+
export default function PumpwoodDropzone({ children, maxFiles, maxSize, accept, onFilesAccepted, }: DropzoneProps): import("react/jsx-runtime").JSX.Element;
|
|
21
|
+
export {};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export interface EmptyContainerProps {
|
|
2
|
+
title: string;
|
|
3
|
+
description: string;
|
|
4
|
+
}
|
|
5
|
+
/**
|
|
6
|
+
* A container to display an empty state.
|
|
7
|
+
*
|
|
8
|
+
* @example
|
|
9
|
+
* ```tsx
|
|
10
|
+
* <EmptyContainer
|
|
11
|
+
* title="No Data"
|
|
12
|
+
* description="There are no items to display at this time."
|
|
13
|
+
* />
|
|
14
|
+
* ```
|
|
15
|
+
*/
|
|
16
|
+
export declare function EmptyContainer({ title, description }: EmptyContainerProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { ReactNode } from "react";
|
|
2
|
+
interface ErrorBoundaryProps {
|
|
3
|
+
children: ReactNode;
|
|
4
|
+
hasError: boolean;
|
|
5
|
+
message?: string;
|
|
6
|
+
className?: string;
|
|
7
|
+
}
|
|
8
|
+
declare const ErrorBoundary: ({ children, hasError, message, }: ErrorBoundaryProps) => import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
export default ErrorBoundary;
|
|
10
|
+
export { ErrorBoundary };
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Parameters passed to the FK fetcher function.
|
|
3
|
+
*/
|
|
4
|
+
export type FKFetcherParams = {
|
|
5
|
+
search: string;
|
|
6
|
+
modelClass: string;
|
|
7
|
+
labelName: string;
|
|
8
|
+
additionalFilters?: Record<string, any>;
|
|
9
|
+
fields?: string[];
|
|
10
|
+
limit?: number;
|
|
11
|
+
offset?: number;
|
|
12
|
+
};
|
|
13
|
+
/**
|
|
14
|
+
* Props for the FKSelect component.
|
|
15
|
+
*/
|
|
16
|
+
export interface IFKSelectProps {
|
|
17
|
+
/** Optional id used as data-testid on the trigger. */
|
|
18
|
+
id?: string;
|
|
19
|
+
/** Function to fetch data from the API. */
|
|
20
|
+
fetcher: (params: FKFetcherParams) => Promise<any[]>;
|
|
21
|
+
/** Optional function to resolve a value not present in the list. */
|
|
22
|
+
resolveValue?: (params: {
|
|
23
|
+
modelClass: string;
|
|
24
|
+
value: string | number;
|
|
25
|
+
}) => Promise<any>;
|
|
26
|
+
/** The model class name to identify the resource. */
|
|
27
|
+
modelClass: string;
|
|
28
|
+
/** The field name to use as the display label. */
|
|
29
|
+
labelName: string;
|
|
30
|
+
/** The field name to use as the value (ID). Defaults to 'pk'. */
|
|
31
|
+
valueField?: string;
|
|
32
|
+
/** Placeholder text for the search input. */
|
|
33
|
+
placeholder?: string;
|
|
34
|
+
/** Message to show when no items are found. */
|
|
35
|
+
emptyMessage?: string;
|
|
36
|
+
/** The currently selected value. */
|
|
37
|
+
value: string | number | null;
|
|
38
|
+
/** Callback when an item is selected. */
|
|
39
|
+
onChange: (value: string | number, item?: any) => void;
|
|
40
|
+
/** Additional filters to apply to the API request. */
|
|
41
|
+
additionalFilters?: Record<string, any>;
|
|
42
|
+
/** Extra fields to include in search. */
|
|
43
|
+
fields?: string[];
|
|
44
|
+
/** Optional class names for the wrapper (e.g. width overrides). */
|
|
45
|
+
className?: string;
|
|
46
|
+
/** Debounce time in ms. Defaults to 300. */
|
|
47
|
+
debounceWait?: number;
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* A foreign key select component (async combobox).
|
|
51
|
+
*
|
|
52
|
+
* @example
|
|
53
|
+
* ```tsx
|
|
54
|
+
* <FKSelect
|
|
55
|
+
* fetcher={fetchData}
|
|
56
|
+
* modelClass="User"
|
|
57
|
+
* labelName="username"
|
|
58
|
+
* value={userId}
|
|
59
|
+
* onChange={setUserId}
|
|
60
|
+
* />
|
|
61
|
+
* ```
|
|
62
|
+
*/
|
|
63
|
+
export declare const FKSelect: ({ id, fetcher, resolveValue, modelClass, labelName, valueField, placeholder, emptyMessage, value, onChange, additionalFilters, fields, className, debounceWait, }: IFKSelectProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { type Accept } from "react-dropzone";
|
|
2
|
+
interface FileDropzoneProps {
|
|
3
|
+
onFileSelected: (file: File) => void;
|
|
4
|
+
onFileDeleted?: () => void;
|
|
5
|
+
acceptExtensions?: string[];
|
|
6
|
+
accept?: Accept;
|
|
7
|
+
maxSizeMB?: number;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* A specialized file dropzone with built-in preview and validation.
|
|
11
|
+
*
|
|
12
|
+
* @example
|
|
13
|
+
* ```tsx
|
|
14
|
+
* <FileDropzone
|
|
15
|
+
* onFileSelected={(file) => console.log(file)}
|
|
16
|
+
* maxSizeMB={5}
|
|
17
|
+
* acceptExtensions={['.pdf', '.docx']}
|
|
18
|
+
* />
|
|
19
|
+
* ```
|
|
20
|
+
*/
|
|
21
|
+
export default function FileDropzone({ onFileSelected, onFileDeleted, acceptExtensions, accept, maxSizeMB, }: FileDropzoneProps): import("react/jsx-runtime").JSX.Element;
|
|
22
|
+
export {};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { ComponentType, ImgHTMLAttributes } from "react";
|
|
2
|
+
export type FileTypeCategory = "image" | "video" | "pdf" | "doc" | "excel" | "ppt" | "other";
|
|
3
|
+
interface FilePreviewProps {
|
|
4
|
+
fileUrl: string;
|
|
5
|
+
fileName: string;
|
|
6
|
+
isLoading?: boolean;
|
|
7
|
+
getFileType: (fileName: string) => FileTypeCategory;
|
|
8
|
+
ImageComponent?: ComponentType<ImgHTMLAttributes<HTMLImageElement> & {
|
|
9
|
+
fill?: boolean;
|
|
10
|
+
}>;
|
|
11
|
+
}
|
|
12
|
+
export declare const FilePreview: ({ fileUrl, fileName, isLoading, getFileType, ImageComponent, }: FilePreviewProps) => import("react/jsx-runtime").JSX.Element;
|
|
13
|
+
export {};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
export interface CreatedByUserFilterProps {
|
|
2
|
+
value: string | number | null;
|
|
3
|
+
onChange: (value: string | number, item?: any) => void;
|
|
4
|
+
fetcher: (params: {
|
|
5
|
+
search: string;
|
|
6
|
+
modelClass: string;
|
|
7
|
+
limit?: number;
|
|
8
|
+
offset?: number;
|
|
9
|
+
}) => Promise<any[]>;
|
|
10
|
+
className?: string;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* A filter component to select a user who created a resource.
|
|
14
|
+
*
|
|
15
|
+
* @example
|
|
16
|
+
* ```tsx
|
|
17
|
+
* <CreatedByUserFilter
|
|
18
|
+
* fetcher={fetchUsers}
|
|
19
|
+
* value={selectedUser}
|
|
20
|
+
* onChange={setSelectedUser}
|
|
21
|
+
* />
|
|
22
|
+
* ```
|
|
23
|
+
*/
|
|
24
|
+
export declare const CreatedByUserFilter: ({ value, onChange, fetcher, className, }: CreatedByUserFilterProps) => import("react/jsx-runtime").JSX.Element;
|