klun-ui 0.2.2 → 0.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/CHANGELOG.md +107 -0
- package/README.md +1 -1
- package/dist/Chip-DiCYJmnv.d.cts +18 -0
- package/dist/Chip-DiCYJmnv.d.ts +18 -0
- package/dist/{chunk-UJOMGMCV.js → chunk-I4OHTBZQ.js} +36 -9
- package/dist/chunk-I4OHTBZQ.js.map +1 -0
- package/dist/{chunk-T7O3RMWL.cjs → chunk-YSCRS555.cjs} +36 -9
- package/dist/chunk-YSCRS555.cjs.map +1 -0
- package/dist/index.cjs +158 -158
- package/dist/index.d.cts +13 -17
- package/dist/index.d.ts +13 -17
- package/dist/index.js +1 -1
- package/dist/styles.css +21 -6
- package/dist/templates/index.cjs +7987 -2028
- package/dist/templates/index.cjs.map +1 -1
- package/dist/templates/index.d.cts +259 -8
- package/dist/templates/index.d.ts +259 -8
- package/dist/templates/index.js +7440 -1515
- package/dist/templates/index.js.map +1 -1
- package/package.json +1 -1
- package/dist/chunk-T7O3RMWL.cjs.map +0 -1
- package/dist/chunk-UJOMGMCV.js.map +0 -1
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import * as react from 'react';
|
|
2
2
|
import { ReactNode } from 'react';
|
|
3
|
+
import { C as ChipColor } from '../Chip-DiCYJmnv.cjs';
|
|
3
4
|
|
|
4
5
|
interface SidebarUser {
|
|
5
6
|
name: string;
|
|
@@ -45,15 +46,18 @@ declare function SettingsTemplate(): react.JSX.Element;
|
|
|
45
46
|
|
|
46
47
|
interface MetronicNavChild {
|
|
47
48
|
key: string;
|
|
48
|
-
|
|
49
|
+
/** Optional override — otherwise resolved from the demo dictionary. */
|
|
50
|
+
label?: string;
|
|
49
51
|
}
|
|
50
52
|
interface MetronicNavItem {
|
|
51
53
|
key: string;
|
|
52
|
-
label
|
|
54
|
+
label?: string;
|
|
53
55
|
/** Remix Icon class, e.g. `ri-dashboard-line`. */
|
|
54
56
|
icon: string;
|
|
55
57
|
badge?: string;
|
|
56
58
|
children?: MetronicNavChild[];
|
|
59
|
+
/** Render a hairline above this item (section break). */
|
|
60
|
+
dividerBefore?: boolean;
|
|
57
61
|
}
|
|
58
62
|
interface MetronicSidebarProps {
|
|
59
63
|
/** Active item key. */
|
|
@@ -62,11 +66,56 @@ interface MetronicSidebarProps {
|
|
|
62
66
|
}
|
|
63
67
|
declare function MetronicSidebar({ active, onNavigate }: MetronicSidebarProps): react.JSX.Element;
|
|
64
68
|
|
|
65
|
-
|
|
69
|
+
/** Accent skins shipped by the design system (`data-mode`). */
|
|
70
|
+
declare const DEMO_SKINS: readonly ["metronic", "blue", "purple", "orange", "green", "slate"];
|
|
71
|
+
type DemoSkin = (typeof DEMO_SKINS)[number];
|
|
72
|
+
interface DemoNotification {
|
|
73
|
+
id: string;
|
|
74
|
+
title: string;
|
|
75
|
+
body: string;
|
|
76
|
+
/** ISO timestamp. */
|
|
77
|
+
time: string;
|
|
78
|
+
icon: string;
|
|
79
|
+
tone: "primary" | "success" | "warning" | "error";
|
|
80
|
+
read: boolean;
|
|
81
|
+
}
|
|
82
|
+
interface MetronicTopBarProps {
|
|
83
|
+
/** Open the ⌘K command palette (the search box does this too). */
|
|
84
|
+
onOpenPalette?: () => void;
|
|
85
|
+
/** Platform hint rendered in the search box. */
|
|
86
|
+
paletteHint?: string;
|
|
87
|
+
theme: "light" | "dark";
|
|
88
|
+
onThemeChange?: (theme: "light" | "dark") => void;
|
|
89
|
+
density: "default" | "compact";
|
|
90
|
+
onDensityChange?: (density: "default" | "compact") => void;
|
|
91
|
+
skin: DemoSkin;
|
|
92
|
+
onSkinChange?: (skin: DemoSkin) => void;
|
|
93
|
+
/** Active BCP-47 locale code (`en-US`, `zh-CN`, …). */
|
|
94
|
+
localeCode?: string;
|
|
95
|
+
onLocaleChange?: (code: string) => void;
|
|
96
|
+
notifications?: DemoNotification[];
|
|
97
|
+
onNotificationClick?: (notification: DemoNotification) => void;
|
|
98
|
+
onMarkAllRead?: () => void;
|
|
99
|
+
/** Navigate to another screen. */
|
|
100
|
+
onNavigate?: (key: string) => void;
|
|
101
|
+
/** Opens the create-order dialog. */
|
|
102
|
+
onNewOrder?: () => void;
|
|
103
|
+
/** Sign out (the demo just shows a toast). */
|
|
104
|
+
onSignOut?: () => void;
|
|
105
|
+
}
|
|
106
|
+
declare function MetronicTopBar({ onOpenPalette, paletteHint, theme, onThemeChange, density, onDensityChange, skin, onSkinChange, localeCode, onLocaleChange, notifications, onNotificationClick, onMarkAllRead, onNavigate, onNewOrder, onSignOut, }: MetronicTopBarProps): react.JSX.Element;
|
|
66
107
|
|
|
67
|
-
|
|
108
|
+
interface DashboardScreenProps {
|
|
109
|
+
/** Jump to the orders screen — fired by “View all” and by clicking a recent order. */
|
|
110
|
+
onViewAllOrders?: (orderId?: string) => void;
|
|
111
|
+
}
|
|
112
|
+
declare function DashboardScreen({ onViewAllOrders }?: DashboardScreenProps): react.JSX.Element;
|
|
68
113
|
|
|
69
|
-
|
|
114
|
+
interface OrdersScreenProps {
|
|
115
|
+
/** Bump this counter to pop the create dialog (used by the shell's top bar). */
|
|
116
|
+
createRequest?: number;
|
|
117
|
+
}
|
|
118
|
+
declare function OrdersScreen({ createRequest }: OrdersScreenProps): react.JSX.Element;
|
|
70
119
|
|
|
71
120
|
declare function ProductsScreen(): react.JSX.Element;
|
|
72
121
|
|
|
@@ -104,7 +153,17 @@ declare function ProductWizardPage({ mode, initial, onCancel, onSave }: ProductW
|
|
|
104
153
|
|
|
105
154
|
declare function CustomersScreen(): react.JSX.Element;
|
|
106
155
|
|
|
107
|
-
|
|
156
|
+
interface UsersScreenProps {
|
|
157
|
+
/** Pre-filter the list by department (used by the departments screen). */
|
|
158
|
+
initialDepartment?: string;
|
|
159
|
+
/** Open the audit log filtered by this member. */
|
|
160
|
+
onOpenAudit?: (actor: string) => void;
|
|
161
|
+
/** Jump to the roles & permissions matrix. */
|
|
162
|
+
onOpenRoles?: () => void;
|
|
163
|
+
/** Jump to the departments tree. */
|
|
164
|
+
onOpenDepartments?: () => void;
|
|
165
|
+
}
|
|
166
|
+
declare function UsersScreen({ initialDepartment, onOpenAudit, onOpenRoles, onOpenDepartments }?: UsersScreenProps): react.JSX.Element;
|
|
108
167
|
|
|
109
168
|
declare function RolesScreen(): react.JSX.Element;
|
|
110
169
|
|
|
@@ -113,6 +172,158 @@ declare function ReportsScreen({ view }: {
|
|
|
113
172
|
view?: ReportsView;
|
|
114
173
|
}): react.JSX.Element;
|
|
115
174
|
|
|
175
|
+
interface DepartmentsScreenProps {
|
|
176
|
+
/** Jump to the team page (the drawer links to members), focused on a department. */
|
|
177
|
+
onOpenTeam?: (departmentName?: string) => void;
|
|
178
|
+
}
|
|
179
|
+
declare function DepartmentsScreen({ onOpenTeam }?: DepartmentsScreenProps): react.JSX.Element;
|
|
180
|
+
|
|
181
|
+
interface RoleTreeScreenProps {
|
|
182
|
+
/** Jump to the roles & permissions matrix. */
|
|
183
|
+
onOpenRoles?: () => void;
|
|
184
|
+
}
|
|
185
|
+
declare function RoleTreeScreen({ onOpenRoles }?: RoleTreeScreenProps): react.JSX.Element;
|
|
186
|
+
|
|
187
|
+
declare function TasksScreen(): react.JSX.Element;
|
|
188
|
+
|
|
189
|
+
interface AuditScreenProps {
|
|
190
|
+
/** Pre-filter the trail by actor (set from the user detail drawer). */
|
|
191
|
+
initialActor?: string;
|
|
192
|
+
}
|
|
193
|
+
declare function AuditScreen({ initialActor }?: AuditScreenProps): react.JSX.Element;
|
|
194
|
+
|
|
195
|
+
type UserStatus = "Active" | "Invited" | "Suspended" | "Locked";
|
|
196
|
+
type RoleId = "Owner" | "Admin" | "Manager" | "Editor" | "Viewer" | "Support";
|
|
197
|
+
interface UserSession {
|
|
198
|
+
id: string;
|
|
199
|
+
device: string;
|
|
200
|
+
icon: string;
|
|
201
|
+
browser: string;
|
|
202
|
+
ip: string;
|
|
203
|
+
location: string;
|
|
204
|
+
lastActive: string;
|
|
205
|
+
current?: boolean;
|
|
206
|
+
}
|
|
207
|
+
interface UserActivity {
|
|
208
|
+
id: string;
|
|
209
|
+
at: string;
|
|
210
|
+
action: "create" | "update" | "delete" | "login" | "export" | "permission";
|
|
211
|
+
target: string;
|
|
212
|
+
ip: string;
|
|
213
|
+
result: "success" | "failed" | "blocked";
|
|
214
|
+
}
|
|
215
|
+
interface PermissionOverride {
|
|
216
|
+
id: string;
|
|
217
|
+
permission: string;
|
|
218
|
+
/** Allow grants a permission the roles don't; deny removes one they grant. */
|
|
219
|
+
effect: "allow" | "deny";
|
|
220
|
+
}
|
|
221
|
+
interface DemoUser {
|
|
222
|
+
id: string;
|
|
223
|
+
name: string;
|
|
224
|
+
email: string;
|
|
225
|
+
title: string;
|
|
226
|
+
avatarColor: "blue" | "purple" | "green" | "orange" | "gray";
|
|
227
|
+
/** Department id — see DEPARTMENTS. */
|
|
228
|
+
department: string;
|
|
229
|
+
manager: string;
|
|
230
|
+
location: string;
|
|
231
|
+
timezone: string;
|
|
232
|
+
roles: RoleId[];
|
|
233
|
+
status: UserStatus;
|
|
234
|
+
twoFA: boolean;
|
|
235
|
+
forcePasswordChange: boolean;
|
|
236
|
+
failedLogins: number;
|
|
237
|
+
lastActive: string;
|
|
238
|
+
createdAt: string;
|
|
239
|
+
passwordChangedAt: string;
|
|
240
|
+
overrides: PermissionOverride[];
|
|
241
|
+
sessions: UserSession[];
|
|
242
|
+
activity: UserActivity[];
|
|
243
|
+
}
|
|
244
|
+
interface DepartmentOption {
|
|
245
|
+
id: string;
|
|
246
|
+
name: string;
|
|
247
|
+
path: string;
|
|
248
|
+
}
|
|
249
|
+
declare const DEPARTMENTS: DepartmentOption[];
|
|
250
|
+
declare const departmentPath: (id: string) => string;
|
|
251
|
+
declare const departmentName: (id: string) => string;
|
|
252
|
+
/** A department plus every descendant — picking a parent filters the whole branch. */
|
|
253
|
+
declare const departmentIdsWithChildren: (id: string) => string[];
|
|
254
|
+
/** Depth of a department in the tree (0 = root). */
|
|
255
|
+
declare const departmentDepth: (id: string) => number;
|
|
256
|
+
/** Direct children of a department (or the roots when `id` is null). */
|
|
257
|
+
declare const departmentChildren: (id: string | null) => DepartmentOption[];
|
|
258
|
+
declare const ROLE_IDS: RoleId[];
|
|
259
|
+
/** Permissions granted by each role (children inherit their parents'). */
|
|
260
|
+
declare const ROLE_PERMISSIONS: Record<RoleId, string[]>;
|
|
261
|
+
declare const ROLE_COLOR: Record<RoleId, ChipColor>;
|
|
262
|
+
/** Every permission the workspace knows about. */
|
|
263
|
+
declare const ALL_PERMISSIONS: string[];
|
|
264
|
+
/** Permissions granted by the user's roles (before overrides). */
|
|
265
|
+
declare const rolePermissions: (roles: RoleId[]) => string[];
|
|
266
|
+
/** Final permission set = role grants + allow overrides − deny overrides. */
|
|
267
|
+
declare const effectivePermissions: (user: DemoUser) => string[];
|
|
268
|
+
declare const USER_STATUS_COLOR: Record<UserStatus, "green" | "blue" | "gray" | "red">;
|
|
269
|
+
declare const USER_STATUSES: UserStatus[];
|
|
270
|
+
declare const INITIAL_USERS: DemoUser[];
|
|
271
|
+
|
|
272
|
+
interface UserDetailDrawerProps {
|
|
273
|
+
user: DemoUser | null;
|
|
274
|
+
onClose: () => void;
|
|
275
|
+
/** Persist changes back into the list. */
|
|
276
|
+
onChange: (user: DemoUser) => void;
|
|
277
|
+
/** Jump to the audit log filtered by this user. */
|
|
278
|
+
onOpenAudit?: (actor: string) => void;
|
|
279
|
+
/** Jump to the roles & permissions matrix. */
|
|
280
|
+
onOpenRoles?: () => void;
|
|
281
|
+
/** Jump to the departments tree. */
|
|
282
|
+
onOpenDepartments?: () => void;
|
|
283
|
+
}
|
|
284
|
+
declare function UserDetailDrawer({ user, onClose, onChange, onOpenAudit, onOpenRoles, onOpenDepartments }: UserDetailDrawerProps): react.JSX.Element;
|
|
285
|
+
|
|
286
|
+
interface DepartmentFilterProps {
|
|
287
|
+
/** Active department id, or `"all"`. */
|
|
288
|
+
value: string;
|
|
289
|
+
onChange: (id: string) => void;
|
|
290
|
+
/** Members used for the per-branch counters. */
|
|
291
|
+
users: DemoUser[];
|
|
292
|
+
}
|
|
293
|
+
declare function DepartmentFilter({ value, onChange, users }: DepartmentFilterProps): react.JSX.Element;
|
|
294
|
+
|
|
295
|
+
/** Every locale the design system ships, as a menu-friendly list. */
|
|
296
|
+
declare const LOCALE_OPTIONS: {
|
|
297
|
+
code: string;
|
|
298
|
+
label: string;
|
|
299
|
+
}[];
|
|
300
|
+
/** Right-to-left locales — the provider flips the whole layout. */
|
|
301
|
+
declare const RTL_LOCALES: string[];
|
|
302
|
+
interface DemoPageCopy {
|
|
303
|
+
title: string;
|
|
304
|
+
subtitle: string;
|
|
305
|
+
}
|
|
306
|
+
interface DemoText {
|
|
307
|
+
nav: Record<string, string>;
|
|
308
|
+
shell: Record<string, string>;
|
|
309
|
+
common: Record<string, string>;
|
|
310
|
+
pages: Record<string, DemoPageCopy>;
|
|
311
|
+
}
|
|
312
|
+
/** Demo copy — add a language by copying a block and translating the strings. */
|
|
313
|
+
declare const DEMO_TEXT: Record<string, DemoText>;
|
|
314
|
+
/** Demo copy for a locale code — falls back to English. */
|
|
315
|
+
declare const demoTextFor: (code: string) => DemoText;
|
|
316
|
+
/** Active demo copy — falls back to English for locales without a dictionary. */
|
|
317
|
+
declare function useDemoText(): DemoText;
|
|
318
|
+
interface PageHeaderProps {
|
|
319
|
+
/** Key into `pages`. */
|
|
320
|
+
page: string;
|
|
321
|
+
/** Right-aligned slot for page actions. */
|
|
322
|
+
extra?: ReactNode;
|
|
323
|
+
}
|
|
324
|
+
/** Localised `<h1>` + subtitle used at the top of every demo screen. */
|
|
325
|
+
declare function PageHeader({ page, extra }: PageHeaderProps): react.JSX.Element;
|
|
326
|
+
|
|
116
327
|
/** Semantic tone → chart color. */
|
|
117
328
|
type ChartTone = "primary" | "success" | "danger" | "info" | "warning" | "feature";
|
|
118
329
|
interface SparklineProps {
|
|
@@ -181,6 +392,46 @@ declare function MiniStat({ label, value, hint, tone }: MiniStatProps): react.JS
|
|
|
181
392
|
|
|
182
393
|
declare function MetronicDashboardTemplate(): react.JSX.Element;
|
|
183
394
|
|
|
184
|
-
|
|
395
|
+
/** Tabs of the settings page. */
|
|
396
|
+
type SettingsSectionKey = "profile" | "account" | "notifications" | "billing" | "api";
|
|
397
|
+
interface SettingsNavItem {
|
|
398
|
+
key: SettingsSectionKey;
|
|
399
|
+
label: string;
|
|
400
|
+
/** Remix Icon class. */
|
|
401
|
+
icon: string;
|
|
402
|
+
/** One-liner used by the page header. */
|
|
403
|
+
description: string;
|
|
404
|
+
}
|
|
405
|
+
declare const SETTINGS_NAV: SettingsNavItem[];
|
|
406
|
+
|
|
407
|
+
interface ProfileSectionProps {
|
|
408
|
+
/** Fired whenever the amount of unsaved work changes. */
|
|
409
|
+
onDirtyChange?: (dirty: boolean) => void;
|
|
410
|
+
}
|
|
411
|
+
declare function ProfileSection({ onDirtyChange }: ProfileSectionProps): react.JSX.Element;
|
|
412
|
+
|
|
413
|
+
declare function AccountSection(): react.JSX.Element;
|
|
414
|
+
|
|
415
|
+
interface NotificationsSectionProps {
|
|
416
|
+
/** Fired whenever the amount of unsaved work changes. */
|
|
417
|
+
onDirtyChange?: (dirty: boolean) => void;
|
|
418
|
+
}
|
|
419
|
+
declare function NotificationsSection({ onDirtyChange }: NotificationsSectionProps): react.JSX.Element;
|
|
420
|
+
|
|
421
|
+
declare function BillingSection(): react.JSX.Element;
|
|
422
|
+
|
|
423
|
+
declare function ApiKeysSection(): react.JSX.Element;
|
|
424
|
+
|
|
425
|
+
interface MetronicSettingsTemplateProps {
|
|
426
|
+
/** Controlled active tab. */
|
|
427
|
+
section?: SettingsSectionKey;
|
|
428
|
+
/** Initial tab in uncontrolled mode. Default `"profile"`. */
|
|
429
|
+
defaultSection?: SettingsSectionKey;
|
|
430
|
+
/** Fired when the user picks another tab (controlled mode). */
|
|
431
|
+
onSectionChange?: (section: SettingsSectionKey) => void;
|
|
432
|
+
/** Cap the page column — `"none"` (default) fills the host width. */
|
|
433
|
+
maxWidth?: number | string;
|
|
434
|
+
}
|
|
435
|
+
declare function MetronicSettingsTemplate({ section, defaultSection, onSectionChange, maxWidth, }?: MetronicSettingsTemplateProps): react.JSX.Element;
|
|
185
436
|
|
|
186
|
-
export { AIAssistantTemplate, AgentChatTemplate, AreaChart, type AreaChartProps, BarChart, type BarChartProps, CATEGORIES, CalendarTemplate, type ChartTone, CryptoTemplate, CustomersScreen, DashboardScreen, DashboardTemplate, DonutChart, type DonutChartProps, Kpi, type KpiProps, MarketingTemplate, MetronicDashboardTemplate, type MetronicNavChild, type MetronicNavItem, MetronicSettingsTemplate, MetronicSidebar, type MetronicSidebarProps, MetronicTopBar, MiniStat, type MiniStatProps, OrdersScreen, OverviewScreen, PricingTemplate, type Product, type ProductDraft, type ProductStatus, ProductWizardPage, type ProductWizardPageProps, ProductsScreen, ReportsScreen, type ReportsView, RolesScreen, STATUS_COLOR, SettingsScreen, SettingsTemplate, Sidebar, type SidebarProps, type SidebarUser, Sparkline, type SparklineProps, TopBar, type TopBarProps, UsersScreen, deriveStatus, emptyDraft };
|
|
437
|
+
export { AIAssistantTemplate, ALL_PERMISSIONS, AccountSection, AgentChatTemplate, ApiKeysSection, AreaChart, type AreaChartProps, AuditScreen, type AuditScreenProps, BarChart, type BarChartProps, BillingSection, CATEGORIES, CalendarTemplate, type ChartTone, CryptoTemplate, CustomersScreen, DEMO_SKINS, DEMO_TEXT, DEPARTMENTS, DashboardScreen, type DashboardScreenProps, DashboardTemplate, type DemoNotification, type DemoPageCopy, type DemoSkin, type DemoText, type DemoUser, DepartmentFilter, type DepartmentFilterProps, type DepartmentOption, DepartmentsScreen, type DepartmentsScreenProps, DonutChart, type DonutChartProps, INITIAL_USERS, Kpi, type KpiProps, LOCALE_OPTIONS, MarketingTemplate, MetronicDashboardTemplate, type MetronicNavChild, type MetronicNavItem, MetronicSettingsTemplate, type MetronicSettingsTemplateProps, MetronicSidebar, type MetronicSidebarProps, MetronicTopBar, type MetronicTopBarProps, MiniStat, type MiniStatProps, NotificationsSection, type NotificationsSectionProps, OrdersScreen, type OrdersScreenProps, OverviewScreen, PageHeader, type PageHeaderProps, type PermissionOverride, PricingTemplate, type Product, type ProductDraft, type ProductStatus, ProductWizardPage, type ProductWizardPageProps, ProductsScreen, ProfileSection, type ProfileSectionProps, ROLE_COLOR, ROLE_IDS, ROLE_PERMISSIONS, RTL_LOCALES, ReportsScreen, type ReportsView, type RoleId, RoleTreeScreen, type RoleTreeScreenProps, RolesScreen, SETTINGS_NAV, STATUS_COLOR, type SettingsNavItem, SettingsScreen, type SettingsSectionKey, SettingsTemplate, Sidebar, type SidebarProps, type SidebarUser, Sparkline, type SparklineProps, TasksScreen, TopBar, type TopBarProps, USER_STATUSES, USER_STATUS_COLOR, type UserActivity, UserDetailDrawer, type UserDetailDrawerProps, type UserSession, type UserStatus, UsersScreen, demoTextFor, departmentChildren, departmentDepth, departmentIdsWithChildren, departmentName, departmentPath, deriveStatus, effectivePermissions, emptyDraft, rolePermissions, useDemoText };
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import * as react from 'react';
|
|
2
2
|
import { ReactNode } from 'react';
|
|
3
|
+
import { C as ChipColor } from '../Chip-DiCYJmnv.js';
|
|
3
4
|
|
|
4
5
|
interface SidebarUser {
|
|
5
6
|
name: string;
|
|
@@ -45,15 +46,18 @@ declare function SettingsTemplate(): react.JSX.Element;
|
|
|
45
46
|
|
|
46
47
|
interface MetronicNavChild {
|
|
47
48
|
key: string;
|
|
48
|
-
|
|
49
|
+
/** Optional override — otherwise resolved from the demo dictionary. */
|
|
50
|
+
label?: string;
|
|
49
51
|
}
|
|
50
52
|
interface MetronicNavItem {
|
|
51
53
|
key: string;
|
|
52
|
-
label
|
|
54
|
+
label?: string;
|
|
53
55
|
/** Remix Icon class, e.g. `ri-dashboard-line`. */
|
|
54
56
|
icon: string;
|
|
55
57
|
badge?: string;
|
|
56
58
|
children?: MetronicNavChild[];
|
|
59
|
+
/** Render a hairline above this item (section break). */
|
|
60
|
+
dividerBefore?: boolean;
|
|
57
61
|
}
|
|
58
62
|
interface MetronicSidebarProps {
|
|
59
63
|
/** Active item key. */
|
|
@@ -62,11 +66,56 @@ interface MetronicSidebarProps {
|
|
|
62
66
|
}
|
|
63
67
|
declare function MetronicSidebar({ active, onNavigate }: MetronicSidebarProps): react.JSX.Element;
|
|
64
68
|
|
|
65
|
-
|
|
69
|
+
/** Accent skins shipped by the design system (`data-mode`). */
|
|
70
|
+
declare const DEMO_SKINS: readonly ["metronic", "blue", "purple", "orange", "green", "slate"];
|
|
71
|
+
type DemoSkin = (typeof DEMO_SKINS)[number];
|
|
72
|
+
interface DemoNotification {
|
|
73
|
+
id: string;
|
|
74
|
+
title: string;
|
|
75
|
+
body: string;
|
|
76
|
+
/** ISO timestamp. */
|
|
77
|
+
time: string;
|
|
78
|
+
icon: string;
|
|
79
|
+
tone: "primary" | "success" | "warning" | "error";
|
|
80
|
+
read: boolean;
|
|
81
|
+
}
|
|
82
|
+
interface MetronicTopBarProps {
|
|
83
|
+
/** Open the ⌘K command palette (the search box does this too). */
|
|
84
|
+
onOpenPalette?: () => void;
|
|
85
|
+
/** Platform hint rendered in the search box. */
|
|
86
|
+
paletteHint?: string;
|
|
87
|
+
theme: "light" | "dark";
|
|
88
|
+
onThemeChange?: (theme: "light" | "dark") => void;
|
|
89
|
+
density: "default" | "compact";
|
|
90
|
+
onDensityChange?: (density: "default" | "compact") => void;
|
|
91
|
+
skin: DemoSkin;
|
|
92
|
+
onSkinChange?: (skin: DemoSkin) => void;
|
|
93
|
+
/** Active BCP-47 locale code (`en-US`, `zh-CN`, …). */
|
|
94
|
+
localeCode?: string;
|
|
95
|
+
onLocaleChange?: (code: string) => void;
|
|
96
|
+
notifications?: DemoNotification[];
|
|
97
|
+
onNotificationClick?: (notification: DemoNotification) => void;
|
|
98
|
+
onMarkAllRead?: () => void;
|
|
99
|
+
/** Navigate to another screen. */
|
|
100
|
+
onNavigate?: (key: string) => void;
|
|
101
|
+
/** Opens the create-order dialog. */
|
|
102
|
+
onNewOrder?: () => void;
|
|
103
|
+
/** Sign out (the demo just shows a toast). */
|
|
104
|
+
onSignOut?: () => void;
|
|
105
|
+
}
|
|
106
|
+
declare function MetronicTopBar({ onOpenPalette, paletteHint, theme, onThemeChange, density, onDensityChange, skin, onSkinChange, localeCode, onLocaleChange, notifications, onNotificationClick, onMarkAllRead, onNavigate, onNewOrder, onSignOut, }: MetronicTopBarProps): react.JSX.Element;
|
|
66
107
|
|
|
67
|
-
|
|
108
|
+
interface DashboardScreenProps {
|
|
109
|
+
/** Jump to the orders screen — fired by “View all” and by clicking a recent order. */
|
|
110
|
+
onViewAllOrders?: (orderId?: string) => void;
|
|
111
|
+
}
|
|
112
|
+
declare function DashboardScreen({ onViewAllOrders }?: DashboardScreenProps): react.JSX.Element;
|
|
68
113
|
|
|
69
|
-
|
|
114
|
+
interface OrdersScreenProps {
|
|
115
|
+
/** Bump this counter to pop the create dialog (used by the shell's top bar). */
|
|
116
|
+
createRequest?: number;
|
|
117
|
+
}
|
|
118
|
+
declare function OrdersScreen({ createRequest }: OrdersScreenProps): react.JSX.Element;
|
|
70
119
|
|
|
71
120
|
declare function ProductsScreen(): react.JSX.Element;
|
|
72
121
|
|
|
@@ -104,7 +153,17 @@ declare function ProductWizardPage({ mode, initial, onCancel, onSave }: ProductW
|
|
|
104
153
|
|
|
105
154
|
declare function CustomersScreen(): react.JSX.Element;
|
|
106
155
|
|
|
107
|
-
|
|
156
|
+
interface UsersScreenProps {
|
|
157
|
+
/** Pre-filter the list by department (used by the departments screen). */
|
|
158
|
+
initialDepartment?: string;
|
|
159
|
+
/** Open the audit log filtered by this member. */
|
|
160
|
+
onOpenAudit?: (actor: string) => void;
|
|
161
|
+
/** Jump to the roles & permissions matrix. */
|
|
162
|
+
onOpenRoles?: () => void;
|
|
163
|
+
/** Jump to the departments tree. */
|
|
164
|
+
onOpenDepartments?: () => void;
|
|
165
|
+
}
|
|
166
|
+
declare function UsersScreen({ initialDepartment, onOpenAudit, onOpenRoles, onOpenDepartments }?: UsersScreenProps): react.JSX.Element;
|
|
108
167
|
|
|
109
168
|
declare function RolesScreen(): react.JSX.Element;
|
|
110
169
|
|
|
@@ -113,6 +172,158 @@ declare function ReportsScreen({ view }: {
|
|
|
113
172
|
view?: ReportsView;
|
|
114
173
|
}): react.JSX.Element;
|
|
115
174
|
|
|
175
|
+
interface DepartmentsScreenProps {
|
|
176
|
+
/** Jump to the team page (the drawer links to members), focused on a department. */
|
|
177
|
+
onOpenTeam?: (departmentName?: string) => void;
|
|
178
|
+
}
|
|
179
|
+
declare function DepartmentsScreen({ onOpenTeam }?: DepartmentsScreenProps): react.JSX.Element;
|
|
180
|
+
|
|
181
|
+
interface RoleTreeScreenProps {
|
|
182
|
+
/** Jump to the roles & permissions matrix. */
|
|
183
|
+
onOpenRoles?: () => void;
|
|
184
|
+
}
|
|
185
|
+
declare function RoleTreeScreen({ onOpenRoles }?: RoleTreeScreenProps): react.JSX.Element;
|
|
186
|
+
|
|
187
|
+
declare function TasksScreen(): react.JSX.Element;
|
|
188
|
+
|
|
189
|
+
interface AuditScreenProps {
|
|
190
|
+
/** Pre-filter the trail by actor (set from the user detail drawer). */
|
|
191
|
+
initialActor?: string;
|
|
192
|
+
}
|
|
193
|
+
declare function AuditScreen({ initialActor }?: AuditScreenProps): react.JSX.Element;
|
|
194
|
+
|
|
195
|
+
type UserStatus = "Active" | "Invited" | "Suspended" | "Locked";
|
|
196
|
+
type RoleId = "Owner" | "Admin" | "Manager" | "Editor" | "Viewer" | "Support";
|
|
197
|
+
interface UserSession {
|
|
198
|
+
id: string;
|
|
199
|
+
device: string;
|
|
200
|
+
icon: string;
|
|
201
|
+
browser: string;
|
|
202
|
+
ip: string;
|
|
203
|
+
location: string;
|
|
204
|
+
lastActive: string;
|
|
205
|
+
current?: boolean;
|
|
206
|
+
}
|
|
207
|
+
interface UserActivity {
|
|
208
|
+
id: string;
|
|
209
|
+
at: string;
|
|
210
|
+
action: "create" | "update" | "delete" | "login" | "export" | "permission";
|
|
211
|
+
target: string;
|
|
212
|
+
ip: string;
|
|
213
|
+
result: "success" | "failed" | "blocked";
|
|
214
|
+
}
|
|
215
|
+
interface PermissionOverride {
|
|
216
|
+
id: string;
|
|
217
|
+
permission: string;
|
|
218
|
+
/** Allow grants a permission the roles don't; deny removes one they grant. */
|
|
219
|
+
effect: "allow" | "deny";
|
|
220
|
+
}
|
|
221
|
+
interface DemoUser {
|
|
222
|
+
id: string;
|
|
223
|
+
name: string;
|
|
224
|
+
email: string;
|
|
225
|
+
title: string;
|
|
226
|
+
avatarColor: "blue" | "purple" | "green" | "orange" | "gray";
|
|
227
|
+
/** Department id — see DEPARTMENTS. */
|
|
228
|
+
department: string;
|
|
229
|
+
manager: string;
|
|
230
|
+
location: string;
|
|
231
|
+
timezone: string;
|
|
232
|
+
roles: RoleId[];
|
|
233
|
+
status: UserStatus;
|
|
234
|
+
twoFA: boolean;
|
|
235
|
+
forcePasswordChange: boolean;
|
|
236
|
+
failedLogins: number;
|
|
237
|
+
lastActive: string;
|
|
238
|
+
createdAt: string;
|
|
239
|
+
passwordChangedAt: string;
|
|
240
|
+
overrides: PermissionOverride[];
|
|
241
|
+
sessions: UserSession[];
|
|
242
|
+
activity: UserActivity[];
|
|
243
|
+
}
|
|
244
|
+
interface DepartmentOption {
|
|
245
|
+
id: string;
|
|
246
|
+
name: string;
|
|
247
|
+
path: string;
|
|
248
|
+
}
|
|
249
|
+
declare const DEPARTMENTS: DepartmentOption[];
|
|
250
|
+
declare const departmentPath: (id: string) => string;
|
|
251
|
+
declare const departmentName: (id: string) => string;
|
|
252
|
+
/** A department plus every descendant — picking a parent filters the whole branch. */
|
|
253
|
+
declare const departmentIdsWithChildren: (id: string) => string[];
|
|
254
|
+
/** Depth of a department in the tree (0 = root). */
|
|
255
|
+
declare const departmentDepth: (id: string) => number;
|
|
256
|
+
/** Direct children of a department (or the roots when `id` is null). */
|
|
257
|
+
declare const departmentChildren: (id: string | null) => DepartmentOption[];
|
|
258
|
+
declare const ROLE_IDS: RoleId[];
|
|
259
|
+
/** Permissions granted by each role (children inherit their parents'). */
|
|
260
|
+
declare const ROLE_PERMISSIONS: Record<RoleId, string[]>;
|
|
261
|
+
declare const ROLE_COLOR: Record<RoleId, ChipColor>;
|
|
262
|
+
/** Every permission the workspace knows about. */
|
|
263
|
+
declare const ALL_PERMISSIONS: string[];
|
|
264
|
+
/** Permissions granted by the user's roles (before overrides). */
|
|
265
|
+
declare const rolePermissions: (roles: RoleId[]) => string[];
|
|
266
|
+
/** Final permission set = role grants + allow overrides − deny overrides. */
|
|
267
|
+
declare const effectivePermissions: (user: DemoUser) => string[];
|
|
268
|
+
declare const USER_STATUS_COLOR: Record<UserStatus, "green" | "blue" | "gray" | "red">;
|
|
269
|
+
declare const USER_STATUSES: UserStatus[];
|
|
270
|
+
declare const INITIAL_USERS: DemoUser[];
|
|
271
|
+
|
|
272
|
+
interface UserDetailDrawerProps {
|
|
273
|
+
user: DemoUser | null;
|
|
274
|
+
onClose: () => void;
|
|
275
|
+
/** Persist changes back into the list. */
|
|
276
|
+
onChange: (user: DemoUser) => void;
|
|
277
|
+
/** Jump to the audit log filtered by this user. */
|
|
278
|
+
onOpenAudit?: (actor: string) => void;
|
|
279
|
+
/** Jump to the roles & permissions matrix. */
|
|
280
|
+
onOpenRoles?: () => void;
|
|
281
|
+
/** Jump to the departments tree. */
|
|
282
|
+
onOpenDepartments?: () => void;
|
|
283
|
+
}
|
|
284
|
+
declare function UserDetailDrawer({ user, onClose, onChange, onOpenAudit, onOpenRoles, onOpenDepartments }: UserDetailDrawerProps): react.JSX.Element;
|
|
285
|
+
|
|
286
|
+
interface DepartmentFilterProps {
|
|
287
|
+
/** Active department id, or `"all"`. */
|
|
288
|
+
value: string;
|
|
289
|
+
onChange: (id: string) => void;
|
|
290
|
+
/** Members used for the per-branch counters. */
|
|
291
|
+
users: DemoUser[];
|
|
292
|
+
}
|
|
293
|
+
declare function DepartmentFilter({ value, onChange, users }: DepartmentFilterProps): react.JSX.Element;
|
|
294
|
+
|
|
295
|
+
/** Every locale the design system ships, as a menu-friendly list. */
|
|
296
|
+
declare const LOCALE_OPTIONS: {
|
|
297
|
+
code: string;
|
|
298
|
+
label: string;
|
|
299
|
+
}[];
|
|
300
|
+
/** Right-to-left locales — the provider flips the whole layout. */
|
|
301
|
+
declare const RTL_LOCALES: string[];
|
|
302
|
+
interface DemoPageCopy {
|
|
303
|
+
title: string;
|
|
304
|
+
subtitle: string;
|
|
305
|
+
}
|
|
306
|
+
interface DemoText {
|
|
307
|
+
nav: Record<string, string>;
|
|
308
|
+
shell: Record<string, string>;
|
|
309
|
+
common: Record<string, string>;
|
|
310
|
+
pages: Record<string, DemoPageCopy>;
|
|
311
|
+
}
|
|
312
|
+
/** Demo copy — add a language by copying a block and translating the strings. */
|
|
313
|
+
declare const DEMO_TEXT: Record<string, DemoText>;
|
|
314
|
+
/** Demo copy for a locale code — falls back to English. */
|
|
315
|
+
declare const demoTextFor: (code: string) => DemoText;
|
|
316
|
+
/** Active demo copy — falls back to English for locales without a dictionary. */
|
|
317
|
+
declare function useDemoText(): DemoText;
|
|
318
|
+
interface PageHeaderProps {
|
|
319
|
+
/** Key into `pages`. */
|
|
320
|
+
page: string;
|
|
321
|
+
/** Right-aligned slot for page actions. */
|
|
322
|
+
extra?: ReactNode;
|
|
323
|
+
}
|
|
324
|
+
/** Localised `<h1>` + subtitle used at the top of every demo screen. */
|
|
325
|
+
declare function PageHeader({ page, extra }: PageHeaderProps): react.JSX.Element;
|
|
326
|
+
|
|
116
327
|
/** Semantic tone → chart color. */
|
|
117
328
|
type ChartTone = "primary" | "success" | "danger" | "info" | "warning" | "feature";
|
|
118
329
|
interface SparklineProps {
|
|
@@ -181,6 +392,46 @@ declare function MiniStat({ label, value, hint, tone }: MiniStatProps): react.JS
|
|
|
181
392
|
|
|
182
393
|
declare function MetronicDashboardTemplate(): react.JSX.Element;
|
|
183
394
|
|
|
184
|
-
|
|
395
|
+
/** Tabs of the settings page. */
|
|
396
|
+
type SettingsSectionKey = "profile" | "account" | "notifications" | "billing" | "api";
|
|
397
|
+
interface SettingsNavItem {
|
|
398
|
+
key: SettingsSectionKey;
|
|
399
|
+
label: string;
|
|
400
|
+
/** Remix Icon class. */
|
|
401
|
+
icon: string;
|
|
402
|
+
/** One-liner used by the page header. */
|
|
403
|
+
description: string;
|
|
404
|
+
}
|
|
405
|
+
declare const SETTINGS_NAV: SettingsNavItem[];
|
|
406
|
+
|
|
407
|
+
interface ProfileSectionProps {
|
|
408
|
+
/** Fired whenever the amount of unsaved work changes. */
|
|
409
|
+
onDirtyChange?: (dirty: boolean) => void;
|
|
410
|
+
}
|
|
411
|
+
declare function ProfileSection({ onDirtyChange }: ProfileSectionProps): react.JSX.Element;
|
|
412
|
+
|
|
413
|
+
declare function AccountSection(): react.JSX.Element;
|
|
414
|
+
|
|
415
|
+
interface NotificationsSectionProps {
|
|
416
|
+
/** Fired whenever the amount of unsaved work changes. */
|
|
417
|
+
onDirtyChange?: (dirty: boolean) => void;
|
|
418
|
+
}
|
|
419
|
+
declare function NotificationsSection({ onDirtyChange }: NotificationsSectionProps): react.JSX.Element;
|
|
420
|
+
|
|
421
|
+
declare function BillingSection(): react.JSX.Element;
|
|
422
|
+
|
|
423
|
+
declare function ApiKeysSection(): react.JSX.Element;
|
|
424
|
+
|
|
425
|
+
interface MetronicSettingsTemplateProps {
|
|
426
|
+
/** Controlled active tab. */
|
|
427
|
+
section?: SettingsSectionKey;
|
|
428
|
+
/** Initial tab in uncontrolled mode. Default `"profile"`. */
|
|
429
|
+
defaultSection?: SettingsSectionKey;
|
|
430
|
+
/** Fired when the user picks another tab (controlled mode). */
|
|
431
|
+
onSectionChange?: (section: SettingsSectionKey) => void;
|
|
432
|
+
/** Cap the page column — `"none"` (default) fills the host width. */
|
|
433
|
+
maxWidth?: number | string;
|
|
434
|
+
}
|
|
435
|
+
declare function MetronicSettingsTemplate({ section, defaultSection, onSectionChange, maxWidth, }?: MetronicSettingsTemplateProps): react.JSX.Element;
|
|
185
436
|
|
|
186
|
-
export { AIAssistantTemplate, AgentChatTemplate, AreaChart, type AreaChartProps, BarChart, type BarChartProps, CATEGORIES, CalendarTemplate, type ChartTone, CryptoTemplate, CustomersScreen, DashboardScreen, DashboardTemplate, DonutChart, type DonutChartProps, Kpi, type KpiProps, MarketingTemplate, MetronicDashboardTemplate, type MetronicNavChild, type MetronicNavItem, MetronicSettingsTemplate, MetronicSidebar, type MetronicSidebarProps, MetronicTopBar, MiniStat, type MiniStatProps, OrdersScreen, OverviewScreen, PricingTemplate, type Product, type ProductDraft, type ProductStatus, ProductWizardPage, type ProductWizardPageProps, ProductsScreen, ReportsScreen, type ReportsView, RolesScreen, STATUS_COLOR, SettingsScreen, SettingsTemplate, Sidebar, type SidebarProps, type SidebarUser, Sparkline, type SparklineProps, TopBar, type TopBarProps, UsersScreen, deriveStatus, emptyDraft };
|
|
437
|
+
export { AIAssistantTemplate, ALL_PERMISSIONS, AccountSection, AgentChatTemplate, ApiKeysSection, AreaChart, type AreaChartProps, AuditScreen, type AuditScreenProps, BarChart, type BarChartProps, BillingSection, CATEGORIES, CalendarTemplate, type ChartTone, CryptoTemplate, CustomersScreen, DEMO_SKINS, DEMO_TEXT, DEPARTMENTS, DashboardScreen, type DashboardScreenProps, DashboardTemplate, type DemoNotification, type DemoPageCopy, type DemoSkin, type DemoText, type DemoUser, DepartmentFilter, type DepartmentFilterProps, type DepartmentOption, DepartmentsScreen, type DepartmentsScreenProps, DonutChart, type DonutChartProps, INITIAL_USERS, Kpi, type KpiProps, LOCALE_OPTIONS, MarketingTemplate, MetronicDashboardTemplate, type MetronicNavChild, type MetronicNavItem, MetronicSettingsTemplate, type MetronicSettingsTemplateProps, MetronicSidebar, type MetronicSidebarProps, MetronicTopBar, type MetronicTopBarProps, MiniStat, type MiniStatProps, NotificationsSection, type NotificationsSectionProps, OrdersScreen, type OrdersScreenProps, OverviewScreen, PageHeader, type PageHeaderProps, type PermissionOverride, PricingTemplate, type Product, type ProductDraft, type ProductStatus, ProductWizardPage, type ProductWizardPageProps, ProductsScreen, ProfileSection, type ProfileSectionProps, ROLE_COLOR, ROLE_IDS, ROLE_PERMISSIONS, RTL_LOCALES, ReportsScreen, type ReportsView, type RoleId, RoleTreeScreen, type RoleTreeScreenProps, RolesScreen, SETTINGS_NAV, STATUS_COLOR, type SettingsNavItem, SettingsScreen, type SettingsSectionKey, SettingsTemplate, Sidebar, type SidebarProps, type SidebarUser, Sparkline, type SparklineProps, TasksScreen, TopBar, type TopBarProps, USER_STATUSES, USER_STATUS_COLOR, type UserActivity, UserDetailDrawer, type UserDetailDrawerProps, type UserSession, type UserStatus, UsersScreen, demoTextFor, departmentChildren, departmentDepth, departmentIdsWithChildren, departmentName, departmentPath, deriveStatus, effectivePermissions, emptyDraft, rolePermissions, useDemoText };
|