@onesy/ui-react 1.0.128 → 1.0.129
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.
|
@@ -1,10 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { ISurface } from '../Surface/Surface';
|
|
3
|
-
import { IElement } from '../types';
|
|
4
3
|
export declare type IBottomAppBar = ISurface & {
|
|
5
|
-
main?: IElement;
|
|
6
4
|
fixed?: boolean;
|
|
7
|
-
noTransition?: boolean;
|
|
8
5
|
};
|
|
9
6
|
declare const BottomAppBar: React.FC<IBottomAppBar>;
|
|
10
7
|
export default BottomAppBar;
|
|
@@ -22,7 +22,7 @@ const Surface_1 = __importDefault(require("../Surface"));
|
|
|
22
22
|
const utils_1 = require("../utils");
|
|
23
23
|
const useStyle = (0, style_react_1.style)(theme => ({
|
|
24
24
|
root: {
|
|
25
|
-
background: theme.palette.color.primary[theme.palette.light ? 100 : 5],
|
|
25
|
+
background: theme.methods.palette.color.alpha(theme.palette.color.primary[theme.palette.light ? 100 : 5], 0.94),
|
|
26
26
|
boxShadow: '0px 8px 10px 1px rgb(0 0 0 / 1%), 0px 3px 14px 2px rgb(0 0 0 / 1%), 0px 5px 5px -3px rgb(0 0 0 / 4%)',
|
|
27
27
|
borderRadius: '500px',
|
|
28
28
|
zIndex: theme.z_index.app_bar,
|
|
@@ -37,7 +37,7 @@ const useStyle = (0, style_react_1.style)(theme => ({
|
|
|
37
37
|
size_large: { padding: '18px 30px' },
|
|
38
38
|
fixed: {
|
|
39
39
|
position: 'fixed',
|
|
40
|
-
bottom: '
|
|
40
|
+
bottom: '8px',
|
|
41
41
|
left: '50%',
|
|
42
42
|
transform: 'translateX(-50%)'
|
|
43
43
|
}
|
|
@@ -47,9 +47,9 @@ const BottomAppBar = react_1.default.forwardRef((props_, ref) => {
|
|
|
47
47
|
const props = react_1.default.useMemo(() => { var _a, _b, _c, _d, _e, _f, _g, _h; return (Object.assign(Object.assign(Object.assign({}, (_d = (_c = (_b = (_a = theme === null || theme === void 0 ? void 0 : theme.ui) === null || _a === void 0 ? void 0 : _a.elements) === null || _b === void 0 ? void 0 : _b.all) === null || _c === void 0 ? void 0 : _c.props) === null || _d === void 0 ? void 0 : _d.default), (_h = (_g = (_f = (_e = theme === null || theme === void 0 ? void 0 : theme.ui) === null || _e === void 0 ? void 0 : _e.elements) === null || _f === void 0 ? void 0 : _f.onesyBottomAppBar) === null || _g === void 0 ? void 0 : _g.props) === null || _h === void 0 ? void 0 : _h.default), props_)); }, [props_]);
|
|
48
48
|
const Line = react_1.default.useMemo(() => { var _a; return ((_a = theme === null || theme === void 0 ? void 0 : theme.elements) === null || _a === void 0 ? void 0 : _a.Line) || Line_1.default; }, [theme]);
|
|
49
49
|
const Surface = react_1.default.useMemo(() => { var _a; return ((_a = theme === null || theme === void 0 ? void 0 : theme.elements) === null || _a === void 0 ? void 0 : _a.Surface) || Surface_1.default; }, [theme]);
|
|
50
|
-
const { tonal = true, color = 'default', size = 'regular', fixed = true, className,
|
|
50
|
+
const { tonal = true, color = 'default', size = 'regular', fixed = true, className, style, children } = props, other = __rest(props, ["tonal", "color", "size", "fixed", "className", "style", "children"]);
|
|
51
51
|
const { classes } = useStyle();
|
|
52
|
-
return ((0, jsx_runtime_1.jsx)(Surface, Object.assign({ ref: ref, color: color, tonal: tonal, gap: 4, direction: 'row', align: 'center', justify: 'space-between',
|
|
52
|
+
return ((0, jsx_runtime_1.jsx)(Surface, Object.assign({ ref: ref, color: color, tonal: tonal, gap: 4, direction: 'row', align: 'center', justify: 'space-between', Component: Line, className: (0, style_react_1.classNames)([
|
|
53
53
|
(0, utils_1.staticClassName)('BottomAppBar', theme) && [
|
|
54
54
|
'onesy-BottomAppBar-root',
|
|
55
55
|
`onesy-BottomAppBar-size-${size}`
|
|
@@ -58,7 +58,7 @@ const BottomAppBar = react_1.default.forwardRef((props_, ref) => {
|
|
|
58
58
|
classes.root,
|
|
59
59
|
classes[`size_${size}`],
|
|
60
60
|
fixed && classes.fixed
|
|
61
|
-
]), style: Object.assign({
|
|
61
|
+
]), style: Object.assign({ maxWidth: `clamp(100px, ${((children === null || children === void 0 ? void 0 : children.length) || 3) * 110}px, calc(100vw - 24px))` }, style) }, other, { children: children })));
|
|
62
62
|
});
|
|
63
63
|
BottomAppBar.displayName = 'onesy-BottomAppBar';
|
|
64
64
|
exports.default = BottomAppBar;
|
|
@@ -28,10 +28,8 @@ const useStyle = (0, style_react_1.style)(theme => ({
|
|
|
28
28
|
display: 'inline-flex',
|
|
29
29
|
justifyContent: 'center',
|
|
30
30
|
flex: '1 1 auto',
|
|
31
|
-
userSelect: 'none',
|
|
32
31
|
cursor: 'pointer',
|
|
33
|
-
|
|
34
|
-
minHeight: '80px',
|
|
32
|
+
userSelect: 'none'
|
|
35
33
|
},
|
|
36
34
|
vertical: {
|
|
37
35
|
flex: '0 0 auto',
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
2
|
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
3
3
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
4
|
-
const _excluded = ["tonal", "color", "size", "fixed", "className", "
|
|
4
|
+
const _excluded = ["tonal", "color", "size", "fixed", "className", "style", "children"];
|
|
5
5
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
6
6
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
7
7
|
import React from 'react';
|
|
@@ -11,7 +11,7 @@ import SurfaceElement from '../Surface';
|
|
|
11
11
|
import { staticClassName } from '../utils';
|
|
12
12
|
const useStyle = styleMethod(theme => ({
|
|
13
13
|
root: {
|
|
14
|
-
background: theme.palette.color.primary[theme.palette.light ? 100 : 5],
|
|
14
|
+
background: theme.methods.palette.color.alpha(theme.palette.color.primary[theme.palette.light ? 100 : 5], 0.94),
|
|
15
15
|
boxShadow: '0px 8px 10px 1px rgb(0 0 0 / 1%), 0px 3px 14px 2px rgb(0 0 0 / 1%), 0px 5px 5px -3px rgb(0 0 0 / 4%)',
|
|
16
16
|
borderRadius: '500px',
|
|
17
17
|
zIndex: theme.z_index.app_bar,
|
|
@@ -32,7 +32,7 @@ const useStyle = styleMethod(theme => ({
|
|
|
32
32
|
},
|
|
33
33
|
fixed: {
|
|
34
34
|
position: 'fixed',
|
|
35
|
-
bottom: '
|
|
35
|
+
bottom: '8px',
|
|
36
36
|
left: '50%',
|
|
37
37
|
transform: 'translateX(-50%)'
|
|
38
38
|
}
|
|
@@ -50,8 +50,8 @@ const BottomAppBar = /*#__PURE__*/React.forwardRef((props_, ref) => {
|
|
|
50
50
|
size = 'regular',
|
|
51
51
|
fixed = true,
|
|
52
52
|
className,
|
|
53
|
-
|
|
54
|
-
|
|
53
|
+
style,
|
|
54
|
+
children
|
|
55
55
|
} = props,
|
|
56
56
|
other = _objectWithoutProperties(props, _excluded);
|
|
57
57
|
const {
|
|
@@ -65,11 +65,10 @@ const BottomAppBar = /*#__PURE__*/React.forwardRef((props_, ref) => {
|
|
|
65
65
|
direction: "row",
|
|
66
66
|
align: "center",
|
|
67
67
|
justify: "space-between",
|
|
68
|
-
fullWidth: true,
|
|
69
68
|
Component: Line,
|
|
70
69
|
className: classNames([staticClassName('BottomAppBar', theme) && ['onesy-BottomAppBar-root', `onesy-BottomAppBar-size-${size}`], className, classes.root, classes[`size_${size}`], fixed && classes.fixed]),
|
|
71
70
|
style: _objectSpread({
|
|
72
|
-
|
|
71
|
+
maxWidth: `clamp(100px, ${(children?.length || 3) * 110}px, calc(100vw - 24px))`
|
|
73
72
|
}, style)
|
|
74
73
|
}, other), children);
|
|
75
74
|
});
|
|
@@ -17,10 +17,8 @@ const useStyle = styleMethod(theme => ({
|
|
|
17
17
|
display: 'inline-flex',
|
|
18
18
|
justifyContent: 'center',
|
|
19
19
|
flex: '1 1 auto',
|
|
20
|
-
userSelect: 'none',
|
|
21
20
|
cursor: 'pointer',
|
|
22
|
-
|
|
23
|
-
minHeight: '80px'
|
|
21
|
+
userSelect: 'none'
|
|
24
22
|
},
|
|
25
23
|
vertical: {
|
|
26
24
|
flex: '0 0 auto',
|
package/esm/index.js
CHANGED