@biza-gov/layout 0.0.0-stage → 1.3.13
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 +717 -2
- package/dist/index.d.mts +279 -0
- package/dist/index.d.ts +279 -0
- package/dist/index.js +2773 -0
- package/dist/index.js.map +1 -0
- package/dist/index.mjs +2722 -0
- package/dist/index.mjs.map +1 -0
- package/package.json +44 -4
package/dist/index.d.mts
ADDED
|
@@ -0,0 +1,279 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import React$1 from 'react';
|
|
3
|
+
|
|
4
|
+
interface User {
|
|
5
|
+
id?: string | number;
|
|
6
|
+
firstName?: string;
|
|
7
|
+
lastName?: string;
|
|
8
|
+
pictureUrl?: string;
|
|
9
|
+
role?: string;
|
|
10
|
+
}
|
|
11
|
+
interface MenuItem {
|
|
12
|
+
id: string;
|
|
13
|
+
title: string;
|
|
14
|
+
path?: string;
|
|
15
|
+
icon?: React.ReactNode;
|
|
16
|
+
children?: MenuItem[];
|
|
17
|
+
dividerAfter?: boolean;
|
|
18
|
+
}
|
|
19
|
+
interface StaffSidebarProps {
|
|
20
|
+
/** URL รูปตราองค์กร */
|
|
21
|
+
orgLogo?: string;
|
|
22
|
+
/** ชื่อองค์กร */
|
|
23
|
+
orgName: string;
|
|
24
|
+
/** ชื่อรอง เช่น จังหวัด */
|
|
25
|
+
orgSubtitle?: string;
|
|
26
|
+
/** เมนูหลัก */
|
|
27
|
+
menuItems: MenuItem[];
|
|
28
|
+
/** เมนูล่าง เช่น ตั้งค่าระบบ */
|
|
29
|
+
bottomMenuItems?: MenuItem[];
|
|
30
|
+
/** ข้อมูลผู้ใช้ */
|
|
31
|
+
user: User | null;
|
|
32
|
+
/** ป้ายแสดงตำแหน่ง เช่น "เจ้าหน้าที่" */
|
|
33
|
+
roleLabel: string;
|
|
34
|
+
/** callback เมื่อคลิกเมนู */
|
|
35
|
+
onNavigate: (path: string) => void;
|
|
36
|
+
/** callback เมื่อกดออกจากระบบ */
|
|
37
|
+
onLogout: () => void;
|
|
38
|
+
/** callback เมื่อกดโปรไฟล์ผู้ใช้ */
|
|
39
|
+
onProfile?: () => void;
|
|
40
|
+
/** path ปัจจุบันเพื่อ highlight active menu */
|
|
41
|
+
currentPath?: string;
|
|
42
|
+
/** ความกว้าง sidebar */
|
|
43
|
+
width?: string;
|
|
44
|
+
/** className เพิ่มเติม */
|
|
45
|
+
className?: string;
|
|
46
|
+
/** เปิด/ปิด sidebar ได้ */
|
|
47
|
+
collapsible?: boolean;
|
|
48
|
+
/** สถานะเปิด/ปิด (controlled) */
|
|
49
|
+
isOpen?: boolean;
|
|
50
|
+
/** callback เมื่อกดเปิด/ปิด */
|
|
51
|
+
onToggle?: () => void;
|
|
52
|
+
/** callback เมื่อกดเมนูที่มี children ขณะ sidebar ย่อ — ใช้สั่งกาง sidebar */
|
|
53
|
+
onExpandRequest?: () => void;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
declare function StaffSidebar({ orgLogo, orgName, orgSubtitle, menuItems, bottomMenuItems, user, roleLabel, onNavigate, onLogout, onProfile, currentPath, width, className, collapsible, isOpen: controlledIsOpen, onToggle, onExpandRequest, topOffset, mobileBreakpoint, }: StaffSidebarProps & {
|
|
57
|
+
topOffset?: number | string;
|
|
58
|
+
mobileBreakpoint?: number;
|
|
59
|
+
}): react_jsx_runtime.JSX.Element | null;
|
|
60
|
+
|
|
61
|
+
interface SidebarHeaderProps {
|
|
62
|
+
orgLogo?: string;
|
|
63
|
+
orgName: string;
|
|
64
|
+
orgSubtitle?: string;
|
|
65
|
+
collapsed?: boolean;
|
|
66
|
+
}
|
|
67
|
+
declare function SidebarHeader({ orgLogo, orgName, orgSubtitle, collapsed }: SidebarHeaderProps): react_jsx_runtime.JSX.Element;
|
|
68
|
+
|
|
69
|
+
interface SidebarMenuProps {
|
|
70
|
+
menuItems: MenuItem[];
|
|
71
|
+
onItemClick: (path: string) => void;
|
|
72
|
+
currentPath?: string;
|
|
73
|
+
collapsed?: boolean;
|
|
74
|
+
onExpandRequest?: () => void;
|
|
75
|
+
}
|
|
76
|
+
declare function SidebarMenu({ menuItems, onItemClick, currentPath, collapsed, onExpandRequest }: SidebarMenuProps): react_jsx_runtime.JSX.Element;
|
|
77
|
+
|
|
78
|
+
interface SidebarUserProfileProps {
|
|
79
|
+
user: User | null;
|
|
80
|
+
roleLabel: string;
|
|
81
|
+
onLogout: () => void;
|
|
82
|
+
collapsed?: boolean;
|
|
83
|
+
/** @deprecated ไม่ใช้แล้ว — ปุ่มโปรไฟล์ถูกเอาออก เหลือเฉพาะออกจากระบบ */
|
|
84
|
+
onProfile?: () => void;
|
|
85
|
+
}
|
|
86
|
+
declare function SidebarUserProfile({ user, roleLabel, onLogout, collapsed, }: SidebarUserProfileProps): react_jsx_runtime.JSX.Element | null;
|
|
87
|
+
|
|
88
|
+
type NotificationCategory = 'action' | 'general';
|
|
89
|
+
interface NotificationItem {
|
|
90
|
+
id: string | number;
|
|
91
|
+
title: string;
|
|
92
|
+
description: string;
|
|
93
|
+
date: string;
|
|
94
|
+
type: 'info' | 'success' | 'warning' | 'error' | 'reminder';
|
|
95
|
+
isRead: boolean;
|
|
96
|
+
/** หมวดหมู่การแจ้งเตือน: 'action' = ต้องดำเนินการ, 'general' = แจ้งเตือนทั่วไป */
|
|
97
|
+
category?: NotificationCategory;
|
|
98
|
+
}
|
|
99
|
+
interface UserHeaderProps {
|
|
100
|
+
user?: {
|
|
101
|
+
firstName?: string;
|
|
102
|
+
lastName?: string;
|
|
103
|
+
pictureUrl?: string;
|
|
104
|
+
/** เช่น 'ผู้สูงอายุ', 'เจ้าหน้าที่' */
|
|
105
|
+
subtitle?: string;
|
|
106
|
+
};
|
|
107
|
+
notifications?: NotificationItem[];
|
|
108
|
+
onToggleSidebar?: () => void;
|
|
109
|
+
/** Custom bell icon */
|
|
110
|
+
notificationBell?: React.ReactNode;
|
|
111
|
+
onMarkAllRead?: () => void;
|
|
112
|
+
/** Callback เมื่อกดการแจ้งเตือนแต่ละรายการ */
|
|
113
|
+
onNotificationClick?: (notification: NotificationItem) => void;
|
|
114
|
+
/** Callback เมื่อกดโปรไฟล์ผู้ใช้ */
|
|
115
|
+
onProfile?: () => void;
|
|
116
|
+
className?: string;
|
|
117
|
+
}
|
|
118
|
+
declare function UserHeader({ user, notifications, onToggleSidebar, notificationBell, onMarkAllRead, onNotificationClick, onProfile, className, }: UserHeaderProps): react_jsx_runtime.JSX.Element;
|
|
119
|
+
|
|
120
|
+
interface UserSidebarProps {
|
|
121
|
+
user: User | null;
|
|
122
|
+
roleLabel: string;
|
|
123
|
+
menuItems: MenuItem[];
|
|
124
|
+
onNavigate: (path: string) => void;
|
|
125
|
+
onLogout: () => void;
|
|
126
|
+
isOpen: boolean;
|
|
127
|
+
onClose: () => void;
|
|
128
|
+
roleColor?: string;
|
|
129
|
+
/** Callback เมื่อกดโปรไฟล์ผู้ใช้ */
|
|
130
|
+
onProfile?: () => void;
|
|
131
|
+
}
|
|
132
|
+
declare function UserSidebar({ user, roleLabel, menuItems, onNavigate, onLogout, isOpen, onClose, roleColor, onProfile, }: UserSidebarProps): react_jsx_runtime.JSX.Element;
|
|
133
|
+
|
|
134
|
+
interface BottomBarProps {
|
|
135
|
+
/** Content inside the bottom bar (pagination, buttons, etc.) */
|
|
136
|
+
children: React.ReactNode;
|
|
137
|
+
/** Left offset to account for sidebar width (default: '280px') */
|
|
138
|
+
sidebarWidth?: string;
|
|
139
|
+
/** Height of the bottom bar (default: '73px') */
|
|
140
|
+
height?: string;
|
|
141
|
+
/** Additional CSS class */
|
|
142
|
+
className?: string;
|
|
143
|
+
/** Custom inline styles */
|
|
144
|
+
style?: React.CSSProperties;
|
|
145
|
+
}
|
|
146
|
+
declare function BottomBar({ children, sidebarWidth, height, className, style, }: BottomBarProps): react_jsx_runtime.JSX.Element;
|
|
147
|
+
|
|
148
|
+
type Theme = 'light' | 'dark';
|
|
149
|
+
type FontSizeKey = 'xsmall' | 'small' | 'medium' | 'large' | 'xlarge';
|
|
150
|
+
interface FontSizeOption {
|
|
151
|
+
key: FontSizeKey;
|
|
152
|
+
label: string;
|
|
153
|
+
scale: number;
|
|
154
|
+
}
|
|
155
|
+
declare const FONT_SIZE_OPTIONS: FontSizeOption[];
|
|
156
|
+
interface SettingsContextType {
|
|
157
|
+
theme: Theme;
|
|
158
|
+
setTheme: (theme: Theme) => void;
|
|
159
|
+
toggleTheme: () => void;
|
|
160
|
+
fontSize: FontSizeKey;
|
|
161
|
+
setFontSize: (size: FontSizeKey) => void;
|
|
162
|
+
fontSizeOption: FontSizeOption;
|
|
163
|
+
}
|
|
164
|
+
declare function SettingsProvider({ children, defaultTheme, defaultFontSize, themeStorageKey, fontSizeStorageKey, }: {
|
|
165
|
+
children: React$1.ReactNode;
|
|
166
|
+
defaultTheme?: Theme;
|
|
167
|
+
defaultFontSize?: FontSizeKey;
|
|
168
|
+
themeStorageKey?: string;
|
|
169
|
+
fontSizeStorageKey?: string;
|
|
170
|
+
}): react_jsx_runtime.JSX.Element;
|
|
171
|
+
declare function useSettings(): SettingsContextType;
|
|
172
|
+
|
|
173
|
+
interface SettingsPanelProps {
|
|
174
|
+
className?: string;
|
|
175
|
+
/** แสดงตัวเลือกโหมดสว่าง/มืด (default: true) — ซ่อนสำหรับเจ้าหน้าที่ */
|
|
176
|
+
showTheme?: boolean;
|
|
177
|
+
}
|
|
178
|
+
declare function SettingsPanel({ className, showTheme }: SettingsPanelProps): react_jsx_runtime.JSX.Element;
|
|
179
|
+
|
|
180
|
+
interface ThemeSettingsProps {
|
|
181
|
+
onBack?: () => void;
|
|
182
|
+
}
|
|
183
|
+
declare function ThemeSettings({ onBack }: ThemeSettingsProps): react_jsx_runtime.JSX.Element;
|
|
184
|
+
|
|
185
|
+
interface FontSizeSettingsProps {
|
|
186
|
+
onBack?: () => void;
|
|
187
|
+
}
|
|
188
|
+
declare function FontSizeSettings({ onBack }: FontSizeSettingsProps): react_jsx_runtime.JSX.Element;
|
|
189
|
+
|
|
190
|
+
/**
|
|
191
|
+
* Hook ตรวจสอบ dark mode จาก class "dark" บน <html>
|
|
192
|
+
* ใช้ MutationObserver เพื่อ react ทันทีเมื่อ theme เปลี่ยน
|
|
193
|
+
*/
|
|
194
|
+
declare function useDarkMode(): boolean;
|
|
195
|
+
|
|
196
|
+
interface IconProps {
|
|
197
|
+
size?: number;
|
|
198
|
+
className?: string;
|
|
199
|
+
style?: React$1.CSSProperties;
|
|
200
|
+
}
|
|
201
|
+
declare function HomeIcon({ size, className, style }?: IconProps): react_jsx_runtime.JSX.Element;
|
|
202
|
+
declare function SearchIcon({ size, className, style }?: IconProps): react_jsx_runtime.JSX.Element;
|
|
203
|
+
declare function BellIcon({ size, className, style }?: IconProps): react_jsx_runtime.JSX.Element;
|
|
204
|
+
declare function FolderIcon({ size, className, style }?: IconProps): react_jsx_runtime.JSX.Element;
|
|
205
|
+
declare function ClipboardIcon({ size, className, style }?: IconProps): react_jsx_runtime.JSX.Element;
|
|
206
|
+
declare function FileTextIcon({ size, className, style }?: IconProps): react_jsx_runtime.JSX.Element;
|
|
207
|
+
declare function CalendarIcon({ size, className, style }?: IconProps): react_jsx_runtime.JSX.Element;
|
|
208
|
+
declare function UserIcon({ size, className, style }?: IconProps): react_jsx_runtime.JSX.Element;
|
|
209
|
+
declare function UsersIcon({ size, className, style }?: IconProps): react_jsx_runtime.JSX.Element;
|
|
210
|
+
declare function GearIcon({ size, className, style }?: IconProps): react_jsx_runtime.JSX.Element;
|
|
211
|
+
declare function WrenchIcon({ size, className, style }?: IconProps): react_jsx_runtime.JSX.Element;
|
|
212
|
+
declare function ShieldIcon({ size, className, style }?: IconProps): react_jsx_runtime.JSX.Element;
|
|
213
|
+
declare function HelpCircleIcon({ size, className, style }?: IconProps): react_jsx_runtime.JSX.Element;
|
|
214
|
+
declare function BarChartIcon({ size, className, style }?: IconProps): react_jsx_runtime.JSX.Element;
|
|
215
|
+
declare function HistoryIcon({ size, className, style }?: IconProps): react_jsx_runtime.JSX.Element;
|
|
216
|
+
declare function DatabaseIcon({ size, className, style }?: IconProps): react_jsx_runtime.JSX.Element;
|
|
217
|
+
declare function BuildingIcon({ size, className, style }?: IconProps): react_jsx_runtime.JSX.Element;
|
|
218
|
+
declare function MapPinIcon({ size, className, style }?: IconProps): react_jsx_runtime.JSX.Element;
|
|
219
|
+
declare function PhoneIcon({ size, className, style }?: IconProps): react_jsx_runtime.JSX.Element;
|
|
220
|
+
declare function MailIcon({ size, className, style }?: IconProps): react_jsx_runtime.JSX.Element;
|
|
221
|
+
declare function CheckCircleIcon({ size, className, style }?: IconProps): react_jsx_runtime.JSX.Element;
|
|
222
|
+
declare function AlertTriangleIcon({ size, className, style }?: IconProps): react_jsx_runtime.JSX.Element;
|
|
223
|
+
declare function XCircleIcon({ size, className, style }?: IconProps): react_jsx_runtime.JSX.Element;
|
|
224
|
+
declare function PlusCircleIcon({ size, className, style }?: IconProps): react_jsx_runtime.JSX.Element;
|
|
225
|
+
declare function LogOutIcon({ size, className, style }?: IconProps): react_jsx_runtime.JSX.Element;
|
|
226
|
+
declare function DownloadIcon({ size, className, style }?: IconProps): react_jsx_runtime.JSX.Element;
|
|
227
|
+
declare function UploadIcon({ size, className, style }?: IconProps): react_jsx_runtime.JSX.Element;
|
|
228
|
+
declare function PrinterIcon({ size, className, style }?: IconProps): react_jsx_runtime.JSX.Element;
|
|
229
|
+
declare function StarIcon({ size, className, style }?: IconProps): react_jsx_runtime.JSX.Element;
|
|
230
|
+
declare function HeartIcon({ size, className, style }?: IconProps): react_jsx_runtime.JSX.Element;
|
|
231
|
+
declare function EyeIcon({ size, className, style }?: IconProps): react_jsx_runtime.JSX.Element;
|
|
232
|
+
declare function EditIcon({ size, className, style }?: IconProps): react_jsx_runtime.JSX.Element;
|
|
233
|
+
declare function TrashIcon({ size, className, style }?: IconProps): react_jsx_runtime.JSX.Element;
|
|
234
|
+
|
|
235
|
+
declare const Icons: {
|
|
236
|
+
readonly Home: typeof HomeIcon;
|
|
237
|
+
readonly Search: typeof SearchIcon;
|
|
238
|
+
readonly Bell: typeof BellIcon;
|
|
239
|
+
readonly Folder: typeof FolderIcon;
|
|
240
|
+
readonly Clipboard: typeof ClipboardIcon;
|
|
241
|
+
readonly FileText: typeof FileTextIcon;
|
|
242
|
+
readonly Calendar: typeof CalendarIcon;
|
|
243
|
+
readonly User: typeof UserIcon;
|
|
244
|
+
readonly Users: typeof UsersIcon;
|
|
245
|
+
readonly Gear: typeof GearIcon;
|
|
246
|
+
readonly Wrench: typeof WrenchIcon;
|
|
247
|
+
readonly Shield: typeof ShieldIcon;
|
|
248
|
+
readonly HelpCircle: typeof HelpCircleIcon;
|
|
249
|
+
readonly BarChart: typeof BarChartIcon;
|
|
250
|
+
readonly History: typeof HistoryIcon;
|
|
251
|
+
readonly Database: typeof DatabaseIcon;
|
|
252
|
+
readonly Building: typeof BuildingIcon;
|
|
253
|
+
readonly MapPin: typeof MapPinIcon;
|
|
254
|
+
readonly Phone: typeof PhoneIcon;
|
|
255
|
+
readonly Mail: typeof MailIcon;
|
|
256
|
+
readonly CheckCircle: typeof CheckCircleIcon;
|
|
257
|
+
readonly AlertTriangle: typeof AlertTriangleIcon;
|
|
258
|
+
readonly XCircle: typeof XCircleIcon;
|
|
259
|
+
readonly PlusCircle: typeof PlusCircleIcon;
|
|
260
|
+
readonly LogOut: typeof LogOutIcon;
|
|
261
|
+
readonly Download: typeof DownloadIcon;
|
|
262
|
+
readonly Upload: typeof UploadIcon;
|
|
263
|
+
readonly Printer: typeof PrinterIcon;
|
|
264
|
+
readonly Star: typeof StarIcon;
|
|
265
|
+
readonly Heart: typeof HeartIcon;
|
|
266
|
+
readonly Eye: typeof EyeIcon;
|
|
267
|
+
readonly Edit: typeof EditIcon;
|
|
268
|
+
readonly Trash: typeof TrashIcon;
|
|
269
|
+
};
|
|
270
|
+
|
|
271
|
+
interface LineConnectProps {
|
|
272
|
+
liffId: string;
|
|
273
|
+
onLineConnected?: (lineUserId: string) => Promise<void>;
|
|
274
|
+
onConnectError?: (error: any) => void;
|
|
275
|
+
}
|
|
276
|
+
declare function useLineConnectCallback({ liffId, onLineConnected, onConnectError }: LineConnectProps): void;
|
|
277
|
+
declare const startLineConnection: (liffId: string, redirectUrl?: string) => void;
|
|
278
|
+
|
|
279
|
+
export { AlertTriangleIcon, BarChartIcon, BellIcon, BottomBar, type BottomBarProps, BuildingIcon, CalendarIcon, CheckCircleIcon, ClipboardIcon, DatabaseIcon, DownloadIcon, EditIcon, EyeIcon, FONT_SIZE_OPTIONS, FileTextIcon, FolderIcon, type FontSizeKey, type FontSizeOption, FontSizeSettings, GearIcon, HeartIcon, HelpCircleIcon, HistoryIcon, HomeIcon, type IconProps, Icons, type LineConnectProps, LogOutIcon, MailIcon, MapPinIcon, type MenuItem, type NotificationCategory, type NotificationItem, PhoneIcon, PlusCircleIcon, PrinterIcon, SearchIcon, SettingsPanel, SettingsProvider, ShieldIcon, SidebarHeader, SidebarMenu, SidebarUserProfile, StaffSidebar, type StaffSidebarProps, StarIcon, type Theme, ThemeSettings, TrashIcon, UploadIcon, type User, UserHeader, UserIcon, UserSidebar, UsersIcon, WrenchIcon, XCircleIcon, startLineConnection, useDarkMode, useLineConnectCallback, useSettings };
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,279 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import React$1 from 'react';
|
|
3
|
+
|
|
4
|
+
interface User {
|
|
5
|
+
id?: string | number;
|
|
6
|
+
firstName?: string;
|
|
7
|
+
lastName?: string;
|
|
8
|
+
pictureUrl?: string;
|
|
9
|
+
role?: string;
|
|
10
|
+
}
|
|
11
|
+
interface MenuItem {
|
|
12
|
+
id: string;
|
|
13
|
+
title: string;
|
|
14
|
+
path?: string;
|
|
15
|
+
icon?: React.ReactNode;
|
|
16
|
+
children?: MenuItem[];
|
|
17
|
+
dividerAfter?: boolean;
|
|
18
|
+
}
|
|
19
|
+
interface StaffSidebarProps {
|
|
20
|
+
/** URL รูปตราองค์กร */
|
|
21
|
+
orgLogo?: string;
|
|
22
|
+
/** ชื่อองค์กร */
|
|
23
|
+
orgName: string;
|
|
24
|
+
/** ชื่อรอง เช่น จังหวัด */
|
|
25
|
+
orgSubtitle?: string;
|
|
26
|
+
/** เมนูหลัก */
|
|
27
|
+
menuItems: MenuItem[];
|
|
28
|
+
/** เมนูล่าง เช่น ตั้งค่าระบบ */
|
|
29
|
+
bottomMenuItems?: MenuItem[];
|
|
30
|
+
/** ข้อมูลผู้ใช้ */
|
|
31
|
+
user: User | null;
|
|
32
|
+
/** ป้ายแสดงตำแหน่ง เช่น "เจ้าหน้าที่" */
|
|
33
|
+
roleLabel: string;
|
|
34
|
+
/** callback เมื่อคลิกเมนู */
|
|
35
|
+
onNavigate: (path: string) => void;
|
|
36
|
+
/** callback เมื่อกดออกจากระบบ */
|
|
37
|
+
onLogout: () => void;
|
|
38
|
+
/** callback เมื่อกดโปรไฟล์ผู้ใช้ */
|
|
39
|
+
onProfile?: () => void;
|
|
40
|
+
/** path ปัจจุบันเพื่อ highlight active menu */
|
|
41
|
+
currentPath?: string;
|
|
42
|
+
/** ความกว้าง sidebar */
|
|
43
|
+
width?: string;
|
|
44
|
+
/** className เพิ่มเติม */
|
|
45
|
+
className?: string;
|
|
46
|
+
/** เปิด/ปิด sidebar ได้ */
|
|
47
|
+
collapsible?: boolean;
|
|
48
|
+
/** สถานะเปิด/ปิด (controlled) */
|
|
49
|
+
isOpen?: boolean;
|
|
50
|
+
/** callback เมื่อกดเปิด/ปิด */
|
|
51
|
+
onToggle?: () => void;
|
|
52
|
+
/** callback เมื่อกดเมนูที่มี children ขณะ sidebar ย่อ — ใช้สั่งกาง sidebar */
|
|
53
|
+
onExpandRequest?: () => void;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
declare function StaffSidebar({ orgLogo, orgName, orgSubtitle, menuItems, bottomMenuItems, user, roleLabel, onNavigate, onLogout, onProfile, currentPath, width, className, collapsible, isOpen: controlledIsOpen, onToggle, onExpandRequest, topOffset, mobileBreakpoint, }: StaffSidebarProps & {
|
|
57
|
+
topOffset?: number | string;
|
|
58
|
+
mobileBreakpoint?: number;
|
|
59
|
+
}): react_jsx_runtime.JSX.Element | null;
|
|
60
|
+
|
|
61
|
+
interface SidebarHeaderProps {
|
|
62
|
+
orgLogo?: string;
|
|
63
|
+
orgName: string;
|
|
64
|
+
orgSubtitle?: string;
|
|
65
|
+
collapsed?: boolean;
|
|
66
|
+
}
|
|
67
|
+
declare function SidebarHeader({ orgLogo, orgName, orgSubtitle, collapsed }: SidebarHeaderProps): react_jsx_runtime.JSX.Element;
|
|
68
|
+
|
|
69
|
+
interface SidebarMenuProps {
|
|
70
|
+
menuItems: MenuItem[];
|
|
71
|
+
onItemClick: (path: string) => void;
|
|
72
|
+
currentPath?: string;
|
|
73
|
+
collapsed?: boolean;
|
|
74
|
+
onExpandRequest?: () => void;
|
|
75
|
+
}
|
|
76
|
+
declare function SidebarMenu({ menuItems, onItemClick, currentPath, collapsed, onExpandRequest }: SidebarMenuProps): react_jsx_runtime.JSX.Element;
|
|
77
|
+
|
|
78
|
+
interface SidebarUserProfileProps {
|
|
79
|
+
user: User | null;
|
|
80
|
+
roleLabel: string;
|
|
81
|
+
onLogout: () => void;
|
|
82
|
+
collapsed?: boolean;
|
|
83
|
+
/** @deprecated ไม่ใช้แล้ว — ปุ่มโปรไฟล์ถูกเอาออก เหลือเฉพาะออกจากระบบ */
|
|
84
|
+
onProfile?: () => void;
|
|
85
|
+
}
|
|
86
|
+
declare function SidebarUserProfile({ user, roleLabel, onLogout, collapsed, }: SidebarUserProfileProps): react_jsx_runtime.JSX.Element | null;
|
|
87
|
+
|
|
88
|
+
type NotificationCategory = 'action' | 'general';
|
|
89
|
+
interface NotificationItem {
|
|
90
|
+
id: string | number;
|
|
91
|
+
title: string;
|
|
92
|
+
description: string;
|
|
93
|
+
date: string;
|
|
94
|
+
type: 'info' | 'success' | 'warning' | 'error' | 'reminder';
|
|
95
|
+
isRead: boolean;
|
|
96
|
+
/** หมวดหมู่การแจ้งเตือน: 'action' = ต้องดำเนินการ, 'general' = แจ้งเตือนทั่วไป */
|
|
97
|
+
category?: NotificationCategory;
|
|
98
|
+
}
|
|
99
|
+
interface UserHeaderProps {
|
|
100
|
+
user?: {
|
|
101
|
+
firstName?: string;
|
|
102
|
+
lastName?: string;
|
|
103
|
+
pictureUrl?: string;
|
|
104
|
+
/** เช่น 'ผู้สูงอายุ', 'เจ้าหน้าที่' */
|
|
105
|
+
subtitle?: string;
|
|
106
|
+
};
|
|
107
|
+
notifications?: NotificationItem[];
|
|
108
|
+
onToggleSidebar?: () => void;
|
|
109
|
+
/** Custom bell icon */
|
|
110
|
+
notificationBell?: React.ReactNode;
|
|
111
|
+
onMarkAllRead?: () => void;
|
|
112
|
+
/** Callback เมื่อกดการแจ้งเตือนแต่ละรายการ */
|
|
113
|
+
onNotificationClick?: (notification: NotificationItem) => void;
|
|
114
|
+
/** Callback เมื่อกดโปรไฟล์ผู้ใช้ */
|
|
115
|
+
onProfile?: () => void;
|
|
116
|
+
className?: string;
|
|
117
|
+
}
|
|
118
|
+
declare function UserHeader({ user, notifications, onToggleSidebar, notificationBell, onMarkAllRead, onNotificationClick, onProfile, className, }: UserHeaderProps): react_jsx_runtime.JSX.Element;
|
|
119
|
+
|
|
120
|
+
interface UserSidebarProps {
|
|
121
|
+
user: User | null;
|
|
122
|
+
roleLabel: string;
|
|
123
|
+
menuItems: MenuItem[];
|
|
124
|
+
onNavigate: (path: string) => void;
|
|
125
|
+
onLogout: () => void;
|
|
126
|
+
isOpen: boolean;
|
|
127
|
+
onClose: () => void;
|
|
128
|
+
roleColor?: string;
|
|
129
|
+
/** Callback เมื่อกดโปรไฟล์ผู้ใช้ */
|
|
130
|
+
onProfile?: () => void;
|
|
131
|
+
}
|
|
132
|
+
declare function UserSidebar({ user, roleLabel, menuItems, onNavigate, onLogout, isOpen, onClose, roleColor, onProfile, }: UserSidebarProps): react_jsx_runtime.JSX.Element;
|
|
133
|
+
|
|
134
|
+
interface BottomBarProps {
|
|
135
|
+
/** Content inside the bottom bar (pagination, buttons, etc.) */
|
|
136
|
+
children: React.ReactNode;
|
|
137
|
+
/** Left offset to account for sidebar width (default: '280px') */
|
|
138
|
+
sidebarWidth?: string;
|
|
139
|
+
/** Height of the bottom bar (default: '73px') */
|
|
140
|
+
height?: string;
|
|
141
|
+
/** Additional CSS class */
|
|
142
|
+
className?: string;
|
|
143
|
+
/** Custom inline styles */
|
|
144
|
+
style?: React.CSSProperties;
|
|
145
|
+
}
|
|
146
|
+
declare function BottomBar({ children, sidebarWidth, height, className, style, }: BottomBarProps): react_jsx_runtime.JSX.Element;
|
|
147
|
+
|
|
148
|
+
type Theme = 'light' | 'dark';
|
|
149
|
+
type FontSizeKey = 'xsmall' | 'small' | 'medium' | 'large' | 'xlarge';
|
|
150
|
+
interface FontSizeOption {
|
|
151
|
+
key: FontSizeKey;
|
|
152
|
+
label: string;
|
|
153
|
+
scale: number;
|
|
154
|
+
}
|
|
155
|
+
declare const FONT_SIZE_OPTIONS: FontSizeOption[];
|
|
156
|
+
interface SettingsContextType {
|
|
157
|
+
theme: Theme;
|
|
158
|
+
setTheme: (theme: Theme) => void;
|
|
159
|
+
toggleTheme: () => void;
|
|
160
|
+
fontSize: FontSizeKey;
|
|
161
|
+
setFontSize: (size: FontSizeKey) => void;
|
|
162
|
+
fontSizeOption: FontSizeOption;
|
|
163
|
+
}
|
|
164
|
+
declare function SettingsProvider({ children, defaultTheme, defaultFontSize, themeStorageKey, fontSizeStorageKey, }: {
|
|
165
|
+
children: React$1.ReactNode;
|
|
166
|
+
defaultTheme?: Theme;
|
|
167
|
+
defaultFontSize?: FontSizeKey;
|
|
168
|
+
themeStorageKey?: string;
|
|
169
|
+
fontSizeStorageKey?: string;
|
|
170
|
+
}): react_jsx_runtime.JSX.Element;
|
|
171
|
+
declare function useSettings(): SettingsContextType;
|
|
172
|
+
|
|
173
|
+
interface SettingsPanelProps {
|
|
174
|
+
className?: string;
|
|
175
|
+
/** แสดงตัวเลือกโหมดสว่าง/มืด (default: true) — ซ่อนสำหรับเจ้าหน้าที่ */
|
|
176
|
+
showTheme?: boolean;
|
|
177
|
+
}
|
|
178
|
+
declare function SettingsPanel({ className, showTheme }: SettingsPanelProps): react_jsx_runtime.JSX.Element;
|
|
179
|
+
|
|
180
|
+
interface ThemeSettingsProps {
|
|
181
|
+
onBack?: () => void;
|
|
182
|
+
}
|
|
183
|
+
declare function ThemeSettings({ onBack }: ThemeSettingsProps): react_jsx_runtime.JSX.Element;
|
|
184
|
+
|
|
185
|
+
interface FontSizeSettingsProps {
|
|
186
|
+
onBack?: () => void;
|
|
187
|
+
}
|
|
188
|
+
declare function FontSizeSettings({ onBack }: FontSizeSettingsProps): react_jsx_runtime.JSX.Element;
|
|
189
|
+
|
|
190
|
+
/**
|
|
191
|
+
* Hook ตรวจสอบ dark mode จาก class "dark" บน <html>
|
|
192
|
+
* ใช้ MutationObserver เพื่อ react ทันทีเมื่อ theme เปลี่ยน
|
|
193
|
+
*/
|
|
194
|
+
declare function useDarkMode(): boolean;
|
|
195
|
+
|
|
196
|
+
interface IconProps {
|
|
197
|
+
size?: number;
|
|
198
|
+
className?: string;
|
|
199
|
+
style?: React$1.CSSProperties;
|
|
200
|
+
}
|
|
201
|
+
declare function HomeIcon({ size, className, style }?: IconProps): react_jsx_runtime.JSX.Element;
|
|
202
|
+
declare function SearchIcon({ size, className, style }?: IconProps): react_jsx_runtime.JSX.Element;
|
|
203
|
+
declare function BellIcon({ size, className, style }?: IconProps): react_jsx_runtime.JSX.Element;
|
|
204
|
+
declare function FolderIcon({ size, className, style }?: IconProps): react_jsx_runtime.JSX.Element;
|
|
205
|
+
declare function ClipboardIcon({ size, className, style }?: IconProps): react_jsx_runtime.JSX.Element;
|
|
206
|
+
declare function FileTextIcon({ size, className, style }?: IconProps): react_jsx_runtime.JSX.Element;
|
|
207
|
+
declare function CalendarIcon({ size, className, style }?: IconProps): react_jsx_runtime.JSX.Element;
|
|
208
|
+
declare function UserIcon({ size, className, style }?: IconProps): react_jsx_runtime.JSX.Element;
|
|
209
|
+
declare function UsersIcon({ size, className, style }?: IconProps): react_jsx_runtime.JSX.Element;
|
|
210
|
+
declare function GearIcon({ size, className, style }?: IconProps): react_jsx_runtime.JSX.Element;
|
|
211
|
+
declare function WrenchIcon({ size, className, style }?: IconProps): react_jsx_runtime.JSX.Element;
|
|
212
|
+
declare function ShieldIcon({ size, className, style }?: IconProps): react_jsx_runtime.JSX.Element;
|
|
213
|
+
declare function HelpCircleIcon({ size, className, style }?: IconProps): react_jsx_runtime.JSX.Element;
|
|
214
|
+
declare function BarChartIcon({ size, className, style }?: IconProps): react_jsx_runtime.JSX.Element;
|
|
215
|
+
declare function HistoryIcon({ size, className, style }?: IconProps): react_jsx_runtime.JSX.Element;
|
|
216
|
+
declare function DatabaseIcon({ size, className, style }?: IconProps): react_jsx_runtime.JSX.Element;
|
|
217
|
+
declare function BuildingIcon({ size, className, style }?: IconProps): react_jsx_runtime.JSX.Element;
|
|
218
|
+
declare function MapPinIcon({ size, className, style }?: IconProps): react_jsx_runtime.JSX.Element;
|
|
219
|
+
declare function PhoneIcon({ size, className, style }?: IconProps): react_jsx_runtime.JSX.Element;
|
|
220
|
+
declare function MailIcon({ size, className, style }?: IconProps): react_jsx_runtime.JSX.Element;
|
|
221
|
+
declare function CheckCircleIcon({ size, className, style }?: IconProps): react_jsx_runtime.JSX.Element;
|
|
222
|
+
declare function AlertTriangleIcon({ size, className, style }?: IconProps): react_jsx_runtime.JSX.Element;
|
|
223
|
+
declare function XCircleIcon({ size, className, style }?: IconProps): react_jsx_runtime.JSX.Element;
|
|
224
|
+
declare function PlusCircleIcon({ size, className, style }?: IconProps): react_jsx_runtime.JSX.Element;
|
|
225
|
+
declare function LogOutIcon({ size, className, style }?: IconProps): react_jsx_runtime.JSX.Element;
|
|
226
|
+
declare function DownloadIcon({ size, className, style }?: IconProps): react_jsx_runtime.JSX.Element;
|
|
227
|
+
declare function UploadIcon({ size, className, style }?: IconProps): react_jsx_runtime.JSX.Element;
|
|
228
|
+
declare function PrinterIcon({ size, className, style }?: IconProps): react_jsx_runtime.JSX.Element;
|
|
229
|
+
declare function StarIcon({ size, className, style }?: IconProps): react_jsx_runtime.JSX.Element;
|
|
230
|
+
declare function HeartIcon({ size, className, style }?: IconProps): react_jsx_runtime.JSX.Element;
|
|
231
|
+
declare function EyeIcon({ size, className, style }?: IconProps): react_jsx_runtime.JSX.Element;
|
|
232
|
+
declare function EditIcon({ size, className, style }?: IconProps): react_jsx_runtime.JSX.Element;
|
|
233
|
+
declare function TrashIcon({ size, className, style }?: IconProps): react_jsx_runtime.JSX.Element;
|
|
234
|
+
|
|
235
|
+
declare const Icons: {
|
|
236
|
+
readonly Home: typeof HomeIcon;
|
|
237
|
+
readonly Search: typeof SearchIcon;
|
|
238
|
+
readonly Bell: typeof BellIcon;
|
|
239
|
+
readonly Folder: typeof FolderIcon;
|
|
240
|
+
readonly Clipboard: typeof ClipboardIcon;
|
|
241
|
+
readonly FileText: typeof FileTextIcon;
|
|
242
|
+
readonly Calendar: typeof CalendarIcon;
|
|
243
|
+
readonly User: typeof UserIcon;
|
|
244
|
+
readonly Users: typeof UsersIcon;
|
|
245
|
+
readonly Gear: typeof GearIcon;
|
|
246
|
+
readonly Wrench: typeof WrenchIcon;
|
|
247
|
+
readonly Shield: typeof ShieldIcon;
|
|
248
|
+
readonly HelpCircle: typeof HelpCircleIcon;
|
|
249
|
+
readonly BarChart: typeof BarChartIcon;
|
|
250
|
+
readonly History: typeof HistoryIcon;
|
|
251
|
+
readonly Database: typeof DatabaseIcon;
|
|
252
|
+
readonly Building: typeof BuildingIcon;
|
|
253
|
+
readonly MapPin: typeof MapPinIcon;
|
|
254
|
+
readonly Phone: typeof PhoneIcon;
|
|
255
|
+
readonly Mail: typeof MailIcon;
|
|
256
|
+
readonly CheckCircle: typeof CheckCircleIcon;
|
|
257
|
+
readonly AlertTriangle: typeof AlertTriangleIcon;
|
|
258
|
+
readonly XCircle: typeof XCircleIcon;
|
|
259
|
+
readonly PlusCircle: typeof PlusCircleIcon;
|
|
260
|
+
readonly LogOut: typeof LogOutIcon;
|
|
261
|
+
readonly Download: typeof DownloadIcon;
|
|
262
|
+
readonly Upload: typeof UploadIcon;
|
|
263
|
+
readonly Printer: typeof PrinterIcon;
|
|
264
|
+
readonly Star: typeof StarIcon;
|
|
265
|
+
readonly Heart: typeof HeartIcon;
|
|
266
|
+
readonly Eye: typeof EyeIcon;
|
|
267
|
+
readonly Edit: typeof EditIcon;
|
|
268
|
+
readonly Trash: typeof TrashIcon;
|
|
269
|
+
};
|
|
270
|
+
|
|
271
|
+
interface LineConnectProps {
|
|
272
|
+
liffId: string;
|
|
273
|
+
onLineConnected?: (lineUserId: string) => Promise<void>;
|
|
274
|
+
onConnectError?: (error: any) => void;
|
|
275
|
+
}
|
|
276
|
+
declare function useLineConnectCallback({ liffId, onLineConnected, onConnectError }: LineConnectProps): void;
|
|
277
|
+
declare const startLineConnection: (liffId: string, redirectUrl?: string) => void;
|
|
278
|
+
|
|
279
|
+
export { AlertTriangleIcon, BarChartIcon, BellIcon, BottomBar, type BottomBarProps, BuildingIcon, CalendarIcon, CheckCircleIcon, ClipboardIcon, DatabaseIcon, DownloadIcon, EditIcon, EyeIcon, FONT_SIZE_OPTIONS, FileTextIcon, FolderIcon, type FontSizeKey, type FontSizeOption, FontSizeSettings, GearIcon, HeartIcon, HelpCircleIcon, HistoryIcon, HomeIcon, type IconProps, Icons, type LineConnectProps, LogOutIcon, MailIcon, MapPinIcon, type MenuItem, type NotificationCategory, type NotificationItem, PhoneIcon, PlusCircleIcon, PrinterIcon, SearchIcon, SettingsPanel, SettingsProvider, ShieldIcon, SidebarHeader, SidebarMenu, SidebarUserProfile, StaffSidebar, type StaffSidebarProps, StarIcon, type Theme, ThemeSettings, TrashIcon, UploadIcon, type User, UserHeader, UserIcon, UserSidebar, UsersIcon, WrenchIcon, XCircleIcon, startLineConnection, useDarkMode, useLineConnectCallback, useSettings };
|