@livechat/design-system-react-components 1.16.9 → 1.17.1-alpha.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/README.md +0 -1
- package/dist/ProgressBar.css +1 -0
- package/dist/Tooltip.css +1 -0
- package/dist/Typography.css +1 -0
- package/dist/chunks/Heading-1f13e793.js +1 -0
- package/dist/chunks/Heading-a4742030.js +64 -0
- package/dist/chunks/ProgressBar-753197bf.js +89 -0
- package/dist/chunks/ProgressBar-ab20b908.js +1 -0
- package/dist/chunks/Text-2356ec2a.js +1 -0
- package/dist/chunks/Text-3504b7ce.js +66 -0
- package/dist/chunks/Tooltip-2c65102c.js +1 -0
- package/dist/chunks/Tooltip-e472934d.js +182 -0
- package/dist/chunks/Typography.module-7abc3bc2.js +1 -0
- package/dist/chunks/Typography.module-be5c667f.js +24 -0
- package/dist/chunks/keyCodes-30323e90.js +15 -0
- package/dist/chunks/keyCodes-c4c35e49.js +1 -0
- package/dist/components/ActionBar/index.cjs.js +1 -0
- package/dist/components/ActionBar/index.es.js +188 -0
- package/dist/components/ActionMenu/index.cjs.js +1 -0
- package/dist/components/ActionMenu/index.es.js +199 -0
- package/dist/components/Alert/index.cjs.js +1 -0
- package/dist/components/Alert/index.es.js +128 -0
- package/dist/components/Avatar/index.cjs.js +1 -0
- package/dist/components/Avatar/index.es.js +190 -0
- package/dist/components/Badge/index.cjs.js +1 -0
- package/dist/components/Badge/index.es.js +66 -0
- package/dist/components/Button/index.cjs.js +1 -0
- package/dist/components/Button/index.es.js +142 -0
- package/dist/components/Card/index.cjs.js +1 -0
- package/dist/components/Card/index.es.js +95 -0
- package/dist/components/Checkbox/index.cjs.js +1 -0
- package/dist/components/Checkbox/index.es.js +64 -0
- package/dist/components/DatePicker/index.cjs.js +1 -0
- package/dist/components/DatePicker/index.es.js +517 -0
- package/dist/components/DetailsCard/index.cjs.js +1 -0
- package/dist/components/DetailsCard/index.es.js +138 -0
- package/dist/components/DetailsCardInfo/index.cjs.js +1 -0
- package/dist/components/DetailsCardInfo/index.es.js +13 -0
- package/dist/components/FieldDescription/index.cjs.js +1 -0
- package/dist/components/FieldDescription/index.es.js +41 -0
- package/dist/components/FieldError/index.cjs.js +1 -0
- package/dist/components/FieldError/index.es.js +51 -0
- package/dist/components/FieldGroup/index.cjs.js +1 -0
- package/dist/components/FieldGroup/index.es.js +55 -0
- package/dist/components/FileUploadProgress/index.cjs.js +1 -0
- package/dist/components/FileUploadProgress/index.es.js +109 -0
- package/dist/components/Form/index.cjs.js +1 -0
- package/dist/components/Form/index.es.js +50 -0
- package/dist/components/FormField/index.cjs.js +1 -0
- package/dist/components/FormField/index.es.js +114 -0
- package/dist/components/FormGroup/index.cjs.js +1 -0
- package/dist/components/FormGroup/index.es.js +58 -0
- package/dist/components/Icon/index.cjs.js +1 -0
- package/dist/components/Icon/index.es.js +104 -0
- package/dist/components/Input/index.cjs.js +1 -0
- package/dist/components/Input/index.es.js +122 -0
- package/dist/components/Link/index.cjs.js +1 -0
- package/dist/components/Link/index.es.js +48 -0
- package/dist/components/Loader/index.cjs.js +1 -0
- package/dist/components/Loader/index.es.js +39 -0
- package/dist/components/Modal/index.cjs.js +1 -0
- package/dist/components/Modal/index.es.js +248 -0
- package/dist/components/NumericInput/index.cjs.js +1 -0
- package/dist/components/NumericInput/index.es.js +140 -0
- package/dist/components/Picker/index.cjs.js +1 -0
- package/dist/components/Picker/index.es.js +738 -0
- package/dist/components/Popover/index.cjs.js +1 -0
- package/dist/components/Popover/index.es.js +75 -0
- package/dist/components/Progress/index.cjs.js +1 -0
- package/dist/components/Progress/index.d.ts +1 -0
- package/dist/components/Progress/index.es.js +105 -0
- package/dist/components/PromoBanner/index.cjs.js +1 -0
- package/dist/components/PromoBanner/index.es.js +73 -0
- package/dist/components/PromoBannerV2/index.cjs.js +1 -0
- package/dist/components/PromoBannerV2/index.es.js +77 -0
- package/dist/components/RadioButton/index.cjs.js +1 -0
- package/dist/components/RadioButton/index.es.js +58 -0
- package/dist/components/Search/index.cjs.js +1 -0
- package/dist/components/Search/index.es.js +117 -0
- package/dist/components/SegmentedControl/index.cjs.js +1 -0
- package/dist/components/SegmentedControl/index.es.js +53 -0
- package/dist/components/Switch/index.cjs.js +1 -0
- package/dist/components/Switch/index.es.js +144 -0
- package/dist/components/Tab/Tab.d.ts +1 -1
- package/dist/components/Tab/index.cjs.js +1 -0
- package/dist/components/Tab/index.es.js +93 -0
- package/dist/components/Tag/index.cjs.js +1 -0
- package/dist/components/Tag/index.es.js +143 -0
- package/dist/components/TagInput/index.cjs.js +1 -0
- package/dist/components/TagInput/index.es.js +241 -0
- package/dist/components/Textarea/index.cjs.js +1 -0
- package/dist/components/Textarea/index.es.js +55 -0
- package/dist/components/Toast/index.cjs.js +1 -0
- package/dist/components/Toast/index.es.js +162 -0
- package/dist/components/Tooltip/components/UserGuide/index.cjs.js +1 -0
- package/dist/components/Tooltip/components/UserGuide/index.es.js +193 -0
- package/dist/components/Tooltip/components/index.cjs.js +1 -0
- package/dist/components/Tooltip/components/index.es.js +114 -0
- package/dist/components/Tooltip/index.cjs.js +1 -0
- package/dist/components/Tooltip/index.es.js +11 -0
- package/dist/components/Typography/index.cjs.js +1 -0
- package/dist/components/Typography/index.es.js +48 -0
- package/dist/components/UploadBar/index.cjs.js +1 -0
- package/dist/components/UploadBar/index.es.js +111 -0
- package/dist/foundations/index.cjs.js +1 -0
- package/dist/foundations/index.d.ts +5 -0
- package/dist/foundations/index.es.js +353 -0
- package/dist/index.cjs.js +1 -0
- package/dist/index.css +1 -0
- package/dist/index.d.ts +2 -7
- package/dist/index.es.js +123 -0
- package/dist/index10.css +1 -0
- package/dist/index11.css +1 -0
- package/dist/index12.css +1 -0
- package/dist/index13.css +1 -0
- package/dist/index14.css +1 -0
- package/dist/index15.css +1 -0
- package/dist/index16.css +1 -0
- package/dist/index17.css +1 -0
- package/dist/index18.css +1 -0
- package/dist/index19.css +1 -0
- package/dist/index2.css +1 -0
- package/dist/index20.css +1 -0
- package/dist/index21.css +1 -0
- package/dist/index22.css +1 -0
- package/dist/index23.css +1 -0
- package/dist/index24.css +1 -0
- package/dist/index25.css +1 -0
- package/dist/index26.css +1 -0
- package/dist/index27.css +1 -0
- package/dist/index28.css +1 -0
- package/dist/index29.css +1 -0
- package/dist/index3.css +1 -0
- package/dist/index30.css +1 -0
- package/dist/index31.css +1 -0
- package/dist/index32.css +1 -0
- package/dist/index33.css +1 -0
- package/dist/index34.css +1 -0
- package/dist/index35.css +1 -0
- package/dist/index36.css +1 -0
- package/dist/index37.css +1 -0
- package/dist/index38.css +1 -0
- package/dist/index39.css +1 -0
- package/dist/index4.css +1 -0
- package/dist/index5.css +1 -0
- package/dist/index6.css +1 -0
- package/dist/index7.css +1 -0
- package/dist/index8.css +1 -0
- package/dist/index9.css +1 -0
- package/dist/preview-stats.json +1136 -1124
- package/dist/style.css +1 -1
- package/dist/utils/index.cjs.js +1 -0
- package/dist/utils/index.es.js +4 -0
- package/package.json +15 -10
- package/dist/components/ActionBar/ActionBar.spec.d.ts +0 -1
- package/dist/components/ActionBar/ActionBar.stories.d.ts +0 -10
- package/dist/components/ActionMenu/ActionMenu.spec.d.ts +0 -1
- package/dist/components/ActionMenu/ActionMenu.stories.d.ts +0 -12
- package/dist/components/Alert/Alert.spec.d.ts +0 -1
- package/dist/components/Alert/Alert.stories.d.ts +0 -9
- package/dist/components/Avatar/Avatar.helpers.spec.d.ts +0 -1
- package/dist/components/Avatar/Avatar.spec.d.ts +0 -1
- package/dist/components/Avatar/Avatar.stories.d.ts +0 -22
- package/dist/components/Badge/Badge.spec.d.ts +0 -1
- package/dist/components/Badge/Badge.stories.d.ts +0 -12
- package/dist/components/Button/Button.spec.d.ts +0 -1
- package/dist/components/Button/Button.stories.d.ts +0 -43
- package/dist/components/Card/Card.spec.d.ts +0 -1
- package/dist/components/Card/Card.stories.d.ts +0 -11
- package/dist/components/Checkbox/Checkbox.spec.d.ts +0 -1
- package/dist/components/Checkbox/Checkbox.stories.d.ts +0 -13
- package/dist/components/DatePicker/DatePicker.spec.d.ts +0 -1
- package/dist/components/DatePicker/DatePicker.stories.d.ts +0 -7
- package/dist/components/DatePicker/RangeDatePicker.spec.d.ts +0 -1
- package/dist/components/DatePicker/RangeDatePicker.stories.d.ts +0 -4
- package/dist/components/DetailsCard/DetailsCard.spec.d.ts +0 -1
- package/dist/components/DetailsCard/DetailsCard.stories.d.ts +0 -17
- package/dist/components/FieldGroup/FieldGroup.spec.d.ts +0 -1
- package/dist/components/FieldGroup/FieldGroup.stories.d.ts +0 -10
- package/dist/components/FileUploadProgress/FileUploadProgress.stories.d.ts +0 -7
- package/dist/components/Form/Form.spec.d.ts +0 -1
- package/dist/components/Form/Form.stories.d.ts +0 -8
- package/dist/components/FormField/FormField.spec.d.ts +0 -1
- package/dist/components/FormField/FormField.stories.d.ts +0 -9
- package/dist/components/FormGroup/FormGroup.spec.d.ts +0 -1
- package/dist/components/FormGroup/FormGroup.stories.d.ts +0 -10
- package/dist/components/Icon/Icon.stories.d.ts +0 -15
- package/dist/components/Input/Input.spec.d.ts +0 -1
- package/dist/components/Input/Input.stories.d.ts +0 -10
- package/dist/components/Link/Link.stories.d.ts +0 -12
- package/dist/components/Loader/Loader.spec.d.ts +0 -1
- package/dist/components/Loader/Loader.stories.d.ts +0 -10
- package/dist/components/Modal/Modal.spec.d.ts +0 -1
- package/dist/components/Modal/Modal.stories.d.ts +0 -14
- package/dist/components/Modal/components/ModalBase.spec.d.ts +0 -1
- package/dist/components/NumericInput/NumericInput.spec.d.ts +0 -1
- package/dist/components/NumericInput/NumericInput.stories.d.ts +0 -20
- package/dist/components/Picker/Picker.spec.d.ts +0 -1
- package/dist/components/Picker/Picker.stories.d.ts +0 -11
- package/dist/components/Picker/components/PickerList.spec.d.ts +0 -1
- package/dist/components/Picker/components/PickerTrigger.spec.d.ts +0 -1
- package/dist/components/Picker/components/PickerTriggerBody.spec.d.ts +0 -1
- package/dist/components/Popover/Popover.spec.d.ts +0 -1
- package/dist/components/Popover/Popover.stories.d.ts +0 -16
- package/dist/components/Progress/ProgressBar.spec.d.ts +0 -1
- package/dist/components/Progress/ProgressBar.stories.d.ts +0 -12
- package/dist/components/Progress/ProgressCircle.spec.d.ts +0 -1
- package/dist/components/Progress/ProgressCircle.stories.d.ts +0 -12
- package/dist/components/PromoBanner/PromoBanner.spec.d.ts +0 -1
- package/dist/components/PromoBanner/PromoBanner.stories.d.ts +0 -11
- package/dist/components/PromoBannerV2/PromoBannerV2.spec.d.ts +0 -1
- package/dist/components/PromoBannerV2/PromoBannerV2.stories.d.ts +0 -51
- package/dist/components/RadioButton/RadioButton.spec.d.ts +0 -1
- package/dist/components/RadioButton/RadioButton.stories.d.ts +0 -13
- package/dist/components/Search/Search.spec.d.ts +0 -1
- package/dist/components/Search/Search.stories.d.ts +0 -19
- package/dist/components/SegmentedControl/SegmentedControl.spec.d.ts +0 -1
- package/dist/components/SegmentedControl/SegmentedControl.stories.d.ts +0 -9
- package/dist/components/Switch/Switch.spec.d.ts +0 -1
- package/dist/components/Switch/Switch.stories.d.ts +0 -11
- package/dist/components/Tab/Tab.spec.d.ts +0 -1
- package/dist/components/Tab/Tab.stories.d.ts +0 -11
- package/dist/components/Tab/TabsWrapper.spec.d.ts +0 -1
- package/dist/components/Tab/TabsWrapper.stories.d.ts +0 -18
- package/dist/components/Tag/Tag.spec.d.ts +0 -1
- package/dist/components/Tag/Tag.stories.d.ts +0 -26
- package/dist/components/TagInput/TagInput.spec.d.ts +0 -1
- package/dist/components/TagInput/TagInput.stories.d.ts +0 -10
- package/dist/components/Textarea/Textarea.spec.d.ts +0 -1
- package/dist/components/Textarea/Textarea.stories.d.ts +0 -7
- package/dist/components/Toast/Toast.spec.d.ts +0 -1
- package/dist/components/Toast/Toast.stories.d.ts +0 -14
- package/dist/components/Toast/ToastWrapper.spec.d.ts +0 -1
- package/dist/components/Toast/ToastWrapper.stories.d.ts +0 -34
- package/dist/components/Tooltip/Tooltip.spec.d.ts +0 -1
- package/dist/components/Tooltip/Tooltip.stories.d.ts +0 -52
- package/dist/components/UploadBar/UploadBar.stories.d.ts +0 -7
- package/dist/dsrc.cjs.js +0 -1
- package/dist/dsrc.es.js +0 -5235
- package/dist/stories/components/BlockColumns/BlockColumns.d.ts +0 -8
- package/dist/stories/components/StoryDescriptor.d.ts +0 -7
- package/dist/stories/components/Table/Table.d.ts +0 -13
- package/dist/stories/foundations/Color/ColorTable.d.ts +0 -7
- package/dist/stories/foundations/Color/constants.d.ts +0 -2
- package/dist/stories/foundations/Color/data.d.ts +0 -7
- package/dist/stories/foundations/Color/helpers.d.ts +0 -2
- package/dist/stories/foundations/Color/types.d.ts +0 -43
- package/dist/stories/foundations/Radius/RadiusTable.d.ts +0 -7
- package/dist/stories/foundations/Radius/constants.d.ts +0 -2
- package/dist/stories/foundations/Radius/types.d.ts +0 -8
- package/dist/stories/foundations/Shadow/ShadowTable.d.ts +0 -7
- package/dist/stories/foundations/Shadow/constants.d.ts +0 -2
- package/dist/stories/foundations/Shadow/types.d.ts +0 -6
- package/dist/stories/foundations/Spacing/SpacingTable.d.ts +0 -7
- package/dist/stories/foundations/Spacing/constants.d.ts +0 -2
- package/dist/stories/foundations/Spacing/types.d.ts +0 -7
- package/dist/stories/foundations/Transition/TransitionTable.d.ts +0 -7
- package/dist/stories/foundations/Transition/components/TransitionDelayExample.d.ts +0 -2
- package/dist/stories/foundations/Transition/components/TransitionDurationExample.d.ts +0 -2
- package/dist/stories/foundations/Transition/components/TransitionTimingExample.d.ts +0 -2
- package/dist/stories/foundations/Transition/constants.d.ts +0 -4
- package/dist/stories/foundations/Transition/types.d.ts +0 -16
- package/dist/stories/foundations/Typography/components/DisplayExamples.d.ts +0 -2
- package/dist/stories/foundations/Typography/components/HeadingExamples.d.ts +0 -2
- package/dist/stories/foundations/Typography/components/TextExamples.d.ts +0 -2
- package/dist/stories/helpers.d.ts +0 -6
- package/dist/test/setup.d.ts +0 -0
- package/dist/test/utils.d.ts +0 -3
|
@@ -0,0 +1,144 @@
|
|
|
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 "../../index7.css";
|
|
22
|
+
import * as s from "react";
|
|
23
|
+
import { LockBlackFilled as X } from "@livechat/design-system-icons";
|
|
24
|
+
import a from "clsx";
|
|
25
|
+
import { Icon as B } from "../Icon/index.es.js";
|
|
26
|
+
import { Loader as C } from "../Loader/index.es.js";
|
|
27
|
+
const G = "lc-Switch-module__switch__input___NiiOR", H = "lc-Switch-module__switch__container___79F7W", I = "lc-Switch-module__switch__track___2wr2M", P = "lc-Switch-module__switch__slider___WHd--", V = "lc-Switch-module__switch__loader___FE-fA", Z = "lc-Switch-module__switch__icon___-O1qY", e = {
|
|
28
|
+
switch: "lc-Switch-module__switch___AaA2k",
|
|
29
|
+
"switch__track--enabled": "lc-Switch-module__switch__track--enabled___sy4Xl",
|
|
30
|
+
"switch__track--on": "lc-Switch-module__switch__track--on___aOMWe",
|
|
31
|
+
"switch__track--off": "lc-Switch-module__switch__track--off___NAisj",
|
|
32
|
+
"switch--large": "lc-Switch-module__switch--large___pSoJ7",
|
|
33
|
+
"switch--compact": "lc-Switch-module__switch--compact___OGFIX",
|
|
34
|
+
"switch--medium": "lc-Switch-module__switch--medium___EcZwT",
|
|
35
|
+
switch__input: G,
|
|
36
|
+
"switch__input--disabled": "lc-Switch-module__switch__input--disabled___Po8gh",
|
|
37
|
+
switch__container: H,
|
|
38
|
+
switch__track: I,
|
|
39
|
+
"switch__track--disabled": "lc-Switch-module__switch__track--disabled___HkDhl",
|
|
40
|
+
switch__slider: P,
|
|
41
|
+
"switch__slider--large": "lc-Switch-module__switch__slider--large___WoEgi",
|
|
42
|
+
"switch__slider--large--on": "lc-Switch-module__switch__slider--large--on___7Qp3G",
|
|
43
|
+
"switch__slider--large--off": "lc-Switch-module__switch__slider--large--off___iRMmD",
|
|
44
|
+
"switch__slider--compact": "lc-Switch-module__switch__slider--compact___uZ-lS",
|
|
45
|
+
"switch__slider--compact--on": "lc-Switch-module__switch__slider--compact--on___FykE3",
|
|
46
|
+
"switch__slider--compact--off": "lc-Switch-module__switch__slider--compact--off___s5yR8",
|
|
47
|
+
"switch__slider--medium": "lc-Switch-module__switch__slider--medium___uhptz",
|
|
48
|
+
"switch__slider--medium--on": "lc-Switch-module__switch__slider--medium--on___SfeAV",
|
|
49
|
+
"switch__slider--medium--off": "lc-Switch-module__switch__slider--medium--off___eXJJz",
|
|
50
|
+
switch__loader: V,
|
|
51
|
+
"switch__loader--compact": "lc-Switch-module__switch__loader--compact___3imUh",
|
|
52
|
+
"switch__loader--medium": "lc-Switch-module__switch__loader--medium___2zi05",
|
|
53
|
+
"switch__loader--large": "lc-Switch-module__switch__loader--large___vLRFa",
|
|
54
|
+
switch__icon: Z
|
|
55
|
+
}, i = "switch", K = (j) => {
|
|
56
|
+
var u = j, {
|
|
57
|
+
className: _ = "",
|
|
58
|
+
defaultOn: t = !1,
|
|
59
|
+
disabled: c = !1,
|
|
60
|
+
name: l = i,
|
|
61
|
+
on: r,
|
|
62
|
+
onChange: h,
|
|
63
|
+
size: o = "large",
|
|
64
|
+
state: n = "regular",
|
|
65
|
+
innerRef: F,
|
|
66
|
+
ariaLabel: L
|
|
67
|
+
} = u, R = A(u, [
|
|
68
|
+
"className",
|
|
69
|
+
"defaultOn",
|
|
70
|
+
"disabled",
|
|
71
|
+
"name",
|
|
72
|
+
"on",
|
|
73
|
+
"onChange",
|
|
74
|
+
"size",
|
|
75
|
+
"state",
|
|
76
|
+
"innerRef",
|
|
77
|
+
"ariaLabel"
|
|
78
|
+
]);
|
|
79
|
+
const w = r !== void 0, [v, x] = s.useState(
|
|
80
|
+
() => w ? r : t
|
|
81
|
+
), 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(
|
|
82
|
+
e[i],
|
|
83
|
+
e[`${i}--${o}`],
|
|
84
|
+
_
|
|
85
|
+
), D = (g) => {
|
|
86
|
+
h == null || h(g, !m), w || (g.stopPropagation(), x((J) => !J));
|
|
87
|
+
};
|
|
88
|
+
return /* @__PURE__ */ s.createElement("span", { className: W }, /* @__PURE__ */ s.createElement(
|
|
89
|
+
"input",
|
|
90
|
+
y({
|
|
91
|
+
type: "checkbox",
|
|
92
|
+
className: a(
|
|
93
|
+
e[`${i}__input`],
|
|
94
|
+
e[`${i}__input--${$}`]
|
|
95
|
+
),
|
|
96
|
+
onChange: D,
|
|
97
|
+
checked: m,
|
|
98
|
+
name: l,
|
|
99
|
+
ref: F,
|
|
100
|
+
disabled: k,
|
|
101
|
+
"aria-label": L
|
|
102
|
+
}, R)
|
|
103
|
+
), /* @__PURE__ */ s.createElement("span", { className: e[`${i}__container`] }, /* @__PURE__ */ s.createElement(
|
|
104
|
+
"span",
|
|
105
|
+
{
|
|
106
|
+
className: a(
|
|
107
|
+
e[`${i}__track`],
|
|
108
|
+
e[`${i}__track--${f}`],
|
|
109
|
+
e[`${i}__track--${$}`]
|
|
110
|
+
)
|
|
111
|
+
}
|
|
112
|
+
), /* @__PURE__ */ s.createElement(
|
|
113
|
+
"span",
|
|
114
|
+
{
|
|
115
|
+
className: a(
|
|
116
|
+
e[`${i}__slider`],
|
|
117
|
+
e[`${i}__slider--${o}`],
|
|
118
|
+
e[`${i}__slider--${o}--${f}`]
|
|
119
|
+
)
|
|
120
|
+
},
|
|
121
|
+
p && /* @__PURE__ */ s.createElement(
|
|
122
|
+
C,
|
|
123
|
+
{
|
|
124
|
+
className: a(
|
|
125
|
+
e[`${i}__loader`],
|
|
126
|
+
e[`${i}__loader--${o}`]
|
|
127
|
+
)
|
|
128
|
+
}
|
|
129
|
+
),
|
|
130
|
+
S && /* @__PURE__ */ s.createElement(
|
|
131
|
+
B,
|
|
132
|
+
{
|
|
133
|
+
className: e[`${i}__icon`],
|
|
134
|
+
"data-testid": "lock-icon",
|
|
135
|
+
size: O,
|
|
136
|
+
source: X,
|
|
137
|
+
kind: "primary"
|
|
138
|
+
}
|
|
139
|
+
)
|
|
140
|
+
)));
|
|
141
|
+
};
|
|
142
|
+
export {
|
|
143
|
+
K as Switch
|
|
144
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var N=Object.defineProperty,j=Object.defineProperties;var q=Object.getOwnPropertyDescriptors;var l=Object.getOwnPropertySymbols;var u=Object.prototype.hasOwnProperty,m=Object.prototype.propertyIsEnumerable;var i=(e,t,a)=>t in e?N(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)=>j(e,q(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};var w=require("../../index6.css");Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const D=require("react"),n=require("clsx"),W=require("../Badge/index.cjs.js"),f=require("../../chunks/Text-2356ec2a.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,v=a!==void 0&&!d,x=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,v&&b.createElement(f.Text,{as:"span",size:"md",className:_[`${c}__count`]},"(",a,")"),x&&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;
|
|
@@ -0,0 +1,93 @@
|
|
|
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 "../../index6.css";
|
|
23
|
+
import * as l from "react";
|
|
24
|
+
import d from "clsx";
|
|
25
|
+
import { Badge as A } from "../Badge/index.es.js";
|
|
26
|
+
import { T as $ } from "../../chunks/Text-3504b7ce.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
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var S=Object.defineProperty,E=Object.defineProperties;var I=Object.getOwnPropertyDescriptors;var r=Object.getOwnPropertySymbols;var b=Object.prototype.hasOwnProperty,f=Object.prototype.propertyIsEnumerable;var T=(e,a,t)=>a in e?S(e,a,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[a]=t,i=(e,a)=>{for(var t in a||(a={}))b.call(a,t)&&T(e,t,a[t]);if(r)for(var t of r(a))f.call(a,t)&&T(e,t,a[t]);return e},x=(e,a)=>E(e,I(a));var F=(e,a)=>{var t={};for(var _ in e)b.call(e,_)&&a.indexOf(_)<0&&(t[_]=e[_]);if(e!=null&&r)for(var _ of r(e))a.indexOf(_)<0&&f.call(e,_)&&(t[_]=e[_]);return t};var Y=require("../../index5.css");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-2356ec2a.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;
|
|
@@ -0,0 +1,143 @@
|
|
|
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 "../../index5.css";
|
|
23
|
+
import * as r from "react";
|
|
24
|
+
import { Close as j } from "@livechat/design-system-icons";
|
|
25
|
+
import z from "clsx";
|
|
26
|
+
import { getContrast as p } from "polished";
|
|
27
|
+
import { Icon as D } from "../Icon/index.es.js";
|
|
28
|
+
import { T as K } from "../../chunks/Text-3504b7ce.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
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var G=Object.defineProperty,X=Object.defineProperties;var A=Object.getOwnPropertyDescriptors;var b=Object.getOwnPropertySymbols;var P=Object.prototype.hasOwnProperty,V=Object.prototype.propertyIsEnumerable;var S=(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={}))P.call(e,n)&&S(t,n,e[n]);if(b)for(var n of b(e))V.call(e,n)&&S(t,n,e[n]);return t},D=(t,e)=>X(t,A(e));var K=(t,e)=>{var n={};for(var a in t)P.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&&V.call(t,a)&&(n[a]=t[a]);return n};var _e=require("../../index4.css");Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const J=require("react"),q=require("clsx"),i=require("../../chunks/keyCodes-c4c35e49.js"),Q=require("../FieldError/index.cjs.js"),U=require("../../chunks/Text-2356ec2a.js"),W=require("../Tag/index.cjs.js"),w=require("lodash.escape");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 o=Z(J),ee=({className:t="",innerEditableRef:e,inputRef:n,change:a,remove:u,value:m})=>{const[_,d]=o.useState(!1),s=()=>e.current,p=()=>{const r=s();return r?r.innerText:""},x=()=>{n&&n.current&&n.current.focus()},v=r=>{if(r.key===i.KeyCodes.enter){r.preventDefault(),x();return}r.key===i.KeyCodes.backspace&&p()===""&&(d(!0),u(),x())},O=()=>{const r=s();if(!(_||!r)){if(r.innerText===""){u();return}a(r.innerText)}},y=r=>{r.preventDefault();const C=r.clipboardData.getData("text/plain");document.execCommand("insertHTML",!1,w(C))};return o.createElement("div",{ref:e,className:t,contentEditable:!0,onPaste:y,onBlur:O,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:u,update:m,size:_})=>{const d=o.useMemo(()=>a!==void 0?a(t):!0,[t,a]),s=o.useRef(null),p=()=>n(e);return o.createElement(W.Tag,{kind:d?"default":"error",dismissible:!0,size:_,onRemove:p},o.createElement(ee,{value:t,inputRef:u,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],ce=[i.KeyCodes.backspace,i.KeyCodes.delete],h=O=>{var y=O,{id:t,tags:e,onChange:n,validator:a,error:u,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 r=q(T[E],{[T[`${E}--error`]]:u},d),C=q(s,T[`${E}__input`],T[`${E}__input--${_}`]),[f,$]=o.useState(""),k=o.useRef(null),z=c=>{n([...e||[],c]),$("")},R=c=>{const l=[...e||[]];l.splice(c,1),n(l)},M=c=>$(c.target.value),N=c=>{if(ae.includes(c.key)){if(c.preventDefault(),f==="")return;z(f)}else if(ce.includes(c.key)){if(f!==""||!(e!=null&&e.length))return;R(e.length-1)}},j=c=>{x&&z(f),p==null||p(c)},F=(c,l)=>{const g=[...e||[]];g.reduce((Y,H,B)=>Y+(H===l&&B!==c?1:0),0)>0?g.splice(c,1):g[c]=l,n(g)},L=c=>{c.preventDefault();const g=c.clipboardData.getData("text/plain").split(/[\s,;\n]+/);n([...e||[],...g])};return o.createElement(o.Fragment,null,o.createElement(U.Text,{as:"div",className:r},e==null?void 0:e.map((c,l)=>o.createElement(ne,{index:l,key:`${l}${c}`,update:F,remove:R,inputRef:k,validator:a,size:_},c)),o.createElement("input",D(I({},v),{id:t,ref:k,className:C,placeholder:m,value:f,onChange:M,onKeyDown:N,onPaste:L,onBlur:j}))),u&&o.createElement(Q.FieldError,null,u))},re=/^(?:[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,oe="name@company.com",ue=t=>re.test(t),se=d=>{var s=d,{id:t,tags:e,onChange:n,error:a,placeholder:u=oe,size:m}=s,_=K(s,["id","tags","onChange","error","placeholder","size"]);return o.createElement(h,D(I({},_),{id:t,tags:e,error:a,onChange:n,placeholder:u,validator:ue,size:m}))};exports.EmailTagInput=se;exports.TagInput=h;
|
|
@@ -0,0 +1,241 @@
|
|
|
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 "../../index4.css";
|
|
23
|
+
import * as u from "react";
|
|
24
|
+
import O from "clsx";
|
|
25
|
+
import { K as i } from "../../chunks/keyCodes-30323e90.js";
|
|
26
|
+
import { FieldError as A } from "../FieldError/index.es.js";
|
|
27
|
+
import { T as J } from "../../chunks/Text-3504b7ce.js";
|
|
28
|
+
import { Tag as Q } from "../Tag/index.es.js";
|
|
29
|
+
import P from "lodash.escape";
|
|
30
|
+
const U = ({
|
|
31
|
+
className: t = "",
|
|
32
|
+
innerEditableRef: e,
|
|
33
|
+
inputRef: n,
|
|
34
|
+
change: r,
|
|
35
|
+
remove: o,
|
|
36
|
+
value: _
|
|
37
|
+
}) => {
|
|
38
|
+
const [m, x] = u.useState(!1), s = () => e.current, p = () => {
|
|
39
|
+
const c = s();
|
|
40
|
+
return c ? c.innerText : "";
|
|
41
|
+
}, f = () => {
|
|
42
|
+
n && n.current && n.current.focus();
|
|
43
|
+
}, y = (c) => {
|
|
44
|
+
if (c.key === i.enter) {
|
|
45
|
+
c.preventDefault(), f();
|
|
46
|
+
return;
|
|
47
|
+
}
|
|
48
|
+
c.key === i.backspace && p() === "" && (x(!0), o(), f());
|
|
49
|
+
}, R = () => {
|
|
50
|
+
const c = s();
|
|
51
|
+
if (!(m || !c)) {
|
|
52
|
+
if (c.innerText === "") {
|
|
53
|
+
o();
|
|
54
|
+
return;
|
|
55
|
+
}
|
|
56
|
+
r(c.innerText);
|
|
57
|
+
}
|
|
58
|
+
}, b = (c) => {
|
|
59
|
+
c.preventDefault();
|
|
60
|
+
const I = c.clipboardData.getData("text/plain");
|
|
61
|
+
document.execCommand("insertHTML", !1, P(I));
|
|
62
|
+
};
|
|
63
|
+
return /* @__PURE__ */ u.createElement(
|
|
64
|
+
"div",
|
|
65
|
+
{
|
|
66
|
+
ref: e,
|
|
67
|
+
className: t,
|
|
68
|
+
contentEditable: !0,
|
|
69
|
+
onPaste: b,
|
|
70
|
+
onBlur: R,
|
|
71
|
+
onKeyDown: y,
|
|
72
|
+
dangerouslySetInnerHTML: { __html: P(_) }
|
|
73
|
+
}
|
|
74
|
+
);
|
|
75
|
+
}, T = {
|
|
76
|
+
"tag-input": "lc-TagInput-module__tag-input___CLVY-",
|
|
77
|
+
"tag-input--error": "lc-TagInput-module__tag-input--error___RP0SB",
|
|
78
|
+
"tag-input__input": "lc-TagInput-module__tag-input__input___dgEYB",
|
|
79
|
+
"tag-input__input--medium": "lc-TagInput-module__tag-input__input--medium___DYF7X",
|
|
80
|
+
"tag-input__input--large": "lc-TagInput-module__tag-input__input--large___G6iEO",
|
|
81
|
+
"tag-input__tag__content": "lc-TagInput-module__tag-input__tag__content___x95-M"
|
|
82
|
+
}, W = "tag-input__tag", Z = ({
|
|
83
|
+
children: t,
|
|
84
|
+
index: e,
|
|
85
|
+
remove: n,
|
|
86
|
+
validator: r,
|
|
87
|
+
inputRef: o,
|
|
88
|
+
update: _,
|
|
89
|
+
size: m
|
|
90
|
+
}) => {
|
|
91
|
+
const x = u.useMemo(() => r !== void 0 ? r(t) : !0, [t, r]), s = u.useRef(null), p = () => n(e);
|
|
92
|
+
return /* @__PURE__ */ u.createElement(
|
|
93
|
+
Q,
|
|
94
|
+
{
|
|
95
|
+
kind: x ? "default" : "error",
|
|
96
|
+
dismissible: !0,
|
|
97
|
+
size: m,
|
|
98
|
+
onRemove: p
|
|
99
|
+
},
|
|
100
|
+
/* @__PURE__ */ u.createElement(
|
|
101
|
+
U,
|
|
102
|
+
{
|
|
103
|
+
value: t,
|
|
104
|
+
inputRef: o,
|
|
105
|
+
innerEditableRef: s,
|
|
106
|
+
className: T[`${W}__content`],
|
|
107
|
+
change: (f) => _(e, f),
|
|
108
|
+
remove: p,
|
|
109
|
+
validator: r
|
|
110
|
+
}
|
|
111
|
+
)
|
|
112
|
+
);
|
|
113
|
+
}, v = "tag-input", ee = [
|
|
114
|
+
i.enter,
|
|
115
|
+
i.spacebar,
|
|
116
|
+
i.tab,
|
|
117
|
+
i.semicolon,
|
|
118
|
+
i.comma
|
|
119
|
+
], te = [i.backspace, i.delete], ne = (R) => {
|
|
120
|
+
var b = R, {
|
|
121
|
+
id: t,
|
|
122
|
+
tags: e,
|
|
123
|
+
onChange: n,
|
|
124
|
+
validator: r,
|
|
125
|
+
error: o,
|
|
126
|
+
placeholder: _,
|
|
127
|
+
size: m = "medium",
|
|
128
|
+
className: x,
|
|
129
|
+
inputClassName: s,
|
|
130
|
+
onBlur: p,
|
|
131
|
+
addOnBlur: f = !0
|
|
132
|
+
} = b, y = z(b, [
|
|
133
|
+
"id",
|
|
134
|
+
"tags",
|
|
135
|
+
"onChange",
|
|
136
|
+
"validator",
|
|
137
|
+
"error",
|
|
138
|
+
"placeholder",
|
|
139
|
+
"size",
|
|
140
|
+
"className",
|
|
141
|
+
"inputClassName",
|
|
142
|
+
"onBlur",
|
|
143
|
+
"addOnBlur"
|
|
144
|
+
]);
|
|
145
|
+
const c = O(
|
|
146
|
+
T[v],
|
|
147
|
+
{
|
|
148
|
+
[T[`${v}--error`]]: o
|
|
149
|
+
},
|
|
150
|
+
x
|
|
151
|
+
), I = O(
|
|
152
|
+
s,
|
|
153
|
+
T[`${v}__input`],
|
|
154
|
+
T[`${v}__input--${m}`]
|
|
155
|
+
), [g, k] = u.useState(""), V = u.useRef(null), C = (a) => {
|
|
156
|
+
n([...e || [], a]), k("");
|
|
157
|
+
}, K = (a) => {
|
|
158
|
+
const l = [...e || []];
|
|
159
|
+
l.splice(a, 1), n(l);
|
|
160
|
+
}, S = (a) => k(a.target.value), M = (a) => {
|
|
161
|
+
if (ee.includes(a.key)) {
|
|
162
|
+
if (a.preventDefault(), g === "")
|
|
163
|
+
return;
|
|
164
|
+
C(g);
|
|
165
|
+
} else if (te.includes(a.key)) {
|
|
166
|
+
if (g !== "" || !(e != null && e.length))
|
|
167
|
+
return;
|
|
168
|
+
K(e.length - 1);
|
|
169
|
+
}
|
|
170
|
+
}, F = (a) => {
|
|
171
|
+
f && C(g), p == null || p(a);
|
|
172
|
+
}, L = (a, l) => {
|
|
173
|
+
const d = [...e || []];
|
|
174
|
+
d.reduce(
|
|
175
|
+
(H, B, G) => H + (B === l && G !== a ? 1 : 0),
|
|
176
|
+
0
|
|
177
|
+
) > 0 ? d.splice(a, 1) : d[a] = l, n(d);
|
|
178
|
+
}, Y = (a) => {
|
|
179
|
+
a.preventDefault();
|
|
180
|
+
const d = a.clipboardData.getData("text/plain").split(/[\s,;\n]+/);
|
|
181
|
+
n([...e || [], ...d]);
|
|
182
|
+
};
|
|
183
|
+
return /* @__PURE__ */ u.createElement(u.Fragment, null, /* @__PURE__ */ u.createElement(J, { as: "div", className: c }, e == null ? void 0 : e.map((a, l) => /* @__PURE__ */ u.createElement(
|
|
184
|
+
Z,
|
|
185
|
+
{
|
|
186
|
+
index: l,
|
|
187
|
+
key: `${l}${a}`,
|
|
188
|
+
update: L,
|
|
189
|
+
remove: K,
|
|
190
|
+
inputRef: V,
|
|
191
|
+
validator: r,
|
|
192
|
+
size: m
|
|
193
|
+
},
|
|
194
|
+
a
|
|
195
|
+
)), /* @__PURE__ */ u.createElement(
|
|
196
|
+
"input",
|
|
197
|
+
$(D({}, y), {
|
|
198
|
+
id: t,
|
|
199
|
+
ref: V,
|
|
200
|
+
className: I,
|
|
201
|
+
placeholder: _,
|
|
202
|
+
value: g,
|
|
203
|
+
onChange: S,
|
|
204
|
+
onKeyDown: M,
|
|
205
|
+
onPaste: Y,
|
|
206
|
+
onBlur: F
|
|
207
|
+
})
|
|
208
|
+
)), o && /* @__PURE__ */ u.createElement(A, null, o));
|
|
209
|
+
}, ae = /^(?:[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*|"(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21\x23-\x5b\x5d-\x7f]|\\[\x01-\x09\x0b\x0c\x0e-\x7f])*")@(?:(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?|\[(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?|[a-z0-9-]*[a-z0-9]:(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21-\x5a\x53-\x7f]|\\[\x01-\x09\x0b\x0c\x0e-\x7f])+)])$/i, re = "name@company.com", ce = (t) => ae.test(t), fe = (x) => {
|
|
210
|
+
var s = x, {
|
|
211
|
+
id: t,
|
|
212
|
+
tags: e,
|
|
213
|
+
onChange: n,
|
|
214
|
+
error: r,
|
|
215
|
+
placeholder: o = re,
|
|
216
|
+
size: _
|
|
217
|
+
} = s, m = z(s, [
|
|
218
|
+
"id",
|
|
219
|
+
"tags",
|
|
220
|
+
"onChange",
|
|
221
|
+
"error",
|
|
222
|
+
"placeholder",
|
|
223
|
+
"size"
|
|
224
|
+
]);
|
|
225
|
+
return /* @__PURE__ */ u.createElement(
|
|
226
|
+
ne,
|
|
227
|
+
$(D({}, m), {
|
|
228
|
+
id: t,
|
|
229
|
+
tags: e,
|
|
230
|
+
error: r,
|
|
231
|
+
onChange: n,
|
|
232
|
+
placeholder: o,
|
|
233
|
+
validator: ce,
|
|
234
|
+
size: _
|
|
235
|
+
})
|
|
236
|
+
);
|
|
237
|
+
};
|
|
238
|
+
export {
|
|
239
|
+
fe as EmailTagInput,
|
|
240
|
+
ne as TagInput
|
|
241
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var S=Object.defineProperty,q=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?S(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)=>q(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};var G=require("../../index3.css");Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const F=require("react"),N=require("clsx"),R=require("../../chunks/Text-2356ec2a.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)},v=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:v,onBlur:j})))});exports.Textarea=w;
|