musae 1.0.27-beta.40 → 1.0.27-beta.41
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/action-sheet/__test__/index.test.d.ts +1 -0
- package/dist/components/action-sheet/action-sheet.cjs +168 -0
- package/dist/components/action-sheet/action-sheet.d.ts +10 -0
- package/dist/components/action-sheet/action-sheet.mjs +164 -0
- package/dist/components/action-sheet/context.cjs +19 -0
- package/dist/components/action-sheet/context.d.ts +15 -0
- package/dist/components/action-sheet/context.mjs +17 -0
- package/dist/components/action-sheet/index.cjs +8 -0
- package/dist/components/action-sheet/index.d.ts +4 -0
- package/dist/components/action-sheet/index.mjs +6 -0
- package/dist/components/action-sheet/notifier.cjs +142 -0
- package/dist/components/action-sheet/notifier.d.ts +17 -0
- package/dist/components/action-sheet/notifier.mjs +138 -0
- package/dist/components/button/styles.d.ts +6 -6
- package/dist/components/fab/fab.d.ts +1 -1
- package/dist/components/image/image.d.ts +1 -1
- package/dist/components/image/index.d.ts +1 -1
- package/dist/components/popper/dropdown.d.ts +1 -1
- package/dist/components/select/selector.d.ts +1 -1
- package/dist/components/theme/tokens.stylex.d.ts +2 -2
- package/dist/index.cjs +20 -18
- package/dist/index.d.ts +1 -0
- package/dist/index.mjs +1 -0
- package/dist/locale/locales/en_US.cjs +3 -0
- package/dist/locale/locales/en_US.mjs +3 -0
- package/dist/locale/locales/zh_CN.cjs +3 -0
- package/dist/locale/locales/zh_CN.mjs +3 -0
- package/dist/styles.css +16 -0
- package/dist/types/action-sheet.d.ts +74 -0
- package/dist/types/locale.d.ts +3 -0
- package/package.json +1 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import "@testing-library/jest-dom";
|
|
@@ -0,0 +1,168 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var _objectSpread = require('@babel/runtime/helpers/objectSpread2');
|
|
6
|
+
var _slicedToArray = require('@babel/runtime/helpers/slicedToArray');
|
|
7
|
+
var React = require('react');
|
|
8
|
+
var stylex = require('../../node_modules/.pnpm/@stylexjs_stylex@0.18.3/node_modules/@stylexjs/stylex/lib/es/stylex.cjs');
|
|
9
|
+
var className = require('@aiszlab/relax/class-name');
|
|
10
|
+
var relax = require('@aiszlab/relax');
|
|
11
|
+
var useClassNames = require('../../hooks/use-class-names.cjs');
|
|
12
|
+
var sheet = require('../sheet/sheet.cjs');
|
|
13
|
+
var useLocale = require('../../locale/use-locale.cjs');
|
|
14
|
+
var useThemeColorVars = require('../../hooks/use-theme-color-vars.cjs');
|
|
15
|
+
var theme = require('../theme/theme.cjs');
|
|
16
|
+
var context = require('./context.cjs');
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* @zh ActionSheet 专用样式:面板背景、拖拽手柄、操作项和取消按钮的样式。
|
|
20
|
+
* @en ActionSheet-specific styles: panel background, drag handle, action items and cancel button.
|
|
21
|
+
*/
|
|
22
|
+
var styles = {
|
|
23
|
+
title: {
|
|
24
|
+
kg3NbH: "musaex-1v4gb6w",
|
|
25
|
+
kLKAdn: "musaex-3nylsr",
|
|
26
|
+
k9WMMc: "musaex-2b8uid",
|
|
27
|
+
$$css: true
|
|
28
|
+
},
|
|
29
|
+
description: {
|
|
30
|
+
kg3NbH: "musaex-1v4gb6w",
|
|
31
|
+
kLKAdn: "musaex-3nylsr",
|
|
32
|
+
k9WMMc: "musaex-2b8uid",
|
|
33
|
+
$$css: true
|
|
34
|
+
},
|
|
35
|
+
actionText: {
|
|
36
|
+
k9WMMc: "musaex-2b8uid",
|
|
37
|
+
$$css: true
|
|
38
|
+
},
|
|
39
|
+
actionDesc: {
|
|
40
|
+
k9WMMc: "musaex-2b8uid",
|
|
41
|
+
keoZOQ: "musaex-1khtc51",
|
|
42
|
+
$$css: true
|
|
43
|
+
},
|
|
44
|
+
cancel: {
|
|
45
|
+
k1xSpc: "musaex-78zum5",
|
|
46
|
+
kGNEyG: "musaex-6s0dn4",
|
|
47
|
+
kjj79g: "musaex-l56j7k",
|
|
48
|
+
k8WAf4: "musaex-1aur8i7",
|
|
49
|
+
kg3NbH: "musaex-1v4gb6w",
|
|
50
|
+
kkrTdU: "musaex-1ypdohk",
|
|
51
|
+
kAzted: "musaex-qi4gqz",
|
|
52
|
+
kEafiO: "musaex-2k45e9",
|
|
53
|
+
kPef9Z: "musaex-13fuv20",
|
|
54
|
+
kVAM5u: "musaex-axmpxa",
|
|
55
|
+
keoZOQ: "musaex-1eodh35",
|
|
56
|
+
kfSwDN: "musaex-87ps6o",
|
|
57
|
+
$$css: true
|
|
58
|
+
}
|
|
59
|
+
};
|
|
60
|
+
/**
|
|
61
|
+
* @zh ActionSheet 组件。基于 Sheet 的移动端底部操作面板,
|
|
62
|
+
* 支持操作列表和二次确认场景,同时提供声明式和指令式 API。
|
|
63
|
+
* @en ActionSheet component. A mobile bottom action panel built on Sheet,
|
|
64
|
+
* supporting action lists and confirmation scenarios, with both declarative and imperative APIs.
|
|
65
|
+
*/
|
|
66
|
+
var ActionSheet = function ActionSheet(_ref) {
|
|
67
|
+
var open = _ref.open,
|
|
68
|
+
onClose = _ref.onClose,
|
|
69
|
+
actions = _ref.actions,
|
|
70
|
+
title = _ref.title,
|
|
71
|
+
description = _ref.description,
|
|
72
|
+
cancelText = _ref.cancelText,
|
|
73
|
+
height = _ref.height,
|
|
74
|
+
className$1 = _ref.className,
|
|
75
|
+
style = _ref.style;
|
|
76
|
+
var classNames = useClassNames.useClassNames(context.CLASS_NAMES);
|
|
77
|
+
var _useLocale = useLocale.useLocale("action-sheet"),
|
|
78
|
+
_useLocale2 = _slicedToArray(_useLocale, 1),
|
|
79
|
+
locale = _useLocale2[0];
|
|
80
|
+
var themeColorVars = useThemeColorVars.useThemeColorVars(["on-surface-variant", "surface-container", "outline-variant"]);
|
|
81
|
+
var styled = {
|
|
82
|
+
handle: {
|
|
83
|
+
className: "musaex-1po6ib musaex-rntz3j musaex-1xa9b2s musaex-9ip8r5 musaex-1eodh35 musaex-19i5tse musaex-vueqy4 musaex-2lah0s"
|
|
84
|
+
},
|
|
85
|
+
panel: {
|
|
86
|
+
className: "musaex-17o6occ musaex-zbxit7 musaex-1ei9pc5 musaex-15q9lfd"
|
|
87
|
+
},
|
|
88
|
+
header: {
|
|
89
|
+
className: "musaex-1b38e8b musaex-7gss4w"
|
|
90
|
+
},
|
|
91
|
+
title: stylex.props(styles.title, theme.$title.medium),
|
|
92
|
+
description: stylex.props(styles.description, theme.$body.medium),
|
|
93
|
+
actions: {
|
|
94
|
+
className: "musaex-ltmd5o"
|
|
95
|
+
},
|
|
96
|
+
action: {
|
|
97
|
+
className: "musaex-78zum5 musaex-dt5ytf musaex-6s0dn4 musaex-l56j7k musaex-1aur8i7 musaex-1v4gb6w musaex-1ypdohk musaex-qi4gqz musaex-uvson1 musaex-13fuv20 musaex-axmpxa musaex-87ps6o"
|
|
98
|
+
},
|
|
99
|
+
actionText: stylex.props(styles.actionText, theme.$body.large),
|
|
100
|
+
actionDesc: stylex.props(styles.actionDesc, theme.$body.small),
|
|
101
|
+
cancel: stylex.props(styles.cancel, theme.$label.large)
|
|
102
|
+
};
|
|
103
|
+
/**
|
|
104
|
+
* @zh 处理操作项点击:先执行回调,再关闭面板。
|
|
105
|
+
* @en Handle action click: execute callback first, then close the panel.
|
|
106
|
+
*/
|
|
107
|
+
var handleAction = relax.useEvent(function (action) {
|
|
108
|
+
try {
|
|
109
|
+
var _action$onClick;
|
|
110
|
+
(_action$onClick = action.onClick) === null || _action$onClick === void 0 || _action$onClick.call(action);
|
|
111
|
+
} catch (_unused) {
|
|
112
|
+
// noop — close the panel regardless of onClick result
|
|
113
|
+
} finally {
|
|
114
|
+
onClose();
|
|
115
|
+
}
|
|
116
|
+
});
|
|
117
|
+
/**
|
|
118
|
+
* @zh 头部区域:拖拽手柄 + 标题 + 描述。
|
|
119
|
+
* @en Header area: drag handle + title + description.
|
|
120
|
+
*/
|
|
121
|
+
var header = /*#__PURE__*/React.createElement("div", {
|
|
122
|
+
className: className.stringify(classNames.header, styled.header.className),
|
|
123
|
+
style: styled.header.style
|
|
124
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
125
|
+
className: className.stringify(styled.handle.className),
|
|
126
|
+
style: _objectSpread(_objectSpread({}, styled.handle.style), themeColorVars)
|
|
127
|
+
}), !!title && (/*#__PURE__*/React.createElement("div", {
|
|
128
|
+
className: className.stringify(classNames.title, styled.title.className),
|
|
129
|
+
style: styled.title.style
|
|
130
|
+
}, title)), !!description && (/*#__PURE__*/React.createElement("div", {
|
|
131
|
+
className: className.stringify(classNames.description, styled.description.className),
|
|
132
|
+
style: styled.description.style
|
|
133
|
+
}, description)));
|
|
134
|
+
return /*#__PURE__*/React.createElement(sheet.default, {
|
|
135
|
+
visible: open,
|
|
136
|
+
placement: "bottom",
|
|
137
|
+
size: height !== null && height !== void 0 ? height : "fit-content",
|
|
138
|
+
onClose: onClose,
|
|
139
|
+
header: header,
|
|
140
|
+
className: className.stringify(classNames.sheet, className$1),
|
|
141
|
+
panelClassName: styled.panel.className,
|
|
142
|
+
panelStyle: _objectSpread(_objectSpread(_objectSpread({}, styled.panel.style), themeColorVars), style)
|
|
143
|
+
}, actions.length > 0 && (/*#__PURE__*/React.createElement("div", {
|
|
144
|
+
className: className.stringify(classNames.actions, styled.actions.className),
|
|
145
|
+
style: styled.actions.style
|
|
146
|
+
}, actions.map(function (action) {
|
|
147
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
148
|
+
key: action.key,
|
|
149
|
+
className: className.stringify(classNames.action, styled.action.className),
|
|
150
|
+
style: styled.action.style,
|
|
151
|
+
onClick: function onClick() {
|
|
152
|
+
return handleAction(action);
|
|
153
|
+
}
|
|
154
|
+
}, /*#__PURE__*/React.createElement("span", {
|
|
155
|
+
className: className.stringify(classNames.actionText, styled.actionText.className),
|
|
156
|
+
style: styled.actionText.style
|
|
157
|
+
}, action.text), !!action.description && (/*#__PURE__*/React.createElement("span", {
|
|
158
|
+
className: className.stringify(classNames.actionDesc, styled.actionDesc.className),
|
|
159
|
+
style: styled.actionDesc.style
|
|
160
|
+
}, action.description)));
|
|
161
|
+
}))), /*#__PURE__*/React.createElement("div", {
|
|
162
|
+
className: className.stringify(classNames.cancel, styled.cancel.className),
|
|
163
|
+
style: styled.cancel.style,
|
|
164
|
+
onClick: onClose
|
|
165
|
+
}, cancelText !== null && cancelText !== void 0 ? cancelText : locale.cancel));
|
|
166
|
+
};
|
|
167
|
+
|
|
168
|
+
exports.default = ActionSheet;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import type { ActionSheetProps } from "../../types/action-sheet";
|
|
3
|
+
/**
|
|
4
|
+
* @zh ActionSheet 组件。基于 Sheet 的移动端底部操作面板,
|
|
5
|
+
* 支持操作列表和二次确认场景,同时提供声明式和指令式 API。
|
|
6
|
+
* @en ActionSheet component. A mobile bottom action panel built on Sheet,
|
|
7
|
+
* supporting action lists and confirmation scenarios, with both declarative and imperative APIs.
|
|
8
|
+
*/
|
|
9
|
+
declare const ActionSheet: ({ open, onClose, actions, title, description, cancelText, height, className, style, }: ActionSheetProps) => React.JSX.Element;
|
|
10
|
+
export default ActionSheet;
|
|
@@ -0,0 +1,164 @@
|
|
|
1
|
+
import _objectSpread from '@babel/runtime/helpers/objectSpread2';
|
|
2
|
+
import _slicedToArray from '@babel/runtime/helpers/slicedToArray';
|
|
3
|
+
import React from 'react';
|
|
4
|
+
import { props } from '../../node_modules/.pnpm/@stylexjs_stylex@0.18.3/node_modules/@stylexjs/stylex/lib/es/stylex.mjs';
|
|
5
|
+
import { stringify } from '@aiszlab/relax/class-name';
|
|
6
|
+
import { useEvent } from '@aiszlab/relax';
|
|
7
|
+
import { useClassNames } from '../../hooks/use-class-names.mjs';
|
|
8
|
+
import Sheet from '../sheet/sheet.mjs';
|
|
9
|
+
import { useLocale } from '../../locale/use-locale.mjs';
|
|
10
|
+
import { useThemeColorVars } from '../../hooks/use-theme-color-vars.mjs';
|
|
11
|
+
import { $label, $body, $title } from '../theme/theme.mjs';
|
|
12
|
+
import { CLASS_NAMES } from './context.mjs';
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* @zh ActionSheet 专用样式:面板背景、拖拽手柄、操作项和取消按钮的样式。
|
|
16
|
+
* @en ActionSheet-specific styles: panel background, drag handle, action items and cancel button.
|
|
17
|
+
*/
|
|
18
|
+
var styles = {
|
|
19
|
+
title: {
|
|
20
|
+
kg3NbH: "musaex-1v4gb6w",
|
|
21
|
+
kLKAdn: "musaex-3nylsr",
|
|
22
|
+
k9WMMc: "musaex-2b8uid",
|
|
23
|
+
$$css: true
|
|
24
|
+
},
|
|
25
|
+
description: {
|
|
26
|
+
kg3NbH: "musaex-1v4gb6w",
|
|
27
|
+
kLKAdn: "musaex-3nylsr",
|
|
28
|
+
k9WMMc: "musaex-2b8uid",
|
|
29
|
+
$$css: true
|
|
30
|
+
},
|
|
31
|
+
actionText: {
|
|
32
|
+
k9WMMc: "musaex-2b8uid",
|
|
33
|
+
$$css: true
|
|
34
|
+
},
|
|
35
|
+
actionDesc: {
|
|
36
|
+
k9WMMc: "musaex-2b8uid",
|
|
37
|
+
keoZOQ: "musaex-1khtc51",
|
|
38
|
+
$$css: true
|
|
39
|
+
},
|
|
40
|
+
cancel: {
|
|
41
|
+
k1xSpc: "musaex-78zum5",
|
|
42
|
+
kGNEyG: "musaex-6s0dn4",
|
|
43
|
+
kjj79g: "musaex-l56j7k",
|
|
44
|
+
k8WAf4: "musaex-1aur8i7",
|
|
45
|
+
kg3NbH: "musaex-1v4gb6w",
|
|
46
|
+
kkrTdU: "musaex-1ypdohk",
|
|
47
|
+
kAzted: "musaex-qi4gqz",
|
|
48
|
+
kEafiO: "musaex-2k45e9",
|
|
49
|
+
kPef9Z: "musaex-13fuv20",
|
|
50
|
+
kVAM5u: "musaex-axmpxa",
|
|
51
|
+
keoZOQ: "musaex-1eodh35",
|
|
52
|
+
kfSwDN: "musaex-87ps6o",
|
|
53
|
+
$$css: true
|
|
54
|
+
}
|
|
55
|
+
};
|
|
56
|
+
/**
|
|
57
|
+
* @zh ActionSheet 组件。基于 Sheet 的移动端底部操作面板,
|
|
58
|
+
* 支持操作列表和二次确认场景,同时提供声明式和指令式 API。
|
|
59
|
+
* @en ActionSheet component. A mobile bottom action panel built on Sheet,
|
|
60
|
+
* supporting action lists and confirmation scenarios, with both declarative and imperative APIs.
|
|
61
|
+
*/
|
|
62
|
+
var ActionSheet = function ActionSheet(_ref) {
|
|
63
|
+
var open = _ref.open,
|
|
64
|
+
onClose = _ref.onClose,
|
|
65
|
+
actions = _ref.actions,
|
|
66
|
+
title = _ref.title,
|
|
67
|
+
description = _ref.description,
|
|
68
|
+
cancelText = _ref.cancelText,
|
|
69
|
+
height = _ref.height,
|
|
70
|
+
className = _ref.className,
|
|
71
|
+
style = _ref.style;
|
|
72
|
+
var classNames = useClassNames(CLASS_NAMES);
|
|
73
|
+
var _useLocale = useLocale("action-sheet"),
|
|
74
|
+
_useLocale2 = _slicedToArray(_useLocale, 1),
|
|
75
|
+
locale = _useLocale2[0];
|
|
76
|
+
var themeColorVars = useThemeColorVars(["on-surface-variant", "surface-container", "outline-variant"]);
|
|
77
|
+
var styled = {
|
|
78
|
+
handle: {
|
|
79
|
+
className: "musaex-1po6ib musaex-rntz3j musaex-1xa9b2s musaex-9ip8r5 musaex-1eodh35 musaex-19i5tse musaex-vueqy4 musaex-2lah0s"
|
|
80
|
+
},
|
|
81
|
+
panel: {
|
|
82
|
+
className: "musaex-17o6occ musaex-zbxit7 musaex-1ei9pc5 musaex-15q9lfd"
|
|
83
|
+
},
|
|
84
|
+
header: {
|
|
85
|
+
className: "musaex-1b38e8b musaex-7gss4w"
|
|
86
|
+
},
|
|
87
|
+
title: props(styles.title, $title.medium),
|
|
88
|
+
description: props(styles.description, $body.medium),
|
|
89
|
+
actions: {
|
|
90
|
+
className: "musaex-ltmd5o"
|
|
91
|
+
},
|
|
92
|
+
action: {
|
|
93
|
+
className: "musaex-78zum5 musaex-dt5ytf musaex-6s0dn4 musaex-l56j7k musaex-1aur8i7 musaex-1v4gb6w musaex-1ypdohk musaex-qi4gqz musaex-uvson1 musaex-13fuv20 musaex-axmpxa musaex-87ps6o"
|
|
94
|
+
},
|
|
95
|
+
actionText: props(styles.actionText, $body.large),
|
|
96
|
+
actionDesc: props(styles.actionDesc, $body.small),
|
|
97
|
+
cancel: props(styles.cancel, $label.large)
|
|
98
|
+
};
|
|
99
|
+
/**
|
|
100
|
+
* @zh 处理操作项点击:先执行回调,再关闭面板。
|
|
101
|
+
* @en Handle action click: execute callback first, then close the panel.
|
|
102
|
+
*/
|
|
103
|
+
var handleAction = useEvent(function (action) {
|
|
104
|
+
try {
|
|
105
|
+
var _action$onClick;
|
|
106
|
+
(_action$onClick = action.onClick) === null || _action$onClick === void 0 || _action$onClick.call(action);
|
|
107
|
+
} catch (_unused) {
|
|
108
|
+
// noop — close the panel regardless of onClick result
|
|
109
|
+
} finally {
|
|
110
|
+
onClose();
|
|
111
|
+
}
|
|
112
|
+
});
|
|
113
|
+
/**
|
|
114
|
+
* @zh 头部区域:拖拽手柄 + 标题 + 描述。
|
|
115
|
+
* @en Header area: drag handle + title + description.
|
|
116
|
+
*/
|
|
117
|
+
var header = /*#__PURE__*/React.createElement("div", {
|
|
118
|
+
className: stringify(classNames.header, styled.header.className),
|
|
119
|
+
style: styled.header.style
|
|
120
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
121
|
+
className: stringify(styled.handle.className),
|
|
122
|
+
style: _objectSpread(_objectSpread({}, styled.handle.style), themeColorVars)
|
|
123
|
+
}), !!title && (/*#__PURE__*/React.createElement("div", {
|
|
124
|
+
className: stringify(classNames.title, styled.title.className),
|
|
125
|
+
style: styled.title.style
|
|
126
|
+
}, title)), !!description && (/*#__PURE__*/React.createElement("div", {
|
|
127
|
+
className: stringify(classNames.description, styled.description.className),
|
|
128
|
+
style: styled.description.style
|
|
129
|
+
}, description)));
|
|
130
|
+
return /*#__PURE__*/React.createElement(Sheet, {
|
|
131
|
+
visible: open,
|
|
132
|
+
placement: "bottom",
|
|
133
|
+
size: height !== null && height !== void 0 ? height : "fit-content",
|
|
134
|
+
onClose: onClose,
|
|
135
|
+
header: header,
|
|
136
|
+
className: stringify(classNames.sheet, className),
|
|
137
|
+
panelClassName: styled.panel.className,
|
|
138
|
+
panelStyle: _objectSpread(_objectSpread(_objectSpread({}, styled.panel.style), themeColorVars), style)
|
|
139
|
+
}, actions.length > 0 && (/*#__PURE__*/React.createElement("div", {
|
|
140
|
+
className: stringify(classNames.actions, styled.actions.className),
|
|
141
|
+
style: styled.actions.style
|
|
142
|
+
}, actions.map(function (action) {
|
|
143
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
144
|
+
key: action.key,
|
|
145
|
+
className: stringify(classNames.action, styled.action.className),
|
|
146
|
+
style: styled.action.style,
|
|
147
|
+
onClick: function onClick() {
|
|
148
|
+
return handleAction(action);
|
|
149
|
+
}
|
|
150
|
+
}, /*#__PURE__*/React.createElement("span", {
|
|
151
|
+
className: stringify(classNames.actionText, styled.actionText.className),
|
|
152
|
+
style: styled.actionText.style
|
|
153
|
+
}, action.text), !!action.description && (/*#__PURE__*/React.createElement("span", {
|
|
154
|
+
className: stringify(classNames.actionDesc, styled.actionDesc.className),
|
|
155
|
+
style: styled.actionDesc.style
|
|
156
|
+
}, action.description)));
|
|
157
|
+
}))), /*#__PURE__*/React.createElement("div", {
|
|
158
|
+
className: stringify(classNames.cancel, styled.cancel.className),
|
|
159
|
+
style: styled.cancel.style,
|
|
160
|
+
onClick: onClose
|
|
161
|
+
}, cancelText !== null && cancelText !== void 0 ? cancelText : locale.cancel));
|
|
162
|
+
};
|
|
163
|
+
|
|
164
|
+
export { ActionSheet as default };
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* @zh ActionSheet 的 BEM class 名称
|
|
5
|
+
* @en BEM class names for ActionSheet
|
|
6
|
+
*/
|
|
7
|
+
var CLASS_NAMES = {
|
|
8
|
+
sheet: "action-sheet",
|
|
9
|
+
header: "action-sheet__header",
|
|
10
|
+
title: "action-sheet__title",
|
|
11
|
+
description: "action-sheet__description",
|
|
12
|
+
actions: "action-sheet__actions",
|
|
13
|
+
action: "action-sheet__action",
|
|
14
|
+
actionText: "action-sheet__action-text",
|
|
15
|
+
actionDesc: "action-sheet__action-desc",
|
|
16
|
+
cancel: "action-sheet__cancel"
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
exports.CLASS_NAMES = CLASS_NAMES;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @zh ActionSheet 的 BEM class 名称
|
|
3
|
+
* @en BEM class names for ActionSheet
|
|
4
|
+
*/
|
|
5
|
+
export declare const CLASS_NAMES: {
|
|
6
|
+
readonly sheet: "action-sheet";
|
|
7
|
+
readonly header: "action-sheet__header";
|
|
8
|
+
readonly title: "action-sheet__title";
|
|
9
|
+
readonly description: "action-sheet__description";
|
|
10
|
+
readonly actions: "action-sheet__actions";
|
|
11
|
+
readonly action: "action-sheet__action";
|
|
12
|
+
readonly actionText: "action-sheet__action-text";
|
|
13
|
+
readonly actionDesc: "action-sheet__action-desc";
|
|
14
|
+
readonly cancel: "action-sheet__cancel";
|
|
15
|
+
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @zh ActionSheet 的 BEM class 名称
|
|
3
|
+
* @en BEM class names for ActionSheet
|
|
4
|
+
*/
|
|
5
|
+
var CLASS_NAMES = {
|
|
6
|
+
sheet: "action-sheet",
|
|
7
|
+
header: "action-sheet__header",
|
|
8
|
+
title: "action-sheet__title",
|
|
9
|
+
description: "action-sheet__description",
|
|
10
|
+
actions: "action-sheet__actions",
|
|
11
|
+
action: "action-sheet__action",
|
|
12
|
+
actionText: "action-sheet__action-text",
|
|
13
|
+
actionDesc: "action-sheet__action-desc",
|
|
14
|
+
cancel: "action-sheet__cancel"
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
export { CLASS_NAMES };
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
declare const ActionSheetWithApi: (({ open, onClose, actions, title, description, cancelText, height, className, style, }: import("../../types/action-sheet").ActionSheetProps) => import("react").JSX.Element) & {
|
|
2
|
+
show: (config: import("../../types/action-sheet").ActionSheetShowConfig) => Promise<void>;
|
|
3
|
+
};
|
|
4
|
+
export { ActionSheetWithApi as ActionSheet };
|
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var _classCallCheck = require('@babel/runtime/helpers/classCallCheck');
|
|
6
|
+
var _createClass = require('@babel/runtime/helpers/createClass');
|
|
7
|
+
var _classPrivateMethodInitSpec = require('@babel/runtime/helpers/classPrivateMethodInitSpec');
|
|
8
|
+
var _classPrivateFieldInitSpec = require('@babel/runtime/helpers/classPrivateFieldInitSpec');
|
|
9
|
+
var _assertClassBrand = require('@babel/runtime/helpers/assertClassBrand');
|
|
10
|
+
var _classPrivateFieldSet = require('@babel/runtime/helpers/classPrivateFieldSet2');
|
|
11
|
+
var _classPrivateFieldGet = require('@babel/runtime/helpers/classPrivateFieldGet2');
|
|
12
|
+
var _objectSpread = require('@babel/runtime/helpers/objectSpread2');
|
|
13
|
+
var _slicedToArray = require('@babel/runtime/helpers/slicedToArray');
|
|
14
|
+
var React = require('react');
|
|
15
|
+
var client = require('react-dom/client');
|
|
16
|
+
var actionSheet = require('./action-sheet.cjs');
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* @zh 指令式 API 的内部 Holder 组件。
|
|
20
|
+
* 管理 open 状态,在退出动画完成后清理 root 并 resolve Promise。
|
|
21
|
+
* @en Internal Holder component for the imperative API.
|
|
22
|
+
* Manages open state, cleans up root and resolves Promise after exit animation.
|
|
23
|
+
*/
|
|
24
|
+
var ActionSheetHolder = function ActionSheetHolder(_ref) {
|
|
25
|
+
var config = _ref.config,
|
|
26
|
+
onResolve = _ref.onResolve;
|
|
27
|
+
var _useState = React.useState(true),
|
|
28
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
29
|
+
open = _useState2[0],
|
|
30
|
+
setOpen = _useState2[1];
|
|
31
|
+
/**
|
|
32
|
+
* @zh 关闭面板:设置 open=false 触发退出动画,
|
|
33
|
+
* 等待动画完成后调用 onResolve 清理 root。
|
|
34
|
+
* @en Close the panel: set open=false to trigger exit animation,
|
|
35
|
+
* wait for animation to complete then call onResolve to cleanup root.
|
|
36
|
+
*/
|
|
37
|
+
var handleClose = React.useCallback(function () {
|
|
38
|
+
setOpen(false);
|
|
39
|
+
setTimeout(function () {
|
|
40
|
+
onResolve();
|
|
41
|
+
}, 350);
|
|
42
|
+
}, [onResolve]);
|
|
43
|
+
return /*#__PURE__*/React.createElement(actionSheet.default, _objectSpread({
|
|
44
|
+
open: open,
|
|
45
|
+
onClose: handleClose
|
|
46
|
+
}, config));
|
|
47
|
+
};
|
|
48
|
+
/**
|
|
49
|
+
* @zh ActionSheet 指令式 API 的 Notifier 单例。
|
|
50
|
+
* 每次调用 show() 创建新的 React root,返回在面板关闭后 resolve 的 Promise。
|
|
51
|
+
* 如果重复调用 show(),会先清理旧面板(旧 Promise 立即 resolve)。
|
|
52
|
+
* @en Notifier singleton for the ActionSheet imperative API.
|
|
53
|
+
* Each show() call creates a new React root and returns a Promise that resolves after panel closes.
|
|
54
|
+
* If show() is called again while a panel is open, the old panel is cleaned up (old Promise resolves immediately).
|
|
55
|
+
*/
|
|
56
|
+
var _root = /*#__PURE__*/new WeakMap();
|
|
57
|
+
var _cleanup = /*#__PURE__*/new WeakMap();
|
|
58
|
+
var _ActionSheetNotifier_brand = /*#__PURE__*/new WeakSet();
|
|
59
|
+
var ActionSheetNotifier = /*#__PURE__*/function () {
|
|
60
|
+
function ActionSheetNotifier() {
|
|
61
|
+
_classCallCheck(this, ActionSheetNotifier);
|
|
62
|
+
/**
|
|
63
|
+
* @zh 清理当前面板(如果有)。
|
|
64
|
+
* @en Clean up the current panel if exists.
|
|
65
|
+
*/
|
|
66
|
+
_classPrivateMethodInitSpec(this, _ActionSheetNotifier_brand);
|
|
67
|
+
_classPrivateFieldInitSpec(this, _root, null);
|
|
68
|
+
_classPrivateFieldInitSpec(this, _cleanup, null);
|
|
69
|
+
if (_instance._) {
|
|
70
|
+
return _instance._;
|
|
71
|
+
}
|
|
72
|
+
_instance._ = this;
|
|
73
|
+
}
|
|
74
|
+
return _createClass(ActionSheetNotifier, [{
|
|
75
|
+
key: "show",
|
|
76
|
+
value:
|
|
77
|
+
/**
|
|
78
|
+
* @zh 显示 ActionSheet。返回的 Promise 在面板关闭动画完成后 resolve。
|
|
79
|
+
* 如果当前已有面板显示,会先清理旧面板再显示新的。
|
|
80
|
+
* @en Show the ActionSheet. Returns a Promise that resolves after the close animation completes.
|
|
81
|
+
* If a panel is already showing, it will be cleaned up before showing the new one.
|
|
82
|
+
*/
|
|
83
|
+
function show(config) {
|
|
84
|
+
var _this = this;
|
|
85
|
+
_assertClassBrand(_ActionSheetNotifier_brand, this, _disposeCurrent).call(this);
|
|
86
|
+
return new Promise(function (resolve) {
|
|
87
|
+
var fragment = document.createDocumentFragment();
|
|
88
|
+
var root = client.createRoot(fragment);
|
|
89
|
+
_classPrivateFieldSet(_root, _this, root);
|
|
90
|
+
var cleanup = function cleanup() {
|
|
91
|
+
_classPrivateFieldSet(_root, _this, null);
|
|
92
|
+
_classPrivateFieldSet(_cleanup, _this, null);
|
|
93
|
+
root.unmount();
|
|
94
|
+
resolve();
|
|
95
|
+
};
|
|
96
|
+
_classPrivateFieldSet(_cleanup, _this, function () {
|
|
97
|
+
_classPrivateFieldSet(_root, _this, null);
|
|
98
|
+
_classPrivateFieldSet(_cleanup, _this, null);
|
|
99
|
+
root.unmount();
|
|
100
|
+
resolve();
|
|
101
|
+
});
|
|
102
|
+
root.render(/*#__PURE__*/React.createElement(ActionSheetHolder, {
|
|
103
|
+
config: config,
|
|
104
|
+
onResolve: cleanup
|
|
105
|
+
}));
|
|
106
|
+
});
|
|
107
|
+
}
|
|
108
|
+
}]);
|
|
109
|
+
}();
|
|
110
|
+
function _disposeCurrent() {
|
|
111
|
+
if (_classPrivateFieldGet(_cleanup, this)) {
|
|
112
|
+
_classPrivateFieldGet(_cleanup, this).call(this);
|
|
113
|
+
_classPrivateFieldSet(_cleanup, this, null);
|
|
114
|
+
}
|
|
115
|
+
if (_classPrivateFieldGet(_root, this)) {
|
|
116
|
+
_classPrivateFieldGet(_root, this).unmount();
|
|
117
|
+
_classPrivateFieldSet(_root, this, null);
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
var _instance = {
|
|
121
|
+
_: null
|
|
122
|
+
};
|
|
123
|
+
var notifier = new ActionSheetNotifier();
|
|
124
|
+
/**
|
|
125
|
+
* @zh ActionSheet 的指令式 API。
|
|
126
|
+
* 调用 `ActionSheet.show(config)` 显示操作面板,返回 Promise。
|
|
127
|
+
* @en ActionSheet imperative API.
|
|
128
|
+
* Call `ActionSheet.show(config)` to display the action panel, returns a Promise.
|
|
129
|
+
*/
|
|
130
|
+
var ActionSheetApi = {
|
|
131
|
+
/**
|
|
132
|
+
* @zh 显示 ActionSheet 操作面板。
|
|
133
|
+
* 返回 Promise,在面板关闭动画完成后 resolve。
|
|
134
|
+
* @en Show the ActionSheet panel.
|
|
135
|
+
* Returns a Promise that resolves after the close animation completes.
|
|
136
|
+
*/
|
|
137
|
+
show: function show(config) {
|
|
138
|
+
return notifier.show(config);
|
|
139
|
+
}
|
|
140
|
+
};
|
|
141
|
+
|
|
142
|
+
exports.default = ActionSheetApi;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { ActionSheetShowConfig } from "../../types/action-sheet";
|
|
2
|
+
/**
|
|
3
|
+
* @zh ActionSheet 的指令式 API。
|
|
4
|
+
* 调用 `ActionSheet.show(config)` 显示操作面板,返回 Promise。
|
|
5
|
+
* @en ActionSheet imperative API.
|
|
6
|
+
* Call `ActionSheet.show(config)` to display the action panel, returns a Promise.
|
|
7
|
+
*/
|
|
8
|
+
declare const ActionSheetApi: {
|
|
9
|
+
/**
|
|
10
|
+
* @zh 显示 ActionSheet 操作面板。
|
|
11
|
+
* 返回 Promise,在面板关闭动画完成后 resolve。
|
|
12
|
+
* @en Show the ActionSheet panel.
|
|
13
|
+
* Returns a Promise that resolves after the close animation completes.
|
|
14
|
+
*/
|
|
15
|
+
show: (config: ActionSheetShowConfig) => Promise<void>;
|
|
16
|
+
};
|
|
17
|
+
export default ActionSheetApi;
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
import _classCallCheck from '@babel/runtime/helpers/classCallCheck';
|
|
2
|
+
import _createClass from '@babel/runtime/helpers/createClass';
|
|
3
|
+
import _classPrivateMethodInitSpec from '@babel/runtime/helpers/classPrivateMethodInitSpec';
|
|
4
|
+
import _classPrivateFieldInitSpec from '@babel/runtime/helpers/classPrivateFieldInitSpec';
|
|
5
|
+
import _assertClassBrand from '@babel/runtime/helpers/assertClassBrand';
|
|
6
|
+
import _classPrivateFieldSet from '@babel/runtime/helpers/classPrivateFieldSet2';
|
|
7
|
+
import _classPrivateFieldGet from '@babel/runtime/helpers/classPrivateFieldGet2';
|
|
8
|
+
import _objectSpread from '@babel/runtime/helpers/objectSpread2';
|
|
9
|
+
import _slicedToArray from '@babel/runtime/helpers/slicedToArray';
|
|
10
|
+
import React, { useState, useCallback } from 'react';
|
|
11
|
+
import { createRoot } from 'react-dom/client';
|
|
12
|
+
import ActionSheet from './action-sheet.mjs';
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* @zh 指令式 API 的内部 Holder 组件。
|
|
16
|
+
* 管理 open 状态,在退出动画完成后清理 root 并 resolve Promise。
|
|
17
|
+
* @en Internal Holder component for the imperative API.
|
|
18
|
+
* Manages open state, cleans up root and resolves Promise after exit animation.
|
|
19
|
+
*/
|
|
20
|
+
var ActionSheetHolder = function ActionSheetHolder(_ref) {
|
|
21
|
+
var config = _ref.config,
|
|
22
|
+
onResolve = _ref.onResolve;
|
|
23
|
+
var _useState = useState(true),
|
|
24
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
25
|
+
open = _useState2[0],
|
|
26
|
+
setOpen = _useState2[1];
|
|
27
|
+
/**
|
|
28
|
+
* @zh 关闭面板:设置 open=false 触发退出动画,
|
|
29
|
+
* 等待动画完成后调用 onResolve 清理 root。
|
|
30
|
+
* @en Close the panel: set open=false to trigger exit animation,
|
|
31
|
+
* wait for animation to complete then call onResolve to cleanup root.
|
|
32
|
+
*/
|
|
33
|
+
var handleClose = useCallback(function () {
|
|
34
|
+
setOpen(false);
|
|
35
|
+
setTimeout(function () {
|
|
36
|
+
onResolve();
|
|
37
|
+
}, 350);
|
|
38
|
+
}, [onResolve]);
|
|
39
|
+
return /*#__PURE__*/React.createElement(ActionSheet, _objectSpread({
|
|
40
|
+
open: open,
|
|
41
|
+
onClose: handleClose
|
|
42
|
+
}, config));
|
|
43
|
+
};
|
|
44
|
+
/**
|
|
45
|
+
* @zh ActionSheet 指令式 API 的 Notifier 单例。
|
|
46
|
+
* 每次调用 show() 创建新的 React root,返回在面板关闭后 resolve 的 Promise。
|
|
47
|
+
* 如果重复调用 show(),会先清理旧面板(旧 Promise 立即 resolve)。
|
|
48
|
+
* @en Notifier singleton for the ActionSheet imperative API.
|
|
49
|
+
* Each show() call creates a new React root and returns a Promise that resolves after panel closes.
|
|
50
|
+
* If show() is called again while a panel is open, the old panel is cleaned up (old Promise resolves immediately).
|
|
51
|
+
*/
|
|
52
|
+
var _root = /*#__PURE__*/new WeakMap();
|
|
53
|
+
var _cleanup = /*#__PURE__*/new WeakMap();
|
|
54
|
+
var _ActionSheetNotifier_brand = /*#__PURE__*/new WeakSet();
|
|
55
|
+
var ActionSheetNotifier = /*#__PURE__*/function () {
|
|
56
|
+
function ActionSheetNotifier() {
|
|
57
|
+
_classCallCheck(this, ActionSheetNotifier);
|
|
58
|
+
/**
|
|
59
|
+
* @zh 清理当前面板(如果有)。
|
|
60
|
+
* @en Clean up the current panel if exists.
|
|
61
|
+
*/
|
|
62
|
+
_classPrivateMethodInitSpec(this, _ActionSheetNotifier_brand);
|
|
63
|
+
_classPrivateFieldInitSpec(this, _root, null);
|
|
64
|
+
_classPrivateFieldInitSpec(this, _cleanup, null);
|
|
65
|
+
if (_instance._) {
|
|
66
|
+
return _instance._;
|
|
67
|
+
}
|
|
68
|
+
_instance._ = this;
|
|
69
|
+
}
|
|
70
|
+
return _createClass(ActionSheetNotifier, [{
|
|
71
|
+
key: "show",
|
|
72
|
+
value:
|
|
73
|
+
/**
|
|
74
|
+
* @zh 显示 ActionSheet。返回的 Promise 在面板关闭动画完成后 resolve。
|
|
75
|
+
* 如果当前已有面板显示,会先清理旧面板再显示新的。
|
|
76
|
+
* @en Show the ActionSheet. Returns a Promise that resolves after the close animation completes.
|
|
77
|
+
* If a panel is already showing, it will be cleaned up before showing the new one.
|
|
78
|
+
*/
|
|
79
|
+
function show(config) {
|
|
80
|
+
var _this = this;
|
|
81
|
+
_assertClassBrand(_ActionSheetNotifier_brand, this, _disposeCurrent).call(this);
|
|
82
|
+
return new Promise(function (resolve) {
|
|
83
|
+
var fragment = document.createDocumentFragment();
|
|
84
|
+
var root = createRoot(fragment);
|
|
85
|
+
_classPrivateFieldSet(_root, _this, root);
|
|
86
|
+
var cleanup = function cleanup() {
|
|
87
|
+
_classPrivateFieldSet(_root, _this, null);
|
|
88
|
+
_classPrivateFieldSet(_cleanup, _this, null);
|
|
89
|
+
root.unmount();
|
|
90
|
+
resolve();
|
|
91
|
+
};
|
|
92
|
+
_classPrivateFieldSet(_cleanup, _this, function () {
|
|
93
|
+
_classPrivateFieldSet(_root, _this, null);
|
|
94
|
+
_classPrivateFieldSet(_cleanup, _this, null);
|
|
95
|
+
root.unmount();
|
|
96
|
+
resolve();
|
|
97
|
+
});
|
|
98
|
+
root.render(/*#__PURE__*/React.createElement(ActionSheetHolder, {
|
|
99
|
+
config: config,
|
|
100
|
+
onResolve: cleanup
|
|
101
|
+
}));
|
|
102
|
+
});
|
|
103
|
+
}
|
|
104
|
+
}]);
|
|
105
|
+
}();
|
|
106
|
+
function _disposeCurrent() {
|
|
107
|
+
if (_classPrivateFieldGet(_cleanup, this)) {
|
|
108
|
+
_classPrivateFieldGet(_cleanup, this).call(this);
|
|
109
|
+
_classPrivateFieldSet(_cleanup, this, null);
|
|
110
|
+
}
|
|
111
|
+
if (_classPrivateFieldGet(_root, this)) {
|
|
112
|
+
_classPrivateFieldGet(_root, this).unmount();
|
|
113
|
+
_classPrivateFieldSet(_root, this, null);
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
var _instance = {
|
|
117
|
+
_: null
|
|
118
|
+
};
|
|
119
|
+
var notifier = new ActionSheetNotifier();
|
|
120
|
+
/**
|
|
121
|
+
* @zh ActionSheet 的指令式 API。
|
|
122
|
+
* 调用 `ActionSheet.show(config)` 显示操作面板,返回 Promise。
|
|
123
|
+
* @en ActionSheet imperative API.
|
|
124
|
+
* Call `ActionSheet.show(config)` to display the action panel, returns a Promise.
|
|
125
|
+
*/
|
|
126
|
+
var ActionSheetApi = {
|
|
127
|
+
/**
|
|
128
|
+
* @zh 显示 ActionSheet 操作面板。
|
|
129
|
+
* 返回 Promise,在面板关闭动画完成后 resolve。
|
|
130
|
+
* @en Show the ActionSheet panel.
|
|
131
|
+
* Returns a Promise that resolves after the close animation completes.
|
|
132
|
+
*/
|
|
133
|
+
show: function show(config) {
|
|
134
|
+
return notifier.show(config);
|
|
135
|
+
}
|
|
136
|
+
};
|
|
137
|
+
|
|
138
|
+
export { ActionSheetApi as default };
|
|
@@ -58,6 +58,9 @@ declare const styles: {
|
|
|
58
58
|
}>;
|
|
59
59
|
shape: {
|
|
60
60
|
round: Readonly<{
|
|
61
|
+
xsmall?: Readonly<{
|
|
62
|
+
borderRadius: import("@stylexjs/stylex").StyleXClassNameFor<"borderRadius", string>;
|
|
63
|
+
} | undefined>;
|
|
61
64
|
small?: Readonly<{
|
|
62
65
|
borderRadius: import("@stylexjs/stylex").StyleXClassNameFor<"borderRadius", string>;
|
|
63
66
|
} | undefined>;
|
|
@@ -67,14 +70,14 @@ declare const styles: {
|
|
|
67
70
|
large?: Readonly<{
|
|
68
71
|
borderRadius: import("@stylexjs/stylex").StyleXClassNameFor<"borderRadius", string>;
|
|
69
72
|
} | undefined>;
|
|
70
|
-
xsmall?: Readonly<{
|
|
71
|
-
borderRadius: import("@stylexjs/stylex").StyleXClassNameFor<"borderRadius", string>;
|
|
72
|
-
} | undefined>;
|
|
73
73
|
xlarge?: Readonly<{
|
|
74
74
|
borderRadius: import("@stylexjs/stylex").StyleXClassNameFor<"borderRadius", string>;
|
|
75
75
|
} | undefined>;
|
|
76
76
|
}>;
|
|
77
77
|
square: Readonly<{
|
|
78
|
+
xsmall?: Readonly<{
|
|
79
|
+
borderRadius: import("@stylexjs/stylex").StyleXClassNameFor<"borderRadius", string>;
|
|
80
|
+
} | undefined>;
|
|
78
81
|
small?: Readonly<{
|
|
79
82
|
borderRadius: import("@stylexjs/stylex").StyleXClassNameFor<"borderRadius", string>;
|
|
80
83
|
} | undefined>;
|
|
@@ -84,9 +87,6 @@ declare const styles: {
|
|
|
84
87
|
large?: Readonly<{
|
|
85
88
|
borderRadius: import("@stylexjs/stylex").StyleXClassNameFor<"borderRadius", string>;
|
|
86
89
|
} | undefined>;
|
|
87
|
-
xsmall?: Readonly<{
|
|
88
|
-
borderRadius: import("@stylexjs/stylex").StyleXClassNameFor<"borderRadius", string>;
|
|
89
|
-
} | undefined>;
|
|
90
90
|
xlarge?: Readonly<{
|
|
91
91
|
borderRadius: import("@stylexjs/stylex").StyleXClassNameFor<"borderRadius", string>;
|
|
92
92
|
} | undefined>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
declare const Fab: React.ForwardRefExoticComponent<Pick<React.ButtonHTMLAttributes<HTMLButtonElement>, "
|
|
2
|
+
declare const Fab: React.ForwardRefExoticComponent<Pick<React.ButtonHTMLAttributes<HTMLButtonElement>, "onPointerEnter" | "onPointerLeave" | "onMouseEnter" | "onMouseLeave"> & {
|
|
3
3
|
container?: import("../../types/portal").PortalProps["container"];
|
|
4
4
|
children?: React.ReactNode;
|
|
5
5
|
onClick?: import("../../types/button").ButtonProps["onClick"];
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import type { ImageRef } from "../../types/image";
|
|
3
|
-
declare const Image: React.ForwardRefExoticComponent<import("../../types/element").ComponentProps & Pick<React.ImgHTMLAttributes<HTMLImageElement>, "
|
|
3
|
+
declare const Image: React.ForwardRefExoticComponent<import("../../types/element").ComponentProps & Pick<React.ImgHTMLAttributes<HTMLImageElement>, "height" | "width" | "alt" | "crossOrigin" | "referrerPolicy"> & {
|
|
4
4
|
src?: string;
|
|
5
5
|
previewable?: boolean;
|
|
6
6
|
fallback?: React.ReactNode;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
declare const Image: import("react").ForwardRefExoticComponent<import("../../types/element").ComponentProps & Pick<import("react").ImgHTMLAttributes<HTMLImageElement>, "
|
|
1
|
+
declare const Image: import("react").ForwardRefExoticComponent<import("../../types/element").ComponentProps & Pick<import("react").ImgHTMLAttributes<HTMLImageElement>, "height" | "width" | "alt" | "crossOrigin" | "referrerPolicy"> & {
|
|
2
2
|
src?: string;
|
|
3
3
|
previewable?: boolean;
|
|
4
4
|
fallback?: import("react").ReactNode;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import type { PopperRef } from "../../types/popper";
|
|
3
|
-
declare const Dropdown: React.ForwardRefExoticComponent<Omit<import("../../types/popper").PopperProps, "
|
|
3
|
+
declare const Dropdown: React.ForwardRefExoticComponent<Omit<import("../../types/popper").PopperProps, "placement" | "container" | "portal"> & {
|
|
4
4
|
placement: import("@floating-ui/dom").Placement;
|
|
5
5
|
} & React.RefAttributes<PopperRef>>;
|
|
6
6
|
export default Dropdown;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import type { SelectorRef } from "../../types/select";
|
|
3
|
-
declare const Selector: React.ForwardRefExoticComponent<Pick<import("@aiszlab/relax/types").RequiredIn<import("../../types/select").SelectProps<import("../../types/select").ValueOrValues>, "searchable" | "onSearch">, "
|
|
3
|
+
declare const Selector: React.ForwardRefExoticComponent<Pick<import("@aiszlab/relax/types").RequiredIn<import("../../types/select").SelectProps<import("../../types/select").ValueOrValues>, "searchable" | "onSearch">, "disabled" | "onBlur" | "mode" | "placeholder" | "searchable" | "onSearch"> & {
|
|
4
4
|
value: Map<React.Key, React.ReactNode>;
|
|
5
5
|
keyword: string;
|
|
6
6
|
onChange: (key: React.Key) => void;
|
|
@@ -4,11 +4,11 @@ import { ValueOf } from "@aiszlab/relax/types";
|
|
|
4
4
|
* elevations
|
|
5
5
|
*/
|
|
6
6
|
export declare const elevations: import("@stylexjs/stylex").VarGroup<Readonly<{
|
|
7
|
+
none: string;
|
|
8
|
+
xsmall: string;
|
|
7
9
|
small: string;
|
|
8
10
|
medium: string;
|
|
9
11
|
large: string;
|
|
10
|
-
none: string;
|
|
11
|
-
xsmall: string;
|
|
12
12
|
xlarge: string;
|
|
13
13
|
}>, symbol>;
|
|
14
14
|
/**
|
package/dist/index.cjs
CHANGED
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var index = require('./components/
|
|
4
|
-
var index$
|
|
5
|
-
var index$
|
|
6
|
-
var index$
|
|
7
|
-
var index$
|
|
8
|
-
var index$
|
|
9
|
-
var index$
|
|
10
|
-
var index$
|
|
11
|
-
var index$
|
|
3
|
+
var index = require('./components/action-sheet/index.cjs');
|
|
4
|
+
var index$1 = require('./components/avatar/index.cjs');
|
|
5
|
+
var index$8 = require('./components/radio/index.cjs');
|
|
6
|
+
var index$2 = require('./components/checkbox/index.cjs');
|
|
7
|
+
var index$4 = require('./components/grid/index.cjs');
|
|
8
|
+
var index$3 = require('./components/form/index.cjs');
|
|
9
|
+
var index$6 = require('./components/layout/index.cjs');
|
|
10
|
+
var index$5 = require('./components/image/index.cjs');
|
|
11
|
+
var index$9 = require('./components/rich-text-editor/index.cjs');
|
|
12
|
+
var index$7 = require('./components/markdown/index.cjs');
|
|
12
13
|
var badge = require('./components/badge/badge.cjs');
|
|
13
14
|
var bench = require('./components/bench/bench.cjs');
|
|
14
15
|
var bottomSheet = require('./components/bottom-sheet/bottom-sheet.cjs');
|
|
@@ -77,15 +78,16 @@ var hooks$2 = require('./components/theme/hooks.cjs');
|
|
|
77
78
|
|
|
78
79
|
|
|
79
80
|
|
|
80
|
-
exports.
|
|
81
|
-
exports.
|
|
82
|
-
exports.
|
|
83
|
-
exports.
|
|
84
|
-
exports.
|
|
85
|
-
exports.
|
|
86
|
-
exports.
|
|
87
|
-
exports.
|
|
88
|
-
exports.
|
|
81
|
+
exports.ActionSheet = index.ActionSheet;
|
|
82
|
+
exports.Avatar = index$1.Avatar;
|
|
83
|
+
exports.Radio = index$8.Radio;
|
|
84
|
+
exports.Checkbox = index$2.Checkbox;
|
|
85
|
+
exports.Grid = index$4.Grid;
|
|
86
|
+
exports.Form = index$3.Form;
|
|
87
|
+
exports.Layout = index$6.Layout;
|
|
88
|
+
exports.Image = index$5.Image;
|
|
89
|
+
exports.RichTextEditor = index$9.RichTextEditor;
|
|
90
|
+
exports.Markdown = index$7.Markdown;
|
|
89
91
|
exports.Badge = badge.default;
|
|
90
92
|
exports.Bench = bench.default;
|
|
91
93
|
exports.BottomSheet = bottomSheet.default;
|
package/dist/index.d.ts
CHANGED
package/dist/index.mjs
CHANGED
package/dist/styles.css
CHANGED
|
@@ -1833,6 +1833,10 @@
|
|
|
1833
1833
|
border-top-style: solid;
|
|
1834
1834
|
}
|
|
1835
1835
|
|
|
1836
|
+
.musaex-2k45e9 {
|
|
1837
|
+
border-top-width: var(--musaex-1t2jekz);
|
|
1838
|
+
}
|
|
1839
|
+
|
|
1836
1840
|
.musaex-uvson1 {
|
|
1837
1841
|
border-top-width: var(--musaex-1xf102v);
|
|
1838
1842
|
}
|
|
@@ -2101,6 +2105,10 @@
|
|
|
2101
2105
|
min-height: var(--musaex-19fxx0u);
|
|
2102
2106
|
}
|
|
2103
2107
|
|
|
2108
|
+
.musaex-qi4gqz {
|
|
2109
|
+
min-height: var(--musaex-1rxoe21);
|
|
2110
|
+
}
|
|
2111
|
+
|
|
2104
2112
|
.musaex-5g0ifs {
|
|
2105
2113
|
min-height: var(--musaex-1w5d7ii);
|
|
2106
2114
|
}
|
|
@@ -2229,6 +2237,14 @@
|
|
|
2229
2237
|
padding-top: var(--musaex-16suft8);
|
|
2230
2238
|
}
|
|
2231
2239
|
|
|
2240
|
+
.musaex-1b38e8b {
|
|
2241
|
+
padding-top: var(--musaex-1fxazvh);
|
|
2242
|
+
}
|
|
2243
|
+
|
|
2244
|
+
.musaex-3nylsr {
|
|
2245
|
+
padding-top: var(--musaex-48i97p);
|
|
2246
|
+
}
|
|
2247
|
+
|
|
2232
2248
|
.musaex-ltmd5o {
|
|
2233
2249
|
padding-top: var(--musaex-jo49ah);
|
|
2234
2250
|
}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import type { ReactNode } from "react";
|
|
2
|
+
import type { ComponentProps } from "./element";
|
|
3
|
+
/**
|
|
4
|
+
* @zh 操作项,用于 ActionSheet 的操作列表。
|
|
5
|
+
* @en An action item for the ActionSheet's action list.
|
|
6
|
+
*/
|
|
7
|
+
export interface ActionItem {
|
|
8
|
+
/**
|
|
9
|
+
* @zh 操作项唯一标识
|
|
10
|
+
* @en Unique identifier for the action item
|
|
11
|
+
*/
|
|
12
|
+
key: string;
|
|
13
|
+
/**
|
|
14
|
+
* @zh 操作项显示文本
|
|
15
|
+
* @en Display text for the action item
|
|
16
|
+
*/
|
|
17
|
+
text: ReactNode;
|
|
18
|
+
/**
|
|
19
|
+
* @zh 操作项描述文本(可选副标题),显示在 text 下方
|
|
20
|
+
* @en Optional description text displayed below the main text
|
|
21
|
+
*/
|
|
22
|
+
description?: ReactNode;
|
|
23
|
+
/**
|
|
24
|
+
* @zh 点击操作项时的回调
|
|
25
|
+
* @en Callback when the action item is clicked
|
|
26
|
+
*/
|
|
27
|
+
onClick?: () => void;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* @zh ActionSheet 组件的属性。
|
|
31
|
+
* @en Props for the ActionSheet component.
|
|
32
|
+
*/
|
|
33
|
+
export interface ActionSheetProps extends ComponentProps {
|
|
34
|
+
/**
|
|
35
|
+
* @zh 控制 ActionSheet 的可见状态
|
|
36
|
+
* @en Controls the visibility state of the ActionSheet
|
|
37
|
+
*/
|
|
38
|
+
open: boolean;
|
|
39
|
+
/**
|
|
40
|
+
* @zh 当 ActionSheet 请求关闭时的回调
|
|
41
|
+
* @en Called when the ActionSheet requests to close
|
|
42
|
+
*/
|
|
43
|
+
onClose: VoidFunction;
|
|
44
|
+
/**
|
|
45
|
+
* @zh 操作项列表
|
|
46
|
+
* @en List of action items
|
|
47
|
+
*/
|
|
48
|
+
actions: ActionItem[];
|
|
49
|
+
/**
|
|
50
|
+
* @zh 顶部标题(可选)
|
|
51
|
+
* @en Optional title displayed at the top
|
|
52
|
+
*/
|
|
53
|
+
title?: ReactNode;
|
|
54
|
+
/**
|
|
55
|
+
* @zh 标题下方的描述文本(可选)
|
|
56
|
+
* @en Optional description text displayed below the title
|
|
57
|
+
*/
|
|
58
|
+
description?: ReactNode;
|
|
59
|
+
/**
|
|
60
|
+
* @zh 取消按钮文本。默认使用 locale 中的 cancel 文案
|
|
61
|
+
* @en Cancel button text. Uses locale cancel text by default
|
|
62
|
+
*/
|
|
63
|
+
cancelText?: ReactNode;
|
|
64
|
+
/**
|
|
65
|
+
* @zh 面板高度。接受数字(px)或任意 CSS 高度值
|
|
66
|
+
* @en Height of the panel. Accepts number (px) or any CSS height value
|
|
67
|
+
*/
|
|
68
|
+
height?: number | string;
|
|
69
|
+
}
|
|
70
|
+
/**
|
|
71
|
+
* @zh 指令式 API `ActionSheet.show()` 的配置参数。
|
|
72
|
+
* @en Configuration for the imperative API `ActionSheet.show()`.
|
|
73
|
+
*/
|
|
74
|
+
export type ActionSheetShowConfig = Omit<ActionSheetProps, "open" | "onClose">;
|
package/dist/types/locale.d.ts
CHANGED