@kiteapps/lite-ui 0.1.0 → 0.1.1
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/README.md +13 -11
- package/dist/index.cjs +783 -37
- package/dist/index.mjs +778 -33
- package/dist/types/admin/screens.d.ts +13 -0
- package/dist/types/lib/index.d.ts +2 -0
- package/dist/types/pages/AdminScreen.d.ts +10 -0
- package/dist/types/pages/ConfigurationPage.d.ts +46 -0
- package/dist/types/pages/DashboardPage.d.ts +30 -0
- package/dist/types/pages/ReportsPage.d.ts +30 -0
- package/dist/types/pages/index.d.ts +4 -0
- package/dist/types/widgets/ConfigurationWidgets.d.ts +90 -0
- package/dist/types/widgets/DashboardWidgets.d.ts +113 -0
- package/dist/types/widgets/Primitives.d.ts +119 -0
- package/dist/types/widgets/ReportWidgets.d.ts +71 -0
- package/dist/types/widgets/SettingsWidgets.d.ts +32 -0
- package/dist/types/widgets/Shell.d.ts +112 -0
- package/dist/types/widgets/index.d.ts +7 -0
- package/package.json +62 -20
- package/dist/pages.cjs +0 -1319
- package/dist/pages.css +0 -2070
- package/dist/pages.mjs +0 -1287
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export function AdminScreen({ screen, screens, renderScreen, screenProps }: {
|
|
2
|
+
screen: any;
|
|
3
|
+
screens?: {} | undefined;
|
|
4
|
+
renderScreen: any;
|
|
5
|
+
screenProps?: {} | undefined;
|
|
6
|
+
}): any;
|
|
7
|
+
export const ADMIN_GROUPS: {
|
|
8
|
+
label: string;
|
|
9
|
+
items: {
|
|
10
|
+
id: string;
|
|
11
|
+
label: string;
|
|
12
|
+
}[];
|
|
13
|
+
}[];
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type * as React from 'react';
|
|
2
|
+
import type { NavigationGroup } from '../widgets';
|
|
3
|
+
export declare const ADMIN_GROUPS: NavigationGroup[];
|
|
4
|
+
export interface AdminScreenProps {
|
|
5
|
+
screen: string;
|
|
6
|
+
screens?: Record<string, React.ComponentType<any>>;
|
|
7
|
+
renderScreen?: (screen: string) => React.ReactNode;
|
|
8
|
+
screenProps?: Record<string, unknown>;
|
|
9
|
+
}
|
|
10
|
+
export declare function AdminScreen(props: AdminScreenProps): React.JSX.Element;
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import type * as React from 'react';
|
|
2
|
+
import { type NavigationGroup, type NavigationItem, type PolicyRecord, type PolicyFeature, type PolicyColumn, type ConfigurationHeaderProps, type PolicyFeatureStripProps, type PolicyToolbarProps, type PolicyTableProps } from '../widgets';
|
|
3
|
+
export interface ConfigurationPageLabels {
|
|
4
|
+
title?: string;
|
|
5
|
+
copySuffix?: string;
|
|
6
|
+
featuresTitle?: string;
|
|
7
|
+
instruction?: React.ReactNode;
|
|
8
|
+
policiesTitle?: string;
|
|
9
|
+
add?: string;
|
|
10
|
+
domain?: string;
|
|
11
|
+
enable?: string;
|
|
12
|
+
sectionDescription?: (title: string) => string;
|
|
13
|
+
editTitle?: string;
|
|
14
|
+
addTitle?: string;
|
|
15
|
+
cancel?: string;
|
|
16
|
+
save?: string;
|
|
17
|
+
policyName?: string;
|
|
18
|
+
}
|
|
19
|
+
export interface ConfigurationPageProps {
|
|
20
|
+
selected?: string;
|
|
21
|
+
policyId?: string;
|
|
22
|
+
groups?: NavigationGroup[];
|
|
23
|
+
policies?: PolicyRecord[];
|
|
24
|
+
initialPolicies?: PolicyRecord[];
|
|
25
|
+
onPoliciesChange?: (policies: PolicyRecord[]) => void;
|
|
26
|
+
features?: PolicyFeature[];
|
|
27
|
+
columns?: PolicyColumn[];
|
|
28
|
+
labels?: ConfigurationPageLabels;
|
|
29
|
+
defaultDomain?: string;
|
|
30
|
+
onSavePolicy?: (saved: PolicyRecord, previous: PolicyRecord) => void;
|
|
31
|
+
onDeletePolicy?: (policy: PolicyRecord) => void;
|
|
32
|
+
onCopyPolicy?: (copy: PolicyRecord, source: PolicyRecord) => void;
|
|
33
|
+
onFeatureSelect?: (id: string, item: PolicyFeature) => void;
|
|
34
|
+
createPolicy?: (name: string) => PolicyRecord;
|
|
35
|
+
renderSection?: (selected: string, item?: NavigationItem) => React.ReactNode;
|
|
36
|
+
renderPolicyForm?: (context: {
|
|
37
|
+
policy: PolicyRecord | null;
|
|
38
|
+
name: string;
|
|
39
|
+
setName: React.Dispatch<React.SetStateAction<string>>;
|
|
40
|
+
}) => React.ReactNode;
|
|
41
|
+
headerProps?: Partial<ConfigurationHeaderProps>;
|
|
42
|
+
featureProps?: PolicyFeatureStripProps;
|
|
43
|
+
toolbarProps?: PolicyToolbarProps;
|
|
44
|
+
tableProps?: PolicyTableProps;
|
|
45
|
+
}
|
|
46
|
+
export declare function ConfigurationPage({ selected, policyId, groups, policies, initialPolicies, onPoliciesChange, features, columns, labels, defaultDomain, onSavePolicy, onDeletePolicy, onCopyPolicy, onFeatureSelect, createPolicy, renderSection, renderPolicyForm, headerProps, featureProps, toolbarProps, tableProps }: ConfigurationPageProps): React.JSX.Element;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import type * as React from 'react';
|
|
2
|
+
import { type DashboardMetric, type ChartDatum, type ShortcutGroup, type ShortcutItem, type ColumnChartProps, type MfaChartProps, type WidgetFrameProps, type DashboardToolbarProps, type DashboardMenuItem } from '../widgets';
|
|
3
|
+
import type { DirectoryOption } from '../widgets';
|
|
4
|
+
type ChartKey = 'directory' | 'mfa' | 'selfService';
|
|
5
|
+
export interface DashboardPageProps {
|
|
6
|
+
metrics?: DashboardMetric[];
|
|
7
|
+
directoryData?: ChartDatum[];
|
|
8
|
+
mfaData?: ChartDatum[];
|
|
9
|
+
selfServiceData?: ChartDatum[];
|
|
10
|
+
shortcuts?: ShortcutGroup[];
|
|
11
|
+
domains?: DirectoryOption[];
|
|
12
|
+
domain?: string;
|
|
13
|
+
onDomainChange?: (value: string, item?: DirectoryOption) => void;
|
|
14
|
+
chartTitles?: Partial<Record<ChartKey, string>>;
|
|
15
|
+
chartProps?: {
|
|
16
|
+
directory?: ColumnChartProps;
|
|
17
|
+
mfa?: MfaChartProps;
|
|
18
|
+
selfService?: ColumnChartProps;
|
|
19
|
+
};
|
|
20
|
+
widgetProps?: Partial<Record<ChartKey, Partial<WidgetFrameProps>>>;
|
|
21
|
+
toolbarProps?: DashboardToolbarProps;
|
|
22
|
+
onMetricSelect?: (item: DashboardMetric) => void;
|
|
23
|
+
onReportSelect?: (id: string, item: DashboardMetric | ChartDatum) => void;
|
|
24
|
+
onShortcutSelect?: (id: string, item: ShortcutItem) => void;
|
|
25
|
+
onToolbarAction?: (id: string, item: DashboardMenuItem) => void;
|
|
26
|
+
renderMetric?: (item: DashboardMetric, index: number) => React.ReactNode;
|
|
27
|
+
renderShortcuts?: (groups: ShortcutGroup[]) => React.ReactNode;
|
|
28
|
+
}
|
|
29
|
+
export declare function DashboardPage({ metrics, directoryData, mfaData, selfServiceData, shortcuts, domains, domain, onDomainChange, chartTitles, chartProps, widgetProps, toolbarProps, onMetricSelect, onReportSelect, onShortcutSelect, onToolbarAction, renderMetric, renderShortcuts }: DashboardPageProps): React.JSX.Element;
|
|
30
|
+
export {};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import type * as React from 'react';
|
|
2
|
+
import { type ReportGroup, type ReportItem, type ReportFiltersProps } from '../widgets';
|
|
3
|
+
export interface ReportGenerationContext {
|
|
4
|
+
selected?: string;
|
|
5
|
+
report?: ReportItem;
|
|
6
|
+
domain?: string;
|
|
7
|
+
ou?: string;
|
|
8
|
+
}
|
|
9
|
+
export interface ReportsPageLabels {
|
|
10
|
+
untitled?: string;
|
|
11
|
+
schedule?: string;
|
|
12
|
+
help?: string | null;
|
|
13
|
+
scheduleNote?: string;
|
|
14
|
+
empty?: string;
|
|
15
|
+
loading?: string;
|
|
16
|
+
}
|
|
17
|
+
export interface ReportsPageProps {
|
|
18
|
+
groups?: ReportGroup[];
|
|
19
|
+
selected?: string;
|
|
20
|
+
defaultSelected?: string;
|
|
21
|
+
onSelect?: (id: string, item: ReportItem) => void;
|
|
22
|
+
filtersProps?: ReportFiltersProps;
|
|
23
|
+
labels?: ReportsPageLabels;
|
|
24
|
+
status?: 'empty' | 'loading' | (string & {});
|
|
25
|
+
onGenerate?: (context: ReportGenerationContext) => void;
|
|
26
|
+
onStop?: () => void;
|
|
27
|
+
onSchedule?: (report?: ReportItem) => void;
|
|
28
|
+
results?: React.ReactNode;
|
|
29
|
+
}
|
|
30
|
+
export declare function ReportsPage({ groups, selected, defaultSelected, onSelect, filtersProps, labels, status: controlledStatus, onGenerate, onStop, onSchedule, results }: ReportsPageProps): React.JSX.Element;
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
import type * as React from 'react';
|
|
2
|
+
import { type LucideIcon } from 'lucide-react';
|
|
3
|
+
import { type NavigationGroup, type NavigationItem } from './Shell';
|
|
4
|
+
import '../configuration/configuration.css';
|
|
5
|
+
export interface PolicyFeature {
|
|
6
|
+
id?: string;
|
|
7
|
+
label: string;
|
|
8
|
+
icon?: LucideIcon;
|
|
9
|
+
}
|
|
10
|
+
export interface PolicyRecord {
|
|
11
|
+
id?: string;
|
|
12
|
+
name: string;
|
|
13
|
+
domain?: string;
|
|
14
|
+
permissions?: string;
|
|
15
|
+
modifiedBy?: string;
|
|
16
|
+
modified?: string;
|
|
17
|
+
[key: string]: any;
|
|
18
|
+
}
|
|
19
|
+
export interface PolicyColumn {
|
|
20
|
+
key: string;
|
|
21
|
+
label: string;
|
|
22
|
+
}
|
|
23
|
+
export declare const CONFIG_GROUPS: NavigationGroup[];
|
|
24
|
+
export declare const POLICY_FEATURES: PolicyFeature[];
|
|
25
|
+
export declare const DEMO_POLICIES: PolicyRecord[];
|
|
26
|
+
export declare const POLICY_COLUMNS: PolicyColumn[];
|
|
27
|
+
export interface ConfigurationSidebarProps {
|
|
28
|
+
groups?: NavigationGroup[];
|
|
29
|
+
selected?: string;
|
|
30
|
+
defaultSelected?: string;
|
|
31
|
+
onSelect?: (id: string, item: NavigationItem) => void;
|
|
32
|
+
initialOpen?: string;
|
|
33
|
+
}
|
|
34
|
+
export declare function ConfigurationSidebar({ groups, selected, defaultSelected, onSelect, initialOpen }: ConfigurationSidebarProps): React.JSX.Element;
|
|
35
|
+
export interface ConfigurationHeaderProps {
|
|
36
|
+
title: string;
|
|
37
|
+
mode?: string;
|
|
38
|
+
onModeChange?: (mode: string) => void;
|
|
39
|
+
helpText?: string | null;
|
|
40
|
+
action?: React.ReactNode;
|
|
41
|
+
}
|
|
42
|
+
export declare function ConfigurationHeader({ title, mode, onModeChange, helpText, action }: ConfigurationHeaderProps): React.JSX.Element;
|
|
43
|
+
export interface PolicyFeatureStripProps {
|
|
44
|
+
title?: string;
|
|
45
|
+
features?: PolicyFeature[];
|
|
46
|
+
instruction?: React.ReactNode;
|
|
47
|
+
onFeatureSelect?: (id: string, item: PolicyFeature) => void;
|
|
48
|
+
}
|
|
49
|
+
export declare function PolicyFeatureStrip({ title, features, instruction, onFeatureSelect }: PolicyFeatureStripProps): React.JSX.Element;
|
|
50
|
+
export interface PolicyToolbarLabels {
|
|
51
|
+
first?: string;
|
|
52
|
+
previous?: string;
|
|
53
|
+
next?: string;
|
|
54
|
+
last?: string;
|
|
55
|
+
range?: (first: number, last: number, total: number) => string;
|
|
56
|
+
}
|
|
57
|
+
export interface PolicyToolbarProps {
|
|
58
|
+
title?: string;
|
|
59
|
+
addLabel?: string;
|
|
60
|
+
searchLabel?: string;
|
|
61
|
+
count?: number;
|
|
62
|
+
page?: number;
|
|
63
|
+
defaultPage?: number;
|
|
64
|
+
pageSize?: number;
|
|
65
|
+
onPageChange?: (page: number) => void;
|
|
66
|
+
onAdd?: () => void;
|
|
67
|
+
query?: string;
|
|
68
|
+
defaultQuery?: string;
|
|
69
|
+
onQueryChange?: (value: string) => void;
|
|
70
|
+
labels?: PolicyToolbarLabels;
|
|
71
|
+
}
|
|
72
|
+
export declare function PolicyToolbar({ title, addLabel, searchLabel, count, page, defaultPage, pageSize, onPageChange, onAdd, query, defaultQuery, onQueryChange, labels }: PolicyToolbarProps): React.JSX.Element;
|
|
73
|
+
export interface PolicyTableProps {
|
|
74
|
+
policies?: PolicyRecord[];
|
|
75
|
+
columns?: PolicyColumn[];
|
|
76
|
+
defaultDomain?: string;
|
|
77
|
+
emptyMessage?: React.ReactNode;
|
|
78
|
+
actionLabels?: {
|
|
79
|
+
edit?: string;
|
|
80
|
+
delete?: string;
|
|
81
|
+
copy?: string;
|
|
82
|
+
advanced?: string;
|
|
83
|
+
};
|
|
84
|
+
onEdit?: (policy: PolicyRecord) => void;
|
|
85
|
+
onDelete?: (policy: PolicyRecord) => void;
|
|
86
|
+
onCopy?: (policy: PolicyRecord) => void;
|
|
87
|
+
renderCell?: (policy: PolicyRecord, key: string) => React.ReactNode | undefined;
|
|
88
|
+
getRowId?: (policy: PolicyRecord) => React.Key;
|
|
89
|
+
}
|
|
90
|
+
export declare function PolicyTable({ policies, columns, defaultDomain, emptyMessage, actionLabels, onEdit, onDelete, onCopy, renderCell, getRowId }: PolicyTableProps): React.JSX.Element;
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
import type * as React from 'react';
|
|
2
|
+
import { type LucideIcon } from 'lucide-react';
|
|
3
|
+
import type { DirectoryOption } from './Shell';
|
|
4
|
+
import '../dashboard/dashboard.css';
|
|
5
|
+
export interface MetricWidgetProps extends Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, 'value' | 'title'> {
|
|
6
|
+
title: string;
|
|
7
|
+
value: React.ReactNode;
|
|
8
|
+
caption?: string;
|
|
9
|
+
icon?: LucideIcon | null;
|
|
10
|
+
tone?: string;
|
|
11
|
+
iconSize?: number;
|
|
12
|
+
}
|
|
13
|
+
export interface DashboardMetric extends Omit<MetricWidgetProps, 'onClick'> {
|
|
14
|
+
id?: string;
|
|
15
|
+
report?: string;
|
|
16
|
+
onClick?: (item: DashboardMetric) => void;
|
|
17
|
+
}
|
|
18
|
+
export interface ChartDatum {
|
|
19
|
+
id: string;
|
|
20
|
+
label: string;
|
|
21
|
+
value: number;
|
|
22
|
+
color?: string;
|
|
23
|
+
}
|
|
24
|
+
export interface ShortcutItem {
|
|
25
|
+
id: string;
|
|
26
|
+
label: string;
|
|
27
|
+
href?: string;
|
|
28
|
+
}
|
|
29
|
+
export type ShortcutLink = string | ShortcutItem;
|
|
30
|
+
export interface ShortcutGroup {
|
|
31
|
+
id?: string;
|
|
32
|
+
title: string;
|
|
33
|
+
links: ShortcutLink[];
|
|
34
|
+
}
|
|
35
|
+
export interface DashboardMenuItem {
|
|
36
|
+
id: string;
|
|
37
|
+
label: string;
|
|
38
|
+
onClick?: (item: DashboardMenuItem) => void;
|
|
39
|
+
}
|
|
40
|
+
export declare const DASHBOARD_METRICS: DashboardMetric[];
|
|
41
|
+
export declare const DASHBOARD_SHORTCUTS: ShortcutGroup[];
|
|
42
|
+
export declare const DIRECTORY_REPORT_DATA: ChartDatum[];
|
|
43
|
+
export declare const MFA_REPORT_DATA: ChartDatum[];
|
|
44
|
+
export declare const SELF_SERVICE_REPORT_DATA: ChartDatum[];
|
|
45
|
+
export declare function MetricWidget({ title, value, caption, icon: Icon, tone, iconSize, onClick, className, ...props }: MetricWidgetProps): React.JSX.Element;
|
|
46
|
+
export interface WidgetFrameProps {
|
|
47
|
+
title: string;
|
|
48
|
+
children?: React.ReactNode;
|
|
49
|
+
onExpand?: () => void;
|
|
50
|
+
onRefresh?: () => void;
|
|
51
|
+
onMore?: () => void;
|
|
52
|
+
tools?: React.ReactNode;
|
|
53
|
+
showTools?: boolean;
|
|
54
|
+
labels?: {
|
|
55
|
+
maximize?: string;
|
|
56
|
+
refresh?: string;
|
|
57
|
+
more?: string;
|
|
58
|
+
};
|
|
59
|
+
className?: string;
|
|
60
|
+
}
|
|
61
|
+
export declare function WidgetFrame({ title, children, onExpand, onRefresh, onMore, tools, showTools, labels, className }: WidgetFrameProps): React.JSX.Element;
|
|
62
|
+
export interface ColumnChartProps {
|
|
63
|
+
data?: ChartDatum[];
|
|
64
|
+
max?: number;
|
|
65
|
+
ticks?: number[];
|
|
66
|
+
axisLabel?: string;
|
|
67
|
+
unit?: string;
|
|
68
|
+
color?: string;
|
|
69
|
+
onSelect?: (id: string, item: ChartDatum) => void;
|
|
70
|
+
}
|
|
71
|
+
export declare function ActiveDirectoryChart({ data, max, ticks, axisLabel, unit, color, onSelect }: ColumnChartProps): React.JSX.Element;
|
|
72
|
+
export interface MfaChartProps {
|
|
73
|
+
data?: ChartDatum[];
|
|
74
|
+
onSelect?: (id: string, item: ChartDatum) => void;
|
|
75
|
+
ariaLabel?: string;
|
|
76
|
+
}
|
|
77
|
+
export declare function MfaChart({ data, onSelect, ariaLabel }: MfaChartProps): React.JSX.Element;
|
|
78
|
+
export declare function SelfServiceChart({ data, max, ticks, axisLabel, unit, color, onSelect }: ColumnChartProps): React.JSX.Element;
|
|
79
|
+
export interface ShortcutRailProps {
|
|
80
|
+
groups?: ShortcutGroup[];
|
|
81
|
+
onSelect?: (id: string, item: ShortcutItem) => void;
|
|
82
|
+
ariaLabel?: string;
|
|
83
|
+
}
|
|
84
|
+
export declare function ShortcutRail({ groups, onSelect, ariaLabel }: ShortcutRailProps): React.JSX.Element;
|
|
85
|
+
export interface DashboardToolbarProps {
|
|
86
|
+
domains?: DirectoryOption[];
|
|
87
|
+
domain?: string;
|
|
88
|
+
defaultDomain?: string;
|
|
89
|
+
onDomainChange?: (value: string, item?: DirectoryOption) => void;
|
|
90
|
+
domainLabel?: string;
|
|
91
|
+
showShortcuts?: boolean;
|
|
92
|
+
onToggleShortcuts?: (show?: boolean) => void;
|
|
93
|
+
onExpand?: () => void;
|
|
94
|
+
settingsLabel?: string;
|
|
95
|
+
expandLabel?: string;
|
|
96
|
+
menuItems?: DashboardMenuItem[];
|
|
97
|
+
onMenuAction?: (id: string, item: DashboardMenuItem) => void;
|
|
98
|
+
}
|
|
99
|
+
export declare function DashboardToolbar({ domains, domain, defaultDomain, onDomainChange, domainLabel, showShortcuts, onToggleShortcuts, onExpand, settingsLabel, expandLabel, menuItems, onMenuAction }: DashboardToolbarProps): React.JSX.Element;
|
|
100
|
+
export interface DashboardLayoutProps {
|
|
101
|
+
metrics?: React.ReactNode;
|
|
102
|
+
charts?: React.ReactNode;
|
|
103
|
+
shortcuts?: React.ReactNode;
|
|
104
|
+
showShortcuts?: boolean;
|
|
105
|
+
}
|
|
106
|
+
export declare function DashboardLayout({ metrics, charts, shortcuts, showShortcuts }: DashboardLayoutProps): React.JSX.Element;
|
|
107
|
+
export interface ExpandedWidgetProps {
|
|
108
|
+
title?: string | null;
|
|
109
|
+
onClose: () => void;
|
|
110
|
+
children?: React.ReactNode;
|
|
111
|
+
closeLabel?: string;
|
|
112
|
+
}
|
|
113
|
+
export declare function ExpandedWidget({ title, onClose, children, closeLabel }: ExpandedWidgetProps): React.JSX.Element | null;
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
import type * as React from 'react';
|
|
2
|
+
import { type LucideIcon } from 'lucide-react';
|
|
3
|
+
export interface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {
|
|
4
|
+
variant?: 'neutral' | 'primary' | 'outline' | 'download' | (string & {});
|
|
5
|
+
icon?: LucideIcon;
|
|
6
|
+
}
|
|
7
|
+
export declare function Button({ children, variant, icon: Icon, className, ...props }: ButtonProps): React.JSX.Element;
|
|
8
|
+
export interface IconButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {
|
|
9
|
+
icon: LucideIcon;
|
|
10
|
+
label: string;
|
|
11
|
+
}
|
|
12
|
+
export declare function IconButton({ icon: Icon, label, ...props }: IconButtonProps): React.JSX.Element;
|
|
13
|
+
export interface TextFieldProps extends React.InputHTMLAttributes<HTMLInputElement> {
|
|
14
|
+
label?: string;
|
|
15
|
+
hint?: React.ReactNode;
|
|
16
|
+
}
|
|
17
|
+
export declare function TextField({ label, hint, id, className, ...props }: TextFieldProps): React.JSX.Element;
|
|
18
|
+
export type SelectOption = string | {
|
|
19
|
+
value: string;
|
|
20
|
+
label: string;
|
|
21
|
+
};
|
|
22
|
+
export interface SelectFieldProps extends React.SelectHTMLAttributes<HTMLSelectElement> {
|
|
23
|
+
label?: string;
|
|
24
|
+
options?: SelectOption[];
|
|
25
|
+
}
|
|
26
|
+
export declare function SelectField({ label, options, value, onChange, className, ...props }: SelectFieldProps): React.JSX.Element;
|
|
27
|
+
export interface CheckRowProps {
|
|
28
|
+
children?: React.ReactNode;
|
|
29
|
+
defaultChecked?: boolean;
|
|
30
|
+
checked?: boolean;
|
|
31
|
+
onChange?: (checked: boolean) => void;
|
|
32
|
+
disabled?: boolean;
|
|
33
|
+
help?: string;
|
|
34
|
+
className?: string;
|
|
35
|
+
}
|
|
36
|
+
export declare function CheckRow({ children, defaultChecked, checked, onChange, disabled, help, className }: CheckRowProps): React.JSX.Element;
|
|
37
|
+
export interface RadioRowProps {
|
|
38
|
+
name: string;
|
|
39
|
+
value: string;
|
|
40
|
+
checked?: boolean;
|
|
41
|
+
onChange?: (value: string) => void;
|
|
42
|
+
children?: React.ReactNode;
|
|
43
|
+
disabled?: boolean;
|
|
44
|
+
}
|
|
45
|
+
export declare function RadioRow({ name, value, checked, onChange, children, disabled }: RadioRowProps): React.JSX.Element;
|
|
46
|
+
export declare function HelpTip({ text }: {
|
|
47
|
+
text: string;
|
|
48
|
+
}): React.JSX.Element;
|
|
49
|
+
export interface TextLinkProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {
|
|
50
|
+
}
|
|
51
|
+
export declare function TextLink({ children, onClick, ...props }: TextLinkProps): React.JSX.Element;
|
|
52
|
+
export type TabItem = string | {
|
|
53
|
+
id: string;
|
|
54
|
+
label: string;
|
|
55
|
+
};
|
|
56
|
+
export interface TabsProps {
|
|
57
|
+
tabs?: TabItem[];
|
|
58
|
+
active?: string;
|
|
59
|
+
onChange?: (id: string, item: {
|
|
60
|
+
id: string;
|
|
61
|
+
label: string;
|
|
62
|
+
}) => void;
|
|
63
|
+
ariaLabel?: string;
|
|
64
|
+
}
|
|
65
|
+
export declare function Tabs({ tabs, active, onChange, ariaLabel }: TabsProps): React.JSX.Element;
|
|
66
|
+
export interface PageHeaderProps {
|
|
67
|
+
title: React.ReactNode;
|
|
68
|
+
action?: React.ReactNode;
|
|
69
|
+
help?: string;
|
|
70
|
+
}
|
|
71
|
+
export declare function PageHeader({ title, action, help }: PageHeaderProps): React.JSX.Element;
|
|
72
|
+
export declare function Panel({ children, className }: {
|
|
73
|
+
children?: React.ReactNode;
|
|
74
|
+
className?: string;
|
|
75
|
+
}): React.JSX.Element;
|
|
76
|
+
export declare function SectionTitle({ children }: {
|
|
77
|
+
children?: React.ReactNode;
|
|
78
|
+
}): React.JSX.Element;
|
|
79
|
+
export declare function FormRow({ label, children, required, hint }: {
|
|
80
|
+
label: React.ReactNode;
|
|
81
|
+
children?: React.ReactNode;
|
|
82
|
+
required?: boolean;
|
|
83
|
+
hint?: React.ReactNode;
|
|
84
|
+
}): React.JSX.Element;
|
|
85
|
+
export interface ActionBarProps {
|
|
86
|
+
onSave?: () => void;
|
|
87
|
+
onCancel?: () => void;
|
|
88
|
+
saveLabel?: string;
|
|
89
|
+
cancelLabel?: string;
|
|
90
|
+
status?: React.ReactNode;
|
|
91
|
+
}
|
|
92
|
+
export declare function ActionBar({ onSave, onCancel, saveLabel, cancelLabel, status }: ActionBarProps): React.JSX.Element;
|
|
93
|
+
export declare function Notice({ children, tone }: {
|
|
94
|
+
children?: React.ReactNode;
|
|
95
|
+
tone?: 'info' | 'warning' | 'error' | (string & {});
|
|
96
|
+
}): React.JSX.Element;
|
|
97
|
+
export type DataRow = Record<string, any> | React.ReactNode[];
|
|
98
|
+
export type DataColumn<Row extends DataRow = DataRow> = string | {
|
|
99
|
+
key: string;
|
|
100
|
+
label: string;
|
|
101
|
+
render?: (row: Row, index: number) => React.ReactNode;
|
|
102
|
+
};
|
|
103
|
+
export interface DataTableProps<Row extends DataRow = DataRow> {
|
|
104
|
+
columns?: DataColumn<Row>[];
|
|
105
|
+
rows?: Row[];
|
|
106
|
+
empty?: React.ReactNode;
|
|
107
|
+
onRowClick?: (row: Row, index: number) => void;
|
|
108
|
+
getRowId?: (row: Row, index: number) => React.Key;
|
|
109
|
+
}
|
|
110
|
+
export declare function DataTable<Row extends DataRow = DataRow>({ columns, rows, empty, onRowClick, getRowId }: DataTableProps<Row>): React.JSX.Element;
|
|
111
|
+
export interface ModalProps {
|
|
112
|
+
title: string;
|
|
113
|
+
children?: React.ReactNode;
|
|
114
|
+
open?: boolean;
|
|
115
|
+
onClose?: () => void;
|
|
116
|
+
footer?: React.ReactNode;
|
|
117
|
+
closeLabel?: string;
|
|
118
|
+
}
|
|
119
|
+
export declare function Modal({ title, children, open, onClose, footer, closeLabel }: ModalProps): React.JSX.Element | null;
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import type * as React from 'react';
|
|
2
|
+
import type { DirectoryOption } from './Shell';
|
|
3
|
+
import '../reports/reports.css';
|
|
4
|
+
export interface ReportItem {
|
|
5
|
+
id: string;
|
|
6
|
+
label: string;
|
|
7
|
+
}
|
|
8
|
+
export type ReportEntry = ReportItem | readonly [string, string];
|
|
9
|
+
export interface ReportGroup {
|
|
10
|
+
id?: string;
|
|
11
|
+
label: string;
|
|
12
|
+
items: ReportEntry[];
|
|
13
|
+
}
|
|
14
|
+
export interface ReportFilterLabels {
|
|
15
|
+
domain?: string;
|
|
16
|
+
selectOu?: string;
|
|
17
|
+
generate?: string;
|
|
18
|
+
stop?: string;
|
|
19
|
+
}
|
|
20
|
+
export declare const REPORT_GROUPS: ReportGroup[];
|
|
21
|
+
export declare const normalizeReport: (item: ReportEntry) => ReportItem;
|
|
22
|
+
export interface ReportNavigationProps {
|
|
23
|
+
groups?: ReportGroup[];
|
|
24
|
+
selected?: string;
|
|
25
|
+
defaultSelected?: string;
|
|
26
|
+
onSelect?: (id: string, item: ReportItem) => void;
|
|
27
|
+
searchPlaceholder?: string;
|
|
28
|
+
searchLabel?: string;
|
|
29
|
+
emptyLabel?: string;
|
|
30
|
+
ariaLabel?: string;
|
|
31
|
+
onSearchChange?: (value: string) => void;
|
|
32
|
+
}
|
|
33
|
+
export declare function ReportNavigation({ groups, selected, defaultSelected, onSelect, searchPlaceholder, searchLabel, emptyLabel, ariaLabel, onSearchChange }: ReportNavigationProps): React.JSX.Element;
|
|
34
|
+
export interface ReportCategoryBarProps {
|
|
35
|
+
groups?: ReportGroup[];
|
|
36
|
+
selected?: string;
|
|
37
|
+
defaultSelected?: string;
|
|
38
|
+
onSelect?: (id: string, item: ReportItem) => void;
|
|
39
|
+
ariaLabel?: string;
|
|
40
|
+
}
|
|
41
|
+
export declare function ReportCategoryBar({ groups, selected, defaultSelected, onSelect, ariaLabel }: ReportCategoryBarProps): React.JSX.Element;
|
|
42
|
+
export interface ReportFiltersProps {
|
|
43
|
+
domains?: DirectoryOption[];
|
|
44
|
+
domain?: string;
|
|
45
|
+
defaultDomain?: string;
|
|
46
|
+
onDomainChange?: (value: string, item?: DirectoryOption) => void;
|
|
47
|
+
ouOptions?: DirectoryOption[];
|
|
48
|
+
ou?: string;
|
|
49
|
+
defaultOu?: string;
|
|
50
|
+
onOuChange?: (value: string, item: DirectoryOption) => void;
|
|
51
|
+
labels?: ReportFilterLabels;
|
|
52
|
+
onGenerate?: () => void;
|
|
53
|
+
onStop?: () => void;
|
|
54
|
+
generating?: boolean;
|
|
55
|
+
}
|
|
56
|
+
export declare function ReportFilters({ domains, domain, defaultDomain, onDomainChange, ouOptions, ou, defaultOu, onOuChange, labels, onGenerate, onStop, generating }: ReportFiltersProps): React.JSX.Element;
|
|
57
|
+
export interface ReportResultsProps {
|
|
58
|
+
status?: 'empty' | 'loading' | (string & {});
|
|
59
|
+
emptyMessage?: React.ReactNode;
|
|
60
|
+
loadingMessage?: React.ReactNode;
|
|
61
|
+
children?: React.ReactNode;
|
|
62
|
+
}
|
|
63
|
+
export declare function ReportResults({ status, emptyMessage, loadingMessage, children }: ReportResultsProps): React.JSX.Element;
|
|
64
|
+
export interface ReportPageHeadingProps {
|
|
65
|
+
title: string;
|
|
66
|
+
onSchedule?: () => void;
|
|
67
|
+
scheduleLabel?: string;
|
|
68
|
+
helpText?: string | null;
|
|
69
|
+
action?: React.ReactNode;
|
|
70
|
+
}
|
|
71
|
+
export declare function ReportPageHeading({ title, onSchedule, scheduleLabel, helpText, action }: ReportPageHeadingProps): React.JSX.Element;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import type * as React from 'react';
|
|
2
|
+
import { type SelectOption, type TabItem } from './Primitives';
|
|
3
|
+
export interface FrameProps {
|
|
4
|
+
title: string;
|
|
5
|
+
tabs?: TabItem[];
|
|
6
|
+
activeTab?: string;
|
|
7
|
+
defaultTab?: string;
|
|
8
|
+
onTabChange?: (id: string) => void;
|
|
9
|
+
children?: React.ReactNode | ((active: string | undefined) => React.ReactNode);
|
|
10
|
+
action?: React.ReactNode;
|
|
11
|
+
help?: string;
|
|
12
|
+
className?: string;
|
|
13
|
+
}
|
|
14
|
+
export declare function Frame({ title, tabs, activeTab, defaultTab, onTabChange, children, action, help, className }: FrameProps): React.JSX.Element;
|
|
15
|
+
export interface SaveBarProps {
|
|
16
|
+
saveLabel?: string;
|
|
17
|
+
cancel?: boolean;
|
|
18
|
+
cancelLabel?: string;
|
|
19
|
+
successMessage?: string;
|
|
20
|
+
onSave?: () => void;
|
|
21
|
+
onCancel?: () => void;
|
|
22
|
+
status?: string;
|
|
23
|
+
}
|
|
24
|
+
export declare function SaveBar({ saveLabel, cancel, cancelLabel, successMessage, onSave, onCancel, status: controlledStatus }: SaveBarProps): React.JSX.Element;
|
|
25
|
+
export interface InlineSelectProps extends Omit<React.SelectHTMLAttributes<HTMLSelectElement>, 'value' | 'onChange'> {
|
|
26
|
+
options?: SelectOption[];
|
|
27
|
+
initial?: string;
|
|
28
|
+
value?: string;
|
|
29
|
+
onChange?: (value: string) => void;
|
|
30
|
+
width?: React.CSSProperties['width'];
|
|
31
|
+
}
|
|
32
|
+
export declare function InlineSelect({ options, initial, value, onChange, width, ...props }: InlineSelectProps): React.JSX.Element;
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
import type * as React from 'react';
|
|
2
|
+
export type NavigationSection = string | {
|
|
3
|
+
id: string;
|
|
4
|
+
label: string;
|
|
5
|
+
};
|
|
6
|
+
export interface NavigationItem {
|
|
7
|
+
id: string;
|
|
8
|
+
label: string;
|
|
9
|
+
}
|
|
10
|
+
export interface NavigationGroup {
|
|
11
|
+
id?: string;
|
|
12
|
+
label: string;
|
|
13
|
+
items: NavigationItem[];
|
|
14
|
+
}
|
|
15
|
+
export type DirectoryOption = string | {
|
|
16
|
+
value: string;
|
|
17
|
+
label: string;
|
|
18
|
+
};
|
|
19
|
+
export type UtilityItem = string | {
|
|
20
|
+
id?: string;
|
|
21
|
+
label: string;
|
|
22
|
+
onClick?: (item: Exclude<UtilityItem, string>) => void;
|
|
23
|
+
};
|
|
24
|
+
export type FooterItem = string | {
|
|
25
|
+
id: string;
|
|
26
|
+
label: string;
|
|
27
|
+
href?: string;
|
|
28
|
+
};
|
|
29
|
+
export declare const MAIN_SECTIONS: NavigationSection[];
|
|
30
|
+
export declare const FOOTER_LINKS: FooterItem[];
|
|
31
|
+
export interface TopNavigationProps {
|
|
32
|
+
sections?: NavigationSection[];
|
|
33
|
+
active?: string;
|
|
34
|
+
onChange?: (id: string, item: NavigationItem) => void;
|
|
35
|
+
ariaLabel?: string;
|
|
36
|
+
}
|
|
37
|
+
export declare function TopNavigation({ sections, active, onChange, ariaLabel }: TopNavigationProps): React.JSX.Element;
|
|
38
|
+
export interface ShellHeaderProps {
|
|
39
|
+
brand?: string;
|
|
40
|
+
brandIcon?: React.ReactNode;
|
|
41
|
+
showBrandOrbit?: boolean;
|
|
42
|
+
sections?: NavigationSection[];
|
|
43
|
+
navigationLabel?: string;
|
|
44
|
+
activeSection?: string;
|
|
45
|
+
onSectionChange?: (id: string, item: NavigationItem) => void;
|
|
46
|
+
directories?: DirectoryOption[];
|
|
47
|
+
directory?: string;
|
|
48
|
+
defaultDirectory?: string;
|
|
49
|
+
onDirectoryChange?: (value: string, item: DirectoryOption) => void;
|
|
50
|
+
showDownload?: boolean;
|
|
51
|
+
downloadLabel?: string;
|
|
52
|
+
onDownload?: () => void;
|
|
53
|
+
utilityItems?: UtilityItem[];
|
|
54
|
+
showNotifications?: boolean;
|
|
55
|
+
notifications?: number;
|
|
56
|
+
notificationLabel?: string;
|
|
57
|
+
onNotificationsClick?: () => void;
|
|
58
|
+
showUserMenu?: boolean;
|
|
59
|
+
userMenuLabel?: string;
|
|
60
|
+
onUserClick?: () => void;
|
|
61
|
+
showSearch?: boolean;
|
|
62
|
+
searchPlaceholder?: string;
|
|
63
|
+
searchLabel?: string;
|
|
64
|
+
searchValue?: string;
|
|
65
|
+
onSearchChange?: (value: string) => void;
|
|
66
|
+
showSettings?: boolean;
|
|
67
|
+
settingsLabel?: string;
|
|
68
|
+
onSettingsClick?: () => void;
|
|
69
|
+
rightContent?: React.ReactNode;
|
|
70
|
+
}
|
|
71
|
+
export declare function ShellHeader({ brand, brandIcon, showBrandOrbit, sections, navigationLabel, activeSection, onSectionChange, directories, directory, defaultDirectory, onDirectoryChange, showDownload, downloadLabel, onDownload, utilityItems, showNotifications, notifications, notificationLabel, onNotificationsClick, showUserMenu, userMenuLabel, onUserClick, showSearch, searchPlaceholder, searchLabel, searchValue, onSearchChange, showSettings, settingsLabel, onSettingsClick, rightContent }: ShellHeaderProps): React.JSX.Element;
|
|
72
|
+
export interface CollapsibleSidebarProps {
|
|
73
|
+
groups?: NavigationGroup[];
|
|
74
|
+
selected?: string;
|
|
75
|
+
defaultSelected?: string;
|
|
76
|
+
onSelect?: (id: string, item: NavigationItem) => void;
|
|
77
|
+
initialOpen?: string;
|
|
78
|
+
open?: string;
|
|
79
|
+
onOpenChange?: (label: string, group: NavigationGroup) => void;
|
|
80
|
+
ariaLabel?: string;
|
|
81
|
+
}
|
|
82
|
+
export declare function CollapsibleSidebar({ groups, selected, defaultSelected, onSelect, initialOpen, open, onOpenChange, ariaLabel }: CollapsibleSidebarProps): React.JSX.Element;
|
|
83
|
+
export interface ShellFooterProps {
|
|
84
|
+
items?: FooterItem[];
|
|
85
|
+
onItemSelect?: (id: string, item: {
|
|
86
|
+
id: string;
|
|
87
|
+
label: string;
|
|
88
|
+
href?: string;
|
|
89
|
+
}) => void;
|
|
90
|
+
children?: React.ReactNode;
|
|
91
|
+
}
|
|
92
|
+
export declare function ShellFooter({ items, onItemSelect, children }: ShellFooterProps): React.JSX.Element;
|
|
93
|
+
export interface AppShellProps {
|
|
94
|
+
activeSection?: string;
|
|
95
|
+
onSectionChange?: (id: string, item: NavigationItem) => void;
|
|
96
|
+
sidebar?: React.ReactNode;
|
|
97
|
+
sidebarLabel?: string;
|
|
98
|
+
hideSidebar?: boolean;
|
|
99
|
+
mainClassName?: string;
|
|
100
|
+
headerProps?: ShellHeaderProps;
|
|
101
|
+
footerProps?: ShellFooterProps;
|
|
102
|
+
header?: React.ReactNode;
|
|
103
|
+
footer?: React.ReactNode;
|
|
104
|
+
children?: React.ReactNode;
|
|
105
|
+
}
|
|
106
|
+
export declare function AppShell({ activeSection, onSectionChange, sidebar, sidebarLabel, hideSidebar, mainClassName, headerProps, footerProps, header, footer, children }: AppShellProps): React.JSX.Element;
|
|
107
|
+
export interface AdminShellProps extends AppShellProps {
|
|
108
|
+
groups?: NavigationGroup[];
|
|
109
|
+
screen?: string;
|
|
110
|
+
onScreenChange?: (id: string, item: NavigationItem) => void;
|
|
111
|
+
}
|
|
112
|
+
export declare function AdminShell({ groups, screen, onScreenChange, children, activeSection, onSectionChange, sidebar, hideSidebar, mainClassName, ...shellProps }: AdminShellProps): React.JSX.Element;
|