@astral/ui 0.23.0-alpha.4 → 0.25.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/Autocomplete/Autocomplete.d.ts +1 -1
- package/Autocomplete/Autocomplete.js +15 -11
- package/Badge/styled.d.ts +3 -3
- package/Button/Button.d.ts +2 -1
- package/Button/Button.js +6 -17
- package/Button/types.d.ts +20 -6
- package/ButtonBase/styled.d.ts +8 -5
- package/ButtonBase/styled.js +2 -1
- package/CircularProgress/CircularProgress.d.ts +1 -1
- package/CircularProgress/CircularProgress.js +12 -7
- package/CircularProgress/CircularProgressStory.d.ts +5 -0
- package/CircularProgress/CircularProgressStory.js +11 -0
- package/CircularProgress/CircularProgressStoryTemplate.d.ts +4 -0
- package/CircularProgress/CircularProgressStoryTemplate.js +21 -0
- package/CircularProgress/types.d.ts +8 -5
- package/DataGrid/DataGridBody/styled.d.ts +2 -2
- package/DataGrid/DataGridHeadColumn/styled.d.ts +2 -2
- package/DataGrid/DataGridLoader/styled.d.ts +4 -4
- package/DataGrid/styled.d.ts +2 -2
- package/DataGridPagination/styled.d.ts +5 -5
- package/FormHelperText/styled.d.ts +8 -8
- package/FormHelperText/styled.js +13 -5
- package/Grid/styled.d.ts +2 -2
- package/IconButton/styled.d.ts +7 -7
- package/List/styled.d.ts +2 -2
- package/ListItem/styled.d.ts +6 -6
- package/ListItemButton/styled.d.ts +2 -2
- package/MenuList/styled.d.ts +2 -2
- package/Placeholder/styled.d.ts +10 -10
- package/Product/Product.d.ts +4 -0
- package/Product/Product.js +33 -0
- package/Product/index.d.ts +2 -0
- package/Product/index.js +14 -0
- package/Product/types.d.ts +6 -0
- package/Product/types.js +2 -0
- package/Radio/Radio.d.ts +1 -1
- package/Select/styled.d.ts +2 -2
- package/Tag/styled.d.ts +5 -5
- package/TextArea/TextArea.d.ts +1 -1
- package/TextField/TextField.d.ts +1 -1
- package/TextField/TextField.js +3 -1
- package/Tooltip/Tooltip.d.ts +1 -1
- package/Tooltip/styled.d.ts +1 -1
- package/esm/Autocomplete/Autocomplete.d.ts +1 -1
- package/esm/Autocomplete/Autocomplete.js +15 -11
- package/esm/Badge/styled.d.ts +3 -3
- package/esm/Button/Button.d.ts +2 -1
- package/esm/Button/Button.js +7 -17
- package/esm/Button/types.d.ts +20 -6
- package/esm/ButtonBase/styled.d.ts +8 -5
- package/esm/ButtonBase/styled.js +2 -1
- package/esm/CircularProgress/CircularProgress.d.ts +1 -1
- package/esm/CircularProgress/CircularProgress.js +9 -6
- package/esm/CircularProgress/CircularProgressStory.d.ts +5 -0
- package/esm/CircularProgress/CircularProgressStory.js +7 -0
- package/esm/CircularProgress/CircularProgressStoryTemplate.d.ts +4 -0
- package/esm/CircularProgress/CircularProgressStoryTemplate.js +17 -0
- package/esm/CircularProgress/types.d.ts +8 -5
- package/esm/DataGrid/DataGridBody/styled.d.ts +2 -2
- package/esm/DataGrid/DataGridHeadColumn/styled.d.ts +2 -2
- package/esm/DataGrid/DataGridLoader/styled.d.ts +4 -4
- package/esm/DataGrid/styled.d.ts +2 -2
- package/esm/DataGridPagination/styled.d.ts +5 -5
- package/esm/FormHelperText/styled.d.ts +8 -8
- package/esm/FormHelperText/styled.js +13 -5
- package/esm/Grid/styled.d.ts +2 -2
- package/esm/IconButton/styled.d.ts +7 -7
- package/esm/List/styled.d.ts +2 -2
- package/esm/ListItem/styled.d.ts +6 -6
- package/esm/ListItemButton/styled.d.ts +2 -2
- package/esm/MenuList/styled.d.ts +2 -2
- package/esm/Placeholder/styled.d.ts +10 -10
- package/esm/Product/Product.d.ts +4 -0
- package/esm/Product/Product.js +30 -0
- package/esm/Product/index.d.ts +2 -0
- package/esm/Product/index.js +2 -0
- package/esm/Product/types.d.ts +6 -0
- package/esm/Product/types.js +1 -0
- package/esm/Radio/Radio.d.ts +1 -1
- package/esm/Select/styled.d.ts +2 -2
- package/esm/Tag/styled.d.ts +5 -5
- package/esm/TextArea/TextArea.d.ts +1 -1
- package/esm/TextField/TextField.d.ts +1 -1
- package/esm/TextField/TextField.js +4 -2
- package/esm/Tooltip/Tooltip.d.ts +1 -1
- package/esm/Tooltip/styled.d.ts +1 -1
- package/esm/index.d.ts +2 -0
- package/esm/index.js +2 -0
- package/esm/theme/components/MuiButton.d.ts +3 -0
- package/esm/theme/components/MuiButton.js +96 -0
- package/esm/theme/components/MuiCircularProgress.d.ts +4 -0
- package/esm/theme/components/MuiCircularProgress.js +16 -0
- package/esm/theme/components/MuiFormHelperText.js +4 -1
- package/esm/theme/components/MuiLoadingButton.d.ts +4 -0
- package/esm/theme/components/MuiLoadingButton.js +45 -0
- package/esm/theme/components/components.js +6 -0
- package/index.d.ts +2 -0
- package/index.js +2 -0
- package/package.json +2 -2
- package/theme/components/MuiButton.d.ts +3 -0
- package/theme/components/MuiButton.js +99 -0
- package/theme/components/MuiCircularProgress.d.ts +4 -0
- package/theme/components/MuiCircularProgress.js +19 -0
- package/theme/components/MuiFormHelperText.js +4 -1
- package/theme/components/MuiLoadingButton.d.ts +4 -0
- package/theme/components/MuiLoadingButton.js +48 -0
- package/theme/components/components.js +6 -0
- package/Button/styled.d.ts +0 -12
- package/Button/styled.js +0 -36
- package/CircularProgress/styled.d.ts +0 -6
- package/CircularProgress/styled.js +0 -20
- package/esm/Button/styled.d.ts +0 -12
- package/esm/Button/styled.js +0 -33
- package/esm/CircularProgress/styled.d.ts +0 -6
- package/esm/CircularProgress/styled.js +0 -17
|
@@ -21,7 +21,7 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
21
21
|
return t;
|
|
22
22
|
};
|
|
23
23
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
24
|
-
import { forwardRef, useMemo } from 'react';
|
|
24
|
+
import { Fragment, forwardRef, useMemo } from 'react';
|
|
25
25
|
import MuiTextField from '@mui/material/TextField';
|
|
26
26
|
import { FormHelperText } from '../FormHelperText';
|
|
27
27
|
export var TextField = forwardRef(function (props, ref) {
|
|
@@ -39,7 +39,9 @@ export var TextField = forwardRef(function (props, ref) {
|
|
|
39
39
|
if (error) {
|
|
40
40
|
return _jsx(FormHelperText, __assign({ error: true }, { children: helperTextProp }), void 0);
|
|
41
41
|
}
|
|
42
|
-
|
|
42
|
+
if (helperTextProp)
|
|
43
|
+
return helperTextProp;
|
|
44
|
+
return _jsx(Fragment, {}, void 0);
|
|
43
45
|
}, [helperTextProp, success, error]);
|
|
44
46
|
return (_jsx(MuiTextField, __assign({ ref: ref, variant: "outlined", error: error, color: color, helperText: helperText }, restProps), void 0));
|
|
45
47
|
});
|
package/esm/Tooltip/Tooltip.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { TooltipProps } from './types';
|
|
3
|
-
export declare const Tooltip: import("react").ForwardRefExoticComponent<Pick<TooltipProps, "
|
|
3
|
+
export declare const Tooltip: import("react").ForwardRefExoticComponent<Pick<TooltipProps, "components" | "tabIndex" | "children" | "className" | "componentsProps" | "slot" | "style" | "title" | "css" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "hidden" | "id" | "lang" | "placeholder" | "spellCheck" | "translate" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "color" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "size" | "open" | "classes" | "sx" | "onClose" | "TransitionComponent" | "TransitionProps" | "arrow" | "describeChild" | "disableFocusListener" | "disableHoverListener" | "disableInteractive" | "disableTouchListener" | "enterDelay" | "enterNextDelay" | "enterTouchDelay" | "followCursor" | "leaveDelay" | "leaveTouchDelay" | "onOpen" | "placement" | "PopperComponent" | "PopperProps"> & import("react").RefAttributes<HTMLDivElement>>;
|
package/esm/Tooltip/styled.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export declare const StyledTooltip: import("@emotion/styled").StyledComponent<import("@mui/material").TooltipProps & {
|
|
2
|
-
size?: "
|
|
2
|
+
size?: "medium" | "small" | undefined;
|
|
3
3
|
} & {
|
|
4
4
|
theme?: import("@emotion/react").Theme | undefined;
|
|
5
5
|
}, {}, {}>;
|
package/esm/index.d.ts
CHANGED
|
@@ -3,6 +3,7 @@ export * from './Badge';
|
|
|
3
3
|
export * from './Button';
|
|
4
4
|
export * from './ButtonBase';
|
|
5
5
|
export * from './Checkbox';
|
|
6
|
+
export * from './CircularProgress';
|
|
6
7
|
export * from './DashboardLayout';
|
|
7
8
|
export * from './DataGrid';
|
|
8
9
|
export * from './DataGridPagination';
|
|
@@ -30,6 +31,7 @@ export * from './Menu';
|
|
|
30
31
|
export * from './MenuItem';
|
|
31
32
|
export * from './MenuList';
|
|
32
33
|
export * from './Placeholder';
|
|
34
|
+
export * from './Product';
|
|
33
35
|
export * from './Select';
|
|
34
36
|
export * from './styles';
|
|
35
37
|
export * from './StylesCacheProvider';
|
package/esm/index.js
CHANGED
|
@@ -3,6 +3,7 @@ export * from './Badge';
|
|
|
3
3
|
export * from './Button';
|
|
4
4
|
export * from './ButtonBase';
|
|
5
5
|
export * from './Checkbox';
|
|
6
|
+
export * from './CircularProgress';
|
|
6
7
|
export * from './DashboardLayout';
|
|
7
8
|
export * from './DataGrid';
|
|
8
9
|
export * from './DataGridPagination';
|
|
@@ -30,6 +31,7 @@ export * from './Menu';
|
|
|
30
31
|
export * from './MenuItem';
|
|
31
32
|
export * from './MenuList';
|
|
32
33
|
export * from './Placeholder';
|
|
34
|
+
export * from './Product';
|
|
33
35
|
export * from './Select';
|
|
34
36
|
export * from './styles';
|
|
35
37
|
export * from './StylesCacheProvider';
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
import { ButtonStates } from '../../ButtonBase/constants';
|
|
2
|
+
import { getBgColor, getButtonHeight, getButtonPadding, getColor, getDisabledBgColor, } from '../../ButtonBase/styled';
|
|
3
|
+
export var MuiButton = {
|
|
4
|
+
defaultProps: {
|
|
5
|
+
disableRipple: true,
|
|
6
|
+
},
|
|
7
|
+
styleOverrides: {
|
|
8
|
+
root: function (_a) {
|
|
9
|
+
var ownerState = _a.ownerState, theme = _a.theme;
|
|
10
|
+
var customVariant = ownerState.variant;
|
|
11
|
+
var customColor = ownerState.color;
|
|
12
|
+
return {
|
|
13
|
+
display: 'inline-flex',
|
|
14
|
+
color: getColor({
|
|
15
|
+
theme: theme,
|
|
16
|
+
customVariant: customVariant,
|
|
17
|
+
customColor: customColor,
|
|
18
|
+
buttonState: ButtonStates.DEFAULT,
|
|
19
|
+
}),
|
|
20
|
+
backgroundColor: getBgColor({
|
|
21
|
+
customColor: customColor,
|
|
22
|
+
customVariant: customVariant,
|
|
23
|
+
buttonState: ButtonStates.DEFAULT,
|
|
24
|
+
theme: theme,
|
|
25
|
+
}),
|
|
26
|
+
height: getButtonHeight({
|
|
27
|
+
theme: theme,
|
|
28
|
+
size: ownerState.size,
|
|
29
|
+
}),
|
|
30
|
+
padding: getButtonPadding({
|
|
31
|
+
theme: theme,
|
|
32
|
+
size: ownerState.size,
|
|
33
|
+
}),
|
|
34
|
+
fontWeight: theme.typography.button.fontWeight,
|
|
35
|
+
fontSize: theme.typography.button.fontSize,
|
|
36
|
+
border: 'none',
|
|
37
|
+
borderRadius: theme.shape.small,
|
|
38
|
+
textTransform: 'none',
|
|
39
|
+
boxShadow: 'none',
|
|
40
|
+
'&:hover': {
|
|
41
|
+
color: getColor({
|
|
42
|
+
theme: theme,
|
|
43
|
+
customVariant: customVariant,
|
|
44
|
+
customColor: customColor,
|
|
45
|
+
buttonState: ButtonStates.HOVER,
|
|
46
|
+
}),
|
|
47
|
+
backgroundColor: getBgColor({
|
|
48
|
+
customColor: customColor,
|
|
49
|
+
customVariant: customVariant,
|
|
50
|
+
theme: theme,
|
|
51
|
+
buttonState: ButtonStates.HOVER,
|
|
52
|
+
}),
|
|
53
|
+
boxShadow: 'none',
|
|
54
|
+
},
|
|
55
|
+
'&:active': {
|
|
56
|
+
color: getColor({
|
|
57
|
+
customColor: customColor,
|
|
58
|
+
customVariant: customVariant,
|
|
59
|
+
theme: theme,
|
|
60
|
+
buttonState: ButtonStates.ACTIVE,
|
|
61
|
+
}),
|
|
62
|
+
backgroundColor: getBgColor({
|
|
63
|
+
customColor: customColor,
|
|
64
|
+
customVariant: customVariant,
|
|
65
|
+
theme: theme,
|
|
66
|
+
buttonState: ButtonStates.ACTIVE,
|
|
67
|
+
}),
|
|
68
|
+
outline: 'none',
|
|
69
|
+
},
|
|
70
|
+
'&.Mui-disabled': {
|
|
71
|
+
color: theme.palette.grey['500'],
|
|
72
|
+
backgroundColor: getDisabledBgColor({
|
|
73
|
+
theme: theme,
|
|
74
|
+
customVariant: customVariant,
|
|
75
|
+
}),
|
|
76
|
+
},
|
|
77
|
+
'&.Mui-focusVisible': {
|
|
78
|
+
color: getColor({
|
|
79
|
+
theme: theme,
|
|
80
|
+
customVariant: customVariant,
|
|
81
|
+
customColor: customColor,
|
|
82
|
+
buttonState: ButtonStates.FOCUS,
|
|
83
|
+
}),
|
|
84
|
+
backgroundColor: getBgColor({
|
|
85
|
+
customColor: customColor,
|
|
86
|
+
customVariant: customVariant,
|
|
87
|
+
theme: theme,
|
|
88
|
+
buttonState: ButtonStates.FOCUS,
|
|
89
|
+
}),
|
|
90
|
+
outline: "2px solid ".concat(theme.palette.primary['400']),
|
|
91
|
+
boxShadow: 'none',
|
|
92
|
+
},
|
|
93
|
+
};
|
|
94
|
+
},
|
|
95
|
+
},
|
|
96
|
+
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export var MuiCircularProgress = {
|
|
2
|
+
styleOverrides: {
|
|
3
|
+
root: function (_a) {
|
|
4
|
+
var ownerState = _a.ownerState, theme = _a.theme;
|
|
5
|
+
// В данном случае появилась необходимость использования data- атрибута
|
|
6
|
+
// Подробнее: https://github.com/kaluga-astral/frontend/pull/199/files/5b42598b80e5b199e1b1a1298844a51b489e9c5a#r857514116
|
|
7
|
+
var color = ownerState["data-color"];
|
|
8
|
+
return {
|
|
9
|
+
color: color === 'primary'
|
|
10
|
+
? theme.palette.grey[900]
|
|
11
|
+
: theme.palette.primary.contrastText,
|
|
12
|
+
};
|
|
13
|
+
},
|
|
14
|
+
},
|
|
15
|
+
};
|
|
16
|
+
export default MuiCircularProgress;
|
|
@@ -3,8 +3,11 @@ export var MuiFormHelperText = {
|
|
|
3
3
|
root: function (_a) {
|
|
4
4
|
var theme = _a.theme;
|
|
5
5
|
return {
|
|
6
|
+
display: 'flex',
|
|
7
|
+
minHeight: theme.typography.small.lineHeight,
|
|
8
|
+
fontSize: theme.typography.small.fontSize,
|
|
6
9
|
margin: theme.spacing(1, 0, 0),
|
|
7
|
-
lineHeight: theme.typography.
|
|
10
|
+
lineHeight: theme.typography.small.lineHeight,
|
|
8
11
|
'&.Mui-error': {
|
|
9
12
|
color: theme.palette.error.dark,
|
|
10
13
|
},
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
var __assign = (this && this.__assign) || function () {
|
|
2
|
+
__assign = Object.assign || function(t) {
|
|
3
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
+
s = arguments[i];
|
|
5
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
+
t[p] = s[p];
|
|
7
|
+
}
|
|
8
|
+
return t;
|
|
9
|
+
};
|
|
10
|
+
return __assign.apply(this, arguments);
|
|
11
|
+
};
|
|
12
|
+
import { loadingButtonClasses } from '@mui/lab';
|
|
13
|
+
import { ButtonStates } from '../../ButtonBase/constants';
|
|
14
|
+
import { getBgColor } from '../../ButtonBase/styled';
|
|
15
|
+
export var MuiLoadingButton = {
|
|
16
|
+
defaultProps: {
|
|
17
|
+
disableRipple: true,
|
|
18
|
+
},
|
|
19
|
+
styleOverrides: {
|
|
20
|
+
root: function (_a) {
|
|
21
|
+
var _b;
|
|
22
|
+
var ownerState = _a.ownerState, theme = _a.theme;
|
|
23
|
+
var customVariant = ownerState.variant;
|
|
24
|
+
var customColor = ownerState.color;
|
|
25
|
+
return _b = {},
|
|
26
|
+
_b["&.".concat(loadingButtonClasses.loading)] = {
|
|
27
|
+
backgroundColor: getBgColor({
|
|
28
|
+
customColor: customColor,
|
|
29
|
+
customVariant: customVariant,
|
|
30
|
+
theme: theme,
|
|
31
|
+
buttonState: ButtonStates.DEFAULT,
|
|
32
|
+
}),
|
|
33
|
+
},
|
|
34
|
+
_b;
|
|
35
|
+
},
|
|
36
|
+
loadingIndicator: function (_a) {
|
|
37
|
+
var ownerState = _a.ownerState, theme = _a.theme;
|
|
38
|
+
var customVariant = ownerState.variant;
|
|
39
|
+
return __assign({}, (customVariant === 'contained' && {
|
|
40
|
+
color: theme.palette.primary.contrastText,
|
|
41
|
+
}));
|
|
42
|
+
},
|
|
43
|
+
},
|
|
44
|
+
};
|
|
45
|
+
export default MuiLoadingButton;
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
+
import { MuiButton } from './MuiButton';
|
|
1
2
|
import { MuiButtonBase } from './MuiButtonBase';
|
|
3
|
+
import { MuiLoadingButton } from './MuiLoadingButton';
|
|
2
4
|
import { MuiInputBase } from './MuiInputBase';
|
|
3
5
|
import { MuiFormHelperText } from './MuiFormHelperText';
|
|
4
6
|
import { MuiFormLabel } from './MuiFormLabel';
|
|
@@ -16,6 +18,7 @@ import { MuiTableHead } from './MuiTableHead';
|
|
|
16
18
|
import { MuiPickersDay } from './MuiPickersDay';
|
|
17
19
|
import { MuiCalendarPicker } from './MuiCalendarPicker';
|
|
18
20
|
import { MuiYearPicker } from './MuiYearPicker';
|
|
21
|
+
import { MuiCircularProgress } from './MuiCircularProgress';
|
|
19
22
|
var getMuiCssBaseline = function (fontUrls) { return ({
|
|
20
23
|
styleOverrides: "\n @font-face {\n font-family: 'Ubuntu';\n font-style: 'normal';\n font-weight: 300;\n font-display: swap;\n src: url(".concat(fontUrls.light.woff2, ") format('woff2'), url(").concat(fontUrls.light.woff, ") format('woff');\n }\n @font-face { \n font-family: 'Ubuntu';\n font-style: 'normal';\n font-weight: 400;\n font-display: swap;\n src: url(").concat(fontUrls.regular.woff2, ") format('woff2'), url(").concat(fontUrls.regular.woff, ") format('woff');\n }\n @font-face {\n font-family: 'Ubuntu';\n font-style: 'normal';\n font-weight: 500;\n font-display: swap;\n src: url(").concat(fontUrls.medium.woff2, ") format('woff2'), url(").concat(fontUrls.medium.woff, ") format('woff');\n }\n @font-face {\n font-family: 'Ubuntu';\n font-style: 'normal';\n font-weight: 700;\n font-display: swap;\n src: url(").concat(fontUrls.bold.woff2, ") format('woff2'), url(").concat(fontUrls.bold.woff, ") format('woff');\n }\n "),
|
|
21
24
|
}); };
|
|
@@ -66,7 +69,9 @@ var MuiMenuItem = {
|
|
|
66
69
|
};
|
|
67
70
|
export var getComponents = function (fontUrls) { return ({
|
|
68
71
|
MuiCssBaseline: getMuiCssBaseline(fontUrls),
|
|
72
|
+
MuiButton: MuiButton,
|
|
69
73
|
MuiButtonBase: MuiButtonBase,
|
|
74
|
+
MuiLoadingButton: MuiLoadingButton,
|
|
70
75
|
MuiTypography: MuiTypography,
|
|
71
76
|
MuiInputBase: MuiInputBase,
|
|
72
77
|
MuiInputLabel: MuiInputLabel,
|
|
@@ -88,4 +93,5 @@ export var getComponents = function (fontUrls) { return ({
|
|
|
88
93
|
MuiPickersDay: MuiPickersDay,
|
|
89
94
|
MuiCalendarPicker: MuiCalendarPicker,
|
|
90
95
|
MuiYearPicker: MuiYearPicker,
|
|
96
|
+
MuiCircularProgress: MuiCircularProgress,
|
|
91
97
|
}); };
|
package/index.d.ts
CHANGED
|
@@ -3,6 +3,7 @@ export * from './Badge';
|
|
|
3
3
|
export * from './Button';
|
|
4
4
|
export * from './ButtonBase';
|
|
5
5
|
export * from './Checkbox';
|
|
6
|
+
export * from './CircularProgress';
|
|
6
7
|
export * from './DashboardLayout';
|
|
7
8
|
export * from './DataGrid';
|
|
8
9
|
export * from './DataGridPagination';
|
|
@@ -30,6 +31,7 @@ export * from './Menu';
|
|
|
30
31
|
export * from './MenuItem';
|
|
31
32
|
export * from './MenuList';
|
|
32
33
|
export * from './Placeholder';
|
|
34
|
+
export * from './Product';
|
|
33
35
|
export * from './Select';
|
|
34
36
|
export * from './styles';
|
|
35
37
|
export * from './StylesCacheProvider';
|
package/index.js
CHANGED
|
@@ -15,6 +15,7 @@ __exportStar(require("./Badge"), exports);
|
|
|
15
15
|
__exportStar(require("./Button"), exports);
|
|
16
16
|
__exportStar(require("./ButtonBase"), exports);
|
|
17
17
|
__exportStar(require("./Checkbox"), exports);
|
|
18
|
+
__exportStar(require("./CircularProgress"), exports);
|
|
18
19
|
__exportStar(require("./DashboardLayout"), exports);
|
|
19
20
|
__exportStar(require("./DataGrid"), exports);
|
|
20
21
|
__exportStar(require("./DataGridPagination"), exports);
|
|
@@ -42,6 +43,7 @@ __exportStar(require("./Menu"), exports);
|
|
|
42
43
|
__exportStar(require("./MenuItem"), exports);
|
|
43
44
|
__exportStar(require("./MenuList"), exports);
|
|
44
45
|
__exportStar(require("./Placeholder"), exports);
|
|
46
|
+
__exportStar(require("./Product"), exports);
|
|
45
47
|
__exportStar(require("./Select"), exports);
|
|
46
48
|
__exportStar(require("./styles"), exports);
|
|
47
49
|
__exportStar(require("./StylesCacheProvider"), exports);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@astral/ui",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.25.0",
|
|
4
4
|
"browser": "./src/index.ts",
|
|
5
5
|
"jest": {
|
|
6
6
|
"moduleNameMapper": {
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
}
|
|
9
9
|
},
|
|
10
10
|
"dependencies": {
|
|
11
|
-
"@astral/icons": "^0.
|
|
11
|
+
"@astral/icons": "^0.25.0",
|
|
12
12
|
"@emotion/cache": "11.7.1",
|
|
13
13
|
"@emotion/react": "11.8.1",
|
|
14
14
|
"@emotion/server": "11.4.0",
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.MuiButton = void 0;
|
|
4
|
+
var constants_1 = require("../../ButtonBase/constants");
|
|
5
|
+
var styled_1 = require("../../ButtonBase/styled");
|
|
6
|
+
exports.MuiButton = {
|
|
7
|
+
defaultProps: {
|
|
8
|
+
disableRipple: true,
|
|
9
|
+
},
|
|
10
|
+
styleOverrides: {
|
|
11
|
+
root: function (_a) {
|
|
12
|
+
var ownerState = _a.ownerState, theme = _a.theme;
|
|
13
|
+
var customVariant = ownerState.variant;
|
|
14
|
+
var customColor = ownerState.color;
|
|
15
|
+
return {
|
|
16
|
+
display: 'inline-flex',
|
|
17
|
+
color: (0, styled_1.getColor)({
|
|
18
|
+
theme: theme,
|
|
19
|
+
customVariant: customVariant,
|
|
20
|
+
customColor: customColor,
|
|
21
|
+
buttonState: constants_1.ButtonStates.DEFAULT,
|
|
22
|
+
}),
|
|
23
|
+
backgroundColor: (0, styled_1.getBgColor)({
|
|
24
|
+
customColor: customColor,
|
|
25
|
+
customVariant: customVariant,
|
|
26
|
+
buttonState: constants_1.ButtonStates.DEFAULT,
|
|
27
|
+
theme: theme,
|
|
28
|
+
}),
|
|
29
|
+
height: (0, styled_1.getButtonHeight)({
|
|
30
|
+
theme: theme,
|
|
31
|
+
size: ownerState.size,
|
|
32
|
+
}),
|
|
33
|
+
padding: (0, styled_1.getButtonPadding)({
|
|
34
|
+
theme: theme,
|
|
35
|
+
size: ownerState.size,
|
|
36
|
+
}),
|
|
37
|
+
fontWeight: theme.typography.button.fontWeight,
|
|
38
|
+
fontSize: theme.typography.button.fontSize,
|
|
39
|
+
border: 'none',
|
|
40
|
+
borderRadius: theme.shape.small,
|
|
41
|
+
textTransform: 'none',
|
|
42
|
+
boxShadow: 'none',
|
|
43
|
+
'&:hover': {
|
|
44
|
+
color: (0, styled_1.getColor)({
|
|
45
|
+
theme: theme,
|
|
46
|
+
customVariant: customVariant,
|
|
47
|
+
customColor: customColor,
|
|
48
|
+
buttonState: constants_1.ButtonStates.HOVER,
|
|
49
|
+
}),
|
|
50
|
+
backgroundColor: (0, styled_1.getBgColor)({
|
|
51
|
+
customColor: customColor,
|
|
52
|
+
customVariant: customVariant,
|
|
53
|
+
theme: theme,
|
|
54
|
+
buttonState: constants_1.ButtonStates.HOVER,
|
|
55
|
+
}),
|
|
56
|
+
boxShadow: 'none',
|
|
57
|
+
},
|
|
58
|
+
'&:active': {
|
|
59
|
+
color: (0, styled_1.getColor)({
|
|
60
|
+
customColor: customColor,
|
|
61
|
+
customVariant: customVariant,
|
|
62
|
+
theme: theme,
|
|
63
|
+
buttonState: constants_1.ButtonStates.ACTIVE,
|
|
64
|
+
}),
|
|
65
|
+
backgroundColor: (0, styled_1.getBgColor)({
|
|
66
|
+
customColor: customColor,
|
|
67
|
+
customVariant: customVariant,
|
|
68
|
+
theme: theme,
|
|
69
|
+
buttonState: constants_1.ButtonStates.ACTIVE,
|
|
70
|
+
}),
|
|
71
|
+
outline: 'none',
|
|
72
|
+
},
|
|
73
|
+
'&.Mui-disabled': {
|
|
74
|
+
color: theme.palette.grey['500'],
|
|
75
|
+
backgroundColor: (0, styled_1.getDisabledBgColor)({
|
|
76
|
+
theme: theme,
|
|
77
|
+
customVariant: customVariant,
|
|
78
|
+
}),
|
|
79
|
+
},
|
|
80
|
+
'&.Mui-focusVisible': {
|
|
81
|
+
color: (0, styled_1.getColor)({
|
|
82
|
+
theme: theme,
|
|
83
|
+
customVariant: customVariant,
|
|
84
|
+
customColor: customColor,
|
|
85
|
+
buttonState: constants_1.ButtonStates.FOCUS,
|
|
86
|
+
}),
|
|
87
|
+
backgroundColor: (0, styled_1.getBgColor)({
|
|
88
|
+
customColor: customColor,
|
|
89
|
+
customVariant: customVariant,
|
|
90
|
+
theme: theme,
|
|
91
|
+
buttonState: constants_1.ButtonStates.FOCUS,
|
|
92
|
+
}),
|
|
93
|
+
outline: "2px solid ".concat(theme.palette.primary['400']),
|
|
94
|
+
boxShadow: 'none',
|
|
95
|
+
},
|
|
96
|
+
};
|
|
97
|
+
},
|
|
98
|
+
},
|
|
99
|
+
};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.MuiCircularProgress = void 0;
|
|
4
|
+
exports.MuiCircularProgress = {
|
|
5
|
+
styleOverrides: {
|
|
6
|
+
root: function (_a) {
|
|
7
|
+
var ownerState = _a.ownerState, theme = _a.theme;
|
|
8
|
+
// В данном случае появилась необходимость использования data- атрибута
|
|
9
|
+
// Подробнее: https://github.com/kaluga-astral/frontend/pull/199/files/5b42598b80e5b199e1b1a1298844a51b489e9c5a#r857514116
|
|
10
|
+
var color = ownerState["data-color"];
|
|
11
|
+
return {
|
|
12
|
+
color: color === 'primary'
|
|
13
|
+
? theme.palette.grey[900]
|
|
14
|
+
: theme.palette.primary.contrastText,
|
|
15
|
+
};
|
|
16
|
+
},
|
|
17
|
+
},
|
|
18
|
+
};
|
|
19
|
+
exports.default = exports.MuiCircularProgress;
|
|
@@ -6,8 +6,11 @@ exports.MuiFormHelperText = {
|
|
|
6
6
|
root: function (_a) {
|
|
7
7
|
var theme = _a.theme;
|
|
8
8
|
return {
|
|
9
|
+
display: 'flex',
|
|
10
|
+
minHeight: theme.typography.small.lineHeight,
|
|
11
|
+
fontSize: theme.typography.small.fontSize,
|
|
9
12
|
margin: theme.spacing(1, 0, 0),
|
|
10
|
-
lineHeight: theme.typography.
|
|
13
|
+
lineHeight: theme.typography.small.lineHeight,
|
|
11
14
|
'&.Mui-error': {
|
|
12
15
|
color: theme.palette.error.dark,
|
|
13
16
|
},
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __assign = (this && this.__assign) || function () {
|
|
3
|
+
__assign = Object.assign || function(t) {
|
|
4
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
5
|
+
s = arguments[i];
|
|
6
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
7
|
+
t[p] = s[p];
|
|
8
|
+
}
|
|
9
|
+
return t;
|
|
10
|
+
};
|
|
11
|
+
return __assign.apply(this, arguments);
|
|
12
|
+
};
|
|
13
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
14
|
+
exports.MuiLoadingButton = void 0;
|
|
15
|
+
var lab_1 = require("@mui/lab");
|
|
16
|
+
var constants_1 = require("../../ButtonBase/constants");
|
|
17
|
+
var styled_1 = require("../../ButtonBase/styled");
|
|
18
|
+
exports.MuiLoadingButton = {
|
|
19
|
+
defaultProps: {
|
|
20
|
+
disableRipple: true,
|
|
21
|
+
},
|
|
22
|
+
styleOverrides: {
|
|
23
|
+
root: function (_a) {
|
|
24
|
+
var _b;
|
|
25
|
+
var ownerState = _a.ownerState, theme = _a.theme;
|
|
26
|
+
var customVariant = ownerState.variant;
|
|
27
|
+
var customColor = ownerState.color;
|
|
28
|
+
return _b = {},
|
|
29
|
+
_b["&.".concat(lab_1.loadingButtonClasses.loading)] = {
|
|
30
|
+
backgroundColor: (0, styled_1.getBgColor)({
|
|
31
|
+
customColor: customColor,
|
|
32
|
+
customVariant: customVariant,
|
|
33
|
+
theme: theme,
|
|
34
|
+
buttonState: constants_1.ButtonStates.DEFAULT,
|
|
35
|
+
}),
|
|
36
|
+
},
|
|
37
|
+
_b;
|
|
38
|
+
},
|
|
39
|
+
loadingIndicator: function (_a) {
|
|
40
|
+
var ownerState = _a.ownerState, theme = _a.theme;
|
|
41
|
+
var customVariant = ownerState.variant;
|
|
42
|
+
return __assign({}, (customVariant === 'contained' && {
|
|
43
|
+
color: theme.palette.primary.contrastText,
|
|
44
|
+
}));
|
|
45
|
+
},
|
|
46
|
+
},
|
|
47
|
+
};
|
|
48
|
+
exports.default = exports.MuiLoadingButton;
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.getComponents = void 0;
|
|
4
|
+
var MuiButton_1 = require("./MuiButton");
|
|
4
5
|
var MuiButtonBase_1 = require("./MuiButtonBase");
|
|
6
|
+
var MuiLoadingButton_1 = require("./MuiLoadingButton");
|
|
5
7
|
var MuiInputBase_1 = require("./MuiInputBase");
|
|
6
8
|
var MuiFormHelperText_1 = require("./MuiFormHelperText");
|
|
7
9
|
var MuiFormLabel_1 = require("./MuiFormLabel");
|
|
@@ -19,6 +21,7 @@ var MuiTableHead_1 = require("./MuiTableHead");
|
|
|
19
21
|
var MuiPickersDay_1 = require("./MuiPickersDay");
|
|
20
22
|
var MuiCalendarPicker_1 = require("./MuiCalendarPicker");
|
|
21
23
|
var MuiYearPicker_1 = require("./MuiYearPicker");
|
|
24
|
+
var MuiCircularProgress_1 = require("./MuiCircularProgress");
|
|
22
25
|
var getMuiCssBaseline = function (fontUrls) { return ({
|
|
23
26
|
styleOverrides: "\n @font-face {\n font-family: 'Ubuntu';\n font-style: 'normal';\n font-weight: 300;\n font-display: swap;\n src: url(".concat(fontUrls.light.woff2, ") format('woff2'), url(").concat(fontUrls.light.woff, ") format('woff');\n }\n @font-face { \n font-family: 'Ubuntu';\n font-style: 'normal';\n font-weight: 400;\n font-display: swap;\n src: url(").concat(fontUrls.regular.woff2, ") format('woff2'), url(").concat(fontUrls.regular.woff, ") format('woff');\n }\n @font-face {\n font-family: 'Ubuntu';\n font-style: 'normal';\n font-weight: 500;\n font-display: swap;\n src: url(").concat(fontUrls.medium.woff2, ") format('woff2'), url(").concat(fontUrls.medium.woff, ") format('woff');\n }\n @font-face {\n font-family: 'Ubuntu';\n font-style: 'normal';\n font-weight: 700;\n font-display: swap;\n src: url(").concat(fontUrls.bold.woff2, ") format('woff2'), url(").concat(fontUrls.bold.woff, ") format('woff');\n }\n "),
|
|
24
27
|
}); };
|
|
@@ -69,7 +72,9 @@ var MuiMenuItem = {
|
|
|
69
72
|
};
|
|
70
73
|
var getComponents = function (fontUrls) { return ({
|
|
71
74
|
MuiCssBaseline: getMuiCssBaseline(fontUrls),
|
|
75
|
+
MuiButton: MuiButton_1.MuiButton,
|
|
72
76
|
MuiButtonBase: MuiButtonBase_1.MuiButtonBase,
|
|
77
|
+
MuiLoadingButton: MuiLoadingButton_1.MuiLoadingButton,
|
|
73
78
|
MuiTypography: MuiTypography_1.MuiTypography,
|
|
74
79
|
MuiInputBase: MuiInputBase_1.MuiInputBase,
|
|
75
80
|
MuiInputLabel: MuiInputLabel_1.MuiInputLabel,
|
|
@@ -91,5 +96,6 @@ var getComponents = function (fontUrls) { return ({
|
|
|
91
96
|
MuiPickersDay: MuiPickersDay_1.MuiPickersDay,
|
|
92
97
|
MuiCalendarPicker: MuiCalendarPicker_1.MuiCalendarPicker,
|
|
93
98
|
MuiYearPicker: MuiYearPicker_1.MuiYearPicker,
|
|
99
|
+
MuiCircularProgress: MuiCircularProgress_1.MuiCircularProgress,
|
|
94
100
|
}); };
|
|
95
101
|
exports.getComponents = getComponents;
|
package/Button/styled.d.ts
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
export declare const StyledButton: import("@emotion/styled").StyledComponent<Omit<import("@mui/base/ButtonUnstyled/ButtonUnstyledProps").default<"button", {}>, "variant" | "color" | "size"> & {
|
|
3
|
-
color?: "error" | "primary" | "success" | "warning" | undefined;
|
|
4
|
-
variant?: "link" | "text" | "light" | "contained" | undefined;
|
|
5
|
-
size?: "large" | "medium" | undefined;
|
|
6
|
-
} & {
|
|
7
|
-
theme?: import("@emotion/react").Theme | undefined;
|
|
8
|
-
} & {
|
|
9
|
-
loading?: boolean | undefined;
|
|
10
|
-
startIcon?: import("react").ReactNode;
|
|
11
|
-
endIcon?: import("react").ReactNode;
|
|
12
|
-
}, {}, {}>;
|