@gravity-ui/aikit 0.4.3 → 0.4.5

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,3 +1,4 @@
1
+ import type { TextProps } from '@gravity-ui/uikit';
1
2
  import './Disclaimer.scss';
2
3
  /**
3
4
  * Props for the Disclaimer component
@@ -7,6 +8,8 @@ export type DisclaimerProps = React.PropsWithChildren<{
7
8
  className?: string;
8
9
  /** Disclaimer text to display */
9
10
  text?: string;
11
+ /** Text variant for typography styling */
12
+ variant?: TextProps['variant'];
10
13
  /** QA/test identifier */
11
14
  qa?: string;
12
15
  }>;
@@ -10,6 +10,6 @@ const b = block('disclaimer');
10
10
  * @returns React component
11
11
  */
12
12
  export function Disclaimer(props) {
13
- const { className, qa, children, text } = props;
14
- return (_jsxs("div", { className: b('container', className), "data-qa": qa, children: [text && _jsx(Text, { color: "secondary", children: text }), children] }));
13
+ const { className, qa, children, text, variant } = props;
14
+ return (_jsxs("div", { className: b('container', className), "data-qa": qa, children: [text && (_jsx(Text, { color: "secondary", variant: variant, children: text })), children] }));
15
15
  }
@@ -3,3 +3,7 @@
3
3
  @import '@diplodoc/transform/dist/css/yfm.css';
4
4
 
5
5
  $block: '.#{variables.$ns}markdown-renderer';
6
+
7
+ #{$block} {
8
+ max-width: 100%;
9
+ }
@@ -7,5 +7,5 @@ $block: '.#{variables.$ns}message-balloon';
7
7
  background-color: var(--g-color-base-info-light);
8
8
  padding: var(--g-spacing-2) var(--g-spacing-3);
9
9
  border-radius: var(--g-spacing-3) 0 var(--g-spacing-3) var(--g-spacing-3);
10
- white-space: pre-wrap;
10
+ max-width: 100%;
11
11
  }
@@ -9,7 +9,7 @@ $block: '.#{variables.$ns}base-message';
9
9
 
10
10
  &_variant_user {
11
11
  align-items: flex-end;
12
- margin-left: var(--g-spacing-10);
12
+ max-width: 90%;
13
13
  }
14
14
 
15
15
  &_variant_system,
@@ -8,3 +8,7 @@ $block: '.#{variables.$ns}user-message';
8
8
  gap: var(--g-spacing-1);
9
9
  align-items: flex-end;
10
10
  }
11
+
12
+ #{$block}_format_plain {
13
+ white-space: pre-wrap;
14
+ }
@@ -1,6 +1,6 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { Avatar } from '@gravity-ui/uikit';
3
- import { block } from '../../../utils/cn';
3
+ import { block, modsClassName } from '../../../utils/cn';
4
4
  import { MarkdownRenderer } from '../../atoms/MarkdownRenderer';
5
5
  import { MessageBalloon } from '../../atoms/MessageBalloon';
6
6
  import { BaseMessage } from '../../molecules/BaseMessage';
@@ -8,5 +8,5 @@ import './UserMessage.scss';
8
8
  const b = block('user-message');
9
9
  export const UserMessage = (props) => {
10
10
  const { className, qa, content, actions, showActionsOnHover, showAvatar, avatarUrl = '', timestamp = '', showTimestamp, format = 'plain', transformOptions, } = props;
11
- return (_jsxs("div", { className: b(null, className), "data-qa": qa, children: [showAvatar ? _jsx(Avatar, { imgUrl: avatarUrl, size: "s", view: "filled" }) : null, _jsx(BaseMessage, { role: "user", actions: actions, showActionsOnHover: showActionsOnHover, showTimestamp: showTimestamp, timestamp: timestamp, children: _jsx(MessageBalloon, { children: format === 'markdown' ? (_jsx(MarkdownRenderer, { content: content, transformOptions: transformOptions })) : (content) }) })] }));
11
+ return (_jsxs("div", { className: b(null, className), "data-qa": qa, children: [showAvatar ? _jsx(Avatar, { imgUrl: avatarUrl, size: "s", view: "filled" }) : null, _jsx(BaseMessage, { role: "user", actions: actions, showActionsOnHover: showActionsOnHover, showTimestamp: showTimestamp, timestamp: timestamp, children: _jsx(MessageBalloon, { className: modsClassName(b({ format })), children: format === 'markdown' ? (_jsx(MarkdownRenderer, { content: content, transformOptions: transformOptions })) : (content) }) })] }));
12
12
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gravity-ui/aikit",
3
- "version": "0.4.3",
3
+ "version": "0.4.5",
4
4
  "description": "Gravity UI base kit for building ai assistant chats",
5
5
  "license": "MIT",
6
6
  "main": "./dist/index.js",