@symply.io/basic-components 1.0.0-alpha.6 → 1.0.0-alpha.7

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 (55) hide show
  1. package/AlertDialog/index.d.ts +3 -2
  2. package/AlertDialog/index.js +10 -10
  3. package/AlertDialog/types.d.ts +3 -1
  4. package/BasicModal/index.d.ts +3 -2
  5. package/BasicModal/index.js +19 -19
  6. package/BasicModal/types.d.ts +3 -1
  7. package/DigitInput/index.d.ts +5 -2
  8. package/DigitInput/index.js +8 -6
  9. package/DigitInput/types.d.ts +3 -0
  10. package/DynamicHeaderBar/HeaderBar.d.ts +4 -2
  11. package/DynamicHeaderBar/HeaderBar.js +8 -8
  12. package/DynamicHeaderBar/HeaderButtons.d.ts +2 -2
  13. package/DynamicHeaderBar/HeaderButtons.js +21 -21
  14. package/DynamicHeaderBar/HeaderLine.d.ts +6 -3
  15. package/DynamicHeaderBar/HeaderLine.js +3 -4
  16. package/FormRadioGroup/index.d.ts +3 -2
  17. package/FormRadioGroup/index.js +16 -14
  18. package/FormRadioGroup/types.d.ts +3 -0
  19. package/FormSelector/MultipleSelector.d.ts +3 -2
  20. package/FormSelector/MultipleSelector.js +15 -13
  21. package/FormSelector/SimpleSelector.d.ts +3 -2
  22. package/FormSelector/SimpleSelector.js +15 -13
  23. package/FormSelector/types.d.ts +3 -1
  24. package/HelpCaption/index.d.ts +5 -3
  25. package/HelpCaption/index.js +16 -16
  26. package/LoadingModal/index.d.ts +3 -2
  27. package/LoadingModal/index.js +9 -7
  28. package/LoadingModal/types.d.ts +3 -0
  29. package/MenuButtonGroup/MenuItem.d.ts +2 -2
  30. package/MenuButtonGroup/MenuItem.js +5 -3
  31. package/MenuButtonGroup/index.d.ts +5 -3
  32. package/MenuButtonGroup/index.js +8 -6
  33. package/NumberInput/index.d.ts +7 -3
  34. package/NumberInput/index.js +9 -7
  35. package/PasswordInput/ConfirmPassword.d.ts +7 -3
  36. package/PasswordInput/ConfirmPassword.js +8 -6
  37. package/PasswordInput/Password.d.ts +6 -2
  38. package/PasswordInput/Password.js +10 -8
  39. package/PhoneNumberInput/index.d.ts +7 -3
  40. package/PhoneNumberInput/index.js +9 -7
  41. package/TabGroup/index.d.ts +3 -2
  42. package/TabGroup/index.js +19 -19
  43. package/TabGroup/types.d.ts +3 -0
  44. package/TextInput/index.d.ts +6 -3
  45. package/TextInput/index.js +9 -7
  46. package/ToastPrompt/Presentation.d.ts +16 -3
  47. package/ToastPrompt/Presentation.js +21 -21
  48. package/VideoPlayerModal/index.d.ts +4 -2
  49. package/VideoPlayerModal/index.js +9 -9
  50. package/VideoPlayerModal/types.d.ts +3 -0
  51. package/package.json +2 -1
  52. package/useCustomTheme.d.ts +6 -0
  53. package/useCustomTheme.js +51 -0
  54. package/withTheme.d.ts +0 -3
  55. package/withTheme.js +0 -35
@@ -1,8 +1,11 @@
1
+ import { CSSProperties } from "react";
1
2
  import { ButtonProps } from "@mui/material/Button";
2
3
  export interface VideoPlayerModalProps {
3
4
  title?: string;
4
5
  open: boolean;
5
6
  pip?: boolean;
6
7
  extraButtons?: Array<ButtonProps>;
8
+ primaryColor?: CSSProperties["color"];
9
+ secondaryColor?: CSSProperties["color"];
7
10
  onClose: () => void;
8
11
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@symply.io/basic-components",
3
- "version": "1.0.0-alpha.6",
3
+ "version": "1.0.0-alpha.7",
4
4
  "description": "Basic and reusable components for all frontend of Symply apps",
5
5
  "keywords": [
6
6
  "react",
@@ -55,6 +55,7 @@
55
55
  "@mui/icons-material": "^5.4.2",
56
56
  "@mui/material": "^5.4.2",
57
57
  "@mui/system": "^5.4.2",
58
+ "color-alpha": "^1.1.3",
58
59
  "react-player": "^2.9.0",
59
60
  "rifm": "^0.12.1"
60
61
  },
@@ -0,0 +1,6 @@
1
+ import { CSSProperties } from "react";
2
+ declare function useCustomTheme(props?: {
3
+ primaryColor?: CSSProperties["color"];
4
+ secondaryColor?: CSSProperties["color"];
5
+ }): import("@mui/material/styles").Theme;
6
+ export default useCustomTheme;
@@ -0,0 +1,51 @@
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 colorAlpha from "color-alpha";
13
+ import { createTheme } from "@mui/material/styles";
14
+ function useCustomTheme(props) {
15
+ var _a = props || {}, primaryColor = _a.primaryColor, secondaryColor = _a.secondaryColor;
16
+ var themeOptions = {
17
+ components: {
18
+ MuiButton: {
19
+ styleOverrides: {
20
+ root: {
21
+ whiteSpace: "nowrap",
22
+ fontWeight: 600,
23
+ fontFamily: "Dinpro"
24
+ }
25
+ }
26
+ }
27
+ },
28
+ typography: {
29
+ fontFamily: "Dinpro"
30
+ }
31
+ };
32
+ if (primaryColor) {
33
+ themeOptions = __assign(__assign({}, themeOptions), { palette: {
34
+ primary: {
35
+ main: primaryColor,
36
+ light: colorAlpha(primaryColor, 0.08)
37
+ }
38
+ } });
39
+ }
40
+ if (secondaryColor) {
41
+ themeOptions = __assign(__assign({}, themeOptions), { palette: {
42
+ secondary: {
43
+ main: secondaryColor,
44
+ light: colorAlpha(secondaryColor, 0.08)
45
+ }
46
+ } });
47
+ }
48
+ var theme = createTheme(themeOptions);
49
+ return theme;
50
+ }
51
+ export default useCustomTheme;
package/withTheme.d.ts DELETED
@@ -1,3 +0,0 @@
1
- import React from 'react';
2
- declare const withTheme: (Component: React.ElementType) => (props: any) => JSX.Element;
3
- export default withTheme;
package/withTheme.js DELETED
@@ -1,35 +0,0 @@
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 { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
13
- import { createTheme, ThemeProvider } from '@mui/material/styles';
14
- import CssBaseline from '@mui/material/CssBaseline';
15
- var theme = createTheme({
16
- components: {
17
- MuiButton: {
18
- styleOverrides: {
19
- root: {
20
- whiteSpace: 'nowrap',
21
- fontWeight: 600,
22
- fontFamily: 'Dinpro'
23
- }
24
- }
25
- }
26
- },
27
- typography: {
28
- fontFamily: 'Dinpro'
29
- }
30
- });
31
- var withTheme = function (Component) {
32
- var CustomComponent = function (props) { return (_jsxs(ThemeProvider, __assign({ theme: theme }, { children: [_jsx(CssBaseline, {}, void 0), _jsx(Component, __assign({}, props), void 0)] }), void 0)); };
33
- return CustomComponent;
34
- };
35
- export default withTheme;