@elliemae/ds-legacy-chat-floating-button 1.0.0-rc.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.
@@ -0,0 +1,36 @@
1
+ "use strict";
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __export = (target, all) => {
9
+ for (var name in all)
10
+ __defProp(target, name, { get: all[name], enumerable: true });
11
+ };
12
+ var __copyProps = (to, from, except, desc) => {
13
+ if (from && typeof from === "object" || typeof from === "function") {
14
+ for (let key of __getOwnPropNames(from))
15
+ if (!__hasOwnProp.call(to, key) && key !== except)
16
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
+ }
18
+ return to;
19
+ };
20
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
+ // If the importer is in node compatibility mode or this is not an ESM
22
+ // file that has been converted to a CommonJS file using a Babel-
23
+ // compatible transform (i.e. "__esModule" has not been set), then set
24
+ // "default" to the CommonJS "module.exports" for node compatibility.
25
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
+ mod
27
+ ));
28
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
+ var DSChatFloatingButtonDefinitions_exports = {};
30
+ __export(DSChatFloatingButtonDefinitions_exports, {
31
+ DSChatFloatingButtonName: () => DSChatFloatingButtonName
32
+ });
33
+ module.exports = __toCommonJS(DSChatFloatingButtonDefinitions_exports);
34
+ var React = __toESM(require("react"));
35
+ const DSChatFloatingButtonName = "DSChatFloatingButton";
36
+ //# sourceMappingURL=DSChatFloatingButtonDefinitions.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../src/DSChatFloatingButtonDefinitions.tsx", "../../../../../scripts/build/transpile/react-shim.js"],
4
+ "sourcesContent": ["export const DSChatFloatingButtonName = 'DSChatFloatingButton';\n", "import * as React from 'react';\nexport { React };\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAhB,MAAM,2BAA2B;",
6
+ "names": []
7
+ }
@@ -0,0 +1,62 @@
1
+ "use strict";
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __export = (target, all) => {
9
+ for (var name in all)
10
+ __defProp(target, name, { get: all[name], enumerable: true });
11
+ };
12
+ var __copyProps = (to, from, except, desc) => {
13
+ if (from && typeof from === "object" || typeof from === "function") {
14
+ for (let key of __getOwnPropNames(from))
15
+ if (!__hasOwnProp.call(to, key) && key !== except)
16
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
+ }
18
+ return to;
19
+ };
20
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
+ // If the importer is in node compatibility mode or this is not an ESM
22
+ // file that has been converted to a CommonJS file using a Babel-
23
+ // compatible transform (i.e. "__esModule" has not been set), then set
24
+ // "default" to the CommonJS "module.exports" for node compatibility.
25
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
+ mod
27
+ ));
28
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
+ var FloatingButton_exports = {};
30
+ __export(FloatingButton_exports, {
31
+ FloatingButton: () => FloatingButton,
32
+ FloatingButtonWithSchema: () => FloatingButtonWithSchema
33
+ });
34
+ module.exports = __toCommonJS(FloatingButton_exports);
35
+ var React = __toESM(require("react"));
36
+ var import_jsx_runtime = require("react/jsx-runtime");
37
+ var import_ds_legacy_props_helpers = require("@elliemae/ds-legacy-props-helpers");
38
+ var import_ds_legacy_icons = require("@elliemae/ds-legacy-icons");
39
+ var import_styled = require("./styled.js");
40
+ var import_react_desc_prop_types = require("./react-desc-prop-types.js");
41
+ var import_DSChatFloatingButtonDefinitions = require("./DSChatFloatingButtonDefinitions.js");
42
+ const FloatingButton = (props) => {
43
+ const propsWithDefault = (0, import_ds_legacy_props_helpers.useMemoMergePropsWithDefault)(props, import_react_desc_prop_types.defaultFloatingButton);
44
+ (0, import_ds_legacy_props_helpers.useValidateTypescriptPropTypes)(propsWithDefault, import_react_desc_prop_types.propsFloatingButton, import_DSChatFloatingButtonDefinitions.DSChatFloatingButtonName);
45
+ const { onFocus, innerRef, onClick } = propsWithDefault;
46
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
47
+ import_styled.StyledFloatingButton,
48
+ {
49
+ onFocus,
50
+ ref: innerRef,
51
+ "data-testid": "chat-floating-button",
52
+ "aria-label": "Open chat",
53
+ onClick,
54
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ds_legacy_icons.Comments, { size: "l" })
55
+ }
56
+ );
57
+ };
58
+ FloatingButton.propTypes = import_react_desc_prop_types.propsFloatingButton;
59
+ FloatingButton.displayName = import_DSChatFloatingButtonDefinitions.DSChatFloatingButtonName;
60
+ const FloatingButtonWithSchema = (0, import_ds_legacy_props_helpers.describe)(FloatingButton);
61
+ FloatingButtonWithSchema.propTypes = import_react_desc_prop_types.propsFloatingButton;
62
+ //# sourceMappingURL=FloatingButton.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../src/FloatingButton.tsx", "../../../../../scripts/build/transpile/react-shim.js"],
4
+ "sourcesContent": ["import type { WeakValidationMap } from 'react';\nimport React from 'react';\nimport { describe, useValidateTypescriptPropTypes, useMemoMergePropsWithDefault } from '@elliemae/ds-legacy-props-helpers';\nimport { Comments } from '@elliemae/ds-legacy-icons';\nimport { StyledFloatingButton } from './styled.js';\nimport type { FloatingButtonProps } from './react-desc-prop-types.js';\nimport { defaultFloatingButton, propsFloatingButton } from './react-desc-prop-types.js';\nimport { DSChatFloatingButtonName } from './DSChatFloatingButtonDefinitions.js';\n\nconst FloatingButton: React.ComponentType<FloatingButtonProps> = (props) => {\n const propsWithDefault = useMemoMergePropsWithDefault(props, defaultFloatingButton);\n useValidateTypescriptPropTypes(propsWithDefault, propsFloatingButton, DSChatFloatingButtonName);\n const { onFocus, innerRef, onClick } = propsWithDefault;\n return (\n <StyledFloatingButton\n onFocus={onFocus}\n ref={innerRef}\n data-testid=\"chat-floating-button\"\n aria-label=\"Open chat\"\n onClick={onClick}\n >\n <Comments size=\"l\" />\n </StyledFloatingButton>\n );\n};\n\nFloatingButton.propTypes = propsFloatingButton as WeakValidationMap<unknown>;\nFloatingButton.displayName = DSChatFloatingButtonName;\nconst FloatingButtonWithSchema = describe(FloatingButton);\nFloatingButtonWithSchema.propTypes = propsFloatingButton as WeakValidationMap<unknown>;\n\nexport { FloatingButton, FloatingButtonWithSchema };\n", "import * as React from 'react';\nexport { React };\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADqBjB;AAnBN,qCAAuF;AACvF,6BAAyB;AACzB,oBAAqC;AAErC,mCAA2D;AAC3D,6CAAyC;AAEzC,MAAM,iBAA2D,CAAC,UAAU;AAC1E,QAAM,uBAAmB,6DAA6B,OAAO,kDAAqB;AAClF,qEAA+B,kBAAkB,kDAAqB,+DAAwB;AAC9F,QAAM,EAAE,SAAS,UAAU,QAAQ,IAAI;AACvC,SACE;AAAA,IAAC;AAAA;AAAA,MACC;AAAA,MACA,KAAK;AAAA,MACL,eAAY;AAAA,MACZ,cAAW;AAAA,MACX;AAAA,MAEA,sDAAC,mCAAS,MAAK,KAAI;AAAA;AAAA,EACrB;AAEJ;AAEA,eAAe,YAAY;AAC3B,eAAe,cAAc;AAC7B,MAAM,+BAA2B,yCAAS,cAAc;AACxD,yBAAyB,YAAY;",
6
+ "names": []
7
+ }
@@ -0,0 +1,38 @@
1
+ "use strict";
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __export = (target, all) => {
9
+ for (var name in all)
10
+ __defProp(target, name, { get: all[name], enumerable: true });
11
+ };
12
+ var __copyProps = (to, from, except, desc) => {
13
+ if (from && typeof from === "object" || typeof from === "function") {
14
+ for (let key of __getOwnPropNames(from))
15
+ if (!__hasOwnProp.call(to, key) && key !== except)
16
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
+ }
18
+ return to;
19
+ };
20
+ var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
21
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
22
+ // If the importer is in node compatibility mode or this is not an ESM
23
+ // file that has been converted to a CommonJS file using a Babel-
24
+ // compatible transform (i.e. "__esModule" has not been set), then set
25
+ // "default" to the CommonJS "module.exports" for node compatibility.
26
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
27
+ mod
28
+ ));
29
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
30
+ var src_exports = {};
31
+ __export(src_exports, {
32
+ StyledFloatingContainer: () => import_styled.StyledFloatingContainer
33
+ });
34
+ module.exports = __toCommonJS(src_exports);
35
+ var React = __toESM(require("react"));
36
+ __reExport(src_exports, require("./FloatingButton.js"), module.exports);
37
+ var import_styled = require("./styled.js");
38
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../src/index.ts", "../../../../../scripts/build/transpile/react-shim.js"],
4
+ "sourcesContent": ["import type {} from '@elliemae/ds-legacy-props-helpers';\nexport * from './FloatingButton.js';\nexport { StyledFloatingContainer } from './styled.js';\n", "import * as React from 'react';\nexport { React };\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADCvB,wBAAc,gCADd;AAEA,oBAAwC;",
6
+ "names": []
7
+ }
@@ -0,0 +1,4 @@
1
+ {
2
+ "type": "commonjs",
3
+ "sideEffects": false
4
+ }
@@ -0,0 +1,47 @@
1
+ "use strict";
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __export = (target, all) => {
9
+ for (var name in all)
10
+ __defProp(target, name, { get: all[name], enumerable: true });
11
+ };
12
+ var __copyProps = (to, from, except, desc) => {
13
+ if (from && typeof from === "object" || typeof from === "function") {
14
+ for (let key of __getOwnPropNames(from))
15
+ if (!__hasOwnProp.call(to, key) && key !== except)
16
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
+ }
18
+ return to;
19
+ };
20
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
+ // If the importer is in node compatibility mode or this is not an ESM
22
+ // file that has been converted to a CommonJS file using a Babel-
23
+ // compatible transform (i.e. "__esModule" has not been set), then set
24
+ // "default" to the CommonJS "module.exports" for node compatibility.
25
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
+ mod
27
+ ));
28
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
+ var react_desc_prop_types_exports = {};
30
+ __export(react_desc_prop_types_exports, {
31
+ defaultFloatingButton: () => defaultFloatingButton,
32
+ propsFloatingButton: () => propsFloatingButton
33
+ });
34
+ module.exports = __toCommonJS(react_desc_prop_types_exports);
35
+ var React = __toESM(require("react"));
36
+ var import_ds_legacy_props_helpers = require("@elliemae/ds-legacy-props-helpers");
37
+ var import_lodash = require("lodash");
38
+ const defaultFloatingButton = {
39
+ onClick: import_lodash.noop,
40
+ onFocus: import_lodash.noop
41
+ };
42
+ const propsFloatingButton = {
43
+ onClick: import_ds_legacy_props_helpers.PropTypes.func.description("The function to call when the chat is opened via the footer").defaultValue(defaultFloatingButton.onClick),
44
+ onFocus: import_ds_legacy_props_helpers.PropTypes.func.description("The function to call when button is being focused").defaultValue(defaultFloatingButton.onFocus),
45
+ innerRef: import_ds_legacy_props_helpers.PropTypes.object.description("Ref to the component container").defaultValue(null)
46
+ };
47
+ //# sourceMappingURL=react-desc-prop-types.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../src/react-desc-prop-types.ts", "../../../../../scripts/build/transpile/react-shim.js"],
4
+ "sourcesContent": ["import { PropTypes } from '@elliemae/ds-legacy-props-helpers';\nimport { noop } from 'lodash';\nimport type React from 'react';\n\nexport interface FloatingButtonProps {\n onClick: () => void;\n onFocus: () => void;\n innerRef: React.RefObject<HTMLButtonElement>;\n}\n\nexport const defaultFloatingButton: Partial<FloatingButtonProps> = {\n onClick: noop,\n onFocus: noop,\n};\n\nexport const propsFloatingButton = {\n onClick: PropTypes.func\n .description('The function to call when the chat is opened via the footer')\n .defaultValue(defaultFloatingButton.onClick),\n onFocus: PropTypes.func\n .description('The function to call when button is being focused')\n .defaultValue(defaultFloatingButton.onFocus),\n innerRef: PropTypes.object.description('Ref to the component container').defaultValue(null),\n};\n", "import * as React from 'react';\nexport { React };\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,qCAA0B;AAC1B,oBAAqB;AASd,MAAM,wBAAsD;AAAA,EACjE,SAAS;AAAA,EACT,SAAS;AACX;AAEO,MAAM,sBAAsB;AAAA,EACjC,SAAS,yCAAU,KAChB,YAAY,6DAA6D,EACzE,aAAa,sBAAsB,OAAO;AAAA,EAC7C,SAAS,yCAAU,KAChB,YAAY,mDAAmD,EAC/D,aAAa,sBAAsB,OAAO;AAAA,EAC7C,UAAU,yCAAU,OAAO,YAAY,gCAAgC,EAAE,aAAa,IAAI;AAC5F;",
6
+ "names": []
7
+ }
@@ -0,0 +1,79 @@
1
+ "use strict";
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __export = (target, all) => {
9
+ for (var name in all)
10
+ __defProp(target, name, { get: all[name], enumerable: true });
11
+ };
12
+ var __copyProps = (to, from, except, desc) => {
13
+ if (from && typeof from === "object" || typeof from === "function") {
14
+ for (let key of __getOwnPropNames(from))
15
+ if (!__hasOwnProp.call(to, key) && key !== except)
16
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
+ }
18
+ return to;
19
+ };
20
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
+ // If the importer is in node compatibility mode or this is not an ESM
22
+ // file that has been converted to a CommonJS file using a Babel-
23
+ // compatible transform (i.e. "__esModule" has not been set), then set
24
+ // "default" to the CommonJS "module.exports" for node compatibility.
25
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
+ mod
27
+ ));
28
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
+ var styled_exports = {};
30
+ __export(styled_exports, {
31
+ StyledFloatingButton: () => StyledFloatingButton,
32
+ StyledFloatingContainer: () => StyledFloatingContainer
33
+ });
34
+ module.exports = __toCommonJS(styled_exports);
35
+ var React = __toESM(require("react"));
36
+ var import_ds_legacy_system = require("@elliemae/ds-legacy-system");
37
+ var import_ds_legacy_grid = require("@elliemae/ds-legacy-grid");
38
+ const BUTTON_FLOATING = 56;
39
+ const BOX_SHADOW = "0 5px 8px 0 rgba(53,60,70,0.55)";
40
+ const BOX_SHADOW_FLOATING = "0 5px 8px 0 rgba(53,60,70,0.35)";
41
+ const StyledFloatingButton = import_ds_legacy_system.styled.button`
42
+ outline: none;
43
+ cursor: pointer;
44
+ height: ${BUTTON_FLOATING}px;
45
+ width: ${BUTTON_FLOATING}px;
46
+ border: none;
47
+ background: ${(props) => props.theme.colors.brand[600]};
48
+ border-radius: 50%;
49
+ box-shadow: ${BOX_SHADOW_FLOATING};
50
+ &:hover {
51
+ background: ${(props) => props.theme.colors.brand[700]};
52
+ }
53
+ &:focus {
54
+ border: 2px solid ${(props) => props.theme.colors.brand[700]};
55
+ box-shadow:
56
+ inset 0 0 0 2px ${(props) => props.theme.colors.neutral["000"]},
57
+ ${BOX_SHADOW};
58
+ }
59
+ &:active {
60
+ background: ${(props) => props.theme.colors.brand[800]};
61
+ box-shadow:
62
+ inset 0 0 0 0,
63
+ ${BOX_SHADOW_FLOATING};
64
+ }
65
+ svg {
66
+ fill: ${(props) => props.theme.colors.neutral["000"]};
67
+ }
68
+ `;
69
+ const StyledFloatingContainer = (0, import_ds_legacy_system.styled)(import_ds_legacy_grid.Grid)`
70
+ position: fixed;
71
+ bottom: 24px;
72
+ right: 24px;
73
+ border-radius: 4px;
74
+ z-index: 1;
75
+ box-shadow: ${BOX_SHADOW};
76
+ background: ${(nestedProps) => nestedProps.theme.colors.neutral["050"]};
77
+ width: 348px;
78
+ `;
79
+ //# sourceMappingURL=styled.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../src/styled.ts", "../../../../../scripts/build/transpile/react-shim.js"],
4
+ "sourcesContent": ["import { styled } from '@elliemae/ds-legacy-system';\nimport { Grid } from '@elliemae/ds-legacy-grid';\n\nconst BUTTON_FLOATING = 56;\nconst BOX_SHADOW = '0 5px 8px 0 rgba(53,60,70,0.55)';\nconst BOX_SHADOW_FLOATING = '0 5px 8px 0 rgba(53,60,70,0.35)';\n\nexport const StyledFloatingButton = styled.button`\n outline: none;\n cursor: pointer;\n height: ${BUTTON_FLOATING}px;\n width: ${BUTTON_FLOATING}px;\n border: none;\n background: ${(props) => props.theme.colors.brand[600]};\n border-radius: 50%;\n box-shadow: ${BOX_SHADOW_FLOATING};\n &:hover {\n background: ${(props) => props.theme.colors.brand[700]};\n }\n &:focus {\n border: 2px solid ${(props) => props.theme.colors.brand[700]};\n box-shadow:\n inset 0 0 0 2px ${(props) => props.theme.colors.neutral['000']},\n ${BOX_SHADOW};\n }\n &:active {\n background: ${(props) => props.theme.colors.brand[800]};\n box-shadow:\n inset 0 0 0 0,\n ${BOX_SHADOW_FLOATING};\n }\n svg {\n fill: ${(props) => props.theme.colors.neutral['000']};\n }\n`;\n\n// Floating\nexport const StyledFloatingContainer = styled(Grid)`\n position: fixed;\n bottom: 24px;\n right: 24px;\n border-radius: 4px;\n z-index: 1;\n box-shadow: ${BOX_SHADOW};\n background: ${(nestedProps) => nestedProps.theme.colors.neutral['050']};\n width: 348px;\n`;\n", "import * as React from 'react';\nexport { React };\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,8BAAuB;AACvB,4BAAqB;AAErB,MAAM,kBAAkB;AACxB,MAAM,aAAa;AACnB,MAAM,sBAAsB;AAErB,MAAM,uBAAuB,+BAAO;AAAA;AAAA;AAAA,YAG/B;AAAA,WACD;AAAA;AAAA,gBAEK,CAAC,UAAU,MAAM,MAAM,OAAO,MAAM,GAAG;AAAA;AAAA,gBAEvC;AAAA;AAAA,kBAEE,CAAC,UAAU,MAAM,MAAM,OAAO,MAAM,GAAG;AAAA;AAAA;AAAA,wBAGjC,CAAC,UAAU,MAAM,MAAM,OAAO,MAAM,GAAG;AAAA;AAAA,wBAEvC,CAAC,UAAU,MAAM,MAAM,OAAO,QAAQ,KAAK;AAAA,QAC3D;AAAA;AAAA;AAAA,kBAGU,CAAC,UAAU,MAAM,MAAM,OAAO,MAAM,GAAG;AAAA;AAAA;AAAA,QAGjD;AAAA;AAAA;AAAA,YAGI,CAAC,UAAU,MAAM,MAAM,OAAO,QAAQ,KAAK;AAAA;AAAA;AAKhD,MAAM,8BAA0B,gCAAO,0BAAI;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,gBAMlC;AAAA,gBACA,CAAC,gBAAgB,YAAY,MAAM,OAAO,QAAQ,KAAK;AAAA;AAAA;",
6
+ "names": []
7
+ }
@@ -0,0 +1,6 @@
1
+ import * as React from "react";
2
+ const DSChatFloatingButtonName = "DSChatFloatingButton";
3
+ export {
4
+ DSChatFloatingButtonName
5
+ };
6
+ //# sourceMappingURL=DSChatFloatingButtonDefinitions.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../src/DSChatFloatingButtonDefinitions.tsx"],
4
+ "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "export const DSChatFloatingButtonName = 'DSChatFloatingButton';\n"],
5
+ "mappings": "AAAA,YAAY,WAAW;ACAhB,MAAM,2BAA2B;",
6
+ "names": []
7
+ }
@@ -0,0 +1,32 @@
1
+ import * as React from "react";
2
+ import { jsx } from "react/jsx-runtime";
3
+ import { describe, useValidateTypescriptPropTypes, useMemoMergePropsWithDefault } from "@elliemae/ds-legacy-props-helpers";
4
+ import { Comments } from "@elliemae/ds-legacy-icons";
5
+ import { StyledFloatingButton } from "./styled.js";
6
+ import { defaultFloatingButton, propsFloatingButton } from "./react-desc-prop-types.js";
7
+ import { DSChatFloatingButtonName } from "./DSChatFloatingButtonDefinitions.js";
8
+ const FloatingButton = (props) => {
9
+ const propsWithDefault = useMemoMergePropsWithDefault(props, defaultFloatingButton);
10
+ useValidateTypescriptPropTypes(propsWithDefault, propsFloatingButton, DSChatFloatingButtonName);
11
+ const { onFocus, innerRef, onClick } = propsWithDefault;
12
+ return /* @__PURE__ */ jsx(
13
+ StyledFloatingButton,
14
+ {
15
+ onFocus,
16
+ ref: innerRef,
17
+ "data-testid": "chat-floating-button",
18
+ "aria-label": "Open chat",
19
+ onClick,
20
+ children: /* @__PURE__ */ jsx(Comments, { size: "l" })
21
+ }
22
+ );
23
+ };
24
+ FloatingButton.propTypes = propsFloatingButton;
25
+ FloatingButton.displayName = DSChatFloatingButtonName;
26
+ const FloatingButtonWithSchema = describe(FloatingButton);
27
+ FloatingButtonWithSchema.propTypes = propsFloatingButton;
28
+ export {
29
+ FloatingButton,
30
+ FloatingButtonWithSchema
31
+ };
32
+ //# sourceMappingURL=FloatingButton.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../src/FloatingButton.tsx"],
4
+ "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import type { WeakValidationMap } from 'react';\nimport React from 'react';\nimport { describe, useValidateTypescriptPropTypes, useMemoMergePropsWithDefault } from '@elliemae/ds-legacy-props-helpers';\nimport { Comments } from '@elliemae/ds-legacy-icons';\nimport { StyledFloatingButton } from './styled.js';\nimport type { FloatingButtonProps } from './react-desc-prop-types.js';\nimport { defaultFloatingButton, propsFloatingButton } from './react-desc-prop-types.js';\nimport { DSChatFloatingButtonName } from './DSChatFloatingButtonDefinitions.js';\n\nconst FloatingButton: React.ComponentType<FloatingButtonProps> = (props) => {\n const propsWithDefault = useMemoMergePropsWithDefault(props, defaultFloatingButton);\n useValidateTypescriptPropTypes(propsWithDefault, propsFloatingButton, DSChatFloatingButtonName);\n const { onFocus, innerRef, onClick } = propsWithDefault;\n return (\n <StyledFloatingButton\n onFocus={onFocus}\n ref={innerRef}\n data-testid=\"chat-floating-button\"\n aria-label=\"Open chat\"\n onClick={onClick}\n >\n <Comments size=\"l\" />\n </StyledFloatingButton>\n );\n};\n\nFloatingButton.propTypes = propsFloatingButton as WeakValidationMap<unknown>;\nFloatingButton.displayName = DSChatFloatingButtonName;\nconst FloatingButtonWithSchema = describe(FloatingButton);\nFloatingButtonWithSchema.propTypes = propsFloatingButton as WeakValidationMap<unknown>;\n\nexport { FloatingButton, FloatingButtonWithSchema };\n"],
5
+ "mappings": "AAAA,YAAY,WAAW;ACqBjB;AAnBN,SAAS,UAAU,gCAAgC,oCAAoC;AACvF,SAAS,gBAAgB;AACzB,SAAS,4BAA4B;AAErC,SAAS,uBAAuB,2BAA2B;AAC3D,SAAS,gCAAgC;AAEzC,MAAM,iBAA2D,CAAC,UAAU;AAC1E,QAAM,mBAAmB,6BAA6B,OAAO,qBAAqB;AAClF,iCAA+B,kBAAkB,qBAAqB,wBAAwB;AAC9F,QAAM,EAAE,SAAS,UAAU,QAAQ,IAAI;AACvC,SACE;AAAA,IAAC;AAAA;AAAA,MACC;AAAA,MACA,KAAK;AAAA,MACL,eAAY;AAAA,MACZ,cAAW;AAAA,MACX;AAAA,MAEA,8BAAC,YAAS,MAAK,KAAI;AAAA;AAAA,EACrB;AAEJ;AAEA,eAAe,YAAY;AAC3B,eAAe,cAAc;AAC7B,MAAM,2BAA2B,SAAS,cAAc;AACxD,yBAAyB,YAAY;",
6
+ "names": []
7
+ }
@@ -0,0 +1,7 @@
1
+ import * as React from "react";
2
+ export * from "./FloatingButton.js";
3
+ import { StyledFloatingContainer } from "./styled.js";
4
+ export {
5
+ StyledFloatingContainer
6
+ };
7
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../src/index.ts"],
4
+ "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import type {} from '@elliemae/ds-legacy-props-helpers';\nexport * from './FloatingButton.js';\nexport { StyledFloatingContainer } from './styled.js';\n"],
5
+ "mappings": "AAAA,YAAY,WAAW;ACCvB,cAAc;AACd,SAAS,+BAA+B;",
6
+ "names": []
7
+ }
@@ -0,0 +1,4 @@
1
+ {
2
+ "type": "module",
3
+ "sideEffects": false
4
+ }
@@ -0,0 +1,17 @@
1
+ import * as React from "react";
2
+ import { PropTypes } from "@elliemae/ds-legacy-props-helpers";
3
+ import { noop } from "lodash";
4
+ const defaultFloatingButton = {
5
+ onClick: noop,
6
+ onFocus: noop
7
+ };
8
+ const propsFloatingButton = {
9
+ onClick: PropTypes.func.description("The function to call when the chat is opened via the footer").defaultValue(defaultFloatingButton.onClick),
10
+ onFocus: PropTypes.func.description("The function to call when button is being focused").defaultValue(defaultFloatingButton.onFocus),
11
+ innerRef: PropTypes.object.description("Ref to the component container").defaultValue(null)
12
+ };
13
+ export {
14
+ defaultFloatingButton,
15
+ propsFloatingButton
16
+ };
17
+ //# sourceMappingURL=react-desc-prop-types.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../src/react-desc-prop-types.ts"],
4
+ "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import { PropTypes } from '@elliemae/ds-legacy-props-helpers';\nimport { noop } from 'lodash';\nimport type React from 'react';\n\nexport interface FloatingButtonProps {\n onClick: () => void;\n onFocus: () => void;\n innerRef: React.RefObject<HTMLButtonElement>;\n}\n\nexport const defaultFloatingButton: Partial<FloatingButtonProps> = {\n onClick: noop,\n onFocus: noop,\n};\n\nexport const propsFloatingButton = {\n onClick: PropTypes.func\n .description('The function to call when the chat is opened via the footer')\n .defaultValue(defaultFloatingButton.onClick),\n onFocus: PropTypes.func\n .description('The function to call when button is being focused')\n .defaultValue(defaultFloatingButton.onFocus),\n innerRef: PropTypes.object.description('Ref to the component container').defaultValue(null),\n};\n"],
5
+ "mappings": "AAAA,YAAY,WAAW;ACAvB,SAAS,iBAAiB;AAC1B,SAAS,YAAY;AASd,MAAM,wBAAsD;AAAA,EACjE,SAAS;AAAA,EACT,SAAS;AACX;AAEO,MAAM,sBAAsB;AAAA,EACjC,SAAS,UAAU,KAChB,YAAY,6DAA6D,EACzE,aAAa,sBAAsB,OAAO;AAAA,EAC7C,SAAS,UAAU,KAChB,YAAY,mDAAmD,EAC/D,aAAa,sBAAsB,OAAO;AAAA,EAC7C,UAAU,UAAU,OAAO,YAAY,gCAAgC,EAAE,aAAa,IAAI;AAC5F;",
6
+ "names": []
7
+ }
@@ -0,0 +1,49 @@
1
+ import * as React from "react";
2
+ import { styled } from "@elliemae/ds-legacy-system";
3
+ import { Grid } from "@elliemae/ds-legacy-grid";
4
+ const BUTTON_FLOATING = 56;
5
+ const BOX_SHADOW = "0 5px 8px 0 rgba(53,60,70,0.55)";
6
+ const BOX_SHADOW_FLOATING = "0 5px 8px 0 rgba(53,60,70,0.35)";
7
+ const StyledFloatingButton = styled.button`
8
+ outline: none;
9
+ cursor: pointer;
10
+ height: ${BUTTON_FLOATING}px;
11
+ width: ${BUTTON_FLOATING}px;
12
+ border: none;
13
+ background: ${(props) => props.theme.colors.brand[600]};
14
+ border-radius: 50%;
15
+ box-shadow: ${BOX_SHADOW_FLOATING};
16
+ &:hover {
17
+ background: ${(props) => props.theme.colors.brand[700]};
18
+ }
19
+ &:focus {
20
+ border: 2px solid ${(props) => props.theme.colors.brand[700]};
21
+ box-shadow:
22
+ inset 0 0 0 2px ${(props) => props.theme.colors.neutral["000"]},
23
+ ${BOX_SHADOW};
24
+ }
25
+ &:active {
26
+ background: ${(props) => props.theme.colors.brand[800]};
27
+ box-shadow:
28
+ inset 0 0 0 0,
29
+ ${BOX_SHADOW_FLOATING};
30
+ }
31
+ svg {
32
+ fill: ${(props) => props.theme.colors.neutral["000"]};
33
+ }
34
+ `;
35
+ const StyledFloatingContainer = styled(Grid)`
36
+ position: fixed;
37
+ bottom: 24px;
38
+ right: 24px;
39
+ border-radius: 4px;
40
+ z-index: 1;
41
+ box-shadow: ${BOX_SHADOW};
42
+ background: ${(nestedProps) => nestedProps.theme.colors.neutral["050"]};
43
+ width: 348px;
44
+ `;
45
+ export {
46
+ StyledFloatingButton,
47
+ StyledFloatingContainer
48
+ };
49
+ //# sourceMappingURL=styled.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../src/styled.ts"],
4
+ "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import { styled } from '@elliemae/ds-legacy-system';\nimport { Grid } from '@elliemae/ds-legacy-grid';\n\nconst BUTTON_FLOATING = 56;\nconst BOX_SHADOW = '0 5px 8px 0 rgba(53,60,70,0.55)';\nconst BOX_SHADOW_FLOATING = '0 5px 8px 0 rgba(53,60,70,0.35)';\n\nexport const StyledFloatingButton = styled.button`\n outline: none;\n cursor: pointer;\n height: ${BUTTON_FLOATING}px;\n width: ${BUTTON_FLOATING}px;\n border: none;\n background: ${(props) => props.theme.colors.brand[600]};\n border-radius: 50%;\n box-shadow: ${BOX_SHADOW_FLOATING};\n &:hover {\n background: ${(props) => props.theme.colors.brand[700]};\n }\n &:focus {\n border: 2px solid ${(props) => props.theme.colors.brand[700]};\n box-shadow:\n inset 0 0 0 2px ${(props) => props.theme.colors.neutral['000']},\n ${BOX_SHADOW};\n }\n &:active {\n background: ${(props) => props.theme.colors.brand[800]};\n box-shadow:\n inset 0 0 0 0,\n ${BOX_SHADOW_FLOATING};\n }\n svg {\n fill: ${(props) => props.theme.colors.neutral['000']};\n }\n`;\n\n// Floating\nexport const StyledFloatingContainer = styled(Grid)`\n position: fixed;\n bottom: 24px;\n right: 24px;\n border-radius: 4px;\n z-index: 1;\n box-shadow: ${BOX_SHADOW};\n background: ${(nestedProps) => nestedProps.theme.colors.neutral['050']};\n width: 348px;\n`;\n"],
5
+ "mappings": "AAAA,YAAY,WAAW;ACAvB,SAAS,cAAc;AACvB,SAAS,YAAY;AAErB,MAAM,kBAAkB;AACxB,MAAM,aAAa;AACnB,MAAM,sBAAsB;AAErB,MAAM,uBAAuB,OAAO;AAAA;AAAA;AAAA,YAG/B;AAAA,WACD;AAAA;AAAA,gBAEK,CAAC,UAAU,MAAM,MAAM,OAAO,MAAM,GAAG;AAAA;AAAA,gBAEvC;AAAA;AAAA,kBAEE,CAAC,UAAU,MAAM,MAAM,OAAO,MAAM,GAAG;AAAA;AAAA;AAAA,wBAGjC,CAAC,UAAU,MAAM,MAAM,OAAO,MAAM,GAAG;AAAA;AAAA,wBAEvC,CAAC,UAAU,MAAM,MAAM,OAAO,QAAQ,KAAK;AAAA,QAC3D;AAAA;AAAA;AAAA,kBAGU,CAAC,UAAU,MAAM,MAAM,OAAO,MAAM,GAAG;AAAA;AAAA;AAAA,QAGjD;AAAA;AAAA;AAAA,YAGI,CAAC,UAAU,MAAM,MAAM,OAAO,QAAQ,KAAK;AAAA;AAAA;AAKhD,MAAM,0BAA0B,OAAO,IAAI;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,gBAMlC;AAAA,gBACA,CAAC,gBAAgB,YAAY,MAAM,OAAO,QAAQ,KAAK;AAAA;AAAA;",
6
+ "names": []
7
+ }
@@ -0,0 +1 @@
1
+ export declare const DSChatFloatingButtonName = "DSChatFloatingButton";
@@ -0,0 +1,5 @@
1
+ import React from 'react';
2
+ import type { FloatingButtonProps } from './react-desc-prop-types.js';
3
+ declare const FloatingButton: React.ComponentType<FloatingButtonProps>;
4
+ declare const FloatingButtonWithSchema: import("@elliemae/ds-legacy-props-helpers/dist/types/propTypes/types.js").DocumentedReactComponent<FloatingButtonProps>;
5
+ export { FloatingButton, FloatingButtonWithSchema };
@@ -0,0 +1,2 @@
1
+ export * from './FloatingButton.js';
2
+ export { StyledFloatingContainer } from './styled.js';
@@ -0,0 +1,12 @@
1
+ import type React from 'react';
2
+ export interface FloatingButtonProps {
3
+ onClick: () => void;
4
+ onFocus: () => void;
5
+ innerRef: React.RefObject<HTMLButtonElement>;
6
+ }
7
+ export declare const defaultFloatingButton: Partial<FloatingButtonProps>;
8
+ export declare const propsFloatingButton: {
9
+ onClick: import("@elliemae/ds-legacy-props-helpers/dist/types/propTypes/types").ReactDescT;
10
+ onFocus: import("@elliemae/ds-legacy-props-helpers/dist/types/propTypes/types").ReactDescT;
11
+ innerRef: import("@elliemae/ds-legacy-props-helpers/dist/types/propTypes/types").ReactDescT;
12
+ };
@@ -0,0 +1,3 @@
1
+ /// <reference types="react" />
2
+ export declare const StyledFloatingButton: import("styled-components").StyledComponent<"button", import("@elliemae/ds-legacy-system").Theme, object & import("@elliemae/ds-legacy-system").OwnerInterface, never>;
3
+ export declare const StyledFloatingContainer: import("styled-components").StyledComponent<import("react").ForwardRefExoticComponent<import("@elliemae/ds-legacy-grid").DSGridT.Props & import("react").RefAttributes<HTMLDivElement>>, import("@elliemae/ds-legacy-system").Theme, object & import("@elliemae/ds-legacy-system").OwnerInterface, never>;
package/package.json ADDED
@@ -0,0 +1,77 @@
1
+ {
2
+ "name": "@elliemae/ds-legacy-chat-floating-button",
3
+ "version": "1.0.0-rc.1",
4
+ "license": "MIT",
5
+ "description": "ICE MT - Dimsum - Chat Floating Button",
6
+ "files": [
7
+ "dist"
8
+ ],
9
+ "module": "./dist/esm/index.js",
10
+ "main": "./dist/cjs/index.js",
11
+ "types": "./dist/types/index.d.ts",
12
+ "exports": {
13
+ ".": {
14
+ "import": "./dist/esm/index.js",
15
+ "require": "./dist/cjs/index.js"
16
+ },
17
+ "./styled": {
18
+ "import": "./dist/esm/styled.js",
19
+ "require": "./dist/cjs/styled.js"
20
+ },
21
+ "./props": {
22
+ "import": "./dist/esm/props.js",
23
+ "require": "./dist/cjs/props.js"
24
+ },
25
+ "./FloatingButton": {
26
+ "import": "./dist/esm/FloatingButton.js",
27
+ "require": "./dist/cjs/FloatingButton.js"
28
+ }
29
+ },
30
+ "repository": {
31
+ "type": "git",
32
+ "url": "https://git.elliemae.io/platform-ui/dimsum-legacy.git"
33
+ },
34
+ "engines": {
35
+ "pnpm": ">=6",
36
+ "node": ">=16"
37
+ },
38
+ "author": "ICE MT",
39
+ "jestSonar": {
40
+ "sonar56x": true,
41
+ "reportPath": "reports",
42
+ "reportFile": "tests.xml",
43
+ "indent": 4
44
+ },
45
+ "publishConfig": {
46
+ "access": "public",
47
+ "typeSafety": true
48
+ },
49
+ "dependencies": {
50
+ "@elliemae/ds-legacy-grid": "1.0.0-rc.1",
51
+ "@elliemae/ds-legacy-icons": "1.0.0-rc.1",
52
+ "@elliemae/ds-legacy-props-helpers": "1.0.0-rc.1",
53
+ "@elliemae/ds-legacy-system": "1.0.0-rc.1"
54
+ },
55
+ "devDependencies": {
56
+ "@elliemae/pui-cli": "~9.0.0-next.31",
57
+ "styled-components": "~5.3.9",
58
+ "@elliemae/ds-legacy-monorepo-devops": "1.0.0-rc.1"
59
+ },
60
+ "peerDependencies": {
61
+ "lodash": "^4.17.21",
62
+ "react": "^17.0.2",
63
+ "react-dom": "^17.0.2",
64
+ "styled-components": "~5.3.9"
65
+ },
66
+ "scripts": {
67
+ "test": "pui-cli test --passWithNoTests",
68
+ "lint": "node ../../../scripts/lint.mjs",
69
+ "eslint:fix": "eslint --ext='.js,.jsx,.test.js,.ts,.tsx' --fix --config='../../../.eslintrc.js' src/",
70
+ "dts": "node ../../../scripts/dts.mjs",
71
+ "dev": "node ../../scripts/build/build.js -w",
72
+ "build": "cross-env NODE_ENV=production node ../../../scripts/build/build.mjs",
73
+ "dev:build": "pnpm --filter {.}... build",
74
+ "dev:install": "pnpm --filter {.}... i --no-lockfile && pnpm run dev:build",
75
+ "checkDeps": "npm exec ../../util/ds-codemods -- check-missing-packages --projectFolderPath=\"./\" --ignorePackagesGlobPattern=\"\" --ignoreFilesGlobPattern=\"**/test-ables/*,**/tests/*\""
76
+ }
77
+ }