@lobehub/ui 1.61.0 → 1.62.0

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.
@@ -1,6 +1,10 @@
1
1
  /// <reference types="react" />
2
2
  import { DivProps } from "../types";
3
3
  export interface TokenTagProps extends DivProps {
4
+ /**
5
+ * @default 'left'
6
+ */
7
+ displayMode?: 'left' | 'used';
4
8
  /**
5
9
  * @description Maximum value for the token
6
10
  */
@@ -1,6 +1,6 @@
1
1
  import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
2
2
  import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
3
- var _excluded = ["className", "maxValue", "value", "text"];
3
+ var _excluded = ["className", "displayMode", "maxValue", "value", "text"];
4
4
  function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
5
5
  function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
6
6
  import { forwardRef } from 'react';
@@ -10,6 +10,8 @@ import { jsx as _jsx } from "react/jsx-runtime";
10
10
  import { jsxs as _jsxs } from "react/jsx-runtime";
11
11
  var TokenTag = /*#__PURE__*/forwardRef(function (_ref, ref) {
12
12
  var className = _ref.className,
13
+ _ref$displayMode = _ref.displayMode,
14
+ displayMode = _ref$displayMode === void 0 ? 'left' : _ref$displayMode,
13
15
  maxValue = _ref.maxValue,
14
16
  value = _ref.value,
15
17
  text = _ref.text,
@@ -38,7 +40,7 @@ var TokenTag = /*#__PURE__*/forwardRef(function (_ref, ref) {
38
40
  children: [/*#__PURE__*/_jsx(FluentEmoji, {
39
41
  emoji: emoji,
40
42
  size: ICON_SIZE
41
- }), valueLeft > 0 ? (text === null || text === void 0 ? void 0 : text.tokens) || "Tokens ".concat(valueLeft) : (text === null || text === void 0 ? void 0 : text.overload) || 'Overload']
43
+ }), valueLeft > 0 ? (text === null || text === void 0 ? void 0 : text.tokens) || "Tokens ".concat(displayMode === 'left' ? valueLeft : value) : (text === null || text === void 0 ? void 0 : text.overload) || 'Overload']
42
44
  }));
43
45
  });
44
46
  export default TokenTag;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lobehub/ui",
3
- "version": "1.61.0",
3
+ "version": "1.62.0",
4
4
  "description": "Lobe UI is an open-source UI component library for building chatbot web apps",
5
5
  "keywords": [
6
6
  "lobehub",