@tidbcloud/uikit 2.6.0 → 2.6.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,12 @@
1
1
  # @tidbcloud/uikit
2
2
 
3
+ ## 2.6.1
4
+
5
+ ### Patch Changes
6
+
7
+ - refactor(uikit/biz): replace HoverCard with Tooltip in CodeBlock ([#615](https://github.com/tidbcloud/tidbcloud-uikit/pull/615))
8
+ - fix: update footer content and improve page titles in documentation ([#613](https://github.com/tidbcloud/tidbcloud-uikit/pull/613))
9
+
3
10
  ## 2.6.0
4
11
 
5
12
  ### Minor Changes
@@ -14,7 +14,7 @@ const styles = require("../../utils/styles.cjs");
14
14
  const Box = require("../../node_modules/.pnpm/@mantine_core@7.17.8_patch_hash_3qirwkgu3wxhvd6hnr2gb24yzq_@mantine_hooks@7.17.8_react@18.3.1_e5yvlgwhmeykc75dkphi7jou6q/node_modules/@mantine/core/esm/core/Box/Box.cjs");
15
15
  const Prism = require("../../primitive/Prism/Prism.cjs");
16
16
  const Group = require("../../node_modules/.pnpm/@mantine_core@7.17.8_patch_hash_3qirwkgu3wxhvd6hnr2gb24yzq_@mantine_hooks@7.17.8_react@18.3.1_e5yvlgwhmeykc75dkphi7jou6q/node_modules/@mantine/core/esm/components/Group/Group.cjs");
17
- const HoverCard = require("../../node_modules/.pnpm/@mantine_core@7.17.8_patch_hash_3qirwkgu3wxhvd6hnr2gb24yzq_@mantine_hooks@7.17.8_react@18.3.1_e5yvlgwhmeykc75dkphi7jou6q/node_modules/@mantine/core/esm/components/HoverCard/HoverCard.cjs");
17
+ const Tooltip = require("../../node_modules/.pnpm/@mantine_core@7.17.8_patch_hash_3qirwkgu3wxhvd6hnr2gb24yzq_@mantine_hooks@7.17.8_react@18.3.1_e5yvlgwhmeykc75dkphi7jou6q/node_modules/@mantine/core/esm/components/Tooltip/Tooltip.cjs");
18
18
  const ActionIcon = require("../../node_modules/.pnpm/@mantine_core@7.17.8_patch_hash_3qirwkgu3wxhvd6hnr2gb24yzq_@mantine_hooks@7.17.8_react@18.3.1_e5yvlgwhmeykc75dkphi7jou6q/node_modules/@mantine/core/esm/components/ActionIcon/ActionIcon.cjs");
19
19
  const Code = require("../../node_modules/.pnpm/@mantine_core@7.17.8_patch_hash_3qirwkgu3wxhvd6hnr2gb24yzq_@mantine_hooks@7.17.8_react@18.3.1_e5yvlgwhmeykc75dkphi7jou6q/node_modules/@mantine/core/esm/components/Code/Code.cjs");
20
20
  const useLocalStorage = require("../../node_modules/.pnpm/@mantine_hooks@7.17.8_react@18.3.1/node_modules/@mantine/hooks/esm/use-local-storage/use-local-storage.cjs");
@@ -95,38 +95,32 @@ const CodeBlock = ({
95
95
  }
96
96
  ),
97
97
  /* @__PURE__ */ jsxRuntime.jsxs(Group.Group, { gap: 4, sx: (theme) => ({ position: "absolute", top: 16, right: 16, color: theme.colors.carbon[8] }), children: [
98
- foldIconVisible && /* @__PURE__ */ jsxRuntime.jsxs(HoverCard.HoverCard, { withArrow: true, position: "top", shadow: "xs", children: [
99
- /* @__PURE__ */ jsxRuntime.jsx(HoverCard.HoverCard.Target, { children: /* @__PURE__ */ jsxRuntime.jsx(
100
- ActionIcon.ActionIcon,
101
- {
102
- size: "sm",
103
- variant: "subtle",
104
- onClick: () => {
105
- const v = !folded;
106
- setFolded(v);
107
- onFoldIconClick == null ? void 0 : onFoldIconClick(v);
108
- },
109
- children: folded ? /* @__PURE__ */ jsxRuntime.jsx(index.IconChevronVerticalExpand, { size: 14 }) : /* @__PURE__ */ jsxRuntime.jsx(index.IconChevronVerticalShrink, { size: 14 })
110
- }
111
- ) }),
112
- /* @__PURE__ */ jsxRuntime.jsx(HoverCard.HoverCard.Dropdown, { p: "xs", children: folded ? "Expand" : "Collapse" })
113
- ] }),
114
- withCopyButton && /* @__PURE__ */ jsxRuntime.jsx(CopyButton.CopyButton, { value: copyContent ?? children, timeout: 2e3, children: ({ copied, copy }) => /* @__PURE__ */ jsxRuntime.jsxs(HoverCard.HoverCard, { withArrow: true, position: "top", shadow: "xs", children: [
115
- /* @__PURE__ */ jsxRuntime.jsx(HoverCard.HoverCard.Target, { children: /* @__PURE__ */ jsxRuntime.jsx(
116
- ActionIcon.ActionIcon,
117
- {
118
- "aria-label": "Copy",
119
- size: "sm",
120
- variant: "subtle",
121
- onClick: () => {
122
- copy();
123
- onCopyClick == null ? void 0 : onCopyClick();
124
- },
125
- children: copied ? /* @__PURE__ */ jsxRuntime.jsx(index.IconCheck, { size: 14 }) : /* @__PURE__ */ jsxRuntime.jsx(index.IconCopy01, { size: 14 })
126
- }
127
- ) }),
128
- /* @__PURE__ */ jsxRuntime.jsx(HoverCard.HoverCard.Dropdown, { p: "xs", children: copied ? "Copied" : "Copy" })
129
- ] }) })
98
+ foldIconVisible && /* @__PURE__ */ jsxRuntime.jsx(Tooltip.Tooltip, { withArrow: true, label: folded ? "Expand" : "Collapse", children: /* @__PURE__ */ jsxRuntime.jsx(
99
+ ActionIcon.ActionIcon,
100
+ {
101
+ size: "sm",
102
+ variant: "subtle",
103
+ onClick: () => {
104
+ const v = !folded;
105
+ setFolded(v);
106
+ onFoldIconClick == null ? void 0 : onFoldIconClick(v);
107
+ },
108
+ children: folded ? /* @__PURE__ */ jsxRuntime.jsx(index.IconChevronVerticalExpand, { size: 14 }) : /* @__PURE__ */ jsxRuntime.jsx(index.IconChevronVerticalShrink, { size: 14 })
109
+ }
110
+ ) }),
111
+ withCopyButton && /* @__PURE__ */ jsxRuntime.jsx(CopyButton.CopyButton, { value: copyContent ?? children, timeout: 2e3, children: ({ copied, copy }) => /* @__PURE__ */ jsxRuntime.jsx(Tooltip.Tooltip, { withArrow: true, label: copied ? "Copied" : "Copy", children: /* @__PURE__ */ jsxRuntime.jsx(
112
+ ActionIcon.ActionIcon,
113
+ {
114
+ "aria-label": "Copy",
115
+ size: "sm",
116
+ variant: "subtle",
117
+ onClick: () => {
118
+ copy();
119
+ onCopyClick == null ? void 0 : onCopyClick();
120
+ },
121
+ children: copied ? /* @__PURE__ */ jsxRuntime.jsx(index.IconCheck, { size: 14 }) : /* @__PURE__ */ jsxRuntime.jsx(index.IconCopy03, { size: 14 })
122
+ }
123
+ ) }) })
130
124
  ] })
131
125
  ] });
132
126
  };
@@ -151,23 +145,20 @@ const CopyText = ({ children, value, ...rest }) => {
151
145
  },
152
146
  children: [
153
147
  children,
154
- /* @__PURE__ */ jsxRuntime.jsx(CopyButton.CopyButton, { value, timeout: 2e3, children: ({ copied, copy }) => /* @__PURE__ */ jsxRuntime.jsxs(HoverCard.HoverCard, { withArrow: true, position: "top", shadow: "xs", children: [
155
- /* @__PURE__ */ jsxRuntime.jsx(HoverCard.HoverCard.Target, { children: /* @__PURE__ */ jsxRuntime.jsx(
156
- ActionIcon.ActionIcon,
157
- {
158
- "aria-label": "Copy",
159
- variant: "subtle",
160
- size: "sm",
161
- ml: 8,
162
- display: "inline-block",
163
- onClick: () => {
164
- copy();
165
- },
166
- children: copied ? /* @__PURE__ */ jsxRuntime.jsx(index.IconCheck, { size: 14 }) : /* @__PURE__ */ jsxRuntime.jsx(index.IconCopy01, { size: 14 })
167
- }
168
- ) }),
169
- /* @__PURE__ */ jsxRuntime.jsx(HoverCard.HoverCard.Dropdown, { p: "xs", children: copied ? "Copied" : "Copy" })
170
- ] }) })
148
+ /* @__PURE__ */ jsxRuntime.jsx(CopyButton.CopyButton, { value, timeout: 2e3, children: ({ copied, copy }) => /* @__PURE__ */ jsxRuntime.jsx(Tooltip.Tooltip, { withArrow: true, label: copied ? "Copied" : "Copy", children: /* @__PURE__ */ jsxRuntime.jsx(
149
+ ActionIcon.ActionIcon,
150
+ {
151
+ "aria-label": "Copy",
152
+ variant: "subtle",
153
+ size: "sm",
154
+ ml: 8,
155
+ display: "inline-block",
156
+ onClick: () => {
157
+ copy();
158
+ },
159
+ children: copied ? /* @__PURE__ */ jsxRuntime.jsx(index.IconCheck, { size: 14 }) : /* @__PURE__ */ jsxRuntime.jsx(index.IconCopy03, { size: 14 })
160
+ }
161
+ ) }) })
171
162
  ]
172
163
  }
173
164
  );
@@ -1,6 +1,6 @@
1
1
  import { jsxs, jsx } from "react/jsx-runtime";
2
2
  import { useMemo, useState } from "react";
3
- import { IconChevronVerticalExpand, IconChevronVerticalShrink, IconCheck, IconCopy01 } from "../../icons/index.mjs";
3
+ import { IconChevronVerticalExpand, IconChevronVerticalShrink, IconCheck, IconCopy03 } from "../../icons/index.mjs";
4
4
  /* empty css */
5
5
  /* empty css */
6
6
  /* empty css */
@@ -12,7 +12,7 @@ import { mergeSxList, mergeStylesList } from "../../utils/styles.mjs";
12
12
  import { Box } from "../../node_modules/.pnpm/@mantine_core@7.17.8_patch_hash_3qirwkgu3wxhvd6hnr2gb24yzq_@mantine_hooks@7.17.8_react@18.3.1_e5yvlgwhmeykc75dkphi7jou6q/node_modules/@mantine/core/esm/core/Box/Box.mjs";
13
13
  import { Prism } from "../../primitive/Prism/Prism.mjs";
14
14
  import { Group } from "../../node_modules/.pnpm/@mantine_core@7.17.8_patch_hash_3qirwkgu3wxhvd6hnr2gb24yzq_@mantine_hooks@7.17.8_react@18.3.1_e5yvlgwhmeykc75dkphi7jou6q/node_modules/@mantine/core/esm/components/Group/Group.mjs";
15
- import { HoverCard } from "../../node_modules/.pnpm/@mantine_core@7.17.8_patch_hash_3qirwkgu3wxhvd6hnr2gb24yzq_@mantine_hooks@7.17.8_react@18.3.1_e5yvlgwhmeykc75dkphi7jou6q/node_modules/@mantine/core/esm/components/HoverCard/HoverCard.mjs";
15
+ import { Tooltip } from "../../node_modules/.pnpm/@mantine_core@7.17.8_patch_hash_3qirwkgu3wxhvd6hnr2gb24yzq_@mantine_hooks@7.17.8_react@18.3.1_e5yvlgwhmeykc75dkphi7jou6q/node_modules/@mantine/core/esm/components/Tooltip/Tooltip.mjs";
16
16
  import { ActionIcon } from "../../node_modules/.pnpm/@mantine_core@7.17.8_patch_hash_3qirwkgu3wxhvd6hnr2gb24yzq_@mantine_hooks@7.17.8_react@18.3.1_e5yvlgwhmeykc75dkphi7jou6q/node_modules/@mantine/core/esm/components/ActionIcon/ActionIcon.mjs";
17
17
  import { Code } from "../../node_modules/.pnpm/@mantine_core@7.17.8_patch_hash_3qirwkgu3wxhvd6hnr2gb24yzq_@mantine_hooks@7.17.8_react@18.3.1_e5yvlgwhmeykc75dkphi7jou6q/node_modules/@mantine/core/esm/components/Code/Code.mjs";
18
18
  import { useLocalStorage } from "../../node_modules/.pnpm/@mantine_hooks@7.17.8_react@18.3.1/node_modules/@mantine/hooks/esm/use-local-storage/use-local-storage.mjs";
@@ -93,38 +93,32 @@ const CodeBlock = ({
93
93
  }
94
94
  ),
95
95
  /* @__PURE__ */ jsxs(Group, { gap: 4, sx: (theme) => ({ position: "absolute", top: 16, right: 16, color: theme.colors.carbon[8] }), children: [
96
- foldIconVisible && /* @__PURE__ */ jsxs(HoverCard, { withArrow: true, position: "top", shadow: "xs", children: [
97
- /* @__PURE__ */ jsx(HoverCard.Target, { children: /* @__PURE__ */ jsx(
98
- ActionIcon,
99
- {
100
- size: "sm",
101
- variant: "subtle",
102
- onClick: () => {
103
- const v = !folded;
104
- setFolded(v);
105
- onFoldIconClick == null ? void 0 : onFoldIconClick(v);
106
- },
107
- children: folded ? /* @__PURE__ */ jsx(IconChevronVerticalExpand, { size: 14 }) : /* @__PURE__ */ jsx(IconChevronVerticalShrink, { size: 14 })
108
- }
109
- ) }),
110
- /* @__PURE__ */ jsx(HoverCard.Dropdown, { p: "xs", children: folded ? "Expand" : "Collapse" })
111
- ] }),
112
- withCopyButton && /* @__PURE__ */ jsx(CopyButton, { value: copyContent ?? children, timeout: 2e3, children: ({ copied, copy }) => /* @__PURE__ */ jsxs(HoverCard, { withArrow: true, position: "top", shadow: "xs", children: [
113
- /* @__PURE__ */ jsx(HoverCard.Target, { children: /* @__PURE__ */ jsx(
114
- ActionIcon,
115
- {
116
- "aria-label": "Copy",
117
- size: "sm",
118
- variant: "subtle",
119
- onClick: () => {
120
- copy();
121
- onCopyClick == null ? void 0 : onCopyClick();
122
- },
123
- children: copied ? /* @__PURE__ */ jsx(IconCheck, { size: 14 }) : /* @__PURE__ */ jsx(IconCopy01, { size: 14 })
124
- }
125
- ) }),
126
- /* @__PURE__ */ jsx(HoverCard.Dropdown, { p: "xs", children: copied ? "Copied" : "Copy" })
127
- ] }) })
96
+ foldIconVisible && /* @__PURE__ */ jsx(Tooltip, { withArrow: true, label: folded ? "Expand" : "Collapse", children: /* @__PURE__ */ jsx(
97
+ ActionIcon,
98
+ {
99
+ size: "sm",
100
+ variant: "subtle",
101
+ onClick: () => {
102
+ const v = !folded;
103
+ setFolded(v);
104
+ onFoldIconClick == null ? void 0 : onFoldIconClick(v);
105
+ },
106
+ children: folded ? /* @__PURE__ */ jsx(IconChevronVerticalExpand, { size: 14 }) : /* @__PURE__ */ jsx(IconChevronVerticalShrink, { size: 14 })
107
+ }
108
+ ) }),
109
+ withCopyButton && /* @__PURE__ */ jsx(CopyButton, { value: copyContent ?? children, timeout: 2e3, children: ({ copied, copy }) => /* @__PURE__ */ jsx(Tooltip, { withArrow: true, label: copied ? "Copied" : "Copy", children: /* @__PURE__ */ jsx(
110
+ ActionIcon,
111
+ {
112
+ "aria-label": "Copy",
113
+ size: "sm",
114
+ variant: "subtle",
115
+ onClick: () => {
116
+ copy();
117
+ onCopyClick == null ? void 0 : onCopyClick();
118
+ },
119
+ children: copied ? /* @__PURE__ */ jsx(IconCheck, { size: 14 }) : /* @__PURE__ */ jsx(IconCopy03, { size: 14 })
120
+ }
121
+ ) }) })
128
122
  ] })
129
123
  ] });
130
124
  };
@@ -149,23 +143,20 @@ const CopyText = ({ children, value, ...rest }) => {
149
143
  },
150
144
  children: [
151
145
  children,
152
- /* @__PURE__ */ jsx(CopyButton, { value, timeout: 2e3, children: ({ copied, copy }) => /* @__PURE__ */ jsxs(HoverCard, { withArrow: true, position: "top", shadow: "xs", children: [
153
- /* @__PURE__ */ jsx(HoverCard.Target, { children: /* @__PURE__ */ jsx(
154
- ActionIcon,
155
- {
156
- "aria-label": "Copy",
157
- variant: "subtle",
158
- size: "sm",
159
- ml: 8,
160
- display: "inline-block",
161
- onClick: () => {
162
- copy();
163
- },
164
- children: copied ? /* @__PURE__ */ jsx(IconCheck, { size: 14 }) : /* @__PURE__ */ jsx(IconCopy01, { size: 14 })
165
- }
166
- ) }),
167
- /* @__PURE__ */ jsx(HoverCard.Dropdown, { p: "xs", children: copied ? "Copied" : "Copy" })
168
- ] }) })
146
+ /* @__PURE__ */ jsx(CopyButton, { value, timeout: 2e3, children: ({ copied, copy }) => /* @__PURE__ */ jsx(Tooltip, { withArrow: true, label: copied ? "Copied" : "Copy", children: /* @__PURE__ */ jsx(
147
+ ActionIcon,
148
+ {
149
+ "aria-label": "Copy",
150
+ variant: "subtle",
151
+ size: "sm",
152
+ ml: 8,
153
+ display: "inline-block",
154
+ onClick: () => {
155
+ copy();
156
+ },
157
+ children: copied ? /* @__PURE__ */ jsx(IconCheck, { size: 14 }) : /* @__PURE__ */ jsx(IconCopy03, { size: 14 })
158
+ }
159
+ ) }) })
169
160
  ]
170
161
  }
171
162
  );
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tidbcloud/uikit",
3
- "version": "2.6.0",
3
+ "version": "2.6.1",
4
4
  "description": "tidbcloud uikit",
5
5
  "type": "module",
6
6
  "main": "dist/primitive/index.cjs",