@lobehub/ui 1.124.2 → 1.125.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.
@@ -1,6 +1,6 @@
1
1
  /// <reference types="react" />
2
2
  import { type FlexboxProps } from 'react-layout-kit';
3
- import { type IconProps, type IconSizeConfig, type IconSizeType } from "../Icon";
3
+ import { type IconProps, type IconSizeConfig, type IconSizeType, LucideIconProps } from "../Icon";
4
4
  import { type TooltipProps } from "../Tooltip";
5
5
  interface ActionIconSizeConfig extends IconSizeConfig {
6
6
  blockSize?: number | string;
@@ -8,7 +8,7 @@ interface ActionIconSizeConfig extends IconSizeConfig {
8
8
  }
9
9
  type ActionIconSizeType = 'site' | IconSizeType;
10
10
  export type ActionIconSize = ActionIconSizeType | ActionIconSizeConfig;
11
- export interface ActionIconProps extends Omit<IconProps, 'size' | 'icon'>, FlexboxProps {
11
+ export interface ActionIconProps extends LucideIconProps, FlexboxProps {
12
12
  /**
13
13
  * @description Whether the icon is active or not
14
14
  * @default false
@@ -41,6 +41,7 @@ export interface ActionIconProps extends Omit<IconProps, 'size' | 'icon'>, Flexb
41
41
  * @default 'normal'
42
42
  */
43
43
  size?: ActionIconSize;
44
+ spin?: boolean;
44
45
  /**
45
46
  * @description Whether add spotlight background
46
47
  * @default false
@@ -1,6 +1,6 @@
1
1
  /// <reference types="react" />
2
- import { ActionIconProps } from "..";
3
2
  import { type LucideIcon } from 'lucide-react';
3
+ import { type ActionIconProps } from "../ActionIcon";
4
4
  import { DivProps } from "../types";
5
5
  export interface ActionIconGroupItems {
6
6
  icon: LucideIcon;
@@ -3,11 +3,13 @@ import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutPr
3
3
  var _excluded = ["type", "items", "placement", "spotlight", "direction", "dropdownMenu", "onActionClick"];
4
4
  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; }
5
5
  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; }
6
- import { ActionIcon, Icon, Spotlight } from "./..";
7
6
  import { Dropdown } from 'antd';
8
7
  import { MoreHorizontal } from 'lucide-react';
9
8
  import { memo } from 'react';
10
9
  import { Flexbox } from 'react-layout-kit';
10
+ import ActionIcon from "../ActionIcon";
11
+ import Icon from "../Icon";
12
+ import Spotlight from "../Spotlight";
11
13
  import { useStyles } from "./style";
12
14
  import { jsx as _jsx } from "react/jsx-runtime";
13
15
  import { jsxs as _jsxs } from "react/jsx-runtime";
@@ -31,6 +31,7 @@ var ChatInputArea = /*#__PURE__*/forwardRef(function (_ref2, ref) {
31
31
  _onSend = _ref2.onSend,
32
32
  onInput = _ref2.onInput,
33
33
  loading = _ref2.loading,
34
+ onBlur = _ref2.onBlur,
34
35
  value = _ref2.value;
35
36
  var _useStyles = useStyles(),
36
37
  styles = _useStyles.styles;
@@ -60,6 +61,7 @@ var ChatInputArea = /*#__PURE__*/forwardRef(function (_ref2, ref) {
60
61
  children: /*#__PURE__*/_jsx(ChatInputAreaInner, {
61
62
  className: styles.textarea,
62
63
  loading: loading,
64
+ onBlur: onBlur,
63
65
  onInput: onInput,
64
66
  onSend: function onSend() {
65
67
  _onSend === null || _onSend === void 0 || _onSend();
@@ -4,11 +4,11 @@ import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutPr
4
4
  var _excluded = ["pin", "setPin", "className", "setExpand", "title", "position"];
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
- import { ActionIcon } from "../..";
8
7
  import { PanelLeft, Pin, PinOff } from 'lucide-react';
9
8
  import { memo } from 'react';
10
9
  import { Flexbox } from 'react-layout-kit';
11
10
  import useControlledState from 'use-merge-value';
11
+ import ActionIcon from "../../ActionIcon";
12
12
  import { useStyles } from "./style";
13
13
  import { jsx as _jsx } from "react/jsx-runtime";
14
14
  import { jsxs as _jsxs } from "react/jsx-runtime";
@@ -3,11 +3,11 @@ import _asyncToGenerator from "@babel/runtime/helpers/esm/asyncToGenerator";
3
3
  import _regeneratorRuntime from "@babel/runtime/regenerator";
4
4
  import data from '@emoji-mart/data';
5
5
  import Picker from '@emoji-mart/react';
6
- import { Avatar } from "./..";
7
6
  import { Popover } from 'antd';
8
7
  import { memo } from 'react';
9
8
  import useSWR from 'swr';
10
9
  import useMergeState from 'use-merge-value';
10
+ import Avatar from "../Avatar";
11
11
  import { useStyles } from "./style";
12
12
  import { jsx as _jsx } from "react/jsx-runtime";
13
13
  var EmojiPicker = /*#__PURE__*/memo(function (_ref) {
@@ -1,5 +1,5 @@
1
1
  /// <reference types="react" />
2
- import { DivProps } from "..";
2
+ import type { DivProps } from "../types";
3
3
  export interface EmptyCardProps extends DivProps {
4
4
  alt?: string;
5
5
  cover?: string;
@@ -4,11 +4,11 @@ import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutPr
4
4
  var _excluded = ["cover", "visible", "defaultVisible", "onVisibleChange", "alt", "title", "desc", "width", "height"];
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
- import { ActionIcon } from "./..";
8
7
  import { X } from 'lucide-react';
9
8
  import { memo } from 'react';
10
9
  import { Flexbox } from 'react-layout-kit';
11
10
  import useMergeState from 'use-merge-value';
11
+ import ActionIcon from "../ActionIcon";
12
12
  import Img from "../Img";
13
13
  import { useStyles } from "./style";
14
14
  import { jsx as _jsx } from "react/jsx-runtime";
@@ -1,12 +1,13 @@
1
- import { type IconProps } from "../..";
2
1
  import { type CollapseProps } from 'antd';
3
2
  import { type ReactNode } from 'react';
3
+ import { type IconProps } from "../../Icon";
4
4
  export type FormVariant = 'default' | 'block' | 'ghost' | 'pure';
5
5
  export type ItemsType = 'group' | 'flat';
6
6
  export declare const useStyles: (props?: FormVariant | undefined) => import("antd-style").ReturnStyles<{
7
7
  flatGroup: string;
8
8
  group: string;
9
9
  icon: import("antd-style").SerializedStyles;
10
+ mobileFlatGroup: import("antd-style").SerializedStyles;
10
11
  mobileGroupBody: import("antd-style").SerializedStyles;
11
12
  mobileGroupHeader: import("antd-style").SerializedStyles;
12
13
  title: import("antd-style").SerializedStyles;
@@ -2,15 +2,15 @@ import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
2
2
  import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
3
3
  import _taggedTemplateLiteral from "@babel/runtime/helpers/esm/taggedTemplateLiteral";
4
4
  var _excluded = ["className", "icon", "title", "children", "extra", "itemsType", "variant", "defaultActive"];
5
- var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7, _templateObject8, _templateObject9, _templateObject10, _templateObject11;
5
+ var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7, _templateObject8, _templateObject9, _templateObject10, _templateObject11, _templateObject12;
6
6
  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; }
7
7
  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; }
8
- import { Icon } from "../..";
9
8
  import { Collapse } from 'antd';
10
9
  import { createStyles, useResponsive } from 'antd-style';
11
10
  import { ChevronDown } from 'lucide-react';
12
11
  import { memo } from 'react';
13
12
  import { Flexbox } from 'react-layout-kit';
13
+ import Icon from "../../Icon";
14
14
  import { jsx as _jsx } from "react/jsx-runtime";
15
15
  import { jsxs as _jsxs } from "react/jsx-runtime";
16
16
  export var useStyles = createStyles(function (_ref, variant) {
@@ -29,9 +29,10 @@ export var useStyles = createStyles(function (_ref, variant) {
29
29
  flatGroup: cx(css(_templateObject5 || (_templateObject5 = _taggedTemplateLiteral(["\n overflow: hidden;\n padding-inline: 16px;\n "]))), variantStyle),
30
30
  group: cx(isDarkMode && css(_templateObject6 || (_templateObject6 = _taggedTemplateLiteral(["\n .", "-collapse-content {\n background: transparent;\n border-color: ", ";\n }\n\n .", "-collapse-header {\n background: ", ";\n }\n "])), prefixCls, token.colorBorderSecondary, prefixCls, token.colorFillTertiary), css(_templateObject7 || (_templateObject7 = _taggedTemplateLiteral(["\n overflow: hidden;\n flex: none;\n\n .", "-collapse-item {\n border: none;\n }\n\n .", "-collapse-header {\n align-items: center !important;\n border-radius: 0 !important;\n }\n\n .", "-collapse-content-box {\n padding-top: 0 !important;\n padding-bottom: 0 !important;\n }\n\n .", "-form-item-label {\n display: flex;\n flex-direction: column;\n justify-content: center;\n }\n "])), prefixCls, prefixCls, prefixCls, prefixCls), variantStyle),
31
31
  icon: css(_templateObject8 || (_templateObject8 = _taggedTemplateLiteral(["\n transition: all 100ms ", ";\n "])), token.motionEaseOut),
32
- mobileGroupBody: css(_templateObject9 || (_templateObject9 = _taggedTemplateLiteral(["\n padding: 0 16px;\n background: ", ";\n "])), token.colorBgContainer),
33
- mobileGroupHeader: css(_templateObject10 || (_templateObject10 = _taggedTemplateLiteral(["\n padding: 16px;\n background: ", ";\n "])), token.colorBgLayout),
34
- title: css(_templateObject11 || (_templateObject11 = _taggedTemplateLiteral(["\n align-items: center;\n font-size: 16px;\n font-weight: 600;\n\n .anticon {\n color: ", ";\n }\n\n ", " {\n font-size: 14px;\n font-weight: 400;\n opacity: 0.5;\n }\n "])), token.colorPrimary, responsive.mobile)
32
+ mobileFlatGroup: css(_templateObject9 || (_templateObject9 = _taggedTemplateLiteral(["\n border-radius: ", "px;\n "])), token.borderRadiusLG),
33
+ mobileGroupBody: css(_templateObject10 || (_templateObject10 = _taggedTemplateLiteral(["\n padding: 0 16px;\n background: ", ";\n "])), token.colorBgContainer),
34
+ mobileGroupHeader: css(_templateObject11 || (_templateObject11 = _taggedTemplateLiteral(["\n padding: 16px;\n background: ", ";\n "])), token.colorBgLayout),
35
+ title: css(_templateObject12 || (_templateObject12 = _taggedTemplateLiteral(["\n align-items: center;\n font-size: 16px;\n font-weight: 600;\n\n .anticon {\n color: ", ";\n }\n\n ", " {\n font-size: 14px;\n font-weight: 400;\n opacity: 0.5;\n }\n "])), token.colorPrimary, responsive.mobile)
35
36
  };
36
37
  });
37
38
  var FormGroup = /*#__PURE__*/memo(function (_ref2) {
@@ -61,11 +62,8 @@ var FormGroup = /*#__PURE__*/memo(function (_ref2) {
61
62
  });
62
63
  if (itemsType === 'flat') {
63
64
  if (mobile) return /*#__PURE__*/_jsx(Flexbox, {
64
- className: className,
65
- children: /*#__PURE__*/_jsx("div", {
66
- className: styles.mobileGroupBody,
67
- children: children
68
- })
65
+ className: cx(styles.mobileFlatGroup, styles.mobileGroupBody, className),
66
+ children: children
69
67
  });
70
68
  return /*#__PURE__*/_jsx(Flexbox, {
71
69
  className: cx(styles.flatGroup, className),
package/es/Hero/index.js CHANGED
@@ -1,10 +1,11 @@
1
- import { GradientButton, Icon } from "./..";
2
1
  import { Button, ConfigProvider } from 'antd';
3
2
  import { useResponsive } from 'antd-style';
4
3
  import * as LucideIcon from 'lucide-react';
5
4
  import { memo, useCallback } from 'react';
6
5
  import { Center, Flexbox } from 'react-layout-kit';
6
+ import GradientButton from "../GradientButton";
7
7
  import GridBackground from "../GridBackground";
8
+ import Icon from "../Icon";
8
9
  import { useStyles } from "./style";
9
10
  import { jsx as _jsx } from "react/jsx-runtime";
10
11
  import { jsxs as _jsxs } from "react/jsx-runtime";
@@ -6,7 +6,8 @@ export interface IconSizeConfig extends Pick<LucideProps, 'strokeWidth' | 'absol
6
6
  }
7
7
  export type IconSizeType = 'large' | 'normal' | 'small';
8
8
  export type IconSize = IconSizeType | IconSizeConfig;
9
- export interface IconProps extends DivProps, Pick<LucideProps, 'fill' | 'fillRule' | 'fillOpacity' | 'color' | 'focusable'> {
9
+ export type LucideIconProps = Pick<LucideProps, 'fill' | 'fillRule' | 'fillOpacity' | 'color' | 'focusable'>;
10
+ export interface IconProps extends DivProps, LucideIconProps {
10
11
  /**
11
12
  * @description The icon element to be rendered
12
13
  * @type LucideIcon
@@ -0,0 +1,15 @@
1
+ /// <reference types="react" />
2
+ import { ButtonProps } from 'antd';
3
+ export interface MessageInputFooterProps {
4
+ editButtonSize?: ButtonProps['size'];
5
+ onCancel?: () => void;
6
+ onConfirm?: (text: string) => void;
7
+ renderButtons?: (text: string) => ButtonProps[];
8
+ temporarySystemRole?: string;
9
+ text?: {
10
+ cancel?: string;
11
+ confirm?: string;
12
+ };
13
+ }
14
+ declare const MessageInputFooter: import("react").NamedExoticComponent<MessageInputFooterProps>;
15
+ export default MessageInputFooter;
@@ -0,0 +1,40 @@
1
+ import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
2
+ 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; }
3
+ 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; }
4
+ import { Button } from 'antd';
5
+ import { memo } from 'react';
6
+ import { Flexbox } from 'react-layout-kit';
7
+ import { jsx as _jsx } from "react/jsx-runtime";
8
+ import { Fragment as _Fragment } from "react/jsx-runtime";
9
+ import { jsxs as _jsxs } from "react/jsx-runtime";
10
+ var MessageInputFooter = /*#__PURE__*/memo(function (_ref) {
11
+ var text = _ref.text,
12
+ renderButtons = _ref.renderButtons,
13
+ onConfirm = _ref.onConfirm,
14
+ temporarySystemRole = _ref.temporarySystemRole,
15
+ editButtonSize = _ref.editButtonSize,
16
+ onCancel = _ref.onCancel;
17
+ return /*#__PURE__*/_jsx(Flexbox, {
18
+ direction: 'horizontal-reverse',
19
+ gap: 8,
20
+ children: renderButtons && temporarySystemRole ? renderButtons(temporarySystemRole).map(function (buttonProps, index) {
21
+ return /*#__PURE__*/_jsx(Button, _objectSpread({
22
+ size: "small"
23
+ }, buttonProps), index);
24
+ }) : /*#__PURE__*/_jsxs(_Fragment, {
25
+ children: [/*#__PURE__*/_jsx(Button, {
26
+ onClick: function onClick() {
27
+ onConfirm === null || onConfirm === void 0 || onConfirm(temporarySystemRole || '');
28
+ },
29
+ size: editButtonSize,
30
+ type: "primary",
31
+ children: (text === null || text === void 0 ? void 0 : text.confirm) || 'Confirm'
32
+ }), /*#__PURE__*/_jsx(Button, {
33
+ onClick: onCancel,
34
+ size: editButtonSize,
35
+ children: (text === null || text === void 0 ? void 0 : text.cancel) || 'Cancel'
36
+ })]
37
+ })
38
+ });
39
+ });
40
+ export default MessageInputFooter;
@@ -2,41 +2,17 @@ import { ButtonProps } from 'antd';
2
2
  import { type CSSProperties } from 'react';
3
3
  import { type TextAreaProps } from "../Input";
4
4
  import { DivProps } from "../types";
5
- export interface MessageInputProps extends DivProps {
6
- /**
7
- * @description Additional className to apply to the component.
8
- */
5
+ import { type MessageInputFooterProps } from './MessageInputFooter';
6
+ export interface MessageInputProps extends MessageInputFooterProps, DivProps {
9
7
  className?: string;
10
8
  classNames?: TextAreaProps['classNames'];
11
- /**
12
- * @description The default value of the input box.
13
- */
14
9
  defaultValue?: string;
15
10
  editButtonSize?: ButtonProps['size'];
16
11
  height?: number | 'auto' | string;
17
- /**
18
- * @description Callback function triggered when user clicks on the cancel button.
19
- */
20
- onCancel?: () => void;
21
- /**
22
- * @description Callback function triggered when user clicks on the confirm button.
23
- * @param text - The text input by the user.
24
- */
25
- onConfirm?: (text: string) => void;
26
- /**
27
- * @description Custom rendering of the bottom buttons.
28
- * @param text - The text input by the user.
29
- */
30
- renderButtons?: (text: string) => ButtonProps[];
31
- text?: {
32
- cancel?: string;
33
- confirm?: string;
34
- };
12
+ setTemporarySystemRole?: (value: string) => void;
13
+ showFooter?: boolean;
35
14
  textareaClassname?: string;
36
15
  textareaStyle?: CSSProperties;
37
- /**
38
- * @description The type of the input box.
39
- */
40
16
  type?: TextAreaProps['type'];
41
17
  }
42
18
  declare const MessageInput: import("react").NamedExoticComponent<MessageInputProps>;
@@ -1,16 +1,16 @@
1
1
  import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
2
2
  import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
3
3
  import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
4
- var _excluded = ["text", "type", "onCancel", "defaultValue", "onConfirm", "renderButtons", "textareaStyle", "textareaClassname", "placeholder", "height", "style", "editButtonSize", "classNames"];
4
+ var _excluded = ["text", "type", "onCancel", "defaultValue", "onConfirm", "renderButtons", "textareaStyle", "textareaClassname", "placeholder", "height", "style", "editButtonSize", "showFooter", "classNames", "setTemporarySystemRole"];
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
- import { Button } from 'antd';
8
- import { memo, useState } from 'react';
7
+ import { memo } from 'react';
9
8
  import { Flexbox } from 'react-layout-kit';
9
+ import useMergeState from 'use-merge-value';
10
10
  import { TextArea } from "../Input";
11
+ import MessageInputFooter from "./MessageInputFooter";
11
12
  import { useStyles } from "./style";
12
13
  import { jsx as _jsx } from "react/jsx-runtime";
13
- import { Fragment as _Fragment } from "react/jsx-runtime";
14
14
  import { jsxs as _jsxs } from "react/jsx-runtime";
15
15
  var MessageInput = /*#__PURE__*/memo(function (_ref) {
16
16
  var text = _ref.text,
@@ -28,12 +28,18 @@ var MessageInput = /*#__PURE__*/memo(function (_ref) {
28
28
  style = _ref.style,
29
29
  _ref$editButtonSize = _ref.editButtonSize,
30
30
  editButtonSize = _ref$editButtonSize === void 0 ? 'middle' : _ref$editButtonSize,
31
+ _ref$showFooter = _ref.showFooter,
32
+ showFooter = _ref$showFooter === void 0 ? true : _ref$showFooter,
31
33
  classNames = _ref.classNames,
34
+ setTemporarySystemRole = _ref.setTemporarySystemRole,
32
35
  rest = _objectWithoutProperties(_ref, _excluded);
33
- var _useState = useState(defaultValue || ''),
34
- _useState2 = _slicedToArray(_useState, 2),
35
- temporarySystemRole = _useState2[0],
36
- setRole = _useState2[1];
36
+ var _useMergeState = useMergeState(defaultValue || '', {
37
+ defaultValue: defaultValue,
38
+ onChange: setTemporarySystemRole
39
+ }),
40
+ _useMergeState2 = _slicedToArray(_useMergeState, 2),
41
+ role = _useMergeState2[0],
42
+ setRole = _useMergeState2[1];
37
43
  var _useStyles = useStyles(),
38
44
  cx = _useStyles.cx,
39
45
  styles = _useStyles.styles;
@@ -62,28 +68,14 @@ var MessageInput = /*#__PURE__*/memo(function (_ref) {
62
68
  minHeight: '100%'
63
69
  }, textareaStyle),
64
70
  type: type,
65
- value: temporarySystemRole
66
- }), /*#__PURE__*/_jsx(Flexbox, {
67
- direction: 'horizontal-reverse',
68
- gap: 8,
69
- children: renderButtons ? renderButtons(temporarySystemRole).map(function (buttonProps, index) {
70
- return /*#__PURE__*/_jsx(Button, _objectSpread({
71
- size: "small"
72
- }, buttonProps), index);
73
- }) : /*#__PURE__*/_jsxs(_Fragment, {
74
- children: [/*#__PURE__*/_jsx(Button, {
75
- onClick: function onClick() {
76
- onConfirm === null || onConfirm === void 0 || onConfirm(temporarySystemRole);
77
- },
78
- size: editButtonSize,
79
- type: "primary",
80
- children: (text === null || text === void 0 ? void 0 : text.confirm) || 'Confirm'
81
- }), /*#__PURE__*/_jsx(Button, {
82
- onClick: onCancel,
83
- size: editButtonSize,
84
- children: (text === null || text === void 0 ? void 0 : text.cancel) || 'Cancel'
85
- })]
86
- })
71
+ value: role
72
+ }), showFooter && /*#__PURE__*/_jsx(MessageInputFooter, {
73
+ editButtonSize: editButtonSize,
74
+ onCancel: onCancel,
75
+ onConfirm: onConfirm,
76
+ renderButtons: renderButtons,
77
+ temporarySystemRole: role,
78
+ text: text
87
79
  })]
88
80
  }));
89
81
  });
@@ -3,10 +3,11 @@ import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
3
3
  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; }
4
4
  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; }
5
5
  import { createStyles, useResponsive } from 'antd-style';
6
- import { memo } from 'react';
6
+ import { memo, useState } from 'react';
7
7
  import useControlledState from 'use-merge-value';
8
8
  import Markdown from "../Markdown";
9
9
  import MessageInput from "../MessageInput";
10
+ import MessageInputFooter from "../MessageInput/MessageInputFooter";
10
11
  import Modal from "../Modal";
11
12
  import { jsx as _jsx } from "react/jsx-runtime";
12
13
  import { Fragment as _Fragment } from "react/jsx-runtime";
@@ -34,6 +35,10 @@ var MessageModal = /*#__PURE__*/memo(function (_ref2) {
34
35
  mobile = _useResponsive.mobile;
35
36
  var _useStyles = useStyles(),
36
37
  styles = _useStyles.styles;
38
+ var _useState = useState(value),
39
+ _useState2 = _slicedToArray(_useState, 2),
40
+ role = _useState2[0],
41
+ setRole = _useState2[1];
37
42
  var _useControlledState = useControlledState(false, {
38
43
  onChange: onEditingChange,
39
44
  value: editing
@@ -55,8 +60,22 @@ var MessageModal = /*#__PURE__*/memo(function (_ref2) {
55
60
  overflowY: 'auto'
56
61
  };
57
62
  return /*#__PURE__*/_jsx(Modal, {
63
+ allowFullscreen: true,
58
64
  cancelText: (text === null || text === void 0 ? void 0 : text.cancel) || 'Cancel',
59
- footer: isEdit ? null : footer,
65
+ footer: isEdit ? /*#__PURE__*/_jsx(MessageInputFooter, {
66
+ onCancel: function onCancel() {
67
+ return setTyping(false);
68
+ },
69
+ onConfirm: function onConfirm(text) {
70
+ setTyping(false);
71
+ onChange === null || onChange === void 0 || onChange(text);
72
+ },
73
+ temporarySystemRole: role,
74
+ text: {
75
+ cancel: text === null || text === void 0 ? void 0 : text.cancel,
76
+ confirm: text === null || text === void 0 ? void 0 : text.confirm
77
+ }
78
+ }) : footer,
60
79
  okText: (text === null || text === void 0 ? void 0 : text.edit) || 'Edit',
61
80
  onCancel: function onCancel() {
62
81
  return setExpand(false);
@@ -65,30 +84,16 @@ var MessageModal = /*#__PURE__*/memo(function (_ref2) {
65
84
  return setTyping(true);
66
85
  },
67
86
  open: expand,
68
- styles: mobile ? {
69
- body: {
70
- padding: 16
71
- }
72
- } : {},
73
- title: (text === null || text === void 0 ? void 0 : text.title) || ' ',
87
+ title: text === null || text === void 0 ? void 0 : text.title,
74
88
  children: isEdit ? /*#__PURE__*/_jsx(MessageInput, {
75
- defaultValue: value,
89
+ defaultValue: role,
76
90
  height: height,
77
- onCancel: function onCancel() {
78
- return setTyping(false);
79
- },
80
- onConfirm: function onConfirm(text) {
81
- setTyping(false);
82
- onChange === null || onChange === void 0 || onChange(text);
83
- },
84
91
  placeholder: placeholder,
92
+ setTemporarySystemRole: setRole,
93
+ showFooter: false,
85
94
  style: mobile ? {
86
95
  height: '100%'
87
96
  } : {},
88
- text: {
89
- cancel: text === null || text === void 0 ? void 0 : text.cancel,
90
- confirm: text === null || text === void 0 ? void 0 : text.confirm
91
- },
92
97
  textareaStyle: mobile ? {
93
98
  flex: 1,
94
99
  minHeight: 'unset'
@@ -1,5 +1,12 @@
1
1
  /// <reference types="react" />
2
2
  import { type ModalProps as AntModalProps } from 'antd';
3
- export type ModalProps = AntModalProps;
4
- declare const Modal: import("react").NamedExoticComponent<AntModalProps>;
3
+ export type ModalProps = AntModalProps & {
4
+ allowFullscreen?: boolean;
5
+ maxHeight?: string | number | false;
6
+ paddings?: {
7
+ desktop?: number;
8
+ mobile?: number;
9
+ };
10
+ };
11
+ declare const Modal: import("react").NamedExoticComponent<ModalProps>;
5
12
  export default Modal;
package/es/Modal/index.js CHANGED
@@ -1,69 +1,93 @@
1
1
  import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
2
+ import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
2
3
  import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
3
4
  import _taggedTemplateLiteral from "@babel/runtime/helpers/esm/taggedTemplateLiteral";
4
- var _excluded = ["children", "title", "className", "wrapClassName", "width", "onCancel", "open", "destroyOnClose"];
5
- var _templateObject, _templateObject2;
5
+ var _excluded = ["allowFullscreen", "children", "title", "className", "wrapClassName", "width", "onCancel", "open", "destroyOnClose", "paddings", "maxHeight", "footer", "styles"],
6
+ _excluded2 = ["body"];
7
+ var _templateObject, _templateObject2, _templateObject3, _templateObject4;
6
8
  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; }
7
9
  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; }
8
10
  import { Modal as AntModal, ConfigProvider, Drawer } from 'antd';
9
11
  import { createStyles, useResponsive } from 'antd-style';
10
- import { X } from 'lucide-react';
12
+ import { isNumber } from 'lodash-es';
13
+ import { Maximize2, Minimize2, X } from 'lucide-react';
11
14
  import { lighten } from 'polished';
12
- import { memo } from 'react';
15
+ import { memo, useState } from 'react';
13
16
  import ActionIcon from "../ActionIcon";
14
17
  import Icon from "../Icon";
15
18
  import { jsx as _jsx } from "react/jsx-runtime";
16
- var useStyles = createStyles(function (_ref) {
17
- var css = _ref.css,
19
+ var HEADER_HEIGHT = 56;
20
+ var FOOTER_HEIGHT = 68;
21
+ var useStyles = createStyles(function (_ref, _ref2) {
22
+ var cx = _ref.cx,
23
+ css = _ref.css,
18
24
  token = _ref.token,
19
25
  prefixCls = _ref.prefixCls;
26
+ var maxHeight = _ref2.maxHeight;
20
27
  return {
21
- content: css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n .", "-modal-body {\n overflow: hidden;\n padding: 0 16px 16px;\n }\n .", "-modal-footer {\n padding: 0 16px 16px;\n }\n .", "-modal-header {\n display: flex;\n gap: 4px;\n align-items: center;\n justify-content: center;\n\n margin-bottom: 0;\n padding: 16px;\n }\n .", "-modal-content {\n overflow: hidden;\n padding: 0;\n border: 1px solid ", ";\n border-radius: ", "px;\n }\n "])), prefixCls, prefixCls, prefixCls, prefixCls, token.colorSplit, token.borderRadiusLG),
22
- wrap: css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n overflow: hidden auto;\n backdrop-filter: blur(2px);\n "])))
28
+ content: cx(maxHeight && css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n .", "-modal-body {\n overflow: auto;\n max-height: ", ";\n }\n "])), prefixCls, maxHeight), css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n .", "-modal-footer {\n margin: 0;\n padding: 16px;\n }\n .", "-modal-header {\n display: flex;\n gap: 4px;\n align-items: center;\n justify-content: center;\n\n height: 56px;\n margin-bottom: 0;\n padding: 16px;\n }\n .", "-modal-content {\n overflow: hidden;\n padding: 0;\n border: 1px solid ", ";\n border-radius: ", "px;\n }\n "])), prefixCls, prefixCls, prefixCls, token.colorSplit, token.borderRadiusLG)),
29
+ drawerContent: css(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n .", "-drawer-close {\n padding: 0;\n }\n .", "-drawer-wrapper-body {\n background: linear-gradient(to bottom, ", ", ", ");\n }\n .", "-drawer-header {\n padding: 8px;\n }\n\n .", "-drawer-footer {\n display: flex;\n align-items: center;\n justify-content: flex-end;\n\n padding: 16px;\n\n border: none;\n }\n "])), prefixCls, prefixCls, token.colorBgContainer, token.colorBgLayout, prefixCls, prefixCls),
30
+ wrap: css(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n overflow: hidden auto;\n backdrop-filter: blur(2px);\n "])))
23
31
  };
24
32
  });
25
- var Modal = /*#__PURE__*/memo(function (_ref2) {
26
- var children = _ref2.children,
27
- title = _ref2.title,
28
- className = _ref2.className,
29
- wrapClassName = _ref2.wrapClassName,
30
- _ref2$width = _ref2.width,
31
- width = _ref2$width === void 0 ? 700 : _ref2$width,
32
- onCancel = _ref2.onCancel,
33
- open = _ref2.open,
34
- destroyOnClose = _ref2.destroyOnClose,
35
- rest = _objectWithoutProperties(_ref2, _excluded);
33
+ var Modal = /*#__PURE__*/memo(function (_ref3) {
34
+ var _paddings$desktop, _paddings$desktop2;
35
+ var allowFullscreen = _ref3.allowFullscreen,
36
+ children = _ref3.children,
37
+ _ref3$title = _ref3.title,
38
+ title = _ref3$title === void 0 ? ' ' : _ref3$title,
39
+ className = _ref3.className,
40
+ wrapClassName = _ref3.wrapClassName,
41
+ _ref3$width = _ref3.width,
42
+ width = _ref3$width === void 0 ? 700 : _ref3$width,
43
+ onCancel = _ref3.onCancel,
44
+ open = _ref3.open,
45
+ destroyOnClose = _ref3.destroyOnClose,
46
+ paddings = _ref3.paddings,
47
+ _ref3$maxHeight = _ref3.maxHeight,
48
+ maxHeight = _ref3$maxHeight === void 0 ? '75vh' : _ref3$maxHeight,
49
+ footer = _ref3.footer,
50
+ _ref3$styles = _ref3.styles,
51
+ stylesProps = _ref3$styles === void 0 ? {} : _ref3$styles,
52
+ rest = _objectWithoutProperties(_ref3, _excluded);
53
+ var _useState = useState(false),
54
+ _useState2 = _slicedToArray(_useState, 2),
55
+ fullscreen = _useState2[0],
56
+ setFullscreen = _useState2[1];
36
57
  var _useResponsive = useResponsive(),
37
58
  mobile = _useResponsive.mobile;
38
- var _useStyles = useStyles(),
59
+ var _useStyles = useStyles({
60
+ maxHeight: maxHeight ? "calc(".concat(isNumber(maxHeight) ? "".concat(maxHeight, "px") : maxHeight, " - ").concat(HEADER_HEIGHT + (footer ? FOOTER_HEIGHT : 0), "px)") : undefined
61
+ }),
39
62
  styles = _useStyles.styles,
40
63
  cx = _useStyles.cx,
41
64
  theme = _useStyles.theme;
65
+ var body = stylesProps.body,
66
+ restStyles = _objectWithoutProperties(stylesProps, _excluded2);
42
67
  if (mobile) return /*#__PURE__*/_jsx(Drawer, {
68
+ className: cx(styles.drawerContent, className),
43
69
  closeIcon: /*#__PURE__*/_jsx(ActionIcon, {
44
- icon: X,
45
- size: {
46
- blockSize: 32,
47
- fontSize: 20
48
- }
70
+ icon: X
49
71
  }),
50
72
  destroyOnClose: destroyOnClose,
51
- drawerStyle: {
52
- background: "linear-gradient(to bottom, ".concat(theme.colorBgContainer, ", ").concat(theme.colorBgLayout, ")")
53
- },
54
- height: '75vh',
73
+ extra: allowFullscreen && /*#__PURE__*/_jsx(ActionIcon, {
74
+ icon: fullscreen ? Minimize2 : Maximize2,
75
+ onClick: function onClick() {
76
+ return setFullscreen(!fullscreen);
77
+ }
78
+ }),
79
+ footer: footer,
80
+ height: fullscreen ? '100vh' : maxHeight || '75vh',
55
81
  maskClassName: cx(styles.wrap, wrapClassName),
56
82
  onClose: onCancel,
57
83
  open: open,
58
84
  placement: 'bottom',
59
85
  styles: _objectSpread({
60
- body: {
61
- padding: 0
62
- },
63
- header: {
64
- padding: '8px 4px'
65
- }
66
- }, rest.styles),
86
+ body: _objectSpread({
87
+ paddingBlock: "16px ".concat(footer ? 0 : '16px'),
88
+ paddingInline: (_paddings$desktop = paddings === null || paddings === void 0 ? void 0 : paddings.desktop) !== null && _paddings$desktop !== void 0 ? _paddings$desktop : 16
89
+ }, body)
90
+ }, restStyles),
67
91
  title: title,
68
92
  children: children
69
93
  });
@@ -83,9 +107,16 @@ var Modal = /*#__PURE__*/memo(function (_ref2) {
83
107
  }
84
108
  }),
85
109
  destroyOnClose: destroyOnClose,
110
+ footer: footer,
86
111
  maskClosable: true,
87
112
  onCancel: onCancel,
88
113
  open: open,
114
+ styles: _objectSpread({
115
+ body: _objectSpread({
116
+ paddingBlock: "0 ".concat(footer === null ? '16px' : 0),
117
+ paddingInline: (_paddings$desktop2 = paddings === null || paddings === void 0 ? void 0 : paddings.desktop) !== null && _paddings$desktop2 !== void 0 ? _paddings$desktop2 : 16
118
+ }, body)
119
+ }, restStyles),
89
120
  title: title,
90
121
  width: width,
91
122
  wrapClassName: cx(styles.wrap, wrapClassName)
@@ -1,6 +1,6 @@
1
- import { IconProps } from "..";
2
1
  import { SelectProps } from 'antd';
3
2
  import { type CSSProperties, ReactNode } from 'react';
3
+ import { IconProps } from "../Icon";
4
4
  export interface SelectWithImgOptionItem {
5
5
  icon?: IconProps['icon'];
6
6
  img: string;
@@ -2,10 +2,10 @@ import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
2
2
  import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
3
3
  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; }
4
4
  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; }
5
- import { Icon } from "./..";
6
5
  import { memo } from 'react';
7
6
  import { Flexbox } from 'react-layout-kit';
8
7
  import useControlledState from 'use-merge-value';
8
+ import Icon from "../Icon";
9
9
  import Img from "../Img";
10
10
  import { useStyles } from "./styles";
11
11
  import { jsx as _jsx } from "react/jsx-runtime";
@@ -3,5 +3,5 @@ var _templateObject;
3
3
  import { css } from 'antd-style';
4
4
  import { readableColor, rgba } from 'polished';
5
5
  export default (function (token) {
6
- return css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n .", "-checkbox-inner:after {\n border-color: ", " !important;\n }\n\n .", "-btn {\n box-shadow: none;\n }\n\n .", "-btn-primary {\n color: ", " !important;\n\n &:hover {\n color: ", " !important;\n }\n\n &:active {\n color: ", " !important;\n }\n }\n\n .", "-tooltip-inner {\n display: flex;\n align-items: center;\n justify-content: center;\n\n min-height: unset;\n padding: 4px 8px;\n\n color: ", " !important;\n\n background-color: ", " !important;\n border-radius: ", "px !important;\n }\n\n .", "-tooltip-arrow {\n &::before,\n &::after {\n background: ", " !important;\n }\n }\n\n .", "-switch-handle::before {\n background: ", " !important;\n }\n\n .", "-image-preview-close,\n .", "-image-preview-switch-right,.", "-image-preview-switch-left {\n ", ";\n border-radius: ", "px;\n background: ", ";\n\n width: 32px;\n height: 32px;\n\n display: flex;\n align-items: center;\n justify-content: center;\n\n padding: 0;\n }\n\n .", "-dropdown {\n .", "-dropdown-menu {\n border: 1px solid ", ";\n border-radius: ", "px !important;\n box-shadow: ", ";\n }\n }\n\n @media (max-width: 575px) {\n .", "-tooltip {\n display: none !important;\n }\n }\n"])), token.prefixCls, readableColor(token.colorPrimary), token.prefixCls, token.prefixCls, readableColor(token.colorPrimary), readableColor(token.colorPrimary), readableColor(token.colorPrimaryActive), token.prefixCls, token.colorBgLayout, token.colorText, token.borderRadiusSM, token.prefixCls, token.colorText, token.prefixCls, token.colorBgContainer, token.prefixCls, token.prefixCls, token.prefixCls, token.stylish.blur, token.borderRadiusLG, rgba(token.colorBgMask, 0.1), token.prefixCls, token.prefixCls, token.colorBorderSecondary, token.borderRadius, token.boxShadowSecondary, token.prefixCls);
6
+ return css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n .", "-checkbox-inner:after {\n border-color: ", " !important;\n }\n\n .", "-btn {\n box-shadow: none;\n }\n\n .", "-btn-primary:not(:disabled) {\n color: ", " !important;\n\n &:hover {\n color: ", " !important;\n }\n\n &:active {\n color: ", " !important;\n }\n }\n\n .", "-tooltip-inner {\n display: flex;\n align-items: center;\n justify-content: center;\n\n min-height: unset;\n padding: 4px 8px;\n\n color: ", " !important;\n\n background-color: ", " !important;\n border-radius: ", "px !important;\n }\n\n .", "-tooltip-arrow {\n &::before,\n &::after {\n background: ", " !important;\n }\n }\n\n .", "-switch-handle::before {\n background: ", " !important;\n }\n\n .", "-image-preview-close,\n .", "-image-preview-switch-right,.", "-image-preview-switch-left {\n ", ";\n border-radius: ", "px;\n background: ", ";\n\n width: 32px;\n height: 32px;\n\n display: flex;\n align-items: center;\n justify-content: center;\n\n padding: 0;\n }\n\n .", "-dropdown {\n .", "-dropdown-menu {\n border: 1px solid ", ";\n border-radius: ", "px !important;\n box-shadow: ", ";\n }\n }\n\n @media (max-width: 575px) {\n .", "-tooltip {\n display: none !important;\n }\n }\n"])), token.prefixCls, readableColor(token.colorPrimary), token.prefixCls, token.prefixCls, readableColor(token.colorPrimary), readableColor(token.colorPrimary), readableColor(token.colorPrimaryActive), token.prefixCls, token.colorBgLayout, token.colorText, token.borderRadiusSM, token.prefixCls, token.colorText, token.prefixCls, token.colorBgContainer, token.prefixCls, token.prefixCls, token.prefixCls, token.stylish.blur, token.borderRadiusLG, rgba(token.colorBgMask, 0.1), token.prefixCls, token.prefixCls, token.colorBorderSecondary, token.borderRadius, token.boxShadowSecondary, token.prefixCls);
7
7
  });
@@ -1,6 +1,6 @@
1
1
  /// <reference types="react" />
2
- import { type ActionIconSize } from "..";
3
2
  import { ThemeMode } from 'antd-style';
3
+ import { type ActionIconSize } from "../ActionIcon";
4
4
  import { DivProps } from "../types";
5
5
  export interface ThemeSwitchProps extends DivProps {
6
6
  labels?: {
@@ -1,8 +1,9 @@
1
- import { ActionIcon, Icon } from "./..";
2
1
  import { Dropdown, Select } from 'antd';
3
2
  import { Monitor, Moon, Sun } from 'lucide-react';
4
3
  import { memo, useMemo } from 'react';
5
4
  import { Flexbox } from 'react-layout-kit';
5
+ import ActionIcon from "../ActionIcon";
6
+ import Icon from "../Icon";
6
7
  import { jsx as _jsx } from "react/jsx-runtime";
7
8
  import { jsxs as _jsxs } from "react/jsx-runtime";
8
9
  var icons = {
@@ -1,9 +1,9 @@
1
1
  import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
2
- import { ActionIcon } from "./..";
3
2
  import { Anchor, Collapse, ConfigProvider } from 'antd';
4
3
  import { PanelTopClose, PanelTopOpen } from 'lucide-react';
5
4
  import { memo } from 'react';
6
5
  import useControlledState from 'use-merge-value';
6
+ import ActionIcon from "../ActionIcon";
7
7
  import { useStyles } from "./style";
8
8
  import { jsx as _jsx } from "react/jsx-runtime";
9
9
  export var mapItems = function mapItems(items) {
@@ -13,7 +13,7 @@ export var generateCustomStylish = function generateCustomStylish(_ref) {
13
13
  blurStrong: css(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n backdrop-filter: blur(36px);\n "]))),
14
14
  bottomScrollbar: css(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n ::-webkit-scrollbar {\n width: 0;\n height: 4px;\n background-color: transparent;\n\n &-thumb {\n background-color: ", ";\n border-radius: 4px;\n transition: background-color 500ms ", ";\n }\n\n &-corner {\n display: none;\n width: 0;\n height: 0;\n }\n }\n "])), token.colorFill, token.motionEaseOut),
15
15
  gradientAnimation: css(_templateObject5 || (_templateObject5 = _taggedTemplateLiteral(["\n background-image: linear-gradient(\n -45deg,\n ", ",\n ", ",\n ", ",\n ", "\n );\n background-size: 400% 400%;\n border-radius: inherit;\n animation: 5s ", " 5s ease infinite;\n "])), token.gold, token.magenta, token.geekblue, token.cyan, gradient),
16
- markdown: css(_templateObject6 || (_templateObject6 = _taggedTemplateLiteral(["\n color: ", ";\n\n h1,\n h2,\n h3,\n h4,\n h5 {\n font-weight: 600;\n }\n\n p {\n margin-block: 0 0;\n font-size: 14px;\n line-height: 2;\n color: ", ";\n\n + * {\n margin-block-end: 1em;\n }\n\n &:not(:last-child) {\n margin-bottom: 1.5em;\n }\n }\n\n blockquote {\n margin: 16px 0;\n padding: 0 12px;\n\n p {\n font-style: italic;\n color: ", ";\n }\n }\n\n a {\n color: ", ";\n\n &:hover {\n color: ", ";\n }\n\n &:active {\n color: ", ";\n }\n }\n\n img {\n max-width: 100%;\n }\n\n pre,\n [data-code-type='highlighter'] {\n border: none;\n border-radius: ", "px;\n\n > code {\n padding: 0 !important;\n background: unset !important;\n border: none !important;\n border-radius: unset !important;\n }\n }\n\n *:not([data-code-type='highlighter'], pre) code {\n padding: 2px 6px;\n\n font-size: ", "px;\n color: ", ";\n\n background: ", ";\n border: 1px solid ", ";\n border-radius: ", "px;\n }\n\n table {\n border-spacing: 0;\n\n width: 100%;\n margin-block: 1em 1em;\n margin-inline: 0 0;\n padding: 8px;\n\n border: 1px solid ", ";\n border-radius: ", "px;\n\n code {\n display: inline-flex;\n }\n }\n\n th,\n td {\n padding-block: 10px 10px;\n padding-inline: 16px 16px;\n }\n\n thead {\n tr {\n th {\n background: ", ";\n\n &:first-child {\n border-top-left-radius: ", "px;\n border-bottom-left-radius: ", "px;\n }\n\n &:last-child {\n border-top-right-radius: ", "px;\n border-bottom-right-radius: ", "px;\n }\n }\n }\n }\n\n > ol > li::marker {\n color: ", " !important;\n }\n\n > ul > li {\n line-height: 1.8;\n list-style-type: disc;\n\n &::marker {\n color: ", " !important;\n }\n }\n\n ol,\n ul {\n > li::marker {\n color: ", ";\n }\n }\n\n details {\n margin-bottom: 1em;\n padding: 12px 16px;\n\n background: ", ";\n border: 1px solid ", ";\n border-radius: ", "px;\n\n transition: all 400ms ", ";\n }\n\n details[open] {\n summary {\n padding-bottom: 12px;\n border-bottom: 1px solid ", ";\n }\n }\n "])), token.colorText, token.colorText, token.colorTextDescription, token.colorLink, token.colorLinkHover, token.colorLinkActive, token.borderRadius, token.fontSizeSM, cyanColor, cyanBackground, isDarkMode ? token.cyan1A : token.cyan6A, token.borderRadiusSM, token.colorBorderSecondary, token.borderRadius, token.colorFillTertiary, token.borderRadius, token.borderRadius, token.borderRadius, token.borderRadius, isDarkMode ? token.cyan9A : token.cyan10A, isDarkMode ? token.cyan9A : token.cyan10A, token.colorTextDescription, token.colorFillTertiary, token.colorBorderSecondary, token.borderRadiusLG, token.motionEaseOut, token.colorBorder),
16
+ markdown: css(_templateObject6 || (_templateObject6 = _taggedTemplateLiteral(["\n color: ", ";\n\n h1,\n h2,\n h3,\n h4,\n h5 {\n font-weight: 600;\n }\n\n p {\n margin-block: 0 0;\n font-size: 14px;\n line-height: 2;\n color: ", ";\n\n + * {\n margin-block-end: 1em;\n }\n\n &:not(:last-child) {\n margin-bottom: 1.5em;\n }\n }\n\n blockquote {\n margin: 16px 0;\n padding: 0 12px;\n\n p {\n font-style: italic;\n color: ", ";\n }\n }\n\n a {\n color: ", ";\n\n &:hover {\n color: ", ";\n }\n\n &:active {\n color: ", ";\n }\n }\n\n img {\n max-width: 100%;\n }\n\n pre,\n [data-code-type='highlighter'] {\n border: none;\n border-radius: ", "px;\n\n > code {\n padding: 0 !important;\n background: unset !important;\n border: none !important;\n border-radius: unset !important;\n }\n }\n\n *:not([data-code-type='highlighter'], pre) code {\n padding: 2px 6px;\n\n font-size: ", "px;\n color: ", ";\n\n background: ", ";\n border: 1px solid ", ";\n border-radius: ", "px;\n }\n\n table {\n border-spacing: 0;\n\n width: 100%;\n margin-block: 1em 1em;\n margin-inline: 0 0;\n padding: 8px;\n\n border: 1px solid ", ";\n border-radius: ", "px;\n\n code {\n display: inline-flex;\n }\n }\n\n th,\n td {\n padding-block: 10px 10px;\n padding-inline: 16px 16px;\n }\n\n thead {\n tr {\n th {\n background: ", ";\n\n &:first-child {\n border-top-left-radius: ", "px;\n border-bottom-left-radius: ", "px;\n }\n\n &:last-child {\n border-top-right-radius: ", "px;\n border-bottom-right-radius: ", "px;\n }\n }\n }\n }\n\n > ul > li {\n list-style-type: disc;\n }\n\n > ol,\n > ul {\n > li {\n margin-left: 24px;\n line-height: 1.8;\n\n &::marker {\n color: ", " !important;\n }\n }\n }\n\n ol,\n ul {\n > li::marker {\n color: ", ";\n }\n }\n\n details {\n margin-bottom: 1em;\n padding: 12px 16px;\n\n background: ", ";\n border: 1px solid ", ";\n border-radius: ", "px;\n\n transition: all 400ms ", ";\n }\n\n details[open] {\n summary {\n padding-bottom: 12px;\n border-bottom: 1px solid ", ";\n }\n }\n "])), token.colorText, token.colorText, token.colorTextDescription, token.colorLink, token.colorLinkHover, token.colorLinkActive, token.borderRadius, token.fontSizeSM, cyanColor, cyanBackground, isDarkMode ? token.cyan1A : token.cyan6A, token.borderRadiusSM, token.colorBorderSecondary, token.borderRadius, token.colorFillTertiary, token.borderRadius, token.borderRadius, token.borderRadius, token.borderRadius, isDarkMode ? token.cyan9A : token.cyan10A, token.colorTextDescription, token.colorFillTertiary, token.colorBorderSecondary, token.borderRadiusLG, token.motionEaseOut, token.colorBorder),
17
17
  markdownInChat: css(_templateObject7 || (_templateObject7 = _taggedTemplateLiteral(["\n h1 {\n margin-top: 0;\n margin-block-start: 0;\n font-size: 1.6em;\n }\n\n h2 {\n margin-top: 0;\n margin-block-start: 0;\n font-size: 1.4em;\n }\n\n h3 {\n margin-top: 0;\n margin-block-start: 0;\n font-size: 1.2em;\n }\n\n h4 {\n margin-top: 0;\n margin-block-start: 0;\n font-size: 1.1em;\n }\n\n h5 {\n margin-top: 0;\n margin-block-start: 0;\n font-size: 1em;\n }\n\n > *:last-child {\n margin-bottom: 0 !important;\n }\n\n p {\n line-height: 1.8 !important;\n white-space: pre-wrap !important;\n\n + * {\n margin-block-end: 0.5em !important;\n }\n\n &:not(:last-child) {\n margin-bottom: 1em !important;\n }\n }\n "]))),
18
18
  noScrollbar: css(_templateObject8 || (_templateObject8 = _taggedTemplateLiteral(["\n ::-webkit-scrollbar {\n display: none;\n width: 0;\n height: 0;\n background-color: transparent;\n }\n "]))),
19
19
  resetLinkColor: css(_templateObject9 || (_templateObject9 = _taggedTemplateLiteral(["\n cursor: pointer;\n color: ", ";\n\n &:hover {\n color: ", ";\n }\n "])), token.colorTextSecondary, token.colorText)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lobehub/ui",
3
- "version": "1.124.2",
3
+ "version": "1.125.1",
4
4
  "description": "Lobe UI is an open-source UI component library for building AIGC web apps",
5
5
  "keywords": [
6
6
  "lobehub",
@@ -79,8 +79,8 @@
79
79
  "@giscus/react": "^2",
80
80
  "@lobehub/emojilib": "latest",
81
81
  "@react-spring/web": "^9",
82
- "@splinetool/react-spline": "^2.2.6",
83
- "@splinetool/runtime": "^0.9.504",
82
+ "@splinetool/react-spline": "^2",
83
+ "@splinetool/runtime": "^1",
84
84
  "ahooks": "^3",
85
85
  "chroma-js": "^2",
86
86
  "copy-to-clipboard": "^3",
@@ -137,7 +137,7 @@
137
137
  "eslint": "^8",
138
138
  "father": "4.3.1",
139
139
  "husky": "^8",
140
- "jsdom": "^22",
140
+ "jsdom": "^23",
141
141
  "lint-staged": "^15",
142
142
  "prettier": "^3",
143
143
  "react": "^18",