@tidbcloud/uikit 2.4.6 → 2.4.7

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 CHANGED
@@ -1,5 +1,11 @@
1
1
  # @tidbcloud/uikit
2
2
 
3
+ ## 2.4.7
4
+
5
+ ### Patch Changes
6
+
7
+ - feat(AppShell): add headerLeftSection prop and make aboveMenu optional ([#555](https://github.com/tidbcloud/tidbcloud-uikit/pull/555))
8
+
3
9
  ## 2.4.6
4
10
 
5
11
  ### Patch Changes
@@ -60,14 +60,14 @@ const AppShell = ({ banner, navbar, children }) => {
60
60
  /* @__PURE__ */ jsxRuntime.jsx(NavbarSection.NavbarSection, { children: /* @__PURE__ */ jsxRuntime.jsx(
61
61
  NavbarHeader.NavbarHeader,
62
62
  {
63
- logo: navbar.logo,
63
+ logo: navbar.headerLeftSection || navbar.logo,
64
64
  onLogoClick: navbar.onLogoClick,
65
65
  onToggleCollapse: handleNavbarCollapse,
66
66
  px: "md",
67
67
  py: 8
68
68
  }
69
69
  ) }),
70
- /* @__PURE__ */ jsxRuntime.jsx(NavbarSection.NavbarSection, { children: /* @__PURE__ */ jsxRuntime.jsx(Box.Box, { className: "tiui-app-shell-navbar-above-menu", px: "md", children: navbar.aboveMenu }) }),
70
+ navbar.aboveMenu && /* @__PURE__ */ jsxRuntime.jsx(NavbarSection.NavbarSection, { children: /* @__PURE__ */ jsxRuntime.jsx(Box.Box, { className: "tiui-app-shell-navbar-above-menu", px: "md", children: navbar.aboveMenu }) }),
71
71
  /* @__PURE__ */ jsxRuntime.jsx(NavbarSection.NavbarSection, { className: "tiui-app-shell-navbar-menu-section", grow: true, scrollable: true, py: 8, children: /* @__PURE__ */ jsxRuntime.jsx(Stack.Stack, { ref: navMenuRef, className: "tiui-app-shell-navbar-menu", gap: 8, px: "md" }) }),
72
72
  /* @__PURE__ */ jsxRuntime.jsxs(NavbarSection.NavbarSection, { px: "md", pb: "8", children: [
73
73
  /* @__PURE__ */ jsxRuntime.jsx(Divider.Divider, { mx: "-md", mb: 8 }),
@@ -15,10 +15,16 @@ interface AppShellProps {
15
15
  * The logo to display in the navbar
16
16
  */
17
17
  logo: React.ReactNode;
18
+ /**
19
+ * The left section of the navbar header, which is usually the logo
20
+ * If not provided, the logo will be used as the left section
21
+ * @default undefined
22
+ */
23
+ headerLeftSection?: React.ReactNode;
18
24
  /**
19
25
  * Custom content rendered in the navbar section between the header and the main menu.
20
26
  */
21
- aboveMenu: React.ReactNode;
27
+ aboveMenu?: React.ReactNode;
22
28
  /**
23
29
  * The footer section of the navbar
24
30
  */
@@ -15,10 +15,16 @@ interface AppShellProps {
15
15
  * The logo to display in the navbar
16
16
  */
17
17
  logo: React.ReactNode;
18
+ /**
19
+ * The left section of the navbar header, which is usually the logo
20
+ * If not provided, the logo will be used as the left section
21
+ * @default undefined
22
+ */
23
+ headerLeftSection?: React.ReactNode;
18
24
  /**
19
25
  * Custom content rendered in the navbar section between the header and the main menu.
20
26
  */
21
- aboveMenu: React.ReactNode;
27
+ aboveMenu?: React.ReactNode;
22
28
  /**
23
29
  * The footer section of the navbar
24
30
  */
@@ -58,14 +58,14 @@ const AppShell = ({ banner, navbar, children }) => {
58
58
  /* @__PURE__ */ jsx(NavbarSection, { children: /* @__PURE__ */ jsx(
59
59
  NavbarHeader,
60
60
  {
61
- logo: navbar.logo,
61
+ logo: navbar.headerLeftSection || navbar.logo,
62
62
  onLogoClick: navbar.onLogoClick,
63
63
  onToggleCollapse: handleNavbarCollapse,
64
64
  px: "md",
65
65
  py: 8
66
66
  }
67
67
  ) }),
68
- /* @__PURE__ */ jsx(NavbarSection, { children: /* @__PURE__ */ jsx(Box, { className: "tiui-app-shell-navbar-above-menu", px: "md", children: navbar.aboveMenu }) }),
68
+ navbar.aboveMenu && /* @__PURE__ */ jsx(NavbarSection, { children: /* @__PURE__ */ jsx(Box, { className: "tiui-app-shell-navbar-above-menu", px: "md", children: navbar.aboveMenu }) }),
69
69
  /* @__PURE__ */ jsx(NavbarSection, { className: "tiui-app-shell-navbar-menu-section", grow: true, scrollable: true, py: 8, children: /* @__PURE__ */ jsx(Stack, { ref: navMenuRef, className: "tiui-app-shell-navbar-menu", gap: 8, px: "md" }) }),
70
70
  /* @__PURE__ */ jsxs(NavbarSection, { px: "md", pb: "8", children: [
71
71
  /* @__PURE__ */ jsx(Divider, { mx: "-md", mb: 8 }),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tidbcloud/uikit",
3
- "version": "2.4.6",
3
+ "version": "2.4.7",
4
4
  "description": "tidbcloud uikit",
5
5
  "type": "module",
6
6
  "main": "dist/primitive/index.cjs",