musae 1.3.1-beta.11 → 1.3.1-beta.13

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.
@@ -108,16 +108,23 @@ var Input = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
108
108
  trailing: stylex.props(styles_stylex.default.trailing.base),
109
109
  outline: stylex.props(styles_stylex.default.outline.base),
110
110
  outlineLeading: stylex.props(styles_stylex.default.outlineLeading.base, disabled && styles_stylex.default.outlineLeading.disabled, invalid && styles_stylex.default.outlineLeading.invalid, shaped && styles_stylex.default.outlineLeading.shaped),
111
- outlineNotch: stylex.props(styles_stylex.default.outlineNotch.base, theme.$body.small, hasLabel && styles_stylex.default.outlineNotch.withLabel, hasLabel && hasPlaceholder && styles_stylex.default.outlineNotch.withLabelAndPlaceholder, disabled && styles_stylex.default.outlineNotch.disabled, invalid && styles_stylex.default.outlineNotch.invalid),
111
+ outlineNotch: stylex.props(styles_stylex.default.outlineNotch.base, theme.$body.small, hasLabel && styles_stylex.default.outlineNotch.withLabel, hasLabel && (hasPlaceholder || !!_value) && styles_stylex.default.outlineNotch.withLabelAndPlaceholder, disabled && styles_stylex.default.outlineNotch.disabled, invalid && styles_stylex.default.outlineNotch.invalid),
112
112
  outlineTrailing: stylex.props(styles_stylex.default.outlineTrailing.base, disabled && styles_stylex.default.outlineTrailing.disabled, invalid && styles_stylex.default.outlineTrailing.invalid, shaped && styles_stylex.default.outlineTrailing.shaped),
113
- floatingLabel: stylex.props(styles_stylex.default.floatingLabel.base, hasPlaceholder && styles_stylex.default.floatingLabel.placeholder, disabled && styles_stylex.default.floatingLabel.disabled, invalid && styles_stylex.default.floatingLabel.invalid)
113
+ floatingLabel: stylex.props(styles_stylex.default.floatingLabel.base, (hasPlaceholder || !!_value) && styles_stylex.default.floatingLabel.placeholder, disabled && styles_stylex.default.floatingLabel.disabled, invalid && styles_stylex.default.floatingLabel.invalid)
114
114
  };
115
- return /*#__PURE__*/React.createElement("div", _objectSpread({
115
+ return /*#__PURE__*/React.createElement("div", _objectSpread(_objectSpread({
116
116
  ref: inputorRef,
117
117
  className: className.stringify(classNames.inputor, _defineProperty(_defineProperty({}, classNames.focused, isFocused), classNames.invalid, !!invalid), className$1, styled.root.className),
118
118
  style: _objectSpread(_objectSpread(_objectSpread({}, styled.root.style), style), _themeColorVars)
119
119
  }, !disabled && {
120
120
  tabIndex: -1
121
+ }), {}, {
122
+ onFocus: function onFocus(event) {
123
+ if (event.target === event.currentTarget) {
124
+ var _inputRef$current5;
125
+ (_inputRef$current5 = inputRef.current) === null || _inputRef$current5 === void 0 || _inputRef$current5.focus();
126
+ }
127
+ }
121
128
  }), !!leading && (/*#__PURE__*/React.createElement("div", {
122
129
  className: className.stringify(classNames.leading, styled.leading.className),
123
130
  style: styled.leading.style
@@ -104,16 +104,23 @@ var Input = /*#__PURE__*/forwardRef(function (_ref, ref) {
104
104
  trailing: props(styles.trailing.base),
105
105
  outline: props(styles.outline.base),
106
106
  outlineLeading: props(styles.outlineLeading.base, disabled && styles.outlineLeading.disabled, invalid && styles.outlineLeading.invalid, shaped && styles.outlineLeading.shaped),
107
- outlineNotch: props(styles.outlineNotch.base, $body.small, hasLabel && styles.outlineNotch.withLabel, hasLabel && hasPlaceholder && styles.outlineNotch.withLabelAndPlaceholder, disabled && styles.outlineNotch.disabled, invalid && styles.outlineNotch.invalid),
107
+ outlineNotch: props(styles.outlineNotch.base, $body.small, hasLabel && styles.outlineNotch.withLabel, hasLabel && (hasPlaceholder || !!_value) && styles.outlineNotch.withLabelAndPlaceholder, disabled && styles.outlineNotch.disabled, invalid && styles.outlineNotch.invalid),
108
108
  outlineTrailing: props(styles.outlineTrailing.base, disabled && styles.outlineTrailing.disabled, invalid && styles.outlineTrailing.invalid, shaped && styles.outlineTrailing.shaped),
109
- floatingLabel: props(styles.floatingLabel.base, hasPlaceholder && styles.floatingLabel.placeholder, disabled && styles.floatingLabel.disabled, invalid && styles.floatingLabel.invalid)
109
+ floatingLabel: props(styles.floatingLabel.base, (hasPlaceholder || !!_value) && styles.floatingLabel.placeholder, disabled && styles.floatingLabel.disabled, invalid && styles.floatingLabel.invalid)
110
110
  };
111
- return /*#__PURE__*/React.createElement("div", _objectSpread({
111
+ return /*#__PURE__*/React.createElement("div", _objectSpread(_objectSpread({
112
112
  ref: inputorRef,
113
113
  className: stringify(classNames.inputor, _defineProperty(_defineProperty({}, classNames.focused, isFocused), classNames.invalid, !!invalid), className, styled.root.className),
114
114
  style: _objectSpread(_objectSpread(_objectSpread({}, styled.root.style), style), _themeColorVars)
115
115
  }, !disabled && {
116
116
  tabIndex: -1
117
+ }), {}, {
118
+ onFocus: function onFocus(event) {
119
+ if (event.target === event.currentTarget) {
120
+ var _inputRef$current5;
121
+ (_inputRef$current5 = inputRef.current) === null || _inputRef$current5 === void 0 || _inputRef$current5.focus();
122
+ }
123
+ }
117
124
  }), !!leading && (/*#__PURE__*/React.createElement("div", {
118
125
  className: stringify(classNames.leading, styled.leading.className),
119
126
  style: styled.leading.style
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "musae",
3
- "version": "1.3.1-beta.11",
3
+ "version": "1.3.1-beta.13",
4
4
  "description": "musae-ui",
5
5
  "author": "tutu@fantufantu.com",
6
6
  "license": "MIT",