@astral/ui 0.1.1 → 0.1.2-beta.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 (289) hide show
  1. package/cjs/src/Badge/Badge.d.ts +1 -0
  2. package/cjs/src/Badge/styled.d.ts +2 -2
  3. package/cjs/src/Button/Button.d.ts +1 -0
  4. package/cjs/src/ButtonBase/ButtonBase.d.ts +1 -0
  5. package/cjs/src/Checkbox/Checkbox.d.ts +3 -0
  6. package/cjs/src/Checkbox/Checkbox.js +33 -0
  7. package/cjs/src/Checkbox/icons.d.ts +5 -0
  8. package/cjs/src/Checkbox/icons.js +42 -0
  9. package/cjs/src/Checkbox/index.d.ts +2 -0
  10. package/cjs/src/Checkbox/index.js +14 -0
  11. package/cjs/src/Checkbox/styled.d.ts +4 -0
  12. package/cjs/src/Checkbox/styled.js +35 -0
  13. package/cjs/src/Checkbox/types.d.ts +2 -0
  14. package/cjs/src/Checkbox/types.js +2 -0
  15. package/cjs/src/CircularProgress/CircularProgress.d.ts +1 -0
  16. package/cjs/src/CircularProgress/CircularProgress.js +2 -1
  17. package/cjs/src/CircularProgress/constants.d.ts +1 -2
  18. package/cjs/src/CircularProgress/constants.js +0 -1
  19. package/cjs/src/CircularProgress/styled.d.ts +0 -1
  20. package/cjs/src/CircularProgress/styled.js +2 -8
  21. package/cjs/src/FormControlLabel/FormControlLabel.d.ts +3 -0
  22. package/cjs/src/FormControlLabel/FormControlLabel.js +32 -0
  23. package/cjs/src/FormControlLabel/index.d.ts +2 -0
  24. package/cjs/src/FormControlLabel/index.js +14 -0
  25. package/cjs/src/FormControlLabel/styled.d.ts +3 -0
  26. package/cjs/src/FormControlLabel/styled.js +14 -0
  27. package/cjs/src/FormControlLabel/types.d.ts +2 -0
  28. package/cjs/src/FormControlLabel/types.js +2 -0
  29. package/cjs/src/FormHelperText/FormHelperText.d.ts +4 -0
  30. package/cjs/src/FormHelperText/FormHelperText.js +24 -0
  31. package/cjs/src/FormHelperText/index.d.ts +1 -0
  32. package/cjs/src/FormHelperText/index.js +13 -0
  33. package/cjs/src/FormHelperText/styled.d.ts +41 -0
  34. package/cjs/src/FormHelperText/styled.js +14 -0
  35. package/cjs/src/FormHelperText/types.d.ts +6 -0
  36. package/cjs/src/FormHelperText/types.js +2 -0
  37. package/cjs/src/Grid/Grid.d.ts +3 -0
  38. package/cjs/src/Grid/Grid.js +32 -0
  39. package/cjs/src/Grid/index.d.ts +2 -0
  40. package/cjs/src/Grid/index.js +14 -0
  41. package/cjs/src/Grid/styled.d.ts +13 -0
  42. package/cjs/src/Grid/styled.js +14 -0
  43. package/cjs/src/Grid/types.d.ts +30 -0
  44. package/cjs/src/Grid/types.js +2 -0
  45. package/cjs/src/IconButton/IconButton.d.ts +1 -0
  46. package/cjs/src/Menu/Menu.d.ts +3 -0
  47. package/cjs/src/Menu/Menu.js +32 -0
  48. package/cjs/src/Menu/index.d.ts +1 -0
  49. package/cjs/src/Menu/index.js +13 -0
  50. package/cjs/src/MenuItem/MenuItem.d.ts +3 -0
  51. package/cjs/src/MenuItem/MenuItem.js +32 -0
  52. package/cjs/src/MenuItem/index.d.ts +1 -0
  53. package/cjs/src/MenuItem/index.js +13 -0
  54. package/cjs/src/MenuList/MenuList.d.ts +3 -0
  55. package/cjs/src/MenuList/MenuList.js +32 -0
  56. package/cjs/src/MenuList/index.d.ts +2 -0
  57. package/cjs/src/MenuList/index.js +14 -0
  58. package/cjs/src/MenuList/styled.d.ts +20 -0
  59. package/cjs/src/MenuList/styled.js +20 -0
  60. package/cjs/src/MenuList/types.d.ts +2 -0
  61. package/cjs/src/MenuList/types.js +2 -0
  62. package/cjs/src/Tag/Tag.d.ts +3 -0
  63. package/cjs/src/Tag/Tag.js +32 -0
  64. package/cjs/src/Tag/constants.d.ts +21 -0
  65. package/cjs/src/Tag/constants.js +28 -0
  66. package/cjs/src/Tag/index.d.ts +2 -0
  67. package/cjs/src/Tag/index.js +14 -0
  68. package/cjs/src/Tag/styled.d.ts +26 -0
  69. package/cjs/src/Tag/styled.js +120 -0
  70. package/cjs/src/Tag/types.d.ts +12 -0
  71. package/cjs/src/Tag/types.js +2 -0
  72. package/cjs/src/TextField/TextField.d.ts +4 -0
  73. package/cjs/src/TextField/TextField.js +53 -0
  74. package/cjs/src/TextField/index.d.ts +2 -0
  75. package/cjs/src/TextField/index.js +14 -0
  76. package/cjs/src/TextField/types.d.ts +6 -0
  77. package/cjs/src/TextField/types.js +2 -0
  78. package/cjs/src/Typography/Typography.d.ts +1 -0
  79. package/cjs/src/index.d.ts +5 -0
  80. package/cjs/src/index.js +5 -0
  81. package/cjs/src/theme/__tests__/BaseTheme.test.js +1 -1
  82. package/cjs/src/theme/baseTheme.d.ts +4 -3
  83. package/cjs/src/theme/baseTheme.js +2 -2
  84. package/cjs/src/theme/components/MuiFormHelperText.d.ts +4 -0
  85. package/cjs/src/theme/components/MuiFormHelperText.js +18 -0
  86. package/cjs/src/theme/components/MuiFormLabel.d.ts +4 -0
  87. package/cjs/src/theme/components/MuiFormLabel.js +14 -0
  88. package/cjs/src/theme/components/MuiInputBase.d.ts +4 -0
  89. package/cjs/src/theme/components/MuiInputBase.js +16 -0
  90. package/cjs/src/theme/components/MuiInputLabel.d.ts +4 -0
  91. package/cjs/src/theme/components/MuiInputLabel.js +32 -0
  92. package/cjs/src/theme/components/MuiOutlinedInput.d.ts +4 -0
  93. package/cjs/src/theme/components/MuiOutlinedInput.js +64 -0
  94. package/cjs/src/theme/components/MuiTypography.d.ts +21 -0
  95. package/cjs/src/theme/components/MuiTypography.js +21 -0
  96. package/cjs/src/theme/{components.d.ts → components/components.d.ts} +2 -1
  97. package/cjs/src/theme/components/components.js +65 -0
  98. package/cjs/src/theme/components/index.d.ts +1 -0
  99. package/cjs/src/theme/components/index.js +13 -0
  100. package/cjs/src/theme/elevation.js +5 -5
  101. package/cjs/src/theme/palette/palette.d.ts +1 -1
  102. package/cjs/src/theme/typography.js +1 -1
  103. package/esm/src/Badge/Badge.d.ts +1 -0
  104. package/esm/src/Badge/styled.d.ts +2 -2
  105. package/esm/src/Button/Button.d.ts +1 -0
  106. package/esm/src/ButtonBase/ButtonBase.d.ts +1 -0
  107. package/esm/src/Checkbox/Checkbox.d.ts +3 -0
  108. package/esm/src/Checkbox/Checkbox.js +29 -0
  109. package/esm/src/Checkbox/icons.d.ts +5 -0
  110. package/esm/src/Checkbox/icons.js +36 -0
  111. package/esm/src/Checkbox/index.d.ts +2 -0
  112. package/esm/src/Checkbox/index.js +2 -0
  113. package/esm/src/Checkbox/styled.d.ts +4 -0
  114. package/esm/src/Checkbox/styled.js +32 -0
  115. package/esm/src/Checkbox/types.d.ts +2 -0
  116. package/esm/src/Checkbox/types.js +1 -0
  117. package/esm/src/CircularProgress/CircularProgress.d.ts +1 -0
  118. package/esm/src/CircularProgress/CircularProgress.js +2 -1
  119. package/esm/src/CircularProgress/constants.d.ts +1 -2
  120. package/esm/src/CircularProgress/constants.js +0 -1
  121. package/esm/src/CircularProgress/styled.d.ts +0 -1
  122. package/esm/src/CircularProgress/styled.js +3 -9
  123. package/esm/src/FormControlLabel/FormControlLabel.d.ts +3 -0
  124. package/esm/src/FormControlLabel/FormControlLabel.js +28 -0
  125. package/esm/src/FormControlLabel/index.d.ts +2 -0
  126. package/esm/src/FormControlLabel/index.js +2 -0
  127. package/esm/src/FormControlLabel/styled.d.ts +3 -0
  128. package/esm/src/FormControlLabel/styled.js +11 -0
  129. package/esm/src/FormControlLabel/types.d.ts +2 -0
  130. package/esm/src/FormControlLabel/types.js +1 -0
  131. package/esm/src/FormHelperText/FormHelperText.d.ts +4 -0
  132. package/esm/src/FormHelperText/FormHelperText.js +20 -0
  133. package/esm/src/FormHelperText/index.d.ts +1 -0
  134. package/esm/src/FormHelperText/index.js +1 -0
  135. package/esm/src/FormHelperText/styled.d.ts +41 -0
  136. package/esm/src/FormHelperText/styled.js +11 -0
  137. package/esm/src/FormHelperText/types.d.ts +6 -0
  138. package/esm/src/FormHelperText/types.js +1 -0
  139. package/esm/src/Grid/Grid.d.ts +3 -0
  140. package/esm/src/Grid/Grid.js +28 -0
  141. package/esm/src/Grid/index.d.ts +2 -0
  142. package/esm/src/Grid/index.js +2 -0
  143. package/esm/src/Grid/styled.d.ts +13 -0
  144. package/esm/src/Grid/styled.js +11 -0
  145. package/esm/src/Grid/types.d.ts +30 -0
  146. package/esm/src/Grid/types.js +1 -0
  147. package/esm/src/IconButton/IconButton.d.ts +1 -0
  148. package/esm/src/Menu/Menu.d.ts +3 -0
  149. package/esm/src/Menu/Menu.js +28 -0
  150. package/esm/src/Menu/index.d.ts +1 -0
  151. package/esm/src/Menu/index.js +1 -0
  152. package/esm/src/MenuItem/MenuItem.d.ts +3 -0
  153. package/esm/src/MenuItem/MenuItem.js +28 -0
  154. package/esm/src/MenuItem/index.d.ts +1 -0
  155. package/esm/src/MenuItem/index.js +1 -0
  156. package/esm/src/MenuList/MenuList.d.ts +3 -0
  157. package/esm/src/MenuList/MenuList.js +28 -0
  158. package/esm/src/MenuList/index.d.ts +2 -0
  159. package/esm/src/MenuList/index.js +2 -0
  160. package/esm/src/MenuList/styled.d.ts +20 -0
  161. package/esm/src/MenuList/styled.js +17 -0
  162. package/esm/src/MenuList/types.d.ts +2 -0
  163. package/esm/src/MenuList/types.js +1 -0
  164. package/esm/src/Tag/Tag.d.ts +3 -0
  165. package/esm/src/Tag/Tag.js +28 -0
  166. package/esm/src/Tag/constants.d.ts +21 -0
  167. package/esm/src/Tag/constants.js +25 -0
  168. package/esm/src/Tag/index.d.ts +2 -0
  169. package/esm/src/Tag/index.js +2 -0
  170. package/esm/src/Tag/styled.d.ts +26 -0
  171. package/esm/src/Tag/styled.js +117 -0
  172. package/esm/src/Tag/types.d.ts +12 -0
  173. package/esm/src/Tag/types.js +1 -0
  174. package/esm/src/TextField/TextField.d.ts +4 -0
  175. package/esm/src/TextField/TextField.js +46 -0
  176. package/esm/src/TextField/index.d.ts +2 -0
  177. package/esm/src/TextField/index.js +2 -0
  178. package/esm/src/TextField/types.d.ts +6 -0
  179. package/esm/src/TextField/types.js +1 -0
  180. package/esm/src/Typography/Typography.d.ts +1 -0
  181. package/esm/src/index.d.ts +5 -0
  182. package/esm/src/index.js +5 -0
  183. package/esm/src/theme/__tests__/BaseTheme.test.js +1 -1
  184. package/esm/src/theme/baseTheme.d.ts +4 -3
  185. package/esm/src/theme/baseTheme.js +2 -2
  186. package/esm/src/theme/components/MuiFormHelperText.d.ts +4 -0
  187. package/esm/src/theme/components/MuiFormHelperText.js +15 -0
  188. package/esm/src/theme/components/MuiFormLabel.d.ts +4 -0
  189. package/esm/src/theme/components/MuiFormLabel.js +11 -0
  190. package/esm/src/theme/components/MuiInputBase.d.ts +4 -0
  191. package/esm/src/theme/components/MuiInputBase.js +13 -0
  192. package/esm/src/theme/components/MuiInputLabel.d.ts +4 -0
  193. package/esm/src/theme/components/MuiInputLabel.js +29 -0
  194. package/esm/src/theme/components/MuiOutlinedInput.d.ts +4 -0
  195. package/esm/src/theme/components/MuiOutlinedInput.js +61 -0
  196. package/esm/src/theme/components/MuiTypography.d.ts +21 -0
  197. package/esm/src/theme/components/MuiTypography.js +18 -0
  198. package/esm/src/theme/{components.d.ts → components/components.d.ts} +2 -1
  199. package/esm/src/theme/components/components.js +61 -0
  200. package/esm/src/theme/components/index.d.ts +1 -0
  201. package/esm/src/theme/components/index.js +1 -0
  202. package/esm/src/theme/elevation.js +5 -5
  203. package/esm/src/theme/palette/palette.d.ts +1 -1
  204. package/esm/src/theme/typography.js +1 -1
  205. package/package.json +11 -3
  206. package/types/index.d.ts +1 -0
  207. package/types/src/Badge/Badge.d.ts +4 -0
  208. package/types/src/Badge/index.d.ts +2 -0
  209. package/types/src/Badge/styled.d.ts +50 -0
  210. package/types/src/Badge/types.d.ts +5 -0
  211. package/types/src/Button/Button.d.ts +3 -0
  212. package/types/src/Button/index.d.ts +2 -0
  213. package/types/src/Button/styled.d.ts +13 -0
  214. package/types/src/Button/types.d.ts +7 -0
  215. package/types/src/ButtonBase/ButtonBase.d.ts +3 -0
  216. package/types/src/ButtonBase/constants.d.ts +22 -0
  217. package/types/src/ButtonBase/index.d.ts +3 -0
  218. package/types/src/ButtonBase/styled.d.ts +32 -0
  219. package/types/src/ButtonBase/types.d.ts +11 -0
  220. package/types/src/Checkbox/Checkbox.d.ts +3 -0
  221. package/types/src/Checkbox/icons.d.ts +5 -0
  222. package/types/src/Checkbox/index.d.ts +2 -0
  223. package/types/src/Checkbox/styled.d.ts +4 -0
  224. package/types/src/Checkbox/types.d.ts +2 -0
  225. package/types/src/CircularProgress/CircularProgress.d.ts +4 -0
  226. package/types/src/CircularProgress/constants.d.ts +8 -0
  227. package/types/src/CircularProgress/index.d.ts +2 -0
  228. package/types/src/CircularProgress/styled.d.ts +7 -0
  229. package/types/src/CircularProgress/types.d.ts +8 -0
  230. package/types/src/FormControlLabel/FormControlLabel.d.ts +3 -0
  231. package/types/src/FormControlLabel/index.d.ts +2 -0
  232. package/types/src/FormControlLabel/styled.d.ts +3 -0
  233. package/types/src/FormControlLabel/types.d.ts +2 -0
  234. package/types/src/FormHelperText/FormHelperText.d.ts +4 -0
  235. package/types/src/FormHelperText/index.d.ts +1 -0
  236. package/types/src/FormHelperText/styled.d.ts +41 -0
  237. package/types/src/FormHelperText/types.d.ts +6 -0
  238. package/types/src/Grid/Grid.d.ts +3 -0
  239. package/types/src/Grid/index.d.ts +2 -0
  240. package/types/src/Grid/styled.d.ts +13 -0
  241. package/types/src/Grid/types.d.ts +30 -0
  242. package/types/src/IconButton/IconButton.d.ts +3 -0
  243. package/types/src/IconButton/index.d.ts +1 -0
  244. package/types/src/IconButton/styled.d.ts +19 -0
  245. package/types/src/Menu/Menu.d.ts +3 -0
  246. package/types/src/Menu/index.d.ts +1 -0
  247. package/types/src/MenuItem/MenuItem.d.ts +3 -0
  248. package/types/src/MenuItem/index.d.ts +1 -0
  249. package/types/src/MenuList/MenuList.d.ts +3 -0
  250. package/types/src/MenuList/index.d.ts +2 -0
  251. package/types/src/MenuList/styled.d.ts +20 -0
  252. package/types/src/MenuList/types.d.ts +2 -0
  253. package/types/src/Tag/Tag.d.ts +3 -0
  254. package/types/src/Tag/constants.d.ts +21 -0
  255. package/types/src/Tag/index.d.ts +2 -0
  256. package/types/src/Tag/styled.d.ts +26 -0
  257. package/types/src/Tag/types.d.ts +12 -0
  258. package/types/src/TextField/TextField.d.ts +4 -0
  259. package/types/src/TextField/index.d.ts +2 -0
  260. package/types/src/TextField/types.d.ts +6 -0
  261. package/types/src/ThemeProvider/ThemeProvider.d.ts +7 -0
  262. package/types/src/ThemeProvider/index.d.ts +1 -0
  263. package/types/src/Typography/Typography.d.ts +8 -0
  264. package/types/src/Typography/index.d.ts +1 -0
  265. package/types/src/index.d.ts +13 -0
  266. package/types/src/styles/index.d.ts +1 -0
  267. package/types/src/styles/styled/index.d.ts +1 -0
  268. package/types/src/styles/styled/styled.d.ts +2 -0
  269. package/types/src/styles/styled/types.d.ts +48 -0
  270. package/types/src/theme/__tests__/BaseTheme.test.d.ts +1 -0
  271. package/types/src/theme/baseTheme.d.ts +28 -0
  272. package/types/src/theme/components/MuiFormHelperText.d.ts +4 -0
  273. package/types/src/theme/components/MuiFormLabel.d.ts +4 -0
  274. package/types/src/theme/components/MuiInputBase.d.ts +4 -0
  275. package/types/src/theme/components/MuiInputLabel.d.ts +4 -0
  276. package/types/src/theme/components/MuiOutlinedInput.d.ts +4 -0
  277. package/types/src/theme/components/MuiTypography.d.ts +21 -0
  278. package/types/src/theme/components/components.d.ts +21 -0
  279. package/types/src/theme/components/index.d.ts +1 -0
  280. package/types/src/theme/constants.d.ts +9 -0
  281. package/types/src/theme/elevation.d.ts +8 -0
  282. package/types/src/theme/index.d.ts +5 -0
  283. package/types/src/theme/palette/brandPalette.d.ts +15 -0
  284. package/types/src/theme/palette/index.d.ts +2 -0
  285. package/types/src/theme/palette/palette.d.ts +29 -0
  286. package/types/src/theme/shape.d.ts +6 -0
  287. package/types/src/theme/typography.d.ts +19 -0
  288. package/cjs/src/theme/components.js +0 -28
  289. package/esm/src/theme/components.js +0 -24
@@ -0,0 +1,21 @@
1
+ export declare enum TagColors {
2
+ DEFAULT = "default",
3
+ PRIMARY = "primary",
4
+ ERROR = "error",
5
+ GREY = "grey",
6
+ SUCCESS = "success",
7
+ WARNING = "warning"
8
+ }
9
+ export declare enum TagVariants {
10
+ CONTAINED = "contained",
11
+ LIGHT = "light"
12
+ }
13
+ export declare enum TagSizes {
14
+ MEDIUM = "medium",
15
+ SMALL = "small"
16
+ }
17
+ export declare enum TagStates {
18
+ DEFAULT = "default",
19
+ HOVER = "hover",
20
+ ACTIVE = "active"
21
+ }
@@ -0,0 +1,25 @@
1
+ export var TagColors;
2
+ (function (TagColors) {
3
+ TagColors["DEFAULT"] = "default";
4
+ TagColors["PRIMARY"] = "primary";
5
+ TagColors["ERROR"] = "error";
6
+ TagColors["GREY"] = "grey";
7
+ TagColors["SUCCESS"] = "success";
8
+ TagColors["WARNING"] = "warning";
9
+ })(TagColors || (TagColors = {}));
10
+ export var TagVariants;
11
+ (function (TagVariants) {
12
+ TagVariants["CONTAINED"] = "contained";
13
+ TagVariants["LIGHT"] = "light";
14
+ })(TagVariants || (TagVariants = {}));
15
+ export var TagSizes;
16
+ (function (TagSizes) {
17
+ TagSizes["MEDIUM"] = "medium";
18
+ TagSizes["SMALL"] = "small";
19
+ })(TagSizes || (TagSizes = {}));
20
+ export var TagStates;
21
+ (function (TagStates) {
22
+ TagStates["DEFAULT"] = "default";
23
+ TagStates["HOVER"] = "hover";
24
+ TagStates["ACTIVE"] = "active";
25
+ })(TagStates || (TagStates = {}));
@@ -0,0 +1,2 @@
1
+ export * from './Tag';
2
+ export * from './types';
@@ -0,0 +1,2 @@
1
+ export * from './Tag';
2
+ export * from './types';
@@ -0,0 +1,26 @@
1
+ /// <reference types="react" />
2
+ import { Theme } from '../theme';
3
+ import { TagProps } from './types';
4
+ export declare const StyledTag: import("@emotion/styled").StyledComponent<{
5
+ avatar?: import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>> | undefined;
6
+ children?: null | undefined;
7
+ classes?: Partial<import("@mui/material").ChipClasses> | undefined;
8
+ clickable?: boolean | undefined;
9
+ color?: "primary" | "secondary" | "default" | "error" | "warning" | "info" | "success" | undefined;
10
+ deleteIcon?: import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>> | undefined;
11
+ disabled?: boolean | undefined;
12
+ icon?: import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>> | undefined;
13
+ label?: import("react").ReactNode;
14
+ onDelete?: ((event: any) => void) | undefined;
15
+ size?: "medium" | "small" | undefined;
16
+ sx?: import("@mui/material").SxProps<import("@mui/material").Theme> | undefined;
17
+ variant?: "filled" | "outlined" | undefined;
18
+ } & import("@mui/material/OverridableComponent").CommonProps & Omit<Pick<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "key" | keyof import("react").HTMLAttributes<HTMLDivElement>> & {
19
+ ref?: ((instance: HTMLDivElement | null) => void) | import("react").RefObject<HTMLDivElement> | null | undefined;
20
+ }, "disabled" | "color" | keyof import("@mui/material/OverridableComponent").CommonProps | "children" | "sx" | "label" | "variant" | "size" | "icon" | "avatar" | "clickable" | "deleteIcon" | "onDelete"> & {
21
+ theme?: Theme | undefined;
22
+ } & Omit<TagProps, "color"> & {
23
+ customColor?: "primary" | "default" | "error" | "grey" | "warning" | "success" | undefined;
24
+ customVariant?: "light" | "contained" | undefined;
25
+ rounded?: boolean | undefined;
26
+ }, {}, {}>;
@@ -0,0 +1,117 @@
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 { Chip } from '@mui/material';
17
+ import { styled } from '../styles';
18
+ import { TagColors, TagStates } from './constants';
19
+ var getShape = function (_a) {
20
+ var theme = _a.theme, rounded = _a.rounded;
21
+ if (rounded)
22
+ return '100px';
23
+ return theme.shape.small;
24
+ };
25
+ var getDeleteIconBorderRadius = function (_a) {
26
+ var theme = _a.theme, rounded = _a.rounded;
27
+ if (rounded)
28
+ return '100px';
29
+ return "0 ".concat(theme.shape.small, " ").concat(theme.shape.small, " 0");
30
+ };
31
+ var getBgColor = function (_a) {
32
+ var theme = _a.theme, customColor = _a.customColor, customVariant = _a.customVariant;
33
+ if (customColor === TagColors.GREY) {
34
+ return theme.palette.grey[100];
35
+ }
36
+ var backgroundColorVariants = {
37
+ contained: {
38
+ primary: theme.palette.primary.main,
39
+ error: theme.palette.red[800],
40
+ success: theme.palette.green[800],
41
+ warning: theme.palette.yellow[800],
42
+ default: theme.palette.background.element,
43
+ },
44
+ light: {
45
+ primary: theme.palette.primary[100],
46
+ error: theme.palette.red[100],
47
+ success: theme.palette.green[100],
48
+ warning: theme.palette.yellow[100],
49
+ default: theme.palette.background.element,
50
+ },
51
+ };
52
+ if (!customVariant) {
53
+ return backgroundColorVariants.contained.primary;
54
+ }
55
+ if (customVariant && customColor) {
56
+ return backgroundColorVariants[customVariant][customColor];
57
+ }
58
+ return theme.palette.background.element;
59
+ };
60
+ var getColor = function (_a) {
61
+ var theme = _a.theme, customColor = _a.customColor, customVariant = _a.customVariant;
62
+ var textColorVariants = {
63
+ contained: {
64
+ primary: theme.palette.primary.contrastText,
65
+ error: theme.palette.error.contrastText,
66
+ success: theme.palette.warning.contrastText,
67
+ warning: theme.palette.success.contrastText,
68
+ default: theme.palette.text.primary,
69
+ },
70
+ light: {
71
+ primary: theme.palette.primary.main,
72
+ error: theme.palette.red[800],
73
+ success: theme.palette.green[800],
74
+ warning: theme.palette.yellow[800],
75
+ default: theme.palette.text.primary,
76
+ },
77
+ };
78
+ if (!customColor) {
79
+ return textColorVariants.contained.primary;
80
+ }
81
+ if (customVariant && customColor) {
82
+ return textColorVariants[customVariant][customColor];
83
+ }
84
+ return theme.palette.text.primary;
85
+ };
86
+ var getTagLabelPadding = function (_a) {
87
+ var theme = _a.theme, rounded = _a.rounded;
88
+ if (rounded)
89
+ return theme.spacing(0, 2);
90
+ return theme.spacing(0, 1);
91
+ };
92
+ var getDeleteIconBgColor = function (_a) {
93
+ var theme = _a.theme, iconState = _a.iconState;
94
+ var bgColorDeleteIcon = {
95
+ default: 'transparent',
96
+ hover: theme.palette.red[100],
97
+ active: theme.palette.red[200],
98
+ };
99
+ if (iconState) {
100
+ return bgColorDeleteIcon[iconState];
101
+ }
102
+ return 'transparent';
103
+ };
104
+ export var StyledTag = styled(Chip)(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n user-select: none;\n font-size: 14px;\n height: 20px;\n border-radius: ", ";\n background-color: ", ";\n &:hover {\n background-color: ", ";\n color: ", ";\n }\n &:active {\n background-color: ", ";\n color: ", ";\n }\n\n .MuiChip-label {\n padding: ", ";\n\n color: ", ";\n\n &:hover {\n color: ", ";\n }\n &:active {\n color: ", ";\n }\n }\n .MuiChip-deleteIcon {\n margin: 0;\n width: 20px;\n height: 20px;\n border-radius: ", ";\n\n background: ", ";\n\n &:hover {\n background: ", ";\n }\n &:active {\n background: ", ";\n }\n }\n .MuiChip-avatar {\n margin: 2px;\n width: 16px;\n height: 16px;\n }\n .MuiChip-icon {\n width: 16px;\n height: 16px;\n }\n"], ["\n user-select: none;\n font-size: 14px;\n height: 20px;\n border-radius: ", ";\n background-color: ", ";\n &:hover {\n background-color: ", ";\n color: ", ";\n }\n &:active {\n background-color: ", ";\n color: ", ";\n }\n\n .MuiChip-label {\n padding: ", ";\n\n color: ", ";\n\n &:hover {\n color: ", ";\n }\n &:active {\n color: ", ";\n }\n }\n .MuiChip-deleteIcon {\n margin: 0;\n width: 20px;\n height: 20px;\n border-radius: ", ";\n\n background: ", ";\n\n &:hover {\n background: ", ";\n }\n &:active {\n background: ", ";\n }\n }\n .MuiChip-avatar {\n margin: 2px;\n width: 16px;\n height: 16px;\n }\n .MuiChip-icon {\n width: 16px;\n height: 16px;\n }\n"])), function (props) { return getShape(__assign({}, props)); }, function (props) {
105
+ return getBgColor(__assign(__assign({}, props), { tagState: TagStates.DEFAULT }));
106
+ }, function (props) {
107
+ return getBgColor(__assign(__assign({}, props), { tagState: TagStates.HOVER }));
108
+ }, function (props) { return getColor(__assign(__assign({}, props), { tagState: TagStates.HOVER })); }, function (props) {
109
+ return getBgColor(__assign(__assign({}, props), { tagState: TagStates.ACTIVE }));
110
+ }, function (props) { return getColor(__assign(__assign({}, props), { tagState: TagStates.ACTIVE })); }, function (props) { return getTagLabelPadding(__assign({}, props)); }, function (props) { return getColor(__assign(__assign({}, props), { tagState: TagStates.DEFAULT })); }, function (props) { return getColor(__assign(__assign({}, props), { tagState: TagStates.HOVER })); }, function (props) { return getColor(__assign(__assign({}, props), { tagState: TagStates.ACTIVE })); }, function (props) { return getDeleteIconBorderRadius(__assign({}, props)); }, function (props) {
111
+ return getDeleteIconBgColor(__assign(__assign({}, props), { iconState: TagStates.DEFAULT }));
112
+ }, function (props) {
113
+ return getDeleteIconBgColor(__assign(__assign({}, props), { iconState: TagStates.HOVER }));
114
+ }, function (props) {
115
+ return getDeleteIconBgColor(__assign(__assign({}, props), { iconState: TagStates.ACTIVE }));
116
+ });
117
+ var templateObject_1;
@@ -0,0 +1,12 @@
1
+ import { ChipProps as MuiTagProps } from '@mui/material/Chip/Chip';
2
+ import { TagColors, TagSizes, TagStates, TagVariants } from './constants';
3
+ export declare type TagColor = `${TagColors}`;
4
+ export declare type TagVariant = `${TagVariants}`;
5
+ export declare type TagSize = `${TagSizes}`;
6
+ export declare type TagState = `${TagStates}`;
7
+ export declare type TagProps = Omit<MuiTagProps, 'color' | 'variant'> & {
8
+ color?: TagColor;
9
+ variant?: TagVariant;
10
+ size?: TagSize;
11
+ rounded?: boolean;
12
+ };
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,4 @@
1
+ /// <reference types="react" />
2
+ import { TextFieldProps } from './types';
3
+ export declare const TextField: (props: TextFieldProps) => JSX.Element;
4
+ export default TextField;
@@ -0,0 +1,46 @@
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 { useMemo } from 'react';
25
+ import MuiTextField from '@mui/material/TextField';
26
+ import { FormHelperText } from '../FormHelperText';
27
+ export var TextField = function (props) {
28
+ var variant = props.variant, success = props.success, error = props.error, colorProp = props.color, helperTextProp = props.helperText, restProps = __rest(props, ["variant", "success", "error", "color", "helperText"]);
29
+ var color = useMemo(function () {
30
+ if (success) {
31
+ return 'success';
32
+ }
33
+ return undefined;
34
+ }, [success]);
35
+ var helperText = useMemo(function () {
36
+ if (success) {
37
+ return _jsx(FormHelperText, __assign({ success: true }, { children: helperTextProp }), void 0);
38
+ }
39
+ if (error) {
40
+ return _jsx(FormHelperText, __assign({ error: true }, { children: helperTextProp }), void 0);
41
+ }
42
+ return helperTextProp;
43
+ }, [helperTextProp, success, error]);
44
+ return (_jsx(MuiTextField, __assign({ variant: "outlined", error: error, color: color, helperText: helperText }, restProps), void 0));
45
+ };
46
+ export default TextField;
@@ -0,0 +1,2 @@
1
+ export * from './TextField';
2
+ export * from './types';
@@ -0,0 +1,2 @@
1
+ export * from './TextField';
2
+ export * from './types';
@@ -0,0 +1,6 @@
1
+ import { TextFieldProps as MuiTextFieldProps } from '@mui/material/TextField';
2
+ export declare type TextFieldProps = Omit<MuiTextFieldProps, 'variant' | 'color'> & {
3
+ variant?: never;
4
+ color?: never;
5
+ success?: boolean;
6
+ };
@@ -0,0 +1 @@
1
+ export {};
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import { TypographyProps as MuiTypographyProps } from '@mui/material/Typography';
2
3
  import { Variant } from '@mui/material/styles/createTypography';
3
4
  export declare type TypographyProps = Omit<MuiTypographyProps, 'variant'> & {
@@ -2,7 +2,12 @@ export * from './Button';
2
2
  export * from './ButtonBase';
3
3
  export * from './IconButton';
4
4
  export * from './Badge';
5
+ export * from './Checkbox';
6
+ export * from './FormControlLabel';
5
7
  export * from './Typography';
8
+ export * from './Menu';
9
+ export * from './MenuItem';
10
+ export * from './MenuList';
6
11
  export * from './theme';
7
12
  export * from './styles';
8
13
  export * from './ThemeProvider';
package/esm/src/index.js CHANGED
@@ -2,7 +2,12 @@ export * from './Button';
2
2
  export * from './ButtonBase';
3
3
  export * from './IconButton';
4
4
  export * from './Badge';
5
+ export * from './Checkbox';
6
+ export * from './FormControlLabel';
5
7
  export * from './Typography';
8
+ export * from './Menu';
9
+ export * from './MenuItem';
10
+ export * from './MenuList';
6
11
  export * from './theme';
7
12
  export * from './styles';
8
13
  export * from './ThemeProvider';
@@ -49,6 +49,6 @@ describe('createTheme', function () {
49
49
  });
50
50
  it('Theme has elevation params', function () {
51
51
  var theme = createTheme({ brand: Brand.SIGN, fontsUrls: fontsUrls });
52
- expect(theme.elevation[100]).toBe('box-shadow: 0px 0px 1px 0px #072D574F; box-shadow: 0px 1px 1px 0px #072D5740;');
52
+ expect(theme.elevation[100]).toBe('0px 0px 1px 0px #072D574F, 0px 1px 1px 0px #072D5740;');
53
53
  });
54
54
  });
@@ -1,16 +1,17 @@
1
1
  import { Palette as MuiPalette, Theme as MuiTheme, PaletteColor, ThemeOptions } from '@mui/material/styles';
2
2
  import { TypographyThemeOptions } from './typography';
3
- import { Color } from './palette';
3
+ import { Background, Color } from './palette';
4
4
  import { FontsUrls } from './components';
5
5
  import { Brand } from './constants';
6
6
  import { Elevation } from './elevation';
7
7
  import { Shape } from './shape';
8
- export declare type Palette = Omit<MuiPalette, 'grey'> & {
8
+ export declare type Palette = Omit<MuiPalette, 'grey' | 'background'> & {
9
9
  red: Color;
10
10
  green: Color;
11
11
  yellow: Color;
12
12
  grey: Color;
13
13
  primary: PaletteColor & Color;
14
+ background: Background;
14
15
  };
15
16
  export declare type Theme = Omit<MuiTheme, 'shadows' | 'palette' | 'shape' | 'typography'> & {
16
17
  elevation: Elevation;
@@ -23,5 +24,5 @@ declare type CreateThemeParams = {
23
24
  options?: ThemeOptions;
24
25
  fontsUrls: FontsUrls;
25
26
  };
26
- export declare const createTheme: ({ brand, options, fontsUrls, }: CreateThemeParams) => Theme;
27
+ export declare const createTheme: (params: CreateThemeParams) => Theme;
27
28
  export {};
@@ -6,8 +6,8 @@ import { getComponents } from './components';
6
6
  import { SPACING } from './constants';
7
7
  import { elevation } from './elevation';
8
8
  import { shape } from './shape';
9
- export var createTheme = function (_a) {
10
- var brand = _a.brand, options = _a.options, fontsUrls = _a.fontsUrls;
9
+ export var createTheme = function (params) {
10
+ var brand = params.brand, options = params.options, fontsUrls = params.fontsUrls;
11
11
  var themeOptions = {
12
12
  typography: typography,
13
13
  spacing: SPACING,
@@ -0,0 +1,4 @@
1
+ import { Components } from '@mui/material';
2
+ import type { Theme } from '../baseTheme';
3
+ export declare const MuiFormHelperText: Components<Theme>['MuiFormHelperText'];
4
+ export default MuiFormHelperText;
@@ -0,0 +1,15 @@
1
+ export var MuiFormHelperText = {
2
+ styleOverrides: {
3
+ root: function (_a) {
4
+ var theme = _a.theme;
5
+ return {
6
+ margin: theme.spacing(1, 0, 0),
7
+ lineHeight: theme.typography.pxToRem(16),
8
+ '&.Mui-error': {
9
+ color: theme.palette.error.dark,
10
+ },
11
+ };
12
+ },
13
+ },
14
+ };
15
+ export default MuiFormHelperText;
@@ -0,0 +1,4 @@
1
+ import { Components } from '@mui/material';
2
+ import type { Theme } from '../baseTheme';
3
+ export declare const MuiFormLabel: Components<Theme>['MuiFormLabel'];
4
+ export default MuiFormLabel;
@@ -0,0 +1,11 @@
1
+ export var MuiFormLabel = {
2
+ styleOverrides: {
3
+ root: function () {
4
+ return {
5
+ position: 'relative',
6
+ transform: 'none',
7
+ };
8
+ },
9
+ },
10
+ };
11
+ export default MuiFormLabel;
@@ -0,0 +1,4 @@
1
+ import { Components } from '@mui/material';
2
+ import type { Theme } from '../baseTheme';
3
+ export declare const MuiInputBase: Components<Theme>['MuiInputBase'];
4
+ export default MuiInputBase;
@@ -0,0 +1,13 @@
1
+ export var MuiInputBase = {
2
+ styleOverrides: {
3
+ root: function (_a) {
4
+ var theme = _a.theme;
5
+ return {
6
+ '&.MuiInputBase-colorSuccess + .MuiFormHelperText-root': {
7
+ color: theme.palette.green[800],
8
+ },
9
+ };
10
+ },
11
+ },
12
+ };
13
+ export default MuiInputBase;
@@ -0,0 +1,4 @@
1
+ import { Components } from '@mui/material';
2
+ import type { Theme } from '../baseTheme';
3
+ export declare const MuiInputLabel: Components<Theme>['MuiInputLabel'];
4
+ export default MuiInputLabel;
@@ -0,0 +1,29 @@
1
+ export var MuiInputLabel = {
2
+ defaultProps: {
3
+ shrink: true,
4
+ },
5
+ styleOverrides: {
6
+ root: function (_a) {
7
+ var theme = _a.theme;
8
+ return {
9
+ position: 'relative',
10
+ transform: 'none',
11
+ color: theme.palette.grey[700],
12
+ fontWeight: theme.typography.fontWeightMedium,
13
+ fontSize: theme.typography.pxToRem(12),
14
+ lineHeight: theme.typography.pxToRem(16),
15
+ marginBottom: theme.spacing(1),
16
+ '&.Mui-focused': {
17
+ color: theme.palette.grey[700],
18
+ },
19
+ '&.Mui-error': {
20
+ color: theme.palette.grey[700],
21
+ },
22
+ '&.Mui-disabled': {
23
+ color: theme.palette.grey[600],
24
+ },
25
+ };
26
+ },
27
+ },
28
+ };
29
+ export default MuiInputLabel;
@@ -0,0 +1,4 @@
1
+ import { Components } from '@mui/material';
2
+ import type { Theme } from '../baseTheme';
3
+ export declare const MuiOutlinedInput: Components<Theme>['MuiOutlinedInput'];
4
+ export default MuiOutlinedInput;
@@ -0,0 +1,61 @@
1
+ export var MuiOutlinedInput = {
2
+ defaultProps: {
3
+ notched: false,
4
+ },
5
+ styleOverrides: {
6
+ root: function (_a) {
7
+ var theme = _a.theme;
8
+ return {
9
+ fontSize: theme.typography.pxToRem(14),
10
+ borderRadius: theme.shape.small,
11
+ color: theme.palette.grey[900],
12
+ background: theme.palette.background.element,
13
+ '&:hover': {
14
+ // FIXME: to theme
15
+ background: '#EEF1F4',
16
+ },
17
+ '&:hover .MuiOutlinedInput-notchedOutline': {
18
+ borderColor: theme.palette.grey[300],
19
+ },
20
+ '&.Mui-disabled .MuiOutlinedInput-notchedOutline': {
21
+ borderColor: theme.palette.background.element,
22
+ },
23
+ '&.Mui-error .MuiOutlinedInput-notchedOutline': {
24
+ borderColor: theme.palette.error.dark,
25
+ },
26
+ '&.Mui-focused .MuiOutlinedInput-notchedOutline': {
27
+ borderColor: theme.palette.primary[700],
28
+ },
29
+ };
30
+ },
31
+ input: function (_a) {
32
+ var theme = _a.theme;
33
+ return {
34
+ padding: theme.spacing(2.5, 2),
35
+ borderRadius: theme.shape.small,
36
+ '&:disabled': {
37
+ background: theme.palette.background.element,
38
+ },
39
+ '&::placeholder': {
40
+ opacity: 1,
41
+ color: theme.palette.grey[600],
42
+ },
43
+ };
44
+ },
45
+ inputSizeSmall: function (_a) {
46
+ var theme = _a.theme;
47
+ return {
48
+ paddingBlock: theme.spacing(2),
49
+ paddingInline: theme.spacing(1.5),
50
+ };
51
+ },
52
+ notchedOutline: function (_a) {
53
+ var theme = _a.theme;
54
+ return {
55
+ borderWidth: '2px',
56
+ borderColor: theme.palette.grey[300],
57
+ };
58
+ },
59
+ },
60
+ };
61
+ export default MuiOutlinedInput;
@@ -0,0 +1,21 @@
1
+ import { Components } from '@mui/material';
2
+ export declare type FontsUrls = {
3
+ bold: {
4
+ woff: string;
5
+ woff2: string;
6
+ };
7
+ light: {
8
+ woff: string;
9
+ woff2: string;
10
+ };
11
+ medium: {
12
+ woff: string;
13
+ woff2: string;
14
+ };
15
+ regular: {
16
+ woff: string;
17
+ woff2: string;
18
+ };
19
+ };
20
+ export declare const MuiTypography: Components['MuiTypography'];
21
+ export default MuiTypography;
@@ -0,0 +1,18 @@
1
+ export var MuiTypography = {
2
+ variants: [
3
+ {
4
+ props: { variant: 'button' },
5
+ style: {
6
+ textTransform: 'capitalize',
7
+ },
8
+ },
9
+ ],
10
+ defaultProps: {
11
+ // TODO: необходимо кастомизировать типы Components['MuiTypography']
12
+ variantMapping: {
13
+ link: 'a',
14
+ code: 'code',
15
+ },
16
+ },
17
+ };
18
+ export default MuiTypography;
@@ -1,4 +1,5 @@
1
1
  import { Components } from '@mui/material';
2
+ import type { Theme } from '../baseTheme';
2
3
  export declare type FontsUrls = {
3
4
  bold: {
4
5
  woff: string;
@@ -17,4 +18,4 @@ export declare type FontsUrls = {
17
18
  woff2: string;
18
19
  };
19
20
  };
20
- export declare const getComponents: (fontUrls: FontsUrls) => Components;
21
+ export declare const getComponents: (fontUrls: FontsUrls) => Components<Theme>;