@vendorflow/components 2.0.46 → 2.0.47

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.
@@ -0,0 +1,4 @@
1
+ /** @jsxRuntime classic */
2
+ /** @jsx jsx */
3
+ import { jsx } from '@emotion/react';
4
+ export default function ActionsMenu(): jsx.JSX.Element;
@@ -0,0 +1,42 @@
1
+ "use strict";
2
+ var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {
3
+ if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
4
+ return cooked;
5
+ };
6
+ var __assign = (this && this.__assign) || function () {
7
+ __assign = Object.assign || function(t) {
8
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
9
+ s = arguments[i];
10
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
11
+ t[p] = s[p];
12
+ }
13
+ return t;
14
+ };
15
+ return __assign.apply(this, arguments);
16
+ };
17
+ var __importDefault = (this && this.__importDefault) || function (mod) {
18
+ return (mod && mod.__esModule) ? mod : { "default": mod };
19
+ };
20
+ Object.defineProperty(exports, "__esModule", { value: true });
21
+ /** @jsxRuntime classic */
22
+ /** @jsx jsx */
23
+ var react_1 = require("@emotion/react");
24
+ var short_uuid_1 = __importDefault(require("short-uuid"));
25
+ var hooks_1 = require("material-ui-popup-state/hooks");
26
+ var material_1 = require("@mui/material");
27
+ var icons_material_1 = require("@mui/icons-material");
28
+ var react_2 = require("react");
29
+ function ActionsMenu() {
30
+ var popupId = (0, react_2.useRef)(short_uuid_1.default.generate());
31
+ var popupState = (0, hooks_1.usePopupState)({ variant: 'popover', popupId: popupId.current });
32
+ return ((0, react_1.jsx)("div", null,
33
+ (0, react_1.jsx)(material_1.Tooltip, { css: (0, react_1.css)(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n font-size: 0.875rem;\n background-color: #555;\n "], ["\n font-size: 0.875rem;\n background-color: #555;\n "]))), placement: "top", title: "Actions" },
34
+ (0, react_1.jsx)(material_1.IconButton, __assign({}, (0, hooks_1.bindTrigger)(popupState)),
35
+ (0, react_1.jsx)(icons_material_1.MapsUgc, null))),
36
+ (0, react_1.jsx)(material_1.Menu, __assign({}, (0, hooks_1.bindMenu)(popupState), { anchorOrigin: { vertical: 'top', horizontal: 'left' }, transformOrigin: { vertical: 'bottom', horizontal: 'right' } }),
37
+ (0, react_1.jsx)(material_1.MenuItem, null, "Template 1"),
38
+ (0, react_1.jsx)(material_1.MenuItem, null, "Template 2"),
39
+ (0, react_1.jsx)(material_1.MenuItem, null, "Template 3"))));
40
+ }
41
+ exports.default = ActionsMenu;
42
+ var templateObject_1;
@@ -14,6 +14,7 @@ var react_2 = require("react");
14
14
  var react_textarea_autosize_1 = __importDefault(require("react-textarea-autosize"));
15
15
  var material_1 = require("@mui/material");
16
16
  var icons_material_1 = require("@mui/icons-material");
17
+ var ActionsMenu_1 = __importDefault(require("./ActionsMenu"));
17
18
  var MessageInput = (0, react_2.forwardRef)(function (_a, ref) {
18
19
  var handleClickSend = _a.handleClickSend, message = _a.message, placeholder = _a.placeholder, setMessage = _a.setMessage, isSubmitting = _a.isSubmitting;
19
20
  function handleOnChange(_a) {
@@ -42,8 +43,11 @@ var MessageInput = (0, react_2.forwardRef)(function (_a, ref) {
42
43
  var _a, _b;
43
44
  return (0, react_1.css)(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell',\n 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;\n -webkit-font-smoothing: antialiased;\n -moz-osx-font-smoothing: grayscale;\n resize: none;\n width: calc(100% - 3.5rem);\n outline: 0 none transparent;\n font-size: 16px;\n margin: 0.5rem;\n padding: 0.5rem;\n box-sizing: border-box;\n border-radius: 5px;\n border-color: ", ";\n "], ["\n font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell',\n 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;\n -webkit-font-smoothing: antialiased;\n -moz-osx-font-smoothing: grayscale;\n resize: none;\n width: calc(100% - 3.5rem);\n outline: 0 none transparent;\n font-size: 16px;\n margin: 0.5rem;\n padding: 0.5rem;\n box-sizing: border-box;\n border-radius: 5px;\n border-color: ", ";\n "])), ((_b = (_a = theme === null || theme === void 0 ? void 0 : theme.palette) === null || _a === void 0 ? void 0 : _a.primary) === null || _b === void 0 ? void 0 : _b.main) || 'hsl(0, 0%, 89%)');
44
45
  }, placeholder: placeholder || 'Type your message here...', value: message, onChange: handleOnChange, onKeyDown: handleOnKeyDown, minRows: 3, maxRows: 8 }),
45
- (0, react_1.jsx)("div", { css: (0, react_1.css)(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n height: 2rem;\n width: 2rem;\n padding-right: ", ";\n "], ["\n height: 2rem;\n width: 2rem;\n padding-right: ", ";\n "])), isSubmitting ? '0.5rem' : '0.25rem') }, isSubmitting ? ((0, react_1.jsx)(material_1.CircularProgress, { size: "2rem" })) : ((0, react_1.jsx)(material_1.IconButton, { css: (0, react_1.css)(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n height: 100%;\n width: 100%;\n "], ["\n height: 100%;\n width: 100%;\n "]))), onClick: handleOnClickSend, disabled: isSubmitting },
46
- (0, react_1.jsx)(icons_material_1.Send, null))))));
46
+ (0, react_1.jsx)("div", { css: (0, react_1.css)(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n display: flex;\n flex-direction: column;\n justify-content: flex-start;\n align-items: center;\n "], ["\n display: flex;\n flex-direction: column;\n justify-content: flex-start;\n align-items: center;\n "]))) },
47
+ (0, react_1.jsx)(ActionsMenu_1.default, null),
48
+ (0, react_1.jsx)("div", { css: (0, react_1.css)(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n height: 2rem;\n width: 2rem;\n padding-right: ", ";\n "], ["\n height: 2rem;\n width: 2rem;\n padding-right: ", ";\n "])), isSubmitting ? '0.5rem' : '0.25rem') }, isSubmitting ? ((0, react_1.jsx)(material_1.CircularProgress, { size: "2rem" })) : ((0, react_1.jsx)(material_1.Tooltip, { title: "Send Now", placement: "bottom" },
49
+ (0, react_1.jsx)(material_1.IconButton, { css: (0, react_1.css)(templateObject_5 || (templateObject_5 = __makeTemplateObject(["\n height: 100%;\n width: 100%;\n "], ["\n height: 100%;\n width: 100%;\n "]))), onClick: handleOnClickSend, disabled: isSubmitting },
50
+ (0, react_1.jsx)(icons_material_1.Send, null))))))));
47
51
  });
48
52
  exports.default = MessageInput;
49
- var templateObject_1, templateObject_2, templateObject_3, templateObject_4;
53
+ var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vendorflow/components",
3
- "version": "2.0.46",
3
+ "version": "2.0.47",
4
4
  "description": "React components for vendorflow",
5
5
  "main": "lib/index.js",
6
6
  "types": "lib/index.d.ts",
@@ -46,7 +46,7 @@
46
46
  "@emotion/babel-plugin": "^11.3.0",
47
47
  "@emotion/react": "^11.4.0",
48
48
  "@emotion/styled": "^11.3.0",
49
- "@mui/icons-material": "^5.0.3",
49
+ "@mui/icons-material": "^5.2.1",
50
50
  "@mui/lab": "^5.0.0-alpha.50",
51
51
  "@mui/material": "^5.0.3",
52
52
  "@mui/styles": "^5.0.1",
@@ -97,6 +97,7 @@
97
97
  "jest-resolve": "24.9.0",
98
98
  "jest-watch-typeahead": "0.4.2",
99
99
  "lodash": "^4.17.15",
100
+ "material-ui-popup-state": "^2.0.0",
100
101
  "mini-css-extract-plugin": "0.9.0",
101
102
  "nanoid": "^3.1.30",
102
103
  "optimize-css-assets-webpack-plugin": "5.0.3",