@livechat/design-system-react-components 1.0.0-alpha.54 → 1.0.0-alpha.55
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/dsrc.cjs.js +8 -5
- package/dist/dsrc.es.js +25 -13
- package/dist/dsrc.umd.js +8 -5
- package/dist/shadow/color-scheme.css +14 -0
- package/dist/shadow/color-scheme.css.map +1 -0
- package/dist/spacing/color-scheme.css +14 -0
- package/dist/spacing/color-scheme.css.map +1 -0
- package/dist/src/components/Input/Input.d.ts +13 -2
- package/dist/src/components/Picker/Picker.d.ts +8 -0
- package/dist/src/components/Picker/Trigger.d.ts +1 -0
- package/dist/src/components/PromoBanner/PromoBanner.d.ts +27 -0
- package/dist/src/components/Search/Search.d.ts +24 -0
- package/dist/src/components/SegmentedControl/SegmentedControl.d.ts +21 -0
- package/dist/src/components/Tag/Tag.d.ts +27 -0
- package/dist/src/components/TagInput/TagInput.d.ts +23 -4
- package/dist/style.css +1 -1
- package/package.json +3 -3
package/dist/dsrc.es.js
CHANGED
|
@@ -350,18 +350,16 @@ const Popover = ({
|
|
|
350
350
|
}
|
|
351
351
|
}
|
|
352
352
|
const handleHideOnEscape = (event) => {
|
|
353
|
-
if (event.key === "Escape") {
|
|
353
|
+
if (closeOnEsc && event.key === "Escape") {
|
|
354
354
|
setVisibility(false);
|
|
355
355
|
}
|
|
356
356
|
};
|
|
357
357
|
React.useEffect(() => {
|
|
358
358
|
document.addEventListener("mousedown", handleDocumentClick);
|
|
359
|
-
|
|
360
|
-
document.addEventListener("keydown", handleHideOnEscape);
|
|
361
|
-
}
|
|
359
|
+
document.addEventListener("keydown", handleHideOnEscape);
|
|
362
360
|
return () => {
|
|
363
|
-
document.removeEventListener("keydown", handleHideOnEscape);
|
|
364
361
|
document.removeEventListener("mousedown", handleDocumentClick);
|
|
362
|
+
document.removeEventListener("keydown", handleHideOnEscape);
|
|
365
363
|
};
|
|
366
364
|
}, []);
|
|
367
365
|
const mergedClassNames = cx(cssStyles["popover"], className, {
|
|
@@ -1991,6 +1989,7 @@ var styles$n = {
|
|
|
1991
1989
|
"input--focused": "lc-Input-module__input--focused___wQH5-",
|
|
1992
1990
|
"input--disabled": "lc-Input-module__input--disabled___HidXX",
|
|
1993
1991
|
"input--error": "lc-Input-module__input--error___DlDbC",
|
|
1992
|
+
"input--xsmall": "lc-Input-module__input--xsmall___9u99K",
|
|
1994
1993
|
"input--compact": "lc-Input-module__input--compact___iKSQZ",
|
|
1995
1994
|
"input--medium": "lc-Input-module__input--medium___3BjqQ",
|
|
1996
1995
|
"input--large": "lc-Input-module__input--large___jX5RW",
|
|
@@ -2052,7 +2051,7 @@ const Input = React.forwardRef((_A, ref) => {
|
|
|
2052
2051
|
type: type && !isPasswordVisible ? type : "text"
|
|
2053
2052
|
})), shouldRenderRightIcon && renderIcon(icon2, disabled), type === "password" && /* @__PURE__ */ React.createElement(Button, {
|
|
2054
2053
|
disabled,
|
|
2055
|
-
kind: "
|
|
2054
|
+
kind: "subtle",
|
|
2056
2055
|
icon: /* @__PURE__ */ React.createElement(Icon, {
|
|
2057
2056
|
customColor: iconCustomColor,
|
|
2058
2057
|
source: iconSource
|
|
@@ -2379,7 +2378,8 @@ const Trigger = ({
|
|
|
2379
2378
|
size = "medium",
|
|
2380
2379
|
hideClearButton,
|
|
2381
2380
|
onTrigger,
|
|
2382
|
-
onClear
|
|
2381
|
+
onClear,
|
|
2382
|
+
testId
|
|
2383
2383
|
}) => {
|
|
2384
2384
|
const triggerRef = React.useRef(null);
|
|
2385
2385
|
const mergedClassNames = cx(styles$j[baseClass$p], styles$j[`${baseClass$p}--${size}`], isMultiSelect && styles$j[`${baseClass$p}--multi-select`], isMultiSelect && isItemSelected && styles$j[`${baseClass$p}--multi-select--with-items`], isDisabled && styles$j[`${baseClass$p}--disabled`], isOpen && styles$j[`${baseClass$p}--focused`], isError && styles$j[`${baseClass$p}--error`]);
|
|
@@ -2411,7 +2411,8 @@ const Trigger = ({
|
|
|
2411
2411
|
ref: triggerRef,
|
|
2412
2412
|
className: mergedClassNames,
|
|
2413
2413
|
onClick: handleTriggerClick,
|
|
2414
|
-
tabIndex: 0
|
|
2414
|
+
tabIndex: 0,
|
|
2415
|
+
"data-testid": testId
|
|
2415
2416
|
}, /* @__PURE__ */ React.createElement("div", {
|
|
2416
2417
|
className: styles$j[`${baseClass$p}__content`]
|
|
2417
2418
|
}, children), /* @__PURE__ */ React.createElement("div", {
|
|
@@ -2801,6 +2802,7 @@ const Picker = (_M) => {
|
|
|
2801
2802
|
type = "single",
|
|
2802
2803
|
searchDisabled = false,
|
|
2803
2804
|
hideClearButton,
|
|
2805
|
+
openedOnInit = false,
|
|
2804
2806
|
onSelect
|
|
2805
2807
|
} = _N, props = __objRest(_N, [
|
|
2806
2808
|
"className",
|
|
@@ -2817,9 +2819,10 @@ const Picker = (_M) => {
|
|
|
2817
2819
|
"type",
|
|
2818
2820
|
"searchDisabled",
|
|
2819
2821
|
"hideClearButton",
|
|
2822
|
+
"openedOnInit",
|
|
2820
2823
|
"onSelect"
|
|
2821
2824
|
]);
|
|
2822
|
-
const [isListOpen, setIsListOpen] = React.useState(
|
|
2825
|
+
const [isListOpen, setIsListOpen] = React.useState(openedOnInit);
|
|
2823
2826
|
const [searchPhrase, setSearchPhrase] = React.useState(null);
|
|
2824
2827
|
const triggerRef = React.useRef(null);
|
|
2825
2828
|
const mergedClassNames = cx(styles$h[baseClass$l], className);
|
|
@@ -2910,12 +2913,14 @@ const Picker = (_M) => {
|
|
|
2910
2913
|
}
|
|
2911
2914
|
return selected.map((item) => item.key);
|
|
2912
2915
|
}, [selected]);
|
|
2913
|
-
return /* @__PURE__ */ React.createElement("div",
|
|
2916
|
+
return /* @__PURE__ */ React.createElement("div", {
|
|
2914
2917
|
ref: triggerRef,
|
|
2915
|
-
className: mergedClassNames
|
|
2916
|
-
|
|
2918
|
+
className: mergedClassNames,
|
|
2919
|
+
id: props.id
|
|
2920
|
+
}, /* @__PURE__ */ React.createElement("div", {
|
|
2917
2921
|
className: styles$h[`${baseClass$l}__container`]
|
|
2918
2922
|
}, /* @__PURE__ */ React.createElement(Trigger, {
|
|
2923
|
+
testId: props["data-testid"],
|
|
2919
2924
|
isSearchDisabled: searchDisabled,
|
|
2920
2925
|
isError: error,
|
|
2921
2926
|
isOpen: isListOpen,
|
|
@@ -3160,7 +3165,9 @@ const PromoBanner = ({
|
|
|
3160
3165
|
className: styles$c[`${baseClass$i}__wrapper`]
|
|
3161
3166
|
}, /* @__PURE__ */ React.createElement("div", {
|
|
3162
3167
|
className: styles$c[`${baseClass$i}__header`]
|
|
3163
|
-
}, header), /* @__PURE__ */ React.createElement(
|
|
3168
|
+
}, header), /* @__PURE__ */ React.createElement(Text, {
|
|
3169
|
+
as: "div"
|
|
3170
|
+
}, children), containerSize !== "large" && footer), containerSize === "large" && footer), onClose && /* @__PURE__ */ React.createElement("button", {
|
|
3164
3171
|
type: "button",
|
|
3165
3172
|
className: styles$c[`${baseClass$i}__close-icon`],
|
|
3166
3173
|
onClick: onClose
|
|
@@ -3990,6 +3997,7 @@ const Tooltip = (props) => {
|
|
|
3990
3997
|
function renderFloatingComponent() {
|
|
3991
3998
|
if (withFadeAnimation) {
|
|
3992
3999
|
const enter = css`
|
|
4000
|
+
pointer-events: none;
|
|
3993
4001
|
opacity: 0;
|
|
3994
4002
|
`;
|
|
3995
4003
|
const enterActive = css`
|
|
@@ -3998,6 +4006,9 @@ const Tooltip = (props) => {
|
|
|
3998
4006
|
transition-duration: ${transitionDuration}ms;
|
|
3999
4007
|
transition-delay: ${transitionDelay}ms;
|
|
4000
4008
|
`;
|
|
4009
|
+
const enterDone = css`
|
|
4010
|
+
pointer-events: initial;
|
|
4011
|
+
`;
|
|
4001
4012
|
const exit = css`
|
|
4002
4013
|
opacity: 1;
|
|
4003
4014
|
`;
|
|
@@ -4015,6 +4026,7 @@ const Tooltip = (props) => {
|
|
|
4015
4026
|
timeout,
|
|
4016
4027
|
classNames: {
|
|
4017
4028
|
enter,
|
|
4029
|
+
enterDone,
|
|
4018
4030
|
enterActive,
|
|
4019
4031
|
exit,
|
|
4020
4032
|
exitActive
|