gov-layout 1.1.4 → 1.1.6
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/dist/index.d.mts +44 -1
- package/dist/index.d.ts +44 -1
- package/dist/index.js +378 -0
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +374 -2
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import React$1 from 'react';
|
|
2
3
|
|
|
3
4
|
interface User {
|
|
4
5
|
id?: string | number;
|
|
@@ -110,4 +111,46 @@ interface UserSidebarProps {
|
|
|
110
111
|
}
|
|
111
112
|
declare function UserSidebar({ user, roleLabel, menuItems, onNavigate, onLogout, isOpen, onClose, roleColor, }: UserSidebarProps): react_jsx_runtime.JSX.Element;
|
|
112
113
|
|
|
113
|
-
|
|
114
|
+
type Theme = 'light' | 'dark';
|
|
115
|
+
type FontSizeKey = 'xsmall' | 'small' | 'medium' | 'large' | 'xlarge';
|
|
116
|
+
interface FontSizeOption {
|
|
117
|
+
key: FontSizeKey;
|
|
118
|
+
label: string;
|
|
119
|
+
scale: number;
|
|
120
|
+
}
|
|
121
|
+
declare const FONT_SIZE_OPTIONS: FontSizeOption[];
|
|
122
|
+
interface SettingsContextType {
|
|
123
|
+
theme: Theme;
|
|
124
|
+
setTheme: (theme: Theme) => void;
|
|
125
|
+
toggleTheme: () => void;
|
|
126
|
+
fontSize: FontSizeKey;
|
|
127
|
+
setFontSize: (size: FontSizeKey) => void;
|
|
128
|
+
fontSizeOption: FontSizeOption;
|
|
129
|
+
}
|
|
130
|
+
declare function SettingsProvider({ children, defaultTheme, defaultFontSize, themeStorageKey, fontSizeStorageKey, }: {
|
|
131
|
+
children: React$1.ReactNode;
|
|
132
|
+
defaultTheme?: Theme;
|
|
133
|
+
defaultFontSize?: FontSizeKey;
|
|
134
|
+
themeStorageKey?: string;
|
|
135
|
+
fontSizeStorageKey?: string;
|
|
136
|
+
}): react_jsx_runtime.JSX.Element;
|
|
137
|
+
declare function useSettings(): SettingsContextType;
|
|
138
|
+
|
|
139
|
+
interface SettingsPanelProps {
|
|
140
|
+
className?: string;
|
|
141
|
+
/** แสดงตัวเลือกโหมดสว่าง/มืด (default: true) — ซ่อนสำหรับเจ้าหน้าที่ */
|
|
142
|
+
showTheme?: boolean;
|
|
143
|
+
}
|
|
144
|
+
declare function SettingsPanel({ className, showTheme }: SettingsPanelProps): react_jsx_runtime.JSX.Element;
|
|
145
|
+
|
|
146
|
+
interface ThemeSettingsProps {
|
|
147
|
+
onBack?: () => void;
|
|
148
|
+
}
|
|
149
|
+
declare function ThemeSettings({ onBack }: ThemeSettingsProps): react_jsx_runtime.JSX.Element;
|
|
150
|
+
|
|
151
|
+
interface FontSizeSettingsProps {
|
|
152
|
+
onBack?: () => void;
|
|
153
|
+
}
|
|
154
|
+
declare function FontSizeSettings({ onBack }: FontSizeSettingsProps): react_jsx_runtime.JSX.Element;
|
|
155
|
+
|
|
156
|
+
export { FONT_SIZE_OPTIONS, type FontSizeKey, type FontSizeOption, FontSizeSettings, type MenuItem, type NotificationItem, SettingsPanel, SettingsProvider, SidebarHeader, SidebarMenu, SidebarUserProfile, StaffSidebar, type StaffSidebarProps, type Theme, ThemeSettings, type User, UserHeader, UserSidebar, useSettings };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import React$1 from 'react';
|
|
2
3
|
|
|
3
4
|
interface User {
|
|
4
5
|
id?: string | number;
|
|
@@ -110,4 +111,46 @@ interface UserSidebarProps {
|
|
|
110
111
|
}
|
|
111
112
|
declare function UserSidebar({ user, roleLabel, menuItems, onNavigate, onLogout, isOpen, onClose, roleColor, }: UserSidebarProps): react_jsx_runtime.JSX.Element;
|
|
112
113
|
|
|
113
|
-
|
|
114
|
+
type Theme = 'light' | 'dark';
|
|
115
|
+
type FontSizeKey = 'xsmall' | 'small' | 'medium' | 'large' | 'xlarge';
|
|
116
|
+
interface FontSizeOption {
|
|
117
|
+
key: FontSizeKey;
|
|
118
|
+
label: string;
|
|
119
|
+
scale: number;
|
|
120
|
+
}
|
|
121
|
+
declare const FONT_SIZE_OPTIONS: FontSizeOption[];
|
|
122
|
+
interface SettingsContextType {
|
|
123
|
+
theme: Theme;
|
|
124
|
+
setTheme: (theme: Theme) => void;
|
|
125
|
+
toggleTheme: () => void;
|
|
126
|
+
fontSize: FontSizeKey;
|
|
127
|
+
setFontSize: (size: FontSizeKey) => void;
|
|
128
|
+
fontSizeOption: FontSizeOption;
|
|
129
|
+
}
|
|
130
|
+
declare function SettingsProvider({ children, defaultTheme, defaultFontSize, themeStorageKey, fontSizeStorageKey, }: {
|
|
131
|
+
children: React$1.ReactNode;
|
|
132
|
+
defaultTheme?: Theme;
|
|
133
|
+
defaultFontSize?: FontSizeKey;
|
|
134
|
+
themeStorageKey?: string;
|
|
135
|
+
fontSizeStorageKey?: string;
|
|
136
|
+
}): react_jsx_runtime.JSX.Element;
|
|
137
|
+
declare function useSettings(): SettingsContextType;
|
|
138
|
+
|
|
139
|
+
interface SettingsPanelProps {
|
|
140
|
+
className?: string;
|
|
141
|
+
/** แสดงตัวเลือกโหมดสว่าง/มืด (default: true) — ซ่อนสำหรับเจ้าหน้าที่ */
|
|
142
|
+
showTheme?: boolean;
|
|
143
|
+
}
|
|
144
|
+
declare function SettingsPanel({ className, showTheme }: SettingsPanelProps): react_jsx_runtime.JSX.Element;
|
|
145
|
+
|
|
146
|
+
interface ThemeSettingsProps {
|
|
147
|
+
onBack?: () => void;
|
|
148
|
+
}
|
|
149
|
+
declare function ThemeSettings({ onBack }: ThemeSettingsProps): react_jsx_runtime.JSX.Element;
|
|
150
|
+
|
|
151
|
+
interface FontSizeSettingsProps {
|
|
152
|
+
onBack?: () => void;
|
|
153
|
+
}
|
|
154
|
+
declare function FontSizeSettings({ onBack }: FontSizeSettingsProps): react_jsx_runtime.JSX.Element;
|
|
155
|
+
|
|
156
|
+
export { FONT_SIZE_OPTIONS, type FontSizeKey, type FontSizeOption, FontSizeSettings, type MenuItem, type NotificationItem, SettingsPanel, SettingsProvider, SidebarHeader, SidebarMenu, SidebarUserProfile, StaffSidebar, type StaffSidebarProps, type Theme, ThemeSettings, type User, UserHeader, UserSidebar, useSettings };
|
package/dist/index.js
CHANGED
|
@@ -1211,12 +1211,390 @@ function UserSidebar({
|
|
|
1211
1211
|
)
|
|
1212
1212
|
] });
|
|
1213
1213
|
}
|
|
1214
|
+
var FONT_SIZE_OPTIONS = [
|
|
1215
|
+
{ key: "xsmall", label: "\u0E40\u0E25\u0E47\u0E01\u0E21\u0E32\u0E01", scale: 0.8 },
|
|
1216
|
+
{ key: "small", label: "\u0E40\u0E25\u0E47\u0E01", scale: 0.9 },
|
|
1217
|
+
{ key: "medium", label: "\u0E01\u0E25\u0E32\u0E07", scale: 1 },
|
|
1218
|
+
{ key: "large", label: "\u0E43\u0E2B\u0E0D\u0E48", scale: 1.2 },
|
|
1219
|
+
{ key: "xlarge", label: "\u0E43\u0E2B\u0E0D\u0E48\u0E21\u0E32\u0E01", scale: 1.4 }
|
|
1220
|
+
];
|
|
1221
|
+
var BASE_FONT_SIZES = {
|
|
1222
|
+
"--font-alias-mobile-body-fontsize": 16,
|
|
1223
|
+
"--font-alias-mobile-h1-fontsize": 28,
|
|
1224
|
+
"--font-alias-mobile-h2-fontsize": 24,
|
|
1225
|
+
"--font-alias-mobile-h3-fontsize": 20,
|
|
1226
|
+
"--font-alias-mobile-sub-fontsize": 14,
|
|
1227
|
+
"--font-alias-mobile-button-fontsize": 16
|
|
1228
|
+
};
|
|
1229
|
+
var SettingsContext = react.createContext(void 0);
|
|
1230
|
+
function SettingsProvider({
|
|
1231
|
+
children,
|
|
1232
|
+
defaultTheme = "light",
|
|
1233
|
+
defaultFontSize = "medium",
|
|
1234
|
+
themeStorageKey = "app-theme",
|
|
1235
|
+
fontSizeStorageKey = "app-font-size"
|
|
1236
|
+
}) {
|
|
1237
|
+
const [theme, setThemeState] = react.useState(defaultTheme);
|
|
1238
|
+
const [fontSize, setFontSizeState] = react.useState(defaultFontSize);
|
|
1239
|
+
react.useEffect(() => {
|
|
1240
|
+
try {
|
|
1241
|
+
const savedTheme = localStorage.getItem(themeStorageKey);
|
|
1242
|
+
if (savedTheme === "light" || savedTheme === "dark") {
|
|
1243
|
+
setThemeState(savedTheme);
|
|
1244
|
+
}
|
|
1245
|
+
const savedFontSize = localStorage.getItem(fontSizeStorageKey);
|
|
1246
|
+
if (savedFontSize && FONT_SIZE_OPTIONS.some((o) => o.key === savedFontSize)) {
|
|
1247
|
+
setFontSizeState(savedFontSize);
|
|
1248
|
+
}
|
|
1249
|
+
} catch {
|
|
1250
|
+
}
|
|
1251
|
+
}, [themeStorageKey, fontSizeStorageKey]);
|
|
1252
|
+
react.useEffect(() => {
|
|
1253
|
+
const root = document.documentElement;
|
|
1254
|
+
if (theme === "dark") {
|
|
1255
|
+
root.classList.add("dark");
|
|
1256
|
+
} else {
|
|
1257
|
+
root.classList.remove("dark");
|
|
1258
|
+
}
|
|
1259
|
+
try {
|
|
1260
|
+
localStorage.setItem(themeStorageKey, theme);
|
|
1261
|
+
} catch {
|
|
1262
|
+
}
|
|
1263
|
+
}, [theme, themeStorageKey]);
|
|
1264
|
+
react.useEffect(() => {
|
|
1265
|
+
const option = FONT_SIZE_OPTIONS.find((o) => o.key === fontSize) || FONT_SIZE_OPTIONS[2];
|
|
1266
|
+
const root = document.documentElement;
|
|
1267
|
+
Object.entries(BASE_FONT_SIZES).forEach(([varName, baseValue]) => {
|
|
1268
|
+
root.style.setProperty(varName, `${baseValue * option.scale}px`);
|
|
1269
|
+
});
|
|
1270
|
+
root.style.fontSize = `${16 * option.scale}px`;
|
|
1271
|
+
root.style.setProperty("--global-font-scale", option.scale.toString());
|
|
1272
|
+
document.body.style.zoom = option.scale.toString();
|
|
1273
|
+
try {
|
|
1274
|
+
localStorage.setItem(fontSizeStorageKey, fontSize);
|
|
1275
|
+
} catch {
|
|
1276
|
+
}
|
|
1277
|
+
}, [fontSize, fontSizeStorageKey]);
|
|
1278
|
+
const setTheme = react.useCallback((t) => {
|
|
1279
|
+
setThemeState(t);
|
|
1280
|
+
}, []);
|
|
1281
|
+
const toggleTheme = react.useCallback(() => {
|
|
1282
|
+
setThemeState((prev) => prev === "light" ? "dark" : "light");
|
|
1283
|
+
}, []);
|
|
1284
|
+
const setFontSize = react.useCallback((s) => {
|
|
1285
|
+
setFontSizeState(s);
|
|
1286
|
+
}, []);
|
|
1287
|
+
const fontSizeOption = FONT_SIZE_OPTIONS.find((o) => o.key === fontSize) || FONT_SIZE_OPTIONS[2];
|
|
1288
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
1289
|
+
SettingsContext.Provider,
|
|
1290
|
+
{
|
|
1291
|
+
value: { theme, setTheme, toggleTheme, fontSize, setFontSize, fontSizeOption },
|
|
1292
|
+
children
|
|
1293
|
+
}
|
|
1294
|
+
);
|
|
1295
|
+
}
|
|
1296
|
+
function useSettings() {
|
|
1297
|
+
const context = react.useContext(SettingsContext);
|
|
1298
|
+
if (!context) {
|
|
1299
|
+
throw new Error("useSettings must be used within <SettingsProvider>");
|
|
1300
|
+
}
|
|
1301
|
+
return context;
|
|
1302
|
+
}
|
|
1303
|
+
function SunIcon() {
|
|
1304
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("svg", { width: "24", height: "24", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: [
|
|
1305
|
+
/* @__PURE__ */ jsxRuntime.jsx("circle", { cx: "12", cy: "12", r: "5" }),
|
|
1306
|
+
/* @__PURE__ */ jsxRuntime.jsx("line", { x1: "12", y1: "1", x2: "12", y2: "3" }),
|
|
1307
|
+
/* @__PURE__ */ jsxRuntime.jsx("line", { x1: "12", y1: "21", x2: "12", y2: "23" }),
|
|
1308
|
+
/* @__PURE__ */ jsxRuntime.jsx("line", { x1: "4.22", y1: "4.22", x2: "5.64", y2: "5.64" }),
|
|
1309
|
+
/* @__PURE__ */ jsxRuntime.jsx("line", { x1: "18.36", y1: "18.36", x2: "19.78", y2: "19.78" }),
|
|
1310
|
+
/* @__PURE__ */ jsxRuntime.jsx("line", { x1: "1", y1: "12", x2: "3", y2: "12" }),
|
|
1311
|
+
/* @__PURE__ */ jsxRuntime.jsx("line", { x1: "21", y1: "12", x2: "23", y2: "12" }),
|
|
1312
|
+
/* @__PURE__ */ jsxRuntime.jsx("line", { x1: "4.22", y1: "19.78", x2: "5.64", y2: "18.36" }),
|
|
1313
|
+
/* @__PURE__ */ jsxRuntime.jsx("line", { x1: "18.36", y1: "5.64", x2: "19.78", y2: "4.22" })
|
|
1314
|
+
] });
|
|
1315
|
+
}
|
|
1316
|
+
function MoonIcon() {
|
|
1317
|
+
return /* @__PURE__ */ jsxRuntime.jsx("svg", { width: "24", height: "24", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M21 12.79A9 9 0 1 1 11.21 3 7 7 0 0 0 21 12.79z" }) });
|
|
1318
|
+
}
|
|
1319
|
+
function ThemeSettings({ onBack }) {
|
|
1320
|
+
const { theme, setTheme } = useSettings();
|
|
1321
|
+
const options = [
|
|
1322
|
+
{ key: "light", label: "\u0E2A\u0E27\u0E48\u0E32\u0E07", icon: /* @__PURE__ */ jsxRuntime.jsx(SunIcon, {}), bg: "#fff", text: "#111" },
|
|
1323
|
+
{ key: "dark", label: "\u0E21\u0E37\u0E14", icon: /* @__PURE__ */ jsxRuntime.jsx(MoonIcon, {}), bg: "#1f2937", text: "#f9fafb" }
|
|
1324
|
+
];
|
|
1325
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
|
|
1326
|
+
onBack && /* @__PURE__ */ jsxRuntime.jsxs(
|
|
1327
|
+
"button",
|
|
1328
|
+
{
|
|
1329
|
+
onClick: onBack,
|
|
1330
|
+
style: {
|
|
1331
|
+
display: "flex",
|
|
1332
|
+
alignItems: "center",
|
|
1333
|
+
gap: 8,
|
|
1334
|
+
padding: "12px 16px",
|
|
1335
|
+
width: "100%",
|
|
1336
|
+
border: "none",
|
|
1337
|
+
background: "transparent",
|
|
1338
|
+
cursor: "pointer",
|
|
1339
|
+
fontSize: 15,
|
|
1340
|
+
fontWeight: 600,
|
|
1341
|
+
color: "var(--color-alias-text-colors-primary, #060d26)"
|
|
1342
|
+
},
|
|
1343
|
+
children: [
|
|
1344
|
+
/* @__PURE__ */ jsxRuntime.jsx("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", children: /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M19 12H5M12 19l-7-7 7-7" }) }),
|
|
1345
|
+
"\u0E42\u0E2B\u0E21\u0E14\u0E2A\u0E27\u0E48\u0E32\u0E07/\u0E21\u0E37\u0E14"
|
|
1346
|
+
]
|
|
1347
|
+
}
|
|
1348
|
+
),
|
|
1349
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { style: { padding: "12px 16px", display: "flex", gap: 12 }, children: options.map((opt) => {
|
|
1350
|
+
const isSelected = theme === opt.key;
|
|
1351
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
1352
|
+
"button",
|
|
1353
|
+
{
|
|
1354
|
+
onClick: () => setTheme(opt.key),
|
|
1355
|
+
style: {
|
|
1356
|
+
flex: 1,
|
|
1357
|
+
padding: "20px 12px",
|
|
1358
|
+
borderRadius: 12,
|
|
1359
|
+
border: isSelected ? "2px solid var(--color-alias-color-brand-primary, #1e7d55)" : "2px solid var(--color-border-colors-neutral, #c8cedd)",
|
|
1360
|
+
background: opt.bg,
|
|
1361
|
+
cursor: "pointer",
|
|
1362
|
+
display: "flex",
|
|
1363
|
+
flexDirection: "column",
|
|
1364
|
+
alignItems: "center",
|
|
1365
|
+
gap: 8,
|
|
1366
|
+
transition: "all 0.2s ease"
|
|
1367
|
+
},
|
|
1368
|
+
children: [
|
|
1369
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { style: { color: opt.text }, children: opt.icon }),
|
|
1370
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { style: {
|
|
1371
|
+
fontSize: 13,
|
|
1372
|
+
fontWeight: isSelected ? 700 : 500,
|
|
1373
|
+
color: opt.text
|
|
1374
|
+
}, children: opt.label }),
|
|
1375
|
+
isSelected && /* @__PURE__ */ jsxRuntime.jsx("span", { style: {
|
|
1376
|
+
width: 20,
|
|
1377
|
+
height: 20,
|
|
1378
|
+
borderRadius: "50%",
|
|
1379
|
+
background: "var(--color-alias-color-brand-primary, #1e7d55)",
|
|
1380
|
+
display: "flex",
|
|
1381
|
+
alignItems: "center",
|
|
1382
|
+
justifyContent: "center"
|
|
1383
|
+
}, children: /* @__PURE__ */ jsxRuntime.jsx("svg", { width: "12", height: "12", viewBox: "0 0 24 24", fill: "none", stroke: "#fff", strokeWidth: "3", children: /* @__PURE__ */ jsxRuntime.jsx("polyline", { points: "20 6 9 17 4 12" }) }) })
|
|
1384
|
+
]
|
|
1385
|
+
},
|
|
1386
|
+
opt.key
|
|
1387
|
+
);
|
|
1388
|
+
}) })
|
|
1389
|
+
] });
|
|
1390
|
+
}
|
|
1391
|
+
function FontSizeSettings({ onBack }) {
|
|
1392
|
+
const { fontSize, setFontSize, fontSizeOption } = useSettings();
|
|
1393
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
|
|
1394
|
+
onBack && /* @__PURE__ */ jsxRuntime.jsxs(
|
|
1395
|
+
"button",
|
|
1396
|
+
{
|
|
1397
|
+
onClick: onBack,
|
|
1398
|
+
style: {
|
|
1399
|
+
display: "flex",
|
|
1400
|
+
alignItems: "center",
|
|
1401
|
+
gap: 8,
|
|
1402
|
+
padding: "12px 16px",
|
|
1403
|
+
width: "100%",
|
|
1404
|
+
border: "none",
|
|
1405
|
+
background: "transparent",
|
|
1406
|
+
cursor: "pointer",
|
|
1407
|
+
fontSize: 15,
|
|
1408
|
+
fontWeight: 600,
|
|
1409
|
+
color: "var(--color-alias-text-colors-primary, #060d26)"
|
|
1410
|
+
},
|
|
1411
|
+
children: [
|
|
1412
|
+
/* @__PURE__ */ jsxRuntime.jsx("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", children: /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M19 12H5M12 19l-7-7 7-7" }) }),
|
|
1413
|
+
"\u0E02\u0E19\u0E32\u0E14\u0E15\u0E31\u0E27\u0E2D\u0E31\u0E01\u0E29\u0E23"
|
|
1414
|
+
]
|
|
1415
|
+
}
|
|
1416
|
+
),
|
|
1417
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { style: {
|
|
1418
|
+
margin: "8px 16px",
|
|
1419
|
+
padding: "16px",
|
|
1420
|
+
borderRadius: 10,
|
|
1421
|
+
background: "var(--color-foundations-fuji-pallet-light, #f5f6fa)",
|
|
1422
|
+
textAlign: "center"
|
|
1423
|
+
}, children: [
|
|
1424
|
+
/* @__PURE__ */ jsxRuntime.jsx("p", { style: {
|
|
1425
|
+
fontSize: `${16 * fontSizeOption.scale}px`,
|
|
1426
|
+
fontWeight: 500,
|
|
1427
|
+
color: "var(--color-alias-text-colors-primary, #060d26)",
|
|
1428
|
+
margin: 0
|
|
1429
|
+
}, children: "\u0E15\u0E31\u0E27\u0E2D\u0E22\u0E48\u0E32\u0E07\u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21" }),
|
|
1430
|
+
/* @__PURE__ */ jsxRuntime.jsxs("p", { style: {
|
|
1431
|
+
fontSize: `${12 * fontSizeOption.scale}px`,
|
|
1432
|
+
color: "var(--color-alias-text-colors-tertiary, #475272)",
|
|
1433
|
+
margin: "4px 0 0"
|
|
1434
|
+
}, children: [
|
|
1435
|
+
"\xD7",
|
|
1436
|
+
fontSizeOption.scale
|
|
1437
|
+
] })
|
|
1438
|
+
] }),
|
|
1439
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { style: { padding: "8px 16px", display: "flex", flexDirection: "column", gap: 4 }, children: FONT_SIZE_OPTIONS.map((opt) => {
|
|
1440
|
+
const isSelected = fontSize === opt.key;
|
|
1441
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
1442
|
+
"button",
|
|
1443
|
+
{
|
|
1444
|
+
onClick: () => setFontSize(opt.key),
|
|
1445
|
+
onMouseEnter: (e) => {
|
|
1446
|
+
if (!isSelected) e.currentTarget.style.backgroundColor = "#f9fafb";
|
|
1447
|
+
},
|
|
1448
|
+
onMouseLeave: (e) => {
|
|
1449
|
+
if (!isSelected) e.currentTarget.style.backgroundColor = "transparent";
|
|
1450
|
+
},
|
|
1451
|
+
style: {
|
|
1452
|
+
display: "flex",
|
|
1453
|
+
alignItems: "center",
|
|
1454
|
+
justifyContent: "space-between",
|
|
1455
|
+
padding: "12px 14px",
|
|
1456
|
+
borderRadius: 8,
|
|
1457
|
+
border: isSelected ? "2px solid var(--color-alias-color-brand-primary, #1e7d55)" : "1px solid transparent",
|
|
1458
|
+
background: isSelected ? "color-mix(in srgb, var(--color-alias-color-brand-primary, #1e7d55) 8%, transparent)" : "transparent",
|
|
1459
|
+
cursor: "pointer",
|
|
1460
|
+
transition: "all 0.15s ease"
|
|
1461
|
+
},
|
|
1462
|
+
children: [
|
|
1463
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { style: {
|
|
1464
|
+
fontSize: `${14 * opt.scale}px`,
|
|
1465
|
+
fontWeight: isSelected ? 600 : 400,
|
|
1466
|
+
color: isSelected ? "var(--color-alias-color-brand-primary, #1e7d55)" : "var(--color-alias-text-colors-primary, #060d26)"
|
|
1467
|
+
}, children: opt.label }),
|
|
1468
|
+
/* @__PURE__ */ jsxRuntime.jsxs("span", { style: {
|
|
1469
|
+
fontSize: 12,
|
|
1470
|
+
color: "var(--color-alias-text-colors-tertiary, #475272)"
|
|
1471
|
+
}, children: [
|
|
1472
|
+
"\xD7",
|
|
1473
|
+
opt.scale
|
|
1474
|
+
] })
|
|
1475
|
+
]
|
|
1476
|
+
},
|
|
1477
|
+
opt.key
|
|
1478
|
+
);
|
|
1479
|
+
}) })
|
|
1480
|
+
] });
|
|
1481
|
+
}
|
|
1482
|
+
function FontSizeIcon() {
|
|
1483
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("svg", { width: "20", height: "20", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: [
|
|
1484
|
+
/* @__PURE__ */ jsxRuntime.jsx("polyline", { points: "4 7 4 4 20 4 20 7" }),
|
|
1485
|
+
/* @__PURE__ */ jsxRuntime.jsx("line", { x1: "9", y1: "20", x2: "15", y2: "20" }),
|
|
1486
|
+
/* @__PURE__ */ jsxRuntime.jsx("line", { x1: "12", y1: "4", x2: "12", y2: "20" })
|
|
1487
|
+
] });
|
|
1488
|
+
}
|
|
1489
|
+
function PaletteIcon() {
|
|
1490
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("svg", { width: "20", height: "20", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: [
|
|
1491
|
+
/* @__PURE__ */ jsxRuntime.jsx("circle", { cx: "12", cy: "12", r: "10" }),
|
|
1492
|
+
/* @__PURE__ */ jsxRuntime.jsx("circle", { cx: "12", cy: "8", r: "1.5", fill: "currentColor" }),
|
|
1493
|
+
/* @__PURE__ */ jsxRuntime.jsx("circle", { cx: "8", cy: "14", r: "1.5", fill: "currentColor" }),
|
|
1494
|
+
/* @__PURE__ */ jsxRuntime.jsx("circle", { cx: "16", cy: "14", r: "1.5", fill: "currentColor" })
|
|
1495
|
+
] });
|
|
1496
|
+
}
|
|
1497
|
+
function SettingsPanel({ className, showTheme = true }) {
|
|
1498
|
+
const [view, setView] = react.useState("menu");
|
|
1499
|
+
if (view === "theme" && showTheme) {
|
|
1500
|
+
return /* @__PURE__ */ jsxRuntime.jsx(ThemeSettings, { onBack: () => setView("menu") });
|
|
1501
|
+
}
|
|
1502
|
+
if (view === "fontSize") {
|
|
1503
|
+
return /* @__PURE__ */ jsxRuntime.jsx(FontSizeSettings, { onBack: () => setView("menu") });
|
|
1504
|
+
}
|
|
1505
|
+
const allMenuItems = [
|
|
1506
|
+
{
|
|
1507
|
+
id: "fontSize",
|
|
1508
|
+
icon: /* @__PURE__ */ jsxRuntime.jsx(FontSizeIcon, {}),
|
|
1509
|
+
label: "\u0E02\u0E19\u0E32\u0E14\u0E15\u0E31\u0E27\u0E2D\u0E31\u0E01\u0E29\u0E23",
|
|
1510
|
+
description: "\u0E40\u0E25\u0E47\u0E01\u0E21\u0E32\u0E01 / \u0E40\u0E25\u0E47\u0E01 / \u0E01\u0E25\u0E32\u0E07 / \u0E43\u0E2B\u0E0D\u0E48 / \u0E43\u0E2B\u0E0D\u0E48\u0E21\u0E32\u0E01",
|
|
1511
|
+
onClick: () => setView("fontSize")
|
|
1512
|
+
},
|
|
1513
|
+
...showTheme ? [{
|
|
1514
|
+
id: "theme",
|
|
1515
|
+
icon: /* @__PURE__ */ jsxRuntime.jsx(PaletteIcon, {}),
|
|
1516
|
+
label: "\u0E42\u0E2B\u0E21\u0E14\u0E2A\u0E27\u0E48\u0E32\u0E07/\u0E21\u0E37\u0E14",
|
|
1517
|
+
description: "\u0E40\u0E1B\u0E25\u0E35\u0E48\u0E22\u0E19\u0E18\u0E35\u0E21\u0E41\u0E2D\u0E1B\u0E1E\u0E25\u0E34\u0E40\u0E04\u0E0A\u0E31\u0E19",
|
|
1518
|
+
onClick: () => setView("theme")
|
|
1519
|
+
}] : []
|
|
1520
|
+
];
|
|
1521
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className, children: [
|
|
1522
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { style: {
|
|
1523
|
+
padding: "16px",
|
|
1524
|
+
borderBottom: "1px solid var(--color-border-colors-neutral, #e5e7eb)"
|
|
1525
|
+
}, children: /* @__PURE__ */ jsxRuntime.jsx("h3", { style: {
|
|
1526
|
+
fontSize: 16,
|
|
1527
|
+
fontWeight: 700,
|
|
1528
|
+
margin: 0,
|
|
1529
|
+
color: "var(--color-alias-text-colors-primary, #060d26)"
|
|
1530
|
+
}, children: "\u0E15\u0E31\u0E49\u0E07\u0E04\u0E48\u0E32\u0E23\u0E30\u0E1A\u0E1A" }) }),
|
|
1531
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { style: { padding: "8px", display: "flex", flexDirection: "column", gap: 2 }, children: allMenuItems.map((item) => /* @__PURE__ */ jsxRuntime.jsxs(
|
|
1532
|
+
"button",
|
|
1533
|
+
{
|
|
1534
|
+
onClick: item.onClick,
|
|
1535
|
+
onMouseEnter: (e) => {
|
|
1536
|
+
e.currentTarget.style.backgroundColor = "#f9fafb";
|
|
1537
|
+
},
|
|
1538
|
+
onMouseLeave: (e) => {
|
|
1539
|
+
e.currentTarget.style.backgroundColor = "transparent";
|
|
1540
|
+
},
|
|
1541
|
+
style: {
|
|
1542
|
+
display: "flex",
|
|
1543
|
+
alignItems: "center",
|
|
1544
|
+
gap: 14,
|
|
1545
|
+
padding: "14px 12px",
|
|
1546
|
+
borderRadius: 10,
|
|
1547
|
+
border: "none",
|
|
1548
|
+
background: "transparent",
|
|
1549
|
+
cursor: "pointer",
|
|
1550
|
+
width: "100%",
|
|
1551
|
+
textAlign: "left",
|
|
1552
|
+
transition: "background-color 0.15s ease"
|
|
1553
|
+
},
|
|
1554
|
+
children: [
|
|
1555
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { style: {
|
|
1556
|
+
width: 40,
|
|
1557
|
+
height: 40,
|
|
1558
|
+
borderRadius: 10,
|
|
1559
|
+
background: "var(--color-foundations-fuji-pallet-light, #ebedf5)",
|
|
1560
|
+
display: "flex",
|
|
1561
|
+
alignItems: "center",
|
|
1562
|
+
justifyContent: "center",
|
|
1563
|
+
color: "var(--color-alias-color-brand-primary, #1e7d55)",
|
|
1564
|
+
flexShrink: 0
|
|
1565
|
+
}, children: item.icon }),
|
|
1566
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { style: { flex: 1, minWidth: 0 }, children: [
|
|
1567
|
+
/* @__PURE__ */ jsxRuntime.jsx("p", { style: {
|
|
1568
|
+
fontSize: 15,
|
|
1569
|
+
fontWeight: 600,
|
|
1570
|
+
margin: 0,
|
|
1571
|
+
color: "var(--color-alias-text-colors-primary, #060d26)"
|
|
1572
|
+
}, children: item.label }),
|
|
1573
|
+
/* @__PURE__ */ jsxRuntime.jsx("p", { style: {
|
|
1574
|
+
fontSize: 12,
|
|
1575
|
+
margin: "2px 0 0",
|
|
1576
|
+
color: "var(--color-alias-text-colors-tertiary, #475272)"
|
|
1577
|
+
}, children: item.description })
|
|
1578
|
+
] }),
|
|
1579
|
+
/* @__PURE__ */ jsxRuntime.jsx("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", children: /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M9 18l6-6-6-6" }) })
|
|
1580
|
+
]
|
|
1581
|
+
},
|
|
1582
|
+
item.id
|
|
1583
|
+
)) })
|
|
1584
|
+
] });
|
|
1585
|
+
}
|
|
1214
1586
|
|
|
1587
|
+
exports.FONT_SIZE_OPTIONS = FONT_SIZE_OPTIONS;
|
|
1588
|
+
exports.FontSizeSettings = FontSizeSettings;
|
|
1589
|
+
exports.SettingsPanel = SettingsPanel;
|
|
1590
|
+
exports.SettingsProvider = SettingsProvider;
|
|
1215
1591
|
exports.SidebarHeader = SidebarHeader;
|
|
1216
1592
|
exports.SidebarMenu = SidebarMenu;
|
|
1217
1593
|
exports.SidebarUserProfile = SidebarUserProfile;
|
|
1218
1594
|
exports.StaffSidebar = StaffSidebar;
|
|
1595
|
+
exports.ThemeSettings = ThemeSettings;
|
|
1219
1596
|
exports.UserHeader = UserHeader;
|
|
1220
1597
|
exports.UserSidebar = UserSidebar;
|
|
1598
|
+
exports.useSettings = useSettings;
|
|
1221
1599
|
//# sourceMappingURL=index.js.map
|
|
1222
1600
|
//# sourceMappingURL=index.js.map
|