@true-engineering/true-react-common-ui-kit 4.0.0-alpha0 → 4.0.0-alpha1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/ControlWrapper/ControlWrapper.styles.d.ts +1 -1
- package/dist/components/Input/Input.d.ts +3 -3
- package/dist/components/Input/Input.stories.d.ts +2 -2
- package/dist/components/Input/Input.styles.d.ts +3 -3
- package/dist/components/SearchInput/SearchInput.stories.d.ts +3 -3
- package/dist/components/Select/Select.styles.d.ts +8 -8
- package/dist/components/TextArea/TextArea.d.ts +2 -2
- package/dist/components/TextArea/TextArea.styles.d.ts +3 -3
- package/dist/components/WithMessages/WithMessages.d.ts +10 -0
- package/dist/components/{ControlGroup/ControlGroup.stories.d.ts → WithMessages/WithMessages.stories.d.ts} +2 -2
- package/dist/components/WithMessages/WithMessages.styles.d.ts +3 -0
- package/dist/components/WithMessages/index.d.ts +2 -0
- package/dist/components/index.d.ts +1 -1
- package/dist/theme/types.d.ts +2 -2
- package/dist/true-react-common-ui-kit.js +47 -54
- package/dist/true-react-common-ui-kit.js.map +1 -1
- package/dist/true-react-common-ui-kit.umd.cjs +47 -54
- package/dist/true-react-common-ui-kit.umd.cjs.map +1 -1
- package/package.json +1 -1
- package/src/components/ControlWrapper/ControlWrapper.styles.ts +1 -1
- package/src/components/ControlWrapper/ControlWrapper.tsx +1 -1
- package/src/components/DatePicker/components/DatePickerHeader/DatePickerHeader.styles.ts +1 -1
- package/src/components/FiltersPane/components/FilterSelect/FilterSelect.styles.ts +2 -2
- package/src/components/FiltersPane/components/FiltersPaneSearch/FiltersPaneSearch.styles.ts +8 -2
- package/src/components/Input/Input.styles.ts +5 -2
- package/src/components/Input/Input.tsx +7 -7
- package/src/components/Input/InputBase.tsx +1 -0
- package/src/components/MultiSelectList/MultiSelectList.styles.ts +1 -1
- package/src/components/PhoneInput/PhoneInput.styles.ts +2 -2
- package/src/components/PhoneInput/components/PhoneInputCountryList/PhoneInputCountryList.styles.ts +1 -1
- package/src/components/SearchInput/SearchInput.styles.ts +1 -1
- package/src/components/Select/CustomSelect.stories.tsx +2 -2
- package/src/components/Select/Select.styles.ts +8 -2
- package/src/components/Select/Select.tsx +7 -29
- package/src/components/TextArea/TextArea.styles.ts +7 -3
- package/src/components/TextArea/TextArea.tsx +13 -9
- package/src/components/{ControlGroup/ControlGroup.stories.tsx → WithMessages/WithMessages.stories.tsx} +10 -10
- package/src/components/{ControlGroup/ControlGroup.styles.ts → WithMessages/WithMessages.styles.ts} +4 -3
- package/src/components/{ControlGroup/ControlGroup.tsx → WithMessages/WithMessages.tsx} +13 -9
- package/src/components/WithMessages/index.ts +2 -0
- package/src/components/index.ts +1 -1
- package/src/theme/types.ts +2 -2
- package/dist/components/ControlGroup/ControlGroup.d.ts +0 -10
- package/dist/components/ControlGroup/ControlGroup.styles.d.ts +0 -3
- package/dist/components/ControlGroup/index.d.ts +0 -2
- package/src/components/ControlGroup/index.ts +0 -2
|
@@ -9614,11 +9614,12 @@
|
|
|
9614
9614
|
className: classes.root
|
|
9615
9615
|
}, trueReactPlatformHelpers.addDataTestId(testId), addDataAttributes(data)));
|
|
9616
9616
|
};
|
|
9617
|
-
var useStyles$J = createThemedStyles("
|
|
9618
|
-
|
|
9617
|
+
var useStyles$J = createThemedStyles("WithMessages", {
|
|
9618
|
+
withMessages: {
|
|
9619
9619
|
display: "flex",
|
|
9620
9620
|
flexDirection: "column",
|
|
9621
|
-
width: "100%"
|
|
9621
|
+
width: "100%",
|
|
9622
|
+
position: "relative"
|
|
9622
9623
|
},
|
|
9623
9624
|
error: {
|
|
9624
9625
|
color: "red"
|
|
@@ -9699,8 +9700,8 @@
|
|
|
9699
9700
|
}
|
|
9700
9701
|
return target;
|
|
9701
9702
|
}
|
|
9702
|
-
var
|
|
9703
|
-
var children = param.children, infoMessage = param.infoMessage, errorMessage = param.errorMessage,
|
|
9703
|
+
var WithMessages = /* @__PURE__ */ React.forwardRef(function(param, ref) {
|
|
9704
|
+
var children = param.children, infoMessage = param.infoMessage, errorMessage = param.errorMessage, controlsDirection = param.controlsDirection, tweakStyles = param.tweakStyles, testId = param.testId, data = param.data;
|
|
9704
9705
|
var classes = useStyles$J({
|
|
9705
9706
|
theme: tweakStyles
|
|
9706
9707
|
});
|
|
@@ -9709,12 +9710,12 @@
|
|
|
9709
9710
|
var _obj2;
|
|
9710
9711
|
return /* @__PURE__ */ jsxs("div", _object_spread_props$L(_object_spread$S({
|
|
9711
9712
|
ref,
|
|
9712
|
-
className: classes.
|
|
9713
|
+
className: classes.withMessages,
|
|
9713
9714
|
"data-invalid": shouldShowError ? true : void 0
|
|
9714
9715
|
}, trueReactPlatformHelpers.addDataAttributes(data, testId)), {
|
|
9715
9716
|
children: [
|
|
9716
9717
|
trueReactPlatformHelpers.isReactNodeNotEmpty(children) && /* @__PURE__ */ jsx("div", {
|
|
9717
|
-
className: clsx(classes.children, (_obj2 = {}, _define_property$U(_obj2, classes.horizontal,
|
|
9718
|
+
className: clsx(classes.children, (_obj2 = {}, _define_property$U(_obj2, classes.horizontal, controlsDirection === "horizontal"), _define_property$U(_obj2, classes.vertical, controlsDirection === "vertical"), _obj2)),
|
|
9718
9719
|
children
|
|
9719
9720
|
}),
|
|
9720
9721
|
(shouldShowError || shouldShowInfo) && /* @__PURE__ */ jsxs("div", {
|
|
@@ -9737,7 +9738,7 @@
|
|
|
9737
9738
|
});
|
|
9738
9739
|
var CONTROL$1 = dimensions.CONTROL, Z_INDEX$2 = dimensions.Z_INDEX;
|
|
9739
9740
|
var useStyles$I = createThemedStyles("ControlWrapper", {
|
|
9740
|
-
|
|
9741
|
+
controlWrapper: {
|
|
9741
9742
|
"--control-height": "".concat(CONTROL$1.HEIGHT - 2, "px"),
|
|
9742
9743
|
// borders
|
|
9743
9744
|
"--control-padding": "".concat(CONTROL$1.PADDING, "px"),
|
|
@@ -9954,7 +9955,7 @@
|
|
|
9954
9955
|
});
|
|
9955
9956
|
var _obj2, _obj1, _obj22;
|
|
9956
9957
|
return /* @__PURE__ */ jsxs("div", _object_spread_props$K(_object_spread$R({
|
|
9957
|
-
className: clsx(classes.
|
|
9958
|
+
className: clsx(classes.controlWrapper, trueReactPlatformHelpers.isNotEmpty(groupPlacement) && [
|
|
9958
9959
|
classes["placement-".concat(groupPlacement)]
|
|
9959
9960
|
], (_obj2 = {}, _define_property$T(_obj2, classes.invalid, isInvalid), _define_property$T(_obj2, classes.focused, isFocused), _define_property$T(_obj2, classes.withValue, hasValue), _define_property$T(_obj2, classes.disabled, isDisabled), _define_property$T(_obj2, classes.loading, isLoading), _define_property$T(_obj2, classes.minContent, !isFullWidth), _obj2))
|
|
9960
9961
|
}, trueReactPlatformHelpers.addDataAttributes(data, testId)), {
|
|
@@ -10062,12 +10063,14 @@
|
|
|
10062
10063
|
}
|
|
10063
10064
|
},
|
|
10064
10065
|
withLabel: {},
|
|
10066
|
+
withValue: {},
|
|
10065
10067
|
fakeValue: {
|
|
10066
10068
|
extend: "inputContent",
|
|
10067
10069
|
visibility: "hidden",
|
|
10068
10070
|
maxWidth: "100%",
|
|
10069
10071
|
overflow: "hidden",
|
|
10070
|
-
minWidth: 8
|
|
10072
|
+
minWidth: 8,
|
|
10073
|
+
whiteSpace: "nowrap"
|
|
10071
10074
|
},
|
|
10072
10075
|
units: {
|
|
10073
10076
|
alignSelf: "center",
|
|
@@ -10447,7 +10450,7 @@
|
|
|
10447
10450
|
]);
|
|
10448
10451
|
var _obj2;
|
|
10449
10452
|
var props = _object_spread$Q({
|
|
10450
|
-
className: clsx(classes.input, (_obj2 = {}, _define_property$S(_obj2, classes.withUnits, hasUnits), _define_property$S(_obj2, classes.withLabel, trueReactPlatformHelpers.isReactNodeNotEmpty(label)), _define_property$S(_obj2, classes.autoSized, isAutoSized), _define_property$S(_obj2, classes.focusedInput, isFocused), _define_property$S(_obj2, classes.disabledInput, isDisabled), _define_property$S(_obj2, classes.invalidInput, isInvalid), _obj2)),
|
|
10453
|
+
className: clsx(classes.input, (_obj2 = {}, _define_property$S(_obj2, classes.withUnits, hasUnits), _define_property$S(_obj2, classes.withValue, hasValue), _define_property$S(_obj2, classes.withLabel, trueReactPlatformHelpers.isReactNodeNotEmpty(label)), _define_property$S(_obj2, classes.autoSized, isAutoSized), _define_property$S(_obj2, classes.focusedInput, isFocused), _define_property$S(_obj2, classes.disabledInput, isDisabled), _define_property$S(_obj2, classes.invalidInput, isInvalid), _obj2)),
|
|
10451
10454
|
style: hasUnits && hasValue ? {
|
|
10452
10455
|
"--units-width": "".concat(unitsWidth, "px")
|
|
10453
10456
|
} : void 0,
|
|
@@ -10603,15 +10606,15 @@
|
|
|
10603
10606
|
"testId",
|
|
10604
10607
|
"tweakStyles"
|
|
10605
10608
|
]);
|
|
10606
|
-
var
|
|
10609
|
+
var tweakWithMessagesStyles = useTweakStyles({
|
|
10607
10610
|
tweakStyles,
|
|
10608
|
-
className: "
|
|
10611
|
+
className: "tweakWithMessages"
|
|
10609
10612
|
});
|
|
10610
|
-
return /* @__PURE__ */ jsx(
|
|
10613
|
+
return /* @__PURE__ */ jsx(WithMessages, {
|
|
10611
10614
|
errorMessage,
|
|
10612
10615
|
infoMessage,
|
|
10613
10616
|
testId,
|
|
10614
|
-
tweakStyles:
|
|
10617
|
+
tweakStyles: tweakWithMessagesStyles,
|
|
10615
10618
|
children: /* @__PURE__ */ jsx(InputBase, _object_spread_props$I(_object_spread$P({}, inputProps), {
|
|
10616
10619
|
ref,
|
|
10617
10620
|
testId,
|
|
@@ -10789,7 +10792,7 @@
|
|
|
10789
10792
|
});
|
|
10790
10793
|
var inputStyles$4 = {
|
|
10791
10794
|
tweakControlWrapper: {
|
|
10792
|
-
|
|
10795
|
+
controlWrapper: {
|
|
10793
10796
|
borderColor: "transparent",
|
|
10794
10797
|
borderRadius: 18,
|
|
10795
10798
|
paddingLeft: 0,
|
|
@@ -11561,6 +11564,11 @@
|
|
|
11561
11564
|
inputContent: {
|
|
11562
11565
|
paddingRight: 32
|
|
11563
11566
|
},
|
|
11567
|
+
input: {
|
|
11568
|
+
"&[readonly]": {
|
|
11569
|
+
cursor: "pointer"
|
|
11570
|
+
}
|
|
11571
|
+
},
|
|
11564
11572
|
tweakControlWrapper: {
|
|
11565
11573
|
controls: {
|
|
11566
11574
|
paddingRight: 40
|
|
@@ -11923,9 +11931,9 @@
|
|
|
11923
11931
|
]);
|
|
11924
11932
|
var hasSearchInputInList = optionsMode !== "normal" && shouldRenderSearchInputInList;
|
|
11925
11933
|
var hasReadonlyInput = isReadonly || optionsMode === "normal" || shouldRenderSearchInputInList;
|
|
11926
|
-
var
|
|
11934
|
+
var tweakWithMessagesStyles = useTweakStyles({
|
|
11927
11935
|
tweakStyles,
|
|
11928
|
-
className: "
|
|
11936
|
+
className: "tweakWithMessages",
|
|
11929
11937
|
currentComponentName: "Select"
|
|
11930
11938
|
});
|
|
11931
11939
|
var tweakInputStyles = useTweakStyles({
|
|
@@ -12017,22 +12025,10 @@
|
|
|
12017
12025
|
convertValueToId,
|
|
12018
12026
|
convertValueToString
|
|
12019
12027
|
]);
|
|
12020
|
-
var getDropdownOffset = function() {
|
|
12021
|
-
var _input_current_parentElement2;
|
|
12022
|
-
if (trueReactPlatformHelpers.isEmpty(input.current)) {
|
|
12023
|
-
return 0;
|
|
12024
|
-
}
|
|
12025
|
-
var _input_current_parentElement_offsetHeight;
|
|
12026
|
-
return (_input_current_parentElement_offsetHeight = (_input_current_parentElement2 = input.current.parentElement) === null || _input_current_parentElement2 === void 0 ? void 0 : _input_current_parentElement2.offsetHeight) !== null && _input_current_parentElement_offsetHeight !== void 0 ? _input_current_parentElement_offsetHeight : 0;
|
|
12027
|
-
};
|
|
12028
12028
|
var closeList = React.useCallback(function() {
|
|
12029
12029
|
setIsListOpen(false);
|
|
12030
12030
|
setSearchValue("");
|
|
12031
12031
|
setShouldShowDefaultOption(true);
|
|
12032
|
-
if (!(dropdownOptions === null || dropdownOptions === void 0 ? void 0 : dropdownOptions.shouldUsePopper)) {
|
|
12033
|
-
var _root_current;
|
|
12034
|
-
(_root_current = root2.current) === null || _root_current === void 0 ? void 0 : _root_current.style.removeProperty("--dropdown-offset");
|
|
12035
|
-
}
|
|
12036
12032
|
}, [
|
|
12037
12033
|
dropdownOptions === null || dropdownOptions === void 0 ? void 0 : dropdownOptions.shouldUsePopper
|
|
12038
12034
|
]);
|
|
@@ -12044,15 +12040,8 @@
|
|
|
12044
12040
|
onBlur
|
|
12045
12041
|
]);
|
|
12046
12042
|
var handleListOpen = function() {
|
|
12047
|
-
if (isReadonly) {
|
|
12048
|
-
return;
|
|
12049
|
-
}
|
|
12050
|
-
if (!isListOpen) {
|
|
12043
|
+
if (!isReadonly && !isListOpen) {
|
|
12051
12044
|
setIsListOpen(true);
|
|
12052
|
-
if (!(dropdownOptions === null || dropdownOptions === void 0 ? void 0 : dropdownOptions.shouldUsePopper)) {
|
|
12053
|
-
var _root_current;
|
|
12054
|
-
(_root_current = root2.current) === null || _root_current === void 0 ? void 0 : _root_current.style.setProperty("--dropdown-offset", "".concat(getDropdownOffset(), "px"));
|
|
12055
|
-
}
|
|
12056
12045
|
}
|
|
12057
12046
|
};
|
|
12058
12047
|
var handleFocus = function(event) {
|
|
@@ -12348,10 +12337,10 @@
|
|
|
12348
12337
|
})
|
|
12349
12338
|
]
|
|
12350
12339
|
}) : void 0;
|
|
12351
|
-
return /* @__PURE__ */ jsx(
|
|
12340
|
+
return /* @__PURE__ */ jsx(WithMessages, {
|
|
12352
12341
|
errorMessage,
|
|
12353
12342
|
infoMessage,
|
|
12354
|
-
tweakStyles:
|
|
12343
|
+
tweakStyles: tweakWithMessagesStyles,
|
|
12355
12344
|
children: /* @__PURE__ */ jsxs("div", {
|
|
12356
12345
|
className: classes.root,
|
|
12357
12346
|
onKeyDown: handleKeyDown,
|
|
@@ -12428,7 +12417,7 @@
|
|
|
12428
12417
|
},
|
|
12429
12418
|
tweakInput: {
|
|
12430
12419
|
tweakControlWrapper: {
|
|
12431
|
-
|
|
12420
|
+
controlWrapper: {
|
|
12432
12421
|
"--control-height": "35px",
|
|
12433
12422
|
border: "none"
|
|
12434
12423
|
}
|
|
@@ -15422,7 +15411,7 @@
|
|
|
15422
15411
|
var searchInputStyles$2 = {
|
|
15423
15412
|
tweakInput: {
|
|
15424
15413
|
tweakControlWrapper: {
|
|
15425
|
-
|
|
15414
|
+
controlWrapper: {
|
|
15426
15415
|
"--control-height": "40px",
|
|
15427
15416
|
backgroundColor: "transparent",
|
|
15428
15417
|
border: "none"
|
|
@@ -16382,7 +16371,7 @@
|
|
|
16382
16371
|
var searchInputStyles$1 = {
|
|
16383
16372
|
tweakInput: {
|
|
16384
16373
|
tweakControlWrapper: {
|
|
16385
|
-
|
|
16374
|
+
controlWrapper: {
|
|
16386
16375
|
"--control-height": "40px",
|
|
16387
16376
|
backgroundColor: "transparent",
|
|
16388
16377
|
border: "none"
|
|
@@ -18969,7 +18958,7 @@
|
|
|
18969
18958
|
var searchInputStyles = {
|
|
18970
18959
|
tweakInput: {
|
|
18971
18960
|
tweakControlWrapper: {
|
|
18972
|
-
|
|
18961
|
+
controlWrapper: {
|
|
18973
18962
|
"--control-height": "".concat(FILTER_HEIGHT - 2, "px"),
|
|
18974
18963
|
backgroundColor: "transparent",
|
|
18975
18964
|
border: "none",
|
|
@@ -28451,7 +28440,7 @@
|
|
|
28451
28440
|
});
|
|
28452
28441
|
var inputStyles$1 = {
|
|
28453
28442
|
tweakControlWrapper: {
|
|
28454
|
-
|
|
28443
|
+
controlWrapper: {
|
|
28455
28444
|
border: "none",
|
|
28456
28445
|
height: "calc(var(--control-height) - 2px)"
|
|
28457
28446
|
}
|
|
@@ -28726,7 +28715,7 @@
|
|
|
28726
28715
|
});
|
|
28727
28716
|
var inputStyles = {
|
|
28728
28717
|
tweakControlWrapper: {
|
|
28729
|
-
|
|
28718
|
+
controlWrapper: {
|
|
28730
28719
|
paddingLeft: COUNTRY_SELECT_WIDTH
|
|
28731
28720
|
},
|
|
28732
28721
|
label: {
|
|
@@ -30377,11 +30366,14 @@
|
|
|
30377
30366
|
margin: 0
|
|
30378
30367
|
}
|
|
30379
30368
|
}),
|
|
30369
|
+
wrapper: {
|
|
30370
|
+
width: "100%"
|
|
30371
|
+
},
|
|
30380
30372
|
autoSized: {
|
|
30381
30373
|
display: "grid",
|
|
30382
30374
|
gridTemplateRows: "minmax(0, 100%)",
|
|
30383
30375
|
"& > $textarea, &::after": {
|
|
30384
|
-
gridArea: "1 /
|
|
30376
|
+
gridArea: "1 / 1"
|
|
30385
30377
|
},
|
|
30386
30378
|
"&::after": {
|
|
30387
30379
|
extend: "textarea",
|
|
@@ -30582,9 +30574,9 @@
|
|
|
30582
30574
|
var classes = useStyles$4({
|
|
30583
30575
|
theme: tweakStyles
|
|
30584
30576
|
});
|
|
30585
|
-
var
|
|
30577
|
+
var tweakWithMessagesStyles = useTweakStyles({
|
|
30586
30578
|
tweakStyles,
|
|
30587
|
-
className: "
|
|
30579
|
+
className: "tweakWithMessages",
|
|
30588
30580
|
currentComponentName: "TextArea"
|
|
30589
30581
|
});
|
|
30590
30582
|
var tweakControlWrapperStyles = useTweakStyles({
|
|
@@ -30609,10 +30601,10 @@
|
|
|
30609
30601
|
setFocused(false);
|
|
30610
30602
|
onBlur === null || onBlur === void 0 ? void 0 : onBlur(event);
|
|
30611
30603
|
};
|
|
30612
|
-
return /* @__PURE__ */ jsxs(
|
|
30604
|
+
return /* @__PURE__ */ jsxs(WithMessages, {
|
|
30613
30605
|
errorMessage,
|
|
30614
30606
|
infoMessage,
|
|
30615
|
-
tweakStyles:
|
|
30607
|
+
tweakStyles: tweakWithMessagesStyles,
|
|
30616
30608
|
children: [
|
|
30617
30609
|
/* @__PURE__ */ jsx(ControlWrapper, _object_spread_props$5(_object_spread$5({
|
|
30618
30610
|
label,
|
|
@@ -30623,8 +30615,9 @@
|
|
|
30623
30615
|
isFullWidth: true,
|
|
30624
30616
|
testId
|
|
30625
30617
|
}, controlProps), {
|
|
30626
|
-
children: /* @__PURE__ */ jsx("div", _object_spread_props$5(_object_spread$5({
|
|
30627
|
-
className: classes.autoSized,
|
|
30618
|
+
children: /* @__PURE__ */ jsx("div", _object_spread_props$5(_object_spread$5({
|
|
30619
|
+
className: clsx(classes.wrapper, _define_property$5({}, classes.autoSized, isAutoSized))
|
|
30620
|
+
}, isAutoSized && {
|
|
30628
30621
|
"data-value": value
|
|
30629
30622
|
}), {
|
|
30630
30623
|
children: /* @__PURE__ */ jsx("textarea", _object_spread$5({
|
|
@@ -31487,7 +31480,6 @@
|
|
|
31487
31480
|
exports2.Checkbox = Checkbox;
|
|
31488
31481
|
exports2.CloseButton = CloseButton;
|
|
31489
31482
|
exports2.Colors = Colors;
|
|
31490
|
-
exports2.ControlGroup = ControlGroup;
|
|
31491
31483
|
exports2.ControlWrapper = ControlWrapper;
|
|
31492
31484
|
exports2.CssBaseline = CssBaseline;
|
|
31493
31485
|
exports2.DEFAULT_PHONE_MASK = DEFAULT_PHONE_MASK;
|
|
@@ -31544,6 +31536,7 @@
|
|
|
31544
31536
|
exports2.ThemedPreloader = ThemedPreloader;
|
|
31545
31537
|
exports2.Toaster = Toaster;
|
|
31546
31538
|
exports2.Tooltip = Tooltip;
|
|
31539
|
+
exports2.WithMessages = WithMessages;
|
|
31547
31540
|
exports2.WithPopup = WithPopup;
|
|
31548
31541
|
exports2.WithTooltip = WithTooltip;
|
|
31549
31542
|
exports2.addDataAttributes = addDataAttributes;
|