@bikdotai/bik-component-library 0.0.844 → 0.0.846-beta.0
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/cjs/assets/icons/Gorgias.svg.js +2 -0
- package/dist/cjs/assets/icons/Gorgias.svg.js.map +1 -0
- package/dist/cjs/assets/icons/Skio.svg.js +2 -0
- package/dist/cjs/assets/icons/Skio.svg.js.map +1 -0
- package/dist/cjs/components/agent-builder/constants/tools.js +1 -1
- package/dist/cjs/components/agent-builder/constants/tools.js.map +1 -1
- package/dist/cjs/components/agent-builder/utils/sourceIcons.js +1 -1
- package/dist/cjs/components/agent-builder/utils/sourceIcons.js.map +1 -1
- package/dist/cjs/components/toaster/Toaster.js +1 -1
- package/dist/cjs/components/toaster/Toaster.js.map +1 -1
- package/dist/cjs/components/toaster/Toaster.styled.js +7 -7
- package/dist/cjs/components/toaster/Toaster.styled.js.map +1 -1
- package/dist/esm/assets/icons/Gorgias.svg.js +6 -0
- package/dist/esm/assets/icons/Gorgias.svg.js.map +1 -0
- package/dist/esm/assets/icons/Skio.svg.js +6 -0
- package/dist/esm/assets/icons/Skio.svg.js.map +1 -0
- package/dist/esm/components/agent-builder/constants/tools.d.ts +5 -2
- package/dist/esm/components/agent-builder/constants/tools.js +18 -15
- package/dist/esm/components/agent-builder/constants/tools.js.map +1 -1
- package/dist/esm/components/agent-builder/utils/sourceIcons.js +27 -23
- package/dist/esm/components/agent-builder/utils/sourceIcons.js.map +1 -1
- package/dist/esm/components/toaster/Toaster.js +30 -25
- package/dist/esm/components/toaster/Toaster.js.map +1 -1
- package/dist/esm/components/toaster/Toaster.styled.js +5 -5
- package/dist/esm/components/toaster/Toaster.styled.js.map +1 -1
- package/package.json +2 -2
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const o=require("react");function r(A){if(A&&typeof A=="object"&&"default"in A)return A;const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(A){for(const e in A)if(e!=="default"){const g=Object.getOwnPropertyDescriptor(A,e);Object.defineProperty(t,e,g.get?g:{enumerable:!0,get:()=>A[e]})}}return t.default=A,Object.freeze(t)}const l=r(o),n=A=>l.createElement("svg",{viewBox:"0 0 48 48",fill:"none",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",...A},l.createElement("image",{width:48,height:48,xlinkHref:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAYAAABXAvmHAAAAAXNSR0IArs4c6QAAAHhlWElmTU0AKgAAAAgABAEaAAUAAAABAAAAPgEbAAUAAAABAAAARgEoAAMAAAABAAIAAIdpAAQAAAABAAAATgAAAAAAAABIAAAAAQAAAEgAAAABAAOgAQADAAAAAQABAACgAgAEAAAAAQAAADCgAwAEAAAAAQAAADAAAAAA6LhYOwAAAAlwSFlzAAALEwAACxMBAJqcGAAABFdJREFUaAXtWFlIVGEU/mbNGVPnxcfyQSTzySICQ4rUdGiBQFsIUnowKCJbITKyfYdos5cIhDajeigremgzhSxc6qFHJW1lMpvJdJy1c+71jtfh2ty5To7CHLhz7///55//fGe/F0hQQgMJDUxpDeiUpE9PT8/V6/ULldbiNRcIBBodDkdH+PnG8Ake63S6QrrOBINBpeUJnyNZWKZddLBqAF4WfrIAYI0RAK+S5vRKk1NpLgEg3taa8hZQzEJqtEppDe6hIegpQ6glTgoGoxFmk0ntloh8mgD4/X7YbGnYXVmJ2dnZdEgQkWBwRv7lcqGurg6tbe0wm80RhVPDEDUA1iIVOVw6fw4lS5erOWMUz1J7Cey0r7OrC0ayxngp6n9g7WdmZqKosABfez6ien8NPORKlKj/KYvX68WGinLYl60Q9l6svRwfAGwBE/mwwWDE5y9fcOfuPUFwjgmPxzMmCAaQlZUlANAb9BgYGODiRP9jGJc7RW0BllCs0OT3JEBSUhLYKhkZGViwII8XFUEwT3FREeD3obCgAL0/fwoW6OzswuuWNzASEP6/aEkTgPBDhsiFVpeVYs/e6vClsDG1J55BFBQtoatYWAsGfDh96hSOnzytyRIxASBKKWq+9U0LabQFBgr0EJFmfaT5/Lw85M6Zgw/v3+HZi5dITU3B6lVl2LJ5E67fuCW4JLtUNBRDAOKxDxoacPDwESQnJ4+S4w/5/KGaGuTOm48b9fU4euwE0tLSMG/uXOTk5GB6Sgo4juIOgAOchQ8HwP4tpU1Ow7xusVhC8STG1SjMqgYyO6vin3RMEwtAKcloyDxyLcY8BtgV2Jf5khOPg2Fzwjrxa3Uf3h9zAFwXUikgLVarXH4hOK1hgT2KQeMgZgA4MJk2bazEurVrhouSrKjRo81mE3g40EM0GVyIM0xvby9cLif05BKcHkNEY6lV9VE1djmdAq+86sqfQ/tUPsTEApwOr1EhevT4SUhY6rAF4lsodumB8fT19VELYhlmGGYUR1H/agIgvsTohLaa24gASeV2u+Ek7aoh1rj4PsBVVzexQcy+7vrtQn//b2Rnz0Ld1Svw+nwCGEl4yiskFutd1P/ImMQl4bt7PuFSbS0cjh8Cz4S6EJf67p4enDl7Dvv2VWNl6SpJ7qju9pJi7K85ILTmwYB2N9LkQmbTNJy/cBGvmpowc+aMYW1Hlp/zPbfNFeXrkb9oMW7X30SArOenRk8raQLAmY9TYVt7B96+baWz1WuQC9r9hofYuWM7tlVthTnJSpmLXFCnrSnQBEDSlvB1QZ7TpYUIdwZx+MhRNDc3o7y8Au7BAXz//i3qTpSPGReACHKOucyJwEqVuvFVE57TewFFNqbRVwqpGI65UWEhLgAkOWLxaUWb40kSTIJ7AkC8jTDlLaAYxFRwTFoywv+yBrcalHplPfjISWMBeEogqkbY4vvEFZyuxvhKkTg9oYGEBv6LBv4CRZ5p7SwREKgAAAAASUVORK5CYII="}));exports.default=n;
|
|
2
|
+
//# sourceMappingURL=Gorgias.svg.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Gorgias.svg.js","sources":["../../../../src/assets/icons/Gorgias.svg"],"sourcesContent":["import * as React from \"react\";\nconst SvgGorgias = (props) => /* @__PURE__ */ React.createElement(\"svg\", { viewBox: \"0 0 48 48\", fill: \"none\", xmlns: \"http://www.w3.org/2000/svg\", xmlnsXlink: \"http://www.w3.org/1999/xlink\", ...props }, /* @__PURE__ */ React.createElement(\"image\", { width: 48, height: 48, xlinkHref: \"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAYAAABXAvmHAAAAAXNSR0IArs4c6QAAAHhlWElmTU0AKgAAAAgABAEaAAUAAAABAAAAPgEbAAUAAAABAAAARgEoAAMAAAABAAIAAIdpAAQAAAABAAAATgAAAAAAAABIAAAAAQAAAEgAAAABAAOgAQADAAAAAQABAACgAgAEAAAAAQAAADCgAwAEAAAAAQAAADAAAAAA6LhYOwAAAAlwSFlzAAALEwAACxMBAJqcGAAABFdJREFUaAXtWFlIVGEU/mbNGVPnxcfyQSTzySICQ4rUdGiBQFsIUnowKCJbITKyfYdos5cIhDajeigremgzhSxc6qFHJW1lMpvJdJy1c+71jtfh2ty5To7CHLhz7///55//fGe/F0hQQgMJDUxpDeiUpE9PT8/V6/ULldbiNRcIBBodDkdH+PnG8Ake63S6QrrOBINBpeUJnyNZWKZddLBqAF4WfrIAYI0RAK+S5vRKk1NpLgEg3taa8hZQzEJqtEppDe6hIegpQ6glTgoGoxFmk0ntloh8mgD4/X7YbGnYXVmJ2dnZdEgQkWBwRv7lcqGurg6tbe0wm80RhVPDEDUA1iIVOVw6fw4lS5erOWMUz1J7Cey0r7OrC0ayxngp6n9g7WdmZqKosABfez6ien8NPORKlKj/KYvX68WGinLYl60Q9l6svRwfAGwBE/mwwWDE5y9fcOfuPUFwjgmPxzMmCAaQlZUlANAb9BgYGODiRP9jGJc7RW0BllCs0OT3JEBSUhLYKhkZGViwII8XFUEwT3FREeD3obCgAL0/fwoW6OzswuuWNzASEP6/aEkTgPBDhsiFVpeVYs/e6vClsDG1J55BFBQtoatYWAsGfDh96hSOnzytyRIxASBKKWq+9U0LabQFBg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}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const f=require("react");function g(A){if(A&&typeof A=="object"&&"default"in A)return A;const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(A){for(const e in A)if(e!=="default"){const n=Object.getOwnPropertyDescriptor(A,e);Object.defineProperty(t,e,n.get?n:{enumerable:!0,get:()=>A[e]})}}return t.default=A,Object.freeze(t)}const a=g(f),l=A=>a.createElement("svg",{viewBox:"0 0 48 48",fill:"none",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",...A},a.createElement("image",{width:48,height:48,xlinkHref:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAYAAABXAvmHAAAABGdBTUEAALGPC/xhBQAAACBjSFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAAjmVYSWZNTQAqAAAACAAFARoABQAAAAEAAABKARsABQAAAAEAAABSASgAAwAAAAEAAgAAATwAAgAAAAkAAABah2kABAAAAAEAAABkAAAAAAAAAEgAAAABAAAASAAAAAFpbWFnZXJ5NAAAAAOgAQADAAAAAQABAACgAgAEAAAAAQAAADCgAwAEAAAAAQAAADAAAAAAiPHIXQAAAAlwSFlzAAALEwAACxMBAJqcGAAAAWJpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IlhNUCBDb3JlIDYuMC4wIj4KICAgPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4KICAgICAgPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIKICAgICAgICAgICAgeG1sbnM6dGlmZj0iaHR0cDovL25zLmFkb2JlLmNvbS90aWZmLzEuMC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MRWA+CoHyevzRB7plGrY0ohDJ41HD/n6XK4gZndzi23wI46uDwEEP5V9/VIQ2z6cFytT3LabHtKCYfXyGdCxF3NhOoyv0FNKhdbVbkHqLCKPEDvjJSS1wXBcYf02F3+xV4C2+lwxlZ3wJq8tp7ERvE+RJ2rSiMnbb3AmRWAIxFxkWfnjSXDvmAnaSlHSDJATN1iYa5lNPs4lrTpWeL5CNDKVhqU+rbC5IBk+3nlZM02kqU8pFCs0/6dFAQLWcHFsWolM5hz3W0opFoB9tBF67wizrHkfXjInS00Yw4cDzVMDwwDBho0TLo9xKQ48y4wI+ol46wUKOPVhqqE1HbOpKOWIHEpgGsTHS4Q3lROYBJg4n0h6XDKNTpWV+ADC3GpXmNAS3yMtURQRoWe0UbU5H9lpp/vKphy3zBtfL2ni0xdvhOhINMA9kGSmL48KbBWE7aNM28CyVtbjIZKJtDiIfUL3hCjf3/mUvUQ2DKJQ1MVe156fRm81jcGkxymhfnqCigTSb14mJLIayGaZFfwIWvZHT4xQlJhyCZnTkuqjNJD6GUop2u/QnLBX7xUjqdcZLwUxgTZOXhr0CjJJgOfoL3Mc0efwNzjrPcEbtnEcJlFYtEGFugCwLvLC5gyo+J/jEZoIR93qJZp4aJOgmmPRo+pEWPeA3XaR6f+0Z1+mUTGLNKhKiUVmmWS6jex5veyJ1F9kH85KCx8LQgKm1QvHIWfpltoDAR4M2SUWrCarKyXJJKqhgOjxCIzykd23D3wjp8eJ42mB3quY5sTxPvZAYCVLSf96Geo1iXr23e8LmuhV1HySbJdViGQXfpm0z5H8CgFwpMxKZ7r1nad56fH/dDQN7jPudybrTtl/5mMy5a6ecglJrzmS9kaoPgb/n2kvfTEb6uXg/hTvj+4Nxwr2WoD/AK+ZiLoWdMUxAAAAAElFTkSuQmCC"}));exports.default=l;
|
|
2
|
+
//# sourceMappingURL=Skio.svg.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Skio.svg.js","sources":["../../../../src/assets/icons/Skio.svg"],"sourcesContent":["import * as React from \"react\";\nconst SvgSkio = (props) => /* @__PURE__ */ React.createElement(\"svg\", { viewBox: \"0 0 48 48\", fill: \"none\", xmlns: \"http://www.w3.org/2000/svg\", xmlnsXlink: \"http://www.w3.org/1999/xlink\", ...props }, /* @__PURE__ */ React.createElement(\"image\", { width: 48, height: 48, xlinkHref: \"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAYAAABXAvmHAAAABGdBTUEAALGPC/xhBQAAACBjSFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAAjmVYSWZNTQAqAAAACAAFARoABQAAAAEAAABKARsABQAAAAEAAABSASgAAwAAAAEAAgAAATwAAgAAAAkAAABah2kABAAAAAEAAABkAAAAAAAAAEgAAAABAAAASAAAAAFpbWFnZXJ5NAAAAAOgAQADAAAAAQABAACgAgAEAAAAAQAAADCgAwAEAAAAAQAAADAAAAAAiPHIXQAAAAlwSFlzAAALEwAACxMBAJqcGAAAAWJpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IlhNUCBDb3JlIDYuMC4wIj4KICAgPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4KICAgICAgPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIKICAgICAgICAgICAgeG1sbnM6dGlmZj0iaHR0cDovL25zLmFkb2JlLmNvbS90aWZmLzEuMC8iPgogICAgICAgICA8dGlmZjpIb3N0Q29tcHV0ZXI+aW1hZ2VyeTQ8L3RpZmY6SG9zdENvbXB1dGVyPgogICAgICA8L3JkZjpEZXNjcmlwdGlvbj4KICAgPC9yZGY6UkRGPgo8L3g6eG1wbWV0YT4K6GIO0QAADwtJREFUaAWVWQmUllUZfv5lVpBdYJTNERUXTFT0hJqY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lNPs4lrTpWeL5CNDKVhqU+rbC5IBk+3nlZM02kqU8pFCs0/6dFAQLWcHFsWolM5hz3W0opFoB9tBF67wizrHkfXjInS00Yw4cDzVMDwwDBho0TLo9xKQ48y4wI+ol46wUKOPVhqqE1HbOpKOWIHEpgGsTHS4Q3lROYBJg4n0h6XDKNTpWV+ADC3GpXmNAS3yMtURQRoWe0UbU5H9lpp/vKphy3zBtfL2ni0xdvhOhINMA9kGSmL48KbBWE7aNM28CyVtbjIZKJtDiIfUL3hCjf3/mUvUQ2DKJQ1MVe156fRm81jcGkxymhfnqCigTSb14mJLIayGaZFfwIWvZHT4xQlJhyCZnTkuqjNJD6GUop2u/QnLBX7xUjqdcZLwUxgTZOXhr0CjJJgOfoL3Mc0efwNzjrPcEbtnEcJlFYtEGFugCwLvLC5gyo+J/jEZoIR93qJZp4aJOgmmPRo+pEWPeA3XaR6f+0Z1+mUTGLNKhKiUVmmWS6jex5veyJ1F9kH85KCx8LQgKm1QvHIWfpltoDAR4M2SUWrCarKyXJJKqhgOjxCIzykd23D3wjp8eJ42mB3quY5sTxPvZAYCVLSf96Geo1iXr23e8LmuhV1HySbJdViGQXfpm0z5H8CgFwpMxKZ7r1nad56fH/dDQN7jPudybrTtl/5mMy5a6ecglJrzmS9kaoPgb/n2kvfTEb6uXg/hTvj+4Nxwr2WoD/AK+ZiLoWdMUxAAAAAElFTkSuQmCC\" }));\nexport default SvgSkio;\n"],"names":["SvgSkio","props","React"],"mappings":"gdACMA,EAAWC,GAA0BC,EAAM,cAAc,MAAO,CAAE,QAAS,YAAa,KAAM,OAAQ,MAAO,6BAA8B,WAAY,+BAAgC,GAAGD,CAAK,EAAoBC,EAAM,cAAc,QAAS,CAAE,MAAO,GAAI,OAAQ,GAAI,UAAW,o5LAAo5L,CAAE,CAAC"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=[{key:"tool",label:"Tools"},{key:"subagent",label:"Sub-agent"}];var e=(a=>(a.Manifest="manifest",a.Shopify="shopify",a.Bigcommerce="bigcommerce",a.Shipstation="shipstation",a.Skio="skio",a.Gorgias="gorgias",a.Integration="integration",a.RestApi="rest_api",a.EmailHandover="email_handover",a.Slack="slack",a))(e||{});const t={manifest:"Manifest",shopify:"Shopify",bigcommerce:"BigCommerce",shipstation:"ShipStation",skio:"Skio",gorgias:"Gorgias",integration:"Integration",rest_api:"Rest API",email_handover:"Email",slack:"Slack"},n={rest_api:"REST API",email_handover:"Send Email",slack:"Send Slack message"},O=["rest_api","email_handover","slack"],i={manifest:0,shopify:1,bigcommerce:2,shipstation:3,skio:4,gorgias:5,rest_api:6,email_handover:7,slack:8},_=Object.keys(i).length,o=a=>i[a]??_,S={email_handover:"send_email",slack:"send_slack_message"};exports.CATEGORIES=s;exports.CONFIG_TOOL_SOURCES=S;exports.TOOL_ACTION_LABELS=n;exports.TOOL_ACTION_SOURCES=O;exports.TOOL_SOURCE_LABELS=t;exports.TOOL_SOURCE_RANK=i;exports.ToolSource=e;exports.toolSourceRank=o;
|
|
2
2
|
//# sourceMappingURL=tools.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tools.js","sources":["../../../../../src/components/agent-builder/constants/tools.ts"],"sourcesContent":["import type { ToolSource as ModelToolSource } from '@bikdotai/bik-models/ai-agents/models/agent-tool';\nimport type { FunctionComponent, SVGAttributes } from 'react';\n\n/**\n * Static tool-related constants for the builder's Step 3 (tools & sub-agents):\n * the reference-picker category tabs and the per-source display labels. Kept here\n * (rather than inline in the picker / serialization utils) so the labels a user\n * sees are all in one obvious place.\n */\n\n/** A reference-picker category tab. */\nexport type Category = 'tool' | 'subagent';\n\n/** Category tabs shown at the root of the `@` reference picker. */\nexport const CATEGORIES: { key: Category; label: string }[] = [\n\t{ key: 'tool', label: 'Tools' },\n\t{ key: 'subagent', label: 'Sub-agent' },\n];\n\n/**\n * Every tool \"source\" the builder renders an icon / label / picker entry for.\n * Enum VALUES are the backend's canonical read-only `source` wire strings\n * (`app/agents/config/schema.py` → `ToolSource`, derived from `tool_key`): the\n * configurable tools are `email_handover` / `rest_api` / `slack`, every native\n * tool is `manifest`. `shopify` / `integration` are legacy bik-models sources\n * kept for back-compat (the backend now collapses natives to `manifest`).\n * Dynamic/unknown sources are looked up leniently — see `toolSourceLabel` and\n * `sourceIcon`.\n *\n * This is the RUNTIME mirror of the canonical `@bikdotai/bik-models` `ToolSource`\n * union (the shape the backend persists as `AgentToolDoc.source`). We keep an\n * enum — not a re-export of the type — because the members are needed at runtime\n * for labels, ranks, icons and `===` comparisons; a type-only union can't do\n * that. The two are kept in lock-step by {@link ToolSourceMatchesBikModels}\n * below, which fails to compile if they ever drift.\n */\nexport enum ToolSource {\n\tManifest = 'manifest',\n\tShopify = 'shopify',\n\tBigcommerce = 'bigcommerce',\n\tShipstation = 'shipstation',\n\tIntegration = 'integration',\n\tRestApi = 'rest_api',\n\tEmailHandover = 'email_handover',\n\tSlack = 'slack',\n}\n\n/**\n * Compile-time guard that {@link ToolSource} stays a faithful mirror of the\n * canonical `@bikdotai/bik-models` `ToolSource` union. If a source is added to\n * (or removed from) either side without the other, `AssertTrue` receives `false`\n * and this type stops compiling — so the runtime enum can never silently diverge\n * from what the backend persists as `AgentToolDoc.source`. The tuple wrappers\n * (`[…]`) stop the conditionals from distributing over the unions, so it checks\n * set-equality in both directions.\n *\n * Type-only (erased at build): a drift shows up as a compile error on\n * `ToolSourceMatchesBikModels` telling you to reconcile this enum with\n * `@bikdotai/bik-models` (bump the dep and/or the enum).\n */\ntype AssertTrue<T extends true> = T;\ntype ToolSourceMatchesBikModels = AssertTrue<\n\t[`${ToolSource}`] extends [ModelToolSource]\n\t\t? [ModelToolSource] extends [`${ToolSource}`]\n\t\t\t? true\n\t\t\t: false\n\t\t: false\n>;\n\n/**\n * Display labels for the known tool sources — the CATEGORY/integration name, used\n * for the picker's source headers (drill-in groups), the empty-state source\n * buttons and the mention-chip prefix. A source is a category (\"Slack\") you drill\n * into; the specific addable action inside it (\"Send Slack message\") is\n * `TOOL_ACTION_LABELS`. Unknown sources fall back to the raw key (see\n * `toolSourceLabel`).\n */\nexport const TOOL_SOURCE_LABELS: Record<ToolSource, string> = {\n\t[ToolSource.Manifest]: 'Manifest',\n\t[ToolSource.Shopify]: 'Shopify',\n\t[ToolSource.Bigcommerce]: 'BigCommerce',\n\t[ToolSource.Shipstation]: 'ShipStation',\n\t[ToolSource.Integration]: 'Integration',\n\t[ToolSource.RestApi]: 'Rest API',\n\t[ToolSource.EmailHandover]: 'Email',\n\t[ToolSource.Slack]: 'Slack',\n};\n\n/**\n * The addable action inside a configurable/rest source — shown as the \"add\" row\n * in the `@` picker (below any existing instances) and the empty-state button.\n * Distinct from `TOOL_SOURCE_LABELS`, which names the category the action lives in\n * (e.g. category \"Slack\" → action \"Send Slack message\").\n */\nexport const TOOL_ACTION_LABELS: Partial<Record<ToolSource, string>> = {\n\t[ToolSource.RestApi]: 'REST API',\n\t[ToolSource.EmailHandover]: 'Send Email',\n\t[ToolSource.Slack]: 'Send Slack message',\n};\n\n/** A tool source's brand-glyph component. */\nexport type IconComp = FunctionComponent<SVGAttributes<SVGElement>>;\n\n/** Brand glyph for a tool source, with its own size so each keeps its aspect ratio. */\nexport interface SourceIcon {\n\tIcon: IconComp;\n\tw: number;\n\th: number;\n}\n\n/**\n * A built-in \"tool\" that opens a config drawer (Rest API / email handover /\n * Slack) rather than inserting a mention. Surfaced as an empty-state source\n * button in the Tools section and as a row in the `@`-picker Tools view; picking\n * it opens the drawer and never writes into the instructions text.\n */\nexport interface ToolAction {\n\tsource: ToolSource;\n\tlabel: string;\n\ticon?: SourceIcon;\n\t/** Open this tool's config drawer. */\n\tonSelect: () => void;\n\t/**\n\t * Integration connection state for this source. `undefined` = no connection\n\t * gating (default). `false` = the store hasn't connected this integration →\n\t * the `@` picker shows a \"Connect\" row that calls {@link onConnect} instead of\n\t * drilling in / offering \"Create new\". `true` = connected (renders normally).\n\t * Set by the consumer via `config.integrationStatus` (today: Slack only).\n\t */\n\tconnected?: boolean;\n\t/** Open the parent's connect flow for this source (used when `connected === false`). */\n\tonConnect?: () => void;\n}\n\n/** Sources of the built-in drawer tools, in display order. */\nexport const TOOL_ACTION_SOURCES: ToolSource[] = [\n\tToolSource.RestApi,\n\tToolSource.EmailHandover,\n\tToolSource.Slack,\n];\n\n/**\n * Fixed display rank for the `@`-picker's tool-source groups (lower = higher). The\n * picker sorts its source rows by this so adding/updating a tool never reshuffles\n * them.
|
|
1
|
+
{"version":3,"file":"tools.js","sources":["../../../../../src/components/agent-builder/constants/tools.ts"],"sourcesContent":["import type { ToolSource as ModelToolSource } from '@bikdotai/bik-models/ai-agents/models/agent-tool';\nimport type { FunctionComponent, SVGAttributes } from 'react';\n\n/**\n * Static tool-related constants for the builder's Step 3 (tools & sub-agents):\n * the reference-picker category tabs and the per-source display labels. Kept here\n * (rather than inline in the picker / serialization utils) so the labels a user\n * sees are all in one obvious place.\n */\n\n/** A reference-picker category tab. */\nexport type Category = 'tool' | 'subagent';\n\n/** Category tabs shown at the root of the `@` reference picker. */\nexport const CATEGORIES: { key: Category; label: string }[] = [\n\t{ key: 'tool', label: 'Tools' },\n\t{ key: 'subagent', label: 'Sub-agent' },\n];\n\n/**\n * Every tool \"source\" the builder renders an icon / label / picker entry for.\n * Enum VALUES are the backend's canonical read-only `source` wire strings\n * (`app/agents/config/schema.py` → `ToolSource`, derived from `tool_key`): the\n * configurable tools are `email_handover` / `rest_api` / `slack`, every native\n * tool is `manifest`. `shopify` / `integration` are legacy bik-models sources\n * kept for back-compat (the backend now collapses natives to `manifest`).\n * Dynamic/unknown sources are looked up leniently — see `toolSourceLabel` and\n * `sourceIcon`.\n *\n * This is the RUNTIME mirror of the canonical `@bikdotai/bik-models` `ToolSource`\n * union (the shape the backend persists as `AgentToolDoc.source`). We keep an\n * enum — not a re-export of the type — because the members are needed at runtime\n * for labels, ranks, icons and `===` comparisons; a type-only union can't do\n * that. The two are kept in lock-step by {@link ToolSourceMatchesBikModels}\n * below, which fails to compile if they ever drift.\n */\nexport enum ToolSource {\n\tManifest = 'manifest',\n\tShopify = 'shopify',\n\tBigcommerce = 'bigcommerce',\n\tShipstation = 'shipstation',\n\tSkio = 'skio',\n\tGorgias = 'gorgias',\n\tIntegration = 'integration',\n\tRestApi = 'rest_api',\n\tEmailHandover = 'email_handover',\n\tSlack = 'slack',\n}\n\n/**\n * Compile-time guard that {@link ToolSource} stays a faithful mirror of the\n * canonical `@bikdotai/bik-models` `ToolSource` union. If a source is added to\n * (or removed from) either side without the other, `AssertTrue` receives `false`\n * and this type stops compiling — so the runtime enum can never silently diverge\n * from what the backend persists as `AgentToolDoc.source`. The tuple wrappers\n * (`[…]`) stop the conditionals from distributing over the unions, so it checks\n * set-equality in both directions.\n *\n * Type-only (erased at build): a drift shows up as a compile error on\n * `ToolSourceMatchesBikModels` telling you to reconcile this enum with\n * `@bikdotai/bik-models` (bump the dep and/or the enum).\n */\ntype AssertTrue<T extends true> = T;\ntype ToolSourceMatchesBikModels = AssertTrue<\n\t[`${ToolSource}`] extends [ModelToolSource]\n\t\t? [ModelToolSource] extends [`${ToolSource}`]\n\t\t\t? true\n\t\t\t: false\n\t\t: false\n>;\n\n/**\n * Display labels for the known tool sources — the CATEGORY/integration name, used\n * for the picker's source headers (drill-in groups), the empty-state source\n * buttons and the mention-chip prefix. A source is a category (\"Slack\") you drill\n * into; the specific addable action inside it (\"Send Slack message\") is\n * `TOOL_ACTION_LABELS`. Unknown sources fall back to the raw key (see\n * `toolSourceLabel`).\n */\nexport const TOOL_SOURCE_LABELS: Record<ToolSource, string> = {\n\t[ToolSource.Manifest]: 'Manifest',\n\t[ToolSource.Shopify]: 'Shopify',\n\t[ToolSource.Bigcommerce]: 'BigCommerce',\n\t[ToolSource.Shipstation]: 'ShipStation',\n\t[ToolSource.Skio]: 'Skio',\n\t[ToolSource.Gorgias]: 'Gorgias',\n\t[ToolSource.Integration]: 'Integration',\n\t[ToolSource.RestApi]: 'Rest API',\n\t[ToolSource.EmailHandover]: 'Email',\n\t[ToolSource.Slack]: 'Slack',\n};\n\n/**\n * The addable action inside a configurable/rest source — shown as the \"add\" row\n * in the `@` picker (below any existing instances) and the empty-state button.\n * Distinct from `TOOL_SOURCE_LABELS`, which names the category the action lives in\n * (e.g. category \"Slack\" → action \"Send Slack message\").\n */\nexport const TOOL_ACTION_LABELS: Partial<Record<ToolSource, string>> = {\n\t[ToolSource.RestApi]: 'REST API',\n\t[ToolSource.EmailHandover]: 'Send Email',\n\t[ToolSource.Slack]: 'Send Slack message',\n};\n\n/** A tool source's brand-glyph component. */\nexport type IconComp = FunctionComponent<SVGAttributes<SVGElement>>;\n\n/** Brand glyph for a tool source, with its own size so each keeps its aspect ratio. */\nexport interface SourceIcon {\n\tIcon: IconComp;\n\tw: number;\n\th: number;\n}\n\n/**\n * A built-in \"tool\" that opens a config drawer (Rest API / email handover /\n * Slack) rather than inserting a mention. Surfaced as an empty-state source\n * button in the Tools section and as a row in the `@`-picker Tools view; picking\n * it opens the drawer and never writes into the instructions text.\n */\nexport interface ToolAction {\n\tsource: ToolSource;\n\tlabel: string;\n\ticon?: SourceIcon;\n\t/** Open this tool's config drawer. */\n\tonSelect: () => void;\n\t/**\n\t * Integration connection state for this source. `undefined` = no connection\n\t * gating (default). `false` = the store hasn't connected this integration →\n\t * the `@` picker shows a \"Connect\" row that calls {@link onConnect} instead of\n\t * drilling in / offering \"Create new\". `true` = connected (renders normally).\n\t * Set by the consumer via `config.integrationStatus` (today: Slack only).\n\t */\n\tconnected?: boolean;\n\t/** Open the parent's connect flow for this source (used when `connected === false`). */\n\tonConnect?: () => void;\n}\n\n/** Sources of the built-in drawer tools, in display order. */\nexport const TOOL_ACTION_SOURCES: ToolSource[] = [\n\tToolSource.RestApi,\n\tToolSource.EmailHandover,\n\tToolSource.Slack,\n];\n\n/**\n * Fixed display rank for the `@`-picker's tool-source groups (lower = higher). The\n * picker sorts its source rows by this so adding/updating a tool never reshuffles\n * them. Manifest (the native tools) leads; any source not listed here\n * (dynamic/unknown, e.g. Integration) sorts AFTER Slack, keeping its discovery\n * order among the rest (Array.sort is stable).\n */\nexport const TOOL_SOURCE_RANK: Partial<Record<ToolSource, number>> = {\n\t[ToolSource.Manifest]: 0,\n\t[ToolSource.Shopify]: 1,\n\t[ToolSource.Bigcommerce]: 2,\n\t[ToolSource.Shipstation]: 3,\n\t[ToolSource.Skio]: 4,\n\t[ToolSource.Gorgias]: 5,\n\t[ToolSource.RestApi]: 6,\n\t[ToolSource.EmailHandover]: 7,\n\t[ToolSource.Slack]: 8,\n};\n\nconst UNRANKED_SOURCE_RANK = Object.keys(TOOL_SOURCE_RANK).length;\n\n/** Sort rank for a source string; unknown sources rank after all known ones. */\nexport const toolSourceRank = (source: string): number =>\n\tTOOL_SOURCE_RANK[source as ToolSource] ?? UNRANKED_SOURCE_RANK;\n\n/**\n * `tool_key` of a configurable shared-drawer tool (email / Slack). Lives here (not\n * in AgentBuilder.model) so this leaf constants file has no back-edge to the model\n * — the dependency stays one-way (model → constants), avoiding a circular import.\n */\nexport type ConfigToolKey = 'send_email' | 'send_slack_message';\n\n/**\n * Drawer sources rendered by the shared dynamic panel (`ConfigToolPanel`), each\n * mapped to its backend `tool_key`. Rest API is absent — it has a bespoke panel.\n */\nexport const CONFIG_TOOL_SOURCES: Partial<Record<ToolSource, ConfigToolKey>> = {\n\t[ToolSource.EmailHandover]: 'send_email',\n\t[ToolSource.Slack]: 'send_slack_message',\n};\n"],"names":["CATEGORIES","ToolSource","TOOL_SOURCE_LABELS","TOOL_ACTION_LABELS","TOOL_ACTION_SOURCES","TOOL_SOURCE_RANK","UNRANKED_SOURCE_RANK","toolSourceRank","source","CONFIG_TOOL_SOURCES"],"mappings":"gFAcO,MAAMA,EAAiD,CAC7D,CAAE,IAAK,OAAQ,MAAO,OAAA,EACtB,CAAE,IAAK,WAAY,MAAO,WAAA,CAC3B,EAmBO,IAAKC,GAAAA,IACXA,EAAA,SAAW,WACXA,EAAA,QAAU,UACVA,EAAA,YAAc,cACdA,EAAA,YAAc,cACdA,EAAA,KAAO,OACPA,EAAA,QAAU,UACVA,EAAA,YAAc,cACdA,EAAA,QAAU,WACVA,EAAA,cAAgB,iBAChBA,EAAA,MAAQ,QAVGA,IAAAA,GAAA,CAAA,CAAA,EA2CL,MAAMC,EAAiD,CAC5D,SAAsB,WACtB,QAAqB,UACrB,YAAyB,cACzB,YAAyB,cACzB,KAAkB,OAClB,QAAqB,UACrB,YAAyB,cACzB,SAAqB,WACrB,eAA2B,QAC3B,MAAmB,OACrB,EAQaC,EAA0D,CACrE,SAAqB,WACrB,eAA2B,aAC3B,MAAmB,oBACrB,EAqCaC,EAAoC,CAChD,WACA,iBACA,OACD,EASaC,EAAwD,CACnE,SAAsB,EACtB,QAAqB,EACrB,YAAyB,EACzB,YAAyB,EACzB,KAAkB,EAClB,QAAqB,EACrB,SAAqB,EACrB,eAA2B,EAC3B,MAAmB,CACrB,EAEMC,EAAuB,OAAO,KAAKD,CAAgB,EAAE,OAG9CE,EAAkBC,GAC9BH,EAAiBG,CAAoB,GAAKF,EAa9BG,EAAkE,CAC7E,eAA2B,aAC3B,MAAmB,oBACrB"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("../../../assets/icons/BigCommerce.svg.js"),n=require("../../../assets/icons/
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("../../../assets/icons/BigCommerce.svg.js"),n=require("../../../assets/icons/Gorgias.svg.js"),u=require("../../../assets/icons/ManifestGlass.svg.js"),l=require("../../../assets/icons/ShipStation.svg.js"),i=require("../../../assets/icons/Shopify.svg.js"),a=require("../../../assets/icons/Skio.svg.js"),s=require("react"),e=require("../constants/tools.js"),S=require("../../../icons/Social/Social/SlackIcon.js"),d=require("../../../icons/Informational/Communication/Email.js"),f=require("../../../icons/BIK AI specific/Webhook.js"),h=o=>o&&typeof o=="object"&&"default"in o?o:{default:o},I=h(s),c={[e.ToolSource.Manifest]:{Icon:u.default,w:24,h:24},[e.ToolSource.Shopify]:{Icon:i.default,w:21,h:24},[e.ToolSource.Bigcommerce]:{Icon:r.default,w:20,h:20},[e.ToolSource.Shipstation]:{Icon:l.default,w:22,h:21},[e.ToolSource.Skio]:{Icon:a.default,w:20,h:20},[e.ToolSource.Gorgias]:{Icon:n.default,w:20,h:20},[e.ToolSource.RestApi]:{Icon:f.default,w:20,h:20},[e.ToolSource.EmailHandover]:{Icon:d.default,w:20,h:20},[e.ToolSource.Slack]:{Icon:S.default,w:20,h:20}},q=o=>o?c[o]:void 0,w=(o,t=0)=>o?I.default.createElement(o.Icon,{width:o.w+t,height:o.h+t}):null;exports.SOURCE_ICONS=c;exports.renderSourceIcon=w;exports.sourceIcon=q;
|
|
2
2
|
//# sourceMappingURL=sourceIcons.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sourceIcons.js","sources":["../../../../../src/components/agent-builder/utils/sourceIcons.ts"],"sourcesContent":["import BigCommerce from '@src/assets/icons/BigCommerce.svg';\nimport ManifestGlass from '@src/assets/icons/ManifestGlass.svg';\nimport ShipStation from '@src/assets/icons/ShipStation.svg';\nimport Shopify from '@src/assets/icons/Shopify.svg';\nimport { Email, SlackIcon, Webhook } from '@src/icons';\nimport React from 'react';\nimport { ToolSource } from '../constants/tools';\nimport type { IconComp, SourceIcon } from '../constants/tools';\n\n// The icon types live with the source enum (constants/tools) to keep the\n// dependency one-directional (util → constants); re-exported here so existing\n// `from '../utils/sourceIcons'` importers keep resolving them.\nexport type { IconComp, SourceIcon };\n\n/**\n * Per-source brand glyph — shared by the `@` picker and the Tools source\n * buttons. Partial: not every source has a glyph (e.g. `integration`), and the\n * render path null-guards. Look up with {@link sourceIcon} when the key is a\n * dynamic / unknown string rather than a {@link ToolSource}.\n */\nexport const SOURCE_ICONS: Partial<Record<ToolSource, SourceIcon>> = {\n\t[ToolSource.Manifest]: { Icon: ManifestGlass, w: 24, h: 24 },\n\t[ToolSource.Shopify]: { Icon: Shopify, w: 21, h: 24 },\n\t[ToolSource.Bigcommerce]: { Icon: BigCommerce, w: 20, h: 20 },\n\t[ToolSource.Shipstation]: { Icon: ShipStation, w: 22, h: 21 },\n\t[ToolSource.RestApi]: { Icon: Webhook as IconComp, w: 20, h: 20 },\n\t[ToolSource.EmailHandover]: { Icon: Email as IconComp, w: 20, h: 20 },\n\t[ToolSource.Slack]: { Icon: SlackIcon as IconComp, w: 20, h: 20 },\n};\n\n/**\n * Lenient icon lookup for a source that may be a raw/dynamic string (a\n * bik-models tool source, an integration key, or the picker's `'other'`\n * fallback). Returns `undefined` for unknown sources.\n */\nexport const sourceIcon = (\n\tsource: string | undefined,\n): SourceIcon | undefined =>\n\tsource ? SOURCE_ICONS[source as ToolSource] : undefined;\n\n/**\n * Render a {@link SourceIcon} at its own aspect ratio. `sizeDelta` nudges both\n * dimensions (e.g. `-4` for the smaller source-button glyph). Returns `null` when\n * no icon is supplied, so callers can drop their own `icon &&` guard.\n */\nexport const renderSourceIcon = (\n\ticon: SourceIcon | undefined,\n\tsizeDelta = 0,\n): React.ReactElement | null =>\n\ticon\n\t\t? React.createElement(icon.Icon, {\n\t\t\t\twidth: icon.w + sizeDelta,\n\t\t\t\theight: icon.h + sizeDelta,\n\t\t })\n\t\t: null;\n"],"names":["SOURCE_ICONS","ToolSource","ManifestGlass","Shopify","BigCommerce","ShipStation","Webhook","Email","SlackIcon","sourceIcon","source","renderSourceIcon","icon","sizeDelta","React"],"mappings":"
|
|
1
|
+
{"version":3,"file":"sourceIcons.js","sources":["../../../../../src/components/agent-builder/utils/sourceIcons.ts"],"sourcesContent":["import BigCommerce from '@src/assets/icons/BigCommerce.svg';\nimport Gorgias from '@src/assets/icons/Gorgias.svg';\nimport ManifestGlass from '@src/assets/icons/ManifestGlass.svg';\nimport ShipStation from '@src/assets/icons/ShipStation.svg';\nimport Shopify from '@src/assets/icons/Shopify.svg';\nimport Skio from '@src/assets/icons/Skio.svg';\nimport { Email, SlackIcon, Webhook } from '@src/icons';\nimport React from 'react';\nimport { ToolSource } from '../constants/tools';\nimport type { IconComp, SourceIcon } from '../constants/tools';\n\n// The icon types live with the source enum (constants/tools) to keep the\n// dependency one-directional (util → constants); re-exported here so existing\n// `from '../utils/sourceIcons'` importers keep resolving them.\nexport type { IconComp, SourceIcon };\n\n/**\n * Per-source brand glyph — shared by the `@` picker and the Tools source\n * buttons. Partial: not every source has a glyph (e.g. `integration`), and the\n * render path null-guards. Look up with {@link sourceIcon} when the key is a\n * dynamic / unknown string rather than a {@link ToolSource}.\n */\nexport const SOURCE_ICONS: Partial<Record<ToolSource, SourceIcon>> = {\n\t[ToolSource.Manifest]: { Icon: ManifestGlass, w: 24, h: 24 },\n\t[ToolSource.Shopify]: { Icon: Shopify, w: 21, h: 24 },\n\t[ToolSource.Bigcommerce]: { Icon: BigCommerce, w: 20, h: 20 },\n\t[ToolSource.Shipstation]: { Icon: ShipStation, w: 22, h: 21 },\n\t[ToolSource.Skio]: { Icon: Skio, w: 20, h: 20 },\n\t[ToolSource.Gorgias]: { Icon: Gorgias, w: 20, h: 20 },\n\t[ToolSource.RestApi]: { Icon: Webhook as IconComp, w: 20, h: 20 },\n\t[ToolSource.EmailHandover]: { Icon: Email as IconComp, w: 20, h: 20 },\n\t[ToolSource.Slack]: { Icon: SlackIcon as IconComp, w: 20, h: 20 },\n};\n\n/**\n * Lenient icon lookup for a source that may be a raw/dynamic string (a\n * bik-models tool source, an integration key, or the picker's `'other'`\n * fallback). Returns `undefined` for unknown sources.\n */\nexport const sourceIcon = (\n\tsource: string | undefined,\n): SourceIcon | undefined =>\n\tsource ? SOURCE_ICONS[source as ToolSource] : undefined;\n\n/**\n * Render a {@link SourceIcon} at its own aspect ratio. `sizeDelta` nudges both\n * dimensions (e.g. `-4` for the smaller source-button glyph). Returns `null` when\n * no icon is supplied, so callers can drop their own `icon &&` guard.\n */\nexport const renderSourceIcon = (\n\ticon: SourceIcon | undefined,\n\tsizeDelta = 0,\n): React.ReactElement | null =>\n\ticon\n\t\t? React.createElement(icon.Icon, {\n\t\t\t\twidth: icon.w + sizeDelta,\n\t\t\t\theight: icon.h + sizeDelta,\n\t\t })\n\t\t: null;\n"],"names":["SOURCE_ICONS","ToolSource","ManifestGlass","Shopify","BigCommerce","ShipStation","Skio","Gorgias","Webhook","Email","SlackIcon","sourceIcon","source","renderSourceIcon","icon","sizeDelta","React"],"mappings":"irBAsBaA,EAAwD,CACpE,CAACC,EAAAA,WAAW,QAAQ,EAAG,CAAE,KAAMC,EAAAA,QAAe,EAAG,GAAI,EAAG,EAAA,EACxD,CAACD,EAAAA,WAAW,OAAO,EAAG,CAAE,KAAME,EAAAA,QAAS,EAAG,GAAI,EAAG,EAAA,EACjD,CAACF,EAAAA,WAAW,WAAW,EAAG,CAAE,KAAMG,EAAAA,QAAa,EAAG,GAAI,EAAG,EAAA,EACzD,CAACH,EAAAA,WAAW,WAAW,EAAG,CAAE,KAAMI,EAAAA,QAAa,EAAG,GAAI,EAAG,EAAA,EACzD,CAACJ,EAAAA,WAAW,IAAI,EAAG,CAAE,KAAMK,EAAAA,QAAM,EAAG,GAAI,EAAG,EAAA,EAC3C,CAACL,EAAAA,WAAW,OAAO,EAAG,CAAE,KAAMM,EAAAA,QAAS,EAAG,GAAI,EAAG,EAAA,EACjD,CAACN,EAAAA,WAAW,OAAO,EAAG,CAAE,KAAMO,EAAAA,QAAqB,EAAG,GAAI,EAAG,EAAA,EAC7D,CAACP,EAAAA,WAAW,aAAa,EAAG,CAAE,KAAMQ,EAAAA,QAAmB,EAAG,GAAI,EAAG,EAAA,EACjE,CAACR,EAAAA,WAAW,KAAK,EAAG,CAAE,KAAMS,EAAAA,QAAuB,EAAG,GAAI,EAAG,EAAA,CAC9D,EAOaC,EACZC,GAEAA,EAASZ,EAAaY,CAAoB,EAAI,OAOlCC,EAAmB,CAC/BC,EACAC,EAAY,IAEZD,EACGE,UAAM,cAAcF,EAAK,KAAM,CAC/B,MAAOA,EAAK,EAAIC,EAChB,OAAQD,EAAK,EAAIC,CACjB,CAAC,EACD"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),C=require("../../assets/icons/alert_triangle.svg.js"),w=require("../../assets/icons/check.svg.js"),S=require("../../assets/icons/cross.svg.js"),j=require("../../assets/icons/errorInfo.svg.js"),O=require("../../assets/icons/info.svg.js"),c=require("react"),k=require("react-dom"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),C=require("../../assets/icons/alert_triangle.svg.js"),w=require("../../assets/icons/check.svg.js"),S=require("../../assets/icons/cross.svg.js"),j=require("../../assets/icons/errorInfo.svg.js"),O=require("../../assets/icons/info.svg.js"),c=require("react"),k=require("react-dom"),s=require("react-toastify"),m=require("./Toaster.styled.js"),x=require("../TypographyStyle.js"),n=require("../../constants/Theme.js"),h=require("../button/Button.js"),b=t=>t&&typeof t=="object"&&"default"in t?t:{default:t},I=b(c),R=b(k),v=t=>e.jsxs(x.BodySecondary,{color:"#9E9E9E",customStyles:{fontWeight:600,fontSize:14,width:25},children:[t.duration,"s"]}),y=t=>{const o=t.type==="default"?n.COLORS.content.primary:t.type==="success"?n.COLORS.content.positive:t.type==="error"?n.COLORS.content.negative:t.type==="warning"?n.COLORS.content.warning:n.COLORS.content.brand,[i,u]=c.useState(t.duration||-1);c.useEffect(()=>{if(!t.duration||t.duration<=0){u(-1);return}u(t.duration);const a=setInterval(()=>{u(B=>{const f=B-1;return f<=0?(clearInterval(a),-1):f})},1e3);return()=>clearInterval(a)},[t.duration]);const l=t.blocking&&i===-1?!1:t.blocking&&i>0,d=()=>{!l&&t.closeToast&&t.closeToast()},r=a=>{a.key==="Enter"&&!l&&t.closeToast&&t.closeToast()};return e.jsx("div",{tabIndex:l?-1:0,role:"button",style:{width:i>0?25:20,display:"flex",cursor:l?"not-allowed":"pointer",alignSelf:`${t.alignTop?"flex-start":"center"}`,opacity:l?.5:1,marginLeft:"auto",flexShrink:0},onClick:d,onKeyDown:r,children:i>0?e.jsx(v,{duration:i}):e.jsx(S.default,{height:20,width:20,color:o})})},T=t=>{const o=n.COLORS.content.placeholder,{toasterText:i}=c.useContext(g);return e.jsx(e.Fragment,{children:e.jsxs("div",{style:{display:"flex",flexGrow:1,maxWidth:"100%"},children:[e.jsx("div",{style:{flexGrow:1,marginRight:16,display:"flex",alignItems:"center",minWidth:0,overflow:"hidden"},children:e.jsxs("div",{style:{width:"100%",minWidth:0,wordBreak:"break-word",overflowWrap:"break-word"},children:[t.subText?e.jsx(x.TitleSmall,{color:"inherit",children:t.toastText??i}):e.jsx(x.BodySecondary,{color:"inherit",children:t.toastText??i}),t.subText&&e.jsx("div",{style:{marginTop:2},children:e.jsx(x.BodyCaption,{color:n.COLORS.content.secondary,children:t.subText})})]})}),t.showButton&&e.jsx("div",{style:{display:"flex",flexDirection:"column",alignSelf:"center",padding:"6px 0px",minWidth:t.subText?"fit-content":"auto",marginRight:t.showSecondButton?4:0},children:e.jsx(h.Button,{buttonText:t.buttonText,buttonType:"tertiaryGray",color:n.COLORS.content.secondary,onClick:t.onButtonClick})}),t.showSecondButton&&e.jsx("div",{style:{display:"flex",flexDirection:"column",alignSelf:"center",padding:"6px 0px",minWidth:t.subText?"fit-content":"auto"},children:e.jsx(h.Button,{buttonText:t.secondButtonText,buttonType:"tertiaryGray",color:n.COLORS.content.secondary,onClick:t.onSecondButtonClick})}),t.showButton||t.showSecondButton?e.jsx("div",{style:{height:28,alignSelf:"center",marginLeft:8,marginRight:8,borderRight:`1px solid ${o}`,borderRadius:1}}):null]})})},P=t=>{const o=c.useRef(t.toastId||"default-toast"),[i,u]=c.useState(t.text),l=s.cssTransition({enter:"Toastify__slide-enter",exit:"Toastify__slide-exit"}),d=t.type==="default"?null:t.type==="success"?e.jsx(w.default,{width:20,height:20,color:n.COLORS.content.positive}):t.type==="error"?e.jsx(j.default,{width:20,height:20,color:n.COLORS.content.negative}):t.type==="warning"?e.jsx(C.default,{width:20,height:20,color:n.COLORS.content.warning}):e.jsx(O.default,{width:20,height:20,color:n.COLORS.content.brand});c.useEffect(()=>{o.current&&o.current===t.toastId?(u(t.text),s.toast.update(o.current,{autoClose:t.autoClose})):o.current&&o.current!==t.toastId&&r(t.text)},[t.toastId,t.text]);const r=a=>{t.hideLeftIcon!==void 0||t.leftIcon?s.toast(e.jsx(T,{toastText:a,type:t.type||"info",buttonText:t.buttonProps?.buttonText,secondButtonText:t.secondButtonProps?.buttonText,showButton:t.buttonProps?.showButton,showSecondButton:t.secondButtonProps?.showButton,onButtonClick:t.buttonProps?.onButtonClick,onSecondButtonClick:t.secondButtonProps?.onButtonClick,subText:t.subText}),{onClose:t.onCloseToast?t.onCloseToast:()=>({}),icon:t.hideLeftIcon===!0?!1:t.leftIcon?t.leftIcon:t.type==="default"?!1:e.jsx("div",{style:{display:"flex",alignItems:"flex-start"},children:d}),type:t.type,closeButton:t.hideCloseButton?!1:e.jsx(y,{type:t.type||"default",alignTop:!!(t.subText&&!(t.buttonProps?.showButton||t.secondButtonProps?.showButton)),blocking:t.blocking,duration:t.duration}),toastId:t.toastId||"default-toast",transition:l}):o.current=s.toast(e.jsx(T,{toastText:a,type:t.type||"info",buttonText:t.buttonProps?.buttonText,secondButtonText:t.secondButtonProps?.buttonText,showButton:t.buttonProps?.showButton,showSecondButton:t.secondButtonProps?.showButton,onButtonClick:t.buttonProps?.onButtonClick,onSecondButtonClick:t.secondButtonProps?.onButtonClick,subText:t.subText}),{onClose:t.onCloseToast?t.onCloseToast:()=>({}),type:t.type,icon:t.type==="default"?!1:e.jsx("div",{style:{display:"flex",alignItems:"flex-start"},children:d}),closeButton:t.hideCloseButton?!1:e.jsx(y,{type:t.type||"default",alignTop:!!(t.subText&&!(t.buttonProps?.showButton||t.secondButtonProps?.showButton)),blocking:t.blocking,duration:t.duration}),toastId:t.toastId||"default-toast",transition:l})};return c.useEffect(()=>{r()},[]),R.default.createPortal(e.jsx(m.ToasterStyled,{width:t.width,height:t.height,zIndex:t.zIndex,isSubTextIncluded:!!t.subText,type:t.type,children:e.jsx(g.Provider,{value:{toasterText:i},children:e.jsx(s.ToastContainer,{position:t.position||"top-right",closeOnClick:t.closeOnClick||!1,hideProgressBar:t.hideProgressBar||!1,draggable:!1,autoClose:t.autoClose||!1,theme:"colored"})})}),document.body)},g=I.default.createContext({toasterText:""});exports.Toaster=P;
|
|
2
2
|
//# sourceMappingURL=Toaster.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Toaster.js","sources":["../../../../src/components/toaster/Toaster.tsx"],"sourcesContent":["import AlertTriangle from '@src/assets/icons/alert_triangle.svg';\nimport Check from '@src/assets/icons/check.svg';\nimport Cross from '@src/assets/icons/cross.svg';\nimport Error from '@src/assets/icons/errorInfo.svg';\nimport Info from '@src/assets/icons/info.svg';\nimport React, {\n\tFunctionComponent,\n\tuseContext,\n\tuseEffect,\n\tuseRef,\n\tuseState,\n} from 'react';\nimport ReactDOM from 'react-dom';\nimport {\n\tcssTransition,\n\tId,\n\ttoast,\n\tToastContainer,\n\tToastPosition,\n\tTypeOptions,\n} from 'react-toastify';\nimport { IconProps } from 'react-toastify/dist/components';\nimport { Button } from '@src/components/button';\nimport { ToasterStyled } from '@src/components/toaster/Toaster.styled';\nimport {\n\tBodyCaption,\n\tBodySecondary,\n\tTitleSmall,\n} from '@src/components/TypographyStyle';\nimport { COLORS } from '@src/constants/Theme';\n\nexport type ToasterButtonProps = {\n\tshowButton?: boolean;\n\tonButtonClick?: () => Record<string, never>;\n\tbuttonText?: string;\n};\nexport type ToasterProps = {\n\ttext: string;\n\tsubText?: string;\n\tposition?: ToastPosition;\n\ttype?: 'info' | 'success' | 'error' | 'default' | 'warning';\n\tduration?: number;\n\tblocking?: boolean;\n\tcloseOnClick?: boolean;\n\thideProgressBar?: boolean;\n\tautoClose?: number | false | undefined;\n\tleftIcon?: React.ReactElement<IconProps>;\n\thideLeftIcon?: boolean;\n\tbuttonProps?: ToasterButtonProps;\n\tsecondButtonProps?: ToasterButtonProps;\n\tonCloseToast?: <T>(props: T) => void;\n\twidth?: string;\n\theight?: string;\n\thideCloseButton?: boolean;\n\tzIndex?: number;\n\ttoastId?: string;\n};\n\nconst CountDownBar: React.FC<{ duration: number }> = (props) => {\n\treturn (\n\t\t<BodySecondary\n\t\t\tcolor={`#9E9E9E`}\n\t\t\tcustomStyles={{\n\t\t\t\tfontWeight: 600,\n\t\t\t\tfontSize: 14,\n\t\t\t\twidth: 25,\n\t\t\t}}\n\t\t>\n\t\t\t{props.duration}s\n\t\t</BodySecondary>\n\t);\n};\n\nconst CloseButton: React.FC<{\n\ttype: string;\n\tcloseToast?: () => Record<string, never>;\n\talignTop?: boolean;\n\tblocking?: boolean;\n\tduration?: number;\n}> = (props) => {\n\tconst iconColor =\n\t\tprops.type === 'default'\n\t\t\t? COLORS.content.primary\n\t\t\t: props.type === 'success'\n\t\t\t? COLORS.content.positive\n\t\t\t: props.type === 'error'\n\t\t\t? COLORS.content.negative\n\t\t\t: props.type === 'warning'\n\t\t\t? COLORS.content.warning\n\t\t\t: COLORS.content.brand;\n\n\t// Each CloseButton has its own independent timer\n\tconst [timerValue, setTimerValue] = useState<number>(props.duration || -1);\n\n\tuseEffect(() => {\n\t\tif (!props.duration || props.duration <= 0) {\n\t\t\tsetTimerValue(-1);\n\t\t\treturn;\n\t\t}\n\n\t\tsetTimerValue(props.duration);\n\n\t\tconst interval = setInterval(() => {\n\t\t\tsetTimerValue((prev) => {\n\t\t\t\tconst next = prev - 1;\n\t\t\t\tif (next <= 0) {\n\t\t\t\t\tclearInterval(interval);\n\t\t\t\t\treturn -1;\n\t\t\t\t}\n\t\t\t\treturn next;\n\t\t\t});\n\t\t}, 1000);\n\n\t\treturn () => clearInterval(interval);\n\t}, [props.duration]);\n\n\t// Enable button when timerValue is -1, otherwise check blocking and timer\n\tconst isDisabled =\n\t\tprops.blocking && timerValue === -1\n\t\t\t? false\n\t\t\t: props.blocking && timerValue > 0;\n\n\tconst handleClick = () => {\n\t\tif (!isDisabled && props.closeToast) {\n\t\t\tprops.closeToast();\n\t\t}\n\t};\n\n\tconst handleKeyDown = (e: React.KeyboardEvent) => {\n\t\tif (e.key === 'Enter' && !isDisabled && props.closeToast) {\n\t\t\tprops.closeToast();\n\t\t}\n\t};\n\n\treturn (\n\t\t<div\n\t\t\ttabIndex={isDisabled ? -1 : 0}\n\t\t\trole={'button'}\n\t\t\tstyle={{\n\t\t\t\twidth: timerValue > 0 ? 25 : 20,\n\t\t\t\tdisplay: 'flex',\n\t\t\t\tcursor: isDisabled ? 'not-allowed' : 'pointer',\n\t\t\t\talignSelf: `${props.alignTop ? 'flex-start' : 'center'}`,\n\t\t\t\topacity: isDisabled ? 0.5 : 1,\n\t\t\t}}\n\t\t\tonClick={handleClick}\n\t\t\tonKeyDown={handleKeyDown}\n\t\t>\n\t\t\t{timerValue > 0 ? (\n\t\t\t\t<CountDownBar duration={timerValue} />\n\t\t\t) : (\n\t\t\t\t<Cross height={20} width={20} color={iconColor} />\n\t\t\t)}\n\t\t</div>\n\t);\n};\n\nconst RenderContent: React.FC<{\n\ttoastText?: string;\n\ttype: TypeOptions;\n\tshowButton?: boolean;\n\tshowSecondButton?: boolean;\n\tonButtonClick?: () => Record<string, never>;\n\tonSecondButtonClick?: () => Record<string, never>;\n\tbuttonText?: string;\n\tsecondButtonText?: string;\n\tsubText?: string;\n}> = (props) => {\n\tconst strokeColor = COLORS.content.placeholder;\n\n\tconst { toasterText: toasterTextContext } = useContext(ToastContext);\n\n\treturn (\n\t\t<>\n\t\t\t<div\n\t\t\t\tstyle={{\n\t\t\t\t\tdisplay: 'flex',\n\t\t\t\t\tflexGrow: 1,\n\t\t\t\t\tmaxWidth: '100%',\n\t\t\t\t}}\n\t\t\t>\n\t\t\t\t<div\n\t\t\t\t\tstyle={{\n\t\t\t\t\t\tflexGrow: 1,\n\t\t\t\t\t\tmarginRight: 16,\n\t\t\t\t\t\tdisplay: 'flex',\n\t\t\t\t\t\talignItems: 'center',\n\t\t\t\t\t\tminWidth: 0,\n\t\t\t\t\t\toverflow: 'hidden',\n\t\t\t\t\t}}\n\t\t\t\t>\n\t\t\t\t\t<div\n\t\t\t\t\t\tstyle={{\n\t\t\t\t\t\t\twidth: '100%',\n\t\t\t\t\t\t\tminWidth: 0,\n\t\t\t\t\t\t\twordBreak: 'break-word',\n\t\t\t\t\t\t\toverflowWrap: 'break-word',\n\t\t\t\t\t\t}}\n\t\t\t\t\t>\n\t\t\t\t\t\t{props.subText ? (\n\t\t\t\t\t\t\t<TitleSmall color={'inherit'}>\n\t\t\t\t\t\t\t\t{/* In normal scenarios, we use the text from prop. As a special case, when we need to change the text in already rendered toast, we change the text in context and let this component render on its own */}\n\t\t\t\t\t\t\t\t{props.toastText ?? toasterTextContext}\n\t\t\t\t\t\t\t</TitleSmall>\n\t\t\t\t\t\t) : (\n\t\t\t\t\t\t\t<BodySecondary color={'inherit'}>\n\t\t\t\t\t\t\t\t{/* In normal scenarios, we use the text from prop. As a special case, when we need to change the text in already rendered toast, we change the text in context and let this component render on its own */}\n\t\t\t\t\t\t\t\t{props.toastText ?? toasterTextContext}\n\t\t\t\t\t\t\t</BodySecondary>\n\t\t\t\t\t\t)}\n\t\t\t\t\t\t{props.subText && (\n\t\t\t\t\t\t\t<div style={{ marginTop: 2 }}>\n\t\t\t\t\t\t\t\t<BodyCaption color={COLORS.content.secondary}>\n\t\t\t\t\t\t\t\t\t{props.subText}\n\t\t\t\t\t\t\t\t</BodyCaption>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t)}\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t\t{props.showButton && (\n\t\t\t\t\t<div\n\t\t\t\t\t\tstyle={{\n\t\t\t\t\t\t\tdisplay: 'flex',\n\t\t\t\t\t\t\tflexDirection: 'column',\n\t\t\t\t\t\t\talignSelf: 'center',\n\t\t\t\t\t\t\tpadding: '6px 0px',\n\t\t\t\t\t\t\tminWidth: props.subText ? 'fit-content' : 'auto',\n\t\t\t\t\t\t\tmarginRight: props.showSecondButton ? 4 : 0,\n\t\t\t\t\t\t}}\n\t\t\t\t\t>\n\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\tbuttonText={props.buttonText}\n\t\t\t\t\t\t\tbuttonType={'tertiaryGray'}\n\t\t\t\t\t\t\tcolor={COLORS.content.secondary}\n\t\t\t\t\t\t\tonClick={props.onButtonClick}\n\t\t\t\t\t\t></Button>\n\t\t\t\t\t</div>\n\t\t\t\t)}\n\t\t\t\t{props.showSecondButton && (\n\t\t\t\t\t<div\n\t\t\t\t\t\tstyle={{\n\t\t\t\t\t\t\tdisplay: 'flex',\n\t\t\t\t\t\t\tflexDirection: 'column',\n\t\t\t\t\t\t\talignSelf: 'center',\n\t\t\t\t\t\t\tpadding: '6px 0px',\n\t\t\t\t\t\t\tminWidth: props.subText ? 'fit-content' : 'auto',\n\t\t\t\t\t\t}}\n\t\t\t\t\t>\n\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\tbuttonText={props.secondButtonText}\n\t\t\t\t\t\t\tbuttonType={'tertiaryGray'}\n\t\t\t\t\t\t\tcolor={COLORS.content.secondary}\n\t\t\t\t\t\t\tonClick={props.onSecondButtonClick}\n\t\t\t\t\t\t></Button>\n\t\t\t\t\t</div>\n\t\t\t\t)}\n\t\t\t\t{!(props.showButton || props.showSecondButton) ? null : (\n\t\t\t\t\t<div\n\t\t\t\t\t\tstyle={{\n\t\t\t\t\t\t\theight: 28,\n\t\t\t\t\t\t\talignSelf: 'center',\n\t\t\t\t\t\t\tmarginLeft: 8,\n\t\t\t\t\t\t\tmarginRight: 8,\n\t\t\t\t\t\t\tborderRight: `1px solid ${strokeColor}`,\n\t\t\t\t\t\t\tborderRadius: 1,\n\t\t\t\t\t\t}}\n\t\t\t\t\t></div>\n\t\t\t\t)}\n\t\t\t</div>\n\t\t</>\n\t);\n};\n\ntype Props = ToasterProps;\n\nexport const Toaster: FunctionComponent<Props> = (props) => {\n\tconst toastId = useRef<Id>(props.toastId || 'default-toast');\n\tconst [toastLocal, setToastLocal] = useState(props.text);\n\tconst bounce = cssTransition({\n\t\tenter: 'Toastify__slide-enter',\n\t\texit: 'Toastify__slide-exit',\n\t});\n\n\tconst leftIcon =\n\t\tprops.type === 'default' ? null : props.type === 'success' ? (\n\t\t\t<Check width={20} height={20} color={COLORS.content.positive} />\n\t\t) : props.type === 'error' ? (\n\t\t\t<Error width={20} height={20} color={COLORS.content.negative} />\n\t\t) : props.type === 'warning' ? (\n\t\t\t<AlertTriangle width={20} height={20} color={COLORS.content.warning} />\n\t\t) : (\n\t\t\t<Info width={20} height={20} color={COLORS.content.brand} />\n\t\t);\n\n\tuseEffect(() => {\n\t\t// When toast id is same but text needed to change, we change the text in context and let the toast re-render on its own.\n\t\tif (toastId.current && toastId.current === props.toastId) {\n\t\t\tsetToastLocal(props.text);\n\t\t\ttoast.update(toastId.current, {\n\t\t\t\tautoClose: props.autoClose,\n\t\t\t});\n\t\t\t// If toast ids are different, we call notify again which will stack the toasts up\n\t\t} else if (toastId.current && toastId.current !== props.toastId) {\n\t\t\tnotify(props.text);\n\t\t}\n\t}, [props.toastId, props.text]);\n\n\tconst notify = (toastText?: string) => {\n\t\tif (props.hideLeftIcon !== undefined || props.leftIcon) {\n\t\t\ttoast(\n\t\t\t\t<RenderContent\n\t\t\t\t\ttoastText={toastText}\n\t\t\t\t\ttype={props.type || 'info'}\n\t\t\t\t\tbuttonText={props.buttonProps?.buttonText}\n\t\t\t\t\tsecondButtonText={props.secondButtonProps?.buttonText}\n\t\t\t\t\tshowButton={props.buttonProps?.showButton}\n\t\t\t\t\tshowSecondButton={props.secondButtonProps?.showButton}\n\t\t\t\t\tonButtonClick={props.buttonProps?.onButtonClick}\n\t\t\t\t\tonSecondButtonClick={props.secondButtonProps?.onButtonClick}\n\t\t\t\t\tsubText={props.subText}\n\t\t\t\t/>,\n\t\t\t\t{\n\t\t\t\t\tonClose: props.onCloseToast ? props.onCloseToast : () => ({}),\n\t\t\t\t\ticon:\n\t\t\t\t\t\tprops.hideLeftIcon === true ? (\n\t\t\t\t\t\t\tfalse\n\t\t\t\t\t\t) : props.leftIcon ? (\n\t\t\t\t\t\t\tprops.leftIcon\n\t\t\t\t\t\t) : props.type === 'default' ? (\n\t\t\t\t\t\t\tfalse\n\t\t\t\t\t\t) : (\n\t\t\t\t\t\t\t<div style={{ display: 'flex', alignItems: 'flex-start' }}>\n\t\t\t\t\t\t\t\t{leftIcon}\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t),\n\t\t\t\t\ttype: props.type,\n\t\t\t\t\tcloseButton: (\n\t\t\t\t\t\t<CloseButton\n\t\t\t\t\t\t\ttype={props.type || 'default'}\n\t\t\t\t\t\t\talignTop={\n\t\t\t\t\t\t\t\t!!(\n\t\t\t\t\t\t\t\t\tprops.subText &&\n\t\t\t\t\t\t\t\t\t!(\n\t\t\t\t\t\t\t\t\t\tprops.buttonProps?.showButton ||\n\t\t\t\t\t\t\t\t\t\tprops.secondButtonProps?.showButton\n\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tblocking={props.blocking}\n\t\t\t\t\t\t\tduration={props.duration}\n\t\t\t\t\t\t/>\n\t\t\t\t\t),\n\t\t\t\t\ttoastId: props.toastId || 'default-toast',\n\t\t\t\t\ttransition: bounce,\n\t\t\t\t},\n\t\t\t);\n\t\t} else {\n\t\t\ttoastId.current = toast(\n\t\t\t\t<RenderContent\n\t\t\t\t\ttoastText={toastText}\n\t\t\t\t\ttype={props.type || 'info'}\n\t\t\t\t\tbuttonText={props.buttonProps?.buttonText}\n\t\t\t\t\tsecondButtonText={props.secondButtonProps?.buttonText}\n\t\t\t\t\tshowButton={props.buttonProps?.showButton}\n\t\t\t\t\tshowSecondButton={props.secondButtonProps?.showButton}\n\t\t\t\t\tonButtonClick={props.buttonProps?.onButtonClick}\n\t\t\t\t\tonSecondButtonClick={props.secondButtonProps?.onButtonClick}\n\t\t\t\t\tsubText={props.subText}\n\t\t\t\t/>,\n\t\t\t\t{\n\t\t\t\t\tonClose: props.onCloseToast ? props.onCloseToast : () => ({}),\n\t\t\t\t\ttype: props.type,\n\t\t\t\t\ticon:\n\t\t\t\t\t\tprops.type === 'default' ? (\n\t\t\t\t\t\t\tfalse\n\t\t\t\t\t\t) : (\n\t\t\t\t\t\t\t<div style={{ display: 'flex', alignItems: 'flex-start' }}>\n\t\t\t\t\t\t\t\t{leftIcon}\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t),\n\t\t\t\t\tcloseButton: (\n\t\t\t\t\t\t<CloseButton\n\t\t\t\t\t\t\ttype={props.type || 'default'}\n\t\t\t\t\t\t\talignTop={\n\t\t\t\t\t\t\t\t!!(\n\t\t\t\t\t\t\t\t\tprops.subText &&\n\t\t\t\t\t\t\t\t\t!(\n\t\t\t\t\t\t\t\t\t\tprops.buttonProps?.showButton ||\n\t\t\t\t\t\t\t\t\t\tprops.secondButtonProps?.showButton\n\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tblocking={props.blocking}\n\t\t\t\t\t\t\tduration={props.duration}\n\t\t\t\t\t\t/>\n\t\t\t\t\t),\n\t\t\t\t\ttoastId: props.toastId || 'default-toast',\n\t\t\t\t\ttransition: bounce,\n\t\t\t\t},\n\t\t\t);\n\t\t}\n\t};\n\n\tuseEffect(() => {\n\t\tnotify();\n\t}, []);\n\n\treturn ReactDOM.createPortal(\n\t\t<ToasterStyled\n\t\t\twidth={props.width}\n\t\t\theight={props.height}\n\t\t\tzIndex={props.zIndex}\n\t\t\tisSubTextIncluded={!!props.subText}\n\t\t\ttype={props.type}\n\t\t>\n\t\t\t<ToastContext.Provider value={{ toasterText: toastLocal }}>\n\t\t\t\t<ToastContainer\n\t\t\t\t\tposition={props.position || 'top-right'}\n\t\t\t\t\tcloseOnClick={props.closeOnClick || false}\n\t\t\t\t\thideProgressBar={props.hideProgressBar || false}\n\t\t\t\t\tdraggable={false}\n\t\t\t\t\tautoClose={props.autoClose || false}\n\t\t\t\t\ttheme={'colored'}\n\t\t\t\t/>\n\t\t\t</ToastContext.Provider>\n\t\t</ToasterStyled>,\n\t\tdocument.body,\n\t);\n};\n\nconst ToastContext = React.createContext({\n\ttoasterText: '',\n});\n"],"names":["CountDownBar","props","jsxs","BodySecondary","CloseButton","iconColor","COLORS","timerValue","setTimerValue","useState","useEffect","interval","prev","next","isDisabled","handleClick","handleKeyDown","e","jsx","Cross","RenderContent","strokeColor","toasterTextContext","useContext","ToastContext","Fragment","TitleSmall","BodyCaption","Button","Toaster","toastId","useRef","toastLocal","setToastLocal","bounce","cssTransition","leftIcon","Check","Error","AlertTriangle","Info","toast","notify","toastText","ReactDOM","ToasterStyled","ToastContainer","React"],"mappings":"ynBA0DMA,EAAgDC,GAEpDC,EAAAA,KAACC,EAAAA,cAAA,CACA,MAAO,UACP,aAAc,CACb,WAAY,IACZ,SAAU,GACV,MAAO,EAAA,EAGP,SAAA,CAAAF,EAAM,SAAS,GAAA,CAAA,CAAA,EAKbG,EAMAH,GAAU,CACf,MAAMI,EACLJ,EAAM,OAAS,UACZK,EAAAA,OAAO,QAAQ,QACfL,EAAM,OAAS,UACfK,EAAAA,OAAO,QAAQ,SACfL,EAAM,OAAS,QACfK,EAAAA,OAAO,QAAQ,SACfL,EAAM,OAAS,UACfK,EAAAA,OAAO,QAAQ,QACfA,EAAAA,OAAO,QAAQ,MAGb,CAACC,EAAYC,CAAa,EAAIC,EAAAA,SAAiBR,EAAM,UAAY,EAAE,EAEzES,EAAAA,UAAU,IAAM,CACf,GAAI,CAACT,EAAM,UAAYA,EAAM,UAAY,EAAG,CAC3CO,EAAc,EAAE,EACh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B,SACC,CAAC,EACAA,EAAM,SACN,EACCA,EAAM,aAAa,YACnBA,EAAM,mBAAmB,aAI5B,SAAUA,EAAM,SAChB,SAAUA,EAAM,QAAA,CAAA,EAGlB,QAASA,EAAM,SAAW,gBAC1B,WAAYiC,CAAA,CACb,CAGH,EAEAxB,OAAAA,EAAAA,UAAU,IAAM,CACfgC,EAAA,CACD,EAAG,CAAA,CAAE,EAEEE,EAAAA,QAAS,aACf1B,EAAAA,IAAC2B,EAAAA,cAAA,CACA,MAAO5C,EAAM,MACb,OAAQA,EAAM,OACd,OAAQA,EAAM,OACd,kBAAmB,CAAC,CAACA,EAAM,QAC3B,KAAMA,EAAM,KAEZ,SAAAiB,EAAAA,IAACM,EAAa,SAAb,CAAsB,MAAO,CAAE,YAAaQ,GAC5C,SAAAd,EAAAA,IAAC4B,EAAAA,eAAA,CACA,SAAU7C,EAAM,UAAY,YAC5B,aAAcA,EAAM,cAAgB,GACpC,gBAAiBA,EAAM,iBAAmB,GAC1C,UAAW,GACX,UAAWA,EAAM,WAAa,GAC9B,MAAO,SAAA,CAAA,CACR,CACD,CAAA,CAAA,EAED,SAAS,IAAA,CAEX,EAEMuB,EAAeuB,EAAAA,QAAM,cAAc,CACxC,YAAa,EACd,CAAC"}
|
|
1
|
+
{"version":3,"file":"Toaster.js","sources":["../../../../src/components/toaster/Toaster.tsx"],"sourcesContent":["import AlertTriangle from '@src/assets/icons/alert_triangle.svg';\nimport Check from '@src/assets/icons/check.svg';\nimport Cross from '@src/assets/icons/cross.svg';\nimport Error from '@src/assets/icons/errorInfo.svg';\nimport Info from '@src/assets/icons/info.svg';\nimport React, {\n\tFunctionComponent,\n\tuseContext,\n\tuseEffect,\n\tuseRef,\n\tuseState,\n} from 'react';\nimport ReactDOM from 'react-dom';\nimport {\n\tcssTransition,\n\tId,\n\ttoast,\n\tToastContainer,\n\tToastPosition,\n\tTypeOptions,\n} from 'react-toastify';\nimport { IconProps } from 'react-toastify/dist/components';\nimport { Button } from '@src/components/button';\nimport { ToasterStyled } from '@src/components/toaster/Toaster.styled';\nimport {\n\tBodyCaption,\n\tBodySecondary,\n\tTitleSmall,\n} from '@src/components/TypographyStyle';\nimport { COLORS } from '@src/constants/Theme';\n\nexport type ToasterButtonProps = {\n\tshowButton?: boolean;\n\tonButtonClick?: () => Record<string, never>;\n\tbuttonText?: string;\n};\nexport type ToasterProps = {\n\ttext: string;\n\tsubText?: string;\n\tposition?: ToastPosition;\n\ttype?: 'info' | 'success' | 'error' | 'default' | 'warning';\n\tduration?: number;\n\tblocking?: boolean;\n\tcloseOnClick?: boolean;\n\thideProgressBar?: boolean;\n\tautoClose?: number | false | undefined;\n\tleftIcon?: React.ReactElement<IconProps>;\n\thideLeftIcon?: boolean;\n\tbuttonProps?: ToasterButtonProps;\n\tsecondButtonProps?: ToasterButtonProps;\n\tonCloseToast?: <T>(props: T) => void;\n\twidth?: string;\n\theight?: string;\n\thideCloseButton?: boolean;\n\tzIndex?: number;\n\ttoastId?: string;\n};\n\nconst CountDownBar: React.FC<{ duration: number }> = (props) => {\n\treturn (\n\t\t<BodySecondary\n\t\t\tcolor={`#9E9E9E`}\n\t\t\tcustomStyles={{\n\t\t\t\tfontWeight: 600,\n\t\t\t\tfontSize: 14,\n\t\t\t\twidth: 25,\n\t\t\t}}\n\t\t>\n\t\t\t{props.duration}s\n\t\t</BodySecondary>\n\t);\n};\n\nconst CloseButton: React.FC<{\n\ttype: string;\n\tcloseToast?: () => Record<string, never>;\n\talignTop?: boolean;\n\tblocking?: boolean;\n\tduration?: number;\n}> = (props) => {\n\tconst iconColor =\n\t\tprops.type === 'default'\n\t\t\t? COLORS.content.primary\n\t\t\t: props.type === 'success'\n\t\t\t? COLORS.content.positive\n\t\t\t: props.type === 'error'\n\t\t\t? COLORS.content.negative\n\t\t\t: props.type === 'warning'\n\t\t\t? COLORS.content.warning\n\t\t\t: COLORS.content.brand;\n\n\t// Each CloseButton has its own independent timer\n\tconst [timerValue, setTimerValue] = useState<number>(props.duration || -1);\n\n\tuseEffect(() => {\n\t\tif (!props.duration || props.duration <= 0) {\n\t\t\tsetTimerValue(-1);\n\t\t\treturn;\n\t\t}\n\n\t\tsetTimerValue(props.duration);\n\n\t\tconst interval = setInterval(() => {\n\t\t\tsetTimerValue((prev) => {\n\t\t\t\tconst next = prev - 1;\n\t\t\t\tif (next <= 0) {\n\t\t\t\t\tclearInterval(interval);\n\t\t\t\t\treturn -1;\n\t\t\t\t}\n\t\t\t\treturn next;\n\t\t\t});\n\t\t}, 1000);\n\n\t\treturn () => clearInterval(interval);\n\t}, [props.duration]);\n\n\t// Enable button when timerValue is -1, otherwise check blocking and timer\n\tconst isDisabled =\n\t\tprops.blocking && timerValue === -1\n\t\t\t? false\n\t\t\t: props.blocking && timerValue > 0;\n\n\tconst handleClick = () => {\n\t\tif (!isDisabled && props.closeToast) {\n\t\t\tprops.closeToast();\n\t\t}\n\t};\n\n\tconst handleKeyDown = (e: React.KeyboardEvent) => {\n\t\tif (e.key === 'Enter' && !isDisabled && props.closeToast) {\n\t\t\tprops.closeToast();\n\t\t}\n\t};\n\n\treturn (\n\t\t<div\n\t\t\ttabIndex={isDisabled ? -1 : 0}\n\t\t\trole={'button'}\n\t\t\tstyle={{\n\t\t\t\twidth: timerValue > 0 ? 25 : 20,\n\t\t\t\tdisplay: 'flex',\n\t\t\t\tcursor: isDisabled ? 'not-allowed' : 'pointer',\n\t\t\t\talignSelf: `${props.alignTop ? 'flex-start' : 'center'}`,\n\t\t\t\topacity: isDisabled ? 0.5 : 1,\n\t\t\t\t// Pin to the toast's right edge. react-toastify clones this element\n\t\t\t\t// without adding the `Toastify__close-button` class, so the toast's\n\t\t\t\t// own stylesheet cannot position it.\n\t\t\t\tmarginLeft: 'auto',\n\t\t\t\tflexShrink: 0,\n\t\t\t}}\n\t\t\tonClick={handleClick}\n\t\t\tonKeyDown={handleKeyDown}\n\t\t>\n\t\t\t{timerValue > 0 ? (\n\t\t\t\t<CountDownBar duration={timerValue} />\n\t\t\t) : (\n\t\t\t\t<Cross height={20} width={20} color={iconColor} />\n\t\t\t)}\n\t\t</div>\n\t);\n};\n\nconst RenderContent: React.FC<{\n\ttoastText?: string;\n\ttype: TypeOptions;\n\tshowButton?: boolean;\n\tshowSecondButton?: boolean;\n\tonButtonClick?: () => Record<string, never>;\n\tonSecondButtonClick?: () => Record<string, never>;\n\tbuttonText?: string;\n\tsecondButtonText?: string;\n\tsubText?: string;\n}> = (props) => {\n\tconst strokeColor = COLORS.content.placeholder;\n\n\tconst { toasterText: toasterTextContext } = useContext(ToastContext);\n\n\treturn (\n\t\t<>\n\t\t\t<div\n\t\t\t\tstyle={{\n\t\t\t\t\tdisplay: 'flex',\n\t\t\t\t\tflexGrow: 1,\n\t\t\t\t\tmaxWidth: '100%',\n\t\t\t\t}}\n\t\t\t>\n\t\t\t\t<div\n\t\t\t\t\tstyle={{\n\t\t\t\t\t\tflexGrow: 1,\n\t\t\t\t\t\tmarginRight: 16,\n\t\t\t\t\t\tdisplay: 'flex',\n\t\t\t\t\t\talignItems: 'center',\n\t\t\t\t\t\tminWidth: 0,\n\t\t\t\t\t\toverflow: 'hidden',\n\t\t\t\t\t}}\n\t\t\t\t>\n\t\t\t\t\t<div\n\t\t\t\t\t\tstyle={{\n\t\t\t\t\t\t\twidth: '100%',\n\t\t\t\t\t\t\tminWidth: 0,\n\t\t\t\t\t\t\twordBreak: 'break-word',\n\t\t\t\t\t\t\toverflowWrap: 'break-word',\n\t\t\t\t\t\t}}\n\t\t\t\t\t>\n\t\t\t\t\t\t{props.subText ? (\n\t\t\t\t\t\t\t<TitleSmall color={'inherit'}>\n\t\t\t\t\t\t\t\t{/* In normal scenarios, we use the text from prop. As a special case, when we need to change the text in already rendered toast, we change the text in context and let this component render on its own */}\n\t\t\t\t\t\t\t\t{props.toastText ?? toasterTextContext}\n\t\t\t\t\t\t\t</TitleSmall>\n\t\t\t\t\t\t) : (\n\t\t\t\t\t\t\t<BodySecondary color={'inherit'}>\n\t\t\t\t\t\t\t\t{/* In normal scenarios, we use the text from prop. As a special case, when we need to change the text in already rendered toast, we change the text in context and let this component render on its own */}\n\t\t\t\t\t\t\t\t{props.toastText ?? toasterTextContext}\n\t\t\t\t\t\t\t</BodySecondary>\n\t\t\t\t\t\t)}\n\t\t\t\t\t\t{props.subText && (\n\t\t\t\t\t\t\t<div style={{ marginTop: 2 }}>\n\t\t\t\t\t\t\t\t<BodyCaption color={COLORS.content.secondary}>\n\t\t\t\t\t\t\t\t\t{props.subText}\n\t\t\t\t\t\t\t\t</BodyCaption>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t)}\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t\t{props.showButton && (\n\t\t\t\t\t<div\n\t\t\t\t\t\tstyle={{\n\t\t\t\t\t\t\tdisplay: 'flex',\n\t\t\t\t\t\t\tflexDirection: 'column',\n\t\t\t\t\t\t\talignSelf: 'center',\n\t\t\t\t\t\t\tpadding: '6px 0px',\n\t\t\t\t\t\t\tminWidth: props.subText ? 'fit-content' : 'auto',\n\t\t\t\t\t\t\tmarginRight: props.showSecondButton ? 4 : 0,\n\t\t\t\t\t\t}}\n\t\t\t\t\t>\n\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\tbuttonText={props.buttonText}\n\t\t\t\t\t\t\tbuttonType={'tertiaryGray'}\n\t\t\t\t\t\t\tcolor={COLORS.content.secondary}\n\t\t\t\t\t\t\tonClick={props.onButtonClick}\n\t\t\t\t\t\t></Button>\n\t\t\t\t\t</div>\n\t\t\t\t)}\n\t\t\t\t{props.showSecondButton && (\n\t\t\t\t\t<div\n\t\t\t\t\t\tstyle={{\n\t\t\t\t\t\t\tdisplay: 'flex',\n\t\t\t\t\t\t\tflexDirection: 'column',\n\t\t\t\t\t\t\talignSelf: 'center',\n\t\t\t\t\t\t\tpadding: '6px 0px',\n\t\t\t\t\t\t\tminWidth: props.subText ? 'fit-content' : 'auto',\n\t\t\t\t\t\t}}\n\t\t\t\t\t>\n\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\tbuttonText={props.secondButtonText}\n\t\t\t\t\t\t\tbuttonType={'tertiaryGray'}\n\t\t\t\t\t\t\tcolor={COLORS.content.secondary}\n\t\t\t\t\t\t\tonClick={props.onSecondButtonClick}\n\t\t\t\t\t\t></Button>\n\t\t\t\t\t</div>\n\t\t\t\t)}\n\t\t\t\t{!(props.showButton || props.showSecondButton) ? null : (\n\t\t\t\t\t<div\n\t\t\t\t\t\tstyle={{\n\t\t\t\t\t\t\theight: 28,\n\t\t\t\t\t\t\talignSelf: 'center',\n\t\t\t\t\t\t\tmarginLeft: 8,\n\t\t\t\t\t\t\tmarginRight: 8,\n\t\t\t\t\t\t\tborderRight: `1px solid ${strokeColor}`,\n\t\t\t\t\t\t\tborderRadius: 1,\n\t\t\t\t\t\t}}\n\t\t\t\t\t></div>\n\t\t\t\t)}\n\t\t\t</div>\n\t\t</>\n\t);\n};\n\ntype Props = ToasterProps;\n\nexport const Toaster: FunctionComponent<Props> = (props) => {\n\tconst toastId = useRef<Id>(props.toastId || 'default-toast');\n\tconst [toastLocal, setToastLocal] = useState(props.text);\n\tconst bounce = cssTransition({\n\t\tenter: 'Toastify__slide-enter',\n\t\texit: 'Toastify__slide-exit',\n\t});\n\n\tconst leftIcon =\n\t\tprops.type === 'default' ? null : props.type === 'success' ? (\n\t\t\t<Check width={20} height={20} color={COLORS.content.positive} />\n\t\t) : props.type === 'error' ? (\n\t\t\t<Error width={20} height={20} color={COLORS.content.negative} />\n\t\t) : props.type === 'warning' ? (\n\t\t\t<AlertTriangle width={20} height={20} color={COLORS.content.warning} />\n\t\t) : (\n\t\t\t<Info width={20} height={20} color={COLORS.content.brand} />\n\t\t);\n\n\tuseEffect(() => {\n\t\t// When toast id is same but text needed to change, we change the text in context and let the toast re-render on its own.\n\t\tif (toastId.current && toastId.current === props.toastId) {\n\t\t\tsetToastLocal(props.text);\n\t\t\ttoast.update(toastId.current, {\n\t\t\t\tautoClose: props.autoClose,\n\t\t\t});\n\t\t\t// If toast ids are different, we call notify again which will stack the toasts up\n\t\t} else if (toastId.current && toastId.current !== props.toastId) {\n\t\t\tnotify(props.text);\n\t\t}\n\t}, [props.toastId, props.text]);\n\n\tconst notify = (toastText?: string) => {\n\t\tif (props.hideLeftIcon !== undefined || props.leftIcon) {\n\t\t\ttoast(\n\t\t\t\t<RenderContent\n\t\t\t\t\ttoastText={toastText}\n\t\t\t\t\ttype={props.type || 'info'}\n\t\t\t\t\tbuttonText={props.buttonProps?.buttonText}\n\t\t\t\t\tsecondButtonText={props.secondButtonProps?.buttonText}\n\t\t\t\t\tshowButton={props.buttonProps?.showButton}\n\t\t\t\t\tshowSecondButton={props.secondButtonProps?.showButton}\n\t\t\t\t\tonButtonClick={props.buttonProps?.onButtonClick}\n\t\t\t\t\tonSecondButtonClick={props.secondButtonProps?.onButtonClick}\n\t\t\t\t\tsubText={props.subText}\n\t\t\t\t/>,\n\t\t\t\t{\n\t\t\t\t\tonClose: props.onCloseToast ? props.onCloseToast : () => ({}),\n\t\t\t\t\ticon:\n\t\t\t\t\t\tprops.hideLeftIcon === true ? (\n\t\t\t\t\t\t\tfalse\n\t\t\t\t\t\t) : props.leftIcon ? (\n\t\t\t\t\t\t\tprops.leftIcon\n\t\t\t\t\t\t) : props.type === 'default' ? (\n\t\t\t\t\t\t\tfalse\n\t\t\t\t\t\t) : (\n\t\t\t\t\t\t\t<div style={{ display: 'flex', alignItems: 'flex-start' }}>\n\t\t\t\t\t\t\t\t{leftIcon}\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t),\n\t\t\t\t\ttype: props.type,\n\t\t\t\t\tcloseButton: props.hideCloseButton ? (\n\t\t\t\t\t\tfalse\n\t\t\t\t\t) : (\n\t\t\t\t\t\t<CloseButton\n\t\t\t\t\t\t\ttype={props.type || 'default'}\n\t\t\t\t\t\t\talignTop={\n\t\t\t\t\t\t\t\t!!(\n\t\t\t\t\t\t\t\t\tprops.subText &&\n\t\t\t\t\t\t\t\t\t!(\n\t\t\t\t\t\t\t\t\t\tprops.buttonProps?.showButton ||\n\t\t\t\t\t\t\t\t\t\tprops.secondButtonProps?.showButton\n\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tblocking={props.blocking}\n\t\t\t\t\t\t\tduration={props.duration}\n\t\t\t\t\t\t/>\n\t\t\t\t\t),\n\t\t\t\t\ttoastId: props.toastId || 'default-toast',\n\t\t\t\t\ttransition: bounce,\n\t\t\t\t},\n\t\t\t);\n\t\t} else {\n\t\t\ttoastId.current = toast(\n\t\t\t\t<RenderContent\n\t\t\t\t\ttoastText={toastText}\n\t\t\t\t\ttype={props.type || 'info'}\n\t\t\t\t\tbuttonText={props.buttonProps?.buttonText}\n\t\t\t\t\tsecondButtonText={props.secondButtonProps?.buttonText}\n\t\t\t\t\tshowButton={props.buttonProps?.showButton}\n\t\t\t\t\tshowSecondButton={props.secondButtonProps?.showButton}\n\t\t\t\t\tonButtonClick={props.buttonProps?.onButtonClick}\n\t\t\t\t\tonSecondButtonClick={props.secondButtonProps?.onButtonClick}\n\t\t\t\t\tsubText={props.subText}\n\t\t\t\t/>,\n\t\t\t\t{\n\t\t\t\t\tonClose: props.onCloseToast ? props.onCloseToast : () => ({}),\n\t\t\t\t\ttype: props.type,\n\t\t\t\t\ticon:\n\t\t\t\t\t\tprops.type === 'default' ? (\n\t\t\t\t\t\t\tfalse\n\t\t\t\t\t\t) : (\n\t\t\t\t\t\t\t<div style={{ display: 'flex', alignItems: 'flex-start' }}>\n\t\t\t\t\t\t\t\t{leftIcon}\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t),\n\t\t\t\t\tcloseButton: props.hideCloseButton ? (\n\t\t\t\t\t\tfalse\n\t\t\t\t\t) : (\n\t\t\t\t\t\t<CloseButton\n\t\t\t\t\t\t\ttype={props.type || 'default'}\n\t\t\t\t\t\t\talignTop={\n\t\t\t\t\t\t\t\t!!(\n\t\t\t\t\t\t\t\t\tprops.subText &&\n\t\t\t\t\t\t\t\t\t!(\n\t\t\t\t\t\t\t\t\t\tprops.buttonProps?.showButton ||\n\t\t\t\t\t\t\t\t\t\tprops.secondButtonProps?.showButton\n\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tblocking={props.blocking}\n\t\t\t\t\t\t\tduration={props.duration}\n\t\t\t\t\t\t/>\n\t\t\t\t\t),\n\t\t\t\t\ttoastId: props.toastId || 'default-toast',\n\t\t\t\t\ttransition: bounce,\n\t\t\t\t},\n\t\t\t);\n\t\t}\n\t};\n\n\tuseEffect(() => {\n\t\tnotify();\n\t}, []);\n\n\treturn ReactDOM.createPortal(\n\t\t<ToasterStyled\n\t\t\twidth={props.width}\n\t\t\theight={props.height}\n\t\t\tzIndex={props.zIndex}\n\t\t\tisSubTextIncluded={!!props.subText}\n\t\t\ttype={props.type}\n\t\t>\n\t\t\t<ToastContext.Provider value={{ toasterText: toastLocal }}>\n\t\t\t\t<ToastContainer\n\t\t\t\t\tposition={props.position || 'top-right'}\n\t\t\t\t\tcloseOnClick={props.closeOnClick || false}\n\t\t\t\t\thideProgressBar={props.hideProgressBar || false}\n\t\t\t\t\tdraggable={false}\n\t\t\t\t\tautoClose={props.autoClose || false}\n\t\t\t\t\ttheme={'colored'}\n\t\t\t\t/>\n\t\t\t</ToastContext.Provider>\n\t\t</ToasterStyled>,\n\t\tdocument.body,\n\t);\n};\n\nconst ToastContext = React.createContext({\n\ttoasterText: '',\n});\n"],"names":["CountDownBar","props","jsxs","BodySecondary","CloseButton","iconColor","COLORS","timerValue","setTimerValue","useState","useEffect","interval","prev","next","isDisabled","handleClick","handleKeyDown","e","jsx","Cross","RenderContent","strokeColor","toasterTextContext","useContext","ToastContext","Fragment","TitleSmall","BodyCaption","Button","Toaster","toastId","useRef","toastLocal","setToastLocal","bounce","cssTransition","leftIcon","Check","Error","AlertTriangle","Info","toast","notify","toastText","ReactDOM","To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AM,cAAgB,GACpC,gBAAiBA,EAAM,iBAAmB,GAC1C,UAAW,GACX,UAAWA,EAAM,WAAa,GAC9B,MAAO,SAAA,CAAA,CACR,CACD,CAAA,CAAA,EAED,SAAS,IAAA,CAEX,EAEMuB,EAAeuB,EAAAA,QAAM,cAAc,CACxC,YAAa,EACd,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("styled-components"),o=require("../../constants/Theme.js"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("styled-components"),o=require("../../constants/Theme.js"),e=require("../../constants/zindex.js"),a=t=>t&&typeof t=="object"&&"default"in t?t:{default:t},r=a(i),s=r.default.div`
|
|
2
2
|
--toastify-color-light: #fff;
|
|
3
3
|
--toastify-color-dark: #121212;
|
|
4
4
|
--toastify-text-color-success: ${o.COLORS.content.primary};
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
--toastify-toast-min-height: ${t=>t.height||(t.isSubTextIncluded?"70px":"56px")};
|
|
15
15
|
--toastify-toast-max-height: ${t=>t.height||"fit-content"};
|
|
16
16
|
font-family: inherit;
|
|
17
|
-
z-index: ${t=>t.zIndex||
|
|
17
|
+
z-index: ${t=>t.zIndex||e.ComponentZindex.TOASTER};
|
|
18
18
|
|
|
19
19
|
.custom-position {
|
|
20
20
|
position: relative;
|
|
@@ -95,7 +95,8 @@
|
|
|
95
95
|
border-radius: 8px;
|
|
96
96
|
word-wrap: break-word;
|
|
97
97
|
overflow-wrap: break-word;
|
|
98
|
-
|
|
98
|
+
/* Clips the absolutely positioned progress bar to the 8px radius */
|
|
99
|
+
overflow: hidden;
|
|
99
100
|
|
|
100
101
|
@media (max-width: 768px) {
|
|
101
102
|
min-width: 80vw;
|
|
@@ -108,10 +109,9 @@
|
|
|
108
109
|
height: 4px;
|
|
109
110
|
}
|
|
110
111
|
|
|
111
|
-
.Toastify__close-button
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
}
|
|
112
|
+
/* NOTE: no .Toastify__close-button rule here — the close button is always a
|
|
113
|
+
custom element passed via the closeButton option, and react-toastify
|
|
114
|
+
clones it without adding that class. It is positioned inline instead. */
|
|
115
115
|
|
|
116
116
|
.Toastify__toast-icon {
|
|
117
117
|
align-self: center;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Toaster.styled.js","sources":["../../../../src/components/toaster/Toaster.styled.tsx"],"sourcesContent":["import { TypeOptions } from 'react-toastify';\nimport styled from 'styled-components';\nimport { COLORS } from '@src/constants/Theme';\nimport { ComponentZindex } from '@src/constants/zindex';\n\nexport const ToasterStyled = styled.div<{\n\twidth?: string;\n\theight?: string;\n\tzIndex?: number;\n\tisSubTextIncluded?: boolean;\n\ttype?: TypeOptions;\n}>`\n\t--toastify-color-light: #fff;\n\t--toastify-color-dark: #121212;\n\t--toastify-text-color-success: ${COLORS.content.primary};\n\t--toastify-text-color-error: ${COLORS.content.primary};\n\t--toastify-text-color-warning: ${COLORS.content.primary};\n\t--toastify-text-color-info: ${COLORS.content.primary};\n\t--toastify-color-info: ${COLORS.background.brandLight};\n\t--toastify-color-success: ${COLORS.background.positive.light};\n\t--toastify-color-error: ${COLORS.background.negative.light};\n\t--toastify-color-warning: ${COLORS.background.warning.light};\n\t--toastify-text-color-light: ${COLORS.content.primary};\n\t--toastify-toast-width: fit-content;\n\t--toastify-toast-min-height: ${(props) =>\n\t\tprops.height || (props.isSubTextIncluded ? '70px' : '56px')};\n\t--toastify-toast-max-height: ${(props) => props.height || 'fit-content'};\n\tfont-family: inherit;\n\tz-index: ${(props) => props.zIndex || ComponentZindex.TOASTER};\n\n\t.custom-position {\n\t\tposition: relative;\n\t}\n\t.Toastify__toast-container {\n\t\tpadding: 0;\n\t\twidth: auto;\n\t\tmax-width: 90vw;\n\t\toverflow: visible;\n\n\t\t@media (max-width: 768px) {\n\t\t\tmax-width: calc(100vw - 64px);\n\t\t\tmargin: 0 32px;\n\t\t}\n\t}\n\n\t/* Mobile positioning - only for top-right (default) */\n\t.Toastify__toast-container--top-right {\n\t\t@media (max-width: 768px) {\n\t\t\ttop: 2%;\n\t\t\tleft: 35%;\n\t\t\ttransform: translateX(-50%);\n\t\t}\n\t}\n\n\t/* Mobile positioning - for top-left */\n\t.Toastify__toast-container--top-left {\n\t\t@media (max-width: 768px) {\n\t\t\ttop: 2%;\n\t\t\tleft: 50%;\n\t\t\ttransform: translateX(-50%);\n\t\t}\n\t}\n\n\t/* Mobile positioning - for bottom positions */\n\t.Toastify__toast-container--bottom-right,\n\t.Toastify__toast-container--bottom-left,\n\t.Toastify__toast-container--bottom-center {\n\t\t@media (max-width: 768px) {\n\t\t\tleft: 50%;\n\t\t\ttransform: translateX(-50%);\n\t\t}\n\t}\n\n\t/* Mobile positioning - for top-center */\n\t.Toastify__toast-container--top-center {\n\t\t@media (max-width: 768px) {\n\t\t\ttop: 2%;\n\t\t\tleft: 50%;\n\t\t\ttransform: translateX(-50%);\n\t\t}\n\t}\n\n\t.Toastify__toast--success {\n\t\tborder: 1px solid ${COLORS.stroke.positive.lightAlt};\n\t}\n\n\t.Toastify__toast--info {\n\t\tborder: 1px solid ${COLORS.stroke.brandLightAlt};\n\t}\n\n\t.Toastify__toast--default {\n\t\tborder: 1px solid ${COLORS.stroke.primary};\n\t}\n\n\t.Toastify__toast--error {\n\t\tborder: 1px solid ${COLORS.stroke.negative.lightAlt};\n\t}\n\n\t.Toastify__toast--warning {\n\t\tborder: 1px solid ${COLORS.stroke.warning.lightAlt};\n\t}\n\n\t.Toastify__toast {\n\t\tpadding: ${(props) => (props.isSubTextIncluded ? '16px 8px' : '12px 8px')};\n\t\tmax-width: ${(props) => props.width || '600px'};\n\t\tmin-width: 320px;\n\t\tborder-radius: 8px;\n\t\tword-wrap: break-word;\n\t\toverflow-wrap: break-word;\n\t\toverflow:
|
|
1
|
+
{"version":3,"file":"Toaster.styled.js","sources":["../../../../src/components/toaster/Toaster.styled.tsx"],"sourcesContent":["import { TypeOptions } from 'react-toastify';\nimport styled from 'styled-components';\nimport { COLORS } from '@src/constants/Theme';\nimport { ComponentZindex } from '@src/constants/zindex';\n\nexport const ToasterStyled = styled.div<{\n\twidth?: string;\n\theight?: string;\n\tzIndex?: number;\n\tisSubTextIncluded?: boolean;\n\ttype?: TypeOptions;\n}>`\n\t--toastify-color-light: #fff;\n\t--toastify-color-dark: #121212;\n\t--toastify-text-color-success: ${COLORS.content.primary};\n\t--toastify-text-color-error: ${COLORS.content.primary};\n\t--toastify-text-color-warning: ${COLORS.content.primary};\n\t--toastify-text-color-info: ${COLORS.content.primary};\n\t--toastify-color-info: ${COLORS.background.brandLight};\n\t--toastify-color-success: ${COLORS.background.positive.light};\n\t--toastify-color-error: ${COLORS.background.negative.light};\n\t--toastify-color-warning: ${COLORS.background.warning.light};\n\t--toastify-text-color-light: ${COLORS.content.primary};\n\t--toastify-toast-width: fit-content;\n\t--toastify-toast-min-height: ${(props) =>\n\t\tprops.height || (props.isSubTextIncluded ? '70px' : '56px')};\n\t--toastify-toast-max-height: ${(props) => props.height || 'fit-content'};\n\tfont-family: inherit;\n\tz-index: ${(props) => props.zIndex || ComponentZindex.TOASTER};\n\n\t.custom-position {\n\t\tposition: relative;\n\t}\n\t.Toastify__toast-container {\n\t\tpadding: 0;\n\t\twidth: auto;\n\t\tmax-width: 90vw;\n\t\toverflow: visible;\n\n\t\t@media (max-width: 768px) {\n\t\t\tmax-width: calc(100vw - 64px);\n\t\t\tmargin: 0 32px;\n\t\t}\n\t}\n\n\t/* Mobile positioning - only for top-right (default) */\n\t.Toastify__toast-container--top-right {\n\t\t@media (max-width: 768px) {\n\t\t\ttop: 2%;\n\t\t\tleft: 35%;\n\t\t\ttransform: translateX(-50%);\n\t\t}\n\t}\n\n\t/* Mobile positioning - for top-left */\n\t.Toastify__toast-container--top-left {\n\t\t@media (max-width: 768px) {\n\t\t\ttop: 2%;\n\t\t\tleft: 50%;\n\t\t\ttransform: translateX(-50%);\n\t\t}\n\t}\n\n\t/* Mobile positioning - for bottom positions */\n\t.Toastify__toast-container--bottom-right,\n\t.Toastify__toast-container--bottom-left,\n\t.Toastify__toast-container--bottom-center {\n\t\t@media (max-width: 768px) {\n\t\t\tleft: 50%;\n\t\t\ttransform: translateX(-50%);\n\t\t}\n\t}\n\n\t/* Mobile positioning - for top-center */\n\t.Toastify__toast-container--top-center {\n\t\t@media (max-width: 768px) {\n\t\t\ttop: 2%;\n\t\t\tleft: 50%;\n\t\t\ttransform: translateX(-50%);\n\t\t}\n\t}\n\n\t.Toastify__toast--success {\n\t\tborder: 1px solid ${COLORS.stroke.positive.lightAlt};\n\t}\n\n\t.Toastify__toast--info {\n\t\tborder: 1px solid ${COLORS.stroke.brandLightAlt};\n\t}\n\n\t.Toastify__toast--default {\n\t\tborder: 1px solid ${COLORS.stroke.primary};\n\t}\n\n\t.Toastify__toast--error {\n\t\tborder: 1px solid ${COLORS.stroke.negative.lightAlt};\n\t}\n\n\t.Toastify__toast--warning {\n\t\tborder: 1px solid ${COLORS.stroke.warning.lightAlt};\n\t}\n\n\t.Toastify__toast {\n\t\tpadding: ${(props) => (props.isSubTextIncluded ? '16px 8px' : '12px 8px')};\n\t\tmax-width: ${(props) => props.width || '600px'};\n\t\tmin-width: 320px;\n\t\tborder-radius: 8px;\n\t\tword-wrap: break-word;\n\t\toverflow-wrap: break-word;\n\t\t/* Clips the absolutely positioned progress bar to the 8px radius */\n\t\toverflow: hidden;\n\n\t\t@media (max-width: 768px) {\n\t\t\tmin-width: 80vw;\n\t\t\tmax-width: calc(100vw - 64px);\n\t\t\tpadding: ${(props) =>\n\t\t\t\tprops.isSubTextIncluded ? '16px 16px' : '12px 16px'};\n\t\t}\n\t}\n\n\t.Toastify__progress-bar {\n\t\theight: 4px;\n\t}\n\n\t/* NOTE: no .Toastify__close-button rule here — the close button is always a\n\t custom element passed via the closeButton option, and react-toastify\n\t clones it without adding that class. It is positioned inline instead. */\n\n\t.Toastify__toast-icon {\n\t\talign-self: center;\n\t\tmargin-inline-end: 12px;\n\t\theight: ${(props) => (props.isSubTextIncluded ? '38px' : '20px')};\n\t}\n\n\t.Toastify__toast-body {\n\t\tpadding: 0;\n\t\tdisplay: flex;\n\t}\n\n\t.Toastify__progress-bar-theme--colored.Toastify__progress-bar--default {\n\t\tbackground: ${COLORS.content.brand};\n\t}\n\n\t.Toastify__progress-bar-theme--colored.Toastify__progress-bar--info {\n\t\tbackground: ${COLORS.content.brand};\n\t}\n\n\t.Toastify__progress-bar-theme--colored.Toastify__progress-bar--warning {\n\t\tbackground: ${COLORS.content.warning};\n\t}\n\n\t.Toastify__progress-bar-theme--colored.Toastify__progress-bar--success {\n\t\tbackground: ${COLORS.content.positive};\n\t}\n\n\t.Toastify__progress-bar-theme--colored.Toastify__progress-bar--error {\n\t\tbackground: ${COLORS.content.negative};\n\t}\n\n\t.Toastify__toast-body > div:last-child {\n\t\tdisplay: flex;\n\t}\n\n\t.Toastify__slide-enter {\n\t\tanimation: slideIn 1s ease forwards,\n\t\t\tbounce cubic-bezier(0.68, -0.55, 0.27, 1.55) 0.5s both;\n\t}\n\t.Toastify__slide-exit {\n\t\tanimation: slideOut 0.5s ease-in-out forwards;\n\t}\n\t@keyframes bounce {\n\t\t0%,\n\t\t20%,\n\t\t50%,\n\t\t80%,\n\t\t100% {\n\t\t\ttransform: translateY(0); /* Start and end at the original position */\n\t\t}\n\t\t40% {\n\t\t\ttransform: translateX(-20px); /* Bouncing up */\n\t\t}\n\t\t60% {\n\t\t\ttransform: translateX(20px); /* Small bounce before settling */\n\t\t}\n\t}\n\t@keyframes slideIn {\n\t\t0% {\n\t\t\ttransform: translateX(-100%); /* Start off-screen to the left */\n\t\t\topacity: 0;\n\t\t}\n\t\t100% {\n\t\t\ttransform: translateX(0); /* End at the original position */\n\t\t\topacity: 1;\n\t\t}\n\t}\n\t@keyframes slideOut {\n\t\t0% {\n\t\t\ttransform: translateX(0); /* Start from the original position */\n\t\t\topacity: 1;\n\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", ...g }, /* @__PURE__ */ A.createElement("image", { width: 48, height: 48, xlinkHref: "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAYAAABXAvmHAAAAAXNSR0IArs4c6QAAAHhlWElmTU0AKgAAAAgABAEaAAUAAAABAAAAPgEbAAUAAAABAAAARgEoAAMAAAABAAIAAIdpAAQAAAABAAAATgAAAAAAAABIAAAAAQAAAEgAAAABAAOgAQADAAAAAQABAACgAgAEAAAAAQAAADCgAwAEAAAAAQAAADAAAAAA6LhYOwAAAAlwSFlzAAALEwAACxMBAJqcGAAABFdJREFUaAXtWFlIVGEU/mbNGVPnxcfyQSTzySICQ4rUdGiBQFsIUnowKCJbITKyfYdos5cIhDajeigremgzhSxc6qFHJW1lMpvJdJy1c+71jtfh2ty5To7CHLhz7///55//fGe/F0hQQgMJDUxpDeiUpE9PT8/V6/ULldbiNRcIBBodDkdH+PnG8Ake63S6QrrOBINBpeUJnyNZWKZddLBqAF4WfrIAYI0RAK+S5vRKk1NpLgEg3taa8hZQzEJqtEppDe6hIegpQ6glTgoGoxFmk0ntloh8mgD4/X7YbGnYXVmJ2dnZdEgQkWBwRv7lcqGurg6tbe0wm80RhVPDEDUA1iIVOVw6fw4lS5erOWMUz1J7Cey0r7OrC0ayxngp6n9g7WdmZqKosABfez6ien8NPORKlKj/KYvX68WGinLYl60Q9l6svRwfAGwBE/mwwWDE5y9fcOfuPUFwjgmPxzMmCAaQlZUlANAb9BgYGODiRP9jGJc7RW0BllCs0OT3JEBSUhLYKhkZGViwII8XFUEwT3FREeD3obCgAL0/fwoW6OzswuuWNzASEP6/aEkTgPBDhsiFVpeVYs/e6vClsDG1J55BFBQtoatYWAsGfDh96hSOnzytyRIxASBKKWq+9U0LabQFBgr0EJFmfaT5/Lw85M6Zgw/v3+HZi5dITU3B6lVl2LJ5E67fuCW4JLtUNBRDAOKxDxoacPDwESQnJ4+S4w/5/KGaGuTOm48b9fU4euwE0tLSMG/uXOTk5GB6Sgo4juIOgAOchQ8HwP4tpU1Ow7xusVhC8STG1SjMqgYyO6vin3RMEwtAKcloyDxyLcY8BtgV2Jf5khOPg2Fzwjrxa3Uf3h9zAFwXUikgLVarXH4hOK1hgT2KQeMgZgA4MJk2bazEurVrhouSrKjRo81mE3g40EM0GVyIM0xvby9cLif05BKcHkNEY6lV9VE1djmdAq+86sqfQ/tUPsTEApwOr1EhevT4SUhY6rAF4lsodumB8fT19VELYhlmGGYUR1H/agIgvsTohLaa24gASeV2u+Ek7aoh1rj4PsBVVzexQcy+7vrtQn//b2Rnz0Ld1Svw+nwCGEl4yiskFutd1P/ImMQl4bt7PuFSbS0cjh8Cz4S6EJf67p4enDl7Dvv2VWNl6SpJ7qju9pJi7K85ILTmwYB2N9LkQmbTNJy/cBGvmpowc+aMYW1Hlp/zPbfNFeXrkb9oMW7X30SArOenRk8raQLAmY9TYVt7B96+baWz1WuQC9r9hofYuWM7tlVthTnJSpmLXFCnrSnQBEDSlvB1QZ7TpYUIdwZx+MhRNDc3o7y8Au7BAXz//i3qTpSPGReACHKOucyJwEqVuvFVE57TewFFNqbRVwqpGI65UWEhLgAkOWLxaUWb40kSTIJ7AkC8jTDlLaAYxFRwTFoywv+yBrcalHplPfjISWMBeEogqkbY4vvEFZyuxvhKkTg9oYGEBv6LBv4CRZ5p7SwREKgAAAAASUVORK5CYII=" }));
|
|
3
|
+
export {
|
|
4
|
+
w as default
|
|
5
|
+
};
|
|
6
|
+
//# sourceMappingURL=Gorgias.svg.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Gorgias.svg.js","sources":["../../../../src/assets/icons/Gorgias.svg"],"sourcesContent":["import * as React from \"react\";\nconst SvgGorgias = (props) => /* @__PURE__ */ React.createElement(\"svg\", { viewBox: \"0 0 48 48\", fill: \"none\", xmlns: \"http://www.w3.org/2000/svg\", xmlnsXlink: \"http://www.w3.org/1999/xlink\", ...props }, /* @__PURE__ */ React.createElement(\"image\", { width: 48, height: 48, xlinkHref: \"data:image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xyLcY8BtgV2Jf5khOPg2Fzwjrxa3Uf3h9zAFwXUikgLVarXH4hOK1hgT2KQeMgZgA4MJk2bazEurVrhouSrKjRo81mE3g40EM0GVyIM0xvby9cLif05BKcHkNEY6lV9VE1djmdAq+86sqfQ/tUPsTEApwOr1EhevT4SUhY6rAF4lsodumB8fT19VELYhlmGGYUR1H/agIgvsTohLaa24gASeV2u+Ek7aoh1rj4PsBVVzexQcy+7vrtQn//b2Rnz0Ld1Svw+nwCGEl4yiskFutd1P/ImMQl4bt7PuFSbS0cjh8Cz4S6EJf67p4enDl7Dvv2VWNl6SpJ7qju9pJi7K85ILTmwYB2N9LkQmbTNJy/cBGvmpowc+aMYW1Hlp/zPbfNFeXrkb9oMW7X30SArOenRk8raQLAmY9TYVt7B96+baWz1WuQC9r9hofYuWM7tlVthTnJSpmLXFCnrSnQBEDSlvB1QZ7TpYUIdwZx+MhRNDc3o7y8Au7BAXz//i3qTpSPGReACHKOucyJwEqVuvFVE57TewFFNqbRVwqpGI65UWEhLgAkOWLxaUWb40kSTIJ7AkC8jTDlLaAYxFRwTFoywv+yBrcalHplPfjISWMBeEogqkbY4vvEFZyuxvhKkTg9oYGEBv6LBv4CRZ5p7SwREKgAAAAASUVORK5CYII=\" }));\nexport default SvgGorgias;\n"],"names":["SvgGorgias","props","React"],"mappings":";AACK,MAACA,IAAa,CAACC,MAA0B,gBAAAC,EAAM,cAAc,OAAO,EAAE,SAAS,aAAa,MAAM,QAAQ,OAAO,8BAA8B,YAAY,gCAAgC,GAAGD,EAAK,GAAoB,gBAAAC,EAAM,cAAc,SAAS,EAAE,OAAO,IAAI,QAAQ,IAAI,WAAW,6wDAA4wD,CAAE,CAAC;"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import * as A from "react";
|
|
2
|
+
const G = (e) => /* @__PURE__ */ A.createElement("svg", { viewBox: "0 0 48 48", fill: "none", xmlns: "http://www.w3.org/2000/svg", xmlnsXlink: "http://www.w3.org/1999/xlink", ...e }, /* @__PURE__ */ A.createElement("image", { width: 48, height: 48, xlinkHref: "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAYAAABXAvmHAAAABGdBTUEAALGPC/xhBQAAACBjSFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAAjmVYSWZNTQAqAAAACAAFARoABQAAAAEAAABKARsABQAAAAEAAABSASgAAwAAAAEAAgAAATwAAgAAAAkAAABah2kABAAAAAEAAABkAAAAAAAAAEgAAAABAAAASAAAAAFpbWFnZXJ5NAAAAAOgAQADAAAAAQABAACgAgAEAAAAAQAAADCgAwAEAAAAAQAAADAAAAAAiPHIXQAAAAlwSFlzAAALEwAACxMBAJqcGAAAAWJpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IlhNUCBDb3JlIDYuMC4wIj4KICAgPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4KICAgICAgPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIKICAgICAgICAgICAgeG1sbnM6dGlmZj0iaHR0cDovL25zLmFkb2JlLmNvbS90aWZmLzEuMC8iPgogICAgICAgICA8dGlmZjpIb3N0Q29tcHV0ZXI+aW1hZ2VyeTQ8L3RpZmY6SG9zdENvbXB1dGVyPgogICAgICA8L3JkZjpEZXNjcmlwdGlvbj4KICAgPC9yZGY6UkRGPgo8L3g6eG1wbWV0YT4K6GIO0QAADwtJREFUaAWVWQmUllUZfv5lVpBdYJTNERUXTFT0hJqY6MnMssUTWp5TuZQm6aHjmgspqScqU0zLpfIcs6JOZR33DExRUUFEUBbZZASGAQeG2ef//9vzvPfe7/9mBup0me+7977v8673vfd+M2TWvbHZAfxBhg/f7DL+ZX0ml0Emy4f/suzBJ0u+MJls1uREt3mQ9fJej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sTHS4Q3lROYBJg4n0h6XDKNTpWV+ADC3GpXmNAS3yMtURQRoWe0UbU5H9lpp/vKphy3zBtfL2ni0xdvhOhINMA9kGSmL48KbBWE7aNM28CyVtbjIZKJtDiIfUL3hCjf3/mUvUQ2DKJQ1MVe156fRm81jcGkxymhfnqCigTSb14mJLIayGaZFfwIWvZHT4xQlJhyCZnTkuqjNJD6GUop2u/QnLBX7xUjqdcZLwUxgTZOXhr0CjJJgOfoL3Mc0efwNzjrPcEbtnEcJlFYtEGFugCwLvLC5gyo+J/jEZoIR93qJZp4aJOgmmPRo+pEWPeA3XaR6f+0Z1+mUTGLNKhKiUVmmWS6jex5veyJ1F9kH85KCx8LQgKm1QvHIWfpltoDAR4M2SUWrCarKyXJJKqhgOjxCIzykd23D3wjp8eJ42mB3quY5sTxPvZAYCVLSf96Geo1iXr23e8LmuhV1HySbJdViGQXfpm0z5H8CgFwpMxKZ7r1nad56fH/dDQN7jPudybrTtl/5mMy5a6ecglJrzmS9kaoPgb/n2kvfTEb6uXg/hTvj+4Nxwr2WoD/AK+ZiLoWdMUxAAAAAElFTkSuQmCC" }));
|
|
3
|
+
export {
|
|
4
|
+
G as default
|
|
5
|
+
};
|
|
6
|
+
//# sourceMappingURL=Skio.svg.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Skio.svg.js","sources":["../../../../src/assets/icons/Skio.svg"],"sourcesContent":["import * as React from \"react\";\nconst SvgSkio = (props) => /* @__PURE__ */ React.createElement(\"svg\", { viewBox: \"0 0 48 48\", fill: \"none\", xmlns: \"http://www.w3.org/2000/svg\", xmlnsXlink: \"http://www.w3.org/1999/xlink\", ...props }, /* @__PURE__ */ React.createElement(\"image\", { width: 48, height: 48, xlinkHref: \"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAYAAABXAvmHAAAABGdBTUEAALGPC/xhBQAAACBjSFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8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14mJLIayGaZFfwIWvZHT4xQlJhyCZnTkuqjNJD6GUop2u/QnLBX7xUjqdcZLwUxgTZOXhr0CjJJgOfoL3Mc0efwNzjrPcEbtnEcJlFYtEGFugCwLvLC5gyo+J/jEZoIR93qJZp4aJOgmmPRo+pEWPeA3XaR6f+0Z1+mUTGLNKhKiUVmmWS6jex5veyJ1F9kH85KCx8LQgKm1QvHIWfpltoDAR4M2SUWrCarKyXJJKqhgOjxCIzykd23D3wjp8eJ42mB3quY5sTxPvZAYCVLSf96Geo1iXr23e8LmuhV1HySbJdViGQXfpm0z5H8CgFwpMxKZ7r1nad56fH/dDQN7jPudybrTtl/5mMy5a6ecglJrzmS9kaoPgb/n2kvfTEb6uXg/hTvj+4Nxwr2WoD/AK+ZiLoWdMUxAAAAAElFTkSuQmCC\" }));\nexport default SvgSkio;\n"],"names":["SvgSkio","props","React"],"mappings":";AACK,MAACA,IAAU,CAACC,MAA0B,gBAAAC,EAAM,cAAc,OAAO,EAAE,SAAS,aAAa,MAAM,QAAQ,OAAO,8BAA8B,YAAY,gCAAgC,GAAGD,EAAK,GAAoB,gBAAAC,EAAM,cAAc,SAAS,EAAE,OAAO,IAAI,QAAQ,IAAI,WAAW,q5LAAo5L,CAAE,CAAC;"}
|
|
@@ -34,6 +34,8 @@ export declare enum ToolSource {
|
|
|
34
34
|
Shopify = "shopify",
|
|
35
35
|
Bigcommerce = "bigcommerce",
|
|
36
36
|
Shipstation = "shipstation",
|
|
37
|
+
Skio = "skio",
|
|
38
|
+
Gorgias = "gorgias",
|
|
37
39
|
Integration = "integration",
|
|
38
40
|
RestApi = "rest_api",
|
|
39
41
|
EmailHandover = "email_handover",
|
|
@@ -91,8 +93,9 @@ export declare const TOOL_ACTION_SOURCES: ToolSource[];
|
|
|
91
93
|
/**
|
|
92
94
|
* Fixed display rank for the `@`-picker's tool-source groups (lower = higher). The
|
|
93
95
|
* picker sorts its source rows by this so adding/updating a tool never reshuffles
|
|
94
|
-
* them.
|
|
95
|
-
*
|
|
96
|
+
* them. Manifest (the native tools) leads; any source not listed here
|
|
97
|
+
* (dynamic/unknown, e.g. Integration) sorts AFTER Slack, keeping its discovery
|
|
98
|
+
* order among the rest (Array.sort is stable).
|
|
96
99
|
*/
|
|
97
100
|
export declare const TOOL_SOURCE_RANK: Partial<Record<ToolSource, number>>;
|
|
98
101
|
/** Sort rank for a source string; unknown sources rank after all known ones. */
|
|
@@ -2,12 +2,14 @@ const t = [
|
|
|
2
2
|
{ key: "tool", label: "Tools" },
|
|
3
3
|
{ key: "subagent", label: "Sub-agent" }
|
|
4
4
|
];
|
|
5
|
-
var
|
|
5
|
+
var s = /* @__PURE__ */ ((a) => (a.Manifest = "manifest", a.Shopify = "shopify", a.Bigcommerce = "bigcommerce", a.Shipstation = "shipstation", a.Skio = "skio", a.Gorgias = "gorgias", a.Integration = "integration", a.RestApi = "rest_api", a.EmailHandover = "email_handover", a.Slack = "slack", a))(s || {});
|
|
6
6
|
const n = {
|
|
7
7
|
manifest: "Manifest",
|
|
8
8
|
shopify: "Shopify",
|
|
9
9
|
bigcommerce: "BigCommerce",
|
|
10
10
|
shipstation: "ShipStation",
|
|
11
|
+
skio: "Skio",
|
|
12
|
+
gorgias: "Gorgias",
|
|
11
13
|
integration: "Integration",
|
|
12
14
|
rest_api: "Rest API",
|
|
13
15
|
email_handover: "Email",
|
|
@@ -21,27 +23,28 @@ const n = {
|
|
|
21
23
|
"email_handover",
|
|
22
24
|
"slack"
|
|
23
25
|
/* Slack */
|
|
24
|
-
],
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
26
|
+
], i = {
|
|
27
|
+
manifest: 0,
|
|
28
|
+
shopify: 1,
|
|
29
|
+
bigcommerce: 2,
|
|
30
|
+
shipstation: 3,
|
|
31
|
+
skio: 4,
|
|
32
|
+
gorgias: 5,
|
|
33
|
+
rest_api: 6,
|
|
34
|
+
email_handover: 7,
|
|
35
|
+
slack: 8
|
|
36
|
+
}, e = Object.keys(i).length, o = (a) => i[a] ?? e, g = {
|
|
34
37
|
email_handover: "send_email",
|
|
35
38
|
slack: "send_slack_message"
|
|
36
39
|
};
|
|
37
40
|
export {
|
|
38
41
|
t as CATEGORIES,
|
|
39
|
-
|
|
42
|
+
g as CONFIG_TOOL_SOURCES,
|
|
40
43
|
_ as TOOL_ACTION_LABELS,
|
|
41
44
|
m as TOOL_ACTION_SOURCES,
|
|
42
45
|
n as TOOL_SOURCE_LABELS,
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
+
i as TOOL_SOURCE_RANK,
|
|
47
|
+
s as ToolSource,
|
|
48
|
+
o as toolSourceRank
|
|
46
49
|
};
|
|
47
50
|
//# sourceMappingURL=tools.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tools.js","sources":["../../../../../src/components/agent-builder/constants/tools.ts"],"sourcesContent":["import type { ToolSource as ModelToolSource } from '@bikdotai/bik-models/ai-agents/models/agent-tool';\nimport type { FunctionComponent, SVGAttributes } from 'react';\n\n/**\n * Static tool-related constants for the builder's Step 3 (tools & sub-agents):\n * the reference-picker category tabs and the per-source display labels. Kept here\n * (rather than inline in the picker / serialization utils) so the labels a user\n * sees are all in one obvious place.\n */\n\n/** A reference-picker category tab. */\nexport type Category = 'tool' | 'subagent';\n\n/** Category tabs shown at the root of the `@` reference picker. */\nexport const CATEGORIES: { key: Category; label: string }[] = [\n\t{ key: 'tool', label: 'Tools' },\n\t{ key: 'subagent', label: 'Sub-agent' },\n];\n\n/**\n * Every tool \"source\" the builder renders an icon / label / picker entry for.\n * Enum VALUES are the backend's canonical read-only `source` wire strings\n * (`app/agents/config/schema.py` → `ToolSource`, derived from `tool_key`): the\n * configurable tools are `email_handover` / `rest_api` / `slack`, every native\n * tool is `manifest`. `shopify` / `integration` are legacy bik-models sources\n * kept for back-compat (the backend now collapses natives to `manifest`).\n * Dynamic/unknown sources are looked up leniently — see `toolSourceLabel` and\n * `sourceIcon`.\n *\n * This is the RUNTIME mirror of the canonical `@bikdotai/bik-models` `ToolSource`\n * union (the shape the backend persists as `AgentToolDoc.source`). We keep an\n * enum — not a re-export of the type — because the members are needed at runtime\n * for labels, ranks, icons and `===` comparisons; a type-only union can't do\n * that. The two are kept in lock-step by {@link ToolSourceMatchesBikModels}\n * below, which fails to compile if they ever drift.\n */\nexport enum ToolSource {\n\tManifest = 'manifest',\n\tShopify = 'shopify',\n\tBigcommerce = 'bigcommerce',\n\tShipstation = 'shipstation',\n\tIntegration = 'integration',\n\tRestApi = 'rest_api',\n\tEmailHandover = 'email_handover',\n\tSlack = 'slack',\n}\n\n/**\n * Compile-time guard that {@link ToolSource} stays a faithful mirror of the\n * canonical `@bikdotai/bik-models` `ToolSource` union. If a source is added to\n * (or removed from) either side without the other, `AssertTrue` receives `false`\n * and this type stops compiling — so the runtime enum can never silently diverge\n * from what the backend persists as `AgentToolDoc.source`. The tuple wrappers\n * (`[…]`) stop the conditionals from distributing over the unions, so it checks\n * set-equality in both directions.\n *\n * Type-only (erased at build): a drift shows up as a compile error on\n * `ToolSourceMatchesBikModels` telling you to reconcile this enum with\n * `@bikdotai/bik-models` (bump the dep and/or the enum).\n */\ntype AssertTrue<T extends true> = T;\ntype ToolSourceMatchesBikModels = AssertTrue<\n\t[`${ToolSource}`] extends [ModelToolSource]\n\t\t? [ModelToolSource] extends [`${ToolSource}`]\n\t\t\t? true\n\t\t\t: false\n\t\t: false\n>;\n\n/**\n * Display labels for the known tool sources — the CATEGORY/integration name, used\n * for the picker's source headers (drill-in groups), the empty-state source\n * buttons and the mention-chip prefix. A source is a category (\"Slack\") you drill\n * into; the specific addable action inside it (\"Send Slack message\") is\n * `TOOL_ACTION_LABELS`. Unknown sources fall back to the raw key (see\n * `toolSourceLabel`).\n */\nexport const TOOL_SOURCE_LABELS: Record<ToolSource, string> = {\n\t[ToolSource.Manifest]: 'Manifest',\n\t[ToolSource.Shopify]: 'Shopify',\n\t[ToolSource.Bigcommerce]: 'BigCommerce',\n\t[ToolSource.Shipstation]: 'ShipStation',\n\t[ToolSource.Integration]: 'Integration',\n\t[ToolSource.RestApi]: 'Rest API',\n\t[ToolSource.EmailHandover]: 'Email',\n\t[ToolSource.Slack]: 'Slack',\n};\n\n/**\n * The addable action inside a configurable/rest source — shown as the \"add\" row\n * in the `@` picker (below any existing instances) and the empty-state button.\n * Distinct from `TOOL_SOURCE_LABELS`, which names the category the action lives in\n * (e.g. category \"Slack\" → action \"Send Slack message\").\n */\nexport const TOOL_ACTION_LABELS: Partial<Record<ToolSource, string>> = {\n\t[ToolSource.RestApi]: 'REST API',\n\t[ToolSource.EmailHandover]: 'Send Email',\n\t[ToolSource.Slack]: 'Send Slack message',\n};\n\n/** A tool source's brand-glyph component. */\nexport type IconComp = FunctionComponent<SVGAttributes<SVGElement>>;\n\n/** Brand glyph for a tool source, with its own size so each keeps its aspect ratio. */\nexport interface SourceIcon {\n\tIcon: IconComp;\n\tw: number;\n\th: number;\n}\n\n/**\n * A built-in \"tool\" that opens a config drawer (Rest API / email handover /\n * Slack) rather than inserting a mention. Surfaced as an empty-state source\n * button in the Tools section and as a row in the `@`-picker Tools view; picking\n * it opens the drawer and never writes into the instructions text.\n */\nexport interface ToolAction {\n\tsource: ToolSource;\n\tlabel: string;\n\ticon?: SourceIcon;\n\t/** Open this tool's config drawer. */\n\tonSelect: () => void;\n\t/**\n\t * Integration connection state for this source. `undefined` = no connection\n\t * gating (default). `false` = the store hasn't connected this integration →\n\t * the `@` picker shows a \"Connect\" row that calls {@link onConnect} instead of\n\t * drilling in / offering \"Create new\". `true` = connected (renders normally).\n\t * Set by the consumer via `config.integrationStatus` (today: Slack only).\n\t */\n\tconnected?: boolean;\n\t/** Open the parent's connect flow for this source (used when `connected === false`). */\n\tonConnect?: () => void;\n}\n\n/** Sources of the built-in drawer tools, in display order. */\nexport const TOOL_ACTION_SOURCES: ToolSource[] = [\n\tToolSource.RestApi,\n\tToolSource.EmailHandover,\n\tToolSource.Slack,\n];\n\n/**\n * Fixed display rank for the `@`-picker's tool-source groups (lower = higher). The\n * picker sorts its source rows by this so adding/updating a tool never reshuffles\n * them.
|
|
1
|
+
{"version":3,"file":"tools.js","sources":["../../../../../src/components/agent-builder/constants/tools.ts"],"sourcesContent":["import type { ToolSource as ModelToolSource } from '@bikdotai/bik-models/ai-agents/models/agent-tool';\nimport type { FunctionComponent, SVGAttributes } from 'react';\n\n/**\n * Static tool-related constants for the builder's Step 3 (tools & sub-agents):\n * the reference-picker category tabs and the per-source display labels. Kept here\n * (rather than inline in the picker / serialization utils) so the labels a user\n * sees are all in one obvious place.\n */\n\n/** A reference-picker category tab. */\nexport type Category = 'tool' | 'subagent';\n\n/** Category tabs shown at the root of the `@` reference picker. */\nexport const CATEGORIES: { key: Category; label: string }[] = [\n\t{ key: 'tool', label: 'Tools' },\n\t{ key: 'subagent', label: 'Sub-agent' },\n];\n\n/**\n * Every tool \"source\" the builder renders an icon / label / picker entry for.\n * Enum VALUES are the backend's canonical read-only `source` wire strings\n * (`app/agents/config/schema.py` → `ToolSource`, derived from `tool_key`): the\n * configurable tools are `email_handover` / `rest_api` / `slack`, every native\n * tool is `manifest`. `shopify` / `integration` are legacy bik-models sources\n * kept for back-compat (the backend now collapses natives to `manifest`).\n * Dynamic/unknown sources are looked up leniently — see `toolSourceLabel` and\n * `sourceIcon`.\n *\n * This is the RUNTIME mirror of the canonical `@bikdotai/bik-models` `ToolSource`\n * union (the shape the backend persists as `AgentToolDoc.source`). We keep an\n * enum — not a re-export of the type — because the members are needed at runtime\n * for labels, ranks, icons and `===` comparisons; a type-only union can't do\n * that. The two are kept in lock-step by {@link ToolSourceMatchesBikModels}\n * below, which fails to compile if they ever drift.\n */\nexport enum ToolSource {\n\tManifest = 'manifest',\n\tShopify = 'shopify',\n\tBigcommerce = 'bigcommerce',\n\tShipstation = 'shipstation',\n\tSkio = 'skio',\n\tGorgias = 'gorgias',\n\tIntegration = 'integration',\n\tRestApi = 'rest_api',\n\tEmailHandover = 'email_handover',\n\tSlack = 'slack',\n}\n\n/**\n * Compile-time guard that {@link ToolSource} stays a faithful mirror of the\n * canonical `@bikdotai/bik-models` `ToolSource` union. If a source is added to\n * (or removed from) either side without the other, `AssertTrue` receives `false`\n * and this type stops compiling — so the runtime enum can never silently diverge\n * from what the backend persists as `AgentToolDoc.source`. The tuple wrappers\n * (`[…]`) stop the conditionals from distributing over the unions, so it checks\n * set-equality in both directions.\n *\n * Type-only (erased at build): a drift shows up as a compile error on\n * `ToolSourceMatchesBikModels` telling you to reconcile this enum with\n * `@bikdotai/bik-models` (bump the dep and/or the enum).\n */\ntype AssertTrue<T extends true> = T;\ntype ToolSourceMatchesBikModels = AssertTrue<\n\t[`${ToolSource}`] extends [ModelToolSource]\n\t\t? [ModelToolSource] extends [`${ToolSource}`]\n\t\t\t? true\n\t\t\t: false\n\t\t: false\n>;\n\n/**\n * Display labels for the known tool sources — the CATEGORY/integration name, used\n * for the picker's source headers (drill-in groups), the empty-state source\n * buttons and the mention-chip prefix. A source is a category (\"Slack\") you drill\n * into; the specific addable action inside it (\"Send Slack message\") is\n * `TOOL_ACTION_LABELS`. Unknown sources fall back to the raw key (see\n * `toolSourceLabel`).\n */\nexport const TOOL_SOURCE_LABELS: Record<ToolSource, string> = {\n\t[ToolSource.Manifest]: 'Manifest',\n\t[ToolSource.Shopify]: 'Shopify',\n\t[ToolSource.Bigcommerce]: 'BigCommerce',\n\t[ToolSource.Shipstation]: 'ShipStation',\n\t[ToolSource.Skio]: 'Skio',\n\t[ToolSource.Gorgias]: 'Gorgias',\n\t[ToolSource.Integration]: 'Integration',\n\t[ToolSource.RestApi]: 'Rest API',\n\t[ToolSource.EmailHandover]: 'Email',\n\t[ToolSource.Slack]: 'Slack',\n};\n\n/**\n * The addable action inside a configurable/rest source — shown as the \"add\" row\n * in the `@` picker (below any existing instances) and the empty-state button.\n * Distinct from `TOOL_SOURCE_LABELS`, which names the category the action lives in\n * (e.g. category \"Slack\" → action \"Send Slack message\").\n */\nexport const TOOL_ACTION_LABELS: Partial<Record<ToolSource, string>> = {\n\t[ToolSource.RestApi]: 'REST API',\n\t[ToolSource.EmailHandover]: 'Send Email',\n\t[ToolSource.Slack]: 'Send Slack message',\n};\n\n/** A tool source's brand-glyph component. */\nexport type IconComp = FunctionComponent<SVGAttributes<SVGElement>>;\n\n/** Brand glyph for a tool source, with its own size so each keeps its aspect ratio. */\nexport interface SourceIcon {\n\tIcon: IconComp;\n\tw: number;\n\th: number;\n}\n\n/**\n * A built-in \"tool\" that opens a config drawer (Rest API / email handover /\n * Slack) rather than inserting a mention. Surfaced as an empty-state source\n * button in the Tools section and as a row in the `@`-picker Tools view; picking\n * it opens the drawer and never writes into the instructions text.\n */\nexport interface ToolAction {\n\tsource: ToolSource;\n\tlabel: string;\n\ticon?: SourceIcon;\n\t/** Open this tool's config drawer. */\n\tonSelect: () => void;\n\t/**\n\t * Integration connection state for this source. `undefined` = no connection\n\t * gating (default). `false` = the store hasn't connected this integration →\n\t * the `@` picker shows a \"Connect\" row that calls {@link onConnect} instead of\n\t * drilling in / offering \"Create new\". `true` = connected (renders normally).\n\t * Set by the consumer via `config.integrationStatus` (today: Slack only).\n\t */\n\tconnected?: boolean;\n\t/** Open the parent's connect flow for this source (used when `connected === false`). */\n\tonConnect?: () => void;\n}\n\n/** Sources of the built-in drawer tools, in display order. */\nexport const TOOL_ACTION_SOURCES: ToolSource[] = [\n\tToolSource.RestApi,\n\tToolSource.EmailHandover,\n\tToolSource.Slack,\n];\n\n/**\n * Fixed display rank for the `@`-picker's tool-source groups (lower = higher). The\n * picker sorts its source rows by this so adding/updating a tool never reshuffles\n * them. Manifest (the native tools) leads; any source not listed here\n * (dynamic/unknown, e.g. Integration) sorts AFTER Slack, keeping its discovery\n * order among the rest (Array.sort is stable).\n */\nexport const TOOL_SOURCE_RANK: Partial<Record<ToolSource, number>> = {\n\t[ToolSource.Manifest]: 0,\n\t[ToolSource.Shopify]: 1,\n\t[ToolSource.Bigcommerce]: 2,\n\t[ToolSource.Shipstation]: 3,\n\t[ToolSource.Skio]: 4,\n\t[ToolSource.Gorgias]: 5,\n\t[ToolSource.RestApi]: 6,\n\t[ToolSource.EmailHandover]: 7,\n\t[ToolSource.Slack]: 8,\n};\n\nconst UNRANKED_SOURCE_RANK = Object.keys(TOOL_SOURCE_RANK).length;\n\n/** Sort rank for a source string; unknown sources rank after all known ones. */\nexport const toolSourceRank = (source: string): number =>\n\tTOOL_SOURCE_RANK[source as ToolSource] ?? UNRANKED_SOURCE_RANK;\n\n/**\n * `tool_key` of a configurable shared-drawer tool (email / Slack). Lives here (not\n * in AgentBuilder.model) so this leaf constants file has no back-edge to the model\n * — the dependency stays one-way (model → constants), avoiding a circular import.\n */\nexport type ConfigToolKey = 'send_email' | 'send_slack_message';\n\n/**\n * Drawer sources rendered by the shared dynamic panel (`ConfigToolPanel`), each\n * mapped to its backend `tool_key`. Rest API is absent — it has a bespoke panel.\n */\nexport const CONFIG_TOOL_SOURCES: Partial<Record<ToolSource, ConfigToolKey>> = {\n\t[ToolSource.EmailHandover]: 'send_email',\n\t[ToolSource.Slack]: 'send_slack_message',\n};\n"],"names":["CATEGORIES","ToolSource","TOOL_SOURCE_LABELS","TOOL_ACTION_LABELS","TOOL_ACTION_SOURCES","TOOL_SOURCE_RANK","UNRANKED_SOURCE_RANK","toolSourceRank","source","CONFIG_TOOL_SOURCES"],"mappings":"AAcO,MAAMA,IAAiD;AAAA,EAC7D,EAAE,KAAK,QAAQ,OAAO,QAAA;AAAA,EACtB,EAAE,KAAK,YAAY,OAAO,YAAA;AAC3B;AAmBO,IAAKC,sBAAAA,OACXA,EAAA,WAAW,YACXA,EAAA,UAAU,WACVA,EAAA,cAAc,eACdA,EAAA,cAAc,eACdA,EAAA,OAAO,QACPA,EAAA,UAAU,WACVA,EAAA,cAAc,eACdA,EAAA,UAAU,YACVA,EAAA,gBAAgB,kBAChBA,EAAA,QAAQ,SAVGA,IAAAA,KAAA,CAAA,CAAA;AA2CL,MAAMC,IAAiD;AAAA,EAC5D,UAAsB;AAAA,EACtB,SAAqB;AAAA,EACrB,aAAyB;AAAA,EACzB,aAAyB;AAAA,EACzB,MAAkB;AAAA,EAClB,SAAqB;AAAA,EACrB,aAAyB;AAAA,EACzB,UAAqB;AAAA,EACrB,gBAA2B;AAAA,EAC3B,OAAmB;AACrB,GAQaC,IAA0D;AAAA,EACrE,UAAqB;AAAA,EACrB,gBAA2B;AAAA,EAC3B,OAAmB;AACrB,GAqCaC,IAAoC;AAAA,EAChD;AAAA,EACA;AAAA,EACA;AAAA;AACD,GASaC,IAAwD;AAAA,EACnE,UAAsB;AAAA,EACtB,SAAqB;AAAA,EACrB,aAAyB;AAAA,EACzB,aAAyB;AAAA,EACzB,MAAkB;AAAA,EAClB,SAAqB;AAAA,EACrB,UAAqB;AAAA,EACrB,gBAA2B;AAAA,EAC3B,OAAmB;AACrB,GAEMC,IAAuB,OAAO,KAAKD,CAAgB,EAAE,QAG9CE,IAAiB,CAACC,MAC9BH,EAAiBG,CAAoB,KAAKF,GAa9BG,IAAkE;AAAA,EAC7E,gBAA2B;AAAA,EAC3B,OAAmB;AACrB;"}
|
|
@@ -1,27 +1,31 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import c from "../../../assets/icons/
|
|
4
|
-
import
|
|
5
|
-
import n from "
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import p from "../../../icons/
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
[
|
|
14
|
-
[
|
|
15
|
-
[
|
|
16
|
-
[
|
|
17
|
-
[
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
1
|
+
import i from "../../../assets/icons/BigCommerce.svg.js";
|
|
2
|
+
import t from "../../../assets/icons/Gorgias.svg.js";
|
|
3
|
+
import c from "../../../assets/icons/ManifestGlass.svg.js";
|
|
4
|
+
import S from "../../../assets/icons/ShipStation.svg.js";
|
|
5
|
+
import n from "../../../assets/icons/Shopify.svg.js";
|
|
6
|
+
import e from "../../../assets/icons/Skio.svg.js";
|
|
7
|
+
import h from "react";
|
|
8
|
+
import { ToolSource as o } from "../constants/tools.js";
|
|
9
|
+
import p from "../../../icons/Social/Social/SlackIcon.js";
|
|
10
|
+
import f from "../../../icons/Informational/Communication/Email.js";
|
|
11
|
+
import a from "../../../icons/BIK AI specific/Webhook.js";
|
|
12
|
+
const g = {
|
|
13
|
+
[o.Manifest]: { Icon: c, w: 24, h: 24 },
|
|
14
|
+
[o.Shopify]: { Icon: n, w: 21, h: 24 },
|
|
15
|
+
[o.Bigcommerce]: { Icon: i, w: 20, h: 20 },
|
|
16
|
+
[o.Shipstation]: { Icon: S, w: 22, h: 21 },
|
|
17
|
+
[o.Skio]: { Icon: e, w: 20, h: 20 },
|
|
18
|
+
[o.Gorgias]: { Icon: t, w: 20, h: 20 },
|
|
19
|
+
[o.RestApi]: { Icon: a, w: 20, h: 20 },
|
|
20
|
+
[o.EmailHandover]: { Icon: f, w: 20, h: 20 },
|
|
21
|
+
[o.Slack]: { Icon: p, w: 20, h: 20 }
|
|
22
|
+
}, R = (r) => r ? g[r] : void 0, _ = (r, m = 0) => r ? h.createElement(r.Icon, {
|
|
23
|
+
width: r.w + m,
|
|
24
|
+
height: r.h + m
|
|
21
25
|
}) : null;
|
|
22
26
|
export {
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
27
|
+
g as SOURCE_ICONS,
|
|
28
|
+
_ as renderSourceIcon,
|
|
29
|
+
R as sourceIcon
|
|
26
30
|
};
|
|
27
31
|
//# sourceMappingURL=sourceIcons.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sourceIcons.js","sources":["../../../../../src/components/agent-builder/utils/sourceIcons.ts"],"sourcesContent":["import BigCommerce from '@src/assets/icons/BigCommerce.svg';\nimport ManifestGlass from '@src/assets/icons/ManifestGlass.svg';\nimport ShipStation from '@src/assets/icons/ShipStation.svg';\nimport Shopify from '@src/assets/icons/Shopify.svg';\nimport { Email, SlackIcon, Webhook } from '@src/icons';\nimport React from 'react';\nimport { ToolSource } from '../constants/tools';\nimport type { IconComp, SourceIcon } from '../constants/tools';\n\n// The icon types live with the source enum (constants/tools) to keep the\n// dependency one-directional (util → constants); re-exported here so existing\n// `from '../utils/sourceIcons'` importers keep resolving them.\nexport type { IconComp, SourceIcon };\n\n/**\n * Per-source brand glyph — shared by the `@` picker and the Tools source\n * buttons. Partial: not every source has a glyph (e.g. `integration`), and the\n * render path null-guards. Look up with {@link sourceIcon} when the key is a\n * dynamic / unknown string rather than a {@link ToolSource}.\n */\nexport const SOURCE_ICONS: Partial<Record<ToolSource, SourceIcon>> = {\n\t[ToolSource.Manifest]: { Icon: ManifestGlass, w: 24, h: 24 },\n\t[ToolSource.Shopify]: { Icon: Shopify, w: 21, h: 24 },\n\t[ToolSource.Bigcommerce]: { Icon: BigCommerce, w: 20, h: 20 },\n\t[ToolSource.Shipstation]: { Icon: ShipStation, w: 22, h: 21 },\n\t[ToolSource.RestApi]: { Icon: Webhook as IconComp, w: 20, h: 20 },\n\t[ToolSource.EmailHandover]: { Icon: Email as IconComp, w: 20, h: 20 },\n\t[ToolSource.Slack]: { Icon: SlackIcon as IconComp, w: 20, h: 20 },\n};\n\n/**\n * Lenient icon lookup for a source that may be a raw/dynamic string (a\n * bik-models tool source, an integration key, or the picker's `'other'`\n * fallback). Returns `undefined` for unknown sources.\n */\nexport const sourceIcon = (\n\tsource: string | undefined,\n): SourceIcon | undefined =>\n\tsource ? SOURCE_ICONS[source as ToolSource] : undefined;\n\n/**\n * Render a {@link SourceIcon} at its own aspect ratio. `sizeDelta` nudges both\n * dimensions (e.g. `-4` for the smaller source-button glyph). Returns `null` when\n * no icon is supplied, so callers can drop their own `icon &&` guard.\n */\nexport const renderSourceIcon = (\n\ticon: SourceIcon | undefined,\n\tsizeDelta = 0,\n): React.ReactElement | null =>\n\ticon\n\t\t? React.createElement(icon.Icon, {\n\t\t\t\twidth: icon.w + sizeDelta,\n\t\t\t\theight: icon.h + sizeDelta,\n\t\t })\n\t\t: null;\n"],"names":["SOURCE_ICONS","ToolSource","ManifestGlass","Shopify","BigCommerce","ShipStation","Webhook","Email","SlackIcon","sourceIcon","source","renderSourceIcon","icon","sizeDelta","React"],"mappings":"
|
|
1
|
+
{"version":3,"file":"sourceIcons.js","sources":["../../../../../src/components/agent-builder/utils/sourceIcons.ts"],"sourcesContent":["import BigCommerce from '@src/assets/icons/BigCommerce.svg';\nimport Gorgias from '@src/assets/icons/Gorgias.svg';\nimport ManifestGlass from '@src/assets/icons/ManifestGlass.svg';\nimport ShipStation from '@src/assets/icons/ShipStation.svg';\nimport Shopify from '@src/assets/icons/Shopify.svg';\nimport Skio from '@src/assets/icons/Skio.svg';\nimport { Email, SlackIcon, Webhook } from '@src/icons';\nimport React from 'react';\nimport { ToolSource } from '../constants/tools';\nimport type { IconComp, SourceIcon } from '../constants/tools';\n\n// The icon types live with the source enum (constants/tools) to keep the\n// dependency one-directional (util → constants); re-exported here so existing\n// `from '../utils/sourceIcons'` importers keep resolving them.\nexport type { IconComp, SourceIcon };\n\n/**\n * Per-source brand glyph — shared by the `@` picker and the Tools source\n * buttons. Partial: not every source has a glyph (e.g. `integration`), and the\n * render path null-guards. Look up with {@link sourceIcon} when the key is a\n * dynamic / unknown string rather than a {@link ToolSource}.\n */\nexport const SOURCE_ICONS: Partial<Record<ToolSource, SourceIcon>> = {\n\t[ToolSource.Manifest]: { Icon: ManifestGlass, w: 24, h: 24 },\n\t[ToolSource.Shopify]: { Icon: Shopify, w: 21, h: 24 },\n\t[ToolSource.Bigcommerce]: { Icon: BigCommerce, w: 20, h: 20 },\n\t[ToolSource.Shipstation]: { Icon: ShipStation, w: 22, h: 21 },\n\t[ToolSource.Skio]: { Icon: Skio, w: 20, h: 20 },\n\t[ToolSource.Gorgias]: { Icon: Gorgias, w: 20, h: 20 },\n\t[ToolSource.RestApi]: { Icon: Webhook as IconComp, w: 20, h: 20 },\n\t[ToolSource.EmailHandover]: { Icon: Email as IconComp, w: 20, h: 20 },\n\t[ToolSource.Slack]: { Icon: SlackIcon as IconComp, w: 20, h: 20 },\n};\n\n/**\n * Lenient icon lookup for a source that may be a raw/dynamic string (a\n * bik-models tool source, an integration key, or the picker's `'other'`\n * fallback). Returns `undefined` for unknown sources.\n */\nexport const sourceIcon = (\n\tsource: string | undefined,\n): SourceIcon | undefined =>\n\tsource ? SOURCE_ICONS[source as ToolSource] : undefined;\n\n/**\n * Render a {@link SourceIcon} at its own aspect ratio. `sizeDelta` nudges both\n * dimensions (e.g. `-4` for the smaller source-button glyph). Returns `null` when\n * no icon is supplied, so callers can drop their own `icon &&` guard.\n */\nexport const renderSourceIcon = (\n\ticon: SourceIcon | undefined,\n\tsizeDelta = 0,\n): React.ReactElement | null =>\n\ticon\n\t\t? React.createElement(icon.Icon, {\n\t\t\t\twidth: icon.w + sizeDelta,\n\t\t\t\theight: icon.h + sizeDelta,\n\t\t })\n\t\t: null;\n"],"names":["SOURCE_ICONS","ToolSource","ManifestGlass","Shopify","BigCommerce","ShipStation","Skio","Gorgias","Webhook","Email","SlackIcon","sourceIcon","source","renderSourceIcon","icon","sizeDelta","React"],"mappings":";;;;;;;;;;;AAsBO,MAAMA,IAAwD;AAAA,EACpE,CAACC,EAAW,QAAQ,GAAG,EAAE,MAAMC,GAAe,GAAG,IAAI,GAAG,GAAA;AAAA,EACxD,CAACD,EAAW,OAAO,GAAG,EAAE,MAAME,GAAS,GAAG,IAAI,GAAG,GAAA;AAAA,EACjD,CAACF,EAAW,WAAW,GAAG,EAAE,MAAMG,GAAa,GAAG,IAAI,GAAG,GAAA;AAAA,EACzD,CAACH,EAAW,WAAW,GAAG,EAAE,MAAMI,GAAa,GAAG,IAAI,GAAG,GAAA;AAAA,EACzD,CAACJ,EAAW,IAAI,GAAG,EAAE,MAAMK,GAAM,GAAG,IAAI,GAAG,GAAA;AAAA,EAC3C,CAACL,EAAW,OAAO,GAAG,EAAE,MAAMM,GAAS,GAAG,IAAI,GAAG,GAAA;AAAA,EACjD,CAACN,EAAW,OAAO,GAAG,EAAE,MAAMO,GAAqB,GAAG,IAAI,GAAG,GAAA;AAAA,EAC7D,CAACP,EAAW,aAAa,GAAG,EAAE,MAAMQ,GAAmB,GAAG,IAAI,GAAG,GAAA;AAAA,EACjE,CAACR,EAAW,KAAK,GAAG,EAAE,MAAMS,GAAuB,GAAG,IAAI,GAAG,GAAA;AAC9D,GAOaC,IAAa,CACzBC,MAEAA,IAASZ,EAAaY,CAAoB,IAAI,QAOlCC,IAAmB,CAC/BC,GACAC,IAAY,MAEZD,IACGE,EAAM,cAAcF,EAAK,MAAM;AAAA,EAC/B,OAAOA,EAAK,IAAIC;AAAA,EAChB,QAAQD,EAAK,IAAIC;AACjB,CAAC,IACD;"}
|
|
@@ -4,9 +4,9 @@ import k from "../../assets/icons/check.svg.js";
|
|
|
4
4
|
import v from "../../assets/icons/cross.svg.js";
|
|
5
5
|
import I from "../../assets/icons/errorInfo.svg.js";
|
|
6
6
|
import S from "../../assets/icons/info.svg.js";
|
|
7
|
-
import P, { useRef as R, useState as
|
|
8
|
-
import
|
|
9
|
-
import { cssTransition as
|
|
7
|
+
import P, { useRef as R, useState as T, useEffect as h, useContext as D } from "react";
|
|
8
|
+
import L from "react-dom";
|
|
9
|
+
import { cssTransition as W, toast as r, ToastContainer as E } from "react-toastify";
|
|
10
10
|
import { ToasterStyled as _ } from "./Toaster.styled.js";
|
|
11
11
|
import { TitleSmall as O, BodySecondary as b, BodyCaption as G } from "../TypographyStyle.js";
|
|
12
12
|
import { COLORS as n } from "../../constants/Theme.js";
|
|
@@ -26,25 +26,25 @@ const z = (t) => /* @__PURE__ */ s(
|
|
|
26
26
|
]
|
|
27
27
|
}
|
|
28
28
|
), y = (t) => {
|
|
29
|
-
const o = t.type === "default" ? n.content.primary : t.type === "success" ? n.content.positive : t.type === "error" ? n.content.negative : t.type === "warning" ? n.content.warning : n.content.brand, [i,
|
|
29
|
+
const o = t.type === "default" ? n.content.primary : t.type === "success" ? n.content.positive : t.type === "error" ? n.content.negative : t.type === "warning" ? n.content.warning : n.content.brand, [i, c] = T(t.duration || -1);
|
|
30
30
|
h(() => {
|
|
31
31
|
if (!t.duration || t.duration <= 0) {
|
|
32
|
-
|
|
32
|
+
c(-1);
|
|
33
33
|
return;
|
|
34
34
|
}
|
|
35
|
-
|
|
36
|
-
const
|
|
37
|
-
|
|
35
|
+
c(t.duration);
|
|
36
|
+
const a = setInterval(() => {
|
|
37
|
+
c((B) => {
|
|
38
38
|
const f = B - 1;
|
|
39
|
-
return f <= 0 ? (clearInterval(
|
|
39
|
+
return f <= 0 ? (clearInterval(a), -1) : f;
|
|
40
40
|
});
|
|
41
41
|
}, 1e3);
|
|
42
|
-
return () => clearInterval(
|
|
42
|
+
return () => clearInterval(a);
|
|
43
43
|
}, [t.duration]);
|
|
44
44
|
const l = t.blocking && i === -1 ? !1 : t.blocking && i > 0, d = () => {
|
|
45
45
|
!l && t.closeToast && t.closeToast();
|
|
46
|
-
}, u = (
|
|
47
|
-
|
|
46
|
+
}, u = (a) => {
|
|
47
|
+
a.key === "Enter" && !l && t.closeToast && t.closeToast();
|
|
48
48
|
};
|
|
49
49
|
return /* @__PURE__ */ e(
|
|
50
50
|
"div",
|
|
@@ -56,14 +56,19 @@ const z = (t) => /* @__PURE__ */ s(
|
|
|
56
56
|
display: "flex",
|
|
57
57
|
cursor: l ? "not-allowed" : "pointer",
|
|
58
58
|
alignSelf: `${t.alignTop ? "flex-start" : "center"}`,
|
|
59
|
-
opacity: l ? 0.5 : 1
|
|
59
|
+
opacity: l ? 0.5 : 1,
|
|
60
|
+
// Pin to the toast's right edge. react-toastify clones this element
|
|
61
|
+
// without adding the `Toastify__close-button` class, so the toast's
|
|
62
|
+
// own stylesheet cannot position it.
|
|
63
|
+
marginLeft: "auto",
|
|
64
|
+
flexShrink: 0
|
|
60
65
|
},
|
|
61
66
|
onClick: d,
|
|
62
67
|
onKeyDown: u,
|
|
63
68
|
children: i > 0 ? /* @__PURE__ */ e(z, { duration: i }) : /* @__PURE__ */ e(v, { height: 20, width: 20, color: o })
|
|
64
69
|
}
|
|
65
70
|
);
|
|
66
|
-
},
|
|
71
|
+
}, g = (t) => {
|
|
67
72
|
const o = n.content.placeholder, { toasterText: i } = D(m);
|
|
68
73
|
return /* @__PURE__ */ e(w, { children: /* @__PURE__ */ s(
|
|
69
74
|
"div",
|
|
@@ -162,21 +167,21 @@ const z = (t) => /* @__PURE__ */ s(
|
|
|
162
167
|
}
|
|
163
168
|
) });
|
|
164
169
|
}, X = (t) => {
|
|
165
|
-
const o = R(t.toastId || "default-toast"), [i,
|
|
170
|
+
const o = R(t.toastId || "default-toast"), [i, c] = T(t.text), l = W({
|
|
166
171
|
enter: "Toastify__slide-enter",
|
|
167
172
|
exit: "Toastify__slide-exit"
|
|
168
173
|
}), d = t.type === "default" ? null : t.type === "success" ? /* @__PURE__ */ e(k, { width: 20, height: 20, color: n.content.positive }) : t.type === "error" ? /* @__PURE__ */ e(I, { width: 20, height: 20, color: n.content.negative }) : t.type === "warning" ? /* @__PURE__ */ e(C, { width: 20, height: 20, color: n.content.warning }) : /* @__PURE__ */ e(S, { width: 20, height: 20, color: n.content.brand });
|
|
169
174
|
h(() => {
|
|
170
|
-
o.current && o.current === t.toastId ? (
|
|
175
|
+
o.current && o.current === t.toastId ? (c(t.text), r.update(o.current, {
|
|
171
176
|
autoClose: t.autoClose
|
|
172
177
|
})) : o.current && o.current !== t.toastId && u(t.text);
|
|
173
178
|
}, [t.toastId, t.text]);
|
|
174
|
-
const u = (
|
|
179
|
+
const u = (a) => {
|
|
175
180
|
t.hideLeftIcon !== void 0 || t.leftIcon ? r(
|
|
176
181
|
/* @__PURE__ */ e(
|
|
177
|
-
|
|
182
|
+
g,
|
|
178
183
|
{
|
|
179
|
-
toastText:
|
|
184
|
+
toastText: a,
|
|
180
185
|
type: t.type || "info",
|
|
181
186
|
buttonText: t.buttonProps?.buttonText,
|
|
182
187
|
secondButtonText: t.secondButtonProps?.buttonText,
|
|
@@ -191,7 +196,7 @@ const z = (t) => /* @__PURE__ */ s(
|
|
|
191
196
|
onClose: t.onCloseToast ? t.onCloseToast : () => ({}),
|
|
192
197
|
icon: t.hideLeftIcon === !0 ? !1 : t.leftIcon ? t.leftIcon : t.type === "default" ? !1 : /* @__PURE__ */ e("div", { style: { display: "flex", alignItems: "flex-start" }, children: d }),
|
|
193
198
|
type: t.type,
|
|
194
|
-
closeButton: /* @__PURE__ */ e(
|
|
199
|
+
closeButton: t.hideCloseButton ? !1 : /* @__PURE__ */ e(
|
|
195
200
|
y,
|
|
196
201
|
{
|
|
197
202
|
type: t.type || "default",
|
|
@@ -205,9 +210,9 @@ const z = (t) => /* @__PURE__ */ s(
|
|
|
205
210
|
}
|
|
206
211
|
) : o.current = r(
|
|
207
212
|
/* @__PURE__ */ e(
|
|
208
|
-
|
|
213
|
+
g,
|
|
209
214
|
{
|
|
210
|
-
toastText:
|
|
215
|
+
toastText: a,
|
|
211
216
|
type: t.type || "info",
|
|
212
217
|
buttonText: t.buttonProps?.buttonText,
|
|
213
218
|
secondButtonText: t.secondButtonProps?.buttonText,
|
|
@@ -222,7 +227,7 @@ const z = (t) => /* @__PURE__ */ s(
|
|
|
222
227
|
onClose: t.onCloseToast ? t.onCloseToast : () => ({}),
|
|
223
228
|
type: t.type,
|
|
224
229
|
icon: t.type === "default" ? !1 : /* @__PURE__ */ e("div", { style: { display: "flex", alignItems: "flex-start" }, children: d }),
|
|
225
|
-
closeButton: /* @__PURE__ */ e(
|
|
230
|
+
closeButton: t.hideCloseButton ? !1 : /* @__PURE__ */ e(
|
|
226
231
|
y,
|
|
227
232
|
{
|
|
228
233
|
type: t.type || "default",
|
|
@@ -238,7 +243,7 @@ const z = (t) => /* @__PURE__ */ s(
|
|
|
238
243
|
};
|
|
239
244
|
return h(() => {
|
|
240
245
|
u();
|
|
241
|
-
}, []),
|
|
246
|
+
}, []), L.createPortal(
|
|
242
247
|
/* @__PURE__ */ e(
|
|
243
248
|
_,
|
|
244
249
|
{
|
|
@@ -248,7 +253,7 @@ const z = (t) => /* @__PURE__ */ s(
|
|
|
248
253
|
isSubTextIncluded: !!t.subText,
|
|
249
254
|
type: t.type,
|
|
250
255
|
children: /* @__PURE__ */ e(m.Provider, { value: { toasterText: i }, children: /* @__PURE__ */ e(
|
|
251
|
-
|
|
256
|
+
E,
|
|
252
257
|
{
|
|
253
258
|
position: t.position || "top-right",
|
|
254
259
|
closeOnClick: t.closeOnClick || !1,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Toaster.js","sources":["../../../../src/components/toaster/Toaster.tsx"],"sourcesContent":["import AlertTriangle from '@src/assets/icons/alert_triangle.svg';\nimport Check from '@src/assets/icons/check.svg';\nimport Cross from '@src/assets/icons/cross.svg';\nimport Error from '@src/assets/icons/errorInfo.svg';\nimport Info from '@src/assets/icons/info.svg';\nimport React, {\n\tFunctionComponent,\n\tuseContext,\n\tuseEffect,\n\tuseRef,\n\tuseState,\n} from 'react';\nimport ReactDOM from 'react-dom';\nimport {\n\tcssTransition,\n\tId,\n\ttoast,\n\tToastContainer,\n\tToastPosition,\n\tTypeOptions,\n} from 'react-toastify';\nimport { IconProps } from 'react-toastify/dist/components';\nimport { Button } from '@src/components/button';\nimport { ToasterStyled } from '@src/components/toaster/Toaster.styled';\nimport {\n\tBodyCaption,\n\tBodySecondary,\n\tTitleSmall,\n} from '@src/components/TypographyStyle';\nimport { COLORS } from '@src/constants/Theme';\n\nexport type ToasterButtonProps = {\n\tshowButton?: boolean;\n\tonButtonClick?: () => Record<string, never>;\n\tbuttonText?: string;\n};\nexport type ToasterProps = {\n\ttext: string;\n\tsubText?: string;\n\tposition?: ToastPosition;\n\ttype?: 'info' | 'success' | 'error' | 'default' | 'warning';\n\tduration?: number;\n\tblocking?: boolean;\n\tcloseOnClick?: boolean;\n\thideProgressBar?: boolean;\n\tautoClose?: number | false | undefined;\n\tleftIcon?: React.ReactElement<IconProps>;\n\thideLeftIcon?: boolean;\n\tbuttonProps?: ToasterButtonProps;\n\tsecondButtonProps?: ToasterButtonProps;\n\tonCloseToast?: <T>(props: T) => void;\n\twidth?: string;\n\theight?: string;\n\thideCloseButton?: boolean;\n\tzIndex?: number;\n\ttoastId?: string;\n};\n\nconst CountDownBar: React.FC<{ duration: number }> = (props) => {\n\treturn (\n\t\t<BodySecondary\n\t\t\tcolor={`#9E9E9E`}\n\t\t\tcustomStyles={{\n\t\t\t\tfontWeight: 600,\n\t\t\t\tfontSize: 14,\n\t\t\t\twidth: 25,\n\t\t\t}}\n\t\t>\n\t\t\t{props.duration}s\n\t\t</BodySecondary>\n\t);\n};\n\nconst CloseButton: React.FC<{\n\ttype: string;\n\tcloseToast?: () => Record<string, never>;\n\talignTop?: boolean;\n\tblocking?: boolean;\n\tduration?: number;\n}> = (props) => {\n\tconst iconColor =\n\t\tprops.type === 'default'\n\t\t\t? COLORS.content.primary\n\t\t\t: props.type === 'success'\n\t\t\t? COLORS.content.positive\n\t\t\t: props.type === 'error'\n\t\t\t? COLORS.content.negative\n\t\t\t: props.type === 'warning'\n\t\t\t? COLORS.content.warning\n\t\t\t: COLORS.content.brand;\n\n\t// Each CloseButton has its own independent timer\n\tconst [timerValue, setTimerValue] = useState<number>(props.duration || -1);\n\n\tuseEffect(() => {\n\t\tif (!props.duration || props.duration <= 0) {\n\t\t\tsetTimerValue(-1);\n\t\t\treturn;\n\t\t}\n\n\t\tsetTimerValue(props.duration);\n\n\t\tconst interval = setInterval(() => {\n\t\t\tsetTimerValue((prev) => {\n\t\t\t\tconst next = prev - 1;\n\t\t\t\tif (next <= 0) {\n\t\t\t\t\tclearInterval(interval);\n\t\t\t\t\treturn -1;\n\t\t\t\t}\n\t\t\t\treturn next;\n\t\t\t});\n\t\t}, 1000);\n\n\t\treturn () => clearInterval(interval);\n\t}, [props.duration]);\n\n\t// Enable button when timerValue is -1, otherwise check blocking and timer\n\tconst isDisabled =\n\t\tprops.blocking && timerValue === -1\n\t\t\t? false\n\t\t\t: props.blocking && timerValue > 0;\n\n\tconst handleClick = () => {\n\t\tif (!isDisabled && props.closeToast) {\n\t\t\tprops.closeToast();\n\t\t}\n\t};\n\n\tconst handleKeyDown = (e: React.KeyboardEvent) => {\n\t\tif (e.key === 'Enter' && !isDisabled && props.closeToast) {\n\t\t\tprops.closeToast();\n\t\t}\n\t};\n\n\treturn (\n\t\t<div\n\t\t\ttabIndex={isDisabled ? -1 : 0}\n\t\t\trole={'button'}\n\t\t\tstyle={{\n\t\t\t\twidth: timerValue > 0 ? 25 : 20,\n\t\t\t\tdisplay: 'flex',\n\t\t\t\tcursor: isDisabled ? 'not-allowed' : 'pointer',\n\t\t\t\talignSelf: `${props.alignTop ? 'flex-start' : 'center'}`,\n\t\t\t\topacity: isDisabled ? 0.5 : 1,\n\t\t\t}}\n\t\t\tonClick={handleClick}\n\t\t\tonKeyDown={handleKeyDown}\n\t\t>\n\t\t\t{timerValue > 0 ? (\n\t\t\t\t<CountDownBar duration={timerValue} />\n\t\t\t) : (\n\t\t\t\t<Cross height={20} width={20} color={iconColor} />\n\t\t\t)}\n\t\t</div>\n\t);\n};\n\nconst RenderContent: React.FC<{\n\ttoastText?: string;\n\ttype: TypeOptions;\n\tshowButton?: boolean;\n\tshowSecondButton?: boolean;\n\tonButtonClick?: () => Record<string, never>;\n\tonSecondButtonClick?: () => Record<string, never>;\n\tbuttonText?: string;\n\tsecondButtonText?: string;\n\tsubText?: string;\n}> = (props) => {\n\tconst strokeColor = COLORS.content.placeholder;\n\n\tconst { toasterText: toasterTextContext } = useContext(ToastContext);\n\n\treturn (\n\t\t<>\n\t\t\t<div\n\t\t\t\tstyle={{\n\t\t\t\t\tdisplay: 'flex',\n\t\t\t\t\tflexGrow: 1,\n\t\t\t\t\tmaxWidth: '100%',\n\t\t\t\t}}\n\t\t\t>\n\t\t\t\t<div\n\t\t\t\t\tstyle={{\n\t\t\t\t\t\tflexGrow: 1,\n\t\t\t\t\t\tmarginRight: 16,\n\t\t\t\t\t\tdisplay: 'flex',\n\t\t\t\t\t\talignItems: 'center',\n\t\t\t\t\t\tminWidth: 0,\n\t\t\t\t\t\toverflow: 'hidden',\n\t\t\t\t\t}}\n\t\t\t\t>\n\t\t\t\t\t<div\n\t\t\t\t\t\tstyle={{\n\t\t\t\t\t\t\twidth: '100%',\n\t\t\t\t\t\t\tminWidth: 0,\n\t\t\t\t\t\t\twordBreak: 'break-word',\n\t\t\t\t\t\t\toverflowWrap: 'break-word',\n\t\t\t\t\t\t}}\n\t\t\t\t\t>\n\t\t\t\t\t\t{props.subText ? (\n\t\t\t\t\t\t\t<TitleSmall color={'inherit'}>\n\t\t\t\t\t\t\t\t{/* In normal scenarios, we use the text from prop. As a special case, when we need to change the text in already rendered toast, we change the text in context and let this component render on its own */}\n\t\t\t\t\t\t\t\t{props.toastText ?? toasterTextContext}\n\t\t\t\t\t\t\t</TitleSmall>\n\t\t\t\t\t\t) : (\n\t\t\t\t\t\t\t<BodySecondary color={'inherit'}>\n\t\t\t\t\t\t\t\t{/* In normal scenarios, we use the text from prop. As a special case, when we need to change the text in already rendered toast, we change the text in context and let this component render on its own */}\n\t\t\t\t\t\t\t\t{props.toastText ?? toasterTextContext}\n\t\t\t\t\t\t\t</BodySecondary>\n\t\t\t\t\t\t)}\n\t\t\t\t\t\t{props.subText && (\n\t\t\t\t\t\t\t<div style={{ marginTop: 2 }}>\n\t\t\t\t\t\t\t\t<BodyCaption color={COLORS.content.secondary}>\n\t\t\t\t\t\t\t\t\t{props.subText}\n\t\t\t\t\t\t\t\t</BodyCaption>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t)}\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t\t{props.showButton && (\n\t\t\t\t\t<div\n\t\t\t\t\t\tstyle={{\n\t\t\t\t\t\t\tdisplay: 'flex',\n\t\t\t\t\t\t\tflexDirection: 'column',\n\t\t\t\t\t\t\talignSelf: 'center',\n\t\t\t\t\t\t\tpadding: '6px 0px',\n\t\t\t\t\t\t\tminWidth: props.subText ? 'fit-content' : 'auto',\n\t\t\t\t\t\t\tmarginRight: props.showSecondButton ? 4 : 0,\n\t\t\t\t\t\t}}\n\t\t\t\t\t>\n\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\tbuttonText={props.buttonText}\n\t\t\t\t\t\t\tbuttonType={'tertiaryGray'}\n\t\t\t\t\t\t\tcolor={COLORS.content.secondary}\n\t\t\t\t\t\t\tonClick={props.onButtonClick}\n\t\t\t\t\t\t></Button>\n\t\t\t\t\t</div>\n\t\t\t\t)}\n\t\t\t\t{props.showSecondButton && (\n\t\t\t\t\t<div\n\t\t\t\t\t\tstyle={{\n\t\t\t\t\t\t\tdisplay: 'flex',\n\t\t\t\t\t\t\tflexDirection: 'column',\n\t\t\t\t\t\t\talignSelf: 'center',\n\t\t\t\t\t\t\tpadding: '6px 0px',\n\t\t\t\t\t\t\tminWidth: props.subText ? 'fit-content' : 'auto',\n\t\t\t\t\t\t}}\n\t\t\t\t\t>\n\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\tbuttonText={props.secondButtonText}\n\t\t\t\t\t\t\tbuttonType={'tertiaryGray'}\n\t\t\t\t\t\t\tcolor={COLORS.content.secondary}\n\t\t\t\t\t\t\tonClick={props.onSecondButtonClick}\n\t\t\t\t\t\t></Button>\n\t\t\t\t\t</div>\n\t\t\t\t)}\n\t\t\t\t{!(props.showButton || props.showSecondButton) ? null : (\n\t\t\t\t\t<div\n\t\t\t\t\t\tstyle={{\n\t\t\t\t\t\t\theight: 28,\n\t\t\t\t\t\t\talignSelf: 'center',\n\t\t\t\t\t\t\tmarginLeft: 8,\n\t\t\t\t\t\t\tmarginRight: 8,\n\t\t\t\t\t\t\tborderRight: `1px solid ${strokeColor}`,\n\t\t\t\t\t\t\tborderRadius: 1,\n\t\t\t\t\t\t}}\n\t\t\t\t\t></div>\n\t\t\t\t)}\n\t\t\t</div>\n\t\t</>\n\t);\n};\n\ntype Props = ToasterProps;\n\nexport const Toaster: FunctionComponent<Props> = (props) => {\n\tconst toastId = useRef<Id>(props.toastId || 'default-toast');\n\tconst [toastLocal, setToastLocal] = useState(props.text);\n\tconst bounce = cssTransition({\n\t\tenter: 'Toastify__slide-enter',\n\t\texit: 'Toastify__slide-exit',\n\t});\n\n\tconst leftIcon =\n\t\tprops.type === 'default' ? null : props.type === 'success' ? (\n\t\t\t<Check width={20} height={20} color={COLORS.content.positive} />\n\t\t) : props.type === 'error' ? (\n\t\t\t<Error width={20} height={20} color={COLORS.content.negative} />\n\t\t) : props.type === 'warning' ? (\n\t\t\t<AlertTriangle width={20} height={20} color={COLORS.content.warning} />\n\t\t) : (\n\t\t\t<Info width={20} height={20} color={COLORS.content.brand} />\n\t\t);\n\n\tuseEffect(() => {\n\t\t// When toast id is same but text needed to change, we change the text in context and let the toast re-render on its own.\n\t\tif (toastId.current && toastId.current === props.toastId) {\n\t\t\tsetToastLocal(props.text);\n\t\t\ttoast.update(toastId.current, {\n\t\t\t\tautoClose: props.autoClose,\n\t\t\t});\n\t\t\t// If toast ids are different, we call notify again which will stack the toasts up\n\t\t} else if (toastId.current && toastId.current !== props.toastId) {\n\t\t\tnotify(props.text);\n\t\t}\n\t}, [props.toastId, props.text]);\n\n\tconst notify = (toastText?: string) => {\n\t\tif (props.hideLeftIcon !== undefined || props.leftIcon) {\n\t\t\ttoast(\n\t\t\t\t<RenderContent\n\t\t\t\t\ttoastText={toastText}\n\t\t\t\t\ttype={props.type || 'info'}\n\t\t\t\t\tbuttonText={props.buttonProps?.buttonText}\n\t\t\t\t\tsecondButtonText={props.secondButtonProps?.buttonText}\n\t\t\t\t\tshowButton={props.buttonProps?.showButton}\n\t\t\t\t\tshowSecondButton={props.secondButtonProps?.showButton}\n\t\t\t\t\tonButtonClick={props.buttonProps?.onButtonClick}\n\t\t\t\t\tonSecondButtonClick={props.secondButtonProps?.onButtonClick}\n\t\t\t\t\tsubText={props.subText}\n\t\t\t\t/>,\n\t\t\t\t{\n\t\t\t\t\tonClose: props.onCloseToast ? props.onCloseToast : () => ({}),\n\t\t\t\t\ticon:\n\t\t\t\t\t\tprops.hideLeftIcon === true ? (\n\t\t\t\t\t\t\tfalse\n\t\t\t\t\t\t) : props.leftIcon ? (\n\t\t\t\t\t\t\tprops.leftIcon\n\t\t\t\t\t\t) : props.type === 'default' ? (\n\t\t\t\t\t\t\tfalse\n\t\t\t\t\t\t) : (\n\t\t\t\t\t\t\t<div style={{ display: 'flex', alignItems: 'flex-start' }}>\n\t\t\t\t\t\t\t\t{leftIcon}\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t),\n\t\t\t\t\ttype: props.type,\n\t\t\t\t\tcloseButton: (\n\t\t\t\t\t\t<CloseButton\n\t\t\t\t\t\t\ttype={props.type || 'default'}\n\t\t\t\t\t\t\talignTop={\n\t\t\t\t\t\t\t\t!!(\n\t\t\t\t\t\t\t\t\tprops.subText &&\n\t\t\t\t\t\t\t\t\t!(\n\t\t\t\t\t\t\t\t\t\tprops.buttonProps?.showButton ||\n\t\t\t\t\t\t\t\t\t\tprops.secondButtonProps?.showButton\n\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tblocking={props.blocking}\n\t\t\t\t\t\t\tduration={props.duration}\n\t\t\t\t\t\t/>\n\t\t\t\t\t),\n\t\t\t\t\ttoastId: props.toastId || 'default-toast',\n\t\t\t\t\ttransition: bounce,\n\t\t\t\t},\n\t\t\t);\n\t\t} else {\n\t\t\ttoastId.current = toast(\n\t\t\t\t<RenderContent\n\t\t\t\t\ttoastText={toastText}\n\t\t\t\t\ttype={props.type || 'info'}\n\t\t\t\t\tbuttonText={props.buttonProps?.buttonText}\n\t\t\t\t\tsecondButtonText={props.secondButtonProps?.buttonText}\n\t\t\t\t\tshowButton={props.buttonProps?.showButton}\n\t\t\t\t\tshowSecondButton={props.secondButtonProps?.showButton}\n\t\t\t\t\tonButtonClick={props.buttonProps?.onButtonClick}\n\t\t\t\t\tonSecondButtonClick={props.secondButtonProps?.onButtonClick}\n\t\t\t\t\tsubText={props.subText}\n\t\t\t\t/>,\n\t\t\t\t{\n\t\t\t\t\tonClose: props.onCloseToast ? props.onCloseToast : () => ({}),\n\t\t\t\t\ttype: props.type,\n\t\t\t\t\ticon:\n\t\t\t\t\t\tprops.type === 'default' ? (\n\t\t\t\t\t\t\tfalse\n\t\t\t\t\t\t) : (\n\t\t\t\t\t\t\t<div style={{ display: 'flex', alignItems: 'flex-start' }}>\n\t\t\t\t\t\t\t\t{leftIcon}\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t),\n\t\t\t\t\tcloseButton: (\n\t\t\t\t\t\t<CloseButton\n\t\t\t\t\t\t\ttype={props.type || 'default'}\n\t\t\t\t\t\t\talignTop={\n\t\t\t\t\t\t\t\t!!(\n\t\t\t\t\t\t\t\t\tprops.subText &&\n\t\t\t\t\t\t\t\t\t!(\n\t\t\t\t\t\t\t\t\t\tprops.buttonProps?.showButton ||\n\t\t\t\t\t\t\t\t\t\tprops.secondButtonProps?.showButton\n\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tblocking={props.blocking}\n\t\t\t\t\t\t\tduration={props.duration}\n\t\t\t\t\t\t/>\n\t\t\t\t\t),\n\t\t\t\t\ttoastId: props.toastId || 'default-toast',\n\t\t\t\t\ttransition: bounce,\n\t\t\t\t},\n\t\t\t);\n\t\t}\n\t};\n\n\tuseEffect(() => {\n\t\tnotify();\n\t}, []);\n\n\treturn ReactDOM.createPortal(\n\t\t<ToasterStyled\n\t\t\twidth={props.width}\n\t\t\theight={props.height}\n\t\t\tzIndex={props.zIndex}\n\t\t\tisSubTextIncluded={!!props.subText}\n\t\t\ttype={props.type}\n\t\t>\n\t\t\t<ToastContext.Provider value={{ toasterText: toastLocal }}>\n\t\t\t\t<ToastContainer\n\t\t\t\t\tposition={props.position || 'top-right'}\n\t\t\t\t\tcloseOnClick={props.closeOnClick || false}\n\t\t\t\t\thideProgressBar={props.hideProgressBar || false}\n\t\t\t\t\tdraggable={false}\n\t\t\t\t\tautoClose={props.autoClose || false}\n\t\t\t\t\ttheme={'colored'}\n\t\t\t\t/>\n\t\t\t</ToastContext.Provider>\n\t\t</ToasterStyled>,\n\t\tdocument.body,\n\t);\n};\n\nconst ToastContext = React.createContext({\n\ttoasterText: '',\n});\n"],"names":["CountDownBar","props","jsxs","BodySecondary","CloseButton","iconColor","COLORS","timerValue","setTimerValue","useState","useEffect","interval","prev","next","isDisabled","handleClick","handleKeyDown","e","jsx","Cross","RenderContent","strokeColor","toasterTextContext","useContext","ToastContext","Fragment","TitleSmall","BodyCaption","Button","Toaster","toastId","useRef","toastLocal","setToastLocal","bounce","cssTransition","leftIcon","Check","Error","AlertTriangle","Info","toast","notify","toastText","ReactDOM","ToasterStyled","ToastContainer","React"],"mappings":";;;;;;;;;;;;;AA0DA,MAAMA,IAA+C,CAACC,MAEpD,gBAAAC;AAAA,EAACC;AAAA,EAAA;AAAA,IACA,OAAO;AAAA,IACP,cAAc;AAAA,MACb,YAAY;AAAA,MACZ,UAAU;AAAA,MACV,OAAO;AAAA,IAAA;AAAA,IAGP,UAAA;AAAA,MAAAF,EAAM;AAAA,MAAS;AAAA,IAAA;AAAA,EAAA;AAAA,GAKbG,IAMD,CAACH,MAAU;AACf,QAAMI,IACLJ,EAAM,SAAS,YACZK,EAAO,QAAQ,UACfL,EAAM,SAAS,YACfK,EAAO,QAAQ,WACfL,EAAM,SAAS,UACfK,EAAO,QAAQ,WACfL,EAAM,SAAS,YACfK,EAAO,QAAQ,UACfA,EAAO,QAAQ,OAGb,CAACC,GAAYC,CAAa,IAAIC,EAAiBR,EAAM,YAAY,EAAE;AAEzE,EAAAS,EAAU,MAAM;AACf,QAAI,CAACT,EAAM,YAAYA,EAAM,YAAY,GAAG;AAC3C,MAAAO,EAAc,EAAE;AAChB;AAAA,IACD;AA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H;AAEA,SAAAxB,EAAU,MAAM;AACf,IAAAgC,EAAA;AAAA,EACD,GAAG,CAAA,CAAE,GAEEE,EAAS;AAAA,IACf,gBAAA1B;AAAA,MAAC2B;AAAA,MAAA;AAAA,QACA,OAAO5C,EAAM;AAAA,QACb,QAAQA,EAAM;AAAA,QACd,QAAQA,EAAM;AAAA,QACd,mBAAmB,CAAC,CAACA,EAAM;AAAA,QAC3B,MAAMA,EAAM;AAAA,QAEZ,UAAA,gBAAAiB,EAACM,EAAa,UAAb,EAAsB,OAAO,EAAE,aAAaQ,KAC5C,UAAA,gBAAAd;AAAA,UAAC4B;AAAA,UAAA;AAAA,YACA,UAAU7C,EAAM,YAAY;AAAA,YAC5B,cAAcA,EAAM,gBAAgB;AAAA,YACpC,iBAAiBA,EAAM,mBAAmB;AAAA,YAC1C,WAAW;AAAA,YACX,WAAWA,EAAM,aAAa;AAAA,YAC9B,OAAO;AAAA,UAAA;AAAA,QAAA,EACR,CACD;AAAA,MAAA;AAAA,IAAA;AAAA,IAED,SAAS;AAAA,EAAA;AAEX,GAEMuB,IAAeuB,EAAM,cAAc;AAAA,EACxC,aAAa;AACd,CAAC;"}
|
|
1
|
+
{"version":3,"file":"Toaster.js","sources":["../../../../src/components/toaster/Toaster.tsx"],"sourcesContent":["import AlertTriangle from '@src/assets/icons/alert_triangle.svg';\nimport Check from '@src/assets/icons/check.svg';\nimport Cross from '@src/assets/icons/cross.svg';\nimport Error from '@src/assets/icons/errorInfo.svg';\nimport Info from '@src/assets/icons/info.svg';\nimport React, {\n\tFunctionComponent,\n\tuseContext,\n\tuseEffect,\n\tuseRef,\n\tuseState,\n} from 'react';\nimport ReactDOM from 'react-dom';\nimport {\n\tcssTransition,\n\tId,\n\ttoast,\n\tToastContainer,\n\tToastPosition,\n\tTypeOptions,\n} from 'react-toastify';\nimport { IconProps } from 'react-toastify/dist/components';\nimport { Button } from '@src/components/button';\nimport { ToasterStyled } from '@src/components/toaster/Toaster.styled';\nimport {\n\tBodyCaption,\n\tBodySecondary,\n\tTitleSmall,\n} from '@src/components/TypographyStyle';\nimport { COLORS } from '@src/constants/Theme';\n\nexport type ToasterButtonProps = {\n\tshowButton?: boolean;\n\tonButtonClick?: () => Record<string, never>;\n\tbuttonText?: string;\n};\nexport type ToasterProps = {\n\ttext: string;\n\tsubText?: string;\n\tposition?: ToastPosition;\n\ttype?: 'info' | 'success' | 'error' | 'default' | 'warning';\n\tduration?: number;\n\tblocking?: boolean;\n\tcloseOnClick?: boolean;\n\thideProgressBar?: boolean;\n\tautoClose?: number | false | undefined;\n\tleftIcon?: React.ReactElement<IconProps>;\n\thideLeftIcon?: boolean;\n\tbuttonProps?: ToasterButtonProps;\n\tsecondButtonProps?: ToasterButtonProps;\n\tonCloseToast?: <T>(props: T) => void;\n\twidth?: string;\n\theight?: string;\n\thideCloseButton?: boolean;\n\tzIndex?: number;\n\ttoastId?: string;\n};\n\nconst CountDownBar: React.FC<{ duration: number }> = (props) => {\n\treturn (\n\t\t<BodySecondary\n\t\t\tcolor={`#9E9E9E`}\n\t\t\tcustomStyles={{\n\t\t\t\tfontWeight: 600,\n\t\t\t\tfontSize: 14,\n\t\t\t\twidth: 25,\n\t\t\t}}\n\t\t>\n\t\t\t{props.duration}s\n\t\t</BodySecondary>\n\t);\n};\n\nconst CloseButton: React.FC<{\n\ttype: string;\n\tcloseToast?: () => Record<string, never>;\n\talignTop?: boolean;\n\tblocking?: boolean;\n\tduration?: number;\n}> = (props) => {\n\tconst iconColor =\n\t\tprops.type === 'default'\n\t\t\t? COLORS.content.primary\n\t\t\t: props.type === 'success'\n\t\t\t? COLORS.content.positive\n\t\t\t: props.type === 'error'\n\t\t\t? COLORS.content.negative\n\t\t\t: props.type === 'warning'\n\t\t\t? COLORS.content.warning\n\t\t\t: COLORS.content.brand;\n\n\t// Each CloseButton has its own independent timer\n\tconst [timerValue, setTimerValue] = useState<number>(props.duration || -1);\n\n\tuseEffect(() => {\n\t\tif (!props.duration || props.duration <= 0) {\n\t\t\tsetTimerValue(-1);\n\t\t\treturn;\n\t\t}\n\n\t\tsetTimerValue(props.duration);\n\n\t\tconst interval = setInterval(() => {\n\t\t\tsetTimerValue((prev) => {\n\t\t\t\tconst next = prev - 1;\n\t\t\t\tif (next <= 0) {\n\t\t\t\t\tclearInterval(interval);\n\t\t\t\t\treturn -1;\n\t\t\t\t}\n\t\t\t\treturn next;\n\t\t\t});\n\t\t}, 1000);\n\n\t\treturn () => clearInterval(interval);\n\t}, [props.duration]);\n\n\t// Enable button when timerValue is -1, otherwise check blocking and timer\n\tconst isDisabled =\n\t\tprops.blocking && timerValue === -1\n\t\t\t? false\n\t\t\t: props.blocking && timerValue > 0;\n\n\tconst handleClick = () => {\n\t\tif (!isDisabled && props.closeToast) {\n\t\t\tprops.closeToast();\n\t\t}\n\t};\n\n\tconst handleKeyDown = (e: React.KeyboardEvent) => {\n\t\tif (e.key === 'Enter' && !isDisabled && props.closeToast) {\n\t\t\tprops.closeToast();\n\t\t}\n\t};\n\n\treturn (\n\t\t<div\n\t\t\ttabIndex={isDisabled ? -1 : 0}\n\t\t\trole={'button'}\n\t\t\tstyle={{\n\t\t\t\twidth: timerValue > 0 ? 25 : 20,\n\t\t\t\tdisplay: 'flex',\n\t\t\t\tcursor: isDisabled ? 'not-allowed' : 'pointer',\n\t\t\t\talignSelf: `${props.alignTop ? 'flex-start' : 'center'}`,\n\t\t\t\topacity: isDisabled ? 0.5 : 1,\n\t\t\t\t// Pin to the toast's right edge. react-toastify clones this element\n\t\t\t\t// without adding the `Toastify__close-button` class, so the toast's\n\t\t\t\t// own stylesheet cannot position it.\n\t\t\t\tmarginLeft: 'auto',\n\t\t\t\tflexShrink: 0,\n\t\t\t}}\n\t\t\tonClick={handleClick}\n\t\t\tonKeyDown={handleKeyDown}\n\t\t>\n\t\t\t{timerValue > 0 ? (\n\t\t\t\t<CountDownBar duration={timerValue} />\n\t\t\t) : (\n\t\t\t\t<Cross height={20} width={20} color={iconColor} />\n\t\t\t)}\n\t\t</div>\n\t);\n};\n\nconst RenderContent: React.FC<{\n\ttoastText?: string;\n\ttype: TypeOptions;\n\tshowButton?: boolean;\n\tshowSecondButton?: boolean;\n\tonButtonClick?: () => Record<string, never>;\n\tonSecondButtonClick?: () => Record<string, never>;\n\tbuttonText?: string;\n\tsecondButtonText?: string;\n\tsubText?: string;\n}> = (props) => {\n\tconst strokeColor = COLORS.content.placeholder;\n\n\tconst { toasterText: toasterTextContext } = useContext(ToastContext);\n\n\treturn (\n\t\t<>\n\t\t\t<div\n\t\t\t\tstyle={{\n\t\t\t\t\tdisplay: 'flex',\n\t\t\t\t\tflexGrow: 1,\n\t\t\t\t\tmaxWidth: '100%',\n\t\t\t\t}}\n\t\t\t>\n\t\t\t\t<div\n\t\t\t\t\tstyle={{\n\t\t\t\t\t\tflexGrow: 1,\n\t\t\t\t\t\tmarginRight: 16,\n\t\t\t\t\t\tdisplay: 'flex',\n\t\t\t\t\t\talignItems: 'center',\n\t\t\t\t\t\tminWidth: 0,\n\t\t\t\t\t\toverflow: 'hidden',\n\t\t\t\t\t}}\n\t\t\t\t>\n\t\t\t\t\t<div\n\t\t\t\t\t\tstyle={{\n\t\t\t\t\t\t\twidth: '100%',\n\t\t\t\t\t\t\tminWidth: 0,\n\t\t\t\t\t\t\twordBreak: 'break-word',\n\t\t\t\t\t\t\toverflowWrap: 'break-word',\n\t\t\t\t\t\t}}\n\t\t\t\t\t>\n\t\t\t\t\t\t{props.subText ? (\n\t\t\t\t\t\t\t<TitleSmall color={'inherit'}>\n\t\t\t\t\t\t\t\t{/* In normal scenarios, we use the text from prop. As a special case, when we need to change the text in already rendered toast, we change the text in context and let this component render on its own */}\n\t\t\t\t\t\t\t\t{props.toastText ?? toasterTextContext}\n\t\t\t\t\t\t\t</TitleSmall>\n\t\t\t\t\t\t) : (\n\t\t\t\t\t\t\t<BodySecondary color={'inherit'}>\n\t\t\t\t\t\t\t\t{/* In normal scenarios, we use the text from prop. As a special case, when we need to change the text in already rendered toast, we change the text in context and let this component render on its own */}\n\t\t\t\t\t\t\t\t{props.toastText ?? toasterTextContext}\n\t\t\t\t\t\t\t</BodySecondary>\n\t\t\t\t\t\t)}\n\t\t\t\t\t\t{props.subText && (\n\t\t\t\t\t\t\t<div style={{ marginTop: 2 }}>\n\t\t\t\t\t\t\t\t<BodyCaption color={COLORS.content.secondary}>\n\t\t\t\t\t\t\t\t\t{props.subText}\n\t\t\t\t\t\t\t\t</BodyCaption>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t)}\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t\t{props.showButton && (\n\t\t\t\t\t<div\n\t\t\t\t\t\tstyle={{\n\t\t\t\t\t\t\tdisplay: 'flex',\n\t\t\t\t\t\t\tflexDirection: 'column',\n\t\t\t\t\t\t\talignSelf: 'center',\n\t\t\t\t\t\t\tpadding: '6px 0px',\n\t\t\t\t\t\t\tminWidth: props.subText ? 'fit-content' : 'auto',\n\t\t\t\t\t\t\tmarginRight: props.showSecondButton ? 4 : 0,\n\t\t\t\t\t\t}}\n\t\t\t\t\t>\n\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\tbuttonText={props.buttonText}\n\t\t\t\t\t\t\tbuttonType={'tertiaryGray'}\n\t\t\t\t\t\t\tcolor={COLORS.content.secondary}\n\t\t\t\t\t\t\tonClick={props.onButtonClick}\n\t\t\t\t\t\t></Button>\n\t\t\t\t\t</div>\n\t\t\t\t)}\n\t\t\t\t{props.showSecondButton && (\n\t\t\t\t\t<div\n\t\t\t\t\t\tstyle={{\n\t\t\t\t\t\t\tdisplay: 'flex',\n\t\t\t\t\t\t\tflexDirection: 'column',\n\t\t\t\t\t\t\talignSelf: 'center',\n\t\t\t\t\t\t\tpadding: '6px 0px',\n\t\t\t\t\t\t\tminWidth: props.subText ? 'fit-content' : 'auto',\n\t\t\t\t\t\t}}\n\t\t\t\t\t>\n\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\tbuttonText={props.secondButtonText}\n\t\t\t\t\t\t\tbuttonType={'tertiaryGray'}\n\t\t\t\t\t\t\tcolor={COLORS.content.secondary}\n\t\t\t\t\t\t\tonClick={props.onSecondButtonClick}\n\t\t\t\t\t\t></Button>\n\t\t\t\t\t</div>\n\t\t\t\t)}\n\t\t\t\t{!(props.showButton || props.showSecondButton) ? null : (\n\t\t\t\t\t<div\n\t\t\t\t\t\tstyle={{\n\t\t\t\t\t\t\theight: 28,\n\t\t\t\t\t\t\talignSelf: 'center',\n\t\t\t\t\t\t\tmarginLeft: 8,\n\t\t\t\t\t\t\tmarginRight: 8,\n\t\t\t\t\t\t\tborderRight: `1px solid ${strokeColor}`,\n\t\t\t\t\t\t\tborderRadius: 1,\n\t\t\t\t\t\t}}\n\t\t\t\t\t></div>\n\t\t\t\t)}\n\t\t\t</div>\n\t\t</>\n\t);\n};\n\ntype Props = ToasterProps;\n\nexport const Toaster: FunctionComponent<Props> = (props) => {\n\tconst toastId = useRef<Id>(props.toastId || 'default-toast');\n\tconst [toastLocal, setToastLocal] = useState(props.text);\n\tconst bounce = cssTransition({\n\t\tenter: 'Toastify__slide-enter',\n\t\texit: 'Toastify__slide-exit',\n\t});\n\n\tconst leftIcon =\n\t\tprops.type === 'default' ? null : props.type === 'success' ? (\n\t\t\t<Check width={20} height={20} color={COLORS.content.positive} />\n\t\t) : props.type === 'error' ? (\n\t\t\t<Error width={20} height={20} color={COLORS.content.negative} />\n\t\t) : props.type === 'warning' ? (\n\t\t\t<AlertTriangle width={20} height={20} color={COLORS.content.warning} />\n\t\t) : (\n\t\t\t<Info width={20} height={20} color={COLORS.content.brand} />\n\t\t);\n\n\tuseEffect(() => {\n\t\t// When toast id is same but text needed to change, we change the text in context and let the toast re-render on its own.\n\t\tif (toastId.current && toastId.current === props.toastId) {\n\t\t\tsetToastLocal(props.text);\n\t\t\ttoast.update(toastId.current, {\n\t\t\t\tautoClose: props.autoClose,\n\t\t\t});\n\t\t\t// If toast ids are different, we call notify again which will stack the toasts up\n\t\t} else if (toastId.current && toastId.current !== props.toastId) {\n\t\t\tnotify(props.text);\n\t\t}\n\t}, [props.toastId, props.text]);\n\n\tconst notify = (toastText?: string) => {\n\t\tif (props.hideLeftIcon !== undefined || props.leftIcon) {\n\t\t\ttoast(\n\t\t\t\t<RenderContent\n\t\t\t\t\ttoastText={toastText}\n\t\t\t\t\ttype={props.type || 'info'}\n\t\t\t\t\tbuttonText={props.buttonProps?.buttonText}\n\t\t\t\t\tsecondButtonText={props.secondButtonProps?.buttonText}\n\t\t\t\t\tshowButton={props.buttonProps?.showButton}\n\t\t\t\t\tshowSecondButton={props.secondButtonProps?.showButton}\n\t\t\t\t\tonButtonClick={props.buttonProps?.onButtonClick}\n\t\t\t\t\tonSecondButtonClick={props.secondButtonProps?.onButtonClick}\n\t\t\t\t\tsubText={props.subText}\n\t\t\t\t/>,\n\t\t\t\t{\n\t\t\t\t\tonClose: props.onCloseToast ? props.onCloseToast : () => ({}),\n\t\t\t\t\ticon:\n\t\t\t\t\t\tprops.hideLeftIcon === true ? (\n\t\t\t\t\t\t\tfalse\n\t\t\t\t\t\t) : props.leftIcon ? (\n\t\t\t\t\t\t\tprops.leftIcon\n\t\t\t\t\t\t) : props.type === 'default' ? (\n\t\t\t\t\t\t\tfalse\n\t\t\t\t\t\t) : (\n\t\t\t\t\t\t\t<div style={{ display: 'flex', alignItems: 'flex-start' }}>\n\t\t\t\t\t\t\t\t{leftIcon}\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t),\n\t\t\t\t\ttype: props.type,\n\t\t\t\t\tcloseButton: props.hideCloseButton ? (\n\t\t\t\t\t\tfalse\n\t\t\t\t\t) : (\n\t\t\t\t\t\t<CloseButton\n\t\t\t\t\t\t\ttype={props.type || 'default'}\n\t\t\t\t\t\t\talignTop={\n\t\t\t\t\t\t\t\t!!(\n\t\t\t\t\t\t\t\t\tprops.subText &&\n\t\t\t\t\t\t\t\t\t!(\n\t\t\t\t\t\t\t\t\t\tprops.buttonProps?.showButton ||\n\t\t\t\t\t\t\t\t\t\tprops.secondButtonProps?.showButton\n\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tblocking={props.blocking}\n\t\t\t\t\t\t\tduration={props.duration}\n\t\t\t\t\t\t/>\n\t\t\t\t\t),\n\t\t\t\t\ttoastId: props.toastId || 'default-toast',\n\t\t\t\t\ttransition: bounce,\n\t\t\t\t},\n\t\t\t);\n\t\t} else {\n\t\t\ttoastId.current = toast(\n\t\t\t\t<RenderContent\n\t\t\t\t\ttoastText={toastText}\n\t\t\t\t\ttype={props.type || 'info'}\n\t\t\t\t\tbuttonText={props.buttonProps?.buttonText}\n\t\t\t\t\tsecondButtonText={props.secondButtonProps?.buttonText}\n\t\t\t\t\tshowButton={props.buttonProps?.showButton}\n\t\t\t\t\tshowSecondButton={props.secondButtonProps?.showButton}\n\t\t\t\t\tonButtonClick={props.buttonProps?.onButtonClick}\n\t\t\t\t\tonSecondButtonClick={props.secondButtonProps?.onButtonClick}\n\t\t\t\t\tsubText={props.subText}\n\t\t\t\t/>,\n\t\t\t\t{\n\t\t\t\t\tonClose: props.onCloseToast ? props.onCloseToast : () => ({}),\n\t\t\t\t\ttype: props.type,\n\t\t\t\t\ticon:\n\t\t\t\t\t\tprops.type === 'default' ? (\n\t\t\t\t\t\t\tfalse\n\t\t\t\t\t\t) : (\n\t\t\t\t\t\t\t<div style={{ display: 'flex', alignItems: 'flex-start' }}>\n\t\t\t\t\t\t\t\t{leftIcon}\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t),\n\t\t\t\t\tcloseButton: props.hideCloseButton ? (\n\t\t\t\t\t\tfalse\n\t\t\t\t\t) : (\n\t\t\t\t\t\t<CloseButton\n\t\t\t\t\t\t\ttype={props.type || 'default'}\n\t\t\t\t\t\t\talignTop={\n\t\t\t\t\t\t\t\t!!(\n\t\t\t\t\t\t\t\t\tprops.subText &&\n\t\t\t\t\t\t\t\t\t!(\n\t\t\t\t\t\t\t\t\t\tprops.buttonProps?.showButton ||\n\t\t\t\t\t\t\t\t\t\tprops.secondButtonProps?.showButton\n\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tblocking={props.blocking}\n\t\t\t\t\t\t\tduration={props.duration}\n\t\t\t\t\t\t/>\n\t\t\t\t\t),\n\t\t\t\t\ttoastId: props.toastId || 'default-toast',\n\t\t\t\t\ttransition: bounce,\n\t\t\t\t},\n\t\t\t);\n\t\t}\n\t};\n\n\tuseEffect(() => {\n\t\tnotify();\n\t}, []);\n\n\treturn ReactDOM.createPortal(\n\t\t<ToasterStyled\n\t\t\twidth={props.width}\n\t\t\theight={props.height}\n\t\t\tzIndex={props.zIndex}\n\t\t\tisSubTextIncluded={!!props.subText}\n\t\t\ttype={props.type}\n\t\t>\n\t\t\t<ToastContext.Provider value={{ toasterText: toastLocal }}>\n\t\t\t\t<ToastContainer\n\t\t\t\t\tposition={props.position || 'top-right'}\n\t\t\t\t\tcloseOnClick={props.closeOnClick || false}\n\t\t\t\t\thideProgressBar={props.hideProgressBar || false}\n\t\t\t\t\tdraggable={false}\n\t\t\t\t\tautoClose={props.autoClose || false}\n\t\t\t\t\ttheme={'colored'}\n\t\t\t\t/>\n\t\t\t</ToastContext.Provider>\n\t\t</ToasterStyled>,\n\t\tdocument.body,\n\t);\n};\n\nconst ToastContext = React.createContext({\n\ttoasterText: '',\n});\n"],"names":["CountDownBar","props","jsxs","BodySecondary","CloseButton","iconColor","COLORS","timerValue","setTimerValue","useState","useEffect","interval","prev","next","isDisabled","handleClick","handleKeyDown","e","jsx","Cross","RenderContent","strokeColor","toasterTextContext","useContext","ToastContext","Fragment","TitleSmall","BodyCaption","Button","Toaster","toastId","useRef","toastLocal","setToastLocal","bounce","cssTransition","leftIcon","Check","Error","AlertTriangle","Info","toast","notify","toastText","ReactDOM","ToasterStyled","ToastContainer","React"],"mappings":";;;;;;;;;;;;;AA0DA,MAAMA,I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AAA,YACX,WAAWA,EAAM,aAAa;AAAA,YAC9B,OAAO;AAAA,UAAA;AAAA,QAAA,EACR,CACD;AAAA,MAAA;AAAA,IAAA;AAAA,IAED,SAAS;AAAA,EAAA;AAEX,GAEMuB,IAAeuB,EAAM,cAAc;AAAA,EACxC,aAAa;AACd,CAAC;"}
|
|
@@ -98,7 +98,8 @@ const n = i.div`
|
|
|
98
98
|
border-radius: 8px;
|
|
99
99
|
word-wrap: break-word;
|
|
100
100
|
overflow-wrap: break-word;
|
|
101
|
-
|
|
101
|
+
/* Clips the absolutely positioned progress bar to the 8px radius */
|
|
102
|
+
overflow: hidden;
|
|
102
103
|
|
|
103
104
|
@media (max-width: 768px) {
|
|
104
105
|
min-width: 80vw;
|
|
@@ -111,10 +112,9 @@ const n = i.div`
|
|
|
111
112
|
height: 4px;
|
|
112
113
|
}
|
|
113
114
|
|
|
114
|
-
.Toastify__close-button
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
}
|
|
115
|
+
/* NOTE: no .Toastify__close-button rule here — the close button is always a
|
|
116
|
+
custom element passed via the closeButton option, and react-toastify
|
|
117
|
+
clones it without adding that class. It is positioned inline instead. */
|
|
118
118
|
|
|
119
119
|
.Toastify__toast-icon {
|
|
120
120
|
align-self: center;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Toaster.styled.js","sources":["../../../../src/components/toaster/Toaster.styled.tsx"],"sourcesContent":["import { TypeOptions } from 'react-toastify';\nimport styled from 'styled-components';\nimport { COLORS } from '@src/constants/Theme';\nimport { ComponentZindex } from '@src/constants/zindex';\n\nexport const ToasterStyled = styled.div<{\n\twidth?: string;\n\theight?: string;\n\tzIndex?: number;\n\tisSubTextIncluded?: boolean;\n\ttype?: TypeOptions;\n}>`\n\t--toastify-color-light: #fff;\n\t--toastify-color-dark: #121212;\n\t--toastify-text-color-success: ${COLORS.content.primary};\n\t--toastify-text-color-error: ${COLORS.content.primary};\n\t--toastify-text-color-warning: ${COLORS.content.primary};\n\t--toastify-text-color-info: ${COLORS.content.primary};\n\t--toastify-color-info: ${COLORS.background.brandLight};\n\t--toastify-color-success: ${COLORS.background.positive.light};\n\t--toastify-color-error: ${COLORS.background.negative.light};\n\t--toastify-color-warning: ${COLORS.background.warning.light};\n\t--toastify-text-color-light: ${COLORS.content.primary};\n\t--toastify-toast-width: fit-content;\n\t--toastify-toast-min-height: ${(props) =>\n\t\tprops.height || (props.isSubTextIncluded ? '70px' : '56px')};\n\t--toastify-toast-max-height: ${(props) => props.height || 'fit-content'};\n\tfont-family: inherit;\n\tz-index: ${(props) => props.zIndex || ComponentZindex.TOASTER};\n\n\t.custom-position {\n\t\tposition: relative;\n\t}\n\t.Toastify__toast-container {\n\t\tpadding: 0;\n\t\twidth: auto;\n\t\tmax-width: 90vw;\n\t\toverflow: visible;\n\n\t\t@media (max-width: 768px) {\n\t\t\tmax-width: calc(100vw - 64px);\n\t\t\tmargin: 0 32px;\n\t\t}\n\t}\n\n\t/* Mobile positioning - only for top-right (default) */\n\t.Toastify__toast-container--top-right {\n\t\t@media (max-width: 768px) {\n\t\t\ttop: 2%;\n\t\t\tleft: 35%;\n\t\t\ttransform: translateX(-50%);\n\t\t}\n\t}\n\n\t/* Mobile positioning - for top-left */\n\t.Toastify__toast-container--top-left {\n\t\t@media (max-width: 768px) {\n\t\t\ttop: 2%;\n\t\t\tleft: 50%;\n\t\t\ttransform: translateX(-50%);\n\t\t}\n\t}\n\n\t/* Mobile positioning - for bottom positions */\n\t.Toastify__toast-container--bottom-right,\n\t.Toastify__toast-container--bottom-left,\n\t.Toastify__toast-container--bottom-center {\n\t\t@media (max-width: 768px) {\n\t\t\tleft: 50%;\n\t\t\ttransform: translateX(-50%);\n\t\t}\n\t}\n\n\t/* Mobile positioning - for top-center */\n\t.Toastify__toast-container--top-center {\n\t\t@media (max-width: 768px) {\n\t\t\ttop: 2%;\n\t\t\tleft: 50%;\n\t\t\ttransform: translateX(-50%);\n\t\t}\n\t}\n\n\t.Toastify__toast--success {\n\t\tborder: 1px solid ${COLORS.stroke.positive.lightAlt};\n\t}\n\n\t.Toastify__toast--info {\n\t\tborder: 1px solid ${COLORS.stroke.brandLightAlt};\n\t}\n\n\t.Toastify__toast--default {\n\t\tborder: 1px solid ${COLORS.stroke.primary};\n\t}\n\n\t.Toastify__toast--error {\n\t\tborder: 1px solid ${COLORS.stroke.negative.lightAlt};\n\t}\n\n\t.Toastify__toast--warning {\n\t\tborder: 1px solid ${COLORS.stroke.warning.lightAlt};\n\t}\n\n\t.Toastify__toast {\n\t\tpadding: ${(props) => (props.isSubTextIncluded ? '16px 8px' : '12px 8px')};\n\t\tmax-width: ${(props) => props.width || '600px'};\n\t\tmin-width: 320px;\n\t\tborder-radius: 8px;\n\t\tword-wrap: break-word;\n\t\toverflow-wrap: break-word;\n\t\toverflow:
|
|
1
|
+
{"version":3,"file":"Toaster.styled.js","sources":["../../../../src/components/toaster/Toaster.styled.tsx"],"sourcesContent":["import { TypeOptions } from 'react-toastify';\nimport styled from 'styled-components';\nimport { COLORS } from '@src/constants/Theme';\nimport { ComponentZindex } from '@src/constants/zindex';\n\nexport const ToasterStyled = styled.div<{\n\twidth?: string;\n\theight?: string;\n\tzIndex?: number;\n\tisSubTextIncluded?: boolean;\n\ttype?: TypeOptions;\n}>`\n\t--toastify-color-light: #fff;\n\t--toastify-color-dark: #121212;\n\t--toastify-text-color-success: ${COLORS.content.primary};\n\t--toastify-text-color-error: ${COLORS.content.primary};\n\t--toastify-text-color-warning: ${COLORS.content.primary};\n\t--toastify-text-color-info: ${COLORS.content.primary};\n\t--toastify-color-info: ${COLORS.background.brandLight};\n\t--toastify-color-success: ${COLORS.background.positive.light};\n\t--toastify-color-error: ${COLORS.background.negative.light};\n\t--toastify-color-warning: ${COLORS.background.warning.light};\n\t--toastify-text-color-light: ${COLORS.content.primary};\n\t--toastify-toast-width: fit-content;\n\t--toastify-toast-min-height: ${(props) =>\n\t\tprops.height || (props.isSubTextIncluded ? '70px' : '56px')};\n\t--toastify-toast-max-height: ${(props) => props.height || 'fit-content'};\n\tfont-family: inherit;\n\tz-index: ${(props) => props.zIndex || ComponentZindex.TOASTER};\n\n\t.custom-position {\n\t\tposition: relative;\n\t}\n\t.Toastify__toast-container {\n\t\tpadding: 0;\n\t\twidth: auto;\n\t\tmax-width: 90vw;\n\t\toverflow: visible;\n\n\t\t@media (max-width: 768px) {\n\t\t\tmax-width: calc(100vw - 64px);\n\t\t\tmargin: 0 32px;\n\t\t}\n\t}\n\n\t/* Mobile positioning - only for top-right (default) */\n\t.Toastify__toast-container--top-right {\n\t\t@media (max-width: 768px) {\n\t\t\ttop: 2%;\n\t\t\tleft: 35%;\n\t\t\ttransform: translateX(-50%);\n\t\t}\n\t}\n\n\t/* Mobile positioning - for top-left */\n\t.Toastify__toast-container--top-left {\n\t\t@media (max-width: 768px) {\n\t\t\ttop: 2%;\n\t\t\tleft: 50%;\n\t\t\ttransform: translateX(-50%);\n\t\t}\n\t}\n\n\t/* Mobile positioning - for bottom positions */\n\t.Toastify__toast-container--bottom-right,\n\t.Toastify__toast-container--bottom-left,\n\t.Toastify__toast-container--bottom-center {\n\t\t@media (max-width: 768px) {\n\t\t\tleft: 50%;\n\t\t\ttransform: translateX(-50%);\n\t\t}\n\t}\n\n\t/* Mobile positioning - for top-center */\n\t.Toastify__toast-container--top-center {\n\t\t@media (max-width: 768px) {\n\t\t\ttop: 2%;\n\t\t\tleft: 50%;\n\t\t\ttransform: translateX(-50%);\n\t\t}\n\t}\n\n\t.Toastify__toast--success {\n\t\tborder: 1px solid ${COLORS.stroke.positive.lightAlt};\n\t}\n\n\t.Toastify__toast--info {\n\t\tborder: 1px solid ${COLORS.stroke.brandLightAlt};\n\t}\n\n\t.Toastify__toast--default {\n\t\tborder: 1px solid ${COLORS.stroke.primary};\n\t}\n\n\t.Toastify__toast--error {\n\t\tborder: 1px solid ${COLORS.stroke.negative.lightAlt};\n\t}\n\n\t.Toastify__toast--warning {\n\t\tborder: 1px solid ${COLORS.stroke.warning.lightAlt};\n\t}\n\n\t.Toastify__toast {\n\t\tpadding: ${(props) => (props.isSubTextIncluded ? '16px 8px' : '12px 8px')};\n\t\tmax-width: ${(props) => props.width || '600px'};\n\t\tmin-width: 320px;\n\t\tborder-radius: 8px;\n\t\tword-wrap: break-word;\n\t\toverflow-wrap: break-word;\n\t\t/* Clips the absolutely positioned progress bar to the 8px radius */\n\t\toverflow: hidden;\n\n\t\t@media (max-width: 768px) {\n\t\t\tmin-width: 80vw;\n\t\t\tmax-width: calc(100vw - 64px);\n\t\t\tpadding: ${(props) =>\n\t\t\t\tprops.isSubTextIncluded ? '16px 16px' : '12px 16px'};\n\t\t}\n\t}\n\n\t.Toastify__progress-bar {\n\t\theight: 4px;\n\t}\n\n\t/* NOTE: no .Toastify__close-button rule here — the close button is always a\n\t custom element passed via the closeButton option, and react-toastify\n\t clones it without adding that class. It is positioned inline instead. */\n\n\t.Toastify__toast-icon {\n\t\talign-self: center;\n\t\tmargin-inline-end: 12px;\n\t\theight: ${(props) => (props.isSubTextIncluded ? '38px' : '20px')};\n\t}\n\n\t.Toastify__toast-body {\n\t\tpadding: 0;\n\t\tdisplay: flex;\n\t}\n\n\t.Toastify__progress-bar-theme--colored.Toastify__progress-bar--default {\n\t\tbackground: ${COLORS.content.brand};\n\t}\n\n\t.Toastify__progress-bar-theme--colored.Toastify__progress-bar--info {\n\t\tbackground: ${COLORS.content.brand};\n\t}\n\n\t.Toastify__progress-bar-theme--colored.Toastify__progress-bar--warning {\n\t\tbackground: ${COLORS.content.warning};\n\t}\n\n\t.Toastify__progress-bar-theme--colored.Toastify__progress-bar--success {\n\t\tbackground: ${COLORS.content.positive};\n\t}\n\n\t.Toastify__progress-bar-theme--colored.Toastify__progress-bar--error {\n\t\tbackground: ${COLORS.content.negative};\n\t}\n\n\t.Toastify__toast-body > div:last-child {\n\t\tdisplay: flex;\n\t}\n\n\t.Toastify__slide-enter {\n\t\tanimation: slideIn 1s ease forwards,\n\t\t\tbounce cubic-bezier(0.68, -0.55, 0.27, 1.55) 0.5s both;\n\t}\n\t.Toastify__slide-exit {\n\t\tanimation: slideOut 0.5s ease-in-out forwards;\n\t}\n\t@keyframes bounce {\n\t\t0%,\n\t\t20%,\n\t\t50%,\n\t\t80%,\n\t\t100% {\n\t\t\ttransform: translateY(0); /* Start and end at the original position */\n\t\t}\n\t\t40% {\n\t\t\ttransform: translateX(-20px); /* Bouncing up */\n\t\t}\n\t\t60% {\n\t\t\ttransform: translateX(20px); /* Small bounce before settling */\n\t\t}\n\t}\n\t@keyframes slideIn {\n\t\t0% {\n\t\t\ttransform: translateX(-100%); /* Start off-screen to the left */\n\t\t\topacity: 0;\n\t\t}\n\t\t100% {\n\t\t\ttransform: translateX(0); /* End at the original position */\n\t\t\topacity: 1;\n\t\t}\n\t}\n\t@keyframes slideOut {\n\t\t0% {\n\t\t\ttransform: translateX(0); /* Start from the original position */\n\t\t\topacity: 1;\n\t\t}\n\t\t100% {\n\t\t\ttransform: translateX(100%); /* Slide out to the right */\n\t\t\topacity: 0;\n\t\t}\n\t}\n`;\n"],"names":["ToasterStyled","styled","COLORS","props","ComponentZindex"],"mappings":";;;AAKO,MAAMA,IAAgBC,EAAO;AAAA;AAAA;AAAA,kCASFC,EAAO,QAAQ,OAAO;AAAA,gCACxBA,EAAO,QAAQ,OAAO;AAAA,kCACpBA,EAAO,QAAQ,OAAO;AAAA,+BACzBA,EAAO,QAAQ,OAAO;AAAA,0BAC3BA,EAAO,WAAW,UAAU;AAAA,6BACzBA,EAAO,WAAW,SAAS,KAAK;AAAA,2BAClCA,EAAO,WAAW,SAAS,KAAK;AAAA,6BAC9BA,EAAO,WAAW,QAAQ,KAAK;AAAA,gCAC5BA,EAAO,QAAQ,OAAO;AAAA;AAAA,gCAEtB,CAACC,MAC/BA,EAAM,WAAWA,EAAM,oBAAoB,SAAS,OAAO;AAAA,gCAC7B,CAACA,MAAUA,EAAM,UAAU,aAAa;AAAA;AAAA,YAE5D,CAACA,MAAUA,EAAM,UAAUC,E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BAIvBA,EAAO,QAAQ,QAAQ;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bikdotai/bik-component-library",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.846-beta.0",
|
|
4
4
|
"description": "Bik Component Library",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -66,7 +66,7 @@
|
|
|
66
66
|
"not op_mini all"
|
|
67
67
|
],
|
|
68
68
|
"dependencies": {
|
|
69
|
-
"@bikdotai/bik-models": "^11.
|
|
69
|
+
"@bikdotai/bik-models": "^11.43.1",
|
|
70
70
|
"@hello-pangea/dnd": "^18.0.1",
|
|
71
71
|
"@popperjs/core": "^2.11.7",
|
|
72
72
|
"@tippyjs/react": "^4.2.6",
|