@lobehub/ui 1.168.2 → 1.168.3

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.
@@ -6,7 +6,6 @@ export interface HotkeyProps extends Omit<FlexboxProps, 'children'> {
6
6
  kbdClassName?: string;
7
7
  };
8
8
  compact?: boolean;
9
- desc?: string;
10
9
  inverseTheme?: boolean;
11
10
  isApple?: boolean;
12
11
  keys: string;
@@ -1,6 +1,6 @@
1
1
  'use client';
2
2
 
3
- var _excluded = ["classNames", "styles", "keys", "desc", "inverseTheme", "isApple", "compact", "className", "style"];
3
+ var _excluded = ["classNames", "styles", "keys", "inverseTheme", "isApple", "compact", "className", "style"];
4
4
  function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
5
5
  function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
6
6
  function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
@@ -25,7 +25,6 @@ import { useStyles } from "./style";
25
25
  import { KeyMap } from "./type";
26
26
  import { checkIsAppleDevice, splitKeysByPlus, startCase } from "./utils";
27
27
  import { jsx as _jsx } from "react/jsx-runtime";
28
- import { jsxs as _jsxs } from "react/jsx-runtime";
29
28
  var mappingKey = function mappingKey(isAppleDevice) {
30
29
  var _ref;
31
30
  return _ref = {}, _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_ref, KeyMap.Alt, isAppleDevice ? /*#__PURE__*/_jsx(Icon, {
@@ -84,7 +83,6 @@ var Hotkey = /*#__PURE__*/memo(function (_ref2) {
84
83
  var classNames = _ref2.classNames,
85
84
  styles = _ref2.styles,
86
85
  keys = _ref2.keys,
87
- desc = _ref2.desc,
88
86
  inverseTheme = _ref2.inverseTheme,
89
87
  isApple = _ref2.isApple,
90
88
  compact = _ref2.compact,
@@ -109,7 +107,7 @@ var Hotkey = /*#__PURE__*/memo(function (_ref2) {
109
107
  var mapping = useMemo(function () {
110
108
  return mappingKey(isAppleDevice);
111
109
  }, [isAppleDevice]);
112
- return /*#__PURE__*/_jsxs(Flexbox, _objectSpread(_objectSpread({
110
+ return /*#__PURE__*/_jsx(Flexbox, _objectSpread(_objectSpread({
113
111
  align: 'center',
114
112
  className: cx(s, className),
115
113
  gap: 2,
@@ -118,13 +116,7 @@ var Hotkey = /*#__PURE__*/memo(function (_ref2) {
118
116
  visibility: visibility
119
117
  }, style)
120
118
  }, rest), {}, {
121
- children: [desc && /*#__PURE__*/_jsx("span", {
122
- className: classNames === null || classNames === void 0 ? void 0 : classNames.descClassName,
123
- style: _objectSpread({
124
- marginRight: 10
125
- }, styles === null || styles === void 0 ? void 0 : styles.descStyle),
126
- children: desc
127
- }), compact ? /*#__PURE__*/_jsx(Flexbox, {
119
+ children: compact ? /*#__PURE__*/_jsx(Flexbox, {
128
120
  align: 'center',
129
121
  as: 'kbd',
130
122
  className: classNames === null || classNames === void 0 ? void 0 : classNames.descClassName,
@@ -144,7 +136,7 @@ var Hotkey = /*#__PURE__*/memo(function (_ref2) {
144
136
  style: styles === null || styles === void 0 ? void 0 : styles.kbdStyle,
145
137
  children: (_mapping$key2 = mapping[key]) !== null && _mapping$key2 !== void 0 ? _mapping$key2 : startCase(key)
146
138
  }, index);
147
- })]
139
+ })
148
140
  }));
149
141
  });
150
142
  export default Hotkey;
@@ -1,5 +1,10 @@
1
- /// <reference types="react" />
2
- import { TooltipProps as AntdTooltipProps } from 'antd';
3
- export type TooltipProps = AntdTooltipProps;
4
- declare const Tooltip: import("react").NamedExoticComponent<AntdTooltipProps>;
1
+ import { type TooltipProps as AntdTooltipProps } from 'antd';
2
+ import { ReactNode } from 'react';
3
+ import { type HotkeyProps } from "../Hotkey";
4
+ export type TooltipProps = Omit<AntdTooltipProps, 'title'> & {
5
+ hotkey?: string;
6
+ hotkeyProps?: Omit<HotkeyProps, 'keys'>;
7
+ title: ReactNode;
8
+ };
9
+ declare const Tooltip: import("react").NamedExoticComponent<TooltipProps>;
5
10
  export default Tooltip;
@@ -1,7 +1,7 @@
1
1
  'use client';
2
2
 
3
3
  function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
4
- var _excluded = ["className", "arrow"];
4
+ var _excluded = ["hotkey", "className", "arrow", "title", "hotkeyProps"];
5
5
  function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
6
6
  function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
7
7
  function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
@@ -11,12 +11,18 @@ function _objectWithoutProperties(source, excluded) { if (source == null) return
11
11
  function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
12
12
  import { Tooltip as AntdTooltip } from 'antd';
13
13
  import { memo } from 'react';
14
+ import { Flexbox } from 'react-layout-kit';
15
+ import Hotkey from "../Hotkey";
14
16
  import { useStyles } from "./style";
15
17
  import { jsx as _jsx } from "react/jsx-runtime";
18
+ import { jsxs as _jsxs } from "react/jsx-runtime";
16
19
  var Tooltip = /*#__PURE__*/memo(function (_ref) {
17
- var className = _ref.className,
20
+ var hotkey = _ref.hotkey,
21
+ className = _ref.className,
18
22
  _ref$arrow = _ref.arrow,
19
23
  arrow = _ref$arrow === void 0 ? false : _ref$arrow,
24
+ title = _ref.title,
25
+ hotkeyProps = _ref.hotkeyProps,
20
26
  rest = _objectWithoutProperties(_ref, _excluded);
21
27
  var _useStyles = useStyles(),
22
28
  styles = _useStyles.styles,
@@ -25,7 +31,19 @@ var Tooltip = /*#__PURE__*/memo(function (_ref) {
25
31
  arrow: arrow,
26
32
  classNames: {
27
33
  root: cx(styles.tooltip, className)
28
- }
34
+ },
35
+ title: hotkey ? /*#__PURE__*/_jsxs(Flexbox, {
36
+ align: 'center',
37
+ gap: 8,
38
+ horizontal: true,
39
+ justify: 'space-between',
40
+ children: [/*#__PURE__*/_jsx("span", {
41
+ children: title
42
+ }), /*#__PURE__*/_jsx(Hotkey, _objectSpread({
43
+ inverseTheme: true,
44
+ keys: hotkey
45
+ }, hotkeyProps))]
46
+ }) : title
29
47
  }, rest));
30
48
  });
31
49
  export default Tooltip;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lobehub/ui",
3
- "version": "1.168.2",
3
+ "version": "1.168.3",
4
4
  "description": "Lobe UI is an open-source UI component library for building AIGC web apps",
5
5
  "keywords": [
6
6
  "lobehub",