gov-layout 1.2.28 → 1.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/README.md CHANGED
@@ -222,6 +222,7 @@ const menuItems: MenuItem[] = [
222
222
  - ✅ Default ตั้งค่าระบบ + ช่วยเหลือ (override ได้)
223
223
  - ✅ โปรไฟล์ + ออกจากระบบ ล่างสุดเสมอ
224
224
  - ✅ `dividerAfter` เส้นคั่นระหว่างกลุ่ม
225
+ - ✅ แสดง Avatar Icon อัตโนมัติกรณีผู้ใช้ไม่มีรูปโปรไฟล์ (v1.2.28+) 🆕
225
226
 
226
227
  ---
227
228
 
package/dist/index.js CHANGED
@@ -1109,6 +1109,9 @@ function HamburgerIcon() {
1109
1109
  function MessageOutlinedIcon(props) {
1110
1110
  return /* @__PURE__ */ jsxRuntime.jsx("svg", { focusable: "false", "aria-hidden": "true", viewBox: "0 0 24 24", fill: "currentColor", ...props, children: /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M4 4h16v12H5.17L4 17.17zm0-2c-1.1 0-1.99.9-1.99 2L2 22l4-4h14c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2zm2 10h12v2H6zm0-3h12v2H6zm0-3h12v2H6z" }) });
1111
1111
  }
1112
+ function AvatarIcon2({ size = 20 }) {
1113
+ return /* @__PURE__ */ jsxRuntime.jsx("svg", { width: size, height: size, viewBox: "0 0 24 24", fill: "currentColor", children: /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M12 12c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm0 2c-2.67 0-8 1.34-8 4v2h16v-2c0-2.66-5.33-4-8-4z" }) });
1114
+ }
1112
1115
  function getNotifBg(type) {
1113
1116
  const map = {
1114
1117
  success: "#dcfce7",
@@ -1140,7 +1143,7 @@ function UserHeader({
1140
1143
  className
1141
1144
  }) {
1142
1145
  const displayName = `${user?.firstName || ""} ${user?.lastName || ""}`.trim() || "\u0E1C\u0E39\u0E49\u0E43\u0E0A\u0E49";
1143
- const firstChar = user?.firstName?.charAt(0) || "\u0E1C";
1146
+ user?.firstName?.charAt(0) || "\u0E1C";
1144
1147
  const [isNotifOpen, setIsNotifOpen] = react.useState(false);
1145
1148
  const [activeFilter, setActiveFilter] = react.useState("all");
1146
1149
  const notifRef = react.useRef(null);
@@ -1234,13 +1237,7 @@ function UserHeader({
1234
1237
  justifyContent: "center",
1235
1238
  boxShadow: "0 1px 3px rgba(0,0,0,0.1)"
1236
1239
  },
1237
- children: /* @__PURE__ */ jsxRuntime.jsx(
1238
- "span",
1239
- {
1240
- style: { color: "#fff", fontSize: "18px", fontWeight: 600 },
1241
- children: firstChar
1242
- }
1243
- )
1240
+ children: /* @__PURE__ */ jsxRuntime.jsx(AvatarIcon2, { size: 24 })
1244
1241
  }
1245
1242
  ),
1246
1243
  /* @__PURE__ */ jsxRuntime.jsxs("div", { style: { flex: 1, minWidth: 0 }, children: [
@@ -1634,6 +1631,9 @@ function ProfileIcon2() {
1634
1631
  /* @__PURE__ */ jsxRuntime.jsx("circle", { cx: "12", cy: "7", r: "4" })
1635
1632
  ] });
1636
1633
  }
1634
+ function AvatarIcon3({ size = 20 }) {
1635
+ return /* @__PURE__ */ jsxRuntime.jsx("svg", { width: size, height: size, viewBox: "0 0 24 24", fill: "currentColor", children: /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M12 12c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm0 2c-2.67 0-8 1.34-8 4v2h16v-2c0-2.66-5.33-4-8-4z" }) });
1636
+ }
1637
1637
  function UserSidebar({
1638
1638
  user,
1639
1639
  roleLabel,
@@ -1661,10 +1661,6 @@ function UserSidebar({
1661
1661
  if (user.firstName && user.lastName) return `${user.firstName} ${user.lastName}`;
1662
1662
  return user.firstName || user.lastName || "\u0E1C\u0E39\u0E49\u0E43\u0E0A\u0E49";
1663
1663
  };
1664
- const getInitial = () => {
1665
- if (!user) return "?";
1666
- return user.firstName?.charAt(0) || user.lastName?.charAt(0) || "?";
1667
- };
1668
1664
  const handleMenuClick = (path) => {
1669
1665
  onNavigate(path);
1670
1666
  onClose();
@@ -1753,7 +1749,7 @@ function UserSidebar({
1753
1749
  fontSize: "20px",
1754
1750
  boxShadow: "0 2px 8px rgba(0,0,0,0.1)"
1755
1751
  },
1756
- children: getInitial()
1752
+ children: /* @__PURE__ */ jsxRuntime.jsx(AvatarIcon3, { size: 32 })
1757
1753
  }
1758
1754
  ),
1759
1755
  /* @__PURE__ */ jsxRuntime.jsxs("div", { style: { flex: 1, minWidth: 0 }, children: [