@astral/ui 4.90.0 → 4.90.1

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,4 +1,5 @@
1
1
  import Badge from '@mui/material/Badge';
2
+ import { iconButtonClassnames } from '../IconButton';
2
3
  import { styled } from '../styled';
3
4
  import { badgeClassnames } from './constants';
4
5
  const getBgColor = ({ $customColor, theme, $variantColor, }) => {
@@ -53,6 +54,12 @@ export const StyledBadge = styled(Badge, {
53
54
  flex-grow: 1;
54
55
  }
55
56
 
57
+ /* Причина игнора: прогрессивное улучшение */
58
+ /* stylelint-disable plugin/no-unsupported-browser-features */
59
+ &:has(.${iconButtonClassnames.root}) {
60
+ width: max-content;
61
+ }
62
+
56
63
  .${badgeClassnames.content} {
57
64
  cursor: default;
58
65
  user-select: none;
@@ -1,9 +1,11 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import { ButtonVariants } from '../Button';
3
3
  import { forwardRefWithGeneric } from '../forwardRefWithGeneric';
4
+ import { classNames } from '../utils/classNames';
5
+ import { iconButtonClassnames } from './constants';
4
6
  import { StyledButton } from './styles';
5
7
  const UnwrappedIconButton = (props, ref) => {
6
- const { variant = ButtonVariants.Contained, children, ...restProps } = props;
7
- return (_jsx(StyledButton, { variant: variant, ...restProps, ref: ref, children: children }));
8
+ const { variant = ButtonVariants.Contained, children, className, ...restProps } = props;
9
+ return (_jsx(StyledButton, { variant: variant, className: classNames(iconButtonClassnames.root, className), ...restProps, ref: ref, children: children }));
8
10
  };
9
11
  export const IconButton = forwardRefWithGeneric(UnwrappedIconButton);
@@ -0,0 +1,3 @@
1
+ export declare const iconButtonClassnames: {
2
+ root: string;
3
+ };
@@ -0,0 +1,4 @@
1
+ import { createUIKitClassname } from '../utils/createUIKitClassname';
2
+ export const iconButtonClassnames = {
3
+ root: createUIKitClassname('icon-button'),
4
+ };
@@ -1 +1,2 @@
1
1
  export * from './IconButton';
2
+ export { iconButtonClassnames } from './constants';
@@ -1 +1,2 @@
1
1
  export * from './IconButton';
2
+ export { iconButtonClassnames } from './constants';
@@ -1 +1,2 @@
1
+ export { iconButtonClassnames } from './constants';
1
2
  export * from './IconButton';
@@ -1 +1,2 @@
1
+ export { iconButtonClassnames } from './constants';
1
2
  export * from './IconButton';
@@ -5,6 +5,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.StyledBadge = void 0;
7
7
  const Badge_1 = __importDefault(require("@mui/material/Badge"));
8
+ const IconButton_1 = require("../IconButton");
8
9
  const styled_1 = require("../styled");
9
10
  const constants_1 = require("./constants");
10
11
  const getBgColor = ({ $customColor, theme, $variantColor, }) => {
@@ -59,6 +60,12 @@ exports.StyledBadge = (0, styled_1.styled)(Badge_1.default, {
59
60
  flex-grow: 1;
60
61
  }
61
62
 
63
+ /* Причина игнора: прогрессивное улучшение */
64
+ /* stylelint-disable plugin/no-unsupported-browser-features */
65
+ &:has(.${IconButton_1.iconButtonClassnames.root}) {
66
+ width: max-content;
67
+ }
68
+
62
69
  .${constants_1.badgeClassnames.content} {
63
70
  cursor: default;
64
71
  user-select: none;
@@ -4,9 +4,11 @@ exports.IconButton = void 0;
4
4
  const jsx_runtime_1 = require("react/jsx-runtime");
5
5
  const Button_1 = require("../Button");
6
6
  const forwardRefWithGeneric_1 = require("../forwardRefWithGeneric");
7
+ const classNames_1 = require("../utils/classNames");
8
+ const constants_1 = require("./constants");
7
9
  const styles_1 = require("./styles");
8
10
  const UnwrappedIconButton = (props, ref) => {
9
- const { variant = Button_1.ButtonVariants.Contained, children, ...restProps } = props;
10
- return ((0, jsx_runtime_1.jsx)(styles_1.StyledButton, { variant: variant, ...restProps, ref: ref, children: children }));
11
+ const { variant = Button_1.ButtonVariants.Contained, children, className, ...restProps } = props;
12
+ return ((0, jsx_runtime_1.jsx)(styles_1.StyledButton, { variant: variant, className: (0, classNames_1.classNames)(constants_1.iconButtonClassnames.root, className), ...restProps, ref: ref, children: children }));
11
13
  };
12
14
  exports.IconButton = (0, forwardRefWithGeneric_1.forwardRefWithGeneric)(UnwrappedIconButton);
@@ -0,0 +1,3 @@
1
+ export declare const iconButtonClassnames: {
2
+ root: string;
3
+ };
@@ -0,0 +1,7 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.iconButtonClassnames = void 0;
4
+ const createUIKitClassname_1 = require("../utils/createUIKitClassname");
5
+ exports.iconButtonClassnames = {
6
+ root: (0, createUIKitClassname_1.createUIKitClassname)('icon-button'),
7
+ };
@@ -1 +1,2 @@
1
1
  export * from './IconButton';
2
+ export { iconButtonClassnames } from './constants';
@@ -14,4 +14,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
14
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
+ exports.iconButtonClassnames = void 0;
17
18
  __exportStar(require("./IconButton"), exports);
19
+ var constants_1 = require("./constants");
20
+ Object.defineProperty(exports, "iconButtonClassnames", { enumerable: true, get: function () { return constants_1.iconButtonClassnames; } });
@@ -1 +1,2 @@
1
+ export { iconButtonClassnames } from './constants';
1
2
  export * from './IconButton';
@@ -14,4 +14,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
14
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
+ exports.iconButtonClassnames = void 0;
18
+ var constants_1 = require("./constants");
19
+ Object.defineProperty(exports, "iconButtonClassnames", { enumerable: true, get: function () { return constants_1.iconButtonClassnames; } });
17
20
  __exportStar(require("./IconButton"), exports);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@astral/ui",
3
- "version": "4.90.0",
3
+ "version": "4.90.1",
4
4
  "browser": "./index.js",
5
5
  "main": "./node/index.js",
6
6
  "dependencies": {