musae 1.0.27-beta.4 → 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.
Files changed (259) hide show
  1. package/dist/components/action-sheet/__test__/index.test.d.ts +1 -0
  2. package/dist/components/action-sheet/action-sheet.cjs +168 -0
  3. package/dist/components/action-sheet/action-sheet.d.ts +10 -0
  4. package/dist/components/action-sheet/action-sheet.mjs +164 -0
  5. package/dist/components/action-sheet/context.cjs +19 -0
  6. package/dist/components/action-sheet/context.d.ts +15 -0
  7. package/dist/components/action-sheet/context.mjs +17 -0
  8. package/dist/components/action-sheet/index.cjs +8 -0
  9. package/dist/components/action-sheet/index.d.ts +4 -0
  10. package/dist/components/action-sheet/index.mjs +6 -0
  11. package/dist/components/action-sheet/notifier.cjs +142 -0
  12. package/dist/components/action-sheet/notifier.d.ts +17 -0
  13. package/dist/components/action-sheet/notifier.mjs +138 -0
  14. package/dist/components/avatar/avatar.cjs +1 -1
  15. package/dist/components/avatar/avatar.mjs +1 -1
  16. package/dist/components/badge/badge.cjs +1 -1
  17. package/dist/components/badge/badge.mjs +1 -1
  18. package/dist/components/bench/bench.cjs +1 -1
  19. package/dist/components/bench/bench.mjs +1 -1
  20. package/dist/components/bottom-sheet/__test__/index.test.d.ts +1 -0
  21. package/dist/components/bottom-sheet/bottom-sheet.cjs +66 -0
  22. package/dist/components/bottom-sheet/bottom-sheet.d.ts +10 -0
  23. package/dist/components/bottom-sheet/bottom-sheet.mjs +62 -0
  24. package/dist/components/bottom-sheet/context.cjs +12 -0
  25. package/dist/components/bottom-sheet/context.d.ts +8 -0
  26. package/dist/components/bottom-sheet/context.mjs +10 -0
  27. package/dist/components/bottom-sheet/index.d.ts +2 -0
  28. package/dist/components/breadcrumb/breadcrumb.cjs +1 -1
  29. package/dist/components/breadcrumb/breadcrumb.mjs +1 -1
  30. package/dist/components/breadcrumb/item.cjs +6 -3
  31. package/dist/components/breadcrumb/item.mjs +6 -3
  32. package/dist/components/button/button.cjs +1 -1
  33. package/dist/components/button/button.mjs +1 -1
  34. package/dist/components/button/styles.cjs +5 -5
  35. package/dist/components/button/styles.d.ts +21 -11
  36. package/dist/components/button/styles.mjs +5 -5
  37. package/dist/components/calendar/calendar.cjs +5 -3
  38. package/dist/components/calendar/calendar.d.ts +1 -0
  39. package/dist/components/calendar/calendar.mjs +5 -3
  40. package/dist/components/calendar/contribution.cjs +1 -1
  41. package/dist/components/calendar/contribution.mjs +1 -1
  42. package/dist/components/calendar/hooks.cjs +24 -21
  43. package/dist/components/calendar/hooks.d.ts +3 -2
  44. package/dist/components/calendar/hooks.mjs +24 -21
  45. package/dist/components/chat/chat.cjs +1 -1
  46. package/dist/components/chat/chat.mjs +1 -1
  47. package/dist/components/checkbox/checkbox.cjs +6 -27
  48. package/dist/components/checkbox/checkbox.mjs +4 -25
  49. package/dist/components/checkbox/styles.cjs +4 -4
  50. package/dist/components/checkbox/styles.d.ts +12 -4
  51. package/dist/components/checkbox/styles.mjs +4 -4
  52. package/dist/components/clock/column.cjs +2 -2
  53. package/dist/components/clock/column.mjs +2 -2
  54. package/dist/components/collapse/item.cjs +1 -1
  55. package/dist/components/collapse/item.mjs +1 -1
  56. package/dist/components/date-picker/date-picker.cjs +1 -1
  57. package/dist/components/date-picker/date-picker.mjs +1 -1
  58. package/dist/components/dialog/dialog.cjs +1 -1
  59. package/dist/components/dialog/dialog.mjs +1 -1
  60. package/dist/components/dialog/popup.cjs +1 -1
  61. package/dist/components/dialog/popup.mjs +1 -1
  62. package/dist/components/divider/divider.cjs +1 -1
  63. package/dist/components/divider/divider.mjs +1 -1
  64. package/dist/components/drawer/context.cjs +4 -5
  65. package/dist/components/drawer/context.d.ts +3 -4
  66. package/dist/components/drawer/context.mjs +4 -5
  67. package/dist/components/drawer/drawer.cjs +67 -23
  68. package/dist/components/drawer/drawer.d.ts +5 -0
  69. package/dist/components/drawer/drawer.mjs +69 -25
  70. package/dist/components/empty/empty.cjs +1 -1
  71. package/dist/components/empty/empty.mjs +1 -1
  72. package/dist/components/fab/fab.d.ts +1 -1
  73. package/dist/components/form/field/layout.cjs +1 -1
  74. package/dist/components/form/field/layout.mjs +1 -1
  75. package/dist/components/icon/icons/action/calendar-today.cjs +22 -0
  76. package/dist/components/icon/icons/action/calendar-today.d.ts +3 -0
  77. package/dist/components/icon/icons/action/calendar-today.mjs +18 -0
  78. package/dist/components/icon/icons/action/index.cjs +2 -0
  79. package/dist/components/icon/icons/action/index.d.ts +2 -1
  80. package/dist/components/icon/icons/action/index.mjs +1 -0
  81. package/dist/components/icon/icons/communication/index.d.ts +2 -0
  82. package/dist/components/icon/icons/communication/location-on.cjs +25 -0
  83. package/dist/components/icon/icons/communication/location-on.d.ts +3 -0
  84. package/dist/components/icon/icons/communication/location-on.mjs +21 -0
  85. package/dist/components/icon/icons/index.cjs +6 -0
  86. package/dist/components/icon/icons/index.d.ts +2 -0
  87. package/dist/components/icon/icons/index.mjs +3 -0
  88. package/dist/components/icon/icons/social/index.d.ts +2 -0
  89. package/dist/components/icon/icons/social/share.cjs +22 -0
  90. package/dist/components/icon/icons/social/share.d.ts +3 -0
  91. package/dist/components/icon/icons/social/share.mjs +18 -0
  92. package/dist/components/icon-button/icon-button.cjs +1 -1
  93. package/dist/components/icon-button/icon-button.mjs +1 -1
  94. package/dist/components/image/image.cjs +1 -1
  95. package/dist/components/image/image.d.ts +1 -1
  96. package/dist/components/image/image.mjs +1 -1
  97. package/dist/components/image/index.d.ts +1 -1
  98. package/dist/components/image/preview/operations.cjs +1 -1
  99. package/dist/components/image/preview/operations.mjs +1 -1
  100. package/dist/components/input/input.cjs +7 -14
  101. package/dist/components/input/input.mjs +4 -11
  102. package/dist/components/layout/sidebar.cjs +1 -1
  103. package/dist/components/layout/sidebar.mjs +1 -1
  104. package/dist/components/loading/loading.cjs +1 -1
  105. package/dist/components/loading/loading.mjs +1 -1
  106. package/dist/components/markdown/markdown.cjs +1 -1
  107. package/dist/components/markdown/markdown.mjs +1 -1
  108. package/dist/components/menu/group.cjs +1 -1
  109. package/dist/components/menu/group.mjs +1 -1
  110. package/dist/components/menu/item.cjs +4 -4
  111. package/dist/components/menu/item.mjs +4 -4
  112. package/dist/components/notification/holder.cjs +1 -1
  113. package/dist/components/notification/holder.mjs +1 -1
  114. package/dist/components/notification/notification.cjs +1 -1
  115. package/dist/components/notification/notification.mjs +1 -1
  116. package/dist/components/pagination/item.cjs +1 -1
  117. package/dist/components/pagination/item.mjs +1 -1
  118. package/dist/components/password-input/password-input.cjs +1 -1
  119. package/dist/components/password-input/password-input.mjs +1 -1
  120. package/dist/components/picker/picker.cjs +14 -8
  121. package/dist/components/picker/picker.mjs +14 -8
  122. package/dist/components/popconfirm/popconfirm.cjs +1 -1
  123. package/dist/components/popconfirm/popconfirm.mjs +1 -1
  124. package/dist/components/popover/popover.cjs +1 -1
  125. package/dist/components/popover/popover.mjs +1 -1
  126. package/dist/components/popper/dropdown.d.ts +1 -1
  127. package/dist/components/portal/portal.cjs +3 -3
  128. package/dist/components/portal/portal.mjs +3 -3
  129. package/dist/components/progress/linear.cjs +2 -2
  130. package/dist/components/progress/linear.mjs +2 -2
  131. package/dist/components/quote/quote.cjs +1 -1
  132. package/dist/components/quote/quote.mjs +1 -1
  133. package/dist/components/radio/radio.cjs +1 -1
  134. package/dist/components/radio/radio.mjs +1 -1
  135. package/dist/components/rate/star.cjs +1 -1
  136. package/dist/components/rate/star.mjs +1 -1
  137. package/dist/components/rich-text-editor/plugins/controlled-state/index.cjs +12 -26
  138. package/dist/components/rich-text-editor/plugins/controlled-state/index.mjs +13 -27
  139. package/dist/components/rich-text-editor/rich-text-editor.cjs +4 -12
  140. package/dist/components/rich-text-editor/rich-text-editor.mjs +4 -12
  141. package/dist/components/rich-text-editor/utils.cjs +2 -2
  142. package/dist/components/rich-text-editor/utils.mjs +2 -2
  143. package/dist/components/select/select.cjs +7 -2
  144. package/dist/components/select/select.d.ts +1 -1
  145. package/dist/components/select/select.mjs +7 -2
  146. package/dist/components/select/selector.cjs +9 -5
  147. package/dist/components/select/selector.d.ts +1 -1
  148. package/dist/components/select/selector.mjs +9 -5
  149. package/dist/components/sheet/context.cjs +14 -0
  150. package/dist/components/sheet/context.d.ts +10 -0
  151. package/dist/components/sheet/context.mjs +12 -0
  152. package/dist/components/sheet/hooks.cjs +17 -0
  153. package/dist/components/sheet/hooks.d.ts +9 -0
  154. package/dist/components/sheet/hooks.mjs +15 -0
  155. package/dist/components/sheet/index.d.ts +2 -0
  156. package/dist/components/{drawer/popup.cjs → sheet/sheet.cjs} +89 -83
  157. package/dist/components/sheet/sheet.d.ts +11 -0
  158. package/dist/components/{drawer/popup.mjs → sheet/sheet.mjs} +90 -84
  159. package/dist/components/slider/track.d.ts +1 -1
  160. package/dist/components/space/space.cjs +1 -1
  161. package/dist/components/space/space.mjs +1 -1
  162. package/dist/components/split-panel/divider.cjs +1 -1
  163. package/dist/components/split-panel/divider.mjs +1 -1
  164. package/dist/components/split-panel/index.d.ts +1 -1
  165. package/dist/components/split-panel/split-panel.cjs +1 -1
  166. package/dist/components/split-panel/split-panel.mjs +1 -1
  167. package/dist/components/steps/item.cjs +1 -1
  168. package/dist/components/steps/item.mjs +1 -1
  169. package/dist/components/steps/steps.cjs +1 -1
  170. package/dist/components/steps/steps.mjs +1 -1
  171. package/dist/components/table/body.cjs +1 -1
  172. package/dist/components/table/body.mjs +1 -1
  173. package/dist/components/table/header/header.cjs +1 -1
  174. package/dist/components/table/header/header.mjs +1 -1
  175. package/dist/components/tabs/context.cjs +1 -4
  176. package/dist/components/tabs/context.d.ts +2 -2
  177. package/dist/components/tabs/context.mjs +1 -4
  178. package/dist/components/tabs/hooks/use-navigation.cjs +87 -0
  179. package/dist/components/tabs/hooks/use-navigation.d.ts +12 -0
  180. package/dist/components/tabs/hooks/use-navigation.mjs +85 -0
  181. package/dist/components/tabs/hooks/use-tabs-context.cjs +18 -0
  182. package/dist/components/tabs/hooks/use-tabs-context.d.ts +7 -0
  183. package/dist/components/tabs/hooks/use-tabs-context.mjs +16 -0
  184. package/dist/components/tabs/hooks/use-tabs.cjs +46 -0
  185. package/dist/components/tabs/hooks/use-tabs.d.ts +17 -0
  186. package/dist/components/tabs/hooks/use-tabs.mjs +44 -0
  187. package/dist/components/tabs/navigation.cjs +48 -18
  188. package/dist/components/tabs/navigation.mjs +47 -17
  189. package/dist/components/tabs/panels.cjs +56 -39
  190. package/dist/components/tabs/panels.mjs +56 -39
  191. package/dist/components/tabs/tab.cjs +7 -9
  192. package/dist/components/tabs/tab.mjs +6 -8
  193. package/dist/components/tabs/tabs.cjs +11 -6
  194. package/dist/components/tabs/tabs.d.ts +1 -1
  195. package/dist/components/tabs/tabs.mjs +10 -5
  196. package/dist/components/tag/tag.cjs +55 -30
  197. package/dist/components/tag/tag.d.ts +1 -1
  198. package/dist/components/tag/tag.mjs +55 -30
  199. package/dist/components/textarea/textarea.cjs +5 -3
  200. package/dist/components/textarea/textarea.d.ts +1 -0
  201. package/dist/components/textarea/textarea.mjs +5 -3
  202. package/dist/components/theme/hooks.cjs +13 -8
  203. package/dist/components/theme/hooks.d.ts +3 -2
  204. package/dist/components/theme/hooks.mjs +13 -8
  205. package/dist/components/theme/theme-provider.cjs +3 -1
  206. package/dist/components/theme/theme-provider.d.ts +1 -1
  207. package/dist/components/theme/theme-provider.mjs +3 -1
  208. package/dist/components/theme/tokens.stylex.d.ts +4 -2
  209. package/dist/components/time-picker/time-picker.cjs +1 -1
  210. package/dist/components/time-picker/time-picker.mjs +1 -1
  211. package/dist/components/timeline/item.cjs +1 -1
  212. package/dist/components/timeline/item.mjs +1 -1
  213. package/dist/components/tour/tour.cjs +2 -2
  214. package/dist/components/tour/tour.mjs +2 -2
  215. package/dist/components/transfer/list.cjs +1 -1
  216. package/dist/components/transfer/list.mjs +1 -1
  217. package/dist/components/tree/node.cjs +2 -2
  218. package/dist/components/tree/node.mjs +2 -2
  219. package/dist/components/upload/uploaded-item/index.cjs +1 -1
  220. package/dist/components/upload/uploaded-item/index.mjs +1 -1
  221. package/dist/components/upload/uploaded-list.cjs +1 -1
  222. package/dist/components/upload/uploaded-list.mjs +1 -1
  223. package/dist/contexts/stack-level.context.mjs +1 -1
  224. package/dist/hooks/use-closable.cjs +1 -1
  225. package/dist/hooks/use-closable.mjs +1 -1
  226. package/dist/hooks/use-theme-color-vars.cjs +7 -9
  227. package/dist/hooks/use-theme-color-vars.d.ts +2 -1
  228. package/dist/hooks/use-theme-color-vars.mjs +6 -8
  229. package/dist/index.cjs +22 -18
  230. package/dist/index.d.ts +2 -0
  231. package/dist/index.mjs +2 -0
  232. package/dist/locale/locales/en_US.cjs +3 -0
  233. package/dist/locale/locales/en_US.mjs +3 -0
  234. package/dist/locale/locales/zh_CN.cjs +3 -0
  235. package/dist/locale/locales/zh_CN.mjs +3 -0
  236. package/dist/styles.css +187 -103
  237. package/dist/types/action-sheet.d.ts +74 -0
  238. package/dist/types/bottom-sheet.d.ts +40 -0
  239. package/dist/types/calendar.d.ts +20 -12
  240. package/dist/types/form.d.ts +1 -1
  241. package/dist/types/locale.d.ts +3 -0
  242. package/dist/types/picker.d.ts +6 -0
  243. package/dist/types/portal.d.ts +2 -2
  244. package/dist/types/select.d.ts +9 -2
  245. package/dist/types/sheet.d.ts +75 -0
  246. package/dist/types/tabs.d.ts +18 -2
  247. package/dist/types/tag.d.ts +10 -6
  248. package/dist/types/textarea.d.ts +5 -0
  249. package/dist/types/theme.d.ts +10 -5
  250. package/package.json +11 -11
  251. package/dist/components/drawer/hooks.cjs +0 -10
  252. package/dist/components/drawer/hooks.d.ts +0 -2
  253. package/dist/components/drawer/hooks.mjs +0 -8
  254. package/dist/components/drawer/popup.d.ts +0 -4
  255. package/dist/components/tabs/hooks.cjs +0 -145
  256. package/dist/components/tabs/hooks.d.ts +0 -43
  257. package/dist/components/tabs/hooks.mjs +0 -140
  258. /package/dist/node_modules/.pnpm/{@stylexjs_stylex@0.17.5 → @stylexjs_stylex@0.18.3}/node_modules/@stylexjs/stylex/lib/es/stylex.cjs +0 -0
  259. /package/dist/node_modules/.pnpm/{@stylexjs_stylex@0.17.5 → @stylexjs_stylex@0.18.3}/node_modules/@stylexjs/stylex/lib/es/stylex.mjs +0 -0
@@ -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,8 @@
1
+ 'use strict';
2
+
3
+ var actionSheet = require('./action-sheet.cjs');
4
+ var notifier = require('./notifier.cjs');
5
+
6
+ var ActionSheetWithApi = Object.assign(actionSheet.default, notifier.default);
7
+
8
+ exports.ActionSheet = ActionSheetWithApi;
@@ -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,6 @@
1
+ import ActionSheet from './action-sheet.mjs';
2
+ import ActionSheetApi from './notifier.mjs';
3
+
4
+ var ActionSheetWithApi = Object.assign(ActionSheet, ActionSheetApi);
5
+
6
+ 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;