@livechat/design-system-react-components 1.17.1-alpha.2 → 1.17.1-alpha.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs.js +1 -1
- package/dist/index.es.js +5230 -134
- package/dist/preview-stats.json +1146 -1146
- package/dist/style.css +1 -1
- package/package.json +2 -2
- package/dist/chunks/Heading-617540b6.js +0 -1
- package/dist/chunks/Heading-6b95d08b.js +0 -64
- package/dist/chunks/ProgressBar-3e0fd769.js +0 -87
- package/dist/chunks/ProgressBar-62d36b60.js +0 -1
- package/dist/chunks/Text-b31d1e9a.js +0 -66
- package/dist/chunks/Text-df483689.js +0 -1
- package/dist/chunks/Tooltip-8c427780.js +0 -1
- package/dist/chunks/Tooltip-f6f4f9c2.js +0 -181
- 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 -250
- 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 -103
- 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/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 -112
- 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
|
@@ -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/Text-b31d1e9a.js";
|
|
27
|
-
import "../../chunks/Typography.module-93efb34d.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"),f=require("../../chunks/Text-df483689.js");require("../../chunks/Typography.module-2558416b.js");function h(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const a in e)if(a!=="default"){const s=Object.getOwnPropertyDescriptor(e,a);Object.defineProperty(t,a,s.get?s:{enumerable:!0,get:()=>e[a]})}}return t.default=e,Object.freeze(t)}const b=h(D),z="lc-Tab-module__tab___fME7u",L="lc-Tab-module__tab__count___gc8tA",A="lc-Tab-module__tab__badge___W9c-T",_={tab:z,tab__count:L,"tab--compact":"lc-Tab-module__tab--compact___4qead","tab--medium":"lc-Tab-module__tab--medium___bHnGV","tab--large":"lc-Tab-module__tab--large___JL30g",tab__badge:A,"tab--selected":"lc-Tab-module__tab--selected___c0EkL","tab--disabled":"lc-Tab-module__tab--disabled___URdTh"},c="tab",C=B=>{var r=B,{children:e,className:t,count:a,isSelected:s,asBadge:d,size:E="medium"}=r,o=g(r,["children","className","count","isSelected","asBadge","size"]);const{disabled:O}=o,q=a!==void 0&&!d,v=a!==void 0&&d;return b.createElement(f.Text,p(T({},o),{as:o.href?"a":"button",size:"md",bold:s,className:n(t,_[c],_[`${c}--${E}`],s&&_[`${c}--selected`],O&&_[`${c}--disabled`])}),e,q&&b.createElement(f.Text,{as:"span",size:"md",className:_[`${c}__count`]},"(",a,")"),v&&b.createElement(W.Badge,{"data-testid":"tab-badge",count:a,size:"compact",className:_[`${c}__badge`]}))},M="lc-TabsWrapper-module__tabs___Y2xyD",R="lc-TabsWrapper-module__tabs__list___i6tVO",y={tabs:M,tabs__list:R},$="tabs",S=({className:e,children:t})=>b.createElement("div",{className:n(y[$],e)},t),k=({className:e,children:t})=>b.createElement("div",{className:n(y[`${$}__list`],e)},t);exports.Tab=C;exports.TabsList=k;exports.TabsWrapper=S;
|
|
@@ -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 { T as $ } from "../../chunks/Text-b31d1e9a.js";
|
|
26
|
-
import "../../chunks/Typography.module-93efb34d.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"),D=require("../../chunks/Text-df483689.js");require("../../chunks/Typography.module-2558416b.js");function P(e){const a=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const t in e)if(t!=="default"){const _=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(a,t,_.get?_:{enumerable:!0,get:()=>e[t]})}}return a.default=e,Object.freeze(a)}const c=P(w),z="lc-Tag-module__tag___1QRVY",N="lc-Tag-module__tag__remove___UmtrW",K="lc-Tag-module__icon___2Z-35",M="lc-Tag-module__tag__node___rZTzB",Q="lc-Tag-module__tag__content___q6vKK",n={tag:z,"tag--success":"lc-Tag-module__tag--success___P2hXQ",tag__remove:N,"tag--error":"lc-Tag-module__tag--error___1cjsm","tag--warning":"lc-Tag-module__tag--warning___PstMG","tag--info":"lc-Tag-module__tag--info___RTH0C","tag--purple":"lc-Tag-module__tag--purple___a0xaE","tag--black":"lc-Tag-module__tag--black___qWjfD","tag--outline":"lc-Tag-module__tag--outline___aZXtr","tag--small":"lc-Tag-module__tag--small___xfcC5","tag--medium":"lc-Tag-module__tag--medium___l5-KI","tag--large":"lc-Tag-module__tag--large___ytC6Y","tag--xlarge":"lc-Tag-module__tag--xlarge___2jj1d",icon:K,"tag--text-white":"lc-Tag-module__tag--text-white___x0fnD","tag--text-black":"lc-Tag-module__tag--text-black___dUvmD","tag--dismissible":"lc-Tag-module__tag--dismissible___Qobyr",tag__node:M,tag__content:Q},o="tag",Z=e=>e?p.getContrast(e,"#FFFFFF")>4.5?"text-white":"text-black":"",U=W=>{var u=W,{className:e="",children:a,dismissible:t=!1,size:_="medium",kind:v="default",onRemove:y,outline:g=!1,leftNode:m,rightNode:d,customColor:l}=u,$=F(u,["className","children","dismissible","size","kind","onRemove","outline","leftNode","rightNode","customColor"]);const C=R(n[o],e,n[`${o}--${_}`],n[`${o}--${v}`],{[n[`${o}--dismissible`]]:t,[n[`${o}--outline`]]:g,[n[`${o}--${Z(l)}`]]:!!l}),j=_==="small"?"small":"medium",k=_==="small"?"sm":"md",q=()=>l?g?{style:{backgroundColor:"transparent",color:l,borderColor:l}}:{style:{backgroundColor:l}}:{},s=()=>{if(l)return g?l:p.getContrast(l,"#FFFFFF")>4.5?"#FFFFFF":"#000000"};return c.createElement(D.Text,x(i(i({className:C},$),q()),{as:"div",size:k}),m&&c.createElement("div",{"data-testid":"lc-tag-left-node",className:n[`${o}__node`],style:{color:s()}},m),c.createElement("div",{className:n[`${o}__content`]},a),d&&c.createElement("div",{"data-testid":"lc-tag-right-node",style:{color:s()}},d),t&&c.createElement("button",{tabIndex:-1,title:"Remove",onClick:y,type:"button","aria-label":"Remove tag",className:n[`${o}__remove`]},c.createElement(h.Icon,{"data-dismiss-icon":!0,source:O.Close,size:j,customColor:s()})))};exports.Tag=U;
|
|
@@ -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 { T as K } from "../../chunks/Text-b31d1e9a.js";
|
|
28
|
-
import "../../chunks/Typography.module-93efb34d.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"),U=require("../../chunks/Text-df483689.js"),W=require("../Tag/index.cjs.js"),w=require("lodash.escape");require("@livechat/design-system-icons");require("../Icon/index.cjs.js");require("../../chunks/Typography.module-2558416b.js");require("polished");function Z(t){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const n in t)if(n!=="default"){const a=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(e,n,a.get?a:{enumerable:!0,get:()=>t[n]})}}return e.default=t,Object.freeze(e)}const c=Z(J),ee=({className:t="",innerEditableRef:e,inputRef:n,change:a,remove:o,value:m})=>{const[_,d]=c.useState(!1),s=()=>e.current,p=()=>{const u=s();return u?u.innerText:""},x=()=>{n&&n.current&&n.current.focus()},v=u=>{if(u.key===i.KeyCodes.enter){u.preventDefault(),x();return}u.key===i.KeyCodes.backspace&&p()===""&&(d(!0),o(),x())},q=()=>{const u=s();if(!(_||!u)){if(u.innerText===""){o();return}a(u.innerText)}},y=u=>{u.preventDefault();const C=u.clipboardData.getData("text/plain");document.execCommand("insertHTML",!1,w(C))};return c.createElement("div",{ref:e,className:t,contentEditable:!0,onPaste:y,onBlur:q,onKeyDown:v,dangerouslySetInnerHTML:{__html:w(m)}})},T={"tag-input":"lc-TagInput-module__tag-input___CLVY-","tag-input--error":"lc-TagInput-module__tag-input--error___RP0SB","tag-input__input":"lc-TagInput-module__tag-input__input___dgEYB","tag-input__input--medium":"lc-TagInput-module__tag-input__input--medium___DYF7X","tag-input__input--large":"lc-TagInput-module__tag-input__input--large___G6iEO","tag-input__tag__content":"lc-TagInput-module__tag-input__tag__content___x95-M"},te="tag-input__tag",ne=({children:t,index:e,remove:n,validator:a,inputRef:o,update:m,size:_})=>{const d=c.useMemo(()=>a!==void 0?a(t):!0,[t,a]),s=c.useRef(null),p=()=>n(e);return c.createElement(W.Tag,{kind:d?"default":"error",dismissible:!0,size:_,onRemove:p},c.createElement(ee,{value:t,inputRef:o,innerEditableRef:s,className:T[`${te}__content`],change:x=>m(e,x),remove:p,validator:a}))},E="tag-input",ae=[i.KeyCodes.enter,i.KeyCodes.spacebar,i.KeyCodes.tab,i.KeyCodes.semicolon,i.KeyCodes.comma],re=[i.KeyCodes.backspace,i.KeyCodes.delete],h=q=>{var y=q,{id:t,tags:e,onChange:n,validator:a,error:o,placeholder:m,size:_="medium",className:d,inputClassName:s,onBlur:p,addOnBlur:x=!0}=y,v=K(y,["id","tags","onChange","validator","error","placeholder","size","className","inputClassName","onBlur","addOnBlur"]);const u=V(T[E],{[T[`${E}--error`]]:o},d),C=V(s,T[`${E}__input`],T[`${E}__input--${_}`]),[f,O]=c.useState(""),$=c.useRef(null),k=r=>{n([...e||[],r]),O("")},z=r=>{const l=[...e||[]];l.splice(r,1),n(l)},M=r=>O(r.target.value),N=r=>{if(ae.includes(r.key)){if(r.preventDefault(),f==="")return;k(f)}else if(re.includes(r.key)){if(f!==""||!(e!=null&&e.length))return;z(e.length-1)}},j=r=>{x&&k(f),p==null||p(r)},F=(r,l)=>{const g=[...e||[]];g.reduce((Y,H,B)=>Y+(H===l&&B!==r?1:0),0)>0?g.splice(r,1):g[r]=l,n(g)},L=r=>{r.preventDefault();const g=r.clipboardData.getData("text/plain").split(/[\s,;\n]+/);n([...e||[],...g])};return c.createElement(c.Fragment,null,c.createElement(U.Text,{as:"div",className:u},e==null?void 0:e.map((r,l)=>c.createElement(ne,{index:l,key:`${l}${r}`,update:F,remove:z,inputRef:$,validator:a,size:_},r)),c.createElement("input",D(I({},v),{id:t,ref:$,className:C,placeholder:m,value:f,onChange:M,onKeyDown:N,onPaste:L,onBlur:j}))),o&&c.createElement(Q.FieldError,null,o))},ue=/^(?:[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*|"(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21\x23-\x5b\x5d-\x7f]|\\[\x01-\x09\x0b\x0c\x0e-\x7f])*")@(?:(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?|\[(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?|[a-z0-9-]*[a-z0-9]:(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21-\x5a\x53-\x7f]|\\[\x01-\x09\x0b\x0c\x0e-\x7f])+)])$/i,ce="name@company.com",oe=t=>ue.test(t),se=d=>{var s=d,{id:t,tags:e,onChange:n,error:a,placeholder:o=ce,size:m}=s,_=K(s,["id","tags","onChange","error","placeholder","size"]);return c.createElement(h,D(I({},_),{id:t,tags:e,error:a,onChange:n,placeholder:o,validator:oe,size:m}))};exports.EmailTagInput=se;exports.TagInput=h;
|
|
@@ -1,244 +0,0 @@
|
|
|
1
|
-
var X = Object.defineProperty, j = Object.defineProperties;
|
|
2
|
-
var q = Object.getOwnPropertyDescriptors;
|
|
3
|
-
var E = Object.getOwnPropertySymbols;
|
|
4
|
-
var w = Object.prototype.hasOwnProperty, N = Object.prototype.propertyIsEnumerable;
|
|
5
|
-
var h = (t, e, n) => e in t ? X(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n, D = (t, e) => {
|
|
6
|
-
for (var n in e || (e = {}))
|
|
7
|
-
w.call(e, n) && h(t, n, e[n]);
|
|
8
|
-
if (E)
|
|
9
|
-
for (var n of E(e))
|
|
10
|
-
N.call(e, n) && h(t, n, e[n]);
|
|
11
|
-
return t;
|
|
12
|
-
}, $ = (t, e) => j(t, q(e));
|
|
13
|
-
var z = (t, e) => {
|
|
14
|
-
var n = {};
|
|
15
|
-
for (var r in t)
|
|
16
|
-
w.call(t, r) && e.indexOf(r) < 0 && (n[r] = t[r]);
|
|
17
|
-
if (t != null && E)
|
|
18
|
-
for (var r of E(t))
|
|
19
|
-
e.indexOf(r) < 0 && N.call(t, r) && (n[r] = t[r]);
|
|
20
|
-
return n;
|
|
21
|
-
};
|
|
22
|
-
import * as c from "react";
|
|
23
|
-
import O from "clsx";
|
|
24
|
-
import { K as i } from "../../chunks/keyCodes-30323e90.js";
|
|
25
|
-
import { FieldError as A } from "../FieldError/index.es.js";
|
|
26
|
-
import { T as J } from "../../chunks/Text-b31d1e9a.js";
|
|
27
|
-
import { Tag as Q } from "../Tag/index.es.js";
|
|
28
|
-
import P from "lodash.escape";
|
|
29
|
-
import "@livechat/design-system-icons";
|
|
30
|
-
import "../Icon/index.es.js";
|
|
31
|
-
import "../../chunks/Typography.module-93efb34d.js";
|
|
32
|
-
import "polished";
|
|
33
|
-
const U = ({
|
|
34
|
-
className: t = "",
|
|
35
|
-
innerEditableRef: e,
|
|
36
|
-
inputRef: n,
|
|
37
|
-
change: r,
|
|
38
|
-
remove: u,
|
|
39
|
-
value: _
|
|
40
|
-
}) => {
|
|
41
|
-
const [m, x] = c.useState(!1), s = () => e.current, p = () => {
|
|
42
|
-
const o = s();
|
|
43
|
-
return o ? o.innerText : "";
|
|
44
|
-
}, f = () => {
|
|
45
|
-
n && n.current && n.current.focus();
|
|
46
|
-
}, y = (o) => {
|
|
47
|
-
if (o.key === i.enter) {
|
|
48
|
-
o.preventDefault(), f();
|
|
49
|
-
return;
|
|
50
|
-
}
|
|
51
|
-
o.key === i.backspace && p() === "" && (x(!0), u(), f());
|
|
52
|
-
}, R = () => {
|
|
53
|
-
const o = s();
|
|
54
|
-
if (!(m || !o)) {
|
|
55
|
-
if (o.innerText === "") {
|
|
56
|
-
u();
|
|
57
|
-
return;
|
|
58
|
-
}
|
|
59
|
-
r(o.innerText);
|
|
60
|
-
}
|
|
61
|
-
}, b = (o) => {
|
|
62
|
-
o.preventDefault();
|
|
63
|
-
const I = o.clipboardData.getData("text/plain");
|
|
64
|
-
document.execCommand("insertHTML", !1, P(I));
|
|
65
|
-
};
|
|
66
|
-
return /* @__PURE__ */ c.createElement(
|
|
67
|
-
"div",
|
|
68
|
-
{
|
|
69
|
-
ref: e,
|
|
70
|
-
className: t,
|
|
71
|
-
contentEditable: !0,
|
|
72
|
-
onPaste: b,
|
|
73
|
-
onBlur: R,
|
|
74
|
-
onKeyDown: y,
|
|
75
|
-
dangerouslySetInnerHTML: { __html: P(_) }
|
|
76
|
-
}
|
|
77
|
-
);
|
|
78
|
-
}, T = {
|
|
79
|
-
"tag-input": "lc-TagInput-module__tag-input___CLVY-",
|
|
80
|
-
"tag-input--error": "lc-TagInput-module__tag-input--error___RP0SB",
|
|
81
|
-
"tag-input__input": "lc-TagInput-module__tag-input__input___dgEYB",
|
|
82
|
-
"tag-input__input--medium": "lc-TagInput-module__tag-input__input--medium___DYF7X",
|
|
83
|
-
"tag-input__input--large": "lc-TagInput-module__tag-input__input--large___G6iEO",
|
|
84
|
-
"tag-input__tag__content": "lc-TagInput-module__tag-input__tag__content___x95-M"
|
|
85
|
-
}, W = "tag-input__tag", Z = ({
|
|
86
|
-
children: t,
|
|
87
|
-
index: e,
|
|
88
|
-
remove: n,
|
|
89
|
-
validator: r,
|
|
90
|
-
inputRef: u,
|
|
91
|
-
update: _,
|
|
92
|
-
size: m
|
|
93
|
-
}) => {
|
|
94
|
-
const x = c.useMemo(() => r !== void 0 ? r(t) : !0, [t, r]), s = c.useRef(null), p = () => n(e);
|
|
95
|
-
return /* @__PURE__ */ c.createElement(
|
|
96
|
-
Q,
|
|
97
|
-
{
|
|
98
|
-
kind: x ? "default" : "error",
|
|
99
|
-
dismissible: !0,
|
|
100
|
-
size: m,
|
|
101
|
-
onRemove: p
|
|
102
|
-
},
|
|
103
|
-
/* @__PURE__ */ c.createElement(
|
|
104
|
-
U,
|
|
105
|
-
{
|
|
106
|
-
value: t,
|
|
107
|
-
inputRef: u,
|
|
108
|
-
innerEditableRef: s,
|
|
109
|
-
className: T[`${W}__content`],
|
|
110
|
-
change: (f) => _(e, f),
|
|
111
|
-
remove: p,
|
|
112
|
-
validator: r
|
|
113
|
-
}
|
|
114
|
-
)
|
|
115
|
-
);
|
|
116
|
-
}, v = "tag-input", ee = [
|
|
117
|
-
i.enter,
|
|
118
|
-
i.spacebar,
|
|
119
|
-
i.tab,
|
|
120
|
-
i.semicolon,
|
|
121
|
-
i.comma
|
|
122
|
-
], te = [i.backspace, i.delete], ne = (R) => {
|
|
123
|
-
var b = R, {
|
|
124
|
-
id: t,
|
|
125
|
-
tags: e,
|
|
126
|
-
onChange: n,
|
|
127
|
-
validator: r,
|
|
128
|
-
error: u,
|
|
129
|
-
placeholder: _,
|
|
130
|
-
size: m = "medium",
|
|
131
|
-
className: x,
|
|
132
|
-
inputClassName: s,
|
|
133
|
-
onBlur: p,
|
|
134
|
-
addOnBlur: f = !0
|
|
135
|
-
} = b, y = z(b, [
|
|
136
|
-
"id",
|
|
137
|
-
"tags",
|
|
138
|
-
"onChange",
|
|
139
|
-
"validator",
|
|
140
|
-
"error",
|
|
141
|
-
"placeholder",
|
|
142
|
-
"size",
|
|
143
|
-
"className",
|
|
144
|
-
"inputClassName",
|
|
145
|
-
"onBlur",
|
|
146
|
-
"addOnBlur"
|
|
147
|
-
]);
|
|
148
|
-
const o = O(
|
|
149
|
-
T[v],
|
|
150
|
-
{
|
|
151
|
-
[T[`${v}--error`]]: u
|
|
152
|
-
},
|
|
153
|
-
x
|
|
154
|
-
), I = O(
|
|
155
|
-
s,
|
|
156
|
-
T[`${v}__input`],
|
|
157
|
-
T[`${v}__input--${m}`]
|
|
158
|
-
), [g, k] = c.useState(""), V = c.useRef(null), C = (a) => {
|
|
159
|
-
n([...e || [], a]), k("");
|
|
160
|
-
}, K = (a) => {
|
|
161
|
-
const l = [...e || []];
|
|
162
|
-
l.splice(a, 1), n(l);
|
|
163
|
-
}, S = (a) => k(a.target.value), M = (a) => {
|
|
164
|
-
if (ee.includes(a.key)) {
|
|
165
|
-
if (a.preventDefault(), g === "")
|
|
166
|
-
return;
|
|
167
|
-
C(g);
|
|
168
|
-
} else if (te.includes(a.key)) {
|
|
169
|
-
if (g !== "" || !(e != null && e.length))
|
|
170
|
-
return;
|
|
171
|
-
K(e.length - 1);
|
|
172
|
-
}
|
|
173
|
-
}, F = (a) => {
|
|
174
|
-
f && C(g), p == null || p(a);
|
|
175
|
-
}, L = (a, l) => {
|
|
176
|
-
const d = [...e || []];
|
|
177
|
-
d.reduce(
|
|
178
|
-
(H, B, G) => H + (B === l && G !== a ? 1 : 0),
|
|
179
|
-
0
|
|
180
|
-
) > 0 ? d.splice(a, 1) : d[a] = l, n(d);
|
|
181
|
-
}, Y = (a) => {
|
|
182
|
-
a.preventDefault();
|
|
183
|
-
const d = a.clipboardData.getData("text/plain").split(/[\s,;\n]+/);
|
|
184
|
-
n([...e || [], ...d]);
|
|
185
|
-
};
|
|
186
|
-
return /* @__PURE__ */ c.createElement(c.Fragment, null, /* @__PURE__ */ c.createElement(J, { as: "div", className: o }, e == null ? void 0 : e.map((a, l) => /* @__PURE__ */ c.createElement(
|
|
187
|
-
Z,
|
|
188
|
-
{
|
|
189
|
-
index: l,
|
|
190
|
-
key: `${l}${a}`,
|
|
191
|
-
update: L,
|
|
192
|
-
remove: K,
|
|
193
|
-
inputRef: V,
|
|
194
|
-
validator: r,
|
|
195
|
-
size: m
|
|
196
|
-
},
|
|
197
|
-
a
|
|
198
|
-
)), /* @__PURE__ */ c.createElement(
|
|
199
|
-
"input",
|
|
200
|
-
$(D({}, y), {
|
|
201
|
-
id: t,
|
|
202
|
-
ref: V,
|
|
203
|
-
className: I,
|
|
204
|
-
placeholder: _,
|
|
205
|
-
value: g,
|
|
206
|
-
onChange: S,
|
|
207
|
-
onKeyDown: M,
|
|
208
|
-
onPaste: Y,
|
|
209
|
-
onBlur: F
|
|
210
|
-
})
|
|
211
|
-
)), u && /* @__PURE__ */ c.createElement(A, null, u));
|
|
212
|
-
}, ae = /^(?:[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*|"(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21\x23-\x5b\x5d-\x7f]|\\[\x01-\x09\x0b\x0c\x0e-\x7f])*")@(?:(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?|\[(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?|[a-z0-9-]*[a-z0-9]:(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21-\x5a\x53-\x7f]|\\[\x01-\x09\x0b\x0c\x0e-\x7f])+)])$/i, re = "name@company.com", oe = (t) => ae.test(t), Te = (x) => {
|
|
213
|
-
var s = x, {
|
|
214
|
-
id: t,
|
|
215
|
-
tags: e,
|
|
216
|
-
onChange: n,
|
|
217
|
-
error: r,
|
|
218
|
-
placeholder: u = re,
|
|
219
|
-
size: _
|
|
220
|
-
} = s, m = z(s, [
|
|
221
|
-
"id",
|
|
222
|
-
"tags",
|
|
223
|
-
"onChange",
|
|
224
|
-
"error",
|
|
225
|
-
"placeholder",
|
|
226
|
-
"size"
|
|
227
|
-
]);
|
|
228
|
-
return /* @__PURE__ */ c.createElement(
|
|
229
|
-
ne,
|
|
230
|
-
$(D({}, m), {
|
|
231
|
-
id: t,
|
|
232
|
-
tags: e,
|
|
233
|
-
error: r,
|
|
234
|
-
onChange: n,
|
|
235
|
-
placeholder: u,
|
|
236
|
-
validator: oe,
|
|
237
|
-
size: _
|
|
238
|
-
})
|
|
239
|
-
);
|
|
240
|
-
};
|
|
241
|
-
export {
|
|
242
|
-
Te as EmailTagInput,
|
|
243
|
-
ne as TagInput
|
|
244
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";var v=Object.defineProperty,S=Object.defineProperties;var E=Object.getOwnPropertyDescriptors;var s=Object.getOwnPropertySymbols;var f=Object.prototype.hasOwnProperty,m=Object.prototype.propertyIsEnumerable;var x=(e,a,t)=>a in e?v(e,a,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[a]=t,b=(e,a)=>{for(var t in a||(a={}))f.call(a,t)&&x(e,t,a[t]);if(s)for(var t of s(a))m.call(a,t)&&x(e,t,a[t]);return e},T=(e,a)=>S(e,E(a));var g=(e,a)=>{var t={};for(var r in e)f.call(e,r)&&a.indexOf(r)<0&&(t[r]=e[r]);if(e!=null&&s)for(var r of s(e))a.indexOf(r)<0&&m.call(e,r)&&(t[r]=e[r]);return t};Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const F=require("react"),N=require("clsx"),R=require("../../chunks/Text-df483689.js");require("../../chunks/Typography.module-2558416b.js");function $(e){const a=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const t in e)if(t!=="default"){const r=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(a,t,r.get?r:{enumerable:!0,get:()=>e[t]})}}return a.default=e,Object.freeze(a)}const c=$(F),h="lc-Textarea-module__textarea___g6U8F",o={textarea:h,"textarea--focused":"lc-Textarea-module__textarea--focused___1vtEx","textarea--disabled":"lc-Textarea-module__textarea--disabled___xXaGv","textarea--error":"lc-Textarea-module__textarea--error___0EGuq"},n="textarea",w=c.forwardRef((C,r)=>{var _=C,{className:e,error:a}=_,t=g(_,["className","error"]);const{disabled:O,onBlur:l,onFocus:u}=t,[p,i]=c.useState(!1),y=N(e,o[n],{[o[`${n}--disabled`]]:O,[o[`${n}--focused`]]:p,[o[`${n}--error`]]:a}),j=d=>{i(!1),l==null||l(d)},q=d=>{i(!0),u==null||u(d)};return c.createElement(R.Text,{as:"div",className:y},c.createElement("textarea",T(b({},t),{ref:r,onFocus:q,onBlur:j})))});exports.Textarea=w;
|