musae 1.3.1-beta.7 → 1.3.1-beta.9
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/bottom-sheet/bottom-sheet.cjs +14 -8
- package/dist/components/bottom-sheet/bottom-sheet.d.ts +1 -1
- package/dist/components/bottom-sheet/bottom-sheet.mjs +14 -8
- package/dist/components/search/bar.cjs +3 -8
- package/dist/components/search/bar.d.ts +1 -2
- package/dist/components/search/bar.mjs +3 -8
- package/dist/components/search/context.cjs +1 -0
- package/dist/components/search/context.d.ts +1 -0
- package/dist/components/search/context.mjs +1 -0
- package/dist/components/search/field.cjs +64 -0
- package/dist/components/search/field.d.ts +19 -0
- package/dist/components/search/field.mjs +60 -0
- package/dist/components/search/result-list.cjs +2 -4
- package/dist/components/search/result-list.mjs +2 -4
- package/dist/components/search/styles.cjs +62 -2
- package/dist/components/search/styles.d.ts +59 -10
- package/dist/components/search/styles.mjs +62 -2
- package/dist/components/search/view.cjs +3 -4
- package/dist/components/search/view.d.ts +1 -2
- package/dist/components/search/view.mjs +3 -4
- package/dist/components/sheet/sheet.cjs +3 -2
- package/dist/components/sheet/sheet.d.ts +1 -1
- package/dist/components/sheet/sheet.mjs +3 -2
- package/dist/components/sheet/styles.cjs +0 -9
- package/dist/components/sheet/styles.d.ts +0 -10
- package/dist/components/sheet/styles.mjs +0 -9
- package/dist/styles.css +8 -26
- package/dist/types/bottom-sheet.d.ts +30 -16
- package/package.json +1 -1
|
@@ -3,7 +3,6 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
var _objectSpread = require('@babel/runtime/helpers/objectSpread2');
|
|
6
|
-
var _objectWithoutProperties = require('@babel/runtime/helpers/objectWithoutProperties');
|
|
7
6
|
var styles = require('./styles.cjs');
|
|
8
7
|
var React = require('react');
|
|
9
8
|
var sheet = require('../sheet/sheet.cjs');
|
|
@@ -13,7 +12,6 @@ var className = require('@aiszlab/relax/class-name');
|
|
|
13
12
|
var useThemeColorVars = require('../../hooks/use-theme-color-vars.cjs');
|
|
14
13
|
var context = require('./context.cjs');
|
|
15
14
|
|
|
16
|
-
var _excluded = ["open", "height", "closable", "modal"];
|
|
17
15
|
/**
|
|
18
16
|
* @zh BottomSheet 组件。从底部滑入的模态面板,带有拖拽手柄指示器。
|
|
19
17
|
* 基于共享的 Sheet 基础组件构建。
|
|
@@ -21,14 +19,20 @@ var _excluded = ["open", "height", "closable", "modal"];
|
|
|
21
19
|
* with a drag handle indicator. Built on the shared Sheet base component.
|
|
22
20
|
*/
|
|
23
21
|
var BottomSheet = function BottomSheet(_ref) {
|
|
24
|
-
var open = _ref.open,
|
|
22
|
+
var _ref$open = _ref.open,
|
|
23
|
+
open = _ref$open === void 0 ? false : _ref$open,
|
|
25
24
|
_ref$height = _ref.height,
|
|
26
25
|
height = _ref$height === void 0 ? "50vh" : _ref$height,
|
|
27
26
|
_ref$closable = _ref.closable,
|
|
28
27
|
closable = _ref$closable === void 0 ? true : _ref$closable,
|
|
29
28
|
_ref$modal = _ref.modal,
|
|
30
29
|
modal = _ref$modal === void 0 ? true : _ref$modal,
|
|
31
|
-
|
|
30
|
+
onClose = _ref.onClose,
|
|
31
|
+
className$1 = _ref.className,
|
|
32
|
+
style = _ref.style,
|
|
33
|
+
panelClassName = _ref.panelClassName,
|
|
34
|
+
panelStyle = _ref.panelStyle,
|
|
35
|
+
children = _ref.children;
|
|
32
36
|
var classNames = useClassNames.useClassNames(context.CLASS_NAMES);
|
|
33
37
|
var themeColorVars = useThemeColorVars.useThemeColorVars(["on-surface-variant"]);
|
|
34
38
|
var styled = {
|
|
@@ -49,11 +53,13 @@ var BottomSheet = function BottomSheet(_ref) {
|
|
|
49
53
|
size: height,
|
|
50
54
|
closable: closable,
|
|
51
55
|
modal: modal,
|
|
52
|
-
onClose:
|
|
53
|
-
className: classNames.sheet,
|
|
56
|
+
onClose: onClose,
|
|
57
|
+
className: className.stringify(classNames.sheet, className$1),
|
|
58
|
+
style: style,
|
|
54
59
|
header: header,
|
|
55
|
-
panelClassName: styled.panel.className
|
|
56
|
-
|
|
60
|
+
panelClassName: className.stringify(styled.panel.className, panelClassName),
|
|
61
|
+
panelStyle: _objectSpread(_objectSpread({}, styled.panel.style), panelStyle)
|
|
62
|
+
}, children);
|
|
57
63
|
};
|
|
58
64
|
|
|
59
65
|
exports.default = BottomSheet;
|
|
@@ -6,5 +6,5 @@ import type { BottomSheetProps } from "../../types/bottom-sheet";
|
|
|
6
6
|
* @en BottomSheet component. A modal panel that slides up from the bottom
|
|
7
7
|
* with a drag handle indicator. Built on the shared Sheet base component.
|
|
8
8
|
*/
|
|
9
|
-
declare const BottomSheet: ({ open, height, closable, modal,
|
|
9
|
+
declare const BottomSheet: ({ open, height, closable, modal, onClose, className, style, panelClassName, panelStyle, children, }: BottomSheetProps) => React.JSX.Element;
|
|
10
10
|
export default BottomSheet;
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import _objectSpread from '@babel/runtime/helpers/objectSpread2';
|
|
2
|
-
import _objectWithoutProperties from '@babel/runtime/helpers/objectWithoutProperties';
|
|
3
2
|
import styles from './styles.mjs';
|
|
4
3
|
import React from 'react';
|
|
5
4
|
import Sheet from '../sheet/sheet.mjs';
|
|
@@ -9,7 +8,6 @@ import { stringify } from '@aiszlab/relax/class-name';
|
|
|
9
8
|
import { useThemeColorVars } from '../../hooks/use-theme-color-vars.mjs';
|
|
10
9
|
import { CLASS_NAMES } from './context.mjs';
|
|
11
10
|
|
|
12
|
-
var _excluded = ["open", "height", "closable", "modal"];
|
|
13
11
|
/**
|
|
14
12
|
* @zh BottomSheet 组件。从底部滑入的模态面板,带有拖拽手柄指示器。
|
|
15
13
|
* 基于共享的 Sheet 基础组件构建。
|
|
@@ -17,14 +15,20 @@ var _excluded = ["open", "height", "closable", "modal"];
|
|
|
17
15
|
* with a drag handle indicator. Built on the shared Sheet base component.
|
|
18
16
|
*/
|
|
19
17
|
var BottomSheet = function BottomSheet(_ref) {
|
|
20
|
-
var open = _ref.open,
|
|
18
|
+
var _ref$open = _ref.open,
|
|
19
|
+
open = _ref$open === void 0 ? false : _ref$open,
|
|
21
20
|
_ref$height = _ref.height,
|
|
22
21
|
height = _ref$height === void 0 ? "50vh" : _ref$height,
|
|
23
22
|
_ref$closable = _ref.closable,
|
|
24
23
|
closable = _ref$closable === void 0 ? true : _ref$closable,
|
|
25
24
|
_ref$modal = _ref.modal,
|
|
26
25
|
modal = _ref$modal === void 0 ? true : _ref$modal,
|
|
27
|
-
|
|
26
|
+
onClose = _ref.onClose,
|
|
27
|
+
className = _ref.className,
|
|
28
|
+
style = _ref.style,
|
|
29
|
+
panelClassName = _ref.panelClassName,
|
|
30
|
+
panelStyle = _ref.panelStyle,
|
|
31
|
+
children = _ref.children;
|
|
28
32
|
var classNames = useClassNames(CLASS_NAMES);
|
|
29
33
|
var themeColorVars = useThemeColorVars(["on-surface-variant"]);
|
|
30
34
|
var styled = {
|
|
@@ -45,11 +49,13 @@ var BottomSheet = function BottomSheet(_ref) {
|
|
|
45
49
|
size: height,
|
|
46
50
|
closable: closable,
|
|
47
51
|
modal: modal,
|
|
48
|
-
onClose:
|
|
49
|
-
className: classNames.sheet,
|
|
52
|
+
onClose: onClose,
|
|
53
|
+
className: stringify(classNames.sheet, className),
|
|
54
|
+
style: style,
|
|
50
55
|
header: header,
|
|
51
|
-
panelClassName: styled.panel.className
|
|
52
|
-
|
|
56
|
+
panelClassName: stringify(styled.panel.className, panelClassName),
|
|
57
|
+
panelStyle: _objectSpread(_objectSpread({}, styled.panel.style), panelStyle)
|
|
58
|
+
}, children);
|
|
53
59
|
};
|
|
54
60
|
|
|
55
61
|
export { BottomSheet as default };
|
|
@@ -4,13 +4,12 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
4
4
|
|
|
5
5
|
var button = require('../button/button.cjs');
|
|
6
6
|
var search = require('../icon/icons/action/search.cjs');
|
|
7
|
-
var input = require('../input/input.cjs');
|
|
8
|
-
var theme = require('../theme/theme.cjs');
|
|
9
7
|
var stylex = require('../../node_modules/.pnpm/@stylexjs_stylex@0.19.0/node_modules/@stylexjs/stylex/lib/es/stylex.cjs');
|
|
10
8
|
var className = require('@aiszlab/relax/class-name');
|
|
11
9
|
var React = require('react');
|
|
12
10
|
var useClassNames = require('../../hooks/use-class-names.cjs');
|
|
13
11
|
var context = require('./context.cjs');
|
|
12
|
+
var field = require('./field.cjs');
|
|
14
13
|
var styles = require('./styles.cjs');
|
|
15
14
|
var close = require('../icon/icons/navigation/close.cjs');
|
|
16
15
|
|
|
@@ -31,7 +30,6 @@ var SearchBar = function SearchBar(_ref) {
|
|
|
31
30
|
var classNames = useClassNames.useClassNames(context.CLASS_NAMES);
|
|
32
31
|
var hasValue = value.length > 0;
|
|
33
32
|
var styled = {
|
|
34
|
-
input: stylex.props(theme.$body.large),
|
|
35
33
|
leading: stylex.props(styles.default.leading.base),
|
|
36
34
|
trailing: stylex.props(styles.default.trailing.base),
|
|
37
35
|
clear: stylex.props(styles.default.clear.base),
|
|
@@ -60,11 +58,8 @@ var SearchBar = function SearchBar(_ref) {
|
|
|
60
58
|
}, searchButton));
|
|
61
59
|
var hasConsumerTrailing = !!trailing;
|
|
62
60
|
var hasTrailing = !!clearAction || hasConsumerTrailing || !!searchButtonAction;
|
|
63
|
-
return /*#__PURE__*/React.createElement(
|
|
64
|
-
|
|
65
|
-
className: className.stringify(classNames.searchInput, styled.input.className),
|
|
66
|
-
variant: "filled",
|
|
67
|
-
shaped: true,
|
|
61
|
+
return /*#__PURE__*/React.createElement(field.default, {
|
|
62
|
+
inputRef: inputRef,
|
|
68
63
|
value: value,
|
|
69
64
|
placeholder: placeholder,
|
|
70
65
|
disabled: disabled,
|
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import type { FocusEventHandler, KeyboardEventHandler, Ref } from "react";
|
|
3
|
-
import type { InputRef } from "../../types/input";
|
|
4
3
|
import type { SearchProps } from "../../types/search";
|
|
5
4
|
/**
|
|
6
5
|
* @zh 私有 Search Bar 属性
|
|
7
6
|
* @en Private Search Bar props
|
|
8
7
|
*/
|
|
9
8
|
export type SearchBarProps = Pick<SearchProps, "clearable" | "disabled" | "leading" | "placeholder" | "searchButton" | "trailing"> & {
|
|
10
|
-
inputRef: Ref<
|
|
9
|
+
inputRef: Ref<HTMLInputElement>;
|
|
11
10
|
value: string;
|
|
12
11
|
onChange: (value: string) => void;
|
|
13
12
|
onClear: () => void;
|
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
import { Button } from '../button/button.mjs';
|
|
2
2
|
import IconSearch from '../icon/icons/action/search.mjs';
|
|
3
|
-
import Input from '../input/input.mjs';
|
|
4
|
-
import { $body } from '../theme/theme.mjs';
|
|
5
3
|
import { props } from '../../node_modules/.pnpm/@stylexjs_stylex@0.19.0/node_modules/@stylexjs/stylex/lib/es/stylex.mjs';
|
|
6
4
|
import { stringify } from '@aiszlab/relax/class-name';
|
|
7
5
|
import React from 'react';
|
|
8
6
|
import { useClassNames } from '../../hooks/use-class-names.mjs';
|
|
9
7
|
import { CLASS_NAMES } from './context.mjs';
|
|
8
|
+
import SearchField from './field.mjs';
|
|
10
9
|
import styles from './styles.mjs';
|
|
11
10
|
import IconClose from '../icon/icons/navigation/close.mjs';
|
|
12
11
|
|
|
@@ -27,7 +26,6 @@ var SearchBar = function SearchBar(_ref) {
|
|
|
27
26
|
var classNames = useClassNames(CLASS_NAMES);
|
|
28
27
|
var hasValue = value.length > 0;
|
|
29
28
|
var styled = {
|
|
30
|
-
input: props($body.large),
|
|
31
29
|
leading: props(styles.leading.base),
|
|
32
30
|
trailing: props(styles.trailing.base),
|
|
33
31
|
clear: props(styles.clear.base),
|
|
@@ -56,11 +54,8 @@ var SearchBar = function SearchBar(_ref) {
|
|
|
56
54
|
}, searchButton));
|
|
57
55
|
var hasConsumerTrailing = !!trailing;
|
|
58
56
|
var hasTrailing = !!clearAction || hasConsumerTrailing || !!searchButtonAction;
|
|
59
|
-
return /*#__PURE__*/React.createElement(
|
|
60
|
-
|
|
61
|
-
className: stringify(classNames.searchInput, styled.input.className),
|
|
62
|
-
variant: "filled",
|
|
63
|
-
shaped: true,
|
|
57
|
+
return /*#__PURE__*/React.createElement(SearchField, {
|
|
58
|
+
inputRef: inputRef,
|
|
64
59
|
value: value,
|
|
65
60
|
placeholder: placeholder,
|
|
66
61
|
disabled: disabled,
|
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
export declare const CLASS_NAMES: {
|
|
6
6
|
readonly search: "search";
|
|
7
7
|
readonly searchInput: "search-input";
|
|
8
|
+
readonly searchInputControl: "search-input__control";
|
|
8
9
|
readonly searchLeading: "search-leading";
|
|
9
10
|
readonly searchTrailing: "search-trailing";
|
|
10
11
|
readonly searchClear: "search-clear";
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var _objectSpread = require('@babel/runtime/helpers/objectSpread2');
|
|
6
|
+
var _objectWithoutProperties = require('@babel/runtime/helpers/objectWithoutProperties');
|
|
7
|
+
var stylex = require('../../node_modules/.pnpm/@stylexjs_stylex@0.19.0/node_modules/@stylexjs/stylex/lib/es/stylex.cjs');
|
|
8
|
+
var relax = require('@aiszlab/relax');
|
|
9
|
+
var className = require('@aiszlab/relax/class-name');
|
|
10
|
+
var React = require('react');
|
|
11
|
+
var useClassNames = require('../../hooks/use-class-names.cjs');
|
|
12
|
+
var useThemeColorVars = require('../../hooks/use-theme-color-vars.cjs');
|
|
13
|
+
var theme = require('../theme/theme.cjs');
|
|
14
|
+
var tokens_stylex = require('../theme/tokens.stylex.cjs');
|
|
15
|
+
var context = require('./context.cjs');
|
|
16
|
+
var styles = require('./styles.cjs');
|
|
17
|
+
|
|
18
|
+
var _excluded = ["disabled", "inputRef", "leading", "onChange", "onFocus", "onKeyDown", "placeholder", "shape", "trailing", "value"];
|
|
19
|
+
var SearchField = function SearchField(_ref) {
|
|
20
|
+
var disabled = _ref.disabled,
|
|
21
|
+
inputRef = _ref.inputRef,
|
|
22
|
+
leading = _ref.leading,
|
|
23
|
+
onChange = _ref.onChange,
|
|
24
|
+
onFocus = _ref.onFocus,
|
|
25
|
+
onKeyDown = _ref.onKeyDown,
|
|
26
|
+
placeholder = _ref.placeholder,
|
|
27
|
+
_ref$shape = _ref.shape,
|
|
28
|
+
shape = _ref$shape === void 0 ? "pill" : _ref$shape,
|
|
29
|
+
trailing = _ref.trailing,
|
|
30
|
+
value = _ref.value,
|
|
31
|
+
inputProps = _objectWithoutProperties(_ref, _excluded);
|
|
32
|
+
var classNames = useClassNames.useClassNames(context.CLASS_NAMES);
|
|
33
|
+
var ownedInputRef = React.useRef(null);
|
|
34
|
+
var composedInputRef = relax.useComposedRef(ownedInputRef, inputRef);
|
|
35
|
+
var themeColorVars = useThemeColorVars.useThemeColorVars(["primary", "surface-container-high", "on-surface", "on-surface-variant", ["on-surface", tokens_stylex.OPACITY.medium], ["on-surface", tokens_stylex.OPACITY.thickest]]);
|
|
36
|
+
var styled = {
|
|
37
|
+
root: stylex.props(theme.$body.large, styles.default.field.root, shape === "pill" ? styles.default.field.pill : styles.default.field.standard, !disabled && styles.default.field.enabled, disabled && styles.default.field.disabled),
|
|
38
|
+
input: stylex.props(styles.default.fieldInput.base, disabled && styles.default.fieldInput.disabled)
|
|
39
|
+
};
|
|
40
|
+
var handleChange = function handleChange(event) {
|
|
41
|
+
onChange(event.currentTarget.value);
|
|
42
|
+
};
|
|
43
|
+
return /*#__PURE__*/React.createElement("div", _objectSpread({
|
|
44
|
+
className: className.stringify(classNames.searchInput, styled.root.className),
|
|
45
|
+
style: _objectSpread(_objectSpread({}, styled.root.style), themeColorVars)
|
|
46
|
+
}, !disabled && {
|
|
47
|
+
onClick: function onClick() {
|
|
48
|
+
var _ownedInputRef$curren;
|
|
49
|
+
(_ownedInputRef$curren = ownedInputRef.current) === null || _ownedInputRef$curren === void 0 || _ownedInputRef$curren.focus();
|
|
50
|
+
}
|
|
51
|
+
}), leading, /*#__PURE__*/React.createElement("input", _objectSpread(_objectSpread({}, inputProps), {}, {
|
|
52
|
+
ref: composedInputRef,
|
|
53
|
+
className: className.stringify(classNames.searchInputControl, styled.input.className),
|
|
54
|
+
style: styled.input.style,
|
|
55
|
+
value: value,
|
|
56
|
+
placeholder: placeholder,
|
|
57
|
+
disabled: disabled,
|
|
58
|
+
onChange: handleChange,
|
|
59
|
+
onFocus: onFocus,
|
|
60
|
+
onKeyDown: onKeyDown
|
|
61
|
+
})), trailing);
|
|
62
|
+
};
|
|
63
|
+
|
|
64
|
+
exports.default = SearchField;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import type { InputHTMLAttributes, KeyboardEventHandler, ReactNode, Ref } from "react";
|
|
3
|
+
/**
|
|
4
|
+
* @zh 私有 Search 输入区域属性
|
|
5
|
+
* @en Private Search input field props
|
|
6
|
+
*/
|
|
7
|
+
export type SearchFieldProps = Pick<InputHTMLAttributes<HTMLInputElement>, "aria-activedescendant" | "aria-autocomplete" | "aria-controls" | "aria-expanded" | "onFocus" | "role"> & {
|
|
8
|
+
inputRef: Ref<HTMLInputElement>;
|
|
9
|
+
value: string;
|
|
10
|
+
placeholder?: string;
|
|
11
|
+
disabled?: boolean;
|
|
12
|
+
shape?: "pill" | "standard";
|
|
13
|
+
leading?: ReactNode;
|
|
14
|
+
trailing?: ReactNode;
|
|
15
|
+
onChange: (value: string) => void;
|
|
16
|
+
onKeyDown: KeyboardEventHandler<HTMLInputElement>;
|
|
17
|
+
};
|
|
18
|
+
declare const SearchField: ({ disabled, inputRef, leading, onChange, onFocus, onKeyDown, placeholder, shape, trailing, value, ...inputProps }: SearchFieldProps) => React.JSX.Element;
|
|
19
|
+
export default SearchField;
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import _objectSpread from '@babel/runtime/helpers/objectSpread2';
|
|
2
|
+
import _objectWithoutProperties from '@babel/runtime/helpers/objectWithoutProperties';
|
|
3
|
+
import { props } from '../../node_modules/.pnpm/@stylexjs_stylex@0.19.0/node_modules/@stylexjs/stylex/lib/es/stylex.mjs';
|
|
4
|
+
import { useComposedRef } from '@aiszlab/relax';
|
|
5
|
+
import { stringify } from '@aiszlab/relax/class-name';
|
|
6
|
+
import React, { useRef } from 'react';
|
|
7
|
+
import { useClassNames } from '../../hooks/use-class-names.mjs';
|
|
8
|
+
import { useThemeColorVars } from '../../hooks/use-theme-color-vars.mjs';
|
|
9
|
+
import { $body } from '../theme/theme.mjs';
|
|
10
|
+
import { OPACITY } from '../theme/tokens.stylex.mjs';
|
|
11
|
+
import { CLASS_NAMES } from './context.mjs';
|
|
12
|
+
import styles from './styles.mjs';
|
|
13
|
+
|
|
14
|
+
var _excluded = ["disabled", "inputRef", "leading", "onChange", "onFocus", "onKeyDown", "placeholder", "shape", "trailing", "value"];
|
|
15
|
+
var SearchField = function SearchField(_ref) {
|
|
16
|
+
var disabled = _ref.disabled,
|
|
17
|
+
inputRef = _ref.inputRef,
|
|
18
|
+
leading = _ref.leading,
|
|
19
|
+
onChange = _ref.onChange,
|
|
20
|
+
onFocus = _ref.onFocus,
|
|
21
|
+
onKeyDown = _ref.onKeyDown,
|
|
22
|
+
placeholder = _ref.placeholder,
|
|
23
|
+
_ref$shape = _ref.shape,
|
|
24
|
+
shape = _ref$shape === void 0 ? "pill" : _ref$shape,
|
|
25
|
+
trailing = _ref.trailing,
|
|
26
|
+
value = _ref.value,
|
|
27
|
+
inputProps = _objectWithoutProperties(_ref, _excluded);
|
|
28
|
+
var classNames = useClassNames(CLASS_NAMES);
|
|
29
|
+
var ownedInputRef = useRef(null);
|
|
30
|
+
var composedInputRef = useComposedRef(ownedInputRef, inputRef);
|
|
31
|
+
var themeColorVars = useThemeColorVars(["primary", "surface-container-high", "on-surface", "on-surface-variant", ["on-surface", OPACITY.medium], ["on-surface", OPACITY.thickest]]);
|
|
32
|
+
var styled = {
|
|
33
|
+
root: props($body.large, styles.field.root, shape === "pill" ? styles.field.pill : styles.field.standard, !disabled && styles.field.enabled, disabled && styles.field.disabled),
|
|
34
|
+
input: props(styles.fieldInput.base, disabled && styles.fieldInput.disabled)
|
|
35
|
+
};
|
|
36
|
+
var handleChange = function handleChange(event) {
|
|
37
|
+
onChange(event.currentTarget.value);
|
|
38
|
+
};
|
|
39
|
+
return /*#__PURE__*/React.createElement("div", _objectSpread({
|
|
40
|
+
className: stringify(classNames.searchInput, styled.root.className),
|
|
41
|
+
style: _objectSpread(_objectSpread({}, styled.root.style), themeColorVars)
|
|
42
|
+
}, !disabled && {
|
|
43
|
+
onClick: function onClick() {
|
|
44
|
+
var _ownedInputRef$curren;
|
|
45
|
+
(_ownedInputRef$curren = ownedInputRef.current) === null || _ownedInputRef$curren === void 0 || _ownedInputRef$curren.focus();
|
|
46
|
+
}
|
|
47
|
+
}), leading, /*#__PURE__*/React.createElement("input", _objectSpread(_objectSpread({}, inputProps), {}, {
|
|
48
|
+
ref: composedInputRef,
|
|
49
|
+
className: stringify(classNames.searchInputControl, styled.input.className),
|
|
50
|
+
style: styled.input.style,
|
|
51
|
+
value: value,
|
|
52
|
+
placeholder: placeholder,
|
|
53
|
+
disabled: disabled,
|
|
54
|
+
onChange: handleChange,
|
|
55
|
+
onFocus: onFocus,
|
|
56
|
+
onKeyDown: onKeyDown
|
|
57
|
+
})), trailing);
|
|
58
|
+
};
|
|
59
|
+
|
|
60
|
+
export { SearchField as default };
|
|
@@ -58,11 +58,9 @@ var SearchResultList = function SearchResultList(_ref) {
|
|
|
58
58
|
className: className.stringify(classNames.searchResultItem, _defineProperty(_defineProperty({}, classNames.searchResultItemActive, isActive), classNames.searchResultItemDisabled, !!item.disabled), itemStyles.className),
|
|
59
59
|
style: itemStyles.style
|
|
60
60
|
}, !item.disabled && {
|
|
61
|
-
onPointerMove: function onPointerMove() {
|
|
62
|
-
return onActiveKeyChange(item.key);
|
|
63
|
-
},
|
|
64
61
|
onClick: function onClick() {
|
|
65
|
-
|
|
62
|
+
onActiveKeyChange(item.key);
|
|
63
|
+
onSelect(item);
|
|
66
64
|
}
|
|
67
65
|
}), relax.isFunction(renderItem) ? itemContent : (/*#__PURE__*/React.createElement(React.Fragment, null, hasLeading && (/*#__PURE__*/React.createElement("span", {
|
|
68
66
|
className: className.stringify(classNames.searchResultItemLeading, styled.leading.className),
|
|
@@ -54,11 +54,9 @@ var SearchResultList = function SearchResultList(_ref) {
|
|
|
54
54
|
className: stringify(classNames.searchResultItem, _defineProperty(_defineProperty({}, classNames.searchResultItemActive, isActive), classNames.searchResultItemDisabled, !!item.disabled), itemStyles.className),
|
|
55
55
|
style: itemStyles.style
|
|
56
56
|
}, !item.disabled && {
|
|
57
|
-
onPointerMove: function onPointerMove() {
|
|
58
|
-
return onActiveKeyChange(item.key);
|
|
59
|
-
},
|
|
60
57
|
onClick: function onClick() {
|
|
61
|
-
|
|
58
|
+
onActiveKeyChange(item.key);
|
|
59
|
+
onSelect(item);
|
|
62
60
|
}
|
|
63
61
|
}), isFunction(renderItem) ? itemContent : (/*#__PURE__*/React.createElement(React.Fragment, null, hasLeading && (/*#__PURE__*/React.createElement("span", {
|
|
64
62
|
className: stringify(classNames.searchResultItemLeading, styled.leading.className),
|
|
@@ -12,6 +12,66 @@ var container = {
|
|
|
12
12
|
$$css: true
|
|
13
13
|
}
|
|
14
14
|
};
|
|
15
|
+
var field = {
|
|
16
|
+
root: {
|
|
17
|
+
kVAEAm: "musaex-1n2onr6",
|
|
18
|
+
k1xSpc: "musaex-78zum5",
|
|
19
|
+
kGNEyG: "musaex-6s0dn4",
|
|
20
|
+
kB7OPa: "musaex-9f619",
|
|
21
|
+
kzqmXN: "musaex-92755x",
|
|
22
|
+
k7Eaqz: "musaex-1rdiejn",
|
|
23
|
+
kZKoxP: "musaex-1s2k5h2",
|
|
24
|
+
kogj98: "musaex-q3gua8",
|
|
25
|
+
k8WAf4: "musaex-11owsmz",
|
|
26
|
+
kg3NbH: "musaex-ipt7de",
|
|
27
|
+
kWkggS: "musaex-1b8defr",
|
|
28
|
+
kMwMTN: "musaex-bq1wot",
|
|
29
|
+
kkrTdU: "musaex-1ed109x",
|
|
30
|
+
$$css: true
|
|
31
|
+
},
|
|
32
|
+
enabled: {
|
|
33
|
+
kSReZ0: "musaex-usidmp",
|
|
34
|
+
$$css: true
|
|
35
|
+
},
|
|
36
|
+
pill: {
|
|
37
|
+
kaIpWk: "musaex-shxsqp",
|
|
38
|
+
$$css: true
|
|
39
|
+
},
|
|
40
|
+
standard: {
|
|
41
|
+
kZKoxP: "musaex-qg7gut",
|
|
42
|
+
kaIpWk: "musaex-mgj2z",
|
|
43
|
+
$$css: true
|
|
44
|
+
},
|
|
45
|
+
disabled: {
|
|
46
|
+
kWkggS: "musaex-1j73dxc",
|
|
47
|
+
kMwMTN: "musaex-1ldep6k",
|
|
48
|
+
kkrTdU: "musaex-t0e3qv",
|
|
49
|
+
$$css: true
|
|
50
|
+
}
|
|
51
|
+
};
|
|
52
|
+
var fieldInput = {
|
|
53
|
+
base: {
|
|
54
|
+
kUk6DE: "musaex-98rzlu",
|
|
55
|
+
k7Eaqz: "musaex-1rdiejn",
|
|
56
|
+
kZKoxP: "musaex-kyvkcq",
|
|
57
|
+
kogj98: "musaex-q3gua8",
|
|
58
|
+
kmVPX3: "musaex-1n775ky",
|
|
59
|
+
kMzoRj: "musaex-k59kd",
|
|
60
|
+
kI3sdo: "musaex-4fx59i",
|
|
61
|
+
kWkggS: "musaex-jbqb8w",
|
|
62
|
+
kMwMTN: "musaex-1j14bxn",
|
|
63
|
+
knGrYV: "musaex-l7pqhg",
|
|
64
|
+
kGuDYH: "musaex-1qlqyl8",
|
|
65
|
+
kLWn49: "musaex-15bjb6t",
|
|
66
|
+
k8Qsv1: "musaex-19r3k9r",
|
|
67
|
+
$$css: true
|
|
68
|
+
},
|
|
69
|
+
disabled: {
|
|
70
|
+
kMwMTN: "musaex-1ldep6k",
|
|
71
|
+
k8Qsv1: "musaex-1tfpmi6",
|
|
72
|
+
$$css: true
|
|
73
|
+
}
|
|
74
|
+
};
|
|
15
75
|
var leading = {
|
|
16
76
|
base: {
|
|
17
77
|
k1xSpc: "musaex-3nfvp2",
|
|
@@ -50,7 +110,6 @@ var clear = {
|
|
|
50
110
|
kkrTdU: "musaex-1ypdohk",
|
|
51
111
|
kaIpWk: "musaex-shxsqp",
|
|
52
112
|
kmVPX3: "musaex-1nskiab",
|
|
53
|
-
kHE3J0: "musaex-1rfa64k",
|
|
54
113
|
$$css: true
|
|
55
114
|
}
|
|
56
115
|
};
|
|
@@ -163,7 +222,6 @@ var resultList = {
|
|
|
163
222
|
kOIVth: "musaex-g4b44g",
|
|
164
223
|
kMwMTN: "musaex-bq1wot",
|
|
165
224
|
kkrTdU: "musaex-1ypdohk",
|
|
166
|
-
kHE3J0: "musaex-1rfa64k",
|
|
167
225
|
$$css: true
|
|
168
226
|
},
|
|
169
227
|
activeItem: {
|
|
@@ -206,6 +264,8 @@ var resultList = {
|
|
|
206
264
|
};
|
|
207
265
|
var styles = {
|
|
208
266
|
container: container,
|
|
267
|
+
field: field,
|
|
268
|
+
fieldInput: fieldInput,
|
|
209
269
|
leading: leading,
|
|
210
270
|
trailing: trailing,
|
|
211
271
|
clear: clear,
|
|
@@ -8,6 +8,65 @@ declare const styles: {
|
|
|
8
8
|
readonly maxWidth: import("@stylexjs/stylex").StyleXClassNameFor<"maxWidth", string>;
|
|
9
9
|
}>;
|
|
10
10
|
}>;
|
|
11
|
+
field: Readonly<{
|
|
12
|
+
readonly root: Readonly<{
|
|
13
|
+
readonly position: import("@stylexjs/stylex").StyleXClassNameFor<"position", "relative">;
|
|
14
|
+
readonly display: import("@stylexjs/stylex").StyleXClassNameFor<"display", "flex">;
|
|
15
|
+
readonly alignItems: import("@stylexjs/stylex").StyleXClassNameFor<"alignItems", "center">;
|
|
16
|
+
readonly boxSizing: import("@stylexjs/stylex").StyleXClassNameFor<"boxSizing", "border-box">;
|
|
17
|
+
readonly width: import("@stylexjs/stylex").StyleXClassNameFor<"width", string>;
|
|
18
|
+
readonly minWidth: import("@stylexjs/stylex").StyleXClassNameFor<"minWidth", string>;
|
|
19
|
+
readonly height: import("@stylexjs/stylex").StyleXClassNameFor<"height", string>;
|
|
20
|
+
readonly margin: import("@stylexjs/stylex").StyleXClassNameFor<"margin", string>;
|
|
21
|
+
readonly paddingBlock: import("@stylexjs/stylex").StyleXClassNameFor<"paddingBlock", string>;
|
|
22
|
+
readonly paddingInline: import("@stylexjs/stylex").StyleXClassNameFor<"paddingInline", string>;
|
|
23
|
+
readonly backgroundColor: import("@stylexjs/stylex").StyleXClassNameFor<"backgroundColor", "var(--color-surface-container-high)">;
|
|
24
|
+
readonly color: import("@stylexjs/stylex").StyleXClassNameFor<"color", "var(--color-on-surface-variant)">;
|
|
25
|
+
readonly cursor: import("@stylexjs/stylex").StyleXClassNameFor<"cursor", "text">;
|
|
26
|
+
}>;
|
|
27
|
+
readonly enabled: Readonly<{
|
|
28
|
+
readonly ":active": import("@stylexjs/stylex").StyleXClassNameFor<":active", {
|
|
29
|
+
readonly backgroundColor: `color-mix(in srgb, var(--color-on-surface) ${number}%, var(--color-surface-container-high))`;
|
|
30
|
+
}>;
|
|
31
|
+
}>;
|
|
32
|
+
readonly pill: Readonly<{
|
|
33
|
+
readonly borderRadius: import("@stylexjs/stylex").StyleXClassNameFor<"borderRadius", string>;
|
|
34
|
+
}>;
|
|
35
|
+
readonly standard: Readonly<{
|
|
36
|
+
readonly height: import("@stylexjs/stylex").StyleXClassNameFor<"height", string>;
|
|
37
|
+
readonly borderRadius: import("@stylexjs/stylex").StyleXClassNameFor<"borderRadius", string>;
|
|
38
|
+
}>;
|
|
39
|
+
readonly disabled: Readonly<{
|
|
40
|
+
readonly backgroundColor: import("@stylexjs/stylex").StyleXClassNameFor<"backgroundColor", "var(--color-on-surface-opacity-12)">;
|
|
41
|
+
readonly color: import("@stylexjs/stylex").StyleXClassNameFor<"color", "var(--color-on-surface-opacity-38)">;
|
|
42
|
+
readonly cursor: import("@stylexjs/stylex").StyleXClassNameFor<"cursor", "default">;
|
|
43
|
+
}>;
|
|
44
|
+
}>;
|
|
45
|
+
fieldInput: Readonly<{
|
|
46
|
+
readonly base: Readonly<{
|
|
47
|
+
readonly flex: import("@stylexjs/stylex").StyleXClassNameFor<"flex", 1>;
|
|
48
|
+
readonly minWidth: import("@stylexjs/stylex").StyleXClassNameFor<"minWidth", string>;
|
|
49
|
+
readonly height: import("@stylexjs/stylex").StyleXClassNameFor<"height", string>;
|
|
50
|
+
readonly margin: import("@stylexjs/stylex").StyleXClassNameFor<"margin", string>;
|
|
51
|
+
readonly padding: import("@stylexjs/stylex").StyleXClassNameFor<"padding", string>;
|
|
52
|
+
readonly borderWidth: import("@stylexjs/stylex").StyleXClassNameFor<"borderWidth", string>;
|
|
53
|
+
readonly outline: import("@stylexjs/stylex").StyleXClassNameFor<"outline", string>;
|
|
54
|
+
readonly backgroundColor: import("@stylexjs/stylex").StyleXClassNameFor<"backgroundColor", "transparent">;
|
|
55
|
+
readonly color: import("@stylexjs/stylex").StyleXClassNameFor<"color", "var(--color-on-surface)">;
|
|
56
|
+
readonly caretColor: import("@stylexjs/stylex").StyleXClassNameFor<"caretColor", "var(--color-primary)">;
|
|
57
|
+
readonly fontSize: import("@stylexjs/stylex").StyleXClassNameFor<"fontSize", "inherit">;
|
|
58
|
+
readonly lineHeight: import("@stylexjs/stylex").StyleXClassNameFor<"lineHeight", "inherit">;
|
|
59
|
+
readonly "::placeholder": import("@stylexjs/stylex").StyleXClassNameFor<"::placeholder", {
|
|
60
|
+
readonly color: "var(--color-on-surface-variant)";
|
|
61
|
+
}>;
|
|
62
|
+
}>;
|
|
63
|
+
readonly disabled: Readonly<{
|
|
64
|
+
readonly color: import("@stylexjs/stylex").StyleXClassNameFor<"color", "var(--color-on-surface-opacity-38)">;
|
|
65
|
+
readonly "::placeholder": import("@stylexjs/stylex").StyleXClassNameFor<"::placeholder", {
|
|
66
|
+
readonly color: "var(--color-on-surface-opacity-38)";
|
|
67
|
+
}>;
|
|
68
|
+
}>;
|
|
69
|
+
}>;
|
|
11
70
|
leading: Readonly<{
|
|
12
71
|
readonly base: Readonly<{
|
|
13
72
|
readonly display: import("@stylexjs/stylex").StyleXClassNameFor<"display", "inline-flex">;
|
|
@@ -44,11 +103,6 @@ declare const styles: {
|
|
|
44
103
|
readonly cursor: import("@stylexjs/stylex").StyleXClassNameFor<"cursor", "pointer">;
|
|
45
104
|
readonly borderRadius: import("@stylexjs/stylex").StyleXClassNameFor<"borderRadius", string>;
|
|
46
105
|
readonly padding: import("@stylexjs/stylex").StyleXClassNameFor<"padding", string>;
|
|
47
|
-
readonly ":hover": import("@stylexjs/stylex").StyleXClassNameFor<":hover", {
|
|
48
|
-
readonly "@media (hover: hover)": {
|
|
49
|
-
readonly backgroundColor: "var(--color-on-surface-opacity-08)";
|
|
50
|
-
};
|
|
51
|
-
}>;
|
|
52
106
|
}>;
|
|
53
107
|
}>;
|
|
54
108
|
searchButton: Readonly<{
|
|
@@ -148,11 +202,6 @@ declare const styles: {
|
|
|
148
202
|
readonly gap: import("@stylexjs/stylex").StyleXClassNameFor<"gap", string>;
|
|
149
203
|
readonly color: import("@stylexjs/stylex").StyleXClassNameFor<"color", "var(--color-on-surface-variant)">;
|
|
150
204
|
readonly cursor: import("@stylexjs/stylex").StyleXClassNameFor<"cursor", "pointer">;
|
|
151
|
-
readonly ":hover": import("@stylexjs/stylex").StyleXClassNameFor<":hover", {
|
|
152
|
-
readonly "@media (hover: hover)": {
|
|
153
|
-
readonly backgroundColor: "var(--color-on-surface-opacity-08)";
|
|
154
|
-
};
|
|
155
|
-
}>;
|
|
156
205
|
}>;
|
|
157
206
|
readonly activeItem: Readonly<{
|
|
158
207
|
readonly backgroundColor: import("@stylexjs/stylex").StyleXClassNameFor<"backgroundColor", "var(--color-on-surface-opacity-08)">;
|
|
@@ -8,6 +8,66 @@ var container = {
|
|
|
8
8
|
$$css: true
|
|
9
9
|
}
|
|
10
10
|
};
|
|
11
|
+
var field = {
|
|
12
|
+
root: {
|
|
13
|
+
kVAEAm: "musaex-1n2onr6",
|
|
14
|
+
k1xSpc: "musaex-78zum5",
|
|
15
|
+
kGNEyG: "musaex-6s0dn4",
|
|
16
|
+
kB7OPa: "musaex-9f619",
|
|
17
|
+
kzqmXN: "musaex-92755x",
|
|
18
|
+
k7Eaqz: "musaex-1rdiejn",
|
|
19
|
+
kZKoxP: "musaex-1s2k5h2",
|
|
20
|
+
kogj98: "musaex-q3gua8",
|
|
21
|
+
k8WAf4: "musaex-11owsmz",
|
|
22
|
+
kg3NbH: "musaex-ipt7de",
|
|
23
|
+
kWkggS: "musaex-1b8defr",
|
|
24
|
+
kMwMTN: "musaex-bq1wot",
|
|
25
|
+
kkrTdU: "musaex-1ed109x",
|
|
26
|
+
$$css: true
|
|
27
|
+
},
|
|
28
|
+
enabled: {
|
|
29
|
+
kSReZ0: "musaex-usidmp",
|
|
30
|
+
$$css: true
|
|
31
|
+
},
|
|
32
|
+
pill: {
|
|
33
|
+
kaIpWk: "musaex-shxsqp",
|
|
34
|
+
$$css: true
|
|
35
|
+
},
|
|
36
|
+
standard: {
|
|
37
|
+
kZKoxP: "musaex-qg7gut",
|
|
38
|
+
kaIpWk: "musaex-mgj2z",
|
|
39
|
+
$$css: true
|
|
40
|
+
},
|
|
41
|
+
disabled: {
|
|
42
|
+
kWkggS: "musaex-1j73dxc",
|
|
43
|
+
kMwMTN: "musaex-1ldep6k",
|
|
44
|
+
kkrTdU: "musaex-t0e3qv",
|
|
45
|
+
$$css: true
|
|
46
|
+
}
|
|
47
|
+
};
|
|
48
|
+
var fieldInput = {
|
|
49
|
+
base: {
|
|
50
|
+
kUk6DE: "musaex-98rzlu",
|
|
51
|
+
k7Eaqz: "musaex-1rdiejn",
|
|
52
|
+
kZKoxP: "musaex-kyvkcq",
|
|
53
|
+
kogj98: "musaex-q3gua8",
|
|
54
|
+
kmVPX3: "musaex-1n775ky",
|
|
55
|
+
kMzoRj: "musaex-k59kd",
|
|
56
|
+
kI3sdo: "musaex-4fx59i",
|
|
57
|
+
kWkggS: "musaex-jbqb8w",
|
|
58
|
+
kMwMTN: "musaex-1j14bxn",
|
|
59
|
+
knGrYV: "musaex-l7pqhg",
|
|
60
|
+
kGuDYH: "musaex-1qlqyl8",
|
|
61
|
+
kLWn49: "musaex-15bjb6t",
|
|
62
|
+
k8Qsv1: "musaex-19r3k9r",
|
|
63
|
+
$$css: true
|
|
64
|
+
},
|
|
65
|
+
disabled: {
|
|
66
|
+
kMwMTN: "musaex-1ldep6k",
|
|
67
|
+
k8Qsv1: "musaex-1tfpmi6",
|
|
68
|
+
$$css: true
|
|
69
|
+
}
|
|
70
|
+
};
|
|
11
71
|
var leading = {
|
|
12
72
|
base: {
|
|
13
73
|
k1xSpc: "musaex-3nfvp2",
|
|
@@ -46,7 +106,6 @@ var clear = {
|
|
|
46
106
|
kkrTdU: "musaex-1ypdohk",
|
|
47
107
|
kaIpWk: "musaex-shxsqp",
|
|
48
108
|
kmVPX3: "musaex-1nskiab",
|
|
49
|
-
kHE3J0: "musaex-1rfa64k",
|
|
50
109
|
$$css: true
|
|
51
110
|
}
|
|
52
111
|
};
|
|
@@ -159,7 +218,6 @@ var resultList = {
|
|
|
159
218
|
kOIVth: "musaex-g4b44g",
|
|
160
219
|
kMwMTN: "musaex-bq1wot",
|
|
161
220
|
kkrTdU: "musaex-1ypdohk",
|
|
162
|
-
kHE3J0: "musaex-1rfa64k",
|
|
163
221
|
$$css: true
|
|
164
222
|
},
|
|
165
223
|
activeItem: {
|
|
@@ -202,6 +260,8 @@ var resultList = {
|
|
|
202
260
|
};
|
|
203
261
|
var styles = {
|
|
204
262
|
container: container,
|
|
263
|
+
field: field,
|
|
264
|
+
fieldInput: fieldInput,
|
|
205
265
|
leading: leading,
|
|
206
266
|
trailing: trailing,
|
|
207
267
|
clear: clear,
|
|
@@ -8,9 +8,9 @@ var stylex = require('../../node_modules/.pnpm/@stylexjs_stylex@0.19.0/node_modu
|
|
|
8
8
|
var className = require('@aiszlab/relax/class-name');
|
|
9
9
|
var useClassNames = require('../../hooks/use-class-names.cjs');
|
|
10
10
|
var useThemeColorVars = require('../../hooks/use-theme-color-vars.cjs');
|
|
11
|
-
var input = require('../input/input.cjs');
|
|
12
11
|
var portal = require('../portal/portal.cjs');
|
|
13
12
|
var context = require('./context.cjs');
|
|
13
|
+
var field = require('./field.cjs');
|
|
14
14
|
var styles = require('./styles.cjs');
|
|
15
15
|
var close = require('../icon/icons/navigation/close.cjs');
|
|
16
16
|
var arrowBack = require('../icon/icons/navigation/arrow-back.cjs');
|
|
@@ -76,9 +76,8 @@ var SearchView = function SearchView(_ref) {
|
|
|
76
76
|
}, /*#__PURE__*/React.createElement("div", {
|
|
77
77
|
className: className.stringify(classNames.searchViewHeader, styled.header.className),
|
|
78
78
|
style: styled.header.style
|
|
79
|
-
}, /*#__PURE__*/React.createElement(
|
|
80
|
-
|
|
81
|
-
variant: "filled",
|
|
79
|
+
}, /*#__PURE__*/React.createElement(field.default, {
|
|
80
|
+
inputRef: inputRef,
|
|
82
81
|
shape: mode === "modal" ? "pill" : "standard",
|
|
83
82
|
role: "combobox",
|
|
84
83
|
"aria-expanded": open,
|
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import type { KeyboardEventHandler, ReactNode, Ref } from "react";
|
|
3
|
-
import type { InputRef } from "../../types/input";
|
|
4
3
|
import type { ResolvedSearchView, SearchProps } from "../../types/search";
|
|
5
4
|
/**
|
|
6
5
|
* @zh 私有 Search View 属性
|
|
7
6
|
* @en Private Search View props
|
|
8
7
|
*/
|
|
9
8
|
export type SearchViewProps = Pick<SearchProps, "clearable" | "disabled" | "placeholder"> & {
|
|
10
|
-
inputRef: Ref<
|
|
9
|
+
inputRef: Ref<HTMLInputElement>;
|
|
11
10
|
mode: ResolvedSearchView;
|
|
12
11
|
open: boolean;
|
|
13
12
|
value: string;
|
|
@@ -4,9 +4,9 @@ import { props } from '../../node_modules/.pnpm/@stylexjs_stylex@0.19.0/node_mod
|
|
|
4
4
|
import { stringify } from '@aiszlab/relax/class-name';
|
|
5
5
|
import { useClassNames } from '../../hooks/use-class-names.mjs';
|
|
6
6
|
import { useThemeColorVars } from '../../hooks/use-theme-color-vars.mjs';
|
|
7
|
-
import Input from '../input/input.mjs';
|
|
8
7
|
import Portal from '../portal/portal.mjs';
|
|
9
8
|
import { CLASS_NAMES } from './context.mjs';
|
|
9
|
+
import SearchField from './field.mjs';
|
|
10
10
|
import styles from './styles.mjs';
|
|
11
11
|
import IconClose from '../icon/icons/navigation/close.mjs';
|
|
12
12
|
import IconArrowBack from '../icon/icons/navigation/arrow-back.mjs';
|
|
@@ -72,9 +72,8 @@ var SearchView = function SearchView(_ref) {
|
|
|
72
72
|
}, /*#__PURE__*/React.createElement("div", {
|
|
73
73
|
className: stringify(classNames.searchViewHeader, styled.header.className),
|
|
74
74
|
style: styled.header.style
|
|
75
|
-
}, /*#__PURE__*/React.createElement(
|
|
76
|
-
|
|
77
|
-
variant: "filled",
|
|
75
|
+
}, /*#__PURE__*/React.createElement(SearchField, {
|
|
76
|
+
inputRef: inputRef,
|
|
78
77
|
shape: mode === "modal" ? "pill" : "standard",
|
|
79
78
|
role: "combobox",
|
|
80
79
|
"aria-expanded": open,
|
|
@@ -40,6 +40,7 @@ var Sheet = function Sheet(_ref) {
|
|
|
40
40
|
header = _ref.header,
|
|
41
41
|
footer = _ref.footer,
|
|
42
42
|
className$1 = _ref.className,
|
|
43
|
+
style = _ref.style,
|
|
43
44
|
panelClassName = _ref.panelClassName,
|
|
44
45
|
panelStyle = _ref.panelStyle,
|
|
45
46
|
_ref$modal = _ref.modal,
|
|
@@ -123,7 +124,7 @@ var Sheet = function Sheet(_ref) {
|
|
|
123
124
|
stackLevel: stylex.props(styles.default.stackLevel.base),
|
|
124
125
|
container: stylex.props(styles.default.stackLevel.base, styles.default.container.base, modal && styles.default.container.modal),
|
|
125
126
|
overlay: stylex.props(styles.default.overlay.base),
|
|
126
|
-
panel: stylex.props(styles.default.panel.base, styles.default.panel[placement]
|
|
127
|
+
panel: stylex.props(styles.default.panel.base, styles.default.panel[placement])
|
|
127
128
|
};
|
|
128
129
|
return /*#__PURE__*/React.createElement(portal.default, {
|
|
129
130
|
open: visible || _isVisible,
|
|
@@ -140,7 +141,7 @@ var Sheet = function Sheet(_ref) {
|
|
|
140
141
|
style: _objectSpread(_objectSpread(_objectSpread({}, styled.container.style), themeColorVars), {}, {
|
|
141
142
|
"--default-position": relax.at(_placement, 0),
|
|
142
143
|
"--size": typeof size === "number" ? "".concat(size, "px") : size
|
|
143
|
-
}),
|
|
144
|
+
}, style),
|
|
144
145
|
onKeyDown: onKeyDown
|
|
145
146
|
}, /*#__PURE__*/React.createElement("div", {
|
|
146
147
|
ref: overlayRef,
|
|
@@ -7,5 +7,5 @@ import type { SheetProps } from "../../types/sheet";
|
|
|
7
7
|
* placement-driven slide animation, focus management, and body scroll lock.
|
|
8
8
|
* Drawer and BottomSheet are thin wrappers around this component.
|
|
9
9
|
*/
|
|
10
|
-
declare const Sheet: ({ visible, onClose, placement, size, closable, header, footer, className, panelClassName, panelStyle, modal, children, }: SheetProps) => React.JSX.Element;
|
|
10
|
+
declare const Sheet: ({ visible, onClose, placement, size, closable, header, footer, className, style, panelClassName, panelStyle, modal, children, }: SheetProps) => React.JSX.Element;
|
|
11
11
|
export default Sheet;
|
|
@@ -36,6 +36,7 @@ var Sheet = function Sheet(_ref) {
|
|
|
36
36
|
header = _ref.header,
|
|
37
37
|
footer = _ref.footer,
|
|
38
38
|
className = _ref.className,
|
|
39
|
+
style = _ref.style,
|
|
39
40
|
panelClassName = _ref.panelClassName,
|
|
40
41
|
panelStyle = _ref.panelStyle,
|
|
41
42
|
_ref$modal = _ref.modal,
|
|
@@ -119,7 +120,7 @@ var Sheet = function Sheet(_ref) {
|
|
|
119
120
|
stackLevel: props(styles.stackLevel.base),
|
|
120
121
|
container: props(styles.stackLevel.base, styles.container.base, modal && styles.container.modal),
|
|
121
122
|
overlay: props(styles.overlay.base),
|
|
122
|
-
panel: props(styles.panel.base, styles.panel[placement]
|
|
123
|
+
panel: props(styles.panel.base, styles.panel[placement])
|
|
123
124
|
};
|
|
124
125
|
return /*#__PURE__*/React.createElement(Portal, {
|
|
125
126
|
open: visible || _isVisible,
|
|
@@ -136,7 +137,7 @@ var Sheet = function Sheet(_ref) {
|
|
|
136
137
|
style: _objectSpread(_objectSpread(_objectSpread({}, styled.container.style), themeColorVars), {}, {
|
|
137
138
|
"--default-position": at(_placement, 0),
|
|
138
139
|
"--size": typeof size === "number" ? "".concat(size, "px") : size
|
|
139
|
-
}),
|
|
140
|
+
}, style),
|
|
140
141
|
onKeyDown: onKeyDown
|
|
141
142
|
}, /*#__PURE__*/React.createElement("div", {
|
|
142
143
|
ref: overlayRef,
|
|
@@ -69,15 +69,6 @@ var panel = {
|
|
|
69
69
|
kCIrl2: "musaex-3m8u43",
|
|
70
70
|
kZKoxP: "musaex-188dgw3",
|
|
71
71
|
$$css: true
|
|
72
|
-
},
|
|
73
|
-
fullscreen: {
|
|
74
|
-
kRDq7Z: "musaex-1ej3teu",
|
|
75
|
-
kllhKz: "musaex-1pzvw0h",
|
|
76
|
-
kIfGbc: "musaex-1se81xg",
|
|
77
|
-
kBJAon: "musaex-19wv56r",
|
|
78
|
-
kGHaHD: "musaex-1m33i82",
|
|
79
|
-
kYNdYH: "musaex-1uogugb",
|
|
80
|
-
$$css: true
|
|
81
72
|
}
|
|
82
73
|
};
|
|
83
74
|
var styles = {
|
|
@@ -58,16 +58,6 @@ declare const styles: {
|
|
|
58
58
|
readonly right: import("@stylexjs/stylex").StyleXClassNameFor<"right", 0>;
|
|
59
59
|
readonly height: import("@stylexjs/stylex").StyleXClassNameFor<"height", "var(--size)">;
|
|
60
60
|
}>;
|
|
61
|
-
readonly fullscreen: Readonly<{
|
|
62
|
-
readonly "@media (max-width: 904px)": import("@stylexjs/stylex").StyleXClassNameFor<"@media (max-width: 904px)", {
|
|
63
|
-
readonly width: "100vw";
|
|
64
|
-
readonly height: "100vh";
|
|
65
|
-
readonly borderTopLeftRadius: 0;
|
|
66
|
-
readonly borderTopRightRadius: 0;
|
|
67
|
-
readonly borderBottomLeftRadius: 0;
|
|
68
|
-
readonly borderBottomRightRadius: 0;
|
|
69
|
-
}>;
|
|
70
|
-
}>;
|
|
71
61
|
}>;
|
|
72
62
|
};
|
|
73
63
|
export default styles;
|
|
@@ -65,15 +65,6 @@ var panel = {
|
|
|
65
65
|
kCIrl2: "musaex-3m8u43",
|
|
66
66
|
kZKoxP: "musaex-188dgw3",
|
|
67
67
|
$$css: true
|
|
68
|
-
},
|
|
69
|
-
fullscreen: {
|
|
70
|
-
kRDq7Z: "musaex-1ej3teu",
|
|
71
|
-
kllhKz: "musaex-1pzvw0h",
|
|
72
|
-
kIfGbc: "musaex-1se81xg",
|
|
73
|
-
kBJAon: "musaex-19wv56r",
|
|
74
|
-
kGHaHD: "musaex-1m33i82",
|
|
75
|
-
kYNdYH: "musaex-1uogugb",
|
|
76
|
-
$$css: true
|
|
77
68
|
}
|
|
78
69
|
};
|
|
79
70
|
var styles = {
|
package/dist/styles.css
CHANGED
|
@@ -852,6 +852,10 @@
|
|
|
852
852
|
box-sizing: border-box;
|
|
853
853
|
}
|
|
854
854
|
|
|
855
|
+
.musaex-l7pqhg {
|
|
856
|
+
caret-color: var(--color-primary);
|
|
857
|
+
}
|
|
858
|
+
|
|
855
859
|
.musaex-zpqnlu {
|
|
856
860
|
clip: rect(0,0,0,0);
|
|
857
861
|
}
|
|
@@ -1889,6 +1893,10 @@
|
|
|
1889
1893
|
background-color: var(--color-primary-opacity-12);
|
|
1890
1894
|
}
|
|
1891
1895
|
|
|
1896
|
+
.musaex-usidmp:active {
|
|
1897
|
+
background-color: color-mix(in srgb,var(--color-on-surface) NaN%,var(--color-surface-container-high));
|
|
1898
|
+
}
|
|
1899
|
+
|
|
1892
1900
|
@media (hover: hover) {
|
|
1893
1901
|
.musaex-1senyb1.musaex-1senyb1:not(:hover) > [role="button"], .musaex-s2sk4o.musaex-s2sk4o:hover > [role="separator"] {
|
|
1894
1902
|
display: none;
|
|
@@ -2741,32 +2749,6 @@
|
|
|
2741
2749
|
border-bottom-width: 0;
|
|
2742
2750
|
}
|
|
2743
2751
|
|
|
2744
|
-
@media (width <= 904px) {
|
|
2745
|
-
.musaex-1m33i82.musaex-1m33i82 {
|
|
2746
|
-
border-bottom-left-radius: 0;
|
|
2747
|
-
}
|
|
2748
|
-
|
|
2749
|
-
.musaex-1uogugb.musaex-1uogugb {
|
|
2750
|
-
border-bottom-right-radius: 0;
|
|
2751
|
-
}
|
|
2752
|
-
|
|
2753
|
-
.musaex-1se81xg.musaex-1se81xg {
|
|
2754
|
-
border-top-left-radius: 0;
|
|
2755
|
-
}
|
|
2756
|
-
|
|
2757
|
-
.musaex-19wv56r.musaex-19wv56r {
|
|
2758
|
-
border-top-right-radius: 0;
|
|
2759
|
-
}
|
|
2760
|
-
|
|
2761
|
-
.musaex-1pzvw0h.musaex-1pzvw0h {
|
|
2762
|
-
height: 100vh;
|
|
2763
|
-
}
|
|
2764
|
-
|
|
2765
|
-
.musaex-1ej3teu.musaex-1ej3teu {
|
|
2766
|
-
width: 100vw;
|
|
2767
|
-
}
|
|
2768
|
-
}
|
|
2769
|
-
|
|
2770
2752
|
@media (hover: hover) {
|
|
2771
2753
|
.musaex-1fjziz3.musaex-1fjziz3:hover {
|
|
2772
2754
|
overflow-y: auto;
|
|
@@ -1,39 +1,53 @@
|
|
|
1
|
-
import type { ReactNode } from "react";
|
|
1
|
+
import type { CSSProperties, ReactNode } from "react";
|
|
2
2
|
import type { ComponentProps } from "./element";
|
|
3
3
|
import type { Closable } from "../hooks/use-closable";
|
|
4
4
|
export interface BottomSheetProps extends ComponentProps {
|
|
5
5
|
/**
|
|
6
|
-
* @
|
|
7
|
-
* Controls
|
|
6
|
+
* @zh 控制 Bottom Sheet 的打开状态。
|
|
7
|
+
* @en Controls whether the Bottom Sheet is open.
|
|
8
|
+
* @default false
|
|
8
9
|
*/
|
|
9
|
-
open
|
|
10
|
+
open?: boolean;
|
|
10
11
|
/**
|
|
11
|
-
* @
|
|
12
|
-
* Called when the
|
|
12
|
+
* @zh Bottom Sheet 请求关闭时调用,例如点击遮罩层或按下 Esc 键。
|
|
13
|
+
* @en Called when the Bottom Sheet requests to close, such as after an overlay click or Esc key press.
|
|
14
|
+
* @default void 0
|
|
13
15
|
*/
|
|
14
|
-
onClose
|
|
16
|
+
onClose?: VoidFunction;
|
|
15
17
|
/**
|
|
16
|
-
* @
|
|
17
|
-
*
|
|
18
|
+
* @zh 渲染在拖拽手柄下方的内容。
|
|
19
|
+
* @en Content rendered below the drag handle.
|
|
20
|
+
* @default void 0
|
|
18
21
|
*/
|
|
19
22
|
children?: ReactNode;
|
|
20
23
|
/**
|
|
21
|
-
* @
|
|
22
|
-
*
|
|
24
|
+
* @zh 应用到 Bottom Sheet 面板元素上的额外类名。
|
|
25
|
+
* @en Additional class name applied to the Bottom Sheet panel element.
|
|
26
|
+
* @default void 0
|
|
27
|
+
*/
|
|
28
|
+
panelClassName?: string;
|
|
29
|
+
/**
|
|
30
|
+
* @zh 应用到 Bottom Sheet 面板元素上的额外内联样式。
|
|
31
|
+
* @en Additional inline styles applied to the Bottom Sheet panel element.
|
|
32
|
+
* @default void 0
|
|
33
|
+
*/
|
|
34
|
+
panelStyle?: CSSProperties;
|
|
35
|
+
/**
|
|
36
|
+
* @zh 面板高度,接受数字(px)或任意 CSS 高度值。
|
|
37
|
+
* @en Height of the sheet panel. Accepts a number (px) or any CSS height value.
|
|
23
38
|
* @default "50vh"
|
|
24
39
|
*/
|
|
25
40
|
height?: number | string;
|
|
26
41
|
/**
|
|
27
|
-
* @
|
|
28
|
-
* Whether the sheet can be closed by overlay
|
|
42
|
+
* @zh 是否可以通过点击遮罩层或按 Esc 键关闭。传入 `Closable` 数组以启用特定关闭方式。
|
|
43
|
+
* @en Whether the sheet can be closed by clicking the overlay or pressing Esc.
|
|
29
44
|
* Pass an array of `Closable` values to enable specific close triggers.
|
|
30
45
|
* @default true (all triggers enabled)
|
|
31
46
|
*/
|
|
32
47
|
closable?: boolean | Closable[];
|
|
33
48
|
/**
|
|
34
|
-
* @
|
|
35
|
-
* Whether to enable modal locking (lock body scroll).
|
|
36
|
-
* Pass `false` to disable scroll locking.
|
|
49
|
+
* @zh 是否启用模态锁定(锁定 body 滚动)。传入 `false` 可禁用滚动锁定。
|
|
50
|
+
* @en Whether to enable modal locking (lock body scroll). Pass `false` to disable scroll locking.
|
|
37
51
|
* @default true
|
|
38
52
|
*/
|
|
39
53
|
modal?: boolean;
|