@doist/reactist 17.6.0 → 17.7.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.
@@ -11,6 +11,7 @@ var flattenChildren = _interopDefault(require('react-keyed-flatten-children'));
11
11
  var tooltip = require('ariakit/tooltip');
12
12
  var portal = require('ariakit/portal');
13
13
  var ariakitUtils = require('ariakit-utils');
14
+ var useCallbackRef = require('use-callback-ref');
14
15
  var FocusLock = _interopDefault(require('react-focus-lock'));
15
16
  var ariaHidden = require('aria-hidden');
16
17
  var dialog = require('ariakit/dialog');
@@ -1713,7 +1714,7 @@ function PasswordHiddenIcon(props) {
1713
1714
 
1714
1715
  var modules_3f03ead6 = {"inputWrapper":"_66b448b3"};
1715
1716
 
1716
- var modules_aaf25250 = {"inputWrapper":"_9d172ece","bordered":"c59d0239","error":"_7e63ee20"};
1717
+ var modules_aaf25250 = {"inputWrapper":"fb09cd05","bordered":"f65f40dd","error":"_29118bf0","startIcon":"a40eb111"};
1717
1718
 
1718
1719
  const _excluded$j = ["variant", "label", "secondaryLabel", "auxiliaryLabel", "hint", "message", "tone", "maxWidth", "togglePasswordLabel", "hidden", "aria-describedby"];
1719
1720
  const PasswordField = /*#__PURE__*/React.forwardRef(function PasswordField(_ref, ref) {
@@ -1946,7 +1947,7 @@ function TextArea(_ref) {
1946
1947
  }, /*#__PURE__*/React.createElement("textarea", _objectSpread2(_objectSpread2({}, props), extraProps))));
1947
1948
  }
1948
1949
 
1949
- const _excluded$n = ["variant", "id", "label", "secondaryLabel", "auxiliaryLabel", "hint", "message", "tone", "type", "maxWidth", "hidden", "aria-describedby"];
1950
+ const _excluded$n = ["variant", "id", "label", "secondaryLabel", "auxiliaryLabel", "hint", "message", "tone", "type", "maxWidth", "hidden", "aria-describedby", "startIcon"];
1950
1951
  const TextField = /*#__PURE__*/React.forwardRef(function TextField(_ref, ref) {
1951
1952
  let {
1952
1953
  variant = 'default',
@@ -1960,10 +1961,20 @@ const TextField = /*#__PURE__*/React.forwardRef(function TextField(_ref, ref) {
1960
1961
  type = 'text',
1961
1962
  maxWidth,
1962
1963
  hidden,
1963
- 'aria-describedby': ariaDescribedBy
1964
+ 'aria-describedby': ariaDescribedBy,
1965
+ startIcon
1964
1966
  } = _ref,
1965
1967
  props = _objectWithoutProperties(_ref, _excluded$n);
1966
1968
 
1969
+ const internalRef = React.useRef(null);
1970
+ const combinedRef = useCallbackRef.useMergeRefs([ref, internalRef]);
1971
+
1972
+ function focusOnIconClick() {
1973
+ var _internalRef$current;
1974
+
1975
+ (_internalRef$current = internalRef.current) == null ? void 0 : _internalRef$current.focus();
1976
+ }
1977
+
1967
1978
  return /*#__PURE__*/React.createElement(BaseField, {
1968
1979
  variant: variant,
1969
1980
  id: id,
@@ -1977,10 +1988,19 @@ const TextField = /*#__PURE__*/React.forwardRef(function TextField(_ref, ref) {
1977
1988
  hidden: hidden,
1978
1989
  "aria-describedby": ariaDescribedBy
1979
1990
  }, extraProps => /*#__PURE__*/React.createElement(Box, {
1991
+ display: "flex",
1992
+ alignItems: "center",
1980
1993
  className: [modules_aaf25250.inputWrapper, tone === 'error' ? modules_aaf25250.error : null, variant === 'bordered' ? modules_aaf25250.bordered : null]
1981
- }, /*#__PURE__*/React.createElement("input", _objectSpread2(_objectSpread2(_objectSpread2({}, props), extraProps), {}, {
1994
+ }, startIcon ? /*#__PURE__*/React.createElement(Box, {
1995
+ display: "flex",
1996
+ className: modules_aaf25250.startIcon,
1997
+ onClick: focusOnIconClick,
1998
+ marginRight: "-xsmall",
1999
+ marginLeft: "small",
2000
+ "aria-hidden": true
2001
+ }, startIcon) : null, /*#__PURE__*/React.createElement("input", _objectSpread2(_objectSpread2(_objectSpread2({}, props), extraProps), {}, {
1982
2002
  type: type,
1983
- ref: ref
2003
+ ref: combinedRef
1984
2004
  }))));
1985
2005
  });
1986
2006