@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.
Files changed (169) hide show
  1. package/cjs/index.d.ts +1 -0
  2. package/cjs/index.js +13 -0
  3. package/cjs/src/Badge/Badge.d.ts +3 -0
  4. package/cjs/src/Badge/Badge.js +31 -0
  5. package/cjs/src/Badge/index.d.ts +2 -0
  6. package/cjs/src/Badge/index.js +14 -0
  7. package/cjs/src/Badge/styled.d.ts +50 -0
  8. package/cjs/src/Badge/styled.js +63 -0
  9. package/cjs/src/Badge/types.d.ts +5 -0
  10. package/cjs/src/Badge/types.js +2 -0
  11. package/cjs/src/Button/Button.d.ts +2 -0
  12. package/cjs/src/Button/Button.js +33 -0
  13. package/cjs/src/Button/index.d.ts +2 -0
  14. package/cjs/src/Button/index.js +14 -0
  15. package/cjs/src/Button/styled.d.ts +13 -0
  16. package/cjs/src/Button/styled.js +33 -0
  17. package/cjs/src/Button/types.d.ts +7 -0
  18. package/cjs/src/Button/types.js +2 -0
  19. package/cjs/src/ButtonBase/ButtonBase.d.ts +2 -0
  20. package/cjs/src/ButtonBase/ButtonBase.js +33 -0
  21. package/cjs/src/ButtonBase/constants.d.ts +22 -0
  22. package/cjs/src/ButtonBase/constants.js +29 -0
  23. package/cjs/src/ButtonBase/index.d.ts +3 -0
  24. package/cjs/src/ButtonBase/index.js +15 -0
  25. package/cjs/src/ButtonBase/styled.d.ts +32 -0
  26. package/cjs/src/ButtonBase/styled.js +224 -0
  27. package/cjs/src/ButtonBase/types.d.ts +11 -0
  28. package/cjs/src/ButtonBase/types.js +2 -0
  29. package/cjs/src/CircularProgress/CircularProgress.d.ts +3 -0
  30. package/cjs/src/CircularProgress/CircularProgress.js +33 -0
  31. package/cjs/src/CircularProgress/constants.d.ts +9 -0
  32. package/cjs/src/CircularProgress/constants.js +14 -0
  33. package/cjs/src/CircularProgress/index.d.ts +2 -0
  34. package/cjs/src/CircularProgress/index.js +14 -0
  35. package/cjs/src/CircularProgress/styled.d.ts +8 -0
  36. package/cjs/src/CircularProgress/styled.js +26 -0
  37. package/cjs/src/CircularProgress/types.d.ts +8 -0
  38. package/cjs/src/CircularProgress/types.js +2 -0
  39. package/cjs/src/IconButton/IconButton.d.ts +2 -0
  40. package/cjs/src/IconButton/IconButton.js +32 -0
  41. package/cjs/src/IconButton/index.d.ts +1 -0
  42. package/cjs/src/IconButton/index.js +13 -0
  43. package/cjs/src/IconButton/styled.d.ts +19 -0
  44. package/cjs/src/IconButton/styled.js +25 -0
  45. package/cjs/src/ThemeProvider/ThemeProvider.d.ts +7 -0
  46. package/cjs/src/ThemeProvider/ThemeProvider.js +22 -0
  47. package/cjs/src/ThemeProvider/index.d.ts +1 -0
  48. package/cjs/src/ThemeProvider/index.js +13 -0
  49. package/cjs/src/Typography/Typography.d.ts +7 -0
  50. package/cjs/src/Typography/Typography.js +36 -0
  51. package/cjs/src/Typography/index.d.ts +1 -0
  52. package/cjs/src/Typography/index.js +13 -0
  53. package/cjs/src/index.d.ts +8 -0
  54. package/cjs/src/index.js +20 -0
  55. package/cjs/src/styles/index.d.ts +1 -0
  56. package/cjs/src/styles/index.js +13 -0
  57. package/cjs/src/styles/styled/index.d.ts +1 -0
  58. package/cjs/src/styles/styled/index.js +13 -0
  59. package/cjs/src/styles/styled/styled.d.ts +2 -0
  60. package/cjs/src/styles/styled/styled.js +8 -0
  61. package/cjs/src/styles/styled/types.d.ts +48 -0
  62. package/cjs/src/styles/styled/types.js +2 -0
  63. package/cjs/src/theme/__tests__/BaseTheme.test.d.ts +1 -0
  64. package/cjs/src/theme/__tests__/BaseTheme.test.js +56 -0
  65. package/cjs/src/theme/baseTheme.d.ts +27 -0
  66. package/cjs/src/theme/baseTheme.js +23 -0
  67. package/cjs/src/theme/components.d.ts +20 -0
  68. package/cjs/src/theme/components.js +28 -0
  69. package/cjs/src/theme/constants.d.ts +9 -0
  70. package/cjs/src/theme/constants.js +13 -0
  71. package/cjs/src/theme/elevation.d.ts +8 -0
  72. package/cjs/src/theme/elevation.js +10 -0
  73. package/cjs/src/theme/index.d.ts +5 -0
  74. package/cjs/src/theme/index.js +17 -0
  75. package/cjs/src/theme/palette/brandPalette.d.ts +15 -0
  76. package/cjs/src/theme/palette/brandPalette.js +85 -0
  77. package/cjs/src/theme/palette/index.d.ts +2 -0
  78. package/cjs/src/theme/palette/index.js +14 -0
  79. package/cjs/src/theme/palette/palette.d.ts +29 -0
  80. package/cjs/src/theme/palette/palette.js +108 -0
  81. package/cjs/src/theme/shape.d.ts +6 -0
  82. package/cjs/src/theme/shape.js +8 -0
  83. package/cjs/src/theme/typography.d.ts +19 -0
  84. package/cjs/src/theme/typography.js +112 -0
  85. package/esm/index.d.ts +1 -0
  86. package/esm/index.js +1 -0
  87. package/esm/src/Badge/Badge.d.ts +3 -0
  88. package/esm/src/Badge/Badge.js +29 -0
  89. package/esm/src/Badge/index.d.ts +2 -0
  90. package/esm/src/Badge/index.js +2 -0
  91. package/esm/src/Badge/styled.d.ts +50 -0
  92. package/esm/src/Badge/styled.js +60 -0
  93. package/esm/src/Badge/types.d.ts +5 -0
  94. package/esm/src/Badge/types.js +1 -0
  95. package/esm/src/Button/Button.d.ts +2 -0
  96. package/esm/src/Button/Button.js +29 -0
  97. package/esm/src/Button/index.d.ts +2 -0
  98. package/esm/src/Button/index.js +2 -0
  99. package/esm/src/Button/styled.d.ts +13 -0
  100. package/esm/src/Button/styled.js +30 -0
  101. package/esm/src/Button/types.d.ts +7 -0
  102. package/esm/src/Button/types.js +1 -0
  103. package/esm/src/ButtonBase/ButtonBase.d.ts +2 -0
  104. package/esm/src/ButtonBase/ButtonBase.js +29 -0
  105. package/esm/src/ButtonBase/constants.d.ts +22 -0
  106. package/esm/src/ButtonBase/constants.js +26 -0
  107. package/esm/src/ButtonBase/index.d.ts +3 -0
  108. package/esm/src/ButtonBase/index.js +3 -0
  109. package/esm/src/ButtonBase/styled.d.ts +32 -0
  110. package/esm/src/ButtonBase/styled.js +196 -0
  111. package/esm/src/ButtonBase/types.d.ts +11 -0
  112. package/esm/src/ButtonBase/types.js +1 -0
  113. package/esm/src/CircularProgress/CircularProgress.d.ts +3 -0
  114. package/esm/src/CircularProgress/CircularProgress.js +29 -0
  115. package/esm/src/CircularProgress/constants.d.ts +9 -0
  116. package/esm/src/CircularProgress/constants.js +11 -0
  117. package/esm/src/CircularProgress/index.d.ts +2 -0
  118. package/esm/src/CircularProgress/index.js +2 -0
  119. package/esm/src/CircularProgress/styled.d.ts +8 -0
  120. package/esm/src/CircularProgress/styled.js +23 -0
  121. package/esm/src/CircularProgress/types.d.ts +8 -0
  122. package/esm/src/CircularProgress/types.js +1 -0
  123. package/esm/src/IconButton/IconButton.d.ts +2 -0
  124. package/esm/src/IconButton/IconButton.js +28 -0
  125. package/esm/src/IconButton/index.d.ts +1 -0
  126. package/esm/src/IconButton/index.js +1 -0
  127. package/esm/src/IconButton/styled.d.ts +19 -0
  128. package/esm/src/IconButton/styled.js +21 -0
  129. package/esm/src/ThemeProvider/ThemeProvider.d.ts +7 -0
  130. package/esm/src/ThemeProvider/ThemeProvider.js +18 -0
  131. package/esm/src/ThemeProvider/index.d.ts +1 -0
  132. package/esm/src/ThemeProvider/index.js +1 -0
  133. package/esm/src/Typography/Typography.d.ts +7 -0
  134. package/esm/src/Typography/Typography.js +29 -0
  135. package/esm/src/Typography/index.d.ts +1 -0
  136. package/esm/src/Typography/index.js +1 -0
  137. package/esm/src/index.d.ts +8 -0
  138. package/esm/src/index.js +8 -0
  139. package/esm/src/styles/index.d.ts +1 -0
  140. package/esm/src/styles/index.js +1 -0
  141. package/esm/src/styles/styled/index.d.ts +1 -0
  142. package/esm/src/styles/styled/index.js +1 -0
  143. package/esm/src/styles/styled/styled.d.ts +2 -0
  144. package/esm/src/styles/styled/styled.js +2 -0
  145. package/esm/src/styles/styled/types.d.ts +48 -0
  146. package/esm/src/styles/styled/types.js +1 -0
  147. package/esm/src/theme/__tests__/BaseTheme.test.d.ts +1 -0
  148. package/esm/src/theme/__tests__/BaseTheme.test.js +54 -0
  149. package/esm/src/theme/baseTheme.d.ts +27 -0
  150. package/esm/src/theme/baseTheme.js +19 -0
  151. package/esm/src/theme/components.d.ts +20 -0
  152. package/esm/src/theme/components.js +24 -0
  153. package/esm/src/theme/constants.d.ts +9 -0
  154. package/esm/src/theme/constants.js +10 -0
  155. package/esm/src/theme/elevation.d.ts +8 -0
  156. package/esm/src/theme/elevation.js +7 -0
  157. package/esm/src/theme/index.d.ts +5 -0
  158. package/esm/src/theme/index.js +5 -0
  159. package/esm/src/theme/palette/brandPalette.d.ts +15 -0
  160. package/esm/src/theme/palette/brandPalette.js +82 -0
  161. package/esm/src/theme/palette/index.d.ts +2 -0
  162. package/esm/src/theme/palette/index.js +2 -0
  163. package/esm/src/theme/palette/palette.d.ts +29 -0
  164. package/esm/src/theme/palette/palette.js +104 -0
  165. package/esm/src/theme/shape.d.ts +6 -0
  166. package/esm/src/theme/shape.js +5 -0
  167. package/esm/src/theme/typography.d.ts +19 -0
  168. package/esm/src/theme/typography.js +108 -0
  169. package/package.json +6 -12
@@ -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,19 @@
1
+ import { createTheme as createMuiTheme, responsiveFontSizes, } from '@mui/material/styles';
2
+ import { merge } from 'lodash-es';
3
+ import { typography } from './typography';
4
+ import { getPalette } from './palette';
5
+ import { getComponents } from './components';
6
+ import { SPACING } from './constants';
7
+ import { elevation } from './elevation';
8
+ import { shape } from './shape';
9
+ export var createTheme = function (_a) {
10
+ var brand = _a.brand, options = _a.options, fontsUrls = _a.fontsUrls;
11
+ var themeOptions = {
12
+ typography: typography,
13
+ spacing: SPACING,
14
+ palette: getPalette(brand),
15
+ components: getComponents(fontsUrls),
16
+ };
17
+ var muiTheme = responsiveFontSizes(createMuiTheme(merge({}, themeOptions, options)));
18
+ return merge(muiTheme, { elevation: elevation, shape: shape });
19
+ };
@@ -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,24 @@
1
+ var getMuiCssBaseline = function (fontUrls) { return ({
2
+ 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 ",
3
+ }); };
4
+ var getMuiTypography = function () { return ({
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
+ export var getComponents = function (fontUrls) { return ({
22
+ MuiCssBaseline: getMuiCssBaseline(fontUrls),
23
+ MuiTypography: getMuiTypography(),
24
+ }); };
@@ -0,0 +1,9 @@
1
+ export declare enum Brand {
2
+ DEFAULT = "DEFAULT",
3
+ EDO = "EDO",
4
+ AO5 = "AO5",
5
+ OFD = "OFD",
6
+ SIGN = "SIGN",
7
+ LKP = "LKP"
8
+ }
9
+ export declare const SPACING = 4;
@@ -0,0 +1,10 @@
1
+ export var Brand;
2
+ (function (Brand) {
3
+ Brand["DEFAULT"] = "DEFAULT";
4
+ Brand["EDO"] = "EDO";
5
+ Brand["AO5"] = "AO5";
6
+ Brand["OFD"] = "OFD";
7
+ Brand["SIGN"] = "SIGN";
8
+ Brand["LKP"] = "LKP";
9
+ })(Brand || (Brand = {}));
10
+ export var SPACING = 4;
@@ -0,0 +1,8 @@
1
+ export declare type Elevation = {
2
+ 100: string;
3
+ 200: string;
4
+ 300: string;
5
+ 400: string;
6
+ 500: string;
7
+ };
8
+ export declare const elevation: Elevation;
@@ -0,0 +1,7 @@
1
+ export var elevation = {
2
+ 100: 'box-shadow: 0px 0px 1px 0px #072D574F; box-shadow: 0px 1px 1px 0px #072D5740;',
3
+ 200: 'box-shadow: 0px 0px 1px 0px #072D574F; box-shadow: 0px 3px 5px 0px #072D5733;',
4
+ 300: 'box-shadow: 0px 0px 1px 0px #072D574F; box-shadow: 0px 8px 12px 0px #072D5726;',
5
+ 400: 'box-shadow: 0px 0px 1px 0px #072D574F; box-shadow: 0px 10px 18px 0px #072D5726;',
6
+ 500: 'box-shadow: 0px 0px 1px 0px #072D574F; box-shadow: 0px 18px 28px 0px #072D5726;',
7
+ };
@@ -0,0 +1,5 @@
1
+ export * from './baseTheme';
2
+ export * from './palette';
3
+ export * from './constants';
4
+ export * from './elevation';
5
+ export * from './shape';
@@ -0,0 +1,5 @@
1
+ export * from './baseTheme';
2
+ export * from './palette';
3
+ export * from './constants';
4
+ export * from './elevation';
5
+ export * from './shape';
@@ -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,82 @@
1
+ var _a;
2
+ import { Brand } from '../constants';
3
+ var defaultBrandPalette = {
4
+ secondary: '#55B8F0',
5
+ 900: '#0F52B8',
6
+ 800: '#2165CC',
7
+ 700: '#1874FF',
8
+ 600: '#2684FF',
9
+ 500: '#4C9AFF',
10
+ 400: '#70AEFF',
11
+ 300: '#94C2FF',
12
+ 200: '#C5DCFF',
13
+ 100: '#E1EDFF',
14
+ };
15
+ var edoPalette = {
16
+ secondary: '#5653FF',
17
+ 900: '#5D3FD4',
18
+ 800: '#6746EB',
19
+ 700: '#8566FF',
20
+ 600: '#9D85FF',
21
+ 500: '#9D85FF',
22
+ 400: '#B29EFF',
23
+ 300: '#C2B2FF',
24
+ 200: '#E0D9FF',
25
+ 100: '#EFEBFF',
26
+ };
27
+ var ao5Palette = {
28
+ secondary: '#14A5D3',
29
+ 900: '#0068B2',
30
+ 800: '#0074C6',
31
+ 700: '#0989E3',
32
+ 600: '#2195E6',
33
+ 500: '#3AA1E9',
34
+ 400: '#52ACEB',
35
+ 300: '#84C4F1',
36
+ 200: '#C1E2F8',
37
+ 100: '#DFF0FB',
38
+ };
39
+ var ofdPalette = {
40
+ secondary: '#22BDEE',
41
+ 900: '#1F78D6',
42
+ 800: '#2285EE',
43
+ 700: '#46A0FF',
44
+ 600: '#58A9FF',
45
+ 500: '#6BB3FF',
46
+ 400: '#7DBCFF',
47
+ 300: '#A2CFFF',
48
+ 200: '#D1E7FF',
49
+ 100: '#E7F3FF',
50
+ };
51
+ var signPalette = {
52
+ secondary: '#4099AC',
53
+ 900: '#325D89',
54
+ 800: '#376798',
55
+ 700: '#4D86BF',
56
+ 600: '#5E92C5',
57
+ 500: '#719ECC',
58
+ 400: '#82AAD2',
59
+ 300: '#A6C2DF',
60
+ 200: '#D3E1EF',
61
+ 100: '#E8EFF7',
62
+ };
63
+ var lkpPalette = {
64
+ secondary: '#00BDB2',
65
+ 900: '#009E71',
66
+ 800: '#00B07E',
67
+ 700: '#2CC89B',
68
+ 600: '#41CDA5',
69
+ 500: '#56D3AF',
70
+ 400: '#6BD8B9',
71
+ 300: '#95E3CD',
72
+ 200: '#CAF1E6',
73
+ 100: '#E3F8F2',
74
+ };
75
+ export var brandPalette = (_a = {},
76
+ _a[Brand.DEFAULT] = defaultBrandPalette,
77
+ _a[Brand.AO5] = ao5Palette,
78
+ _a[Brand.EDO] = edoPalette,
79
+ _a[Brand.OFD] = ofdPalette,
80
+ _a[Brand.SIGN] = signPalette,
81
+ _a[Brand.LKP] = lkpPalette,
82
+ _a);
@@ -0,0 +1,2 @@
1
+ export * from './brandPalette';
2
+ export * from './palette';
@@ -0,0 +1,2 @@
1
+ export * from './brandPalette';
2
+ export * from './palette';
@@ -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,104 @@
1
+ var __assign = (this && this.__assign) || function () {
2
+ __assign = Object.assign || function(t) {
3
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
4
+ s = arguments[i];
5
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
6
+ t[p] = s[p];
7
+ }
8
+ return t;
9
+ };
10
+ return __assign.apply(this, arguments);
11
+ };
12
+ import { Brand } from '../constants';
13
+ import { brandPalette } from './brandPalette';
14
+ export var getPalette = function (brand) {
15
+ if (brand === void 0) { brand = Brand.DEFAULT; }
16
+ var brandColors = brandPalette[brand];
17
+ return {
18
+ red: {
19
+ 900: '#E64343',
20
+ 800: '#F24646',
21
+ 700: '#F35959',
22
+ 600: '#F67E7E',
23
+ 500: '#F79090',
24
+ 400: '#F8A3A3',
25
+ 300: '#FAB5B5',
26
+ 200: '#FCDADA',
27
+ 100: '#FEEDED',
28
+ },
29
+ green: {
30
+ 900: '#008055',
31
+ 800: '#00875A',
32
+ 700: '#19936A',
33
+ 600: '#4DAB8C',
34
+ 500: '#66B79C',
35
+ 400: '#80C3AC',
36
+ 300: '#99CFBD',
37
+ 200: '#CCE7DE',
38
+ 100: '#E6F3EF',
39
+ },
40
+ yellow: {
41
+ 900: '#ED8000',
42
+ 800: '#F98700',
43
+ 700: '#FA961F',
44
+ 600: '#FBAB4D',
45
+ 500: '#FBB766',
46
+ 400: '#FDCF99',
47
+ 300: '#FDDBB2',
48
+ 200: '#FBE6CC',
49
+ 100: '#FEF3E6',
50
+ },
51
+ primary: __assign({ main: brandColors[800], dark: brandColors[900], contrastText: '#FFF' }, brandColors),
52
+ secondary: {
53
+ main: brandColors.secondary,
54
+ dark: brandColors[900],
55
+ contrastText: '#FFF',
56
+ },
57
+ get success() {
58
+ return {
59
+ light: this.green[100],
60
+ main: this.green[600],
61
+ dark: this.green[800],
62
+ contrastText: '#FFF',
63
+ };
64
+ },
65
+ get warning() {
66
+ return {
67
+ light: this.yellow[100],
68
+ main: this.yellow[600],
69
+ dark: this.yellow[800],
70
+ contrastText: '#FFF',
71
+ };
72
+ },
73
+ get error() {
74
+ return {
75
+ light: this.red[100],
76
+ main: this.red[600],
77
+ dark: this.red[800],
78
+ contrastText: '#FFF',
79
+ };
80
+ },
81
+ text: {
82
+ primary: '#072D57',
83
+ secondary: '#072D57',
84
+ disabled: '#99A9BA',
85
+ },
86
+ grey: {
87
+ 900: '#072D57',
88
+ 800: '#1D3F66',
89
+ 700: '#557192',
90
+ 600: '#778DA8',
91
+ 500: '#99A9BA',
92
+ 400: '#B7C2CE',
93
+ 300: '#DDE2E8',
94
+ 200: '#EBEEF1',
95
+ 100: '#F0F4F7',
96
+ },
97
+ background: {
98
+ default: '#FFF',
99
+ paper: '#FFF',
100
+ element: '#FAFBFC',
101
+ elementHover: '#EBECF0',
102
+ },
103
+ };
104
+ };
@@ -0,0 +1,6 @@
1
+ export declare type Shape = {
2
+ small: string;
3
+ medium: string;
4
+ large: string;
5
+ };
6
+ export declare const shape: Shape;
@@ -0,0 +1,5 @@
1
+ export var shape = {
2
+ small: '3px',
3
+ medium: '6px',
4
+ large: '9px',
5
+ };
@@ -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 {};
@@ -0,0 +1,108 @@
1
+ var HTML_FONT_SIZE = 14;
2
+ // Т.к. нет досутпа к теме, написал функцию для конвертации px в rem
3
+ export var pxToRem = function (fontSize, htmlFontSize) {
4
+ if (htmlFontSize === void 0) { htmlFontSize = HTML_FONT_SIZE; }
5
+ return fontSize / htmlFontSize + "rem";
6
+ };
7
+ export var typography = {
8
+ fontSize: 14,
9
+ htmlFontSize: 14,
10
+ fontWeightLight: 300,
11
+ fontWeightRegular: 400,
12
+ fontWeightMedium: 500,
13
+ fontWeightBold: 700,
14
+ fontFamily: ['Ubuntu', 'sans-serif'].join(','),
15
+ get h1() {
16
+ return {
17
+ fontSize: pxToRem(35, this.htmlFontSize),
18
+ fontWeight: this.fontWeightMedium,
19
+ };
20
+ },
21
+ get h2() {
22
+ return {
23
+ fontSize: pxToRem(29, this.htmlFontSize),
24
+ fontWeight: this.fontWeightMedium,
25
+ };
26
+ },
27
+ get h3() {
28
+ return {
29
+ fontSize: pxToRem(24, this.htmlFontSize),
30
+ fontWeight: this.fontWeightMedium,
31
+ };
32
+ },
33
+ get h4() {
34
+ return {
35
+ fontSize: pxToRem(20, this.htmlFontSize),
36
+ fontWeight: this.fontWeightMedium,
37
+ };
38
+ },
39
+ get h5() {
40
+ return {
41
+ fontSize: pxToRem(16, this.htmlFontSize),
42
+ fontWeight: this.fontWeightMedium,
43
+ };
44
+ },
45
+ get h6() {
46
+ return {
47
+ fontSize: pxToRem(14, this.htmlFontSize),
48
+ fontWeight: this.fontWeightMedium,
49
+ };
50
+ },
51
+ get h7() {
52
+ return {
53
+ fontSize: pxToRem(12, this.htmlFontSize),
54
+ fontWeight: this.fontWeightMedium,
55
+ };
56
+ },
57
+ get h8() {
58
+ return {
59
+ fontSize: pxToRem(12, this.htmlFontSize),
60
+ fontWeight: this.fontWeightMedium,
61
+ };
62
+ },
63
+ get h9() {
64
+ return {
65
+ fontSize: pxToRem(11, this.htmlFontSize),
66
+ fontWeight: this.fontWeightBold,
67
+ };
68
+ },
69
+ get button() {
70
+ return {
71
+ fontSize: pxToRem(14, this.htmlFontSize),
72
+ fontWeight: this.fontWeightMedium,
73
+ };
74
+ },
75
+ get ui() {
76
+ return {
77
+ fontSize: pxToRem(14, this.htmlFontSize),
78
+ fontWeight: this.fontWeightRegular,
79
+ };
80
+ },
81
+ get link() {
82
+ return {
83
+ fontSize: pxToRem(14, this.htmlFontSize),
84
+ fontWeight: this.fontWeightRegular,
85
+ };
86
+ },
87
+ get pointer() {
88
+ return {
89
+ fontSize: pxToRem(12, this.htmlFontSize),
90
+ fontWeight: this.fontWeightMedium,
91
+ };
92
+ },
93
+ get small() {
94
+ return {
95
+ fontSize: pxToRem(12, this.htmlFontSize),
96
+ fontWeight: this.fontWeightRegular,
97
+ };
98
+ },
99
+ get code() {
100
+ return {
101
+ fontSize: pxToRem(12, this.htmlFontSize),
102
+ fontWeight: this.fontWeightLight,
103
+ };
104
+ },
105
+ body1: {
106
+ fontSize: '1rem',
107
+ },
108
+ };
package/package.json CHANGED
@@ -1,23 +1,13 @@
1
1
  {
2
2
  "name": "@astral/ui",
3
- "version": "0.1.0",
3
+ "version": "0.1.1",
4
4
  "type": "module",
5
- "main": "./dist/esm/index.js",
6
5
  "source": "./src/index.ts",
7
- "module": "./dist/esm/index.js",
8
- "types": "./dist/esm/index.d.ts",
9
- "exports": {
10
- "require": "./dist/cjs/index.js",
11
- "default": "./dist/esm/index.js"
12
- },
13
6
  "jest": {
14
7
  "moduleNameMapper": {
15
8
  "^lodash-es$": "lodash"
16
9
  }
17
10
  },
18
- "files": [
19
- "dist"
20
- ],
21
11
  "dependencies": {
22
12
  "@emotion/react": "11.5.0",
23
13
  "@emotion/styled": "11.3.0",
@@ -38,5 +28,9 @@
38
28
  "bugs": {
39
29
  "url": "https://github.com/kaluga-astral/frontend/issues"
40
30
  },
41
- "keywords": []
31
+ "keywords": [],
32
+ "sideEffects": false,
33
+ "main": "./cjs/index.js",
34
+ "types": "./esm/index.d.ts",
35
+ "module": "./esm/index.js"
42
36
  }