@astral/ui 4.80.0 → 4.81.0
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/components/DashboardMenuSidebarButton/DashboardMenuSidebarButton.js +2 -3
- package/components/DashboardSidebarButton/styles.js +24 -8
- package/components/fileUploading/services/MimeTypeRegistry/constants.js +11 -1
- package/node/components/DashboardMenuSidebarButton/DashboardMenuSidebarButton.js +2 -3
- package/node/components/DashboardSidebarButton/styles.js +23 -7
- package/node/components/fileUploading/services/MimeTypeRegistry/constants.js +11 -1
- package/package.json +1 -1
|
@@ -1,16 +1,15 @@
|
|
|
1
1
|
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { forwardRef, useContext } from 'react';
|
|
3
|
-
import { Collapse } from '../Collapse';
|
|
4
3
|
import { DashboardSidebarButton } from '../DashboardSidebarButton';
|
|
5
4
|
import { DashboardSidebarContext } from '../DashboardSidebarProvider';
|
|
6
5
|
import { useLogic } from './useLogic';
|
|
7
6
|
export const DashboardMenuSidebarButton = forwardRef((props, ref) => {
|
|
8
|
-
const {
|
|
7
|
+
const { isPopupOpen, setIsPopupOpen } = useContext(DashboardSidebarContext);
|
|
9
8
|
const { handleTogglePopover, popoverAnchorRef } = useLogic({
|
|
10
9
|
isPopupOpen,
|
|
11
10
|
setIsPopupOpen,
|
|
12
11
|
ref,
|
|
13
12
|
});
|
|
14
13
|
const { children, popover, ...buttonProps } = props;
|
|
15
|
-
return (_jsxs(_Fragment, { children: [_jsx(DashboardSidebarButton, { ref: popoverAnchorRef, ...buttonProps, onClick: handleTogglePopover, selected: isPopupOpen, children:
|
|
14
|
+
return (_jsxs(_Fragment, { children: [_jsx(DashboardSidebarButton, { ref: popoverAnchorRef, ...buttonProps, onClick: handleTogglePopover, selected: isPopupOpen, children: children }), popover] }));
|
|
16
15
|
});
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Button as UIKitButton, } from '../Button';
|
|
1
|
+
import { buttonClasses, Button as UIKitButton, } from '../Button';
|
|
2
2
|
import { styled } from '../styled';
|
|
3
3
|
export const SidebarButton = styled(UIKitButton, {
|
|
4
4
|
shouldForwardProp: (prop) => !['$isOpen'].includes(prop),
|
|
@@ -18,12 +18,7 @@ export const SidebarButton = styled(UIKitButton, {
|
|
|
18
18
|
});
|
|
19
19
|
}};
|
|
20
20
|
|
|
21
|
-
|
|
22
|
-
height: 48px;
|
|
23
|
-
max-height: 48px;
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
&& > .MuiButton-startIcon {
|
|
21
|
+
&& > .${buttonClasses.startIcon} {
|
|
27
22
|
margin-right: ${({ theme, $isOpen }) => !$isOpen ? theme.spacing(-2) : theme.spacing(0)};
|
|
28
23
|
|
|
29
24
|
transition: ${({ theme }) => {
|
|
@@ -33,7 +28,7 @@ export const SidebarButton = styled(UIKitButton, {
|
|
|
33
28
|
}};
|
|
34
29
|
}
|
|
35
30
|
|
|
36
|
-
&& > .
|
|
31
|
+
&& > .${buttonClasses.endIcon} {
|
|
37
32
|
margin-right: ${({ theme, $isOpen }) => !$isOpen ? theme.spacing(2) : theme.spacing(0)};
|
|
38
33
|
|
|
39
34
|
transition: ${({ theme }) => {
|
|
@@ -42,4 +37,25 @@ export const SidebarButton = styled(UIKitButton, {
|
|
|
42
37
|
});
|
|
43
38
|
}};
|
|
44
39
|
}
|
|
40
|
+
|
|
41
|
+
${({ theme }) => theme.breakpoints.down('sm')} {
|
|
42
|
+
min-width: 100%;
|
|
43
|
+
max-width: 100%;
|
|
44
|
+
height: 48px;
|
|
45
|
+
max-height: 48px;
|
|
46
|
+
|
|
47
|
+
transition: none;
|
|
48
|
+
|
|
49
|
+
&& > .${buttonClasses.startIcon} {
|
|
50
|
+
margin-right: ${({ theme }) => theme.spacing(0)};
|
|
51
|
+
|
|
52
|
+
transition: none;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
&& > .${buttonClasses.endIcon} {
|
|
56
|
+
margin-right: ${({ theme }) => theme.spacing(0)};
|
|
57
|
+
|
|
58
|
+
transition: none;
|
|
59
|
+
}
|
|
60
|
+
}
|
|
45
61
|
`;
|
|
@@ -248,7 +248,17 @@ export const getMimeTypesMap = () => ({
|
|
|
248
248
|
'image/ief': ['ief'],
|
|
249
249
|
'image/jls': ['jls'],
|
|
250
250
|
'image/jp2': ['jp2', 'jpg2'],
|
|
251
|
-
'image/jpeg': ['jpeg', 'jpg', 'jpe'],
|
|
251
|
+
'image/jpeg': ['jpeg', 'jpg', 'jpe', '.pjpg', 'jfif', 'jfif-tbnl', 'jif'],
|
|
252
|
+
'image/pjpeg': [
|
|
253
|
+
'.jpe',
|
|
254
|
+
'.jpeg',
|
|
255
|
+
'.jpg',
|
|
256
|
+
'.pjpg',
|
|
257
|
+
'.jfi',
|
|
258
|
+
' .jfif',
|
|
259
|
+
'.jfif-tbnl',
|
|
260
|
+
' .jif',
|
|
261
|
+
],
|
|
252
262
|
'image/jph': ['jph'],
|
|
253
263
|
'image/jphc': ['jhc'],
|
|
254
264
|
'image/jpm': ['jpm'],
|
|
@@ -3,17 +3,16 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.DashboardMenuSidebarButton = void 0;
|
|
4
4
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
5
|
const react_1 = require("react");
|
|
6
|
-
const Collapse_1 = require("../Collapse");
|
|
7
6
|
const DashboardSidebarButton_1 = require("../DashboardSidebarButton");
|
|
8
7
|
const DashboardSidebarProvider_1 = require("../DashboardSidebarProvider");
|
|
9
8
|
const useLogic_1 = require("./useLogic");
|
|
10
9
|
exports.DashboardMenuSidebarButton = (0, react_1.forwardRef)((props, ref) => {
|
|
11
|
-
const {
|
|
10
|
+
const { isPopupOpen, setIsPopupOpen } = (0, react_1.useContext)(DashboardSidebarProvider_1.DashboardSidebarContext);
|
|
12
11
|
const { handleTogglePopover, popoverAnchorRef } = (0, useLogic_1.useLogic)({
|
|
13
12
|
isPopupOpen,
|
|
14
13
|
setIsPopupOpen,
|
|
15
14
|
ref,
|
|
16
15
|
});
|
|
17
16
|
const { children, popover, ...buttonProps } = props;
|
|
18
|
-
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(DashboardSidebarButton_1.DashboardSidebarButton, { ref: popoverAnchorRef, ...buttonProps, onClick: handleTogglePopover, selected: isPopupOpen, children:
|
|
17
|
+
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(DashboardSidebarButton_1.DashboardSidebarButton, { ref: popoverAnchorRef, ...buttonProps, onClick: handleTogglePopover, selected: isPopupOpen, children: children }), popover] }));
|
|
19
18
|
});
|
|
@@ -21,12 +21,7 @@ exports.SidebarButton = (0, styled_1.styled)(Button_1.Button, {
|
|
|
21
21
|
});
|
|
22
22
|
}};
|
|
23
23
|
|
|
24
|
-
|
|
25
|
-
height: 48px;
|
|
26
|
-
max-height: 48px;
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
&& > .MuiButton-startIcon {
|
|
24
|
+
&& > .${Button_1.buttonClasses.startIcon} {
|
|
30
25
|
margin-right: ${({ theme, $isOpen }) => !$isOpen ? theme.spacing(-2) : theme.spacing(0)};
|
|
31
26
|
|
|
32
27
|
transition: ${({ theme }) => {
|
|
@@ -36,7 +31,7 @@ exports.SidebarButton = (0, styled_1.styled)(Button_1.Button, {
|
|
|
36
31
|
}};
|
|
37
32
|
}
|
|
38
33
|
|
|
39
|
-
&& > .
|
|
34
|
+
&& > .${Button_1.buttonClasses.endIcon} {
|
|
40
35
|
margin-right: ${({ theme, $isOpen }) => !$isOpen ? theme.spacing(2) : theme.spacing(0)};
|
|
41
36
|
|
|
42
37
|
transition: ${({ theme }) => {
|
|
@@ -45,4 +40,25 @@ exports.SidebarButton = (0, styled_1.styled)(Button_1.Button, {
|
|
|
45
40
|
});
|
|
46
41
|
}};
|
|
47
42
|
}
|
|
43
|
+
|
|
44
|
+
${({ theme }) => theme.breakpoints.down('sm')} {
|
|
45
|
+
min-width: 100%;
|
|
46
|
+
max-width: 100%;
|
|
47
|
+
height: 48px;
|
|
48
|
+
max-height: 48px;
|
|
49
|
+
|
|
50
|
+
transition: none;
|
|
51
|
+
|
|
52
|
+
&& > .${Button_1.buttonClasses.startIcon} {
|
|
53
|
+
margin-right: ${({ theme }) => theme.spacing(0)};
|
|
54
|
+
|
|
55
|
+
transition: none;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
&& > .${Button_1.buttonClasses.endIcon} {
|
|
59
|
+
margin-right: ${({ theme }) => theme.spacing(0)};
|
|
60
|
+
|
|
61
|
+
transition: none;
|
|
62
|
+
}
|
|
63
|
+
}
|
|
48
64
|
`;
|
|
@@ -251,7 +251,17 @@ const getMimeTypesMap = () => ({
|
|
|
251
251
|
'image/ief': ['ief'],
|
|
252
252
|
'image/jls': ['jls'],
|
|
253
253
|
'image/jp2': ['jp2', 'jpg2'],
|
|
254
|
-
'image/jpeg': ['jpeg', 'jpg', 'jpe'],
|
|
254
|
+
'image/jpeg': ['jpeg', 'jpg', 'jpe', '.pjpg', 'jfif', 'jfif-tbnl', 'jif'],
|
|
255
|
+
'image/pjpeg': [
|
|
256
|
+
'.jpe',
|
|
257
|
+
'.jpeg',
|
|
258
|
+
'.jpg',
|
|
259
|
+
'.pjpg',
|
|
260
|
+
'.jfi',
|
|
261
|
+
' .jfif',
|
|
262
|
+
'.jfif-tbnl',
|
|
263
|
+
' .jif',
|
|
264
|
+
],
|
|
255
265
|
'image/jph': ['jph'],
|
|
256
266
|
'image/jphc': ['jhc'],
|
|
257
267
|
'image/jpm': ['jpm'],
|