@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 +7 -0
- package/dist/biz/CodeBlock/index.cjs +41 -50
- package/dist/biz/CodeBlock/index.mjs +42 -51
- package/package.json +1 -1
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
|
|
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.
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
{
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
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.
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
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,
|
|
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 {
|
|
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__ */
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
{
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
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__ */
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
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
|
);
|