@astral/ui 0.1.0 → 0.2.3
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/index.d.ts +1 -0
- package/esm/index.js +1 -0
- package/esm/src/Badge/Badge.d.ts +4 -0
- package/esm/src/Badge/Badge.js +29 -0
- package/esm/src/Badge/index.d.ts +2 -0
- package/esm/src/Badge/index.js +2 -0
- package/esm/src/Badge/styled.d.ts +50 -0
- package/esm/src/Badge/styled.js +60 -0
- package/esm/src/Badge/types.d.ts +5 -0
- package/esm/src/Badge/types.js +1 -0
- package/esm/src/Button/Button.d.ts +3 -0
- package/esm/src/Button/Button.js +29 -0
- package/esm/src/Button/index.d.ts +2 -0
- package/esm/src/Button/index.js +2 -0
- package/esm/src/Button/styled.d.ts +13 -0
- package/esm/src/Button/styled.js +33 -0
- package/esm/src/Button/types.d.ts +7 -0
- package/esm/src/Button/types.js +1 -0
- package/esm/src/ButtonBase/ButtonBase.d.ts +3 -0
- package/esm/src/ButtonBase/ButtonBase.js +29 -0
- package/esm/src/ButtonBase/constants.d.ts +22 -0
- package/esm/src/ButtonBase/constants.js +26 -0
- package/esm/src/ButtonBase/index.d.ts +3 -0
- package/esm/src/ButtonBase/index.js +3 -0
- package/esm/src/ButtonBase/styled.d.ts +27 -0
- package/esm/src/ButtonBase/styled.js +202 -0
- package/esm/src/ButtonBase/types.d.ts +11 -0
- package/esm/src/ButtonBase/types.js +1 -0
- 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/esm/src/Checkbox/types.js +1 -0
- package/esm/src/CircularProgress/CircularProgress.d.ts +4 -0
- package/esm/src/CircularProgress/CircularProgress.js +30 -0
- package/esm/src/CircularProgress/constants.d.ts +8 -0
- package/esm/src/CircularProgress/constants.js +10 -0
- package/esm/src/CircularProgress/index.d.ts +2 -0
- package/esm/src/CircularProgress/index.js +2 -0
- package/esm/src/CircularProgress/styled.d.ts +7 -0
- package/esm/src/CircularProgress/styled.js +17 -0
- package/esm/src/CircularProgress/types.d.ts +8 -0
- package/esm/src/CircularProgress/types.js +1 -0
- 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 +3 -0
- package/esm/src/IconButton/IconButton.js +28 -0
- package/esm/src/IconButton/index.d.ts +1 -0
- package/esm/src/IconButton/index.js +1 -0
- package/esm/src/IconButton/styled.d.ts +19 -0
- package/esm/src/IconButton/styled.js +21 -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.d.ts +7 -0
- package/esm/src/ThemeProvider/ThemeProvider.js +19 -0
- package/esm/src/ThemeProvider/index.d.ts +1 -0
- package/esm/src/ThemeProvider/index.js +1 -0
- package/esm/src/Typography/Typography.d.ts +8 -0
- package/esm/src/Typography/Typography.js +29 -0
- package/esm/src/Typography/index.d.ts +1 -0
- package/esm/src/Typography/index.js +1 -0
- package/esm/src/index.d.ts +18 -0
- package/esm/src/index.js +18 -0
- package/esm/src/styles/index.d.ts +1 -0
- package/esm/src/styles/index.js +1 -0
- package/esm/src/styles/styled/index.d.ts +1 -0
- package/esm/src/styles/styled/index.js +1 -0
- package/esm/src/styles/styled/styled.d.ts +2 -0
- package/esm/src/styles/styled/styled.js +2 -0
- package/esm/src/styles/styled/types.d.ts +48 -0
- package/esm/src/styles/styled/types.js +1 -0
- package/esm/src/theme/__tests__/BaseTheme.test.d.ts +1 -0
- package/esm/src/theme/__tests__/BaseTheme.test.js +54 -0
- package/esm/src/theme/baseTheme.d.ts +28 -0
- package/esm/src/theme/baseTheme.js +19 -0
- 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/components.d.ts +21 -0
- 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/constants.d.ts +9 -0
- package/esm/src/theme/constants.js +10 -0
- package/esm/src/theme/elevation.d.ts +8 -0
- package/esm/src/theme/elevation.js +7 -0
- 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 +6 -0
- package/esm/src/theme/index.js +6 -0
- package/esm/src/theme/palette/brandPalette.d.ts +15 -0
- package/esm/src/theme/palette/brandPalette.js +82 -0
- package/esm/src/theme/palette/index.d.ts +2 -0
- package/esm/src/theme/palette/index.js +2 -0
- package/esm/src/theme/palette/palette.d.ts +29 -0
- package/esm/src/theme/palette/palette.js +104 -0
- package/esm/src/theme/shape.d.ts +6 -0
- package/esm/src/theme/shape.js +5 -0
- package/esm/src/theme/typography.d.ts +19 -0
- package/esm/src/theme/typography.js +108 -0
- package/node/index.d.ts +1 -0
- package/node/index.js +13 -0
- package/node/src/Badge/Badge.d.ts +4 -0
- package/node/src/Badge/Badge.js +31 -0
- package/node/src/Badge/index.d.ts +2 -0
- package/node/src/Badge/index.js +14 -0
- package/node/src/Badge/styled.d.ts +50 -0
- package/node/src/Badge/styled.js +63 -0
- package/node/src/Badge/types.d.ts +5 -0
- package/node/src/Badge/types.js +2 -0
- package/node/src/Button/Button.d.ts +3 -0
- package/node/src/Button/Button.js +33 -0
- package/node/src/Button/index.d.ts +2 -0
- package/node/src/Button/index.js +14 -0
- package/node/src/Button/styled.d.ts +13 -0
- package/node/src/Button/styled.js +36 -0
- package/node/src/Button/types.d.ts +7 -0
- package/node/src/Button/types.js +2 -0
- package/node/src/ButtonBase/ButtonBase.d.ts +3 -0
- package/node/src/ButtonBase/ButtonBase.js +33 -0
- package/node/src/ButtonBase/constants.d.ts +22 -0
- package/node/src/ButtonBase/constants.js +29 -0
- package/node/src/ButtonBase/index.d.ts +3 -0
- package/node/src/ButtonBase/index.js +15 -0
- package/node/src/ButtonBase/styled.d.ts +27 -0
- package/node/src/ButtonBase/styled.js +229 -0
- package/node/src/ButtonBase/types.d.ts +11 -0
- package/node/src/ButtonBase/types.js +2 -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/node/src/Checkbox/types.js +2 -0
- package/node/src/CircularProgress/CircularProgress.d.ts +4 -0
- package/node/src/CircularProgress/CircularProgress.js +34 -0
- package/node/src/CircularProgress/constants.d.ts +8 -0
- package/node/src/CircularProgress/constants.js +13 -0
- package/node/src/CircularProgress/index.d.ts +2 -0
- package/node/src/CircularProgress/index.js +14 -0
- package/node/src/CircularProgress/styled.d.ts +7 -0
- package/node/src/CircularProgress/styled.js +20 -0
- package/node/src/CircularProgress/types.d.ts +8 -0
- package/node/src/CircularProgress/types.js +2 -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/node/src/IconButton/IconButton.d.ts +3 -0
- package/node/src/IconButton/IconButton.js +32 -0
- package/node/src/IconButton/index.d.ts +1 -0
- package/node/src/IconButton/index.js +13 -0
- package/node/src/IconButton/styled.d.ts +19 -0
- package/node/src/IconButton/styled.js +25 -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/node/src/ThemeProvider/ThemeProvider.d.ts +7 -0
- package/node/src/ThemeProvider/ThemeProvider.js +23 -0
- package/node/src/ThemeProvider/index.d.ts +1 -0
- package/node/src/ThemeProvider/index.js +13 -0
- package/node/src/Typography/Typography.d.ts +8 -0
- package/node/src/Typography/Typography.js +36 -0
- package/node/src/Typography/index.d.ts +1 -0
- package/node/src/Typography/index.js +13 -0
- package/node/src/index.d.ts +18 -0
- package/node/src/index.js +30 -0
- package/node/src/styles/index.d.ts +1 -0
- package/node/src/styles/index.js +13 -0
- package/node/src/styles/styled/index.d.ts +1 -0
- package/node/src/styles/styled/index.js +13 -0
- package/node/src/styles/styled/styled.d.ts +2 -0
- package/node/src/styles/styled/styled.js +8 -0
- package/node/src/styles/styled/types.d.ts +48 -0
- package/node/src/styles/styled/types.js +2 -0
- package/node/src/theme/__tests__/BaseTheme.test.d.ts +1 -0
- package/node/src/theme/__tests__/BaseTheme.test.js +56 -0
- package/node/src/theme/baseTheme.d.ts +28 -0
- package/node/src/theme/baseTheme.js +23 -0
- 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/node/src/theme/components/components.d.ts +21 -0
- 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/node/src/theme/constants.d.ts +9 -0
- package/node/src/theme/constants.js +13 -0
- package/node/src/theme/elevation.d.ts +8 -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/node/src/theme/index.d.ts +6 -0
- package/node/src/theme/index.js +18 -0
- package/node/src/theme/palette/brandPalette.d.ts +15 -0
- package/node/src/theme/palette/brandPalette.js +85 -0
- package/node/src/theme/palette/index.d.ts +2 -0
- package/node/src/theme/palette/index.js +14 -0
- package/node/src/theme/palette/palette.d.ts +29 -0
- package/node/src/theme/palette/palette.js +108 -0
- package/node/src/theme/shape.d.ts +6 -0
- package/node/src/theme/shape.js +8 -0
- package/node/src/theme/typography.d.ts +19 -0
- package/node/src/theme/typography.js +112 -0
- package/package.json +7 -12
package/esm/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './src';
|
package/esm/index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './src';
|
|
@@ -0,0 +1,29 @@
|
|
|
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
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
13
|
+
var t = {};
|
|
14
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
15
|
+
t[p] = s[p];
|
|
16
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
17
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
18
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
19
|
+
t[p[i]] = s[p[i]];
|
|
20
|
+
}
|
|
21
|
+
return t;
|
|
22
|
+
};
|
|
23
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
24
|
+
import { StyledBadge } from './styled';
|
|
25
|
+
var Badge = function (_a) {
|
|
26
|
+
var children = _a.children, color = _a.color, props = __rest(_a, ["children", "color"]);
|
|
27
|
+
return (_jsx(StyledBadge, __assign({ customColor: color }, props, { max: 99 }, { children: children }), void 0));
|
|
28
|
+
};
|
|
29
|
+
export default Badge;
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { Theme } from '../theme';
|
|
3
|
+
import { BadgeColor, BadgeProps } from './types';
|
|
4
|
+
export declare const StyledBadge: import("@emotion/styled").StyledComponent<{
|
|
5
|
+
classes?: (Partial<import("@mui/material").BadgeUnstyledClasses> & {
|
|
6
|
+
colorPrimary?: string | undefined;
|
|
7
|
+
colorSecondary?: string | undefined;
|
|
8
|
+
colorError?: string | undefined;
|
|
9
|
+
colorInfo?: string | undefined;
|
|
10
|
+
colorSuccess?: string | undefined;
|
|
11
|
+
colorWarning?: string | undefined;
|
|
12
|
+
anchorOriginTopRightRectangular?: string | undefined;
|
|
13
|
+
anchorOriginBottomRightRectangular?: string | undefined;
|
|
14
|
+
anchorOriginTopLeftRectangular?: string | undefined;
|
|
15
|
+
anchorOriginBottomLeftRectangular?: string | undefined;
|
|
16
|
+
anchorOriginTopRightCircular?: string | undefined;
|
|
17
|
+
anchorOriginBottomRightCircular?: string | undefined;
|
|
18
|
+
anchorOriginTopLeftCircular?: string | undefined;
|
|
19
|
+
anchorOriginBottomLeftCircular?: string | undefined;
|
|
20
|
+
overlapRectangular?: string | undefined;
|
|
21
|
+
overlapCircular?: string | undefined;
|
|
22
|
+
}) | undefined;
|
|
23
|
+
color?: "primary" | "secondary" | "default" | "error" | "warning" | "info" | "success" | undefined;
|
|
24
|
+
overlap?: "circular" | "rectangular" | undefined;
|
|
25
|
+
sx?: import("@mui/material").SxProps<import("@mui/material").Theme> | undefined;
|
|
26
|
+
variant?: "standard" | "dot" | undefined;
|
|
27
|
+
} & {
|
|
28
|
+
anchorOrigin?: import("@mui/material").BadgeOrigin | undefined;
|
|
29
|
+
components?: {
|
|
30
|
+
Root?: import("react").ElementType<any> | undefined;
|
|
31
|
+
Badge?: import("react").ElementType<any> | undefined;
|
|
32
|
+
} | undefined;
|
|
33
|
+
componentsProps?: {
|
|
34
|
+
root?: (import("react").HTMLAttributes<HTMLSpanElement> & import("@mui/material").BadgeUnstyledComponentsPropsOverrides) | undefined;
|
|
35
|
+
badge?: (import("react").HTMLAttributes<HTMLSpanElement> & import("@mui/material").BadgeUnstyledComponentsPropsOverrides) | undefined;
|
|
36
|
+
} | undefined;
|
|
37
|
+
badgeContent?: import("react").ReactNode;
|
|
38
|
+
children?: import("react").ReactNode;
|
|
39
|
+
classes?: Partial<import("@mui/material").BadgeUnstyledClasses> | undefined;
|
|
40
|
+
invisible?: boolean | undefined;
|
|
41
|
+
max?: number | undefined;
|
|
42
|
+
showZero?: boolean | undefined;
|
|
43
|
+
variant?: string | undefined;
|
|
44
|
+
} & import("@mui/material/OverridableComponent").CommonProps & Omit<Pick<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, "key" | keyof import("react").HTMLAttributes<HTMLSpanElement>> & {
|
|
45
|
+
ref?: ((instance: HTMLSpanElement | null) => void) | import("react").RefObject<HTMLSpanElement> | null | undefined;
|
|
46
|
+
}, "components" | "color" | keyof import("@mui/material/OverridableComponent").CommonProps | "children" | "sx" | "variant" | "componentsProps" | "invisible" | "anchorOrigin" | "overlap" | "badgeContent" | "max" | "showZero"> & {
|
|
47
|
+
theme?: Theme | undefined;
|
|
48
|
+
} & Omit<BadgeProps, "color"> & {
|
|
49
|
+
customColor: BadgeColor;
|
|
50
|
+
}, {}, {}>;
|
|
@@ -0,0 +1,60 @@
|
|
|
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 { Badge } from '@mui/material';
|
|
6
|
+
import { styled } from '../styles';
|
|
7
|
+
var getBgColor = function (_a) {
|
|
8
|
+
var customColor = _a.customColor, theme = _a.theme;
|
|
9
|
+
if (customColor === 'grey')
|
|
10
|
+
return theme.palette.grey[300];
|
|
11
|
+
if (customColor === 'errorLight')
|
|
12
|
+
return theme.palette.error.light;
|
|
13
|
+
if (customColor === 'success')
|
|
14
|
+
return theme.palette.success.light;
|
|
15
|
+
if (customColor === 'primary')
|
|
16
|
+
return theme.palette.primary.main;
|
|
17
|
+
if (customColor === 'white')
|
|
18
|
+
return theme.palette.background.default;
|
|
19
|
+
if (customColor === 'error')
|
|
20
|
+
return theme.palette.error.dark;
|
|
21
|
+
return theme.palette.primary.main;
|
|
22
|
+
};
|
|
23
|
+
var getTextColor = function (_a) {
|
|
24
|
+
var customColor = _a.customColor, theme = _a.theme;
|
|
25
|
+
if (customColor === 'grey')
|
|
26
|
+
return theme.palette.text.primary;
|
|
27
|
+
if (customColor === 'primary')
|
|
28
|
+
return theme.palette.primary.contrastText;
|
|
29
|
+
if (customColor === 'white')
|
|
30
|
+
return theme.palette.primary.main;
|
|
31
|
+
if (customColor === 'error')
|
|
32
|
+
return theme.palette.error.contrastText;
|
|
33
|
+
if (customColor === 'errorLight')
|
|
34
|
+
return theme.palette.error.dark;
|
|
35
|
+
if (customColor === 'success')
|
|
36
|
+
return theme.palette.success.dark;
|
|
37
|
+
return theme.palette.primary.contrastText;
|
|
38
|
+
};
|
|
39
|
+
export var StyledBadge = styled(Badge, {
|
|
40
|
+
shouldForwardProp: function (prop) { return prop !== 'customColor'; },
|
|
41
|
+
})(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n .MuiBadge-badge {\n height: 20px;\n border-radius: 12px;\n line-height: 20px;\n background-color: ", ";\n color: ", ";\n padding: ", ";\n font-size: ", ";\n border: 2px solid ", ";\n }\n\n .MuiBadge-dot {\n width: 12px;\n height: 12px;\n border: 2px solid ", ";\n }\n"], ["\n .MuiBadge-badge {\n height: 20px;\n border-radius: 12px;\n line-height: 20px;\n background-color: ", ";\n color: ", ";\n padding: ", ";\n font-size: ", ";\n border: 2px solid ", ";\n }\n\n .MuiBadge-dot {\n width: 12px;\n height: 12px;\n border: 2px solid ", ";\n }\n"])), function (_a) {
|
|
42
|
+
var customColor = _a.customColor, theme = _a.theme;
|
|
43
|
+
return getBgColor({ customColor: customColor, theme: theme });
|
|
44
|
+
}, function (_a) {
|
|
45
|
+
var customColor = _a.customColor, theme = _a.theme;
|
|
46
|
+
return getTextColor({ customColor: customColor, theme: theme });
|
|
47
|
+
}, function (_a) {
|
|
48
|
+
var theme = _a.theme;
|
|
49
|
+
return theme.spacing(0, 1);
|
|
50
|
+
}, function (_a) {
|
|
51
|
+
var theme = _a.theme;
|
|
52
|
+
return theme.typography.small.fontSize;
|
|
53
|
+
}, function (_a) {
|
|
54
|
+
var theme = _a.theme;
|
|
55
|
+
return theme.palette.common.white;
|
|
56
|
+
}, function (_a) {
|
|
57
|
+
var theme = _a.theme;
|
|
58
|
+
return theme.palette.common.white;
|
|
59
|
+
});
|
|
60
|
+
var templateObject_1;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,29 @@
|
|
|
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
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
13
|
+
var t = {};
|
|
14
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
15
|
+
t[p] = s[p];
|
|
16
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
17
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
18
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
19
|
+
t[p[i]] = s[p[i]];
|
|
20
|
+
}
|
|
21
|
+
return t;
|
|
22
|
+
};
|
|
23
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
24
|
+
import { CircularProgress } from '../CircularProgress';
|
|
25
|
+
import { StyledButton } from './styled';
|
|
26
|
+
export var Button = function (_a) {
|
|
27
|
+
var children = _a.children, startIcon = _a.startIcon, endIcon = _a.endIcon, loading = _a.loading, props = __rest(_a, ["children", "startIcon", "endIcon", "loading"]);
|
|
28
|
+
return (_jsxs(StyledButton, __assign({ loading: loading }, props, { children: [_jsx("span", { children: startIcon }, void 0), children, loading && _jsx(CircularProgress, {}, void 0), _jsx("span", { children: endIcon }, void 0)] }), void 0));
|
|
29
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { Theme } from '../theme';
|
|
3
|
+
export declare const StyledButton: import("@emotion/styled").StyledComponent<Omit<import("@mui/base/ButtonUnstyled/ButtonUnstyledProps").default<"button", {}>, "color" | "variant" | "size"> & {
|
|
4
|
+
color?: "primary" | "error" | "warning" | "success" | undefined;
|
|
5
|
+
variant?: "link" | "light" | "text" | "contained" | undefined;
|
|
6
|
+
size?: "large" | "medium" | undefined;
|
|
7
|
+
} & {
|
|
8
|
+
theme?: Theme | undefined;
|
|
9
|
+
} & {
|
|
10
|
+
loading?: boolean | undefined;
|
|
11
|
+
startIcon?: import("react").ReactNode;
|
|
12
|
+
endIcon?: import("react").ReactNode;
|
|
13
|
+
}, {}, {}>;
|
|
@@ -0,0 +1,33 @@
|
|
|
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 pointer-events: ", ";\n color: ", ";\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 width: 16px !important;\n height: 16px !important;\n transform: translate(-50%, -50%);\n position: absolute;\n\n color: ", ";\n }\n"], ["\n pointer-events: ", ";\n color: ", ";\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 width: 16px !important;\n height: 16px !important;\n transform: translate(-50%, -50%);\n position: absolute;\n\n color: ", ";\n }\n"])), function (_a) {
|
|
18
|
+
var loading = _a.loading;
|
|
19
|
+
return (loading ? 'none' : 'inherit');
|
|
20
|
+
}, function (_a) {
|
|
21
|
+
var loading = _a.loading;
|
|
22
|
+
return loading && 'transparent';
|
|
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;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,29 @@
|
|
|
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
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
13
|
+
var t = {};
|
|
14
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
15
|
+
t[p] = s[p];
|
|
16
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
17
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
18
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
19
|
+
t[p[i]] = s[p[i]];
|
|
20
|
+
}
|
|
21
|
+
return t;
|
|
22
|
+
};
|
|
23
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
24
|
+
import { ButtonColors, ButtonVariants } from './constants';
|
|
25
|
+
import { StyledButtonBase } from './styled';
|
|
26
|
+
export var ButtonBase = function (_a) {
|
|
27
|
+
var children = _a.children, _b = _a.variant, variant = _b === void 0 ? ButtonVariants.CONTAINED : _b, _c = _a.color, color = _c === void 0 ? ButtonColors.PRIMARY : _c, props = __rest(_a, ["children", "variant", "color"]);
|
|
28
|
+
return (_jsx(StyledButtonBase, __assign({}, props, { customColor: color, customVariant: variant }, { children: children }), void 0));
|
|
29
|
+
};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
export declare enum ButtonColors {
|
|
2
|
+
ERROR = "error",
|
|
3
|
+
SUCCESS = "success",
|
|
4
|
+
WARNING = "warning",
|
|
5
|
+
PRIMARY = "primary"
|
|
6
|
+
}
|
|
7
|
+
export declare enum ButtonVariants {
|
|
8
|
+
CONTAINED = "contained",
|
|
9
|
+
LIGHT = "light",
|
|
10
|
+
TEXT = "text",
|
|
11
|
+
LINK = "link"
|
|
12
|
+
}
|
|
13
|
+
export declare enum ButtonSizes {
|
|
14
|
+
MEDIUM = "medium",
|
|
15
|
+
LARGE = "large"
|
|
16
|
+
}
|
|
17
|
+
export declare enum ButtonStates {
|
|
18
|
+
DEFAULT = "default",
|
|
19
|
+
ACTIVE = "active",
|
|
20
|
+
FOCUS = "focus",
|
|
21
|
+
HOVER = "hover"
|
|
22
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
export var ButtonColors;
|
|
2
|
+
(function (ButtonColors) {
|
|
3
|
+
ButtonColors["ERROR"] = "error";
|
|
4
|
+
ButtonColors["SUCCESS"] = "success";
|
|
5
|
+
ButtonColors["WARNING"] = "warning";
|
|
6
|
+
ButtonColors["PRIMARY"] = "primary";
|
|
7
|
+
})(ButtonColors || (ButtonColors = {}));
|
|
8
|
+
export var ButtonVariants;
|
|
9
|
+
(function (ButtonVariants) {
|
|
10
|
+
ButtonVariants["CONTAINED"] = "contained";
|
|
11
|
+
ButtonVariants["LIGHT"] = "light";
|
|
12
|
+
ButtonVariants["TEXT"] = "text";
|
|
13
|
+
ButtonVariants["LINK"] = "link";
|
|
14
|
+
})(ButtonVariants || (ButtonVariants = {}));
|
|
15
|
+
export var ButtonSizes;
|
|
16
|
+
(function (ButtonSizes) {
|
|
17
|
+
ButtonSizes["MEDIUM"] = "medium";
|
|
18
|
+
ButtonSizes["LARGE"] = "large";
|
|
19
|
+
})(ButtonSizes || (ButtonSizes = {}));
|
|
20
|
+
export var ButtonStates;
|
|
21
|
+
(function (ButtonStates) {
|
|
22
|
+
ButtonStates["DEFAULT"] = "default";
|
|
23
|
+
ButtonStates["ACTIVE"] = "active";
|
|
24
|
+
ButtonStates["FOCUS"] = "focus";
|
|
25
|
+
ButtonStates["HOVER"] = "hover";
|
|
26
|
+
})(ButtonStates || (ButtonStates = {}));
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { Theme } from '../theme';
|
|
3
|
+
import { BaseButtonProps, ButtonColor, ButtonSize, ButtonState, ButtonVariant } from './types';
|
|
4
|
+
declare type StyledButtonBaseThemeProps = {
|
|
5
|
+
customColor?: ButtonColor;
|
|
6
|
+
customVariant?: ButtonVariant;
|
|
7
|
+
size?: ButtonSize;
|
|
8
|
+
theme: Theme;
|
|
9
|
+
};
|
|
10
|
+
export declare const getColor: ({ theme, customVariant, customColor, buttonState, }: StyledButtonBaseThemeProps & {
|
|
11
|
+
buttonState: ButtonState;
|
|
12
|
+
}) => string;
|
|
13
|
+
export declare const getBgColor: ({ customColor, customVariant, buttonState, theme, }: StyledButtonBaseThemeProps & {
|
|
14
|
+
buttonState: ButtonState;
|
|
15
|
+
}) => string;
|
|
16
|
+
export declare const getButtonHeight: ({ size, }: StyledButtonBaseThemeProps) => string;
|
|
17
|
+
export declare const getButtonPadding: ({ size, theme, }: StyledButtonBaseThemeProps) => string;
|
|
18
|
+
export declare const getDisabledBgColor: ({ theme, customVariant, }: StyledButtonBaseThemeProps) => string;
|
|
19
|
+
export declare const StyledButtonBase: import("@emotion/styled").StyledComponent<Pick<import("@mui/base/ButtonUnstyled").ButtonUnstyledOwnProps & Omit<any, keyof import("@mui/base/ButtonUnstyled").ButtonUnstyledOwnProps> & {
|
|
20
|
+
component?: import("react").ElementType<any> | undefined;
|
|
21
|
+
}, string | number | symbol> & import("react").RefAttributes<any> & {
|
|
22
|
+
theme?: Theme | undefined;
|
|
23
|
+
} & Omit<BaseButtonProps, "color" | "variant"> & {
|
|
24
|
+
customColor?: "primary" | "error" | "warning" | "success" | undefined;
|
|
25
|
+
customVariant?: "link" | "light" | "text" | "contained" | undefined;
|
|
26
|
+
}, {}, {}>;
|
|
27
|
+
export {};
|
|
@@ -0,0 +1,202 @@
|
|
|
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
|
+
var __assign = (this && this.__assign) || function () {
|
|
6
|
+
__assign = Object.assign || function(t) {
|
|
7
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
8
|
+
s = arguments[i];
|
|
9
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
10
|
+
t[p] = s[p];
|
|
11
|
+
}
|
|
12
|
+
return t;
|
|
13
|
+
};
|
|
14
|
+
return __assign.apply(this, arguments);
|
|
15
|
+
};
|
|
16
|
+
import ButtonUnstyled, { buttonUnstyledClasses, } from '@mui/base/ButtonUnstyled';
|
|
17
|
+
import { styled } from '../styles';
|
|
18
|
+
import { ButtonSizes, ButtonStates, ButtonVariants } from './constants';
|
|
19
|
+
export var getColor = function (_a) {
|
|
20
|
+
var theme = _a.theme, customVariant = _a.customVariant, customColor = _a.customColor, buttonState = _a.buttonState;
|
|
21
|
+
var textColorVariants = {
|
|
22
|
+
light: {
|
|
23
|
+
error: {
|
|
24
|
+
default: theme.palette.red['900'],
|
|
25
|
+
hover: theme.palette.red['900'],
|
|
26
|
+
active: theme.palette.red['900'],
|
|
27
|
+
focus: theme.palette.red['900'],
|
|
28
|
+
},
|
|
29
|
+
success: {
|
|
30
|
+
default: theme.palette.green['900'],
|
|
31
|
+
hover: theme.palette.green['900'],
|
|
32
|
+
active: theme.palette.green['900'],
|
|
33
|
+
focus: theme.palette.green['900'],
|
|
34
|
+
},
|
|
35
|
+
primary: {
|
|
36
|
+
default: theme.palette.grey['900'],
|
|
37
|
+
hover: theme.palette.grey['900'],
|
|
38
|
+
active: theme.palette.primary['800'],
|
|
39
|
+
focus: theme.palette.grey['900'],
|
|
40
|
+
},
|
|
41
|
+
warning: {
|
|
42
|
+
default: theme.palette.yellow['900'],
|
|
43
|
+
hover: theme.palette.yellow['900'],
|
|
44
|
+
active: theme.palette.yellow['900'],
|
|
45
|
+
focus: theme.palette.yellow['900'],
|
|
46
|
+
},
|
|
47
|
+
},
|
|
48
|
+
contained: theme.palette.primary.contrastText,
|
|
49
|
+
text: {
|
|
50
|
+
default: theme.palette.grey['900'],
|
|
51
|
+
hover: theme.palette.grey['900'],
|
|
52
|
+
active: theme.palette.primary['800'],
|
|
53
|
+
focus: theme.palette.grey['900'],
|
|
54
|
+
},
|
|
55
|
+
link: {
|
|
56
|
+
default: theme.palette.primary['800'],
|
|
57
|
+
hover: theme.palette.primary['700'],
|
|
58
|
+
active: theme.palette.primary['900'],
|
|
59
|
+
focus: theme.palette.primary['800'],
|
|
60
|
+
},
|
|
61
|
+
};
|
|
62
|
+
if (customVariant === ButtonVariants.CONTAINED) {
|
|
63
|
+
return textColorVariants.contained;
|
|
64
|
+
}
|
|
65
|
+
if (customVariant === ButtonVariants.LIGHT && customColor) {
|
|
66
|
+
return textColorVariants.light[customColor][buttonState];
|
|
67
|
+
}
|
|
68
|
+
if (customVariant === ButtonVariants.TEXT) {
|
|
69
|
+
return textColorVariants.text[buttonState];
|
|
70
|
+
}
|
|
71
|
+
return textColorVariants.link[buttonState];
|
|
72
|
+
};
|
|
73
|
+
export var getBgColor = function (_a) {
|
|
74
|
+
var customColor = _a.customColor, customVariant = _a.customVariant, buttonState = _a.buttonState, theme = _a.theme;
|
|
75
|
+
var bgColorVariants = {
|
|
76
|
+
light: {
|
|
77
|
+
error: {
|
|
78
|
+
default: theme.palette.red['100'],
|
|
79
|
+
hover: theme.palette.red['200'],
|
|
80
|
+
active: theme.palette.red['100'],
|
|
81
|
+
focus: theme.palette.red['100'],
|
|
82
|
+
},
|
|
83
|
+
success: {
|
|
84
|
+
default: theme.palette.green['100'],
|
|
85
|
+
hover: theme.palette.green['200'],
|
|
86
|
+
active: theme.palette.green['100'],
|
|
87
|
+
focus: theme.palette.green['100'],
|
|
88
|
+
},
|
|
89
|
+
primary: {
|
|
90
|
+
default: theme.palette.grey['100'],
|
|
91
|
+
hover: theme.palette.grey['200'],
|
|
92
|
+
active: theme.palette.primary['100'],
|
|
93
|
+
focus: theme.palette.grey['100'],
|
|
94
|
+
},
|
|
95
|
+
warning: {
|
|
96
|
+
default: theme.palette.yellow['100'],
|
|
97
|
+
hover: theme.palette.yellow['200'],
|
|
98
|
+
active: theme.palette.yellow['100'],
|
|
99
|
+
focus: theme.palette.yellow['100'],
|
|
100
|
+
},
|
|
101
|
+
},
|
|
102
|
+
contained: {
|
|
103
|
+
error: {
|
|
104
|
+
default: theme.palette.red['800'],
|
|
105
|
+
hover: theme.palette.red['700'],
|
|
106
|
+
active: theme.palette.red['900'],
|
|
107
|
+
focus: theme.palette.red['800'],
|
|
108
|
+
},
|
|
109
|
+
success: {
|
|
110
|
+
default: theme.palette.green['800'],
|
|
111
|
+
hover: theme.palette.green['700'],
|
|
112
|
+
active: theme.palette.green['900'],
|
|
113
|
+
focus: theme.palette.green['800'],
|
|
114
|
+
},
|
|
115
|
+
primary: {
|
|
116
|
+
default: theme.palette.primary['800'],
|
|
117
|
+
hover: theme.palette.primary['700'],
|
|
118
|
+
active: theme.palette.primary['900'],
|
|
119
|
+
focus: theme.palette.primary['800'],
|
|
120
|
+
},
|
|
121
|
+
warning: {
|
|
122
|
+
default: theme.palette.yellow['800'],
|
|
123
|
+
hover: theme.palette.yellow['700'],
|
|
124
|
+
active: theme.palette.yellow['900'],
|
|
125
|
+
focus: theme.palette.yellow['800'],
|
|
126
|
+
},
|
|
127
|
+
},
|
|
128
|
+
text: {
|
|
129
|
+
default: 'transparent',
|
|
130
|
+
hover: theme.palette.grey['200'],
|
|
131
|
+
active: theme.palette.primary['100'],
|
|
132
|
+
focus: 'transparent',
|
|
133
|
+
},
|
|
134
|
+
link: 'transparent',
|
|
135
|
+
};
|
|
136
|
+
if (customVariant === ButtonVariants.LIGHT && customColor) {
|
|
137
|
+
return bgColorVariants.light[customColor][buttonState];
|
|
138
|
+
}
|
|
139
|
+
if (customVariant === ButtonVariants.CONTAINED && customColor) {
|
|
140
|
+
return bgColorVariants.contained[customColor][buttonState];
|
|
141
|
+
}
|
|
142
|
+
if (customVariant === ButtonVariants.TEXT) {
|
|
143
|
+
return bgColorVariants.text[buttonState];
|
|
144
|
+
}
|
|
145
|
+
return bgColorVariants.link;
|
|
146
|
+
};
|
|
147
|
+
export var getButtonHeight = function (_a) {
|
|
148
|
+
var size = _a.size;
|
|
149
|
+
if (size === ButtonSizes.LARGE)
|
|
150
|
+
return '40px';
|
|
151
|
+
return '32px';
|
|
152
|
+
};
|
|
153
|
+
export var getButtonPadding = function (_a) {
|
|
154
|
+
var size = _a.size, theme = _a.theme;
|
|
155
|
+
if (size === ButtonSizes.LARGE)
|
|
156
|
+
return theme.spacing(2, 4, 2, 4);
|
|
157
|
+
return theme.spacing(1, 3, 1, 3);
|
|
158
|
+
};
|
|
159
|
+
export var getDisabledBgColor = function (_a) {
|
|
160
|
+
var theme = _a.theme, customVariant = _a.customVariant;
|
|
161
|
+
if (customVariant === ButtonVariants.LINK ||
|
|
162
|
+
customVariant === ButtonVariants.TEXT)
|
|
163
|
+
return 'transparent';
|
|
164
|
+
return theme.palette.grey['100'];
|
|
165
|
+
};
|
|
166
|
+
export var StyledButtonBase = styled(ButtonUnstyled, {
|
|
167
|
+
shouldForwardProp: function (prop) {
|
|
168
|
+
return prop !== 'customColor' && prop !== 'customVariant';
|
|
169
|
+
},
|
|
170
|
+
})(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 outline: 2px solid ", ";\n }\n\n &:active {\n background-color: ", ";\n color: ", ";\n outline: none;\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 outline: 2px solid ", ";\n }\n\n &:active {\n background-color: ", ";\n color: ", ";\n outline: none;\n }\n\n &.", " {\n cursor: unset;\n background-color: ", ";\n color: ", ";\n }\n"])), getButtonPadding, getButtonHeight, function (_a) {
|
|
171
|
+
var theme = _a.theme;
|
|
172
|
+
return theme.shape.small;
|
|
173
|
+
}, function (_a) {
|
|
174
|
+
var theme = _a.theme;
|
|
175
|
+
return theme.typography.button.fontSize;
|
|
176
|
+
}, function (_a) {
|
|
177
|
+
var theme = _a.theme;
|
|
178
|
+
return theme.typography.button.fontWeight;
|
|
179
|
+
}, function (props) {
|
|
180
|
+
return getBgColor(__assign(__assign({}, props), { buttonState: ButtonStates.DEFAULT }));
|
|
181
|
+
}, function (props) {
|
|
182
|
+
return getColor(__assign(__assign({}, props), { buttonState: ButtonStates.DEFAULT }));
|
|
183
|
+
}, function (props) {
|
|
184
|
+
return getBgColor(__assign(__assign({}, props), { buttonState: ButtonStates.HOVER }));
|
|
185
|
+
}, function (props) {
|
|
186
|
+
return getColor(__assign(__assign({}, props), { buttonState: ButtonStates.HOVER }));
|
|
187
|
+
}, function (props) {
|
|
188
|
+
return getBgColor(__assign(__assign({}, props), { buttonState: ButtonStates.FOCUS }));
|
|
189
|
+
}, function (props) {
|
|
190
|
+
return getColor(__assign(__assign({}, props), { buttonState: ButtonStates.FOCUS }));
|
|
191
|
+
}, function (_a) {
|
|
192
|
+
var theme = _a.theme;
|
|
193
|
+
return theme.palette.primary['400'];
|
|
194
|
+
}, function (props) {
|
|
195
|
+
return getBgColor(__assign(__assign({}, props), { buttonState: ButtonStates.ACTIVE }));
|
|
196
|
+
}, function (props) {
|
|
197
|
+
return getColor(__assign(__assign({}, props), { buttonState: ButtonStates.ACTIVE }));
|
|
198
|
+
}, buttonUnstyledClasses.disabled, getDisabledBgColor, function (_a) {
|
|
199
|
+
var theme = _a.theme;
|
|
200
|
+
return theme.palette.grey['500'];
|
|
201
|
+
});
|
|
202
|
+
var templateObject_1;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { ButtonUnstyledProps } from '@mui/base/ButtonUnstyled';
|
|
2
|
+
import { ButtonColors, ButtonSizes, ButtonStates, ButtonVariants } from './constants';
|
|
3
|
+
export declare type ButtonColor = `${ButtonColors}`;
|
|
4
|
+
export declare type ButtonVariant = `${ButtonVariants}`;
|
|
5
|
+
export declare type ButtonSize = `${ButtonSizes}`;
|
|
6
|
+
export declare type ButtonState = `${ButtonStates}`;
|
|
7
|
+
export declare type BaseButtonProps = Omit<ButtonUnstyledProps, 'color' | 'variant' | 'size'> & {
|
|
8
|
+
color?: ButtonColor;
|
|
9
|
+
variant?: ButtonVariant;
|
|
10
|
+
size?: ButtonSize;
|
|
11
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|