@astral/ui 4.80.1 → 4.82.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.
@@ -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 { collapsedIn, isPopupOpen, setIsPopupOpen } = useContext(DashboardSidebarContext);
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: _jsx(Collapse, { orientation: "horizontal", in: collapsedIn, children: children }) }), popover] }));
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
- ${({ theme }) => theme.breakpoints.down('sm')} {
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
- && > .MuiButton-endIcon {
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
  `;
@@ -1,8 +1,9 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { OverflowTypography } from '../../OverflowTypography';
2
3
  import { StyledTag } from './styles';
3
4
  import { useLogic } from './useLogic';
4
5
  export const Tag = (props) => {
5
6
  const { onMouseDown } = useLogic();
6
- const { shrinks, isDisabled, ...restProps } = props;
7
- return (_jsx(StyledTag, { "$shrinks": shrinks, color: "grey", variant: "light", disabled: isDisabled, ...restProps, onMouseDown: onMouseDown }));
7
+ const { shrinks, isDisabled, label, ...restProps } = props;
8
+ return (_jsx(StyledTag, { "$shrinks": shrinks, color: "grey", variant: "light", disabled: isDisabled, label: _jsx(OverflowTypography, { children: label }), ...restProps, onMouseDown: onMouseDown }));
8
9
  };
@@ -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 { collapsedIn, isPopupOpen, setIsPopupOpen } = (0, react_1.useContext)(DashboardSidebarProvider_1.DashboardSidebarContext);
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: (0, jsx_runtime_1.jsx)(Collapse_1.Collapse, { orientation: "horizontal", in: collapsedIn, children: children }) }), popover] }));
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
- ${({ theme }) => theme.breakpoints.down('sm')} {
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
- && > .MuiButton-endIcon {
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
  `;
@@ -2,11 +2,12 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.Tag = void 0;
4
4
  const jsx_runtime_1 = require("react/jsx-runtime");
5
+ const OverflowTypography_1 = require("../../OverflowTypography");
5
6
  const styles_1 = require("./styles");
6
7
  const useLogic_1 = require("./useLogic");
7
8
  const Tag = (props) => {
8
9
  const { onMouseDown } = (0, useLogic_1.useLogic)();
9
- const { shrinks, isDisabled, ...restProps } = props;
10
- return ((0, jsx_runtime_1.jsx)(styles_1.StyledTag, { "$shrinks": shrinks, color: "grey", variant: "light", disabled: isDisabled, ...restProps, onMouseDown: onMouseDown }));
10
+ const { shrinks, isDisabled, label, ...restProps } = props;
11
+ return ((0, jsx_runtime_1.jsx)(styles_1.StyledTag, { "$shrinks": shrinks, color: "grey", variant: "light", disabled: isDisabled, label: (0, jsx_runtime_1.jsx)(OverflowTypography_1.OverflowTypography, { children: label }), ...restProps, onMouseDown: onMouseDown }));
11
12
  };
12
13
  exports.Tag = Tag;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@astral/ui",
3
- "version": "4.80.1",
3
+ "version": "4.82.0",
4
4
  "browser": "./index.js",
5
5
  "main": "./node/index.js",
6
6
  "dependencies": {