@astral/ui 0.23.0-alpha.3 → 0.24.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.
Files changed (111) hide show
  1. package/Autocomplete/Autocomplete.d.ts +1 -1
  2. package/Autocomplete/Autocomplete.js +15 -11
  3. package/Badge/styled.d.ts +3 -3
  4. package/Button/Button.d.ts +2 -1
  5. package/Button/Button.js +6 -17
  6. package/Button/types.d.ts +18 -6
  7. package/ButtonBase/styled.d.ts +8 -5
  8. package/ButtonBase/styled.js +2 -1
  9. package/CircularProgress/CircularProgress.d.ts +1 -1
  10. package/CircularProgress/CircularProgress.js +12 -7
  11. package/CircularProgress/CircularProgressStory.d.ts +5 -0
  12. package/CircularProgress/CircularProgressStory.js +11 -0
  13. package/CircularProgress/CircularProgressStoryTemplate.d.ts +4 -0
  14. package/CircularProgress/CircularProgressStoryTemplate.js +21 -0
  15. package/CircularProgress/types.d.ts +8 -5
  16. package/DataGrid/DataGridBody/styled.d.ts +2 -2
  17. package/DataGrid/DataGridHeadColumn/styled.d.ts +2 -2
  18. package/DataGrid/DataGridLoader/styled.d.ts +4 -4
  19. package/DataGrid/styled.d.ts +2 -2
  20. package/DataGridPagination/styled.d.ts +13 -3
  21. package/FormHelperText/styled.d.ts +8 -8
  22. package/FormHelperText/styled.js +13 -5
  23. package/Grid/styled.d.ts +2 -2
  24. package/IconButton/styled.d.ts +6 -8
  25. package/List/styled.d.ts +2 -2
  26. package/ListItem/styled.d.ts +6 -6
  27. package/ListItemButton/styled.d.ts +2 -2
  28. package/MenuList/styled.d.ts +2 -2
  29. package/Placeholder/styled.d.ts +26 -6
  30. package/Radio/Radio.d.ts +1 -1
  31. package/Select/styled.d.ts +2 -2
  32. package/Tag/styled.d.ts +5 -5
  33. package/TextArea/TextArea.d.ts +1 -1
  34. package/TextField/TextField.d.ts +1 -1
  35. package/TextField/TextField.js +3 -1
  36. package/Tooltip/Tooltip.d.ts +1 -1
  37. package/Tooltip/styled.d.ts +1 -1
  38. package/Typography/Typography.d.ts +1 -8
  39. package/Typography/Typography.js +2 -30
  40. package/Typography/types.d.ts +18 -0
  41. package/Typography/types.js +2 -0
  42. package/esm/Autocomplete/Autocomplete.d.ts +1 -1
  43. package/esm/Autocomplete/Autocomplete.js +15 -11
  44. package/esm/Badge/styled.d.ts +3 -3
  45. package/esm/Button/Button.d.ts +2 -1
  46. package/esm/Button/Button.js +7 -17
  47. package/esm/Button/types.d.ts +18 -6
  48. package/esm/ButtonBase/styled.d.ts +8 -5
  49. package/esm/ButtonBase/styled.js +2 -1
  50. package/esm/CircularProgress/CircularProgress.d.ts +1 -1
  51. package/esm/CircularProgress/CircularProgress.js +9 -6
  52. package/esm/CircularProgress/CircularProgressStory.d.ts +5 -0
  53. package/esm/CircularProgress/CircularProgressStory.js +7 -0
  54. package/esm/CircularProgress/CircularProgressStoryTemplate.d.ts +4 -0
  55. package/esm/CircularProgress/CircularProgressStoryTemplate.js +17 -0
  56. package/esm/CircularProgress/types.d.ts +8 -5
  57. package/esm/DataGrid/DataGridBody/styled.d.ts +2 -2
  58. package/esm/DataGrid/DataGridHeadColumn/styled.d.ts +2 -2
  59. package/esm/DataGrid/DataGridLoader/styled.d.ts +4 -4
  60. package/esm/DataGrid/styled.d.ts +2 -2
  61. package/esm/DataGridPagination/styled.d.ts +13 -3
  62. package/esm/FormHelperText/styled.d.ts +8 -8
  63. package/esm/FormHelperText/styled.js +13 -5
  64. package/esm/Grid/styled.d.ts +2 -2
  65. package/esm/IconButton/styled.d.ts +6 -8
  66. package/esm/List/styled.d.ts +2 -2
  67. package/esm/ListItem/styled.d.ts +6 -6
  68. package/esm/ListItemButton/styled.d.ts +2 -2
  69. package/esm/MenuList/styled.d.ts +2 -2
  70. package/esm/Placeholder/styled.d.ts +26 -6
  71. package/esm/Radio/Radio.d.ts +1 -1
  72. package/esm/Select/styled.d.ts +2 -2
  73. package/esm/Tag/styled.d.ts +5 -5
  74. package/esm/TextArea/TextArea.d.ts +1 -1
  75. package/esm/TextField/TextField.d.ts +1 -1
  76. package/esm/TextField/TextField.js +4 -2
  77. package/esm/Tooltip/Tooltip.d.ts +1 -1
  78. package/esm/Tooltip/styled.d.ts +1 -1
  79. package/esm/Typography/Typography.d.ts +1 -8
  80. package/esm/Typography/Typography.js +1 -29
  81. package/esm/Typography/types.d.ts +18 -0
  82. package/esm/Typography/types.js +1 -0
  83. package/esm/index.d.ts +1 -0
  84. package/esm/index.js +1 -0
  85. package/esm/theme/components/MuiButton.d.ts +3 -0
  86. package/esm/theme/components/MuiButton.js +96 -0
  87. package/esm/theme/components/MuiCircularProgress.d.ts +4 -0
  88. package/esm/theme/components/MuiCircularProgress.js +16 -0
  89. package/esm/theme/components/MuiFormHelperText.js +4 -1
  90. package/esm/theme/components/MuiLoadingButton.d.ts +4 -0
  91. package/esm/theme/components/MuiLoadingButton.js +45 -0
  92. package/esm/theme/components/components.js +6 -0
  93. package/index.d.ts +1 -0
  94. package/index.js +1 -0
  95. package/package.json +2 -2
  96. package/theme/components/MuiButton.d.ts +3 -0
  97. package/theme/components/MuiButton.js +99 -0
  98. package/theme/components/MuiCircularProgress.d.ts +4 -0
  99. package/theme/components/MuiCircularProgress.js +19 -0
  100. package/theme/components/MuiFormHelperText.js +4 -1
  101. package/theme/components/MuiLoadingButton.d.ts +4 -0
  102. package/theme/components/MuiLoadingButton.js +48 -0
  103. package/theme/components/components.js +6 -0
  104. package/Button/styled.d.ts +0 -12
  105. package/Button/styled.js +0 -36
  106. package/CircularProgress/styled.d.ts +0 -6
  107. package/CircularProgress/styled.js +0 -20
  108. package/esm/Button/styled.d.ts +0 -12
  109. package/esm/Button/styled.js +0 -33
  110. package/esm/CircularProgress/styled.d.ts +0 -6
  111. package/esm/CircularProgress/styled.js +0 -17
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';
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';
@@ -0,0 +1,3 @@
1
+ import { Components } from '@mui/material';
2
+ import type { Theme } from '../baseTheme';
3
+ export declare const MuiButton: Components<Theme>['MuiButton'];
@@ -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,4 @@
1
+ import { Components } from '@mui/material';
2
+ import type { Theme } from '../baseTheme';
3
+ export declare const MuiCircularProgress: Components<Theme>['MuiCircularProgress'];
4
+ export default MuiCircularProgress;
@@ -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.pxToRem(16),
10
+ lineHeight: theme.typography.small.lineHeight,
8
11
  '&.Mui-error': {
9
12
  color: theme.palette.error.dark,
10
13
  },
@@ -0,0 +1,4 @@
1
+ import { Components } from '@mui/material';
2
+ import type { Theme } from '../baseTheme';
3
+ export declare const MuiLoadingButton: Components<Theme>['MuiLoadingButton'];
4
+ export default MuiLoadingButton;
@@ -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';
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);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@astral/ui",
3
- "version": "0.23.0-alpha.3",
3
+ "version": "0.24.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.23.0-alpha.3",
11
+ "@astral/icons": "^0.24.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,3 @@
1
+ import { Components } from '@mui/material';
2
+ import type { Theme } from '../baseTheme';
3
+ export declare const MuiButton: Components<Theme>['MuiButton'];
@@ -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,4 @@
1
+ import { Components } from '@mui/material';
2
+ import type { Theme } from '../baseTheme';
3
+ export declare const MuiCircularProgress: Components<Theme>['MuiCircularProgress'];
4
+ export default MuiCircularProgress;
@@ -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.pxToRem(16),
13
+ lineHeight: theme.typography.small.lineHeight,
11
14
  '&.Mui-error': {
12
15
  color: theme.palette.error.dark,
13
16
  },
@@ -0,0 +1,4 @@
1
+ import { Components } from '@mui/material';
2
+ import type { Theme } from '../baseTheme';
3
+ export declare const MuiLoadingButton: Components<Theme>['MuiLoadingButton'];
4
+ export default MuiLoadingButton;
@@ -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;
@@ -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
- }, {}, {}>;
package/Button/styled.js DELETED
@@ -1,36 +0,0 @@
1
- "use strict";
2
- var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {
3
- if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
4
- return cooked;
5
- };
6
- Object.defineProperty(exports, "__esModule", { value: true });
7
- exports.StyledButton = void 0;
8
- var styles_1 = require("../styles");
9
- var ButtonBase_1 = require("../ButtonBase");
10
- var getProgressColor = function (_a) {
11
- var theme = _a.theme, variant = _a.variant;
12
- if (variant === ButtonBase_1.ButtonVariants.CONTAINED)
13
- return theme.palette.primary.contrastText;
14
- return theme.palette.grey['900'];
15
- };
16
- exports.StyledButton = (0, styles_1.styled)(ButtonBase_1.ButtonBase, {
17
- shouldForwardProp: function (prop) {
18
- return prop !== 'startIcon' && prop !== 'endIcon' && prop !== 'loading';
19
- },
20
- })(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n color: ", ";\n\n pointer-events: ", ";\n\n &:focus {\n color: ", ";\n }\n\n > span:first-of-type {\n display: inherit;\n margin-right: ", ";\n }\n\n > span:last-of-type {\n display: inherit;\n margin-left: ", ";\n }\n\n .MuiCircularProgress-root {\n position: absolute;\n\n width: 16px !important;\n height: 16px !important;\n\n color: ", ";\n\n transform: translate(-50%, -50%);\n }\n"], ["\n color: ", ";\n\n pointer-events: ", ";\n\n &:focus {\n color: ", ";\n }\n\n > span:first-of-type {\n display: inherit;\n margin-right: ", ";\n }\n\n > span:last-of-type {\n display: inherit;\n margin-left: ", ";\n }\n\n .MuiCircularProgress-root {\n position: absolute;\n\n width: 16px !important;\n height: 16px !important;\n\n color: ", ";\n\n transform: translate(-50%, -50%);\n }\n"])), function (_a) {
21
- var loading = _a.loading;
22
- return loading && 'transparent';
23
- }, function (_a) {
24
- var loading = _a.loading;
25
- return (loading ? 'none' : 'inherit');
26
- }, function (_a) {
27
- var loading = _a.loading;
28
- return loading && 'transparent';
29
- }, function (_a) {
30
- var theme = _a.theme;
31
- return theme.spacing(2);
32
- }, function (_a) {
33
- var theme = _a.theme;
34
- return theme.spacing(2);
35
- }, getProgressColor);
36
- var templateObject_1;
@@ -1,6 +0,0 @@
1
- import { CircularProgressProps } from './types';
2
- export declare const StyledCircularProgress: import("@emotion/styled").StyledComponent<import("@mui/material").CircularProgressProps & {
3
- theme?: import("@emotion/react").Theme | undefined;
4
- } & Omit<CircularProgressProps, "color" | "size"> & {
5
- customColor?: "primary" | "inverted" | undefined;
6
- }, {}, {}>;
@@ -1,20 +0,0 @@
1
- "use strict";
2
- var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {
3
- if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
4
- return cooked;
5
- };
6
- Object.defineProperty(exports, "__esModule", { value: true });
7
- exports.StyledCircularProgress = void 0;
8
- var material_1 = require("@mui/material");
9
- var styles_1 = require("../styles");
10
- var constants_1 = require("./constants");
11
- var getColor = function (_a) {
12
- var theme = _a.theme, customColor = _a.customColor;
13
- if (customColor === constants_1.CircularProgressColors.PRIMARY)
14
- return theme.palette.primary.dark;
15
- return theme.palette.primary.contrastText;
16
- };
17
- exports.StyledCircularProgress = (0, styles_1.styled)(material_1.CircularProgress, {
18
- shouldForwardProp: function (prop) { return prop !== 'customColor'; },
19
- })(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n color: ", ";\n"], ["\n color: ", ";\n"])), function (props) { return getColor(props); });
20
- var templateObject_1;
@@ -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
- }, {}, {}>;
@@ -1,33 +0,0 @@
1
- var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {
2
- if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
3
- return cooked;
4
- };
5
- import { styled } from '../styles';
6
- import { ButtonBase, ButtonVariants } from '../ButtonBase';
7
- var getProgressColor = function (_a) {
8
- var theme = _a.theme, variant = _a.variant;
9
- if (variant === ButtonVariants.CONTAINED)
10
- return theme.palette.primary.contrastText;
11
- return theme.palette.grey['900'];
12
- };
13
- export var StyledButton = styled(ButtonBase, {
14
- shouldForwardProp: function (prop) {
15
- return prop !== 'startIcon' && prop !== 'endIcon' && prop !== 'loading';
16
- },
17
- })(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n color: ", ";\n\n pointer-events: ", ";\n\n &:focus {\n color: ", ";\n }\n\n > span:first-of-type {\n display: inherit;\n margin-right: ", ";\n }\n\n > span:last-of-type {\n display: inherit;\n margin-left: ", ";\n }\n\n .MuiCircularProgress-root {\n position: absolute;\n\n width: 16px !important;\n height: 16px !important;\n\n color: ", ";\n\n transform: translate(-50%, -50%);\n }\n"], ["\n color: ", ";\n\n pointer-events: ", ";\n\n &:focus {\n color: ", ";\n }\n\n > span:first-of-type {\n display: inherit;\n margin-right: ", ";\n }\n\n > span:last-of-type {\n display: inherit;\n margin-left: ", ";\n }\n\n .MuiCircularProgress-root {\n position: absolute;\n\n width: 16px !important;\n height: 16px !important;\n\n color: ", ";\n\n transform: translate(-50%, -50%);\n }\n"])), function (_a) {
18
- var loading = _a.loading;
19
- return loading && 'transparent';
20
- }, function (_a) {
21
- var loading = _a.loading;
22
- return (loading ? 'none' : 'inherit');
23
- }, function (_a) {
24
- var loading = _a.loading;
25
- return loading && 'transparent';
26
- }, function (_a) {
27
- var theme = _a.theme;
28
- return theme.spacing(2);
29
- }, function (_a) {
30
- var theme = _a.theme;
31
- return theme.spacing(2);
32
- }, getProgressColor);
33
- var templateObject_1;
@@ -1,6 +0,0 @@
1
- import { CircularProgressProps } from './types';
2
- export declare const StyledCircularProgress: import("@emotion/styled").StyledComponent<import("@mui/material").CircularProgressProps & {
3
- theme?: import("@emotion/react").Theme | undefined;
4
- } & Omit<CircularProgressProps, "color" | "size"> & {
5
- customColor?: "primary" | "inverted" | undefined;
6
- }, {}, {}>;