@livechat/design-system-react-components 1.17.1-alpha.1 → 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 +5231 -120
- package/dist/preview-stats.json +1158 -1158
- 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/Heading-1a31001f.js +0 -64
- package/dist/chunks/Heading-597d11a4.js +0 -1
- package/dist/chunks/ProgressBar-0e01c602.js +0 -88
- package/dist/chunks/ProgressBar-dd89d43a.js +0 -1
- package/dist/chunks/Text-78b02609.js +0 -66
- package/dist/chunks/Text-dd6930a2.js +0 -1
- package/dist/chunks/Tooltip-21230071.js +0 -1
- package/dist/chunks/Tooltip-f4d8b8fd.js +0 -182
- package/dist/chunks/Typography.module-58a031dc.js +0 -24
- package/dist/chunks/Typography.module-8b7171c2.js +0 -1
- 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 -188
- 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 -128
- 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 -66
- package/dist/components/Button/index.cjs.js +0 -1
- package/dist/components/Button/index.es.js +0 -142
- package/dist/components/Card/index.cjs.js +0 -1
- package/dist/components/Card/index.es.js +0 -95
- 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 -517
- package/dist/components/DetailsCard/index.cjs.js +0 -1
- package/dist/components/DetailsCard/index.es.js +0 -138
- package/dist/components/DetailsCardInfo/index.cjs.js +0 -1
- package/dist/components/DetailsCardInfo/index.es.js +0 -13
- 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 -55
- 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 -114
- 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 -104
- package/dist/components/Input/index.cjs.js +0 -1
- package/dist/components/Input/index.es.js +0 -122
- package/dist/components/Link/index.cjs.js +0 -1
- package/dist/components/Link/index.es.js +0 -48
- 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 -248
- package/dist/components/NumericInput/index.cjs.js +0 -1
- package/dist/components/NumericInput/index.es.js +0 -140
- package/dist/components/Picker/index.cjs.js +0 -1
- package/dist/components/Picker/index.es.js +0 -738
- 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 -104
- package/dist/components/PromoBanner/index.cjs.js +0 -1
- package/dist/components/PromoBanner/index.es.js +0 -73
- package/dist/components/PromoBannerV2/index.cjs.js +0 -1
- package/dist/components/PromoBannerV2/index.es.js +0 -77
- 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 -53
- package/dist/components/Switch/index.cjs.js +0 -1
- package/dist/components/Switch/index.es.js +0 -144
- 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 -241
- 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 -162
- package/dist/components/Tooltip/components/UserGuide/index.cjs.js +0 -1
- package/dist/components/Tooltip/components/UserGuide/index.es.js +0 -193
- package/dist/components/Tooltip/components/index.cjs.js +0 -1
- package/dist/components/Tooltip/components/index.es.js +0 -114
- package/dist/components/Tooltip/index.cjs.js +0 -1
- package/dist/components/Tooltip/index.es.js +0 -11
- 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
|
@@ -1,182 +0,0 @@
|
|
|
1
|
-
var ao = Object.defineProperty, co = Object.defineProperties;
|
|
2
|
-
var uo = Object.getOwnPropertyDescriptors;
|
|
3
|
-
var P = Object.getOwnPropertySymbols;
|
|
4
|
-
var mo = Object.prototype.hasOwnProperty, fo = Object.prototype.propertyIsEnumerable;
|
|
5
|
-
var S = (t, o, e) => o in t ? ao(t, o, { enumerable: !0, configurable: !0, writable: !0, value: e }) : t[o] = e, r = (t, o) => {
|
|
6
|
-
for (var e in o || (o = {}))
|
|
7
|
-
mo.call(o, e) && S(t, e, o[e]);
|
|
8
|
-
if (P)
|
|
9
|
-
for (var e of P(o))
|
|
10
|
-
fo.call(o, e) && S(t, e, o[e]);
|
|
11
|
-
return t;
|
|
12
|
-
}, f = (t, o) => co(t, uo(o));
|
|
13
|
-
import "../assets/style-Tooltip.css";
|
|
14
|
-
import * as i from "react";
|
|
15
|
-
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
|
-
import Vo from "clsx";
|
|
17
|
-
import { T as Do } from "./Text-78b02609.js";
|
|
18
|
-
function Wo(t) {
|
|
19
|
-
switch (t) {
|
|
20
|
-
case "invert":
|
|
21
|
-
return "inverted";
|
|
22
|
-
default:
|
|
23
|
-
return "primary";
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
function Io(t, o, e, _) {
|
|
27
|
-
if (e)
|
|
28
|
-
return {
|
|
29
|
-
top: t ? e + t : e
|
|
30
|
-
};
|
|
31
|
-
if (_)
|
|
32
|
-
return {
|
|
33
|
-
left: o ? _ + o : _
|
|
34
|
-
};
|
|
35
|
-
}
|
|
36
|
-
const Qo = "lc-Tooltip-module__tooltip___QOOAr", jo = "lc-Tooltip-module__tooltip__arrow___Ov1YW", No = "lc-Tooltip-module__tooltip__interactive___0JawB", n = {
|
|
37
|
-
tooltip: Qo,
|
|
38
|
-
tooltip__arrow: jo,
|
|
39
|
-
"tooltip--invert": "lc-Tooltip-module__tooltip--invert___PVjhE",
|
|
40
|
-
"tooltip--important": "lc-Tooltip-module__tooltip--important___X-IMK",
|
|
41
|
-
tooltip__interactive: No,
|
|
42
|
-
"tooltip__user-guide-step": "lc-Tooltip-module__tooltip__user-guide-step___evexI",
|
|
43
|
-
"tooltip--full-space": "lc-Tooltip-module__tooltip--full-space___wmbaw",
|
|
44
|
-
"tooltip-header": "lc-Tooltip-module__tooltip-header___QV0Vd",
|
|
45
|
-
"tooltip-header--info": "lc-Tooltip-module__tooltip-header--info___zLJ2Z",
|
|
46
|
-
"tooltip-image-container": "lc-Tooltip-module__tooltip-image-container___ySmcd",
|
|
47
|
-
"tooltip-image": "lc-Tooltip-module__tooltip-image___Aorwg",
|
|
48
|
-
"tooltip-text--info": "lc-Tooltip-module__tooltip-text--info___3d2Ql",
|
|
49
|
-
"tooltip-close": "lc-Tooltip-module__tooltip-close___3r3h9",
|
|
50
|
-
"tooltip-step": "lc-Tooltip-module__tooltip-step___-j0n8",
|
|
51
|
-
"tooltip-footer": "lc-Tooltip-module__tooltip-footer___9hxFq",
|
|
52
|
-
"tooltip-footer-secondary": "lc-Tooltip-module__tooltip-footer-secondary___WBgVR",
|
|
53
|
-
"tooltip-footer-secondary-invert": "lc-Tooltip-module__tooltip-footer-secondary-invert___PuAQL",
|
|
54
|
-
"tooltip-footer--interactive": "lc-Tooltip-module__tooltip-footer--interactive___hqMM5",
|
|
55
|
-
"tooltip-footer--user-guide-step": "lc-Tooltip-module__tooltip-footer--user-guide-step___i7z3S",
|
|
56
|
-
"guide-tooltip--slide": "lc-Tooltip-module__guide-tooltip--slide___Uawm2",
|
|
57
|
-
"guide-tooltip__overlay": "lc-Tooltip-module__guide-tooltip__overlay___IyrKK",
|
|
58
|
-
"guide-tooltip__overlay--slide": "lc-Tooltip-module__guide-tooltip__overlay--slide___VW8oq",
|
|
59
|
-
"guide-tooltip__overlay--visible": "lc-Tooltip-module__guide-tooltip__overlay--visible___dbdsZ",
|
|
60
|
-
"reports-tooltip": "lc-Tooltip-module__reports-tooltip___amyTo",
|
|
61
|
-
"reports-tooltip__heading": "lc-Tooltip-module__reports-tooltip__heading___FtjvD",
|
|
62
|
-
"reports-tooltip__heading__title": "lc-Tooltip-module__reports-tooltip__heading__title___6TlzE",
|
|
63
|
-
"reports-tooltip__heading__description": "lc-Tooltip-module__reports-tooltip__heading__description___eOQnc",
|
|
64
|
-
"reports-tooltip__content": "lc-Tooltip-module__reports-tooltip__content___jxis9"
|
|
65
|
-
}, a = "tooltip", ko = ({
|
|
66
|
-
children: t,
|
|
67
|
-
className: o,
|
|
68
|
-
triggerClassName: e,
|
|
69
|
-
triggerRenderer: _,
|
|
70
|
-
theme: c,
|
|
71
|
-
kind: b,
|
|
72
|
-
placement: F = "bottom",
|
|
73
|
-
isVisible: T,
|
|
74
|
-
fullSpaceContent: E,
|
|
75
|
-
onClose: d,
|
|
76
|
-
onOpen: u,
|
|
77
|
-
withFadeAnimation: M = !0,
|
|
78
|
-
transitionDuration: R = 200,
|
|
79
|
-
hoverOnDuration: A,
|
|
80
|
-
hoverOffDuration: V,
|
|
81
|
-
transitionDelay: D = 0,
|
|
82
|
-
hoverOnDelay: I,
|
|
83
|
-
hoverOffDelay: Q,
|
|
84
|
-
triggerOnClick: j = !1,
|
|
85
|
-
offsetMainAxis: N = 8,
|
|
86
|
-
referenceElement: m,
|
|
87
|
-
activationThreshold: $ = 0,
|
|
88
|
-
useDismissHookProps: q,
|
|
89
|
-
useClickHookProps: z,
|
|
90
|
-
hoverOutDelayTimeout: C = 100,
|
|
91
|
-
arrowOffsetY: K,
|
|
92
|
-
arrowOffsetX: W,
|
|
93
|
-
closeOnTriggerBlur: k = !1,
|
|
94
|
-
floatingStrategy: B
|
|
95
|
-
}) => {
|
|
96
|
-
const g = T !== void 0, [J, L] = i.useState(!1), y = i.useRef(null), v = g ? T : J, h = b || c, U = Vo(
|
|
97
|
-
n[a],
|
|
98
|
-
o,
|
|
99
|
-
h && n[`${a}--${h}`],
|
|
100
|
-
E && n[`${a}--full-space`]
|
|
101
|
-
), Z = typeof _ == "function", H = (l) => {
|
|
102
|
-
l !== v && (l ? u == null || u() : d == null || d(), !g && L(l));
|
|
103
|
-
}, w = (l) => M ? l != null ? l : R : 0, x = (l) => l != null ? l : D, {
|
|
104
|
-
floatingStyles: X,
|
|
105
|
-
refs: p,
|
|
106
|
-
context: s,
|
|
107
|
-
middlewareData: { arrow: { x: Y, y: G } = {} },
|
|
108
|
-
placement: O
|
|
109
|
-
} = To({
|
|
110
|
-
middleware: [
|
|
111
|
-
go({ mainAxis: N }),
|
|
112
|
-
yo(),
|
|
113
|
-
vo(),
|
|
114
|
-
ho({ element: y })
|
|
115
|
-
],
|
|
116
|
-
placement: F,
|
|
117
|
-
open: v,
|
|
118
|
-
strategy: B,
|
|
119
|
-
onOpenChange: H,
|
|
120
|
-
whileElementsMounted: wo
|
|
121
|
-
}), oo = xo(s, {
|
|
122
|
-
move: !1,
|
|
123
|
-
restMs: $,
|
|
124
|
-
delay: {
|
|
125
|
-
open: x(I),
|
|
126
|
-
close: x(Q || C)
|
|
127
|
-
},
|
|
128
|
-
enabled: !j,
|
|
129
|
-
handleClose: k ? null : Po()
|
|
130
|
-
}), to = So(s), eo = bo(s, q), lo = Fo(s, { role: "tooltip" }), io = Eo(s, z), { isMounted: _o, styles: so } = Mo(s, {
|
|
131
|
-
duration: {
|
|
132
|
-
open: w(A),
|
|
133
|
-
close: w(V)
|
|
134
|
-
}
|
|
135
|
-
}), { status: ro } = Ro(s), { getReferenceProps: po, getFloatingProps: no } = Ao([
|
|
136
|
-
oo,
|
|
137
|
-
to,
|
|
138
|
-
eo,
|
|
139
|
-
lo,
|
|
140
|
-
io
|
|
141
|
-
]);
|
|
142
|
-
return i.useEffect(() => {
|
|
143
|
-
m && p.setReference(m);
|
|
144
|
-
}, [p.setReference, m]), /* @__PURE__ */ i.createElement(i.Fragment, null, /* @__PURE__ */ i.createElement(
|
|
145
|
-
"div",
|
|
146
|
-
f(r({
|
|
147
|
-
ref: p.setReference
|
|
148
|
-
}, po()), {
|
|
149
|
-
className: e
|
|
150
|
-
}),
|
|
151
|
-
Z ? _() : _
|
|
152
|
-
), _o && /* @__PURE__ */ i.createElement(
|
|
153
|
-
"div",
|
|
154
|
-
f(r({
|
|
155
|
-
ref: p.setFloating,
|
|
156
|
-
style: r(r({}, X), so),
|
|
157
|
-
className: U
|
|
158
|
-
}, no()), {
|
|
159
|
-
"data-status": ro
|
|
160
|
-
}),
|
|
161
|
-
/* @__PURE__ */ i.createElement(Do, { as: "div" }, t),
|
|
162
|
-
/* @__PURE__ */ i.createElement(
|
|
163
|
-
"div",
|
|
164
|
-
{
|
|
165
|
-
ref: y,
|
|
166
|
-
className: n[`${a}__arrow`],
|
|
167
|
-
"aria-placement": O,
|
|
168
|
-
style: r({}, Io(
|
|
169
|
-
K,
|
|
170
|
-
W,
|
|
171
|
-
G,
|
|
172
|
-
Y
|
|
173
|
-
))
|
|
174
|
-
}
|
|
175
|
-
)
|
|
176
|
-
));
|
|
177
|
-
};
|
|
178
|
-
export {
|
|
179
|
-
ko as T,
|
|
180
|
-
Wo as g,
|
|
181
|
-
n as s
|
|
182
|
-
};
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import "../assets/style-Typography.css";
|
|
2
|
-
const a = {
|
|
3
|
-
"heading-xl": "lc-Typography-module__heading-xl___nhr-6",
|
|
4
|
-
"heading-lg": "lc-Typography-module__heading-lg___XYF7l",
|
|
5
|
-
"heading-md": "lc-Typography-module__heading-md___wHOIs",
|
|
6
|
-
"heading-sm": "lc-Typography-module__heading-sm___nBmTV",
|
|
7
|
-
"heading-xs": "lc-Typography-module__heading-xs___VcZBs",
|
|
8
|
-
"heading-2xs": "lc-Typography-module__heading-2xs___tcrVl",
|
|
9
|
-
"heading-uppercase": "lc-Typography-module__heading-uppercase___cpixD",
|
|
10
|
-
"heading-bold": "lc-Typography-module__heading-bold___ZAPzP",
|
|
11
|
-
"paragraph-md": "lc-Typography-module__paragraph-md___UGoqq",
|
|
12
|
-
"paragraph-sm": "lc-Typography-module__paragraph-sm___QIEFL",
|
|
13
|
-
"paragraph-xs": "lc-Typography-module__paragraph-xs___OUooD",
|
|
14
|
-
"paragraph--bold": "lc-Typography-module__paragraph--bold___9I2wL",
|
|
15
|
-
"paragraph--underline": "lc-Typography-module__paragraph--underline___yFDzp",
|
|
16
|
-
"paragraph--strike": "lc-Typography-module__paragraph--strike___ZDWOj",
|
|
17
|
-
"paragraph--uppercase": "lc-Typography-module__paragraph--uppercase___hdEfX",
|
|
18
|
-
"display-md": "lc-Typography-module__display-md___7eFCF",
|
|
19
|
-
"display-sm": "lc-Typography-module__display-sm___kfNES",
|
|
20
|
-
"display-max": "lc-Typography-module__display-max___vR8yn"
|
|
21
|
-
};
|
|
22
|
-
export {
|
|
23
|
-
a as s
|
|
24
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
var a=require("../assets/style-Typography.css");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 +0,0 @@
|
|
|
1
|
-
"use strict";const e={esc:"Escape",enter:"Enter",backspace:"Backspace",delete:"Delete",spacebar:" ",tab:"Tab",semicolon:";",comma:",",arrowUp:"ArrowUp",arrowDown:"ArrowDown"};exports.KeyCodes=e;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
var O=Object.defineProperty;var y=Object.getOwnPropertySymbols;var q=Object.prototype.hasOwnProperty,S=Object.prototype.propertyIsEnumerable;var B=(e,t,n)=>t in e?O(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,w=(e,t)=>{for(var n in t||(t={}))q.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};var R=require("../../assets/style-index39.css");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-21230071.js");function j(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const n in e)if(n!=="default"){const c=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,c.get?c:{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:c})=>{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:c?"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})},u="action-bar",L=({className:e,id:t="action-bar-area",type:n="menu",options:c,activeOptionKey:d,vertical:l})=>{const[s,v]=r.useState([]),f=n==="scroll",C=b(_[u],e,l&&_[`${u}--vertical`]),p=`${u}__menu-wrapper`,$={root:document.querySelector(`${t}`),threshold:1},N=!f&&s.length!==0,I=i=>{i.map(o=>{const a=s.includes(o.target.id);if(!o.isIntersecting){o.target.setAttribute("tabindex","-1"),a||v(m=>[...m,o.target.id]);return}o.target.removeAttribute("tabindex"),a&&v(s.filter(m=>m!==o.target.id))})};r.useEffect(()=>{const i=!!window.IntersectionObserver;if(!f&&i){const o=document.querySelectorAll(`.${_[`${u}__items__button`]}`),a=new IntersectionObserver(I,$);return o.forEach(m=>a.observe(m)),()=>a.disconnect()}},[s,f]);const M=i=>c.filter(a=>i.find(m=>m===a.key)).map(a=>({key:a.key,element:r.createElement(E.ActionMenuItem,{leftNode:a.element},a.label),onClick:a.onClick})),k=c.filter(i=>s.find(o=>o===i.key)).find(i=>i.key===d);return r.createElement("div",{id:t,className:C},r.createElement("div",{className:b(_[`${u}__items`],{[_[`${u}__items--scroll`]]:f})},c.map(i=>r.createElement(D,{option:i,menuItemsKeys:s,activeOptionKey:d,vertical:l}))),N&&r.createElement("div",{className:_[p]},r.createElement(E.ActionMenu,{placement:l?"left-end":"bottom-end",options:M(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,188 +0,0 @@
|
|
|
1
|
-
var I = Object.defineProperty;
|
|
2
|
-
var w = Object.getOwnPropertySymbols;
|
|
3
|
-
var M = Object.prototype.hasOwnProperty, x = Object.prototype.propertyIsEnumerable;
|
|
4
|
-
var B = (e, t, _) => t in e ? I(e, t, { enumerable: !0, configurable: !0, writable: !0, value: _ }) : e[t] = _, h = (e, t) => {
|
|
5
|
-
for (var _ in t || (t = {}))
|
|
6
|
-
M.call(t, _) && B(e, _, t[_]);
|
|
7
|
-
if (w)
|
|
8
|
-
for (var _ of w(t))
|
|
9
|
-
x.call(t, _) && B(e, _, t[_]);
|
|
10
|
-
return e;
|
|
11
|
-
};
|
|
12
|
-
import "../../assets/style-index39.css";
|
|
13
|
-
import * as n from "react";
|
|
14
|
-
import { ChevronLeft as L, ChevronDown as O } from "@livechat/design-system-icons";
|
|
15
|
-
import u from "clsx";
|
|
16
|
-
import { ActionMenu as S, ActionMenuItem as T } from "../ActionMenu/index.es.js";
|
|
17
|
-
import { Button as A } from "../Button/index.es.js";
|
|
18
|
-
import { Icon as D } from "../Icon/index.es.js";
|
|
19
|
-
import { T as P } from "../../chunks/Tooltip-f4d8b8fd.js";
|
|
20
|
-
const r = {
|
|
21
|
-
"action-bar": "lc-ActionBar-module__action-bar___TJitF",
|
|
22
|
-
"action-bar__items": "lc-ActionBar-module__action-bar__items___uhoQA",
|
|
23
|
-
"action-bar__items--scroll": "lc-ActionBar-module__action-bar__items--scroll___f--dN",
|
|
24
|
-
"action-bar__items__button": "lc-ActionBar-module__action-bar__items__button___Vdjl7",
|
|
25
|
-
"action-bar__items__button--active": "lc-ActionBar-module__action-bar__items__button--active___PFLdm",
|
|
26
|
-
"action-bar__items__button--hidden": "lc-ActionBar-module__action-bar__items__button--hidden___C00VA",
|
|
27
|
-
"action-bar__items__tooltip": "lc-ActionBar-module__action-bar__items__tooltip___BuQPo",
|
|
28
|
-
"action-bar__menu-wrapper": "lc-ActionBar-module__action-bar__menu-wrapper___OMWP5",
|
|
29
|
-
"action-bar__menu-wrapper__button": "lc-ActionBar-module__action-bar__menu-wrapper__button___MDsLx",
|
|
30
|
-
"action-bar__menu-wrapper__button__with-item": "lc-ActionBar-module__action-bar__menu-wrapper__button__with-item___FYlqL",
|
|
31
|
-
"fade-in": "lc-ActionBar-module__fade-in___tQvzD",
|
|
32
|
-
"action-bar__menu-wrapper__button--active": "lc-ActionBar-module__action-bar__menu-wrapper__button--active___Hlzoc",
|
|
33
|
-
"action-bar__menu-wrapper__trigger-vertical": "lc-ActionBar-module__action-bar__menu-wrapper__trigger-vertical___84WL1",
|
|
34
|
-
"action-bar--vertical": "lc-ActionBar-module__action-bar--vertical___tMzLJ"
|
|
35
|
-
}, g = "action-bar__items", V = ({
|
|
36
|
-
option: e,
|
|
37
|
-
menuItemsKeys: t,
|
|
38
|
-
activeOptionKey: _,
|
|
39
|
-
vertical: b
|
|
40
|
-
}) => {
|
|
41
|
-
const d = u(r[`${g}__button`], {
|
|
42
|
-
[r[`${g}__button--hidden`]]: t.includes(
|
|
43
|
-
e.key
|
|
44
|
-
),
|
|
45
|
-
[r[`${g}__button--active`]]: e.key === _
|
|
46
|
-
});
|
|
47
|
-
if (e.showTooltip) {
|
|
48
|
-
const c = t.includes(e.key) && {
|
|
49
|
-
isVisible: !1
|
|
50
|
-
};
|
|
51
|
-
return /* @__PURE__ */ n.createElement(
|
|
52
|
-
P,
|
|
53
|
-
h({
|
|
54
|
-
kind: "invert",
|
|
55
|
-
placement: b ? "left" : "bottom",
|
|
56
|
-
triggerClassName: r[`${g}__tooltip`],
|
|
57
|
-
triggerRenderer: () => /* @__PURE__ */ n.createElement(
|
|
58
|
-
A,
|
|
59
|
-
{
|
|
60
|
-
id: e.key,
|
|
61
|
-
key: e.key,
|
|
62
|
-
title: e.label,
|
|
63
|
-
kind: "plain",
|
|
64
|
-
className: d,
|
|
65
|
-
onClick: e.onClick,
|
|
66
|
-
icon: e.element
|
|
67
|
-
}
|
|
68
|
-
)
|
|
69
|
-
}, c),
|
|
70
|
-
/* @__PURE__ */ n.createElement("div", null, e.label)
|
|
71
|
-
);
|
|
72
|
-
}
|
|
73
|
-
return /* @__PURE__ */ n.createElement(
|
|
74
|
-
A,
|
|
75
|
-
{
|
|
76
|
-
id: e.key,
|
|
77
|
-
key: e.key,
|
|
78
|
-
title: e.label,
|
|
79
|
-
kind: "plain",
|
|
80
|
-
className: d,
|
|
81
|
-
onClick: e.onClick,
|
|
82
|
-
icon: e.element
|
|
83
|
-
}
|
|
84
|
-
);
|
|
85
|
-
}, m = "action-bar", H = ({
|
|
86
|
-
className: e,
|
|
87
|
-
id: t = "action-bar-area",
|
|
88
|
-
type: _ = "menu",
|
|
89
|
-
options: b,
|
|
90
|
-
activeOptionKey: d,
|
|
91
|
-
vertical: c
|
|
92
|
-
}) => {
|
|
93
|
-
const [l, v] = n.useState([]), f = _ === "scroll", y = u(
|
|
94
|
-
r[m],
|
|
95
|
-
e,
|
|
96
|
-
c && r[`${m}--vertical`]
|
|
97
|
-
), p = `${m}__menu-wrapper`, E = {
|
|
98
|
-
root: document.querySelector(`${t}`),
|
|
99
|
-
threshold: 1
|
|
100
|
-
}, C = !f && l.length !== 0, $ = (i) => {
|
|
101
|
-
i.map((o) => {
|
|
102
|
-
const a = l.includes(o.target.id);
|
|
103
|
-
if (!o.isIntersecting) {
|
|
104
|
-
o.target.setAttribute("tabindex", "-1"), a || v((s) => [
|
|
105
|
-
...s,
|
|
106
|
-
o.target.id
|
|
107
|
-
]);
|
|
108
|
-
return;
|
|
109
|
-
}
|
|
110
|
-
o.target.removeAttribute("tabindex"), a && v(l.filter((s) => s !== o.target.id));
|
|
111
|
-
});
|
|
112
|
-
};
|
|
113
|
-
n.useEffect(() => {
|
|
114
|
-
const i = !!window.IntersectionObserver;
|
|
115
|
-
if (!f && i) {
|
|
116
|
-
const o = document.querySelectorAll(
|
|
117
|
-
`.${r[`${m}__items__button`]}`
|
|
118
|
-
), a = new IntersectionObserver(
|
|
119
|
-
$,
|
|
120
|
-
E
|
|
121
|
-
);
|
|
122
|
-
return o.forEach((s) => a.observe(s)), () => a.disconnect();
|
|
123
|
-
}
|
|
124
|
-
}, [l, f]);
|
|
125
|
-
const N = (i) => b.filter(
|
|
126
|
-
(a) => i.find((s) => s === a.key)
|
|
127
|
-
).map((a) => ({
|
|
128
|
-
key: a.key,
|
|
129
|
-
element: /* @__PURE__ */ n.createElement(T, { leftNode: a.element }, a.label),
|
|
130
|
-
onClick: a.onClick
|
|
131
|
-
})), k = b.filter((i) => l.find((o) => o === i.key)).find((i) => i.key === d);
|
|
132
|
-
return /* @__PURE__ */ n.createElement("div", { id: t, className: y }, /* @__PURE__ */ n.createElement(
|
|
133
|
-
"div",
|
|
134
|
-
{
|
|
135
|
-
className: u(r[`${m}__items`], {
|
|
136
|
-
[r[`${m}__items--scroll`]]: f
|
|
137
|
-
})
|
|
138
|
-
},
|
|
139
|
-
b.map((i) => /* @__PURE__ */ n.createElement(
|
|
140
|
-
V,
|
|
141
|
-
{
|
|
142
|
-
option: i,
|
|
143
|
-
menuItemsKeys: l,
|
|
144
|
-
activeOptionKey: d,
|
|
145
|
-
vertical: c
|
|
146
|
-
}
|
|
147
|
-
))
|
|
148
|
-
), C && /* @__PURE__ */ n.createElement("div", { className: r[p] }, /* @__PURE__ */ n.createElement(
|
|
149
|
-
S,
|
|
150
|
-
{
|
|
151
|
-
placement: c ? "left-end" : "bottom-end",
|
|
152
|
-
options: N(l),
|
|
153
|
-
triggerClassName: u(
|
|
154
|
-
c && r[`${p}__trigger-vertical`]
|
|
155
|
-
),
|
|
156
|
-
triggerRenderer: /* @__PURE__ */ n.createElement(
|
|
157
|
-
A,
|
|
158
|
-
{
|
|
159
|
-
className: u(
|
|
160
|
-
r[`${p}__button`],
|
|
161
|
-
k && r[`${p}__button--active`]
|
|
162
|
-
),
|
|
163
|
-
kind: "plain",
|
|
164
|
-
icon: /* @__PURE__ */ n.createElement(
|
|
165
|
-
D,
|
|
166
|
-
{
|
|
167
|
-
source: c ? L : O,
|
|
168
|
-
kind: "primary"
|
|
169
|
-
}
|
|
170
|
-
),
|
|
171
|
-
iconPosition: "right"
|
|
172
|
-
},
|
|
173
|
-
k && /* @__PURE__ */ n.createElement(
|
|
174
|
-
"div",
|
|
175
|
-
{
|
|
176
|
-
className: u(
|
|
177
|
-
r[`${p}__button__with-item`]
|
|
178
|
-
)
|
|
179
|
-
},
|
|
180
|
-
k.element
|
|
181
|
-
)
|
|
182
|
-
)
|
|
183
|
-
}
|
|
184
|
-
)));
|
|
185
|
-
};
|
|
186
|
-
export {
|
|
187
|
-
H as ActionBar
|
|
188
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
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},N=(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};var ye=require("../../assets/style-index38.css");Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const ae=require("react"),l=require("@floating-ui/react"),le=require("@livechat/design-system-icons"),q=require("clsx"),K=require("../../chunks/keyCodes-c4c35e49.js"),ue=require("../Icon/index.cjs.js"),oe=require("../../chunks/Text-dd6930a2.js");function me(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 _=me(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",se=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:s,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),m=_.useRef(-1),S=_.useRef(null),g=v?x:Y,B=()=>{g?(s==null||s(),!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=m.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;m.current=te(e);const r=(y=S.current)==null?void 0:y.children,a=r&&((b=r[m.current])==null?void 0:b.children[0]);return a==null?void 0:a.focus()},D=e=>{e.key===K.KeyCodes.arrowUp&&m.current>0&&(e.preventDefault(),P(-1)),e.key===K.KeyCodes.arrowDown&&m.current+1<n.length&&(e.preventDefault(),P(1))};_.useEffect(()=>{if(g)return document.addEventListener("keydown",D),()=>document.removeEventListener("keydown",D);m.current=-1},[g,D]);const ne=(e,r)=>{m.current=e,r==null||r(),!v&&!F&&(A(!1),s==null||s())},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:q(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",N(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",N(f({},X),{className:q(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:q(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=se;exports.ActionMenuItem=de;
|
|
@@ -1,199 +0,0 @@
|
|
|
1
|
-
var _e = Object.defineProperty, ie = Object.defineProperties;
|
|
2
|
-
var ae = Object.getOwnPropertyDescriptors;
|
|
3
|
-
var M = Object.getOwnPropertySymbols;
|
|
4
|
-
var K = Object.prototype.hasOwnProperty, L = Object.prototype.propertyIsEnumerable;
|
|
5
|
-
var H = (t, _, n) => _ in t ? _e(t, _, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[_] = n, g = (t, _) => {
|
|
6
|
-
for (var n in _ || (_ = {}))
|
|
7
|
-
K.call(_, n) && H(t, n, _[n]);
|
|
8
|
-
if (M)
|
|
9
|
-
for (var n of M(_))
|
|
10
|
-
L.call(_, n) && H(t, n, _[n]);
|
|
11
|
-
return t;
|
|
12
|
-
}, N = (t, _) => ie(t, ae(_));
|
|
13
|
-
var S = (t, _) => {
|
|
14
|
-
var n = {};
|
|
15
|
-
for (var a in t)
|
|
16
|
-
K.call(t, a) && _.indexOf(a) < 0 && (n[a] = t[a]);
|
|
17
|
-
if (t != null && M)
|
|
18
|
-
for (var a of M(t))
|
|
19
|
-
_.indexOf(a) < 0 && L.call(t, a) && (n[a] = t[a]);
|
|
20
|
-
return n;
|
|
21
|
-
};
|
|
22
|
-
import "../../assets/style-index38.css";
|
|
23
|
-
import * as i from "react";
|
|
24
|
-
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
|
-
import { Check as fe } from "@livechat/design-system-icons";
|
|
26
|
-
import x from "clsx";
|
|
27
|
-
import { K as U } from "../../chunks/keyCodes-30323e90.js";
|
|
28
|
-
import { Icon as ye } from "../Icon/index.es.js";
|
|
29
|
-
import { T as be } from "../../chunks/Text-78b02609.js";
|
|
30
|
-
const m = {
|
|
31
|
-
"action-menu": "lc-ActionMenu-module__action-menu___K2UwW",
|
|
32
|
-
"action-menu__trigger-button": "lc-ActionMenu-module__action-menu__trigger-button___tBrz5",
|
|
33
|
-
"action-menu__list": "lc-ActionMenu-module__action-menu__list___9pNUX",
|
|
34
|
-
"action-menu__list__group-header": "lc-ActionMenu-module__action-menu__list__group-header___n-DTq",
|
|
35
|
-
"action-menu__list__item": "lc-ActionMenu-module__action-menu__list__item___n-OgH",
|
|
36
|
-
"action-menu__list__item--with-divider": "lc-ActionMenu-module__action-menu__list__item--with-divider___2H3Vm",
|
|
37
|
-
"action-menu__list__item--disabled": "lc-ActionMenu-module__action-menu__list__item--disabled___MgaX8",
|
|
38
|
-
"action-menu__list__item--selected": "lc-ActionMenu-module__action-menu__list__item--selected___eevlJ",
|
|
39
|
-
"action-menu__list__item__icon": "lc-ActionMenu-module__action-menu__list__item__icon___o3ePo"
|
|
40
|
-
}, r = "action-menu", Ne = (he) => {
|
|
41
|
-
var R = he, {
|
|
42
|
-
className: t,
|
|
43
|
-
triggerClassName: _,
|
|
44
|
-
options: n,
|
|
45
|
-
triggerRenderer: a,
|
|
46
|
-
placement: F = "bottom-end",
|
|
47
|
-
openedOnInit: J = !1,
|
|
48
|
-
keepOpenOnClick: P,
|
|
49
|
-
flipOptions: q,
|
|
50
|
-
visible: D,
|
|
51
|
-
onClose: o,
|
|
52
|
-
onOpen: v,
|
|
53
|
-
floatingStrategy: X,
|
|
54
|
-
selectedOptions: s
|
|
55
|
-
} = R, Y = S(R, [
|
|
56
|
-
"className",
|
|
57
|
-
"triggerClassName",
|
|
58
|
-
"options",
|
|
59
|
-
"triggerRenderer",
|
|
60
|
-
"placement",
|
|
61
|
-
"openedOnInit",
|
|
62
|
-
"keepOpenOnClick",
|
|
63
|
-
"flipOptions",
|
|
64
|
-
"visible",
|
|
65
|
-
"onClose",
|
|
66
|
-
"onOpen",
|
|
67
|
-
"floatingStrategy",
|
|
68
|
-
"selectedOptions"
|
|
69
|
-
]);
|
|
70
|
-
const w = D !== void 0, [z, k] = i.useState(J), u = i.useRef(-1), T = i.useRef(null), d = w ? D : z, B = () => {
|
|
71
|
-
d ? (o == null || o(), !w && k(!1)) : (v == null || v(), !w && k(!0));
|
|
72
|
-
}, { x: A, y: $, strategy: W, refs: V, context: E } = ce({
|
|
73
|
-
middleware: [le(4), me(q)],
|
|
74
|
-
placement: F,
|
|
75
|
-
open: d,
|
|
76
|
-
strategy: X,
|
|
77
|
-
onOpenChange: B,
|
|
78
|
-
whileElementsMounted: re
|
|
79
|
-
}), j = ue(E), G = oe(E, {
|
|
80
|
-
enabled: d
|
|
81
|
-
}), Q = se(E), { getReferenceProps: Z, getFloatingProps: C } = de([
|
|
82
|
-
j,
|
|
83
|
-
G,
|
|
84
|
-
Q
|
|
85
|
-
]), { styles: O } = ge(E, {
|
|
86
|
-
initial: ({ side: e }) => g({
|
|
87
|
-
opacity: 0
|
|
88
|
-
}, e === "bottom" && {
|
|
89
|
-
marginTop: -10
|
|
90
|
-
} || e === "top" && {
|
|
91
|
-
marginTop: 10
|
|
92
|
-
} || e === "left" && {
|
|
93
|
-
marginLeft: 10
|
|
94
|
-
} || e === "right" && {
|
|
95
|
-
marginLeft: -10
|
|
96
|
-
})
|
|
97
|
-
}), ee = (e) => {
|
|
98
|
-
var f, y;
|
|
99
|
-
const c = u.current;
|
|
100
|
-
let l = c + e;
|
|
101
|
-
for (; (f = n[l]) != null && f.disabled || (y = n[l]) != null && y.groupHeader; )
|
|
102
|
-
if (l += e, l === -1) {
|
|
103
|
-
l = c;
|
|
104
|
-
break;
|
|
105
|
-
}
|
|
106
|
-
return l;
|
|
107
|
-
}, p = (e) => {
|
|
108
|
-
var f, y;
|
|
109
|
-
u.current = ee(e);
|
|
110
|
-
const c = (f = T.current) == null ? void 0 : f.children, l = c && ((y = c[u.current]) == null ? void 0 : y.children[0]);
|
|
111
|
-
return l == null ? void 0 : l.focus();
|
|
112
|
-
}, I = (e) => {
|
|
113
|
-
e.key === U.arrowUp && u.current > 0 && (e.preventDefault(), p(-1)), e.key === U.arrowDown && u.current + 1 < n.length && (e.preventDefault(), p(1));
|
|
114
|
-
};
|
|
115
|
-
i.useEffect(() => {
|
|
116
|
-
if (d)
|
|
117
|
-
return document.addEventListener("keydown", I), () => document.removeEventListener("keydown", I);
|
|
118
|
-
u.current = -1;
|
|
119
|
-
}, [d, I]);
|
|
120
|
-
const te = (e, c) => {
|
|
121
|
-
u.current = e, c == null || c(), !w && !P && (k(!1), o == null || o());
|
|
122
|
-
}, ne = (e, c) => e.groupHeader ? /* @__PURE__ */ i.createElement(
|
|
123
|
-
"li",
|
|
124
|
-
{
|
|
125
|
-
key: e.key,
|
|
126
|
-
role: "none",
|
|
127
|
-
className: m[`${r}__list__group-header`]
|
|
128
|
-
},
|
|
129
|
-
e.element
|
|
130
|
-
) : /* @__PURE__ */ i.createElement("li", { key: e.key, role: "none" }, /* @__PURE__ */ i.createElement(
|
|
131
|
-
"button",
|
|
132
|
-
{
|
|
133
|
-
"data-testid": e.key,
|
|
134
|
-
tabIndex: -1,
|
|
135
|
-
key: e.key,
|
|
136
|
-
disabled: e.disabled,
|
|
137
|
-
onClick: () => te(c, e.onClick),
|
|
138
|
-
role: "menuitem",
|
|
139
|
-
className: x(m[`${r}__list__item`], {
|
|
140
|
-
[m[`${r}__list__item--disabled`]]: e.disabled,
|
|
141
|
-
[m[`${r}__list__item--with-divider`]]: e.withDivider,
|
|
142
|
-
[m[`${r}__list__item--selected`]]: s == null ? void 0 : s.includes(e.key)
|
|
143
|
-
})
|
|
144
|
-
},
|
|
145
|
-
e.element,
|
|
146
|
-
(s == null ? void 0 : s.includes(e.key)) && /* @__PURE__ */ i.createElement("div", { className: m[`${r}__list__item__icon`] }, /* @__PURE__ */ i.createElement(ye, { source: fe, kind: "action-primary" }))
|
|
147
|
-
));
|
|
148
|
-
return /* @__PURE__ */ i.createElement(i.Fragment, null, /* @__PURE__ */ i.createElement(
|
|
149
|
-
"div",
|
|
150
|
-
N(g({
|
|
151
|
-
"aria-label": "Toggle menu",
|
|
152
|
-
"data-testid": "action-menu-trigger-button",
|
|
153
|
-
ref: V.setReference
|
|
154
|
-
}, Z()), {
|
|
155
|
-
className: _
|
|
156
|
-
}),
|
|
157
|
-
a
|
|
158
|
-
), d && /* @__PURE__ */ i.createElement(
|
|
159
|
-
"div",
|
|
160
|
-
g({
|
|
161
|
-
ref: V.setFloating,
|
|
162
|
-
className: m[r],
|
|
163
|
-
style: g({
|
|
164
|
-
position: W,
|
|
165
|
-
top: $ != null ? $ : "",
|
|
166
|
-
left: A != null ? A : ""
|
|
167
|
-
}, O)
|
|
168
|
-
}, C()),
|
|
169
|
-
/* @__PURE__ */ i.createElement(
|
|
170
|
-
"ul",
|
|
171
|
-
N(g({}, Y), {
|
|
172
|
-
className: x(m[`${r}__list`], t),
|
|
173
|
-
role: "menu",
|
|
174
|
-
ref: T
|
|
175
|
-
}),
|
|
176
|
-
n.map(ne)
|
|
177
|
-
)
|
|
178
|
-
));
|
|
179
|
-
}, b = {
|
|
180
|
-
"action-menu-item": "lc-ActionMenuItem-module__action-menu-item___cT70J",
|
|
181
|
-
"action-menu-item__left-node": "lc-ActionMenuItem-module__action-menu-item__left-node___3R-o1",
|
|
182
|
-
"action-menu-item__right-node": "lc-ActionMenuItem-module__action-menu-item__right-node___uq0Ym",
|
|
183
|
-
"action-menu-item__label": "lc-ActionMenuItem-module__action-menu-item__label___OgJ80",
|
|
184
|
-
"action-menu-item--warning": "lc-ActionMenuItem-module__action-menu-item--warning___DgeYg"
|
|
185
|
-
}, h = "action-menu-item", xe = ({ leftNode: t, rightNode: _, children: n, kind: a }) => /* @__PURE__ */ i.createElement(
|
|
186
|
-
"div",
|
|
187
|
-
{
|
|
188
|
-
className: x(b[h], {
|
|
189
|
-
[b[`${h}--warning`]]: a === "warning"
|
|
190
|
-
})
|
|
191
|
-
},
|
|
192
|
-
t && /* @__PURE__ */ i.createElement("div", { className: b[`${h}__left-node`] }, t),
|
|
193
|
-
/* @__PURE__ */ i.createElement(be, { as: "div", className: b[`${h}__label`] }, n),
|
|
194
|
-
_ && /* @__PURE__ */ i.createElement("div", { className: b[`${h}__right-node`] }, _)
|
|
195
|
-
);
|
|
196
|
-
export {
|
|
197
|
-
Ne as ActionMenu,
|
|
198
|
-
xe as ActionMenuItem
|
|
199
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
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};var F=require("../../assets/style-index37.css");Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const S=require("react"),o=require("@livechat/design-system-icons"),q=require("clsx"),T=require("lodash.debounce"),d=require("../Button/index.cjs.js"),v=require("../Icon/index.cjs.js"),D=require("../../chunks/Text-dd6930a2.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(S),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=q(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;
|