@tidbcloud/uikit 2.4.0 → 2.4.1

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.1
4
+
5
+ ### Patch Changes
6
+
7
+ - refactor(biz/app-shell): extract back button props for cleaner prop handling ([#542](https://github.com/tidbcloud/tidbcloud-uikit/pull/542))
8
+
3
9
  ## 2.4.0
4
10
 
5
11
  ### Minor Changes
@@ -45,6 +45,7 @@ const AppPageShell = ({
45
45
  }
46
46
  );
47
47
  }
48
+ const { withBack, onBackClick, ...headerPropsWithoutBack } = headerProps ?? {};
48
49
  return /* @__PURE__ */ jsxRuntime.jsxs(
49
50
  PageShellBaseRoot.PageShellBaseRoot,
50
51
  {
@@ -67,10 +68,10 @@ const AppPageShell = ({
67
68
  /* @__PURE__ */ jsxRuntime.jsx(
68
69
  PageShellBaseHeader.PageShellBaseHeader,
69
70
  {
70
- ...headerProps,
71
+ ...headerPropsWithoutBack,
71
72
  leftSection: /* @__PURE__ */ jsxRuntime.jsxs(Group.Group, { wrap: "nowrap", gap: 0, children: [
72
73
  /* @__PURE__ */ jsxRuntime.jsx(ExpandNavbarButtonPlaceholder.ExpandNavbarButtonPlaceholder, {}),
73
- (headerProps == null ? void 0 : headerProps.withBack) && /* @__PURE__ */ jsxRuntime.jsx(PageShellBaseBackButton.PageShellBaseBackButton, { onClick: headerProps == null ? void 0 : headerProps.onBackClick, mr: "md" })
74
+ withBack && /* @__PURE__ */ jsxRuntime.jsx(PageShellBaseBackButton.PageShellBaseBackButton, { onClick: onBackClick, mr: "md" })
74
75
  ] }),
75
76
  sx: styles.mergeSxList([
76
77
  (theme) => ({
@@ -43,6 +43,7 @@ const AppPageShell = ({
43
43
  }
44
44
  );
45
45
  }
46
+ const { withBack, onBackClick, ...headerPropsWithoutBack } = headerProps ?? {};
46
47
  return /* @__PURE__ */ jsxs(
47
48
  PageShellBaseRoot,
48
49
  {
@@ -65,10 +66,10 @@ const AppPageShell = ({
65
66
  /* @__PURE__ */ jsx(
66
67
  PageShellBaseHeader,
67
68
  {
68
- ...headerProps,
69
+ ...headerPropsWithoutBack,
69
70
  leftSection: /* @__PURE__ */ jsxs(Group, { wrap: "nowrap", gap: 0, children: [
70
71
  /* @__PURE__ */ jsx(ExpandNavbarButtonPlaceholder, {}),
71
- (headerProps == null ? void 0 : headerProps.withBack) && /* @__PURE__ */ jsx(PageShellBaseBackButton, { onClick: headerProps == null ? void 0 : headerProps.onBackClick, mr: "md" })
72
+ withBack && /* @__PURE__ */ jsx(PageShellBaseBackButton, { onClick: onBackClick, mr: "md" })
72
73
  ] }),
73
74
  sx: mergeSxList([
74
75
  (theme) => ({
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tidbcloud/uikit",
3
- "version": "2.4.0",
3
+ "version": "2.4.1",
4
4
  "description": "tidbcloud uikit",
5
5
  "type": "module",
6
6
  "main": "dist/primitive/index.cjs",