@lobehub/ui 1.156.2 → 1.156.4

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.
@@ -5,6 +5,7 @@ export interface CodeEditorProps {
5
5
  autoFocus?: boolean;
6
6
  className?: string;
7
7
  disabled?: boolean;
8
+ fontSize?: number | string;
8
9
  form?: string;
9
10
  ignoreTabKey?: boolean;
10
11
  insertSpaces?: boolean;
@@ -2,7 +2,7 @@
2
2
 
3
3
  import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
4
4
  import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
5
- var _excluded = ["style", "language", "value", "onValueChange", "resize", "className", "textareaClassName", "type"];
5
+ var _excluded = ["style", "language", "value", "onValueChange", "resize", "className", "textareaClassName", "type", "fontSize"];
6
6
  import { forwardRef } from 'react';
7
7
  import Editor from 'react-simple-code-editor';
8
8
  import SyntaxHighlighter from "../Highlighter/SyntaxHighlighter";
@@ -19,8 +19,11 @@ var CodeEditor = /*#__PURE__*/forwardRef(function (_ref, ref) {
19
19
  textareaClassName = _ref.textareaClassName,
20
20
  _ref$type = _ref.type,
21
21
  type = _ref$type === void 0 ? 'ghost' : _ref$type,
22
+ _ref$fontSize = _ref.fontSize,
23
+ fontSize = _ref$fontSize === void 0 ? 12 : _ref$fontSize,
22
24
  rest = _objectWithoutProperties(_ref, _excluded);
23
25
  var _useStyles = useStyles({
26
+ fontSize: fontSize,
24
27
  resize: resize,
25
28
  type: type
26
29
  }),
@@ -1,4 +1,5 @@
1
1
  export declare const useStyles: (props?: {
2
+ fontSize: string | number;
2
3
  resize: boolean;
3
4
  type: 'ghost' | 'block' | 'pure';
4
5
  } | undefined) => import("antd-style").ReturnStyles<{
@@ -1,15 +1,18 @@
1
1
  import _taggedTemplateLiteral from "@babel/runtime/helpers/esm/taggedTemplateLiteral";
2
2
  var _templateObject, _templateObject2, _templateObject3, _templateObject4;
3
3
  import { createStyles } from 'antd-style';
4
+ import { isNumber } from 'lodash-es';
4
5
  export var useStyles = createStyles(function (_ref, _ref2) {
5
6
  var cx = _ref.cx,
6
7
  css = _ref.css,
7
8
  token = _ref.token;
8
9
  var type = _ref2.type,
9
- resize = _ref2.resize;
10
+ resize = _ref2.resize,
11
+ fontSize = _ref2.fontSize;
12
+ var size = isNumber(fontSize) ? "".concat(fontSize, "px") : fontSize;
10
13
  var typeStylish = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n padding-block: 8px;\n padding-inline: 12px;\n\n background-color: ", ";\n border: 1px solid ", ";\n border-radius: ", "px;\n\n transition:\n background-color 100ms ", ",\n border-color 200ms ", ";\n\n &:hover {\n background-color: ", ";\n border-color: ", ";\n }\n "])), type === 'block' ? token.colorFillTertiary : 'transparent', type === 'block' ? 'transparent' : token.colorBorderSecondary, token.borderRadius, token.motionEaseOut, token.motionEaseOut, type === 'block' ? token.colorFillSecondary : token.colorFillQuaternary, token.colorBorder);
11
14
  return {
12
- container: cx(type !== 'pure' && typeStylish, css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n overflow: hidden auto;\n width: 100%;\n height: fit-content;\n "])))),
15
+ container: cx(type !== 'pure' && typeStylish, css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n overflow: hidden auto;\n width: 100%;\n height: fit-content;\n\n * {\n font-size: ", " !important;\n line-height: 1.5 !important;\n }\n "])), size)),
13
16
  editor: css(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n resize: ", ";\n height: fit-content;\n min-height: 100%;\n font-family: ", " !important;\n\n textarea {\n min-height: 36px !important;\n }\n\n pre {\n min-height: 36px !important;\n word-break: break-all;\n word-wrap: break-word;\n white-space: pre-wrap;\n\n &.shiki {\n margin: 0;\n }\n }\n "])), resize ? 'vertical' : 'none', token.fontFamilyCode),
14
17
  textarea: css(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n overflow: hidden auto;\n\n height: 100% !important;\n\n color: transparent !important;\n word-break: break-all !important;\n word-wrap: break-word !important;\n\n caret-color: ", ";\n\n -webkit-text-fill-color: unset !important;\n\n &::placeholder {\n color: ", ";\n }\n\n &:focus {\n border: none !important;\n outline: none !important;\n box-shadow: none !important;\n }\n "])), token.colorText, token.colorTextQuaternary)
15
18
  };
@@ -2,6 +2,7 @@ import { FC } from 'react';
2
2
  import { DivProps, SvgProps } from "../../types";
3
3
  import './style.css';
4
4
  export interface BrandLoadingProps {
5
+ size?: number;
5
6
  text: FC<SvgProps & DivProps & {
6
7
  size?: number;
7
8
  }>;
@@ -1,14 +1,16 @@
1
1
  import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
2
2
  import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
3
- var _excluded = ["text"];
3
+ var _excluded = ["size", "text"];
4
4
  import "./style.css";
5
5
  import { jsx as _jsx } from "react/jsx-runtime";
6
6
  var BrandLoading = function BrandLoading(_ref) {
7
- var text = _ref.text,
7
+ var size = _ref.size,
8
+ text = _ref.text,
8
9
  rest = _objectWithoutProperties(_ref, _excluded);
9
10
  var RenderText = text;
10
11
  return /*#__PURE__*/_jsx(RenderText, _objectSpread({
11
- className: 'lobe-brand-loading'
12
+ className: 'lobe-brand-loading',
13
+ size: size
12
14
  }, rest));
13
15
  };
14
16
  export default BrandLoading;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lobehub/ui",
3
- "version": "1.156.2",
3
+ "version": "1.156.4",
4
4
  "description": "Lobe UI is an open-source UI component library for building AIGC web apps",
5
5
  "keywords": [
6
6
  "lobehub",