@skiddph/prui 0.1.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 +201 -0
- package/dist/app/app.d.ts +91 -0
- package/dist/app/auto-pages.d.ts +20 -0
- package/dist/app/form.d.ts +44 -0
- package/dist/app/index.d.ts +8 -0
- package/dist/app/resource.d.ts +61 -0
- package/dist/app/settings.d.ts +27 -0
- package/dist/app/stat-row.d.ts +20 -0
- package/dist/app.js +18 -0
- package/dist/chunks/data-table-toolbar-C9likJBN.js +430 -0
- package/dist/chunks/settings-DUz5nyX-.js +731 -0
- package/dist/core/button.d.ts +14 -0
- package/dist/core/button.js +58 -0
- package/dist/core/card.d.ts +24 -0
- package/dist/core/card.js +122 -0
- package/dist/core/cn.d.ts +3 -0
- package/dist/core/cn.js +8 -0
- package/dist/core/dialog.d.ts +25 -0
- package/dist/core/dialog.js +102 -0
- package/dist/core/dropdown.d.ts +24 -0
- package/dist/core/dropdown.js +89 -0
- package/dist/core/index.d.ts +14 -0
- package/dist/core/input.d.ts +8 -0
- package/dist/core/input.js +42 -0
- package/dist/core/label.d.ts +12 -0
- package/dist/core/label.js +52 -0
- package/dist/core/modal.d.ts +56 -0
- package/dist/core/modal.js +303 -0
- package/dist/core/props-meta.d.ts +26 -0
- package/dist/core/props-meta.js +1 -0
- package/dist/core/scroll-area.d.ts +8 -0
- package/dist/core/scroll-area.js +27 -0
- package/dist/core/select.d.ts +38 -0
- package/dist/core/select.js +157 -0
- package/dist/core/switch.d.ts +10 -0
- package/dist/core/switch.js +57 -0
- package/dist/core/tabs.d.ts +22 -0
- package/dist/core/tabs.js +94 -0
- package/dist/core.js +64 -0
- package/dist/data-table/data-table-daterange-filter.d.ts +14 -0
- package/dist/data-table/data-table-faceted-filter.d.ts +17 -0
- package/dist/data-table/data-table-number-range-filter.d.ts +14 -0
- package/dist/data-table/data-table-pagination.d.ts +24 -0
- package/dist/data-table/data-table-toolbar.d.ts +38 -0
- package/dist/data-table/data-table.d.ts +47 -0
- package/dist/data-table/index.d.ts +7 -0
- package/dist/data-table.js +12 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.js +125 -0
- package/dist/pages/forgot-password.d.ts +21 -0
- package/dist/pages/index.d.ts +18 -0
- package/dist/pages/login.d.ts +24 -0
- package/dist/pages/logout.d.ts +12 -0
- package/dist/pages/otp.d.ts +18 -0
- package/dist/pages/profile-settings.d.ts +55 -0
- package/dist/pages/register.d.ts +19 -0
- package/dist/pages/reset-password.d.ts +20 -0
- package/dist/pages/shared.d.ts +55 -0
- package/dist/pages/status.d.ts +33 -0
- package/dist/pages.js +806 -0
- package/dist/prui.css +120 -0
- package/dist/theme/base.css +36 -0
- package/dist/theme/control.css +16 -0
- package/dist/theme/daylight.css +16 -0
- package/dist/theme/ember.css +16 -0
- package/dist/theme/index.d.ts +55 -0
- package/dist/theme/workshop.css +16 -0
- package/dist/theme.js +63 -0
- package/package.json +81 -0
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { PropsMeta } from '../core/props-meta';
|
|
2
|
+
import { BrandConfig } from '../app/app';
|
|
3
|
+
import * as React from "react";
|
|
4
|
+
export interface ProfilePageProps {
|
|
5
|
+
/** Initial profile values. */
|
|
6
|
+
profile?: {
|
|
7
|
+
name?: string;
|
|
8
|
+
email?: string;
|
|
9
|
+
avatar?: string;
|
|
10
|
+
bio?: string;
|
|
11
|
+
};
|
|
12
|
+
onSubmit?: (values: {
|
|
13
|
+
name: string;
|
|
14
|
+
email: string;
|
|
15
|
+
bio: string;
|
|
16
|
+
}) => void | Promise<void>;
|
|
17
|
+
fields?: Partial<Record<"name" | "email" | "bio", boolean>>;
|
|
18
|
+
onSignOut?: () => void;
|
|
19
|
+
signOutLabel?: string;
|
|
20
|
+
brand?: BrandConfig;
|
|
21
|
+
submitLabel?: string;
|
|
22
|
+
loading?: boolean;
|
|
23
|
+
error?: string | null;
|
|
24
|
+
}
|
|
25
|
+
export declare function ProfilePage({ profile, onSubmit, fields, onSignOut, signOutLabel, brand, submitLabel, loading, error, }: ProfilePageProps): React.JSX.Element;
|
|
26
|
+
export declare const profilePagePropsMeta: PropsMeta;
|
|
27
|
+
export interface SettingsToggle {
|
|
28
|
+
id: string;
|
|
29
|
+
label: string;
|
|
30
|
+
description?: string;
|
|
31
|
+
defaultChecked?: boolean;
|
|
32
|
+
checked?: boolean;
|
|
33
|
+
onChange?: (checked: boolean) => void;
|
|
34
|
+
}
|
|
35
|
+
export interface SettingsPageProps {
|
|
36
|
+
title?: string;
|
|
37
|
+
toggles?: SettingsToggle[];
|
|
38
|
+
brand?: BrandConfig;
|
|
39
|
+
}
|
|
40
|
+
export declare function SettingsPage({ title, toggles, brand }: SettingsPageProps): React.JSX.Element;
|
|
41
|
+
export declare const settingsPagePropsMeta: PropsMeta;
|
|
42
|
+
export interface AdminSetupProps {
|
|
43
|
+
onSubmit?: (values: {
|
|
44
|
+
name: string;
|
|
45
|
+
email: string;
|
|
46
|
+
password: string;
|
|
47
|
+
}) => void | Promise<void>;
|
|
48
|
+
brand?: BrandConfig;
|
|
49
|
+
description?: React.ReactNode;
|
|
50
|
+
loading?: boolean;
|
|
51
|
+
error?: string | null;
|
|
52
|
+
}
|
|
53
|
+
/** First-run admin account creation. */
|
|
54
|
+
export declare function AdminSetup({ onSubmit, brand, description, loading, error, }: AdminSetupProps): React.JSX.Element;
|
|
55
|
+
export declare const adminSetupPropsMeta: PropsMeta;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { PropsMeta } from '../core/props-meta';
|
|
2
|
+
import { PageField, PageLink, OAuthProvider } from './shared';
|
|
3
|
+
import { BrandConfig } from '../app/app';
|
|
4
|
+
import * as React from "react";
|
|
5
|
+
export interface RegisterPageProps {
|
|
6
|
+
onSubmit?: (values: Record<string, string>) => void | Promise<void>;
|
|
7
|
+
fields?: Partial<Record<"name" | "email" | "password" | "confirm", boolean>>;
|
|
8
|
+
extraFields?: PageField[];
|
|
9
|
+
links?: {
|
|
10
|
+
login?: PageLink | false;
|
|
11
|
+
};
|
|
12
|
+
oauth?: OAuthProvider[];
|
|
13
|
+
brand?: BrandConfig;
|
|
14
|
+
submitLabel?: string;
|
|
15
|
+
loading?: boolean;
|
|
16
|
+
error?: string | null;
|
|
17
|
+
}
|
|
18
|
+
export declare function RegisterPage({ onSubmit, fields, extraFields, links, oauth, brand, submitLabel, loading, error, }: RegisterPageProps): React.JSX.Element;
|
|
19
|
+
export declare const registerPagePropsMeta: PropsMeta;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { PropsMeta } from '../core/props-meta';
|
|
2
|
+
import { PageLink } from './shared';
|
|
3
|
+
import { BrandConfig } from '../app/app';
|
|
4
|
+
import * as React from "react";
|
|
5
|
+
export interface ResetPasswordPageProps {
|
|
6
|
+
onSubmit?: (values: {
|
|
7
|
+
password: string;
|
|
8
|
+
confirm: string;
|
|
9
|
+
}) => void | Promise<void>;
|
|
10
|
+
fields?: Partial<Record<"password" | "confirm", boolean>>;
|
|
11
|
+
links?: {
|
|
12
|
+
login?: PageLink | false;
|
|
13
|
+
};
|
|
14
|
+
brand?: BrandConfig;
|
|
15
|
+
submitLabel?: string;
|
|
16
|
+
loading?: boolean;
|
|
17
|
+
error?: string | null;
|
|
18
|
+
}
|
|
19
|
+
export declare function ResetPasswordPage({ onSubmit, fields, links, brand, submitLabel, loading, error, }: ResetPasswordPageProps): React.JSX.Element;
|
|
20
|
+
export declare const resetPasswordPagePropsMeta: PropsMeta;
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { BrandConfig } from '../app/app';
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
/**
|
|
4
|
+
* Shared page scaffolding for the pre-made page set.
|
|
5
|
+
* All pages share: onSubmit, fields (per-field show/hide), links, oauth
|
|
6
|
+
* providers optional, brand. Loading and error states included.
|
|
7
|
+
*/
|
|
8
|
+
export type FieldType = "text" | "email" | "password" | "number" | "tel" | "url";
|
|
9
|
+
export interface PageField {
|
|
10
|
+
name: string;
|
|
11
|
+
label: string;
|
|
12
|
+
type?: FieldType;
|
|
13
|
+
placeholder?: string;
|
|
14
|
+
required?: boolean;
|
|
15
|
+
autoComplete?: string;
|
|
16
|
+
}
|
|
17
|
+
export interface PageLink {
|
|
18
|
+
label: string;
|
|
19
|
+
href: string;
|
|
20
|
+
}
|
|
21
|
+
export interface OAuthProvider {
|
|
22
|
+
id: string;
|
|
23
|
+
label: string;
|
|
24
|
+
icon?: React.ComponentType<{
|
|
25
|
+
className?: string;
|
|
26
|
+
}>;
|
|
27
|
+
}
|
|
28
|
+
export interface PageSubmitState {
|
|
29
|
+
loading?: boolean;
|
|
30
|
+
error?: string | null;
|
|
31
|
+
}
|
|
32
|
+
export interface PageShellProps {
|
|
33
|
+
title: string;
|
|
34
|
+
description?: React.ReactNode;
|
|
35
|
+
brand?: BrandConfig;
|
|
36
|
+
/** Column width class for the card. */
|
|
37
|
+
width?: string;
|
|
38
|
+
children?: React.ReactNode;
|
|
39
|
+
footer?: React.ReactNode;
|
|
40
|
+
className?: string;
|
|
41
|
+
}
|
|
42
|
+
export declare function PageShell({ title, description, brand, width, children, footer }: PageShellProps): React.JSX.Element;
|
|
43
|
+
export declare function ErrorBanner({ error }: {
|
|
44
|
+
error?: string | null;
|
|
45
|
+
}): React.JSX.Element | null;
|
|
46
|
+
export declare function LoadingButtonLabel({ loading, children }: {
|
|
47
|
+
loading?: boolean;
|
|
48
|
+
children: React.ReactNode;
|
|
49
|
+
}): React.JSX.Element;
|
|
50
|
+
export declare function OAuthButtons({ providers }: {
|
|
51
|
+
providers?: OAuthProvider[];
|
|
52
|
+
}): React.JSX.Element | null;
|
|
53
|
+
/** Default field sets per page; pages merge with caller overrides via the fields prop. */
|
|
54
|
+
export declare const defaultLoginFields: PageField[];
|
|
55
|
+
export declare const defaultRegisterFields: PageField[];
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { PropsMeta } from '../core/props-meta';
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
export interface NotFoundPageProps {
|
|
4
|
+
title?: string;
|
|
5
|
+
description?: React.ReactNode;
|
|
6
|
+
/** Home link target. */
|
|
7
|
+
homeHref?: string;
|
|
8
|
+
onGoHome?: () => void;
|
|
9
|
+
brand?: import('../app/app').BrandConfig;
|
|
10
|
+
}
|
|
11
|
+
export declare function NotFoundPage({ title, description, homeHref, onGoHome, brand, }: NotFoundPageProps): React.JSX.Element;
|
|
12
|
+
export declare const notFoundPagePropsMeta: PropsMeta;
|
|
13
|
+
export interface ErrorPageProps {
|
|
14
|
+
title?: string;
|
|
15
|
+
/** Error object or message; shown in a details block when provided. */
|
|
16
|
+
error?: unknown;
|
|
17
|
+
onRetry?: () => void;
|
|
18
|
+
retryLabel?: string;
|
|
19
|
+
brand?: import('../app/app').BrandConfig;
|
|
20
|
+
}
|
|
21
|
+
export declare function ErrorPage({ title, error, onRetry, retryLabel, brand, }: ErrorPageProps): React.JSX.Element;
|
|
22
|
+
export declare const errorPagePropsMeta: PropsMeta;
|
|
23
|
+
export interface EmptyStateProps {
|
|
24
|
+
title?: string;
|
|
25
|
+
description?: React.ReactNode;
|
|
26
|
+
icon?: React.ComponentType<{
|
|
27
|
+
className?: string;
|
|
28
|
+
}>;
|
|
29
|
+
action?: React.ReactNode;
|
|
30
|
+
className?: string;
|
|
31
|
+
}
|
|
32
|
+
export declare function EmptyState({ title, description, icon: Icon, action, className, }: EmptyStateProps): React.JSX.Element;
|
|
33
|
+
export declare const emptyStatePropsMeta: PropsMeta;
|