@xqmsg/ui-core 0.23.1-rc.0 → 0.23.1-rc.1
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/input/StackedInput/StackedInput.d.ts +1 -0
- package/dist/components/input/StackedPilledInput/index.d.ts +1 -0
- package/dist/components/input/StackedTextarea/StackedTextarea.d.ts +1 -0
- package/dist/theme/components/button.d.ts +0 -3
- package/dist/theme/components/checkbox.d.ts +5 -4
- package/dist/theme/components/input.d.ts +12 -1
- package/dist/theme/components/select.d.ts +12 -1
- package/dist/theme/components/textarea.d.ts +15 -3
- package/dist/ui-core.cjs.development.js +84 -77
- package/dist/ui-core.cjs.development.js.map +1 -1
- package/dist/ui-core.cjs.production.min.js +1 -1
- package/dist/ui-core.cjs.production.min.js.map +1 -1
- package/dist/ui-core.esm.js +84 -77
- package/dist/ui-core.esm.js.map +1 -1
- package/package.json +1 -1
- package/src/components/input/Input.stories.tsx +1 -0
- package/src/components/input/StackedInput/StackedInput.tsx +8 -3
- package/src/components/input/StackedPilledInput/index.tsx +24 -0
- package/src/components/input/StackedTextarea/StackedTextarea.tsx +6 -4
- package/src/components/input/index.tsx +3 -0
- package/src/components/select/index.tsx +36 -80
- package/src/theme/components/button.ts +1 -1
- package/src/theme/components/checkbox.ts +5 -2
- package/src/theme/components/input.ts +9 -1
- package/src/theme/components/textarea.ts +4 -3
package/dist/ui-core.esm.js
CHANGED
|
@@ -801,7 +801,7 @@ function _objectWithoutPropertiesLoose(source, excluded) {
|
|
|
801
801
|
return target;
|
|
802
802
|
}
|
|
803
803
|
|
|
804
|
-
var _excluded = ["type", "isRequired", "rightElement", "leftElement", "defaultValue", "allowDefault", "variant"];
|
|
804
|
+
var _excluded = ["type", "isRequired", "rightElement", "leftElement", "defaultValue", "allowDefault", "variant", "label"];
|
|
805
805
|
/**
|
|
806
806
|
* A functional React component utilized to render the `StackedInput` component.
|
|
807
807
|
*/
|
|
@@ -814,14 +814,17 @@ var StackedInput = /*#__PURE__*/React__default.forwardRef(function (_ref2, _ref)
|
|
|
814
814
|
defaultValue = _ref2.defaultValue,
|
|
815
815
|
allowDefault = _ref2.allowDefault,
|
|
816
816
|
variant = _ref2.variant,
|
|
817
|
+
label = _ref2.label,
|
|
817
818
|
props = _objectWithoutPropertiesLoose(_ref2, _excluded);
|
|
818
|
-
|
|
819
|
+
var isMobile = variant === 'mobile';
|
|
820
|
+
var placeholder = isMobile && label ? label : undefined;
|
|
821
|
+
return /*#__PURE__*/React__default.createElement(InputGroup, null, leftElement && leftElement, label, /*#__PURE__*/React__default.createElement(Input$2, Object.assign({}, props, {
|
|
822
|
+
placeholder: placeholder,
|
|
819
823
|
type: type,
|
|
820
|
-
isRequired: isRequired
|
|
821
|
-
}, props, {
|
|
824
|
+
isRequired: isRequired,
|
|
822
825
|
ref: _ref,
|
|
823
826
|
defaultValue: defaultValue,
|
|
824
|
-
fontSize:
|
|
827
|
+
fontSize: isMobile ? '17px' : '13px',
|
|
825
828
|
variant: variant,
|
|
826
829
|
onKeyDown: function onKeyDown(e) {
|
|
827
830
|
if (e.key === 'Enter' && !allowDefault) {
|
|
@@ -1165,20 +1168,23 @@ var StackedSelect = /*#__PURE__*/React__default.forwardRef(function (_ref2, _ref
|
|
|
1165
1168
|
}));
|
|
1166
1169
|
});
|
|
1167
1170
|
|
|
1168
|
-
var _excluded$2 = ["isRequired", "allowDefault", "variant"];
|
|
1171
|
+
var _excluded$2 = ["isRequired", "allowDefault", "variant", "label"];
|
|
1169
1172
|
/**
|
|
1170
1173
|
* A functional React component utilized to render the `StackedTextarea` component.
|
|
1171
1174
|
*/
|
|
1172
1175
|
var StackedTextarea = /*#__PURE__*/React__default.forwardRef(function (_ref2, _ref) {
|
|
1173
1176
|
var allowDefault = _ref2.allowDefault,
|
|
1174
1177
|
variant = _ref2.variant,
|
|
1178
|
+
label = _ref2.label,
|
|
1175
1179
|
props = _objectWithoutPropertiesLoose(_ref2, _excluded$2);
|
|
1176
|
-
|
|
1177
|
-
|
|
1180
|
+
var isMobile = variant === 'mobile';
|
|
1181
|
+
if (isMobile) {
|
|
1182
|
+
return /*#__PURE__*/React__default.createElement(Flex, null, /*#__PURE__*/React__default.createElement(Textarea$1, Object.assign({
|
|
1178
1183
|
ref: _ref
|
|
1179
1184
|
}, props, {
|
|
1180
1185
|
variant: variant,
|
|
1181
1186
|
fontSize: "17px",
|
|
1187
|
+
placeholder: label != null ? label : '',
|
|
1182
1188
|
onKeyDown: function onKeyDown(e) {
|
|
1183
1189
|
if (e.key === 'Enter' && !allowDefault) {
|
|
1184
1190
|
e.stopPropagation();
|
|
@@ -1191,7 +1197,7 @@ var StackedTextarea = /*#__PURE__*/React__default.forwardRef(function (_ref2, _r
|
|
|
1191
1197
|
ref: _ref
|
|
1192
1198
|
}, props, {
|
|
1193
1199
|
variant: variant,
|
|
1194
|
-
fontSize:
|
|
1200
|
+
fontSize: "13px",
|
|
1195
1201
|
onKeyDown: function onKeyDown(e) {
|
|
1196
1202
|
if (e.key === 'Enter' && !allowDefault) {
|
|
1197
1203
|
e.stopPropagation();
|
|
@@ -1561,7 +1567,8 @@ var StackedPilledInput = /*#__PURE__*/React__default.forwardRef(function (_ref2,
|
|
|
1561
1567
|
disabled = _ref2.disabled,
|
|
1562
1568
|
_ref2$separators = _ref2.separators,
|
|
1563
1569
|
separators = _ref2$separators === void 0 ? ['Enter', ' ', ',', ';', 'Tab'] : _ref2$separators,
|
|
1564
|
-
variant = _ref2.variant
|
|
1570
|
+
variant = _ref2.variant,
|
|
1571
|
+
label = _ref2.label;
|
|
1565
1572
|
var watchedValue = useWatch({
|
|
1566
1573
|
control: control,
|
|
1567
1574
|
name: name
|
|
@@ -1709,6 +1716,18 @@ var StackedPilledInput = /*#__PURE__*/React__default.forwardRef(function (_ref2,
|
|
|
1709
1716
|
borderRadius: isMobile ? '0' : '4px',
|
|
1710
1717
|
alignItems: "center",
|
|
1711
1718
|
justifyContent: "space-between",
|
|
1719
|
+
style: isMobile ? {
|
|
1720
|
+
cursor: 'pointer',
|
|
1721
|
+
height: '48px',
|
|
1722
|
+
fontSize: '17px',
|
|
1723
|
+
lineHeight: '20px',
|
|
1724
|
+
fontWeight: 400,
|
|
1725
|
+
padding: '12px 16px 12px 0px',
|
|
1726
|
+
borderRadius: 0,
|
|
1727
|
+
border: '0.5px solid rgba(153, 153, 153, 0.1)',
|
|
1728
|
+
borderLeft: 'none',
|
|
1729
|
+
borderRight: 'none'
|
|
1730
|
+
} : undefined,
|
|
1712
1731
|
onClick: function onClick() {
|
|
1713
1732
|
if (isFocussed && tokenIndex !== null) {
|
|
1714
1733
|
setTokenIndex(null);
|
|
@@ -1788,7 +1807,11 @@ var StackedPilledInput = /*#__PURE__*/React__default.forwardRef(function (_ref2,
|
|
|
1788
1807
|
setIsFocussed(false);
|
|
1789
1808
|
return setTokenIndex(null);
|
|
1790
1809
|
},
|
|
1791
|
-
|
|
1810
|
+
placeholder: isMobile && label && lastestFormValueToArray.length === 0 ? label : '',
|
|
1811
|
+
variant: variant,
|
|
1812
|
+
style: isMobile ? {
|
|
1813
|
+
border: 'none'
|
|
1814
|
+
} : undefined
|
|
1792
1815
|
}))));
|
|
1793
1816
|
});
|
|
1794
1817
|
|
|
@@ -1890,7 +1913,8 @@ function Input(_ref) {
|
|
|
1890
1913
|
defaultValue: defaultValue,
|
|
1891
1914
|
value: value,
|
|
1892
1915
|
allowDefault: allowDefault,
|
|
1893
|
-
variant: variant
|
|
1916
|
+
variant: variant,
|
|
1917
|
+
label: label
|
|
1894
1918
|
});
|
|
1895
1919
|
case 'radio':
|
|
1896
1920
|
return /*#__PURE__*/React__default.createElement(StackedRadioGroup, {
|
|
@@ -1939,7 +1963,8 @@ function Input(_ref) {
|
|
|
1939
1963
|
ref: ref,
|
|
1940
1964
|
disabled: disabled,
|
|
1941
1965
|
value: value,
|
|
1942
|
-
variant: variant
|
|
1966
|
+
variant: variant,
|
|
1967
|
+
label: label
|
|
1943
1968
|
});
|
|
1944
1969
|
case 'checkbox':
|
|
1945
1970
|
return /*#__PURE__*/React__default.createElement(StackedCheckbox, {
|
|
@@ -1992,7 +2017,8 @@ function Input(_ref) {
|
|
|
1992
2017
|
clearErrors: clearErrors,
|
|
1993
2018
|
control: control,
|
|
1994
2019
|
maxLength: maxLength,
|
|
1995
|
-
variant: variant
|
|
2020
|
+
variant: variant,
|
|
2021
|
+
label: label
|
|
1996
2022
|
});
|
|
1997
2023
|
case 'switch':
|
|
1998
2024
|
return /*#__PURE__*/React__default.createElement(StackedSwitch, {
|
|
@@ -2988,7 +3014,6 @@ var _excluded$4 = ["label", "ariaLabel", "className", "placeholder", "name", "he
|
|
|
2988
3014
|
* A functional React component utilized to render the `SelectNative` component.
|
|
2989
3015
|
*/
|
|
2990
3016
|
var SelectNative = function SelectNative(_ref) {
|
|
2991
|
-
var _options$;
|
|
2992
3017
|
var name = _ref.name,
|
|
2993
3018
|
helperText = _ref.helperText,
|
|
2994
3019
|
options = _ref.options,
|
|
@@ -3002,38 +3027,35 @@ var SelectNative = function SelectNative(_ref) {
|
|
|
3002
3027
|
setValue = _ref.setValue,
|
|
3003
3028
|
props = _objectWithoutPropertiesLoose(_ref, _excluded$4);
|
|
3004
3029
|
// const [selectedOption, setSelectedOption] = useState(
|
|
3005
|
-
// options
|
|
3030
|
+
// options ? options[0] ?? '' : ''
|
|
3006
3031
|
// );
|
|
3007
|
-
var
|
|
3008
|
-
|
|
3009
|
-
|
|
3010
|
-
|
|
3011
|
-
|
|
3012
|
-
|
|
3013
|
-
|
|
3014
|
-
|
|
3015
|
-
|
|
3016
|
-
|
|
3017
|
-
|
|
3018
|
-
|
|
3019
|
-
|
|
3032
|
+
var style = {
|
|
3033
|
+
cursor: 'pointer',
|
|
3034
|
+
color: 'var(--chakra-colors-blue-500)',
|
|
3035
|
+
height: '48px',
|
|
3036
|
+
fontSize: '17px',
|
|
3037
|
+
lineHeight: '20px',
|
|
3038
|
+
fontWeight: 400,
|
|
3039
|
+
padding: '12px 16px 12px 0px',
|
|
3040
|
+
borderRadius: 0,
|
|
3041
|
+
border: '0.5px solid rgba(153, 153, 153, 0.1)',
|
|
3042
|
+
borderLeft: 'none',
|
|
3043
|
+
borderRight: 'none'
|
|
3044
|
+
};
|
|
3020
3045
|
var handleOnSelectItem = function handleOnSelectItem(selectedValue) {
|
|
3021
|
-
console.log(selectedValue);
|
|
3022
3046
|
var selectedOption = options == null ? void 0 : options.find(function (_ref2) {
|
|
3023
3047
|
var val = _ref2.value;
|
|
3024
3048
|
return selectedValue === val;
|
|
3025
3049
|
});
|
|
3026
|
-
console.log(selectedValue);
|
|
3027
|
-
setValue(name, selectedValue);
|
|
3028
3050
|
if (selectedOption) {
|
|
3029
3051
|
if (onChange) {
|
|
3030
3052
|
onChange(selectedOption.value);
|
|
3031
3053
|
}
|
|
3032
|
-
setSelectedOption(selectedOption);
|
|
3033
3054
|
setValue(name, selectedOption.value);
|
|
3055
|
+
} else {
|
|
3056
|
+
setValue(name, selectedValue);
|
|
3034
3057
|
}
|
|
3035
3058
|
};
|
|
3036
|
-
console.log(selectedOption);
|
|
3037
3059
|
useEffect(function () {
|
|
3038
3060
|
if (defaultValue) {
|
|
3039
3061
|
handleOnSelectItem(defaultValue);
|
|
@@ -3043,61 +3065,34 @@ var SelectNative = function SelectNative(_ref) {
|
|
|
3043
3065
|
return /*#__PURE__*/React__default.createElement(Controller, {
|
|
3044
3066
|
control: control,
|
|
3045
3067
|
name: name,
|
|
3046
|
-
// defaultValue={defaultValue as PathValue<T, Path<T>>}
|
|
3047
3068
|
rules: {
|
|
3048
3069
|
required: isRequired
|
|
3049
3070
|
},
|
|
3050
3071
|
/** @ts-ignore: issues with implicit */
|
|
3051
3072
|
render: function render(_ref3) {
|
|
3052
3073
|
var _ref3$field = _ref3.field,
|
|
3053
|
-
ref = _ref3$field.ref
|
|
3074
|
+
ref = _ref3$field.ref,
|
|
3075
|
+
value = _ref3$field.value;
|
|
3054
3076
|
return /*#__PURE__*/React__default.createElement(FormControl, {
|
|
3055
3077
|
id: name,
|
|
3056
3078
|
isInvalid: isInvalid,
|
|
3057
3079
|
position: "relative",
|
|
3058
3080
|
py: 0
|
|
3059
|
-
}, /*#__PURE__*/React__default.createElement(Box //ref={dropdownRef}
|
|
3060
|
-
, {
|
|
3061
|
-
position: "relative"
|
|
3062
|
-
}, /*#__PURE__*/React__default.createElement(Flex, {
|
|
3063
|
-
flexDirection: "column",
|
|
3064
|
-
//ref={dropdownRef}
|
|
3065
|
-
//scrollMargin="15px"
|
|
3066
|
-
border: "0",
|
|
3067
|
-
mt: "3px",
|
|
3068
|
-
//maxH="240px"
|
|
3069
|
-
overflowY: "auto",
|
|
3070
|
-
width: "fit-content",
|
|
3071
|
-
minWidth: "100%",
|
|
3072
|
-
zIndex: 100,
|
|
3073
|
-
tabIndex: -2000,
|
|
3074
|
-
borderTop: "0.5px solid #9999991A"
|
|
3075
3081
|
}, /*#__PURE__*/React__default.createElement(Select$1, Object.assign({}, props, {
|
|
3076
3082
|
required: isRequired,
|
|
3077
3083
|
ref: ref,
|
|
3078
|
-
|
|
3079
|
-
// textShadow={`0 0 0 ${colors.label.primary.light}`}
|
|
3084
|
+
value: value,
|
|
3080
3085
|
disabled: disabled != null ? disabled : false,
|
|
3081
3086
|
onChange: function onChange(e) {
|
|
3082
3087
|
return handleOnSelectItem(e.target.value);
|
|
3083
3088
|
},
|
|
3084
|
-
|
|
3085
|
-
style: {
|
|
3086
|
-
cursor: 'pointer',
|
|
3087
|
-
color: 'var(--chakra-colors-blue-500)',
|
|
3088
|
-
height: '48px',
|
|
3089
|
-
fontSize: '17px',
|
|
3090
|
-
lineHeight: '20px',
|
|
3091
|
-
fontWeight: 400,
|
|
3092
|
-
padding: '12px 16px 12px 0px',
|
|
3093
|
-
borderRadius: 0
|
|
3094
|
-
}
|
|
3089
|
+
style: style
|
|
3095
3090
|
}), options && options.map(function (i) {
|
|
3096
3091
|
return /*#__PURE__*/React__default.createElement("option", {
|
|
3097
3092
|
value: i.value,
|
|
3098
3093
|
key: i.sortValue
|
|
3099
3094
|
}, i.label);
|
|
3100
|
-
}))
|
|
3095
|
+
})), isInvalid ? /*#__PURE__*/React__default.createElement(FormErrorMessage, null, errorText) : helperText && /*#__PURE__*/React__default.createElement(FormHelperText, null, helperText));
|
|
3101
3096
|
}
|
|
3102
3097
|
});
|
|
3103
3098
|
};
|
|
@@ -3788,7 +3783,7 @@ var variantPrimaryFlat = function variantPrimaryFlat() {
|
|
|
3788
3783
|
border: '0.5px',
|
|
3789
3784
|
gap: '8px',
|
|
3790
3785
|
height: '44px',
|
|
3791
|
-
margin: '8px',
|
|
3786
|
+
// margin: '8px',
|
|
3792
3787
|
fontSize: '17px',
|
|
3793
3788
|
fontWeight: '500',
|
|
3794
3789
|
lineHeight: '24px',
|
|
@@ -3859,12 +3854,15 @@ var _createMultiStyleConf = /*#__PURE__*/createMultiStyleConfigHelpers(checkboxA
|
|
|
3859
3854
|
defineMultiStyleConfig = _createMultiStyleConf.defineMultiStyleConfig;
|
|
3860
3855
|
var roundedCheckbox = /*#__PURE__*/definePartsStyle({
|
|
3861
3856
|
control: {
|
|
3862
|
-
borderRadius: 50,
|
|
3863
|
-
padding: 3
|
|
3857
|
+
//borderRadius: 50,
|
|
3864
3858
|
},
|
|
3865
3859
|
label: {
|
|
3866
|
-
fontSize: '17px'
|
|
3867
|
-
|
|
3860
|
+
fontSize: '17px',
|
|
3861
|
+
fontWeight: 400,
|
|
3862
|
+
lineHeight: '20px',
|
|
3863
|
+
padding: '12px 16px 12px 0px'
|
|
3864
|
+
},
|
|
3865
|
+
height: '44px'
|
|
3868
3866
|
});
|
|
3869
3867
|
var variants$3 = {
|
|
3870
3868
|
mobile: roundedCheckbox
|
|
@@ -3980,19 +3978,27 @@ var baseStyle$7 = {
|
|
|
3980
3978
|
bg: '#ffffff',
|
|
3981
3979
|
border: '2px solid',
|
|
3982
3980
|
borderColor: colors.border.focus
|
|
3981
|
+
},
|
|
3982
|
+
_placeholder: {
|
|
3983
|
+
color: colors.label.secondary.light
|
|
3983
3984
|
}
|
|
3984
3985
|
}
|
|
3985
3986
|
};
|
|
3986
3987
|
var mobileInputs = /*#__PURE__*/_extends$6({}, baseStyle$7, {
|
|
3987
3988
|
field: {
|
|
3988
3989
|
fontSize: '17px',
|
|
3989
|
-
border: 'none',
|
|
3990
3990
|
py: '14px',
|
|
3991
3991
|
px: '16px',
|
|
3992
3992
|
cursor: 'pointer',
|
|
3993
3993
|
lineHeight: '21px',
|
|
3994
3994
|
fontWeight: 400,
|
|
3995
|
-
borderRadius: 0
|
|
3995
|
+
borderRadius: 0,
|
|
3996
|
+
height: '48px',
|
|
3997
|
+
padding: '12px 16px 12px 0px',
|
|
3998
|
+
border: '0.5px solid rgba(153, 153, 153, 0.1)',
|
|
3999
|
+
borderColor: 'rgba(153, 153, 153, 0.1)',
|
|
4000
|
+
borderLeft: 'none',
|
|
4001
|
+
borderRight: 'none'
|
|
3996
4002
|
}
|
|
3997
4003
|
});
|
|
3998
4004
|
var variants$5 = {
|
|
@@ -4551,15 +4557,16 @@ var baseStyle$e = /*#__PURE__*/_extends$6({}, Input$1.baseStyle.field, {
|
|
|
4551
4557
|
var mobileInputs$1 = /*#__PURE__*/defineStyle$1( /*#__PURE__*/_extends$6({}, baseStyle$e, Input$1.variants.mobile.field, {
|
|
4552
4558
|
border: 'none',
|
|
4553
4559
|
borderRadius: 0,
|
|
4554
|
-
paddingY: '
|
|
4555
|
-
paddingX: '
|
|
4556
|
-
padding: '
|
|
4560
|
+
paddingY: '16px',
|
|
4561
|
+
paddingX: '0',
|
|
4562
|
+
// padding: '16px 16px',
|
|
4557
4563
|
cursor: 'pointer',
|
|
4558
4564
|
lineHeight: '21px',
|
|
4559
4565
|
fontWeight: 400,
|
|
4560
4566
|
resize: 'none',
|
|
4561
4567
|
overflowY: 'auto',
|
|
4562
|
-
fontSize: '17px'
|
|
4568
|
+
fontSize: '17px',
|
|
4569
|
+
minHeight: '208px'
|
|
4563
4570
|
}));
|
|
4564
4571
|
var variants$9 = {
|
|
4565
4572
|
"default": baseStyle$e,
|