@capillarytech/blaze-ui 0.1.6-alpha.36 → 0.1.6-alpha.37
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/CapUnifiedSelect/CapUnifiedSelect.js +1 -1
- package/index.js +1 -1
- package/package.json +1 -1
- package/utils/index.js +1 -0
- package/utils/withStyles.js +24 -0
|
@@ -8,7 +8,7 @@ import uploadIcon from '../assets/upload.svg';
|
|
|
8
8
|
|
|
9
9
|
import { InfoCircleOutlined, SearchOutlined, WarningFilled, DownOutlined } from '@ant-design/icons';
|
|
10
10
|
|
|
11
|
-
import withStyles from '
|
|
11
|
+
import withStyles from '../utils/withStyles';
|
|
12
12
|
import { SelectWrapper, HeaderWrapper, selectStyles } from './styles';
|
|
13
13
|
|
|
14
14
|
const CapUnifiedSelect = ({
|
package/index.js
CHANGED
package/package.json
CHANGED
package/utils/index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as withStyles } from './withStyles';
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import styled from 'styled-components';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Enhances a React component with additional styles using styled-components.
|
|
5
|
+
* @param {React.ComponentType} WrappedComponent - The React component to enhance.
|
|
6
|
+
* @param {TemplateStringsArray} styles - CSS styles as a TemplateStringsArray.
|
|
7
|
+
* @returns {React.ComponentType} Returns the enhanced styled component.
|
|
8
|
+
*/
|
|
9
|
+
const withStyledComponent = (WrappedComponent, styles) => {
|
|
10
|
+
/**
|
|
11
|
+
* A styled component generated by combining WrappedComponent with additional styles.
|
|
12
|
+
* @type {React.ComponentType}
|
|
13
|
+
*/
|
|
14
|
+
const StyledComponent = styled(WrappedComponent)`
|
|
15
|
+
${styles};
|
|
16
|
+
`;
|
|
17
|
+
|
|
18
|
+
// Set default props from the original component to the styled component
|
|
19
|
+
StyledComponent.defaultProps = WrappedComponent.defaultProps;
|
|
20
|
+
|
|
21
|
+
return StyledComponent;
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
export default withStyledComponent;
|