@antscorp/antsomi-ui 1.3.5-beta.30 → 1.3.5-beta.31

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,5 +1,6 @@
1
1
  import React from 'react';
2
2
  export interface MobileFrameProps extends React.HtmlHTMLAttributes<HTMLDivElement> {
3
3
  size?: 'large' | 'medium';
4
+ backgroundColor?: string;
4
5
  }
5
6
  export declare const MobileFrame: React.FC<React.PropsWithChildren<MobileFrameProps>>;
@@ -16,7 +16,7 @@ import { MobileWrapper, MobileInner, MobileBottomLine } from './styled';
16
16
  export const MobileFrame = (_a) => {
17
17
  var { children } = _a, restOfProps = __rest(_a, ["children"]);
18
18
  return (React.createElement(MobileWrapper, Object.assign({}, restOfProps),
19
- React.createElement(MobileInner, { size: restOfProps.size },
19
+ React.createElement(MobileInner, { backgroundColor: restOfProps.backgroundColor, size: restOfProps.size },
20
20
  children,
21
21
  React.createElement(MobileBottomLine, null))));
22
22
  };
@@ -1,5 +1,5 @@
1
1
  // Libraries
2
- import styled from 'styled-components';
2
+ import styled, { css } from 'styled-components';
3
3
  // Assets
4
4
  import MobileFrame from '@antscorp/antsomi-ui/es/assets/images/iphone.png';
5
5
  export const MobileWrapper = styled.div `
@@ -18,6 +18,11 @@ export const MobileInner = styled.div `
18
18
  border-bottom-left-radius: ${props => (props.size === 'medium' ? 37 : 50)}px;
19
19
  border-bottom-right-radius: ${props => (props.size === 'medium' ? 37 : 50)}px;
20
20
  overflow: hidden;
21
+
22
+ ${props => props.backgroundColor &&
23
+ css `
24
+ background-color: ${props.backgroundColor};
25
+ `}
21
26
  `;
22
27
  export const MobileBottomLine = styled.div `
23
28
  width: 145px;
@@ -10,6 +10,7 @@ interface RichMenuMobileViewProps extends React.HTMLAttributes<HTMLDivElement> {
10
10
  onChangeRichMenu?: (richMenu: RichMenu, source?: 'user' | 'system') => void;
11
11
  onClickCell?: (cellIndex: number) => void;
12
12
  size?: 'large' | 'medium';
13
+ backgroundColor?: string;
13
14
  reCalculateFlag?: boolean | number;
14
15
  }
15
16
  export declare const RichMenuMobileView: React.FC<RichMenuMobileViewProps>;
@@ -22,7 +22,7 @@ import { RichMenuBlock } from '../RichMenuBlock';
22
22
  // Styles
23
23
  import { Image, Message, MessageBox, MessageWrapper, Profile, MobileContent, RichMenuWrapper, TopBar, } from './styled';
24
24
  export const RichMenuMobileView = props => {
25
- const { richMenu, className, isPreview, onChangeRichMenu, onClickCell, reCalculateFlag, messagePreview, size } = props, restOfProps = __rest(props, ["richMenu", "className", "isPreview", "onChangeRichMenu", "onClickCell", "reCalculateFlag", "messagePreview", "size"]);
25
+ const { richMenu, className, isPreview, onChangeRichMenu, onClickCell, reCalculateFlag, messagePreview, backgroundColor, size } = props, restOfProps = __rest(props, ["richMenu", "className", "isPreview", "onChangeRichMenu", "onClickCell", "reCalculateFlag", "messagePreview", "backgroundColor", "size"]);
26
26
  // State
27
27
  const [state, setState] = useState({
28
28
  showRichMenu: true,
@@ -31,7 +31,7 @@ export const RichMenuMobileView = props => {
31
31
  });
32
32
  // Variables
33
33
  const { showRichMenu, showTypingChat } = state;
34
- return (React.createElement(MobileFrame, Object.assign({ size: size, className: `ants-mx-auto ${className}` }, restOfProps),
34
+ return (React.createElement(MobileFrame, Object.assign({ size: size, backgroundColor: backgroundColor, className: `ants-mx-auto ${className}` }, restOfProps),
35
35
  isPreview && (React.createElement(React.Fragment, null,
36
36
  React.createElement(TopBar, { src: IphoneTopBar, width: "100%", height: "auto" }),
37
37
  (messagePreview === null || messagePreview === void 0 ? void 0 : messagePreview.show) && (React.createElement(MessageBox, null,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@antscorp/antsomi-ui",
3
- "version": "1.3.5-beta.30",
3
+ "version": "1.3.5-beta.31",
4
4
  "description": "An enterprise-class UI design language and React UI library.",
5
5
  "sideEffects": [
6
6
  "dist/*",