@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
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var p=Object.defineProperty;var c=Object.getOwnPropertySymbols;var l=Object.prototype.hasOwnProperty,u=Object.prototype.propertyIsEnumerable;var o=(e,n,t)=>n in e?p(e,n,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[n]=t,i=(e,n)=>{for(var t in n||(n={}))l.call(n,t)&&o(e,t,n[t]);if(c)for(var t of c(n))u.call(n,t)&&o(e,t,n[t]);return e};var d=(e,n)=>{var t={};for(var r in e)l.call(e,r)&&n.indexOf(r)<0&&(t[r]=e[r]);if(e!=null&&c)for(var r of c(e))n.indexOf(r)<0&&u.call(e,r)&&(t[r]=e[r]);return t};const f=require("react"),y=require("clsx"),s=require("./Typography.module-
|
|
1
|
+
"use strict";var p=Object.defineProperty;var c=Object.getOwnPropertySymbols;var l=Object.prototype.hasOwnProperty,u=Object.prototype.propertyIsEnumerable;var o=(e,n,t)=>n in e?p(e,n,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[n]=t,i=(e,n)=>{for(var t in n||(n={}))l.call(n,t)&&o(e,t,n[t]);if(c)for(var t of c(n))u.call(n,t)&&o(e,t,n[t]);return e};var d=(e,n)=>{var t={};for(var r in e)l.call(e,r)&&n.indexOf(r)<0&&(t[r]=e[r]);if(e!=null&&c)for(var r of c(e))n.indexOf(r)<0&&u.call(e,r)&&(t[r]=e[r]);return t};const f=require("react"),y=require("clsx"),s=require("./Typography.module-2558416b.js");function b(e){const n=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(n,t,r.get?r:{enumerable:!0,get:()=>e[t]})}}return n.default=e,Object.freeze(n)}const _=b(f),O={xl:"h1",lg:"h2",md:"h3",sm:"h4",xs:"h5","2xs":"h6"},E=j=>{var a=j,{as:e,size:n="md",children:t,className:r,uppercase:g,bold:h}=a,m=d(a,["as","size","children","className","uppercase","bold"]);return _.createElement(e||O[n],i({className:y({[s.styles[`heading-${n}`]]:!0,[s.styles["heading-uppercase"]]:g,[s.styles["heading-bold"]]:h},r)},m),t)};exports.Heading=E;
|
|
@@ -2,15 +2,15 @@ var S = Object.defineProperty, R = Object.defineProperties;
|
|
|
2
2
|
var $ = Object.getOwnPropertyDescriptors;
|
|
3
3
|
var a = Object.getOwnPropertySymbols;
|
|
4
4
|
var n = Object.prototype.hasOwnProperty, t = Object.prototype.propertyIsEnumerable;
|
|
5
|
-
var
|
|
5
|
+
var m = (r, s, e) => s in r ? S(r, s, { enumerable: !0, configurable: !0, writable: !0, value: e }) : r[s] = e, p = (r, s) => {
|
|
6
6
|
for (var e in s || (s = {}))
|
|
7
|
-
n.call(s, e) &&
|
|
7
|
+
n.call(s, e) && m(r, e, s[e]);
|
|
8
8
|
if (a)
|
|
9
9
|
for (var e of a(s))
|
|
10
|
-
t.call(s, e) &&
|
|
10
|
+
t.call(s, e) && m(r, e, s[e]);
|
|
11
11
|
return r;
|
|
12
12
|
}, u = (r, s) => R(r, $(s));
|
|
13
|
-
var
|
|
13
|
+
var b = (r, s) => {
|
|
14
14
|
var e = {};
|
|
15
15
|
for (var o in r)
|
|
16
16
|
n.call(r, o) && s.indexOf(o) < 0 && (e[o] = r[o]);
|
|
@@ -19,7 +19,6 @@ var i = (r, s) => {
|
|
|
19
19
|
s.indexOf(o) < 0 && t.call(r, o) && (e[o] = r[o]);
|
|
20
20
|
return e;
|
|
21
21
|
};
|
|
22
|
-
import "../assets/style-ProgressBar.css";
|
|
23
22
|
import * as c from "react";
|
|
24
23
|
import N from "clsx";
|
|
25
24
|
const h = [
|
|
@@ -43,14 +42,14 @@ const _ = {
|
|
|
43
42
|
"progress-bar--normal": "lc-ProgressBar-module__progress-bar--normal___ZwCb-",
|
|
44
43
|
"progress-bar__indicator--success": "lc-ProgressBar-module__progress-bar__indicator--success___wRjR3",
|
|
45
44
|
"progress-bar__indicator--normal": "lc-ProgressBar-module__progress-bar__indicator--normal___0Uhle"
|
|
46
|
-
}, l = "progress-bar",
|
|
47
|
-
(M,
|
|
48
|
-
var
|
|
45
|
+
}, l = "progress-bar", v = c.forwardRef(
|
|
46
|
+
(M, i) => {
|
|
47
|
+
var g = M, {
|
|
49
48
|
status: r = "normal",
|
|
50
49
|
percent: s,
|
|
51
50
|
size: e = "medium",
|
|
52
51
|
className: o = ""
|
|
53
|
-
} =
|
|
52
|
+
} = g, d = b(g, [
|
|
54
53
|
"status",
|
|
55
54
|
"percent",
|
|
56
55
|
"size",
|
|
@@ -66,9 +65,9 @@ const _ = {
|
|
|
66
65
|
);
|
|
67
66
|
return /* @__PURE__ */ c.createElement(
|
|
68
67
|
"div",
|
|
69
|
-
u(p({},
|
|
68
|
+
u(p({}, d), {
|
|
70
69
|
className: f,
|
|
71
|
-
ref:
|
|
70
|
+
ref: i,
|
|
72
71
|
role: "progressbar"
|
|
73
72
|
}),
|
|
74
73
|
/* @__PURE__ */ c.createElement(
|
|
@@ -82,7 +81,7 @@ const _ = {
|
|
|
82
81
|
}
|
|
83
82
|
);
|
|
84
83
|
export {
|
|
85
|
-
|
|
84
|
+
v as P,
|
|
86
85
|
E as a,
|
|
87
86
|
x as g
|
|
88
87
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var R=Object.defineProperty,$=Object.defineProperties;var O=Object.getOwnPropertyDescriptors;var a=Object.getOwnPropertySymbols;var g=Object.prototype.hasOwnProperty,m=Object.prototype.propertyIsEnumerable;var l=(r,e,s)=>e in r?R(r,e,{enumerable:!0,configurable:!0,writable:!0,value:s}):r[e]=s,u=(r,e)=>{for(var s in e||(e={}))g.call(e,s)&&l(r,s,e[s]);if(a)for(var s of a(e))m.call(e,s)&&l(r,s,e[s]);return r},i=(r,e)=>$(r,O(e));var p=(r,e)=>{var s={};for(var o in r)g.call(r,o)&&e.indexOf(o)<0&&(s[o]=r[o]);if(r!=null&&a)for(var o of a(r))e.indexOf(o)<0&&m.call(r,o)&&(s[o]=r[o]);return s};const j=require("react"),w=require("clsx");function y(r){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(r){for(const s in r)if(s!=="default"){const o=Object.getOwnPropertyDescriptor(r,s);Object.defineProperty(e,s,o.get?o:{enumerable:!0,get:()=>r[s]})}}return e.default=r,Object.freeze(e)}const n=y(j),M=["normal","error","success"],h=r=>Math.min(Math.max(r,0),100);function b(r,e=0){return r==="error"?0:h(parseInt(e.toString(),10))}function d(r,e){return!M.includes(r)&&e>=100?"normal":r||"normal"}const t={"progress-bar":"lc-ProgressBar-module__progress-bar___3pa3d","progress-bar--small":"lc-ProgressBar-module__progress-bar--small___7nQKx","progress-bar--medium":"lc-ProgressBar-module__progress-bar--medium___cM44p","progress-bar--large":"lc-ProgressBar-module__progress-bar--large___UlzNR","progress-bar--error":"lc-ProgressBar-module__progress-bar--error___MulqI","progress-bar--success":"lc-ProgressBar-module__progress-bar--success___p7nB-","progress-bar--normal":"lc-ProgressBar-module__progress-bar--normal___ZwCb-","progress-bar__indicator--success":"lc-ProgressBar-module__progress-bar__indicator--success___wRjR3","progress-bar__indicator--normal":"lc-ProgressBar-module__progress-bar__indicator--normal___0Uhle"},c="progress-bar",E=n.forwardRef((q,f)=>{var _=q,{status:r="normal",percent:e,size:s="medium",className:o=""}=_,P=p(_,["status","percent","size","className"]);const B=d(r,e),S=b(B,e),N=w(t[c],{[t[`${c}--${s}`]]:s,[t[`${c}--${r}`]]:r},o);return n.createElement("div",i(u({},P),{className:N,ref:f,role:"progressbar"}),n.createElement("div",{className:t[`${c}__indicator--${r}`],style:{width:`${S}%`}}))});exports.ProgressBar=E;exports.getPercentNumber=b;exports.getProgressStatus=d;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var O=Object.defineProperty;var l=Object.getOwnPropertySymbols;var u=Object.prototype.hasOwnProperty,f=Object.prototype.propertyIsEnumerable;var o=(e,s,t)=>s in e?O(e,s,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[s]=t,i=(e,s)=>{for(var t in s||(s={}))u.call(s,t)&&o(e,t,s[t]);if(l)for(var t of l(s))f.call(s,t)&&o(e,t,s[t]);return e};var p=(e,s)=>{var t={};for(var r in e)u.call(e,r)&&s.indexOf(r)<0&&(t[r]=e[r]);if(e!=null&&l)for(var r of l(e))s.indexOf(r)<0&&f.call(e,r)&&(t[r]=e[r]);return t};const j=require("react"),x=require("clsx"),c=require("./Typography.module-
|
|
1
|
+
"use strict";var O=Object.defineProperty;var l=Object.getOwnPropertySymbols;var u=Object.prototype.hasOwnProperty,f=Object.prototype.propertyIsEnumerable;var o=(e,s,t)=>s in e?O(e,s,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[s]=t,i=(e,s)=>{for(var t in s||(s={}))u.call(s,t)&&o(e,t,s[t]);if(l)for(var t of l(s))f.call(s,t)&&o(e,t,s[t]);return e};var p=(e,s)=>{var t={};for(var r in e)u.call(e,r)&&s.indexOf(r)<0&&(t[r]=e[r]);if(e!=null&&l)for(var r of l(e))s.indexOf(r)<0&&f.call(e,r)&&(t[r]=e[r]);return t};const j=require("react"),x=require("clsx"),c=require("./Typography.module-2558416b.js");function T(e){const s=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(s,t,r.get?r:{enumerable:!0,get:()=>e[t]})}}return s.default=e,Object.freeze(s)}const _=T(j),q=P=>{var n=P,{as:e="p",size:s="md",caps:t=!1,uppercase:r=!1,bold:y=!1,underline:d=!1,strike:b=!1,children:m,className:g}=n,$=p(n,["as","size","caps","uppercase","bold","underline","strike","children","className"]);const a="paragraph";return _.createElement(e,i({className:x({[c.styles[`${a}-${s}`]]:!0,[c.styles[`${a}--bold`]]:y,[c.styles[`${a}--strike`]]:b,[c.styles[`${a}--underline`]]:d,[c.styles[`${a}--uppercase`]]:r||t},g)},$),m)};exports.Text=q;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var at=Object.defineProperty,ut=Object.defineProperties;var dt=Object.getOwnPropertyDescriptors;var S=Object.getOwnPropertySymbols;var mt=Object.prototype.hasOwnProperty,ft=Object.prototype.propertyIsEnumerable;var x=(t,o,e)=>o in t?at(t,o,{enumerable:!0,configurable:!0,writable:!0,value:e}):t[o]=e,n=(t,o)=>{for(var e in o||(o={}))mt.call(o,e)&&x(t,e,o[e]);if(S)for(var e of S(o))ft.call(o,e)&&x(t,e,o[e]);return t},g=(t,o)=>ut(t,dt(o));const gt=require("react"),l=require("@floating-ui/react"),Tt=require("clsx"),yt=require("./Text-df483689.js");function vt(t){const o=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const e in t)if(e!=="default"){const _=Object.getOwnPropertyDescriptor(t,e);Object.defineProperty(o,e,_.get?_:{enumerable:!0,get:()=>t[e]})}}return o.default=t,Object.freeze(o)}const s=vt(gt);function ht(t){switch(t){case"invert":return"inverted";default:return"primary"}}function wt(t,o,e,_){if(e)return{top:t?e+t:e};if(_)return{left:o?_+o:_}}const bt="lc-Tooltip-module__tooltip___QOOAr",Pt="lc-Tooltip-module__tooltip__arrow___Ov1YW",St="lc-Tooltip-module__tooltip__interactive___0JawB",c={tooltip:bt,tooltip__arrow:Pt,"tooltip--invert":"lc-Tooltip-module__tooltip--invert___PVjhE","tooltip--important":"lc-Tooltip-module__tooltip--important___X-IMK",tooltip__interactive:St,"tooltip__user-guide-step":"lc-Tooltip-module__tooltip__user-guide-step___evexI","tooltip--full-space":"lc-Tooltip-module__tooltip--full-space___wmbaw","tooltip-header":"lc-Tooltip-module__tooltip-header___QV0Vd","tooltip-header--info":"lc-Tooltip-module__tooltip-header--info___zLJ2Z","tooltip-image-container":"lc-Tooltip-module__tooltip-image-container___ySmcd","tooltip-image":"lc-Tooltip-module__tooltip-image___Aorwg","tooltip-text--info":"lc-Tooltip-module__tooltip-text--info___3d2Ql","tooltip-close":"lc-Tooltip-module__tooltip-close___3r3h9","tooltip-step":"lc-Tooltip-module__tooltip-step___-j0n8","tooltip-footer":"lc-Tooltip-module__tooltip-footer___9hxFq","tooltip-footer-secondary":"lc-Tooltip-module__tooltip-footer-secondary___WBgVR","tooltip-footer-secondary-invert":"lc-Tooltip-module__tooltip-footer-secondary-invert___PuAQL","tooltip-footer--interactive":"lc-Tooltip-module__tooltip-footer--interactive___hqMM5","tooltip-footer--user-guide-step":"lc-Tooltip-module__tooltip-footer--user-guide-step___i7z3S","guide-tooltip--slide":"lc-Tooltip-module__guide-tooltip--slide___Uawm2","guide-tooltip__overlay":"lc-Tooltip-module__guide-tooltip__overlay___IyrKK","guide-tooltip__overlay--slide":"lc-Tooltip-module__guide-tooltip__overlay--slide___VW8oq","guide-tooltip__overlay--visible":"lc-Tooltip-module__guide-tooltip__overlay--visible___dbdsZ","reports-tooltip":"lc-Tooltip-module__reports-tooltip___amyTo","reports-tooltip__heading":"lc-Tooltip-module__reports-tooltip__heading___FtjvD","reports-tooltip__heading__title":"lc-Tooltip-module__reports-tooltip__heading__title___6TlzE","reports-tooltip__heading__description":"lc-Tooltip-module__reports-tooltip__heading__description___eOQnc","reports-tooltip__content":"lc-Tooltip-module__reports-tooltip__content___jxis9"},a="tooltip",xt=({children:t,className:o,triggerClassName:e,triggerRenderer:_,theme:u,kind:j,placement:F="bottom",isVisible:T,fullSpaceContent:M,onClose:d,onOpen:m,withFadeAnimation:R=!0,transitionDuration:q=200,hoverOnDuration:D,hoverOffDuration:E,transitionDelay:A=0,hoverOnDelay:I,hoverOffDelay:V,triggerOnClick:N=!1,offsetMainAxis:Q=8,referenceElement:f,activationThreshold:z=0,useDismissHookProps:$,useClickHookProps:k,hoverOutDelayTimeout:C=100,arrowOffsetY:K,arrowOffsetX:W,closeOnTriggerBlur:B=!1,floatingStrategy:J})=>{const y=T!==void 0,[L,O]=s.useState(!1),v=s.useRef(null),h=y?T:L,w=j||u,U=Tt(c[a],o,w&&c[`${a}--${w}`],M&&c[`${a}--full-space`]),Z=typeof _=="function",H=i=>{i!==h&&(i?m==null||m():d==null||d(),!y&&O(i))},b=i=>R?i!=null?i:q:0,P=i=>i!=null?i:A,{floatingStyles:X,refs:p,context:r,middlewareData:{arrow:{x:Y,y:G}={}},placement:tt}=l.useFloating({middleware:[l.offset({mainAxis:Q}),l.shift(),l.flip(),l.arrow({element:v})],placement:F,open:h,strategy:J,onOpenChange:H,whileElementsMounted:l.autoUpdate}),ot=l.useHover(r,{move:!1,restMs:z,delay:{open:P(I),close:P(V||C)},enabled:!N,handleClose:B?null:l.safePolygon()}),et=l.useFocus(r),lt=l.useDismiss(r,$),it=l.useRole(r,{role:"tooltip"}),_t=l.useClick(r,k),{isMounted:st,styles:rt}=l.useTransitionStyles(r,{duration:{open:b(D),close:b(E)}}),{status:nt}=l.useTransitionStatus(r),{getReferenceProps:ct,getFloatingProps:pt}=l.useInteractions([ot,et,lt,it,_t]);return s.useEffect(()=>{f&&p.setReference(f)},[p.setReference,f]),s.createElement(s.Fragment,null,s.createElement("div",g(n({ref:p.setReference},ct()),{className:e}),Z?_():_),st&&s.createElement("div",g(n({ref:p.setFloating,style:n(n({},X),rt),className:U},pt()),{"data-status":nt}),s.createElement(yt.Text,{as:"div"},t),s.createElement("div",{ref:v,className:c[`${a}__arrow`],"aria-placement":tt,style:n({},wt(K,W,G,Y))})))};exports.Tooltip=xt;exports.getIconType=ht;exports.styles=c;
|
|
@@ -10,12 +10,11 @@ var S = (t, o, e) => o in t ? ao(t, o, { enumerable: !0, configurable: !0, writa
|
|
|
10
10
|
fo.call(o, e) && S(t, e, o[e]);
|
|
11
11
|
return t;
|
|
12
12
|
}, f = (t, o) => co(t, uo(o));
|
|
13
|
-
import "../assets/style-Tooltip.css";
|
|
14
13
|
import * as i from "react";
|
|
15
14
|
import { useFloating as To, offset as go, shift as yo, flip as vo, arrow as ho, autoUpdate as wo, useHover as xo, safePolygon as Po, useFocus as So, useDismiss as bo, useRole as Fo, useClick as Eo, useTransitionStyles as Mo, useTransitionStatus as Ro, useInteractions as Ao } from "@floating-ui/react";
|
|
16
15
|
import Vo from "clsx";
|
|
17
|
-
import { T as Do } from "./Text-
|
|
18
|
-
function
|
|
16
|
+
import { T as Do } from "./Text-b31d1e9a.js";
|
|
17
|
+
function Ko(t) {
|
|
19
18
|
switch (t) {
|
|
20
19
|
case "invert":
|
|
21
20
|
return "inverted";
|
|
@@ -62,7 +61,7 @@ const Qo = "lc-Tooltip-module__tooltip___QOOAr", jo = "lc-Tooltip-module__toolti
|
|
|
62
61
|
"reports-tooltip__heading__title": "lc-Tooltip-module__reports-tooltip__heading__title___6TlzE",
|
|
63
62
|
"reports-tooltip__heading__description": "lc-Tooltip-module__reports-tooltip__heading__description___eOQnc",
|
|
64
63
|
"reports-tooltip__content": "lc-Tooltip-module__reports-tooltip__content___jxis9"
|
|
65
|
-
}, a = "tooltip",
|
|
64
|
+
}, a = "tooltip", Wo = ({
|
|
66
65
|
children: t,
|
|
67
66
|
className: o,
|
|
68
67
|
triggerClassName: e,
|
|
@@ -176,7 +175,7 @@ const Qo = "lc-Tooltip-module__tooltip___QOOAr", jo = "lc-Tooltip-module__toolti
|
|
|
176
175
|
));
|
|
177
176
|
};
|
|
178
177
|
export {
|
|
179
|
-
|
|
180
|
-
|
|
178
|
+
Wo as T,
|
|
179
|
+
Ko as g,
|
|
181
180
|
n as s
|
|
182
181
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const _={"heading-xl":"lc-Typography-module__heading-xl___nhr-6","heading-lg":"lc-Typography-module__heading-lg___XYF7l","heading-md":"lc-Typography-module__heading-md___wHOIs","heading-sm":"lc-Typography-module__heading-sm___nBmTV","heading-xs":"lc-Typography-module__heading-xs___VcZBs","heading-2xs":"lc-Typography-module__heading-2xs___tcrVl","heading-uppercase":"lc-Typography-module__heading-uppercase___cpixD","heading-bold":"lc-Typography-module__heading-bold___ZAPzP","paragraph-md":"lc-Typography-module__paragraph-md___UGoqq","paragraph-sm":"lc-Typography-module__paragraph-sm___QIEFL","paragraph-xs":"lc-Typography-module__paragraph-xs___OUooD","paragraph--bold":"lc-Typography-module__paragraph--bold___9I2wL","paragraph--underline":"lc-Typography-module__paragraph--underline___yFDzp","paragraph--strike":"lc-Typography-module__paragraph--strike___ZDWOj","paragraph--uppercase":"lc-Typography-module__paragraph--uppercase___hdEfX","display-md":"lc-Typography-module__display-md___7eFCF","display-sm":"lc-Typography-module__display-sm___kfNES","display-max":"lc-Typography-module__display-max___vR8yn"};exports.styles=_;
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
const a = {
|
|
1
|
+
const _ = {
|
|
3
2
|
"heading-xl": "lc-Typography-module__heading-xl___nhr-6",
|
|
4
3
|
"heading-lg": "lc-Typography-module__heading-lg___XYF7l",
|
|
5
4
|
"heading-md": "lc-Typography-module__heading-md___wHOIs",
|
|
@@ -20,5 +19,5 @@ const a = {
|
|
|
20
19
|
"display-max": "lc-Typography-module__display-max___vR8yn"
|
|
21
20
|
};
|
|
22
21
|
export {
|
|
23
|
-
|
|
22
|
+
_ as s
|
|
24
23
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var
|
|
1
|
+
"use strict";var M=Object.defineProperty;var y=Object.getOwnPropertySymbols;var O=Object.prototype.hasOwnProperty,S=Object.prototype.propertyIsEnumerable;var B=(e,t,n)=>t in e?M(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,w=(e,t)=>{for(var n in t||(t={}))O.call(t,n)&&B(e,n,t[n]);if(y)for(var n of y(t))S.call(t,n)&&B(e,n,t[n]);return e};Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const x=require("react"),h=require("@livechat/design-system-icons"),b=require("clsx"),E=require("../ActionMenu/index.cjs.js"),A=require("../Button/index.cjs.js"),P=require("../Icon/index.cjs.js"),T=require("../../chunks/Tooltip-8c427780.js");require("@floating-ui/react");require("../../chunks/keyCodes-c4c35e49.js");require("../../chunks/Text-df483689.js");require("../../chunks/Typography.module-2558416b.js");require("../Loader/index.cjs.js");function j(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 r=j(x),_={"action-bar":"lc-ActionBar-module__action-bar___TJitF","action-bar__items":"lc-ActionBar-module__action-bar__items___uhoQA","action-bar__items--scroll":"lc-ActionBar-module__action-bar__items--scroll___f--dN","action-bar__items__button":"lc-ActionBar-module__action-bar__items__button___Vdjl7","action-bar__items__button--active":"lc-ActionBar-module__action-bar__items__button--active___PFLdm","action-bar__items__button--hidden":"lc-ActionBar-module__action-bar__items__button--hidden___C00VA","action-bar__items__tooltip":"lc-ActionBar-module__action-bar__items__tooltip___BuQPo","action-bar__menu-wrapper":"lc-ActionBar-module__action-bar__menu-wrapper___OMWP5","action-bar__menu-wrapper__button":"lc-ActionBar-module__action-bar__menu-wrapper__button___MDsLx","action-bar__menu-wrapper__button__with-item":"lc-ActionBar-module__action-bar__menu-wrapper__button__with-item___FYlqL","fade-in":"lc-ActionBar-module__fade-in___tQvzD","action-bar__menu-wrapper__button--active":"lc-ActionBar-module__action-bar__menu-wrapper__button--active___Hlzoc","action-bar__menu-wrapper__trigger-vertical":"lc-ActionBar-module__action-bar__menu-wrapper__trigger-vertical___84WL1","action-bar--vertical":"lc-ActionBar-module__action-bar--vertical___tMzLJ"},g="action-bar__items",D=({option:e,menuItemsKeys:t,activeOptionKey:n,vertical:o})=>{const d=b(_[`${g}__button`],{[_[`${g}__button--hidden`]]:t.includes(e.key),[_[`${g}__button--active`]]:e.key===n});if(e.showTooltip){const l=t.includes(e.key)&&{isVisible:!1};return r.createElement(T.Tooltip,w({kind:"invert",placement:o?"left":"bottom",triggerClassName:_[`${g}__tooltip`],triggerRenderer:()=>r.createElement(A.Button,{id:e.key,key:e.key,title:e.label,kind:"plain",className:d,onClick:e.onClick,icon:e.element})},l),r.createElement("div",null,e.label))}return r.createElement(A.Button,{id:e.key,key:e.key,title:e.label,kind:"plain",className:d,onClick:e.onClick,icon:e.element})},m="action-bar",L=({className:e,id:t="action-bar-area",type:n="menu",options:o,activeOptionKey:d,vertical:l})=>{const[s,v]=r.useState([]),f=n==="scroll",C=b(_[m],e,l&&_[`${m}--vertical`]),p=`${m}__menu-wrapper`,$={root:document.querySelector(`${t}`),threshold:1},q=!f&&s.length!==0,N=a=>{a.map(c=>{const i=s.includes(c.target.id);if(!c.isIntersecting){c.target.setAttribute("tabindex","-1"),i||v(u=>[...u,c.target.id]);return}c.target.removeAttribute("tabindex"),i&&v(s.filter(u=>u!==c.target.id))})};r.useEffect(()=>{const a=!!window.IntersectionObserver;if(!f&&a){const c=document.querySelectorAll(`.${_[`${m}__items__button`]}`),i=new IntersectionObserver(N,$);return c.forEach(u=>i.observe(u)),()=>i.disconnect()}},[s,f]);const I=a=>o.filter(i=>a.find(u=>u===i.key)).map(i=>({key:i.key,element:r.createElement(E.ActionMenuItem,{leftNode:i.element},i.label),onClick:i.onClick})),k=o.filter(a=>s.find(c=>c===a.key)).find(a=>a.key===d);return r.createElement("div",{id:t,className:C},r.createElement("div",{className:b(_[`${m}__items`],{[_[`${m}__items--scroll`]]:f})},o.map(a=>r.createElement(D,{option:a,menuItemsKeys:s,activeOptionKey:d,vertical:l}))),q&&r.createElement("div",{className:_[p]},r.createElement(E.ActionMenu,{placement:l?"left-end":"bottom-end",options:I(s),triggerClassName:b(l&&_[`${p}__trigger-vertical`]),triggerRenderer:r.createElement(A.Button,{className:b(_[`${p}__button`],k&&_[`${p}__button--active`]),kind:"plain",icon:r.createElement(P.Icon,{source:l?h.ChevronLeft:h.ChevronDown,kind:"primary"}),iconPosition:"right"},k&&r.createElement("div",{className:b(_[`${p}__button__with-item`])},k.element))})))};exports.ActionBar=L;
|
|
@@ -1,23 +1,27 @@
|
|
|
1
1
|
var I = Object.defineProperty;
|
|
2
2
|
var w = Object.getOwnPropertySymbols;
|
|
3
3
|
var M = Object.prototype.hasOwnProperty, x = Object.prototype.propertyIsEnumerable;
|
|
4
|
-
var B = (e, t,
|
|
5
|
-
for (var
|
|
6
|
-
M.call(t,
|
|
4
|
+
var B = (e, t, n) => t in e ? I(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n, h = (e, t) => {
|
|
5
|
+
for (var n in t || (t = {}))
|
|
6
|
+
M.call(t, n) && B(e, n, t[n]);
|
|
7
7
|
if (w)
|
|
8
|
-
for (var
|
|
9
|
-
x.call(t,
|
|
8
|
+
for (var n of w(t))
|
|
9
|
+
x.call(t, n) && B(e, n, t[n]);
|
|
10
10
|
return e;
|
|
11
11
|
};
|
|
12
|
-
import "
|
|
13
|
-
import * as n from "react";
|
|
12
|
+
import * as r from "react";
|
|
14
13
|
import { ChevronLeft as L, ChevronDown as O } from "@livechat/design-system-icons";
|
|
15
14
|
import u from "clsx";
|
|
16
15
|
import { ActionMenu as S, ActionMenuItem as T } from "../ActionMenu/index.es.js";
|
|
17
16
|
import { Button as A } from "../Button/index.es.js";
|
|
18
17
|
import { Icon as D } from "../Icon/index.es.js";
|
|
19
|
-
import { T as P } from "../../chunks/Tooltip-
|
|
20
|
-
|
|
18
|
+
import { T as P } from "../../chunks/Tooltip-f6f4f9c2.js";
|
|
19
|
+
import "@floating-ui/react";
|
|
20
|
+
import "../../chunks/keyCodes-30323e90.js";
|
|
21
|
+
import "../../chunks/Text-b31d1e9a.js";
|
|
22
|
+
import "../../chunks/Typography.module-93efb34d.js";
|
|
23
|
+
import "../Loader/index.es.js";
|
|
24
|
+
const _ = {
|
|
21
25
|
"action-bar": "lc-ActionBar-module__action-bar___TJitF",
|
|
22
26
|
"action-bar__items": "lc-ActionBar-module__action-bar__items___uhoQA",
|
|
23
27
|
"action-bar__items--scroll": "lc-ActionBar-module__action-bar__items--scroll___f--dN",
|
|
@@ -35,26 +39,26 @@ const r = {
|
|
|
35
39
|
}, g = "action-bar__items", V = ({
|
|
36
40
|
option: e,
|
|
37
41
|
menuItemsKeys: t,
|
|
38
|
-
activeOptionKey:
|
|
42
|
+
activeOptionKey: n,
|
|
39
43
|
vertical: b
|
|
40
44
|
}) => {
|
|
41
|
-
const d = u(
|
|
42
|
-
[
|
|
45
|
+
const d = u(_[`${g}__button`], {
|
|
46
|
+
[_[`${g}__button--hidden`]]: t.includes(
|
|
43
47
|
e.key
|
|
44
48
|
),
|
|
45
|
-
[
|
|
49
|
+
[_[`${g}__button--active`]]: e.key === n
|
|
46
50
|
});
|
|
47
51
|
if (e.showTooltip) {
|
|
48
52
|
const c = t.includes(e.key) && {
|
|
49
53
|
isVisible: !1
|
|
50
54
|
};
|
|
51
|
-
return /* @__PURE__ */
|
|
55
|
+
return /* @__PURE__ */ r.createElement(
|
|
52
56
|
P,
|
|
53
57
|
h({
|
|
54
58
|
kind: "invert",
|
|
55
59
|
placement: b ? "left" : "bottom",
|
|
56
|
-
triggerClassName:
|
|
57
|
-
triggerRenderer: () => /* @__PURE__ */
|
|
60
|
+
triggerClassName: _[`${g}__tooltip`],
|
|
61
|
+
triggerRenderer: () => /* @__PURE__ */ r.createElement(
|
|
58
62
|
A,
|
|
59
63
|
{
|
|
60
64
|
id: e.key,
|
|
@@ -67,10 +71,10 @@ const r = {
|
|
|
67
71
|
}
|
|
68
72
|
)
|
|
69
73
|
}, c),
|
|
70
|
-
/* @__PURE__ */
|
|
74
|
+
/* @__PURE__ */ r.createElement("div", null, e.label)
|
|
71
75
|
);
|
|
72
76
|
}
|
|
73
|
-
return /* @__PURE__ */
|
|
77
|
+
return /* @__PURE__ */ r.createElement(
|
|
74
78
|
A,
|
|
75
79
|
{
|
|
76
80
|
id: e.key,
|
|
@@ -82,18 +86,18 @@ const r = {
|
|
|
82
86
|
icon: e.element
|
|
83
87
|
}
|
|
84
88
|
);
|
|
85
|
-
}, m = "action-bar",
|
|
89
|
+
}, m = "action-bar", U = ({
|
|
86
90
|
className: e,
|
|
87
91
|
id: t = "action-bar-area",
|
|
88
|
-
type:
|
|
92
|
+
type: n = "menu",
|
|
89
93
|
options: b,
|
|
90
94
|
activeOptionKey: d,
|
|
91
95
|
vertical: c
|
|
92
96
|
}) => {
|
|
93
|
-
const [l, v] =
|
|
94
|
-
|
|
97
|
+
const [l, v] = r.useState([]), f = n === "scroll", y = u(
|
|
98
|
+
_[m],
|
|
95
99
|
e,
|
|
96
|
-
c &&
|
|
100
|
+
c && _[`${m}--vertical`]
|
|
97
101
|
), p = `${m}__menu-wrapper`, E = {
|
|
98
102
|
root: document.querySelector(`${t}`),
|
|
99
103
|
threshold: 1
|
|
@@ -110,11 +114,11 @@ const r = {
|
|
|
110
114
|
o.target.removeAttribute("tabindex"), a && v(l.filter((s) => s !== o.target.id));
|
|
111
115
|
});
|
|
112
116
|
};
|
|
113
|
-
|
|
117
|
+
r.useEffect(() => {
|
|
114
118
|
const i = !!window.IntersectionObserver;
|
|
115
119
|
if (!f && i) {
|
|
116
120
|
const o = document.querySelectorAll(
|
|
117
|
-
`.${
|
|
121
|
+
`.${_[`${m}__items__button`]}`
|
|
118
122
|
), a = new IntersectionObserver(
|
|
119
123
|
$,
|
|
120
124
|
E
|
|
@@ -126,17 +130,17 @@ const r = {
|
|
|
126
130
|
(a) => i.find((s) => s === a.key)
|
|
127
131
|
).map((a) => ({
|
|
128
132
|
key: a.key,
|
|
129
|
-
element: /* @__PURE__ */
|
|
133
|
+
element: /* @__PURE__ */ r.createElement(T, { leftNode: a.element }, a.label),
|
|
130
134
|
onClick: a.onClick
|
|
131
135
|
})), k = b.filter((i) => l.find((o) => o === i.key)).find((i) => i.key === d);
|
|
132
|
-
return /* @__PURE__ */
|
|
136
|
+
return /* @__PURE__ */ r.createElement("div", { id: t, className: y }, /* @__PURE__ */ r.createElement(
|
|
133
137
|
"div",
|
|
134
138
|
{
|
|
135
|
-
className: u(
|
|
136
|
-
[
|
|
139
|
+
className: u(_[`${m}__items`], {
|
|
140
|
+
[_[`${m}__items--scroll`]]: f
|
|
137
141
|
})
|
|
138
142
|
},
|
|
139
|
-
b.map((i) => /* @__PURE__ */
|
|
143
|
+
b.map((i) => /* @__PURE__ */ r.createElement(
|
|
140
144
|
V,
|
|
141
145
|
{
|
|
142
146
|
option: i,
|
|
@@ -145,23 +149,23 @@ const r = {
|
|
|
145
149
|
vertical: c
|
|
146
150
|
}
|
|
147
151
|
))
|
|
148
|
-
), C && /* @__PURE__ */
|
|
152
|
+
), C && /* @__PURE__ */ r.createElement("div", { className: _[p] }, /* @__PURE__ */ r.createElement(
|
|
149
153
|
S,
|
|
150
154
|
{
|
|
151
155
|
placement: c ? "left-end" : "bottom-end",
|
|
152
156
|
options: N(l),
|
|
153
157
|
triggerClassName: u(
|
|
154
|
-
c &&
|
|
158
|
+
c && _[`${p}__trigger-vertical`]
|
|
155
159
|
),
|
|
156
|
-
triggerRenderer: /* @__PURE__ */
|
|
160
|
+
triggerRenderer: /* @__PURE__ */ r.createElement(
|
|
157
161
|
A,
|
|
158
162
|
{
|
|
159
163
|
className: u(
|
|
160
|
-
|
|
161
|
-
k &&
|
|
164
|
+
_[`${p}__button`],
|
|
165
|
+
k && _[`${p}__button--active`]
|
|
162
166
|
),
|
|
163
167
|
kind: "plain",
|
|
164
|
-
icon: /* @__PURE__ */
|
|
168
|
+
icon: /* @__PURE__ */ r.createElement(
|
|
165
169
|
D,
|
|
166
170
|
{
|
|
167
171
|
source: c ? L : O,
|
|
@@ -170,11 +174,11 @@ const r = {
|
|
|
170
174
|
),
|
|
171
175
|
iconPosition: "right"
|
|
172
176
|
},
|
|
173
|
-
k && /* @__PURE__ */
|
|
177
|
+
k && /* @__PURE__ */ r.createElement(
|
|
174
178
|
"div",
|
|
175
179
|
{
|
|
176
180
|
className: u(
|
|
177
|
-
|
|
181
|
+
_[`${p}__button__with-item`]
|
|
178
182
|
)
|
|
179
183
|
},
|
|
180
184
|
k.element
|
|
@@ -184,5 +188,5 @@ const r = {
|
|
|
184
188
|
)));
|
|
185
189
|
};
|
|
186
190
|
export {
|
|
187
|
-
|
|
191
|
+
U as ActionBar
|
|
188
192
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var _e=Object.defineProperty,ce=Object.defineProperties;var re=Object.getOwnPropertyDescriptors;var k=Object.getOwnPropertySymbols;var j=Object.prototype.hasOwnProperty,p=Object.prototype.propertyIsEnumerable;var V=(t,i,n)=>i in t?_e(t,i,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[i]=n,f=(t,i)=>{for(var n in i||(i={}))j.call(i,n)&&V(t,n,i[n]);if(k)for(var n of k(i))p.call(i,n)&&V(t,n,i[n]);return t},
|
|
1
|
+
"use strict";var _e=Object.defineProperty,ce=Object.defineProperties;var re=Object.getOwnPropertyDescriptors;var k=Object.getOwnPropertySymbols;var j=Object.prototype.hasOwnProperty,p=Object.prototype.propertyIsEnumerable;var V=(t,i,n)=>i in t?_e(t,i,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[i]=n,f=(t,i)=>{for(var n in i||(i={}))j.call(i,n)&&V(t,n,i[n]);if(k)for(var n of k(i))p.call(i,n)&&V(t,n,i[n]);return t},D=(t,i)=>ce(t,re(i));var H=(t,i)=>{var n={};for(var c in t)j.call(t,c)&&i.indexOf(c)<0&&(n[c]=t[c]);if(t!=null&&k)for(var c of k(t))i.indexOf(c)<0&&p.call(t,c)&&(n[c]=t[c]);return n};Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const ae=require("react"),l=require("@floating-ui/react"),le=require("@livechat/design-system-icons"),N=require("clsx"),K=require("../../chunks/keyCodes-c4c35e49.js"),ue=require("../Icon/index.cjs.js"),oe=require("../../chunks/Text-df483689.js");require("../../chunks/Typography.module-2558416b.js");function se(t){const i=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const n in t)if(n!=="default"){const c=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(i,n,c.get?c:{enumerable:!0,get:()=>t[n]})}}return i.default=t,Object.freeze(i)}const _=se(ae),u={"action-menu":"lc-ActionMenu-module__action-menu___K2UwW","action-menu__trigger-button":"lc-ActionMenu-module__action-menu__trigger-button___tBrz5","action-menu__list":"lc-ActionMenu-module__action-menu__list___9pNUX","action-menu__list__group-header":"lc-ActionMenu-module__action-menu__list__group-header___n-DTq","action-menu__list__item":"lc-ActionMenu-module__action-menu__list__item___n-OgH","action-menu__list__item--with-divider":"lc-ActionMenu-module__action-menu__list__item--with-divider___2H3Vm","action-menu__list__item--disabled":"lc-ActionMenu-module__action-menu__list__item--disabled___MgaX8","action-menu__list__item--selected":"lc-ActionMenu-module__action-menu__list__item--selected___eevlJ","action-menu__list__item__icon":"lc-ActionMenu-module__action-menu__list__item__icon___o3ePo"},o="action-menu",me=ge=>{var R=ge,{className:t,triggerClassName:i,options:n,triggerRenderer:c,placement:L="bottom-end",openedOnInit:U=!1,keepOpenOnClick:F,flipOptions:J,visible:x,onClose:m,onOpen:E,floatingStrategy:z,selectedOptions:d}=R,X=H(R,["className","triggerClassName","options","triggerRenderer","placement","openedOnInit","keepOpenOnClick","flipOptions","visible","onClose","onOpen","floatingStrategy","selectedOptions"]);const v=x!==void 0,[Y,A]=_.useState(U),s=_.useRef(-1),S=_.useRef(null),g=v?x:Y,B=()=>{g?(m==null||m(),!v&&A(!1)):(E==null||E(),!v&&A(!0))},{x:I,y:$,strategy:W,refs:T,context:w}=l.useFloating({middleware:[l.offset(4),l.flip(J)],placement:L,open:g,strategy:z,onOpenChange:B,whileElementsMounted:l.autoUpdate}),C=l.useClick(w),G=l.useDismiss(w,{enabled:g}),Q=l.useRole(w),{getReferenceProps:Z,getFloatingProps:O}=l.useInteractions([C,G,Q]),{styles:ee}=l.useTransitionStyles(w,{initial:({side:e})=>f({opacity:0},e==="bottom"&&{marginTop:-10}||e==="top"&&{marginTop:10}||e==="left"&&{marginLeft:10}||e==="right"&&{marginLeft:-10})}),te=e=>{var y,b;const r=s.current;let a=r+e;for(;(y=n[a])!=null&&y.disabled||(b=n[a])!=null&&b.groupHeader;)if(a+=e,a===-1){a=r;break}return a},P=e=>{var y,b;s.current=te(e);const r=(y=S.current)==null?void 0:y.children,a=r&&((b=r[s.current])==null?void 0:b.children[0]);return a==null?void 0:a.focus()},q=e=>{e.key===K.KeyCodes.arrowUp&&s.current>0&&(e.preventDefault(),P(-1)),e.key===K.KeyCodes.arrowDown&&s.current+1<n.length&&(e.preventDefault(),P(1))};_.useEffect(()=>{if(g)return document.addEventListener("keydown",q),()=>document.removeEventListener("keydown",q);s.current=-1},[g,q]);const ne=(e,r)=>{s.current=e,r==null||r(),!v&&!F&&(A(!1),m==null||m())},ie=(e,r)=>e.groupHeader?_.createElement("li",{key:e.key,role:"none",className:u[`${o}__list__group-header`]},e.element):_.createElement("li",{key:e.key,role:"none"},_.createElement("button",{"data-testid":e.key,tabIndex:-1,key:e.key,disabled:e.disabled,onClick:()=>ne(r,e.onClick),role:"menuitem",className:N(u[`${o}__list__item`],{[u[`${o}__list__item--disabled`]]:e.disabled,[u[`${o}__list__item--with-divider`]]:e.withDivider,[u[`${o}__list__item--selected`]]:d==null?void 0:d.includes(e.key)})},e.element,(d==null?void 0:d.includes(e.key))&&_.createElement("div",{className:u[`${o}__list__item__icon`]},_.createElement(ue.Icon,{source:le.Check,kind:"action-primary"}))));return _.createElement(_.Fragment,null,_.createElement("div",D(f({"aria-label":"Toggle menu","data-testid":"action-menu-trigger-button",ref:T.setReference},Z()),{className:i}),c),g&&_.createElement("div",f({ref:T.setFloating,className:u[o],style:f({position:W,top:$!=null?$:"",left:I!=null?I:""},ee)},O()),_.createElement("ul",D(f({},X),{className:N(u[`${o}__list`],t),role:"menu",ref:S}),n.map(ie))))},M={"action-menu-item":"lc-ActionMenuItem-module__action-menu-item___cT70J","action-menu-item__left-node":"lc-ActionMenuItem-module__action-menu-item__left-node___3R-o1","action-menu-item__right-node":"lc-ActionMenuItem-module__action-menu-item__right-node___uq0Ym","action-menu-item__label":"lc-ActionMenuItem-module__action-menu-item__label___OgJ80","action-menu-item--warning":"lc-ActionMenuItem-module__action-menu-item--warning___DgeYg"},h="action-menu-item",de=({leftNode:t,rightNode:i,children:n,kind:c})=>_.createElement("div",{className:N(M[h],{[M[`${h}--warning`]]:c==="warning"})},t&&_.createElement("div",{className:M[`${h}__left-node`]},t),_.createElement(oe.Text,{as:"div",className:M[`${h}__label`]},n),i&&_.createElement("div",{className:M[`${h}__right-node`]},i));exports.ActionMenu=me;exports.ActionMenuItem=de;
|
|
@@ -19,14 +19,14 @@ var S = (t, _) => {
|
|
|
19
19
|
_.indexOf(a) < 0 && L.call(t, a) && (n[a] = t[a]);
|
|
20
20
|
return n;
|
|
21
21
|
};
|
|
22
|
-
import "../../assets/style-index38.css";
|
|
23
22
|
import * as i from "react";
|
|
24
23
|
import { useFloating as ce, offset as le, flip as me, autoUpdate as re, useClick as ue, useDismiss as oe, useRole as se, useInteractions as de, useTransitionStyles as ge } from "@floating-ui/react";
|
|
25
24
|
import { Check as fe } from "@livechat/design-system-icons";
|
|
26
25
|
import x from "clsx";
|
|
27
26
|
import { K as U } from "../../chunks/keyCodes-30323e90.js";
|
|
28
27
|
import { Icon as ye } from "../Icon/index.es.js";
|
|
29
|
-
import { T as be } from "../../chunks/Text-
|
|
28
|
+
import { T as be } from "../../chunks/Text-b31d1e9a.js";
|
|
29
|
+
import "../../chunks/Typography.module-93efb34d.js";
|
|
30
30
|
const m = {
|
|
31
31
|
"action-menu": "lc-ActionMenu-module__action-menu___K2UwW",
|
|
32
32
|
"action-menu__trigger-button": "lc-ActionMenu-module__action-menu__trigger-button___tBrz5",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var h=Object.defineProperty,z=Object.defineProperties;var I=Object.getOwnPropertyDescriptors;var s=Object.getOwnPropertySymbols;var b=Object.prototype.hasOwnProperty,E=Object.prototype.propertyIsEnumerable;var A=(e,_,t)=>_ in e?h(e,_,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[_]=t,m=(e,_)=>{for(var t in _||(_={}))b.call(_,t)&&A(e,t,_[t]);if(s)for(var t of s(_))E.call(_,t)&&A(e,t,_[t]);return e},C=(e,_)=>z(e,I(_));var $=(e,_)=>{var t={};for(var r in e)b.call(e,r)&&_.indexOf(r)<0&&(t[r]=e[r]);if(e!=null&&s)for(var r of s(e))_.indexOf(r)<0&&E.call(e,r)&&(t[r]=e[r]);return t};
|
|
1
|
+
"use strict";var h=Object.defineProperty,z=Object.defineProperties;var I=Object.getOwnPropertyDescriptors;var s=Object.getOwnPropertySymbols;var b=Object.prototype.hasOwnProperty,E=Object.prototype.propertyIsEnumerable;var A=(e,_,t)=>_ in e?h(e,_,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[_]=t,m=(e,_)=>{for(var t in _||(_={}))b.call(_,t)&&A(e,t,_[t]);if(s)for(var t of s(_))E.call(_,t)&&A(e,t,_[t]);return e},C=(e,_)=>z(e,I(_));var $=(e,_)=>{var t={};for(var r in e)b.call(e,r)&&_.indexOf(r)<0&&(t[r]=e[r]);if(e!=null&&s)for(var r of s(e))_.indexOf(r)<0&&E.call(e,r)&&(t[r]=e[r]);return t};Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const q=require("react"),o=require("@livechat/design-system-icons"),S=require("clsx"),T=require("lodash.debounce"),d=require("../Button/index.cjs.js"),v=require("../Icon/index.cjs.js"),D=require("../../chunks/Text-df483689.js");require("../Loader/index.cjs.js");require("../../chunks/Typography.module-2558416b.js");function O(e){const _=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(_,t,r.get?r:{enumerable:!0,get:()=>e[t]})}}return _.default=e,Object.freeze(_)}const n=O(q),P="lc-Alert-module__alert___HBTns",R="lc-Alert-module__alert__icon___8TaAH",j="lc-Alert-module__alert__content___9nZdf",y="lc-Alert-module__alert__content__wrapper___aLBkP",M="lc-Alert-module__alert__content__wrapper__text___HDMbR",W="lc-Alert-module__alert__content__wrapper__cta___9L-oE",H="lc-Alert-module__alert__content__wrapper__cta__link___D9Igz",l={alert:P,alert__icon:R,alert__content:j,alert__content__wrapper:y,alert__content__wrapper__text:M,alert__content__wrapper__cta:W,alert__content__wrapper__cta__link:H,"alert__close-icon":"lc-Alert-module__alert__close-icon___rYxVy","alert--small":"lc-Alert-module__alert--small___Fyk-v","alert--medium":"lc-Alert-module__alert--medium___ItZWT","alert--large":"lc-Alert-module__alert--large___IH9yM","alert--info":"lc-Alert-module__alert--info___GmIGN","alert--warning":"lc-Alert-module__alert--warning___MubhD","alert--success":"lc-Alert-module__alert--success___fPtlZ","alert--error":"lc-Alert-module__alert--error___DKPo0"},L={info:{source:o.Info,kind:"link"},warning:{source:o.Warning,kind:"warning"},success:{source:o.CheckCircle,kind:"success"},error:{source:o.Block,kind:"error"}},c="alert",Z=G=>{var w=G,{children:e,className:_,primaryButton:t,secondaryButton:r,kind:p="info",onClose:f}=w,x=$(w,["children","className","primaryButton","secondaryButton","kind","onClose"]);const a=n.useRef(null),[i,u]=n.useState(null),N=S(l[c],l[`${c}--${p}`],i==="large"&&l[`${c}--large`],i==="medium"&&l[`${c}--medium`],i==="small"&&l[`${c}--small`],_);return n.useEffect(()=>{const g=()=>a.current&&a.current.offsetWidth<=400?u("small"):a.current&&a.current.offsetWidth>400&&a.current.offsetWidth<=800?u("medium"):u("large"),k=T(()=>{g()},500);return window.addEventListener("resize",k),g(),()=>window.removeEventListener("resize",k)}),n.createElement("div",m({ref:a,className:N},x),n.createElement("div",{className:l[`${c}__content`]},n.createElement("div",{className:l[`${c}__content__wrapper`]},n.createElement(v.Icon,C(m({},L[p]),{size:"large",className:l[`${c}__icon`]})),n.createElement(D.Text,{as:"div",className:l[`${c}__content__wrapper__text`]},e)),(t||r)&&n.createElement("div",{className:l[`${c}__content__wrapper__cta`]},t&&n.createElement(d.Button,{kind:"high-contrast",onClick:t.handleClick},t.label),r&&n.createElement(d.Button,{className:l[`${c}__content__wrapper__cta__link`],kind:"text",onClick:r.handleClick},r.label))),f&&n.createElement(d.Button,{"aria-label":"Close alert",type:"button",className:l[`${c}__close-icon`],size:"compact",kind:"plain",icon:n.createElement(v.Icon,{source:o.Close}),onClick:f}))};exports.Alert=Z;
|
|
@@ -19,14 +19,15 @@ var $ = (e, t) => {
|
|
|
19
19
|
t.indexOf(r) < 0 && E.call(e, r) && (_[r] = e[r]);
|
|
20
20
|
return _;
|
|
21
21
|
};
|
|
22
|
-
import "../../assets/style-index37.css";
|
|
23
22
|
import * as l from "react";
|
|
24
23
|
import { Close as I, Info as R, Warning as T, CheckCircle as W, Block as D } from "@livechat/design-system-icons";
|
|
25
24
|
import H from "clsx";
|
|
26
25
|
import L from "lodash.debounce";
|
|
27
|
-
import { Button as
|
|
26
|
+
import { Button as p } from "../Button/index.es.js";
|
|
28
27
|
import { Icon as h } from "../Icon/index.es.js";
|
|
29
|
-
import { T as M } from "../../chunks/Text-
|
|
28
|
+
import { T as M } from "../../chunks/Text-b31d1e9a.js";
|
|
29
|
+
import "../Loader/index.es.js";
|
|
30
|
+
import "../../chunks/Typography.module-93efb34d.js";
|
|
30
31
|
const P = "lc-Alert-module__alert___HBTns", S = "lc-Alert-module__alert__icon___8TaAH", Z = "lc-Alert-module__alert__content___9nZdf", G = "lc-Alert-module__alert__content__wrapper___aLBkP", F = "lc-Alert-module__alert__content__wrapper__text___HDMbR", K = "lc-Alert-module__alert__content__wrapper__cta___9L-oE", V = "lc-Alert-module__alert__content__wrapper__cta__link___D9Igz", n = {
|
|
31
32
|
alert: P,
|
|
32
33
|
alert__icon: S,
|
|
@@ -60,14 +61,14 @@ const P = "lc-Alert-module__alert___HBTns", S = "lc-Alert-module__alert__icon___
|
|
|
60
61
|
source: D,
|
|
61
62
|
kind: "error"
|
|
62
63
|
}
|
|
63
|
-
}, a = "alert",
|
|
64
|
+
}, a = "alert", _e = (j) => {
|
|
64
65
|
var f = j, {
|
|
65
66
|
children: e,
|
|
66
67
|
className: t,
|
|
67
68
|
primaryButton: _,
|
|
68
69
|
secondaryButton: r,
|
|
69
|
-
kind:
|
|
70
|
-
onClose:
|
|
70
|
+
kind: u = "info",
|
|
71
|
+
onClose: d
|
|
71
72
|
} = f, N = $(f, [
|
|
72
73
|
"children",
|
|
73
74
|
"className",
|
|
@@ -78,7 +79,7 @@ const P = "lc-Alert-module__alert___HBTns", S = "lc-Alert-module__alert__icon___
|
|
|
78
79
|
]);
|
|
79
80
|
const c = l.useRef(null), [s, i] = l.useState(null), v = H(
|
|
80
81
|
n[a],
|
|
81
|
-
n[`${a}--${
|
|
82
|
+
n[`${a}--${u}`],
|
|
82
83
|
s === "large" && n[`${a}--large`],
|
|
83
84
|
s === "medium" && n[`${a}--medium`],
|
|
84
85
|
s === "small" && n[`${a}--small`],
|
|
@@ -91,7 +92,7 @@ const P = "lc-Alert-module__alert___HBTns", S = "lc-Alert-module__alert__icon___
|
|
|
91
92
|
return window.addEventListener("resize", k), w(), () => window.removeEventListener("resize", k);
|
|
92
93
|
}), /* @__PURE__ */ l.createElement("div", m({ ref: c, className: v }, N), /* @__PURE__ */ l.createElement("div", { className: n[`${a}__content`] }, /* @__PURE__ */ l.createElement("div", { className: n[`${a}__content__wrapper`] }, /* @__PURE__ */ l.createElement(
|
|
93
94
|
h,
|
|
94
|
-
C(m({}, Y[
|
|
95
|
+
C(m({}, Y[u]), {
|
|
95
96
|
size: "large",
|
|
96
97
|
className: n[`${a}__icon`]
|
|
97
98
|
})
|
|
@@ -102,16 +103,16 @@ const P = "lc-Alert-module__alert___HBTns", S = "lc-Alert-module__alert__icon___
|
|
|
102
103
|
className: n[`${a}__content__wrapper__text`]
|
|
103
104
|
},
|
|
104
105
|
e
|
|
105
|
-
)), (_ || r) && /* @__PURE__ */ l.createElement("div", { className: n[`${a}__content__wrapper__cta`] }, _ && /* @__PURE__ */ l.createElement(
|
|
106
|
-
|
|
106
|
+
)), (_ || r) && /* @__PURE__ */ l.createElement("div", { className: n[`${a}__content__wrapper__cta`] }, _ && /* @__PURE__ */ l.createElement(p, { kind: "high-contrast", onClick: _.handleClick }, _.label), r && /* @__PURE__ */ l.createElement(
|
|
107
|
+
p,
|
|
107
108
|
{
|
|
108
109
|
className: n[`${a}__content__wrapper__cta__link`],
|
|
109
110
|
kind: "text",
|
|
110
111
|
onClick: r.handleClick
|
|
111
112
|
},
|
|
112
113
|
r.label
|
|
113
|
-
))),
|
|
114
|
-
|
|
114
|
+
))), d && /* @__PURE__ */ l.createElement(
|
|
115
|
+
p,
|
|
115
116
|
{
|
|
116
117
|
"aria-label": "Close alert",
|
|
117
118
|
type: "button",
|
|
@@ -119,10 +120,10 @@ const P = "lc-Alert-module__alert___HBTns", S = "lc-Alert-module__alert__icon___
|
|
|
119
120
|
size: "compact",
|
|
120
121
|
kind: "plain",
|
|
121
122
|
icon: /* @__PURE__ */ l.createElement(h, { source: I }),
|
|
122
|
-
onClick:
|
|
123
|
+
onClick: d
|
|
123
124
|
}
|
|
124
125
|
));
|
|
125
126
|
};
|
|
126
127
|
export {
|
|
127
|
-
|
|
128
|
+
_e as Alert
|
|
128
129
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var Q=Object.defineProperty;var c=Object.getOwnPropertySymbols;var S=Object.prototype.hasOwnProperty,h=Object.prototype.propertyIsEnumerable;var E=(a,_,t)=>_ in a?Q(a,_,{enumerable:!0,configurable:!0,writable:!0,value:t}):a[_]=t,A=(a,_)=>{for(var t in _||(_={}))S.call(_,t)&&E(a,t,_[t]);if(c)for(var t of c(_))h.call(_,t)&&E(a,t,_[t]);return a};var F=(a,_)=>{var t={};for(var r in a)S.call(a,r)&&_.indexOf(r)<0&&(t[r]=a[r]);if(a!=null&&c)for(var r of c(a))_.indexOf(r)<0&&h.call(a,r)&&(t[r]=a[r]);return t};
|
|
1
|
+
"use strict";var Q=Object.defineProperty;var c=Object.getOwnPropertySymbols;var S=Object.prototype.hasOwnProperty,h=Object.prototype.propertyIsEnumerable;var E=(a,_,t)=>_ in a?Q(a,_,{enumerable:!0,configurable:!0,writable:!0,value:t}):a[_]=t,A=(a,_)=>{for(var t in _||(_={}))S.call(_,t)&&E(a,t,_[t]);if(c)for(var t of c(_))h.call(_,t)&&E(a,t,_[t]);return a};var F=(a,_)=>{var t={};for(var r in a)S.call(a,r)&&_.indexOf(r)<0&&(t[r]=a[r]);if(a!=null&&c)for(var r of c(a))_.indexOf(r)<0&&h.call(a,r)&&(t[r]=a[r]);return t};Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const R=require("react"),T=require("@livechat/design-system-icons"),u=require("clsx"),V=require("../Icon/index.cjs.js"),G=require("../../chunks/Heading-617540b6.js"),K=require("polished");require("../../chunks/Typography.module-2558416b.js");function W(a){const _=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(a){for(const t in a)if(t!=="default"){const r=Object.getOwnPropertyDescriptor(a,t);Object.defineProperty(_,t,r.get?r:{enumerable:!0,get:()=>a[t]})}}return _.default=a,Object.freeze(_)}const m=W(R),I=Array.from({length:10},(a,_)=>`--surface-avatar-${_+1}`);function q(a){if(!a)return;const _=a.split("").reduce((t,r)=>t+r.charCodeAt(0),0);return`var(${I[_%I.length]})`}function X(a="",_=2){const t=a.trim().split(/\s+/),r=t.map(o=>[...o][0]);if(_<1)return"";if(t.length<=_)return r.join("").toUpperCase();const s=[r[0]];for(let o=t.length-_+1;o<t.length;o++)s.push(r[o]);return s.join("").toUpperCase()}function J(a){let _=a;if(a.startsWith("var(--")&&a.endsWith(")")){const t=a.slice(4,-1);_=window.getComputedStyle(document.documentElement).getPropertyValue(t).trim()}return _&&K.getContrast(_,"#FFFFFF")>3?"var(--color-white)":"var(--color-black)"}const Y="lc-Avatar-module__avatar___1zTCE",Z="lc-Avatar-module__avatar__status___nX2Ls",z="lc-Avatar-module__avatar__rim___RCQ8Q",aa="lc-Avatar-module__avatar__image___YqfqE",e={avatar:Y,avatar__status:Z,"avatar__status--available":"lc-Avatar-module__avatar__status--available___tcpFg","avatar__status--unavailable":"lc-Avatar-module__avatar__status--unavailable___ciauF","avatar__status--unknown":"lc-Avatar-module__avatar__status--unknown___MBaGB","avatar__status--xxxsmall":"lc-Avatar-module__avatar__status--xxxsmall___8pkEO","avatar__status--circle":"lc-Avatar-module__avatar__status--circle___doV5H","avatar__status--xxsmall":"lc-Avatar-module__avatar__status--xxsmall___M69lx","avatar__status--xsmall":"lc-Avatar-module__avatar__status--xsmall___RKQiI","avatar__status--small":"lc-Avatar-module__avatar__status--small___cVrA7","avatar__status--medium":"lc-Avatar-module__avatar__status--medium___n5z1H","avatar__status--large":"lc-Avatar-module__avatar__status--large___Lt-0p","avatar__status--xlarge":"lc-Avatar-module__avatar__status--xlarge___RWIcJ","avatar__status--xxlarge":"lc-Avatar-module__avatar__status--xxlarge___crG9D","avatar__status--xxxlarge":"lc-Avatar-module__avatar__status--xxxlarge___Iv61X","avatar__status--rounded-square":"lc-Avatar-module__avatar__status--rounded-square___-My1P",avatar__rim:z,"avatar__rim--xxxsmall":"lc-Avatar-module__avatar__rim--xxxsmall___0CH9D","avatar__rim--xxsmall":"lc-Avatar-module__avatar__rim--xxsmall___Mde0K","avatar__rim--xsmall":"lc-Avatar-module__avatar__rim--xsmall___LAN-b","avatar__rim--small":"lc-Avatar-module__avatar__rim--small___FT8LX","avatar__rim--medium":"lc-Avatar-module__avatar__rim--medium___Dy0pr","avatar__rim--large":"lc-Avatar-module__avatar__rim--large___FPvGp","avatar__rim--xlarge":"lc-Avatar-module__avatar__rim--xlarge___CY0kN","avatar__rim--xxlarge":"lc-Avatar-module__avatar__rim--xxlarge___tE053","avatar__rim--xxxlarge":"lc-Avatar-module__avatar__rim--xxxlarge___amlGP",avatar__image:aa,"avatar__icon--xxxsmall":"lc-Avatar-module__avatar__icon--xxxsmall___KaoMa","avatar__icon--xxsmall":"lc-Avatar-module__avatar__icon--xxsmall___NJJNV","avatar__icon--xsmall":"lc-Avatar-module__avatar__icon--xsmall___yHEZK","avatar__icon--small":"lc-Avatar-module__avatar__icon--small___l6lBu","avatar__icon--medium":"lc-Avatar-module__avatar__icon--medium___LF4w2","avatar__icon--large":"lc-Avatar-module__avatar__icon--large___QntBf","avatar__icon--xlarge":"lc-Avatar-module__avatar__icon--xlarge___bcHbI","avatar__icon--xxlarge":"lc-Avatar-module__avatar__icon--xxlarge___sx8Fq","avatar__icon--xxxlarge":"lc-Avatar-module__avatar__icon--xxxlarge___4144S","avatar--circle":"lc-Avatar-module__avatar--circle___XwEz-","avatar--rounded-square":"lc-Avatar-module__avatar--rounded-square___m7-4I","avatar--xxxsmall":"lc-Avatar-module__avatar--xxxsmall___EHzpP","avatar--xxsmall":"lc-Avatar-module__avatar--xxsmall___EDOVp","avatar--xsmall":"lc-Avatar-module__avatar--xsmall___nI348","avatar--small":"lc-Avatar-module__avatar--small___UuQen","avatar--medium":"lc-Avatar-module__avatar--medium___Bt9Eo","avatar--large":"lc-Avatar-module__avatar--large___OU-08","avatar--xlarge":"lc-Avatar-module__avatar--xlarge___zwgeW","avatar--xxlarge":"lc-Avatar-module__avatar--xxlarge___Ur0ul","avatar--xxxlarge":"lc-Avatar-module__avatar--xxxlarge___Z-54U"},l="avatar",_a=ta=>{var b=ta,{alt:a,className:_,color:t,shape:r="circle",size:s="medium",src:o,status:v,text:p,type:n,withRim:f=!1}=b,k=F(b,["alt","className","color","shape","size","src","status","text","type","withRim"]);const i=n==="image"&&!o,[$,y]=m.useState(i),N=n==="image"&&!!o&&!$,C=n==="text",D=["xxxsmall","xxsmall","xsmall"].includes(s)?1:2,w=X(p,D),x=["xxxsmall","xxsmall","xsmall","small"].includes(s),d=t||q(p),O=d?J(d):void 0,P=C?{backgroundColor:d}:{},H=u(A({[e[l]]:!0,[e[`${l}--${r}`]]:!0,[e[`${l}--${s}`]]:!0,[e[`${l}--with-rim`]]:f},_?{[`${_}`]:_}:{})),j=u(e[`${l}__status`],e[`${l}__status--${r}`],e[`${l}__status--${s}`],...v?[e[`${l}__status--${v}`]]:[]),M=u(e[`${l}__icon`],e[`${l}__icon--${s}`]),B=u(e[`${l}__rim`],e[`${l}__rim--${s}`]),U=g=>x?"2xs":["medium"].includes(g)?"xs":["large","xlarge"].includes(g)?"sm":["xxlarge"].includes(g)?"lg":"xl",L=m.useCallback(()=>y(!0),[]);return m.useEffect(()=>{y(i)},[i]),m.createElement("div",A({className:H,style:P},k),f&&m.createElement("div",{"data-testid":`${l}__rim`,className:B}),v&&m.createElement("div",{"data-testid":`${l}__status`,className:j}),N&&m.createElement("img",{className:e[`${l}__image`],src:o,alt:a,onError:L}),C&&m.createElement(G.Heading,{as:"span",size:U(s),style:{color:O},bold:x,uppercase:x},w),$&&m.createElement(V.Icon,{"data-testid":`${l}__icon`,className:M,source:T.Person}))};exports.Avatar=_a;exports.generateAvatarColor=q;
|