@astral/ui 0.1.0 → 0.1.1
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/cjs/index.d.ts +1 -0
- package/cjs/index.js +13 -0
- package/cjs/src/Badge/Badge.d.ts +3 -0
- package/cjs/src/Badge/Badge.js +31 -0
- package/cjs/src/Badge/index.d.ts +2 -0
- package/cjs/src/Badge/index.js +14 -0
- package/cjs/src/Badge/styled.d.ts +50 -0
- package/cjs/src/Badge/styled.js +63 -0
- package/cjs/src/Badge/types.d.ts +5 -0
- package/cjs/src/Badge/types.js +2 -0
- package/cjs/src/Button/Button.d.ts +2 -0
- package/cjs/src/Button/Button.js +33 -0
- package/cjs/src/Button/index.d.ts +2 -0
- package/cjs/src/Button/index.js +14 -0
- package/cjs/src/Button/styled.d.ts +13 -0
- package/cjs/src/Button/styled.js +33 -0
- package/cjs/src/Button/types.d.ts +7 -0
- package/cjs/src/Button/types.js +2 -0
- package/cjs/src/ButtonBase/ButtonBase.d.ts +2 -0
- package/cjs/src/ButtonBase/ButtonBase.js +33 -0
- package/cjs/src/ButtonBase/constants.d.ts +22 -0
- package/cjs/src/ButtonBase/constants.js +29 -0
- package/cjs/src/ButtonBase/index.d.ts +3 -0
- package/cjs/src/ButtonBase/index.js +15 -0
- package/cjs/src/ButtonBase/styled.d.ts +32 -0
- package/cjs/src/ButtonBase/styled.js +224 -0
- package/cjs/src/ButtonBase/types.d.ts +11 -0
- package/cjs/src/ButtonBase/types.js +2 -0
- package/cjs/src/CircularProgress/CircularProgress.d.ts +3 -0
- package/cjs/src/CircularProgress/CircularProgress.js +33 -0
- package/cjs/src/CircularProgress/constants.d.ts +9 -0
- package/cjs/src/CircularProgress/constants.js +14 -0
- package/cjs/src/CircularProgress/index.d.ts +2 -0
- package/cjs/src/CircularProgress/index.js +14 -0
- package/cjs/src/CircularProgress/styled.d.ts +8 -0
- package/cjs/src/CircularProgress/styled.js +26 -0
- package/cjs/src/CircularProgress/types.d.ts +8 -0
- package/cjs/src/CircularProgress/types.js +2 -0
- package/cjs/src/IconButton/IconButton.d.ts +2 -0
- package/cjs/src/IconButton/IconButton.js +32 -0
- package/cjs/src/IconButton/index.d.ts +1 -0
- package/cjs/src/IconButton/index.js +13 -0
- package/cjs/src/IconButton/styled.d.ts +19 -0
- package/cjs/src/IconButton/styled.js +25 -0
- package/cjs/src/ThemeProvider/ThemeProvider.d.ts +7 -0
- package/cjs/src/ThemeProvider/ThemeProvider.js +22 -0
- package/cjs/src/ThemeProvider/index.d.ts +1 -0
- package/cjs/src/ThemeProvider/index.js +13 -0
- package/cjs/src/Typography/Typography.d.ts +7 -0
- package/cjs/src/Typography/Typography.js +36 -0
- package/cjs/src/Typography/index.d.ts +1 -0
- package/cjs/src/Typography/index.js +13 -0
- package/cjs/src/index.d.ts +8 -0
- package/cjs/src/index.js +20 -0
- package/cjs/src/styles/index.d.ts +1 -0
- package/cjs/src/styles/index.js +13 -0
- package/cjs/src/styles/styled/index.d.ts +1 -0
- package/cjs/src/styles/styled/index.js +13 -0
- package/cjs/src/styles/styled/styled.d.ts +2 -0
- package/cjs/src/styles/styled/styled.js +8 -0
- package/cjs/src/styles/styled/types.d.ts +48 -0
- package/cjs/src/styles/styled/types.js +2 -0
- package/cjs/src/theme/__tests__/BaseTheme.test.d.ts +1 -0
- package/cjs/src/theme/__tests__/BaseTheme.test.js +56 -0
- package/cjs/src/theme/baseTheme.d.ts +27 -0
- package/cjs/src/theme/baseTheme.js +23 -0
- package/cjs/src/theme/components.d.ts +20 -0
- package/cjs/src/theme/components.js +28 -0
- package/cjs/src/theme/constants.d.ts +9 -0
- package/cjs/src/theme/constants.js +13 -0
- package/cjs/src/theme/elevation.d.ts +8 -0
- package/cjs/src/theme/elevation.js +10 -0
- package/cjs/src/theme/index.d.ts +5 -0
- package/cjs/src/theme/index.js +17 -0
- package/cjs/src/theme/palette/brandPalette.d.ts +15 -0
- package/cjs/src/theme/palette/brandPalette.js +85 -0
- package/cjs/src/theme/palette/index.d.ts +2 -0
- package/cjs/src/theme/palette/index.js +14 -0
- package/cjs/src/theme/palette/palette.d.ts +29 -0
- package/cjs/src/theme/palette/palette.js +108 -0
- package/cjs/src/theme/shape.d.ts +6 -0
- package/cjs/src/theme/shape.js +8 -0
- package/cjs/src/theme/typography.d.ts +19 -0
- package/cjs/src/theme/typography.js +112 -0
- package/esm/index.d.ts +1 -0
- package/esm/index.js +1 -0
- package/esm/src/Badge/Badge.d.ts +3 -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 +2 -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 +30 -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 +2 -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 +32 -0
- package/esm/src/ButtonBase/styled.js +196 -0
- package/esm/src/ButtonBase/types.d.ts +11 -0
- package/esm/src/ButtonBase/types.js +1 -0
- package/esm/src/CircularProgress/CircularProgress.d.ts +3 -0
- package/esm/src/CircularProgress/CircularProgress.js +29 -0
- package/esm/src/CircularProgress/constants.d.ts +9 -0
- package/esm/src/CircularProgress/constants.js +11 -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 +8 -0
- package/esm/src/CircularProgress/styled.js +23 -0
- package/esm/src/CircularProgress/types.d.ts +8 -0
- package/esm/src/CircularProgress/types.js +1 -0
- package/esm/src/IconButton/IconButton.d.ts +2 -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/ThemeProvider/ThemeProvider.d.ts +7 -0
- package/esm/src/ThemeProvider/ThemeProvider.js +18 -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 +7 -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 +8 -0
- package/esm/src/index.js +8 -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 +27 -0
- package/esm/src/theme/baseTheme.js +19 -0
- package/esm/src/theme/components.d.ts +20 -0
- package/esm/src/theme/components.js +24 -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/index.d.ts +5 -0
- package/esm/src/theme/index.js +5 -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/package.json +6 -12
|
@@ -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("./styled"), exports);
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.styled = void 0;
|
|
7
|
+
var styled_1 = __importDefault(require("@emotion/styled"));
|
|
8
|
+
exports.styled = styled_1.default;
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { PropsOf } from '@emotion/react';
|
|
3
|
+
import { CreateStyledComponent, FilteringStyledOptions, StyledOptions } from '@emotion/styled/base';
|
|
4
|
+
import { Theme } from '../../theme';
|
|
5
|
+
/**
|
|
6
|
+
* @desc
|
|
7
|
+
* This function accepts a React component or tag ('div', 'a' etc).
|
|
8
|
+
*
|
|
9
|
+
* @example styled(MyComponent)({ width: 100 })
|
|
10
|
+
* @example styled(MyComponent)(myComponentProps => ({ width: myComponentProps.width })
|
|
11
|
+
* @example styled('div')({ width: 100 })
|
|
12
|
+
* @example styled('div')<Props>(props => ({ width: props.width })
|
|
13
|
+
*/
|
|
14
|
+
interface BaseCreateStyled {
|
|
15
|
+
<C extends React.ComponentClass<React.ComponentProps<C>>, ForwardedProps extends keyof React.ComponentProps<C> = keyof React.ComponentProps<C>>(component: C, options: FilteringStyledOptions<React.ComponentProps<C>, ForwardedProps>): CreateStyledComponent<Pick<PropsOf<C>, ForwardedProps> & {
|
|
16
|
+
theme?: Theme;
|
|
17
|
+
}, {}, {
|
|
18
|
+
ref?: React.Ref<InstanceType<C>>;
|
|
19
|
+
}>;
|
|
20
|
+
<C extends React.ComponentClass<React.ComponentProps<C>>>(component: C, options?: StyledOptions<React.ComponentProps<C>>): CreateStyledComponent<PropsOf<C> & {
|
|
21
|
+
theme?: Theme;
|
|
22
|
+
}, {}, {
|
|
23
|
+
ref?: React.Ref<InstanceType<C>>;
|
|
24
|
+
}>;
|
|
25
|
+
<C extends React.ComponentType<React.ComponentProps<C>>, ForwardedProps extends keyof React.ComponentProps<C> = keyof React.ComponentProps<C>>(component: C, options: FilteringStyledOptions<React.ComponentProps<C>, ForwardedProps>): CreateStyledComponent<Pick<PropsOf<C>, ForwardedProps> & {
|
|
26
|
+
theme?: Theme;
|
|
27
|
+
}>;
|
|
28
|
+
<C extends React.ComponentType<React.ComponentProps<C>>>(component: C, options?: StyledOptions<React.ComponentProps<C>>): CreateStyledComponent<PropsOf<C> & {
|
|
29
|
+
theme?: Theme;
|
|
30
|
+
}>;
|
|
31
|
+
<Tag extends keyof JSX.IntrinsicElements, ForwardedProps extends keyof JSX.IntrinsicElements[Tag] = keyof JSX.IntrinsicElements[Tag]>(tag: Tag, options: FilteringStyledOptions<JSX.IntrinsicElements[Tag], ForwardedProps>): CreateStyledComponent<{
|
|
32
|
+
theme?: Theme;
|
|
33
|
+
as?: React.ElementType;
|
|
34
|
+
}, Pick<JSX.IntrinsicElements[Tag], ForwardedProps>>;
|
|
35
|
+
<Tag extends keyof JSX.IntrinsicElements>(tag: Tag, options?: StyledOptions<JSX.IntrinsicElements[Tag]>): CreateStyledComponent<{
|
|
36
|
+
theme?: Theme;
|
|
37
|
+
as?: React.ElementType;
|
|
38
|
+
}, JSX.IntrinsicElements[Tag]>;
|
|
39
|
+
}
|
|
40
|
+
declare type StyledTags = {
|
|
41
|
+
[Tag in keyof JSX.IntrinsicElements]: CreateStyledComponent<{
|
|
42
|
+
theme?: Theme;
|
|
43
|
+
as?: React.ElementType;
|
|
44
|
+
}, JSX.IntrinsicElements[Tag]>;
|
|
45
|
+
};
|
|
46
|
+
export interface CreateStyled extends BaseCreateStyled, StyledTags {
|
|
47
|
+
}
|
|
48
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
var baseTheme_1 = require("../baseTheme");
|
|
4
|
+
var constants_1 = require("../constants");
|
|
5
|
+
describe('createTheme', function () {
|
|
6
|
+
var fontsUrls = {
|
|
7
|
+
bold: {
|
|
8
|
+
woff: '',
|
|
9
|
+
woff2: '',
|
|
10
|
+
},
|
|
11
|
+
regular: {
|
|
12
|
+
woff: '',
|
|
13
|
+
woff2: '',
|
|
14
|
+
},
|
|
15
|
+
medium: {
|
|
16
|
+
woff: '',
|
|
17
|
+
woff2: '',
|
|
18
|
+
},
|
|
19
|
+
light: {
|
|
20
|
+
woff: '',
|
|
21
|
+
woff2: '',
|
|
22
|
+
},
|
|
23
|
+
};
|
|
24
|
+
it('Theme merge done correctly', function () {
|
|
25
|
+
var extendedTheme = (0, baseTheme_1.createTheme)({
|
|
26
|
+
brand: constants_1.Brand.DEFAULT,
|
|
27
|
+
fontsUrls: fontsUrls,
|
|
28
|
+
options: {
|
|
29
|
+
typography: { h1: { lineHeight: 12 } },
|
|
30
|
+
},
|
|
31
|
+
});
|
|
32
|
+
expect(extendedTheme.typography.h1.lineHeight).toBe(12);
|
|
33
|
+
});
|
|
34
|
+
it('Color should be taken depending on the brand', function () {
|
|
35
|
+
var theme = (0, baseTheme_1.createTheme)({ brand: constants_1.Brand.SIGN, fontsUrls: fontsUrls });
|
|
36
|
+
var expected = {
|
|
37
|
+
primary: {
|
|
38
|
+
main: '#376798',
|
|
39
|
+
dark: '#325D89',
|
|
40
|
+
},
|
|
41
|
+
secondary: {
|
|
42
|
+
main: '#4099AC',
|
|
43
|
+
dark: '#325D89',
|
|
44
|
+
},
|
|
45
|
+
};
|
|
46
|
+
expect(theme.palette).toMatchObject(expected);
|
|
47
|
+
});
|
|
48
|
+
it('Spacing are calculated correctly', function () {
|
|
49
|
+
var theme = (0, baseTheme_1.createTheme)({ brand: constants_1.Brand.SIGN, fontsUrls: fontsUrls });
|
|
50
|
+
expect(theme.spacing(2)).toBe('8px');
|
|
51
|
+
});
|
|
52
|
+
it('Theme has elevation params', function () {
|
|
53
|
+
var theme = (0, baseTheme_1.createTheme)({ brand: constants_1.Brand.SIGN, fontsUrls: fontsUrls });
|
|
54
|
+
expect(theme.elevation[100]).toBe('box-shadow: 0px 0px 1px 0px #072D574F; box-shadow: 0px 1px 1px 0px #072D5740;');
|
|
55
|
+
});
|
|
56
|
+
});
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { Palette as MuiPalette, Theme as MuiTheme, PaletteColor, ThemeOptions } from '@mui/material/styles';
|
|
2
|
+
import { TypographyThemeOptions } from './typography';
|
|
3
|
+
import { Color } from './palette';
|
|
4
|
+
import { FontsUrls } from './components';
|
|
5
|
+
import { Brand } from './constants';
|
|
6
|
+
import { Elevation } from './elevation';
|
|
7
|
+
import { Shape } from './shape';
|
|
8
|
+
export declare type Palette = Omit<MuiPalette, 'grey'> & {
|
|
9
|
+
red: Color;
|
|
10
|
+
green: Color;
|
|
11
|
+
yellow: Color;
|
|
12
|
+
grey: Color;
|
|
13
|
+
primary: PaletteColor & Color;
|
|
14
|
+
};
|
|
15
|
+
export declare type Theme = Omit<MuiTheme, 'shadows' | 'palette' | 'shape' | 'typography'> & {
|
|
16
|
+
elevation: Elevation;
|
|
17
|
+
palette: Palette;
|
|
18
|
+
shape: Shape;
|
|
19
|
+
typography: TypographyThemeOptions;
|
|
20
|
+
};
|
|
21
|
+
declare type CreateThemeParams = {
|
|
22
|
+
brand: Brand;
|
|
23
|
+
options?: ThemeOptions;
|
|
24
|
+
fontsUrls: FontsUrls;
|
|
25
|
+
};
|
|
26
|
+
export declare const createTheme: ({ brand, options, fontsUrls, }: CreateThemeParams) => Theme;
|
|
27
|
+
export {};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.createTheme = void 0;
|
|
4
|
+
var styles_1 = require("@mui/material/styles");
|
|
5
|
+
var lodash_es_1 = require("lodash-es");
|
|
6
|
+
var typography_1 = require("./typography");
|
|
7
|
+
var palette_1 = require("./palette");
|
|
8
|
+
var components_1 = require("./components");
|
|
9
|
+
var constants_1 = require("./constants");
|
|
10
|
+
var elevation_1 = require("./elevation");
|
|
11
|
+
var shape_1 = require("./shape");
|
|
12
|
+
var createTheme = function (_a) {
|
|
13
|
+
var brand = _a.brand, options = _a.options, fontsUrls = _a.fontsUrls;
|
|
14
|
+
var themeOptions = {
|
|
15
|
+
typography: typography_1.typography,
|
|
16
|
+
spacing: constants_1.SPACING,
|
|
17
|
+
palette: (0, palette_1.getPalette)(brand),
|
|
18
|
+
components: (0, components_1.getComponents)(fontsUrls),
|
|
19
|
+
};
|
|
20
|
+
var muiTheme = (0, styles_1.responsiveFontSizes)((0, styles_1.createTheme)((0, lodash_es_1.merge)({}, themeOptions, options)));
|
|
21
|
+
return (0, lodash_es_1.merge)(muiTheme, { elevation: elevation_1.elevation, shape: shape_1.shape });
|
|
22
|
+
};
|
|
23
|
+
exports.createTheme = createTheme;
|
|
@@ -0,0 +1,20 @@
|
|
|
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 getComponents: (fontUrls: FontsUrls) => Components;
|
|
@@ -0,0 +1,28 @@
|
|
|
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;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.SPACING = exports.Brand = void 0;
|
|
4
|
+
var Brand;
|
|
5
|
+
(function (Brand) {
|
|
6
|
+
Brand["DEFAULT"] = "DEFAULT";
|
|
7
|
+
Brand["EDO"] = "EDO";
|
|
8
|
+
Brand["AO5"] = "AO5";
|
|
9
|
+
Brand["OFD"] = "OFD";
|
|
10
|
+
Brand["SIGN"] = "SIGN";
|
|
11
|
+
Brand["LKP"] = "LKP";
|
|
12
|
+
})(Brand = exports.Brand || (exports.Brand = {}));
|
|
13
|
+
exports.SPACING = 4;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.elevation = void 0;
|
|
4
|
+
exports.elevation = {
|
|
5
|
+
100: 'box-shadow: 0px 0px 1px 0px #072D574F; box-shadow: 0px 1px 1px 0px #072D5740;',
|
|
6
|
+
200: 'box-shadow: 0px 0px 1px 0px #072D574F; box-shadow: 0px 3px 5px 0px #072D5733;',
|
|
7
|
+
300: 'box-shadow: 0px 0px 1px 0px #072D574F; box-shadow: 0px 8px 12px 0px #072D5726;',
|
|
8
|
+
400: 'box-shadow: 0px 0px 1px 0px #072D574F; box-shadow: 0px 10px 18px 0px #072D5726;',
|
|
9
|
+
500: 'box-shadow: 0px 0px 1px 0px #072D574F; box-shadow: 0px 18px 28px 0px #072D5726;',
|
|
10
|
+
};
|
|
@@ -0,0 +1,17 @@
|
|
|
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("./baseTheme"), exports);
|
|
14
|
+
__exportStar(require("./palette"), exports);
|
|
15
|
+
__exportStar(require("./constants"), exports);
|
|
16
|
+
__exportStar(require("./elevation"), exports);
|
|
17
|
+
__exportStar(require("./shape"), exports);
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { Brand } from '../constants';
|
|
2
|
+
declare type BrandColors = {
|
|
3
|
+
secondary: string;
|
|
4
|
+
900: string;
|
|
5
|
+
800: string;
|
|
6
|
+
700: string;
|
|
7
|
+
600: string;
|
|
8
|
+
500: string;
|
|
9
|
+
400: string;
|
|
10
|
+
300: string;
|
|
11
|
+
200: string;
|
|
12
|
+
100: string;
|
|
13
|
+
};
|
|
14
|
+
export declare const brandPalette: Record<Brand, BrandColors>;
|
|
15
|
+
export {};
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var _a;
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.brandPalette = void 0;
|
|
5
|
+
var constants_1 = require("../constants");
|
|
6
|
+
var defaultBrandPalette = {
|
|
7
|
+
secondary: '#55B8F0',
|
|
8
|
+
900: '#0F52B8',
|
|
9
|
+
800: '#2165CC',
|
|
10
|
+
700: '#1874FF',
|
|
11
|
+
600: '#2684FF',
|
|
12
|
+
500: '#4C9AFF',
|
|
13
|
+
400: '#70AEFF',
|
|
14
|
+
300: '#94C2FF',
|
|
15
|
+
200: '#C5DCFF',
|
|
16
|
+
100: '#E1EDFF',
|
|
17
|
+
};
|
|
18
|
+
var edoPalette = {
|
|
19
|
+
secondary: '#5653FF',
|
|
20
|
+
900: '#5D3FD4',
|
|
21
|
+
800: '#6746EB',
|
|
22
|
+
700: '#8566FF',
|
|
23
|
+
600: '#9D85FF',
|
|
24
|
+
500: '#9D85FF',
|
|
25
|
+
400: '#B29EFF',
|
|
26
|
+
300: '#C2B2FF',
|
|
27
|
+
200: '#E0D9FF',
|
|
28
|
+
100: '#EFEBFF',
|
|
29
|
+
};
|
|
30
|
+
var ao5Palette = {
|
|
31
|
+
secondary: '#14A5D3',
|
|
32
|
+
900: '#0068B2',
|
|
33
|
+
800: '#0074C6',
|
|
34
|
+
700: '#0989E3',
|
|
35
|
+
600: '#2195E6',
|
|
36
|
+
500: '#3AA1E9',
|
|
37
|
+
400: '#52ACEB',
|
|
38
|
+
300: '#84C4F1',
|
|
39
|
+
200: '#C1E2F8',
|
|
40
|
+
100: '#DFF0FB',
|
|
41
|
+
};
|
|
42
|
+
var ofdPalette = {
|
|
43
|
+
secondary: '#22BDEE',
|
|
44
|
+
900: '#1F78D6',
|
|
45
|
+
800: '#2285EE',
|
|
46
|
+
700: '#46A0FF',
|
|
47
|
+
600: '#58A9FF',
|
|
48
|
+
500: '#6BB3FF',
|
|
49
|
+
400: '#7DBCFF',
|
|
50
|
+
300: '#A2CFFF',
|
|
51
|
+
200: '#D1E7FF',
|
|
52
|
+
100: '#E7F3FF',
|
|
53
|
+
};
|
|
54
|
+
var signPalette = {
|
|
55
|
+
secondary: '#4099AC',
|
|
56
|
+
900: '#325D89',
|
|
57
|
+
800: '#376798',
|
|
58
|
+
700: '#4D86BF',
|
|
59
|
+
600: '#5E92C5',
|
|
60
|
+
500: '#719ECC',
|
|
61
|
+
400: '#82AAD2',
|
|
62
|
+
300: '#A6C2DF',
|
|
63
|
+
200: '#D3E1EF',
|
|
64
|
+
100: '#E8EFF7',
|
|
65
|
+
};
|
|
66
|
+
var lkpPalette = {
|
|
67
|
+
secondary: '#00BDB2',
|
|
68
|
+
900: '#009E71',
|
|
69
|
+
800: '#00B07E',
|
|
70
|
+
700: '#2CC89B',
|
|
71
|
+
600: '#41CDA5',
|
|
72
|
+
500: '#56D3AF',
|
|
73
|
+
400: '#6BD8B9',
|
|
74
|
+
300: '#95E3CD',
|
|
75
|
+
200: '#CAF1E6',
|
|
76
|
+
100: '#E3F8F2',
|
|
77
|
+
};
|
|
78
|
+
exports.brandPalette = (_a = {},
|
|
79
|
+
_a[constants_1.Brand.DEFAULT] = defaultBrandPalette,
|
|
80
|
+
_a[constants_1.Brand.AO5] = ao5Palette,
|
|
81
|
+
_a[constants_1.Brand.EDO] = edoPalette,
|
|
82
|
+
_a[constants_1.Brand.OFD] = ofdPalette,
|
|
83
|
+
_a[constants_1.Brand.SIGN] = signPalette,
|
|
84
|
+
_a[constants_1.Brand.LKP] = lkpPalette,
|
|
85
|
+
_a);
|
|
@@ -0,0 +1,14 @@
|
|
|
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("./brandPalette"), exports);
|
|
14
|
+
__exportStar(require("./palette"), exports);
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { PaletteOptions as MuiPaletteOptions, PaletteColorOptions } from '@mui/material';
|
|
2
|
+
import { TypeBackground } from '@mui/material/styles/createPalette';
|
|
3
|
+
import { Brand } from '../constants';
|
|
4
|
+
export declare type Color = {
|
|
5
|
+
900: string;
|
|
6
|
+
800: string;
|
|
7
|
+
700: string;
|
|
8
|
+
600: string;
|
|
9
|
+
500: string;
|
|
10
|
+
400: string;
|
|
11
|
+
300: string;
|
|
12
|
+
200: string;
|
|
13
|
+
100: string;
|
|
14
|
+
};
|
|
15
|
+
export declare type PrimaryColorOptions = PaletteColorOptions & Color;
|
|
16
|
+
declare type Background = TypeBackground & {
|
|
17
|
+
element: string;
|
|
18
|
+
elementHover: string;
|
|
19
|
+
};
|
|
20
|
+
declare type PaletteOptions = MuiPaletteOptions & {
|
|
21
|
+
red: Color;
|
|
22
|
+
green: Color;
|
|
23
|
+
yellow: Color;
|
|
24
|
+
grey: Color;
|
|
25
|
+
primary: PrimaryColorOptions;
|
|
26
|
+
background: Background;
|
|
27
|
+
};
|
|
28
|
+
export declare const getPalette: (brand?: Brand) => PaletteOptions;
|
|
29
|
+
export {};
|
|
@@ -0,0 +1,108 @@
|
|
|
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.getPalette = void 0;
|
|
15
|
+
var constants_1 = require("../constants");
|
|
16
|
+
var brandPalette_1 = require("./brandPalette");
|
|
17
|
+
var getPalette = function (brand) {
|
|
18
|
+
if (brand === void 0) { brand = constants_1.Brand.DEFAULT; }
|
|
19
|
+
var brandColors = brandPalette_1.brandPalette[brand];
|
|
20
|
+
return {
|
|
21
|
+
red: {
|
|
22
|
+
900: '#E64343',
|
|
23
|
+
800: '#F24646',
|
|
24
|
+
700: '#F35959',
|
|
25
|
+
600: '#F67E7E',
|
|
26
|
+
500: '#F79090',
|
|
27
|
+
400: '#F8A3A3',
|
|
28
|
+
300: '#FAB5B5',
|
|
29
|
+
200: '#FCDADA',
|
|
30
|
+
100: '#FEEDED',
|
|
31
|
+
},
|
|
32
|
+
green: {
|
|
33
|
+
900: '#008055',
|
|
34
|
+
800: '#00875A',
|
|
35
|
+
700: '#19936A',
|
|
36
|
+
600: '#4DAB8C',
|
|
37
|
+
500: '#66B79C',
|
|
38
|
+
400: '#80C3AC',
|
|
39
|
+
300: '#99CFBD',
|
|
40
|
+
200: '#CCE7DE',
|
|
41
|
+
100: '#E6F3EF',
|
|
42
|
+
},
|
|
43
|
+
yellow: {
|
|
44
|
+
900: '#ED8000',
|
|
45
|
+
800: '#F98700',
|
|
46
|
+
700: '#FA961F',
|
|
47
|
+
600: '#FBAB4D',
|
|
48
|
+
500: '#FBB766',
|
|
49
|
+
400: '#FDCF99',
|
|
50
|
+
300: '#FDDBB2',
|
|
51
|
+
200: '#FBE6CC',
|
|
52
|
+
100: '#FEF3E6',
|
|
53
|
+
},
|
|
54
|
+
primary: __assign({ main: brandColors[800], dark: brandColors[900], contrastText: '#FFF' }, brandColors),
|
|
55
|
+
secondary: {
|
|
56
|
+
main: brandColors.secondary,
|
|
57
|
+
dark: brandColors[900],
|
|
58
|
+
contrastText: '#FFF',
|
|
59
|
+
},
|
|
60
|
+
get success() {
|
|
61
|
+
return {
|
|
62
|
+
light: this.green[100],
|
|
63
|
+
main: this.green[600],
|
|
64
|
+
dark: this.green[800],
|
|
65
|
+
contrastText: '#FFF',
|
|
66
|
+
};
|
|
67
|
+
},
|
|
68
|
+
get warning() {
|
|
69
|
+
return {
|
|
70
|
+
light: this.yellow[100],
|
|
71
|
+
main: this.yellow[600],
|
|
72
|
+
dark: this.yellow[800],
|
|
73
|
+
contrastText: '#FFF',
|
|
74
|
+
};
|
|
75
|
+
},
|
|
76
|
+
get error() {
|
|
77
|
+
return {
|
|
78
|
+
light: this.red[100],
|
|
79
|
+
main: this.red[600],
|
|
80
|
+
dark: this.red[800],
|
|
81
|
+
contrastText: '#FFF',
|
|
82
|
+
};
|
|
83
|
+
},
|
|
84
|
+
text: {
|
|
85
|
+
primary: '#072D57',
|
|
86
|
+
secondary: '#072D57',
|
|
87
|
+
disabled: '#99A9BA',
|
|
88
|
+
},
|
|
89
|
+
grey: {
|
|
90
|
+
900: '#072D57',
|
|
91
|
+
800: '#1D3F66',
|
|
92
|
+
700: '#557192',
|
|
93
|
+
600: '#778DA8',
|
|
94
|
+
500: '#99A9BA',
|
|
95
|
+
400: '#B7C2CE',
|
|
96
|
+
300: '#DDE2E8',
|
|
97
|
+
200: '#EBEEF1',
|
|
98
|
+
100: '#F0F4F7',
|
|
99
|
+
},
|
|
100
|
+
background: {
|
|
101
|
+
default: '#FFF',
|
|
102
|
+
paper: '#FFF',
|
|
103
|
+
element: '#FAFBFC',
|
|
104
|
+
elementHover: '#EBECF0',
|
|
105
|
+
},
|
|
106
|
+
};
|
|
107
|
+
};
|
|
108
|
+
exports.getPalette = getPalette;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { Typography } from '@mui/material/styles/createTypography';
|
|
2
|
+
import { CSSProperties } from 'react';
|
|
3
|
+
declare type CustomTypographyVariantStyle = {
|
|
4
|
+
fontSize: CSSProperties['fontSize'];
|
|
5
|
+
fontWeight: CSSProperties['fontWeight'];
|
|
6
|
+
};
|
|
7
|
+
export declare type TypographyThemeOptions = Typography & {
|
|
8
|
+
h7: CustomTypographyVariantStyle;
|
|
9
|
+
h8: CustomTypographyVariantStyle;
|
|
10
|
+
h9: CustomTypographyVariantStyle;
|
|
11
|
+
ui: CustomTypographyVariantStyle;
|
|
12
|
+
link: CustomTypographyVariantStyle;
|
|
13
|
+
pointer: CustomTypographyVariantStyle;
|
|
14
|
+
small: CustomTypographyVariantStyle;
|
|
15
|
+
code: CustomTypographyVariantStyle;
|
|
16
|
+
};
|
|
17
|
+
export declare const pxToRem: (fontSize: number, htmlFontSize?: number) => string;
|
|
18
|
+
export declare const typography: Partial<TypographyThemeOptions>;
|
|
19
|
+
export {};
|