@doist/reactist 20.2.0 → 21.0.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/reactist.cjs.development.js +130 -144
- package/dist/reactist.cjs.development.js.map +1 -1
- package/dist/reactist.cjs.production.min.js +1 -1
- package/dist/reactist.cjs.production.min.js.map +1 -1
- package/es/index.js +1 -1
- package/es/password-field/password-field.js +19 -62
- package/es/password-field/password-field.js.map +1 -1
- package/es/text-field/text-field.js +18 -12
- package/es/text-field/text-field.js.map +1 -1
- package/es/text-field/text-field.module.css.js +1 -1
- package/es/toast/static-toast.js +1 -1
- package/es/toast/static-toast.js.map +1 -1
- package/es/toast/use-toasts.js +31 -11
- package/es/toast/use-toasts.js.map +1 -1
- package/lib/index.js +1 -1
- package/lib/password-field/password-field.d.ts +4 -4
- package/lib/password-field/password-field.js +1 -1
- package/lib/password-field/password-field.js.map +1 -1
- package/lib/text-field/text-field.d.ts +3 -2
- package/lib/text-field/text-field.js +1 -1
- package/lib/text-field/text-field.js.map +1 -1
- package/lib/text-field/text-field.module.css.js +1 -1
- package/lib/toast/static-toast.d.ts +2 -1
- package/lib/toast/static-toast.js +1 -1
- package/lib/toast/static-toast.js.map +1 -1
- package/lib/toast/use-toasts.js +1 -1
- package/lib/toast/use-toasts.js.map +1 -1
- package/package.json +1 -1
- package/styles/modal.css +1 -1
- package/styles/modal.module.css.css +1 -1
- package/styles/password-field.css +3 -3
- package/styles/reactist.css +1 -2
- package/styles/text-field.css +1 -1
- package/styles/text-field.module.css.css +1 -1
- package/es/password-field/password-field.module.css.js +0 -4
- package/es/password-field/password-field.module.css.js.map +0 -1
- package/lib/password-field/password-field.module.css.js +0 -2
- package/lib/password-field/password-field.module.css.js.map +0 -1
- package/styles/password-field.module.css.css +0 -1
|
@@ -1262,24 +1262,44 @@ const InternalToast = /*#__PURE__*/React__default.forwardRef(function InternalTo
|
|
|
1262
1262
|
clearTimeout(timeoutRef.current);
|
|
1263
1263
|
timeoutRef.current = undefined;
|
|
1264
1264
|
}, []);
|
|
1265
|
+
const removeToast = React__default.useCallback(function removeToast() {
|
|
1266
|
+
onRemoveToast(toastId);
|
|
1267
|
+
onDismiss == null ? void 0 : onDismiss();
|
|
1268
|
+
}, [onDismiss, onRemoveToast, toastId]);
|
|
1265
1269
|
React__default.useEffect(function setupAutoDismiss() {
|
|
1266
1270
|
if (!timeoutRunning || !autoDismissDelay) return;
|
|
1267
|
-
timeoutRef.current = window.setTimeout(
|
|
1268
|
-
onRemoveToast(toastId);
|
|
1269
|
-
onDismiss == null ? void 0 : onDismiss();
|
|
1270
|
-
}, autoDismissDelay * 1000);
|
|
1271
|
+
timeoutRef.current = window.setTimeout(removeToast, autoDismissDelay * 1000);
|
|
1271
1272
|
return stopTimeout;
|
|
1272
|
-
}, [autoDismissDelay,
|
|
1273
|
+
}, [autoDismissDelay, removeToast, stopTimeout, timeoutRunning]);
|
|
1274
|
+
/**
|
|
1275
|
+
* If the action is toast action object and not a custom element,
|
|
1276
|
+
* the `onClick` property is wrapped in another handler responsible
|
|
1277
|
+
* for removing the toast when the action is triggered.
|
|
1278
|
+
*/
|
|
1279
|
+
|
|
1280
|
+
const actionWithCustomActionHandler = React__default.useMemo(() => {
|
|
1281
|
+
if (!isActionObject(action)) {
|
|
1282
|
+
return action;
|
|
1283
|
+
}
|
|
1284
|
+
|
|
1285
|
+
return _objectSpread2(_objectSpread2({}, action), {}, {
|
|
1286
|
+
onClick: function handleActionClick() {
|
|
1287
|
+
if (!action) {
|
|
1288
|
+
return;
|
|
1289
|
+
}
|
|
1290
|
+
|
|
1291
|
+
action.onClick();
|
|
1292
|
+
removeToast();
|
|
1293
|
+
}
|
|
1294
|
+
});
|
|
1295
|
+
}, [action, removeToast]);
|
|
1273
1296
|
return /*#__PURE__*/React__default.createElement(StaticToast, {
|
|
1274
1297
|
ref: ref,
|
|
1275
1298
|
message: message,
|
|
1276
1299
|
description: description,
|
|
1277
1300
|
icon: icon,
|
|
1278
|
-
action:
|
|
1279
|
-
onDismiss: showDismissButton ?
|
|
1280
|
-
onDismiss == null ? void 0 : onDismiss();
|
|
1281
|
-
onRemoveToast(toastId);
|
|
1282
|
-
} : undefined,
|
|
1301
|
+
action: actionWithCustomActionHandler,
|
|
1302
|
+
onDismiss: showDismissButton ? removeToast : undefined,
|
|
1283
1303
|
dismissLabel: dismissLabel,
|
|
1284
1304
|
// @ts-expect-error
|
|
1285
1305
|
onMouseEnter: stopTimeout,
|
|
@@ -1660,6 +1680,49 @@ const CheckboxField = /*#__PURE__*/React.forwardRef(function CheckboxField(_ref,
|
|
|
1660
1680
|
}, /*#__PURE__*/React.createElement(Text, null, label)) : null);
|
|
1661
1681
|
});
|
|
1662
1682
|
|
|
1683
|
+
function PasswordVisibleIcon(props) {
|
|
1684
|
+
return /*#__PURE__*/React.createElement("svg", _objectSpread2({
|
|
1685
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
1686
|
+
width: "24",
|
|
1687
|
+
height: "24"
|
|
1688
|
+
}, props), /*#__PURE__*/React.createElement("g", {
|
|
1689
|
+
fill: "none",
|
|
1690
|
+
fillRule: "evenodd",
|
|
1691
|
+
stroke: "gray"
|
|
1692
|
+
}, /*#__PURE__*/React.createElement("path", {
|
|
1693
|
+
d: "M21.358 12C17.825 7.65 14.692 5.5 12 5.5c-2.624 0-5.67 2.043-9.097 6.181a.5.5 0 0 0 0 .638C6.331 16.457 9.376 18.5 12 18.5c2.692 0 5.825-2.15 9.358-6.5z"
|
|
1694
|
+
}), /*#__PURE__*/React.createElement("circle", {
|
|
1695
|
+
cx: "12",
|
|
1696
|
+
cy: "12",
|
|
1697
|
+
r: "3.5"
|
|
1698
|
+
})));
|
|
1699
|
+
}
|
|
1700
|
+
|
|
1701
|
+
function PasswordHiddenIcon(props) {
|
|
1702
|
+
return /*#__PURE__*/React.createElement("svg", _objectSpread2({
|
|
1703
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
1704
|
+
width: "24",
|
|
1705
|
+
height: "24"
|
|
1706
|
+
}, props), /*#__PURE__*/React.createElement("g", {
|
|
1707
|
+
fill: "gray",
|
|
1708
|
+
fillRule: "evenodd",
|
|
1709
|
+
transform: "translate(2 4)"
|
|
1710
|
+
}, /*#__PURE__*/React.createElement("path", {
|
|
1711
|
+
fillRule: "nonzero",
|
|
1712
|
+
d: "M13.047 2.888C11.962 2.294 10.944 2 10 2 7.56 2 4.63 3.966 1.288 8c1.133 1.368 2.218 2.497 3.253 3.394l-.708.708c-1.068-.93-2.173-2.085-3.315-3.464a1 1 0 0 1 0-1.276C4.031 3.121 7.192 1 10 1c1.196 0 2.456.385 3.78 1.154l-.733.734zm-6.02 10.263C8.084 13.72 9.076 14 10 14c2.443 0 5.373-1.969 8.712-6-1.11-1.34-2.176-2.453-3.193-3.341l.708-.709C17.437 5.013 18.695 6.363 20 8c-3.721 4.667-7.054 7-10 7-1.175 0-2.411-.371-3.709-1.113l.735-.736z"
|
|
1713
|
+
}), /*#__PURE__*/React.createElement("path", {
|
|
1714
|
+
fillRule: "nonzero",
|
|
1715
|
+
d: "M8.478 11.7l.79-.79a3 3 0 0 0 3.642-3.642l.79-.79A4 4 0 0 1 8.477 11.7zM6.334 9.602a4 4 0 0 1 5.268-5.268l-.78.78A3.002 3.002 0 0 0 7.113 8.82l-.78.78z"
|
|
1716
|
+
}), /*#__PURE__*/React.createElement("rect", {
|
|
1717
|
+
width: "21",
|
|
1718
|
+
height: "1",
|
|
1719
|
+
x: "-.722",
|
|
1720
|
+
y: "7.778",
|
|
1721
|
+
rx: ".5",
|
|
1722
|
+
transform: "rotate(-45 9.778 8.278)"
|
|
1723
|
+
})));
|
|
1724
|
+
}
|
|
1725
|
+
|
|
1663
1726
|
var modules_540a88ff = {"container":"_2e189908","auxiliaryLabel":"_83051e0a","bordered":"fd20ef50","error":"d1a17d92","primaryLabel":"_75e0afa0","secondaryLabel":"d04a867d","messageIcon":"_77b2107e"};
|
|
1664
1727
|
|
|
1665
1728
|
function FieldHint(props) {
|
|
@@ -1762,79 +1825,35 @@ function BaseField({
|
|
|
1762
1825
|
}, hint) : null);
|
|
1763
1826
|
}
|
|
1764
1827
|
|
|
1765
|
-
|
|
1766
|
-
return /*#__PURE__*/React.createElement("svg", _objectSpread2({
|
|
1767
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
1768
|
-
width: "24",
|
|
1769
|
-
height: "24"
|
|
1770
|
-
}, props), /*#__PURE__*/React.createElement("g", {
|
|
1771
|
-
fill: "none",
|
|
1772
|
-
fillRule: "evenodd",
|
|
1773
|
-
stroke: "gray"
|
|
1774
|
-
}, /*#__PURE__*/React.createElement("path", {
|
|
1775
|
-
d: "M21.358 12C17.825 7.65 14.692 5.5 12 5.5c-2.624 0-5.67 2.043-9.097 6.181a.5.5 0 0 0 0 .638C6.331 16.457 9.376 18.5 12 18.5c2.692 0 5.825-2.15 9.358-6.5z"
|
|
1776
|
-
}), /*#__PURE__*/React.createElement("circle", {
|
|
1777
|
-
cx: "12",
|
|
1778
|
-
cy: "12",
|
|
1779
|
-
r: "3.5"
|
|
1780
|
-
})));
|
|
1781
|
-
}
|
|
1828
|
+
var modules_aaf25250 = {"inputWrapper":"_6c84b26d","bordered":"_8522aec5","error":"d4d62845","slot":"_9c20ca38"};
|
|
1782
1829
|
|
|
1783
|
-
|
|
1784
|
-
|
|
1785
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
1786
|
-
width: "24",
|
|
1787
|
-
height: "24"
|
|
1788
|
-
}, props), /*#__PURE__*/React.createElement("g", {
|
|
1789
|
-
fill: "gray",
|
|
1790
|
-
fillRule: "evenodd",
|
|
1791
|
-
transform: "translate(2 4)"
|
|
1792
|
-
}, /*#__PURE__*/React.createElement("path", {
|
|
1793
|
-
fillRule: "nonzero",
|
|
1794
|
-
d: "M13.047 2.888C11.962 2.294 10.944 2 10 2 7.56 2 4.63 3.966 1.288 8c1.133 1.368 2.218 2.497 3.253 3.394l-.708.708c-1.068-.93-2.173-2.085-3.315-3.464a1 1 0 0 1 0-1.276C4.031 3.121 7.192 1 10 1c1.196 0 2.456.385 3.78 1.154l-.733.734zm-6.02 10.263C8.084 13.72 9.076 14 10 14c2.443 0 5.373-1.969 8.712-6-1.11-1.34-2.176-2.453-3.193-3.341l.708-.709C17.437 5.013 18.695 6.363 20 8c-3.721 4.667-7.054 7-10 7-1.175 0-2.411-.371-3.709-1.113l.735-.736z"
|
|
1795
|
-
}), /*#__PURE__*/React.createElement("path", {
|
|
1796
|
-
fillRule: "nonzero",
|
|
1797
|
-
d: "M8.478 11.7l.79-.79a3 3 0 0 0 3.642-3.642l.79-.79A4 4 0 0 1 8.477 11.7zM6.334 9.602a4 4 0 0 1 5.268-5.268l-.78.78A3.002 3.002 0 0 0 7.113 8.82l-.78.78z"
|
|
1798
|
-
}), /*#__PURE__*/React.createElement("rect", {
|
|
1799
|
-
width: "21",
|
|
1800
|
-
height: "1",
|
|
1801
|
-
x: "-.722",
|
|
1802
|
-
y: "7.778",
|
|
1803
|
-
rx: ".5",
|
|
1804
|
-
transform: "rotate(-45 9.778 8.278)"
|
|
1805
|
-
})));
|
|
1806
|
-
}
|
|
1807
|
-
|
|
1808
|
-
var modules_3f03ead6 = {"inputWrapper":"_66b448b3"};
|
|
1809
|
-
|
|
1810
|
-
var modules_aaf25250 = {"inputWrapper":"fb09cd05","bordered":"f65f40dd","error":"_29118bf0","startIcon":"a40eb111"};
|
|
1811
|
-
|
|
1812
|
-
const _excluded$k = ["variant", "label", "secondaryLabel", "auxiliaryLabel", "hint", "message", "tone", "maxWidth", "togglePasswordLabel", "hidden", "aria-describedby"];
|
|
1813
|
-
const PasswordField = /*#__PURE__*/React.forwardRef(function PasswordField(_ref, ref) {
|
|
1830
|
+
const _excluded$k = ["variant", "id", "label", "secondaryLabel", "auxiliaryLabel", "hint", "message", "tone", "type", "maxWidth", "hidden", "aria-describedby", "startSlot", "endSlot"];
|
|
1831
|
+
const TextField = /*#__PURE__*/React.forwardRef(function TextField(_ref, ref) {
|
|
1814
1832
|
let {
|
|
1815
1833
|
variant = 'default',
|
|
1834
|
+
id,
|
|
1816
1835
|
label,
|
|
1817
1836
|
secondaryLabel,
|
|
1818
1837
|
auxiliaryLabel,
|
|
1819
1838
|
hint,
|
|
1820
1839
|
message,
|
|
1821
1840
|
tone,
|
|
1841
|
+
type = 'text',
|
|
1822
1842
|
maxWidth,
|
|
1823
|
-
togglePasswordLabel = 'Toggle password visibility',
|
|
1824
1843
|
hidden,
|
|
1825
|
-
'aria-describedby': ariaDescribedBy
|
|
1844
|
+
'aria-describedby': ariaDescribedBy,
|
|
1845
|
+
startSlot,
|
|
1846
|
+
endSlot
|
|
1826
1847
|
} = _ref,
|
|
1827
1848
|
props = _objectWithoutProperties(_ref, _excluded$k);
|
|
1828
1849
|
|
|
1829
|
-
const id = useId(props.id);
|
|
1830
1850
|
const internalRef = React.useRef(null);
|
|
1831
|
-
const
|
|
1832
|
-
const [isPasswordVisible, setPasswordVisible] = React.useState(false);
|
|
1851
|
+
const combinedRef = useCallbackRef.useMergeRefs([ref, internalRef]);
|
|
1833
1852
|
|
|
1834
|
-
function
|
|
1853
|
+
function handleClick(event) {
|
|
1835
1854
|
var _internalRef$current;
|
|
1836
1855
|
|
|
1837
|
-
|
|
1856
|
+
if (event.currentTarget === combinedRef.current) return;
|
|
1838
1857
|
(_internalRef$current = internalRef.current) == null ? void 0 : _internalRef$current.focus();
|
|
1839
1858
|
}
|
|
1840
1859
|
|
|
@@ -1853,27 +1872,51 @@ const PasswordField = /*#__PURE__*/React.forwardRef(function PasswordField(_ref,
|
|
|
1853
1872
|
}, extraProps => /*#__PURE__*/React.createElement(Box, {
|
|
1854
1873
|
display: "flex",
|
|
1855
1874
|
alignItems: "center",
|
|
1856
|
-
className: [
|
|
1857
|
-
|
|
1858
|
-
|
|
1859
|
-
|
|
1860
|
-
|
|
1861
|
-
|
|
1862
|
-
|
|
1863
|
-
|
|
1864
|
-
|
|
1865
|
-
|
|
1866
|
-
|
|
1867
|
-
|
|
1868
|
-
"
|
|
1869
|
-
|
|
1870
|
-
|
|
1871
|
-
})))
|
|
1875
|
+
className: [modules_aaf25250.inputWrapper, tone === 'error' ? modules_aaf25250.error : null, variant === 'bordered' ? modules_aaf25250.bordered : null],
|
|
1876
|
+
onClick: handleClick
|
|
1877
|
+
}, startSlot ? /*#__PURE__*/React.createElement(Box, {
|
|
1878
|
+
className: modules_aaf25250.slot,
|
|
1879
|
+
display: "flex",
|
|
1880
|
+
marginRight: variant === 'bordered' ? 'xsmall' : '-xsmall',
|
|
1881
|
+
marginLeft: variant === 'bordered' ? '-xsmall' : 'xsmall'
|
|
1882
|
+
}, startSlot) : null, /*#__PURE__*/React.createElement("input", _objectSpread2(_objectSpread2(_objectSpread2({}, props), extraProps), {}, {
|
|
1883
|
+
type: type,
|
|
1884
|
+
ref: combinedRef
|
|
1885
|
+
})), endSlot ? /*#__PURE__*/React.createElement(Box, {
|
|
1886
|
+
className: modules_aaf25250.slot,
|
|
1887
|
+
display: "flex",
|
|
1888
|
+
marginRight: variant === 'bordered' ? '-xsmall' : 'xsmall',
|
|
1889
|
+
marginLeft: variant === 'bordered' ? 'xsmall' : '-xsmall'
|
|
1890
|
+
}, endSlot) : null));
|
|
1891
|
+
});
|
|
1892
|
+
|
|
1893
|
+
const _excluded$l = ["togglePasswordLabel"];
|
|
1894
|
+
const PasswordField = /*#__PURE__*/React.forwardRef(function PasswordField(_ref, ref) {
|
|
1895
|
+
let {
|
|
1896
|
+
togglePasswordLabel = 'Toggle password visibility'
|
|
1897
|
+
} = _ref,
|
|
1898
|
+
props = _objectWithoutProperties(_ref, _excluded$l);
|
|
1899
|
+
|
|
1900
|
+
const [isPasswordVisible, setPasswordVisible] = React.useState(false);
|
|
1901
|
+
const Icon = isPasswordVisible ? PasswordVisibleIcon : PasswordHiddenIcon;
|
|
1902
|
+
return /*#__PURE__*/React.createElement(TextField, _objectSpread2(_objectSpread2({}, props), {}, {
|
|
1903
|
+
ref: ref,
|
|
1904
|
+
// @ts-expect-error TextField does not support type="password", so we override the type check here
|
|
1905
|
+
type: isPasswordVisible ? 'text' : 'password',
|
|
1906
|
+
endSlot: /*#__PURE__*/React.createElement(Button, {
|
|
1907
|
+
variant: "quaternary",
|
|
1908
|
+
icon: /*#__PURE__*/React.createElement(Icon, {
|
|
1909
|
+
"aria-hidden": true
|
|
1910
|
+
}),
|
|
1911
|
+
"aria-label": togglePasswordLabel,
|
|
1912
|
+
onClick: () => setPasswordVisible(v => !v)
|
|
1913
|
+
})
|
|
1914
|
+
}));
|
|
1872
1915
|
});
|
|
1873
1916
|
|
|
1874
1917
|
var modules_1fa9b208 = {"selectWrapper":"a804edbf","bordered":"_50a3655f","error":"a6d38abf"};
|
|
1875
1918
|
|
|
1876
|
-
const _excluded$
|
|
1919
|
+
const _excluded$m = ["variant", "id", "label", "secondaryLabel", "auxiliaryLabel", "hint", "message", "tone", "maxWidth", "children", "hidden", "aria-describedby"];
|
|
1877
1920
|
const SelectField = /*#__PURE__*/React.forwardRef(function SelectField(_ref, ref) {
|
|
1878
1921
|
let {
|
|
1879
1922
|
variant = 'default',
|
|
@@ -1889,7 +1932,7 @@ const SelectField = /*#__PURE__*/React.forwardRef(function SelectField(_ref, ref
|
|
|
1889
1932
|
hidden,
|
|
1890
1933
|
'aria-describedby': ariaDescribedBy
|
|
1891
1934
|
} = _ref,
|
|
1892
|
-
props = _objectWithoutProperties(_ref, _excluded$
|
|
1935
|
+
props = _objectWithoutProperties(_ref, _excluded$m);
|
|
1893
1936
|
|
|
1894
1937
|
return /*#__PURE__*/React.createElement(BaseField, {
|
|
1895
1938
|
variant: variant,
|
|
@@ -1927,7 +1970,7 @@ function SelectChevron(props) {
|
|
|
1927
1970
|
|
|
1928
1971
|
var modules_8e05f7c9 = {"container":"bae487be","disabled":"_408d32a0","checked":"_99b0ead7","toggle":"_5af09fb5","label":"a66e1846","handle":"_0dcf70ec","keyFocused":"_1f5e7fd4"};
|
|
1929
1972
|
|
|
1930
|
-
const _excluded$
|
|
1973
|
+
const _excluded$n = ["label", "hint", "disabled", "hidden", "defaultChecked", "id", "aria-describedby", "aria-label", "aria-labelledby", "onChange"];
|
|
1931
1974
|
const SwitchField = /*#__PURE__*/React.forwardRef(function SwitchField(_ref, ref) {
|
|
1932
1975
|
var _ref2, _props$checked, _props$checked2;
|
|
1933
1976
|
|
|
@@ -1943,7 +1986,7 @@ const SwitchField = /*#__PURE__*/React.forwardRef(function SwitchField(_ref, ref
|
|
|
1943
1986
|
'aria-labelledby': originalAriaLabelledby,
|
|
1944
1987
|
onChange
|
|
1945
1988
|
} = _ref,
|
|
1946
|
-
props = _objectWithoutProperties(_ref, _excluded$
|
|
1989
|
+
props = _objectWithoutProperties(_ref, _excluded$n);
|
|
1947
1990
|
|
|
1948
1991
|
const id = useId(originalId);
|
|
1949
1992
|
const hintId = useId();
|
|
@@ -2003,7 +2046,7 @@ const SwitchField = /*#__PURE__*/React.forwardRef(function SwitchField(_ref, ref
|
|
|
2003
2046
|
|
|
2004
2047
|
var modules_2728c236 = {"textAreaContainer":"_21dbfa84","innerContainer":"_43588660","bordered":"f081b428","error":"a862f0e5","autoExpand":"_46360b15"};
|
|
2005
2048
|
|
|
2006
|
-
const _excluded$
|
|
2049
|
+
const _excluded$o = ["variant", "id", "label", "secondaryLabel", "auxiliaryLabel", "hint", "message", "tone", "maxWidth", "hidden", "aria-describedby", "rows", "autoExpand"];
|
|
2007
2050
|
const TextArea = /*#__PURE__*/React.forwardRef(function TextArea(_ref, ref) {
|
|
2008
2051
|
let {
|
|
2009
2052
|
variant = 'default',
|
|
@@ -2020,7 +2063,7 @@ const TextArea = /*#__PURE__*/React.forwardRef(function TextArea(_ref, ref) {
|
|
|
2020
2063
|
rows,
|
|
2021
2064
|
autoExpand = false
|
|
2022
2065
|
} = _ref,
|
|
2023
|
-
props = _objectWithoutProperties(_ref, _excluded$
|
|
2066
|
+
props = _objectWithoutProperties(_ref, _excluded$o);
|
|
2024
2067
|
|
|
2025
2068
|
const containerRef = React.useRef(null);
|
|
2026
2069
|
const internalRef = React.useRef(null);
|
|
@@ -2064,63 +2107,6 @@ const TextArea = /*#__PURE__*/React.forwardRef(function TextArea(_ref, ref) {
|
|
|
2064
2107
|
}))));
|
|
2065
2108
|
});
|
|
2066
2109
|
|
|
2067
|
-
const _excluded$o = ["variant", "id", "label", "secondaryLabel", "auxiliaryLabel", "hint", "message", "tone", "type", "maxWidth", "hidden", "aria-describedby", "startIcon"];
|
|
2068
|
-
const TextField = /*#__PURE__*/React.forwardRef(function TextField(_ref, ref) {
|
|
2069
|
-
let {
|
|
2070
|
-
variant = 'default',
|
|
2071
|
-
id,
|
|
2072
|
-
label,
|
|
2073
|
-
secondaryLabel,
|
|
2074
|
-
auxiliaryLabel,
|
|
2075
|
-
hint,
|
|
2076
|
-
message,
|
|
2077
|
-
tone,
|
|
2078
|
-
type = 'text',
|
|
2079
|
-
maxWidth,
|
|
2080
|
-
hidden,
|
|
2081
|
-
'aria-describedby': ariaDescribedBy,
|
|
2082
|
-
startIcon
|
|
2083
|
-
} = _ref,
|
|
2084
|
-
props = _objectWithoutProperties(_ref, _excluded$o);
|
|
2085
|
-
|
|
2086
|
-
const internalRef = React.useRef(null);
|
|
2087
|
-
const combinedRef = useCallbackRef.useMergeRefs([ref, internalRef]);
|
|
2088
|
-
|
|
2089
|
-
function focusOnIconClick() {
|
|
2090
|
-
var _internalRef$current;
|
|
2091
|
-
|
|
2092
|
-
(_internalRef$current = internalRef.current) == null ? void 0 : _internalRef$current.focus();
|
|
2093
|
-
}
|
|
2094
|
-
|
|
2095
|
-
return /*#__PURE__*/React.createElement(BaseField, {
|
|
2096
|
-
variant: variant,
|
|
2097
|
-
id: id,
|
|
2098
|
-
label: label,
|
|
2099
|
-
secondaryLabel: secondaryLabel,
|
|
2100
|
-
auxiliaryLabel: auxiliaryLabel,
|
|
2101
|
-
hint: hint,
|
|
2102
|
-
message: message,
|
|
2103
|
-
tone: tone,
|
|
2104
|
-
maxWidth: maxWidth,
|
|
2105
|
-
hidden: hidden,
|
|
2106
|
-
"aria-describedby": ariaDescribedBy
|
|
2107
|
-
}, extraProps => /*#__PURE__*/React.createElement(Box, {
|
|
2108
|
-
display: "flex",
|
|
2109
|
-
alignItems: "center",
|
|
2110
|
-
className: [modules_aaf25250.inputWrapper, tone === 'error' ? modules_aaf25250.error : null, variant === 'bordered' ? modules_aaf25250.bordered : null]
|
|
2111
|
-
}, startIcon ? /*#__PURE__*/React.createElement(Box, {
|
|
2112
|
-
display: "flex",
|
|
2113
|
-
className: modules_aaf25250.startIcon,
|
|
2114
|
-
onClick: focusOnIconClick,
|
|
2115
|
-
marginRight: "-xsmall",
|
|
2116
|
-
marginLeft: "small",
|
|
2117
|
-
"aria-hidden": true
|
|
2118
|
-
}, startIcon) : null, /*#__PURE__*/React.createElement("input", _objectSpread2(_objectSpread2(_objectSpread2({}, props), extraProps), {}, {
|
|
2119
|
-
type: type,
|
|
2120
|
-
ref: combinedRef
|
|
2121
|
-
}))));
|
|
2122
|
-
});
|
|
2123
|
-
|
|
2124
2110
|
function getInitials(name) {
|
|
2125
2111
|
var _initials;
|
|
2126
2112
|
|