@livechat/design-system-react-components 1.17.1-alpha.1 → 1.17.1-alpha.2
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/chunks/{Heading-597d11a4.js → Heading-617540b6.js} +1 -1
- package/dist/chunks/{Heading-1a31001f.js → Heading-6b95d08b.js} +1 -1
- package/dist/chunks/{ProgressBar-0e01c602.js → ProgressBar-3e0fd769.js} +11 -12
- package/dist/chunks/ProgressBar-62d36b60.js +1 -0
- package/dist/chunks/{Text-78b02609.js → Text-b31d1e9a.js} +1 -1
- package/dist/chunks/{Text-dd6930a2.js → Text-df483689.js} +1 -1
- package/dist/chunks/Tooltip-8c427780.js +1 -0
- package/dist/chunks/{Tooltip-f4d8b8fd.js → Tooltip-f6f4f9c2.js} +5 -6
- package/dist/chunks/Typography.module-2558416b.js +1 -0
- package/dist/chunks/{Typography.module-58a031dc.js → Typography.module-93efb34d.js} +2 -3
- package/dist/components/ActionBar/index.cjs.js +1 -1
- package/dist/components/ActionBar/index.es.js +43 -39
- package/dist/components/ActionMenu/index.cjs.js +1 -1
- package/dist/components/ActionMenu/index.es.js +2 -2
- package/dist/components/Alert/index.cjs.js +1 -1
- package/dist/components/Alert/index.es.js +15 -14
- package/dist/components/Avatar/index.cjs.js +1 -1
- package/dist/components/Avatar/index.es.js +2 -2
- package/dist/components/Badge/index.cjs.js +1 -1
- package/dist/components/Badge/index.es.js +7 -8
- package/dist/components/Button/index.cjs.js +1 -1
- package/dist/components/Button/index.es.js +4 -3
- package/dist/components/Card/index.cjs.js +1 -1
- package/dist/components/Card/index.es.js +6 -5
- package/dist/components/Checkbox/index.cjs.js +1 -1
- package/dist/components/Checkbox/index.es.js +2 -2
- package/dist/components/DatePicker/index.cjs.js +1 -1
- package/dist/components/DatePicker/index.es.js +2 -3
- package/dist/components/DetailsCard/index.cjs.js +1 -1
- package/dist/components/DetailsCard/index.es.js +12 -10
- package/dist/components/DetailsCardInfo/index.cjs.js +1 -1
- package/dist/components/DetailsCardInfo/index.es.js +2 -3
- package/dist/components/FieldDescription/index.cjs.js +1 -1
- package/dist/components/FieldDescription/index.es.js +2 -2
- package/dist/components/FieldError/index.cjs.js +1 -1
- package/dist/components/FieldError/index.es.js +2 -2
- package/dist/components/FieldGroup/index.cjs.js +1 -1
- package/dist/components/FieldGroup/index.es.js +26 -23
- package/dist/components/FileUploadProgress/index.cjs.js +1 -1
- package/dist/components/FileUploadProgress/index.es.js +3 -3
- package/dist/components/Form/index.cjs.js +1 -1
- package/dist/components/Form/index.es.js +3 -3
- package/dist/components/FormField/index.cjs.js +1 -1
- package/dist/components/FormField/index.es.js +14 -12
- package/dist/components/FormGroup/index.cjs.js +1 -1
- package/dist/components/FormGroup/index.es.js +3 -3
- package/dist/components/Icon/index.cjs.js +1 -1
- package/dist/components/Icon/index.es.js +2 -3
- package/dist/components/Input/index.cjs.js +1 -1
- package/dist/components/Input/index.es.js +5 -4
- package/dist/components/Link/index.cjs.js +1 -1
- package/dist/components/Link/index.es.js +12 -13
- package/dist/components/Loader/index.cjs.js +1 -1
- package/dist/components/Loader/index.es.js +2 -2
- package/dist/components/Modal/index.cjs.js +1 -1
- package/dist/components/Modal/index.es.js +21 -19
- package/dist/components/NumericInput/index.cjs.js +1 -1
- package/dist/components/NumericInput/index.es.js +2 -3
- package/dist/components/Picker/index.cjs.js +1 -1
- package/dist/components/Picker/index.es.js +42 -40
- package/dist/components/Popover/index.cjs.js +1 -1
- package/dist/components/Popover/index.es.js +2 -2
- package/dist/components/Progress/index.cjs.js +1 -1
- package/dist/components/Progress/index.es.js +5 -6
- package/dist/components/PromoBanner/index.cjs.js +1 -1
- package/dist/components/PromoBanner/index.es.js +5 -4
- package/dist/components/PromoBannerV2/index.cjs.js +1 -1
- package/dist/components/PromoBannerV2/index.es.js +22 -20
- package/dist/components/RadioButton/index.cjs.js +1 -1
- package/dist/components/RadioButton/index.es.js +2 -2
- package/dist/components/Search/index.cjs.js +1 -1
- package/dist/components/Search/index.es.js +2 -2
- package/dist/components/SegmentedControl/index.cjs.js +1 -1
- package/dist/components/SegmentedControl/index.es.js +16 -14
- package/dist/components/Switch/index.cjs.js +1 -1
- package/dist/components/Switch/index.es.js +4 -3
- package/dist/components/Tab/index.cjs.js +1 -1
- package/dist/components/Tab/index.es.js +2 -2
- package/dist/components/Tag/index.cjs.js +1 -1
- package/dist/components/Tag/index.es.js +2 -2
- package/dist/components/TagInput/index.cjs.js +1 -1
- package/dist/components/TagInput/index.es.js +41 -38
- package/dist/components/Textarea/index.cjs.js +1 -1
- package/dist/components/Textarea/index.es.js +2 -2
- package/dist/components/Toast/index.cjs.js +1 -1
- package/dist/components/Toast/index.es.js +5 -4
- package/dist/components/Tooltip/components/UserGuide/index.cjs.js +1 -1
- package/dist/components/Tooltip/components/UserGuide/index.es.js +21 -18
- package/dist/components/Tooltip/components/index.cjs.js +1 -1
- package/dist/components/Tooltip/components/index.es.js +25 -22
- package/dist/components/Tooltip/index.cjs.js +1 -1
- package/dist/components/Tooltip/index.es.js +19 -9
- package/dist/components/Typography/index.cjs.js +1 -1
- package/dist/components/Typography/index.es.js +3 -3
- package/dist/components/UploadBar/index.cjs.js +1 -1
- package/dist/components/UploadBar/index.es.js +12 -11
- package/dist/index.cjs.js +1 -1
- package/dist/index.es.js +135 -120
- package/dist/preview-stats.json +888 -888
- package/dist/style.css +1 -1
- package/package.json +2 -2
- package/dist/assets/style-ProgressBar.css +0 -1
- package/dist/assets/style-Tooltip.css +0 -1
- package/dist/assets/style-Typography.css +0 -1
- package/dist/assets/style-index.css +0 -1
- package/dist/assets/style-index10.css +0 -1
- package/dist/assets/style-index11.css +0 -1
- package/dist/assets/style-index12.css +0 -1
- package/dist/assets/style-index13.css +0 -1
- package/dist/assets/style-index14.css +0 -1
- package/dist/assets/style-index15.css +0 -1
- package/dist/assets/style-index16.css +0 -1
- package/dist/assets/style-index17.css +0 -1
- package/dist/assets/style-index18.css +0 -1
- package/dist/assets/style-index19.css +0 -1
- package/dist/assets/style-index2.css +0 -1
- package/dist/assets/style-index20.css +0 -1
- package/dist/assets/style-index21.css +0 -1
- package/dist/assets/style-index22.css +0 -1
- package/dist/assets/style-index23.css +0 -1
- package/dist/assets/style-index24.css +0 -1
- package/dist/assets/style-index25.css +0 -1
- package/dist/assets/style-index26.css +0 -1
- package/dist/assets/style-index27.css +0 -1
- package/dist/assets/style-index28.css +0 -1
- package/dist/assets/style-index29.css +0 -1
- package/dist/assets/style-index3.css +0 -1
- package/dist/assets/style-index30.css +0 -1
- package/dist/assets/style-index31.css +0 -1
- package/dist/assets/style-index32.css +0 -1
- package/dist/assets/style-index33.css +0 -1
- package/dist/assets/style-index34.css +0 -1
- package/dist/assets/style-index35.css +0 -1
- package/dist/assets/style-index36.css +0 -1
- package/dist/assets/style-index37.css +0 -1
- package/dist/assets/style-index38.css +0 -1
- package/dist/assets/style-index39.css +0 -1
- package/dist/assets/style-index4.css +0 -1
- package/dist/assets/style-index5.css +0 -1
- package/dist/assets/style-index6.css +0 -1
- package/dist/assets/style-index7.css +0 -1
- package/dist/assets/style-index8.css +0 -1
- package/dist/assets/style-index9.css +0 -1
- package/dist/chunks/ProgressBar-dd89d43a.js +0 -1
- package/dist/chunks/Tooltip-21230071.js +0 -1
- package/dist/chunks/Typography.module-8b7171c2.js +0 -1
|
@@ -19,11 +19,11 @@ var p = (t, e) => {
|
|
|
19
19
|
e.indexOf(_) < 0 && m.call(t, _) && (o[_] = t[_]);
|
|
20
20
|
return o;
|
|
21
21
|
};
|
|
22
|
-
import "../../assets/style-index10.css";
|
|
23
22
|
import * as i from "react";
|
|
24
23
|
import x from "clsx";
|
|
25
24
|
import { FieldDescription as T } from "../FieldDescription/index.es.js";
|
|
26
|
-
import { T as g } from "../../chunks/Text-
|
|
25
|
+
import { T as g } from "../../chunks/Text-b31d1e9a.js";
|
|
26
|
+
import "../../chunks/Typography.module-93efb34d.js";
|
|
27
27
|
const a = {
|
|
28
28
|
"radio-button": "lc-RadioButton-module__radio-button___WaToM",
|
|
29
29
|
"radio-button__circle": "lc-RadioButton-module__radio-button__circle___wimWA",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const N=require("react"),h=require("@livechat/design-system-icons"),O=require("clsx"),T=require("../../chunks/keyCodes-c4c35e49.js"),j=require("../Button/index.cjs.js"),m=require("../Icon/index.cjs.js"),v=require("../Loader/index.cjs.js"),F=require("../../chunks/Text-df483689.js");require("../../chunks/Typography.module-2558416b.js");function w(e){const r=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const n in e)if(n!=="default"){const l=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(r,n,l.get?l:{enumerable:!0,get:()=>e[n]})}}return r.default=e,Object.freeze(r)}const c=w(N),a={"search-input":"lc-Search-module__search-input___FsbCk","search-input--compact":"lc-Search-module__search-input--compact___498To","search-input--medium":"lc-Search-module__search-input--medium___Hwteg","search-input--large":"lc-Search-module__search-input--large___-IBuC","search-input--focused":"lc-Search-module__search-input--focused___i2eul","search-input--disabled":"lc-Search-module__search-input--disabled___LSJ2e","search-input--collapsable":"lc-Search-module__search-input--collapsable___5GaIH","search-input__search-icon":"lc-Search-module__search-input__search-icon___BBQoD","search-input--collapsable--open":"lc-Search-module__search-input--collapsable--open___vqTpD","search-input__clear-icon":"lc-Search-module__search-input__clear-icon___LoNkc","search-input__loader":"lc-Search-module__search-input__loader___pkpIG","search-input__input":"lc-Search-module__search-input__input___OhyTr"},t="search-input",D=`${t}__input`,R=({isCollapsable:e,isDisabled:r,isLoading:n,placeholder:l="Search ...",size:f="medium",value:o,className:S,onChange:u})=>{const[i,_]=c.useState(!0),[b,d]=c.useState(!1),p=c.useRef(null),y=!!o&&!r&&!n,g=e&&!i&&"true",k=O(S,a[t],a[`${t}--${f}`],b&&a[`${t}--focused`],r&&a[`${t}--disabled`],e&&a[`${t}--collapsable`],!i&&a[`${t}--collapsable--open`]);c.useEffect(()=>{e&&o&&_(!1)},[e]);const C=s=>{const B=s.currentTarget.value;u(B)},I=()=>{u("")},x=()=>{var s;(s=p.current)==null||s.focus()},$=()=>{e&&_(!1),d(!0)},q=()=>{e&&!o&&_(!0),d(!1)},E=s=>{s.key===T.KeyCodes.enter&&(s.preventDefault(),u(o))};return c.createElement("div",{"aria-expanded":g,role:"search",className:k,onClick:x},c.createElement(m.Icon,{className:a[`${t}__search-icon`],source:h.Search,disabled:r,kind:"primary"}),c.createElement(F.Text,{as:"div"},c.createElement("input",{role:"searchbox",ref:p,className:a[D],type:"text",value:o,placeholder:l,onChange:C,onBlur:q,onFocus:$,onKeyDown:E,disabled:r})),y&&c.createElement(j.Button,{"aria-label":"Clear search",title:"Clear search",className:a[`${t}__clear-icon`],onClick:I,icon:c.createElement(m.Icon,{source:h.Close,kind:"primary"}),kind:"text",size:"compact"}),n&&c.createElement("div",{"data-testid":`${t}-loader`,className:a[`${t}__loader`]},c.createElement(v.Loader,{size:"small"})))};exports.SearchInput=R;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import "../../assets/style-index9.css";
|
|
2
1
|
import * as e from "react";
|
|
3
2
|
import { Search as T, Close as F } from "@livechat/design-system-icons";
|
|
4
3
|
import g from "clsx";
|
|
@@ -6,7 +5,8 @@ import { K } from "../../chunks/keyCodes-30323e90.js";
|
|
|
6
5
|
import { Button as v } from "../Button/index.es.js";
|
|
7
6
|
import { Icon as m } from "../Icon/index.es.js";
|
|
8
7
|
import { Loader as w } from "../Loader/index.es.js";
|
|
9
|
-
import { T as R } from "../../chunks/Text-
|
|
8
|
+
import { T as R } from "../../chunks/Text-b31d1e9a.js";
|
|
9
|
+
import "../../chunks/Typography.module-93efb34d.js";
|
|
10
10
|
const a = {
|
|
11
11
|
"search-input": "lc-Search-module__search-input___FsbCk",
|
|
12
12
|
"search-input--compact": "lc-Search-module__search-input--compact___498To",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const j=require("react"),i=require("clsx"),P=require("../Button/index.cjs.js");require("../Loader/index.cjs.js");require("../../chunks/Text-df483689.js");require("../../chunks/Typography.module-2558416b.js");function w(e){const o=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const t in e)if(t!=="default"){const c=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(o,t,c.get?c:{enumerable:!0,get:()=>e[t]})}}return o.default=e,Object.freeze(o)}const r=w(j);function N(){}const E="lc-SegmentedControl-module__btn___tfsvL",l={"segmented-control":"lc-SegmentedControl-module__segmented-control___LHWSk",btn:E,"btn--active":"lc-SegmentedControl-module__btn--active___Za-th","btn--compact":"lc-SegmentedControl-module__btn--compact___gcSwq","btn--medium":"lc-SegmentedControl-module__btn--medium___w3UzC","btn--large":"lc-SegmentedControl-module__btn--large___yHPw4"},h="segmented-control",x=({size:e="medium",buttons:o,className:t,initialId:c,currentId:s,fullWidth:_=!1,onButtonClick:g=N})=>{const b=i(l[h],t),[S,u]=r.useState(()=>c),d=typeof s=="string";r.useEffect(()=>{d&&u(s)},[s]);const f=(n,a)=>{d||u(n),g(n,a)},p=o.map(({id:n,label:a,loading:C,disabled:y,icon:v})=>{const m=n===S,q=m?l["btn--active"]:"",k=m?!1:C;return r.createElement(P.Button,{key:n,fullWidth:_,loading:k,disabled:y,"aria-pressed":m,kind:"secondary",icon:v,className:i(l.btn,l[`btn--${e}`],q),onClick:O=>{f(n,O)}},a)});return r.createElement("div",{role:"group",className:b},p)};exports.SegmentedControl=x;
|
|
@@ -1,33 +1,35 @@
|
|
|
1
|
-
import "../../assets/style-index8.css";
|
|
2
1
|
import * as e from "react";
|
|
3
2
|
import r from "clsx";
|
|
4
3
|
import { Button as N } from "../Button/index.es.js";
|
|
4
|
+
import "../Loader/index.es.js";
|
|
5
|
+
import "../../chunks/Text-b31d1e9a.js";
|
|
6
|
+
import "../../chunks/Typography.module-93efb34d.js";
|
|
5
7
|
function h() {
|
|
6
8
|
}
|
|
7
|
-
const x = "lc-SegmentedControl-module__btn___tfsvL",
|
|
9
|
+
const x = "lc-SegmentedControl-module__btn___tfsvL", o = {
|
|
8
10
|
"segmented-control": "lc-SegmentedControl-module__segmented-control___LHWSk",
|
|
9
11
|
btn: x,
|
|
10
12
|
"btn--active": "lc-SegmentedControl-module__btn--active___Za-th",
|
|
11
13
|
"btn--compact": "lc-SegmentedControl-module__btn--compact___gcSwq",
|
|
12
14
|
"btn--medium": "lc-SegmentedControl-module__btn--medium___w3UzC",
|
|
13
15
|
"btn--large": "lc-SegmentedControl-module__btn--large___yHPw4"
|
|
14
|
-
}, H = "segmented-control",
|
|
16
|
+
}, H = "segmented-control", R = ({
|
|
15
17
|
size: a = "medium",
|
|
16
18
|
buttons: _,
|
|
17
19
|
className: d,
|
|
18
20
|
initialId: i,
|
|
19
|
-
currentId:
|
|
21
|
+
currentId: n,
|
|
20
22
|
fullWidth: g = !1,
|
|
21
23
|
onButtonClick: u = h
|
|
22
24
|
}) => {
|
|
23
|
-
const b = r(
|
|
25
|
+
const b = r(o[H], d), [S, c] = e.useState(() => i), m = typeof n == "string";
|
|
24
26
|
e.useEffect(() => {
|
|
25
|
-
m && c(
|
|
26
|
-
}, [
|
|
27
|
-
const
|
|
27
|
+
m && c(n);
|
|
28
|
+
}, [n]);
|
|
29
|
+
const p = (t, s) => {
|
|
28
30
|
m || c(t), u(t, s);
|
|
29
|
-
},
|
|
30
|
-
const l = t === S, k = l ?
|
|
31
|
+
}, C = _.map(({ id: t, label: s, loading: f, disabled: y, icon: v }) => {
|
|
32
|
+
const l = t === S, k = l ? o["btn--active"] : "", w = l ? !1 : f;
|
|
31
33
|
return /* @__PURE__ */ e.createElement(
|
|
32
34
|
N,
|
|
33
35
|
{
|
|
@@ -38,16 +40,16 @@ const x = "lc-SegmentedControl-module__btn___tfsvL", n = {
|
|
|
38
40
|
"aria-pressed": l,
|
|
39
41
|
kind: "secondary",
|
|
40
42
|
icon: v,
|
|
41
|
-
className: r(
|
|
43
|
+
className: r(o.btn, o[`btn--${a}`], k),
|
|
42
44
|
onClick: (E) => {
|
|
43
|
-
|
|
45
|
+
p(t, E);
|
|
44
46
|
}
|
|
45
47
|
},
|
|
46
48
|
s
|
|
47
49
|
);
|
|
48
50
|
});
|
|
49
|
-
return /* @__PURE__ */ e.createElement("div", { role: "group", className: b },
|
|
51
|
+
return /* @__PURE__ */ e.createElement("div", { role: "group", className: b }, C);
|
|
50
52
|
};
|
|
51
53
|
export {
|
|
52
|
-
|
|
54
|
+
R as SegmentedControl
|
|
53
55
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var M=Object.defineProperty;var r=Object.getOwnPropertySymbols;var y=Object.prototype.hasOwnProperty,E=Object.prototype.propertyIsEnumerable;var $=(_,e,c)=>e in _?M(_,e,{enumerable:!0,configurable:!0,writable:!0,value:c}):_[e]=c,N=(_,e)=>{for(var c in e||(e={}))y.call(e,c)&&$(_,c,e[c]);if(r)for(var c of r(e))E.call(e,c)&&$(_,c,e[c]);return _};var O=(_,e)=>{var c={};for(var i in _)y.call(_,i)&&e.indexOf(i)<0&&(c[i]=_[i]);if(_!=null&&r)for(var i of r(_))e.indexOf(i)<0&&E.call(_,i)&&(c[i]=_[i]);return c};
|
|
1
|
+
"use strict";var M=Object.defineProperty;var r=Object.getOwnPropertySymbols;var y=Object.prototype.hasOwnProperty,E=Object.prototype.propertyIsEnumerable;var $=(_,e,c)=>e in _?M(_,e,{enumerable:!0,configurable:!0,writable:!0,value:c}):_[e]=c,N=(_,e)=>{for(var c in e||(e={}))y.call(e,c)&&$(_,c,e[c]);if(r)for(var c of r(e))E.call(e,c)&&$(_,c,e[c]);return _};var O=(_,e)=>{var c={};for(var i in _)y.call(_,i)&&e.indexOf(i)<0&&(c[i]=_[i]);if(_!=null&&r)for(var i of r(_))e.indexOf(i)<0&&E.call(_,i)&&(c[i]=_[i]);return c};Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const P=require("react"),I=require("@livechat/design-system-icons"),a=require("clsx"),W=require("../Icon/index.cjs.js"),J=require("../Loader/index.cjs.js");require("../../chunks/Text-df483689.js");require("../../chunks/Typography.module-2558416b.js");function T(_){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(_){for(const c in _)if(c!=="default"){const i=Object.getOwnPropertyDescriptor(_,c);Object.defineProperty(e,c,i.get?i:{enumerable:!0,get:()=>_[c]})}}return e.default=_,Object.freeze(e)}const l=T(P),X="lc-Switch-module__switch__input___NiiOR",z="lc-Switch-module__switch__container___79F7W",B="lc-Switch-module__switch__track___2wr2M",C="lc-Switch-module__switch__slider___WHd--",G="lc-Switch-module__switch__loader___FE-fA",H="lc-Switch-module__switch__icon___-O1qY",s={switch:"lc-Switch-module__switch___AaA2k","switch__track--enabled":"lc-Switch-module__switch__track--enabled___sy4Xl","switch__track--on":"lc-Switch-module__switch__track--on___aOMWe","switch__track--off":"lc-Switch-module__switch__track--off___NAisj","switch--large":"lc-Switch-module__switch--large___pSoJ7","switch--compact":"lc-Switch-module__switch--compact___OGFIX","switch--medium":"lc-Switch-module__switch--medium___EcZwT",switch__input:X,"switch__input--disabled":"lc-Switch-module__switch__input--disabled___Po8gh",switch__container:z,switch__track:B,"switch__track--disabled":"lc-Switch-module__switch__track--disabled___HkDhl",switch__slider:C,"switch__slider--large":"lc-Switch-module__switch__slider--large___WoEgi","switch__slider--large--on":"lc-Switch-module__switch__slider--large--on___7Qp3G","switch__slider--large--off":"lc-Switch-module__switch__slider--large--off___iRMmD","switch__slider--compact":"lc-Switch-module__switch__slider--compact___uZ-lS","switch__slider--compact--on":"lc-Switch-module__switch__slider--compact--on___FykE3","switch__slider--compact--off":"lc-Switch-module__switch__slider--compact--off___s5yR8","switch__slider--medium":"lc-Switch-module__switch__slider--medium___uhptz","switch__slider--medium--on":"lc-Switch-module__switch__slider--medium--on___SfeAV","switch__slider--medium--off":"lc-Switch-module__switch__slider--medium--off___eXJJz",switch__loader:G,"switch__loader--compact":"lc-Switch-module__switch__loader--compact___3imUh","switch__loader--medium":"lc-Switch-module__switch__loader--medium___2zi05","switch__loader--large":"lc-Switch-module__switch__loader--large___vLRFa",switch__icon:H},t="switch",V=Z=>{var u=Z,{className:_="",defaultOn:e=!1,disabled:c=!1,name:i=t,on:d,onChange:n,size:o="large",state:m="regular",innerRef:q,ariaLabel:j}=u,v=O(u,["className","defaultOn","disabled","name","on","onChange","size","state","innerRef","ariaLabel"]);const h=d!==void 0,[A,F]=l.useState(()=>h?d:e),w=h?d:A,S=m==="loading",p=m==="locked",L=o==="large"?"small":"xsmall",f=w?"on":"off",g=c||S||p,k=g?"disabled":"enabled",R=a(s[t],s[`${t}--${o}`],_),x=b=>{n==null||n(b,!w),h||(b.stopPropagation(),F(D=>!D))};return l.createElement("span",{className:R},l.createElement("input",N({type:"checkbox",className:a(s[`${t}__input`],s[`${t}__input--${k}`]),onChange:x,checked:w,name:i,ref:q,disabled:g,"aria-label":j},v)),l.createElement("span",{className:s[`${t}__container`]},l.createElement("span",{className:a(s[`${t}__track`],s[`${t}__track--${f}`],s[`${t}__track--${k}`])}),l.createElement("span",{className:a(s[`${t}__slider`],s[`${t}__slider--${o}`],s[`${t}__slider--${o}--${f}`])},S&&l.createElement(J.Loader,{className:a(s[`${t}__loader`],s[`${t}__loader--${o}`])}),p&&l.createElement(W.Icon,{className:s[`${t}__icon`],"data-testid":"lock-icon",size:L,source:I.LockBlackFilled,kind:"primary"}))))};exports.Switch=V;
|
|
@@ -18,12 +18,13 @@ var A = (_, t) => {
|
|
|
18
18
|
t.indexOf(l) < 0 && N.call(_, l) && (c[l] = _[l]);
|
|
19
19
|
return c;
|
|
20
20
|
};
|
|
21
|
-
import "../../assets/style-index7.css";
|
|
22
21
|
import * as s from "react";
|
|
23
22
|
import { LockBlackFilled as X } from "@livechat/design-system-icons";
|
|
24
23
|
import a from "clsx";
|
|
25
24
|
import { Icon as B } from "../Icon/index.es.js";
|
|
26
25
|
import { Loader as C } from "../Loader/index.es.js";
|
|
26
|
+
import "../../chunks/Text-b31d1e9a.js";
|
|
27
|
+
import "../../chunks/Typography.module-93efb34d.js";
|
|
27
28
|
const G = "lc-Switch-module__switch__input___NiiOR", H = "lc-Switch-module__switch__container___79F7W", I = "lc-Switch-module__switch__track___2wr2M", P = "lc-Switch-module__switch__slider___WHd--", V = "lc-Switch-module__switch__loader___FE-fA", Z = "lc-Switch-module__switch__icon___-O1qY", e = {
|
|
28
29
|
switch: "lc-Switch-module__switch___AaA2k",
|
|
29
30
|
"switch__track--enabled": "lc-Switch-module__switch__track--enabled___sy4Xl",
|
|
@@ -52,7 +53,7 @@ const G = "lc-Switch-module__switch__input___NiiOR", H = "lc-Switch-module__swit
|
|
|
52
53
|
"switch__loader--medium": "lc-Switch-module__switch__loader--medium___2zi05",
|
|
53
54
|
"switch__loader--large": "lc-Switch-module__switch__loader--large___vLRFa",
|
|
54
55
|
switch__icon: Z
|
|
55
|
-
}, i = "switch",
|
|
56
|
+
}, i = "switch", __ = (j) => {
|
|
56
57
|
var u = j, {
|
|
57
58
|
className: _ = "",
|
|
58
59
|
defaultOn: t = !1,
|
|
@@ -140,5 +141,5 @@ const G = "lc-Switch-module__switch__input___NiiOR", H = "lc-Switch-module__swit
|
|
|
140
141
|
)));
|
|
141
142
|
};
|
|
142
143
|
export {
|
|
143
|
-
|
|
144
|
+
__ as Switch
|
|
144
145
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var
|
|
1
|
+
"use strict";var x=Object.defineProperty,N=Object.defineProperties;var j=Object.getOwnPropertyDescriptors;var l=Object.getOwnPropertySymbols;var u=Object.prototype.hasOwnProperty,m=Object.prototype.propertyIsEnumerable;var i=(e,t,a)=>t in e?x(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a,T=(e,t)=>{for(var a in t||(t={}))u.call(t,a)&&i(e,a,t[a]);if(l)for(var a of l(t))m.call(t,a)&&i(e,a,t[a]);return e},p=(e,t)=>N(e,j(t));var g=(e,t)=>{var a={};for(var s in e)u.call(e,s)&&t.indexOf(s)<0&&(a[s]=e[s]);if(e!=null&&l)for(var s of l(e))t.indexOf(s)<0&&m.call(e,s)&&(a[s]=e[s]);return a};Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const D=require("react"),n=require("clsx"),W=require("../Badge/index.cjs.js"),f=require("../../chunks/Text-df483689.js");require("../../chunks/Typography.module-2558416b.js");function h(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const a in e)if(a!=="default"){const s=Object.getOwnPropertyDescriptor(e,a);Object.defineProperty(t,a,s.get?s:{enumerable:!0,get:()=>e[a]})}}return t.default=e,Object.freeze(t)}const b=h(D),z="lc-Tab-module__tab___fME7u",L="lc-Tab-module__tab__count___gc8tA",A="lc-Tab-module__tab__badge___W9c-T",_={tab:z,tab__count:L,"tab--compact":"lc-Tab-module__tab--compact___4qead","tab--medium":"lc-Tab-module__tab--medium___bHnGV","tab--large":"lc-Tab-module__tab--large___JL30g",tab__badge:A,"tab--selected":"lc-Tab-module__tab--selected___c0EkL","tab--disabled":"lc-Tab-module__tab--disabled___URdTh"},c="tab",C=B=>{var r=B,{children:e,className:t,count:a,isSelected:s,asBadge:d,size:E="medium"}=r,o=g(r,["children","className","count","isSelected","asBadge","size"]);const{disabled:O}=o,q=a!==void 0&&!d,v=a!==void 0&&d;return b.createElement(f.Text,p(T({},o),{as:o.href?"a":"button",size:"md",bold:s,className:n(t,_[c],_[`${c}--${E}`],s&&_[`${c}--selected`],O&&_[`${c}--disabled`])}),e,q&&b.createElement(f.Text,{as:"span",size:"md",className:_[`${c}__count`]},"(",a,")"),v&&b.createElement(W.Badge,{"data-testid":"tab-badge",count:a,size:"compact",className:_[`${c}__badge`]}))},M="lc-TabsWrapper-module__tabs___Y2xyD",R="lc-TabsWrapper-module__tabs__list___i6tVO",y={tabs:M,tabs__list:R},$="tabs",S=({className:e,children:t})=>b.createElement("div",{className:n(y[$],e)},t),k=({className:e,children:t})=>b.createElement("div",{className:n(y[`${$}__list`],e)},t);exports.Tab=C;exports.TabsList=k;exports.TabsWrapper=S;
|
|
@@ -19,11 +19,11 @@ var g = (a, t) => {
|
|
|
19
19
|
t.indexOf(_) < 0 && u.call(a, _) && (e[_] = a[_]);
|
|
20
20
|
return e;
|
|
21
21
|
};
|
|
22
|
-
import "../../assets/style-index6.css";
|
|
23
22
|
import * as l from "react";
|
|
24
23
|
import d from "clsx";
|
|
25
24
|
import { Badge as A } from "../Badge/index.es.js";
|
|
26
|
-
import { T as $ } from "../../chunks/Text-
|
|
25
|
+
import { T as $ } from "../../chunks/Text-b31d1e9a.js";
|
|
26
|
+
import "../../chunks/Typography.module-93efb34d.js";
|
|
27
27
|
const C = "lc-Tab-module__tab___fME7u", D = "lc-Tab-module__tab__count___gc8tA", L = "lc-Tab-module__tab__badge___W9c-T", s = {
|
|
28
28
|
tab: C,
|
|
29
29
|
tab__count: D,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var S=Object.defineProperty,E=Object.defineProperties;var I=Object.getOwnPropertyDescriptors;var r=Object.getOwnPropertySymbols;var b=Object.prototype.hasOwnProperty,f=Object.prototype.propertyIsEnumerable;var T=(e,a,t)=>a in e?S(e,a,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[a]=t,i=(e,a)=>{for(var t in a||(a={}))b.call(a,t)&&T(e,t,a[t]);if(r)for(var t of r(a))f.call(a,t)&&T(e,t,a[t]);return e},x=(e,a)=>E(e,I(a));var F=(e,a)=>{var t={};for(var _ in e)b.call(e,_)&&a.indexOf(_)<0&&(t[_]=e[_]);if(e!=null&&r)for(var _ of r(e))a.indexOf(_)<0&&f.call(e,_)&&(t[_]=e[_]);return t};
|
|
1
|
+
"use strict";var S=Object.defineProperty,E=Object.defineProperties;var I=Object.getOwnPropertyDescriptors;var r=Object.getOwnPropertySymbols;var b=Object.prototype.hasOwnProperty,f=Object.prototype.propertyIsEnumerable;var T=(e,a,t)=>a in e?S(e,a,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[a]=t,i=(e,a)=>{for(var t in a||(a={}))b.call(a,t)&&T(e,t,a[t]);if(r)for(var t of r(a))f.call(a,t)&&T(e,t,a[t]);return e},x=(e,a)=>E(e,I(a));var F=(e,a)=>{var t={};for(var _ in e)b.call(e,_)&&a.indexOf(_)<0&&(t[_]=e[_]);if(e!=null&&r)for(var _ of r(e))a.indexOf(_)<0&&f.call(e,_)&&(t[_]=e[_]);return t};Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const w=require("react"),O=require("@livechat/design-system-icons"),R=require("clsx"),p=require("polished"),h=require("../Icon/index.cjs.js"),D=require("../../chunks/Text-df483689.js");require("../../chunks/Typography.module-2558416b.js");function P(e){const a=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const t in e)if(t!=="default"){const _=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(a,t,_.get?_:{enumerable:!0,get:()=>e[t]})}}return a.default=e,Object.freeze(a)}const c=P(w),z="lc-Tag-module__tag___1QRVY",N="lc-Tag-module__tag__remove___UmtrW",K="lc-Tag-module__icon___2Z-35",M="lc-Tag-module__tag__node___rZTzB",Q="lc-Tag-module__tag__content___q6vKK",n={tag:z,"tag--success":"lc-Tag-module__tag--success___P2hXQ",tag__remove:N,"tag--error":"lc-Tag-module__tag--error___1cjsm","tag--warning":"lc-Tag-module__tag--warning___PstMG","tag--info":"lc-Tag-module__tag--info___RTH0C","tag--purple":"lc-Tag-module__tag--purple___a0xaE","tag--black":"lc-Tag-module__tag--black___qWjfD","tag--outline":"lc-Tag-module__tag--outline___aZXtr","tag--small":"lc-Tag-module__tag--small___xfcC5","tag--medium":"lc-Tag-module__tag--medium___l5-KI","tag--large":"lc-Tag-module__tag--large___ytC6Y","tag--xlarge":"lc-Tag-module__tag--xlarge___2jj1d",icon:K,"tag--text-white":"lc-Tag-module__tag--text-white___x0fnD","tag--text-black":"lc-Tag-module__tag--text-black___dUvmD","tag--dismissible":"lc-Tag-module__tag--dismissible___Qobyr",tag__node:M,tag__content:Q},o="tag",Z=e=>e?p.getContrast(e,"#FFFFFF")>4.5?"text-white":"text-black":"",U=W=>{var u=W,{className:e="",children:a,dismissible:t=!1,size:_="medium",kind:v="default",onRemove:y,outline:g=!1,leftNode:m,rightNode:d,customColor:l}=u,$=F(u,["className","children","dismissible","size","kind","onRemove","outline","leftNode","rightNode","customColor"]);const C=R(n[o],e,n[`${o}--${_}`],n[`${o}--${v}`],{[n[`${o}--dismissible`]]:t,[n[`${o}--outline`]]:g,[n[`${o}--${Z(l)}`]]:!!l}),j=_==="small"?"small":"medium",k=_==="small"?"sm":"md",q=()=>l?g?{style:{backgroundColor:"transparent",color:l,borderColor:l}}:{style:{backgroundColor:l}}:{},s=()=>{if(l)return g?l:p.getContrast(l,"#FFFFFF")>4.5?"#FFFFFF":"#000000"};return c.createElement(D.Text,x(i(i({className:C},$),q()),{as:"div",size:k}),m&&c.createElement("div",{"data-testid":"lc-tag-left-node",className:n[`${o}__node`],style:{color:s()}},m),c.createElement("div",{className:n[`${o}__content`]},a),d&&c.createElement("div",{"data-testid":"lc-tag-right-node",style:{color:s()}},d),t&&c.createElement("button",{tabIndex:-1,title:"Remove",onClick:y,type:"button","aria-label":"Remove tag",className:n[`${o}__remove`]},c.createElement(h.Icon,{"data-dismiss-icon":!0,source:O.Close,size:j,customColor:s()})))};exports.Tag=U;
|
|
@@ -19,13 +19,13 @@ var b = (t, e) => {
|
|
|
19
19
|
e.indexOf(_) < 0 && F.call(t, _) && (a[_] = t[_]);
|
|
20
20
|
return a;
|
|
21
21
|
};
|
|
22
|
-
import "../../assets/style-index5.css";
|
|
23
22
|
import * as r from "react";
|
|
24
23
|
import { Close as j } from "@livechat/design-system-icons";
|
|
25
24
|
import z from "clsx";
|
|
26
25
|
import { getContrast as p } from "polished";
|
|
27
26
|
import { Icon as D } from "../Icon/index.es.js";
|
|
28
|
-
import { T as K } from "../../chunks/Text-
|
|
27
|
+
import { T as K } from "../../chunks/Text-b31d1e9a.js";
|
|
28
|
+
import "../../chunks/Typography.module-93efb34d.js";
|
|
29
29
|
const N = "lc-Tag-module__tag___1QRVY", Q = "lc-Tag-module__tag__remove___UmtrW", S = "lc-Tag-module__icon___2Z-35", Z = "lc-Tag-module__tag__node___rZTzB", q = "lc-Tag-module__tag__content___q6vKK", o = {
|
|
30
30
|
tag: N,
|
|
31
31
|
"tag--success": "lc-Tag-module__tag--success___P2hXQ",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var G=Object.defineProperty,X=Object.defineProperties;var A=Object.getOwnPropertyDescriptors;var b=Object.getOwnPropertySymbols;var
|
|
1
|
+
"use strict";var G=Object.defineProperty,X=Object.defineProperties;var A=Object.getOwnPropertyDescriptors;var b=Object.getOwnPropertySymbols;var S=Object.prototype.hasOwnProperty,P=Object.prototype.propertyIsEnumerable;var R=(t,e,n)=>e in t?G(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,I=(t,e)=>{for(var n in e||(e={}))S.call(e,n)&&R(t,n,e[n]);if(b)for(var n of b(e))P.call(e,n)&&R(t,n,e[n]);return t},D=(t,e)=>X(t,A(e));var K=(t,e)=>{var n={};for(var a in t)S.call(t,a)&&e.indexOf(a)<0&&(n[a]=t[a]);if(t!=null&&b)for(var a of b(t))e.indexOf(a)<0&&P.call(t,a)&&(n[a]=t[a]);return n};Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const J=require("react"),V=require("clsx"),i=require("../../chunks/keyCodes-c4c35e49.js"),Q=require("../FieldError/index.cjs.js"),U=require("../../chunks/Text-df483689.js"),W=require("../Tag/index.cjs.js"),w=require("lodash.escape");require("@livechat/design-system-icons");require("../Icon/index.cjs.js");require("../../chunks/Typography.module-2558416b.js");require("polished");function Z(t){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const n in t)if(n!=="default"){const a=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(e,n,a.get?a:{enumerable:!0,get:()=>t[n]})}}return e.default=t,Object.freeze(e)}const c=Z(J),ee=({className:t="",innerEditableRef:e,inputRef:n,change:a,remove:o,value:m})=>{const[_,d]=c.useState(!1),s=()=>e.current,p=()=>{const u=s();return u?u.innerText:""},x=()=>{n&&n.current&&n.current.focus()},v=u=>{if(u.key===i.KeyCodes.enter){u.preventDefault(),x();return}u.key===i.KeyCodes.backspace&&p()===""&&(d(!0),o(),x())},q=()=>{const u=s();if(!(_||!u)){if(u.innerText===""){o();return}a(u.innerText)}},y=u=>{u.preventDefault();const C=u.clipboardData.getData("text/plain");document.execCommand("insertHTML",!1,w(C))};return c.createElement("div",{ref:e,className:t,contentEditable:!0,onPaste:y,onBlur:q,onKeyDown:v,dangerouslySetInnerHTML:{__html:w(m)}})},T={"tag-input":"lc-TagInput-module__tag-input___CLVY-","tag-input--error":"lc-TagInput-module__tag-input--error___RP0SB","tag-input__input":"lc-TagInput-module__tag-input__input___dgEYB","tag-input__input--medium":"lc-TagInput-module__tag-input__input--medium___DYF7X","tag-input__input--large":"lc-TagInput-module__tag-input__input--large___G6iEO","tag-input__tag__content":"lc-TagInput-module__tag-input__tag__content___x95-M"},te="tag-input__tag",ne=({children:t,index:e,remove:n,validator:a,inputRef:o,update:m,size:_})=>{const d=c.useMemo(()=>a!==void 0?a(t):!0,[t,a]),s=c.useRef(null),p=()=>n(e);return c.createElement(W.Tag,{kind:d?"default":"error",dismissible:!0,size:_,onRemove:p},c.createElement(ee,{value:t,inputRef:o,innerEditableRef:s,className:T[`${te}__content`],change:x=>m(e,x),remove:p,validator:a}))},E="tag-input",ae=[i.KeyCodes.enter,i.KeyCodes.spacebar,i.KeyCodes.tab,i.KeyCodes.semicolon,i.KeyCodes.comma],re=[i.KeyCodes.backspace,i.KeyCodes.delete],h=q=>{var y=q,{id:t,tags:e,onChange:n,validator:a,error:o,placeholder:m,size:_="medium",className:d,inputClassName:s,onBlur:p,addOnBlur:x=!0}=y,v=K(y,["id","tags","onChange","validator","error","placeholder","size","className","inputClassName","onBlur","addOnBlur"]);const u=V(T[E],{[T[`${E}--error`]]:o},d),C=V(s,T[`${E}__input`],T[`${E}__input--${_}`]),[f,O]=c.useState(""),$=c.useRef(null),k=r=>{n([...e||[],r]),O("")},z=r=>{const l=[...e||[]];l.splice(r,1),n(l)},M=r=>O(r.target.value),N=r=>{if(ae.includes(r.key)){if(r.preventDefault(),f==="")return;k(f)}else if(re.includes(r.key)){if(f!==""||!(e!=null&&e.length))return;z(e.length-1)}},j=r=>{x&&k(f),p==null||p(r)},F=(r,l)=>{const g=[...e||[]];g.reduce((Y,H,B)=>Y+(H===l&&B!==r?1:0),0)>0?g.splice(r,1):g[r]=l,n(g)},L=r=>{r.preventDefault();const g=r.clipboardData.getData("text/plain").split(/[\s,;\n]+/);n([...e||[],...g])};return c.createElement(c.Fragment,null,c.createElement(U.Text,{as:"div",className:u},e==null?void 0:e.map((r,l)=>c.createElement(ne,{index:l,key:`${l}${r}`,update:F,remove:z,inputRef:$,validator:a,size:_},r)),c.createElement("input",D(I({},v),{id:t,ref:$,className:C,placeholder:m,value:f,onChange:M,onKeyDown:N,onPaste:L,onBlur:j}))),o&&c.createElement(Q.FieldError,null,o))},ue=/^(?:[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*|"(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21\x23-\x5b\x5d-\x7f]|\\[\x01-\x09\x0b\x0c\x0e-\x7f])*")@(?:(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?|\[(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?|[a-z0-9-]*[a-z0-9]:(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21-\x5a\x53-\x7f]|\\[\x01-\x09\x0b\x0c\x0e-\x7f])+)])$/i,ce="name@company.com",oe=t=>ue.test(t),se=d=>{var s=d,{id:t,tags:e,onChange:n,error:a,placeholder:o=ce,size:m}=s,_=K(s,["id","tags","onChange","error","placeholder","size"]);return c.createElement(h,D(I({},_),{id:t,tags:e,error:a,onChange:n,placeholder:o,validator:oe,size:m}))};exports.EmailTagInput=se;exports.TagInput=h;
|
|
@@ -19,48 +19,51 @@ var z = (t, e) => {
|
|
|
19
19
|
e.indexOf(r) < 0 && N.call(t, r) && (n[r] = t[r]);
|
|
20
20
|
return n;
|
|
21
21
|
};
|
|
22
|
-
import "
|
|
23
|
-
import * as u from "react";
|
|
22
|
+
import * as c from "react";
|
|
24
23
|
import O from "clsx";
|
|
25
24
|
import { K as i } from "../../chunks/keyCodes-30323e90.js";
|
|
26
25
|
import { FieldError as A } from "../FieldError/index.es.js";
|
|
27
|
-
import { T as J } from "../../chunks/Text-
|
|
26
|
+
import { T as J } from "../../chunks/Text-b31d1e9a.js";
|
|
28
27
|
import { Tag as Q } from "../Tag/index.es.js";
|
|
29
28
|
import P from "lodash.escape";
|
|
29
|
+
import "@livechat/design-system-icons";
|
|
30
|
+
import "../Icon/index.es.js";
|
|
31
|
+
import "../../chunks/Typography.module-93efb34d.js";
|
|
32
|
+
import "polished";
|
|
30
33
|
const U = ({
|
|
31
34
|
className: t = "",
|
|
32
35
|
innerEditableRef: e,
|
|
33
36
|
inputRef: n,
|
|
34
37
|
change: r,
|
|
35
|
-
remove:
|
|
38
|
+
remove: u,
|
|
36
39
|
value: _
|
|
37
40
|
}) => {
|
|
38
|
-
const [m, x] =
|
|
39
|
-
const
|
|
40
|
-
return
|
|
41
|
+
const [m, x] = c.useState(!1), s = () => e.current, p = () => {
|
|
42
|
+
const o = s();
|
|
43
|
+
return o ? o.innerText : "";
|
|
41
44
|
}, f = () => {
|
|
42
45
|
n && n.current && n.current.focus();
|
|
43
|
-
}, y = (
|
|
44
|
-
if (
|
|
45
|
-
|
|
46
|
+
}, y = (o) => {
|
|
47
|
+
if (o.key === i.enter) {
|
|
48
|
+
o.preventDefault(), f();
|
|
46
49
|
return;
|
|
47
50
|
}
|
|
48
|
-
|
|
51
|
+
o.key === i.backspace && p() === "" && (x(!0), u(), f());
|
|
49
52
|
}, R = () => {
|
|
50
|
-
const
|
|
51
|
-
if (!(m || !
|
|
52
|
-
if (
|
|
53
|
-
|
|
53
|
+
const o = s();
|
|
54
|
+
if (!(m || !o)) {
|
|
55
|
+
if (o.innerText === "") {
|
|
56
|
+
u();
|
|
54
57
|
return;
|
|
55
58
|
}
|
|
56
|
-
r(
|
|
59
|
+
r(o.innerText);
|
|
57
60
|
}
|
|
58
|
-
}, b = (
|
|
59
|
-
|
|
60
|
-
const I =
|
|
61
|
+
}, b = (o) => {
|
|
62
|
+
o.preventDefault();
|
|
63
|
+
const I = o.clipboardData.getData("text/plain");
|
|
61
64
|
document.execCommand("insertHTML", !1, P(I));
|
|
62
65
|
};
|
|
63
|
-
return /* @__PURE__ */
|
|
66
|
+
return /* @__PURE__ */ c.createElement(
|
|
64
67
|
"div",
|
|
65
68
|
{
|
|
66
69
|
ref: e,
|
|
@@ -84,12 +87,12 @@ const U = ({
|
|
|
84
87
|
index: e,
|
|
85
88
|
remove: n,
|
|
86
89
|
validator: r,
|
|
87
|
-
inputRef:
|
|
90
|
+
inputRef: u,
|
|
88
91
|
update: _,
|
|
89
92
|
size: m
|
|
90
93
|
}) => {
|
|
91
|
-
const x =
|
|
92
|
-
return /* @__PURE__ */
|
|
94
|
+
const x = c.useMemo(() => r !== void 0 ? r(t) : !0, [t, r]), s = c.useRef(null), p = () => n(e);
|
|
95
|
+
return /* @__PURE__ */ c.createElement(
|
|
93
96
|
Q,
|
|
94
97
|
{
|
|
95
98
|
kind: x ? "default" : "error",
|
|
@@ -97,11 +100,11 @@ const U = ({
|
|
|
97
100
|
size: m,
|
|
98
101
|
onRemove: p
|
|
99
102
|
},
|
|
100
|
-
/* @__PURE__ */
|
|
103
|
+
/* @__PURE__ */ c.createElement(
|
|
101
104
|
U,
|
|
102
105
|
{
|
|
103
106
|
value: t,
|
|
104
|
-
inputRef:
|
|
107
|
+
inputRef: u,
|
|
105
108
|
innerEditableRef: s,
|
|
106
109
|
className: T[`${W}__content`],
|
|
107
110
|
change: (f) => _(e, f),
|
|
@@ -122,7 +125,7 @@ const U = ({
|
|
|
122
125
|
tags: e,
|
|
123
126
|
onChange: n,
|
|
124
127
|
validator: r,
|
|
125
|
-
error:
|
|
128
|
+
error: u,
|
|
126
129
|
placeholder: _,
|
|
127
130
|
size: m = "medium",
|
|
128
131
|
className: x,
|
|
@@ -142,17 +145,17 @@ const U = ({
|
|
|
142
145
|
"onBlur",
|
|
143
146
|
"addOnBlur"
|
|
144
147
|
]);
|
|
145
|
-
const
|
|
148
|
+
const o = O(
|
|
146
149
|
T[v],
|
|
147
150
|
{
|
|
148
|
-
[T[`${v}--error`]]:
|
|
151
|
+
[T[`${v}--error`]]: u
|
|
149
152
|
},
|
|
150
153
|
x
|
|
151
154
|
), I = O(
|
|
152
155
|
s,
|
|
153
156
|
T[`${v}__input`],
|
|
154
157
|
T[`${v}__input--${m}`]
|
|
155
|
-
), [g, k] =
|
|
158
|
+
), [g, k] = c.useState(""), V = c.useRef(null), C = (a) => {
|
|
156
159
|
n([...e || [], a]), k("");
|
|
157
160
|
}, K = (a) => {
|
|
158
161
|
const l = [...e || []];
|
|
@@ -180,7 +183,7 @@ const U = ({
|
|
|
180
183
|
const d = a.clipboardData.getData("text/plain").split(/[\s,;\n]+/);
|
|
181
184
|
n([...e || [], ...d]);
|
|
182
185
|
};
|
|
183
|
-
return /* @__PURE__ */
|
|
186
|
+
return /* @__PURE__ */ c.createElement(c.Fragment, null, /* @__PURE__ */ c.createElement(J, { as: "div", className: o }, e == null ? void 0 : e.map((a, l) => /* @__PURE__ */ c.createElement(
|
|
184
187
|
Z,
|
|
185
188
|
{
|
|
186
189
|
index: l,
|
|
@@ -192,7 +195,7 @@ const U = ({
|
|
|
192
195
|
size: m
|
|
193
196
|
},
|
|
194
197
|
a
|
|
195
|
-
)), /* @__PURE__ */
|
|
198
|
+
)), /* @__PURE__ */ c.createElement(
|
|
196
199
|
"input",
|
|
197
200
|
$(D({}, y), {
|
|
198
201
|
id: t,
|
|
@@ -205,14 +208,14 @@ const U = ({
|
|
|
205
208
|
onPaste: Y,
|
|
206
209
|
onBlur: F
|
|
207
210
|
})
|
|
208
|
-
)),
|
|
209
|
-
}, ae = /^(?:[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*|"(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21\x23-\x5b\x5d-\x7f]|\\[\x01-\x09\x0b\x0c\x0e-\x7f])*")@(?:(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?|\[(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?|[a-z0-9-]*[a-z0-9]:(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21-\x5a\x53-\x7f]|\\[\x01-\x09\x0b\x0c\x0e-\x7f])+)])$/i, re = "name@company.com",
|
|
211
|
+
)), u && /* @__PURE__ */ c.createElement(A, null, u));
|
|
212
|
+
}, ae = /^(?:[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*|"(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21\x23-\x5b\x5d-\x7f]|\\[\x01-\x09\x0b\x0c\x0e-\x7f])*")@(?:(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?|\[(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?|[a-z0-9-]*[a-z0-9]:(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21-\x5a\x53-\x7f]|\\[\x01-\x09\x0b\x0c\x0e-\x7f])+)])$/i, re = "name@company.com", oe = (t) => ae.test(t), Te = (x) => {
|
|
210
213
|
var s = x, {
|
|
211
214
|
id: t,
|
|
212
215
|
tags: e,
|
|
213
216
|
onChange: n,
|
|
214
217
|
error: r,
|
|
215
|
-
placeholder:
|
|
218
|
+
placeholder: u = re,
|
|
216
219
|
size: _
|
|
217
220
|
} = s, m = z(s, [
|
|
218
221
|
"id",
|
|
@@ -222,20 +225,20 @@ const U = ({
|
|
|
222
225
|
"placeholder",
|
|
223
226
|
"size"
|
|
224
227
|
]);
|
|
225
|
-
return /* @__PURE__ */
|
|
228
|
+
return /* @__PURE__ */ c.createElement(
|
|
226
229
|
ne,
|
|
227
230
|
$(D({}, m), {
|
|
228
231
|
id: t,
|
|
229
232
|
tags: e,
|
|
230
233
|
error: r,
|
|
231
234
|
onChange: n,
|
|
232
|
-
placeholder:
|
|
233
|
-
validator:
|
|
235
|
+
placeholder: u,
|
|
236
|
+
validator: oe,
|
|
234
237
|
size: _
|
|
235
238
|
})
|
|
236
239
|
);
|
|
237
240
|
};
|
|
238
241
|
export {
|
|
239
|
-
|
|
242
|
+
Te as EmailTagInput,
|
|
240
243
|
ne as TagInput
|
|
241
244
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var
|
|
1
|
+
"use strict";var v=Object.defineProperty,S=Object.defineProperties;var E=Object.getOwnPropertyDescriptors;var s=Object.getOwnPropertySymbols;var f=Object.prototype.hasOwnProperty,m=Object.prototype.propertyIsEnumerable;var x=(e,a,t)=>a in e?v(e,a,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[a]=t,b=(e,a)=>{for(var t in a||(a={}))f.call(a,t)&&x(e,t,a[t]);if(s)for(var t of s(a))m.call(a,t)&&x(e,t,a[t]);return e},T=(e,a)=>S(e,E(a));var g=(e,a)=>{var t={};for(var r in e)f.call(e,r)&&a.indexOf(r)<0&&(t[r]=e[r]);if(e!=null&&s)for(var r of s(e))a.indexOf(r)<0&&m.call(e,r)&&(t[r]=e[r]);return t};Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const F=require("react"),N=require("clsx"),R=require("../../chunks/Text-df483689.js");require("../../chunks/Typography.module-2558416b.js");function $(e){const a=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const t in e)if(t!=="default"){const r=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(a,t,r.get?r:{enumerable:!0,get:()=>e[t]})}}return a.default=e,Object.freeze(a)}const c=$(F),h="lc-Textarea-module__textarea___g6U8F",o={textarea:h,"textarea--focused":"lc-Textarea-module__textarea--focused___1vtEx","textarea--disabled":"lc-Textarea-module__textarea--disabled___xXaGv","textarea--error":"lc-Textarea-module__textarea--error___0EGuq"},n="textarea",w=c.forwardRef((C,r)=>{var _=C,{className:e,error:a}=_,t=g(_,["className","error"]);const{disabled:O,onBlur:l,onFocus:u}=t,[p,i]=c.useState(!1),y=N(e,o[n],{[o[`${n}--disabled`]]:O,[o[`${n}--focused`]]:p,[o[`${n}--error`]]:a}),j=d=>{i(!1),l==null||l(d)},q=d=>{i(!0),u==null||u(d)};return c.createElement(R.Text,{as:"div",className:y},c.createElement("textarea",T(b({},t),{ref:r,onFocus:q,onBlur:j})))});exports.Textarea=w;
|
|
@@ -19,10 +19,10 @@ var p = (e, a) => {
|
|
|
19
19
|
a.indexOf(r) < 0 && i.call(e, r) && (t[r] = e[r]);
|
|
20
20
|
return t;
|
|
21
21
|
};
|
|
22
|
-
import "../../assets/style-index3.css";
|
|
23
22
|
import * as o from "react";
|
|
24
23
|
import N from "clsx";
|
|
25
|
-
import { T as O } from "../../chunks/Text-
|
|
24
|
+
import { T as O } from "../../chunks/Text-b31d1e9a.js";
|
|
25
|
+
import "../../chunks/Typography.module-93efb34d.js";
|
|
26
26
|
const R = "lc-Textarea-module__textarea___g6U8F", c = {
|
|
27
27
|
textarea: R,
|
|
28
28
|
"textarea--focused": "lc-Textarea-module__textarea--focused___1vtEx",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var
|
|
1
|
+
"use strict";var O=Object.defineProperty,j=Object.defineProperties;var M=Object.getOwnPropertyDescriptors;var d=Object.getOwnPropertySymbols;var $=Object.prototype.hasOwnProperty,N=Object.prototype.propertyIsEnumerable;var x=(t,o,e)=>o in t?O(t,o,{enumerable:!0,configurable:!0,writable:!0,value:e}):t[o]=e,w=(t,o)=>{for(var e in o||(o={}))$.call(o,e)&&x(t,e,o[e]);if(d)for(var e of d(o))N.call(o,e)&&x(t,e,o[e]);return t},C=(t,o)=>j(t,M(o));var E=(t,o)=>{var e={};for(var a in t)$.call(t,a)&&o.indexOf(a)<0&&(e[a]=t[a]);if(t!=null&&d)for(var a of d(t))o.indexOf(a)<0&&N.call(t,a)&&(e[a]=t[a]);return e};Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const G=require("react"),u=require("@livechat/design-system-icons"),v=require("clsx"),h=require("../Button/index.cjs.js"),I=require("../Icon/index.cjs.js"),y=require("../../chunks/Text-df483689.js"),k=require("react-transition-group");require("../Loader/index.cjs.js");require("../../chunks/Typography.module-2558416b.js");function S(t){const o=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const e in t)if(e!=="default"){const a=Object.getOwnPropertyDescriptor(t,e);Object.defineProperty(o,e,a.get?a:{enumerable:!0,get:()=>t[e]})}}return o.default=t,Object.freeze(o)}const _=S(G),B="lc-Toast-module__toast___j5Amn",W="lc-Toast-module__toast__content___HjaNw",D="lc-Toast-module__toast__actions___JWu-1",H="lc-Toast-module__toast__actions__button___Iblrl",s={toast:B,toast__content:W,toast__actions:D,toast__actions__button:H,"toast__actions__button--success":"lc-Toast-module__toast__actions__button--success___5JmFw","toast__actions__button--warning":"lc-Toast-module__toast__actions__button--warning___zGQ-Q","toast__actions__button--error":"lc-Toast-module__toast__actions__button--error___PuTv3","toast__actions__button--info":"lc-Toast-module__toast__actions__button--info___fNtsj","toast__actions--custom":"lc-Toast-module__toast__actions--custom___lm-pM","toast--success":"lc-Toast-module__toast--success___7UC6m","toast--warning":"lc-Toast-module__toast--warning___pteb7","toast--error":"lc-Toast-module__toast--error___trg--","toast--info":"lc-Toast-module__toast--info___IOp44","toast-wrapper":"lc-Toast-module__toast-wrapper___Oiwqp","toast-wrapper--fixed":"lc-Toast-module__toast-wrapper--fixed___QYxRI","toast-wrapper--block":"lc-Toast-module__toast-wrapper--block___j0kGt","toast-wrapper--horizontal-center":"lc-Toast-module__toast-wrapper--horizontal-center___t9AFd","toast-wrapper--horizontal-left":"lc-Toast-module__toast-wrapper--horizontal-left___-GY4I","toast-wrapper--horizontal-right":"lc-Toast-module__toast-wrapper--horizontal-right___VVMgm","toast-wrapper--vertical-top":"lc-Toast-module__toast-wrapper--vertical-top___uBfEG","toast-appear--slide":"lc-Toast-module__toast-appear--slide___G7GAp","toast-appear-active--slide":"lc-Toast-module__toast-appear-active--slide___brfgK","toast-exit--slide":"lc-Toast-module__toast-exit--slide___aqiBq","toast-exit-active--slide":"lc-Toast-module__toast-exit-active--slide___WryMi","toast-wrapper--vertical-bottom":"lc-Toast-module__toast-wrapper--vertical-bottom___erPuH","toast-appear--fade":"lc-Toast-module__toast-appear--fade___oUwHm","toast-appear-active--fade":"lc-Toast-module__toast-appear-active--fade___D3--J","toast-exit--fade":"lc-Toast-module__toast-exit--fade___iDA1p","toast-exit-active--fade":"lc-Toast-module__toast-exit-active--fade___tL7sb"},J={success:{source:u.CheckCircle},warning:{source:u.Warning},error:{source:u.Block},info:{source:u.Info}},r="toast",q=g=>{var m=g,{action:t,className:o,children:e,removable:a,kind:c="info",onClose:n}=m,p=E(m,["action","className","children","removable","kind","onClose"]);const T=v(s[r],s[`${r}--${c}`],o),f=typeof e=="string",b=l=>l&&l.closesOnClick&&n?(l.onClick(),n()):l.onClick();return _.createElement("div",w({className:T},p),_.createElement("div",{className:s[`${r}__icon`]},_.createElement(I.Icon,C(w({},J[c]),{size:"medium"}))),_.createElement("div",{className:s[`${r}__content`]},f?_.createElement(y.Text,{as:"div"},e):e),(t||a)&&_.createElement("div",{className:s[`${r}__actions`]},t&&_.createElement(h.Button,{className:s[`${r}__actions--custom`],kind:"text",size:"compact",onClick:()=>b(t)},t.label),a&&_.createElement("button",{className:v(s[`${r}__actions__button`],s[`${r}__actions__button--${c}`]),"aria-label":"Close toast",onClick:n},_.createElement(I.Icon,{source:u.Close,size:"medium"}))))},z=200,i="toast-wrapper",P=({className:t,toasts:o=[],fixed:e=!0,block:a=!1,animationType:c="slide",verticalPosition:n="top",horizontalPosition:p="center"})=>{const g=v(s[i],{[s[`${i}--fixed`]]:e,[s[`${i}--block`]]:!e&&a,[s[`${i}--horizontal-${p}`]]:p,[s[`${i}--vertical-${n}`]]:n},t);return _.createElement("div",{className:g},_.createElement(k.TransitionGroup,{component:null},o.map(({id:m,kind:T,content:f,removable:b,action:l,onClose:A})=>_.createElement(k.CSSTransition,{key:m,classNames:{enter:s[`toast-appear--${c}`],enterActive:s[`toast-appear-active--${c}`],exit:s[`toast-exit--${c}`],exitActive:s[`toast-exit-active--${c}`]},timeout:z},_.createElement(q,{kind:T,onClose:A,removable:b,action:l},f)))))};exports.ANIMATION_TIME=z;exports.Toast=q;exports.ToastWrapper=P;
|
|
@@ -19,14 +19,15 @@ var E = (t, a) => {
|
|
|
19
19
|
a.indexOf(_) < 0 && C.call(t, _) && (o[_] = t[_]);
|
|
20
20
|
return o;
|
|
21
21
|
};
|
|
22
|
-
import "../../assets/style-index2.css";
|
|
23
22
|
import * as s from "react";
|
|
24
23
|
import { Close as h, CheckCircle as G, Warning as M, Block as j, Info as B } from "@livechat/design-system-icons";
|
|
25
24
|
import w from "clsx";
|
|
26
25
|
import { Button as O } from "../Button/index.es.js";
|
|
27
26
|
import { Icon as N } from "../Icon/index.es.js";
|
|
28
|
-
import { T as W } from "../../chunks/Text-
|
|
27
|
+
import { T as W } from "../../chunks/Text-b31d1e9a.js";
|
|
29
28
|
import { TransitionGroup as q, CSSTransition as H } from "react-transition-group";
|
|
29
|
+
import "../Loader/index.es.js";
|
|
30
|
+
import "../../chunks/Typography.module-93efb34d.js";
|
|
30
31
|
const J = "lc-Toast-module__toast___j5Amn", Q = "lc-Toast-module__toast__content___HjaNw", D = "lc-Toast-module__toast__actions___JWu-1", F = "lc-Toast-module__toast__actions__button___Iblrl", e = {
|
|
31
32
|
toast: J,
|
|
32
33
|
toast__content: Q,
|
|
@@ -112,7 +113,7 @@ const J = "lc-Toast-module__toast___j5Amn", Q = "lc-Toast-module__toast__content
|
|
|
112
113
|
},
|
|
113
114
|
/* @__PURE__ */ s.createElement(N, { source: h, size: "medium" })
|
|
114
115
|
)));
|
|
115
|
-
}, U = 200, i = "toast-wrapper",
|
|
116
|
+
}, U = 200, i = "toast-wrapper", ot = ({
|
|
116
117
|
className: t,
|
|
117
118
|
toasts: a = [],
|
|
118
119
|
fixed: o = !0,
|
|
@@ -158,5 +159,5 @@ const J = "lc-Toast-module__toast___j5Amn", Q = "lc-Toast-module__toast__content
|
|
|
158
159
|
export {
|
|
159
160
|
U as ANIMATION_TIME,
|
|
160
161
|
S as Toast,
|
|
161
|
-
|
|
162
|
+
ot as ToastWrapper
|
|
162
163
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var R=Object.defineProperty,S=Object.defineProperties;var C=Object.getOwnPropertyDescriptors;var p=Object.getOwnPropertySymbols;var N=Object.prototype.hasOwnProperty,O=Object.prototype.propertyIsEnumerable;var v=(e,t,n)=>t in e?R(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,_=(e,t)=>{for(var n in t||(t={}))N.call(t,n)&&v(e,n,t[n]);if(p)for(var n of p(t))O.call(t,n)&&v(e,n,t[n]);return e},$=(e,t)=>S(e,C(t));var f=(e,t,n)=>(v(e,typeof t!="symbol"?t+"":t,n),n);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const B=require("react"),h=require("clsx"),l=require("../../../../chunks/Tooltip-
|
|
1
|
+
"use strict";var R=Object.defineProperty,S=Object.defineProperties;var C=Object.getOwnPropertyDescriptors;var p=Object.getOwnPropertySymbols;var N=Object.prototype.hasOwnProperty,O=Object.prototype.propertyIsEnumerable;var v=(e,t,n)=>t in e?R(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,_=(e,t)=>{for(var n in t||(t={}))N.call(t,n)&&v(e,n,t[n]);if(p)for(var n of p(t))O.call(t,n)&&v(e,n,t[n]);return e},$=(e,t)=>S(e,C(t));var f=(e,t,n)=>(v(e,typeof t!="symbol"?t+"":t,n),n);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const B=require("react"),h=require("clsx"),l=require("../../../../chunks/Tooltip-8c427780.js");require("@floating-ui/react");require("../../../../chunks/Text-df483689.js");require("../../../../chunks/Typography.module-2558416b.js");function P(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const n in e)if(n!=="default"){const o=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,o.get?o:{enumerable:!0,get:()=>e[n]})}}return t.default=e,Object.freeze(t)}const s=P(B),i="guide-tooltip",q=({gap:e,isVisible:t,slide:n,disablePointerEvents:o})=>{if(!e)return null;const c={top:`${e.top}px`,left:"0",width:`${e.left}px`,height:`${e.height}px`},r={top:`${e.top}px`,left:`${e.right}px`,width:`calc(100% - ${e.right}px)`,height:`${e.height}px`},d={top:"0",left:"0",width:"100%",height:`${e.top}px`},a={top:`${e.bottom}px`,left:"0",width:"100%",height:`calc(100% - ${e.bottom}px)`},u={top:`${e.top}px`,left:`${e.left}px`,width:`${e.width}px`,height:`${e.height}px`,backgroundColor:"transparent"};return s.createElement(s.Fragment,null,s.createElement("div",{className:h({[l.styles[`${i}__overlay`]]:!0,[l.styles[`${i}__overlay--visible`]]:t,[l.styles[`${i}__overlay--slide`]]:n}),style:c}),s.createElement("div",{className:h({[l.styles[`${i}__overlay`]]:!0,[l.styles[`${i}__overlay--visible`]]:t,[l.styles[`${i}__overlay--slide`]]:n}),style:d}),s.createElement("div",{className:h({[l.styles[`${i}__overlay`]]:!0,[l.styles[`${i}__overlay--visible`]]:t,[l.styles[`${i}__overlay--slide`]]:n}),style:r}),s.createElement("div",{className:h({[l.styles[`${i}__overlay`]]:!0,[l.styles[`${i}__overlay--visible`]]:t,[l.styles[`${i}__overlay--slide`]]:n}),style:a}),o&&s.createElement("div",{className:h({[l.styles[`${i}__overlay`]]:!0,[l.styles[`${i}__overlay--visible`]]:t,[l.styles[`${i}__overlay--slide`]]:n}),style:u}))},M=q;class j{constructor(t,n){f(this,"element");f(this,"padding");this.element=t,this.padding=n}addPadding(t){const n=Math.round(t.left)-this.padding,o=Math.round(t.top)-this.padding,c=Math.round(t.width)+2*this.padding,r=Math.round(t.height)+2*this.padding,d=o,a=n,u=d+r,y=a+c;return{x:n,y:o,width:c,height:r,top:d,left:a,bottom:u,right:y}}getBoundingClientRect(){return this.addPadding(this.element.getBoundingClientRect())}get clientWidth(){return this.getBoundingClientRect().width}get clientHeight(){return this.getBoundingClientRect().height}}const E=8,w="guide-tooltip",b=(e,t)=>new j(e,t),L=e=>{const{className:t,parentElementName:n,isVisible:o=!1,shouldSlide:c=!0}=e,[r,d]=s.useState(null),[a,u]=s.useState(null),[y,m]=s.useState(c),g=()=>{r&&(u(b(r,E).getBoundingClientRect()),m(!1))};return s.useEffect(()=>{if(r!==null)return window.addEventListener("resize",g),window.addEventListener("scroll",g),()=>{window.addEventListener("resize",g),window.addEventListener("resize",g)}},[r,n]),s.useEffect(()=>{if(n){const x=document.querySelector(n);d(x)}},[n]),s.useEffect(()=>{r&&u(b(r,E).getBoundingClientRect()),m(!0)},[r]),r&&o?s.createElement("div",null,s.createElement(M,{gap:a,isVisible:o,slide:y,disablePointerEvents:!0}),s.createElement(l.Tooltip,$(_({},e),{referenceElement:{getBoundingClientRect:()=>a,contextElement:r},arrowOffsetY:25,className:h({[l.styles[w]]:!0,[l.styles[`${w}--slide`]]:y,className:t})}),e.children)):null};exports.UserGuide=L;
|