@tidbcloud/uikit 2.4.5 → 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,17 @@
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
+
9
+ ## 2.4.6
10
+
11
+ ### Patch Changes
12
+
13
+ - fix(uikit): add custom styles for Code component in theme ([#553](https://github.com/tidbcloud/tidbcloud-uikit/pull/553))
14
+
3
15
  ## 2.4.5
4
16
 
5
17
  ### 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 }),
@@ -1245,6 +1245,16 @@ const theme = createTheme.createTheme({
1245
1245
  }
1246
1246
  return {};
1247
1247
  }
1248
+ },
1249
+ Code: {
1250
+ styles: (theme2) => {
1251
+ return {
1252
+ root: {
1253
+ backgroundColor: themeColor(theme2, "carbon", 3),
1254
+ color: themeColor(theme2, "carbon", 8)
1255
+ }
1256
+ };
1257
+ }
1248
1258
  }
1249
1259
  }
1250
1260
  });
@@ -1243,6 +1243,16 @@ const theme = createTheme({
1243
1243
  }
1244
1244
  return {};
1245
1245
  }
1246
+ },
1247
+ Code: {
1248
+ styles: (theme2) => {
1249
+ return {
1250
+ root: {
1251
+ backgroundColor: themeColor(theme2, "carbon", 3),
1252
+ color: themeColor(theme2, "carbon", 8)
1253
+ }
1254
+ };
1255
+ }
1246
1256
  }
1247
1257
  }
1248
1258
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tidbcloud/uikit",
3
- "version": "2.4.5",
3
+ "version": "2.4.7",
4
4
  "description": "tidbcloud uikit",
5
5
  "type": "module",
6
6
  "main": "dist/primitive/index.cjs",