@astral/ui 0.1.1 → 0.2.4
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/esm/src/Badge/Badge.d.ts +1 -0
- package/esm/src/Badge/styled.d.ts +2 -2
- package/esm/src/Button/Button.d.ts +1 -0
- package/esm/src/Button/styled.js +4 -1
- package/esm/src/ButtonBase/ButtonBase.d.ts +1 -0
- package/esm/src/ButtonBase/styled.d.ts +1 -6
- package/esm/src/ButtonBase/styled.js +124 -118
- package/esm/src/Checkbox/Checkbox.d.ts +3 -0
- package/esm/src/Checkbox/Checkbox.js +29 -0
- package/esm/src/Checkbox/icons.d.ts +5 -0
- package/esm/src/Checkbox/icons.js +36 -0
- package/esm/src/Checkbox/index.d.ts +2 -0
- package/esm/src/Checkbox/index.js +2 -0
- package/esm/src/Checkbox/styled.d.ts +4 -0
- package/esm/src/Checkbox/styled.js +32 -0
- package/esm/src/Checkbox/types.d.ts +2 -0
- package/{cjs/src/theme/__tests__/BaseTheme.test.d.ts → esm/src/Checkbox/types.js} +0 -0
- package/esm/src/CircularProgress/CircularProgress.d.ts +1 -0
- package/esm/src/CircularProgress/CircularProgress.js +2 -1
- package/esm/src/CircularProgress/constants.d.ts +1 -2
- package/esm/src/CircularProgress/constants.js +0 -1
- package/esm/src/CircularProgress/styled.d.ts +0 -1
- package/esm/src/CircularProgress/styled.js +3 -9
- package/esm/src/FormControlLabel/FormControlLabel.d.ts +3 -0
- package/esm/src/FormControlLabel/FormControlLabel.js +28 -0
- package/esm/src/FormControlLabel/index.d.ts +2 -0
- package/esm/src/FormControlLabel/index.js +2 -0
- package/esm/src/FormControlLabel/styled.d.ts +3 -0
- package/esm/src/FormControlLabel/styled.js +11 -0
- package/esm/src/FormControlLabel/types.d.ts +2 -0
- package/esm/src/FormControlLabel/types.js +1 -0
- package/esm/src/FormHelperText/FormHelperText.d.ts +4 -0
- package/esm/src/FormHelperText/FormHelperText.js +20 -0
- package/esm/src/FormHelperText/index.d.ts +1 -0
- package/esm/src/FormHelperText/index.js +1 -0
- package/esm/src/FormHelperText/styled.d.ts +41 -0
- package/esm/src/FormHelperText/styled.js +11 -0
- package/esm/src/FormHelperText/types.d.ts +6 -0
- package/esm/src/FormHelperText/types.js +1 -0
- package/esm/src/GlobalStyles/GlobalStyles.d.ts +3 -0
- package/esm/src/GlobalStyles/GlobalStyles.js +35 -0
- package/esm/src/GlobalStyles/index.d.ts +1 -0
- package/esm/src/GlobalStyles/index.js +1 -0
- package/esm/src/Grid/Grid.d.ts +3 -0
- package/esm/src/Grid/Grid.js +28 -0
- package/esm/src/Grid/index.d.ts +2 -0
- package/esm/src/Grid/index.js +2 -0
- package/esm/src/Grid/styled.d.ts +13 -0
- package/esm/src/Grid/styled.js +11 -0
- package/esm/src/Grid/types.d.ts +30 -0
- package/esm/src/Grid/types.js +1 -0
- package/esm/src/IconButton/IconButton.d.ts +1 -0
- package/esm/src/Menu/Menu.d.ts +3 -0
- package/esm/src/Menu/Menu.js +28 -0
- package/esm/src/Menu/index.d.ts +1 -0
- package/esm/src/Menu/index.js +1 -0
- package/esm/src/MenuItem/MenuItem.d.ts +3 -0
- package/esm/src/MenuItem/MenuItem.js +28 -0
- package/esm/src/MenuItem/index.d.ts +1 -0
- package/esm/src/MenuItem/index.js +1 -0
- package/esm/src/MenuList/MenuList.d.ts +3 -0
- package/esm/src/MenuList/MenuList.js +28 -0
- package/esm/src/MenuList/index.d.ts +2 -0
- package/esm/src/MenuList/index.js +2 -0
- package/esm/src/MenuList/styled.d.ts +20 -0
- package/esm/src/MenuList/styled.js +17 -0
- package/esm/src/MenuList/types.d.ts +2 -0
- package/esm/src/MenuList/types.js +1 -0
- package/esm/src/Tag/Tag.d.ts +3 -0
- package/esm/src/Tag/Tag.js +28 -0
- package/esm/src/Tag/constants.d.ts +21 -0
- package/esm/src/Tag/constants.js +25 -0
- package/esm/src/Tag/index.d.ts +2 -0
- package/esm/src/Tag/index.js +2 -0
- package/esm/src/Tag/styled.d.ts +26 -0
- package/esm/src/Tag/styled.js +117 -0
- package/esm/src/Tag/types.d.ts +12 -0
- package/esm/src/Tag/types.js +1 -0
- package/esm/src/TextField/TextField.d.ts +4 -0
- package/esm/src/TextField/TextField.js +46 -0
- package/esm/src/TextField/index.d.ts +2 -0
- package/esm/src/TextField/index.js +2 -0
- package/esm/src/TextField/types.d.ts +6 -0
- package/esm/src/TextField/types.js +1 -0
- package/esm/src/ThemeProvider/ThemeProvider.js +3 -2
- package/esm/src/Typography/Typography.d.ts +1 -0
- package/esm/src/index.d.ts +10 -0
- package/esm/src/index.js +10 -0
- package/esm/src/theme/__tests__/BaseTheme.test.js +1 -1
- package/esm/src/theme/baseTheme.d.ts +4 -3
- package/esm/src/theme/baseTheme.js +2 -2
- package/esm/src/theme/components/MuiFormHelperText.d.ts +4 -0
- package/esm/src/theme/components/MuiFormHelperText.js +15 -0
- package/esm/src/theme/components/MuiFormLabel.d.ts +4 -0
- package/esm/src/theme/components/MuiFormLabel.js +11 -0
- package/esm/src/theme/components/MuiInputBase.d.ts +4 -0
- package/esm/src/theme/components/MuiInputBase.js +13 -0
- package/esm/src/theme/components/MuiInputLabel.d.ts +4 -0
- package/esm/src/theme/components/MuiInputLabel.js +29 -0
- package/esm/src/theme/components/MuiOutlinedInput.d.ts +4 -0
- package/esm/src/theme/components/MuiOutlinedInput.js +61 -0
- package/esm/src/theme/components/MuiTypography.d.ts +21 -0
- package/esm/src/theme/components/MuiTypography.js +18 -0
- package/esm/src/theme/{components.d.ts → components/components.d.ts} +2 -1
- package/esm/src/theme/components/components.js +61 -0
- package/esm/src/theme/components/index.d.ts +1 -0
- package/esm/src/theme/components/index.js +1 -0
- package/esm/src/theme/elevation.js +5 -5
- package/esm/src/theme/hooks/index.d.ts +1 -0
- package/esm/src/theme/hooks/index.js +1 -0
- package/esm/src/theme/hooks/useTheme/index.d.ts +2 -0
- package/esm/src/theme/hooks/useTheme/index.js +2 -0
- package/esm/src/theme/index.d.ts +1 -0
- package/esm/src/theme/index.js +1 -0
- package/esm/src/theme/palette/palette.d.ts +1 -1
- package/esm/src/theme/typography.js +1 -1
- package/{cjs → node}/index.d.ts +0 -0
- package/{cjs → node}/index.js +0 -0
- package/{cjs → node}/src/Badge/Badge.d.ts +1 -0
- package/{cjs → node}/src/Badge/Badge.js +0 -0
- package/{cjs → node}/src/Badge/index.d.ts +0 -0
- package/{cjs → node}/src/Badge/index.js +0 -0
- package/{cjs → node}/src/Badge/styled.d.ts +2 -2
- package/{cjs → node}/src/Badge/styled.js +0 -0
- package/{cjs → node}/src/Badge/types.d.ts +0 -0
- package/{cjs → node}/src/Badge/types.js +0 -0
- package/{cjs → node}/src/Button/Button.d.ts +1 -0
- package/{cjs → node}/src/Button/Button.js +0 -0
- package/{cjs → node}/src/Button/index.d.ts +0 -0
- package/{cjs → node}/src/Button/index.js +0 -0
- package/{cjs → node}/src/Button/styled.d.ts +0 -0
- package/{cjs → node}/src/Button/styled.js +4 -1
- package/{cjs → node}/src/Button/types.d.ts +0 -0
- package/{cjs → node}/src/Button/types.js +0 -0
- package/{cjs → node}/src/ButtonBase/ButtonBase.d.ts +1 -0
- package/{cjs → node}/src/ButtonBase/ButtonBase.js +0 -0
- package/{cjs → node}/src/ButtonBase/constants.d.ts +0 -0
- package/{cjs → node}/src/ButtonBase/constants.js +0 -0
- package/{cjs → node}/src/ButtonBase/index.d.ts +0 -0
- package/{cjs → node}/src/ButtonBase/index.js +0 -0
- package/{cjs → node}/src/ButtonBase/styled.d.ts +1 -6
- package/node/src/ButtonBase/styled.js +229 -0
- package/{cjs → node}/src/ButtonBase/types.d.ts +0 -0
- package/{cjs → node}/src/ButtonBase/types.js +0 -0
- package/node/src/Checkbox/Checkbox.d.ts +3 -0
- package/node/src/Checkbox/Checkbox.js +33 -0
- package/node/src/Checkbox/icons.d.ts +5 -0
- package/node/src/Checkbox/icons.js +42 -0
- package/node/src/Checkbox/index.d.ts +2 -0
- package/node/src/Checkbox/index.js +14 -0
- package/node/src/Checkbox/styled.d.ts +4 -0
- package/node/src/Checkbox/styled.js +35 -0
- package/node/src/Checkbox/types.d.ts +2 -0
- package/{cjs/src/CircularProgress → node/src/Checkbox}/types.js +0 -0
- package/{cjs → node}/src/CircularProgress/CircularProgress.d.ts +1 -0
- package/{cjs → node}/src/CircularProgress/CircularProgress.js +2 -1
- package/{cjs → node}/src/CircularProgress/constants.d.ts +1 -2
- package/{cjs → node}/src/CircularProgress/constants.js +0 -1
- package/{cjs → node}/src/CircularProgress/index.d.ts +0 -0
- package/{cjs → node}/src/CircularProgress/index.js +0 -0
- package/{cjs → node}/src/CircularProgress/styled.d.ts +0 -1
- package/{cjs → node}/src/CircularProgress/styled.js +2 -8
- package/{cjs → node}/src/CircularProgress/types.d.ts +0 -0
- package/{cjs/src/styles/styled → node/src/CircularProgress}/types.js +0 -0
- package/node/src/FormControlLabel/FormControlLabel.d.ts +3 -0
- package/node/src/FormControlLabel/FormControlLabel.js +32 -0
- package/node/src/FormControlLabel/index.d.ts +2 -0
- package/node/src/FormControlLabel/index.js +14 -0
- package/node/src/FormControlLabel/styled.d.ts +3 -0
- package/node/src/FormControlLabel/styled.js +14 -0
- package/node/src/FormControlLabel/types.d.ts +2 -0
- package/node/src/FormControlLabel/types.js +2 -0
- package/node/src/FormHelperText/FormHelperText.d.ts +4 -0
- package/node/src/FormHelperText/FormHelperText.js +24 -0
- package/node/src/FormHelperText/index.d.ts +1 -0
- package/node/src/FormHelperText/index.js +13 -0
- package/node/src/FormHelperText/styled.d.ts +41 -0
- package/node/src/FormHelperText/styled.js +14 -0
- package/node/src/FormHelperText/types.d.ts +6 -0
- package/node/src/FormHelperText/types.js +2 -0
- package/node/src/GlobalStyles/GlobalStyles.d.ts +3 -0
- package/node/src/GlobalStyles/GlobalStyles.js +39 -0
- package/node/src/GlobalStyles/index.d.ts +1 -0
- package/node/src/GlobalStyles/index.js +13 -0
- package/node/src/Grid/Grid.d.ts +3 -0
- package/node/src/Grid/Grid.js +32 -0
- package/node/src/Grid/index.d.ts +2 -0
- package/node/src/Grid/index.js +14 -0
- package/node/src/Grid/styled.d.ts +13 -0
- package/node/src/Grid/styled.js +14 -0
- package/node/src/Grid/types.d.ts +30 -0
- package/node/src/Grid/types.js +2 -0
- package/{cjs → node}/src/IconButton/IconButton.d.ts +1 -0
- package/{cjs → node}/src/IconButton/IconButton.js +0 -0
- package/{cjs → node}/src/IconButton/index.d.ts +0 -0
- package/{cjs → node}/src/IconButton/index.js +0 -0
- package/{cjs → node}/src/IconButton/styled.d.ts +0 -0
- package/{cjs → node}/src/IconButton/styled.js +0 -0
- package/node/src/Menu/Menu.d.ts +3 -0
- package/node/src/Menu/Menu.js +32 -0
- package/node/src/Menu/index.d.ts +1 -0
- package/node/src/Menu/index.js +13 -0
- package/node/src/MenuItem/MenuItem.d.ts +3 -0
- package/node/src/MenuItem/MenuItem.js +32 -0
- package/node/src/MenuItem/index.d.ts +1 -0
- package/node/src/MenuItem/index.js +13 -0
- package/node/src/MenuList/MenuList.d.ts +3 -0
- package/node/src/MenuList/MenuList.js +32 -0
- package/node/src/MenuList/index.d.ts +2 -0
- package/node/src/MenuList/index.js +14 -0
- package/node/src/MenuList/styled.d.ts +20 -0
- package/node/src/MenuList/styled.js +20 -0
- package/node/src/MenuList/types.d.ts +2 -0
- package/node/src/MenuList/types.js +2 -0
- package/node/src/Tag/Tag.d.ts +3 -0
- package/node/src/Tag/Tag.js +32 -0
- package/node/src/Tag/constants.d.ts +21 -0
- package/node/src/Tag/constants.js +28 -0
- package/node/src/Tag/index.d.ts +2 -0
- package/node/src/Tag/index.js +14 -0
- package/node/src/Tag/styled.d.ts +26 -0
- package/node/src/Tag/styled.js +120 -0
- package/node/src/Tag/types.d.ts +12 -0
- package/node/src/Tag/types.js +2 -0
- package/node/src/TextField/TextField.d.ts +4 -0
- package/node/src/TextField/TextField.js +53 -0
- package/node/src/TextField/index.d.ts +2 -0
- package/node/src/TextField/index.js +14 -0
- package/node/src/TextField/types.d.ts +6 -0
- package/node/src/TextField/types.js +2 -0
- package/{cjs → node}/src/ThemeProvider/ThemeProvider.d.ts +0 -0
- package/{cjs → node}/src/ThemeProvider/ThemeProvider.js +2 -1
- package/{cjs → node}/src/ThemeProvider/index.d.ts +0 -0
- package/{cjs → node}/src/ThemeProvider/index.js +0 -0
- package/{cjs → node}/src/Typography/Typography.d.ts +1 -0
- package/{cjs → node}/src/Typography/Typography.js +0 -0
- package/{cjs → node}/src/Typography/index.d.ts +0 -0
- package/{cjs → node}/src/Typography/index.js +0 -0
- package/node/src/index.d.ts +18 -0
- package/{cjs → node}/src/index.js +10 -0
- package/{cjs → node}/src/styles/index.d.ts +0 -0
- package/{cjs → node}/src/styles/index.js +0 -0
- package/{cjs → node}/src/styles/styled/index.d.ts +0 -0
- package/{cjs → node}/src/styles/styled/index.js +0 -0
- package/{cjs → node}/src/styles/styled/styled.d.ts +0 -0
- package/{cjs → node}/src/styles/styled/styled.js +0 -0
- package/{cjs → node}/src/styles/styled/types.d.ts +0 -0
- package/node/src/styles/styled/types.js +2 -0
- package/node/src/theme/__tests__/BaseTheme.test.d.ts +1 -0
- package/{cjs → node}/src/theme/__tests__/BaseTheme.test.js +1 -1
- package/{cjs → node}/src/theme/baseTheme.d.ts +4 -3
- package/{cjs → node}/src/theme/baseTheme.js +2 -2
- package/node/src/theme/components/MuiFormHelperText.d.ts +4 -0
- package/node/src/theme/components/MuiFormHelperText.js +18 -0
- package/node/src/theme/components/MuiFormLabel.d.ts +4 -0
- package/node/src/theme/components/MuiFormLabel.js +14 -0
- package/node/src/theme/components/MuiInputBase.d.ts +4 -0
- package/node/src/theme/components/MuiInputBase.js +16 -0
- package/node/src/theme/components/MuiInputLabel.d.ts +4 -0
- package/node/src/theme/components/MuiInputLabel.js +32 -0
- package/node/src/theme/components/MuiOutlinedInput.d.ts +4 -0
- package/node/src/theme/components/MuiOutlinedInput.js +64 -0
- package/node/src/theme/components/MuiTypography.d.ts +21 -0
- package/node/src/theme/components/MuiTypography.js +21 -0
- package/{cjs/src/theme → node/src/theme/components}/components.d.ts +2 -1
- package/node/src/theme/components/components.js +65 -0
- package/node/src/theme/components/index.d.ts +1 -0
- package/node/src/theme/components/index.js +13 -0
- package/{cjs → node}/src/theme/constants.d.ts +0 -0
- package/{cjs → node}/src/theme/constants.js +0 -0
- package/{cjs → node}/src/theme/elevation.d.ts +0 -0
- package/node/src/theme/elevation.js +10 -0
- package/node/src/theme/hooks/index.d.ts +1 -0
- package/node/src/theme/hooks/index.js +13 -0
- package/node/src/theme/hooks/useTheme/index.d.ts +2 -0
- package/node/src/theme/hooks/useTheme/index.js +6 -0
- package/{cjs → node}/src/theme/index.d.ts +1 -0
- package/{cjs → node}/src/theme/index.js +1 -0
- package/{cjs → node}/src/theme/palette/brandPalette.d.ts +0 -0
- package/{cjs → node}/src/theme/palette/brandPalette.js +0 -0
- package/{cjs → node}/src/theme/palette/index.d.ts +0 -0
- package/{cjs → node}/src/theme/palette/index.js +0 -0
- package/{cjs → node}/src/theme/palette/palette.d.ts +1 -1
- package/{cjs → node}/src/theme/palette/palette.js +0 -0
- package/{cjs → node}/src/theme/shape.d.ts +0 -0
- package/{cjs → node}/src/theme/shape.js +0 -0
- package/{cjs → node}/src/theme/typography.d.ts +0 -0
- package/{cjs → node}/src/theme/typography.js +1 -1
- package/package.json +3 -2
- package/cjs/src/ButtonBase/styled.js +0 -224
- package/cjs/src/index.d.ts +0 -8
- package/cjs/src/theme/components.js +0 -28
- package/cjs/src/theme/elevation.js +0 -10
- package/esm/src/theme/components.js +0 -24
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.MuiInputBase = void 0;
|
|
4
|
+
exports.MuiInputBase = {
|
|
5
|
+
styleOverrides: {
|
|
6
|
+
root: function (_a) {
|
|
7
|
+
var theme = _a.theme;
|
|
8
|
+
return {
|
|
9
|
+
'&.MuiInputBase-colorSuccess + .MuiFormHelperText-root': {
|
|
10
|
+
color: theme.palette.green[800],
|
|
11
|
+
},
|
|
12
|
+
};
|
|
13
|
+
},
|
|
14
|
+
},
|
|
15
|
+
};
|
|
16
|
+
exports.default = exports.MuiInputBase;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.MuiInputLabel = void 0;
|
|
4
|
+
exports.MuiInputLabel = {
|
|
5
|
+
defaultProps: {
|
|
6
|
+
shrink: true,
|
|
7
|
+
},
|
|
8
|
+
styleOverrides: {
|
|
9
|
+
root: function (_a) {
|
|
10
|
+
var theme = _a.theme;
|
|
11
|
+
return {
|
|
12
|
+
position: 'relative',
|
|
13
|
+
transform: 'none',
|
|
14
|
+
color: theme.palette.grey[700],
|
|
15
|
+
fontWeight: theme.typography.fontWeightMedium,
|
|
16
|
+
fontSize: theme.typography.pxToRem(12),
|
|
17
|
+
lineHeight: theme.typography.pxToRem(16),
|
|
18
|
+
marginBottom: theme.spacing(1),
|
|
19
|
+
'&.Mui-focused': {
|
|
20
|
+
color: theme.palette.grey[700],
|
|
21
|
+
},
|
|
22
|
+
'&.Mui-error': {
|
|
23
|
+
color: theme.palette.grey[700],
|
|
24
|
+
},
|
|
25
|
+
'&.Mui-disabled': {
|
|
26
|
+
color: theme.palette.grey[600],
|
|
27
|
+
},
|
|
28
|
+
};
|
|
29
|
+
},
|
|
30
|
+
},
|
|
31
|
+
};
|
|
32
|
+
exports.default = exports.MuiInputLabel;
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.MuiOutlinedInput = void 0;
|
|
4
|
+
exports.MuiOutlinedInput = {
|
|
5
|
+
defaultProps: {
|
|
6
|
+
notched: false,
|
|
7
|
+
},
|
|
8
|
+
styleOverrides: {
|
|
9
|
+
root: function (_a) {
|
|
10
|
+
var theme = _a.theme;
|
|
11
|
+
return {
|
|
12
|
+
fontSize: theme.typography.pxToRem(14),
|
|
13
|
+
borderRadius: theme.shape.small,
|
|
14
|
+
color: theme.palette.grey[900],
|
|
15
|
+
background: theme.palette.background.element,
|
|
16
|
+
'&:hover': {
|
|
17
|
+
// FIXME: to theme
|
|
18
|
+
background: '#EEF1F4',
|
|
19
|
+
},
|
|
20
|
+
'&:hover .MuiOutlinedInput-notchedOutline': {
|
|
21
|
+
borderColor: theme.palette.grey[300],
|
|
22
|
+
},
|
|
23
|
+
'&.Mui-disabled .MuiOutlinedInput-notchedOutline': {
|
|
24
|
+
borderColor: theme.palette.background.element,
|
|
25
|
+
},
|
|
26
|
+
'&.Mui-error .MuiOutlinedInput-notchedOutline': {
|
|
27
|
+
borderColor: theme.palette.error.dark,
|
|
28
|
+
},
|
|
29
|
+
'&.Mui-focused .MuiOutlinedInput-notchedOutline': {
|
|
30
|
+
borderColor: theme.palette.primary[700],
|
|
31
|
+
},
|
|
32
|
+
};
|
|
33
|
+
},
|
|
34
|
+
input: function (_a) {
|
|
35
|
+
var theme = _a.theme;
|
|
36
|
+
return {
|
|
37
|
+
padding: theme.spacing(2.5, 2),
|
|
38
|
+
borderRadius: theme.shape.small,
|
|
39
|
+
'&:disabled': {
|
|
40
|
+
background: theme.palette.background.element,
|
|
41
|
+
},
|
|
42
|
+
'&::placeholder': {
|
|
43
|
+
opacity: 1,
|
|
44
|
+
color: theme.palette.grey[600],
|
|
45
|
+
},
|
|
46
|
+
};
|
|
47
|
+
},
|
|
48
|
+
inputSizeSmall: function (_a) {
|
|
49
|
+
var theme = _a.theme;
|
|
50
|
+
return {
|
|
51
|
+
paddingBlock: theme.spacing(2),
|
|
52
|
+
paddingInline: theme.spacing(1.5),
|
|
53
|
+
};
|
|
54
|
+
},
|
|
55
|
+
notchedOutline: function (_a) {
|
|
56
|
+
var theme = _a.theme;
|
|
57
|
+
return {
|
|
58
|
+
borderWidth: '2px',
|
|
59
|
+
borderColor: theme.palette.grey[300],
|
|
60
|
+
};
|
|
61
|
+
},
|
|
62
|
+
},
|
|
63
|
+
};
|
|
64
|
+
exports.default = exports.MuiOutlinedInput;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { Components } from '@mui/material';
|
|
2
|
+
export declare type FontsUrls = {
|
|
3
|
+
bold: {
|
|
4
|
+
woff: string;
|
|
5
|
+
woff2: string;
|
|
6
|
+
};
|
|
7
|
+
light: {
|
|
8
|
+
woff: string;
|
|
9
|
+
woff2: string;
|
|
10
|
+
};
|
|
11
|
+
medium: {
|
|
12
|
+
woff: string;
|
|
13
|
+
woff2: string;
|
|
14
|
+
};
|
|
15
|
+
regular: {
|
|
16
|
+
woff: string;
|
|
17
|
+
woff2: string;
|
|
18
|
+
};
|
|
19
|
+
};
|
|
20
|
+
export declare const MuiTypography: Components['MuiTypography'];
|
|
21
|
+
export default MuiTypography;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.MuiTypography = void 0;
|
|
4
|
+
exports.MuiTypography = {
|
|
5
|
+
variants: [
|
|
6
|
+
{
|
|
7
|
+
props: { variant: 'button' },
|
|
8
|
+
style: {
|
|
9
|
+
textTransform: 'capitalize',
|
|
10
|
+
},
|
|
11
|
+
},
|
|
12
|
+
],
|
|
13
|
+
defaultProps: {
|
|
14
|
+
// TODO: необходимо кастомизировать типы Components['MuiTypography']
|
|
15
|
+
variantMapping: {
|
|
16
|
+
link: 'a',
|
|
17
|
+
code: 'code',
|
|
18
|
+
},
|
|
19
|
+
},
|
|
20
|
+
};
|
|
21
|
+
exports.default = exports.MuiTypography;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { Components } from '@mui/material';
|
|
2
|
+
import type { Theme } from '../baseTheme';
|
|
2
3
|
export declare type FontsUrls = {
|
|
3
4
|
bold: {
|
|
4
5
|
woff: string;
|
|
@@ -17,4 +18,4 @@ export declare type FontsUrls = {
|
|
|
17
18
|
woff2: string;
|
|
18
19
|
};
|
|
19
20
|
};
|
|
20
|
-
export declare const getComponents: (fontUrls: FontsUrls) => Components
|
|
21
|
+
export declare const getComponents: (fontUrls: FontsUrls) => Components<Theme>;
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getComponents = void 0;
|
|
4
|
+
var MuiInputBase_1 = require("./MuiInputBase");
|
|
5
|
+
var MuiFormHelperText_1 = require("./MuiFormHelperText");
|
|
6
|
+
var MuiFormLabel_1 = require("./MuiFormLabel");
|
|
7
|
+
var MuiInputLabel_1 = require("./MuiInputLabel");
|
|
8
|
+
var MuiOutlinedInput_1 = require("./MuiOutlinedInput");
|
|
9
|
+
var MuiTypography_1 = require("./MuiTypography");
|
|
10
|
+
var getMuiCssBaseline = function (fontUrls) { return ({
|
|
11
|
+
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 "),
|
|
12
|
+
}); };
|
|
13
|
+
var MuiCheckbox = {
|
|
14
|
+
defaultProps: {
|
|
15
|
+
disableRipple: true,
|
|
16
|
+
},
|
|
17
|
+
};
|
|
18
|
+
var MuiMenu = {
|
|
19
|
+
defaultProps: {
|
|
20
|
+
autoFocus: false,
|
|
21
|
+
},
|
|
22
|
+
styleOverrides: {
|
|
23
|
+
paper: function (_a) {
|
|
24
|
+
var theme = _a.theme;
|
|
25
|
+
return {
|
|
26
|
+
marginTop: theme.spacing(2),
|
|
27
|
+
'&.MuiPaper-root': {
|
|
28
|
+
borderRadius: theme.shape.small,
|
|
29
|
+
boxShadow: theme.elevation[200],
|
|
30
|
+
},
|
|
31
|
+
};
|
|
32
|
+
},
|
|
33
|
+
list: function (_a) {
|
|
34
|
+
var theme = _a.theme;
|
|
35
|
+
return {
|
|
36
|
+
padding: theme.spacing(1, 0),
|
|
37
|
+
};
|
|
38
|
+
},
|
|
39
|
+
},
|
|
40
|
+
};
|
|
41
|
+
var MuiMenuItem = {
|
|
42
|
+
styleOverrides: {
|
|
43
|
+
root: function (_a) {
|
|
44
|
+
var theme = _a.theme;
|
|
45
|
+
return {
|
|
46
|
+
'&:hover': {
|
|
47
|
+
backgroundColor: theme.palette.background.elementHover,
|
|
48
|
+
},
|
|
49
|
+
};
|
|
50
|
+
},
|
|
51
|
+
},
|
|
52
|
+
};
|
|
53
|
+
var getComponents = function (fontUrls) { return ({
|
|
54
|
+
MuiCssBaseline: getMuiCssBaseline(fontUrls),
|
|
55
|
+
MuiTypography: MuiTypography_1.MuiTypography,
|
|
56
|
+
MuiInputBase: MuiInputBase_1.MuiInputBase,
|
|
57
|
+
MuiInputLabel: MuiInputLabel_1.MuiInputLabel,
|
|
58
|
+
MuiOutlinedInput: MuiOutlinedInput_1.MuiOutlinedInput,
|
|
59
|
+
MuiFormLabel: MuiFormLabel_1.MuiFormLabel,
|
|
60
|
+
MuiFormHelperText: MuiFormHelperText_1.MuiFormHelperText,
|
|
61
|
+
MuiCheckbox: MuiCheckbox,
|
|
62
|
+
MuiMenu: MuiMenu,
|
|
63
|
+
MuiMenuItem: MuiMenuItem,
|
|
64
|
+
}); };
|
|
65
|
+
exports.getComponents = getComponents;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './components';
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
5
|
+
}) : (function(o, m, k, k2) {
|
|
6
|
+
if (k2 === undefined) k2 = k;
|
|
7
|
+
o[k2] = m[k];
|
|
8
|
+
}));
|
|
9
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
10
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
11
|
+
};
|
|
12
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
|
+
__exportStar(require("./components"), exports);
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.elevation = void 0;
|
|
4
|
+
exports.elevation = {
|
|
5
|
+
100: '0px 0px 1px 0px #072D574F, 0px 1px 1px 0px #072D5740;',
|
|
6
|
+
200: '0px 0px 1px 0px #072D574F, 0px 3px 5px 0px #072D5733;',
|
|
7
|
+
300: '0px 0px 1px 0px #072D574F, 0px 8px 12px 0px #072D5726;',
|
|
8
|
+
400: '0px 0px 1px 0px #072D574F, 0px 10px 18px 0px #072D5726;',
|
|
9
|
+
500: '0px 0px 1px 0px #072D574F, 0px 18px 28px 0px #072D5726;',
|
|
10
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './useTheme';
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
5
|
+
}) : (function(o, m, k, k2) {
|
|
6
|
+
if (k2 === undefined) k2 = k;
|
|
7
|
+
o[k2] = m[k];
|
|
8
|
+
}));
|
|
9
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
10
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
11
|
+
};
|
|
12
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
|
+
__exportStar(require("./useTheme"), exports);
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -13,7 +13,7 @@ export declare type Color = {
|
|
|
13
13
|
100: string;
|
|
14
14
|
};
|
|
15
15
|
export declare type PrimaryColorOptions = PaletteColorOptions & Color;
|
|
16
|
-
declare type Background = TypeBackground & {
|
|
16
|
+
export declare type Background = TypeBackground & {
|
|
17
17
|
element: string;
|
|
18
18
|
elementHover: string;
|
|
19
19
|
};
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -5,7 +5,7 @@ var HTML_FONT_SIZE = 14;
|
|
|
5
5
|
// Т.к. нет досутпа к теме, написал функцию для конвертации px в rem
|
|
6
6
|
var pxToRem = function (fontSize, htmlFontSize) {
|
|
7
7
|
if (htmlFontSize === void 0) { htmlFontSize = HTML_FONT_SIZE; }
|
|
8
|
-
return fontSize / htmlFontSize
|
|
8
|
+
return "".concat(fontSize / htmlFontSize, "rem");
|
|
9
9
|
};
|
|
10
10
|
exports.pxToRem = pxToRem;
|
|
11
11
|
exports.typography = {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@astral/ui",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.2.4",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"source": "./src/index.ts",
|
|
6
6
|
"jest": {
|
|
@@ -9,6 +9,7 @@
|
|
|
9
9
|
}
|
|
10
10
|
},
|
|
11
11
|
"dependencies": {
|
|
12
|
+
"@astral/icons": "^0.2.2",
|
|
12
13
|
"@emotion/react": "11.5.0",
|
|
13
14
|
"@emotion/styled": "11.3.0",
|
|
14
15
|
"@mui/base": "5.0.0-alpha.66",
|
|
@@ -30,7 +31,7 @@
|
|
|
30
31
|
},
|
|
31
32
|
"keywords": [],
|
|
32
33
|
"sideEffects": false,
|
|
33
|
-
"main": "./
|
|
34
|
+
"main": "./node/index.js",
|
|
34
35
|
"types": "./esm/index.d.ts",
|
|
35
36
|
"module": "./esm/index.js"
|
|
36
37
|
}
|
|
@@ -1,224 +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
|
-
var __assign = (this && this.__assign) || function () {
|
|
7
|
-
__assign = Object.assign || function(t) {
|
|
8
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
9
|
-
s = arguments[i];
|
|
10
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
11
|
-
t[p] = s[p];
|
|
12
|
-
}
|
|
13
|
-
return t;
|
|
14
|
-
};
|
|
15
|
-
return __assign.apply(this, arguments);
|
|
16
|
-
};
|
|
17
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
18
|
-
if (k2 === undefined) k2 = k;
|
|
19
|
-
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
20
|
-
}) : (function(o, m, k, k2) {
|
|
21
|
-
if (k2 === undefined) k2 = k;
|
|
22
|
-
o[k2] = m[k];
|
|
23
|
-
}));
|
|
24
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
25
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
26
|
-
}) : function(o, v) {
|
|
27
|
-
o["default"] = v;
|
|
28
|
-
});
|
|
29
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
30
|
-
if (mod && mod.__esModule) return mod;
|
|
31
|
-
var result = {};
|
|
32
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
33
|
-
__setModuleDefault(result, mod);
|
|
34
|
-
return result;
|
|
35
|
-
};
|
|
36
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
37
|
-
exports.StyledButtonBase = exports.getDisabledBgColor = exports.getButtonPadding = exports.getButtonHeight = exports.getBgColor = exports.getBgText = exports.getColor = void 0;
|
|
38
|
-
var ButtonUnstyled_1 = __importStar(require("@mui/base/ButtonUnstyled"));
|
|
39
|
-
var styles_1 = require("../styles");
|
|
40
|
-
var constants_1 = require("./constants");
|
|
41
|
-
var BACKGROUND_COLOR_VARIANTS = {
|
|
42
|
-
default: {
|
|
43
|
-
contained: '800',
|
|
44
|
-
light: '100',
|
|
45
|
-
text: '100',
|
|
46
|
-
},
|
|
47
|
-
hover: {
|
|
48
|
-
contained: '700',
|
|
49
|
-
light: '200',
|
|
50
|
-
text: '200',
|
|
51
|
-
},
|
|
52
|
-
focus: {
|
|
53
|
-
contained: '900',
|
|
54
|
-
light: '100',
|
|
55
|
-
text: '100',
|
|
56
|
-
},
|
|
57
|
-
};
|
|
58
|
-
var getColor = function (_a) {
|
|
59
|
-
var theme = _a.theme, customVariant = _a.customVariant, customColor = _a.customColor, buttonState = _a.buttonState;
|
|
60
|
-
var palette = theme.palette;
|
|
61
|
-
if (buttonState === constants_1.ButtonStates.ACTIVE) {
|
|
62
|
-
if (customVariant === constants_1.ButtonVariants.LINK)
|
|
63
|
-
return palette.grey['900'];
|
|
64
|
-
return palette.primary.contrastText;
|
|
65
|
-
}
|
|
66
|
-
if (customVariant === constants_1.ButtonVariants.TEXT) {
|
|
67
|
-
if (buttonState === constants_1.ButtonStates.FOCUS)
|
|
68
|
-
return theme.palette.primary.main;
|
|
69
|
-
return palette.grey['900'];
|
|
70
|
-
}
|
|
71
|
-
if (customVariant === constants_1.ButtonVariants.CONTAINED)
|
|
72
|
-
return palette.primary.contrastText;
|
|
73
|
-
if (customVariant === constants_1.ButtonVariants.LIGHT) {
|
|
74
|
-
if (customColor === constants_1.ButtonColors.PRIMARY) {
|
|
75
|
-
if (buttonState === constants_1.ButtonStates.DEFAULT)
|
|
76
|
-
return palette.grey['900'];
|
|
77
|
-
if (buttonState === constants_1.ButtonStates.HOVER)
|
|
78
|
-
return palette.grey['900'];
|
|
79
|
-
if (buttonState === constants_1.ButtonStates.FOCUS)
|
|
80
|
-
return palette.primary['800'];
|
|
81
|
-
}
|
|
82
|
-
if (customColor === constants_1.ButtonColors.ERROR)
|
|
83
|
-
return palette.red['900'];
|
|
84
|
-
if (customColor === constants_1.ButtonColors.SUCCESS)
|
|
85
|
-
return palette.green['900'];
|
|
86
|
-
if (customColor === constants_1.ButtonColors.WARNING)
|
|
87
|
-
return palette.yellow['900'];
|
|
88
|
-
return palette.grey['900'];
|
|
89
|
-
}
|
|
90
|
-
if (customVariant === constants_1.ButtonVariants.LINK) {
|
|
91
|
-
if (buttonState === constants_1.ButtonStates.DEFAULT)
|
|
92
|
-
return palette.primary['800'];
|
|
93
|
-
if (buttonState === constants_1.ButtonStates.HOVER)
|
|
94
|
-
return palette.primary['700'];
|
|
95
|
-
if (buttonState === constants_1.ButtonStates.FOCUS)
|
|
96
|
-
return palette.primary.dark;
|
|
97
|
-
return palette.primary.main;
|
|
98
|
-
}
|
|
99
|
-
return palette.grey['900'];
|
|
100
|
-
};
|
|
101
|
-
exports.getColor = getColor;
|
|
102
|
-
var getBgText = function (_a) {
|
|
103
|
-
var palette = _a.palette, buttonState = _a.buttonState, colorVariant = _a.colorVariant;
|
|
104
|
-
if (buttonState === constants_1.ButtonStates.HOVER)
|
|
105
|
-
return palette.grey[colorVariant];
|
|
106
|
-
if (buttonState === constants_1.ButtonStates.FOCUS)
|
|
107
|
-
return palette.primary[colorVariant];
|
|
108
|
-
return 'transparent';
|
|
109
|
-
};
|
|
110
|
-
exports.getBgText = getBgText;
|
|
111
|
-
var getBgContained = function (_a) {
|
|
112
|
-
var palette = _a.palette, colorVariant = _a.colorVariant, customColor = _a.customColor;
|
|
113
|
-
if (customColor === constants_1.ButtonColors.ERROR)
|
|
114
|
-
return palette.red[colorVariant];
|
|
115
|
-
if (customColor === constants_1.ButtonColors.SUCCESS)
|
|
116
|
-
return palette.green[colorVariant];
|
|
117
|
-
if (customColor === constants_1.ButtonColors.WARNING)
|
|
118
|
-
return palette.yellow[colorVariant];
|
|
119
|
-
if (customColor === constants_1.ButtonColors.PRIMARY)
|
|
120
|
-
return palette.primary[colorVariant];
|
|
121
|
-
return 'transparent';
|
|
122
|
-
};
|
|
123
|
-
var getBgLight = function (_a) {
|
|
124
|
-
var palette = _a.palette, colorVariant = _a.colorVariant, buttonState = _a.buttonState, customColor = _a.customColor;
|
|
125
|
-
if (customColor === constants_1.ButtonColors.PRIMARY) {
|
|
126
|
-
if (buttonState === constants_1.ButtonStates.DEFAULT)
|
|
127
|
-
return palette.grey[colorVariant];
|
|
128
|
-
if (buttonState === constants_1.ButtonStates.HOVER)
|
|
129
|
-
return palette.grey[colorVariant];
|
|
130
|
-
if (buttonState === constants_1.ButtonStates.FOCUS)
|
|
131
|
-
return palette.primary[colorVariant];
|
|
132
|
-
}
|
|
133
|
-
if (customColor === constants_1.ButtonColors.ERROR)
|
|
134
|
-
return palette.red[colorVariant];
|
|
135
|
-
if (customColor === constants_1.ButtonColors.SUCCESS)
|
|
136
|
-
return palette.green[colorVariant];
|
|
137
|
-
if (customColor === constants_1.ButtonColors.WARNING)
|
|
138
|
-
return palette.yellow[colorVariant];
|
|
139
|
-
return 'transparent';
|
|
140
|
-
};
|
|
141
|
-
var getBgColor = function (_a) {
|
|
142
|
-
var customColor = _a.customColor, customVariant = _a.customVariant, buttonState = _a.buttonState, theme = _a.theme;
|
|
143
|
-
var palette = theme.palette;
|
|
144
|
-
if (customVariant === constants_1.ButtonVariants.LINK)
|
|
145
|
-
return 'transparent';
|
|
146
|
-
if (buttonState === constants_1.ButtonStates.ACTIVE)
|
|
147
|
-
return palette.grey['900'];
|
|
148
|
-
var containedColor = BACKGROUND_COLOR_VARIANTS[buttonState].contained;
|
|
149
|
-
var lightColor = BACKGROUND_COLOR_VARIANTS[buttonState].light;
|
|
150
|
-
var textColor = BACKGROUND_COLOR_VARIANTS[buttonState].text;
|
|
151
|
-
if (customVariant === constants_1.ButtonVariants.TEXT)
|
|
152
|
-
return (0, exports.getBgText)({ buttonState: buttonState, palette: palette, colorVariant: textColor });
|
|
153
|
-
if (customVariant === constants_1.ButtonVariants.CONTAINED)
|
|
154
|
-
return getBgContained({
|
|
155
|
-
palette: palette,
|
|
156
|
-
customColor: customColor,
|
|
157
|
-
colorVariant: containedColor,
|
|
158
|
-
});
|
|
159
|
-
if (customVariant === constants_1.ButtonVariants.LIGHT)
|
|
160
|
-
return getBgLight({
|
|
161
|
-
palette: palette,
|
|
162
|
-
buttonState: buttonState,
|
|
163
|
-
customColor: customColor,
|
|
164
|
-
colorVariant: lightColor,
|
|
165
|
-
});
|
|
166
|
-
return 'transparent';
|
|
167
|
-
};
|
|
168
|
-
exports.getBgColor = getBgColor;
|
|
169
|
-
var getButtonHeight = function (_a) {
|
|
170
|
-
var size = _a.size;
|
|
171
|
-
if (size === constants_1.ButtonSizes.LARGE)
|
|
172
|
-
return '40px';
|
|
173
|
-
return '32px';
|
|
174
|
-
};
|
|
175
|
-
exports.getButtonHeight = getButtonHeight;
|
|
176
|
-
var getButtonPadding = function (_a) {
|
|
177
|
-
var size = _a.size, theme = _a.theme;
|
|
178
|
-
if (size === constants_1.ButtonSizes.LARGE)
|
|
179
|
-
return theme.spacing(2, 4, 2, 4);
|
|
180
|
-
return theme.spacing(1, 3, 1, 3);
|
|
181
|
-
};
|
|
182
|
-
exports.getButtonPadding = getButtonPadding;
|
|
183
|
-
var getDisabledBgColor = function (_a) {
|
|
184
|
-
var theme = _a.theme, customVariant = _a.customVariant;
|
|
185
|
-
if (customVariant === constants_1.ButtonVariants.LINK ||
|
|
186
|
-
customVariant === constants_1.ButtonVariants.TEXT)
|
|
187
|
-
return 'transparent';
|
|
188
|
-
return theme.palette.grey['100'];
|
|
189
|
-
};
|
|
190
|
-
exports.getDisabledBgColor = getDisabledBgColor;
|
|
191
|
-
exports.StyledButtonBase = (0, styles_1.styled)(ButtonUnstyled_1.default, {
|
|
192
|
-
shouldForwardProp: function (prop) {
|
|
193
|
-
return prop !== 'customColor' && prop !== 'customVariant';
|
|
194
|
-
},
|
|
195
|
-
})(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n border: none;\n font-family: Ubuntu, serif;\n padding: ", ";\n height: ", ";\n border-radius: ", ";\n cursor: pointer;\n font-size: ", ";\n font-weight: ", ";\n display: inline-flex;\n align-items: center;\n justify-content: center;\n position: relative;\n\n background-color: ", ";\n color: ", ";\n\n &:hover {\n background-color: ", ";\n color: ", ";\n }\n\n &:focus {\n background-color: ", ";\n color: ", ";\n }\n\n &:active {\n background-color: ", ";\n color: ", ";\n }\n\n &.", " {\n cursor: unset;\n background-color: ", ";\n color: ", ";\n }\n"], ["\n border: none;\n font-family: Ubuntu, serif;\n padding: ", ";\n height: ", ";\n border-radius: ", ";\n cursor: pointer;\n font-size: ", ";\n font-weight: ", ";\n display: inline-flex;\n align-items: center;\n justify-content: center;\n position: relative;\n\n background-color: ", ";\n color: ", ";\n\n &:hover {\n background-color: ", ";\n color: ", ";\n }\n\n &:focus {\n background-color: ", ";\n color: ", ";\n }\n\n &:active {\n background-color: ", ";\n color: ", ";\n }\n\n &.", " {\n cursor: unset;\n background-color: ", ";\n color: ", ";\n }\n"])), exports.getButtonPadding, exports.getButtonHeight, function (_a) {
|
|
196
|
-
var theme = _a.theme;
|
|
197
|
-
return theme.shape.small;
|
|
198
|
-
}, function (_a) {
|
|
199
|
-
var theme = _a.theme;
|
|
200
|
-
return theme.typography.button.fontSize;
|
|
201
|
-
}, function (_a) {
|
|
202
|
-
var theme = _a.theme;
|
|
203
|
-
return theme.typography.button.fontWeight;
|
|
204
|
-
}, function (props) {
|
|
205
|
-
return (0, exports.getBgColor)(__assign(__assign({}, props), { buttonState: constants_1.ButtonStates.DEFAULT }));
|
|
206
|
-
}, function (props) {
|
|
207
|
-
return (0, exports.getColor)(__assign(__assign({}, props), { buttonState: constants_1.ButtonStates.DEFAULT }));
|
|
208
|
-
}, function (props) {
|
|
209
|
-
return (0, exports.getBgColor)(__assign(__assign({}, props), { buttonState: constants_1.ButtonStates.HOVER }));
|
|
210
|
-
}, function (props) {
|
|
211
|
-
return (0, exports.getColor)(__assign(__assign({}, props), { buttonState: constants_1.ButtonStates.HOVER }));
|
|
212
|
-
}, function (props) {
|
|
213
|
-
return (0, exports.getBgColor)(__assign(__assign({}, props), { buttonState: constants_1.ButtonStates.FOCUS }));
|
|
214
|
-
}, function (props) {
|
|
215
|
-
return (0, exports.getColor)(__assign(__assign({}, props), { buttonState: constants_1.ButtonStates.FOCUS }));
|
|
216
|
-
}, function (props) {
|
|
217
|
-
return (0, exports.getBgColor)(__assign(__assign({}, props), { buttonState: constants_1.ButtonStates.ACTIVE }));
|
|
218
|
-
}, function (props) {
|
|
219
|
-
return (0, exports.getColor)(__assign(__assign({}, props), { buttonState: constants_1.ButtonStates.ACTIVE }));
|
|
220
|
-
}, ButtonUnstyled_1.buttonUnstyledClasses.disabled, exports.getDisabledBgColor, function (_a) {
|
|
221
|
-
var theme = _a.theme;
|
|
222
|
-
return theme.palette.grey['500'];
|
|
223
|
-
});
|
|
224
|
-
var templateObject_1;
|
package/cjs/src/index.d.ts
DELETED
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getComponents = void 0;
|
|
4
|
-
var getMuiCssBaseline = function (fontUrls) { return ({
|
|
5
|
-
styleOverrides: "\n @font-face {\n font-family: 'Ubuntu';\n font-style: 'normal';\n font-weight: 300;\n font-display: swap;\n src: url(" + fontUrls.light.woff2 + ") format('woff2'), url(" + 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(" + fontUrls.regular.woff2 + ") format('woff2'), url(" + 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(" + fontUrls.medium.woff2 + ") format('woff2'), url(" + 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(" + fontUrls.bold.woff2 + ") format('woff2'), url(" + fontUrls.bold.woff + ") format('woff');\n }\n ",
|
|
6
|
-
}); };
|
|
7
|
-
var getMuiTypography = function () { return ({
|
|
8
|
-
variants: [
|
|
9
|
-
{
|
|
10
|
-
props: { variant: 'button' },
|
|
11
|
-
style: {
|
|
12
|
-
textTransform: 'capitalize',
|
|
13
|
-
},
|
|
14
|
-
},
|
|
15
|
-
],
|
|
16
|
-
defaultProps: {
|
|
17
|
-
// TODO: необходимо кастомизировать типы Components['MuiTypography']
|
|
18
|
-
variantMapping: {
|
|
19
|
-
link: 'a',
|
|
20
|
-
code: 'code',
|
|
21
|
-
},
|
|
22
|
-
},
|
|
23
|
-
}); };
|
|
24
|
-
var getComponents = function (fontUrls) { return ({
|
|
25
|
-
MuiCssBaseline: getMuiCssBaseline(fontUrls),
|
|
26
|
-
MuiTypography: getMuiTypography(),
|
|
27
|
-
}); };
|
|
28
|
-
exports.getComponents = getComponents;
|