@xqmsg/ui-core 0.22.4 → 0.23.1-rc.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/dist/components/form/FormTypes.d.ts +2 -0
- package/dist/components/input/StackedCheckbox/StackedCheckbox.d.ts +3 -2
- package/dist/components/input/StackedInput/StackedInput.d.ts +1 -0
- package/dist/components/input/StackedPilledInput/index.d.ts +2 -0
- package/dist/components/input/StackedTextarea/StackedTextarea.d.ts +3 -0
- package/dist/components/input/components/token/index.d.ts +1 -0
- package/dist/components/input/index.d.ts +3 -2
- package/dist/components/select/index.d.ts +27 -0
- package/dist/index.d.ts +1 -0
- package/dist/theme/components/button.d.ts +116 -0
- package/dist/theme/components/checkbox.d.ts +28 -0
- package/dist/theme/components/input.d.ts +12 -0
- package/dist/theme/components/select.d.ts +12 -0
- package/dist/theme/components/textarea.d.ts +66 -0
- package/dist/ui-core.cjs.development.js +328 -53
- 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 +330 -56
- package/dist/ui-core.esm.js.map +1 -1
- package/package.json +1 -1
- package/src/components/button/Button.stories.tsx +92 -27
- package/src/components/form/FormTypes.ts +2 -0
- package/src/components/form/section/index.tsx +2 -0
- package/src/components/input/Input.stories.tsx +66 -0
- package/src/components/input/StackedCheckbox/StackedCheckbox.tsx +12 -4
- package/src/components/input/StackedInput/StackedInput.tsx +5 -0
- package/src/components/input/StackedPilledInput/index.tsx +286 -266
- package/src/components/input/StackedTextarea/StackedTextarea.tsx +29 -5
- package/src/components/input/components/dropdown/index.tsx +1 -1
- package/src/components/input/components/token/index.tsx +6 -5
- package/src/components/input/index.tsx +22 -9
- package/src/components/select/index.tsx +184 -0
- package/src/components/tabs/TabsWrapper.stories.tsx +1 -1
- package/src/index.tsx +3 -0
- package/src/theme/components/button.ts +67 -0
- package/src/theme/components/checkbox.ts +25 -0
- package/src/theme/components/input.ts +15 -1
- package/src/theme/components/textarea.ts +20 -0
- package/src/theme/customXQChakraTheme.ts +2 -0
|
@@ -15,6 +15,7 @@ var hi = require('react-icons/hi');
|
|
|
15
15
|
var provider = require('@chakra-ui/provider');
|
|
16
16
|
var themeTools = require('@chakra-ui/theme-tools');
|
|
17
17
|
var system = require('@chakra-ui/system');
|
|
18
|
+
var anatomy = require('@chakra-ui/anatomy');
|
|
18
19
|
|
|
19
20
|
/**
|
|
20
21
|
* A functional React component utilized to render the `ActionRow` component
|
|
@@ -761,7 +762,8 @@ var StackedCheckbox = /*#__PURE__*/React__default.forwardRef(function (_ref2, _r
|
|
|
761
762
|
var value = _ref2.value,
|
|
762
763
|
label = _ref2.label,
|
|
763
764
|
_onChange = _ref2.onChange,
|
|
764
|
-
disabled = _ref2.disabled
|
|
765
|
+
disabled = _ref2.disabled,
|
|
766
|
+
variant = _ref2.variant;
|
|
765
767
|
if (value === null) return null;
|
|
766
768
|
return /*#__PURE__*/React__default.createElement(react.Checkbox, {
|
|
767
769
|
ref: _ref,
|
|
@@ -771,9 +773,10 @@ var StackedCheckbox = /*#__PURE__*/React__default.forwardRef(function (_ref2, _r
|
|
|
771
773
|
if (_onChange) return _onChange(e.target.checked);
|
|
772
774
|
},
|
|
773
775
|
isChecked: Boolean(value),
|
|
774
|
-
disabled: disabled
|
|
776
|
+
disabled: disabled,
|
|
777
|
+
variant: variant
|
|
775
778
|
}, /*#__PURE__*/React__default.createElement(react.Text, {
|
|
776
|
-
fontSize:
|
|
779
|
+
fontSize: variant === 'mobile' ? '17px' : '13px',
|
|
777
780
|
alignSelf: "center"
|
|
778
781
|
}, label));
|
|
779
782
|
});
|
|
@@ -792,9 +795,6 @@ function _extends$6() {
|
|
|
792
795
|
};
|
|
793
796
|
return _extends$6.apply(this, arguments);
|
|
794
797
|
}
|
|
795
|
-
function _objectDestructuringEmpty(obj) {
|
|
796
|
-
if (obj == null) throw new TypeError("Cannot destructure " + obj);
|
|
797
|
-
}
|
|
798
798
|
function _objectWithoutPropertiesLoose(source, excluded) {
|
|
799
799
|
if (source == null) return {};
|
|
800
800
|
var target = {};
|
|
@@ -808,7 +808,7 @@ function _objectWithoutPropertiesLoose(source, excluded) {
|
|
|
808
808
|
return target;
|
|
809
809
|
}
|
|
810
810
|
|
|
811
|
-
var _excluded = ["type", "isRequired", "rightElement", "leftElement", "defaultValue", "allowDefault"];
|
|
811
|
+
var _excluded = ["type", "isRequired", "rightElement", "leftElement", "defaultValue", "allowDefault", "variant"];
|
|
812
812
|
/**
|
|
813
813
|
* A functional React component utilized to render the `StackedInput` component.
|
|
814
814
|
*/
|
|
@@ -820,13 +820,16 @@ var StackedInput = /*#__PURE__*/React__default.forwardRef(function (_ref2, _ref)
|
|
|
820
820
|
leftElement = _ref2.leftElement,
|
|
821
821
|
defaultValue = _ref2.defaultValue,
|
|
822
822
|
allowDefault = _ref2.allowDefault,
|
|
823
|
+
variant = _ref2.variant,
|
|
823
824
|
props = _objectWithoutPropertiesLoose(_ref2, _excluded);
|
|
824
|
-
return /*#__PURE__*/React__default.createElement(react.InputGroup, null, leftElement && leftElement, /*#__PURE__*/React__default.createElement(react.Input, Object.assign({
|
|
825
|
+
return /*#__PURE__*/React__default.createElement(react.InputGroup, null, leftElement && leftElement, variant, /*#__PURE__*/React__default.createElement(react.Input, Object.assign({
|
|
825
826
|
type: type,
|
|
826
827
|
isRequired: isRequired
|
|
827
828
|
}, props, {
|
|
828
829
|
ref: _ref,
|
|
829
830
|
defaultValue: defaultValue,
|
|
831
|
+
fontSize: variant === 'mobile' ? '17px' : '13px',
|
|
832
|
+
variant: variant,
|
|
830
833
|
onKeyDown: function onKeyDown(e) {
|
|
831
834
|
if (e.key === 'Enter' && !allowDefault) {
|
|
832
835
|
e.stopPropagation();
|
|
@@ -872,7 +875,8 @@ var Dropdown = function Dropdown(_ref) {
|
|
|
872
875
|
return options.map(function (option, idx) {
|
|
873
876
|
return /*#__PURE__*/React__default.createElement(react.Box, {
|
|
874
877
|
key: idx,
|
|
875
|
-
width: "100%"
|
|
878
|
+
width: "100%",
|
|
879
|
+
role: "combobox"
|
|
876
880
|
}, option.value === 'section_header' && options[idx + 1] && options[idx + 1].value !== 'section_header' && /*#__PURE__*/React__default.createElement(react.Box, {
|
|
877
881
|
color: colors.label.secondary.light,
|
|
878
882
|
fontSize: "13px",
|
|
@@ -1168,17 +1172,35 @@ var StackedSelect = /*#__PURE__*/React__default.forwardRef(function (_ref2, _ref
|
|
|
1168
1172
|
}));
|
|
1169
1173
|
});
|
|
1170
1174
|
|
|
1175
|
+
var _excluded$2 = ["isRequired", "allowDefault", "variant"];
|
|
1171
1176
|
/**
|
|
1172
1177
|
* A functional React component utilized to render the `StackedTextarea` component.
|
|
1173
1178
|
*/
|
|
1174
1179
|
var StackedTextarea = /*#__PURE__*/React__default.forwardRef(function (_ref2, _ref) {
|
|
1175
|
-
var
|
|
1180
|
+
var allowDefault = _ref2.allowDefault,
|
|
1181
|
+
variant = _ref2.variant,
|
|
1182
|
+
props = _objectWithoutPropertiesLoose(_ref2, _excluded$2);
|
|
1183
|
+
if (variant === 'mobile') {
|
|
1184
|
+
return /*#__PURE__*/React__default.createElement(react.Flex, null, allowDefault, /*#__PURE__*/React__default.createElement(react.Textarea, Object.assign({
|
|
1185
|
+
ref: _ref
|
|
1186
|
+
}, props, {
|
|
1187
|
+
variant: variant,
|
|
1188
|
+
fontSize: "17px",
|
|
1189
|
+
onKeyDown: function onKeyDown(e) {
|
|
1190
|
+
if (e.key === 'Enter' && !allowDefault) {
|
|
1191
|
+
e.stopPropagation();
|
|
1192
|
+
e.preventDefault();
|
|
1193
|
+
}
|
|
1194
|
+
}
|
|
1195
|
+
})));
|
|
1196
|
+
}
|
|
1176
1197
|
return /*#__PURE__*/React__default.createElement(react.Textarea, Object.assign({
|
|
1177
1198
|
ref: _ref
|
|
1178
1199
|
}, props, {
|
|
1179
|
-
|
|
1200
|
+
variant: variant,
|
|
1201
|
+
fontSize: variant === '' ? '13px' : '17px',
|
|
1180
1202
|
onKeyDown: function onKeyDown(e) {
|
|
1181
|
-
if (e.key === 'Enter') {
|
|
1203
|
+
if (e.key === 'Enter' && !allowDefault) {
|
|
1182
1204
|
e.stopPropagation();
|
|
1183
1205
|
e.preventDefault();
|
|
1184
1206
|
}
|
|
@@ -1222,15 +1244,17 @@ var Close = function Close(_ref) {
|
|
|
1222
1244
|
// For v1 we are truncating the label at 15 characters to avoid overflow
|
|
1223
1245
|
var Token = function Token(_ref) {
|
|
1224
1246
|
var label = _ref.label,
|
|
1225
|
-
onDelete = _ref.onDelete
|
|
1247
|
+
onDelete = _ref.onDelete,
|
|
1248
|
+
_ref$isMobile = _ref.isMobile,
|
|
1249
|
+
isMobile = _ref$isMobile === void 0 ? false : _ref$isMobile;
|
|
1226
1250
|
return /*#__PURE__*/React__default.createElement(react.Flex, {
|
|
1227
1251
|
key: label,
|
|
1228
|
-
borderRadius:
|
|
1252
|
+
borderRadius: 'full',
|
|
1229
1253
|
backgroundColor: "#7676801F",
|
|
1230
1254
|
alignItems: "center",
|
|
1231
1255
|
width: "fit-content",
|
|
1232
1256
|
w: "auto",
|
|
1233
|
-
h:
|
|
1257
|
+
h: isMobile ? '18px' : '16px',
|
|
1234
1258
|
pl: "6px",
|
|
1235
1259
|
pr: "2px",
|
|
1236
1260
|
py: "2px",
|
|
@@ -1238,13 +1262,13 @@ var Token = function Token(_ref) {
|
|
|
1238
1262
|
}, /*#__PURE__*/React__default.createElement(react.Text, {
|
|
1239
1263
|
whiteSpace: "nowrap",
|
|
1240
1264
|
color: colors.label.primary.light,
|
|
1241
|
-
fontSize:
|
|
1265
|
+
fontSize: isMobile ? '17px' : '13px',
|
|
1242
1266
|
pr: "4px"
|
|
1243
1267
|
}, lodash.truncate(label.trim(), {
|
|
1244
1268
|
length: 15,
|
|
1245
1269
|
omission: '...'
|
|
1246
1270
|
})), /*#__PURE__*/React__default.createElement(Close, {
|
|
1247
|
-
boxSize:
|
|
1271
|
+
boxSize: isMobile ? '17px' : '11px',
|
|
1248
1272
|
onClick: onDelete
|
|
1249
1273
|
}));
|
|
1250
1274
|
};
|
|
@@ -1541,7 +1565,10 @@ var StackedPilledInput = /*#__PURE__*/React__default.forwardRef(function (_ref2,
|
|
|
1541
1565
|
setValue = _ref2.setValue,
|
|
1542
1566
|
control = _ref2.control,
|
|
1543
1567
|
placeholder = _ref2.placeholder,
|
|
1544
|
-
disabled = _ref2.disabled
|
|
1568
|
+
disabled = _ref2.disabled,
|
|
1569
|
+
_ref2$separators = _ref2.separators,
|
|
1570
|
+
separators = _ref2$separators === void 0 ? ['Enter', ' ', ',', ';', 'Tab'] : _ref2$separators,
|
|
1571
|
+
variant = _ref2.variant;
|
|
1545
1572
|
var watchedValue = reactHookForm.useWatch({
|
|
1546
1573
|
control: control,
|
|
1547
1574
|
name: name
|
|
@@ -1578,12 +1605,17 @@ var StackedPilledInput = /*#__PURE__*/React__default.forwardRef(function (_ref2,
|
|
|
1578
1605
|
}
|
|
1579
1606
|
}
|
|
1580
1607
|
}, [latestTokenElement, watchedValue]);
|
|
1608
|
+
var handleOnChange = function handleOnChange(e) {
|
|
1609
|
+
if (tokenIndex === null) {
|
|
1610
|
+
setLocalValue(e.target.value.trim().replace(',', '').replace(';', '').length ? e.target.value : '');
|
|
1611
|
+
}
|
|
1612
|
+
};
|
|
1581
1613
|
var onHandleKeyDown = function onHandleKeyDown(e) {
|
|
1582
1614
|
if (e.key === 'Enter') {
|
|
1583
1615
|
e.stopPropagation();
|
|
1584
1616
|
e.preventDefault();
|
|
1585
1617
|
}
|
|
1586
|
-
if ((e.key
|
|
1618
|
+
if (separators.includes(e.key)) {
|
|
1587
1619
|
if (e.key === 'Enter' && !localValue.trim().length && tokenIndex !== null) {
|
|
1588
1620
|
setLocalValue(lastestFormValueToArray[tokenIndex]);
|
|
1589
1621
|
var _filteredUniqueValues = Array.from(new Set(lastestFormValueToArray.filter(function (value) {
|
|
@@ -1673,14 +1705,15 @@ var StackedPilledInput = /*#__PURE__*/React__default.forwardRef(function (_ref2,
|
|
|
1673
1705
|
onBlur();
|
|
1674
1706
|
}
|
|
1675
1707
|
});
|
|
1708
|
+
var isMobile = variant === 'mobile';
|
|
1676
1709
|
return /*#__PURE__*/React__default.createElement(react.Box, {
|
|
1677
1710
|
position: "relative"
|
|
1678
1711
|
}, /*#__PURE__*/React__default.createElement(react.Flex, {
|
|
1679
|
-
fontSize:
|
|
1712
|
+
fontSize: isMobile ? '17px' : '13px',
|
|
1680
1713
|
border: isFocussed ? '2px solid' : '.5px solid',
|
|
1681
1714
|
borderColor: isFocussed ? colors.border.focus : colors.border["default"],
|
|
1682
1715
|
pl: "8px",
|
|
1683
|
-
borderRadius:
|
|
1716
|
+
borderRadius: isMobile ? '0' : '4px',
|
|
1684
1717
|
alignItems: "center",
|
|
1685
1718
|
justifyContent: "space-between",
|
|
1686
1719
|
onClick: function onClick() {
|
|
@@ -1695,7 +1728,7 @@ var StackedPilledInput = /*#__PURE__*/React__default.forwardRef(function (_ref2,
|
|
|
1695
1728
|
bg: disabled ? colors.fill.light.quaternary : '#ffffff',
|
|
1696
1729
|
cursor: disabled ? 'not-allowed' : 'pointer',
|
|
1697
1730
|
ref: inputWrapperRef,
|
|
1698
|
-
h:
|
|
1731
|
+
h: isMobile ? '48px' : '26px'
|
|
1699
1732
|
}, /*#__PURE__*/React__default.createElement(react.Flex, {
|
|
1700
1733
|
h: "100%",
|
|
1701
1734
|
alignItems: "center",
|
|
@@ -1731,11 +1764,12 @@ var StackedPilledInput = /*#__PURE__*/React__default.forwardRef(function (_ref2,
|
|
|
1731
1764
|
e.stopPropagation();
|
|
1732
1765
|
e.preventDefault();
|
|
1733
1766
|
onRemoveTag(index);
|
|
1734
|
-
}
|
|
1767
|
+
},
|
|
1768
|
+
isMobile: isMobile
|
|
1735
1769
|
}));
|
|
1736
1770
|
}) : null, !lastestFormValueToArray.length && !isFocussed ? /*#__PURE__*/React__default.createElement(react.Text, {
|
|
1737
1771
|
color: colors.label.secondary.light,
|
|
1738
|
-
fontSize:
|
|
1772
|
+
fontSize: isMobile ? '17px' : '13px'
|
|
1739
1773
|
}, placeholder) : null), !disabled && /*#__PURE__*/React__default.createElement(react.Flex, {
|
|
1740
1774
|
flex: 1,
|
|
1741
1775
|
minWidth: isFocussed && !tokenIndex ? '20%' : 0
|
|
@@ -1752,9 +1786,7 @@ var StackedPilledInput = /*#__PURE__*/React__default.forwardRef(function (_ref2,
|
|
|
1752
1786
|
boxShadow: 'none !important'
|
|
1753
1787
|
},
|
|
1754
1788
|
value: localValue,
|
|
1755
|
-
onChange:
|
|
1756
|
-
return tokenIndex === null && setLocalValue(e.target.value.trim().replace(',', '').replace(';', '').length ? e.target.value : '');
|
|
1757
|
-
},
|
|
1789
|
+
onChange: handleOnChange,
|
|
1758
1790
|
ref: inputRef,
|
|
1759
1791
|
onFocus: function onFocus() {
|
|
1760
1792
|
return setIsFocussed(true);
|
|
@@ -1762,7 +1794,8 @@ var StackedPilledInput = /*#__PURE__*/React__default.forwardRef(function (_ref2,
|
|
|
1762
1794
|
onBlur: function onBlur() {
|
|
1763
1795
|
setIsFocussed(false);
|
|
1764
1796
|
return setTokenIndex(null);
|
|
1765
|
-
}
|
|
1797
|
+
},
|
|
1798
|
+
variant: variant
|
|
1766
1799
|
}))));
|
|
1767
1800
|
});
|
|
1768
1801
|
|
|
@@ -1837,6 +1870,8 @@ function Input(_ref) {
|
|
|
1837
1870
|
rightElement = _ref.rightElement,
|
|
1838
1871
|
leftElement = _ref.leftElement,
|
|
1839
1872
|
allowDefault = _ref.allowDefault,
|
|
1873
|
+
_ref$variant = _ref.variant,
|
|
1874
|
+
variant = _ref$variant === void 0 ? 'default' : _ref$variant,
|
|
1840
1875
|
onChange = _ref.onChange,
|
|
1841
1876
|
setValue = _ref.setValue,
|
|
1842
1877
|
setError = _ref.setError,
|
|
@@ -1861,7 +1896,8 @@ function Input(_ref) {
|
|
|
1861
1896
|
disabled: disabled,
|
|
1862
1897
|
defaultValue: defaultValue,
|
|
1863
1898
|
value: value,
|
|
1864
|
-
allowDefault: allowDefault
|
|
1899
|
+
allowDefault: allowDefault,
|
|
1900
|
+
variant: variant
|
|
1865
1901
|
});
|
|
1866
1902
|
case 'radio':
|
|
1867
1903
|
return /*#__PURE__*/React__default.createElement(StackedRadioGroup, {
|
|
@@ -1909,7 +1945,8 @@ function Input(_ref) {
|
|
|
1909
1945
|
onBlur: onBlur,
|
|
1910
1946
|
ref: ref,
|
|
1911
1947
|
disabled: disabled,
|
|
1912
|
-
value: value
|
|
1948
|
+
value: value,
|
|
1949
|
+
variant: variant
|
|
1913
1950
|
});
|
|
1914
1951
|
case 'checkbox':
|
|
1915
1952
|
return /*#__PURE__*/React__default.createElement(StackedCheckbox, {
|
|
@@ -1923,7 +1960,8 @@ function Input(_ref) {
|
|
|
1923
1960
|
value: value,
|
|
1924
1961
|
defaultValue: defaultValue,
|
|
1925
1962
|
label: label,
|
|
1926
|
-
disabled: disabled
|
|
1963
|
+
disabled: disabled,
|
|
1964
|
+
variant: variant
|
|
1927
1965
|
});
|
|
1928
1966
|
case 'multi-select':
|
|
1929
1967
|
return /*#__PURE__*/React__default.createElement(StackedMultiSelect, {
|
|
@@ -1960,7 +1998,8 @@ function Input(_ref) {
|
|
|
1960
1998
|
setError: setError,
|
|
1961
1999
|
clearErrors: clearErrors,
|
|
1962
2000
|
control: control,
|
|
1963
|
-
maxLength: maxLength
|
|
2001
|
+
maxLength: maxLength,
|
|
2002
|
+
variant: variant
|
|
1964
2003
|
});
|
|
1965
2004
|
case 'switch':
|
|
1966
2005
|
return /*#__PURE__*/React__default.createElement(StackedSwitch, {
|
|
@@ -1978,6 +2017,7 @@ function Input(_ref) {
|
|
|
1978
2017
|
return null;
|
|
1979
2018
|
}
|
|
1980
2019
|
};
|
|
2020
|
+
var nonLabeledInputs = ['checkbox'];
|
|
1981
2021
|
return /*#__PURE__*/React__default.createElement(reactHookForm.Controller, {
|
|
1982
2022
|
control: control,
|
|
1983
2023
|
name: name,
|
|
@@ -1996,8 +2036,8 @@ function Input(_ref) {
|
|
|
1996
2036
|
id: name,
|
|
1997
2037
|
isInvalid: isInvalid,
|
|
1998
2038
|
position: "relative",
|
|
1999
|
-
py: inputType !== '
|
|
2000
|
-
}, label && inputType !== '
|
|
2039
|
+
py: !nonLabeledInputs.includes(inputType) && variant !== 'mobile' && label || helperText || isInvalid ? 5 : 0
|
|
2040
|
+
}, label && !nonLabeledInputs.includes(inputType) && variant !== 'mobile' && /*#__PURE__*/React__default.createElement(Label$1, {
|
|
2001
2041
|
tooltipText: tooltipText,
|
|
2002
2042
|
label: label,
|
|
2003
2043
|
isRequired: isRequired
|
|
@@ -2036,7 +2076,8 @@ function FormSection(_ref) {
|
|
|
2036
2076
|
maxLength = _ref2.maxLength,
|
|
2037
2077
|
ariaLabel = _ref2.ariaLabel,
|
|
2038
2078
|
disabled = _ref2.disabled,
|
|
2039
|
-
defaultValue = _ref2.defaultValue
|
|
2079
|
+
defaultValue = _ref2.defaultValue,
|
|
2080
|
+
variant = _ref2.variant;
|
|
2040
2081
|
return /*#__PURE__*/React__default.createElement(Input, {
|
|
2041
2082
|
key: name,
|
|
2042
2083
|
control: form.control,
|
|
@@ -2052,7 +2093,8 @@ function FormSection(_ref) {
|
|
|
2052
2093
|
defaultValue: defaultValue,
|
|
2053
2094
|
setValue: form.setValue,
|
|
2054
2095
|
setError: form.setError,
|
|
2055
|
-
clearErrors: form.clearErrors
|
|
2096
|
+
clearErrors: form.clearErrors,
|
|
2097
|
+
variant: variant ? variant : ''
|
|
2056
2098
|
});
|
|
2057
2099
|
}));
|
|
2058
2100
|
}
|
|
@@ -2926,11 +2968,11 @@ var Task = function Task(_ref) {
|
|
|
2926
2968
|
});
|
|
2927
2969
|
};
|
|
2928
2970
|
|
|
2929
|
-
var _excluded$
|
|
2971
|
+
var _excluded$3 = ["boxSize", "color"];
|
|
2930
2972
|
var GearIcon = function GearIcon(_ref) {
|
|
2931
2973
|
var boxSize = _ref.boxSize,
|
|
2932
2974
|
color = _ref.color,
|
|
2933
|
-
props = _objectWithoutPropertiesLoose(_ref, _excluded$
|
|
2975
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded$3);
|
|
2934
2976
|
return /*#__PURE__*/React__default.createElement(react.Box, Object.assign({}, props), /*#__PURE__*/React__default.createElement("svg", Object.assign({
|
|
2935
2977
|
xmlns: "http://www.w3.org/2000/svg",
|
|
2936
2978
|
width: boxSize != null ? boxSize : 16,
|
|
@@ -2948,6 +2990,125 @@ var GearIcon = function GearIcon(_ref) {
|
|
|
2948
2990
|
})));
|
|
2949
2991
|
};
|
|
2950
2992
|
|
|
2993
|
+
var _excluded$4 = ["label", "ariaLabel", "className", "placeholder", "name", "helperText", "options", "tooltipText", "isInvalid", "errorText", "isRequired", "defaultValue", "fullOptions", "control", "disabled", "onChange", "setValue", "setError", "clearErrors"];
|
|
2994
|
+
/**
|
|
2995
|
+
* A functional React component utilized to render the `SelectNative` component.
|
|
2996
|
+
*/
|
|
2997
|
+
var SelectNative = function SelectNative(_ref) {
|
|
2998
|
+
var _options$;
|
|
2999
|
+
var name = _ref.name,
|
|
3000
|
+
helperText = _ref.helperText,
|
|
3001
|
+
options = _ref.options,
|
|
3002
|
+
isInvalid = _ref.isInvalid,
|
|
3003
|
+
errorText = _ref.errorText,
|
|
3004
|
+
isRequired = _ref.isRequired,
|
|
3005
|
+
defaultValue = _ref.defaultValue,
|
|
3006
|
+
control = _ref.control,
|
|
3007
|
+
disabled = _ref.disabled,
|
|
3008
|
+
onChange = _ref.onChange,
|
|
3009
|
+
setValue = _ref.setValue,
|
|
3010
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded$4);
|
|
3011
|
+
// const [selectedOption, setSelectedOption] = useState(
|
|
3012
|
+
// options.find(option => option.value === value)?.label ?? ''
|
|
3013
|
+
// );
|
|
3014
|
+
var _useState = React.useState(options ? (_options$ = options[0]) != null ? _options$ : '' : ''),
|
|
3015
|
+
selectedOption = _useState[0],
|
|
3016
|
+
setSelectedOption = _useState[1];
|
|
3017
|
+
//const [selectedOption, setSelectedOption] = useState(null);
|
|
3018
|
+
// useEffect(() => {
|
|
3019
|
+
// if (defaultValue) {
|
|
3020
|
+
// setSelectedOption(defaultValue);
|
|
3021
|
+
// }
|
|
3022
|
+
// setSelectedOption(
|
|
3023
|
+
// (fullOptions || options).find(option => option.value === value)?.label ??
|
|
3024
|
+
// ''
|
|
3025
|
+
// );
|
|
3026
|
+
// }, [fullOptions, value]);
|
|
3027
|
+
var handleOnSelectItem = function handleOnSelectItem(selectedValue) {
|
|
3028
|
+
console.log(selectedValue);
|
|
3029
|
+
var selectedOption = options == null ? void 0 : options.find(function (_ref2) {
|
|
3030
|
+
var val = _ref2.value;
|
|
3031
|
+
return selectedValue === val;
|
|
3032
|
+
});
|
|
3033
|
+
console.log(selectedValue);
|
|
3034
|
+
setValue(name, selectedValue);
|
|
3035
|
+
if (selectedOption) {
|
|
3036
|
+
if (onChange) {
|
|
3037
|
+
onChange(selectedOption.value);
|
|
3038
|
+
}
|
|
3039
|
+
setSelectedOption(selectedOption);
|
|
3040
|
+
setValue(name, selectedOption.value);
|
|
3041
|
+
}
|
|
3042
|
+
};
|
|
3043
|
+
console.log(selectedOption);
|
|
3044
|
+
React.useEffect(function () {
|
|
3045
|
+
if (defaultValue) {
|
|
3046
|
+
handleOnSelectItem(defaultValue);
|
|
3047
|
+
}
|
|
3048
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
3049
|
+
}, [defaultValue]);
|
|
3050
|
+
return /*#__PURE__*/React__default.createElement(reactHookForm.Controller, {
|
|
3051
|
+
control: control,
|
|
3052
|
+
name: name,
|
|
3053
|
+
// defaultValue={defaultValue as PathValue<T, Path<T>>}
|
|
3054
|
+
rules: {
|
|
3055
|
+
required: isRequired
|
|
3056
|
+
},
|
|
3057
|
+
/** @ts-ignore: issues with implicit */
|
|
3058
|
+
render: function render(_ref3) {
|
|
3059
|
+
var _ref3$field = _ref3.field,
|
|
3060
|
+
ref = _ref3$field.ref;
|
|
3061
|
+
return /*#__PURE__*/React__default.createElement(react.FormControl, {
|
|
3062
|
+
id: name,
|
|
3063
|
+
isInvalid: isInvalid,
|
|
3064
|
+
position: "relative",
|
|
3065
|
+
py: 0
|
|
3066
|
+
}, /*#__PURE__*/React__default.createElement(react.Box //ref={dropdownRef}
|
|
3067
|
+
, {
|
|
3068
|
+
position: "relative"
|
|
3069
|
+
}, /*#__PURE__*/React__default.createElement(react.Flex, {
|
|
3070
|
+
flexDirection: "column",
|
|
3071
|
+
//ref={dropdownRef}
|
|
3072
|
+
//scrollMargin="15px"
|
|
3073
|
+
border: "0",
|
|
3074
|
+
mt: "3px",
|
|
3075
|
+
//maxH="240px"
|
|
3076
|
+
overflowY: "auto",
|
|
3077
|
+
width: "fit-content",
|
|
3078
|
+
minWidth: "100%",
|
|
3079
|
+
zIndex: 100,
|
|
3080
|
+
tabIndex: -2000,
|
|
3081
|
+
borderTop: "0.5px solid #9999991A"
|
|
3082
|
+
}, /*#__PURE__*/React__default.createElement(react.Select, Object.assign({}, props, {
|
|
3083
|
+
required: isRequired,
|
|
3084
|
+
ref: ref,
|
|
3085
|
+
//value={selectedOption?.value ?? value}
|
|
3086
|
+
// textShadow={`0 0 0 ${colors.label.primary.light}`}
|
|
3087
|
+
disabled: disabled != null ? disabled : false,
|
|
3088
|
+
onChange: function onChange(e) {
|
|
3089
|
+
return handleOnSelectItem(e.target.value);
|
|
3090
|
+
},
|
|
3091
|
+
// onKeyDown={handleOnKeyDown}
|
|
3092
|
+
style: {
|
|
3093
|
+
cursor: 'pointer',
|
|
3094
|
+
color: 'var(--chakra-colors-blue-500)',
|
|
3095
|
+
height: '48px',
|
|
3096
|
+
fontSize: '17px',
|
|
3097
|
+
lineHeight: '20px',
|
|
3098
|
+
fontWeight: 400,
|
|
3099
|
+
padding: '12px 16px 12px 0px',
|
|
3100
|
+
borderRadius: 0
|
|
3101
|
+
}
|
|
3102
|
+
}), options && options.map(function (i) {
|
|
3103
|
+
return /*#__PURE__*/React__default.createElement("option", {
|
|
3104
|
+
value: i.value,
|
|
3105
|
+
key: i.sortValue
|
|
3106
|
+
}, i.label);
|
|
3107
|
+
})))), isInvalid ? /*#__PURE__*/React__default.createElement(react.FormErrorMessage, null, errorText) : helperText && /*#__PURE__*/React__default.createElement(react.FormHelperText, null, helperText));
|
|
3108
|
+
}
|
|
3109
|
+
});
|
|
3110
|
+
};
|
|
3111
|
+
|
|
2951
3112
|
/**
|
|
2952
3113
|
* A functional React component utilized to render the `BorderedBox` component
|
|
2953
3114
|
*/
|
|
@@ -3624,10 +3785,72 @@ var variantTertiary = function variantTertiary() {
|
|
|
3624
3785
|
}
|
|
3625
3786
|
});
|
|
3626
3787
|
};
|
|
3788
|
+
var variantPrimaryFlat = function variantPrimaryFlat() {
|
|
3789
|
+
return _extends$6({}, baseStyle$2, {
|
|
3790
|
+
bg: colors.fill.action,
|
|
3791
|
+
bgGradient: null,
|
|
3792
|
+
minWidth: '172.5px',
|
|
3793
|
+
padding: '10px 16px',
|
|
3794
|
+
borderRadius: '8px',
|
|
3795
|
+
border: '0.5px',
|
|
3796
|
+
gap: '8px',
|
|
3797
|
+
height: '44px',
|
|
3798
|
+
margin: '8px',
|
|
3799
|
+
fontSize: '17px',
|
|
3800
|
+
fontWeight: '500',
|
|
3801
|
+
lineHeight: '24px',
|
|
3802
|
+
letterSpacing: '0.02em',
|
|
3803
|
+
textAlign: 'center',
|
|
3804
|
+
boxShadow: '0px 0.5px 1px 0.5px #0000001A'
|
|
3805
|
+
});
|
|
3806
|
+
};
|
|
3807
|
+
var variantSecondaryFlat = function variantSecondaryFlat() {
|
|
3808
|
+
return _extends$6({}, variantPrimaryFlat(), {
|
|
3809
|
+
fontWeight: '400',
|
|
3810
|
+
color: colors.black,
|
|
3811
|
+
bg: colors.label.primary.dark,
|
|
3812
|
+
_hover: {
|
|
3813
|
+
bg: colors.label.primary.dark
|
|
3814
|
+
},
|
|
3815
|
+
_active: {
|
|
3816
|
+
color: colors.black,
|
|
3817
|
+
bg: colors.label.primary.dark,
|
|
3818
|
+
bgGradient: colors.fill.light.quaternary
|
|
3819
|
+
},
|
|
3820
|
+
_focus: {
|
|
3821
|
+
bg: colors.label.primary.dark
|
|
3822
|
+
}
|
|
3823
|
+
});
|
|
3824
|
+
};
|
|
3825
|
+
var variantTertiaryFlat = function variantTertiaryFlat() {
|
|
3826
|
+
return _extends$6({}, variantPrimaryFlat(), {
|
|
3827
|
+
fontWeight: '400',
|
|
3828
|
+
color: colors.label.primary.dark,
|
|
3829
|
+
bg: colors.blur.quaternary.dark,
|
|
3830
|
+
_hover: {
|
|
3831
|
+
bg: colors.blur.quaternary.dark
|
|
3832
|
+
},
|
|
3833
|
+
_active: {
|
|
3834
|
+
color: colors.label.primary.dark,
|
|
3835
|
+
bg: colors.blur.tertiary.dark
|
|
3836
|
+
},
|
|
3837
|
+
_focus: {
|
|
3838
|
+
color: colors.label.primary.dark,
|
|
3839
|
+
bg: colors.blur.quaternary.dark
|
|
3840
|
+
},
|
|
3841
|
+
_disabled: {
|
|
3842
|
+
backgroundColor: colors.blur.quaternary.dark,
|
|
3843
|
+
color: colors.blur.tertiary.dark
|
|
3844
|
+
}
|
|
3845
|
+
});
|
|
3846
|
+
};
|
|
3627
3847
|
var variants$2 = {
|
|
3628
3848
|
primary: /*#__PURE__*/variantPrimary(),
|
|
3629
3849
|
secondary: /*#__PURE__*/variantSecondary(),
|
|
3630
|
-
tertiary: /*#__PURE__*/variantTertiary()
|
|
3850
|
+
tertiary: /*#__PURE__*/variantTertiary(),
|
|
3851
|
+
'flat-primary': /*#__PURE__*/variantPrimaryFlat(),
|
|
3852
|
+
'flat-secondary': /*#__PURE__*/variantSecondaryFlat(),
|
|
3853
|
+
'flat-tertiary': /*#__PURE__*/variantTertiaryFlat()
|
|
3631
3854
|
};
|
|
3632
3855
|
var defaultProps$2 = {
|
|
3633
3856
|
variant: 'primary'
|
|
@@ -3638,7 +3861,26 @@ var Button$1 = {
|
|
|
3638
3861
|
defaultProps: defaultProps$2
|
|
3639
3862
|
};
|
|
3640
3863
|
|
|
3641
|
-
var
|
|
3864
|
+
var _createMultiStyleConf = /*#__PURE__*/react.createMultiStyleConfigHelpers(anatomy.checkboxAnatomy.keys),
|
|
3865
|
+
definePartsStyle = _createMultiStyleConf.definePartsStyle,
|
|
3866
|
+
defineMultiStyleConfig = _createMultiStyleConf.defineMultiStyleConfig;
|
|
3867
|
+
var roundedCheckbox = /*#__PURE__*/definePartsStyle({
|
|
3868
|
+
control: {
|
|
3869
|
+
borderRadius: 50,
|
|
3870
|
+
padding: 3
|
|
3871
|
+
},
|
|
3872
|
+
label: {
|
|
3873
|
+
fontSize: '17px'
|
|
3874
|
+
}
|
|
3875
|
+
});
|
|
3876
|
+
var variants$3 = {
|
|
3877
|
+
mobile: roundedCheckbox
|
|
3878
|
+
};
|
|
3879
|
+
var Checkbox = /*#__PURE__*/defineMultiStyleConfig({
|
|
3880
|
+
variants: variants$3
|
|
3881
|
+
});
|
|
3882
|
+
|
|
3883
|
+
var variants$4 = Badge.variants,
|
|
3642
3884
|
defaultProps$3 = Badge.defaultProps;
|
|
3643
3885
|
var baseStyle$3 = {
|
|
3644
3886
|
fontFamily: 'mono',
|
|
@@ -3648,7 +3890,7 @@ var baseStyle$3 = {
|
|
|
3648
3890
|
};
|
|
3649
3891
|
var Code = {
|
|
3650
3892
|
baseStyle: baseStyle$3,
|
|
3651
|
-
variants: variants$
|
|
3893
|
+
variants: variants$4,
|
|
3652
3894
|
defaultProps: defaultProps$3
|
|
3653
3895
|
};
|
|
3654
3896
|
|
|
@@ -3748,8 +3990,21 @@ var baseStyle$7 = {
|
|
|
3748
3990
|
}
|
|
3749
3991
|
}
|
|
3750
3992
|
};
|
|
3751
|
-
var
|
|
3752
|
-
|
|
3993
|
+
var mobileInputs = /*#__PURE__*/_extends$6({}, baseStyle$7, {
|
|
3994
|
+
field: {
|
|
3995
|
+
fontSize: '17px',
|
|
3996
|
+
border: 'none',
|
|
3997
|
+
py: '14px',
|
|
3998
|
+
px: '16px',
|
|
3999
|
+
cursor: 'pointer',
|
|
4000
|
+
lineHeight: '21px',
|
|
4001
|
+
fontWeight: 400,
|
|
4002
|
+
borderRadius: 0
|
|
4003
|
+
}
|
|
4004
|
+
});
|
|
4005
|
+
var variants$5 = {
|
|
4006
|
+
"default": baseStyle$7,
|
|
4007
|
+
mobile: mobileInputs
|
|
3753
4008
|
};
|
|
3754
4009
|
var defaultProps$4 = {
|
|
3755
4010
|
variant: 'default'
|
|
@@ -3757,7 +4012,7 @@ var defaultProps$4 = {
|
|
|
3757
4012
|
var Input$1 = {
|
|
3758
4013
|
parts: parts$3,
|
|
3759
4014
|
baseStyle: baseStyle$7,
|
|
3760
|
-
variants: variants$
|
|
4015
|
+
variants: variants$5,
|
|
3761
4016
|
defaultProps: defaultProps$4
|
|
3762
4017
|
};
|
|
3763
4018
|
|
|
@@ -3854,7 +4109,7 @@ function variantNavlink(props) {
|
|
|
3854
4109
|
}
|
|
3855
4110
|
};
|
|
3856
4111
|
}
|
|
3857
|
-
var variants$
|
|
4112
|
+
var variants$6 = {
|
|
3858
4113
|
sidebar: variantSidebar,
|
|
3859
4114
|
sidebarExact: variantSidebarExact,
|
|
3860
4115
|
subNavigation: variantSubNavigation,
|
|
@@ -3862,7 +4117,7 @@ var variants$5 = {
|
|
|
3862
4117
|
};
|
|
3863
4118
|
var Link$1 = {
|
|
3864
4119
|
baseStyle: baseStyle$8,
|
|
3865
|
-
variants: variants$
|
|
4120
|
+
variants: variants$6
|
|
3866
4121
|
};
|
|
3867
4122
|
|
|
3868
4123
|
var parts$4 = ['overlay', 'dialogContainer', 'dialog', 'header', 'closeButton', 'body', 'footer'];
|
|
@@ -3902,7 +4157,7 @@ var Modal$1 = {
|
|
|
3902
4157
|
};
|
|
3903
4158
|
|
|
3904
4159
|
var defaultProps$5 = Input$1.defaultProps,
|
|
3905
|
-
variants$
|
|
4160
|
+
variants$7 = Input$1.variants;
|
|
3906
4161
|
var parts$5 = ['field', 'icon'];
|
|
3907
4162
|
function baseStyleField() {
|
|
3908
4163
|
return _extends$6({}, Input$1.baseStyle.field, {
|
|
@@ -3931,7 +4186,7 @@ var baseStyle$a = function baseStyle() {
|
|
|
3931
4186
|
var Select = {
|
|
3932
4187
|
parts: parts$5,
|
|
3933
4188
|
baseStyle: baseStyle$a,
|
|
3934
|
-
variants: variants$
|
|
4189
|
+
variants: variants$7,
|
|
3935
4190
|
defaultProps: defaultProps$5
|
|
3936
4191
|
};
|
|
3937
4192
|
|
|
@@ -4270,7 +4525,7 @@ var variantSimple = {
|
|
|
4270
4525
|
}
|
|
4271
4526
|
}
|
|
4272
4527
|
};
|
|
4273
|
-
var variants$
|
|
4528
|
+
var variants$8 = {
|
|
4274
4529
|
line: variantLine,
|
|
4275
4530
|
enclosed: variantEnclosed,
|
|
4276
4531
|
'enclosed-colored': variantEnclosedColored,
|
|
@@ -4288,7 +4543,7 @@ var Tabs = {
|
|
|
4288
4543
|
parts: parts$8,
|
|
4289
4544
|
baseStyle: baseStyle$d,
|
|
4290
4545
|
sizes: sizes$1,
|
|
4291
|
-
variants: variants$
|
|
4546
|
+
variants: variants$8,
|
|
4292
4547
|
defaultProps: defaultProps$7
|
|
4293
4548
|
};
|
|
4294
4549
|
|
|
@@ -4300,11 +4555,29 @@ var baseStyle$e = /*#__PURE__*/_extends$6({}, Input$1.baseStyle.field, {
|
|
|
4300
4555
|
height: '78px',
|
|
4301
4556
|
lineHeight: 'short'
|
|
4302
4557
|
});
|
|
4558
|
+
var mobileInputs$1 = /*#__PURE__*/react.defineStyle( /*#__PURE__*/_extends$6({}, baseStyle$e, Input$1.variants.mobile.field, {
|
|
4559
|
+
border: 'none',
|
|
4560
|
+
borderRadius: 0,
|
|
4561
|
+
paddingY: '14px',
|
|
4562
|
+
paddingX: '16px',
|
|
4563
|
+
padding: '14px 16px',
|
|
4564
|
+
cursor: 'pointer',
|
|
4565
|
+
lineHeight: '21px',
|
|
4566
|
+
fontWeight: 400,
|
|
4567
|
+
resize: 'none',
|
|
4568
|
+
overflowY: 'auto',
|
|
4569
|
+
fontSize: '17px'
|
|
4570
|
+
}));
|
|
4571
|
+
var variants$9 = {
|
|
4572
|
+
"default": baseStyle$e,
|
|
4573
|
+
mobile: mobileInputs$1
|
|
4574
|
+
};
|
|
4303
4575
|
var defaultProps$8 = {
|
|
4304
4576
|
variant: 'default'
|
|
4305
4577
|
};
|
|
4306
4578
|
var Textarea = {
|
|
4307
4579
|
baseStyle: baseStyle$e,
|
|
4580
|
+
variants: variants$9,
|
|
4308
4581
|
defaultProps: defaultProps$8
|
|
4309
4582
|
};
|
|
4310
4583
|
|
|
@@ -4381,7 +4654,7 @@ function variantDescriptionLarge() {
|
|
|
4381
4654
|
letterSpacing: '0.02em'
|
|
4382
4655
|
};
|
|
4383
4656
|
}
|
|
4384
|
-
var variants$
|
|
4657
|
+
var variants$a = {
|
|
4385
4658
|
'title-small': variantTitleSmall,
|
|
4386
4659
|
'title-medium': variantTitleMedium,
|
|
4387
4660
|
'title-large': variantTitleLarge,
|
|
@@ -4393,9 +4666,9 @@ var variants$8 = {
|
|
|
4393
4666
|
'description-large': variantDescriptionLarge
|
|
4394
4667
|
};
|
|
4395
4668
|
var Text$1 = {
|
|
4396
|
-
variants: variants$
|
|
4669
|
+
variants: variants$a,
|
|
4397
4670
|
defaultProps: /*#__PURE__*/_extends$6({}, defaultProps$9, {
|
|
4398
|
-
variant: variants$
|
|
4671
|
+
variant: variants$a['description-large']
|
|
4399
4672
|
})
|
|
4400
4673
|
};
|
|
4401
4674
|
|
|
@@ -4428,6 +4701,7 @@ var customXQChakraTheme = /*#__PURE__*/react.extendTheme( /*#__PURE__*/_extends$
|
|
|
4428
4701
|
Alert: Alert,
|
|
4429
4702
|
Badge: Badge,
|
|
4430
4703
|
Button: Button$1,
|
|
4704
|
+
Checkbox: Checkbox,
|
|
4431
4705
|
Code: Code,
|
|
4432
4706
|
Form: Form$1,
|
|
4433
4707
|
FormError: FormError,
|
|
@@ -4825,6 +5099,7 @@ exports.Page = Page;
|
|
|
4825
5099
|
exports.Positive = Positive;
|
|
4826
5100
|
exports.Question = Question;
|
|
4827
5101
|
exports.Search = Search;
|
|
5102
|
+
exports.SelectNative = SelectNative;
|
|
4828
5103
|
exports.Services = Services;
|
|
4829
5104
|
exports.Settings = Settings;
|
|
4830
5105
|
exports.SpinnerButton = SpinnerButton;
|