@livechat/design-system-react-components 1.17.1-alpha.4 → 1.18.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/Skeleton/SkeletonAvatar.d.ts +16 -0
- package/dist/components/Skeleton/SkeletonText.d.ts +16 -0
- package/dist/components/Skeleton/SkeletonWrapper.d.ts +16 -0
- package/dist/components/Skeleton/index.d.ts +3 -0
- package/dist/components/Tag/Tag.d.ts +1 -34
- package/dist/components/Tag/constants.d.ts +2 -0
- package/dist/components/Tag/index.d.ts +2 -1
- package/dist/components/Tag/types.d.ts +55 -0
- package/dist/components/TagInput/TagInput.d.ts +2 -39
- package/dist/components/TagInput/{EditableTag.d.ts → components/EditableTag.d.ts} +2 -0
- package/dist/components/TagInput/components/EmailTagInput.d.ts +5 -0
- package/dist/components/TagInput/index.d.ts +3 -3
- package/dist/components/TagInput/types.d.ts +41 -0
- package/dist/components/Typography/Display.d.ts +5 -1
- package/dist/components/Typography/Heading.d.ts +5 -1
- package/dist/components/Typography/Text.d.ts +5 -1
- package/dist/components/Typography/types.d.ts +1 -0
- package/dist/foundations/design-token.d.ts +23 -0
- package/dist/index.cjs.js +1 -1
- package/dist/index.es.js +5280 -132
- package/dist/preview-stats.json +1254 -1254
- package/dist/style.css +1 -1
- package/package.json +5 -5
- package/dist/chunks/Heading-617540b6.js +0 -1
- package/dist/chunks/Heading-6b95d08b.js +0 -64
- package/dist/chunks/Text-b31d1e9a.js +0 -66
- package/dist/chunks/Text-df483689.js +0 -1
- package/dist/chunks/Tooltip-1c5cb6fe.js +0 -182
- package/dist/chunks/Tooltip-f9f79274.js +0 -1
- package/dist/chunks/Typography.module-2558416b.js +0 -1
- package/dist/chunks/Typography.module-93efb34d.js +0 -23
- package/dist/chunks/keyCodes-30323e90.js +0 -15
- package/dist/chunks/keyCodes-c4c35e49.js +0 -1
- package/dist/components/ActionBar/index.cjs.js +0 -1
- package/dist/components/ActionBar/index.es.js +0 -192
- package/dist/components/ActionMenu/index.cjs.js +0 -1
- package/dist/components/ActionMenu/index.es.js +0 -199
- package/dist/components/Alert/index.cjs.js +0 -1
- package/dist/components/Alert/index.es.js +0 -129
- package/dist/components/Avatar/index.cjs.js +0 -1
- package/dist/components/Avatar/index.es.js +0 -190
- package/dist/components/Badge/index.cjs.js +0 -1
- package/dist/components/Badge/index.es.js +0 -65
- package/dist/components/Button/index.cjs.js +0 -1
- package/dist/components/Button/index.es.js +0 -143
- package/dist/components/Card/index.cjs.js +0 -1
- package/dist/components/Card/index.es.js +0 -96
- package/dist/components/Checkbox/index.cjs.js +0 -1
- package/dist/components/Checkbox/index.es.js +0 -64
- package/dist/components/DatePicker/index.cjs.js +0 -1
- package/dist/components/DatePicker/index.es.js +0 -516
- package/dist/components/DetailsCard/index.cjs.js +0 -1
- package/dist/components/DetailsCard/index.es.js +0 -140
- package/dist/components/DetailsCardInfo/index.cjs.js +0 -1
- package/dist/components/DetailsCardInfo/index.es.js +0 -12
- package/dist/components/FieldDescription/index.cjs.js +0 -1
- package/dist/components/FieldDescription/index.es.js +0 -41
- package/dist/components/FieldError/index.cjs.js +0 -1
- package/dist/components/FieldError/index.es.js +0 -51
- package/dist/components/FieldGroup/index.cjs.js +0 -1
- package/dist/components/FieldGroup/index.es.js +0 -58
- package/dist/components/FileUploadProgress/index.cjs.js +0 -1
- package/dist/components/FileUploadProgress/index.es.js +0 -109
- package/dist/components/Form/index.cjs.js +0 -1
- package/dist/components/Form/index.es.js +0 -50
- package/dist/components/FormField/index.cjs.js +0 -1
- package/dist/components/FormField/index.es.js +0 -116
- package/dist/components/FormGroup/index.cjs.js +0 -1
- package/dist/components/FormGroup/index.es.js +0 -58
- package/dist/components/Icon/index.cjs.js +0 -1
- package/dist/components/Icon/index.es.js +0 -103
- package/dist/components/Input/index.cjs.js +0 -1
- package/dist/components/Input/index.es.js +0 -123
- package/dist/components/Link/index.cjs.js +0 -1
- package/dist/components/Link/index.es.js +0 -47
- package/dist/components/Loader/index.cjs.js +0 -1
- package/dist/components/Loader/index.es.js +0 -39
- package/dist/components/Modal/index.cjs.js +0 -1
- package/dist/components/Modal/index.es.js +0 -249
- package/dist/components/NumericInput/index.cjs.js +0 -1
- package/dist/components/NumericInput/index.es.js +0 -139
- package/dist/components/Picker/index.cjs.js +0 -1
- package/dist/components/Picker/index.es.js +0 -740
- package/dist/components/Popover/index.cjs.js +0 -1
- package/dist/components/Popover/index.es.js +0 -75
- package/dist/components/Progress/index.cjs.js +0 -1
- package/dist/components/Progress/index.es.js +0 -160
- package/dist/components/PromoBanner/index.cjs.js +0 -1
- package/dist/components/PromoBanner/index.es.js +0 -74
- package/dist/components/PromoBannerV2/index.cjs.js +0 -1
- package/dist/components/PromoBannerV2/index.es.js +0 -79
- package/dist/components/RadioButton/index.cjs.js +0 -1
- package/dist/components/RadioButton/index.es.js +0 -58
- package/dist/components/Search/index.cjs.js +0 -1
- package/dist/components/Search/index.es.js +0 -117
- package/dist/components/SegmentedControl/index.cjs.js +0 -1
- package/dist/components/SegmentedControl/index.es.js +0 -55
- package/dist/components/Switch/index.cjs.js +0 -1
- package/dist/components/Switch/index.es.js +0 -145
- package/dist/components/Tab/index.cjs.js +0 -1
- package/dist/components/Tab/index.es.js +0 -93
- package/dist/components/Tag/index.cjs.js +0 -1
- package/dist/components/Tag/index.es.js +0 -143
- package/dist/components/TagInput/EmailTagInput.d.ts +0 -5
- package/dist/components/TagInput/index.cjs.js +0 -1
- package/dist/components/TagInput/index.es.js +0 -244
- package/dist/components/Textarea/index.cjs.js +0 -1
- package/dist/components/Textarea/index.es.js +0 -55
- package/dist/components/Toast/index.cjs.js +0 -1
- package/dist/components/Toast/index.es.js +0 -163
- package/dist/components/Tooltip/components/UserGuide/index.cjs.js +0 -1
- package/dist/components/Tooltip/components/UserGuide/index.es.js +0 -196
- package/dist/components/Tooltip/components/index.cjs.js +0 -1
- package/dist/components/Tooltip/components/index.es.js +0 -117
- package/dist/components/Tooltip/index.cjs.js +0 -1
- package/dist/components/Tooltip/index.es.js +0 -21
- package/dist/components/Typography/index.cjs.js +0 -1
- package/dist/components/Typography/index.es.js +0 -48
- package/dist/components/UploadBar/index.cjs.js +0 -1
- package/dist/components/UploadBar/index.es.js +0 -111
- package/dist/foundations/index.cjs.js +0 -1
- package/dist/foundations/index.es.js +0 -353
- package/dist/utils/index.cjs.js +0 -1
- package/dist/utils/index.es.js +0 -4
- /package/dist/components/TagInput/{EditableTagContent.d.ts → components/EditableTagContent.d.ts} +0 -0
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
import * as e from "react";
|
|
2
|
-
import r from "clsx";
|
|
3
|
-
import { Button as N } from "../Button/index.es.js";
|
|
4
|
-
import "../Loader/index.es.js";
|
|
5
|
-
import "../../chunks/Typography.module-93efb34d.js";
|
|
6
|
-
import "../../chunks/Text-b31d1e9a.js";
|
|
7
|
-
function h() {
|
|
8
|
-
}
|
|
9
|
-
const x = "lc-SegmentedControl-module__btn___tfsvL", o = {
|
|
10
|
-
"segmented-control": "lc-SegmentedControl-module__segmented-control___LHWSk",
|
|
11
|
-
btn: x,
|
|
12
|
-
"btn--active": "lc-SegmentedControl-module__btn--active___Za-th",
|
|
13
|
-
"btn--compact": "lc-SegmentedControl-module__btn--compact___gcSwq",
|
|
14
|
-
"btn--medium": "lc-SegmentedControl-module__btn--medium___w3UzC",
|
|
15
|
-
"btn--large": "lc-SegmentedControl-module__btn--large___yHPw4"
|
|
16
|
-
}, H = "segmented-control", R = ({
|
|
17
|
-
size: a = "medium",
|
|
18
|
-
buttons: _,
|
|
19
|
-
className: d,
|
|
20
|
-
initialId: i,
|
|
21
|
-
currentId: n,
|
|
22
|
-
fullWidth: g = !1,
|
|
23
|
-
onButtonClick: u = h
|
|
24
|
-
}) => {
|
|
25
|
-
const b = r(o[H], d), [S, c] = e.useState(() => i), m = typeof n == "string";
|
|
26
|
-
e.useEffect(() => {
|
|
27
|
-
m && c(n);
|
|
28
|
-
}, [n]);
|
|
29
|
-
const p = (t, s) => {
|
|
30
|
-
m || c(t), u(t, s);
|
|
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;
|
|
33
|
-
return /* @__PURE__ */ e.createElement(
|
|
34
|
-
N,
|
|
35
|
-
{
|
|
36
|
-
key: t,
|
|
37
|
-
fullWidth: g,
|
|
38
|
-
loading: w,
|
|
39
|
-
disabled: y,
|
|
40
|
-
"aria-pressed": l,
|
|
41
|
-
kind: "secondary",
|
|
42
|
-
icon: v,
|
|
43
|
-
className: r(o.btn, o[`btn--${a}`], k),
|
|
44
|
-
onClick: (E) => {
|
|
45
|
-
p(t, E);
|
|
46
|
-
}
|
|
47
|
-
},
|
|
48
|
-
s
|
|
49
|
-
);
|
|
50
|
-
});
|
|
51
|
-
return /* @__PURE__ */ e.createElement("div", { role: "group", className: b }, C);
|
|
52
|
-
};
|
|
53
|
-
export {
|
|
54
|
-
R as SegmentedControl
|
|
55
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
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/Typography.module-2558416b.js");require("../../chunks/Text-df483689.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;
|
|
@@ -1,145 +0,0 @@
|
|
|
1
|
-
var M = Object.defineProperty;
|
|
2
|
-
var d = Object.getOwnPropertySymbols;
|
|
3
|
-
var E = Object.prototype.hasOwnProperty, N = Object.prototype.propertyIsEnumerable;
|
|
4
|
-
var b = (_, t, c) => t in _ ? M(_, t, { enumerable: !0, configurable: !0, writable: !0, value: c }) : _[t] = c, y = (_, t) => {
|
|
5
|
-
for (var c in t || (t = {}))
|
|
6
|
-
E.call(t, c) && b(_, c, t[c]);
|
|
7
|
-
if (d)
|
|
8
|
-
for (var c of d(t))
|
|
9
|
-
N.call(t, c) && b(_, c, t[c]);
|
|
10
|
-
return _;
|
|
11
|
-
};
|
|
12
|
-
var A = (_, t) => {
|
|
13
|
-
var c = {};
|
|
14
|
-
for (var l in _)
|
|
15
|
-
E.call(_, l) && t.indexOf(l) < 0 && (c[l] = _[l]);
|
|
16
|
-
if (_ != null && d)
|
|
17
|
-
for (var l of d(_))
|
|
18
|
-
t.indexOf(l) < 0 && N.call(_, l) && (c[l] = _[l]);
|
|
19
|
-
return c;
|
|
20
|
-
};
|
|
21
|
-
import * as s from "react";
|
|
22
|
-
import { LockBlackFilled as X } from "@livechat/design-system-icons";
|
|
23
|
-
import a from "clsx";
|
|
24
|
-
import { Icon as B } from "../Icon/index.es.js";
|
|
25
|
-
import { Loader as C } from "../Loader/index.es.js";
|
|
26
|
-
import "../../chunks/Typography.module-93efb34d.js";
|
|
27
|
-
import "../../chunks/Text-b31d1e9a.js";
|
|
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 = {
|
|
29
|
-
switch: "lc-Switch-module__switch___AaA2k",
|
|
30
|
-
"switch__track--enabled": "lc-Switch-module__switch__track--enabled___sy4Xl",
|
|
31
|
-
"switch__track--on": "lc-Switch-module__switch__track--on___aOMWe",
|
|
32
|
-
"switch__track--off": "lc-Switch-module__switch__track--off___NAisj",
|
|
33
|
-
"switch--large": "lc-Switch-module__switch--large___pSoJ7",
|
|
34
|
-
"switch--compact": "lc-Switch-module__switch--compact___OGFIX",
|
|
35
|
-
"switch--medium": "lc-Switch-module__switch--medium___EcZwT",
|
|
36
|
-
switch__input: G,
|
|
37
|
-
"switch__input--disabled": "lc-Switch-module__switch__input--disabled___Po8gh",
|
|
38
|
-
switch__container: H,
|
|
39
|
-
switch__track: I,
|
|
40
|
-
"switch__track--disabled": "lc-Switch-module__switch__track--disabled___HkDhl",
|
|
41
|
-
switch__slider: P,
|
|
42
|
-
"switch__slider--large": "lc-Switch-module__switch__slider--large___WoEgi",
|
|
43
|
-
"switch__slider--large--on": "lc-Switch-module__switch__slider--large--on___7Qp3G",
|
|
44
|
-
"switch__slider--large--off": "lc-Switch-module__switch__slider--large--off___iRMmD",
|
|
45
|
-
"switch__slider--compact": "lc-Switch-module__switch__slider--compact___uZ-lS",
|
|
46
|
-
"switch__slider--compact--on": "lc-Switch-module__switch__slider--compact--on___FykE3",
|
|
47
|
-
"switch__slider--compact--off": "lc-Switch-module__switch__slider--compact--off___s5yR8",
|
|
48
|
-
"switch__slider--medium": "lc-Switch-module__switch__slider--medium___uhptz",
|
|
49
|
-
"switch__slider--medium--on": "lc-Switch-module__switch__slider--medium--on___SfeAV",
|
|
50
|
-
"switch__slider--medium--off": "lc-Switch-module__switch__slider--medium--off___eXJJz",
|
|
51
|
-
switch__loader: V,
|
|
52
|
-
"switch__loader--compact": "lc-Switch-module__switch__loader--compact___3imUh",
|
|
53
|
-
"switch__loader--medium": "lc-Switch-module__switch__loader--medium___2zi05",
|
|
54
|
-
"switch__loader--large": "lc-Switch-module__switch__loader--large___vLRFa",
|
|
55
|
-
switch__icon: Z
|
|
56
|
-
}, i = "switch", __ = (j) => {
|
|
57
|
-
var u = j, {
|
|
58
|
-
className: _ = "",
|
|
59
|
-
defaultOn: t = !1,
|
|
60
|
-
disabled: c = !1,
|
|
61
|
-
name: l = i,
|
|
62
|
-
on: r,
|
|
63
|
-
onChange: h,
|
|
64
|
-
size: o = "large",
|
|
65
|
-
state: n = "regular",
|
|
66
|
-
innerRef: F,
|
|
67
|
-
ariaLabel: L
|
|
68
|
-
} = u, R = A(u, [
|
|
69
|
-
"className",
|
|
70
|
-
"defaultOn",
|
|
71
|
-
"disabled",
|
|
72
|
-
"name",
|
|
73
|
-
"on",
|
|
74
|
-
"onChange",
|
|
75
|
-
"size",
|
|
76
|
-
"state",
|
|
77
|
-
"innerRef",
|
|
78
|
-
"ariaLabel"
|
|
79
|
-
]);
|
|
80
|
-
const w = r !== void 0, [v, x] = s.useState(
|
|
81
|
-
() => w ? r : t
|
|
82
|
-
), m = w ? r : v, p = n === "loading", S = n === "locked", O = o === "large" ? "small" : "xsmall", f = m ? "on" : "off", k = c || p || S, $ = k ? "disabled" : "enabled", W = a(
|
|
83
|
-
e[i],
|
|
84
|
-
e[`${i}--${o}`],
|
|
85
|
-
_
|
|
86
|
-
), D = (g) => {
|
|
87
|
-
h == null || h(g, !m), w || (g.stopPropagation(), x((J) => !J));
|
|
88
|
-
};
|
|
89
|
-
return /* @__PURE__ */ s.createElement("span", { className: W }, /* @__PURE__ */ s.createElement(
|
|
90
|
-
"input",
|
|
91
|
-
y({
|
|
92
|
-
type: "checkbox",
|
|
93
|
-
className: a(
|
|
94
|
-
e[`${i}__input`],
|
|
95
|
-
e[`${i}__input--${$}`]
|
|
96
|
-
),
|
|
97
|
-
onChange: D,
|
|
98
|
-
checked: m,
|
|
99
|
-
name: l,
|
|
100
|
-
ref: F,
|
|
101
|
-
disabled: k,
|
|
102
|
-
"aria-label": L
|
|
103
|
-
}, R)
|
|
104
|
-
), /* @__PURE__ */ s.createElement("span", { className: e[`${i}__container`] }, /* @__PURE__ */ s.createElement(
|
|
105
|
-
"span",
|
|
106
|
-
{
|
|
107
|
-
className: a(
|
|
108
|
-
e[`${i}__track`],
|
|
109
|
-
e[`${i}__track--${f}`],
|
|
110
|
-
e[`${i}__track--${$}`]
|
|
111
|
-
)
|
|
112
|
-
}
|
|
113
|
-
), /* @__PURE__ */ s.createElement(
|
|
114
|
-
"span",
|
|
115
|
-
{
|
|
116
|
-
className: a(
|
|
117
|
-
e[`${i}__slider`],
|
|
118
|
-
e[`${i}__slider--${o}`],
|
|
119
|
-
e[`${i}__slider--${o}--${f}`]
|
|
120
|
-
)
|
|
121
|
-
},
|
|
122
|
-
p && /* @__PURE__ */ s.createElement(
|
|
123
|
-
C,
|
|
124
|
-
{
|
|
125
|
-
className: a(
|
|
126
|
-
e[`${i}__loader`],
|
|
127
|
-
e[`${i}__loader--${o}`]
|
|
128
|
-
)
|
|
129
|
-
}
|
|
130
|
-
),
|
|
131
|
-
S && /* @__PURE__ */ s.createElement(
|
|
132
|
-
B,
|
|
133
|
-
{
|
|
134
|
-
className: e[`${i}__icon`],
|
|
135
|
-
"data-testid": "lock-icon",
|
|
136
|
-
size: O,
|
|
137
|
-
source: X,
|
|
138
|
-
kind: "primary"
|
|
139
|
-
}
|
|
140
|
-
)
|
|
141
|
-
)));
|
|
142
|
-
};
|
|
143
|
-
export {
|
|
144
|
-
__ as Switch
|
|
145
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
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");require("../../chunks/Typography.module-2558416b.js");const f=require("../../chunks/Text-df483689.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;
|
|
@@ -1,93 +0,0 @@
|
|
|
1
|
-
var x = Object.defineProperty, W = Object.defineProperties;
|
|
2
|
-
var z = Object.getOwnPropertyDescriptors;
|
|
3
|
-
var c = Object.getOwnPropertySymbols;
|
|
4
|
-
var r = Object.prototype.hasOwnProperty, u = Object.prototype.propertyIsEnumerable;
|
|
5
|
-
var i = (a, t, e) => t in a ? x(a, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : a[t] = e, T = (a, t) => {
|
|
6
|
-
for (var e in t || (t = {}))
|
|
7
|
-
r.call(t, e) && i(a, e, t[e]);
|
|
8
|
-
if (c)
|
|
9
|
-
for (var e of c(t))
|
|
10
|
-
u.call(t, e) && i(a, e, t[e]);
|
|
11
|
-
return a;
|
|
12
|
-
}, p = (a, t) => W(a, z(t));
|
|
13
|
-
var g = (a, t) => {
|
|
14
|
-
var e = {};
|
|
15
|
-
for (var _ in a)
|
|
16
|
-
r.call(a, _) && t.indexOf(_) < 0 && (e[_] = a[_]);
|
|
17
|
-
if (a != null && c)
|
|
18
|
-
for (var _ of c(a))
|
|
19
|
-
t.indexOf(_) < 0 && u.call(a, _) && (e[_] = a[_]);
|
|
20
|
-
return e;
|
|
21
|
-
};
|
|
22
|
-
import * as l from "react";
|
|
23
|
-
import d from "clsx";
|
|
24
|
-
import { Badge as A } from "../Badge/index.es.js";
|
|
25
|
-
import "../../chunks/Typography.module-93efb34d.js";
|
|
26
|
-
import { T as $ } from "../../chunks/Text-b31d1e9a.js";
|
|
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
|
-
tab: C,
|
|
29
|
-
tab__count: D,
|
|
30
|
-
"tab--compact": "lc-Tab-module__tab--compact___4qead",
|
|
31
|
-
"tab--medium": "lc-Tab-module__tab--medium___bHnGV",
|
|
32
|
-
"tab--large": "lc-Tab-module__tab--large___JL30g",
|
|
33
|
-
tab__badge: L,
|
|
34
|
-
"tab--selected": "lc-Tab-module__tab--selected___c0EkL",
|
|
35
|
-
"tab--disabled": "lc-Tab-module__tab--disabled___URdTh"
|
|
36
|
-
}, b = "tab", M = (k) => {
|
|
37
|
-
var n = k, {
|
|
38
|
-
children: a,
|
|
39
|
-
className: t,
|
|
40
|
-
count: e,
|
|
41
|
-
isSelected: _,
|
|
42
|
-
asBadge: m,
|
|
43
|
-
size: y = "medium"
|
|
44
|
-
} = n, o = g(n, [
|
|
45
|
-
"children",
|
|
46
|
-
"className",
|
|
47
|
-
"count",
|
|
48
|
-
"isSelected",
|
|
49
|
-
"asBadge",
|
|
50
|
-
"size"
|
|
51
|
-
]);
|
|
52
|
-
const { disabled: N } = o, h = e !== void 0 && !m, v = e !== void 0 && m;
|
|
53
|
-
return /* @__PURE__ */ l.createElement(
|
|
54
|
-
$,
|
|
55
|
-
p(T({}, o), {
|
|
56
|
-
as: o.href ? "a" : "button",
|
|
57
|
-
size: "md",
|
|
58
|
-
bold: _,
|
|
59
|
-
className: d(
|
|
60
|
-
t,
|
|
61
|
-
s[b],
|
|
62
|
-
s[`${b}--${y}`],
|
|
63
|
-
_ && s[`${b}--selected`],
|
|
64
|
-
N && s[`${b}--disabled`]
|
|
65
|
-
)
|
|
66
|
-
}),
|
|
67
|
-
a,
|
|
68
|
-
h && /* @__PURE__ */ l.createElement($, { as: "span", size: "md", className: s[`${b}__count`] }, "(", e, ")"),
|
|
69
|
-
v && /* @__PURE__ */ l.createElement(
|
|
70
|
-
A,
|
|
71
|
-
{
|
|
72
|
-
"data-testid": "tab-badge",
|
|
73
|
-
count: e,
|
|
74
|
-
size: "compact",
|
|
75
|
-
className: s[`${b}__badge`]
|
|
76
|
-
}
|
|
77
|
-
)
|
|
78
|
-
);
|
|
79
|
-
}, R = "lc-TabsWrapper-module__tabs___Y2xyD", V = "lc-TabsWrapper-module__tabs__list___i6tVO", E = {
|
|
80
|
-
tabs: R,
|
|
81
|
-
tabs__list: V
|
|
82
|
-
}, f = "tabs", O = ({
|
|
83
|
-
className: a,
|
|
84
|
-
children: t
|
|
85
|
-
}) => /* @__PURE__ */ l.createElement("div", { className: d(E[f], a) }, t), U = ({
|
|
86
|
-
className: a,
|
|
87
|
-
children: t
|
|
88
|
-
}) => /* @__PURE__ */ l.createElement("div", { className: d(E[`${f}__list`], a) }, t);
|
|
89
|
-
export {
|
|
90
|
-
M as Tab,
|
|
91
|
-
U as TabsList,
|
|
92
|
-
O as TabsWrapper
|
|
93
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
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");require("../../chunks/Typography.module-2558416b.js");const D=require("../../chunks/Text-df483689.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;
|
|
@@ -1,143 +0,0 @@
|
|
|
1
|
-
var I = Object.defineProperty, R = Object.defineProperties;
|
|
2
|
-
var h = Object.getOwnPropertyDescriptors;
|
|
3
|
-
var c = Object.getOwnPropertySymbols;
|
|
4
|
-
var f = Object.prototype.hasOwnProperty, F = Object.prototype.propertyIsEnumerable;
|
|
5
|
-
var T = (t, e, a) => e in t ? I(t, e, { enumerable: !0, configurable: !0, writable: !0, value: a }) : t[e] = a, m = (t, e) => {
|
|
6
|
-
for (var a in e || (e = {}))
|
|
7
|
-
f.call(e, a) && T(t, a, e[a]);
|
|
8
|
-
if (c)
|
|
9
|
-
for (var a of c(e))
|
|
10
|
-
F.call(e, a) && T(t, a, e[a]);
|
|
11
|
-
return t;
|
|
12
|
-
}, x = (t, e) => R(t, h(e));
|
|
13
|
-
var b = (t, e) => {
|
|
14
|
-
var a = {};
|
|
15
|
-
for (var _ in t)
|
|
16
|
-
f.call(t, _) && e.indexOf(_) < 0 && (a[_] = t[_]);
|
|
17
|
-
if (t != null && c)
|
|
18
|
-
for (var _ of c(t))
|
|
19
|
-
e.indexOf(_) < 0 && F.call(t, _) && (a[_] = t[_]);
|
|
20
|
-
return a;
|
|
21
|
-
};
|
|
22
|
-
import * as r from "react";
|
|
23
|
-
import { Close as j } from "@livechat/design-system-icons";
|
|
24
|
-
import z from "clsx";
|
|
25
|
-
import { getContrast as p } from "polished";
|
|
26
|
-
import { Icon as D } from "../Icon/index.es.js";
|
|
27
|
-
import "../../chunks/Typography.module-93efb34d.js";
|
|
28
|
-
import { T as K } from "../../chunks/Text-b31d1e9a.js";
|
|
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
|
-
tag: N,
|
|
31
|
-
"tag--success": "lc-Tag-module__tag--success___P2hXQ",
|
|
32
|
-
tag__remove: Q,
|
|
33
|
-
"tag--error": "lc-Tag-module__tag--error___1cjsm",
|
|
34
|
-
"tag--warning": "lc-Tag-module__tag--warning___PstMG",
|
|
35
|
-
"tag--info": "lc-Tag-module__tag--info___RTH0C",
|
|
36
|
-
"tag--purple": "lc-Tag-module__tag--purple___a0xaE",
|
|
37
|
-
"tag--black": "lc-Tag-module__tag--black___qWjfD",
|
|
38
|
-
"tag--outline": "lc-Tag-module__tag--outline___aZXtr",
|
|
39
|
-
"tag--small": "lc-Tag-module__tag--small___xfcC5",
|
|
40
|
-
"tag--medium": "lc-Tag-module__tag--medium___l5-KI",
|
|
41
|
-
"tag--large": "lc-Tag-module__tag--large___ytC6Y",
|
|
42
|
-
"tag--xlarge": "lc-Tag-module__tag--xlarge___2jj1d",
|
|
43
|
-
icon: S,
|
|
44
|
-
"tag--text-white": "lc-Tag-module__tag--text-white___x0fnD",
|
|
45
|
-
"tag--text-black": "lc-Tag-module__tag--text-black___dUvmD",
|
|
46
|
-
"tag--dismissible": "lc-Tag-module__tag--dismissible___Qobyr",
|
|
47
|
-
tag__node: Z,
|
|
48
|
-
tag__content: q
|
|
49
|
-
}, g = "tag", P = (t) => t ? p(t, "#FFFFFF") > 4.5 ? "text-white" : "text-black" : "", V = (U) => {
|
|
50
|
-
var u = U, {
|
|
51
|
-
className: t = "",
|
|
52
|
-
children: e,
|
|
53
|
-
dismissible: a = !1,
|
|
54
|
-
size: _ = "medium",
|
|
55
|
-
kind: v = "default",
|
|
56
|
-
onRemove: $,
|
|
57
|
-
outline: n = !1,
|
|
58
|
-
leftNode: d,
|
|
59
|
-
rightNode: i,
|
|
60
|
-
customColor: l
|
|
61
|
-
} = u, y = b(u, [
|
|
62
|
-
"className",
|
|
63
|
-
"children",
|
|
64
|
-
"dismissible",
|
|
65
|
-
"size",
|
|
66
|
-
"kind",
|
|
67
|
-
"onRemove",
|
|
68
|
-
"outline",
|
|
69
|
-
"leftNode",
|
|
70
|
-
"rightNode",
|
|
71
|
-
"customColor"
|
|
72
|
-
]);
|
|
73
|
-
const C = z(
|
|
74
|
-
o[g],
|
|
75
|
-
t,
|
|
76
|
-
o[`${g}--${_}`],
|
|
77
|
-
o[`${g}--${v}`],
|
|
78
|
-
{
|
|
79
|
-
[o[`${g}--dismissible`]]: a,
|
|
80
|
-
[o[`${g}--outline`]]: n,
|
|
81
|
-
[o[`${g}--${P(l)}`]]: !!l
|
|
82
|
-
}
|
|
83
|
-
), k = _ === "small" ? "small" : "medium", E = _ === "small" ? "sm" : "md", w = () => l ? n ? {
|
|
84
|
-
style: {
|
|
85
|
-
backgroundColor: "transparent",
|
|
86
|
-
color: l,
|
|
87
|
-
borderColor: l
|
|
88
|
-
}
|
|
89
|
-
} : { style: { backgroundColor: l } } : {}, s = () => {
|
|
90
|
-
if (l)
|
|
91
|
-
return n ? l : p(l, "#FFFFFF") > 4.5 ? "#FFFFFF" : "#000000";
|
|
92
|
-
};
|
|
93
|
-
return /* @__PURE__ */ r.createElement(
|
|
94
|
-
K,
|
|
95
|
-
x(m(m({
|
|
96
|
-
className: C
|
|
97
|
-
}, y), w()), {
|
|
98
|
-
as: "div",
|
|
99
|
-
size: E
|
|
100
|
-
}),
|
|
101
|
-
d && /* @__PURE__ */ r.createElement(
|
|
102
|
-
"div",
|
|
103
|
-
{
|
|
104
|
-
"data-testid": "lc-tag-left-node",
|
|
105
|
-
className: o[`${g}__node`],
|
|
106
|
-
style: { color: s() }
|
|
107
|
-
},
|
|
108
|
-
d
|
|
109
|
-
),
|
|
110
|
-
/* @__PURE__ */ r.createElement("div", { className: o[`${g}__content`] }, e),
|
|
111
|
-
i && /* @__PURE__ */ r.createElement(
|
|
112
|
-
"div",
|
|
113
|
-
{
|
|
114
|
-
"data-testid": "lc-tag-right-node",
|
|
115
|
-
style: { color: s() }
|
|
116
|
-
},
|
|
117
|
-
i
|
|
118
|
-
),
|
|
119
|
-
a && /* @__PURE__ */ r.createElement(
|
|
120
|
-
"button",
|
|
121
|
-
{
|
|
122
|
-
tabIndex: -1,
|
|
123
|
-
title: "Remove",
|
|
124
|
-
onClick: $,
|
|
125
|
-
type: "button",
|
|
126
|
-
"aria-label": "Remove tag",
|
|
127
|
-
className: o[`${g}__remove`]
|
|
128
|
-
},
|
|
129
|
-
/* @__PURE__ */ r.createElement(
|
|
130
|
-
D,
|
|
131
|
-
{
|
|
132
|
-
"data-dismiss-icon": !0,
|
|
133
|
-
source: j,
|
|
134
|
-
size: k,
|
|
135
|
-
customColor: s()
|
|
136
|
-
}
|
|
137
|
-
)
|
|
138
|
-
)
|
|
139
|
-
);
|
|
140
|
-
};
|
|
141
|
-
export {
|
|
142
|
-
V as Tag
|
|
143
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
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");require("../../chunks/Typography.module-2558416b.js");const 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("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;
|