musae 1.0.26 → 1.0.27-beta.1
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/category-picker/index.d.ts +12 -0
- package/dist/components/icon/icons/action/search.cjs +22 -0
- package/dist/components/icon/icons/action/search.d.ts +3 -0
- package/dist/components/icon/icons/action/search.mjs +18 -0
- package/dist/components/input/input.cjs +16 -12
- package/dist/components/input/input.d.ts +5 -4
- package/dist/components/input/input.mjs +16 -12
- package/dist/components/pagination/pagination.cjs +2 -5
- package/dist/components/pagination/pagination.mjs +2 -5
- package/dist/components/picker/picker.cjs +4 -5
- package/dist/components/picker/picker.mjs +4 -5
- package/dist/components/search/index.d.ts +2 -0
- package/dist/components/search/search.cjs +47 -0
- package/dist/components/search/search.d.ts +4 -0
- package/dist/components/search/search.mjs +43 -0
- package/dist/index.cjs +2 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.mjs +1 -0
- package/dist/styles.css +40 -8
- package/dist/types/input.d.ts +4 -0
- package/dist/types/search.d.ts +16 -0
- package/package.json +7 -7
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
type Props = {
|
|
3
|
+
categories?: {
|
|
4
|
+
label: string;
|
|
5
|
+
children: {
|
|
6
|
+
value: string;
|
|
7
|
+
label: string;
|
|
8
|
+
}[];
|
|
9
|
+
}[];
|
|
10
|
+
};
|
|
11
|
+
declare const CategoryPicker: ({ categories }: Props) => React.JSX.Element | null;
|
|
12
|
+
export default CategoryPicker;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var React = require('react');
|
|
6
|
+
var hoc = require('../../hoc.cjs');
|
|
7
|
+
|
|
8
|
+
var Search = hoc.withIcon(function (_ref) {
|
|
9
|
+
var size = _ref.size;
|
|
10
|
+
return /*#__PURE__*/React.createElement("svg", {
|
|
11
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
12
|
+
width: size,
|
|
13
|
+
height: size,
|
|
14
|
+
viewBox: "0 0 24 24",
|
|
15
|
+
fill: "none"
|
|
16
|
+
}, /*#__PURE__*/React.createElement("path", {
|
|
17
|
+
d: "M15.755 14.2549H14.965L14.685 13.9849C15.665 12.8449 16.255 11.3649 16.255 9.75488C16.255 6.16488 13.345 3.25488 9.755 3.25488C6.165 3.25488 3.255 6.16488 3.255 9.75488C3.255 13.3449 6.165 16.2549 9.755 16.2549C11.365 16.2549 12.845 15.6649 13.985 14.6849L14.255 14.9649V15.7549L19.255 20.7449L20.745 19.2549L15.755 14.2549ZM9.755 14.2549C7.26501 14.2549 5.255 12.2449 5.255 9.75488C5.255 7.26488 7.26501 5.25488 9.755 5.25488C12.245 5.25488 14.255 7.26488 14.255 9.75488C14.255 12.2449 12.245 14.2549 9.755 14.2549Z",
|
|
18
|
+
fill: "currentColor"
|
|
19
|
+
}));
|
|
20
|
+
});
|
|
21
|
+
|
|
22
|
+
exports.default = Search;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { withIcon } from '../../hoc.mjs';
|
|
3
|
+
|
|
4
|
+
var Search = withIcon(function (_ref) {
|
|
5
|
+
var size = _ref.size;
|
|
6
|
+
return /*#__PURE__*/React.createElement("svg", {
|
|
7
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
8
|
+
width: size,
|
|
9
|
+
height: size,
|
|
10
|
+
viewBox: "0 0 24 24",
|
|
11
|
+
fill: "none"
|
|
12
|
+
}, /*#__PURE__*/React.createElement("path", {
|
|
13
|
+
d: "M15.755 14.2549H14.965L14.685 13.9849C15.665 12.8449 16.255 11.3649 16.255 9.75488C16.255 6.16488 13.345 3.25488 9.755 3.25488C6.165 3.25488 3.255 6.16488 3.255 9.75488C3.255 13.3449 6.165 16.2549 9.755 16.2549C11.365 16.2549 12.845 15.6649 13.985 14.6849L14.255 14.9649V15.7549L19.255 20.7449L20.745 19.2549L15.755 14.2549ZM9.755 14.2549C7.26501 14.2549 5.255 12.2449 5.255 9.75488C5.255 7.26488 7.26501 5.25488 9.755 5.25488C12.245 5.25488 14.255 7.26488 14.255 9.75488C14.255 12.2449 12.245 14.2549 9.755 14.2549Z",
|
|
14
|
+
fill: "currentColor"
|
|
15
|
+
}));
|
|
16
|
+
});
|
|
17
|
+
|
|
18
|
+
export { Search as default };
|
|
@@ -30,7 +30,7 @@ var styles = {
|
|
|
30
30
|
kAzted: "musaex-epu74c",
|
|
31
31
|
k7Eaqz: "musaex-1rdiejn",
|
|
32
32
|
kzqmXN: "musaex-92755x",
|
|
33
|
-
kGVxlE: "musaex-
|
|
33
|
+
kGVxlE: "musaex-7u4mnu",
|
|
34
34
|
kB7OPa: "musaex-9f619",
|
|
35
35
|
kogj98: "musaex-q3gua8",
|
|
36
36
|
k8WAf4: "musaex-11owsmz",
|
|
@@ -38,16 +38,17 @@ var styles = {
|
|
|
38
38
|
k1ekBW: "musaex-kdsq27",
|
|
39
39
|
kIyJzY: "musaex-1ptezny",
|
|
40
40
|
k6sLGO: "musaex-1o9dqaq",
|
|
41
|
-
knuKkz: "musaex-
|
|
41
|
+
knuKkz: "musaex-8pombj",
|
|
42
42
|
$$css: true
|
|
43
43
|
},
|
|
44
44
|
invalid: {
|
|
45
|
-
kGVxlE: "musaex-
|
|
45
|
+
kGVxlE: "musaex-4ms1xy",
|
|
46
46
|
knuKkz: null,
|
|
47
47
|
$$css: true
|
|
48
48
|
},
|
|
49
49
|
input: {
|
|
50
50
|
kLWn49: "musaex-15bjb6t",
|
|
51
|
+
kGuDYH: "musaex-1qlqyl8",
|
|
51
52
|
kmVPX3: "musaex-1n775ky",
|
|
52
53
|
kMzoRj: "musaex-k59kd",
|
|
53
54
|
kWkggS: "musaex-jbqb8w",
|
|
@@ -60,7 +61,7 @@ var styles = {
|
|
|
60
61
|
disabled: {
|
|
61
62
|
kWkggS: "musaex-1fbjual",
|
|
62
63
|
kMwMTN: "musaex-1ldep6k",
|
|
63
|
-
kGVxlE: "musaex-
|
|
64
|
+
kGVxlE: "musaex-yb4mll",
|
|
64
65
|
$$css: true
|
|
65
66
|
}
|
|
66
67
|
};
|
|
@@ -89,6 +90,13 @@ var Input = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
|
89
90
|
var inputRef = React.useRef(null);
|
|
90
91
|
var classNames = useClassNames.useClassNames(context.CLASS_NAMES);
|
|
91
92
|
var theme$1 = hooks.useTheme();
|
|
93
|
+
// controlled value
|
|
94
|
+
var _useControlledState = relax.useControlledState(valueInProps, {
|
|
95
|
+
defaultState: ""
|
|
96
|
+
}),
|
|
97
|
+
_useControlledState2 = _slicedToArray(_useControlledState, 2),
|
|
98
|
+
_value = _useControlledState2[0],
|
|
99
|
+
_setValue = _useControlledState2[1];
|
|
92
100
|
React.useImperativeHandle(ref, function () {
|
|
93
101
|
return {
|
|
94
102
|
focus: function focus() {
|
|
@@ -98,16 +106,12 @@ var Input = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
|
98
106
|
select: function select() {
|
|
99
107
|
var _inputRef$current2;
|
|
100
108
|
(_inputRef$current2 = inputRef.current) === null || _inputRef$current2 === void 0 || _inputRef$current2.select();
|
|
109
|
+
},
|
|
110
|
+
getValue: function getValue() {
|
|
111
|
+
return _value;
|
|
101
112
|
}
|
|
102
113
|
};
|
|
103
114
|
});
|
|
104
|
-
// controlled value
|
|
105
|
-
var _useControlledState = relax.useControlledState(valueInProps, {
|
|
106
|
-
defaultState: ""
|
|
107
|
-
}),
|
|
108
|
-
_useControlledState2 = _slicedToArray(_useControlledState, 2),
|
|
109
|
-
_value = _useControlledState2[0],
|
|
110
|
-
_setValue = _useControlledState2[1];
|
|
111
115
|
// input events
|
|
112
116
|
var inputEvents = hooks$1.useInputEvents({
|
|
113
117
|
setValue: _setValue,
|
|
@@ -131,7 +135,7 @@ var Input = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
|
131
135
|
var styled = {
|
|
132
136
|
inputor: stylex.props(theme.$body.medium, styles.inputor, invalid && styles.invalid, disabled && styles.disabled),
|
|
133
137
|
input: {
|
|
134
|
-
className: "musaex-15bjb6t musaex-1n775ky musaex-k59kd musaex-jbqb8w musaex-4fx59i musaex-1rdiejn musaex-kyvkcq musaex-98rzlu"
|
|
138
|
+
className: "musaex-15bjb6t musaex-1qlqyl8 musaex-1n775ky musaex-k59kd musaex-jbqb8w musaex-4fx59i musaex-1rdiejn musaex-kyvkcq musaex-98rzlu"
|
|
135
139
|
}
|
|
136
140
|
};
|
|
137
141
|
return /*#__PURE__*/React.createElement("span", _objectSpread({
|
|
@@ -11,7 +11,7 @@ export declare const styles: Readonly<{
|
|
|
11
11
|
readonly minHeight: import("@stylexjs/stylex").StyleXClassNameFor<"minHeight", string>;
|
|
12
12
|
readonly minWidth: import("@stylexjs/stylex").StyleXClassNameFor<"minWidth", string>;
|
|
13
13
|
readonly width: import("@stylexjs/stylex").StyleXClassNameFor<"width", string>;
|
|
14
|
-
readonly boxShadow: import("@stylexjs/stylex").StyleXClassNameFor<"boxShadow", `0px 0px 0px ${import("@stylexjs/stylex").StyleXVar<string>} var(--color-outline)`>;
|
|
14
|
+
readonly boxShadow: import("@stylexjs/stylex").StyleXClassNameFor<"boxShadow", `0px 0px 0px ${import("@stylexjs/stylex").StyleXVar<string>} var(--color-outline) inset`>;
|
|
15
15
|
readonly boxSizing: import("@stylexjs/stylex").StyleXClassNameFor<"boxSizing", "border-box">;
|
|
16
16
|
readonly margin: import("@stylexjs/stylex").StyleXClassNameFor<"margin", string>;
|
|
17
17
|
readonly paddingBlock: import("@stylexjs/stylex").StyleXClassNameFor<"paddingBlock", string>;
|
|
@@ -20,17 +20,18 @@ export declare const styles: Readonly<{
|
|
|
20
20
|
readonly transitionDuration: import("@stylexjs/stylex").StyleXClassNameFor<"transitionDuration", string>;
|
|
21
21
|
readonly willChange: import("@stylexjs/stylex").StyleXClassNameFor<"willChange", "box-shadow, transform">;
|
|
22
22
|
readonly ":focus-within": import("@stylexjs/stylex").StyleXClassNameFor<":focus-within", {
|
|
23
|
-
readonly boxShadow: `0px 0px 0px ${import("@stylexjs/stylex").StyleXVar<string>} var(--color-primary)`;
|
|
23
|
+
readonly boxShadow: `0px 0px 0px ${import("@stylexjs/stylex").StyleXVar<string>} var(--color-primary) inset`;
|
|
24
24
|
}>;
|
|
25
25
|
}>;
|
|
26
26
|
readonly invalid: Readonly<{
|
|
27
|
-
readonly boxShadow: import("@stylexjs/stylex").StyleXClassNameFor<"boxShadow", `0px 0px 0px ${import("@stylexjs/stylex").StyleXVar<string>} var(--color-error)`>;
|
|
27
|
+
readonly boxShadow: import("@stylexjs/stylex").StyleXClassNameFor<"boxShadow", `0px 0px 0px ${import("@stylexjs/stylex").StyleXVar<string>} var(--color-error) inset`>;
|
|
28
28
|
readonly ":focus-within": import("@stylexjs/stylex").StyleXClassNameFor<":focus-within", {
|
|
29
29
|
readonly boxShadow: null;
|
|
30
30
|
}>;
|
|
31
31
|
}>;
|
|
32
32
|
readonly input: Readonly<{
|
|
33
33
|
readonly lineHeight: import("@stylexjs/stylex").StyleXClassNameFor<"lineHeight", "inherit">;
|
|
34
|
+
readonly fontSize: import("@stylexjs/stylex").StyleXClassNameFor<"fontSize", "inherit">;
|
|
34
35
|
readonly padding: import("@stylexjs/stylex").StyleXClassNameFor<"padding", string>;
|
|
35
36
|
readonly borderWidth: import("@stylexjs/stylex").StyleXClassNameFor<"borderWidth", string>;
|
|
36
37
|
readonly backgroundColor: import("@stylexjs/stylex").StyleXClassNameFor<"backgroundColor", "transparent">;
|
|
@@ -42,7 +43,7 @@ export declare const styles: Readonly<{
|
|
|
42
43
|
readonly disabled: Readonly<{
|
|
43
44
|
readonly backgroundColor: import("@stylexjs/stylex").StyleXClassNameFor<"backgroundColor", "var(--color-on-surface-opacity-08)">;
|
|
44
45
|
readonly color: import("@stylexjs/stylex").StyleXClassNameFor<"color", "var(--color-on-surface-opacity-38)">;
|
|
45
|
-
readonly boxShadow: import("@stylexjs/stylex").StyleXClassNameFor<"boxShadow", `0px 0px 0px ${import("@stylexjs/stylex").StyleXVar<string>} var(--color-on-surface-opacity-38)`>;
|
|
46
|
+
readonly boxShadow: import("@stylexjs/stylex").StyleXClassNameFor<"boxShadow", `0px 0px 0px ${import("@stylexjs/stylex").StyleXVar<string>} var(--color-on-surface-opacity-38) inset`>;
|
|
46
47
|
}>;
|
|
47
48
|
}>;
|
|
48
49
|
/**
|
|
@@ -26,7 +26,7 @@ var styles = {
|
|
|
26
26
|
kAzted: "musaex-epu74c",
|
|
27
27
|
k7Eaqz: "musaex-1rdiejn",
|
|
28
28
|
kzqmXN: "musaex-92755x",
|
|
29
|
-
kGVxlE: "musaex-
|
|
29
|
+
kGVxlE: "musaex-7u4mnu",
|
|
30
30
|
kB7OPa: "musaex-9f619",
|
|
31
31
|
kogj98: "musaex-q3gua8",
|
|
32
32
|
k8WAf4: "musaex-11owsmz",
|
|
@@ -34,16 +34,17 @@ var styles = {
|
|
|
34
34
|
k1ekBW: "musaex-kdsq27",
|
|
35
35
|
kIyJzY: "musaex-1ptezny",
|
|
36
36
|
k6sLGO: "musaex-1o9dqaq",
|
|
37
|
-
knuKkz: "musaex-
|
|
37
|
+
knuKkz: "musaex-8pombj",
|
|
38
38
|
$$css: true
|
|
39
39
|
},
|
|
40
40
|
invalid: {
|
|
41
|
-
kGVxlE: "musaex-
|
|
41
|
+
kGVxlE: "musaex-4ms1xy",
|
|
42
42
|
knuKkz: null,
|
|
43
43
|
$$css: true
|
|
44
44
|
},
|
|
45
45
|
input: {
|
|
46
46
|
kLWn49: "musaex-15bjb6t",
|
|
47
|
+
kGuDYH: "musaex-1qlqyl8",
|
|
47
48
|
kmVPX3: "musaex-1n775ky",
|
|
48
49
|
kMzoRj: "musaex-k59kd",
|
|
49
50
|
kWkggS: "musaex-jbqb8w",
|
|
@@ -56,7 +57,7 @@ var styles = {
|
|
|
56
57
|
disabled: {
|
|
57
58
|
kWkggS: "musaex-1fbjual",
|
|
58
59
|
kMwMTN: "musaex-1ldep6k",
|
|
59
|
-
kGVxlE: "musaex-
|
|
60
|
+
kGVxlE: "musaex-yb4mll",
|
|
60
61
|
$$css: true
|
|
61
62
|
}
|
|
62
63
|
};
|
|
@@ -85,6 +86,13 @@ var Input = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
85
86
|
var inputRef = useRef(null);
|
|
86
87
|
var classNames = useClassNames(CLASS_NAMES);
|
|
87
88
|
var theme = useTheme();
|
|
89
|
+
// controlled value
|
|
90
|
+
var _useControlledState = useControlledState(valueInProps, {
|
|
91
|
+
defaultState: ""
|
|
92
|
+
}),
|
|
93
|
+
_useControlledState2 = _slicedToArray(_useControlledState, 2),
|
|
94
|
+
_value = _useControlledState2[0],
|
|
95
|
+
_setValue = _useControlledState2[1];
|
|
88
96
|
useImperativeHandle(ref, function () {
|
|
89
97
|
return {
|
|
90
98
|
focus: function focus() {
|
|
@@ -94,16 +102,12 @@ var Input = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
94
102
|
select: function select() {
|
|
95
103
|
var _inputRef$current2;
|
|
96
104
|
(_inputRef$current2 = inputRef.current) === null || _inputRef$current2 === void 0 || _inputRef$current2.select();
|
|
105
|
+
},
|
|
106
|
+
getValue: function getValue() {
|
|
107
|
+
return _value;
|
|
97
108
|
}
|
|
98
109
|
};
|
|
99
110
|
});
|
|
100
|
-
// controlled value
|
|
101
|
-
var _useControlledState = useControlledState(valueInProps, {
|
|
102
|
-
defaultState: ""
|
|
103
|
-
}),
|
|
104
|
-
_useControlledState2 = _slicedToArray(_useControlledState, 2),
|
|
105
|
-
_value = _useControlledState2[0],
|
|
106
|
-
_setValue = _useControlledState2[1];
|
|
107
111
|
// input events
|
|
108
112
|
var inputEvents = useInputEvents({
|
|
109
113
|
setValue: _setValue,
|
|
@@ -127,7 +131,7 @@ var Input = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
127
131
|
var styled = {
|
|
128
132
|
inputor: props($body.medium, styles.inputor, invalid && styles.invalid, disabled && styles.disabled),
|
|
129
133
|
input: {
|
|
130
|
-
className: "musaex-15bjb6t musaex-1n775ky musaex-k59kd musaex-jbqb8w musaex-4fx59i musaex-1rdiejn musaex-kyvkcq musaex-98rzlu"
|
|
134
|
+
className: "musaex-15bjb6t musaex-1qlqyl8 musaex-1n775ky musaex-k59kd musaex-jbqb8w musaex-4fx59i musaex-1rdiejn musaex-kyvkcq musaex-98rzlu"
|
|
131
135
|
}
|
|
132
136
|
};
|
|
133
137
|
return /*#__PURE__*/React.createElement("span", _objectSpread({
|
|
@@ -82,17 +82,14 @@ var Pagination = function Pagination(_ref) {
|
|
|
82
82
|
hasNext: hasNext,
|
|
83
83
|
hasPrev: hasPrev
|
|
84
84
|
}));
|
|
85
|
-
}), /*#__PURE__*/React.createElement("li", {
|
|
85
|
+
}), sizeOptions.length > 0 && (/*#__PURE__*/React.createElement("li", {
|
|
86
86
|
className: className.stringify(classNames.sizeSelector, styled.sizer.className),
|
|
87
87
|
style: styled.sizer.style
|
|
88
88
|
}, /*#__PURE__*/React.createElement(select.default, {
|
|
89
89
|
options: sizeOptions,
|
|
90
90
|
value: pageSize,
|
|
91
|
-
style: {
|
|
92
|
-
minWidth: 0
|
|
93
|
-
},
|
|
94
91
|
onChange: onPageSizeChange
|
|
95
|
-
}))));
|
|
92
|
+
})))));
|
|
96
93
|
};
|
|
97
94
|
|
|
98
95
|
exports.default = Pagination;
|
|
@@ -78,17 +78,14 @@ var Pagination = function Pagination(_ref) {
|
|
|
78
78
|
hasNext: hasNext,
|
|
79
79
|
hasPrev: hasPrev
|
|
80
80
|
}));
|
|
81
|
-
}), /*#__PURE__*/React.createElement("li", {
|
|
81
|
+
}), sizeOptions.length > 0 && (/*#__PURE__*/React.createElement("li", {
|
|
82
82
|
className: stringify(classNames.sizeSelector, styled.sizer.className),
|
|
83
83
|
style: styled.sizer.style
|
|
84
84
|
}, /*#__PURE__*/React.createElement(Select, {
|
|
85
85
|
options: sizeOptions,
|
|
86
86
|
value: pageSize,
|
|
87
|
-
style: {
|
|
88
|
-
minWidth: 0
|
|
89
|
-
},
|
|
90
87
|
onChange: onPageSizeChange
|
|
91
|
-
}))));
|
|
88
|
+
})))));
|
|
92
89
|
};
|
|
93
90
|
|
|
94
91
|
export { Pagination as default };
|
|
@@ -100,10 +100,7 @@ var Picker = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
|
100
100
|
}
|
|
101
101
|
}, /*#__PURE__*/React.createElement("span", _objectSpread({
|
|
102
102
|
className: className.stringify(classNames.picker, isFocused && classNames.focused, className$1, styled.picker.className),
|
|
103
|
-
style: _objectSpread(_objectSpread(_objectSpread({}, styled.picker.style),
|
|
104
|
-
// eslint-disable-next-line react-hooks/refs
|
|
105
|
-
"--min-width": "".concat((_getDropdownWidth = getDropdownWidth()) !== null && _getDropdownWidth !== void 0 ? _getDropdownWidth : 0, "px")
|
|
106
|
-
}, style),
|
|
103
|
+
style: _objectSpread(_objectSpread(_objectSpread({}, styled.picker.style), style), _themeColorVars),
|
|
107
104
|
ref: _trigger,
|
|
108
105
|
tabIndex: -1,
|
|
109
106
|
onClick: click
|
|
@@ -129,7 +126,9 @@ var Picker = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
|
129
126
|
}, /*#__PURE__*/React.createElement("div", {
|
|
130
127
|
ref: pickableRef,
|
|
131
128
|
className: className.stringify(pickableClassName, styled.pickable.className),
|
|
132
|
-
style: _objectSpread(_objectSpread({}, styled.pickable.style), pickableStyle)
|
|
129
|
+
style: _objectSpread(_objectSpread(_objectSpread({}, styled.pickable.style), pickableStyle), {}, {
|
|
130
|
+
"--min-width": "".concat((_getDropdownWidth = getDropdownWidth()) !== null && _getDropdownWidth !== void 0 ? _getDropdownWidth : 0, "px")
|
|
131
|
+
})
|
|
133
132
|
}, pickable)));
|
|
134
133
|
});
|
|
135
134
|
|
|
@@ -96,10 +96,7 @@ var Picker = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
96
96
|
}
|
|
97
97
|
}, /*#__PURE__*/React.createElement("span", _objectSpread({
|
|
98
98
|
className: stringify(classNames.picker, isFocused && classNames.focused, className, styled.picker.className),
|
|
99
|
-
style: _objectSpread(_objectSpread(_objectSpread({}, styled.picker.style),
|
|
100
|
-
// eslint-disable-next-line react-hooks/refs
|
|
101
|
-
"--min-width": "".concat((_getDropdownWidth = getDropdownWidth()) !== null && _getDropdownWidth !== void 0 ? _getDropdownWidth : 0, "px")
|
|
102
|
-
}, style),
|
|
99
|
+
style: _objectSpread(_objectSpread(_objectSpread({}, styled.picker.style), style), _themeColorVars),
|
|
103
100
|
ref: _trigger,
|
|
104
101
|
tabIndex: -1,
|
|
105
102
|
onClick: click
|
|
@@ -125,7 +122,9 @@ var Picker = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
125
122
|
}, /*#__PURE__*/React.createElement("div", {
|
|
126
123
|
ref: pickableRef,
|
|
127
124
|
className: stringify(pickableClassName, styled.pickable.className),
|
|
128
|
-
style: _objectSpread(_objectSpread({}, styled.pickable.style), pickableStyle)
|
|
125
|
+
style: _objectSpread(_objectSpread(_objectSpread({}, styled.pickable.style), pickableStyle), {}, {
|
|
126
|
+
"--min-width": "".concat((_getDropdownWidth = getDropdownWidth()) !== null && _getDropdownWidth !== void 0 ? _getDropdownWidth : 0, "px")
|
|
127
|
+
})
|
|
129
128
|
}, pickable)));
|
|
130
129
|
});
|
|
131
130
|
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var _objectSpread = require('@babel/runtime/helpers/objectSpread2');
|
|
6
|
+
var button = require('../button/button.cjs');
|
|
7
|
+
var input = require('../input/input.cjs');
|
|
8
|
+
var React = require('react');
|
|
9
|
+
var search = require('../icon/icons/action/search.cjs');
|
|
10
|
+
var useThemeColorVars = require('../../hooks/use-theme-color-vars.cjs');
|
|
11
|
+
var relax = require('@aiszlab/relax');
|
|
12
|
+
|
|
13
|
+
var Search = function Search(_ref) {
|
|
14
|
+
var searchButton = _ref.searchButton,
|
|
15
|
+
onSearch = _ref.onSearch;
|
|
16
|
+
var inputRef = React.useRef(null);
|
|
17
|
+
var styled = {
|
|
18
|
+
search: {
|
|
19
|
+
className: "musaex-3nfvp2 musaex-92755x musaex-shxsqp musaex-3awqi9"
|
|
20
|
+
},
|
|
21
|
+
input: {
|
|
22
|
+
className: "musaex-19h0how musaex-4v1e0s musaex-vt43hk musaex-dsx2o5 musaex-yttm51"
|
|
23
|
+
},
|
|
24
|
+
button: {
|
|
25
|
+
className: "musaex-jizfy5 musaex-yjjj70"
|
|
26
|
+
}
|
|
27
|
+
};
|
|
28
|
+
var themeColorVars = useThemeColorVars.useThemeColorVars(["outline", "primary"]);
|
|
29
|
+
var search$1 = relax.useEvent(function () {
|
|
30
|
+
var _inputRef$current;
|
|
31
|
+
onSearch === null || onSearch === void 0 || onSearch((_inputRef$current = inputRef.current) === null || _inputRef$current === void 0 ? void 0 : _inputRef$current.getValue());
|
|
32
|
+
});
|
|
33
|
+
return /*#__PURE__*/React.createElement("span", {
|
|
34
|
+
className: styled.search.className,
|
|
35
|
+
style: _objectSpread(_objectSpread({}, styled.search.style), themeColorVars)
|
|
36
|
+
}, /*#__PURE__*/React.createElement(input.default, {
|
|
37
|
+
className: styled.input.className,
|
|
38
|
+
style: styled.input.style,
|
|
39
|
+
ref: inputRef
|
|
40
|
+
}), /*#__PURE__*/React.createElement(button.Button, {
|
|
41
|
+
className: styled.button.className,
|
|
42
|
+
style: styled.button.style,
|
|
43
|
+
onClick: search$1
|
|
44
|
+
}, searchButton !== null && searchButton !== void 0 ? searchButton : /*#__PURE__*/React.createElement(search.default, null)));
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
exports.default = Search;
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import _objectSpread from '@babel/runtime/helpers/objectSpread2';
|
|
2
|
+
import { Button } from '../button/button.mjs';
|
|
3
|
+
import Input from '../input/input.mjs';
|
|
4
|
+
import React, { useRef } from 'react';
|
|
5
|
+
import Search$1 from '../icon/icons/action/search.mjs';
|
|
6
|
+
import { useThemeColorVars } from '../../hooks/use-theme-color-vars.mjs';
|
|
7
|
+
import { useEvent } from '@aiszlab/relax';
|
|
8
|
+
|
|
9
|
+
var Search = function Search(_ref) {
|
|
10
|
+
var searchButton = _ref.searchButton,
|
|
11
|
+
onSearch = _ref.onSearch;
|
|
12
|
+
var inputRef = useRef(null);
|
|
13
|
+
var styled = {
|
|
14
|
+
search: {
|
|
15
|
+
className: "musaex-3nfvp2 musaex-92755x musaex-shxsqp musaex-3awqi9"
|
|
16
|
+
},
|
|
17
|
+
input: {
|
|
18
|
+
className: "musaex-19h0how musaex-4v1e0s musaex-vt43hk musaex-dsx2o5 musaex-yttm51"
|
|
19
|
+
},
|
|
20
|
+
button: {
|
|
21
|
+
className: "musaex-jizfy5 musaex-yjjj70"
|
|
22
|
+
}
|
|
23
|
+
};
|
|
24
|
+
var themeColorVars = useThemeColorVars(["outline", "primary"]);
|
|
25
|
+
var search = useEvent(function () {
|
|
26
|
+
var _inputRef$current;
|
|
27
|
+
onSearch === null || onSearch === void 0 || onSearch((_inputRef$current = inputRef.current) === null || _inputRef$current === void 0 ? void 0 : _inputRef$current.getValue());
|
|
28
|
+
});
|
|
29
|
+
return /*#__PURE__*/React.createElement("span", {
|
|
30
|
+
className: styled.search.className,
|
|
31
|
+
style: _objectSpread(_objectSpread({}, styled.search.style), themeColorVars)
|
|
32
|
+
}, /*#__PURE__*/React.createElement(Input, {
|
|
33
|
+
className: styled.input.className,
|
|
34
|
+
style: styled.input.style,
|
|
35
|
+
ref: inputRef
|
|
36
|
+
}), /*#__PURE__*/React.createElement(Button, {
|
|
37
|
+
className: styled.button.className,
|
|
38
|
+
style: styled.button.style,
|
|
39
|
+
onClick: search
|
|
40
|
+
}, searchButton !== null && searchButton !== void 0 ? searchButton : /*#__PURE__*/React.createElement(Search$1, null)));
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
export { Search as default };
|
package/dist/index.cjs
CHANGED
|
@@ -46,6 +46,7 @@ var popover = require('./components/popover/popover.cjs');
|
|
|
46
46
|
var progress = require('./components/progress/progress.cjs');
|
|
47
47
|
var quote = require('./components/quote/quote.cjs');
|
|
48
48
|
var rate = require('./components/rate/rate.cjs');
|
|
49
|
+
var search = require('./components/search/search.cjs');
|
|
49
50
|
var select = require('./components/select/select.cjs');
|
|
50
51
|
var sessionStorage = require('./components/session-storage/session-storage.cjs');
|
|
51
52
|
var skeleton = require('./components/skeleton/skeleton.cjs');
|
|
@@ -121,6 +122,7 @@ exports.Popover = popover.default;
|
|
|
121
122
|
exports.Progress = progress.default;
|
|
122
123
|
exports.Quote = quote.default;
|
|
123
124
|
exports.Rate = rate.default;
|
|
125
|
+
exports.Search = search.default;
|
|
124
126
|
exports.Select = select.default;
|
|
125
127
|
exports.SessionStorage = sessionStorage.default;
|
|
126
128
|
exports.Skeleton = skeleton.default;
|
package/dist/index.d.ts
CHANGED
|
@@ -68,6 +68,7 @@ export { Markdown } from "./components/markdown";
|
|
|
68
68
|
export { Ellipsis } from "./components/ellipsis";
|
|
69
69
|
export { SplitPanel } from "./components/split-panel";
|
|
70
70
|
export { SessionStorage } from "./components/session-storage";
|
|
71
|
+
export { Search } from "./components/search";
|
|
71
72
|
/**
|
|
72
73
|
* @description
|
|
73
74
|
* hooks
|
package/dist/index.mjs
CHANGED
|
@@ -44,6 +44,7 @@ export { default as Popover } from './components/popover/popover.mjs';
|
|
|
44
44
|
export { default as Progress } from './components/progress/progress.mjs';
|
|
45
45
|
export { default as Quote } from './components/quote/quote.mjs';
|
|
46
46
|
export { default as Rate } from './components/rate/rate.mjs';
|
|
47
|
+
export { default as Search } from './components/search/search.mjs';
|
|
47
48
|
export { default as Select } from './components/select/select.mjs';
|
|
48
49
|
export { default as SessionStorage } from './components/session-storage/session-storage.mjs';
|
|
49
50
|
export { default as Skeleton } from './components/skeleton/skeleton.mjs';
|
package/dist/styles.css
CHANGED
|
@@ -706,20 +706,24 @@
|
|
|
706
706
|
border-spacing: var(--musaex-16072l3);
|
|
707
707
|
}
|
|
708
708
|
|
|
709
|
-
.musaex-
|
|
710
|
-
box-shadow: 0 0 0 var(--musaex-1035pbm) var(--color-error);
|
|
709
|
+
.musaex-4ms1xy {
|
|
710
|
+
box-shadow: 0 0 0 var(--musaex-1035pbm) var(--color-error) inset;
|
|
711
|
+
}
|
|
712
|
+
|
|
713
|
+
.musaex-3awqi9 {
|
|
714
|
+
box-shadow: 0 0 0 var(--musaex-1035pbm) var(--color-primary) inset;
|
|
711
715
|
}
|
|
712
716
|
|
|
713
717
|
.musaex-bxw2on {
|
|
714
718
|
box-shadow: 0 0 0 var(--musaex-1xf102v) var(--color-on-primary);
|
|
715
719
|
}
|
|
716
720
|
|
|
717
|
-
.musaex-
|
|
718
|
-
box-shadow: 0 0 0 var(--musaex-1xf102v) var(--color-on-surface-opacity-38);
|
|
721
|
+
.musaex-yb4mll {
|
|
722
|
+
box-shadow: 0 0 0 var(--musaex-1xf102v) var(--color-on-surface-opacity-38) inset;
|
|
719
723
|
}
|
|
720
724
|
|
|
721
|
-
.musaex-
|
|
722
|
-
box-shadow: 0 0 0 var(--musaex-1xf102v) var(--color-outline);
|
|
725
|
+
.musaex-7u4mnu {
|
|
726
|
+
box-shadow: 0 0 0 var(--musaex-1xf102v) var(--color-outline) inset;
|
|
723
727
|
}
|
|
724
728
|
|
|
725
729
|
.musaex-1gnnqk1 {
|
|
@@ -1018,6 +1022,10 @@
|
|
|
1018
1022
|
font-size: 57px;
|
|
1019
1023
|
}
|
|
1020
1024
|
|
|
1025
|
+
.musaex-1qlqyl8 {
|
|
1026
|
+
font-size: inherit;
|
|
1027
|
+
}
|
|
1028
|
+
|
|
1021
1029
|
.musaex-o1l8bm {
|
|
1022
1030
|
font-weight: 400;
|
|
1023
1031
|
}
|
|
@@ -1623,8 +1631,12 @@
|
|
|
1623
1631
|
background-color: var(--color-outline-variant);
|
|
1624
1632
|
}
|
|
1625
1633
|
|
|
1626
|
-
.musaex-
|
|
1627
|
-
box-shadow: 0 0 0 var(--musaex-1035pbm) var(--color-primary);
|
|
1634
|
+
.musaex-8pombj:focus-within {
|
|
1635
|
+
box-shadow: 0 0 0 var(--musaex-1035pbm) var(--color-primary) inset;
|
|
1636
|
+
}
|
|
1637
|
+
|
|
1638
|
+
.musaex-4v1e0s:not(#\#), .musaex-yttm51:focus-within:not(#\#) {
|
|
1639
|
+
box-shadow: none;
|
|
1628
1640
|
}
|
|
1629
1641
|
|
|
1630
1642
|
.musaex-x7gz8e:not(:last-of-type):after {
|
|
@@ -1635,6 +1647,10 @@
|
|
|
1635
1647
|
display: none;
|
|
1636
1648
|
}
|
|
1637
1649
|
|
|
1650
|
+
.musaex-19h0how:not(#\#) {
|
|
1651
|
+
font-size: var(--musaex-zv0eff);
|
|
1652
|
+
}
|
|
1653
|
+
|
|
1638
1654
|
.musaex-192i3sz:not(:last-of-type):after {
|
|
1639
1655
|
inset-inline-end: 0;
|
|
1640
1656
|
}
|
|
@@ -1729,6 +1745,10 @@
|
|
|
1729
1745
|
border-bottom-left-radius: var(--musaex-hio464);
|
|
1730
1746
|
}
|
|
1731
1747
|
|
|
1748
|
+
.musaex-yjjj70 {
|
|
1749
|
+
border-bottom-left-radius: var(--musaex-mw242b);
|
|
1750
|
+
}
|
|
1751
|
+
|
|
1732
1752
|
.musaex-ipjkct {
|
|
1733
1753
|
border-bottom-right-radius: var(--musaex-1035pbm);
|
|
1734
1754
|
}
|
|
@@ -1757,6 +1777,10 @@
|
|
|
1757
1777
|
border-top-left-radius: var(--musaex-1035pbm);
|
|
1758
1778
|
}
|
|
1759
1779
|
|
|
1780
|
+
.musaex-jizfy5 {
|
|
1781
|
+
border-top-left-radius: var(--musaex-mw242b);
|
|
1782
|
+
}
|
|
1783
|
+
|
|
1760
1784
|
.musaex-ebmt4n {
|
|
1761
1785
|
border-top-left-radius: var(--musaex-zv0eff);
|
|
1762
1786
|
}
|
|
@@ -2337,6 +2361,14 @@
|
|
|
2337
2361
|
border-bottom-color: var(--color-primary);
|
|
2338
2362
|
}
|
|
2339
2363
|
|
|
2364
|
+
.musaex-dsx2o5:not(#\#) {
|
|
2365
|
+
border-bottom-right-radius: var(--musaex-mw242b);
|
|
2366
|
+
}
|
|
2367
|
+
|
|
2368
|
+
.musaex-vt43hk:not(#\#) {
|
|
2369
|
+
border-top-right-radius: var(--musaex-mw242b);
|
|
2370
|
+
}
|
|
2371
|
+
|
|
2340
2372
|
.musaex-8l2ero:not(:last-of-type):after {
|
|
2341
2373
|
height: var(--musaex-qe7ci9);
|
|
2342
2374
|
}
|
package/dist/types/input.d.ts
CHANGED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { ReactNode } from "react";
|
|
2
|
+
/**
|
|
3
|
+
* `Search`组件属性入参
|
|
4
|
+
*/
|
|
5
|
+
export type SearchProps = {
|
|
6
|
+
/**
|
|
7
|
+
* 定制搜索按钮
|
|
8
|
+
* @default undefined
|
|
9
|
+
*/
|
|
10
|
+
searchButton?: ReactNode;
|
|
11
|
+
/**
|
|
12
|
+
* 用户点击搜索时的回调函数
|
|
13
|
+
* @default undefined
|
|
14
|
+
*/
|
|
15
|
+
onSearch?: (keyword?: string) => void;
|
|
16
|
+
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "musae",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.27-beta.1",
|
|
4
4
|
"description": "musae-ui",
|
|
5
5
|
"author": "tutu@fantufantu.com",
|
|
6
6
|
"license": "MIT",
|
|
@@ -82,9 +82,9 @@
|
|
|
82
82
|
"@rollup/plugin-commonjs": "^29.0.0",
|
|
83
83
|
"@rollup/plugin-node-resolve": "^16.0.3",
|
|
84
84
|
"@rollup/plugin-typescript": "^12.3.0",
|
|
85
|
-
"@storybook/addon-docs": "^10.2.
|
|
86
|
-
"@storybook/addon-onboarding": "^10.2.
|
|
87
|
-
"@storybook/react-vite": "^10.2.
|
|
85
|
+
"@storybook/addon-docs": "^10.2.17",
|
|
86
|
+
"@storybook/addon-onboarding": "^10.2.17",
|
|
87
|
+
"@storybook/react-vite": "^10.2.17",
|
|
88
88
|
"@stylexjs/babel-plugin": "^0.17.5",
|
|
89
89
|
"@stylexjs/rollup-plugin": "^0.17.5",
|
|
90
90
|
"@stylexjs/stylex": "^0.17.5",
|
|
@@ -99,13 +99,13 @@
|
|
|
99
99
|
"eslint": "^10.0.0",
|
|
100
100
|
"eslint-plugin-react": "^7.37.5",
|
|
101
101
|
"eslint-plugin-react-hooks": "^7.0.1",
|
|
102
|
-
"eslint-plugin-storybook": "^10.2.
|
|
102
|
+
"eslint-plugin-storybook": "^10.2.17",
|
|
103
103
|
"jest": "^30.2.0",
|
|
104
104
|
"jest-environment-jsdom": "^30.2.0",
|
|
105
105
|
"react": "^19.2.4",
|
|
106
106
|
"react-dom": "^19.2.4",
|
|
107
107
|
"rollup": "^4.57.1",
|
|
108
|
-
"storybook": "^10.2.
|
|
108
|
+
"storybook": "^10.2.17",
|
|
109
109
|
"typescript": "^5.9.3",
|
|
110
110
|
"typescript-eslint": "^8.55.0",
|
|
111
111
|
"zx": "^8.8.5"
|
|
@@ -131,7 +131,7 @@
|
|
|
131
131
|
"test": "jest",
|
|
132
132
|
"test:coverage": "jest --coverage",
|
|
133
133
|
"dev": "rollup -c -w --environment NODE_ENV:development",
|
|
134
|
-
"build": "rollup -c --environment NODE_ENV:production",
|
|
134
|
+
"build": "z rm dist && rollup -c --environment NODE_ENV:production",
|
|
135
135
|
"preinstall": "npx @aiszlab/watchdog preinstall",
|
|
136
136
|
"authors": "zx scripts/contributors.mjs",
|
|
137
137
|
"changesets": "z cs",
|