@synchat/webchat 0.0.8 → 0.0.10

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.
package/dist/index.d.mts CHANGED
@@ -1,19 +1,22 @@
1
1
  import * as React from 'react';
2
+ import { FC } from 'react';
2
3
  import * as react_jsx_runtime from 'react/jsx-runtime';
3
4
 
4
- type MyButtonProps = {
5
+ type ChatButtonProps = {
5
6
  children?: React.ReactNode;
6
7
  onClick?: () => void;
7
8
  className?: string;
8
- /** Desabilita o botão */
9
9
  disabled?: boolean;
10
10
  };
11
- /**
12
- * Um botão básico para exemplo da lib.
13
- * Renderiza um <button> com estilos básicos inline (você pode trocar para CSS Modules/Tailwind/etc).
14
- */
15
- declare const MyButton: React.FC<MyButtonProps>;
11
+
12
+ type IDefaultProps = {
13
+ testId?: string;
14
+ };
15
+ interface IComponent<T = {}> extends FC<IDefaultProps & T> {
16
+ }
17
+
18
+ declare const ChatButton: IComponent<ChatButtonProps>;
16
19
 
17
20
  declare const WebChat: () => react_jsx_runtime.JSX.Element;
18
21
 
19
- export { MyButton, type MyButtonProps, WebChat };
22
+ export { ChatButton, type ChatButtonProps, WebChat };
package/dist/index.d.ts CHANGED
@@ -1,19 +1,22 @@
1
1
  import * as React from 'react';
2
+ import { FC } from 'react';
2
3
  import * as react_jsx_runtime from 'react/jsx-runtime';
3
4
 
4
- type MyButtonProps = {
5
+ type ChatButtonProps = {
5
6
  children?: React.ReactNode;
6
7
  onClick?: () => void;
7
8
  className?: string;
8
- /** Desabilita o botão */
9
9
  disabled?: boolean;
10
10
  };
11
- /**
12
- * Um botão básico para exemplo da lib.
13
- * Renderiza um <button> com estilos básicos inline (você pode trocar para CSS Modules/Tailwind/etc).
14
- */
15
- declare const MyButton: React.FC<MyButtonProps>;
11
+
12
+ type IDefaultProps = {
13
+ testId?: string;
14
+ };
15
+ interface IComponent<T = {}> extends FC<IDefaultProps & T> {
16
+ }
17
+
18
+ declare const ChatButton: IComponent<ChatButtonProps>;
16
19
 
17
20
  declare const WebChat: () => react_jsx_runtime.JSX.Element;
18
21
 
19
- export { MyButton, type MyButtonProps, WebChat };
22
+ export { ChatButton, type ChatButtonProps, WebChat };
package/dist/index.js CHANGED
@@ -1,11 +1,17 @@
1
1
  'use strict';
2
2
 
3
+ var material = require('@mui/material');
3
4
  var jsxRuntime = require('react/jsx-runtime');
4
5
 
5
- // src/lib/components/button/index.tsx
6
- var MyButton = ({ children = "Clique", onClick, className, disabled }) => {
6
+ // src/lib/components/button/styles.tsx
7
+ var AtomButton = material.styled(material.Button, {
8
+ shouldForwardProp: (prop) => prop !== "buttonType"
9
+ })(({ buttonType = "default" }) => {
10
+ return {};
11
+ });
12
+ var ChatButton = ({ children = "Chat", onClick, className, disabled }) => {
7
13
  return /* @__PURE__ */ jsxRuntime.jsx(
8
- "button",
14
+ AtomButton,
9
15
  {
10
16
  onClick,
11
17
  disabled,
@@ -23,10 +29,16 @@ var MyButton = ({ children = "Clique", onClick, className, disabled }) => {
23
29
  );
24
30
  };
25
31
  var WebChat = () => {
26
- return /* @__PURE__ */ jsxRuntime.jsx("button", { className: "floating-chat-button", children: "CHATS" });
32
+ return /* @__PURE__ */ jsxRuntime.jsx("button", { style: {
33
+ position: "fixed",
34
+ bottom: "20px",
35
+ right: "20px",
36
+ backgroundColor: "#007bff",
37
+ display: "flex"
38
+ }, children: "CHAT" });
27
39
  };
28
40
 
29
- exports.MyButton = MyButton;
41
+ exports.ChatButton = ChatButton;
30
42
  exports.WebChat = WebChat;
31
43
  //# sourceMappingURL=index.js.map
32
44
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/lib/components/button/index.tsx","../src/lib/components/webchat/index.tsx"],"names":["jsx"],"mappings":";;;;;AAcO,IAAM,QAAA,GAAoC,CAAC,EAAE,QAAA,GAAW,UAAU,OAAA,EAAS,SAAA,EAAW,UAAS,KAAM;AAC1G,EAAA,uBACEA,cAAA;AAAA,IAAC,QAAA;AAAA,IAAA;AAAA,MACC,OAAA;AAAA,MACA,QAAA;AAAA,MACA,SAAA;AAAA,MACA,KAAA,EAAO;AAAA,QACL,OAAA,EAAS,UAAA;AAAA,QACT,YAAA,EAAc,CAAA;AAAA,QACd,MAAA,EAAQ,gBAAA;AAAA,QACR,MAAA,EAAQ,WAAW,aAAA,GAAgB,SAAA;AAAA,QACnC,UAAA,EAAY,WAAW,SAAA,GAAY,MAAA;AAAA,QACnC,UAAA,EAAY;AAAA,OACd;AAAA,MAEC;AAAA;AAAA,GACH;AAEJ;AC9BO,IAAM,UAAU,MAAM;AACzB,EAAA,uBACIA,cAAAA,CAAC,QAAA,EAAA,EAAO,SAAA,EAAU,wBAAuB,QAAA,EAAA,OAAA,EAEzC,CAAA;AAER","file":"index.js","sourcesContent":["import * as React from 'react'\n\nexport type MyButtonProps = {\n children?: React.ReactNode\n onClick?: () => void\n className?: string\n /** Desabilita o botão */\n disabled?: boolean\n}\n\n/**\n * Um botão básico para exemplo da lib.\n * Renderiza um <button> com estilos básicos inline (você pode trocar para CSS Modules/Tailwind/etc).\n */\nexport const MyButton: React.FC<MyButtonProps> = ({ children = 'Clique', onClick, className, disabled }) => {\n return (\n <button\n onClick={onClick}\n disabled={disabled}\n className={className}\n style={{\n padding: '8px 14px',\n borderRadius: 8,\n border: '1px solid #ddd',\n cursor: disabled ? 'not-allowed' : 'pointer',\n background: disabled ? '#f2f2f2' : '#fff',\n fontWeight: 600\n }}\n >\n {children}\n </button>\n )\n}\n","import \"./styles.css\";\n\nexport const WebChat = () => {\n return (\n <button className=\"floating-chat-button\">\n CHATS\n </button>\n )\n}"]}
1
+ {"version":3,"sources":["../src/lib/components/button/styles.tsx","../src/lib/components/button/index.tsx","../src/lib/components/webchat/index.tsx"],"names":["styled","Button","jsx"],"mappings":";;;;;;AA8EO,IAAM,UAAA,GAAaA,gBAAOC,eAAA,EAAQ;AAAA,EACrC,iBAAA,EAAmB,CAAC,IAAA,KAAS,IAAA,KAAS;AAC1C,CAAC,CAAA,CAAmB,CAAC,EAAE,UAAA,GAAa,WAAU,KAAM;AAEhD,EAAA,OAAO,EACP;AAEJ,CAAC,CAAA;AChFM,IAAM,UAAA,GAA0C,CAAC,EAAE,QAAA,GAAW,QAAQ,OAAA,EAAS,SAAA,EAAW,UAAS,KAAM;AAC9G,EAAA,uBACEC,cAAA;AAAA,IAAC,UAAA;AAAA,IAAA;AAAA,MACC,OAAA;AAAA,MACA,QAAA;AAAA,MACA,SAAA;AAAA,MACA,KAAA,EAAO;AAAA,QACL,OAAA,EAAS,UAAA;AAAA,QACT,YAAA,EAAc,CAAA;AAAA,QACd,MAAA,EAAQ,gBAAA;AAAA,QACR,MAAA,EAAQ,WAAW,aAAA,GAAgB,SAAA;AAAA,QACnC,UAAA,EAAY,WAAW,SAAA,GAAY,MAAA;AAAA,QACnC,UAAA,EAAY;AAAA,OACd;AAAA,MAEC;AAAA;AAAA,GACH;AAEJ;ACvBO,IAAM,UAAU,MAAM;AACzB,EAAA,uBACIA,cAAAA,CAAC,QAAA,EAAA,EAAO,KAAA,EAAO;AAAA,IACX,QAAA,EAAU,OAAA;AAAA,IACV,MAAA,EAAQ,MAAA;AAAA,IACR,KAAA,EAAO,MAAA;AAAA,IACP,eAAA,EAAiB,SAAA;AAAA,IACjB,OAAA,EAAS;AAAA,KACV,QAAA,EAAA,MAAA,EAEH,CAAA;AAER","file":"index.js","sourcesContent":["import { Button, ButtonProps, styled } from \"@mui/material\";\nimport { ButtonHTMLAttributes } from \"react\";\n\nconst disabledStyles = {\n backgroundColor: \"#E0E0E0\",\n color: \"#9E9E9E\",\n borderColor: \"#BDBDBD\",\n};\n\nconst buttonVariants = {\n primary: {\n background: \"#00BB7E\",\n color: \"#FFF\",\n border: \"none\",\n },\n secondary: {\n background: \"transparent\",\n color: \"#00BB7E\",\n border: \"#00BB7E\",\n },\n error: {\n background: \"transparent\",\n color: \"#D32F2F\",\n border: \"#D32F2F\",\n },\n danger: {\n background: \"#E61E2E\",\n color: \"#fff\",\n border: \"none\",\n },\n outlinedBlue: {\n background: \"transparent\",\n color: \"#2196F3\",\n border: \"#2196F3\",\n },\n outlinedGreen: {\n background: \"transparent\",\n color: \"#00BB7E\",\n border: \"#00BB7E\",\n },\n outlinedBlack: {\n background: \"transparent\",\n color: \"#000000DE\",\n border: \"#000000DE\",\n },\n outlinedGrey: {\n background: \"transparent\",\n color: \"#59676D\",\n border: \"#0B0D0E52\",\n },\n textPrimary: {\n background: \"transparent\",\n color: \"#00BB7E\",\n border: \"transparent\",\n },\n textSecondary: {\n background: \"transparent\",\n color: \"#000000DE\",\n border: \"transparent\",\n },\n textBlue: {\n background: \"transparent\",\n color: \"#2196F3\",\n border: \"transparent\",\n },\n default: {\n background: \"#00BB7E\",\n color: \"#FFF\",\n border: \"#00BB7E\",\n },\n};\n\ninterface AtomButtonProps\n extends Omit<ButtonHTMLAttributes<HTMLButtonElement>, \"color\">,\n ButtonProps {\n buttonType?: keyof typeof buttonVariants;\n}\n\nexport const AtomButton = styled(Button, {\n shouldForwardProp: (prop) => prop !== \"buttonType\",\n})<AtomButtonProps>(({ buttonType = \"default\" }) => {\n\n return {\n }\n\n});","import * as React from 'react'\nimport { ChatButtonProps } from \"./types\";\nimport IComponent from \"../../../types/component\";\nimport { AtomButton } from \"./styles\";\n\nexport const ChatButton: IComponent<ChatButtonProps> = ({ children = 'Chat', onClick, className, disabled }) => {\n return (\n <AtomButton\n onClick={onClick}\n disabled={disabled}\n className={className}\n style={{\n padding: '8px 14px',\n borderRadius: 8,\n border: '1px solid #ddd',\n cursor: disabled ? 'not-allowed' : 'pointer',\n background: disabled ? '#f2f2f2' : '#fff',\n fontWeight: 600\n }}\n >\n {children}\n </AtomButton>\n )\n}\n","export const WebChat = () => {\n return (\n <button style={{\n position: \"fixed\",\n bottom: \"20px\",\n right: \"20px\",\n backgroundColor: \"#007bff\",\n display: \"flex\",\n }}>\n CHAT\n </button>\n )\n}"]}
package/dist/index.mjs CHANGED
@@ -1,9 +1,15 @@
1
+ import { styled, Button } from '@mui/material';
1
2
  import { jsx } from 'react/jsx-runtime';
2
3
 
3
- // src/lib/components/button/index.tsx
4
- var MyButton = ({ children = "Clique", onClick, className, disabled }) => {
4
+ // src/lib/components/button/styles.tsx
5
+ var AtomButton = styled(Button, {
6
+ shouldForwardProp: (prop) => prop !== "buttonType"
7
+ })(({ buttonType = "default" }) => {
8
+ return {};
9
+ });
10
+ var ChatButton = ({ children = "Chat", onClick, className, disabled }) => {
5
11
  return /* @__PURE__ */ jsx(
6
- "button",
12
+ AtomButton,
7
13
  {
8
14
  onClick,
9
15
  disabled,
@@ -21,9 +27,15 @@ var MyButton = ({ children = "Clique", onClick, className, disabled }) => {
21
27
  );
22
28
  };
23
29
  var WebChat = () => {
24
- return /* @__PURE__ */ jsx("button", { className: "floating-chat-button", children: "CHATS" });
30
+ return /* @__PURE__ */ jsx("button", { style: {
31
+ position: "fixed",
32
+ bottom: "20px",
33
+ right: "20px",
34
+ backgroundColor: "#007bff",
35
+ display: "flex"
36
+ }, children: "CHAT" });
25
37
  };
26
38
 
27
- export { MyButton, WebChat };
39
+ export { ChatButton, WebChat };
28
40
  //# sourceMappingURL=index.mjs.map
29
41
  //# sourceMappingURL=index.mjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/lib/components/button/index.tsx","../src/lib/components/webchat/index.tsx"],"names":["jsx"],"mappings":";;;AAcO,IAAM,QAAA,GAAoC,CAAC,EAAE,QAAA,GAAW,UAAU,OAAA,EAAS,SAAA,EAAW,UAAS,KAAM;AAC1G,EAAA,uBACE,GAAA;AAAA,IAAC,QAAA;AAAA,IAAA;AAAA,MACC,OAAA;AAAA,MACA,QAAA;AAAA,MACA,SAAA;AAAA,MACA,KAAA,EAAO;AAAA,QACL,OAAA,EAAS,UAAA;AAAA,QACT,YAAA,EAAc,CAAA;AAAA,QACd,MAAA,EAAQ,gBAAA;AAAA,QACR,MAAA,EAAQ,WAAW,aAAA,GAAgB,SAAA;AAAA,QACnC,UAAA,EAAY,WAAW,SAAA,GAAY,MAAA;AAAA,QACnC,UAAA,EAAY;AAAA,OACd;AAAA,MAEC;AAAA;AAAA,GACH;AAEJ;AC9BO,IAAM,UAAU,MAAM;AACzB,EAAA,uBACIA,GAAAA,CAAC,QAAA,EAAA,EAAO,SAAA,EAAU,wBAAuB,QAAA,EAAA,OAAA,EAEzC,CAAA;AAER","file":"index.mjs","sourcesContent":["import * as React from 'react'\n\nexport type MyButtonProps = {\n children?: React.ReactNode\n onClick?: () => void\n className?: string\n /** Desabilita o botão */\n disabled?: boolean\n}\n\n/**\n * Um botão básico para exemplo da lib.\n * Renderiza um <button> com estilos básicos inline (você pode trocar para CSS Modules/Tailwind/etc).\n */\nexport const MyButton: React.FC<MyButtonProps> = ({ children = 'Clique', onClick, className, disabled }) => {\n return (\n <button\n onClick={onClick}\n disabled={disabled}\n className={className}\n style={{\n padding: '8px 14px',\n borderRadius: 8,\n border: '1px solid #ddd',\n cursor: disabled ? 'not-allowed' : 'pointer',\n background: disabled ? '#f2f2f2' : '#fff',\n fontWeight: 600\n }}\n >\n {children}\n </button>\n )\n}\n","import \"./styles.css\";\n\nexport const WebChat = () => {\n return (\n <button className=\"floating-chat-button\">\n CHATS\n </button>\n )\n}"]}
1
+ {"version":3,"sources":["../src/lib/components/button/styles.tsx","../src/lib/components/button/index.tsx","../src/lib/components/webchat/index.tsx"],"names":["jsx"],"mappings":";;;;AA8EO,IAAM,UAAA,GAAa,OAAO,MAAA,EAAQ;AAAA,EACrC,iBAAA,EAAmB,CAAC,IAAA,KAAS,IAAA,KAAS;AAC1C,CAAC,CAAA,CAAmB,CAAC,EAAE,UAAA,GAAa,WAAU,KAAM;AAEhD,EAAA,OAAO,EACP;AAEJ,CAAC,CAAA;AChFM,IAAM,UAAA,GAA0C,CAAC,EAAE,QAAA,GAAW,QAAQ,OAAA,EAAS,SAAA,EAAW,UAAS,KAAM;AAC9G,EAAA,uBACE,GAAA;AAAA,IAAC,UAAA;AAAA,IAAA;AAAA,MACC,OAAA;AAAA,MACA,QAAA;AAAA,MACA,SAAA;AAAA,MACA,KAAA,EAAO;AAAA,QACL,OAAA,EAAS,UAAA;AAAA,QACT,YAAA,EAAc,CAAA;AAAA,QACd,MAAA,EAAQ,gBAAA;AAAA,QACR,MAAA,EAAQ,WAAW,aAAA,GAAgB,SAAA;AAAA,QACnC,UAAA,EAAY,WAAW,SAAA,GAAY,MAAA;AAAA,QACnC,UAAA,EAAY;AAAA,OACd;AAAA,MAEC;AAAA;AAAA,GACH;AAEJ;ACvBO,IAAM,UAAU,MAAM;AACzB,EAAA,uBACIA,GAAAA,CAAC,QAAA,EAAA,EAAO,KAAA,EAAO;AAAA,IACX,QAAA,EAAU,OAAA;AAAA,IACV,MAAA,EAAQ,MAAA;AAAA,IACR,KAAA,EAAO,MAAA;AAAA,IACP,eAAA,EAAiB,SAAA;AAAA,IACjB,OAAA,EAAS;AAAA,KACV,QAAA,EAAA,MAAA,EAEH,CAAA;AAER","file":"index.mjs","sourcesContent":["import { Button, ButtonProps, styled } from \"@mui/material\";\nimport { ButtonHTMLAttributes } from \"react\";\n\nconst disabledStyles = {\n backgroundColor: \"#E0E0E0\",\n color: \"#9E9E9E\",\n borderColor: \"#BDBDBD\",\n};\n\nconst buttonVariants = {\n primary: {\n background: \"#00BB7E\",\n color: \"#FFF\",\n border: \"none\",\n },\n secondary: {\n background: \"transparent\",\n color: \"#00BB7E\",\n border: \"#00BB7E\",\n },\n error: {\n background: \"transparent\",\n color: \"#D32F2F\",\n border: \"#D32F2F\",\n },\n danger: {\n background: \"#E61E2E\",\n color: \"#fff\",\n border: \"none\",\n },\n outlinedBlue: {\n background: \"transparent\",\n color: \"#2196F3\",\n border: \"#2196F3\",\n },\n outlinedGreen: {\n background: \"transparent\",\n color: \"#00BB7E\",\n border: \"#00BB7E\",\n },\n outlinedBlack: {\n background: \"transparent\",\n color: \"#000000DE\",\n border: \"#000000DE\",\n },\n outlinedGrey: {\n background: \"transparent\",\n color: \"#59676D\",\n border: \"#0B0D0E52\",\n },\n textPrimary: {\n background: \"transparent\",\n color: \"#00BB7E\",\n border: \"transparent\",\n },\n textSecondary: {\n background: \"transparent\",\n color: \"#000000DE\",\n border: \"transparent\",\n },\n textBlue: {\n background: \"transparent\",\n color: \"#2196F3\",\n border: \"transparent\",\n },\n default: {\n background: \"#00BB7E\",\n color: \"#FFF\",\n border: \"#00BB7E\",\n },\n};\n\ninterface AtomButtonProps\n extends Omit<ButtonHTMLAttributes<HTMLButtonElement>, \"color\">,\n ButtonProps {\n buttonType?: keyof typeof buttonVariants;\n}\n\nexport const AtomButton = styled(Button, {\n shouldForwardProp: (prop) => prop !== \"buttonType\",\n})<AtomButtonProps>(({ buttonType = \"default\" }) => {\n\n return {\n }\n\n});","import * as React from 'react'\nimport { ChatButtonProps } from \"./types\";\nimport IComponent from \"../../../types/component\";\nimport { AtomButton } from \"./styles\";\n\nexport const ChatButton: IComponent<ChatButtonProps> = ({ children = 'Chat', onClick, className, disabled }) => {\n return (\n <AtomButton\n onClick={onClick}\n disabled={disabled}\n className={className}\n style={{\n padding: '8px 14px',\n borderRadius: 8,\n border: '1px solid #ddd',\n cursor: disabled ? 'not-allowed' : 'pointer',\n background: disabled ? '#f2f2f2' : '#fff',\n fontWeight: 600\n }}\n >\n {children}\n </AtomButton>\n )\n}\n","export const WebChat = () => {\n return (\n <button style={{\n position: \"fixed\",\n bottom: \"20px\",\n right: \"20px\",\n backgroundColor: \"#007bff\",\n display: \"flex\",\n }}>\n CHAT\n </button>\n )\n}"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@synchat/webchat",
3
- "version": "0.0.8",
3
+ "version": "0.0.10",
4
4
  "description": "Starter de biblioteca de componentes React + TypeScript com tsup.",
5
5
  "author": "synchat <contato@synchat.com.br>",
6
6
  "license": "MIT",
package/dist/index.css DELETED
@@ -1,23 +0,0 @@
1
- /* src/lib/components/webchat/styles.css */
2
- .floating-chat-button {
3
- position: fixed;
4
- bottom: 20px;
5
- right: 20px;
6
- background-color: #007bff;
7
- color: white;
8
- border: none;
9
- border-radius: 50%;
10
- width: 60px;
11
- height: 60px;
12
- font-size: 16px;
13
- display: flex;
14
- justify-content: center;
15
- align-items: center;
16
- cursor: pointer;
17
- box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
18
- z-index: 1000;
19
- }
20
- .floating-chat-button:hover {
21
- background-color: #0056b3;
22
- }
23
- /*# sourceMappingURL=index.css.map */
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/lib/components/webchat/styles.css"],"sourcesContent":[".floating-chat-button {\n position: fixed; /* Fixes the button relative to the viewport */\n bottom: 20px; /* Distance from the bottom of the viewport */\n right: 20px; /* Distance from the right of the viewport */\n background-color: #007bff; /* Example background color */\n color: white;\n border: none;\n border-radius: 50%; /* Makes it circular */\n width: 60px;\n height: 60px;\n font-size: 16px;\n display: flex;\n justify-content: center;\n align-items: center;\n cursor: pointer;\n box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2); /* Adds a subtle shadow */\n z-index: 1000; /* Ensures it stays on top of other content */\n}\n\n.floating-chat-button:hover {\n background-color: #0056b3; /* Darker color on hover */\n}"],"mappings":";AAAA,CAAC;AACG,YAAU;AACV,UAAQ;AACR,SAAO;AACP,oBAAkB;AAClB,SAAO;AACP,UAAQ;AACR,iBAAe;AACf,SAAO;AACP,UAAQ;AACR,aAAW;AACX,WAAS;AACT,mBAAiB;AACjB,eAAa;AACb,UAAQ;AACR,cAAY,EAAE,IAAI,IAAI,KAAK,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE;AACpC,WAAS;AACb;AAEA,CAnBC,oBAmBoB;AACjB,oBAAkB;AACtB;","names":[]}