musae 1.0.27-beta.30 → 1.0.27-beta.32
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/bottom-sheet/__test__/index.test.d.ts +1 -0
- package/dist/components/bottom-sheet/bottom-sheet.cjs +45 -0
- package/dist/components/bottom-sheet/bottom-sheet.d.ts +4 -0
- package/dist/components/bottom-sheet/bottom-sheet.mjs +41 -0
- package/dist/components/bottom-sheet/context.cjs +15 -0
- package/dist/components/bottom-sheet/context.d.ts +11 -0
- package/dist/components/bottom-sheet/context.mjs +13 -0
- package/dist/components/bottom-sheet/index.d.ts +2 -0
- package/dist/components/bottom-sheet/sheet.cjs +137 -0
- package/dist/components/bottom-sheet/sheet.d.ts +8 -0
- package/dist/components/bottom-sheet/sheet.mjs +133 -0
- package/dist/components/image/image.cjs +1 -1
- package/dist/components/image/image.mjs +1 -1
- package/dist/components/theme/tokens.stylex.cjs +1 -0
- package/dist/components/theme/tokens.stylex.mjs +1 -0
- package/dist/index.cjs +2 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.mjs +1 -0
- package/dist/styles.css +24 -0
- package/dist/types/bottom-sheet.d.ts +33 -0
- package/package.json +1 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import "@testing-library/jest-dom";
|
|
@@ -0,0 +1,45 @@
|
|
|
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 _objectWithoutProperties = require('@babel/runtime/helpers/objectWithoutProperties');
|
|
8
|
+
var React = require('react');
|
|
9
|
+
var relax = require('@aiszlab/relax');
|
|
10
|
+
var portal = require('../portal/portal.cjs');
|
|
11
|
+
var sheet = require('./sheet.cjs');
|
|
12
|
+
|
|
13
|
+
var _excluded = ["open", "height", "closable"];
|
|
14
|
+
var BottomSheet = function BottomSheet(_ref) {
|
|
15
|
+
var open = _ref.open,
|
|
16
|
+
_ref$height = _ref.height,
|
|
17
|
+
height = _ref$height === void 0 ? "50vh" : _ref$height,
|
|
18
|
+
_ref$closable = _ref.closable,
|
|
19
|
+
closable = _ref$closable === void 0 ? true : _ref$closable,
|
|
20
|
+
props = _objectWithoutProperties(_ref, _excluded);
|
|
21
|
+
// Keep Portal mounted during exit animation
|
|
22
|
+
var _useBoolean = relax.useBoolean(false),
|
|
23
|
+
_useBoolean2 = _slicedToArray(_useBoolean, 2),
|
|
24
|
+
isVisible = _useBoolean2[0],
|
|
25
|
+
_useBoolean2$ = _useBoolean2[1],
|
|
26
|
+
turnOn = _useBoolean2$.turnOn,
|
|
27
|
+
turnOff = _useBoolean2$.turnOff;
|
|
28
|
+
React.useEffect(function () {
|
|
29
|
+
if (open) {
|
|
30
|
+
turnOn();
|
|
31
|
+
}
|
|
32
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
33
|
+
}, [open]);
|
|
34
|
+
return /*#__PURE__*/React.createElement(portal.default, {
|
|
35
|
+
open: open || isVisible,
|
|
36
|
+
lockable: true
|
|
37
|
+
}, /*#__PURE__*/React.createElement(sheet.default, _objectSpread(_objectSpread({}, props), {}, {
|
|
38
|
+
open: open,
|
|
39
|
+
height: height,
|
|
40
|
+
closable: closable,
|
|
41
|
+
onClosed: turnOff
|
|
42
|
+
})));
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
exports.default = BottomSheet;
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import _objectSpread from '@babel/runtime/helpers/objectSpread2';
|
|
2
|
+
import _slicedToArray from '@babel/runtime/helpers/slicedToArray';
|
|
3
|
+
import _objectWithoutProperties from '@babel/runtime/helpers/objectWithoutProperties';
|
|
4
|
+
import React, { useEffect } from 'react';
|
|
5
|
+
import { useBoolean } from '@aiszlab/relax';
|
|
6
|
+
import Portal from '../portal/portal.mjs';
|
|
7
|
+
import Sheet from './sheet.mjs';
|
|
8
|
+
|
|
9
|
+
var _excluded = ["open", "height", "closable"];
|
|
10
|
+
var BottomSheet = function BottomSheet(_ref) {
|
|
11
|
+
var open = _ref.open,
|
|
12
|
+
_ref$height = _ref.height,
|
|
13
|
+
height = _ref$height === void 0 ? "50vh" : _ref$height,
|
|
14
|
+
_ref$closable = _ref.closable,
|
|
15
|
+
closable = _ref$closable === void 0 ? true : _ref$closable,
|
|
16
|
+
props = _objectWithoutProperties(_ref, _excluded);
|
|
17
|
+
// Keep Portal mounted during exit animation
|
|
18
|
+
var _useBoolean = useBoolean(false),
|
|
19
|
+
_useBoolean2 = _slicedToArray(_useBoolean, 2),
|
|
20
|
+
isVisible = _useBoolean2[0],
|
|
21
|
+
_useBoolean2$ = _useBoolean2[1],
|
|
22
|
+
turnOn = _useBoolean2$.turnOn,
|
|
23
|
+
turnOff = _useBoolean2$.turnOff;
|
|
24
|
+
useEffect(function () {
|
|
25
|
+
if (open) {
|
|
26
|
+
turnOn();
|
|
27
|
+
}
|
|
28
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
29
|
+
}, [open]);
|
|
30
|
+
return /*#__PURE__*/React.createElement(Portal, {
|
|
31
|
+
open: open || isVisible,
|
|
32
|
+
lockable: true
|
|
33
|
+
}, /*#__PURE__*/React.createElement(Sheet, _objectSpread(_objectSpread({}, props), {}, {
|
|
34
|
+
open: open,
|
|
35
|
+
height: height,
|
|
36
|
+
closable: closable,
|
|
37
|
+
onClosed: turnOff
|
|
38
|
+
})));
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
export { BottomSheet as default };
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* @description
|
|
5
|
+
* class names for BottomSheet
|
|
6
|
+
*/
|
|
7
|
+
var CLASS_NAMES = {
|
|
8
|
+
sheet: "bottom-sheet",
|
|
9
|
+
overlay: "bottom-sheet__overlay",
|
|
10
|
+
panel: "bottom-sheet__panel",
|
|
11
|
+
handle: "bottom-sheet__drag-handle",
|
|
12
|
+
body: "bottom-sheet__body"
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
exports.CLASS_NAMES = CLASS_NAMES;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @description
|
|
3
|
+
* class names for BottomSheet
|
|
4
|
+
*/
|
|
5
|
+
export declare const CLASS_NAMES: {
|
|
6
|
+
readonly sheet: "bottom-sheet";
|
|
7
|
+
readonly overlay: "bottom-sheet__overlay";
|
|
8
|
+
readonly panel: "bottom-sheet__panel";
|
|
9
|
+
readonly handle: "bottom-sheet__drag-handle";
|
|
10
|
+
readonly body: "bottom-sheet__body";
|
|
11
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @description
|
|
3
|
+
* class names for BottomSheet
|
|
4
|
+
*/
|
|
5
|
+
var CLASS_NAMES = {
|
|
6
|
+
sheet: "bottom-sheet",
|
|
7
|
+
overlay: "bottom-sheet__overlay",
|
|
8
|
+
panel: "bottom-sheet__panel",
|
|
9
|
+
handle: "bottom-sheet__drag-handle",
|
|
10
|
+
body: "bottom-sheet__body"
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
export { CLASS_NAMES };
|
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var _objectSpread = require('@babel/runtime/helpers/objectSpread2');
|
|
6
|
+
var _regenerator = require('@babel/runtime/helpers/regenerator');
|
|
7
|
+
var _asyncToGenerator = require('@babel/runtime/helpers/asyncToGenerator');
|
|
8
|
+
var React = require('react');
|
|
9
|
+
var react = require('motion/react');
|
|
10
|
+
var className = require('@aiszlab/relax/class-name');
|
|
11
|
+
var relax = require('@aiszlab/relax');
|
|
12
|
+
var dom = require('@aiszlab/relax/dom');
|
|
13
|
+
var useClassNames = require('../../hooks/use-class-names.cjs');
|
|
14
|
+
var useClosable = require('../../hooks/use-closable.cjs');
|
|
15
|
+
var useThemeColorVars = require('../../hooks/use-theme-color-vars.cjs');
|
|
16
|
+
var tokens_stylex = require('../theme/tokens.stylex.cjs');
|
|
17
|
+
var context = require('./context.cjs');
|
|
18
|
+
|
|
19
|
+
var ANIMATION_OPTIONS = {
|
|
20
|
+
enter: {
|
|
21
|
+
duration: 0.3
|
|
22
|
+
},
|
|
23
|
+
exit: {
|
|
24
|
+
duration: 0.2
|
|
25
|
+
}
|
|
26
|
+
};
|
|
27
|
+
var Sheet = function Sheet(_ref) {
|
|
28
|
+
var open = _ref.open,
|
|
29
|
+
onClose = _ref.onClose,
|
|
30
|
+
onClosed = _ref.onClosed,
|
|
31
|
+
_ref$height = _ref.height,
|
|
32
|
+
height = _ref$height === void 0 ? "50vh" : _ref$height,
|
|
33
|
+
closable = _ref.closable,
|
|
34
|
+
className$1 = _ref.className,
|
|
35
|
+
children = _ref.children;
|
|
36
|
+
var classNames = useClassNames.useClassNames(context.CLASS_NAMES);
|
|
37
|
+
var ref = React.useRef(null);
|
|
38
|
+
var panelRef = React.useRef(null);
|
|
39
|
+
var overlayRef = React.useRef(null);
|
|
40
|
+
var themeColorVars = useThemeColorVars.useThemeColorVars(["surface-dim", "surface-container", "on-surface-variant"]);
|
|
41
|
+
var _useClosable = useClosable.useClosable({
|
|
42
|
+
closable: closable,
|
|
43
|
+
onClose: onClose
|
|
44
|
+
}),
|
|
45
|
+
onOverlayClick = _useClosable.onOverlayClick,
|
|
46
|
+
onKeyDown = _useClosable.onKeyDown;
|
|
47
|
+
// Focus the sheet when open to receive keyboard events
|
|
48
|
+
React.useEffect(function () {
|
|
49
|
+
var _ref$current;
|
|
50
|
+
if (!open) return;
|
|
51
|
+
if (dom.contains(ref.current, document.activeElement)) return;
|
|
52
|
+
(_ref$current = ref.current) === null || _ref$current === void 0 || _ref$current.focus();
|
|
53
|
+
}, [open]);
|
|
54
|
+
relax.useAsyncEffect(/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee() {
|
|
55
|
+
return _regenerator().w(function (_context) {
|
|
56
|
+
while (1) switch (_context.n) {
|
|
57
|
+
case 0:
|
|
58
|
+
if (ref.current) {
|
|
59
|
+
_context.n = 1;
|
|
60
|
+
break;
|
|
61
|
+
}
|
|
62
|
+
return _context.a(2);
|
|
63
|
+
case 1:
|
|
64
|
+
if (!open) {
|
|
65
|
+
_context.n = 3;
|
|
66
|
+
break;
|
|
67
|
+
}
|
|
68
|
+
ref.current.style.display = "block";
|
|
69
|
+
_context.n = 2;
|
|
70
|
+
return Promise.all([panelRef.current && react.animate(panelRef.current, {
|
|
71
|
+
transform: "translateY(0)"
|
|
72
|
+
}, ANIMATION_OPTIONS.enter), overlayRef.current && react.animate(overlayRef.current, {
|
|
73
|
+
opacity: tokens_stylex.OPACITY.heavier
|
|
74
|
+
}, ANIMATION_OPTIONS.enter)]);
|
|
75
|
+
case 2:
|
|
76
|
+
return _context.a(2);
|
|
77
|
+
case 3:
|
|
78
|
+
_context.n = 4;
|
|
79
|
+
return Promise.all([panelRef.current && react.animate(panelRef.current, {
|
|
80
|
+
transform: "translateY(100%)"
|
|
81
|
+
}, ANIMATION_OPTIONS.exit), overlayRef.current && react.animate(overlayRef.current, {
|
|
82
|
+
opacity: 0
|
|
83
|
+
}, ANIMATION_OPTIONS.exit)]);
|
|
84
|
+
case 4:
|
|
85
|
+
ref.current.style.display = "none";
|
|
86
|
+
onClosed();
|
|
87
|
+
case 5:
|
|
88
|
+
return _context.a(2);
|
|
89
|
+
}
|
|
90
|
+
}, _callee);
|
|
91
|
+
})), [open]);
|
|
92
|
+
var styled = {
|
|
93
|
+
popup: {
|
|
94
|
+
className: "musaex-ixxii4 musaex-10a8y8t musaex-47corl musaex-pje0qt"
|
|
95
|
+
},
|
|
96
|
+
overlay: {
|
|
97
|
+
className: "musaex-10l6tqk musaex-10a8y8t musaex-67bb7w musaex-g01cxk musaex-11we2rp"
|
|
98
|
+
},
|
|
99
|
+
panel: {
|
|
100
|
+
className: "musaex-10l6tqk musaex-1ey2m1c musaex-u96u03 musaex-3m8u43 musaex-67bb7w musaex-17o6occ musaex-zbxit7 musaex-1ei9pc5 musaex-78zum5 musaex-dt5ytf musaex-1bwycvy musaex-b3r6kr musaex-1weeur4"
|
|
101
|
+
},
|
|
102
|
+
handle: {
|
|
103
|
+
className: "musaex-1po6ib musaex-rntz3j musaex-1xa9b2s musaex-9ip8r5 musaex-1eodh35 musaex-19i5tse musaex-vueqy4 musaex-2lah0s"
|
|
104
|
+
},
|
|
105
|
+
body: {
|
|
106
|
+
className: "musaex-98rzlu musaex-ysyzu8 musaex-1y9dh0z"
|
|
107
|
+
}
|
|
108
|
+
};
|
|
109
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
110
|
+
ref: ref,
|
|
111
|
+
tabIndex: -1,
|
|
112
|
+
className: className.stringify(classNames.sheet, className$1, styled.popup.className),
|
|
113
|
+
style: _objectSpread(_objectSpread({}, styled.popup.style), {}, {
|
|
114
|
+
display: "none"
|
|
115
|
+
}),
|
|
116
|
+
onKeyDown: onKeyDown
|
|
117
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
118
|
+
ref: overlayRef,
|
|
119
|
+
className: className.stringify(classNames.overlay, styled.overlay.className),
|
|
120
|
+
style: styled.overlay.style,
|
|
121
|
+
onClick: onOverlayClick
|
|
122
|
+
}), /*#__PURE__*/React.createElement("div", {
|
|
123
|
+
ref: panelRef,
|
|
124
|
+
className: className.stringify(classNames.panel, styled.panel.className),
|
|
125
|
+
style: _objectSpread(_objectSpread(_objectSpread({}, styled.panel.style), themeColorVars), {}, {
|
|
126
|
+
height: typeof height === "number" ? "".concat(height, "px") : height
|
|
127
|
+
})
|
|
128
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
129
|
+
className: className.stringify(classNames.handle, styled.handle.className),
|
|
130
|
+
style: styled.handle.style
|
|
131
|
+
}), /*#__PURE__*/React.createElement("div", {
|
|
132
|
+
className: className.stringify(classNames.body, styled.body.className),
|
|
133
|
+
style: styled.body.style
|
|
134
|
+
}, children)));
|
|
135
|
+
};
|
|
136
|
+
|
|
137
|
+
exports.default = Sheet;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import type { BottomSheetProps } from "../../types/bottom-sheet";
|
|
3
|
+
type SheetProps = Required<Pick<BottomSheetProps, "height" | "closable">> & Omit<BottomSheetProps, "height" | "closable"> & {
|
|
4
|
+
/** Called after exit animation completes, signals Portal to unmount */
|
|
5
|
+
onClosed: VoidFunction;
|
|
6
|
+
};
|
|
7
|
+
declare const Sheet: ({ open, onClose, onClosed, height, closable, className, children, }: SheetProps) => React.JSX.Element;
|
|
8
|
+
export default Sheet;
|
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
import _objectSpread from '@babel/runtime/helpers/objectSpread2';
|
|
2
|
+
import _regenerator from '@babel/runtime/helpers/regenerator';
|
|
3
|
+
import _asyncToGenerator from '@babel/runtime/helpers/asyncToGenerator';
|
|
4
|
+
import React, { useRef, useEffect } from 'react';
|
|
5
|
+
import { animate } from 'motion/react';
|
|
6
|
+
import { stringify } from '@aiszlab/relax/class-name';
|
|
7
|
+
import { useAsyncEffect } from '@aiszlab/relax';
|
|
8
|
+
import { contains } from '@aiszlab/relax/dom';
|
|
9
|
+
import { useClassNames } from '../../hooks/use-class-names.mjs';
|
|
10
|
+
import { useClosable } from '../../hooks/use-closable.mjs';
|
|
11
|
+
import { useThemeColorVars } from '../../hooks/use-theme-color-vars.mjs';
|
|
12
|
+
import { OPACITY } from '../theme/tokens.stylex.mjs';
|
|
13
|
+
import { CLASS_NAMES } from './context.mjs';
|
|
14
|
+
|
|
15
|
+
var ANIMATION_OPTIONS = {
|
|
16
|
+
enter: {
|
|
17
|
+
duration: 0.3
|
|
18
|
+
},
|
|
19
|
+
exit: {
|
|
20
|
+
duration: 0.2
|
|
21
|
+
}
|
|
22
|
+
};
|
|
23
|
+
var Sheet = function Sheet(_ref) {
|
|
24
|
+
var open = _ref.open,
|
|
25
|
+
onClose = _ref.onClose,
|
|
26
|
+
onClosed = _ref.onClosed,
|
|
27
|
+
_ref$height = _ref.height,
|
|
28
|
+
height = _ref$height === void 0 ? "50vh" : _ref$height,
|
|
29
|
+
closable = _ref.closable,
|
|
30
|
+
className = _ref.className,
|
|
31
|
+
children = _ref.children;
|
|
32
|
+
var classNames = useClassNames(CLASS_NAMES);
|
|
33
|
+
var ref = useRef(null);
|
|
34
|
+
var panelRef = useRef(null);
|
|
35
|
+
var overlayRef = useRef(null);
|
|
36
|
+
var themeColorVars = useThemeColorVars(["surface-dim", "surface-container", "on-surface-variant"]);
|
|
37
|
+
var _useClosable = useClosable({
|
|
38
|
+
closable: closable,
|
|
39
|
+
onClose: onClose
|
|
40
|
+
}),
|
|
41
|
+
onOverlayClick = _useClosable.onOverlayClick,
|
|
42
|
+
onKeyDown = _useClosable.onKeyDown;
|
|
43
|
+
// Focus the sheet when open to receive keyboard events
|
|
44
|
+
useEffect(function () {
|
|
45
|
+
var _ref$current;
|
|
46
|
+
if (!open) return;
|
|
47
|
+
if (contains(ref.current, document.activeElement)) return;
|
|
48
|
+
(_ref$current = ref.current) === null || _ref$current === void 0 || _ref$current.focus();
|
|
49
|
+
}, [open]);
|
|
50
|
+
useAsyncEffect(/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee() {
|
|
51
|
+
return _regenerator().w(function (_context) {
|
|
52
|
+
while (1) switch (_context.n) {
|
|
53
|
+
case 0:
|
|
54
|
+
if (ref.current) {
|
|
55
|
+
_context.n = 1;
|
|
56
|
+
break;
|
|
57
|
+
}
|
|
58
|
+
return _context.a(2);
|
|
59
|
+
case 1:
|
|
60
|
+
if (!open) {
|
|
61
|
+
_context.n = 3;
|
|
62
|
+
break;
|
|
63
|
+
}
|
|
64
|
+
ref.current.style.display = "block";
|
|
65
|
+
_context.n = 2;
|
|
66
|
+
return Promise.all([panelRef.current && animate(panelRef.current, {
|
|
67
|
+
transform: "translateY(0)"
|
|
68
|
+
}, ANIMATION_OPTIONS.enter), overlayRef.current && animate(overlayRef.current, {
|
|
69
|
+
opacity: OPACITY.heavier
|
|
70
|
+
}, ANIMATION_OPTIONS.enter)]);
|
|
71
|
+
case 2:
|
|
72
|
+
return _context.a(2);
|
|
73
|
+
case 3:
|
|
74
|
+
_context.n = 4;
|
|
75
|
+
return Promise.all([panelRef.current && animate(panelRef.current, {
|
|
76
|
+
transform: "translateY(100%)"
|
|
77
|
+
}, ANIMATION_OPTIONS.exit), overlayRef.current && animate(overlayRef.current, {
|
|
78
|
+
opacity: 0
|
|
79
|
+
}, ANIMATION_OPTIONS.exit)]);
|
|
80
|
+
case 4:
|
|
81
|
+
ref.current.style.display = "none";
|
|
82
|
+
onClosed();
|
|
83
|
+
case 5:
|
|
84
|
+
return _context.a(2);
|
|
85
|
+
}
|
|
86
|
+
}, _callee);
|
|
87
|
+
})), [open]);
|
|
88
|
+
var styled = {
|
|
89
|
+
popup: {
|
|
90
|
+
className: "musaex-ixxii4 musaex-10a8y8t musaex-47corl musaex-pje0qt"
|
|
91
|
+
},
|
|
92
|
+
overlay: {
|
|
93
|
+
className: "musaex-10l6tqk musaex-10a8y8t musaex-67bb7w musaex-g01cxk musaex-11we2rp"
|
|
94
|
+
},
|
|
95
|
+
panel: {
|
|
96
|
+
className: "musaex-10l6tqk musaex-1ey2m1c musaex-u96u03 musaex-3m8u43 musaex-67bb7w musaex-17o6occ musaex-zbxit7 musaex-1ei9pc5 musaex-78zum5 musaex-dt5ytf musaex-1bwycvy musaex-b3r6kr musaex-1weeur4"
|
|
97
|
+
},
|
|
98
|
+
handle: {
|
|
99
|
+
className: "musaex-1po6ib musaex-rntz3j musaex-1xa9b2s musaex-9ip8r5 musaex-1eodh35 musaex-19i5tse musaex-vueqy4 musaex-2lah0s"
|
|
100
|
+
},
|
|
101
|
+
body: {
|
|
102
|
+
className: "musaex-98rzlu musaex-ysyzu8 musaex-1y9dh0z"
|
|
103
|
+
}
|
|
104
|
+
};
|
|
105
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
106
|
+
ref: ref,
|
|
107
|
+
tabIndex: -1,
|
|
108
|
+
className: stringify(classNames.sheet, className, styled.popup.className),
|
|
109
|
+
style: _objectSpread(_objectSpread({}, styled.popup.style), {}, {
|
|
110
|
+
display: "none"
|
|
111
|
+
}),
|
|
112
|
+
onKeyDown: onKeyDown
|
|
113
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
114
|
+
ref: overlayRef,
|
|
115
|
+
className: stringify(classNames.overlay, styled.overlay.className),
|
|
116
|
+
style: styled.overlay.style,
|
|
117
|
+
onClick: onOverlayClick
|
|
118
|
+
}), /*#__PURE__*/React.createElement("div", {
|
|
119
|
+
ref: panelRef,
|
|
120
|
+
className: stringify(classNames.panel, styled.panel.className),
|
|
121
|
+
style: _objectSpread(_objectSpread(_objectSpread({}, styled.panel.style), themeColorVars), {}, {
|
|
122
|
+
height: typeof height === "number" ? "".concat(height, "px") : height
|
|
123
|
+
})
|
|
124
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
125
|
+
className: stringify(classNames.handle, styled.handle.className),
|
|
126
|
+
style: styled.handle.style
|
|
127
|
+
}), /*#__PURE__*/React.createElement("div", {
|
|
128
|
+
className: stringify(classNames.body, styled.body.className),
|
|
129
|
+
style: styled.body.style
|
|
130
|
+
}, children)));
|
|
131
|
+
};
|
|
132
|
+
|
|
133
|
+
export { Sheet as default };
|
|
@@ -91,7 +91,7 @@ var Image = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
|
91
91
|
}
|
|
92
92
|
}[!!!isHovered << 1 | !!(actions.size === 1 && actions.has("preview")) << 0],
|
|
93
93
|
img: {
|
|
94
|
-
className: "musaex-92755x musaex-
|
|
94
|
+
className: "musaex-92755x musaex-qg7gut musaex-l1xv1r"
|
|
95
95
|
}
|
|
96
96
|
};
|
|
97
97
|
React.useImperativeHandle(ref, function () {
|
|
@@ -87,7 +87,7 @@ var Image = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
87
87
|
}
|
|
88
88
|
}[!!!isHovered << 1 | !!(actions.size === 1 && actions.has("preview")) << 0],
|
|
89
89
|
img: {
|
|
90
|
-
className: "musaex-92755x musaex-
|
|
90
|
+
className: "musaex-92755x musaex-qg7gut musaex-l1xv1r"
|
|
91
91
|
}
|
|
92
92
|
};
|
|
93
93
|
useImperativeHandle(ref, function () {
|
package/dist/index.cjs
CHANGED
|
@@ -11,6 +11,7 @@ var index$8 = require('./components/rich-text-editor/index.cjs');
|
|
|
11
11
|
var index$6 = require('./components/markdown/index.cjs');
|
|
12
12
|
var badge = require('./components/badge/badge.cjs');
|
|
13
13
|
var bench = require('./components/bench/bench.cjs');
|
|
14
|
+
var bottomSheet = require('./components/bottom-sheet/bottom-sheet.cjs');
|
|
14
15
|
var breadcrumb = require('./components/breadcrumb/breadcrumb.cjs');
|
|
15
16
|
var button = require('./components/button/button.cjs');
|
|
16
17
|
var calendar = require('./components/calendar/calendar.cjs');
|
|
@@ -87,6 +88,7 @@ exports.RichTextEditor = index$8.RichTextEditor;
|
|
|
87
88
|
exports.Markdown = index$6.Markdown;
|
|
88
89
|
exports.Badge = badge.default;
|
|
89
90
|
exports.Bench = bench.default;
|
|
91
|
+
exports.BottomSheet = bottomSheet.default;
|
|
90
92
|
exports.Breadcrumb = breadcrumb.default;
|
|
91
93
|
exports.Button = button.Button;
|
|
92
94
|
exports.Calendar = calendar.default;
|
package/dist/index.d.ts
CHANGED
|
@@ -57,6 +57,7 @@ export { NumberInput } from "./components/number-input";
|
|
|
57
57
|
export { Popconfirm } from "./components/popconfirm";
|
|
58
58
|
export { Highlight } from "./components/highlight";
|
|
59
59
|
export { Bench } from "./components/bench";
|
|
60
|
+
export { BottomSheet } from "./components/bottom-sheet";
|
|
60
61
|
export { I18nButton } from "./components/i18n-button";
|
|
61
62
|
export { RichTextEditor } from "./components/rich-text-editor";
|
|
62
63
|
export { Quote } from "./components/quote";
|
package/dist/index.mjs
CHANGED
|
@@ -9,6 +9,7 @@ export { RichTextEditor } from './components/rich-text-editor/index.mjs';
|
|
|
9
9
|
export { Markdown } from './components/markdown/index.mjs';
|
|
10
10
|
export { default as Badge } from './components/badge/badge.mjs';
|
|
11
11
|
export { default as Bench } from './components/bench/bench.mjs';
|
|
12
|
+
export { default as BottomSheet } from './components/bottom-sheet/bottom-sheet.mjs';
|
|
12
13
|
export { default as Breadcrumb } from './components/breadcrumb/breadcrumb.mjs';
|
|
13
14
|
export { Button } from './components/button/button.mjs';
|
|
14
15
|
export { default as Calendar } from './components/calendar/calendar.mjs';
|
package/dist/styles.css
CHANGED
|
@@ -344,6 +344,10 @@
|
|
|
344
344
|
margin-block: var(--musaex-jo49ah);
|
|
345
345
|
}
|
|
346
346
|
|
|
347
|
+
.musaex-vueqy4 {
|
|
348
|
+
margin-inline: auto;
|
|
349
|
+
}
|
|
350
|
+
|
|
347
351
|
.musaex-15o2aup {
|
|
348
352
|
margin-inline: var(--musaex-16072l3);
|
|
349
353
|
}
|
|
@@ -1476,6 +1480,10 @@
|
|
|
1476
1480
|
transform: translateY(-50%);
|
|
1477
1481
|
}
|
|
1478
1482
|
|
|
1483
|
+
.musaex-1weeur4 {
|
|
1484
|
+
transform: translateY(100%);
|
|
1485
|
+
}
|
|
1486
|
+
|
|
1479
1487
|
.musaex-n7yqov {
|
|
1480
1488
|
transform: var(--default-position);
|
|
1481
1489
|
}
|
|
@@ -1797,6 +1805,10 @@
|
|
|
1797
1805
|
border-top-left-radius: var(--musaex-1035pbm);
|
|
1798
1806
|
}
|
|
1799
1807
|
|
|
1808
|
+
.musaex-zbxit7 {
|
|
1809
|
+
border-top-left-radius: var(--musaex-1hteljg);
|
|
1810
|
+
}
|
|
1811
|
+
|
|
1800
1812
|
.musaex-jizfy5 {
|
|
1801
1813
|
border-top-left-radius: var(--musaex-mw242b);
|
|
1802
1814
|
}
|
|
@@ -1809,6 +1821,10 @@
|
|
|
1809
1821
|
border-top-right-radius: var(--musaex-1035pbm);
|
|
1810
1822
|
}
|
|
1811
1823
|
|
|
1824
|
+
.musaex-1ei9pc5 {
|
|
1825
|
+
border-top-right-radius: var(--musaex-1hteljg);
|
|
1826
|
+
}
|
|
1827
|
+
|
|
1812
1828
|
.musaex-xieajt {
|
|
1813
1829
|
border-top-right-radius: var(--musaex-zv0eff);
|
|
1814
1830
|
}
|
|
@@ -1997,6 +2013,10 @@
|
|
|
1997
2013
|
margin-bottom: var(--musaex-48i97p);
|
|
1998
2014
|
}
|
|
1999
2015
|
|
|
2016
|
+
.musaex-19i5tse {
|
|
2017
|
+
margin-bottom: var(--musaex-jo49ah);
|
|
2018
|
+
}
|
|
2019
|
+
|
|
2000
2020
|
.musaex-16udq8c {
|
|
2001
2021
|
margin-right: var(--musaex-16072l3);
|
|
2002
2022
|
}
|
|
@@ -2041,6 +2061,10 @@
|
|
|
2041
2061
|
margin-top: var(--musaex-jo49ah);
|
|
2042
2062
|
}
|
|
2043
2063
|
|
|
2064
|
+
.musaex-1bwycvy {
|
|
2065
|
+
max-height: 100vh;
|
|
2066
|
+
}
|
|
2067
|
+
|
|
2044
2068
|
.musaex-19nmtej {
|
|
2045
2069
|
max-height: calc(100% - var(--musaex-16suft8) * 2);
|
|
2046
2070
|
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import type { ReactNode } from "react";
|
|
2
|
+
import type { ComponentProps } from "./element";
|
|
3
|
+
import type { Closable } from "../hooks/use-closable";
|
|
4
|
+
export interface BottomSheetProps extends ComponentProps {
|
|
5
|
+
/**
|
|
6
|
+
* @description
|
|
7
|
+
* Controls open/close state of the bottom sheet.
|
|
8
|
+
*/
|
|
9
|
+
open: boolean;
|
|
10
|
+
/**
|
|
11
|
+
* @description
|
|
12
|
+
* Called when the sheet requests to close (overlay click, Esc key).
|
|
13
|
+
*/
|
|
14
|
+
onClose: VoidFunction;
|
|
15
|
+
/**
|
|
16
|
+
* @description
|
|
17
|
+
* Sheet content rendered below the drag handle.
|
|
18
|
+
*/
|
|
19
|
+
children?: ReactNode;
|
|
20
|
+
/**
|
|
21
|
+
* @description
|
|
22
|
+
* Height of the sheet panel. Accepts any CSS height value.
|
|
23
|
+
* @default "50vh"
|
|
24
|
+
*/
|
|
25
|
+
height?: number | string;
|
|
26
|
+
/**
|
|
27
|
+
* @description
|
|
28
|
+
* Whether the sheet can be closed by overlay click or Esc key.
|
|
29
|
+
* Pass an array of `Closable` values to enable specific close triggers.
|
|
30
|
+
* @default true (all triggers enabled)
|
|
31
|
+
*/
|
|
32
|
+
closable?: boolean | Closable[];
|
|
33
|
+
}
|