@astral/ui 4.90.0 → 4.91.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/Badge/styles.js +7 -0
- package/components/DescriptionList/DescriptionList.js +2 -4
- package/components/DescriptionList/styles.d.ts +0 -11
- package/components/DescriptionList/styles.js +0 -7
- package/components/IconButton/IconButton.js +4 -2
- package/components/IconButton/constants.d.ts +3 -0
- package/components/IconButton/constants.js +4 -0
- package/components/IconButton/index.d.ts +1 -0
- package/components/IconButton/index.js +1 -0
- package/components/IconButton/public.d.ts +1 -0
- package/components/IconButton/public.js +1 -0
- package/node/components/Badge/styles.js +7 -0
- package/node/components/DescriptionList/DescriptionList.js +1 -3
- package/node/components/DescriptionList/styles.d.ts +0 -11
- package/node/components/DescriptionList/styles.js +1 -8
- package/node/components/IconButton/IconButton.js +4 -2
- package/node/components/IconButton/constants.d.ts +3 -0
- package/node/components/IconButton/constants.js +7 -0
- package/node/components/IconButton/index.d.ts +1 -0
- package/node/components/IconButton/index.js +3 -0
- package/node/components/IconButton/public.d.ts +1 -0
- package/node/components/IconButton/public.js +3 -0
- package/package.json +1 -1
|
@@ -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;
|
|
@@ -6,9 +6,8 @@ import { Tag } from '../Tag';
|
|
|
6
6
|
import { Typography } from '../Typography';
|
|
7
7
|
import { cva } from '../utils/cva';
|
|
8
8
|
import { descriptionListClassnames } from './constants';
|
|
9
|
-
import { DescriptionWrapper, ListWrapper, StyledDescriptionName,
|
|
9
|
+
import { DescriptionWrapper, ListWrapper, StyledDescriptionName, Title, Wrapper, } from './styles';
|
|
10
10
|
import { useLogic } from './useLogic';
|
|
11
|
-
import { getTooltipProps } from './utils';
|
|
12
11
|
const descriptionList = cva(descriptionListClassnames.root, {
|
|
13
12
|
variants: {
|
|
14
13
|
variant: {
|
|
@@ -39,8 +38,7 @@ export const DescriptionList = ({ items, variant: listVariant = 'default', title
|
|
|
39
38
|
return (_jsx(Description.Value, { isHidePersonalData: optionProps.isHidePersonalData, children: _jsx(Tag, { label: value, color: color, variant: "light" }) }));
|
|
40
39
|
}
|
|
41
40
|
if (variant === 'guid') {
|
|
42
|
-
|
|
43
|
-
return (_jsx(StyledDescriptionValue, { canCopy: canCopy, "$isCopy": canCopy, color: color, copyPosition: copyPosition, copyText: copyText, children: _jsx(GuidTypography, { tooltipProps: tooltipProps, children: value }) }));
|
|
41
|
+
return (_jsx(Description.Value, { isHidePersonalData: optionProps.isHidePersonalData, children: _jsx(GuidTypography, { copyParams: { copyText: copyText || String(value) }, canCopy: canCopy, children: value }) }));
|
|
44
42
|
}
|
|
45
43
|
return (_jsx(Description.Value, { canCopy: canCopy, color: color, copyPosition: copyPosition, isHidePersonalData: optionProps.isHidePersonalData, children: value }));
|
|
46
44
|
}, []);
|
|
@@ -20,17 +20,6 @@ export declare const ListWrapper: import("../styled").StyledComponent<{
|
|
|
20
20
|
$variant?: DescriptionListVariant | undefined;
|
|
21
21
|
$hasDivider: boolean;
|
|
22
22
|
}, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDListElement>, HTMLDListElement>, {}>;
|
|
23
|
-
export declare const StyledDescriptionValue: import("../styled").StyledComponent<Pick<import("../Typography").TypographyProps, "color" | "children" | "variant" | "isTabularNums"> & {
|
|
24
|
-
stub?: import("react").ReactNode;
|
|
25
|
-
canCopy?: boolean | undefined;
|
|
26
|
-
copyPosition?: "left" | "right" | undefined;
|
|
27
|
-
copyText?: string | undefined;
|
|
28
|
-
isHidePersonalData?: boolean | undefined;
|
|
29
|
-
} & {
|
|
30
|
-
theme?: import("@emotion/react").Theme | undefined;
|
|
31
|
-
} & {
|
|
32
|
-
$isCopy?: boolean | undefined;
|
|
33
|
-
}, {}, {}>;
|
|
34
23
|
export declare const DescriptionWrapper: import("../styled").StyledComponent<{
|
|
35
24
|
theme?: import("@emotion/react").Theme | undefined;
|
|
36
25
|
as?: import("react").ElementType<any, keyof import("react").JSX.IntrinsicElements> | undefined;
|
|
@@ -49,13 +49,6 @@ export const ListWrapper = styled('dl', {
|
|
|
49
49
|
row-gap: ${({ theme }) => theme.spacing(3)};
|
|
50
50
|
}
|
|
51
51
|
`;
|
|
52
|
-
export const StyledDescriptionValue = styled(Description.Value, {
|
|
53
|
-
shouldForwardProp: (prop) => !['$isCopy'].includes(prop),
|
|
54
|
-
}) `
|
|
55
|
-
display: ${({ $isCopy }) => $isCopy && 'flex'};
|
|
56
|
-
|
|
57
|
-
width: ${({ $isCopy }) => $isCopy && 'calc(100% - 20px)'};
|
|
58
|
-
`;
|
|
59
52
|
export const DescriptionWrapper = styled.div `
|
|
60
53
|
display: flex;
|
|
61
54
|
flex-direction: column;
|
|
@@ -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);
|
|
@@ -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;
|
|
@@ -11,7 +11,6 @@ const cva_1 = require("../utils/cva");
|
|
|
11
11
|
const constants_1 = require("./constants");
|
|
12
12
|
const styles_1 = require("./styles");
|
|
13
13
|
const useLogic_1 = require("./useLogic");
|
|
14
|
-
const utils_1 = require("./utils");
|
|
15
14
|
const descriptionList = (0, cva_1.cva)(constants_1.descriptionListClassnames.root, {
|
|
16
15
|
variants: {
|
|
17
16
|
variant: {
|
|
@@ -42,8 +41,7 @@ const DescriptionList = ({ items, variant: listVariant = 'default', title, direc
|
|
|
42
41
|
return ((0, jsx_runtime_1.jsx)(Description_1.Description.Value, { isHidePersonalData: optionProps.isHidePersonalData, children: (0, jsx_runtime_1.jsx)(Tag_1.Tag, { label: value, color: color, variant: "light" }) }));
|
|
43
42
|
}
|
|
44
43
|
if (variant === 'guid') {
|
|
45
|
-
|
|
46
|
-
return ((0, jsx_runtime_1.jsx)(styles_1.StyledDescriptionValue, { canCopy: canCopy, "$isCopy": canCopy, color: color, copyPosition: copyPosition, copyText: copyText, children: (0, jsx_runtime_1.jsx)(GuidTypography_1.GuidTypography, { tooltipProps: tooltipProps, children: value }) }));
|
|
44
|
+
return ((0, jsx_runtime_1.jsx)(Description_1.Description.Value, { isHidePersonalData: optionProps.isHidePersonalData, children: (0, jsx_runtime_1.jsx)(GuidTypography_1.GuidTypography, { copyParams: { copyText: copyText || String(value) }, canCopy: canCopy, children: value }) }));
|
|
47
45
|
}
|
|
48
46
|
return ((0, jsx_runtime_1.jsx)(Description_1.Description.Value, { canCopy: canCopy, color: color, copyPosition: copyPosition, isHidePersonalData: optionProps.isHidePersonalData, children: value }));
|
|
49
47
|
}, []);
|
|
@@ -20,17 +20,6 @@ export declare const ListWrapper: import("@emotion/styled/dist/declarations/src/
|
|
|
20
20
|
$variant?: DescriptionListVariant | undefined;
|
|
21
21
|
$hasDivider: boolean;
|
|
22
22
|
}, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDListElement>, HTMLDListElement>, {}>;
|
|
23
|
-
export declare const StyledDescriptionValue: import("@emotion/styled/dist/declarations/src/types").StyledComponent<Pick<import("../Typography").TypographyProps, "color" | "children" | "variant" | "isTabularNums"> & {
|
|
24
|
-
stub?: import("react").ReactNode;
|
|
25
|
-
canCopy?: boolean | undefined;
|
|
26
|
-
copyPosition?: "left" | "right" | undefined;
|
|
27
|
-
copyText?: string | undefined;
|
|
28
|
-
isHidePersonalData?: boolean | undefined;
|
|
29
|
-
} & {
|
|
30
|
-
theme?: import("@emotion/react").Theme | undefined;
|
|
31
|
-
} & {
|
|
32
|
-
$isCopy?: boolean | undefined;
|
|
33
|
-
}, {}, {}>;
|
|
34
23
|
export declare const DescriptionWrapper: import("@emotion/styled/dist/declarations/src/types").StyledComponent<{
|
|
35
24
|
theme?: import("@emotion/react").Theme | undefined;
|
|
36
25
|
as?: import("react").ElementType<any, keyof import("react").JSX.IntrinsicElements> | undefined;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.Title = exports.DescriptionWrapper = exports.
|
|
3
|
+
exports.Title = exports.DescriptionWrapper = exports.ListWrapper = exports.Wrapper = exports.StyledDescriptionName = void 0;
|
|
4
4
|
const Description_1 = require("../Description");
|
|
5
5
|
const styled_1 = require("../styled");
|
|
6
6
|
const Typography_1 = require("../Typography");
|
|
@@ -52,13 +52,6 @@ exports.ListWrapper = (0, styled_1.styled)('dl', {
|
|
|
52
52
|
row-gap: ${({ theme }) => theme.spacing(3)};
|
|
53
53
|
}
|
|
54
54
|
`;
|
|
55
|
-
exports.StyledDescriptionValue = (0, styled_1.styled)(Description_1.Description.Value, {
|
|
56
|
-
shouldForwardProp: (prop) => !['$isCopy'].includes(prop),
|
|
57
|
-
}) `
|
|
58
|
-
display: ${({ $isCopy }) => $isCopy && 'flex'};
|
|
59
|
-
|
|
60
|
-
width: ${({ $isCopy }) => $isCopy && 'calc(100% - 20px)'};
|
|
61
|
-
`;
|
|
62
55
|
exports.DescriptionWrapper = styled_1.styled.div `
|
|
63
56
|
display: flex;
|
|
64
57
|
flex-direction: column;
|
|
@@ -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,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
|
+
};
|
|
@@ -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; } });
|
|
@@ -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);
|