musae 1.3.1-beta.13 → 1.3.1-beta.14

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.
@@ -18,7 +18,7 @@ var context = require('./context.cjs');
18
18
  var theme = require('../theme/theme.cjs');
19
19
  var useThemeColorVars = require('../../hooks/use-theme-color-vars.cjs');
20
20
 
21
- var _excluded = ["className", "style", "type", "variant", "shaped", "invalid", "disabled", "maxLength", "value", "onBlur", "onChange", "onClick", "onFocus", "leading", "trailing", "label"];
21
+ var _excluded = ["className", "style", "type", "variant", "shaped", "invalid", "disabled", "maxLength", "value", "onBlur", "onChange", "onClick", "onFocus", "leading", "trailing", "label", "inputClassName"];
22
22
  /**
23
23
  * @author murukal
24
24
  * @zh 输入组件
@@ -43,6 +43,7 @@ var Input = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
43
43
  leading = _ref.leading,
44
44
  trailing = _ref.trailing,
45
45
  label = _ref.label,
46
+ inputClassName = _ref.inputClassName,
46
47
  inputProps = _objectWithoutProperties(_ref, _excluded);
47
48
  var inputorRef = React.useRef(null);
48
49
  var inputRef = React.useRef(null);
@@ -131,7 +132,7 @@ var Input = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
131
132
  }, leading)), /*#__PURE__*/React.createElement("input", _objectSpread(_objectSpread({
132
133
  id: id,
133
134
  value: _value,
134
- className: className.stringify(classNames.input, styled.input.className),
135
+ className: className.stringify(classNames.input, inputClassName, styled.input.className),
135
136
  style: styled.input.style,
136
137
  type: type,
137
138
  ref: inputRef,
@@ -14,7 +14,7 @@ import { CLASS_NAMES } from './context.mjs';
14
14
  import { $body } from '../theme/theme.mjs';
15
15
  import { useThemeColorVars } from '../../hooks/use-theme-color-vars.mjs';
16
16
 
17
- var _excluded = ["className", "style", "type", "variant", "shaped", "invalid", "disabled", "maxLength", "value", "onBlur", "onChange", "onClick", "onFocus", "leading", "trailing", "label"];
17
+ var _excluded = ["className", "style", "type", "variant", "shaped", "invalid", "disabled", "maxLength", "value", "onBlur", "onChange", "onClick", "onFocus", "leading", "trailing", "label", "inputClassName"];
18
18
  /**
19
19
  * @author murukal
20
20
  * @zh 输入组件
@@ -39,6 +39,7 @@ var Input = /*#__PURE__*/forwardRef(function (_ref, ref) {
39
39
  leading = _ref.leading,
40
40
  trailing = _ref.trailing,
41
41
  label = _ref.label,
42
+ inputClassName = _ref.inputClassName,
42
43
  inputProps = _objectWithoutProperties(_ref, _excluded);
43
44
  var inputorRef = useRef(null);
44
45
  var inputRef = useRef(null);
@@ -127,7 +128,7 @@ var Input = /*#__PURE__*/forwardRef(function (_ref, ref) {
127
128
  }, leading)), /*#__PURE__*/React.createElement("input", _objectSpread(_objectSpread({
128
129
  id: id,
129
130
  value: _value,
130
- className: stringify(classNames.input, styled.input.className),
131
+ className: stringify(classNames.input, inputClassName, styled.input.className),
131
132
  style: styled.input.style,
132
133
  type: type,
133
134
  ref: inputRef,
@@ -9,11 +9,11 @@ var styles = require('./styles.cjs');
9
9
  var React = require('react');
10
10
  var input = require('../input/input.cjs');
11
11
  var relax = require('@aiszlab/relax');
12
- var hooks = require('../theme/hooks.cjs');
13
12
  var stylex = require('../../node_modules/.pnpm/@stylexjs_stylex@0.19.0/node_modules/@stylexjs/stylex/lib/es/stylex.cjs');
14
13
  var context = require('./context.cjs');
15
14
  var useClassNames = require('../../hooks/use-class-names.cjs');
16
15
  var className = require('@aiszlab/relax/class-name');
16
+ var useThemeColorVars = require('../../hooks/use-theme-color-vars.cjs');
17
17
  var visibilityOff = require('../icon/icons/action/visibility-off.cjs');
18
18
  var visibility = require('../icon/icons/action/visibility.cjs');
19
19
 
@@ -25,19 +25,18 @@ var PasswordInput = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
25
25
  _useBoolean2 = _slicedToArray(_useBoolean, 2),
26
26
  isVisible = _useBoolean2[0],
27
27
  toggle = _useBoolean2[1].toggle;
28
- var theme = hooks.useTheme();
29
28
  var classNames = useClassNames.useClassNames(context.CLASS_NAMES);
29
+ var themeColorVars = useThemeColorVars.useThemeColorVars(["secondary-fixed-dim", "secondary"]);
30
30
  var styled = {
31
+ input: stylex.props(styles.default.input),
31
32
  visibility: stylex.props(styles.default.visibility)
32
33
  };
33
34
  return /*#__PURE__*/React.createElement(input.default, _objectSpread(_objectSpread({}, props), {}, {
34
35
  className: className.stringify(classNames.passwordInput, className$1),
35
- style: {
36
- "--color-secondary-fixed-dim": theme.colors["secondary-fixed-dim"],
37
- "--color-secondary": theme.colors.secondary
38
- },
36
+ style: themeColorVars,
39
37
  ref: ref,
40
38
  type: isVisible ? "text" : "password",
39
+ inputClassName: styled.input.className,
41
40
  trailing: /*#__PURE__*/React.createElement(isVisible ? visibilityOff.default : visibility.default, _objectSpread({
42
41
  role: "button",
43
42
  onClick: toggle,
@@ -5,11 +5,11 @@ import styles from './styles.mjs';
5
5
  import React, { forwardRef, createElement } from 'react';
6
6
  import Input from '../input/input.mjs';
7
7
  import { useBoolean } from '@aiszlab/relax';
8
- import { useTheme } from '../theme/hooks.mjs';
9
8
  import { props } from '../../node_modules/.pnpm/@stylexjs_stylex@0.19.0/node_modules/@stylexjs/stylex/lib/es/stylex.mjs';
10
9
  import { CLASS_NAMES } from './context.mjs';
11
10
  import { useClassNames } from '../../hooks/use-class-names.mjs';
12
11
  import { stringify } from '@aiszlab/relax/class-name';
12
+ import { useThemeColorVars } from '../../hooks/use-theme-color-vars.mjs';
13
13
  import IconVisibilityOff from '../icon/icons/action/visibility-off.mjs';
14
14
  import IconVisibility from '../icon/icons/action/visibility.mjs';
15
15
 
@@ -21,19 +21,18 @@ var PasswordInput = /*#__PURE__*/forwardRef(function (_ref, ref) {
21
21
  _useBoolean2 = _slicedToArray(_useBoolean, 2),
22
22
  isVisible = _useBoolean2[0],
23
23
  toggle = _useBoolean2[1].toggle;
24
- var theme = useTheme();
25
24
  var classNames = useClassNames(CLASS_NAMES);
25
+ var themeColorVars = useThemeColorVars(["secondary-fixed-dim", "secondary"]);
26
26
  var styled = {
27
+ input: props(styles.input),
27
28
  visibility: props(styles.visibility)
28
29
  };
29
30
  return /*#__PURE__*/React.createElement(Input, _objectSpread(_objectSpread({}, props$1), {}, {
30
31
  className: stringify(classNames.passwordInput, className),
31
- style: {
32
- "--color-secondary-fixed-dim": theme.colors["secondary-fixed-dim"],
33
- "--color-secondary": theme.colors.secondary
34
- },
32
+ style: themeColorVars,
35
33
  ref: ref,
36
34
  type: isVisible ? "text" : "password",
35
+ inputClassName: styled.input.className,
37
36
  trailing: /*#__PURE__*/createElement(isVisible ? IconVisibilityOff : IconVisibility, _objectSpread({
38
37
  role: "button",
39
38
  onClick: toggle,
@@ -3,6 +3,10 @@
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  var styles = {
6
+ input: {
7
+ k3Osrj: "musaex-10emqs4",
8
+ $$css: true
9
+ },
6
10
  visibility: {
7
11
  kMwMTN: "musaex-kmi68j",
8
12
  k6sLGO: "musaex-xnarah",
@@ -1,4 +1,9 @@
1
1
  declare const styles: Readonly<{
2
+ readonly input: Readonly<{
3
+ readonly "::-ms-reveal": import("@stylexjs/stylex").StyleXClassNameFor<"::-ms-reveal", {
4
+ readonly display: "none";
5
+ }>;
6
+ }>;
2
7
  readonly visibility: Readonly<{
3
8
  readonly color: import("@stylexjs/stylex").StyleXClassNameFor<"color", "var(--color-secondary-fixed-dim)">;
4
9
  readonly willChange: import("@stylexjs/stylex").StyleXClassNameFor<"willChange", "color">;
@@ -1,4 +1,8 @@
1
1
  var styles = {
2
+ input: {
3
+ k3Osrj: "musaex-10emqs4",
4
+ $$css: true
5
+ },
2
6
  visibility: {
3
7
  kMwMTN: "musaex-kmi68j",
4
8
  k6sLGO: "musaex-xnarah",
package/dist/styles.css CHANGED
@@ -2889,6 +2889,10 @@
2889
2889
  display: block;
2890
2890
  }
2891
2891
 
2892
+ .musaex-10emqs4::-ms-reveal {
2893
+ display: none;
2894
+ }
2895
+
2892
2896
  .musaex-15ozc13:before {
2893
2897
  display: none;
2894
2898
  }
@@ -33,6 +33,11 @@ export interface InputProps extends Pick<InputHTMLAttributes<HTMLInputElement>,
33
33
  * @default false
34
34
  */
35
35
  shaped?: boolean;
36
+ /**
37
+ * @zh 输入元素的附加类名
38
+ * @en Additional class name for the input element
39
+ */
40
+ inputClassName?: string;
36
41
  /**
37
42
  * @zh 前置节点
38
43
  * @en Leading node
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "musae",
3
- "version": "1.3.1-beta.13",
3
+ "version": "1.3.1-beta.14",
4
4
  "description": "musae-ui",
5
5
  "author": "tutu@fantufantu.com",
6
6
  "license": "MIT",