@astral/ui 1.16.0 → 1.16.2
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/Button/styles.js +8 -1
- package/ButtonBase/styles.d.ts +2 -1
- package/ButtonBase/styles.js +4 -1
- package/ConfigProvider/ConfigProvider.d.ts +2 -2
- package/ConfigProvider/ConfigProvider.js +1 -1
- package/ErrorBoundary/ErrorBoundary.d.ts +3 -3
- package/ErrorBoundary/ErrorBoundary.js +2 -2
- package/esm/Button/styles.js +8 -1
- package/esm/ButtonBase/styles.d.ts +2 -1
- package/esm/ButtonBase/styles.js +4 -1
- package/esm/ConfigProvider/ConfigProvider.d.ts +2 -2
- package/esm/ConfigProvider/ConfigProvider.js +1 -1
- package/esm/ErrorBoundary/ErrorBoundary.d.ts +3 -3
- package/esm/ErrorBoundary/ErrorBoundary.js +2 -2
- package/package.json +2 -2
package/Button/styles.js
CHANGED
|
@@ -8,11 +8,18 @@ exports.LoadingButtonWrapper = void 0;
|
|
|
8
8
|
var lab_1 = require("@mui/lab");
|
|
9
9
|
var styles_1 = require("../styles");
|
|
10
10
|
var styles_2 = require("../ButtonBase/styles");
|
|
11
|
+
var ButtonBase_1 = require("../ButtonBase");
|
|
11
12
|
exports.LoadingButtonWrapper = (0, styles_1.styled)(lab_1.LoadingButton, {
|
|
12
13
|
shouldForwardProp: function (prop) {
|
|
13
14
|
return prop !== 'customColor' && prop !== 'customVariant';
|
|
14
15
|
},
|
|
15
|
-
})(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n ", " {\n height: ", ";\n padding: ", ";\n\n white-space: nowrap;\n }\n"], ["\n ", " {\n height: ", ";\n padding: ", ";\n\n white-space: nowrap;\n }\n"])), function (_a) {
|
|
16
|
+
})(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n min-width: ", ";\n padding: ", ";\n\n ", " {\n height: ", ";\n padding: ", ";\n\n white-space: nowrap;\n }\n"], ["\n min-width: ", ";\n padding: ", ";\n\n ", " {\n height: ", ";\n padding: ", ";\n\n white-space: nowrap;\n }\n"])), function (_a) {
|
|
17
|
+
var variant = _a.variant;
|
|
18
|
+
return variant === ButtonBase_1.ButtonVariants.Link ? 'auto' : '';
|
|
19
|
+
}, function (_a) {
|
|
20
|
+
var variant = _a.variant;
|
|
21
|
+
return (variant === ButtonBase_1.ButtonVariants.Link ? 0 : '');
|
|
22
|
+
}, function (_a) {
|
|
16
23
|
var theme = _a.theme;
|
|
17
24
|
return theme.breakpoints.down('sm');
|
|
18
25
|
}, styles_2.getButtonHeightMobile, styles_2.getButtonPaddingMobile);
|
package/ButtonBase/styles.d.ts
CHANGED
|
@@ -6,6 +6,7 @@ export declare type ButtonBaseWrapperProps = Omit<BaseButtonProps, 'color' | 'va
|
|
|
6
6
|
customVariant?: ButtonVariant;
|
|
7
7
|
};
|
|
8
8
|
export declare type ButtonBaseWrapperThemeProps = {
|
|
9
|
+
variant?: ButtonVariant;
|
|
9
10
|
customColor?: ButtonColor;
|
|
10
11
|
customVariant?: ButtonVariant;
|
|
11
12
|
selected?: boolean;
|
|
@@ -21,7 +22,7 @@ export declare const getBgColor: ({ selected, customColor, customVariant, button
|
|
|
21
22
|
export declare const getButtonHeight: ({ size, }: ButtonBaseWrapperThemeProps) => string;
|
|
22
23
|
export declare const getButtonPadding: ({ size, theme, }: ButtonBaseWrapperThemeProps) => string;
|
|
23
24
|
export declare const getDisabledBgColor: ({ theme, customVariant, }: ButtonBaseWrapperThemeProps) => string;
|
|
24
|
-
export declare const getButtonPaddingMobile: ({ size, theme, }: ButtonBaseWrapperThemeProps) => string;
|
|
25
|
+
export declare const getButtonPaddingMobile: ({ size, theme, variant, }: ButtonBaseWrapperThemeProps) => string;
|
|
25
26
|
export declare const getButtonHeightMobile: ({ size, }: ButtonBaseWrapperThemeProps) => string;
|
|
26
27
|
export declare const ButtonBaseWrapper: import("@emotion/styled").StyledComponent<Pick<import("@mui/base/ButtonUnstyled").ButtonUnstyledOwnProps & Omit<any, keyof import("@mui/base/ButtonUnstyled").ButtonUnstyledOwnProps> & {
|
|
27
28
|
component?: import("react").ElementType<any> | undefined;
|
package/ButtonBase/styles.js
CHANGED
|
@@ -218,7 +218,10 @@ var getDisabledBgColor = function (_a) {
|
|
|
218
218
|
};
|
|
219
219
|
exports.getDisabledBgColor = getDisabledBgColor;
|
|
220
220
|
var getButtonPaddingMobile = function (_a) {
|
|
221
|
-
var size = _a.size, theme = _a.theme;
|
|
221
|
+
var size = _a.size, theme = _a.theme, variant = _a.variant;
|
|
222
|
+
if (variant === enums_1.ButtonVariants.Link) {
|
|
223
|
+
return '0';
|
|
224
|
+
}
|
|
222
225
|
if (size === enums_1.ButtonSizes.Small) {
|
|
223
226
|
return theme.spacing(2, 3);
|
|
224
227
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
2
|
export declare type ConfigContextProps = {
|
|
3
3
|
locale?: Locale;
|
|
4
|
-
captureException?: (
|
|
4
|
+
captureException?: (error: any) => void;
|
|
5
5
|
};
|
|
6
6
|
export declare type ConfigProviderProps = ConfigContextProps & {
|
|
7
7
|
children: ReactNode;
|
|
@@ -20,7 +20,7 @@ var react_1 = require("react");
|
|
|
20
20
|
var ru_1 = __importDefault(require("date-fns/locale/ru"));
|
|
21
21
|
exports.ConfigContext = (0, react_1.createContext)({
|
|
22
22
|
locale: ru_1.default,
|
|
23
|
-
captureException: function (
|
|
23
|
+
captureException: function (error) { return console.error(error); },
|
|
24
24
|
});
|
|
25
25
|
var ConfigProvider = function (_a) {
|
|
26
26
|
var children = _a.children, _b = _a.locale, locale = _b === void 0 ? ru_1.default : _b, captureException = _a.captureException;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import React, {
|
|
1
|
+
import React, { ReactNode } from 'react';
|
|
2
2
|
declare type Props = {
|
|
3
3
|
children: ReactNode;
|
|
4
|
-
captureException?: (
|
|
4
|
+
captureException?: (error: any) => void;
|
|
5
5
|
};
|
|
6
6
|
declare type State = {
|
|
7
7
|
error: boolean;
|
|
@@ -11,7 +11,7 @@ declare class ErrorBoundary extends React.Component<Props, State> {
|
|
|
11
11
|
static getDerivedStateFromError(): {
|
|
12
12
|
error: boolean;
|
|
13
13
|
};
|
|
14
|
-
componentDidCatch(error: Error
|
|
14
|
+
componentDidCatch(error: Error): void;
|
|
15
15
|
handleReloadPage(): void;
|
|
16
16
|
render(): string | number | boolean | React.ReactFragment | JSX.Element | null | undefined;
|
|
17
17
|
}
|
|
@@ -46,9 +46,9 @@ var ErrorBoundary = /** @class */ (function (_super) {
|
|
|
46
46
|
ErrorBoundary.getDerivedStateFromError = function () {
|
|
47
47
|
return { error: true };
|
|
48
48
|
};
|
|
49
|
-
ErrorBoundary.prototype.componentDidCatch = function (error
|
|
49
|
+
ErrorBoundary.prototype.componentDidCatch = function (error) {
|
|
50
50
|
var _a, _b;
|
|
51
|
-
(_b = (_a = this.props).captureException) === null || _b === void 0 ? void 0 : _b.call(_a,
|
|
51
|
+
(_b = (_a = this.props).captureException) === null || _b === void 0 ? void 0 : _b.call(_a, error);
|
|
52
52
|
};
|
|
53
53
|
ErrorBoundary.prototype.handleReloadPage = function () {
|
|
54
54
|
location.reload();
|
package/esm/Button/styles.js
CHANGED
|
@@ -5,11 +5,18 @@ var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cook
|
|
|
5
5
|
import { LoadingButton } from '@mui/lab';
|
|
6
6
|
import { styled } from '../styles';
|
|
7
7
|
import { getButtonHeightMobile, getButtonPaddingMobile, } from '../ButtonBase/styles';
|
|
8
|
+
import { ButtonVariants } from '../ButtonBase';
|
|
8
9
|
export var LoadingButtonWrapper = styled(LoadingButton, {
|
|
9
10
|
shouldForwardProp: function (prop) {
|
|
10
11
|
return prop !== 'customColor' && prop !== 'customVariant';
|
|
11
12
|
},
|
|
12
|
-
})(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n ", " {\n height: ", ";\n padding: ", ";\n\n white-space: nowrap;\n }\n"], ["\n ", " {\n height: ", ";\n padding: ", ";\n\n white-space: nowrap;\n }\n"])), function (_a) {
|
|
13
|
+
})(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n min-width: ", ";\n padding: ", ";\n\n ", " {\n height: ", ";\n padding: ", ";\n\n white-space: nowrap;\n }\n"], ["\n min-width: ", ";\n padding: ", ";\n\n ", " {\n height: ", ";\n padding: ", ";\n\n white-space: nowrap;\n }\n"])), function (_a) {
|
|
14
|
+
var variant = _a.variant;
|
|
15
|
+
return variant === ButtonVariants.Link ? 'auto' : '';
|
|
16
|
+
}, function (_a) {
|
|
17
|
+
var variant = _a.variant;
|
|
18
|
+
return (variant === ButtonVariants.Link ? 0 : '');
|
|
19
|
+
}, function (_a) {
|
|
13
20
|
var theme = _a.theme;
|
|
14
21
|
return theme.breakpoints.down('sm');
|
|
15
22
|
}, getButtonHeightMobile, getButtonPaddingMobile);
|
|
@@ -6,6 +6,7 @@ export declare type ButtonBaseWrapperProps = Omit<BaseButtonProps, 'color' | 'va
|
|
|
6
6
|
customVariant?: ButtonVariant;
|
|
7
7
|
};
|
|
8
8
|
export declare type ButtonBaseWrapperThemeProps = {
|
|
9
|
+
variant?: ButtonVariant;
|
|
9
10
|
customColor?: ButtonColor;
|
|
10
11
|
customVariant?: ButtonVariant;
|
|
11
12
|
selected?: boolean;
|
|
@@ -21,7 +22,7 @@ export declare const getBgColor: ({ selected, customColor, customVariant, button
|
|
|
21
22
|
export declare const getButtonHeight: ({ size, }: ButtonBaseWrapperThemeProps) => string;
|
|
22
23
|
export declare const getButtonPadding: ({ size, theme, }: ButtonBaseWrapperThemeProps) => string;
|
|
23
24
|
export declare const getDisabledBgColor: ({ theme, customVariant, }: ButtonBaseWrapperThemeProps) => string;
|
|
24
|
-
export declare const getButtonPaddingMobile: ({ size, theme, }: ButtonBaseWrapperThemeProps) => string;
|
|
25
|
+
export declare const getButtonPaddingMobile: ({ size, theme, variant, }: ButtonBaseWrapperThemeProps) => string;
|
|
25
26
|
export declare const getButtonHeightMobile: ({ size, }: ButtonBaseWrapperThemeProps) => string;
|
|
26
27
|
export declare const ButtonBaseWrapper: import("@emotion/styled").StyledComponent<Pick<import("@mui/base/ButtonUnstyled").ButtonUnstyledOwnProps & Omit<any, keyof import("@mui/base/ButtonUnstyled").ButtonUnstyledOwnProps> & {
|
|
27
28
|
component?: import("react").ElementType<any> | undefined;
|
package/esm/ButtonBase/styles.js
CHANGED
|
@@ -187,7 +187,10 @@ export var getDisabledBgColor = function (_a) {
|
|
|
187
187
|
return theme.palette.grey['100'];
|
|
188
188
|
};
|
|
189
189
|
export var getButtonPaddingMobile = function (_a) {
|
|
190
|
-
var size = _a.size, theme = _a.theme;
|
|
190
|
+
var size = _a.size, theme = _a.theme, variant = _a.variant;
|
|
191
|
+
if (variant === ButtonVariants.Link) {
|
|
192
|
+
return '0';
|
|
193
|
+
}
|
|
191
194
|
if (size === ButtonSizes.Small) {
|
|
192
195
|
return theme.spacing(2, 3);
|
|
193
196
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
2
|
export declare type ConfigContextProps = {
|
|
3
3
|
locale?: Locale;
|
|
4
|
-
captureException?: (
|
|
4
|
+
captureException?: (error: any) => void;
|
|
5
5
|
};
|
|
6
6
|
export declare type ConfigProviderProps = ConfigContextProps & {
|
|
7
7
|
children: ReactNode;
|
|
@@ -14,7 +14,7 @@ import { createContext, useEffect } from 'react';
|
|
|
14
14
|
import ru from 'date-fns/locale/ru';
|
|
15
15
|
export var ConfigContext = createContext({
|
|
16
16
|
locale: ru,
|
|
17
|
-
captureException: function (
|
|
17
|
+
captureException: function (error) { return console.error(error); },
|
|
18
18
|
});
|
|
19
19
|
export var ConfigProvider = function (_a) {
|
|
20
20
|
var children = _a.children, _b = _a.locale, locale = _b === void 0 ? ru : _b, captureException = _a.captureException;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import React, {
|
|
1
|
+
import React, { ReactNode } from 'react';
|
|
2
2
|
declare type Props = {
|
|
3
3
|
children: ReactNode;
|
|
4
|
-
captureException?: (
|
|
4
|
+
captureException?: (error: any) => void;
|
|
5
5
|
};
|
|
6
6
|
declare type State = {
|
|
7
7
|
error: boolean;
|
|
@@ -11,7 +11,7 @@ declare class ErrorBoundary extends React.Component<Props, State> {
|
|
|
11
11
|
static getDerivedStateFromError(): {
|
|
12
12
|
error: boolean;
|
|
13
13
|
};
|
|
14
|
-
componentDidCatch(error: Error
|
|
14
|
+
componentDidCatch(error: Error): void;
|
|
15
15
|
handleReloadPage(): void;
|
|
16
16
|
render(): string | number | boolean | React.ReactFragment | JSX.Element | null | undefined;
|
|
17
17
|
}
|
|
@@ -41,9 +41,9 @@ var ErrorBoundary = /** @class */ (function (_super) {
|
|
|
41
41
|
ErrorBoundary.getDerivedStateFromError = function () {
|
|
42
42
|
return { error: true };
|
|
43
43
|
};
|
|
44
|
-
ErrorBoundary.prototype.componentDidCatch = function (error
|
|
44
|
+
ErrorBoundary.prototype.componentDidCatch = function (error) {
|
|
45
45
|
var _a, _b;
|
|
46
|
-
(_b = (_a = this.props).captureException) === null || _b === void 0 ? void 0 : _b.call(_a,
|
|
46
|
+
(_b = (_a = this.props).captureException) === null || _b === void 0 ? void 0 : _b.call(_a, error);
|
|
47
47
|
};
|
|
48
48
|
ErrorBoundary.prototype.handleReloadPage = function () {
|
|
49
49
|
location.reload();
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@astral/ui",
|
|
3
3
|
"browser": "./src/index.ts",
|
|
4
4
|
"dependencies": {
|
|
5
|
-
"@astral/icons": "^1.16.
|
|
5
|
+
"@astral/icons": "^1.16.2",
|
|
6
6
|
"@emotion/cache": "11.7.1",
|
|
7
7
|
"@emotion/react": "11.9.0",
|
|
8
8
|
"@emotion/server": "11.4.0",
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
"require": "./server/index.js"
|
|
32
32
|
}
|
|
33
33
|
},
|
|
34
|
-
"version": "1.16.
|
|
34
|
+
"version": "1.16.2",
|
|
35
35
|
"author": "Astral.Soft",
|
|
36
36
|
"license": "MIT",
|
|
37
37
|
"repository": {
|