pcm-shared-components 0.0.31 → 0.0.34

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.
@@ -4,8 +4,11 @@ import Fab from '@mui/material/Fab';
4
4
  import PropTypes from 'prop-types';
5
5
  import Tooltip from '@mui/material/Tooltip';
6
6
  import clsx from 'clsx';
7
- import '../../../styles/tailwind.css';
8
7
  import MoreVertIcon from '@mui/icons-material/MoreVert';
8
+ import { ThemeProvider } from '@mui/system';
9
+ import { createTheme } from '@mui/material/styles';
10
+ import { theme } from '../../Theme/theme';
11
+ const defaultTheme = createTheme(theme.pitchCamp);
9
12
  const useStyles = makeStyles(() => ({
10
13
  rootFabElement: {
11
14
  margin: 2,
@@ -26,6 +29,16 @@ const useStyles = makeStyles(() => ({
26
29
  color: ({
27
30
  textColor
28
31
  }) => textColor
32
+ },
33
+ Icon: {
34
+ width: ({
35
+ iconSize
36
+ }) => iconSize,
37
+ height: ({
38
+ iconSize
39
+ }) => iconSize,
40
+ marginTop: 'auto',
41
+ marginBottom: 'auto'
29
42
  }
30
43
  }));
31
44
 
@@ -39,11 +52,14 @@ const CustomFab = props => {
39
52
  backgroundColor,
40
53
  color,
41
54
  Icon,
55
+ iconSize,
42
56
  buttonText,
43
57
  iconLocation
44
58
  } = props;
45
59
  const classes = useStyles(props);
46
- return /*#__PURE__*/React.createElement(Tooltip, {
60
+ return /*#__PURE__*/React.createElement(ThemeProvider, {
61
+ theme: defaultTheme
62
+ }, /*#__PURE__*/React.createElement(Tooltip, {
47
63
  title: tooltipText,
48
64
  disableHoverListener: tooltipText && tooltipText.length === 0 ? true : false
49
65
  }, /*#__PURE__*/React.createElement(Fab, {
@@ -55,15 +71,18 @@ const CustomFab = props => {
55
71
  onClick: onClick
56
72
  }, /*#__PURE__*/React.createElement("div", {
57
73
  className: `flex ${iconLocation === 'left' ? 'flex-row' : 'flex-row-reverse'}`
58
- }, Icon && /*#__PURE__*/React.createElement(Icon, null), buttonText && buttonText.length > 0 && /*#__PURE__*/React.createElement("div", {
74
+ }, Icon && /*#__PURE__*/React.createElement(Icon, {
75
+ className: classes.Icon
76
+ }), buttonText && buttonText.length > 0 && /*#__PURE__*/React.createElement("div", {
59
77
  className: "mx-6"
60
- }, " ", buttonText))));
78
+ }, " ", buttonText)))));
61
79
  };
62
80
 
63
81
  export default /*#__PURE__*/memo(CustomFab);
64
82
  CustomFab.defaultProps = {
65
83
  onClick: () => {},
66
84
  Icon: MoreVertIcon,
85
+ iconSize: 24,
67
86
  iconLocation: 'left',
68
87
  buttonText: '',
69
88
  variant: 'circular',
@@ -84,6 +103,9 @@ CustomFab.propTypes = {
84
103
  /** Icon to be used in the button */
85
104
  Icon: PropTypes.element,
86
105
 
106
+ /** Controls the size of the icon in pixels */
107
+ iconSize: PropTypes.number,
108
+
87
109
  /** Text inside of the button */
88
110
  buttonText: PropTypes.string,
89
111
 
@@ -1,8 +1,7 @@
1
1
  import React from 'react';
2
2
  import CustomFab from '../CustomFab/CustomFab';
3
3
  import HelpOutlineIcon from '@mui/icons-material/HelpOutline';
4
- import PropTypes from 'prop-types'; // import '../../../styles/tailwind.css';
5
-
4
+ import PropTypes from 'prop-types';
6
5
  export const HelpButton = props => {
7
6
  const {
8
7
  onClickLink,
@@ -1,6 +1,5 @@
1
1
  import React from "react";
2
- import PropTypes from 'prop-types'; // import '../../../styles/tailwind.css';
3
-
2
+ import PropTypes from 'prop-types';
4
3
  export const TestButton = props => {
5
4
  const {
6
5
  text = 'hey'
@@ -2,9 +2,8 @@ import React, { useState } from 'react';
2
2
  import * as Prism from 'prismjs';
3
3
  import { memo, useEffect, useRef } from 'react';
4
4
  import './prism-languages';
5
- import PropTypes from 'prop-types'; // import '../../../styles/tailwind.css';
6
- // import '../../../styles/prism.css';
7
-
5
+ import PropTypes from 'prop-types';
6
+ import '../../../styles/prism.css';
8
7
  export const CodeHighlight = props => {
9
8
  const domNode = useRef(null);
10
9
  const source = useRef(trimCode());
package/dist/index.js CHANGED
@@ -1,3 +1,4 @@
1
+ import './styles/tailwind.css';
1
2
  import TestButton from './components/Buttons/TestButton';
2
3
  import CodeHighlight from './components/Tools/CodeHighlight/CodeHighlight';
3
4
  import CustomFab from './components/Buttons/CustomFab/CustomFab';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pcm-shared-components",
3
- "version": "0.0.31",
3
+ "version": "0.0.34",
4
4
  "private": false,
5
5
  "main": "dist/index.js",
6
6
  "babel": {