klun-ui 0.3.0 → 0.4.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.
@@ -58,13 +58,24 @@ interface MetronicNavItem {
58
58
  children?: MetronicNavChild[];
59
59
  /** Render a hairline above this item (section break). */
60
60
  dividerBefore?: boolean;
61
+ /** The current role can't open this screen — shown with a lock and routed to a 403. */
62
+ locked?: boolean;
61
63
  }
62
64
  interface MetronicSidebarProps {
63
65
  /** Active item key. */
64
66
  active: string;
65
67
  onNavigate: (key: string) => void;
66
- }
67
- declare function MetronicSidebar({ active, onNavigate }: MetronicSidebarProps): react.JSX.Element;
68
+ /** Live badges overriding the static ones, e.g. `{ messages: "3" }`. */
69
+ badges?: Record<string, string | number | undefined>;
70
+ /** Keys the current role can't access — rendered with a lock. */
71
+ lockedKeys?: string[];
72
+ /** Icon-only rail. */
73
+ collapsed?: boolean;
74
+ onToggleCollapsed?: () => void;
75
+ /** Role shown in the user card. */
76
+ roleLabel?: string;
77
+ }
78
+ declare function MetronicSidebar({ active, onNavigate, badges, lockedKeys, collapsed, onToggleCollapsed, roleLabel }: MetronicSidebarProps): react.JSX.Element;
68
79
 
69
80
  /** Accent skins shipped by the design system (`data-mode`). */
70
81
  declare const DEMO_SKINS: readonly ["metronic", "blue", "purple", "orange", "green", "slate"];
@@ -192,6 +203,94 @@ interface AuditScreenProps {
192
203
  }
193
204
  declare function AuditScreen({ initialActor }?: AuditScreenProps): react.JSX.Element;
194
205
 
206
+ interface MessagesScreenProps {
207
+ /** Total unread in the inbox — drives the sidebar badge. */
208
+ onUnreadChange?: (unread: number) => void;
209
+ }
210
+ declare function MessagesScreen({ onUnreadChange }?: MessagesScreenProps): react.JSX.Element;
211
+
212
+ interface ApprovalsScreenProps {
213
+ /** Jump to the audit log filtered by the requester of the decision. */
214
+ onOpenAudit?: (requester: string) => void;
215
+ }
216
+ declare function ApprovalsScreen({ onOpenAudit }?: ApprovalsScreenProps): react.JSX.Element;
217
+
218
+ interface TicketsScreenProps {
219
+ /** Quick jump into the audit log for this requester. */
220
+ onOpenAudit?: (actor: string) => void;
221
+ }
222
+ declare function TicketsScreen({ onOpenAudit }?: TicketsScreenProps): react.JSX.Element;
223
+
224
+ declare function CalendarScreen(): react.JSX.Element;
225
+
226
+ interface SearchScreenProps {
227
+ /** Jump to the screen owning a hit. */
228
+ onNavigate?: (key: string) => void;
229
+ }
230
+ declare function SearchScreen({ onNavigate }?: SearchScreenProps): react.JSX.Element;
231
+
232
+ interface WorkspaceSecurityScreenProps {
233
+ /** Forward the admin to the audit log filtered by this actor. */
234
+ onOpenAudit?: (actor: string) => void;
235
+ }
236
+ declare function WorkspaceSecurityScreen({ onOpenAudit }?: WorkspaceSecurityScreenProps): react.JSX.Element;
237
+
238
+ interface IntegrationsScreenProps {
239
+ onOpenAudit?: (actor: string) => void;
240
+ }
241
+ declare function IntegrationsScreen({ onOpenAudit }?: IntegrationsScreenProps): react.JSX.Element;
242
+
243
+ declare function FeatureFlagsScreen(): react.JSX.Element;
244
+
245
+ declare function TemplatesScreen(): react.JSX.Element;
246
+
247
+ declare function ImportExportScreen(): react.JSX.Element;
248
+
249
+ type MailFolder = "inbox" | "sent" | "drafts" | "archived";
250
+ type MailView = MailFolder | "starred";
251
+ declare const FOLDER_LABELS: Record<MailFolder, string>;
252
+ declare const FOLDER_ICONS: Record<MailFolder, string>;
253
+ declare const MAIL_LABELS: readonly ["Finance", "Design", "Support", "Engineering", "Alerts", "Product"];
254
+ type MailLabel = (typeof MAIL_LABELS)[number];
255
+ declare const LABEL_COLOR: Record<MailLabel, "blue" | "purple" | "orange" | "teal" | "red" | "green">;
256
+ interface MailAttachment {
257
+ id: string;
258
+ name: string;
259
+ size: string;
260
+ icon: string;
261
+ }
262
+ interface MailMessage {
263
+ id: string;
264
+ /** Sender display name — `"You"` for the signed-in user. */
265
+ from: string;
266
+ to: string[];
267
+ cc?: string[];
268
+ at: string;
269
+ body: string;
270
+ attachments?: MailAttachment[];
271
+ }
272
+ interface MailThread {
273
+ id: string;
274
+ subject: string;
275
+ folder: MailFolder;
276
+ labels: MailLabel[];
277
+ starred: boolean;
278
+ priority: "normal" | "high";
279
+ updatedAt: string;
280
+ /** Unread messages for the signed-in user. */
281
+ unread: number;
282
+ messages: MailMessage[];
283
+ }
284
+ /** Teammates you can write to (everyone except yourself). */
285
+ declare const RECIPIENTS: {
286
+ name: string;
287
+ email: string;
288
+ title: string;
289
+ department: string;
290
+ }[];
291
+ declare const INITIAL_THREADS: MailThread[];
292
+ declare const totalUnread: (threads: MailThread[]) => number;
293
+
195
294
  type UserStatus = "Active" | "Invited" | "Suspended" | "Locked";
196
295
  type RoleId = "Owner" | "Admin" | "Manager" | "Editor" | "Viewer" | "Support";
197
296
  interface UserSession {
@@ -434,4 +533,4 @@ interface MetronicSettingsTemplateProps {
434
533
  }
435
534
  declare function MetronicSettingsTemplate({ section, defaultSection, onSectionChange, maxWidth, }?: MetronicSettingsTemplateProps): react.JSX.Element;
436
535
 
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 };
536
+ export { AIAssistantTemplate, ALL_PERMISSIONS, AccountSection, AgentChatTemplate, ApiKeysSection, ApprovalsScreen, type ApprovalsScreenProps, AreaChart, type AreaChartProps, AuditScreen, type AuditScreenProps, BarChart, type BarChartProps, BillingSection, CATEGORIES, CalendarScreen, 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, FOLDER_ICONS, FOLDER_LABELS, FeatureFlagsScreen, INITIAL_THREADS, INITIAL_USERS, ImportExportScreen, IntegrationsScreen, type IntegrationsScreenProps, Kpi, type KpiProps, LABEL_COLOR, LOCALE_OPTIONS, MAIL_LABELS, type MailAttachment, type MailFolder, type MailLabel, type MailMessage, type MailThread, type MailView, MarketingTemplate, MessagesScreen, type MessagesScreenProps, 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, RECIPIENTS, ROLE_COLOR, ROLE_IDS, ROLE_PERMISSIONS, RTL_LOCALES, ReportsScreen, type ReportsView, type RoleId, RoleTreeScreen, type RoleTreeScreenProps, RolesScreen, SETTINGS_NAV, STATUS_COLOR, SearchScreen, type SearchScreenProps, type SettingsNavItem, SettingsScreen, type SettingsSectionKey, SettingsTemplate, Sidebar, type SidebarProps, type SidebarUser, Sparkline, type SparklineProps, TasksScreen, TemplatesScreen, TicketsScreen, type TicketsScreenProps, TopBar, type TopBarProps, USER_STATUSES, USER_STATUS_COLOR, type UserActivity, UserDetailDrawer, type UserDetailDrawerProps, type UserSession, type UserStatus, UsersScreen, WorkspaceSecurityScreen, type WorkspaceSecurityScreenProps, demoTextFor, departmentChildren, departmentDepth, departmentIdsWithChildren, departmentName, departmentPath, deriveStatus, effectivePermissions, emptyDraft, rolePermissions, totalUnread, useDemoText };
@@ -58,13 +58,24 @@ interface MetronicNavItem {
58
58
  children?: MetronicNavChild[];
59
59
  /** Render a hairline above this item (section break). */
60
60
  dividerBefore?: boolean;
61
+ /** The current role can't open this screen — shown with a lock and routed to a 403. */
62
+ locked?: boolean;
61
63
  }
62
64
  interface MetronicSidebarProps {
63
65
  /** Active item key. */
64
66
  active: string;
65
67
  onNavigate: (key: string) => void;
66
- }
67
- declare function MetronicSidebar({ active, onNavigate }: MetronicSidebarProps): react.JSX.Element;
68
+ /** Live badges overriding the static ones, e.g. `{ messages: "3" }`. */
69
+ badges?: Record<string, string | number | undefined>;
70
+ /** Keys the current role can't access — rendered with a lock. */
71
+ lockedKeys?: string[];
72
+ /** Icon-only rail. */
73
+ collapsed?: boolean;
74
+ onToggleCollapsed?: () => void;
75
+ /** Role shown in the user card. */
76
+ roleLabel?: string;
77
+ }
78
+ declare function MetronicSidebar({ active, onNavigate, badges, lockedKeys, collapsed, onToggleCollapsed, roleLabel }: MetronicSidebarProps): react.JSX.Element;
68
79
 
69
80
  /** Accent skins shipped by the design system (`data-mode`). */
70
81
  declare const DEMO_SKINS: readonly ["metronic", "blue", "purple", "orange", "green", "slate"];
@@ -192,6 +203,94 @@ interface AuditScreenProps {
192
203
  }
193
204
  declare function AuditScreen({ initialActor }?: AuditScreenProps): react.JSX.Element;
194
205
 
206
+ interface MessagesScreenProps {
207
+ /** Total unread in the inbox — drives the sidebar badge. */
208
+ onUnreadChange?: (unread: number) => void;
209
+ }
210
+ declare function MessagesScreen({ onUnreadChange }?: MessagesScreenProps): react.JSX.Element;
211
+
212
+ interface ApprovalsScreenProps {
213
+ /** Jump to the audit log filtered by the requester of the decision. */
214
+ onOpenAudit?: (requester: string) => void;
215
+ }
216
+ declare function ApprovalsScreen({ onOpenAudit }?: ApprovalsScreenProps): react.JSX.Element;
217
+
218
+ interface TicketsScreenProps {
219
+ /** Quick jump into the audit log for this requester. */
220
+ onOpenAudit?: (actor: string) => void;
221
+ }
222
+ declare function TicketsScreen({ onOpenAudit }?: TicketsScreenProps): react.JSX.Element;
223
+
224
+ declare function CalendarScreen(): react.JSX.Element;
225
+
226
+ interface SearchScreenProps {
227
+ /** Jump to the screen owning a hit. */
228
+ onNavigate?: (key: string) => void;
229
+ }
230
+ declare function SearchScreen({ onNavigate }?: SearchScreenProps): react.JSX.Element;
231
+
232
+ interface WorkspaceSecurityScreenProps {
233
+ /** Forward the admin to the audit log filtered by this actor. */
234
+ onOpenAudit?: (actor: string) => void;
235
+ }
236
+ declare function WorkspaceSecurityScreen({ onOpenAudit }?: WorkspaceSecurityScreenProps): react.JSX.Element;
237
+
238
+ interface IntegrationsScreenProps {
239
+ onOpenAudit?: (actor: string) => void;
240
+ }
241
+ declare function IntegrationsScreen({ onOpenAudit }?: IntegrationsScreenProps): react.JSX.Element;
242
+
243
+ declare function FeatureFlagsScreen(): react.JSX.Element;
244
+
245
+ declare function TemplatesScreen(): react.JSX.Element;
246
+
247
+ declare function ImportExportScreen(): react.JSX.Element;
248
+
249
+ type MailFolder = "inbox" | "sent" | "drafts" | "archived";
250
+ type MailView = MailFolder | "starred";
251
+ declare const FOLDER_LABELS: Record<MailFolder, string>;
252
+ declare const FOLDER_ICONS: Record<MailFolder, string>;
253
+ declare const MAIL_LABELS: readonly ["Finance", "Design", "Support", "Engineering", "Alerts", "Product"];
254
+ type MailLabel = (typeof MAIL_LABELS)[number];
255
+ declare const LABEL_COLOR: Record<MailLabel, "blue" | "purple" | "orange" | "teal" | "red" | "green">;
256
+ interface MailAttachment {
257
+ id: string;
258
+ name: string;
259
+ size: string;
260
+ icon: string;
261
+ }
262
+ interface MailMessage {
263
+ id: string;
264
+ /** Sender display name — `"You"` for the signed-in user. */
265
+ from: string;
266
+ to: string[];
267
+ cc?: string[];
268
+ at: string;
269
+ body: string;
270
+ attachments?: MailAttachment[];
271
+ }
272
+ interface MailThread {
273
+ id: string;
274
+ subject: string;
275
+ folder: MailFolder;
276
+ labels: MailLabel[];
277
+ starred: boolean;
278
+ priority: "normal" | "high";
279
+ updatedAt: string;
280
+ /** Unread messages for the signed-in user. */
281
+ unread: number;
282
+ messages: MailMessage[];
283
+ }
284
+ /** Teammates you can write to (everyone except yourself). */
285
+ declare const RECIPIENTS: {
286
+ name: string;
287
+ email: string;
288
+ title: string;
289
+ department: string;
290
+ }[];
291
+ declare const INITIAL_THREADS: MailThread[];
292
+ declare const totalUnread: (threads: MailThread[]) => number;
293
+
195
294
  type UserStatus = "Active" | "Invited" | "Suspended" | "Locked";
196
295
  type RoleId = "Owner" | "Admin" | "Manager" | "Editor" | "Viewer" | "Support";
197
296
  interface UserSession {
@@ -434,4 +533,4 @@ interface MetronicSettingsTemplateProps {
434
533
  }
435
534
  declare function MetronicSettingsTemplate({ section, defaultSection, onSectionChange, maxWidth, }?: MetronicSettingsTemplateProps): react.JSX.Element;
436
535
 
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 };
536
+ export { AIAssistantTemplate, ALL_PERMISSIONS, AccountSection, AgentChatTemplate, ApiKeysSection, ApprovalsScreen, type ApprovalsScreenProps, AreaChart, type AreaChartProps, AuditScreen, type AuditScreenProps, BarChart, type BarChartProps, BillingSection, CATEGORIES, CalendarScreen, 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, FOLDER_ICONS, FOLDER_LABELS, FeatureFlagsScreen, INITIAL_THREADS, INITIAL_USERS, ImportExportScreen, IntegrationsScreen, type IntegrationsScreenProps, Kpi, type KpiProps, LABEL_COLOR, LOCALE_OPTIONS, MAIL_LABELS, type MailAttachment, type MailFolder, type MailLabel, type MailMessage, type MailThread, type MailView, MarketingTemplate, MessagesScreen, type MessagesScreenProps, 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, RECIPIENTS, ROLE_COLOR, ROLE_IDS, ROLE_PERMISSIONS, RTL_LOCALES, ReportsScreen, type ReportsView, type RoleId, RoleTreeScreen, type RoleTreeScreenProps, RolesScreen, SETTINGS_NAV, STATUS_COLOR, SearchScreen, type SearchScreenProps, type SettingsNavItem, SettingsScreen, type SettingsSectionKey, SettingsTemplate, Sidebar, type SidebarProps, type SidebarUser, Sparkline, type SparklineProps, TasksScreen, TemplatesScreen, TicketsScreen, type TicketsScreenProps, TopBar, type TopBarProps, USER_STATUSES, USER_STATUS_COLOR, type UserActivity, UserDetailDrawer, type UserDetailDrawerProps, type UserSession, type UserStatus, UsersScreen, WorkspaceSecurityScreen, type WorkspaceSecurityScreenProps, demoTextFor, departmentChildren, departmentDepth, departmentIdsWithChildren, departmentName, departmentPath, deriveStatus, effectivePermissions, emptyDraft, rolePermissions, totalUnread, useDemoText };