musae 1.3.1-beta.5 → 1.3.1-beta.7
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/cascader/cascader.cjs +0 -1
- package/dist/components/cascader/cascader.mjs +0 -1
- package/dist/components/date-picker/date-picker.cjs +0 -1
- package/dist/components/date-picker/date-picker.mjs +0 -1
- package/dist/components/date-range-picker/date-range-picker.cjs +0 -1
- package/dist/components/date-range-picker/date-range-picker.mjs +0 -1
- package/dist/components/input/__test__/input-appearance.test.d.ts +1 -0
- package/dist/components/input/__test__/style-contract.test.d.ts +1 -0
- package/dist/components/input/hooks.cjs +0 -22
- package/dist/components/input/hooks.d.ts +1 -12
- package/dist/components/input/hooks.mjs +1 -22
- package/dist/components/input/input.cjs +15 -18
- package/dist/components/input/input.mjs +16 -19
- package/dist/components/input/styles.stylex.cjs +33 -7
- package/dist/components/input/styles.stylex.d.ts +37 -8
- package/dist/components/input/styles.stylex.mjs +33 -7
- package/dist/components/password-input/__test__/password-input.test.d.ts +1 -0
- package/dist/components/password-input/password-input.cjs +1 -0
- package/dist/components/password-input/password-input.mjs +1 -0
- package/dist/components/portal/__test__/portal.test.d.ts +1 -0
- package/dist/components/search/__test__/hooks.test.d.ts +1 -0
- package/dist/components/search/__test__/style-contract.test.d.ts +1 -0
- package/dist/components/search/bar.cjs +87 -0
- package/dist/components/search/bar.d.ts +19 -0
- package/dist/components/search/bar.mjs +83 -0
- package/dist/components/search/context.cjs +15 -0
- package/dist/components/search/context.d.ts +15 -0
- package/dist/components/search/context.mjs +15 -0
- package/dist/components/search/hooks.cjs +50 -0
- package/dist/components/search/hooks.d.ts +12 -0
- package/dist/components/search/hooks.mjs +47 -0
- package/dist/components/search/index.d.ts +1 -1
- package/dist/components/search/result-list.cjs +86 -0
- package/dist/components/search/result-list.d.ts +16 -0
- package/dist/components/search/result-list.mjs +82 -0
- package/dist/components/search/search.cjs +164 -44
- package/dist/components/search/search.d.ts +11 -1
- package/dist/components/search/search.mjs +166 -46
- package/dist/components/search/styles.cjs +160 -42
- package/dist/components/search/styles.d.ts +136 -41
- package/dist/components/search/styles.mjs +160 -42
- package/dist/components/search/view.cjs +109 -0
- package/dist/components/search/view.d.ts +23 -0
- package/dist/components/search/view.mjs +105 -0
- package/dist/components/select/selector.cjs +0 -1
- package/dist/components/select/selector.d.ts +1 -1
- package/dist/components/select/selector.mjs +0 -1
- package/dist/components/theme/tokens.stylex.cjs +8 -0
- package/dist/components/theme/tokens.stylex.d.ts +14 -0
- package/dist/components/theme/tokens.stylex.mjs +8 -1
- package/dist/components/time-picker/time-picker.cjs +0 -1
- package/dist/components/time-picker/time-picker.mjs +0 -1
- package/dist/index.d.ts +1 -0
- package/dist/styles.css +76 -60
- package/dist/types/input.d.ts +31 -28
- package/dist/types/search.d.ts +84 -1
- package/dist/types/select.d.ts +2 -2
- package/dist/utils/react.cjs +2 -2
- package/dist/utils/react.d.ts +2 -2
- package/dist/utils/react.mjs +2 -2
- package/package.json +1 -1
|
@@ -53,7 +53,6 @@ var DatePicker = function DatePicker(props) {
|
|
|
53
53
|
value: (_value$format = value === null || value === void 0 ? void 0 : value.format("YYYY-MM-DD")) !== null && _value$format !== void 0 ? _value$format : "",
|
|
54
54
|
onBlur: close,
|
|
55
55
|
onClick: toggle,
|
|
56
|
-
onInputorClick: toggle,
|
|
57
56
|
readOnly: true
|
|
58
57
|
});
|
|
59
58
|
});
|
|
@@ -49,7 +49,6 @@ var DatePicker = function DatePicker(props$1) {
|
|
|
49
49
|
value: (_value$format = value === null || value === void 0 ? void 0 : value.format("YYYY-MM-DD")) !== null && _value$format !== void 0 ? _value$format : "",
|
|
50
50
|
onBlur: close,
|
|
51
51
|
onClick: toggle,
|
|
52
|
-
onInputorClick: toggle,
|
|
53
52
|
readOnly: true
|
|
54
53
|
});
|
|
55
54
|
});
|
|
@@ -59,7 +59,6 @@ var DateRangePicker = function DateRangePicker(_ref) {
|
|
|
59
59
|
value: (_from$format = from === null || from === void 0 ? void 0 : from.format("YYYY-MM-DD")) !== null && _from$format !== void 0 ? _from$format : "",
|
|
60
60
|
onBlur: close,
|
|
61
61
|
onClick: toggle,
|
|
62
|
-
onInputorClick: toggle,
|
|
63
62
|
readOnly: true,
|
|
64
63
|
trailing: /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(swapHoriz.default, {
|
|
65
64
|
className: classNames.separator
|
|
@@ -55,7 +55,6 @@ var DateRangePicker = function DateRangePicker(_ref) {
|
|
|
55
55
|
value: (_from$format = from === null || from === void 0 ? void 0 : from.format("YYYY-MM-DD")) !== null && _from$format !== void 0 ? _from$format : "",
|
|
56
56
|
onBlur: close,
|
|
57
57
|
onClick: toggle,
|
|
58
|
-
onInputorClick: toggle,
|
|
59
58
|
readOnly: true,
|
|
60
59
|
trailing: /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(IconSwapHoriz, {
|
|
61
60
|
className: classNames.separator
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import "@testing-library/jest-dom";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
var React = require('react');
|
|
4
|
-
var relax = require('@aiszlab/relax');
|
|
5
4
|
|
|
6
5
|
/**
|
|
7
6
|
* @description
|
|
@@ -38,26 +37,5 @@ var useInputEvents = function useInputEvents(_ref) {
|
|
|
38
37
|
click: click
|
|
39
38
|
};
|
|
40
39
|
};
|
|
41
|
-
/**
|
|
42
|
-
* @description
|
|
43
|
-
* inputor events
|
|
44
|
-
*/
|
|
45
|
-
var useInputorEvents = function useInputorEvents(_ref2) {
|
|
46
|
-
var inputRef = _ref2.inputRef,
|
|
47
|
-
onClick = _ref2.onClick;
|
|
48
|
-
// click
|
|
49
|
-
var click = React.useCallback(function (event) {
|
|
50
|
-
var _inputRef$current;
|
|
51
|
-
(_inputRef$current = inputRef.current) === null || _inputRef$current === void 0 || _inputRef$current.focus();
|
|
52
|
-
if (relax.isFunction(onClick)) {
|
|
53
|
-
event.stopPropagation();
|
|
54
|
-
onClick(event);
|
|
55
|
-
}
|
|
56
|
-
}, [inputRef, onClick]);
|
|
57
|
-
return {
|
|
58
|
-
click: click
|
|
59
|
-
};
|
|
60
|
-
};
|
|
61
40
|
|
|
62
41
|
exports.useInputEvents = useInputEvents;
|
|
63
|
-
exports.useInputorEvents = useInputorEvents;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import { type ChangeEventHandler, type Dispatch, type FocusEventHandler, type MouseEventHandler, type SetStateAction
|
|
1
|
+
import { type ChangeEventHandler, type Dispatch, type FocusEventHandler, type MouseEventHandler, type SetStateAction } from "react";
|
|
2
2
|
import type { InputProps } from "../../types/input";
|
|
3
|
-
import type { Nullable } from "@aiszlab/relax/types";
|
|
4
3
|
/**
|
|
5
4
|
* @description
|
|
6
5
|
* use events for input
|
|
@@ -13,13 +12,3 @@ export declare const useInputEvents: ({ setValue, onBlur, onChange, onClick, onF
|
|
|
13
12
|
change: ChangeEventHandler<HTMLInputElement>;
|
|
14
13
|
click: MouseEventHandler<HTMLInputElement>;
|
|
15
14
|
};
|
|
16
|
-
/**
|
|
17
|
-
* @description
|
|
18
|
-
* inputor events
|
|
19
|
-
*/
|
|
20
|
-
export declare const useInputorEvents: ({ inputRef, onClick, }: {
|
|
21
|
-
inputRef: RefObject<Nullable<HTMLInputElement>>;
|
|
22
|
-
onClick?: InputProps["onInputorClick"];
|
|
23
|
-
}) => {
|
|
24
|
-
click: MouseEventHandler<HTMLDivElement>;
|
|
25
|
-
};
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { useCallback } from 'react';
|
|
2
|
-
import { isFunction } from '@aiszlab/relax';
|
|
3
2
|
|
|
4
3
|
/**
|
|
5
4
|
* @description
|
|
@@ -36,25 +35,5 @@ var useInputEvents = function useInputEvents(_ref) {
|
|
|
36
35
|
click: click
|
|
37
36
|
};
|
|
38
37
|
};
|
|
39
|
-
/**
|
|
40
|
-
* @description
|
|
41
|
-
* inputor events
|
|
42
|
-
*/
|
|
43
|
-
var useInputorEvents = function useInputorEvents(_ref2) {
|
|
44
|
-
var inputRef = _ref2.inputRef,
|
|
45
|
-
onClick = _ref2.onClick;
|
|
46
|
-
// click
|
|
47
|
-
var click = useCallback(function (event) {
|
|
48
|
-
var _inputRef$current;
|
|
49
|
-
(_inputRef$current = inputRef.current) === null || _inputRef$current === void 0 || _inputRef$current.focus();
|
|
50
|
-
if (isFunction(onClick)) {
|
|
51
|
-
event.stopPropagation();
|
|
52
|
-
onClick(event);
|
|
53
|
-
}
|
|
54
|
-
}, [inputRef, onClick]);
|
|
55
|
-
return {
|
|
56
|
-
click: click
|
|
57
|
-
};
|
|
58
|
-
};
|
|
59
38
|
|
|
60
|
-
export { useInputEvents
|
|
39
|
+
export { useInputEvents };
|
|
@@ -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", "invalid", "disabled", "maxLength", "value", "onBlur", "onChange", "onClick", "onFocus", "leading", "trailing", "
|
|
21
|
+
var _excluded = ["className", "style", "type", "variant", "shaped", "invalid", "disabled", "maxLength", "value", "onBlur", "onChange", "onClick", "onFocus", "leading", "trailing", "label"];
|
|
22
22
|
/**
|
|
23
23
|
* @author murukal
|
|
24
24
|
* @zh 输入组件
|
|
@@ -27,7 +27,10 @@ var _excluded = ["className", "style", "type", "invalid", "disabled", "maxLength
|
|
|
27
27
|
var Input = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
28
28
|
var className$1 = _ref.className,
|
|
29
29
|
style = _ref.style,
|
|
30
|
-
type = _ref.type
|
|
30
|
+
type = _ref.type;
|
|
31
|
+
_ref.variant;
|
|
32
|
+
var _ref$shaped = _ref.shaped,
|
|
33
|
+
shaped = _ref$shaped === void 0 ? false : _ref$shaped,
|
|
31
34
|
_ref$invalid = _ref.invalid,
|
|
32
35
|
invalid = _ref$invalid === void 0 ? false : _ref$invalid,
|
|
33
36
|
disabled = _ref.disabled,
|
|
@@ -39,17 +42,17 @@ var Input = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
|
39
42
|
onFocus = _ref.onFocus,
|
|
40
43
|
leading = _ref.leading,
|
|
41
44
|
trailing = _ref.trailing,
|
|
42
|
-
onInputorClick = _ref.onInputorClick,
|
|
43
45
|
label = _ref.label,
|
|
44
46
|
inputProps = _objectWithoutProperties(_ref, _excluded);
|
|
45
47
|
var inputorRef = React.useRef(null);
|
|
46
48
|
var inputRef = React.useRef(null);
|
|
47
49
|
var classNames = useClassNames.useClassNames(context.CLASS_NAMES);
|
|
48
50
|
var hasPlaceholder = !!inputProps.placeholder;
|
|
51
|
+
var hasLabel = !!label;
|
|
49
52
|
var _useIdentity = relax.useIdentity(),
|
|
50
53
|
_useIdentity2 = _slicedToArray(_useIdentity, 1),
|
|
51
54
|
id = _useIdentity2[0];
|
|
52
|
-
var _themeColorVars = useThemeColorVars.useThemeColorVars(["primary", "outline", "error", "on-surface-variant", ["on-surface", tokens_stylex.OPACITY.thickest], ["on-surface", tokens_stylex.OPACITY.medium], ["on-surface", tokens_stylex.OPACITY.thin]]);
|
|
55
|
+
var _themeColorVars = useThemeColorVars.useThemeColorVars(["primary", "outline", "error", "surface-container-high", "on-surface-variant", ["on-surface", tokens_stylex.OPACITY.thickest], ["on-surface", tokens_stylex.OPACITY.medium], ["on-surface", tokens_stylex.OPACITY.thin]]);
|
|
53
56
|
// controlled value
|
|
54
57
|
var _useControlledState = relax.useControlledState(valueInProps, {
|
|
55
58
|
defaultState: ""
|
|
@@ -90,11 +93,6 @@ var Input = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
|
90
93
|
onClick: onClick,
|
|
91
94
|
onFocus: onFocus
|
|
92
95
|
});
|
|
93
|
-
// inputor events
|
|
94
|
-
var inputorEvents = hooks.useInputorEvents({
|
|
95
|
-
inputRef: inputRef,
|
|
96
|
-
onClick: disabled ? undefined : onInputorClick
|
|
97
|
-
});
|
|
98
96
|
// is focused
|
|
99
97
|
var _useFocus = relax.useFocus({
|
|
100
98
|
onBlur: inputEvents.blur,
|
|
@@ -104,21 +102,20 @@ var Input = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
|
104
102
|
isFocused = _useFocus2[0],
|
|
105
103
|
focusProps = _useFocus2[1];
|
|
106
104
|
var styled = {
|
|
107
|
-
root: stylex.props(theme.$body.medium, styles_stylex.default.root.base,
|
|
105
|
+
root: stylex.props(theme.$body.medium, styles_stylex.default.root.base, disabled && styles_stylex.default.root.disabled, !disabled && styles_stylex.textFieldMarker),
|
|
108
106
|
input: stylex.props(styles_stylex.default.input.base, !!leading && styles_stylex.default.input.hasLeading, !!trailing && styles_stylex.default.input.hasTrailing, disabled && styles_stylex.default.input.disabled),
|
|
109
107
|
leading: stylex.props(styles_stylex.default.leading.base),
|
|
110
108
|
trailing: stylex.props(styles_stylex.default.trailing.base),
|
|
111
109
|
outline: stylex.props(styles_stylex.default.outline.base),
|
|
112
|
-
outlineLeading: stylex.props(styles_stylex.default.outlineLeading.base, disabled && styles_stylex.default.outlineLeading.disabled),
|
|
113
|
-
outlineNotch: stylex.props(styles_stylex.default.outlineNotch.base, theme.$body.small,
|
|
114
|
-
outlineTrailing: stylex.props(styles_stylex.default.outlineTrailing.base, disabled && styles_stylex.default.outlineTrailing.disabled),
|
|
115
|
-
floatingLabel: stylex.props(styles_stylex.default.floatingLabel.base, hasPlaceholder && styles_stylex.default.floatingLabel.placeholder, disabled && styles_stylex.default.floatingLabel.disabled)
|
|
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),
|
|
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)
|
|
116
114
|
};
|
|
117
115
|
return /*#__PURE__*/React.createElement("div", _objectSpread({
|
|
118
116
|
ref: inputorRef,
|
|
119
117
|
className: className.stringify(classNames.inputor, _defineProperty(_defineProperty({}, classNames.focused, isFocused), classNames.invalid, !!invalid), className$1, styled.root.className),
|
|
120
|
-
style: _objectSpread(_objectSpread(_objectSpread({}, styled.root.style), style), _themeColorVars)
|
|
121
|
-
onClick: inputorEvents.click
|
|
118
|
+
style: _objectSpread(_objectSpread(_objectSpread({}, styled.root.style), style), _themeColorVars)
|
|
122
119
|
}, !disabled && {
|
|
123
120
|
tabIndex: -1
|
|
124
121
|
}), !!leading && (/*#__PURE__*/React.createElement("div", {
|
|
@@ -145,10 +142,10 @@ var Input = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
|
145
142
|
}), /*#__PURE__*/React.createElement("div", {
|
|
146
143
|
className: className.stringify(classNames.outlineNotch, styled.outlineNotch.className),
|
|
147
144
|
style: styled.outlineNotch.style
|
|
148
|
-
}, /*#__PURE__*/React.createElement("label", {
|
|
145
|
+
}, hasLabel && (/*#__PURE__*/React.createElement("label", {
|
|
149
146
|
htmlFor: id,
|
|
150
147
|
className: className.stringify(styled.floatingLabel.className)
|
|
151
|
-
}, label)), /*#__PURE__*/React.createElement("div", {
|
|
148
|
+
}, label))), /*#__PURE__*/React.createElement("div", {
|
|
152
149
|
className: className.stringify(classNames.outlineTrailing, styled.outlineTrailing.className),
|
|
153
150
|
style: styled.outlineTrailing.style
|
|
154
151
|
})), !!trailing && (/*#__PURE__*/React.createElement("div", {
|
|
@@ -4,7 +4,7 @@ import _slicedToArray from '@babel/runtime/helpers/slicedToArray';
|
|
|
4
4
|
import _objectWithoutProperties from '@babel/runtime/helpers/objectWithoutProperties';
|
|
5
5
|
import styles, { textFieldMarker } from './styles.stylex.mjs';
|
|
6
6
|
import React, { forwardRef, useRef, useImperativeHandle } from 'react';
|
|
7
|
-
import { useInputEvents
|
|
7
|
+
import { useInputEvents } from './hooks.mjs';
|
|
8
8
|
import { useIdentity, useControlledState, useFocus } from '@aiszlab/relax';
|
|
9
9
|
import { props } from '../../node_modules/.pnpm/@stylexjs_stylex@0.19.0/node_modules/@stylexjs/stylex/lib/es/stylex.mjs';
|
|
10
10
|
import { OPACITY } from '../theme/tokens.stylex.mjs';
|
|
@@ -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", "invalid", "disabled", "maxLength", "value", "onBlur", "onChange", "onClick", "onFocus", "leading", "trailing", "
|
|
17
|
+
var _excluded = ["className", "style", "type", "variant", "shaped", "invalid", "disabled", "maxLength", "value", "onBlur", "onChange", "onClick", "onFocus", "leading", "trailing", "label"];
|
|
18
18
|
/**
|
|
19
19
|
* @author murukal
|
|
20
20
|
* @zh 输入组件
|
|
@@ -23,7 +23,10 @@ var _excluded = ["className", "style", "type", "invalid", "disabled", "maxLength
|
|
|
23
23
|
var Input = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
24
24
|
var className = _ref.className,
|
|
25
25
|
style = _ref.style,
|
|
26
|
-
type = _ref.type
|
|
26
|
+
type = _ref.type;
|
|
27
|
+
_ref.variant;
|
|
28
|
+
var _ref$shaped = _ref.shaped,
|
|
29
|
+
shaped = _ref$shaped === void 0 ? false : _ref$shaped,
|
|
27
30
|
_ref$invalid = _ref.invalid,
|
|
28
31
|
invalid = _ref$invalid === void 0 ? false : _ref$invalid,
|
|
29
32
|
disabled = _ref.disabled,
|
|
@@ -35,17 +38,17 @@ var Input = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
35
38
|
onFocus = _ref.onFocus,
|
|
36
39
|
leading = _ref.leading,
|
|
37
40
|
trailing = _ref.trailing,
|
|
38
|
-
onInputorClick = _ref.onInputorClick,
|
|
39
41
|
label = _ref.label,
|
|
40
42
|
inputProps = _objectWithoutProperties(_ref, _excluded);
|
|
41
43
|
var inputorRef = useRef(null);
|
|
42
44
|
var inputRef = useRef(null);
|
|
43
45
|
var classNames = useClassNames(CLASS_NAMES);
|
|
44
46
|
var hasPlaceholder = !!inputProps.placeholder;
|
|
47
|
+
var hasLabel = !!label;
|
|
45
48
|
var _useIdentity = useIdentity(),
|
|
46
49
|
_useIdentity2 = _slicedToArray(_useIdentity, 1),
|
|
47
50
|
id = _useIdentity2[0];
|
|
48
|
-
var _themeColorVars = useThemeColorVars(["primary", "outline", "error", "on-surface-variant", ["on-surface", OPACITY.thickest], ["on-surface", OPACITY.medium], ["on-surface", OPACITY.thin]]);
|
|
51
|
+
var _themeColorVars = useThemeColorVars(["primary", "outline", "error", "surface-container-high", "on-surface-variant", ["on-surface", OPACITY.thickest], ["on-surface", OPACITY.medium], ["on-surface", OPACITY.thin]]);
|
|
49
52
|
// controlled value
|
|
50
53
|
var _useControlledState = useControlledState(valueInProps, {
|
|
51
54
|
defaultState: ""
|
|
@@ -86,11 +89,6 @@ var Input = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
86
89
|
onClick: onClick,
|
|
87
90
|
onFocus: onFocus
|
|
88
91
|
});
|
|
89
|
-
// inputor events
|
|
90
|
-
var inputorEvents = useInputorEvents({
|
|
91
|
-
inputRef: inputRef,
|
|
92
|
-
onClick: disabled ? undefined : onInputorClick
|
|
93
|
-
});
|
|
94
92
|
// is focused
|
|
95
93
|
var _useFocus = useFocus({
|
|
96
94
|
onBlur: inputEvents.blur,
|
|
@@ -100,21 +98,20 @@ var Input = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
100
98
|
isFocused = _useFocus2[0],
|
|
101
99
|
focusProps = _useFocus2[1];
|
|
102
100
|
var styled = {
|
|
103
|
-
root: props($body.medium, styles.root.base,
|
|
101
|
+
root: props($body.medium, styles.root.base, disabled && styles.root.disabled, !disabled && textFieldMarker),
|
|
104
102
|
input: props(styles.input.base, !!leading && styles.input.hasLeading, !!trailing && styles.input.hasTrailing, disabled && styles.input.disabled),
|
|
105
103
|
leading: props(styles.leading.base),
|
|
106
104
|
trailing: props(styles.trailing.base),
|
|
107
105
|
outline: props(styles.outline.base),
|
|
108
|
-
outlineLeading: props(styles.outlineLeading.base, disabled && styles.outlineLeading.disabled),
|
|
109
|
-
outlineNotch: props(styles.outlineNotch.base, $body.small,
|
|
110
|
-
outlineTrailing: props(styles.outlineTrailing.base, disabled && styles.outlineTrailing.disabled),
|
|
111
|
-
floatingLabel: props(styles.floatingLabel.base, hasPlaceholder && styles.floatingLabel.placeholder, disabled && styles.floatingLabel.disabled)
|
|
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),
|
|
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)
|
|
112
110
|
};
|
|
113
111
|
return /*#__PURE__*/React.createElement("div", _objectSpread({
|
|
114
112
|
ref: inputorRef,
|
|
115
113
|
className: stringify(classNames.inputor, _defineProperty(_defineProperty({}, classNames.focused, isFocused), classNames.invalid, !!invalid), className, styled.root.className),
|
|
116
|
-
style: _objectSpread(_objectSpread(_objectSpread({}, styled.root.style), style), _themeColorVars)
|
|
117
|
-
onClick: inputorEvents.click
|
|
114
|
+
style: _objectSpread(_objectSpread(_objectSpread({}, styled.root.style), style), _themeColorVars)
|
|
118
115
|
}, !disabled && {
|
|
119
116
|
tabIndex: -1
|
|
120
117
|
}), !!leading && (/*#__PURE__*/React.createElement("div", {
|
|
@@ -141,10 +138,10 @@ var Input = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
141
138
|
}), /*#__PURE__*/React.createElement("div", {
|
|
142
139
|
className: stringify(classNames.outlineNotch, styled.outlineNotch.className),
|
|
143
140
|
style: styled.outlineNotch.style
|
|
144
|
-
}, /*#__PURE__*/React.createElement("label", {
|
|
141
|
+
}, hasLabel && (/*#__PURE__*/React.createElement("label", {
|
|
145
142
|
htmlFor: id,
|
|
146
143
|
className: stringify(styled.floatingLabel.className)
|
|
147
|
-
}, label)), /*#__PURE__*/React.createElement("div", {
|
|
144
|
+
}, label))), /*#__PURE__*/React.createElement("div", {
|
|
148
145
|
className: stringify(classNames.outlineTrailing, styled.outlineTrailing.className),
|
|
149
146
|
style: styled.outlineTrailing.style
|
|
150
147
|
})), !!trailing && (/*#__PURE__*/React.createElement("div", {
|
|
@@ -24,11 +24,6 @@ var root = {
|
|
|
24
24
|
kg3NbH: "musaex-2961ne",
|
|
25
25
|
$$css: true
|
|
26
26
|
},
|
|
27
|
-
invalid: {
|
|
28
|
-
kGVxlE: "musaex-4ms1xy",
|
|
29
|
-
knuKkz: null,
|
|
30
|
-
$$css: true
|
|
31
|
-
},
|
|
32
27
|
disabled: {
|
|
33
28
|
kMwMTN: "musaex-1ldep6k",
|
|
34
29
|
$$css: true
|
|
@@ -46,6 +41,7 @@ var input = {
|
|
|
46
41
|
k7Eaqz: "musaex-1rdiejn",
|
|
47
42
|
kZKoxP: "musaex-kyvkcq",
|
|
48
43
|
kUk6DE: "musaex-98rzlu",
|
|
44
|
+
k8Qsv1: "musaex-19r3k9r",
|
|
49
45
|
$$css: true
|
|
50
46
|
},
|
|
51
47
|
hasLeading: {
|
|
@@ -112,6 +108,16 @@ var outlineLeading = {
|
|
|
112
108
|
disabled: {
|
|
113
109
|
kVAM5u: "musaex-utl9qk",
|
|
114
110
|
$$css: true
|
|
111
|
+
},
|
|
112
|
+
invalid: {
|
|
113
|
+
kVAM5u: "musaex-1ofxpqo",
|
|
114
|
+
k6qhrQ: "musaex-7rzjjb",
|
|
115
|
+
$$css: true
|
|
116
|
+
},
|
|
117
|
+
shaped: {
|
|
118
|
+
krdFHd: "musaex-16hqlox",
|
|
119
|
+
kVL7Gh: "musaex-e8lclw",
|
|
120
|
+
$$css: true
|
|
115
121
|
}
|
|
116
122
|
};
|
|
117
123
|
var outlineTrailing = {
|
|
@@ -136,6 +142,16 @@ var outlineTrailing = {
|
|
|
136
142
|
disabled: {
|
|
137
143
|
kVAM5u: "musaex-utl9qk",
|
|
138
144
|
$$css: true
|
|
145
|
+
},
|
|
146
|
+
invalid: {
|
|
147
|
+
kVAM5u: "musaex-1ofxpqo",
|
|
148
|
+
k6qhrQ: "musaex-7rzjjb",
|
|
149
|
+
$$css: true
|
|
150
|
+
},
|
|
151
|
+
shaped: {
|
|
152
|
+
kfmiAY: "musaex-ortkii",
|
|
153
|
+
kT0f0o: "musaex-1ogpvgu",
|
|
154
|
+
$$css: true
|
|
139
155
|
}
|
|
140
156
|
};
|
|
141
157
|
var outlineNotch = {
|
|
@@ -156,18 +172,23 @@ var outlineNotch = {
|
|
|
156
172
|
k6qhrQ: "musaex-48fzr0",
|
|
157
173
|
$$css: true
|
|
158
174
|
},
|
|
159
|
-
|
|
175
|
+
withLabel: {
|
|
160
176
|
k3lJl8: "musaex-14zl4sw",
|
|
161
177
|
kRj6wj: "musaex-1bq66p9",
|
|
162
178
|
$$css: true
|
|
163
179
|
},
|
|
164
|
-
|
|
180
|
+
withLabelAndPlaceholder: {
|
|
165
181
|
kLZC3w: "musaex-1v8p93f",
|
|
166
182
|
$$css: true
|
|
167
183
|
},
|
|
168
184
|
disabled: {
|
|
169
185
|
kVAM5u: "musaex-utl9qk",
|
|
170
186
|
$$css: true
|
|
187
|
+
},
|
|
188
|
+
invalid: {
|
|
189
|
+
kVAM5u: "musaex-1ofxpqo",
|
|
190
|
+
k6qhrQ: "musaex-7rzjjb",
|
|
191
|
+
$$css: true
|
|
171
192
|
}
|
|
172
193
|
};
|
|
173
194
|
var floatingLabel = {
|
|
@@ -189,6 +210,11 @@ var floatingLabel = {
|
|
|
189
210
|
k3aq6I: "musaex-3oybdh",
|
|
190
211
|
$$css: true
|
|
191
212
|
},
|
|
213
|
+
invalid: {
|
|
214
|
+
kMwMTN: "musaex-jt36v0",
|
|
215
|
+
kan248: "musaex-19uxsja",
|
|
216
|
+
$$css: true
|
|
217
|
+
},
|
|
192
218
|
disabled: {
|
|
193
219
|
kMwMTN: "musaex-1ldep6k",
|
|
194
220
|
$$css: true
|
|
@@ -19,12 +19,6 @@ declare const styles: {
|
|
|
19
19
|
readonly paddingBlock: import("@stylexjs/stylex").StyleXClassNameFor<"paddingBlock", string>;
|
|
20
20
|
readonly paddingInline: import("@stylexjs/stylex").StyleXClassNameFor<"paddingInline", string>;
|
|
21
21
|
}>;
|
|
22
|
-
readonly invalid: Readonly<{
|
|
23
|
-
readonly boxShadow: import("@stylexjs/stylex").StyleXClassNameFor<"boxShadow", `0px 0px 0px ${import("@stylexjs/stylex").StyleXVar<string>} var(--color-error) inset`>;
|
|
24
|
-
readonly ":focus-within": import("@stylexjs/stylex").StyleXClassNameFor<":focus-within", {
|
|
25
|
-
readonly boxShadow: null;
|
|
26
|
-
}>;
|
|
27
|
-
}>;
|
|
28
22
|
readonly disabled: Readonly<{
|
|
29
23
|
readonly color: import("@stylexjs/stylex").StyleXClassNameFor<"color", "var(--color-on-surface-opacity-38)">;
|
|
30
24
|
}>;
|
|
@@ -41,6 +35,9 @@ declare const styles: {
|
|
|
41
35
|
readonly minWidth: import("@stylexjs/stylex").StyleXClassNameFor<"minWidth", string>;
|
|
42
36
|
readonly height: import("@stylexjs/stylex").StyleXClassNameFor<"height", string>;
|
|
43
37
|
readonly flex: import("@stylexjs/stylex").StyleXClassNameFor<"flex", 1>;
|
|
38
|
+
readonly "::placeholder": import("@stylexjs/stylex").StyleXClassNameFor<"::placeholder", {
|
|
39
|
+
readonly color: "var(--color-on-surface-variant)";
|
|
40
|
+
}>;
|
|
44
41
|
}>;
|
|
45
42
|
readonly hasLeading: Readonly<{
|
|
46
43
|
readonly paddingInlineStart: import("@stylexjs/stylex").StyleXClassNameFor<"paddingInlineStart", string>;
|
|
@@ -103,6 +100,16 @@ declare const styles: {
|
|
|
103
100
|
readonly disabled: Readonly<{
|
|
104
101
|
readonly borderColor: import("@stylexjs/stylex").StyleXClassNameFor<"borderColor", "var(--color-on-surface-opacity-12)">;
|
|
105
102
|
}>;
|
|
103
|
+
readonly invalid: Readonly<{
|
|
104
|
+
readonly [x: string]: import("@stylexjs/stylex").StyleXClassNameFor<string, "var(--color-error)" | {
|
|
105
|
+
readonly borderColor: "var(--color-error)";
|
|
106
|
+
}>;
|
|
107
|
+
readonly borderColor: import("@stylexjs/stylex").StyleXClassNameFor<"borderColor", "var(--color-error)">;
|
|
108
|
+
}>;
|
|
109
|
+
readonly shaped: Readonly<{
|
|
110
|
+
readonly borderStartStartRadius: import("@stylexjs/stylex").StyleXClassNameFor<"borderStartStartRadius", string>;
|
|
111
|
+
readonly borderEndStartRadius: import("@stylexjs/stylex").StyleXClassNameFor<"borderEndStartRadius", string>;
|
|
112
|
+
}>;
|
|
106
113
|
}>;
|
|
107
114
|
outlineNotch: Readonly<{
|
|
108
115
|
readonly base: Readonly<{
|
|
@@ -123,18 +130,24 @@ declare const styles: {
|
|
|
123
130
|
readonly borderInlineWidth: import("@stylexjs/stylex").StyleXClassNameFor<"borderInlineWidth", string>;
|
|
124
131
|
readonly borderBlockWidth: import("@stylexjs/stylex").StyleXClassNameFor<"borderBlockWidth", string>;
|
|
125
132
|
}>;
|
|
126
|
-
readonly
|
|
133
|
+
readonly withLabel: Readonly<{
|
|
127
134
|
readonly [x: string]: import("@stylexjs/stylex").StyleXClassNameFor<string, {
|
|
128
135
|
readonly borderBlockStartWidth: import("@stylexjs/stylex").StyleXVar<string>;
|
|
129
136
|
readonly borderBlockStartColor: "transparent";
|
|
130
137
|
}>;
|
|
131
138
|
}>;
|
|
132
|
-
readonly
|
|
139
|
+
readonly withLabelAndPlaceholder: Readonly<{
|
|
133
140
|
readonly borderBlockStartColor: import("@stylexjs/stylex").StyleXClassNameFor<"borderBlockStartColor", "transparent">;
|
|
134
141
|
}>;
|
|
135
142
|
readonly disabled: Readonly<{
|
|
136
143
|
readonly borderColor: import("@stylexjs/stylex").StyleXClassNameFor<"borderColor", "var(--color-on-surface-opacity-12)">;
|
|
137
144
|
}>;
|
|
145
|
+
readonly invalid: Readonly<{
|
|
146
|
+
readonly [x: string]: import("@stylexjs/stylex").StyleXClassNameFor<string, "var(--color-error)" | {
|
|
147
|
+
readonly borderColor: "var(--color-error)";
|
|
148
|
+
}>;
|
|
149
|
+
readonly borderColor: import("@stylexjs/stylex").StyleXClassNameFor<"borderColor", "var(--color-error)">;
|
|
150
|
+
}>;
|
|
138
151
|
}>;
|
|
139
152
|
outlineTrailing: Readonly<{
|
|
140
153
|
readonly base: Readonly<{
|
|
@@ -159,6 +172,16 @@ declare const styles: {
|
|
|
159
172
|
readonly disabled: Readonly<{
|
|
160
173
|
readonly borderColor: import("@stylexjs/stylex").StyleXClassNameFor<"borderColor", "var(--color-on-surface-opacity-12)">;
|
|
161
174
|
}>;
|
|
175
|
+
readonly invalid: Readonly<{
|
|
176
|
+
readonly [x: string]: import("@stylexjs/stylex").StyleXClassNameFor<string, "var(--color-error)" | {
|
|
177
|
+
readonly borderColor: "var(--color-error)";
|
|
178
|
+
}>;
|
|
179
|
+
readonly borderColor: import("@stylexjs/stylex").StyleXClassNameFor<"borderColor", "var(--color-error)">;
|
|
180
|
+
}>;
|
|
181
|
+
readonly shaped: Readonly<{
|
|
182
|
+
readonly borderStartEndRadius: import("@stylexjs/stylex").StyleXClassNameFor<"borderStartEndRadius", string>;
|
|
183
|
+
readonly borderEndEndRadius: import("@stylexjs/stylex").StyleXClassNameFor<"borderEndEndRadius", string>;
|
|
184
|
+
}>;
|
|
162
185
|
}>;
|
|
163
186
|
floatingLabel: Readonly<{
|
|
164
187
|
readonly base: Readonly<{
|
|
@@ -179,6 +202,12 @@ declare const styles: {
|
|
|
179
202
|
readonly top: import("@stylexjs/stylex").StyleXClassNameFor<"top", "-50%">;
|
|
180
203
|
readonly transform: import("@stylexjs/stylex").StyleXClassNameFor<"transform", "scale(1)">;
|
|
181
204
|
}>;
|
|
205
|
+
readonly invalid: Readonly<{
|
|
206
|
+
readonly [x: string]: import("@stylexjs/stylex").StyleXClassNameFor<string, "var(--color-error)" | {
|
|
207
|
+
readonly color: "var(--color-error)";
|
|
208
|
+
}>;
|
|
209
|
+
readonly color: import("@stylexjs/stylex").StyleXClassNameFor<"color", "var(--color-error)">;
|
|
210
|
+
}>;
|
|
182
211
|
readonly disabled: Readonly<{
|
|
183
212
|
readonly color: import("@stylexjs/stylex").StyleXClassNameFor<"color", "var(--color-on-surface-opacity-38)">;
|
|
184
213
|
}>;
|
|
@@ -20,11 +20,6 @@ var root = {
|
|
|
20
20
|
kg3NbH: "musaex-2961ne",
|
|
21
21
|
$$css: true
|
|
22
22
|
},
|
|
23
|
-
invalid: {
|
|
24
|
-
kGVxlE: "musaex-4ms1xy",
|
|
25
|
-
knuKkz: null,
|
|
26
|
-
$$css: true
|
|
27
|
-
},
|
|
28
23
|
disabled: {
|
|
29
24
|
kMwMTN: "musaex-1ldep6k",
|
|
30
25
|
$$css: true
|
|
@@ -42,6 +37,7 @@ var input = {
|
|
|
42
37
|
k7Eaqz: "musaex-1rdiejn",
|
|
43
38
|
kZKoxP: "musaex-kyvkcq",
|
|
44
39
|
kUk6DE: "musaex-98rzlu",
|
|
40
|
+
k8Qsv1: "musaex-19r3k9r",
|
|
45
41
|
$$css: true
|
|
46
42
|
},
|
|
47
43
|
hasLeading: {
|
|
@@ -108,6 +104,16 @@ var outlineLeading = {
|
|
|
108
104
|
disabled: {
|
|
109
105
|
kVAM5u: "musaex-utl9qk",
|
|
110
106
|
$$css: true
|
|
107
|
+
},
|
|
108
|
+
invalid: {
|
|
109
|
+
kVAM5u: "musaex-1ofxpqo",
|
|
110
|
+
k6qhrQ: "musaex-7rzjjb",
|
|
111
|
+
$$css: true
|
|
112
|
+
},
|
|
113
|
+
shaped: {
|
|
114
|
+
krdFHd: "musaex-16hqlox",
|
|
115
|
+
kVL7Gh: "musaex-e8lclw",
|
|
116
|
+
$$css: true
|
|
111
117
|
}
|
|
112
118
|
};
|
|
113
119
|
var outlineTrailing = {
|
|
@@ -132,6 +138,16 @@ var outlineTrailing = {
|
|
|
132
138
|
disabled: {
|
|
133
139
|
kVAM5u: "musaex-utl9qk",
|
|
134
140
|
$$css: true
|
|
141
|
+
},
|
|
142
|
+
invalid: {
|
|
143
|
+
kVAM5u: "musaex-1ofxpqo",
|
|
144
|
+
k6qhrQ: "musaex-7rzjjb",
|
|
145
|
+
$$css: true
|
|
146
|
+
},
|
|
147
|
+
shaped: {
|
|
148
|
+
kfmiAY: "musaex-ortkii",
|
|
149
|
+
kT0f0o: "musaex-1ogpvgu",
|
|
150
|
+
$$css: true
|
|
135
151
|
}
|
|
136
152
|
};
|
|
137
153
|
var outlineNotch = {
|
|
@@ -152,18 +168,23 @@ var outlineNotch = {
|
|
|
152
168
|
k6qhrQ: "musaex-48fzr0",
|
|
153
169
|
$$css: true
|
|
154
170
|
},
|
|
155
|
-
|
|
171
|
+
withLabel: {
|
|
156
172
|
k3lJl8: "musaex-14zl4sw",
|
|
157
173
|
kRj6wj: "musaex-1bq66p9",
|
|
158
174
|
$$css: true
|
|
159
175
|
},
|
|
160
|
-
|
|
176
|
+
withLabelAndPlaceholder: {
|
|
161
177
|
kLZC3w: "musaex-1v8p93f",
|
|
162
178
|
$$css: true
|
|
163
179
|
},
|
|
164
180
|
disabled: {
|
|
165
181
|
kVAM5u: "musaex-utl9qk",
|
|
166
182
|
$$css: true
|
|
183
|
+
},
|
|
184
|
+
invalid: {
|
|
185
|
+
kVAM5u: "musaex-1ofxpqo",
|
|
186
|
+
k6qhrQ: "musaex-7rzjjb",
|
|
187
|
+
$$css: true
|
|
167
188
|
}
|
|
168
189
|
};
|
|
169
190
|
var floatingLabel = {
|
|
@@ -185,6 +206,11 @@ var floatingLabel = {
|
|
|
185
206
|
k3aq6I: "musaex-3oybdh",
|
|
186
207
|
$$css: true
|
|
187
208
|
},
|
|
209
|
+
invalid: {
|
|
210
|
+
kMwMTN: "musaex-jt36v0",
|
|
211
|
+
kan248: "musaex-19uxsja",
|
|
212
|
+
$$css: true
|
|
213
|
+
},
|
|
188
214
|
disabled: {
|
|
189
215
|
kMwMTN: "musaex-1ldep6k",
|
|
190
216
|
$$css: true
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import "@testing-library/jest-dom";
|
|
@@ -39,6 +39,7 @@ var PasswordInput = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
|
39
39
|
ref: ref,
|
|
40
40
|
type: isVisible ? "text" : "password",
|
|
41
41
|
trailing: /*#__PURE__*/React.createElement(isVisible ? visibilityOff.default : visibility.default, _objectSpread({
|
|
42
|
+
role: "button",
|
|
42
43
|
onClick: toggle,
|
|
43
44
|
onMouseDown: function onMouseDown(event) {
|
|
44
45
|
return event.preventDefault();
|
|
@@ -35,6 +35,7 @@ var PasswordInput = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
35
35
|
ref: ref,
|
|
36
36
|
type: isVisible ? "text" : "password",
|
|
37
37
|
trailing: /*#__PURE__*/createElement(isVisible ? IconVisibilityOff : IconVisibility, _objectSpread({
|
|
38
|
+
role: "button",
|
|
38
39
|
onClick: toggle,
|
|
39
40
|
onMouseDown: function onMouseDown(event) {
|
|
40
41
|
return event.preventDefault();
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import "@testing-library/jest-dom";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|